Skip to content

fix(loop-memory): repair planning intake tree reconciliation#188

Merged
abiorh-claw merged 7 commits into
mainfrom
codex/ws-eng-007-00r1-planning-intake-tree-repair
Jul 23, 2026
Merged

fix(loop-memory): repair planning intake tree reconciliation#188
abiorh-claw merged 7 commits into
mainfrom
codex/ws-eng-007-00r1-planning-intake-tree-repair

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

PR Trust Bundle: WS-ENG-007-00R1

Goal

Repair the signed planning-intake reconciliation failure without weakening
ordinary start authority or changing workflow permissions.

Root Cause And Fix

GitHub's recursive tree API included six directory objects in PR #187's
19-entry tree response, while the PR inventory and independent git ls-tree -r
checker correctly contained 13 leaf files. The updater now validates the full
response, rejects malformed or ambiguous prefix structure, and excludes only
exact tree/040000 directory entries from the canonical leaf map.

Recovery Boundary

The one-use certificate names only PR #187, merge
8928ba80eeaf31e609dbdeda7d2cc22e9ea482c8, WS-ENG-007-PLAN, and the direct
next merge WS-ENG-007-00R1. Both temporary exemptions are consumed before
signing and never persist. Replay, wrong identity, wrong order, intervening
merge, partial consumption, or failed required checks fails closed.

Evidence

  • 217 focused updater, agent-gate, and independent-checker tests passed.
  • 97 manual agent-gate tests passed.
  • Merge intent, Markdown links, stale wording, and diff checks passed.
  • All nine required internal review tracks passed exact code SHA
    c620610e20061b9755c825ed2dc1f89ba80bef4a after findings were repaired.
  • No workflow, coverage threshold, dependency, secret, permission, signing key,
    branch protection, product lifecycle, or human merge authority changed.

Human Review Focus

Confirm canonical tree comparison excludes only validated directory entries,
the production recovery identities are exact, and recovery cannot start either
successor.

Human Merge Ownership

Only the user may approve and merge this PR. Because recovery is adjacency
bound, no other PR may merge first. After successful post-merge reconciliation,
WS-ENG-007-01 and WS-ENG-006-01 still require separate explicit signed
starts.

Summary by CodeRabbit

  • Bug Fixes

    • Improved planning-history recovery after repository tree data contains unexpected or incomplete entries.
    • Added stricter validation to prevent ambiguous, duplicate, malformed, or conflicting file records from being accepted.
    • Added a narrowly scoped recovery path for a previously merged change, with safeguards preventing reuse as a general bypass.
  • Documentation

    • Updated operational guidance, recovery requirements, review evidence, status tracking, and release sequencing.
    • Clarified that follow-up work remains stopped until separately and explicitly authorized.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Abiorh001, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d9fbcb5-bed3-4092-bca4-9734efaa75f8

📥 Commits

Reviewing files that changed from the base of the PR and between ae1a4c6 and 40aa543.

📒 Files selected for processing (5)
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/DECISIONS.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/RISKS.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-external-review-response.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-internal-review-evidence.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-pr-trust-bundle.md
📝 Walkthrough

Walkthrough

This PR adds the WS-ENG-007-00R1 planning-intake recovery contract, strengthens recursive Git tree canonicalization, updates recovery policy and manifests, expands gate regression coverage, and records review evidence while keeping successor chunks stopped pending explicit signed starts.

Changes

WS-ENG-007 Planning-Intake Recovery

Layer / File(s) Summary
Recovery contract and workflow state
.agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/*, docs/operations_post_merge_memory.md
Defines WS-ENG-007-00R1, exact PR 187 recovery ordering, fail-closed validation rules, consumed exemptions, and the blocked successor state.
Recursive tree canonicalization and intake validation
scripts/update_post_merge_memory.py, scripts/test_agent_gates.py
Rejects unsafe or conflicting tree paths and expands fixtures and negative tests for recursive directory, mode, provenance, and delta validation.
Recovery wiring and verification evidence
.agent-loop/merge-intents/*, .agent-loop/policies/*, scripts/test_agent_gates.py, .agent-loop/.../reviews/*
Pins manifests and recovery policy to WS-ENG-007, replaces the prior recovery regression scenario, and records review results and verification commands.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub
  participant PlanningIntake
  participant RecoveryPolicy
  participant SignedMemory
  GitHub->>PlanningIntake: return recursive tree and PR file data
  PlanningIntake->>PlanningIntake: canonicalize leaves and validate deltas
  PlanningIntake->>RecoveryPolicy: verify pinned PR 187 and 00R1 sequence
  RecoveryPolicy->>SignedMemory: consume ephemeral recovery authority
  SignedMemory-->>PlanningIntake: preserve stopped successor chunks
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers goal, root cause, recovery boundary, evidence, and review focus, but omits required template sections like Chunk, merge intent, and test delta. Add the missing template sections, especially Chunk/merge-intent details, What Changed, Evidence commands/result summary, Acceptance Criteria Proof, Test Delta, and reviewer results.
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed It clearly summarizes the main fix: repairing planning-intake tree reconciliation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ws-eng-007-00r1-planning-intake-tree-repair

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
@.agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/DECISIONS.md:
- Around line 60-62: Update the paragraph in DECISIONS.md so the PR `#187`
reference is not placed at the start of the line; keep the literal “PR `#187`”
wording while joining or reflowing the sentence to avoid Markdown interpreting
`#187` as a heading.

In
@.agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/RISKS.md:
- Line 13: Update the “Planning intake cannot enter signed history” mitigation
in RISKS.md to limit preservation to validated, supported non-tree leaf entries
rather than every non-tree identity, while retaining the requirement to filter
directory entries from the GitHub recursive tree map and recover PR `#187` plus
00R1 through the consumed two-merge certificate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 09205d7e-64ef-4305-8b59-19c82286444b

📥 Commits

Reviewing files that changed from the base of the PR and between 8928ba8 and ae1a4c6.

📒 Files selected for processing (13)
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/CHUNK_MAP.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/DECISIONS.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/RISKS.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/STATUS.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/chunks/WS-ENG-007-00R1-planning-intake-tree-recovery.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-external-review-response.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-internal-review-evidence.md
  • .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R1-pr-trust-bundle.md
  • .agent-loop/merge-intents/WS-ENG-007-00R1.json
  • .agent-loop/policies/loop-memory-recovery.json
  • docs/operations_post_merge_memory.md
  • scripts/test_agent_gates.py
  • scripts/update_post_merge_memory.py

Comment thread .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/RISKS.md Outdated
@abiorh-claw
abiorh-claw self-requested a review July 23, 2026 06:23
@abiorh-claw
abiorh-claw merged commit c65633f into main Jul 23, 2026
9 checks passed
@abiorh-claw
abiorh-claw deleted the codex/ws-eng-007-00r1-planning-intake-tree-repair branch July 23, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants