From e4039eed95b89fb15a4f28a234859cd06b3cc5f0 Mon Sep 17 00:00:00 2001 From: CLAUDE <355856132+HoTT-stuff@users.noreply.github.com> Date: Sun, 15 Nov 2026 09:38:04 +0000 Subject: [PATCH] chore(arrival-pack): take the template's generated Proofs guidance (rsr-template-repo#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The template now generates the '## Proofs' block inside the arrival-pack region (rsr-template-repo#413), with the PROOF-POLICY §1.1 and §8.1 wording from rsr-template-repo#400. This carries the engine here and regenerates CLAUDE.md; the hand-authored copy below the region is removed so the block appears once. governance_policy_test.sh is the template's, which asserts the block is inside the region. Regenerating also brings the template's newer estate-common wording and identity line. scripts/deed-field.sh is left as it is. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_0136P7Zoc4g7WLgAwdMTnzPM --- .../arrival-pack/arrival-pack.ncl | 62 ++++++++++++- .machine_readable/arrival-pack/extract.sh | 66 ++++++++++--- CLAUDE.md | 92 +++++++++++-------- tests/workflows/governance_policy_test.sh | 23 +++-- 4 files changed, 179 insertions(+), 64 deletions(-) diff --git a/.machine_readable/arrival-pack/arrival-pack.ncl b/.machine_readable/arrival-pack/arrival-pack.ncl index d9fa035..50a21b3 100644 --- a/.machine_readable/arrival-pack/arrival-pack.ncl +++ b/.machine_readable/arrival-pack/arrival-pack.ncl @@ -20,6 +20,11 @@ let data = import "claude-md-data.json" in # owner's voice. Until then the estate-common block is explicitly DRAFT. let manifesto_pin = "DRAFT-unratified" in +let anchor_override = + if std.array.length data.anchor_forbidden == 0 then "" + else "\n- **Anchor override** (ANCHOR) — This repo's anchor forbids: %{std.string.join ", " data.anchor_forbidden}. The anchor overrides the estate policy above." +in + let provenance = "DEED@%{data.h_deed} ANCHOR@%{data.h_anchor}" in @@ -57,7 +62,7 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | File | Answers | |---|---| -| `%{data.deed}` | **CHORA**, the repo deed. Its `(identity)` `(clade)` `(lineage)` clauses say what this repo IS (registers into `gv-clade-index`); `(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 (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`. | | `(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. | @@ -66,7 +71,15 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | k9 | *Validation*. Kennel (data) / Yard (pure eval) / Hunt (guarded exec). | ## Canon pointers -- `hyperpolymath/standards` — the canon source. · `hyperpolymath/gv-clade-index` — the estate map (identity registry). · `hyperpolymath/manifesto` — this doctrine. +Estate data-format route: **kyq** handles exactly **TOML, Dhall, KYAML, +I-JSON/JCS**. Preserve TOML/Dhall; migrate YAML/YML to KYAML and JSON variants +through kyq using **hyperpolymath/ijson-jcs**, the actual estate implementation +repository. **kyX** owns wider projection. DEED/K9/coordination keep their own +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. - **Before you invent, rename, or consolidate anything: STOP and check the map + IS-NOT.** ## Estate language policy (overridable per-repo via AGENTIC) @@ -77,16 +90,55 @@ Use plain JavaScript when this tooling is needed. TypeScript and ReScript migrat ## Asking the owner Put every question that needs the owner's decision through the selector (the AskUserQuestion tool), not as prose at the end of a report. Batch up to four per call, offer concrete options with the recommended one first, and say what each option would cause. +## Proofs — which prover for which obligation + +Normative source: `3-practice/PROOF-POLICY.adoc` in `hyperpolymath/standards`. +Read it there; `verification/proofs/README.adoc` maps it onto this repo. + +| Code or obligation | Verifier | +|---|---| +| Rust code | **Creusot** with **Pearlite** contracts, and **Verus**, by default and on the code (§1.2). Kani for `unsafe`/FFI seams and Aeneas for Rust that implements an Agda theorem run alongside, never instead | +| Ada code | **SPARK** | +| APIs, ABIs, engineering properties | **Idris2** | +| Theory | **Agda**, rechecked in **Rocq** and **Lean** (no Mathlib) | + +Always name Creusot, Pearlite and Verus in Rust verification plans and in +`docs/status/PROOF-STATUS.adoc`. Pearlite is Creusot's specification +language, not a third verifier. Plan scopes for both verifiers, and record +any that is unsupported, inapplicable or not yet run, with its reason; never +present an unexecuted check as a pass. Using both does not make two +independent witnesses (policy §1.2). + +Third-party code (crates such as Bevy, libraries, forks) is **not** converted +or re-proved. Where a proof relies on a dependency the prover does not check, +state the reliance as an `ASSUMED` boundary specification. Where the +dependency's whole import cone compiles under the prover's safe mode with zero +postulates, it is *checked, not assumed*: record the cone (root module, flags, +postulate count of zero, library name, version and pin) instead of an +`ASSUMED` row (policy §1.1). A cone with a postulate, or compiled outside safe +mode, is not checked. When choosing between dependencies that fit equally +well, prefer one that carries its own verification. A preference, not a gate. + +Proof Witness Grades are policy §8. They apply to *theory* theorems only: Agda +source, rechecked in Rocq and Lean (§8.1). Engineering proofs (Creusot, Verus, +SPARK, Idris2) are not graded on this ladder; they use the §5 tokens only. For +a theory theorem, `PWG-3` < `PWG-2i` < `PWG-2ii` < `PWG-1`, where `PWG-1` is +strongest. A theorem that does not reach `PWG-3` is `ungraded`, with no +qualifier. A grade is derived from receipts, never asserted. A "verified" or +"machine-checked" claim needs current receipts. Report a census with its +denominator, never a percentage. Always write the `PWG-` prefix: CRG, TRG, ARG +and FRG letters, and ECHIDNA's `TrustLevel`, are different schemes. + --- -# This repo: `%{data.canonical_name}` · clade `%{data.prefixed_name}` +# This repo: `%{data.canonical_name}` -- **Identity** — uuid `%{data.uuid}`; clade `%{data.clade_primary}` (secondary `%{data.clade_secondary}`); born %{data.born}; forge `%{data.forge_gh}`. +- **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. -- **Golden path** (ANCHOR) — `%{data.golden_smoke}` → %{data.golden_crit}. +- **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`. diff --git a/.machine_readable/arrival-pack/extract.sh b/.machine_readable/arrival-pack/extract.sh index 8c2e3c0..c9e0aa4 100755 --- a/.machine_readable/arrival-pack/extract.sh +++ b/.machine_readable/arrival-pack/extract.sh @@ -46,21 +46,43 @@ items() { printf '%s' "$out" } +# lines PATH KEY -> the deed list :KEY ( … ), one item per line, "" when absent +lines() { + local out rc=0 + out="$(bash "$READ" --list "$DEED" "$1" "$2")" || rc=$? + [[ "$rc" -le 1 ]] || return "$rc" + printf '%s' "$out" +} + # hash12 -> short content hash of stdin (drift provenance) hash12() { sha256sum | cut -c1-12; } -# The identity is the deed's own TYPED literal (#u5"", later #u8""), -# never a computed hex uuid. The uuid is derived from that name and never -# stored (deed.abnf); printing its hex form put a version-5 literal in -# CLAUDE.md, which ADR-008's strict gate (owner ruling D320, standards -# governance job uuid-v7-conformance) rejects in every minted repo. The -# typed literal says what the identifier is, as ADR-008 asks of legacy ids, -# and follows the deed when it moves to version 8. +# The identity is the deed's own TYPED literal, printed as written: +# #uuid"" (minted once, A7 J11), or the computed #u8"". +# The pack never prints a derived hex form of a name literal: that once put a +# version 5 id in CLAUDE.md, which ADR-008's strict gate (owner ruling D320) +# rejects in every minted repo. The typed literal says what the identifier is, +# as ADR-008 asks. uuid_name="$(field '' repo-uuid)" uuid="" -[ -z "$uuid_name" ] || uuid="$(sed -n -E 's/^[[:space:]]*:repo-uuid[[:space:]]+(#u[0-9]+"[^"]*").*/\1/p' "$DEED" | head -1)" +if [[ -n "$uuid_name" ]]; then + # --typed keeps the tag and quotes, and reads the literal wherever the layout puts it + rc=0 + uuid="$(bash "$READ" --typed "$DEED" '' repo-uuid)" || rc=$? + [[ "$rc" -le 1 ]] || exit "$rc" + [[ "$uuid" =~ ^#u(uid|[0-9]+)\"[^\"]*\"$ ]] || uuid="" +fi [ -z "$uuid_name" ] || [ -n "$uuid" ] \ - || { echo "extract.sh: $(basename "$DEED") :repo-uuid is not a typed #u\"...\" literal" >&2; exit 2; } + || { echo "extract.sh: $(basename "$DEED") :repo-uuid is not a typed #uuid\"...\" or #u\"...\" literal" >&2; exit 2; } +# A version 5 identity is reported, not refused, here: this is the arrival-pack +# reader, not the gate. Standards A1 v0.4.5 C10 and T30 (ruling Q2) make +# v5-identity and u5-identity errors in every mode, and `just validate-rsr` +# and estate-rules (scripts/check-identity.sh) refuse them. The chora id is the +# v8 id of the birth path. +case "$uuid" in + '#u5"'*|'#uuid"'????????-????-5*) + echo "extract.sh: v5-identity: $(basename "$DEED") :repo-uuid $uuid is a version 5 id; the chora id is #uuid\"\" (standards A1 V8)" >&2 ;; +esac # read_clauses -> the clauses this pack reads, one token per line. Hashing only # these keeps an unrelated deed edit (say a canon-pin bump) from reading as drift. @@ -81,9 +103,18 @@ isnot="$(items ecosystem not ' · ')" canonical_name="$(field '' canonical-name)" [ -n "$canonical_name" ] \ || { echo "extract.sh: $(basename "$DEED") has no :canonical-name" >&2; exit 2; } -prefixed_name="$(field identity prefixed-name)" +# Clade placements are identity facts about where the repo sits, never its id +# and never an edict; chora-registry is authoritative for them (standards A1 +# §11, ruling W10). The clause is optional. clade_primary="$(field clade primary)" clade_secondary="$(items clade secondary ', ')" +if [[ -z "$clade_primary" ]]; then + clade_aid="none declared (optional placement)" +elif [[ -n "$clade_secondary" ]]; then + clade_aid="$clade_primary (secondary $clade_secondary; placement)" +else + clade_aid="$clade_primary (placement)" +fi born="$(field lineage born)" forge_gh="$(field forges github)" purpose="$(field ecosystem purpose)" @@ -94,16 +125,17 @@ phase="$(field status phase)" maturity="$(field maturity level)" golden_smoke="$(items anchor/golden-path smoke-test-command ' && ')" golden_crit="$(items anchor/golden-path success-criteria '; ')" +# The anchor may override the estate language policy for this repo only. +anchor_forbidden="$(lines anchor/implementation-policy forbidden)" +anchor_allowed="$(lines anchor/implementation-policy allowed)" anchor_clause="$(bash "$READ" --clause "$DEED" anchor)" h_deed="$(read_clauses | hash12)" h_anchor="$(printf '%s\n' "$anchor_clause" | hash12)" -jq -n \ +jq -cnS \ --arg canonical_name "$canonical_name" \ - --arg prefixed_name "$prefixed_name" \ + --arg clade_aid "$clade_aid" \ --arg uuid "$uuid" \ - --arg clade_primary "$clade_primary" \ - --arg clade_secondary "$clade_secondary" \ --arg born "$born" \ --arg forge_gh "$forge_gh" \ --arg purpose "$purpose" \ @@ -118,4 +150,8 @@ jq -n \ --arg golden_crit "$golden_crit" \ --arg h_deed "$h_deed" \ --arg h_anchor "$h_anchor" \ - '$ARGS.named' + --arg anchor_forbidden "$anchor_forbidden" \ + --arg anchor_allowed "$anchor_allowed" \ + '$ARGS.named + | .anchor_forbidden |= (split("\n") | map(select(. != ""))) + | .anchor_allowed |= (split("\n") | map(select(. != "")))' diff --git a/CLAUDE.md b/CLAUDE.md index 60976f7..c227b88 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell - + # You are in the hyperpolymath estate — orient before acting @@ -39,7 +39,7 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | File | Answers | |---|---| -| `sholes_chora.deed` | **CHORA**, the repo deed. Its `(identity)` `(clade)` `(lineage)` clauses say what this repo IS (registers into `gv-clade-index`); `(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`. | +| `sholes_chora.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`. | | `(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. | @@ -48,7 +48,15 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | k9 | *Validation*. Kennel (data) / Yard (pure eval) / Hunt (guarded exec). | ## Canon pointers -- `hyperpolymath/standards` — the canon source. · `hyperpolymath/gv-clade-index` — the estate map (identity registry). · `hyperpolymath/manifesto` — this doctrine. +Estate data-format route: **kyq** handles exactly **TOML, Dhall, KYAML, +I-JSON/JCS**. Preserve TOML/Dhall; migrate YAML/YML to KYAML and JSON variants +through kyq using **hyperpolymath/ijson-jcs**, the actual estate implementation +repository. **kyX** owns wider projection. DEED/K9/coordination keep their own +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. - **Before you invent, rename, or consolidate anything: STOP and check the map + IS-NOT.** ## Estate language policy (overridable per-repo via AGENTIC) @@ -59,19 +67,59 @@ Use plain JavaScript when this tooling is needed. TypeScript and ReScript migrat ## Asking the owner Put every question that needs the owner's decision through the selector (the AskUserQuestion tool), not as prose at the end of a report. Batch up to four per call, offer concrete options with the recommended one first, and say what each option would cause. +## Proofs — which prover for which obligation + +Normative source: `3-practice/PROOF-POLICY.adoc` in `hyperpolymath/standards`. +Read it there; `verification/proofs/README.adoc` maps it onto this repo. + +| Code or obligation | Verifier | +|---|---| +| Rust code | **Creusot** with **Pearlite** contracts, and **Verus**, by default and on the code (§1.2). Kani for `unsafe`/FFI seams and Aeneas for Rust that implements an Agda theorem run alongside, never instead | +| Ada code | **SPARK** | +| APIs, ABIs, engineering properties | **Idris2** | +| Theory | **Agda**, rechecked in **Rocq** and **Lean** (no Mathlib) | + +Always name Creusot, Pearlite and Verus in Rust verification plans and in +`docs/status/PROOF-STATUS.adoc`. Pearlite is Creusot's specification +language, not a third verifier. Plan scopes for both verifiers, and record +any that is unsupported, inapplicable or not yet run, with its reason; never +present an unexecuted check as a pass. Using both does not make two +independent witnesses (policy §1.2). + +Third-party code (crates such as Bevy, libraries, forks) is **not** converted +or re-proved. Where a proof relies on a dependency the prover does not check, +state the reliance as an `ASSUMED` boundary specification. Where the +dependency's whole import cone compiles under the prover's safe mode with zero +postulates, it is *checked, not assumed*: record the cone (root module, flags, +postulate count of zero, library name, version and pin) instead of an +`ASSUMED` row (policy §1.1). A cone with a postulate, or compiled outside safe +mode, is not checked. When choosing between dependencies that fit equally +well, prefer one that carries its own verification. A preference, not a gate. + +Proof Witness Grades are policy §8. They apply to *theory* theorems only: Agda +source, rechecked in Rocq and Lean (§8.1). Engineering proofs (Creusot, Verus, +SPARK, Idris2) are not graded on this ladder; they use the §5 tokens only. For +a theory theorem, `PWG-3` < `PWG-2i` < `PWG-2ii` < `PWG-1`, where `PWG-1` is +strongest. A theorem that does not reach `PWG-3` is `ungraded`, with no +qualifier. A grade is derived from receipts, never asserted. A "verified" or +"machine-checked" claim needs current receipts. Report a census with its +denominator, never a percentage. Always write the `PWG-` prefix: CRG, TRG, ARG +and FRG letters, and ECHIDNA's `TrustLevel`, are different schemes. + --- -# This repo: `sholes` · clade `UNASSIGNED-sholes` +# This repo: `sholes` -- **Identity** — uuid `#u8"gv-clade-index:github.com/hyperpolymath/sholes"`; clade `UNASSIGNED` (secondary ``); born 2026-11-12; forge `hyperpolymath/sholes`. +- **Identity** — chora id `#u8"gv-clade-index:github.com/hyperpolymath/sholes"`; clade: UNASSIGNED (placement); born 2026-11-12; forge `hyperpolymath/sholes`. - **IS** — UNASSIGNED - **IS-NOT** — (not yet declared — add (ecosystem :not (…)) to the deed) - **Where it sits** — pipeline position **UNASSIGNED**; chain `UNASSIGNED`; coordination = `standards`. - **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. - **Golden path** (ANCHOR) — `just test && just quality` → Core tests pass; Quality gates pass; No unresolved critical security findings. +- **Anchor override** (ANCHOR) — This repo's anchor forbids: Node.js, npm. The anchor overrides the estate policy above. - **State** — phase incubating; maturity experimental. Milestones and next actions: `docs/status/ROADMAP.adoc`. - + ## Estate-Wide Format Migration Directives @@ -116,35 +164,3 @@ hand; that migration is done per repo (ADR-008 phase P3). In deed files use **ENFORCEMENT:** these rulings are recorded on `standards#787`. Some are ruled but not yet gated: check the gate on `standards` main before relying on it. - - -## Proofs — which prover for which obligation - -Normative source: `3-practice/PROOF-POLICY.adoc` in `hyperpolymath/standards`. -Read it there; `verification/proofs/README.adoc` maps it onto this repo. - -| Code or obligation | Verifier | -|---|---| -| Rust code | **Creusot** with **Pearlite** contracts, and **Verus**, by default and on the code (§1.2). Kani for `unsafe`/FFI seams and Aeneas for Rust that implements an Agda theorem run alongside, never instead | -| Ada code | **SPARK** | -| APIs, ABIs, engineering properties | **Idris2** | -| Theory | **Agda**, rechecked in **Rocq** and **Lean** (no Mathlib) | - -Always name Creusot, Pearlite and Verus in Rust verification plans and in -`docs/status/PROOF-STATUS.adoc`. Pearlite is Creusot's specification -language, not a third verifier. Plan scopes for both verifiers, and record -any that is unsupported, inapplicable or not yet run, with its reason; never -present an unexecuted check as a pass. Using both does not make two -independent witnesses (policy §1.2). - -Third-party code (crates such as Bevy, libraries, forks) is **not** converted -or re-proved. State what a proof relies on as an `ASSUMED` boundary -specification, and when choosing between dependencies that fit equally well, -prefer one that carries its own verification. A preference, not a gate. - -Proof grades are policy §8, *Proof Witness Grades*: `PWG-3` < `PWG-2i` < -`PWG-2ii` < `PWG-1`, where `PWG-1` is strongest. A grade is derived from -receipts, never asserted. A "verified" or "machine-checked" claim needs -current receipts. Report a census with its denominator, never a -percentage. Always write the `PWG-` prefix: CRG, TRG, ARG and FRG letters, -and ECHIDNA's `TrustLevel`, are different schemes. diff --git a/tests/workflows/governance_policy_test.sh b/tests/workflows/governance_policy_test.sh index 14a58a9..486518d 100644 --- a/tests/workflows/governance_policy_test.sh +++ b/tests/workflows/governance_policy_test.sh @@ -122,12 +122,23 @@ for (const [name, text] of [["arrival guidance", arrival], ["proof guide", guide `${name} must identify the policy's authoritative repository`); } assert.match(arrival, /`verification\/proofs\/README\.adoc`/); -assert.notEqual(claude.indexOf("