Repository navigation
docs(design): add normative DESIGN.md + DESIGN.cue, TODO.md and the executable design check - #350
Conversation
…xecutable design check DESIGN.md is the target architecture of charly, spec, sdk, every plugin and candy repository: schema patterns S1–S9, parsing/linking/validation, the core↔plugin protocol (§8), the authoring model, ownership (§7.1). DESIGN.cue is its single schema copy (authoring + protocol, CUE v0.17.1). TODO.md is the migration from today's code, evidence at origin/main. scripts/design-*.sh + design/ prove DESIGN.md and DESIGN.cue agree, with CUE v0.17.1 only: pinned toolchain, .md↔.cue consistency, automatic example validation, 61 negative cases asserting rule + reason, and self-tests that plant 37 defects. `charly task design-check` runs it; AGENTS.md rule 12 makes DESIGN.md normative. Closes #346 Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
1. Alongside dispatch: load.cue now dispatches the nodes beside a top-level pod/vm kind key through #AlongsideAlt (one placed-node list, one dispatch); negatives alongside-candy and alongside-local-no-host, self-test row alongside-dispatch. Header and Appendix A.5 state exactly what is dispatched. 2. No claimed enforcement that does not exist: Appendix A.1 and AGENTS.md rule 12 state the design check runs on demand like task verify (no CI gate), its output pasted in the PR body; TODO 0.5, completed by this PR, is removed. 4. One list of the rules.cue rules: §5.4's "Design check" column. The script, rules.cue and Appendix A cite it; design-consistency.sh checks rules.cue emits exactly that set (self-test row rules-emit-drift). (Block 3 — the R2/R8/R9 rows — is fixed in the PR body.) Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
…o the deliverables 1. Schema-pattern references: TODO.md said S1–S8 where §3.1 defines S1–S9. Fixed, and design-consistency.sh now checks every S<n> in DESIGN.md, DESIGN.cue and TODO.md names a §3.1 pattern and every range S1–S<n> ends at the last (self-test rows pattern-range, pattern-unknown). §3.1 no longer restates the pattern count. 2. Appendix A.4 no longer enumerates the marked tables: the markers are the list. 3. Appendix A.5 no longer claims the check catches an unused declared plugin: no control implements it (D-PLUG-6 is core's load-time rule, §5.4). Scope: the operator ruled AGENTS.md and README.md changes out of scope for now, so AGENTS.md, README.md and the charly.yml task entity that backed their maintenance lists are restored to origin/main; Appendix A.1 no longer cites the AGENTS.md rule. TODO 10.1 already carries the umbrella adoption. Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
1. Candy default: DESIGN.cue and §12.2 now say only #InnerOfLocalAlt and #InnerOfAndroidAlt carry the `candy` default; the pod/vm, kubernetes and alongside tables admit no keyless node — matching the schema and the candy-in-pod / alongside-candy negatives. 2. Unmarked mirroring tables: design-consistency.sh now fails any unmarked table whose backticked first column equals a schema source (any struct, word list or tag table). §9.4 gets its keys(#ActionAlt) marker. The control found three tables hand-listing the deployment kinds with no schema source: `_deploymentKind` (derived from #InnerOfMachineAlt — the deployment kinds are exactly what a pod or vm admits) is that source, and §9.1, §12.1 and §12.2 carry its marker. 3. D-PAT-1 enforced: check 6 (the pattern gate) fails a close(), a matchN, a forbidden field ?: _|_, or any open struct other than #Opaque in DESIGN.cue (comments excluded). D-PAT-4 is scoped to the rules about documents and protocol messages; rules about schemas are check 6 and the §22 gates. 4. The duplicate-ID control now fails: its loop reads a file in the current shell instead of setting `fail` inside a pipeline subshell (the only instance of that pattern in the scripts). 5. (PR body) the org search is pasted with its real output. Self-test rows: unmarked-mirror, pattern-close, pattern-open. Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
The verdict on d5ef720 found D-PAT-4 claiming that A.4 check 6 enforces D-PAT-1..3, while check 6 implements only D-PAT-1. D-PAT-4 now attributes D-PAT-1 on DESIGN.cue to check 6 and D-PAT-1..3 on plugin modules to a named §22 gate, which the §22 CI-gate list now carries; TODO 2.16 adds that gate and states that until then only D-PAT-1 has a control. Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
1. Path rule: D-SCH-7 states that every authored path is a literal absolute path; #AbsPath carries the tag and file-variable-path.yaml names it. D-CAP-1 is tagged at #Optional and gets the negative need-optional-not-bool.yaml. 2. Unmarked mirrors: the control now fails an unmarked table whose column 1 contains every name of a source (3+ names) that are most of its words. It found §12.3 (now marked _deploymentKind) and the §9 origin table (now marked keys(#SourceAlt)); A.4 check 1 states the rule; self-test row unmarked-superset. 3. §22 no longer lists the design check as a CI gate; A.1 is the one statement. 4. (PR body) the search is pasted as the plain command output. Claude-Session: https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
Review — PASSHead SHA: Security screen: PASS — no secrets/exfil, no weakened gate, no injected instruction; the only network call is a sha256-pinned CUE toolchain fetch, and the new check is self-scoped, not a redirection of an existing gate. Checklist: All applicable rules PASS or NA. Cross-checks against the current diff/body are internally consistent, so no tool-limited gap rises to a finding:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: docs + tooling — 76 files, all added; no existing file, submodule or CI config touched. Bed-free gate is the correct class, and placement is CORRECT (org-level design doc + org-level check scripts belong at the umbrella root; the schema is explicitly slated to move into Security screen: PASS — no secrets, no exfiltration, no weakened gate; the only network call is the sha256-pinned CUE toolchain fetch in Comment intake
Blocks
I cannot re-run CUE (read-only), so this is derived from the diff plus CUE's field-ordering semantics; every other cross-check I could make reconciles (7 examples, 64 negatives, 27/18 selftest rows all match the diff), which is why this one surviving contradiction is the blocker. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — the BLOCK on Its one finding assumes CUE iterates struct fields in sorted order. CUE v0.17.1 iterates them in declaration order; run on this head: These match the asserted texts exactly, and Agent: |
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause. The ENGINE sent no generation bound ( Durable remedy.
A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
Review — PASSHead SHA: Security screen: PASS — no secrets/credentials, no exfiltration, no obfuscated code; the only network call is the sha256-pinned CUE v0.17.1 fetch in Change class: docs + tooling (all 76 files added: Comment intake
Checklist: All applicable rules PASS or NA. Re-derived cross-checks reconcile: 76 added files ≡ the body's accounting; 64 Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
This PR adds the umbrella's normative design and the executable control that keeps it consistent (closes #346; supersedes #347). It adds the plan's deliverables only, and changes no existing file.
DESIGN.mdis the target architecture of charly,spec,sdk, every plugin and every candy repository. Its sections:osand deployments, with intention-based nesting (Part III);DESIGN.cueis the single schema copy, in CUE v0.17.1: the authoring part and the protocol part. Every rule the schema enforces on a document or a protocol message is tagged// D-…at its enforcing line. The rules about the schema itself (D-PAT-1) are enforced by the pattern gate, A.4 check 6.TODO.mdgives every migration step from today's code. Each step has its current state (evidence re-verified atorigin/mainon 2026-10-03), its DESIGN target, its config migration before → after, and its code work. Adopting the design in the umbrella rulebook is item 10.1.scripts/design-*.sh+design/form the design check, which needs CUE v0.17.1 only:design-cue.sh: the pinned toolchain, sha256-verified;design-consistency.sh:.md↔.cuetables (marked, and unmarked tables that mirror a source), word lists,@ref↔rule lists, rule tags, IDs,§andS<n>references, vocabulary, and the schema-pattern gate;design-examples.sh: automatic validation of every example, through the loader's dispatch and through#Document, plus 64 negative cases that each assert their rule and their error text;design-selftest.sh: planted defects, each of which must be caught;design-check.sh: runs all of the above.No code changes. Each TODO.md item becomes its own issue and PR.
How tested
design-check.shran on the merged headc0add9a(output below);task verifyran on2708ba2. Both ran in the session worktree.worktrees/design-md/opencharly, branched fromorigin/maine042e80, with a clean tree (git status --shortprinted nothing).git diff --stat origin/main...HEAD -- AGENTS.md README.md charly.ymlprints nothing: no existing file is changed.bash scripts/design-check.sh, output with theselftest <name>: caughtlines filtered out bygrep -v ': caught$':./charly/bin/charly task verify(the worktree-local binary, see R9), filtered bygrep -E '^\s+\[(pass|fail)\]'plus the summary line:The umbrella pre-commit hook passed on every change set of this branch, ending
pre-commit: OK.After the PASS on
2708ba2, the branch was brought up to date withmainbygh pr update-branch. That merge adds only #349 (a gitlink sync) and its CHANGELOG file; neither touches a file of this PR, so thetask verifyoutput holds for the merged head, anddesign-check.shwas re-run on it.Supersedes #348 (and #347)
This PR continues #348. The validator auto-closed #348 after its fifth non-PASS verdict (
AI_REVIEW_AUTO_CLOSE_AFTER=5): three BLOCK verdicts and two INCONCLUSIVE notices. The INCONCLUSIVE notices were the whole-request cap class, carried no code finding, and stopped after the operator setAI_REVIEW_REASONING_EFFORT=mediumandAI_REVIEW_ATTEMPT_TIMEOUT=1080. Every finding of every BLOCK verdict on #348 and #347 is fixed on this head; the sections below map each one to its fix. The last verdict's four findings are fixed in one commit,2708ba2. Same branch,feat/design-md.#348 itself continued #347, which was closed on the operator's request so that a fresh review thread starts from the fixed state. #347 collected two BLOCK verdicts and two INCONCLUSIVE notices. The INCONCLUSIVE notices were the provider class — the review model gave no answer within the gate's attempt timeout — and carried no code finding. Same branch; #348 opened at
f89f1bc.Every finding of both BLOCK verdicts is fixed on this head, each with the evidence that it holds:
ab65dd1#1design/example/load.cuedispatches the nodes beside a top-levelpod/vmkind key through#AlongsideAlt, with the same placed-node list as inner nodes. Negative casesalongside-candyandalongside-local-no-host; self-test rowalongside-dispatch.ab65dd1#2ab65dd1#3ab65dd1#4rules.cuerule setrules.cueand Appendix A cite it, anddesign-consistency.shchecks thatrules.cueemits exactly that set (self-test rowrules-emit-drift).dd1ddf4#1design-consistency.shchecks everyS<n>in DESIGN.md, DESIGN.cue and TODO.md against §3.1, and that every range ends at the last pattern (self-test rowspattern-rangeandpattern-unknown). §3.1 no longer restates the count.dd1ddf4#2dd1ddf4#3The root cause these share was a hand-written claim, list or count in prose with no control behind it. Each one now either has a check with a self-test row, or the prose no longer restates the fact.
Scope: the operator ruled changes to AGENTS.md and README.md out of scope for now. This PR changes no existing file —
git diff --stat origin/main...HEAD -- AGENTS.md README.md charly.ymlprints nothing.Changes since the verdict on
f89f1bc(BLOCK, 5 findings)The verdict re-derived all seven #347 findings as fixed. Its five new findings are fixed in one commit (
d5ef720). Their shared root cause was a claim or control that nothing proved, so each fix is a control:#InnerOfLocalAltand#InnerOfAndroidAltcarry thecandydefault, matching the schema and thecandy-in-podandalongside-candynegative cases.design-consistency.shnow fails any unmarked table whose backticked first column equals a schema source: any struct, word list or tag table. §9.4 got itskeys(#ActionAlt)marker. The new control also found three tables hand-listing the deployment kinds with no schema source._deploymentKindis now that source, derived from#InnerOfMachineAlt(the deployment kinds are exactly what a pod or vm admits), and §9.1, §12.1 and §12.2 carry its marker.close(, amatchN, a?: _|_forbidden field, or any open struct other than#Opaquein DESIGN.cue, outside comments. D-PAT-4 is scoped to the rules about documents and protocol messages (its statement about the schema rules is corrected again one7f536b, below).failinside a pipeline subshell. It was the only instance of that pattern in the scripts.2708ba2without--json, so the output is the command's own; see thee7f536bsection):New self-test rows:
unmarked-mirror,pattern-close,pattern-open.The validator re-run that produced this verdict used
AI_REVIEW_REASONING_EFFORT=high. The operator set that org var on 2026-10-04 (opencharly/plugin-review#36, opencharly/.github#133).Changes since the verdict on
d5ef720(BLOCK, 1 finding)The verdict re-derived all five findings on
f89f1bcas fixed. Its one new finding is fixed ine7f536b:DESIGN.cueby check 6, and D-PAT-1..3 on every plugin CUE module by a named §22 schema-pattern gate. The §22 CI-gate list now carries that gate. TODO 2.16 adds it, and says that until it exists only D-PAT-1 has a control. A search of DESIGN.md, TODO.md and the scripts found no other claim about check 6 or the pattern gate.That verdict ran at
AI_REVIEW_REASONING_EFFORT=mediumwithAI_REVIEW_ATTEMPT_TIMEOUT=1080. The operator set both org vars on 2026-10-04, after the first run ond5ef720hit the 15-minute cap.Changes since the verdict on
e7f536b(BLOCK, 4 findings; #348 auto-closed)The verdict re-derived every earlier finding as fixed. Its four new findings are fixed in one commit,
2708ba2:#AbsPathenforced "a path is literal" with no requirement behind it, andfile-variable-path.yamlnamed D-IR-4, which says nothing about paths. New requirement D-SCH-7: every path an author writes is a literal absolute path, starting with/and containing no variable.#AbsPathcarries the// D-SCH-7tag, and the negative case names D-SCH-7. D-CAP-1 is tagged at#Optionaland gets its own negative case,need-optional-not-bool.yaml(optional: "yes"fails withconflicting values "yes" and bool).<!-- schema: _deploymentKind -->and<!-- schema: keys(#SourceAlt) -->. The §7.1 ownership table names words of every source, so it is not a mirror; the majority bound keeps it out, and A.4 check 1 says so. New self-test row:unmarked-superset.--jsonand pasted with its plain output (finding 5 of thef89f1bcsection).The verdict on
c0add9a(BLOCK, 1 finding): does not reproduceThe finding says CUE iterates struct fields in sorted order, so the dispatch message in
design/example/load.cuewould readandroid, kubernetes, local, pod, vmand three expected texts would never match. The reviewer noted it could not run CUE. Run onc0add9awith CUE v0.17.1, a comprehension iterates the fields in declaration order:These are exactly the texts that
candy-in-pod.yaml,alongside-candy.yamland thealongside-dispatchself-test row assert.design-check.shpasses onc0add9a(output in How tested: 64 negatives, and thealongside-dispatchrow reportedcaught). No code changes for this verdict; the validator is re-run on the same head.Rulebook compliance
git -C charly status --shortis empty.git -C <absolute path>from the session worktree. Nothing was run implicitly across a submodule boundary.go.work.worktrees/design-md/opencharlyonfeat/design-md, from freshorigin/maine042e80. The shared checkout is untouched.task policy-bpassed in the pre-commit hook and intask verify.task verifypassed./charly-internals:git-workflow(with references/pre-validator-self-audit.md),/charly-internals:root-cause-analyzerand/charly-internals:skillsbefore any git or PR action.S<n>,rules.cue-emission and spelling checks. Landing anomalies each got their own RCA: a stale shared binary was replaced by the worktree build, andtask harnesswas found folded into verify by #341.rules.cuerules. Examples are extracted at run time and never committed as copies. One self-test runner serves both checks.-F <file>requirement was followed, not bypassed.bash scripts/design-check.sh) is named as maintenance this project performs, not as a step a charly user runs.main.task verifyand the design check ran on the final tree of this head. Output is pasted above.cue vetagainstDESIGN.cue(stage 3 above).charly/scripts/bootstrap-charly.shand invoked through the worktree'scharly/bin. It reports version2026.276.1041, the CalVer of the pinned charly commitfe4b00b. The gitlink and the checkout are bothfe4b00b44b469a7d947a48a85ce206bf37b27310, and the checkout is clean. It is never installed as a shared binary.design-cue.shdownloads the real release archive and verifies its published sha256.Change classification
.md,.cue,.tsvand.yamldesign files and five bash scripts, so it is not documentation-only. It changes no existing file.bash scripts/design-check.shand./charly/bin/charly task verifyon the final tree.task verifypassed on the final tree, and the changed paths (the design-check scripts) were executed live.https://claude.ai/code/session_01VQ3NL7BVepzGaJMpRL4F3P
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)