Repository navigation
chore(sync): proof guide carries the checked-cone exception; anchor override names allowed languages #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
chore(sync): proof guide carries the checked-cone exception; anchor override names allowed languages #39
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 foranchor_allows_denied, rather than adding only the later override sentence.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
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.mdcarries 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