From d55c9b14bb867521d4d529622fc31a425535b45d Mon Sep 17 00:00:00 2001 From: Abiorh001 Date: Sun, 16 Aug 2026 05:47:58 +0100 Subject: [PATCH 1/4] ci(review): close final-head and merged-state gaps --- .agent-loop/CURRENT_STATE.md | 22 ++-- .../CHUNK_MAP.md | 2 +- .../STATUS.md | 20 ++-- .../CHUNK_MAP.md | 4 +- .../STATUS.md | 8 +- .../CHUNK_MAP.md | 8 +- .../STATUS.md | 22 ++-- .../WS-CI-004-03-final-head-state-closure.md | 108 ++++++++++++++++++ .../CHUNK_MAP.md | 2 +- .../STATUS.md | 6 +- .../STATUS.md | 2 +- AGENTS.md | 10 +- CONTRIBUTING.md | 11 +- scripts/check_chunk_state_sync.py | 7 ++ scripts/test_chunk_state_sync.py | 24 ++++ 15 files changed, 203 insertions(+), 53 deletions(-) create mode 100644 .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md diff --git a/.agent-loop/CURRENT_STATE.md b/.agent-loop/CURRENT_STATE.md index 66f5078ef..cdc16774e 100644 --- a/.agent-loop/CURRENT_STATE.md +++ b/.agent-loop/CURRENT_STATE.md @@ -28,10 +28,10 @@ authority; these records do not grant or withhold it. | Initiative | Durable state on `main` | Remaining boundary | |---|---|---| -| [WS-ARCH-001](initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md) | Complete through `WS-ARCH-001-02H`; CP01A-CP02 establish unavailable authority facts and hidden CON adapter-binding behavior; PLAN4 planned incremental debt retirement | CP03A is complete on merge with exact target identity and owner eligibility; after that merge, implement CP03B exact Finance Authority activation; PLAN4 keeps debt retirement delivery-coupled without blocking features on unrelated frozen debt; the wider PLAN2 path still targets durable `allow_review`, and `02I` remains later | +| [WS-ARCH-001](initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md) | Complete through CP03A; exact adapter target identity and ACTORS/PROJECTS owner eligibility are merged while binding actions remain unavailable; PLAN4 continues incremental debt retirement | Implement CP03B exact Finance Authority activation; PLAN4 keeps debt retirement delivery-coupled without blocking features on unrelated frozen debt; the wider PLAN2 path still targets durable `allow_review`, and `02I` remains later | | [WS-ART-001](initiatives/WS-ART-001-immutable-artifact-storage/STATUS.md) | Active delivery initiative; verified ready-admission publication, hidden preparation, consumption and binding are merged through ARCH-02H | Implement exact post-submit materialization only after the unified guide/checker and PLAN2 public contracts are executable; live cutover remains later | | [WS-AUTH-001](initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md) | Active delivery initiative; project-policy authority and unified compilation authorization are merged through `12I` | POL-03B consumes 12I next; remaining AUTH activation chunks wait for their exact hidden owner behavior | -| [WS-CON-001](initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md) | Active delivery initiative; CP02 hidden adapter-binding behavior, ContributionPolicy persistence, shared lifecycle audit, and unavailable AUTH registrations are merged | CP03A target identity and owner eligibility are complete on merge; after that merge, implement CP03B exact Finance Authority activation; later complete guide-activation validation/persistence before task readiness, preserving immutable attempt lineage through Submission and ReviewLease | +| [WS-CON-001](initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md) | Active delivery initiative; CP02 hidden adapter-binding behavior, CP03A target identity and owner eligibility, ContributionPolicy persistence, shared lifecycle audit, and unavailable AUTH registrations are merged | Implement CP03B exact Finance Authority activation; later complete guide-activation validation/persistence before task readiness, preserving immutable attempt lineage through Submission and ReviewLease | | [WS-AUTH-003](initiatives/WS-AUTH-003-module-boundary-recovery/STATUS.md) | AUTH boundary foundation and first public-capability proof through POL-03A are merged | Repair each touched AUTH capability through `authorization.api` and shrink the canonical AUTH ledger | | [WS-POL-003](initiatives/WS-POL-003-unified-project-guide-compilation/STATUS.md) | Active delivery initiative; hidden compilation custody and AUTH-12I activation are merged | Implement POL-03B authorized compilation persistence, then continue the reviewed dependency order | | [WS-REV-001](initiatives/WS-REV-001-review-revision-lifecycle/STATUS.md) | Independent foundations through queue admission and reviewer-lease persistence are merged through `03A2`; schema/packet foundations may continue behind their own gates | Live admission/claim requires canonical 04E `allow_review`; ReviewLease copies the admitted Submission's immutable attempt policy version, and the first Review commit requires CON-03C/07 atomic contribution/award behavior | @@ -44,9 +44,9 @@ authority; these records do not grant or withhold it. | [WS-CI-001](initiatives/WS-CI-001-backend-ci-acceleration/STATUS.md) | Semantic distributed backend lanes complete | Treat further CI optimization as a fresh measured bounded change | | [WS-CI-002](initiatives/WS-CI-002-deterministic-agent-gates/STATUS.md) | `WS-CI-002-01` complete through PR #311; Agent Gates is deterministic per PR head | Preserve protected-branch review as the independent approval authority | | [WS-CI-003](initiatives/WS-CI-003-atomic-chunk-state/STATUS.md) | `WS-CI-003-01` complete | Require every chunk PR to land its final contract and initiative state atomically | -| [WS-CI-004](initiatives/WS-CI-004-review-evidence-integrity/STATUS.md) | `WS-CI-004-01` merged through PR #341; `WS-CI-004-02` is complete on merge with nine-reviewer protocol adoption | Human review this chunk; do not start local convergence automatically | +| [WS-CI-004](initiatives/WS-CI-004-review-evidence-integrity/STATUS.md) | Exact-target protocol and nine-reviewer adoption are merged through PRs #341 and #342; `WS-CI-004-03` is complete with final-head approval and durable-state closure | Human review `WS-CI-004-03`; do not start another successor automatically | | [WS-DB-001](initiatives/WS-DB-001-v01-schema-baseline/STATUS.md) | v0.1 schema baseline complete through PRs #316 and #317 | Extend `0001_v01_baseline` only through future bounded migrations | -| [WS-SEC-001](initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md) | `WS-SEC-001-01` complete on merge with patched runtime and tooling dependencies | Handle future security alerts through fresh bounded dependency changes | +| [WS-SEC-001](initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md) | `WS-SEC-001-01` is complete with patched runtime and tooling dependencies | Handle future security alerts through fresh bounded dependency changes | | [WS-DOCS-001](initiatives/WS-DOCS-001-current-v01-documentation/STATUS.md) | Current v0.1 entry documentation complete | Keep current pages synchronized with merged capability changes | | [WS-DOCS-002](initiatives/WS-DOCS-002-workstream-definition/STATUS.md) | Canonical Workstream definition complete | Preserve terminology across current documentation and generated artifacts | | [WS-XINT-001](initiatives/WS-XINT-001-lifecycle-boundary-reconciliation/STATUS.md) | Planning reconciliation complete and closed | Owner initiatives implement the resulting boundaries | @@ -101,22 +101,22 @@ AUTH unavailable registration, hidden CON binding/policy behavior, exact AUTH activations, CON validation, PROJECT guide binding, TASK attempt lineage, and clean v0.1 legacy economic-path removal in that order. CP02 is complete on merge while all four actions remain unavailable. CP03 is split with executable -CP03A/CP03B contracts complete on merge; later CP04-CP09 children remain +CP03A/CP03B contracts are merged; later CP04-CP09 children remain non-executable until their current-main contracts are expanded. - WS-ARCH-001-PLAN3 is planned; its planning merge changed no runtime behavior. - WS-ARCH-001-CP01 is a planned split and non-executable. -- WS-ARCH-001-CP01A is complete on merge with adapter-binding actions registered +- WS-ARCH-001-CP01A is merged with adapter-binding actions registered but unavailable. -- WS-ARCH-001-CP01B is complete on merge with five unavailable ContributionPolicy +- WS-ARCH-001-CP01B is merged with five unavailable ContributionPolicy actions registered. -- WS-ARCH-001-CP01C is complete on merge with corrected unavailable +- WS-ARCH-001-CP01C is merged with corrected unavailable adapter-binding identity and lifecycle-version facts. -- WS-ARCH-001-CP02 is complete on merge with hidden, route-unreachable behavior, +- WS-ARCH-001-CP02 is merged with hidden, route-unreachable behavior, exact lifecycle history, and deny-default production composition. - WS-ARCH-001-CP03 is a planned split/non-executable parent. CP03A and CP03B have executable - contracts complete on merge and are the next ordered bounded boundaries. -- WS-ARCH-001-CP03A is complete on merge with exact target identity and owner + contracts are merged and are the next ordered bounded boundaries. +- WS-ARCH-001-CP03A is merged with exact target identity and owner eligibility while all four actions remain unavailable. - WS-ARCH-001-CP03B is planned with an executable implementation contract after merged CP03A. diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md index d16b3d6a7..1f047f457 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md @@ -23,7 +23,7 @@ | `WS-ARCH-001-CP01C` | AUTH adapter-binding fact correction | L1 | Complete on merge; corrects unavailable facts before CON behavior | | `WS-ARCH-001-CP02` | CON hidden adapter-binding behavior | L1 | Complete on merge; route-unreachable and deny-default while actions remain unavailable | | `WS-ARCH-001-CP03` | Adapter-binding activation coordination parent | L1 | Planned split into CP03A/CP03B; non-executable | -| `WS-ARCH-001-CP03A` | Closed adapter target identity and PROJECTS/ACTORS owner eligibility | L1 | Complete on merge; actions remain unavailable | +| `WS-ARCH-001-CP03A` | Closed adapter target identity and PROJECTS/ACTORS owner eligibility | L1 | Merged through PR #340; actions remain unavailable | | `WS-ARCH-001-CP03B` | AUTH exact Finance Authority adapter-binding activation | L1 | Planned executable contract; follows merged CP03A | | `WS-ARCH-001-CP04` | CON hidden ContributionPolicy behavior | L1 | Proposed skeleton after merged CP03B evidence | | `WS-ARCH-001-CP05` | AUTH exact ContributionPolicy activation | L1 | Proposed skeleton after CP04 evidence | diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md index b5c6e1bb9..38eafd4f6 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md @@ -51,13 +51,13 @@ - PLAN3 corrects PLAN2's first implementation dependency. CON-05A is not a valid direct start: missing AUTH registration/activation and hidden CON behavior must precede owner-separated guide/task lineage. CP01 is the - non-executable split parent; CP01A is complete on merge with its four actions - registered/unavailable, CP01B is complete on merge with five policy actions - registered/unavailable. CP02 is complete on merge with hidden CON behavior + non-executable split parent; CP01A is merged with its four actions + registered/unavailable, CP01B is merged with five policy actions + registered/unavailable. CP02 is merged with hidden CON behavior while its AUTH actions remain unavailable; CP03 is split with executable - CP03A/CP03B contracts complete on merge, while CP04-CP09 remain + CP03A/CP03B contracts are merged, while CP04-CP09 remain non-executable skeletons. -- [WS-ARCH-001-PLAN4](chunks/WS-ARCH-001-PLAN4-incremental-debt-retirement.md) is planned on merge +- [WS-ARCH-001-PLAN4](chunks/WS-ARCH-001-PLAN4-incremental-debt-retirement.md) is planned and changes no runtime. It makes the existing incremental strangler operational: unrelated frozen debt cannot block delivery, new debt is prohibited, directly touched debt must shrink, and unsafe adjacent debt is @@ -71,20 +71,20 @@ - WS-ARCH-001-PLAN3 is planned; its planning merge changed no runtime behavior. - WS-ARCH-001-CP01 is a planned split and non-executable. Current-main discovery proved adapter binding and ContributionPolicy are distinct resource/action families. -- WS-ARCH-001-CP01A is complete on merge: exact adapter-binding identifiers, +- WS-ARCH-001-CP01A is merged: exact adapter-binding identifiers, mappings, typed facts, and digests are registered while unavailable. -- WS-ARCH-001-CP01B is complete on merge: exact unavailable +- WS-ARCH-001-CP01B is merged: exact unavailable ContributionPolicy registration. -- WS-ARCH-001-CP01C is complete on merge: unavailable adapter-binding facts +- WS-ARCH-001-CP01C is merged: unavailable adapter-binding facts match exact binding identity and lifecycle generation without a unit alias. -- WS-ARCH-001-CP02 is complete on merge: hidden, route-unreachable +- WS-ARCH-001-CP02 is merged: hidden, route-unreachable adapter-binding behavior while its AUTH actions remain unavailable. - WS-ARCH-001-CP03 is a planned split/non-executable parent. CP03A implements the closed compensation-adapter target identity and PROJECTS/ACTORS owner eligibility while actions remain unavailable. CP03B's executable contract specifies and requires proof of exact Finance Authority activation without adding a route or adjacent compensation authority. -- WS-ARCH-001-CP03A is complete on merge: the closed target-only identity and +- WS-ARCH-001-CP03A is merged through PR #340: the closed target-only identity and PROJECTS/ACTORS owner eligibility are implemented while all binding actions remain unavailable. - WS-ARCH-001-CP03B is planned with an executable implementation contract after diff --git a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md index 8e8cff244..9a6ffcf5e 100644 --- a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md @@ -30,7 +30,7 @@ sequence. | `WS-ARCH-001-CP01C` | Adapter-binding fact correction | L1 | Complete on merge; unavailable facts match binding identity and lifecycle generation | | `WS-ARCH-001-CP03` | Adapter-binding activation parent | L1 | Split into CP03A/CP03B; non-executable | | `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility prerequisite | L1 | Complete on merge; actions remain unavailable | -| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | L1 | Executable contract complete on merge; follows CP03A | +| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | L1 | Executable contract is complete; follows merged CP03A | | `WS-ARCH-001-CP05` | Exact ContributionPolicy activation | L1 | Proposed after merged CP04 hidden proof | | `WS-AUTH-001-PLAN` | Authorization Service Planning | L0 | Merged through PR #91 as `ad6d644` | | `WS-AUTH-001-01` | Adopt Authorization Baseline And Repository Contracts | L1 | Merged through PR #93 as `772af1d` | @@ -107,7 +107,7 @@ feature manifest exists and then uses the ordinary bounded contribution loop. | `WS-AUTH-001-ART-03` | ART 03 Guide Source Action Activation | L1 | Feature-gated | | `WS-XINT-002-06A` | Pre-Submit Materialization Activation | L1 | Merged through PR #293; ART-04C1 is its next ART consumer | | `WS-XINT-002-05A` | Historical Submission Bundle Preparation Activation | L1 | Superseded/non-executable; replacement WS-ARCH-001-02G requires 02A-02F | -| `WS-XINT-002-05B` | Historical Submission Binding Activation | L1 | Superseded/non-executable; replacement WS-ARCH-001-02H is complete on merge | +| `WS-XINT-002-05B` | Historical Submission Binding Activation | L1 | Superseded/non-executable; replacement WS-ARCH-001-02H is merged | | `WS-XINT-002-06B` | Historical Post-Submit Materialization And Checker Output Activation | L1 | Superseded/non-executable; WS-ARCH-001 PLAN2/04A-04E owns the current split | | `WS-AUTH-001-REV-05` | REV 05 Queue Read Activation | L1 | Feature-gated | | `WS-AUTH-001-REV-06` | REV 06 Claim Lease And Expiry Activation | L1 | Feature/service-gated | diff --git a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md index 057d7b232..182a1d573 100644 --- a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md +++ b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md @@ -43,11 +43,11 @@ not current start requirements. owner behavior and typed manifests are merged. Their activation order lives in the matching XINT and feature-owner records. - PLAN3 defines the missing contribution-policy sequence: WS-ARCH-001-CP01A is - complete on merge with exact adapter-binding actions still unavailable; CP01B is - complete on merge and separately registers - policy actions while unavailable; CP01C is complete on merge with corrected + merged with exact adapter-binding actions still unavailable; CP01B is + merged and separately registers + policy actions while unavailable; CP01C is merged with corrected unavailable binding identity and lifecycle-generation facts; CP03 is split. - CP03A is complete on merge with only the target identity and owner + CP03A is merged through PR #340 with only the target identity and owner eligibility while actions remain unavailable; CP03B's implementation then activates only CP02's four exact Finance Authority boundaries. CP05 later activates only CP04's merged hidden policy behavior. Fulfillment callback authority diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md index c095f5d9b..c1a81443f 100644 --- a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md @@ -2,10 +2,10 @@ | Chunk | Goal | Risk | State | |---|---|---:|---| -| `WS-CI-004-PLAN` | First-principles discovery, threat model, design, and bounded delivery contracts | L1 | Planned on merge; no implementation behavior | -| `WS-CI-004-01` | Shared Reviewer Evidence Protocol and deterministic review-target command, reusing `scripts/git_delta.py` | L1 | Complete on merge | -| `WS-CI-004-02` | Adopt the shared protocol across all nine reviewer agents and matching skills, with the shared evaluation harness | L1 | Complete on merge | -| Proposed step 3 | Add local exact-target session convergence and orchestration rules | L1 | No contract; not active | +| `WS-CI-004-PLAN` | First-principles discovery, threat model, design, and bounded delivery contracts | L1 | Planned; no implementation behavior | +| `WS-CI-004-01` | Shared Reviewer Evidence Protocol and deterministic review-target command, reusing `scripts/git_delta.py` | L1 | Complete through PR #341 | +| `WS-CI-004-02` | Adopt the shared protocol across all nine reviewer agents and matching skills, with the shared evaluation harness | L1 | Complete through PR #342 | +| `WS-CI-004-03` | Close final-head approval and durable merged-state gaps exposed by PR #340 | L1 | Complete | This is sequencing guidance, not an implementation queue. Create one bounded contract only when a human explicitly starts that step. One implementation diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md index ca60bb643..b0e282296 100644 --- a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md @@ -2,29 +2,29 @@ ## Current status -`WS-CI-004-01` is merged; `WS-CI-004-02` is complete on merge. +`WS-CI-004-01` and `WS-CI-004-02` are merged. `WS-CI-004-03` is complete. ## Current focus -Adopt the shared protocol across all nine reviewer skills and custom agents and -prove their contracts without changing CI or product behavior. +Preserve exact-final-head review convergence, last-push human approval, resolved +review conversations, and durable final-state wording without changing product +behavior or creating a second permission system. ## Chunk status | Chunk | Status | Notes | |---|---|---| -| `WS-CI-004-PLAN` | Planned on merge | Research and contracts only | +| `WS-CI-004-PLAN` | Planned | Research and contracts only | | `WS-CI-004-01` | Merged | Protocol, schema, target tool, and focused tests landed through PR #341 | -| `WS-CI-004-02` | Complete on merge | Nine reviewer skills and agents plus deterministic evaluation harness | -| Proposed step 3 | Not active | Local session convergence; no implementation contract exists | +| `WS-CI-004-02` | Merged | Nine reviewer skills and agents plus deterministic evaluation harness landed through PR #342 | +| `WS-CI-004-03` | Complete | Last-push approval, conversation resolution, and non-temporal final-state enforcement | ## Durable current state -The shared protocol, schema, and target sensor are merged. This chunk changes -only reviewer instructions and their offline contract evaluation; workflows, -product behavior, and GitHub merge authority remain unchanged. +The shared protocol, schema, target sensor, reviewer adoption, and final-head +closure are complete. GitHub remains the sole contribution and merge authority; +repository evidence remains advisory. ## Next action -Human review and merge of `WS-CI-004-02`. Do not start local convergence -automatically. +Human review of `WS-CI-004-03`. Do not start another successor automatically. diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md new file mode 100644 index 000000000..a360f6039 --- /dev/null +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md @@ -0,0 +1,108 @@ +# Chunk Contract: WS-CI-004-03 — Final-Head And Merged-State Closure + +## Merge state + +- Outcome on merge: `complete` + +## Goal + +Close the two gaps demonstrated by PR #340: require an independent approval of +the most recent reviewable push, require review conversations to be resolved, +and prevent completed chunk projections from landing temporal `on merge` +wording that becomes stale immediately after merge. + +## Why this chunk exists + +PR #340 received complete exact-head internal review at `354bdb57`, but a later +test-only push became the merged PR head. GitHub dismissed stale approvals but +did not require approval of the most recent push. The same merge left CP03A and +WS-CI-004-02 described as `complete on merge` on `main`. Both conditions make +otherwise correct evidence misleading. + +## Risk class + +L1 — repository protection, CI, review integrity, and durable engineering state. + +## Allowed files + +```text +AGENTS.md +CONTRIBUTING.md +scripts/check_chunk_state_sync.py +scripts/test_chunk_state_sync.py +.agent-loop/CURRENT_STATE.md +.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md +.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md +.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md +.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md +.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md +.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md +.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/STATUS.md +.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md +.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md +.agent-loop/initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md +``` + +Repository branch-protection settings for `main` are also in scope: preserve +strict `test` and `agent-gates` checks, one approving review, stale-review +dismissal, admin enforcement, and force-push/deletion denial; additionally +require approval of the most recent reviewable push and resolved conversations. + +## Not allowed + +```text +product/runtime behavior +authentication or authorization behavior +test or coverage weakening +hosted reviewer receipt custody +agent-generated merge authority +automatic merging +additional approval count +workflow duplication +post-merge state-repair automation +``` + +## Acceptance criteria + +- [ ] `main` requires one approving review, dismisses stale approvals, requires + approval of the most recent reviewable push, and requires conversation + resolution. +- [ ] Existing strict required checks and destructive-branch protections remain + unchanged. +- [ ] A completed chunk's chunk-map, initiative-status, and current-state + projection lines describe the final durable state without `on merge`. +- [ ] The chunk-state gate rejects temporal `on merge` wording in projection + lines while continuing to require the contract declaration + `Outcome on merge`. +- [ ] Tests cover chunk-map, initiative-status, and current-state rejection plus + the valid final-state form. +- [ ] CP03A and WS-CI-004-02 are reconciled to merged state, and WS-CI-004-03 + lands as complete without a follow-up memory PR. +- [ ] No active `CURRENT_STATE.md`, initiative `STATUS.md`, or `CHUNK_MAP.md` + retains temporal outcome wording from an already merged change. +- [ ] Documentation states that a push invalidates approval/review evidence and + that another eligible human must approve the latest reviewable push. + +## Verification commands + +```bash +python3 -m unittest -v scripts.test_chunk_state_sync scripts.test_lightweight_agent_gates +python3 scripts/check_chunk_state_sync.py --base-ref origin/main +python3 scripts/check_markdown_links.py +python3 scripts/check_stale_workstream_wording.py +python3 scripts/check_stale_authorization_docs.py +git diff --check +gh api repos/Flow-Research/workstream/branches/main/protection +``` + +## Required reviewers + +Architecture, CI integrity, security, QA, senior engineering, reuse/dedup, and +documentation. Product/operations confirms engineering review language does +not become Workstream product review state. + +## Human review focus + +Confirm the GitHub protection change closes the last-push race without adding a +second permission system, and confirm the local gate prevents stale merged-state +language without rewriting historical evidence. diff --git a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md index f190c6ade..46c84c413 100644 --- a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md @@ -16,7 +16,7 @@ signed-loop records do not make behavior live. | `WS-ARCH-001-CP02` | Hidden adapter-binding lifecycle behavior | Complete on merge; actions remain unavailable | | `WS-ARCH-001-CP03` | Adapter-binding activation parent | Split into CP03A/CP03B; non-executable | | `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility | Complete on merge; actions remain unavailable | -| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | Executable contract complete on merge; follows CP03A | +| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | Executable contract is complete; follows merged CP03A | | `PLAN5` | Historical complete-context human needs-revision rebase reconciliation | Merged PR #270; continuing-TaskAssignment rebase retained, independent reviewer-selection wording superseded by current PLAN2 | ## Current reconciliation diff --git a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md index f9eb2c6b2..2770ae384 100644 --- a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md +++ b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md @@ -78,13 +78,13 @@ historical-row backfill or compatibility behavior. - CON-02B: missing `outbox.dispatch`, `workstream.outbox.dispatcher`, exact matrix/context/PREP support, and AUTH activation plan. -- CP01A and CP01B are complete on merge with four exact adapter-binding and five +- CP01A and CP01B are merged with four exact adapter-binding and five exact ContributionPolicy actions registered but unavailable. CP01C is - complete on merge with corrected binding identity and lifecycle-generation + merged with corrected binding identity and lifecycle-generation facts. Callback/fulfillment authority stays separate. - CP02 is merged with hidden, route-unreachable adapter-binding behavior and immutable lifecycle history while all four AUTH actions remain unavailable. - CP03A is complete on merge with target identity and owner eligibility while + CP03A is merged through PR #340 with target identity and owner eligibility while actions remain unavailable. CP03B owns Finance Authority activation. CP04-CP05 remain non-executable policy behavior/activation skeletons. - CP06-CP09: validation, owner schema lineage, and clean legacy removal wait for diff --git a/.agent-loop/initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md b/.agent-loop/initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md index 01b2c0a3d..0294f15a9 100644 --- a/.agent-loop/initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md +++ b/.agent-loop/initiatives/WS-SEC-001-dependency-alert-remediation/STATUS.md @@ -1,6 +1,6 @@ # Status: WS-SEC-001 Dependency Alert Remediation -- Initiative state: complete on merge of `WS-SEC-001-01` +- Initiative state: complete through merged `WS-SEC-001-01` - Runtime dependency outcome: `cryptography` and `pypdf` use patched versions. - Tooling dependency outcome: backend manifests use patched `pytest` and `pytest-asyncio`; mutation-tool manifests use patched `pytest` and `uv` diff --git a/AGENTS.md b/AGENTS.md index b5ac15f9f..866e34bca 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,8 +81,10 @@ definition or ownership boundary of Workstream. - One implementation chunk equals one pull request. The chunk contract must declare its outcome on merge, and the same pull request must update the initiative chunk map, initiative status, and `.agent-loop/CURRENT_STATE.md` - to that final state. Do not use `in review`, `pending review`, or `ready for - review` as the state that will land on `main`. + to that final state. Projection lines must say `Complete`, `Planned`, + `Cancelled`, or `Superseded` as applicable; do not land temporal wording such + as `complete on merge`, `in review`, `pending review`, or `ready for review` + on `main`. - Do not begin the next chunk automatically after finishing the current chunk. - Use internal sub-agent review proportionate to risk. Security, authorization, payment, architecture, workflow, and broad product changes require focused @@ -94,6 +96,10 @@ definition or ownership boundary of Workstream. it ready for merge until applicable internal reviewers have run and valid findings are addressed or documented. - Do not merge a PR unless the user explicitly approves that specific PR for merge. +- Any push invalidates affected internal evidence and stale GitHub approval. + Fetch the PR head again after all checks and reviews finish. The most recent + reviewable push requires approval from an eligible human other than its + pusher, and every review conversation must be resolved before merge. - New or materially changed backend subsystems must remain at or above 90 percent test coverage. Until the dedicated global-coverage work reaches 90 percent, CI must also preserve the current repository-wide 78 percent diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d2311786..8564456ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,8 +81,10 @@ active queue or approval gate. - For a chunk PR, declare `Outcome on merge` in the chunk contract and update its initiative `CHUNK_MAP.md`, initiative `STATUS.md`, and `.agent-loop/CURRENT_STATE.md` to the state that will exist after human - merge. Code and durable state land together; there is no second pre-merge or - post-merge memory PR. + merge. Write that projection as the final durable value (`Complete`, + `Planned`, `Cancelled`, or `Superseded`), never as temporal `on merge` + wording. Code and durable state land together; there is no second pre-merge + or post-merge memory PR. Run the same atomic check locally before pushing: @@ -99,7 +101,10 @@ to contribute. GitHub CI validates repository quality. CodeRabbit and internal agents supplement human review. A maintainer must explicitly approve the final pull -request before it is merged. +request before it is merged. A new push invalidates affected internal evidence +and stale GitHub approval. Branch protection requires an eligible human other +than the latest pusher to approve the most recent reviewable push, and requires +all review conversations to be resolved before merge. Different initiatives may proceed concurrently in separate branches or worktrees. If another pull request changes the base, inspect the new delta and diff --git a/scripts/check_chunk_state_sync.py b/scripts/check_chunk_state_sync.py index 3c618d238..7ec0e2ddb 100644 --- a/scripts/check_chunk_state_sync.py +++ b/scripts/check_chunk_state_sync.py @@ -31,6 +31,7 @@ "superseded": ("superseded",), } REVIEW_ONLY_WORDS = ("in review", "pending review", "ready for review") +TEMPORAL_PROJECTION = re.compile(r"\bon merge\b", re.IGNORECASE) class ChunkStateError(RuntimeError): @@ -129,6 +130,8 @@ def _validate_chunk(chunk_path: str, changed: set[str]) -> str: status = _read(status_path) current_state = _read(current_state_path) row = _chunk_row(chunk_map, chunk_id) + if TEMPORAL_PROJECTION.search(row): + raise ChunkStateError(f"CHUNK_STATE_TEMPORAL_PROJECTION: {chunk_id}") if not _has_outcome(row, outcome): raise ChunkStateError(f"CHUNK_STATE_MAP_OUTCOME_MISMATCH: {chunk_id}") if outcome == "complete" and any(word in row.casefold() for word in REVIEW_ONLY_WORDS): @@ -142,6 +145,10 @@ def _validate_chunk(chunk_path: str, changed: set[str]) -> str: raise ChunkStateError(f"CHUNK_STATE_ID_MISSING: {projection_path}: {chunk_id}") if not any(_has_outcome(line, outcome) for line in lines): raise ChunkStateError(f"CHUNK_STATE_OUTCOME_MISMATCH: {projection_path}: {chunk_id}") + if any(TEMPORAL_PROJECTION.search(line) for line in lines): + raise ChunkStateError( + f"CHUNK_STATE_TEMPORAL_PROJECTION: {projection_path}: {chunk_id}" + ) return outcome diff --git a/scripts/test_chunk_state_sync.py b/scripts/test_chunk_state_sync.py index 42e2db7c9..f4571a752 100644 --- a/scripts/test_chunk_state_sync.py +++ b/scripts/test_chunk_state_sync.py @@ -147,6 +147,30 @@ def test_complete_chunk_cannot_remain_in_review(self) -> None: with self.assertRaisesRegex(gate.ChunkStateError, "CHUNK_STATE_REVIEW_WORDING"): self._validate() + def test_chunk_map_cannot_land_temporal_merge_state(self) -> None: + self._write( + f"{self.initiative}/CHUNK_MAP.md", + "| `WS-EXAMPLE-001-01` | Example | L1 | Complete on merge |\n", + ) + with self.assertRaisesRegex(gate.ChunkStateError, "CHUNK_STATE_TEMPORAL_PROJECTION"): + self._validate() + + def test_status_cannot_land_temporal_merge_state(self) -> None: + self._write( + f"{self.initiative}/STATUS.md", + "WS-EXAMPLE-001-01 is complete on merge.\n", + ) + with self.assertRaisesRegex(gate.ChunkStateError, "CHUNK_STATE_TEMPORAL_PROJECTION"): + self._validate() + + def test_current_state_cannot_land_temporal_merge_state(self) -> None: + self._write( + ".agent-loop/CURRENT_STATE.md", + "WS-EXAMPLE-001-01 is complete on merge.\n", + ) + with self.assertRaisesRegex(gate.ChunkStateError, "CHUNK_STATE_TEMPORAL_PROJECTION"): + self._validate() + def test_planning_outcome_is_supported(self) -> None: self._write(self.chunk, "## Merge state\n\n- Outcome on merge: `planned`\n") self._write( From 24871d940ba8081dbc13a3c2308e164c4bc54055 Mon Sep 17 00:00:00 2001 From: Abiorh001 Date: Sun, 16 Aug 2026 05:57:52 +0100 Subject: [PATCH 2/4] fix(ci): scan every active state projection --- .../CHUNK_MAP.md | 14 ++-- .../STATUS.md | 4 +- .../CHUNK_MAP.md | 8 +-- .../WS-CI-004-03-final-head-state-closure.md | 5 ++ .../CHUNK_MAP.md | 4 +- .github/workflows/agent-gates.yml | 4 ++ scripts/check_active_state_projections.py | 51 +++++++++++++++ scripts/test_active_state_projections.py | 65 +++++++++++++++++++ 8 files changed, 140 insertions(+), 15 deletions(-) create mode 100644 scripts/check_active_state_projections.py create mode 100644 scripts/test_active_state_projections.py diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md index 1f047f457..f75f8abf0 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md @@ -11,17 +11,17 @@ | `WS-ARCH-001-02D` | ART hidden preparation public API and private-edge migration | L1 | Complete; production remains deny-only | | `WS-ARCH-001-02E` | ART ready-admission consumption and binding hidden module-level capability | L1 | Complete; production remains deny-only and route-unreachable | | `WS-ARCH-001-02F` | TASK-owned immutable Submission command and hidden composed transaction | L1 | Complete; production remains deny-only and route-unreachable | -| `WS-ARCH-001-02G` | AUTH contributor preparation activation after the complete hidden path | L1 | Complete on merge | -| `WS-ARCH-001-02H` | AUTH human/fixed-service consumption activation | L1 | Complete on merge; public route remains unchanged | +| `WS-ARCH-001-02G` | AUTH contributor preparation activation after the complete hidden path | L1 | Complete | +| `WS-ARCH-001-02H` | AUTH human/fixed-service consumption activation | L1 | Complete; public route remains unchanged | | `WS-ARCH-001-02I` | Admission-only public API/dispatch cutover and complete legacy removal | L1 | Deferred after 02H plus split 03/04/05 remediation, revision, checker-output and REV admission prerequisites | | `WS-ARCH-001-PLAN2` | Current-main reconciliation around canonical Submission-to-`allow_review` | L1 | Planned; planning contract lands on merge | | `WS-ARCH-001-PLAN3` | ContributionPolicy registration, behavior, activation, guide/task lineage and clean legacy-removal sequencing | L1 | Planned; planning correction only and no runtime | -| `WS-ARCH-001-PLAN4` | Delivery-coupled technical-debt retirement policy and current-main baseline | L1 | Planned on merge; planning only and no unrelated v0.1 delivery block | +| `WS-ARCH-001-PLAN4` | Delivery-coupled technical-debt retirement policy and current-main baseline | L1 | Planned; planning only and no unrelated v0.1 delivery block | | `WS-ARCH-001-CP01` | Combined AUTH registration planning parent | L1 | Planned split into CP01A/CP01B; non-executable | -| `WS-ARCH-001-CP01A` | AUTH adapter-binding unavailable registration | L1 | Complete on merge; four actions remain planned/unavailable | -| `WS-ARCH-001-CP01B` | AUTH ContributionPolicy unavailable registration | L1 | Complete on merge; five actions remain planned/unavailable | -| `WS-ARCH-001-CP01C` | AUTH adapter-binding fact correction | L1 | Complete on merge; corrects unavailable facts before CON behavior | -| `WS-ARCH-001-CP02` | CON hidden adapter-binding behavior | L1 | Complete on merge; route-unreachable and deny-default while actions remain unavailable | +| `WS-ARCH-001-CP01A` | AUTH adapter-binding unavailable registration | L1 | Complete; four actions remain planned/unavailable | +| `WS-ARCH-001-CP01B` | AUTH ContributionPolicy unavailable registration | L1 | Complete; five actions remain planned/unavailable | +| `WS-ARCH-001-CP01C` | AUTH adapter-binding fact correction | L1 | Complete; corrects unavailable facts before CON behavior | +| `WS-ARCH-001-CP02` | CON hidden adapter-binding behavior | L1 | Complete; route-unreachable and deny-default while actions remain unavailable | | `WS-ARCH-001-CP03` | Adapter-binding activation coordination parent | L1 | Planned split into CP03A/CP03B; non-executable | | `WS-ARCH-001-CP03A` | Closed adapter target identity and PROJECTS/ACTORS owner eligibility | L1 | Merged through PR #340; actions remain unavailable | | `WS-ARCH-001-CP03B` | AUTH exact Finance Authority adapter-binding activation | L1 | Planned executable contract; follows merged CP03A | diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md index 38eafd4f6..f553ea4c6 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md @@ -30,9 +30,9 @@ - WS-ARCH-001-02F is complete. TASK owns the immutable admission-backed Submission command and the adapter owns one hidden root transaction; production remains deny-only and route-unreachable. -- Complete on merge: WS-ARCH-001-02G AUTH contributor-preparation +- Complete: WS-ARCH-001-02G AUTH contributor-preparation activation. Open pull requests show transient ownership. -- Complete on merge: WS-ARCH-001-02H activates exact human Submission +- Complete: WS-ARCH-001-02H activates exact human Submission consumption and fixed ART binding authority against the hidden atomic transaction. The public route remains unchanged. - WS-ARCH-001-PLAN2 is planned and lands as the current-main planning diff --git a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md index 9a6ffcf5e..20328f313 100644 --- a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md @@ -25,11 +25,11 @@ sequence. | Chunk | Title | Risk | Status | |---|---|---:|---| | `WS-ARCH-001-CP01` | Combined registration planning parent | L1 | Planned split into CP01A/CP01B; non-executable | -| `WS-ARCH-001-CP01A` | Adapter-binding unavailable registration | L1 | Complete on merge; excludes retirement, callback/fulfillment, identity, evaluator, and activation | -| `WS-ARCH-001-CP01B` | ContributionPolicy unavailable registration | L1 | Complete on merge; excludes binding behavior, evaluator, and activation | -| `WS-ARCH-001-CP01C` | Adapter-binding fact correction | L1 | Complete on merge; unavailable facts match binding identity and lifecycle generation | +| `WS-ARCH-001-CP01A` | Adapter-binding unavailable registration | L1 | Complete; excludes retirement, callback/fulfillment, identity, evaluator, and activation | +| `WS-ARCH-001-CP01B` | ContributionPolicy unavailable registration | L1 | Complete; excludes binding behavior, evaluator, and activation | +| `WS-ARCH-001-CP01C` | Adapter-binding fact correction | L1 | Complete; unavailable facts match binding identity and lifecycle generation | | `WS-ARCH-001-CP03` | Adapter-binding activation parent | L1 | Split into CP03A/CP03B; non-executable | -| `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility prerequisite | L1 | Complete on merge; actions remain unavailable | +| `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility prerequisite | L1 | Merged through PR #340; actions remain unavailable | | `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | L1 | Executable contract is complete; follows merged CP03A | | `WS-ARCH-001-CP05` | Exact ContributionPolicy activation | L1 | Proposed after merged CP04 hidden proof | | `WS-AUTH-001-PLAN` | Authorization Service Planning | L0 | Merged through PR #91 as `ad6d644` | diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md index a360f6039..ce43ad38d 100644 --- a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md @@ -30,6 +30,9 @@ AGENTS.md CONTRIBUTING.md scripts/check_chunk_state_sync.py scripts/test_chunk_state_sync.py +scripts/check_active_state_projections.py +scripts/test_active_state_projections.py +.github/workflows/agent-gates.yml .agent-loop/CURRENT_STATE.md .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md @@ -88,6 +91,8 @@ post-merge state-repair automation ```bash python3 -m unittest -v scripts.test_chunk_state_sync scripts.test_lightweight_agent_gates python3 scripts/check_chunk_state_sync.py --base-ref origin/main +python3 -m unittest -v scripts.test_active_state_projections +python3 scripts/check_active_state_projections.py python3 scripts/check_markdown_links.py python3 scripts/check_stale_workstream_wording.py python3 scripts/check_stale_authorization_docs.py diff --git a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md index 46c84c413..45a39aa90 100644 --- a/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md @@ -13,9 +13,9 @@ signed-loop records do not make behavior live. | `02A` | Shared transactional outbox persistence/append | Merged PR #155; migration 0029 | | `03A` | Adapter-binding persistence | Merged PR #267; migration 0053 | | `03B` | Contribution-policy persistence | Merged PR #274; migration 0055 | -| `WS-ARCH-001-CP02` | Hidden adapter-binding lifecycle behavior | Complete on merge; actions remain unavailable | +| `WS-ARCH-001-CP02` | Hidden adapter-binding lifecycle behavior | Complete; actions remain unavailable | | `WS-ARCH-001-CP03` | Adapter-binding activation parent | Split into CP03A/CP03B; non-executable | -| `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility | Complete on merge; actions remain unavailable | +| `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility | Merged through PR #340; actions remain unavailable | | `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | Executable contract is complete; follows merged CP03A | | `PLAN5` | Historical complete-context human needs-revision rebase reconciliation | Merged PR #270; continuing-TaskAssignment rebase retained, independent reviewer-selection wording superseded by current PLAN2 | diff --git a/.github/workflows/agent-gates.yml b/.github/workflows/agent-gates.yml index 7c04d9ffd..4fef31179 100644 --- a/.github/workflows/agent-gates.yml +++ b/.github/workflows/agent-gates.yml @@ -48,8 +48,12 @@ jobs: python3 scripts/check_chunk_state_sync.py --base-ref "${WORKSTREAM_BASE_SHA}" + - name: Active state projection validation + run: python3 scripts/check_active_state_projections.py + - name: Lightweight gate regression tests run: >- python3 -m unittest -v scripts.test_chunk_state_sync + scripts.test_active_state_projections scripts.test_lightweight_agent_gates diff --git a/scripts/check_active_state_projections.py b/scripts/check_active_state_projections.py new file mode 100644 index 000000000..55237e71d --- /dev/null +++ b/scripts/check_active_state_projections.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +"""Reject temporal merge wording from active engineering-state projections.""" + +from __future__ import annotations + +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +TEMPORAL_OUTCOME = re.compile( + r"\b(?:complete|planned|cancelled|superseded)\s+on\s+merge\b", + re.IGNORECASE, +) + + +def projection_paths(root: Path = ROOT) -> list[Path]: + """Return current state plus every initiative status and chunk map.""" + paths = [root / ".agent-loop" / "CURRENT_STATE.md"] + initiative_root = root / ".agent-loop" / "initiatives" + for filename in ("STATUS.md", "CHUNK_MAP.md"): + paths.extend(sorted(initiative_root.glob(f"*/{filename}"))) + return paths + + +def temporal_projection_failures(root: Path = ROOT) -> list[str]: + """Return deterministic failures for temporal wording in active ledgers.""" + failures: list[str] = [] + for path in projection_paths(root): + if not path.is_file(): + continue + relative = path.relative_to(root).as_posix() + for line_number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1): + if TEMPORAL_OUTCOME.search(line): + failures.append( + f"ACTIVE_STATE_TEMPORAL_PROJECTION: {relative}:{line_number}" + ) + return failures + + +def main() -> int: + failures = temporal_projection_failures() + if failures: + print("\n".join(failures), file=sys.stderr) + return 1 + print("Active state projection check passed.") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/test_active_state_projections.py b/scripts/test_active_state_projections.py new file mode 100644 index 000000000..03e0e8224 --- /dev/null +++ b/scripts/test_active_state_projections.py @@ -0,0 +1,65 @@ +"""Tests for repository-wide active-state projection validation.""" + +from __future__ import annotations + +import tempfile +import unittest +from pathlib import Path + +from scripts.check_active_state_projections import temporal_projection_failures + + +class ActiveStateProjectionTests(unittest.TestCase): + def setUp(self) -> None: + self.temporary_directory = tempfile.TemporaryDirectory() + self.root = Path(self.temporary_directory.name) + + def tearDown(self) -> None: + self.temporary_directory.cleanup() + + def _write(self, relative: str, text: str) -> None: + path = self.root / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(text, encoding="utf-8") + + def test_final_durable_values_pass(self) -> None: + self._write(".agent-loop/CURRENT_STATE.md", "WS-EXAMPLE-001-01 is complete.\n") + self._write( + ".agent-loop/initiatives/WS-EXAMPLE-001-example/STATUS.md", + "WS-EXAMPLE-001-01 is merged.\n", + ) + self._write( + ".agent-loop/initiatives/WS-EXAMPLE-001-example/CHUNK_MAP.md", + "| `WS-EXAMPLE-001-02` | Later | Planned |\n", + ) + self.assertEqual(temporal_projection_failures(self.root), []) + + def test_each_active_projection_type_is_scanned_case_insensitively(self) -> None: + self._write(".agent-loop/CURRENT_STATE.md", "One is complete on merge.\n") + self._write( + ".agent-loop/initiatives/WS-ONE-001-one/STATUS.md", + "Two is Planned on merge.\n", + ) + self._write( + ".agent-loop/initiatives/WS-TWO-001-two/CHUNK_MAP.md", + "| Three | CANCELLED ON MERGE |\n", + ) + failures = temporal_projection_failures(self.root) + self.assertEqual(len(failures), 3) + self.assertTrue(all(item.startswith("ACTIVE_STATE_TEMPORAL_PROJECTION:") for item in failures)) + + def test_contracts_and_historical_reviews_are_not_active_projections(self) -> None: + self._write(".agent-loop/CURRENT_STATE.md", "Current state is complete.\n") + self._write( + ".agent-loop/initiatives/WS-ONE-001-one/chunks/WS-ONE-001-01.md", + "- Outcome on merge: `complete`\n", + ) + self._write( + ".agent-loop/initiatives/WS-ONE-001-one/reviews/review.md", + "The change was complete on merge.\n", + ) + self.assertEqual(temporal_projection_failures(self.root), []) + + +if __name__ == "__main__": + unittest.main() From 3a77d28301b63ac6a96f355738b0c5fa5b2c6fe6 Mon Sep 17 00:00:00 2001 From: Abiorh001 Date: Sun, 16 Aug 2026 06:05:51 +0100 Subject: [PATCH 3/4] fix(ci): close temporal projection review gaps --- .agent-loop/CURRENT_STATE.md | 11 ++--- .../CHUNK_MAP.md | 2 +- .../STATUS.md | 5 ++- .../CHUNK_MAP.md | 2 +- .../WS-CI-003-atomic-chunk-state/STATUS.md | 2 +- .../WS-CI-004-03-final-head-state-closure.md | 16 +++++-- .../WS-CI-004-03-external-review-response.md | 43 +++++++++++++++++++ CONTRIBUTING.md | 5 ++- scripts/check_active_state_projections.py | 5 +-- scripts/test_active_state_projections.py | 9 ++++ 10 files changed, 81 insertions(+), 19 deletions(-) create mode 100644 .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/reviews/WS-CI-004-03-external-review-response.md diff --git a/.agent-loop/CURRENT_STATE.md b/.agent-loop/CURRENT_STATE.md index cdc16774e..e1f0e1d3f 100644 --- a/.agent-loop/CURRENT_STATE.md +++ b/.agent-loop/CURRENT_STATE.md @@ -99,9 +99,10 @@ selection wording. Do not start historical CON-05A directly. The CP01-CP09 sequence owns AUTH unavailable registration, hidden CON binding/policy behavior, exact AUTH activations, CON validation, PROJECT guide binding, TASK attempt lineage, and -clean v0.1 legacy economic-path removal in that order. CP02 is complete on -merge while all four actions remain unavailable. CP03 is split with executable -CP03A/CP03B contracts are merged; later CP04-CP09 children remain +clean v0.1 legacy economic-path removal in that order. CP02 is complete while +all four actions remain unavailable. CP03 is split: the CP03A implementation is +merged, and the CP03B implementation contract is complete but its implementation +remains planned; later CP04-CP09 children remain non-executable until their current-main contracts are expanded. - WS-ARCH-001-PLAN3 is planned; its planning merge changed no runtime behavior. @@ -114,8 +115,8 @@ non-executable until their current-main contracts are expanded. adapter-binding identity and lifecycle-version facts. - WS-ARCH-001-CP02 is merged with hidden, route-unreachable behavior, exact lifecycle history, and deny-default production composition. -- WS-ARCH-001-CP03 is a planned split/non-executable parent. CP03A and CP03B have executable - contracts are merged and are the next ordered bounded boundaries. +- WS-ARCH-001-CP03 is a planned split/non-executable parent. CP03A is merged; + CP03B has a complete executable contract and its implementation remains planned. - WS-ARCH-001-CP03A is merged with exact target identity and owner eligibility while all four actions remain unavailable. - WS-ARCH-001-CP03B is planned with an executable implementation contract after diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md index f75f8abf0..03867f500 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md @@ -14,7 +14,7 @@ | `WS-ARCH-001-02G` | AUTH contributor preparation activation after the complete hidden path | L1 | Complete | | `WS-ARCH-001-02H` | AUTH human/fixed-service consumption activation | L1 | Complete; public route remains unchanged | | `WS-ARCH-001-02I` | Admission-only public API/dispatch cutover and complete legacy removal | L1 | Deferred after 02H plus split 03/04/05 remediation, revision, checker-output and REV admission prerequisites | -| `WS-ARCH-001-PLAN2` | Current-main reconciliation around canonical Submission-to-`allow_review` | L1 | Planned; planning contract lands on merge | +| `WS-ARCH-001-PLAN2` | Current-main reconciliation around canonical Submission-to-`allow_review` | L1 | Planning contract complete; implementation sequencing remains planned | | `WS-ARCH-001-PLAN3` | ContributionPolicy registration, behavior, activation, guide/task lineage and clean legacy-removal sequencing | L1 | Planned; planning correction only and no runtime | | `WS-ARCH-001-PLAN4` | Delivery-coupled technical-debt retirement policy and current-main baseline | L1 | Planned; planning only and no unrelated v0.1 delivery block | | `WS-ARCH-001-CP01` | Combined AUTH registration planning parent | L1 | Planned split into CP01A/CP01B; non-executable | diff --git a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md index f553ea4c6..12fc0f868 100644 --- a/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md +++ b/.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md @@ -54,8 +54,9 @@ non-executable split parent; CP01A is merged with its four actions registered/unavailable, CP01B is merged with five policy actions registered/unavailable. CP02 is merged with hidden CON behavior - while its AUTH actions remain unavailable; CP03 is split with executable - CP03A/CP03B contracts are merged, while CP04-CP09 remain + while its AUTH actions remain unavailable; CP03 is split, CP03A is merged, + and CP03B has a complete executable contract but remains planned for + implementation, while CP04-CP09 remain non-executable skeletons. - [WS-ARCH-001-PLAN4](chunks/WS-ARCH-001-PLAN4-incremental-debt-retirement.md) is planned and changes no runtime. It makes the existing incremental strangler diff --git a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md index 20328f313..50c6e061b 100644 --- a/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md +++ b/.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md @@ -30,7 +30,7 @@ sequence. | `WS-ARCH-001-CP01C` | Adapter-binding fact correction | L1 | Complete; unavailable facts match binding identity and lifecycle generation | | `WS-ARCH-001-CP03` | Adapter-binding activation parent | L1 | Split into CP03A/CP03B; non-executable | | `WS-ARCH-001-CP03A` | Adapter target identity and owner eligibility prerequisite | L1 | Merged through PR #340; actions remain unavailable | -| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | L1 | Executable contract is complete; follows merged CP03A | +| `WS-ARCH-001-CP03B` | Exact Finance Authority adapter-binding activation | L1 | Executable contract is complete; implementation remains planned after merged CP03A | | `WS-ARCH-001-CP05` | Exact ContributionPolicy activation | L1 | Proposed after merged CP04 hidden proof | | `WS-AUTH-001-PLAN` | Authorization Service Planning | L0 | Merged through PR #91 as `ad6d644` | | `WS-AUTH-001-01` | Adopt Authorization Baseline And Repository Contracts | L1 | Merged through PR #93 as `772af1d` | diff --git a/.agent-loop/initiatives/WS-CI-003-atomic-chunk-state/STATUS.md b/.agent-loop/initiatives/WS-CI-003-atomic-chunk-state/STATUS.md index 5e8433db9..81f28cdcb 100644 --- a/.agent-loop/initiatives/WS-CI-003-atomic-chunk-state/STATUS.md +++ b/.agent-loop/initiatives/WS-CI-003-atomic-chunk-state/STATUS.md @@ -2,7 +2,7 @@ - Initiative state: complete through PR #319 - Completed chunk: `WS-CI-003-01` -- Outcome on merge: `WS-CI-003-01` is complete and Agent Gates requires every +- Durable outcome: `WS-CI-003-01` is complete and Agent Gates requires every chunk PR to carry its contract, chunk-map, initiative-status, and current-state outcome atomically. - Product behavior changed: no diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md index ce43ad38d..90af0628c 100644 --- a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md @@ -37,6 +37,7 @@ scripts/test_active_state_projections.py .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/CHUNK_MAP.md .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/STATUS.md .agent-loop/initiatives/WS-CI-004-review-evidence-integrity/chunks/WS-CI-004-03-final-head-state-closure.md +.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/reviews/WS-CI-004-03-external-review-response.md .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md .agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/CHUNK_MAP.md @@ -89,15 +90,24 @@ post-merge state-repair automation ## Verification commands ```bash -python3 -m unittest -v scripts.test_chunk_state_sync scripts.test_lightweight_agent_gates +python3 -m unittest -v scripts.test_chunk_state_sync scripts.test_active_state_projections scripts.test_lightweight_agent_gates python3 scripts/check_chunk_state_sync.py --base-ref origin/main -python3 -m unittest -v scripts.test_active_state_projections python3 scripts/check_active_state_projections.py python3 scripts/check_markdown_links.py python3 scripts/check_stale_workstream_wording.py python3 scripts/check_stale_authorization_docs.py git diff --check -gh api repos/Flow-Research/workstream/branches/main/protection +gh api repos/Flow-Research/workstream/branches/main/protection | jq -e ' + .required_status_checks.strict == true and + (["test", "agent-gates"] - (.required_status_checks.contexts // [])) == [] and + .required_pull_request_reviews.required_approving_review_count == 1 and + .required_pull_request_reviews.dismiss_stale_reviews == true and + .required_pull_request_reviews.require_last_push_approval == true and + .required_conversation_resolution.enabled == true and + .enforce_admins.enabled == true and + .allow_force_pushes.enabled == false and + .allow_deletions.enabled == false +' >/dev/null ``` ## Required reviewers diff --git a/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/reviews/WS-CI-004-03-external-review-response.md b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/reviews/WS-CI-004-03-external-review-response.md new file mode 100644 index 000000000..e287d0656 --- /dev/null +++ b/.agent-loop/initiatives/WS-CI-004-review-evidence-integrity/reviews/WS-CI-004-03-external-review-response.md @@ -0,0 +1,43 @@ +# External Review Response: WS-CI-004-03 + +## CodeRabbit review at `d55c9b14bb867521d4d529622fc31a425535b45d` + +Comments addressed: + +- CP03B projections now consistently distinguish its complete executable + contract from its planned, unmerged implementation. +- The branch-protection verification command uses `jq -e` to assert every + required setting and fail on a mismatch. +- The contribution boundary's CP02 and CP03A rows use durable `Complete` + values while preserving their unavailable-action notes. +- `CONTRIBUTING.md` explicitly requires the user's approval of the specific + pull request in addition to maintainer approval and branch protection. +- The broader exact-head replay found two equivalent temporal phrases that the + initial scanner missed. The scanner now rejects every case-insensitive + `on merge` occurrence in active projections, regression tests cover + `Outcome on merge` and `lands on merge`, and both stale active rows are + reconciled. + +Comments deferred: + +- None. + +Human decisions needed: + +- The user must approve this specific pull request after the final push. The + latest pusher cannot supply the branch-protection approval. + +Commands rerun: + +```text +python3 -m unittest -v scripts.test_active_state_projections scripts.test_chunk_state_sync scripts.test_lightweight_agent_gates +python3 scripts/check_active_state_projections.py +python3 scripts/check_chunk_state_sync.py --base-ref origin/main +python3 scripts/check_markdown_links.py +git diff --check +``` + +Remaining risks: + +- External and internal review receipts for earlier heads become stale after + this correction and must be rerun against the final clean head. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8564456ba..d51f2459c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,8 +101,9 @@ to contribute. GitHub CI validates repository quality. CodeRabbit and internal agents supplement human review. A maintainer must explicitly approve the final pull -request before it is merged. A new push invalidates affected internal evidence -and stale GitHub approval. Branch protection requires an eligible human other +request before it is merged, and the user must explicitly approve that specific +pull request for merge. A new push invalidates affected internal evidence and +stale GitHub approval. Branch protection requires an eligible human other than the latest pusher to approve the most recent reviewable push, and requires all review conversations to be resolved before merge. diff --git a/scripts/check_active_state_projections.py b/scripts/check_active_state_projections.py index 55237e71d..9029f554b 100644 --- a/scripts/check_active_state_projections.py +++ b/scripts/check_active_state_projections.py @@ -8,10 +8,7 @@ from pathlib import Path ROOT = Path(__file__).resolve().parents[1] -TEMPORAL_OUTCOME = re.compile( - r"\b(?:complete|planned|cancelled|superseded)\s+on\s+merge\b", - re.IGNORECASE, -) +TEMPORAL_OUTCOME = re.compile(r"\bon\s+merge\b", re.IGNORECASE) def projection_paths(root: Path = ROOT) -> list[Path]: diff --git a/scripts/test_active_state_projections.py b/scripts/test_active_state_projections.py index 03e0e8224..fd9a1f9ff 100644 --- a/scripts/test_active_state_projections.py +++ b/scripts/test_active_state_projections.py @@ -48,6 +48,15 @@ def test_each_active_projection_type_is_scanned_case_insensitively(self) -> None self.assertEqual(len(failures), 3) self.assertTrue(all(item.startswith("ACTIVE_STATE_TEMPORAL_PROJECTION:") for item in failures)) + def test_equivalent_temporal_merge_phrases_are_rejected(self) -> None: + self._write(".agent-loop/CURRENT_STATE.md", "Outcome on merge: complete.\n") + self._write( + ".agent-loop/initiatives/WS-ONE-001-one/CHUNK_MAP.md", + "| Plan | Planning contract lands on merge |\n", + ) + failures = temporal_projection_failures(self.root) + self.assertEqual(len(failures), 2) + def test_contracts_and_historical_reviews_are_not_active_projections(self) -> None: self._write(".agent-loop/CURRENT_STATE.md", "Current state is complete.\n") self._write( From c055ecb0fbfb93c542762db26bd59217ef9e7c24 Mon Sep 17 00:00:00 2001 From: Abiorh001 Date: Sun, 16 Aug 2026 06:06:24 +0100 Subject: [PATCH 4/4] docs(ci): document projection gate tests --- scripts/check_active_state_projections.py | 1 + scripts/test_active_state_projections.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/scripts/check_active_state_projections.py b/scripts/check_active_state_projections.py index 9029f554b..bf5581de7 100644 --- a/scripts/check_active_state_projections.py +++ b/scripts/check_active_state_projections.py @@ -36,6 +36,7 @@ def temporal_projection_failures(root: Path = ROOT) -> list[str]: def main() -> int: + """Print deterministic failures and return a process status.""" failures = temporal_projection_failures() if failures: print("\n".join(failures), file=sys.stderr) diff --git a/scripts/test_active_state_projections.py b/scripts/test_active_state_projections.py index fd9a1f9ff..466fdd08d 100644 --- a/scripts/test_active_state_projections.py +++ b/scripts/test_active_state_projections.py @@ -10,19 +10,25 @@ class ActiveStateProjectionTests(unittest.TestCase): + """Verify temporal wording cannot survive in active state projections.""" + def setUp(self) -> None: + """Create an isolated repository-shaped test root.""" self.temporary_directory = tempfile.TemporaryDirectory() self.root = Path(self.temporary_directory.name) def tearDown(self) -> None: + """Remove the isolated test root.""" self.temporary_directory.cleanup() def _write(self, relative: str, text: str) -> None: + """Write one fixture file beneath the isolated root.""" path = self.root / relative path.parent.mkdir(parents=True, exist_ok=True) path.write_text(text, encoding="utf-8") def test_final_durable_values_pass(self) -> None: + """Accept durable final values in every active projection type.""" self._write(".agent-loop/CURRENT_STATE.md", "WS-EXAMPLE-001-01 is complete.\n") self._write( ".agent-loop/initiatives/WS-EXAMPLE-001-example/STATUS.md", @@ -35,6 +41,7 @@ def test_final_durable_values_pass(self) -> None: self.assertEqual(temporal_projection_failures(self.root), []) def test_each_active_projection_type_is_scanned_case_insensitively(self) -> None: + """Reject temporal wording regardless of projection type or case.""" self._write(".agent-loop/CURRENT_STATE.md", "One is complete on merge.\n") self._write( ".agent-loop/initiatives/WS-ONE-001-one/STATUS.md", @@ -49,6 +56,7 @@ def test_each_active_projection_type_is_scanned_case_insensitively(self) -> None self.assertTrue(all(item.startswith("ACTIVE_STATE_TEMPORAL_PROJECTION:") for item in failures)) def test_equivalent_temporal_merge_phrases_are_rejected(self) -> None: + """Reject temporal labels and prose beyond a fixed status vocabulary.""" self._write(".agent-loop/CURRENT_STATE.md", "Outcome on merge: complete.\n") self._write( ".agent-loop/initiatives/WS-ONE-001-one/CHUNK_MAP.md", @@ -58,6 +66,7 @@ def test_equivalent_temporal_merge_phrases_are_rejected(self) -> None: self.assertEqual(len(failures), 2) def test_contracts_and_historical_reviews_are_not_active_projections(self) -> None: + """Exclude contracts and historical evidence from active-state scans.""" self._write(".agent-loop/CURRENT_STATE.md", "Current state is complete.\n") self._write( ".agent-loop/initiatives/WS-ONE-001-one/chunks/WS-ONE-001-01.md",