Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Status: WS-ENG-ROOT-001 — Planning-Intake Gate Recovery

- Phase: one-use root recovery
- Active planning chunk: none
- Active implementation chunk: none
- Recovery target: `WS-ENG-ROOT-001-01`
- Signed basis and first parent: `339248c40020658583bf7bd1e4a58daf85f5ffb8`
- Purpose: restore the already-documented closed first-planning-intake admission
- Stop: recovery certificate is consumed by this exact merge and cannot replay
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Chunk Contract: WS-ENG-ROOT-001-01 — Exact Root Planning-Intake Gate Recovery

## Goal

Repair the circular trusted gates that reject the repository's documented
first-new-initiative planning intake, using one exact consumed recovery.

## Risk class

L0

## Start phase

`implementation`

## Machine-checkable scope

```chunk-scope-json
{
"schema_version": 1,
"chunk_id": "WS-ENG-ROOT-001-01",
"phase": "implementation",
"risk_class": "L0",
"allowed_paths": [
".agent-loop/policies/loop-memory-recovery.json",
".agent-loop/initiatives/WS-ENG-ROOT-001-planning-intake-gate-recovery/**",
".agent-loop/merge-intents/WS-ENG-ROOT-001-01.json",
"scripts/check_chunk_contract.py",
"scripts/check_internal_review_evidence.py",
"scripts/check_loop_memory_state.py",
"scripts/update_post_merge_memory.py",
"scripts/test_agent_gates.py",
"scripts/test_check_chunk_contract.py",
"scripts/test_check_loop_memory_state.py",
"scripts/test_update_post_merge_memory.py"
],
"forbidden_paths": ["backend/**", "frontend/**", ".github/**"],
"required_reviewers": ["senior engineering", "qa/test", "security/auth", "product/ops", "architecture", "ci integrity", "docs", "reuse/dedup", "test delta"],
"verification_commands": ["agent-gate-tests", "loop-memory-state", "loop-memory-recovery-tests", "chunk-scope-tests", "internal-review-evidence", "markdown-links", "stale-wording", "git-diff-check"]
}
```

## Allowed files

```text
.agent-loop/policies/loop-memory-recovery.json
.agent-loop/initiatives/WS-ENG-ROOT-001-planning-intake-gate-recovery/**
.agent-loop/merge-intents/WS-ENG-ROOT-001-01.json
scripts/check_chunk_contract.py
scripts/check_internal_review_evidence.py
scripts/check_loop_memory_state.py
scripts/update_post_merge_memory.py
scripts/test_agent_gates.py
scripts/test_check_chunk_contract.py
scripts/test_check_loop_memory_state.py
scripts/test_update_post_merge_memory.py
```

## Not allowed

```text
product code, backend, frontend, workflows, dependencies, coverage weakening
general unsigned implementation admission or reusable recovery authority
automatic start, merge, approval, cancellation, or AUTH implementation
```

## Acceptance criteria

- [ ] Only a brand-new initiative's additive canonical planning tree and one
`<initiative>-PLAN` intent can use the restored planning-intake admission.
- [ ] Existing initiatives, implementation/configuration paths, scripts,
workflows, policies, deletes, renames, links, and executable modes fail.
- [ ] Internal evidence accepts PLAN identity without inventing a PLAN contract,
while retaining exact reviewed-SHA and all required tracks.
- [ ] Ordinary implementation/specification chunks remain signed-start-only.
- [ ] Schema-v7 recovery is exact to this identity, signed basis, first parent,
empty recovered list, fixed reason/code, and is consumed on first use.
- [ ] Independent state validation rejects altered recovery evidence.
- [ ] Exactly one null-successor merge intent completes the root repair.

## Verification commands

```bash
python3 scripts/test_check_chunk_contract.py
python3 scripts/test_agent_gates.py
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/check_loop_memory_state.py
python3 scripts/check_internal_review_evidence.py
python3 scripts/check_markdown_links.py
python3 scripts/check_stale_workstream_wording.py
git diff --check origin/main...HEAD
```

## Required reviewers

- [ ] senior engineering
- [ ] QA/test
- [ ] security/auth
- [ ] product/ops
- [ ] architecture
- [ ] CI integrity
- [ ] docs
- [ ] reuse/dedup
- [ ] test delta

## Stop conditions

Stop if the recovery is reusable, changes product code, or admits anything
beyond the closed planning-intake tree.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# WS-ENG-ROOT-001-01 External Review Response

Comments addressed: one CodeRabbit fail-closed finding. Independent planning
state validation now rejects a non-string `intent_path` with a stable failure
instead of raising, with a regression test for `null` input.

Comments deferred: CodeRabbit's generic docstring-coverage warning is not a
changed-code defect and adding unrelated docstrings would violate this exact
recovery scope. The optional wider recovery runbook remains separate work.

Human decisions needed: explicit approval of PR #205 remains required because
trusted `main` contains the circular Agent Gate being repaired.

Commands rerun: focused loop-memory tests, chunk-contract tests, agent-gate
tests, independent state validation, internal evidence, Markdown links, stale
wording, and diff integrity.

Remaining risks: the trusted-main Agent Gate must fail on this recovery PR; it
cannot consume candidate code without self-authorizing the repair. The exact
schema-v7 recovery is base-pinned, identity-pinned, path-pinned, and one-use.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# WS-ENG-ROOT-001-01 Internal Review Evidence

Reviewed code SHA: `60db7ce2d682319b0c14ec0920b6adc75654bab9`

Reviewed at: `2026-07-26T14:00:00Z`

Reviewer run IDs: `cr_senior`, `cr_qa`, `cr_security`, `cr_product`,
`cr_arch`, `cr_ci`, `cr_docs`, `cr_reuse`, `cr_testdelta`

## Commands Run

```bash
python3 scripts/test_agent_gates.py
python3 scripts/check_loop_memory_state.py
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_check_chunk_contract.py
python3 scripts/check_internal_review_evidence.py
python3 scripts/check_markdown_links.py
python3 scripts/check_stale_workstream_wording.py
git diff --check origin/main...HEAD
```

## Reviewer Results

| Reviewer | Result | Blocking findings | Notes |
|---|---|---|---|
| senior engineering | PASS WITH LOW RISKS | none | The malformed-path repair is minimal and retains exact recovery boundaries. |
| QA/test | PASS WITH LOW RISKS | none | The `null` intent-path regression proves a controlled fail-closed result. |
| security/auth | PASS | none | Ordinary implementation remains signed-start-only; recovery remains exact and one-use. |
| product/ops | PASS AFTER FIXES | none | The only procedural finding was this stale evidence, now rebound to the reviewed SHA. |
| architecture | PASS AFTER FIXES | none | The external-response path is explicitly re-reviewed as part of the closed certificate. |
| CI integrity | PASS WITH LOW RISKS | none | No workflow, threshold, exclusion, dependency, or coverage command was weakened. |
| docs | PASS AFTER FIXES | none | The external response is recorded separately and this evidence is rebound to the reviewed SHA. |
| reuse/dedup | PASS WITH LOW RISKS | none | Validator duplication is deliberate independent verification, not a forked helper. |
| test delta | PASS WITH LOW RISKS | none | No tests were removed, skipped, deselected, or weakened. |

## Findings Resolved

Valid findings addressed: yes

Open sub-agent sessions: none

The repaired implementation also rejects a non-string planning-intake
`intent_path` with a stable failure instead of raising. All nine reviewer
tracks reviewed the exact implementation SHA above. Their only procedural
finding was stale evidence after the external-review repair; this evidence-only
commit resolves it without changing the reviewed implementation.

## Remaining Gate

GitHub checks, external review, and the explicit human merge checkpoint remain.
The low-risk documentation suggestions are intentionally deferred because the
one-use recovery certificate permits only its exact closed path set.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# PR Trust Bundle: WS-ENG-ROOT-001-01

## Goal

Restore the documented first-planning-intake path after PR #203 accidentally
made it impossible to enter, using one exact consumed root recovery.

## Scope and behavior

Only trusted engineering gates, their tests, the independent memory checker,
and the exact recovery certificate change. Product behavior is unchanged.
Ordinary work remains signed-start-only.

## Why root recovery is required

Trusted base code rejects both the repair and every normal planning intake, so
no ordinary signed contract can authorize the correction. The exact recovery
is bound to current signed main and this single identity, then consumed.

## Human review focus

- Closed planning tree grammar and signed-history absence.
- No candidate implementation self-authorization.
- Exact recovery certificate, consumption, and replay inertness.
- Continued signed-start requirement for ordinary chunks.

## Human merge ownership

The owner must explicitly approve this specific repair PR. A failing old scope
check is the defect being repaired and must not be represented as passing.

## External review response

CodeRabbit identified one valid fail-closed issue: a non-string planning-intake
`intent_path` could raise during independent state validation. The repair now
returns a controlled validation failure and includes an adversarial regression.
The Backend rerun passed after its first attempt hit a transient quay.io MinIO
image-pull timeout. The trusted-main Agent Gate remains the expected circular
failure that this exact recovery repairs.
9 changes: 9 additions & 0 deletions .agent-loop/merge-intents/WS-ENG-ROOT-001-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"schema_version": 2,
"initiative_id": "WS-ENG-ROOT-001",
"chunk_id": "WS-ENG-ROOT-001-01",
"chunk_title": "Exact Root Planning-Intake Gate Recovery",
"next_chunk_id": null,
"next_chunk_title": null,
"next_requires_explicit_start": true
}
23 changes: 5 additions & 18 deletions .agent-loop/policies/loop-memory-recovery.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"activation": {
"chunk_id": "WS-ENG-007-00R6",
"initiative_id": "WS-ENG-007"
"chunk_id": "WS-ENG-ROOT-001-01",
"initiative_id": "WS-ENG-ROOT-001"
},
"signed_basis": "bba4ba5f171a4438b072740707a5cf8bde49d9af",
"recovered_merges": [
{
"chunk_id": "WS-ART-001-PLAN2",
"initiative_id": "WS-ART-001",
"merge_sha": "03a05eeb8f129e0d5f226cc5c058965f43590a81",
"pr_number": 197
},
{
"chunk_id": "WS-AUTH-001-11",
"initiative_id": "WS-AUTH-001",
"merge_sha": "f670b7058c71ad4d11a68c6e242e9fe501ae3aaf",
"pr_number": 201
}
],
"schema_version": 6
"signed_basis": "339248c40020658583bf7bd1e4a58daf85f5ffb8",
"recovered_merges": [],
"schema_version": 7
}
Loading
Loading