Repository navigation
feat: plan kernel spike, engine-neutral conformance suite, and the plan laws in Agda (ADR-0003, proposed) - #76
hyperpolymath wants to merge 16 commits into
Conversation
…formance suite Refines ADR-0002 without selecting an engine. - Separates an untrusted planner from a small trusted kernel that checks and applies a plan, so the ADR-0002 safety invariants are stated once. - Two tiers on one plan format: a minimal engine (kernel plus published plans) and a composer (planner on top of the same kernel). - Composition is a partial join that refuses conflicts; lists the laws to prove. Nothing is claimed proved. - Records that hybrid-automation-router's resource-graph/plan meta-model is the same model (its 115 tests pass at 0176b7d, run 2026-11-17) and leaves the kernel's home and the graph carrier as owner decisions. - verification/conformance/README.adoc specifies plan format v0.1, the command-line protocol, refusal codes, case layout and levels. Its Evidence section is empty: no runner, case or engine exists yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
Add verification/proofs/agda/PlanLaws/, a self-contained Agda development (no agda-stdlib, no .agda-lib) of the algebra of plan composition and application that ADR-0003 "Composition is a join, not an overwrite" lists. Model: paths and contents abstract with decidable equality; a desired state is a file with content or absent; a plan is a list read through lookup (first entry wins), compared by pointwise equality of lookup (≈, no function extensionality); the join returns a conflict naming a path or the union; apply overrides a total file system at the paths a plan mentions. Preconditions are kept out of the algebra and brought back in PlanLaws.Kernel as a refinement. Proved: conflict-sound, conflict-complete, join-lub, join-defined-sym, join-comm, join-assoc with join-assoc-defined (either side defined iff pairwise compatible), join-idem, join-cong; apply-idem, apply-join, apply-comm and its converse commute-compatible (apply-comm-iff), apply-faithful; safe-join (per-path safety) and plan-safe-join with the counterexample plan-safety-not-preserved (plan-level clash safety is NOT preserved by join); the total semilattice on outcomes (⊔ᴼ-comm, ⊔ᴼ-assoc, ⊔ᴼ-idem, ⊔ᴼ-unit, ⊔ᴼ-cong); kapply-refines, kapply-refuses, unique-functional, kapply-idem. Verified with the upstream Agda 2.7.0.1 release binary: cd verification/proofs/agda && agda --safe --without-K --cubical-compatible PlanLaws/All.agda checks every module with exit 0 and no warning. Import cone: the nine PlanLaws modules plus Agda.Primitive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
…ntrols
scripts/check-plan-laws.sh checks verification/proofs/agda/PlanLaws with
the PROOF-POLICY §2.1 invocation on a fresh copy (no stale .agdai), and
fails if agda is absent or not the pinned 2.7.0.1; if any file's first
line is not the canonical OPTIONS pragma or it has any other pragma; on a
hole or trust primitive; on an Agda error or warning; on a postulate in
the first-party import cone (scripts/scan-postulates.sh, copied unchanged
from hyperpolymath/mathesis 770e565, itself adopted from the januskey
reference gate PROOF-POLICY §8.4 names); if the prover-supplied
postulates of the cone differ from the recorded trusted base (the four of
Agda.Primitive, by name and BUILTIN binding); and if any PlanLaws file is
outside the import cone of PlanLaws/All.agda.
--controls runs the negative controls in tests/reject/PlanLaws/Controls
(a false last-writer-wins lemma, a postulated plan-safety law, a
TERMINATING loop, a hole, a --with-K OPTIONS line) plus a generated
orphan module with a postulate; each must be refused for the reason its
EXPECT-REFUSED line names.
New just recipes proof-check-plan-laws and proof-check-plan-laws-controls
run both, and proof-check-all runs them first. *.agdai is ignored.
Verified: `just proof-check-plan-laws` -> RESULT: PASS;
`just proof-check-plan-laws-controls` -> RESULT: PASS (6 of 6 control(s)
refused, each for its expected reason). Meta-checked by hand on a copy:
a valid file placed among the controls makes --controls fail
("ACCEPTED by the gate"), and importing Agda.Builtin.String into the root
makes the gate fail on the trusted base (Char, String). shellcheck clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
Add a "Theory claims" section to docs/status/PROOF-STATUS.adoc: one row per theorem with its statement as proved, file:line, the PROOF-POLICY §5 token (`proven` for the Agda leg), the PWG and both recheck legs, plus the invocation, checker, library cone (none), trusted base, equality notions and model scope that every row shares. Grade: `ungraded` for every row. PROOF-POLICY §8.2 grants PWG-3 only with a receipt recording version, library pin, flags and cone, and §8.4 derives grades from receipts. The check ran on a local commit that is not on main, so no receipt is recorded; a draft receipt for 35583f1 passes the canon reader (bun 1-formats/deed/tools/deed_lint.js --proof-receipt-json, standards 58362c24) and derives PWG-3 for all 19 claims, so the missing piece is a receipt for the commit as it lands on main. Rocq and Lean legs: open. Also: replace "Overall: 0% proven" with a census (§8.4 forbids percentages); record the §6 deviation (Agda 2.7.0.1 from the upstream release archive, digests given, no Guix in the session, no CI lane yet); note the Creusot/Pearlite and Verus obligation for a future Rust kernel; add the remaining legs and the receipt to "Proofs Remaining"; list the new recipes; show PlanLaws/ in verification/proofs/README.adoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
Law 2 said:
. a join of safe plans is safe;
It now says:
. every path of a join of safe plans is safe, but the join is a safe plan
only when no path of one plan clashes with a path of the other
(case-fold collision or directory prefix), so the kernel checks
plan-level safety again on the composed plan;
Why: plan format v0.1 ("Safe paths") defines a safe plan by per-path
conditions and by two plan-level conditions (no case-fold collision, no
proper directory prefix). Per-path safety is preserved by join
(PlanLaws/Safety.agda safe-join-ok). Plan-level safety is not:
plan-safety-not-preserved proves that two one-entry plans at clashing safe
paths are each plan-safe, are compatible, and join to a plan that is not
plan-safe, and PlanLaws/Example.agda instantiates it with README.adoc and
readme.adoc. plan-safe-join proves the exact condition: for plan-safe p
and q with a defined join, the join is plan-safe iff no path of p clashes
with a path of q. Checked with `just proof-check-plan-laws` (Agda 2.7.0.1,
--safe --without-K --cubical-compatible): RESULT: PASS.
Laws 1, 3 and 4 hold as worded and are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
verification/conformance/run.sh implements the runner the conformance README describes: --kernel "<cmd>" [--planner "<cmd>"] [--level L0..L3] [--cases DIR]. For each case at or below the level it copies the inputs and before/ into a fresh sandbox and runs the case's kind (check, instantiate, apply, apply-twice, plan). Assertions: exit 0 / 10 / other (= crash = fail); for a refusal, the stdout object's `refused` equals the expected code, the output is JCS, the target is byte-identical (files, links, directories, exec bits) and no receipt or instantiated plan is written; for success, the tree equals expected/ exactly, the receipt is JCS with the plan digest and the plan's paths, and apply-twice leaves the tree identical with only unchanged/already-absent. Every case also asserts nothing was written in the sandbox outside the target (sibling "outside" directory, inputs, engine cwd), so path escapes are caught even when they land elsewhere. One line per case (ok/FAIL/SKIP + id + reason), totals per level; exit 1 on any FAIL or any SKIP at or below the level, 2 when it cannot run (including when no case is found). Planner cases without --planner are SKIP. Commands are split with `read -a` (no eval, no globbing). Verified: shellcheck 0.9.0 reports nothing on run.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
cases/kernel/L0/<id>/ holds case.json (JCS, naming principle and source), plan.json, blobs/sha256/<hex>, answers.json, before/ and expected/ as each kind needs. gen-cases.sh (Bash + jq + coreutils) derives every blob hash, plan serialisation and case.json, and `gen-cases.sh --check` regenerates into a temporary directory and diffs against the committed fixtures (generate-and-diff). Coverage: ok cases mint-minimal, apply-twice-idempotent, already-realised, update-expected-content, delete-already-absent, mode-755, check-open-plan, instantiate-two-holes, child-identity (the publisher's name appears nowhere in the child). Refusals: MALFORMED x4 (not JSON, not JCS, missing field, unknown member), PLAN_VERSION, SOURCE_UNPINNED x2, PATH_UNSAFE x9 (.., absolute, backslash, empty segment, .git, .GIT, control char, non-NFC, and via check), PATH_DUPLICATE x2, PATH_COLLISION x2, BLOB_MISSING, BLOB_MISMATCH, OPEN_PLAN, HOLE_UNFILLED, HOLE_UNKNOWN, RESIDUE, PRECONDITION x6 (including all-or-nothing on the last op and an ancestor that is a file), TARGET_SYMLINK x2 (ancestor, leaf), TARGET_INVALID x2. cases/.gitattributes sets `-text` so git never rewrites fixture bytes. Verified: `gen-cases.sh --check` reports the committed cases match; `ijson-jcs check` passes every .json except the two deliberately non-canonical plan.json fixtures (malformed-not-json, malformed-not-jcs); shellcheck reports nothing on gen-cases.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
controls/ holds deliberately wrong kernels; selftest.sh runs the suite against each and fails if any of them passes (or if the runner cannot run on one), listing the cases that caught each control. - naive-kernel.sh: writes every operation with no check at all. - no-atomicity-kernel.sh: checks the plan carefully (JCS, version, shape, pins, holes, paths with an ASCII-only stand-in for NFC, order, collisions, blobs) but checks the target op by op and writes as it goes. Its only intended defect is the missing check-then-write phase. - refuse-all-kernel.sh: refuses everything, so "never writes" cannot pass for "safe". Verified: `selftest.sh` exits 0 at L0 with this output summary: naive-kernel.sh caught by 39 of 45 cases; no-atomicity-kernel.sh caught by 2 of 45 (all-or-nothing, target-symlink: both leave the first write behind); refuse-all-kernel.sh caught by 41 of 45. shellcheck reports nothing on selftest.sh and controls/*.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
src/kernel/ is a Cargo workspace (the root allowlist has no Cargo.toml, and src/ is the allowed source tree): - plan-kernel (library): the pure decision core. No dependency beyond std, #![forbid(unsafe_code)], no I/O. JSON value + RFC 8785 canonical serialiser (number-free; plan v0.1 has no numbers), closed-world plan well-formedness and pins, safe paths, order/uniqueness/case-fold and prefix collisions, blob integrity, the refuse-or-exact-effects decision over lstat observations, instantiate (single-pass substitution, residue), receipt, and an in-memory target model. SHA-256 and NFC are injected via the Prims trait. Neutral names only: it is the candidate for HAR's planned har-il (see its README). - scaffoldia-kernel (binary): the I/O edge. check / instantiate / apply per the conformance README; exit 0 / 10 (refusal JCS on stdout) / 1 (I/O) / 2 (usage). Never follows links: lstat observation, all ops decided before the first write, directories created one component at a time with re-checks, writes via O_CREAT|O_EXCL temp file + rename. Dependencies: serde_json 1.0.154, sha2 0.10.9, unicode-normalization 0.1.26 (pinned by the committed Cargo.lock). PROOF-PLAN.adoc names Creusot (Pearlite contracts) and Verus, the functions and properties (containment, uniqueness, pins, all-or-nothing, precondition soundness, idempotence, no residue, canonical form); every row is `not run`: the Verus release download got HTTP 403 through the session proxy, and the Creusot driver is not on crates.io. Verified: `cargo test` 22 passed (19 core incl. fixed-seed property tests for apply∘apply = apply, all-or-nothing and permutation-then-sort, 3 edge); `cargo clippy --all-targets -- -D warnings` clean; `cargo fmt --check` clean; `verification/conformance/run.sh --level L0 --kernel src/kernel/target/release/scaffoldia-kernel` gives 45 ok, 0 FAIL, 0 SKIP. Toolchain: rustc/cargo 1.97.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
The example under 'Plan format v0.1' presents a JCS-serialised plan (line breaks aside) but listed the write op's members as expect, mode, op, path, blob, source. JCS sorts members by UTF-16 code units, so blob comes first. Reordered; no other change. Verified: the reordered member order equals the order jq -cS and the kernel's canonical serialiser emit for the same op (see cases/kernel/L0/mint-minimal/plan.json). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
Adds to "Case layout": expect.results, expect.tree_excludes and target (additive fields the L0 cases use), that a missing before/ or expected/ is an empty tree, how trees are compared (accepted: files, links, exec bits; refused: also directories), and the sandbox rule that any write outside the target fails the case. Marked as pending ratification; the reading choices behind them are listed with the work order's spec questions, not silently made normative. Verified: run.sh's validate_case accepts exactly these fields' values (jq schema in run.sh) and all 45 committed case.json files pass it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
build/just/conformance.just, imported from the Justfile in the same style as the other build/just/*.just files: - kernel-build: cargo build --release --locked of src/kernel/. - kernel-check: cargo test, clippy -D warnings and fmt --check. - conformance: kernel-build, then gen-cases.sh --check (fixtures match their generator), run.sh --level L0 against the release binary, and selftest.sh --level L0 (every negative control must fail). Verified: `just conformance` exits 0 (45 ok, 0 FAIL, 0 SKIP; selftest PASS, 3 controls); `just kernel-check` exits 0. `just validate` fails exactly as on the base commit (validate-rsr: licensing/ exhibits missing; validate-ai-install: 2 issues); outputs compared with diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
…case
- residue-from-answer (RESIDUE): an answer whose value is itself a
token ({"OWNER":"{{REPO}}"}). Substitution is one pass and residue is
checked on the result, so an answer cannot smuggle template text in.
- instantiate-literal-answer (ok): an answer containing & | \1 $HOME
backticks "{{ y }}" and / renders byte for byte. Source: the existing
control in rsr-template-repo tests/e2e/use_template_mint_test.sh,
listed as SC-T-002 in the T6 engine-neutral mint-defect list.
The other T6 L0 rows describe reference-mint content, answer validation
or source resolution and need a planner or a plan-format change; they
are listed in the work-order report, not forced into kernel cases.
Verified: gen-cases.sh --check matches (47 cases); run.sh --level L0
against the Rust kernel: 47 ok, 0 FAIL, 0 SKIP; selftest PASS, and the
naive and no-atomicity controls are both caught by residue-from-answer
(each substitutes repeatedly, so {{REPO}} inside an answer is expanded
again instead of being refused). shellcheck clean (one intentional
SC2016 suppressed with a reason).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
Evidence section of verification/conformance/README.adoc: the command (`just conformance`), the commit it ran at (35752ee on wo/KERNEL) and the observed totals: 47 ok, 0 FAIL, 0 SKIP at L0; selftest PASS with naive (40/47), no-atomicity (3/47: all-or-nothing, target-symlink, residue-from-answer) and refuse-all (43/47) controls failed by the suite. States what is not claimed: no L1-L3 or planner cases, local not CI, verifiers not run. docs/status/ROADMAP.adoc: one ticked M0 line saying exactly that; the existing "prove ... in CI" item stays open. Verified: the quoted lines are copied from the run's output (exit 0, from a clean src/kernel/target/). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
…ses as backlog Owner decisions of 2026-11-17, given through the question selector: - the plan kernel's long-run home is the hybrid automation router, consumed here as a pinned module; the spike crate stands in until then; - deed for declarations, I-JSON/JCS for plans; - Scaffoldia's first retrofit is itself (118 .a2ml files, no chora deed); - no separate control-plane repository (standards#636); - toolchains derived from the deed's declared languages (standards#698). Open questions raised by the Agda laws and the kernel spike are listed, not settled. verification/conformance/backlog/cases-from-mint-defects.jsonl carries 72 engine-neutral cases derived from rsr-template-repo mint defects (issues #200, #201, #203, #205, #211, #269, #280, #309) and from ADR-0002's negatives. They are data: nothing runs them yet. Two were already taken into the L0 suite. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
|
A note on the one red check, so it is not read as caused by this branch. E2E — smoke fails here the same way it fails on What this branch adds is not yet run by CI at all: the Automated review did not run on this PR: CodeRabbit skipped it (271 files, most of them case fixtures) and Codex reported its usage limit. Generated by Claude Code |
The E2E job ran the inherited Idris2/Zig harness, which needs idris2 and zig that no runner step provides, so it failed on main and on every pull request, and it tested an inherited scaffold that the README and ADR-0002 call unproven. Owner decision 2026-11-17: retire E2E until Scaffoldia can mint end to end; the required check is the highest conformance level passed, `Conformance L0` today. e2e.yml (name kept: actions.lock key) now has one job, `Conformance L0`, which runs verification/conformance/check-l0.sh. `just conformance` calls the same script, so the command list lives in one place. The pull_request paths filter is dropped so the required check always reports. No `uses:` line changed. tests/e2e.sh is kept, marked as not run by CI. `just test` now runs the conformance suite; `just test-all` no longer lists e2e. Docs that presented E2E as a gate are corrected; ROADMAP records the owner step (ruleset context `E2E — smoke` to `Conformance L0`). Not yet run on GitHub. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD
|
Important Review skippedToo many files! This PR contains 276 files, which is 176 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
|
|
Two notes on the checks after 0aa489a, which replaces the
The latest run on gh actions-lock --no-migrate-local-actions
Generated by Claude Code |
…tep (#1665) ## Summary Follows #1661. The owner's decisions of 2026-11-17 (round three and four) asked for a live retire-check before any kyX work, then for the two files it reports deletable to be deleted and the check wired into CI. This pull request does those three things. Why a tool first: the measurement in `docs/triage/2026-11-17/a2ml-measure.adoc` found that 0 of 278 `.a2ml` files across the measured repos met the three deletion conditions in `.claude/CLAUDE.md`, and that kyX alone would unblock none. So the list of what blocks each file has to be recomputed from the tree, not kept by hand. ## Changes **The retire-check** (`scripts/a2ml-retire-check.sh`) - For every tracked `.a2ml` file it recomputes the family, the mapping spec, the target deeds, the three deletion conditions (facts, lint, readers) and a closed list of blockers. A file with no blocker is `deletable-now`. - Rulings that cannot be read from the tree live in one data file, `.machine_readable/a2ml-retire-rulings.jsonl` (12 rows), so a ruling moves files between classes without a code change. - `--check` is the gate. It fails when a file is deletable and still present (it prints the `git rm` and the ledger line), when a file fits no class, when the committed counts (`.machine_readable/a2ml-retire-counts.json`) differ from the tree, and, with `--base REV`, when an A2ML path joined since REV. The total can only fall. - Documented in `docs/wikis/maintainers/index.adoc` (`[[a2ml-retire-check]]`), with the deletion recipe. **The first two deletions** (authorised by the owner through the selector on 2026-11-17; one commit each) - `1-formats/sub-specs/cartridges/0.2-AI-MANIFEST.a2ml` and `docs/wikis/0.2-AI-MANIFEST.a2ml`. Both are directory manifests, dropped under the ruling "directory manifests are derived, not stored". No tool read either file. - Each commit removes the file's line from `.machine_readable/a2ml-legacy-allow.txt`, adds a row to `9-archive/A2ML-REMOVED.adoc` (size, sha256, blob id, what it held) and regenerates the counts. `docs/wikis/README.adoc` no longer tells the reader to keep the removed file in step. **The CI step** - `.github/workflows/self-test.yml`: a `run:` step, "A2ML retire-check", after "A2ML stays archived", with the pull request's base as `--base`. No `uses:` line changes, so `actions.lock` is untouched. **Departures met on the way** - `Justfile`: `just llm-context <role>` fell back to `cat 0-AI-MANIFEST.a2ml`, a file that no longer exists. It now names `0-AI-MANIFEST.deed`. - `0-AI-MANIFEST.deed`: the education-layer route named `docs/wikis/0.2-AI-MANIFEST.deed`, which has never existed. Removed. - `.machine_readable/departures.jsonl`: one new row (20 in all) for `standards_chora.deed`'s `:evidence-source` pointer at `STATE.a2ml`. It cannot be fixed until the STATE journal is removed (work order W14). ## State after this pull request 165 tracked `.a2ml` files in `standards` (167 before). By class: 80 governed by a ruling that drops them once its condition is met, 78 with no mapping spec, 3 covered but still read, 4 waiting on kyX, 0 deletable now, 0 unclassified. ## Testing Run in the cloud container on the branch head: - `bash scripts/a2ml-retire-check.sh --check --base origin/main` → `OK (165 file(s); none deletable now, none unclassified; counts current; no A2ML path joined since origin/main)`. Before the second deletion the same command exited 1 and named the remaining file. - `scripts/tests/a2ml-retire-check-test.sh` → 47 passed, 0 failed (fixtures for each class and blocker, negative controls, mutants of the gate). - `scripts/tests/check-a2ml-archived-test.sh` → 26 passed; `bash scripts/check-a2ml-archived.sh .` → OK. - `scripts/tests/departures-test.sh` → 120 passed; `bash scripts/departures.sh check` → 20 of 20 rows present. `ijson-jcs check` on the ledger → canonical. - `bun 1-formats/deed/tools/deed_lint.js 0-AI-MANIFEST.deed` → OK. `just llm-context nosuchrole` prints the deed. - `actionlint .github/workflows/self-test.yml` → clean. - The whole light shard (`SHELL_TEST_SHARD=light bash scripts/run-shell-test-suite.sh`), run before the last two small commits: 151 of 155 files passed. The four that failed need tools this container lacks (`gh-actions-lock-contract-test`, `js-runtimes-test`, `prune-stale-test`, `science-ci-security-test`); they fail the same way on `main` here. After the last two commits I re-ran only the suites they touch (listed above). Not established: - The new CI step has not yet run on GitHub. It needs bun, jq and full history, which the job already sets up. - The tool does not see readers in other repositories, except those named in the rulings file, and does not see glob readers. - For families other than CLADE, STATE and the scorecards, facts are not compared field by field; such a file is reported `facts-unchecked` and is never classed deletable. ## Beyond this repository The same tool takes `--root DIR --repo NAME`, so it can measure any estate repo. In Scaffoldia it reports 71 deletable directory manifests; removing them is planned as Scaffoldia's first kernel-checked retrofit (work order S10), after hyperpolymath/scaffoldia#76 merges. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD)_ --------- Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>



Summary
Scaffoldia's first executable engine code, the test suite any future engine is judged by, and the CI check that runs it. It does not select an engine (ADR-0002's gate stands) and does not tie anything to
rsr-template-repo's mint scripts.The idea, proposed as ADR-0003: split an untrusted planner (any language; composes a plan) from a small trusted kernel (checks a plan is safe, applies it, refuses anything it cannot show safe). A minimal engine is the kernel plus published plans; the composer is a planner on top of the same kernel. That is the "one system at two sizes" the owner asked for on 2026-11-17.
Partly addresses #70 (does not close it).
One owner step is needed before this can merge. The required check
E2E — smokeno longer exists (see "CI gate" below). In the branch ruleset forhyperpolymath/scaffoldia, replace the required status checkE2E — smokewithConformance L0. Until then this pull request, and every other one, waits on a check that no longer reports.Changes
docs/decisions/0003-plan-kernel-tiers-and-conformance.adoc— proposed ADR. Records the owner decisions of 2026-11-17 (the hybrid automation router is the kernel's long-run home, consumed as a pinned module; deed for declarations and I-JSON/JCS for plans; Scaffoldia's first retrofit is itself; no separate control-plane repo; toolchains derived from the deed; the CI gate is conformance levels) and four open questions the proofs and spike raised.verification/conformance/— specification of plan format v0.1, the command-line protocol and a closed list of refusal codes;run.sh(engine-neutral runner); 47L0kernel cases with a generator; three deliberately wrong kernels andselftest.sh, which fails if the suite passes any of them;check-l0.sh, the one command list behind bothjust conformanceand CI.verification/conformance/backlog/cases-from-mint-defects.jsonl— 72 engine-neutral cases derived from real mint defects (rsr-template-repo #200, #201, #203, #205, #211, #269, #280, #309). Data only; most need a planner and are not runnable yet.src/kernel/— Rust workspace.plan-kernelis the pure core (no dependencies,#[forbid(unsafe_code)], no I/O, nothing Scaffoldia-specific so it can move to the router).scaffoldia-kernelis the thin binary (check,instantiate,apply).verification/proofs/agda/PlanLaws/— nine Agda modules stating and proving the plan-composition laws;scripts/check-plan-laws.shand six negative controls.docs/status/PROOF-STATUS.adoc,docs/status/ROADMAP.adoc,build/just/recipes (just conformance,just kernel-check,just proof-check-plan-laws).One law in the first draft of the ADR was wrong and is corrected here: a join of two individually safe plans is not always a safe plan (one pack writes
README.adoc, anotherreadme.adoc). The proof gives the exact condition, and the consequence for the kernel is that plan-level safety must be re-checked after composing.CI gate (owner decision, 2026-11-17).
E2E — smokerantests/e2e.sh, the unmodified template harness. It needs idris2 and zig, which the job never installed, so it failed onmainand on every pull request; and it builds the inherited Idris/Zig scaffold that the README and ADR-0002 say not to rely on. The owner chose to retire "E2E" as a concept until Scaffoldia can mint something end to end, and to name the required check after the highest conformance level the engine passes..github/workflows/e2e.yml(file name kept): one job,Conformance L0, which runsverification/conformance/check-l0.sh. The checkoutuses:line is unchanged and no action was added. Thepaths:filter onpull_requestis removed, because a required check skipped by a path filter never reports. A block of commented-out template examples was deleted.tests/e2e.sh: kept, with a header saying it is not run by CI and is not a merge gate. Whether the Idris2/Zig seam stays is the open P0 item in the roadmap.Justfile:just testnow runs the conformance suite (it ran idris2 and zig and failed for anyone without them);test-allno longer includes the old harness.docs/status/ROADMAP.adoc,docs/status/TEST-NEEDS.adoc,docs/architecture/TOPOLOGY.adoc,verification/conformance/README.adoc: corrected so nothing presents the old harness as a gate.RSR Quality Checklist
Required
just validatefails identically before and after this PR.cargo fmt --checkclean)cargo clippy --all-targets -- -D warnings, shellcheck)unsafeblockspostulatein the Agda coneAs Applicable
docs/decisions/anddocs/status/ROADMAP.adocupdated.a2mllines in this template do not apply: A2ML is retired and this PR adds no fact to any.a2mlfile (0 touched).Testing
On GitHub, at the branch head
0aa489a:Conformance L0passed (run 44140030544, 34 seconds). This is the first run of the new check on a hosted runner.lint-workflowsfails, as it does onmain(see below). Every other check that ran passed.Run in the cloud container on the branch head:
bash verification/conformance/check-l0.sh(whatjust conformanceand the CI job run) →L0: 47 ok, 0 FAIL, 0 SKIP, thenselftest: PASS (3 controls, each failed by the suite at L0).run:body, extracted from the workflow withyqand run in a clean clone: exit 0, same summary. With the kernel deliberately broken in that clone (path checks ignored): exit 1,L0: 38 ok, 9 FAIL.cargo testinsrc/kernel→ 22 passed (19 core, 3 binary), 0 failed.just proof-check-plan-laws→RESULT: PASSunder--safe --without-K --cubical-compatible, Agda 2.7.0.1, no library, no postulate.just proof-check-plan-laws-controls→ 6 of 6 controls refused, each for its expected reason.tests/workflows/check-workflow-uses-lock_test.shandtests/workflows/validate_workflows_test.sh: exit 0 before and after the workflow change.What is not established:
src/kernel/plan-kernel/PROOF-PLAN.adoclists eight properties and marks every onenot run. No contract annotations were added.ungraded. They check locally, but a grade needs a receipt for a commit onmainfrom CI; the Agda check is not in CI yet (the runner's packaged Agda is older than the version used). Rocq and Lean recheck legs are not done.scripts/check-workflow-uses-lock.shexits 1 before and after this PR for an unrelated, pre-existing reason (static-analysis-gate.ymluses an action missing fromactions.lock).lint-workflowsand other required contexts listed in P0: reconcile merged PR #68/#69 follow-ups before claiming readiness #70 are not fixed here.justrecipes still call idris2 or zig (lint,fmt-check,build,release,test-smoke), sojust qualitystill fails without those tools. That waits on the P0 decision about the seam.L1–L3have no runnable cases.Screenshots
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01J4QvDfhy8tVtwc5dx1A3nD