Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/estate-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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
Expand Down
36 changes: 33 additions & 3 deletions .machine_readable/arrival-pack/arrival-pack.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop repeating overridden languages as hard constraints

When an anchor allows an estate-denied language such as Go, this branch emits that Go is allowed, but the same generated pack still unconditionally says Never: banned langs (above) in .machine_readable/arrival-pack/arrival-pack.ncl:170 (and separately repeats AGPL). That leaves agents with mutually exclusive instructions in the exact scenario this change is intended to repair; the repo-specific constraints text must also account for anchor_allows_denied, rather than adding only the later override sentence.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked, and the finding is correct. The "Constraints here" line in arrival-pack.ncl (line 170) says "Never: banned langs (above), … AGPL" unconditionally. For an anchor that allows an estate-denied language, the pack would then say both "never" and "the anchor allows it".

It does not bite in this repo: bactrian's anchor allows no estate-denied language, so the generated CLAUDE.md carries no "allows" clause and the two lines agree.

Not fixed here, and this PR has merged: the line is the template's, carried unchanged, so the fix belongs in rsr-template-repo, and how the constraint should read when an anchor lifts a denial is the owner's wording to settle. Raised with the owner.


Generated by Claude Code

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}"
Expand Down Expand Up @@ -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
Expand All @@ -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.

Expand Down
1 change: 1 addition & 0 deletions .machine_readable/arrival-pack/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"<v8 id of the birth path>\" (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
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 89 additions & 0 deletions tests/workflows/arrival_pack_anchor_override_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# 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:-<no Anchor override line>}"
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 ]]
16 changes: 15 additions & 1 deletion tests/workflows/governance_policy_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 12 additions & 3 deletions verification/proofs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading