Repository navigation
fix(verify): add the "referenced root file exists" landing gate (#356 prevention, supersedes #363) - #365
Conversation
…prevention) The four canonical root narratives were relocated delete-first across two repos and briefly existed in no main (#356). Nothing in task verify read the agent surfaces that referenced them, so no gate saw the loss. scripts/check-root-refs.mjs asserts (1) the four canonical narratives exist at the umbrella root, and (2) every reference to a canonical narrative in an agent surface (AGENTS.md, README.md, .opencode/instructions.md, .pi/extensions/ charly-gates.ts) resolves — a `charly/<Name>.md` reference whose file now lives at the umbrella root is a STALE-reference FAIL, the #356 shape. Wired into the verify plan with a --self-test step that proves it discriminates. Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
Addresses the two blocks on #363 in one commit: 1. B14a/B18 — the `else` branch after the `!prefix` guard was unreachable, and the `if (prefix)` wrapper redundant. Collapsed to a prefixed-only walk (the bare-name case is check 1s). 2. B12 — the prefixed DANGLING arm had no mutation. Added `notes/SOUL.md` (a prefix that is neither a file nor a submodule) to --self-test, so the arm is exercised. Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
…/soul-md-ref-gate
…tion Addresses the two blocks on #363 (head e803020) in one commit: 1. B12 — the prefixed DANGLING push was redundant with check 1 (a canonical narrative missing at the umbrella root already FAILs check 1), so it could never be reached by a mutation without check 1 also firing. Removed it: check 2 now owns ONLY the STALE arm, and every surviving arm has a mutation that fails without it (check 1 by the SOUL.md-removed case, STALE by charly/SOUL.md). 2. B18/A1 — the verify step description carried an unquoted inline `#356`, which YAML read as a comment — the rendered check name was truncated at `(the`. Quoted the value so it renders in full. Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — no instruction-injection in body/commits/diff (T2); the new Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
) * docs(agents): SOUL identity + a 10-rule rulebook (reland, supersedes #353) The #353 rulebook rewrite, relanded off current main after #353 was auto-closed at the validator's 5-verdict limit (its narratives landed via #357, its seam via plugin-docs#17; the rulebook cut itself did not). AGENTS.md becomes the identity + the WHAT/MUST, with the skill-owned prose removed and pointed at its owner: - a condensed 'You are charly' identity opening (SOUL.md is the full text); - 11 rules -> 10: merge pins + Policy B; fold the engineering-rules list into a single discipline rule 10; delete the prose the skills already own (identity/coordination -> git-workflow B2b; main-vs-subagent -> agents orchestration-model; subagent lifecycle -> agents hooks-and-lifecycle; development model -> git-workflow); - remove the 'OWNING - ETA' ask from the coordination protocol; - keep every MUST (R1/R3/R4/R5/R6/R7/R10, live-or-skip, PR-only landing) and carry soul-md's R7 nuance (run the gate the change class requires) and the umbrella-root SOUL.md pointer. Rule-number citations swept (rule 9->2, 11->9, 8->5, 4->2) across .opencode, .pi, the gate scripts, and the charly.yml check labels. Refs #352; preserves soul-md's #357/#365 work. * docs(agents): fix the 11->10 sweep's stale prose and restore two dropped clauses Addresses the #366 BLOCK (R5/B14(d), R5/B10): - the sweep was mechanical in three places, leaving stale framing that contradicted the new rule 9: tracker.ts and instructions.md both claimed rule 9 'names two branches' (a structured todo primitive vs a durable file) — the new rule 9 states only the durable ledger. Reworded to match. - restore two clauses the fold dropped: rule 3 keeps the sdk/spec-are-recorded-but- not-pinned-by-charly statement (builds resolve them from the Go proxy), and rule 10 keeps the 'no R10 class exemption' clause (a plugin-library/schema change runs the full assembled disposable bed; a bed-exemption sign-off is never accepted). No MUST is subtracted. The sweep is now evidenced by a real grep in the PR body. Refs #352. * docs: re-freeze the reland head No source change — the head now carries the final body: the R5 sweep is evidenced by a pasted grep, and the two stale-framing hits + two dropped clauses are fixed in bb492c6. This mints a fresh head so the required pr-validator reads the final body against the fixed tree. --------- Co-authored-by: atrawog <[email protected]>
Summary
Supersedes #363, which was auto-closed at the validator's 5-verdict limit (
AI_REVIEW_AUTO_CLOSE_AFTER=5). Every finding from its BLOCK verdicts was fixed before this branch existed, in ONE new head: the current head carries the sole residual from #363's final verdict (the rule-compliance section was missing R0/R2/R8 — now added). The predecessor's earlier findings (deadelsebranch, the redundant/untested DANGLING arm, the unquoted#356YAML-truncation, and the staletask verifypaste) were all fixed on #363's branch, whose tree this branch carries forward verbatim; #363's last verdict dispositioned each of themstale-superseded.Add the "referenced root file exists" landing gate (prevention item 3 of #356) to the umbrella's
charly task verify.opencharly#356root-caused a HIGH content loss: the four canonical root narratives —SOUL.md,VISION.md,GRIEVANCES.md,LIBERATION.md— were relocated from the charly submodule root to the umbrella root (where every session is rooted), and the multi-repo cutover landed delete-first — charly#791 removed them and the umbrella PR that added them was auto-closed at the validator's block limit. For a window the files existed in no repository'smain, and every agent surface (AGENTS.md,.opencode/instructions.md,.pi/extensions/charly-gates.ts) pointed atcharly/SOUL.md, a path that no longer resolved. Nothing intask verifyread those surfaces, so no gate could see the loss.New:
scripts/check-root-refs.mjs, wired into theverifyplan with a self-test step. It asserts:AGENTS.md,README.md,.opencode/instructions.md,.pi/extensions/charly-gates.ts) resolves — acharly/<Name>.mdreference whose file now lives at the umbrella root is a STALE-reference FAIL (the exact#356shape). A canonical missing at the root is check 1's failure, so check 2 owns the STALE arm and nothing redundant.The reference walk is scoped to the four canonical files on purpose: matching every
<Uppercase>.mdproduced false positives on legitimate different files (SKILL.md,charly/AGENTS.md), so the gate covers the narrative-relocation class and nothing else. The canonical list is hardcoded, so a cutover that also deletes the reference (not just the file) still trips the gate.Two files changed:
scripts/check-root-refs.mjs(new) andcharly.yml(twoverifysteps). Part of #356 — this is the mechanical gate (prevention item 3); the remaining prevention items (the relocation ordering rule — add-before-delete — and the "do not auto-close a multi-repo cutover's middle producer without a successor" rule) land as rulebook/skill edits, so #356 stays open until those land.How tested
All output below was re-run on the final head
bf7ebfb41bff2fe36231ce52e9e083e420a30214(aftergh pr update-branch; no force-push).The new gate on the current tree (the four narratives are present at the umbrella root after #357; the three surface references were repointed to the bare names):
The self-test — it proves the gate DISCRIMINATES by EXECUTING it against mutated trees (each mutation must turn it RED; a restored tree GREEN):
Every surviving arm is load-bearing — MEASURED by deleting an arm and re-running the self-test (a test that cannot fail without its arm is not coverage):
Removing the STALE push turns its mutation GREEN, so the arm is genuinely exercised. (Check 1 is proven the same way by its own removed-canonical case. The prefixed DANGLING push this gate previously carried was redundant with check 1 — a canonical missing at the root already fails check 1 — so it was removed rather than tested, per the validator's finding.)
The
#356shape reproduced against a temp tree — root narratives present,AGENTS.mdstill pointing atcharly/SOUL.md:The full gate on the final tree —
./charly/bin/charly task verify(the description renders IN FULL — the value is quoted incharly.yml, so the inline#356is not read as a YAML comment):Rulebook compliance
Every applicable rule answered (or
N/Awith a reason):/charly-internals:git-workflow(the landing loop),/charly-check:check(R10/gate authoring),/charly-internals:cutover-policy, and the umbrellaAGENTS.mdrulebook.verifygate).check(); the--self-testdrives the SAME code path against mutated trees (no parallel re-implementation). Check 2 owns only the STALE arm — the missing-canonical case is check 1's, not duplicated.task verify; no ad-hoc shell, no hand-run substitute, no fallback branch.verifygate), not a documentation workaround routing around a defect.verifystep; it touches no generated artifact, label, plan, config schema, or emitted file. (Thecharly.ymledit is the umbrella's own task surface, not a generated artifact.)./charly/bin/charly task verify(the committed binary).task verifyran on the final committed tree (11/11, pasted above).Change classification
verifygate — a newscripts/*.mjschecker + twocharly.ymlverifysteps (the umbrella's own task surface; no submodule edit)../charly/bin/charly task verifyon the final tree — 11/11 PASS, including the two new steps.fully tested and validated— the full gate passed on the final tree and the changed path (the new checker) executed with retained output, plus the self-test proving discrimination.Closes nothing on its own — part of #356 (prevention item 3). Relates to #357 (the restoration this gate would have caught).
Agent:
soul-md· sessionses_ef8af7149ffe5G0oj20EhTQn6VAssisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)