diff --git a/.github/workflows/estate-rules.yml b/.github/workflows/estate-rules.yml index 886bdbc..aa3ff3b 100644 --- a/.github/workflows/estate-rules.yml +++ b/.github/workflows/estate-rules.yml @@ -114,6 +114,9 @@ jobs: run: bash scripts/validate-session-contracts.sh - name: Check Nickel typecheck controls run: bash tests/workflows/k9_typecheck_test.sh + # 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 - 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/arrival-pack.ncl b/.machine_readable/arrival-pack/arrival-pack.ncl index 50a21b3..205e332 100644 --- a/.machine_readable/arrival-pack/arrival-pack.ncl +++ b/.machine_readable/arrival-pack/arrival-pack.ncl @@ -20,9 +20,33 @@ 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 +# The estate deny list, stated once: the language-policy line below prints it, +# and the anchor override compares the anchor's allowed list against it. +let estate_denied = ["Nix", "Python", "Go", "TypeScript", "ReScript", "AGPL"] in + +# An anchor overrides the estate policy for its repo in two ways: it forbids +# what the estate permits, and it allows what the estate denies. Both are +# 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. +let anchor_allows_denied = + std.array.filter (fun l => std.array.elem l estate_denied) data.anchor_allowed +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." + let allows = std.string.join ", " anchor_allows_denied in + let forbids = std.string.join ", " data.anchor_forbidden in + let has_allows = std.array.length anchor_allows_denied > 0 in + let has_forbids = std.array.length data.anchor_forbidden > 0 in + let lead = "\n- **Anchor override** (ANCHOR) — This repo's anchor " in + let tail = ". The anchor overrides the estate policy above." in + if has_allows && has_forbids then + "%{lead}allows, where the estate policy above denies: %{allows}; it forbids: %{forbids}%{tail}" + else if has_allows then + "%{lead}allows, where the estate policy above denies: %{allows}%{tail}" + else if has_forbids then + "%{lead}forbids: %{forbids}%{tail}" + else "" in let provenance = "DEED@%{data.h_deed} ANCHOR@%{data.h_anchor}" @@ -70,6 +94,12 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | 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). | +**The chora and CLADE are different things** (owner, 2026-11-15; standards A1 CHORA-SPEC §11.1): +- **The chora is ontological/metaphysical**: what this repo *is* and is meant to be in its context, code as identity: its intension (what defines it) and its extension (what it is an instance of). A `(clade …)` placement in it is an identity fact, copied from chora-registry, and the registry wins; never take one from a legacy file. +- **`CLADE.deed` is logical/epistemological**: how this repo's own content is ordered. Its scheme may be strict (Linnaean), judgement or none; membership may be single or multiple; a category is decided by its criterion. It is a descriptile and never identity; none is created until A7 M3 `clade` lands. +- **The aesthetic spans both**: what one experiences of the repo from outside, and in its ordering within. +- A legacy `CLADE.a2ml`, or A2ML named `CLADE.deed`, feeds the chora and `STATE.deed` (standards `clade-to-repo-deed.adoc`), never a `CLADE.deed`. + ## Canon pointers Estate data-format route: **kyq** handles exactly **TOML, Dhall, KYAML, I-JSON/JCS**. Preserve TOML/Dhall; migrate YAML/YML to KYAML and JSON variants @@ -83,7 +113,7 @@ checks until a pinned kyq executable passes positive and negative tests. - **Before you invent, rename, or consolidate anything: STOP and check the map + IS-NOT.** ## Estate language policy (overridable per-repo via AGENTIC) -Deny: **Nix, Python, Go, TypeScript, ReScript, AGPL**. (Guix, not Nix.) +Deny: **%{std.string.join ", " estate_denied}**. (Guix, not Nix.) JavaScript runtime: **Bun** > Deno > pnpm > npm (last resort, permitted), from one `package.json` that carries every runtime's lock (`bun.lock`, `deno.lock`, `pnpm-lock.yaml`), all written by `js-runtimes regen` (owner ruling 2026-10-14, standards LANGUAGE-POLICY §1.3–§1.4). Deno is permitted again; `package-lock.json` stays refused. Use plain JavaScript when this tooling is needed. TypeScript and ReScript migrate to AffineScript. diff --git a/.machine_readable/arrival-pack/extract.sh b/.machine_readable/arrival-pack/extract.sh index c9e0aa4..3972306 100755 --- a/.machine_readable/arrival-pack/extract.sh +++ b/.machine_readable/arrival-pack/extract.sh @@ -82,6 +82,7 @@ fi 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 ;; + *) ;; # any other identity is printed as written, with nothing to report esac # read_clauses -> the clauses this pack reads, one token per line. Hashing only diff --git a/CLAUDE.md b/CLAUDE.md index 4aedd42..fe055ce 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,6 +47,12 @@ The descriptive family (working name *descriptiles*) describes what-is; the **co | 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). | +**The chora and CLADE are different things** (owner, 2026-11-15; standards A1 CHORA-SPEC §11.1): +- **The chora is ontological/metaphysical**: what this repo *is* and is meant to be in its context, code as identity: its intension (what defines it) and its extension (what it is an instance of). A `(clade …)` placement in it is an identity fact, copied from chora-registry, and the registry wins; never take one from a legacy file. +- **`CLADE.deed` is logical/epistemological**: how this repo's own content is ordered. Its scheme may be strict (Linnaean), judgement or none; membership may be single or multiple; a category is decided by its criterion. It is a descriptile and never identity; none is created until A7 M3 `clade` lands. +- **The aesthetic spans both**: what one experiences of the repo from outside, and in its ordering within. +- A legacy `CLADE.a2ml`, or A2ML named `CLADE.deed`, feeds the chora and `STATE.deed` (standards `clade-to-repo-deed.adoc`), never a `CLADE.deed`. + ## Canon pointers Estate data-format route: **kyq** handles exactly **TOML, Dhall, KYAML, I-JSON/JCS**. Preserve TOML/Dhall; migrate YAML/YML to KYAML and JSON variants diff --git a/tests/workflows/arrival_pack_anchor_override_test.sh b/tests/workflows/arrival_pack_anchor_override_test.sh new file mode 100644 index 0000000..7023171 --- /dev/null +++ b/tests/workflows/arrival_pack_anchor_override_test.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +# +# arrival_pack_anchor_override_test.sh — controls for the "Anchor override" +# line of the CLAUDE.md arrival pack (.machine_readable/arrival-pack/). +# +# An anchor overrides the estate language policy in two ways: it forbids what +# the estate permits, and it allows what the estate denies. The engine once +# rendered only the first, so a repo whose anchor allowed a denied language +# still told its agents the estate denial applied (Codex review of sholes#13). +# Each case renders the engine over a fixture and reads the one line. +# +# Requires nickel and jq. Exit: 0 all controls hold; 1 a control failed. + +set -uo pipefail + +REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +AP="$REPO_DIR/.machine_readable/arrival-pack" +for tool in nickel jq; do + command -v "$tool" >/dev/null 2>&1 || { echo "FAIL: $tool is required" >&2; exit 1; } +done +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +# The fixture is this repo's own extract, so every field the engine reads is +# present; only the two anchor lists are replaced per case. +BASE="$WORK/base.json" +bash "$AP/extract.sh" "$REPO_DIR" > "$BASE" || { echo "FAIL: extract.sh did not run" >&2; exit 1; } + +FAILED=0 +CHECKS=0 +# render ALLOWED_JSON FORBIDDEN_JSON -> the rendered region on stdout +render() { + local allowed="$1" forbidden="$2" dir="$WORK/case.$CHECKS" + mkdir -p "$dir" + cp "$AP/arrival-pack.ncl" "$dir/" + jq -cS --argjson a "$allowed" --argjson f "$forbidden" '.anchor_allowed = $a | .anchor_forbidden = $f' \ + "$BASE" > "$dir/claude-md-data.json" + nickel export --format raw "$dir/arrival-pack.ncl" +} +# check LABEL ALLOWED_JSON FORBIDDEN_JSON EXPECTED_LINE ("" = no override line) +check() { + local label="$1" want="$4" out line count + CHECKS=$((CHECKS + 1)) + out="$(render "$2" "$3" 2>&1)" || { FAILED=$((FAILED + 1)); echo " FAIL $label (engine did not render)"; echo "$out" | sed 's/^/ /'; return; } + count="$(grep -c -- '- \*\*Anchor override\*\*' <<<"$out")" + line="$(grep -- '- \*\*Anchor override\*\*' <<<"$out")" + if [[ -z "$want" && "$count" -eq 0 ]]; then + echo " PASS $label" + elif [[ -n "$want" && "$count" -eq 1 && "$line" == "$want" ]]; then + echo " PASS $label" + else + FAILED=$((FAILED + 1)); echo " FAIL $label" + echo " want: ${want:-}" + echo " got ($count line(s)): $line" + fi +} + +LEAD="- **Anchor override** (ANCHOR) — This repo's anchor" +TAIL="The anchor overrides the estate policy above." + +check "no lists: no override line" '[]' '[]' "" +check "forbids only: the wording minted repos already carry" \ + '[]' '["Node.js","npm"]' \ + "$LEAD forbids: Node.js, npm. $TAIL" +check "allowed languages the estate does not deny are no override" \ + '["Rust","Idris2","Zig"]' '["Node.js","npm"]' \ + "$LEAD forbids: Node.js, npm. $TAIL" +check "allows a denied language: it is named" \ + '["Rust","Go"]' '[]' \ + "$LEAD allows, where the estate policy above denies: Go. $TAIL" +check "allows a denied language and forbids: both are named" \ + '["Go","Rust","Python"]' '["Node.js","npm"]' \ + "$LEAD allows, where the estate policy above denies: Go, Python; it forbids: Node.js, npm. $TAIL" +check "allowed but not denied, nothing forbidden: no override line" \ + '["Rust","Zig"]' '[]' "" + +# The deny list is stated once in the engine: the policy line prints the same +# list the override compares against. +CHECKS=$((CHECKS + 1)) +if render '[]' '[]' 2>/dev/null | grep -qF 'Deny: **Nix, Python, Go, TypeScript, ReScript, AGPL**. (Guix, not Nix.)'; then + echo " PASS the language-policy line prints the estate deny list" +else + FAILED=$((FAILED + 1)); echo " FAIL the language-policy line prints the estate deny list" +fi + +echo "$CHECKS controls, $FAILED failed" +[[ "$FAILED" -eq 0 ]] diff --git a/tests/workflows/governance_policy_test.sh b/tests/workflows/governance_policy_test.sh index 486518d..d27e241 100644 --- a/tests/workflows/governance_policy_test.sh +++ b/tests/workflows/governance_policy_test.sh @@ -204,7 +204,21 @@ for (const text of [dependencies, arrival]) { assert.match(prose(text), /fit equally well.*prefer one that carries its own verification/i); assert.match(prose(text), /preference, not a gate/i); } -console.log("PASS: third-party dependencies remain ASSUMED boundaries and verification is a preference"); +// PROOF-POLICY section 1.1: a dependency whose whole import cone passes safe +// mode with zero postulates is checked, not assumed. The guide and the arrival +// guidance must both carry the exception, or they give opposite instructions +// for the same dependency (Codex review of sholes#13). +for (const [name, text] of [["proof guide", dependencies], ["arrival guidance", arrival]]) { + assert.match(prose(text), /import cone.*safe mode with zero postulates.*checked, not assumed/i, + `${name} must carry the checked-cone exception`); + assert.match(prose(text), /record the cone.*instead of an ASSUMED row/i, + `${name} must say a checked cone is recorded instead of an ASSUMED row`); + assert.match(prose(text), /root module.*flags.*postulate count.*library name, version and pin/i, + `${name} must list what a recorded cone holds`); + assert.match(prose(text), /postulate.*outside safe mode.*not checked/i, + `${name} must say a cone with a postulate or outside safe mode is not checked`); +} +console.log("PASS: third-party dependencies are ASSUMED boundaries unless the whole import cone is checked; verification is a preference"); // Negative regression: a shipped example, even one with a gated manifest // entry, must never become evidence of completed proofs or a theory recheck. diff --git a/verification/proofs/README.adoc b/verification/proofs/README.adoc index b008631..8ba2f0c 100644 --- a/verification/proofs/README.adoc +++ b/verification/proofs/README.adoc @@ -76,9 +76,18 @@ Dependencies (crates, libraries, vendored or forked code) are not converted, re-proved or annotated to meet this policy. Where a proof here relies on a dependency's behaviour, state that reliance as a trusted boundary specification and record it as `ASSUMED`, with the dependency and version, -in `docs/status/PROOF-STATUS.adoc`. When choosing between dependencies that -fit equally well, prefer one that carries its own verification. This is a -preference, not a gate. +in `docs/status/PROOF-STATUS.adoc`. + +A dependency the prover itself checks is not an assumption (policy §1.1). +When the whole import cone of a proof (every module it transitively imports, +first-party or library) compiles under the prover's safe mode with zero +postulates, the dependency is checked, not assumed. Record the cone instead +of an `ASSUMED` row: the root module, the flags in force, the postulate count +(zero), and the library name, version and pin. A cone that contains a +postulate, or that was compiled outside safe mode, is not checked. + +When choosing between dependencies that fit equally well, prefer one that +carries its own verification. This is a preference, not a gate. == Directory structure