From 0c4fda30d7dd6a985ca89f0c42771729738d569d Mon Sep 17 00:00:00 2001 From: CLAUDE <355856132+HoTT-stuff@users.noreply.github.com> Date: Thu, 26 Nov 2026 02:38:00 +0000 Subject: [PATCH 1/2] chore(sync): take the template's arrival-pack engine at 55508e6 Carries the template's arrival-pack engine here, as merged in rsr-template-repo#441, #454, #455, #464 and #465: - arrival-pack.ncl, extract.sh, claude-md.k9.ncl and the engine README are the template's files, unchanged. - scripts/deed-field.sh is the template's reader (line-wise tokeniser and the --kv mode the engine now uses). - tests/workflows/arrival_pack_anchor_override_test.sh gains the AGPL and Constraints-line controls; arrival_pack_derived_facts_test.sh is new and is wired into estate-rules.yml as one step. - CLAUDE.md regenerated from this repo's deed: it now points to the standards STANDING-RULES.adoc first and names chora-registry and metadatastician/standards. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_0136P7Zoc4g7WLgAwdMTnzPM --- .github/workflows/estate-rules.yml | 5 + .machine_readable/arrival-pack/README.adoc | 84 ++++- .../arrival-pack/arrival-pack.ncl | 150 +++++++- .../arrival-pack/claude-md.k9.ncl | 13 +- .machine_readable/arrival-pack/extract.sh | 93 ++++- CLAUDE.md | 6 +- scripts/deed-field.sh | 120 +++++-- .../arrival_pack_anchor_override_test.sh | 37 +- .../arrival_pack_derived_facts_test.sh | 336 ++++++++++++++++++ 9 files changed, 787 insertions(+), 57 deletions(-) create mode 100644 tests/workflows/arrival_pack_derived_facts_test.sh diff --git a/.github/workflows/estate-rules.yml b/.github/workflows/estate-rules.yml index dd3f67c0..f0c89402 100644 --- a/.github/workflows/estate-rules.yml +++ b/.github/workflows/estate-rules.yml @@ -109,6 +109,11 @@ jobs: # An anchor that allows an estate-denied language must show in the pack. - name: Arrival pack renders both sides of an anchor override run: bash tests/workflows/arrival_pack_anchor_override_test.sh + # The pack states what the tree shows: the tracked legacy .a2ml files and + # the clauses the deed has. A partly migrated child must get no false line, + # and a deed with content after its closing ")" is refused (as deed_lint.js). + - name: Arrival pack derives the .a2ml count and the deed's clauses + run: bash tests/workflows/arrival_pack_derived_facts_test.sh - name: Verify session envelope controls run: bash tests/workflows/session_contracts_test.sh - name: Verify mint cleanup controls diff --git a/.machine_readable/arrival-pack/README.adoc b/.machine_readable/arrival-pack/README.adoc index 8c857014..11c86cfa 100644 --- a/.machine_readable/arrival-pack/README.adoc +++ b/.machine_readable/arrival-pack/README.adoc @@ -11,14 +11,16 @@ the repo's own machine-readable truth. [source] ---- _chora.deed extract.sh arrival-pack.ncl CLAUDE.md -+ anchors/ANCHOR ──▶ (deed → JSON, ──▶ (Nickel projection ──▶ region between - the thin reader) = the engine) BEGIN/END markers +(incl. its (anchor (deed → JSON, (Nickel projection region between + (golden-path))) ──▶ the thin reader) ──▶ = the engine) ──▶ BEGIN/END markers ---- Two halves of the generated region: * *Estate-common* — identical in every repo; the Manifesto doctrine + format-family - orientation + canon pointers + language policy. Pinned to a Manifesto SHA once + orientation + canon pointers + language policy + the proof guidance (which + prover for which obligation; moved in from hand-authored text on 2026-11-15 + so a wording fix reaches every repo by regenerating). Pinned to a Manifesto SHA once the wording is ratified (today: `DRAFT-unratified`). * *Repo-specific* — projected from this repo's deed: identity, IS / IS-NOT, position, constraints, golden path, state. @@ -29,11 +31,72 @@ over the former CLADE / ECOSYSTEM / AGENTIC / STATE records (rsr-template-repo#2 comes from its `(anchor (golden-path))` clause. CLAUDE.md is a *view*. Content outside the `ARRIVAL-PACK:BEGIN/END` markers is hand-authorable and preserved. +== Facts the pack derives instead of asserting + +The pack once said in every repo that there are no `.a2ml` files and that +ANCHOR, AGENTIC, ECOSYSTEM, STATE, NEUROSYM and PLAYBOOK are deed clauses. +That is true of this template. It is false in a repo that took the pack while +its remaining A2ML still waits for conversion (kyX, ruling D313). So +`extract.sh` reports two facts about the tree, and `arrival-pack.ncl` states +only what they show: + +* *The tracked `.a2ml` files* (`git ls-files '*.a2ml'`, each path once). With + none, the region says there are none. Otherwise it gives the count and says + the files are read-only pending conversion. Outside a git work tree nothing + is tracked: every `.a2ml` file under the tree except `.git/` is counted + instead, and the region says the repo "contains" them, not "tracks". +* *The clauses the deed has*, asked with `scripts/deed-field.sh --has`: + `(anchor)`, `(agentic)`, `(ecosystem)`, `(status)`, `(maturity)`, + `(neurosym)`, `(playbook)`, `(meta)` and the three sub-clauses of + `(bot-directives)`. A clause the deed lacks is listed as not yet in the deed, + and every line that reads it (the table rows, IS, IS-NOT, Where it sits, + Constraints, State) says so; none renders an empty value. + +For an absent clause the region names a legacy file only if that file is +tracked: `ANCHOR.a2ml`, `AGENTIC.a2ml`, `ECOSYSTEM.a2ml`, `STATE.a2ml`, +`NEUROSYM.a2ml` or `PLAYBOOK.a2ml` in any directory (the name is matched without +regard to case), and any tracked `.a2ml` file under a `bot_directives/` +directory for `(bot-directives)`. The match is by file name; the pack does not +read the file. + +This template gets the same bytes as before: its deed has every clause and +every field the pack reads, and its tree tracks no `.a2ml` file. That is not +true of every such repo. A deed that has a clause without the field the pack +reads from it (a `(status)` with no `:phase`) used to render an empty value and +now renders "not declared". + +Deleting or converting a legacy file changes the region, so +`just validate-claude-md` reports drift until `just claude-md` is run again. +Both commands read the git index, not the work tree, so the order matters: + +. stage the removal (`git rm .a2ml`); +. regenerate (`just claude-md`); +. stage the result (`git add CLAUDE.md`), and commit the two together. + +A file deleted on disk but not staged still counts. The pre-commit hook runs on +every commit for this reason: pre-commit passes no deleted path to a `files:` +filter. Controls: `tests/workflows/arrival_pack_derived_facts_test.sh`. + +`extract.sh` also refuses a deed that is not exactly one form. `deed-field.sh` +reads the first `(repo-deed …)` form and ignores what follows, while standards +`deed_lint.js` rejects "trailing content after the form's closing ')'"; the +reader's `--strict` mode closes that gap. Whitespace and comments after the +form are allowed, as in the linter. + +`--strict` checks token boundaries only and does not replace `deed_lint.js`. +The reader's tokeniser is more lenient than the grammar: it accepts a tab as +whitespace and a last comment with no line end, and the linter refuses both. +A deed must still pass the linter (`.github/hooks/validate-deed.sh`). + +The reader does not take a field's list value for a clause. In +`:example (agentic)` the parentheses are a list (deed.abnf `value`), so the +deed has no `(agentic)` clause and the pack says so. + == Files [cols="1,3"] |=== -| `extract.sh` | deed reader → deterministic `claude-md-data.json` (build artifact, git-ignored) +| `extract.sh` | deed and tree-fact reader → deterministic `claude-md-data.json` (build artifact, git-ignored) | `arrival-pack.ncl` | Nickel projection engine → the region string (`nickel export --format raw`) | `generate.sh` | orchestrator: extract → render → splice (Hunt-tier, writes CLAUDE.md) | `verify.sh` | drift check: regenerate + byte-compare committed region (Yard-tier) @@ -52,7 +115,16 @@ just validate-claude-md # fail if the committed region drifted / was hand-edit * Estate-common doctrine is a *DRAFT* in the agent's words — owner to ratify into his voice, then pin to a `hyperpolymath/manifesto` commit SHA. -* `ECOSYSTEM.what-this-is-not` is empty here, so IS-NOT renders as "not yet - declared". Populating it is the boundary-erosion fix (the `lith` lesson). +* IS-NOT comes from the deed's `(ecosystem :not (…))`. When that list is empty, + IS-NOT renders as "not yet declared" and the deed should gain the list (the + boundary-erosion fix, the `lith` lesson). +* A repo's `(anchor (implementation-policy …))` renders as one "Anchor + override" line in the repo-specific part: what `:forbidden` lists, and any + language `:allowed` lists that the estate policy denies. An allowed language + the estate does not deny is no override and is not listed. AGPL is a licence + and is never counted as allowed. The "Constraints here" line names the same + allowed languages as exceptions to "banned langs". The override line is + hidden when there is neither. Controls: + `tests/workflows/arrival_pack_anchor_override_test.sh`. * The `(anchor)` clause currently encodes semantic-authority + golden-path; the recognised-drift / re-anchor-ledger aspect is a pending standards change. diff --git a/.machine_readable/arrival-pack/arrival-pack.ncl b/.machine_readable/arrival-pack/arrival-pack.ncl index 205e3323..9d0f1b0f 100644 --- a/.machine_readable/arrival-pack/arrival-pack.ncl +++ b/.machine_readable/arrival-pack/arrival-pack.ncl @@ -29,9 +29,13 @@ let estate_denied = ["Nix", "Python", "Go", "TypeScript", "ReScript", "AGPL"] in # rendered, or the pack would tell an agent that an estate denial applies in a # repo whose anchor allows the language (Codex review of sholes#13). A language # the anchor allows and the estate does not deny is no override and is not -# listed. Names are compared as written. +# listed. Names are compared as written. AGPL is a licence, not a language: no +# anchor can lift that denial (owner ruling by selector, 2026-11-19), so it is +# never counted as allowed. let anchor_allows_denied = - std.array.filter (fun l => std.array.elem l estate_denied) data.anchor_allowed + std.array.filter + (fun l => l != "AGPL" && std.array.elem l estate_denied) + data.anchor_allowed in let anchor_override = let allows = std.string.join ", " anchor_allows_denied in @@ -49,14 +53,136 @@ let anchor_override = else "" in +# The Constraints line must not contradict the override line: where the anchor +# allows a denied language, "banned langs" names the exception (Codex review of +# bactrian#39). With no such allowance the line is unchanged. +let banned_langs = + if std.array.length anchor_allows_denied > 0 then + "banned langs (above, except those this repo's anchor allows: %{std.string.join ", " anchor_allows_denied})" + else "banned langs (above)" +in + let provenance = "DEED@%{data.h_deed} ANCHOR@%{data.h_anchor}" in +# What the deed holds and what the tree still tracks are FACTS read by +# extract.sh, not assertions of this engine: the clauses the deed has (`has`), +# the tracked legacy .a2ml files (`a2ml_count`), and the ones that carry the +# name of a clause (`legacy`). A clause the deed lacks is stated as absent, and +# a legacy file is named only if extract.sh found it tracked. This template +# (every clause, every field the pack reads, no .a2ml file) gets the text below +# unchanged. A deed that has a clause but not the field the pack reads from it +# (a (status) with no :phase) now reads "not declared" where it read empty. +let has = data.has in +let legacy = data.legacy in +# A pipe would end a GFM table cell even inside backticks, so it is escaped. +let ticks = fun files => std.string.join ", " (std.array.map (fun f => "`%{std.string.replace "|" "\\|" f}`") files) in +let legacy_what = fun files => + let n = std.array.length files in + if n == 0 then "" + else if n == 1 then "legacy file %{ticks files}, read-only pending conversion" + else "legacy files %{ticks files}, read-only pending conversion" +in +# After a sentence part, inside parentheses ("; …"), and as a parenthesis (" (…)"). +let legacy_note = fun files => if files == [] then "" else "; %{legacy_what files}" in +let legacy_paren = fun files => if files == [] then "" else " (%{legacy_what files})" in +let undeclared = fun clause key v => + if v == "" then "(not declared — the deed's %{clause} has no :%{key})" else v +in + +# The substrate paragraph: the clauses the deed has, then the .a2ml sentence. +let clauses = [ + { name = "(anchor)", present = has.anchor, files = legacy.anchor }, + { name = "(agentic)", present = has.agentic, files = legacy.agentic }, + { name = "(ecosystem)", present = has.ecosystem, files = legacy.ecosystem }, + { name = "(status)", present = has.status, files = legacy.state }, + { name = "(maturity)", present = has.maturity, files = legacy.state }, + { name = "(neurosym)", present = has.neurosym, files = legacy.neurosym }, + { name = "(playbook)", present = has.playbook, files = legacy.playbook }, +] in +let missing = std.array.filter (fun c => !c.present) clauses in +let clause_sentence = + if std.array.length missing == 0 then + "ANCHOR, AGENTIC, ECOSYSTEM, STATE, NEUROSYM and PLAYBOOK are clauses of the CHORA deed — `(anchor)`, `(agentic)`, `(ecosystem)`, `(status)` and `(maturity)`, `(neurosym)`, `(playbook)` — not files; STATE's journal is `docs/status/ROADMAP.adoc`." + else + let in_deed = std.array.filter (fun c => c.present) clauses in + let in_list = std.string.join ", " (std.array.map (fun c => "`%{c.name}`") in_deed) in + let out_list = std.string.join "; " (std.array.map (fun c => "`%{c.name}`%{legacy_paren c.files}") missing) in + "ANCHOR, AGENTIC, ECOSYSTEM, STATE, NEUROSYM and PLAYBOOK are meant to be clauses of the CHORA deed, not files, but this repo's deed does not have them all yet. In its deed: %{in_list}. Not yet in its deed: %{out_list}. STATE's journal is `docs/status/ROADMAP.adoc`." +in +let a2ml_sentence = + let n = data.a2ml_count in + # Outside a git work tree the files were found on disk; nothing is tracked. + let holds = if data.a2ml_source == "git-index" then "tracks" else "contains" in + if n == 0 then "There are no `.a2ml` files in this estate." + else if n == 1 then "This repo still %{holds} 1 legacy `.a2ml` file, awaiting conversion to deed clauses (kyX, ruling D313): it is read-only pending that conversion; never create, restore or extend one, and you may only delete content from it." + else "This repo still %{holds} %{std.string.from_number n} legacy `.a2ml` files, awaiting conversion to deed clauses (kyX, ruling D313): they are read-only pending that conversion; never create, restore or extend one, and you may only delete content from one." +in + +# The CHORA row names the clauses the deed has, in the order it always has. +let chora_clauses = + let status_part = + if has.status && has.maturity then ["`(status)` and `(maturity)` where it is now"] + else if has.status then ["`(status)` where it is now"] + else if has.maturity then ["`(maturity)` where it is now"] + else [] + in + # each part carries its own "; " so that a deed with none of them adds nothing + std.string.join "" (std.array.map (fun p => "; %{p}") ( + (if has.meta then ["`(meta)` the architecture axes"] else []) + @ (if has.agentic then ["`(agentic)` *may I act now?*"] else []) + @ (if has.ecosystem then ["`(ecosystem)` where it sits and what it is not"] else []) + @ status_part + )) +in +let neurosym_row = + if has.neurosym then "| `(neurosym)` | *Meaning* of operations — proof obligations. |" + else "| `(neurosym)` | *Meaning* of operations — proof obligations. Not yet in this repo's deed%{legacy_note legacy.neurosym}. |" +in +let playbook_row = + if has.playbook then "| `(playbook)` | *How* permitted actions run. |" + else "| `(playbook)` | *How* permitted actions run. Not yet in this repo's deed%{legacy_note legacy.playbook}. |" +in + +# The per-repo block: each line reads clauses that may be absent. +let absent_ecosystem = "not yet in the deed: no `(ecosystem)` clause%{legacy_paren legacy.ecosystem}" in +let is_line = + if has.ecosystem then undeclared "(ecosystem)" "purpose" data.purpose else absent_ecosystem +in +let isnot_line = if has.ecosystem then data.isnot else absent_ecosystem in +let sits_line = + if has.ecosystem then + "pipeline position **%{undeclared "(ecosystem)" "pipeline-position" data.pipeline_pos}**; chain `%{undeclared "(ecosystem)" "chain" data.chain}`; coordination = `%{undeclared "(ecosystem)" "coordination" data.coordination}`." + else "%{absent_ecosystem}." +in +let bd_subs = std.string.join " " (std.array.map (fun s => "(%{s})") has.bot_directives) in +let bd_sentence = + if std.array.length has.bot_directives == 0 then + " Details: not yet in the deed (`(bot-directives)` has no `(methodology)`, `(coverage)` or `(debt)` clause%{legacy_note legacy.bot_directives})." + else " Details: the deed's `(bot-directives %{bd_subs})` clauses." +in +let constraints_line = + if has.agentic then + "fail-closed; evidence-per-step; no-silent-skip; rerun-after-fix; release-claim-requires-hard-pass. Never: %{banned_langs}, secrets, state files in repo root, AGPL.%{bd_sentence}" + else + "not yet in the deed: no `(agentic)` clause%{legacy_paren legacy.agentic}. The estate policy above applies.%{bd_sentence}" +in +let phase_text = + if has.status then undeclared "(status)" "phase" data.phase + else "unknown (not yet in the deed: no `(status)` clause%{legacy_note legacy.state})" +in +let maturity_text = + if has.maturity then undeclared "(maturity)" "level" data.maturity + else "unknown (not yet in the deed: no `(maturity)` clause%{legacy_note legacy.state})" +in + m%" # You are in the hyperpolymath estate — orient before acting +**First, read `metadatastician/standards` `STANDING-RULES.adoc` at the start of every session; it overrides anything older here.** Raw: https://raw.githubusercontent.com/metadatastician/standards/main/STANDING-RULES.adoc + If you are unsure what something is, **read the canon; do not guess** (guessing is how the fake `lith` monorepo got fabricated). Start here, then the files named below. ## Doctrine (the rules here) @@ -80,16 +206,16 @@ If you are unsure what something is, **read the canon; do not guess** (guessing ## The machine-readable substrate (read in this order on arrival) **CHORA** → **ANCHOR** → **AGENTIC** → **ECOSYSTEM** → **STATE** -> **NEUROSYM** -> **PLAYBOOK** -ANCHOR, AGENTIC, ECOSYSTEM, STATE, NEUROSYM and PLAYBOOK are clauses of the CHORA deed — `(anchor)`, `(agentic)`, `(ecosystem)`, `(status)` and `(maturity)`, `(neurosym)`, `(playbook)` — not files; STATE's journal is `docs/status/ROADMAP.adoc`. There are no `.a2ml` files in this estate. +%{clause_sentence} %{a2ml_sentence} The descriptive family (working name *descriptiles*) describes what-is; the **contractiles** are the normative set-point. | File | Answers | |---|---| -| `%{data.deed}` | **CHORA**, the repo deed. Its header `:repo-uuid` is the repo's one id, and `(identity)` and `(lineage)` say what this repo IS; a `(clade)` clause, when present, records the repo's clade placements: identity facts about where it sits, never its id and never an edict. chora-registry (formerly `gv-clade-index`) is authoritative for them; this repo's validation checks only that a declared clade is one of the 12 shelves; `(meta)` the architecture axes; `(agentic)` *may I act now?*; `(ecosystem)` where it sits and what it is not; `(status)` and `(maturity)` where it is now. Read fields with `scripts/deed-field.sh`. | +| `%{data.deed}` | **CHORA**, the repo deed. Its header `:repo-uuid` is the repo's one id, and `(identity)` and `(lineage)` say what this repo IS; a `(clade)` clause, when present, records the repo's clade placements: identity facts about where it sits, never its id and never an edict. chora-registry is authoritative for them; this repo's validation checks only that a declared clade is one of the 12 shelves%{chora_clauses}. Read fields with `scripts/deed-field.sh`. | | `(anchor)` | *Semantic authority + golden path* — what downstream may extend-not-redefine; if a recognised-drift / re-anchor marker is present, it **supersedes** accumulated context — read it first. | -| `(neurosym)` | *Meaning* of operations — proof obligations. | -| `(playbook)` | *How* permitted actions run. | +%{neurosym_row} +%{playbook_row} | `docs/status/ROADMAP.adoc` | *What is next* — milestones, blockers, next actions. | | contractiles | Normative doctrine: **Intend** (north-star) · **Must** (invariants) · **Trust** (security) · **Adjust** (accessibility / inclusive design) — the integral core that holds strong; plus **Dust** (exnovation drift) · **Bust** (failure / breakage, not drift). | | k9 | *Validation*. Kennel (data) / Yard (pure eval) / Hunt (guarded exec). | @@ -109,7 +235,7 @@ grammars. Canon: `metadatastician/standards/3-practice/DATA-FORMAT-ROUTING.adoc` Planned support is not operational evidence: retain explicit transitional checks until a pinned kyq executable passes positive and negative tests. -- `hyperpolymath/standards` — the canon source. · `hyperpolymath/gv-clade-index` (being renamed chora-registry) — the estate registry of repo identities and classification schemes. · `hyperpolymath/manifesto` — this doctrine. +- `metadatastician/standards` — the canon source. · `hyperpolymath/chora-registry` — the estate registry of repo identities and classification schemes. · `hyperpolymath/manifesto` — this doctrine. - **Before you invent, rename, or consolidate anything: STOP and check the map + IS-NOT.** ## Estate language policy (overridable per-repo via AGENTIC) @@ -164,12 +290,12 @@ and FRG letters, and ECHIDNA's `TrustLevel`, are different schemes. # This repo: `%{data.canonical_name}` - **Identity** — chora id `%{data.uuid}`; clade: %{data.clade_aid}; born %{data.born}; forge `%{data.forge_gh}`. -- **IS** — %{data.purpose} -- **IS-NOT** — %{data.isnot} -- **Where it sits** — pipeline position **%{data.pipeline_pos}**; chain `%{data.chain}`; coordination = `%{data.coordination}`. -- **Constraints here** (AGENTIC) — fail-closed; evidence-per-step; no-silent-skip; rerun-after-fix; release-claim-requires-hard-pass. Never: banned langs (above), secrets, state files in repo root, AGPL. Details: the deed's `(bot-directives (methodology) (coverage) (debt))` clauses. +- **IS** — %{is_line} +- **IS-NOT** — %{isnot_line} +- **Where it sits** — %{sits_line} +- **Constraints here** (AGENTIC) — %{constraints_line} - **Golden path** (ANCHOR) — `%{data.golden_smoke}` → %{data.golden_crit}.%{anchor_override} -- **State** — phase %{data.phase}; maturity %{data.maturity}. Milestones and next actions: `docs/status/ROADMAP.adoc`. +- **State** — phase %{phase_text}; maturity %{maturity_text}. Milestones and next actions: `docs/status/ROADMAP.adoc`. "% diff --git a/.machine_readable/arrival-pack/claude-md.k9.ncl b/.machine_readable/arrival-pack/claude-md.k9.ncl index 6685d812..c9049f74 100644 --- a/.machine_readable/arrival-pack/claude-md.k9.ncl +++ b/.machine_readable/arrival-pack/claude-md.k9.ncl @@ -34,11 +34,17 @@ K9! # Inputs the projection reads (single source of truth). inputs = { - # The repo deed (_chora.deed) is the only input; the golden path is - # its (anchor (golden-path)) clause (rsr-template-repo#209). + # The repo deed (_chora.deed) is the only authored input; the golden + # path is its (anchor (golden-path)) clause (rsr-template-repo#209). descriptiles = [ "_chora.deed", ], + # Facts read from the tree, never authored: the pack states them instead of + # asserting them, so a repo with legacy A2ML is not told it has none. + tree_facts = [ + "tracked .a2ml files: git ls-files '*.a2ml', each path once (every .a2ml under the tree, minus .git/, outside a git work tree, where the region says 'contains')", + "which of (anchor) (agentic) (ecosystem) (status) (maturity) (neurosym) (playbook) (meta) (bot-directives (methodology) (coverage) (debt)) the deed has", + ], estate_common = "hyperpolymath/manifesto@", # DRAFT-unratified today target = "CLAUDE.md", markers = { begin = "