Skip to content

policy: owner-approved-foreign only for new foreign files and the gate itself (Closes #10197) - #10201

Merged
gHashTag merged 1 commit into
masterfrom
policy/label-only-for-gate-files
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
policy/label-only-for-gate-files

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

What

owner-approved-foreign is now needed only for the most important files, not for every pull request that touches existing foreign code.

change before after
modify an existing foreign file (M): compiler.rs, cli/t27b/**/*.rs, a workflow .yml, scripts/tri DENY, label needed ALLOW (R_MODIFIED), held by the budget
add a new foreign file (A), or rename/copy/type-change to a foreign path DENY DENY, label needed
the gate itself: the spec, gen/c/policy/own_language.c, lefthook.yml, .github/workflows/own-language.yml, tools/policy/foreign-exceptions.txt (CI) PROTECTED PROTECTED, label needed
check_budget(): 40 added foreign lines per file, 80 per PR, never more added than deleted every PR, no label lifts it unchanged
  • specs/policy/own_language.t27
    • New ALLOW reason R_MODIFIED = 8.
    • existing(kind, r) maps a foreign reason to it when kind == 'M'.
    • counts_against_budget() now classifies as 'A', so modified foreign files still count against the budget. Without this change they would have dropped out of it.
    • New tests for each row of the table. Tests that described a file's kind now use 'A'.
  • gen/c/policy/own_language.c: t27c gen-c output (L2), regenerated on the Railway lab.
  • .github/workflows/own-language.yml: header comment only. 5 lines added and 5 deleted, so it is net zero for the budget. The if: label conditions are unchanged.
  • AGENTS.md: the "Only t27" and "t27b is written in t27" bullets now describe the new rule.

Authorization

Owner instruction in this Claude Code session, 2026-10-18 (translated): remove this, the label owner-approved-foreign is not needed on every PR, only for the most important files. This PR changes the gate's protected files, so it carries that label. The label waives the path check only; the budget step still runs on this PR. The local hook denies every change to the gate's own files, so the commit and the push were made with LEFTHOOK=0, as with #7399. This time the agent ran them in the owner's terminal, on the owner's explicit instruction in the session (2026-10-18, translated): "Yes, I authorize it: run the LEFTHOOK=0 commit and push in my terminal tab".

Verified on the Railway lab (base 6d60995)

  • cargo build --release -p t27c: exit 0.
  • t27c gen-c of master's spec reproduces master's own_language.c byte for byte. The committed C is the gen-c output of this spec; sha256 590d8243 matched after transfer.
  • t27c check: 0 errors.
  • t27c test-report specs/policy/own_language.t27: 36/36 pass, 0 vacuous, 2 invariants proved.
  • Negative control: flipping one new assert (classify('M', lower.rs) == DENY) gives 35 pass and 1 FAIL.
  • Generated gate, compiled with cc exactly as lefthook does:
    • --ci with M compiler.rs, M cli-tri.yml, M scripts/tri: exit 0.
    • A tools/new_tool.rs: exit 1.
    • R100 a.t27 b.py: exit 1.
    • M specs/policy/own_language.t27: exit 1.
    • M tools/policy/foreign-exceptions.txt in CI: exit 1.
    • M lefthook.yml locally: exit 1.
  • Generated budget: 3 added and 1 deleted gives exit 1; 1 added and 1 deleted gives exit 0.

Closes #10197

🤖 Generated with Claude Code

…e itself (Closes #10197)

Owner rule, 2026-10-18 (translated): the label must not be needed on
every pull request, only for the most important files.

specs/policy/own_language.t27: a modified (git M) hand-written foreign
file now gets the ALLOW reason R_MODIFIED (8) via existing(). New files,
renames, copies and type changes to a foreign path stay DENY. The gate's
own files and tools/policy/foreign-exceptions.txt stay PROTECTED.
counts_against_budget() classifies as 'A', so modified foreign files
still count against check_budget() (40 per file, 80 per PR, shrink-only),
which no label lifts.

gen/c/policy/own_language.c is t27c gen-c output (L2), regenerated on
the Railway lab. AGENTS.md and the own-language.yml header comment are
updated to match (the yml is net zero lines).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 18, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 18, 2026 04:10
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 04:13:03 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=0f8c66b9ed0e != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 5b70c4f into master Oct 18, 2026
26 of 32 checks passed
gHashTag added a commit that referenced this pull request Oct 18, 2026
…) (#10211)

#10201 changed specs/policy/own_language.t27 without resealing it, so
tools/check_seal_coverage.py has failed on master since: the seal is
stale. The seal is renewed with t27c built from master 27efeba on
the Railway lab (`t27c seal specs/policy/own_language.t27 --save`):
new spec_hash and gen hashes, tests 36/36, 0 vacuous. Only the seal
file changes. The spec, its generated C and the workflow are the
gate's protected paths and are not touched, and seal_baseline.txt is
unchanged.

Lab, master 27efeba + this change: check_seal_coverage.py exits 0,
"OK: 2512 seals, 2390 hold, 122 known-broken".

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

policy: owner-approved-foreign only for new foreign files and the gate itself, not for every edit

1 participant