-
Notifications
You must be signed in to change notification settings - Fork 6
fix(loop-memory): freeze merge-bound evidence #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fa73182
fix(loop-memory): freeze merge-bound evidence
Abiorh001 e357e8f
docs(loop-memory): record 00r3 review evidence
Abiorh001 0498803
test(loop-memory): close merge evidence coverage
Abiorh001 2ffc344
test(loop-memory): cover protected recovery branches
Abiorh001 8de627e
test(loop-memory): cover shared reducer cli
Abiorh001 3f72645
test(loop-memory): cross literal coverage floor
Abiorh001 f83eaec
docs(loop-memory): bind final 00r3 evidence
Abiorh001 4a3eee7
fix(loop-memory): centralize historical recovery gate
Abiorh001 c739a00
docs(loop-memory): record external review repairs
Abiorh001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...nt-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/DECISIONS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
.agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/STATUS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| # STATUS: WS-ENG-007 - Concurrent PR Review Reconciliation | ||
|
|
||
| - Phase: canonical check-evidence recovery | ||
| - Phase: merge-bound check-evidence recovery | ||
| - Gate: fail-closed automation repair | ||
| - Active planning chunk: none | ||
| - Active implementation chunk: none | ||
| - Completed but unreconciled recovery chunk: `WS-ENG-007-00R1` | ||
| - Proposed recovery chunk: `WS-ENG-007-00R2` | ||
| - Merged but unreconciled recovery chunk: `WS-ENG-007-00R2` | ||
| - Active recovery chunk: `WS-ENG-007-00R3` | ||
| - Proposed implementation successor after recovery: `WS-ENG-007-01` | ||
| - Separate explicit start required: true | ||
| - Current gate: PR #188 merged at | ||
| `c65633f8f0991dbefe7b0635e053aab0df8f9af8`. Its tree normalization repair is | ||
| correct, but signed reconciliation still fails because PR #187 has two | ||
| successful trusted `agent-gates` reruns and planning intake incorrectly | ||
| treats repeated check evidence as ambiguous. Signed state remains at | ||
| `73b457925b02301587b83d01ced0adb66319d134`; no successor is active. | ||
| - Current gate: PRs #187–#189 are merged, but signed reconciliation still fails | ||
| because mutable post-merge check history is re-evaluated and the explicit | ||
| start workflow lacks the merge workflow's recovery path. Signed state remains | ||
| at `73b457925b02301587b83d01ced0adb66319d134`; no successor is active. | ||
| - Review gate: all required internal tracks passed reviewed implementation | ||
| `4a3eee7fdd80970675ae2574542073b8a92e1ef9`; awaiting external checks and the | ||
| user-owned merge decision. |
140 changes: 140 additions & 0 deletions
140
...r-review-reconciliation/chunks/WS-ENG-007-00R3-merge-bound-evidence-recovery.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| # Chunk Contract: WS-ENG-007-00R3 — Merge-Bound Evidence Recovery | ||
|
|
||
| ## Parent initiative | ||
|
|
||
| `WS-ENG-007` — Concurrent PR Review Reconciliation | ||
|
|
||
| ## Goal | ||
|
|
||
| Restore signed reconciliation and explicit starts without allowing mutable | ||
| post-merge check reruns to rewrite the evidence accepted for an already merged | ||
| PR. | ||
|
|
||
| ## Why this chunk exists | ||
|
|
||
| PRs #187–#189 are on protected `main`, but signed memory remains at PR #178. | ||
| The recovery path re-queries mutable check history, rejects later rerun shapes, | ||
| and exists only in the merge workflow. PR #189 also merged without completed | ||
| pre-merge `agent-gates` evidence. Consequently an ordinary explicit start cannot | ||
| reconcile the same trusted history and unrelated ENG-006 work is blocked. | ||
|
|
||
| ## Risk class | ||
|
|
||
| L1 / P0 reliability repair. | ||
|
|
||
| ## Start phase | ||
|
|
||
| Recovery implementation. This contract records the exact fail-closed repair | ||
| needed to restore the signed start mechanism that is itself unavailable. | ||
|
|
||
| ## Allowed files | ||
|
|
||
| ```text | ||
| .github/workflows/loop-memory.yml | ||
| .github/workflows/loop-memory-start.yml | ||
| scripts/update_post_merge_memory.py | ||
| scripts/check_loop_memory_state.py | ||
| scripts/test_update_post_merge_memory.py | ||
| scripts/test_check_loop_memory_state.py | ||
| scripts/test_agent_gates.py | ||
| docs/operations_post_merge_memory.md | ||
| .agent-loop/policies/loop-memory-recovery.json | ||
| .agent-loop/initiatives/WS-ENG-007-concurrent-pr-review-reconciliation/** | ||
| .agent-loop/merge-intents/WS-ENG-007-00R3.json | ||
| ``` | ||
|
|
||
| ## Not allowed | ||
|
|
||
| ```text | ||
| application, API, database, product, auth, payment, or coverage changes | ||
| repository permissions, secrets, branch protection, or cancel authority changes | ||
| weakening required checks, signed starts, internal review, or human merge approval | ||
| any wildcard, reusable, reorderable, or persistent recovery exception | ||
| automatic successor starts | ||
| ``` | ||
|
|
||
| ## Acceptance criteria | ||
|
|
||
| - [ ] For each protected name, classify every candidate against immutable | ||
| `merged_at`; ignore only candidates started after the merge. Select the | ||
| latest candidate started no later than the merge by normalized RFC3339 | ||
| instant and positive unique ID, and require it to have completed | ||
| successfully no later than the merge. An older success cannot hide a | ||
| newer eligible failure or incomplete run. | ||
| - [ ] Malformed timestamps or identities that prevent trustworthy boundary | ||
| classification, incomplete pagination, forged app, wrong head, duplicate | ||
| ID, non-successful selected evidence, and ambiguity fail closed. | ||
| - [ ] Check retrieval is completely paginated with deterministic deduplication, | ||
| explicit page/item bounds, and rejection of total drift, overlap, or bound | ||
| exhaustion. More than 100 later reruns cannot hide eligible evidence. | ||
| - [ ] Signed merge records persist selected run ID, protected name, head SHA, | ||
| pinned app, normalized start/completion instants, conclusion, merge cutoff, | ||
| and a canonical evidence digest; the independent checker validates them. | ||
| - [ ] CodeRabbit remains supplementary external evidence and is not converted | ||
| into signed start or merge authority. | ||
| - [ ] Merge reconciliation and explicit-start reconciliation use one shared, | ||
| deterministic recovery sequence and consume the recovery inventory before | ||
| signing or publishing. | ||
| - [ ] A schema-v4 closed recovery certificate binds signed basis | ||
| `73b457925b02301587b83d01ced0adb66319d134`, exact PR #187 / `PLAN` / | ||
| `8928ba80…`, PR #188 / `00R1` / `c65633f8…`, PR #189 / `00R2` / | ||
| `d3321698…`, and direct-next activation `00R3`. It requires exact adjacent | ||
| order `[8928ba8…, c65633f…, d332169…, target]` and a four-entry bounded | ||
| ephemeral transport. All entries are consumed before signing and none is | ||
| serialized or reusable. | ||
| - [ ] Protected merge-bound evidence is required for PRs #187, #188, and the | ||
| new `00R3` activation PR. Only exact historical PR #189 may carry the | ||
| closed `historical-recovery-only` evidence mode: its exact merge/head/chunk, | ||
| absence reason, and certificate digest are independently validated. That | ||
| mode is impossible for `00R3` or any future merge. | ||
| - [ ] Policy v4 has exactly `schema_version`, `signed_basis`, `activation`, and | ||
| three ordered `recovered_merges`; transport v3 has exactly four | ||
| chronological unique identities. Policy/transport v1 and v2 bounds remain | ||
| unchanged. Unknown keys, basis mismatch, collisions, 0–3/5 entries, | ||
| reordering, wrong parents, and legacy-version widening reject. | ||
| - [ ] Once history is reconciled, distinct idle initiatives can start | ||
| independently and a later rerun on an older PR cannot block them. | ||
| - [ ] Repeated reconciliation and repeated start dispatch remain idempotent or | ||
| fail closed with a stable, actionable error. | ||
| - [ ] Both workflows call one shared reconciliation implementation in this | ||
| order: plan, prepare recovery, update every merge with the same inventory, | ||
| assert consumption, then sign/publish or apply the start. Failure publishes | ||
| neither partial state nor authority event. | ||
| - [ ] Exactly one schema-v2 merge intent names `WS-ENG-007-01` with | ||
| `next_requires_explicit_start: true`; ENG-006 and ENG-007 successors remain | ||
| inactive after recovery. | ||
|
|
||
| ## Verification commands | ||
|
|
||
| ```bash | ||
| PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q scripts/test_update_post_merge_memory.py scripts/test_check_loop_memory_state.py scripts/test_agent_gates.py | ||
| python3 scripts/check_markdown_links.py | ||
| python3 scripts/check_stale_workstream_wording.py | ||
| python3 scripts/update_post_merge_memory.py validate-merge-intent --repository-root . --base-ref origin/main | ||
| git diff --check origin/main...HEAD | ||
| ``` | ||
|
|
||
| ## Required reviewers | ||
|
|
||
| - senior engineering | ||
| - QA/test | ||
| - security/auth | ||
| - product/ops | ||
| - architecture | ||
| - CI integrity | ||
| - docs | ||
| - reuse/dedup | ||
| - test delta | ||
|
|
||
| ## Human review focus | ||
|
|
||
| - Is historical evidence frozen at the merge boundary without accepting a | ||
| failing or untrusted pre-merge run? | ||
| - Can the explicit-start path reconcile exactly as safely as the merge path? | ||
| - Does this remove the global mutable-history lock without weakening the | ||
| initiative-local signed-start rule? | ||
|
|
||
| ## Stop conditions | ||
|
|
||
| Stop if the repair requires weakening protected checks, adding a new historical | ||
| PR exemption, changing GitHub authority, or allowing unsigned implementation. |
36 changes: 36 additions & 0 deletions
36
...nt-pr-review-reconciliation/reviews/WS-ENG-007-00R3-external-review-response.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # External Review Response: WS-ENG-007-00R3 | ||
|
|
||
| ## Comments addressed | ||
|
|
||
| - Added an explicit statement that the `eng006_*` reviewer sessions were | ||
| inherited and reassigned to this exact ENG-007 review. | ||
| - Extended the shared-reconciliation test to prove only exact PR #189 is | ||
| collected with `historical_recovery=True`. | ||
| - Extracted the duplicated PR #189 predicate into | ||
| `_is_r3_historical_recovery()` and reused it in both production call sites. | ||
| - Expanded the PR description to expose the complete trust-bundle sections. | ||
|
|
||
| ## Comments deferred | ||
|
|
||
| - CodeRabbit's docstring-coverage warning is stale. The authoritative backend | ||
| preflight ran the repository docstring gate successfully on the exact PR head. | ||
| - Usage-limit notices are service availability metadata, not code findings. | ||
|
|
||
| ## Human decisions needed | ||
|
|
||
| None. All valid comments are in scope and addressed without changing authority. | ||
|
|
||
| ## Commands rerun | ||
|
|
||
| ```bash | ||
| PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q scripts/test_update_post_merge_memory.py -k 'shared_reconcile_orders or historical_recovery' | ||
| python3 scripts/test_agent_gates.py | ||
| PR_HEAD_SHA="$(git rev-parse HEAD)" python3 scripts/check_internal_review_evidence.py | ||
| python3 scripts/check_markdown_links.py | ||
| git diff --check origin/main...HEAD | ||
| ``` | ||
|
|
||
| ## Remaining risks | ||
|
|
||
| CodeRabbit may remain rate-limited. Internal reviews and repository checks remain | ||
| the blocking evidence; CodeRabbit is supplementary under repository policy. |
80 changes: 80 additions & 0 deletions
80
...nt-pr-review-reconciliation/reviews/WS-ENG-007-00R3-internal-review-evidence.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Internal Review Evidence: WS-ENG-007-00R3 | ||
|
|
||
| ## Chunk | ||
|
|
||
| `WS-ENG-007-00R3` — Merge-Bound Evidence Recovery | ||
|
|
||
| open sub-agent sessions: none | ||
|
|
||
| valid findings addressed: yes | ||
|
|
||
| ## Reviewed Revision | ||
|
|
||
| Reviewed code SHA: 4a3eee7fdd80970675ae2574542073b8a92e1ef9 | ||
|
|
||
| Reviewed at: 2026-07-23T10:30:00Z | ||
|
|
||
| The `/root/eng006_*` sessions were inherited from the ENG-006 reviewer pool and | ||
| explicitly reassigned to this WS-ENG-007-00R3 review. Every track is rebound to | ||
| the exact reviewed implementation SHA below; the session name grants no | ||
| cross-initiative authority. | ||
|
|
||
| Reviewer run IDs: senior-engineering=/root/eng006_senior_arch_docs; QA/test=/root/eng006_qa_ci_tests; security/auth=/root/eng006_security_ops_reuse; product/ops=/root/eng006_security_ops_reuse; architecture=/root/eng006_senior_arch_docs; docs=/root/eng006_senior_arch_docs; CI-integrity=/root/eng006_qa_ci_tests; reuse/dedup=/root/eng006_security_ops_reuse; test-delta=/root/eng006_qa_ci_tests | ||
|
|
||
| ## Reviewer Results | ||
|
|
||
| | Reviewer | Result | Blocking findings | Notes | | ||
| |---|---:|---|---| | ||
| | senior engineering | PASS AFTER FIXES | None | Merge cutoff and recovery architecture accepted. | | ||
| | QA/test | PASS AFTER FIXES | None | CodeRabbit is supplementary; proof matrix accepted. | | ||
| | security/auth | PASS AFTER FIXES | None | Exact one-use authority and replay boundaries accepted. | | ||
| | product/ops | PASS | None | No product lifecycle behavior changed. | | ||
| | architecture | PASS AFTER FIXES | None | One shared reconciliation reducer. | | ||
| | CI integrity | PASS AFTER FIXES | None | No CI, coverage, or required-check weakening. | | ||
| | docs | PASS AFTER FIXES | None | Runbook and durable artifacts aligned. | | ||
| | reuse/dedup | PASS AFTER FIXES | None | Workflow duplication removed. | | ||
| | test delta | PASS AFTER FIXES | None | Cutoff, pagination, checker, certificate, and reducer tests added. | | ||
|
|
||
| ## Valid Findings Addressed | ||
|
|
||
| - Filtered classifiable post-merge reruns before validating eligible protected | ||
| evidence, and removed the redundant mutable planning-intake validator. | ||
| - Removed CodeRabbit from planning and recovery authority while retaining it as | ||
| diagnostic external evidence. | ||
| - Persisted and independently validated exact protected-run provenance with a | ||
| strict merge cutoff and canonical RFC3339 timestamps. | ||
| - Bound PR #189's sole recovery-only mode to its exact PR, merge, head, chunk, | ||
| signed basis, activation, policy schema, reason, and certificate digest. | ||
| - Added bounded complete pagination with stable totals and global ID overlap | ||
| rejection. | ||
| - Replaced duplicated YAML reducers with one atomic `reconcile` command shared | ||
| by merge and explicit-start workflows. | ||
| - Added cutoff poisoning, pagination drift, mandatory-cutover, strict timestamp, | ||
| certificate mutation, and shared-reducer tests. | ||
|
|
||
| ## Commands Run | ||
|
|
||
| ```bash | ||
| PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q scripts/test_update_post_merge_memory.py scripts/test_check_loop_memory_state.py | ||
| python3 scripts/test_agent_gates.py | ||
| python3 scripts/check_markdown_links.py | ||
| python3 scripts/check_stale_workstream_wording.py | ||
| git diff --check origin/main...HEAD | ||
| python3 -m py_compile scripts/update_post_merge_memory.py scripts/check_loop_memory_state.py | ||
| ``` | ||
|
|
||
| Final exact-head verification passed 278 updater-gate tests at 90.10 percent | ||
| branch coverage and the independent checker at 90.41 percent. Agent Gates | ||
| passed all 98 standalone scenarios. All reviewer tracks reapproved exact head | ||
| `4a3eee7fdd80970675ae2574542073b8a92e1ef9` after the CodeRabbit repairs. | ||
|
|
||
| ## Remaining Risks | ||
|
|
||
| The schema-v4 bridge is intentionally exact. Any intervening protected-main | ||
| merge before this chunk invalidates adjacency and requires a freshly reviewed | ||
| certificate rather than reinterpretation. | ||
|
|
||
| ## Stop Condition | ||
|
|
||
| No successor is active. ENG-006 documentation work and ENG-007-01 each require | ||
| their ordinary explicit signed start after successful reconciliation. | ||
43 changes: 43 additions & 0 deletions
43
...-concurrent-pr-review-reconciliation/reviews/WS-ENG-007-00R3-pr-trust-bundle.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # PR Trust Bundle: WS-ENG-007-00R3 | ||
|
|
||
| ## Intent | ||
|
|
||
| Restore signed loop-memory reconciliation without allowing mutable post-merge | ||
| reruns to block unrelated initiatives or rewrite accepted merge evidence. | ||
|
|
||
| ## Scope | ||
|
|
||
| - Freeze protected `agent-gates` and backend `test` evidence at PR merge time. | ||
| - Persist selected-run provenance in signed records. | ||
| - Recover exact PRs #187–#189 plus this activation once from signed PR #178. | ||
| - Use one atomic reconciliation reducer in merge and explicit-start workflows. | ||
|
|
||
| ## Reviewed Revision | ||
|
|
||
| `4a3eee7fdd80970675ae2574542073b8a92e1ef9` | ||
|
|
||
| ## CI Integrity | ||
|
|
||
| - No test, coverage floor, required reviewer, human merge checkpoint, or signed | ||
| start rule was removed or weakened. | ||
| - CodeRabbit remains supplementary external evidence. | ||
| - Both workflows fail before signing, publication, or authority application if | ||
| reconciliation or recovery consumption fails. | ||
|
|
||
| ## Reviewer Result | ||
|
|
||
| All nine required internal tracks passed after fixes. No Critical or High | ||
| finding remains open. | ||
|
|
||
| ## Human Review Focus | ||
|
|
||
| - Confirm only exact historical PR #189 receives recovery-only evidence. | ||
| - Confirm the new activation PR still requires ordinary protected evidence. | ||
| - Confirm both workflows invoke the same `reconcile` command before authority or | ||
| publication. | ||
| - Confirm the four-entry bridge is exact, consumed, and non-reusable. | ||
|
|
||
| ## Remaining Risk | ||
|
|
||
| An intervening `main` merge invalidates the exact recovery bridge and must fail | ||
| closed. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.