Jurisdiction-neutrality gate: state policy in shared Rust, SQL CHECKs, templates and the neutral packs fails the pre-push battery (#2208, epic &128)

Status: Done (2026-09-22) — !1484
Epic: &128
Issues: #2208
Branches: feat/2208-neutrality-gate (carries this page)

This is a Design + Scope plan: GitLab owns tracking, #2208 carries the brief, the plan freezes when U-A starts. One MR — page + nav, U-A, U-B, U-C, the Done flip — one battery.

Erratum (2026-09-22): N5 also skips a JSON string value whose key begins with _ (_comment, _source — the packs' JSON annotation convention, the analogue of the TOML notes exemption); N3’s unsupported-CHECK failure applies to list and pattern forms on a declared column (IN, NOT IN, = ANY, ~, LIKE, SIMILAR TO), not to a single-token = / <> / IS NULL reference, which the real tree carries (snap_certification_adjustments, application_interviews).

Context

The audit behind epic &128 found 42 sites of state policy compiled into shared code (closed Georgia vocabularies in canopy-contracts- and canopy-reference, PAMMS-cited enums, nine SQL CHECK … IN (…) lists that pin pack vocabularies, Georgia copy in canopy-web templates and canopy-portal, Georgia values under rulesets/federal/) and named the mechanism: every existing lint targets *numeric literals. policy audit-literals (xtask/src/cmd/policy.rs:1604-1644) matches Decimal::from( and dec!(; policy audit-jurisdiction-literals (:1854-1953) matches the helpline digits, a quoted "GA" and Georgia prose in canopy-portal only; policy audit (crates/canopy-policy/src/citation.rs:498-510) checks citation authority in rulesets/default/ only. Nothing reads enums, string arrays, migrations, templates, rulesets/federal/ or the fixture packs, so each family passed the ADR-011 sweeps with its numbers extracted and its vocabulary intact.

The battery already has the shape this gate needs: in-process static gates registered in stage_static_gates (xtask/src/cmd/validate.rs:277-309) with a matching stage(id, name, policy, capture) row in STAGES (xtask/src/validate_report.rs:204-515; the [N/57] label is STAGES.len(), so a new row renumbers everything); findings printed as ✗ path:line … and an anyhow::bail! count; the fail-closed walker (walk::files_with_extension, walk::read_to_string); textscan::mask_literals_and_comments + test_block_ranges to skip #[cfg(test)] bodies; syn 2 (full, visit), regex 1, walkdir 2, toml 0.8, proptest already in xtask/Cargo.toml. The allowlist conventions are split across two files: compliance/jurisdiction-literal-allowlist.toml (file + line_contains + reason; no stale detection) and compliance/action-coverage-allowlist.toml (issue = "#N" or kind = "by-design" + adr; stale entries fail, policy_actions.rs:212-246, action.rs:356-380). This gate takes the second convention and adds an exact per-entry count so an allowlisted file can neither grow nor drain silently. Migrations are forward-only (ADR-016): a wrong CHECK is retired by a later DROP CONSTRAINT, never by editing the file, so the SQL detector must read the constraint lifecycle, not single files.

Rulings in force: the gate is scoped to the SHARED tree — a per-jurisdiction extension crate (#2216) may name its state, so the config carries an exclude_globs list; no site is fixed by the #2208 MR (each belongs to a family issue of &128 — #2209, #655, #2210–#2215); every baseline entry names its owner; git push is the only gate.

Scope

In scope

  • One new xtask module xtask/src/cmd/neutrality_lint.rs (six pure detectors, the config loader, the allowlist matcher, the report), syntax-aware comment masking in xtask/src/textscan.rs, the neutrality validate stage and the cargo xtask neutrality-lint [--explain] [--print-baseline] subcommand.

  • One config file compliance/neutrality-gate.toml (token lists, pack-vocabulary column declarations, allowlist) with the baseline entries for every open site the gate finds on main, each carrying its family issue (or a by-design ADR) and a reason.

  • Antora: the xtask catalog section, the validate stage table, the ADR-011 ATO evidence gate table, one paragraph in rulesets.adoc; CHANGELOG.

Out of scope

  • Fixing any flagged site (the families); folding audit-jurisdiction-literals (#1226) into this module (a follow-up only if the maintainer wants one gate; its helpline detector spans test code, which this gate does not).

  • A CI job (the pre-push battery is the gate; CI runners are not).

  • Enforcing fixture-pack divergence from georgia (each family’s acceptance criterion); the gate does flag Georgia identity and non-fixture authorities INSIDE rulesets/test-min and rulesets/test-max, the corpus half it can see.

  • Numeric policy values (ADR-011’s sweeps own them); the semantics of extension-crate exclusion beyond exclude_globs (#2216); growth INSIDE an already-flagged line (a second Georgia token on the same line) — the gate’s promise is no new line, declaration member, constraint token or pack file, stated in the catalog page.

Design

Decisions

# Decision

D1

One in-process Blocking stage, neutrality, immediately after jurisdiction-literals. validate_report.rs: stage("neutrality", "jurisdiction-neutrality gate (#2208)", Blocking, ErrorChainOnly) inserted after the jurisdiction-literals row (:273-278); validate.rs stage_static_gates: h.run_gate("neutrality", crate::cmd::neutrality_lint::run)?; after the jurisdiction-literals call (:286-289) — inventory order == runtime order is enforced by Harness::checkpoint. CLI: Command::NeutralityLint(neutrality_lint::Args) in xtask/src/cmd/mod.rs dispatched in main.rs, the test-lanes-lint wiring copied; Args { explain: bool, print_baseline: bool }; run() = run_with(Args::default()).

D2

Scope of the walk (fail-closed, crate::walk).

  • Rust code: services//src and crates//src .rs files, EXCLUDING crates/canopy-test-lib, any path with a tests, benches, examples or infra_tests component, files named tests.rs or _tests.rs (is_test_path, policy.rs:1762), lines inside test_block_ranges (policy.rs:2556), and *out-of-line test modules: a pre-pass per crate root marks as test paths every file a #[cfg(test)]-attributed bodiless mod name; declares (the module’s own file, the mod.rs inside a directory named after the module, and everything under that directory, relative to the declaring file’s module directory — the crate source root for main.rs, lib.rs and mod.rs, else the directory named after the file stem; the attribute is recognised with the cfg_predicate_names_test text twin, policy.rs:2477), iterated to a fixpoint so a test module’s own children are covered. xtask, tools, design, target are never walked.

  • SQL: every .sql under services//migrations and services//outbox-migrations (the migrations_lint::migration_dirs roots, :123-140), read per service in filename (version) order.

  • Templates: every .html under services/canopy-web/templates.

  • Packs: every .toml, .json, .typ and .txt under rulesets/default, rulesets/federal, rulesets/test-min, rulesets/test-max (never rulesets/georgia; .policy-cache directories pruned).

  • Test code (N6 only): the Rust roots above restricted to test paths, out-of-line test modules and test_block_ranges, plus every .rs under services//tests and crates//tests.

[scope].exclude_globs (glob on the repo-relative path; a matcher written in the module that supports , ? and * — globset is not a dependency) removes paths from every detector; it ships empty with a comment naming #2216.

D3

The config file compliance/neutrality-gate.toml — schema and validation in the "Config schema" section below the table (header: Source of truth / Enforced by / Why / Schema, the typed-id-path-allowlist.toml convention). Every [[allow]] entry carries an exact count, an optional non-empty line_contains, an owner (issue or kind = "by-design" + adr) and a reason; [[pack_vocabulary_columns]] declarations must match a live CHECK or they are stale.

D4

Six pure detectors, fn detect(rel: &str, content: &str, cfg: &Config) → Result<Vec<Finding>> each; Finding { detector: Detector, file, line, excerpt } (Detector is an enum, serde(rename_all = "kebab-case")). Identity matching is ONE shared function identity_hit(text) → bool: the prose regexes P1 over the text, plus the identifier rule P2 over every [A-Za-z0-9_]+ run in the text. The three policy.rs helpers reused — is_test_path (:1762), is_in_ranges (:2428), test_block_ranges (:2556) — become pub(crate).

  • N1 rust-identity — non-test Rust code. Scan textscan::mask_comments(content, CommentSyntax::rust()) (comments blanked, string and char literal interiors KEPT, newline- and column-preserving) line by line outside test ranges; a line with an identity hit is a finding. Rationale prose in comments is fine; identifiers and rendered strings are the leak.

  • N2 rust-vocab — non-test Rust declarations. syn::parse_file; a parse failure FAILS the run naming the path (every walked file passes clippy, so a parse failure is a defect, never a shrink). Visit every ItemEnum, and every ItemConst and ItemStatic whose type is an array or slice of &str; a finding on the declaration line when (a) its doc attributes (joined) match a manual-citation regex P4, or (b) any variant ident, variant doc or array element literal has an identity hit. Items inside a #[cfg(test)] module are skipped (crate::cfg_predicate::attrs_have_cfg_test on the module chain). The excerpt is enum Name members=N digest=HHHHHHHHHHHH (or const NAME …): the first 12 hex of SHA-256 over the sorted member idents (or element literals) joined by newlines — an allow entry pins line_contains = "digest=…", so any member change un-absorbs the declaration.

  • N3 sql-check — migrations, as a constraint lifecycle. Per service, in version order, with comments masked (CommentSyntax::sql(), '…' strings kept): every CHECK (…) expression (balanced parentheses; the extractor never panics, every span it returns is balanced) matched by P3 defines a constraint keyed (table, name) — name is the explicit CONSTRAINT name or PostgreSQL’s default <table>_<column>_check; the table is the enclosing CREATE TABLE or the ALTER TABLE target, schema prefix dropped, quoted identifiers unquoted. ALTER TABLE t DROP CONSTRAINT [IF EXISTS] name retires (t, name); DROP TABLE [IF EXISTS] t retires every constraint of t; ALTER TABLE t DROP COLUMN c retires (t, t_c_check); ALTER TABLE t RENAME TO with live tracked constraints FAILS the run as unsupported. Only constraints still live at the end are candidates, reported at their defining file:line. A live constraint is a finding when: (a) two or more of its tokens are in the pack token universe V, or (b) any token has an identity hit, or (c) (table, column) is declared in [[pack_vocabulary_columns]]. V = the union over every rulesets/*/jurisdiction.toml (all slugs; federal has none) of every string element of a string array plus every code string of an array-of-tables row (toml::Value, built once per run), MINUS the canopy_reference::Program slugs (snap, tanf, medicaid, chip, caps, wic — a federal enum enabled_programs happens to list). A CHECK on a federal enum that (a) still flags takes a by-design entry with adr = "ADR-006". A CHECK expression that names a declared column but does not match P3 FAILS the run (unsupported CHECK expression on declared pack-vocabulary column t.c at file:line). The excerpt is t.c CHECK tokens=N digest=HHHHHHHHHHHH (SHA-256 over the sorted token list); entries pin the digest.

  • N4 copy-identity — templates. Mask {# … #} and <!-- … -→ regions (CommentSyntax::askama_html()), then any remaining line with an identity hit.

  • N5 pack-identity — the neutral and fixture packs. (a) Content: mask comments per language (.toml — outside single-, double- and triple-quoted strings, tracked across lines so a inside a multi-line string is content; .typ — // and /* … */ outside "…" strings; .json and .txt — no comment syntax, whole file), skip the value of a notes or note key including the continuation lines of a multi-line string, then any remaining line with an identity hit. (b) Structure, in all four packs: every citation table in citations.toml with a state_citation key, or an authority outside canopy_policy::citation::DEFAULT_RULESET_AUTHORITIES (fixture is in that list); in rulesets/default every .json whose top-level "name" starts georgia-.

  • N6 test-canon — test code, line-based by design (an assertion that does not close on its line is not scanned; the pins the audit found are single-line). (a) For assert!, assert_eq!, assert_ne! closing on the line: split the macro’s arguments at top-level commas; the subject is the first argument with whitespace removed; it pins when it contains .contains(" followed by PAMMS, Georgia, PeachCare or Pathways; polarity: assert! — a finding when the subject does not start with !; assert_eq! — a finding when (subject does not start with !) equals (second argument is true); assert_ne! — a finding when (subject does not start with !) equals (second argument is false); any other second argument is not a finding. (b) In crates/canopy-contracts-* and crates/canopy-reference test code only (canopy-policy and canopy-composition load every pack by design): a string literal containing rulesets/georgia/, or a line containing both join( and the literal "georgia" — a shared wire or reference crate’s tests must not depend on one pack.

D5

Allowlist matching, the count ratchet and staleness.

  • An entry matches a finding when detector and file equal and either the entry has no line_contains or line_contains is a substring of the finding’s excerpt. A finding is absorbed by at most one entry; a pair’s entries are tried in file order.

  • Every entry REQUIRES the number of findings it absorbs to equal count: more → regression (N found, count = M); fewer but non-zero → ratchet: lower count to N; zero → stale allowlist entry — the site is fixed; delete the entry. The file never silently grows and the baseline stays truthful as families drain it.

  • A [[pack_vocabulary_columns]] declaration matching no live constraint → stale pack-vocabulary declaration.

  • The gate exits non-zero on any unabsorbed finding, regression, ratchet, stale entry, stale declaration, unsupported CHECK or config error.

  • --explain prints a per-entry hit tally (the audit-literals --explain shape).

  • --print-baseline prints, instead of failing, a TOML skeleton of [[allow]] entries for the UNABSORBED findings only, grouped by (detector, file) with the exact count, a line_contains = "digest=…" per N2/N3 finding, and empty issue and reason — the implementer fills them; the loader rejects empties, so the skeleton cannot be committed as-is.

D6

Output. === Jurisdiction-Neutrality Gate (#2208) ===, Loaded E allowlist entries, K token patterns, C pack-vocabulary columns., per finding ` ✗ path:line [detector] — excerpt`, then F files scanned, A findings allowlisted across E entries, V un-allowlisted, S stale, R ratchet. and anyhow::bail!("{v} jurisdiction-neutrality violation(s) — packs declare vocabularies and values; shared Rust validates against the pack; a CHECK never pins a pack vocabulary; a template never names a state. Fix at the source or add an entry with an owner and a reason to compliance/neutrality-gate.toml (epic &128)."). Clean run: ✓ No un-allowlisted findings (A allowlisted across E entries).

D7

Baseline.

  • On the branch, run cargo xtask neutrality-lint --print-baseline against main's tree and commit the entries with the owning issue: Medicaid/CHIP sites → #655; SNAP certification vocabulary → #2209; TANF → #2210; intake → #2211; values/narratives → #2212; web/portal copy → #2213; form_kind CHECK → #2214; federal constants → #2215.

  • Federal reference tables that DEFINE Georgia (crates/canopy-reference/src/fips.rs state rows, counties keyed by FIPS) and CHECKs on federal enums → kind = "by-design", adr = "ADR-006".

  • A site no family owns gets ONE fix: issue per cluster, filed in U-B’s R2 step and referenced from its entry — never a reasonless or issueless entry.

  • [[pack_vocabulary_columns]] shipped (each verified against a live constraint before commit): snap_certifications.certification_type (renewals 20260401, re-declared 20260723, 20261221), snap_universe_snapshot_rows.certification_type (20270107), snap_renewal_decisions.certification_type (20270108), snap_certification_adjustments.new_type (20261224), snap_certification_adjustments.certification_category (20261229), enrollment_continuations.certification_category (enrollment 20270105) → #2209; snap_periodic_reports.form_kind (renewals 20260721) → #2214; application_postponement_episodes.reverted_reason (applications 20261223) and application_interviews.interview_mode (applications 20261124) → #2211. The ELE tier CHECKs are caught by rule (b) (peachcare).

  • Expected size: the audit’s 42 sites plus the count-form files (canopy-reference labels, canopy-notices generator strings, fixture-pack JSON copied from georgia, the four federal authority = "manual" and "pamms" citation rows).

D8

Docs. docs/modules/ROOT/pages/tooling/xtask-catalog.adoc: a catalog row and a == neutrality-lint — jurisdiction neutrality (epic &128) section (usage, the six detectors in one table, the config schema, the count rule, what the gate does NOT promise — same-line growth — and the extension-crate exclusion); docs/modules/ROOT/pages/testing.adoc, anchor validate-stages: neutrality added to the in-process gates row and the stage count (57 → 58; the same count at xtask-catalog.adoc:117); docs/modules/ROOT/pages/compliance/adr-011-ato-evidence.adoc gate table: one row (CI job cell — (pre-push stage neutrality), command cargo xtask neutrality-lint, exception file compliance/neutrality-gate.toml); docs/modules/ROOT/pages/rulesets.adoc after the default-ruleset-authority anchor: one paragraph stating the rule sentence and that the gate enforces it over the default, federal and fixture packs; CHANGELOG.adoc === Added.

Config schema

[scope]
exclude_globs = []            # per-jurisdiction extension crates (#2216), e.g. "crates/canopy-ext-*/**"

[tokens]                      # see "Patterns" — P1 prose regexes, P2 identifier stems, P4 manual citations
prose = [...]
stems = [...]
compound_stems = [...]
manual_citation = [...]

[[pack_vocabulary_columns]]   # a live CHECK list on this column is always a finding
table = "snap_certifications"
column = "certification_type"
pack_key = "snap.certification.categories"   # documentary: the loader never resolves it
issue = "#2209"

[[allow]]
detector = "rust-vocab"       # rust-identity | rust-vocab | sql-check | copy-identity | pack-identity | test-canon
file = "crates/canopy-contracts-renewals/src/certifications.rs"
line_contains = "digest=3f9a1c0b7e2d" # optional, non-empty; N2/N3 entries pin the digest
count = 1                     # exact number of findings this entry absorbs
issue = "#2209"               # tracked form; OR kind = "by-design" + adr = "ADR-NNN" (page must exist)
reason = "closed CertificationType enum (Chart 3105.1); #2209 makes the vocabulary pack data"

Validation (a config error, not a pass): every regex compiles; detector deserialises into Detector; count ≥ 1; line_contains, when present, is non-empty; reason non-empty; tracked entries carry issue = "#N" and no adr; by-design entries carry adr whose page exists (policy_actions::adr_page_exists, made pub(crate)) and no issue; a (detector, file) pair carries EITHER exactly one entry without line_contains OR one-or-more entries with distinct line_contains, never both; file is repo-relative with forward slashes; [[pack_vocabulary_columns]] rows carry table, column, issue (pack_key optional, documentary).

Patterns

# P1 — prose regexes (case-sensitive, the `regex` crate), matched over the non-comment text
prose = ["PAMMS", "Chart [0-9]", "\\bMT-[0-9]", "\\bDFCS\\b", "\\bDCH\\b", "\\bDECAL\\b", "\\bDPH\\b",
  "Women's Health Medicaid", "Planning for Healthy Babies", "NOW waiver", "COMP waiver", "Senior SNAP",
  "\\bForm [0-9]{2,4}\\b"]
# P2 — identifier rule: every [A-Za-z0-9_]+ run is split on `_` and on a lower-case-or-digit → upper-case
# boundary (P4hbFp → p4hb, fp; GrgPayment → grg, payment; tfsp_signature → tfsp, signature; "georgia-snap-…"
# → georgia, snap, …); a run hits when any lower-cased segment equals a stem, or the lower-cased whole run
# contains a compound stem (PeachCare → peachcare). `msp` is deliberately absent (Medicare Savings Program).
stems = ["georgia", "dfcs", "dch", "decal", "pathways", "p4hb", "whm", "edwp", "icwp", "grg", "crisp", "tfsp", "cso"]
compound_stems = ["peachcare", "pamms", "nowwaiver", "compwaiver", "seniorsnap", "georgiadol"]
# P3 — SQL (case-insensitive, applied to whitespace-collapsed, comment-masked text); IDENT = "?[A-Za-z_][A-Za-z0-9_]*"?
#   column list:  IDENT (?:::\w+)? \s+ (?:NOT\s+)? IN \s* \( TOK (?:\s*,\s*TOK)* \)
#   any-array:    IDENT \s* = \s* ANY \s* \( \s* ARRAY \s* \[ TOK (?:\s*,\s*TOK)* \] \s* \)
#   TOK = '(?:[^']|'')*' (?:::\w+)?          — quoted tokens only; numeric lists ignored
#   table:        CREATE TABLE (?:IF NOT EXISTS )? (?:IDENT\.)? IDENT   |   ALTER TABLE (?:ONLY )? (?:IDENT\.)? IDENT
#   retire:       DROP CONSTRAINT (?:IF EXISTS )? IDENT  ·  DROP TABLE (?:IF EXISTS )? IDENT  ·  DROP COLUMN IDENT
# P4 — manual-citation regexes for N2's doc attributes
manual_citation = ["PAMMS", "Chart [0-9]", "\\bMT-[0-9]", "\\bDFCS\\b", "\\bDCH\\b", "\\bDECAL\\b", "\\bDPH\\b", "state plan", "Georgia"]

Invariants

  • The gate is pure over the tree + the config: no network, no database, no git; a walk or read error, an unparsable Rust file, an unsupported CHECK over a declared column or a table rename with live constraints fails the run (never shrinks it).

  • Comments never produce a finding in Rust code, SQL, TOML, Typst or templates — with one deliberate exception, N2’s reading of the doc attributes ON a vocabulary declaration, which is the citation that marks the vocabulary as policy.

  • Every allowlist entry names an owner and a reason, absorbs at least one finding and exactly count findings; every pack-vocabulary declaration matches a live constraint.

  • rulesets/georgia is never scanned; a path under [scope].exclude_globs is never scanned.

  • Adding a stage row and its run_gate call is the whole battery change; --skip-docker and stage capture kinds are untouched.

Units (weights by complexity) — U-A → U-B → U-C, one MR

U-A (w5) — feat(xtask): add the jurisdiction-neutrality gate (#2208)

Files: xtask/src/cmd/neutrality_lint.rs (new), xtask/src/cmd/mod.rs + xtask/src/main.rs (subcommand), xtask/src/textscan.rs (CommentSyntax + mask_comments), xtask/src/cmd/policy.rs (is_test_path, is_in_ranges, test_block_ranges → pub(crate)), xtask/src/cmd/policy_actions.rs (adr_page_exists → pub(crate)), xtask/src/cmd/validate.rs + xtask/src/validate_report.rs (stage), compliance/neutrality-gate.toml (scope + tokens + columns; allow = [] in this commit). Tests (inline #[cfg(test)], in-memory sources, tempfile trees for walks):

  • Identity rule — tfsp_signature, GrgPayment, pathways_enabled, whm_eligible, P4hbFp, "PeachCare for Kids", "georgia-snap-self-employment-deduction", GEORGIA hit; msp_eligible, crispness (prose), Peach, snapshot do not.

  • N1 — identity in a string literal and in an identifier are findings; the same token in // and /// and inside a [cfg(test)] mod is not; a file declared by [cfg(test)] mod test_support; in main.rs is not scanned by N1 (and is scanned by N6); mask_comments keeps literal interiors and blanks nested block comments.

  • N2 — an enum whose doc cites PAMMS 3105 Chart 3105.1 is a finding with members= and digest=; adding a variant changes the digest; an enum with PeachCare as a variant is a finding; an enum documented with a CFR cite only is not; a const X: [&str; 5] holding "tfsp_signature" is a finding; an unparsable file fails the run naming the path.

  • N3 — CHECK (form_kind IN ('528','297','508')) is a finding when V holds the three tokens, and not when V holds one; migration A adds an inline CHECK and migration B drops it by its PostgreSQL default name → no finding, A alone → a finding at A’s line; a named CONSTRAINT … CHECK dropped by name → no finding; DROP TABLE retires; a multi-line CHECK, a lowercase check (, a NOT IN (…) list, CHECK ("certification_type" IN ('standard'::text,'senior'::text)), public.snap_certifications, an = ANY (ARRAY[…]) form and an escaped '' token parse; a numeric IN (1,2) is ignored; program IN ('snap','tanf') is not a finding; the real application_interviews.interview_mode SQL is a finding under its declaration; a declared column inside a CHECK P3 cannot parse fails the run; ALTER TABLE … RENAME TO with a live tracked constraint fails the run; the digest changes when a token is added.

  • N4 — {# PAMMS #} and <!-- Georgia -→ are not findings, <option>Senior SNAP (36 months)</option> is.

  • N5 — notes = "… PAMMS …", a multi-line notes = """ … Georgia … """, bbce_enabled = true # Georgia uses BBCE and a Typst let x = 1 // Georgia / /* PAMMS / are not findings; label = "Georgia # 1", label = "PeachCare", a """…""" string containing Georgia as content, a .txt line naming Georgia and a Typst string "PeachCare" are; a test-max citation row with authority = "pamms" and a federal row with state_citation are; a default/.json name georgia-snap-eligibility is.

  • N6 — assert!(text.contains("PAMMS")), assert_eq!(text.contains("PAMMS"), true) and assert_ne!(text.contains("PAMMS"), false) are findings; assert!( !text.contains("PAMMS")), assert_eq!(text.contains("PAMMS"), false) and assert_ne!(text.contains("PAMMS"), true) are not; .join("rulesets").join("georgia") in a crates/canopy-contracts- test is a finding, the same line in crates/canopy-policy or a services/* test is not.

  • Allowlist — each validation rule has a rejecting test (unknown detector, empty reason, empty line_contains, count = 0, tracked without issue, by-design with a missing ADR page, both forms on one pair, stale pack-vocabulary declaration); count exact passes, over → regression, under → ratchet, zero → stale; a line_contains entry absorbs only its finding; exclude_globs prunes (, ?, *); an unreadable subdirectory fails the run (walk::fault::lock_dir); the stage inventory tests (inventory_has_no_duplicate_ids, fresh_report_seeds_full_inventory_as_not_run) still pass with 58 stages.

  • Property tests (proptest, the textscan.rs precedent): every CommentSyntax masker never panics and preserves the line count and every line’s char count for arbitrary input; the CHECK (…) extractor never panics and every span it returns is parenthesis-balanced; the glob matcher never panics and ** matches any path prefix; the identifier splitter never panics and its segments re-join to the run.

U-B (w3) — chore(compliance): seed the neutrality-gate baseline (#2208)

Files: compliance/neutrality-gate.toml (the [[allow]] entries and [[pack_vocabulary_columns]] per D7; every entry with an owner and a reason). Tests: cargo xtask neutrality-lint is clean on the branch; --explain shows every entry with exactly count hits; the five live-failure sites named in 2208 appear under their family issue; a repo-reading test in neutrality_lint.rs asserts the committed config parses and validates and that every tracked entry’s issue matches \d+ and every by-design entry’s ADR page exists — no test pins a site that a family will remove.

U-C (w2) — docs(xtask): document the neutrality gate (#2208)

Files: the four Antora pages in D8, CHANGELOG.adoc, this page’s Status → Done.

Verification

  1. cargo xtask neutrality-lint on the branch: clean; --explain lists every allowlist entry with its hit count equal to count; --print-baseline on a tree with the [[allow]] entries removed prints exactly the committed entries' (detector, file, line_contains, count) set.

  2. Mutation checks in a scratch copy (never committed): add let x = "PeachCare"; to a service src file → one rust-identity finding; delete the single site behind a count = 1 entry → one stale failure; delete one of the N sites behind a count = N entry → one ratchet failure; add a second Georgia line to that file → one regression failure; add a variant to an allowlisted enum → its digest= entry goes stale and the new digest is un-allowlisted; add a forward migration that DROP CONSTRAINTs an allowlisted CHECK → its entry goes stale (the drain path); add CHECK (kind IN ('528','297')) to a migration → one sql-check finding; add Georgia inside {# #} → clean.

  3. The push battery prints [17/58] jurisdiction-neutrality gate (#2208) after [16/58] jurisdiction-literal audit (#1226); test-results/validate-report.json carries the stage.

  4. git push — the pre-push battery is the gate (it runs cargo xtask validate; no separate run).

Documentation Updates

  • tooling/xtask-catalog.adoc (row + section), testing.adoc (stage row + count), compliance/adr-011-ato-evidence.adoc (gate row), rulesets.adoc (one paragraph).

  • CHANGELOG.adoc — == Unreleased === Added.

  • GitLab: every fix: issue filed for an orphan cluster in D7 related to &128; #2208’s closing comment lists the baseline size per family.

Review log

round vendor resolved model verdict

1 (2026-09-21)

Anthropic

claude-fable-5-1

no-ship — six blockers fixed in-plan: a nav anchor that did not exist; N5’s TOML rule made a trailing # Georgia comment a finding; count and line_contains entries could coexist for one file with undefined arithmetic; four pack-vocabulary column names did not exist and the certification columns were not enumerated (their tokens are not in V); three commit subjects lacked a verb; the new parsers had no property tests. Q3 clean; Q4 D5/D7/U-A bulleted.

2 (2026-09-21)

OpenAI

gpt-6-astra

no-ship — 18 findings (5 P1, 11 P2, 2 P3), each verified against 692c4bf1b and resolved in-plan: application_postponement_episodes (D7); the constraint lifecycle so ADR-016 forward drops retire findings (N3); identifier-segment matching for snake_case and CamelCase tokens, msp dropped (P2); exact count on every entry and a member digest on N2/N3 findings (D3/D5); interview_mode declared (D7); quoted identifiers, casts, schema prefixes and an explicit failure on unsupported CHECKs (P3); .txt templates and fixture-pack authorities (N5); out-of-line #[cfg(test)] modules (D2); assertion polarity and composed georgia paths with a narrowed N6(b) scope; syntax-aware TOML/Typst masking; U-B and mutation fixtures per entry form; pipes moved out of the table; completion-lint wording and path tokens; five commits, one battery; the success line and the comment invariant reworded. No round 3.

Edit this page · default