Skip to content

Commit 35e2b22

Browse files
chore(governance): drop the skills CODEOWNERS rows; the mirror exempts low-risk arm rows (#33948)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi94Bm1UetTUkAru2JFLUkZvZ)_ Fixes #33704 Clause-②: no Metadata-protocol: none Ruling-ref: 6891850019 ## 维护者速读 - 改了什么:删掉 `.github/CODEOWNERS` 里 `/skills/` 和 `/ui/skills/` 两行;队列守卫的 CODEOWNERS 镜像检查改为从登记表读「低风险技能臂」,带这个臂的行不再要求有 CODEOWNERS 行,反而有行就报红;同时改写 AGENTS.md 第 14 条里 CODEOWNERS 那句(改为「every Tier H surface but the low-risk catalogs」,中继逐个 PR 请审),并修正 check-governed-merges.mjs 两处注释。 - 为什么改:按你的裁决 6891850019「删除这两行(排在审计之后)」。审计工作流已上线(#33766),技能 PR 请谁审改由中继逐个 PR 判断,不再每个技能 PR 都自动请你和 os-zhuang。 - 风险与回滚:只影响 GitHub 自动请审;落地门槛(Tier H 仍需批准)、审计、中继请审都不变。回滚 = revert 本 PR。 - 先看:`scripts/pm/check-governed-queue-guard.mjs` 的 `codeownersMirrorVerdict`(约 L792–L849);`AGENTS.md` L306–L307(第 14 条里「CODEOWNERS 路由每个 Tier H 面」改为低风险技能目录除外);再看 `.github/CODEOWNERS` 的删行与注释。 - 两分钟验证:`node scripts/pm/check-governed-queue-guard.mjs --self-test`,预期 `534 cases pass`。 - 需要你做的:批准并合并本 PR ## What changes - `.github/CODEOWNERS`: the `/skills/` and `/ui/skills/` lines are removed. The header paragraph that describes what the mirror check enforces and the two group comments above the removed lines say why those rows have no line. - `scripts/pm/check-governed-queue-guard.mjs`, `codeownersMirrorVerdict` (L792–L849 after the change; docblock and body only): a Tier H row that carries the register's low-risk arm in the repository under test (`lowRisk.repos`, read off each `GOVERNED_SURFACES` row; no pattern list is kept here) owes no CODEOWNERS line, and a line at its pattern is a problem naming the row. Rows without the arm are judged exactly as before. The verdict gains `armPatterns`; `tierHPatterns` now lists the Tier H patterns the file must carry. - The arm is scoped per repository by the register, so a sibling copy the arm does not reach (objectui) still owes the `/skills/` line. A pin holds that. - `AGENTS.md` L306–L307 (Prime Directive 14, the "Behind it" sentence): it said CODEOWNERS routes every Tier H surface to the approvers, which this PR makes false. It now reads "CODEOWNERS routes every Tier H surface but the low-risk catalogs to the approvers, the relay asks per pull on drafts (no barrier)". The two lines are rewrapped in place so AGENTS.md stays at its 1050-line ceiling (`check:pm-skill-ratchet`); to fit, "(a summons, no barrier)" became "(no barrier)" and the audit script is named by file, since its full path is given earlier in the same directive. Added by claim amendment 6896355134. - `scripts/pm/check-governed-merges.mjs`, comment text only (L479–L481, the low-risk arm docblock, and L6189, a self-test comment): both listed the CODEOWNERS mirror among the path-only readers that "answer as before". They now say the mirror reads the arm and keeps both catalog rows out of the file. No code changes. Added by claim amendment 6896370431. - Self-test (CODEOWNERS mirror battery, L5914–L5947): no other battery is touched. Line ranges are given because `check-governed-queue-guard.mjs` is shared with #33539's low-risk arm reader region; this diff stays inside `codeownersMirrorVerdict` and its battery. ### Forced pin edits (named) - `the-patterns-are-the-register-rows-root-anchored-prefix-or-exact`: the expected list loses `/skills/` and `/ui/skills/`. - `every-Tier-H-row-that-governs-this-repository-is-a-pattern-the-file-carries` → `…-or-an-arm-row-it-leaves-out`: the count is `tierHPatterns + armPatterns`, and the arm patterns must be absent from the file. - `⛔ a-Tier-H-row-with-no-line-is-a-problem-naming-the-row` → `⛔ a-Tier-H-row-with-no-arm-and-no-line-is-a-problem-naming-the-row`: re-pointed from `/skills/` (now an arm row) to `/AGENTS.md` (`agents-md`, no arm). - `the-ui-patterns-are-root-anchored-under-ui-the-ui-claude-tree-included`: the expected `/ui/` list loses `/ui/skills/`; `uiRows.length === 6` stays (a register fact) and `uiRouted.length === 5` is added. - `⛔ without-its-ui-lines-the-file-on-disk-is-short-one-line-per-ui-row` → `…-without-an-arm`: the count is the five ui rows without the arm, and `ui-skills-catalog` must not be named. ### New pins - `⭐ the-arm-patterns-are-the-register-rows-carrying-the-low-risk-arm-here`: `/skills/,/ui/skills/`, and equal to the register rows filtered on `lowRisk.repos`. - `⭐ a-per-pull-arm-row-with-no-line-passes`. - `⛔ a-line-routing-an-arm-row-is-a-problem-naming-the-row-even-with-every-owner`. - `⛔ the-arm-is-per-repository-a-sibling-copy-it-does-not-reach-still-owes-the-skills-line`. ## Tests `node scripts/pm/check-governed-queue-guard.mjs --self-test` at eb771b5: `✓ check-governed-queue-guard self-test: 534 cases pass` (main at 895783a: 530; +4 new pins). The CODEOWNERS battery floor (12) and the roster floor (31) are unchanged. <details><summary>Ablations at 3aaac4f (one-off, ablation-replace.mjs, restored to the HEAD blob each time; the guard file is byte-identical at eb771b5)</summary> - A. Restore the removed line-check (`armedIn` forced false, so arm rows owe a line again): mutation landed (blob f65808d → 809e2a20), self-test `10 of 534 case(s) failed`, including the file on disk (`skills-catalog` / `ui-skills-catalog` have no line), the arm-pattern pin, `a-per-pull-arm-row-with-no-line-passes` and the sibling pin. Restored: blob == HEAD, `git diff HEAD` empty. - B. Drop the arm-line problem (the `problems.push` under `if (arm)` disabled): mutation landed (blob f65808d → 1d3a69a0), self-test `1 of 534 case(s) failed`: `⛔ a-line-routing-an-arm-row-is-a-problem-naming-the-row-even-with-every-owner`. Restored: blob == HEAD, `git diff HEAD` empty. </details> ## Acceptance notes - Precondition of the ruling: #33717 is closed and the weekly governed-merges audit job is on main (PR #33766, `.github/workflows/fleet-patrols.yml`). - The arm-row line is refused, not merely tolerated, for the same reason a Tier S row's line is refused: a static line summons both approvers on every catalog pull, which is what the ruling removes. A reviewer who prefers "optional" deletes the `if (arm)` branch and pin B's assertion. - Out of scope, untouched: the `/.github/workflows/` row (its `split` arm has the same mismatch; it has its own card). The predicate reads `lowRisk` only, so the workflows line stays required until that card extends it. - Tier H on four paths: `.github/CODEOWNERS` and `AGENTS.md` are governed register rows; the two `scripts/pm/` files are the enforcement chain CODEOWNERS routes to the approvers. - `ui/scripts/__tests__/check-governed-queue-guard.test.ts` tests the `ui/` copy of the guard, not this file; nothing in `packages/**` or `ui/**` imports this script. ## Verification Head eb771b5. `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at eb771b5 derived 45 commands (38 at 3aaac4f, plus the AGENTS.md and check-governed-merges.mjs families: `check:pm-governed-merges`, `check:pm-governed-prose`, `check:pm-skill-id-lint`, `check:pm-skill-ratchet`, `check:docs-audit-scope`, `check-skills-token-ratchet` and its self-test). All 45 ran with exit 0 captured before any pipe, and `--ran` reconciles: `45 derived, 45 run, 0 NOT-MEASURED, 0 UNRUN` (a derived zero). `check:pm-skill-ratchet`: `AGENTS.md is 1050 lines (ceiling 1050; headroom 0)`. `pnpm check:pm-dispatch-gates` (fast tier): `2205 cases pass`. <!-- signed: domain:skills#2 · os-steve · session_01ADHkmPFUAMcPYPfnirkUSn --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 152f262 commit 35e2b22

4 files changed

Lines changed: 51 additions & 22 deletions

File tree

‎.github/CODEOWNERS‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
# `node scripts/pm/check-governed-queue-guard.mjs --self-test` reads this file
1414
# (`codeownersMirrorVerdict`) and reds when a Tier H row has no line here, when
1515
# any line names fewer or other owners than that constant, or when a Tier S row
16-
# (`.claude/**`, which lands on a seat's review of record) is routed here.
16+
# (`.claude/**`, which lands on a seat's review of record) is routed here. A
17+
# Tier H row carrying the register's low-risk arm (`lowRisk`: the two skills
18+
# catalogs) has NO line here and reds if one is added: the relay's per-pull
19+
# review plan reads the arm and decides who is asked (ruling record 6891850019).
1720
# Change the constant or the register first; this file follows in the same PR.
1821
#
1922
# What routing buys, and what it does not: GitHub requests a code owner's
@@ -38,19 +41,19 @@
3841
# without these entries the rule could be lifted by editing the enforcers
3942
# instead of the surfaces.
4043

41-
# Tier H governed surfaces — the register's rows with tier H
44+
# Tier H governed surfaces — the register's rows with tier H, less the
45+
# low-risk arm's `/skills/` row (see the header)
4246
/docs/adr/ @os-zhuang @hotlong
43-
/skills/ @os-zhuang @hotlong
4447
/AGENTS.md @os-zhuang @hotlong
4548
/CLAUDE.md @os-zhuang @hotlong
4649
/docs/NORTH-STAR.md @os-zhuang @hotlong
4750
/.github/workflows/ @os-zhuang @hotlong
4851

4952
# Tier H governed surfaces of the nested `ui/` workspace (#25712) — the same
50-
# register rows, under `ui/`; `ui/.claude/` is Tier H, unlike the root tree
53+
# register rows, under `ui/`; `ui/.claude/` is Tier H, unlike the root tree;
54+
# `/ui/skills/` carries the low-risk arm too and has no line
5155
/ui/docs/adr/ @os-zhuang @hotlong
5256
/ui/.claude/ @os-zhuang @hotlong
53-
/ui/skills/ @os-zhuang @hotlong
5457
/ui/AGENTS.md @os-zhuang @hotlong
5558
/ui/CLAUDE.md @os-zhuang @hotlong
5659
/ui/.github/workflows/ @os-zhuang @hotlong

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
303303
membership), so ask the maintainer at once to remove a queued PR by hand — then confirm from the remote that it is
304304
in neither the queue nor `origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a
305305
spent approval or a standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a
306-
governed diff without its tier's record; CODEOWNERS routes every Tier H surface to the approvers, and the relay
307-
requests them on drafts (a summons, no barrier); the post-merge audit (`scripts/pm/check-governed-merges.mjs`) lists
306+
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk catalogs to the
307+
approvers, the relay asks per pull on drafts (no barrier); the post-merge audit (`check-governed-merges.mjs`) lists
308308
every governed-surface merge with its approver and merger — a merger the maintainer does not recognise, any agent
309309
approval, or a Tier S merge without a PASS record is a seat violation, filed and rolled back. No seat judges this.
310310

‎scripts/pm/check-governed-merges.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@
476476
*
477477
* Modelled as the workflows split is: the `skills-catalog` and
478478
* `ui-skills-catalog` rows KEEP `tier: H` — every path-only reader (`--test`,
479-
* `--branch`, the CODEOWNERS mirror, the prose gate) answers exactly as before —
480-
* and carry `lowRisk`, scoped to objectstack. The relay's review plan is not
479+
* `--branch`, the prose gate) answers exactly as before, while the CODEOWNERS
480+
* mirror reads the arm and keeps both rows out of the file (ruling record
481+
* 6891850019) — and carry `lowRisk`, scoped to objectstack. The relay's review plan is not
481482
* path-only from #33540: `governedReviewPlan` (`scripts/pm/fleet-write/execute.mjs`)
482483
* reads the arm with its readers. A READING of the pull request
483484
* (`lowRiskArmVerdict`: every changed path, the body, the label names, the
@@ -6277,7 +6278,7 @@ async function selfTest() {
62776278
const rider = (p) => LOW_RISK_RIDER_PATTERNS.some((re) => re.test(p));
62786279
assert('the-rider-allowlist-is-changesets-and-Markdown-prose-under-the-docs-trees-only', Object.isFrozen(LOW_RISK_RIDER_PATTERNS) && [CS, 'docs/agents/x.md', 'content/docs/guides/x.mdx'].every(rider) && !['.changeset/config.json', 'docs/x.ts', 'content/docs/x.json', 'content/x.md', 'packages/docs/x.md', '.changeset/a/b.md'].some(rider));
62796280

6280-
// ⛔ Fail closed: no reading, or an unmeasured one, is H — the path-only readers (`--test`, `--branch`, CODEOWNERS, the prose gate) answer as before.
6281+
// ⛔ Fail closed: no reading, or an unmeasured one, is H — the path-only readers (`--test`, `--branch`, the prose gate) answer as before.
62816282
assert('⛔ no-reading-is-Tier-H-and-says-NOT-MEASURED', tier([SK], null) === GOVERNED_TIER_H && governedTierFor([SK], REPO) === GOVERNED_TIER_H && testVerdict([SK], { repo: REPO }).tier === GOVERNED_TIER_H && /low-risk skills arm .*NOT MEASURED/.test(renderTestVerdict(testVerdict([SK], { repo: REPO }))));
62826283
assert('⛔ an-unmeasured-reading-is-Tier-H-with-its-own-reason', tier([SK], { measured: false, reason: 'the pull could not be read' }) === GOVERNED_TIER_H && /the pull could not be read/.test(renderTestVerdict(testVerdict([SK], { repo: REPO, lowRisk: { measured: false, reason: 'the pull could not be read' } }))));
62836284

‎scripts/pm/check-governed-queue-guard.mjs‎

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -789,10 +789,19 @@ export function codeownersPatternFor(surface) {
789789
}
790790

791791
/**
792-
* The verdict: `{ ok, problems, tierHPatterns }`. `ok` holds only when
793-
* - every Tier H row of the register that governs `repo` has a CODEOWNERS
794-
* line at exactly its pattern, naming exactly `@` + every account in
795-
* `approvers` (order-free; nobody else, nobody fewer);
792+
* The verdict: `{ ok, problems, tierHPatterns, armPatterns }`. `ok` holds
793+
* only when
794+
* - every Tier H row of the register that governs `repo` and carries no
795+
* per-pull arm there has a CODEOWNERS line at exactly its pattern, naming
796+
* exactly `@` + every account in `approvers` (order-free; nobody else,
797+
* nobody fewer) — those patterns are `tierHPatterns`;
798+
* - no line routes a Tier H row that carries the low-risk arm in `repo`
799+
* (`armPatterns`, read off the row's own `lowRisk.repos`, never a list
800+
* kept here): who is asked to review such a pull is the relay's per-pull
801+
* plan, which reads the arm, and a static line would summon both
802+
* approvers on every catalog pull, the low-risk ones included (ruling
803+
* record 6891850019). The arm is per repository, so a sibling copy the
804+
* arm does not reach still owes the line;
796805
* - every other line — the enforcement chain's rows — names exactly that
797806
* same owner set, so an enforcer cannot be routed to a subset;
798807
* - no line routes a Tier S row's pattern: Tier S lands on a seat's review of
@@ -811,8 +820,11 @@ export function codeownersMirrorVerdict({ text, approvers = GOVERNED_APPROVERS,
811820
// The rows that govern THIS repository, read from the register (ruling B2: the question has a repository in it).
812821
// `register` is the register's own seam (`governedSurfacesFor`): the self-test hands in rows not on it yet.
813822
const governing = governedSurfacesFor(repo, register);
814-
const tierH = governing.filter((s) => s.tier === GOVERNED_TIER_H);
823+
const armedIn = (s) => Boolean(s.lowRisk) && Array.isArray(s.lowRisk.repos) && s.lowRisk.repos.includes(repo);
824+
const tierH = governing.filter((s) => s.tier === GOVERNED_TIER_H && !armedIn(s));
825+
const armed = governing.filter((s) => s.tier === GOVERNED_TIER_H && armedIn(s));
815826
const tierHPatterns = tierH.map(codeownersPatternFor);
827+
const armPatterns = armed.map(codeownersPatternFor);
816828
for (const surface of tierH) {
817829
const pattern = codeownersPatternFor(surface);
818830
const row = rows.find((r) => r.pattern === pattern);
@@ -824,12 +836,17 @@ export function codeownersMirrorVerdict({ text, approvers = GOVERNED_APPROVERS,
824836
}
825837
for (const row of rows) {
826838
if (tierHPatterns.includes(row.pattern)) continue;
839+
const arm = armed.find((s) => codeownersPatternFor(s) === row.pattern);
840+
if (arm) {
841+
problems.push(`CODEOWNERS line ${row.line} routes \`${row.pattern}\`, a Tier H row (\`${arm.id}\`) carrying the low-risk arm in this repository — the relay's per-pull plan decides who is asked there, and a static line summons both approvers on every pull, the low-risk ones too`);
842+
continue;
843+
}
827844
const tierS = governing.find((s) => s.tier === GOVERNED_TIER_S && codeownersPatternFor(s) === row.pattern);
828845
if (tierS) problems.push(`CODEOWNERS line ${row.line} routes \`${row.pattern}\`, a Tier S row (\`${tierS.id}\`) that lands on a seat's review of record — a code-owner request there asks the maintainer for a landing that is not his`);
829846
else if (!sameOwners(row.owners)) problems.push(`CODEOWNERS line ${row.line} \`${row.pattern}\` (an enforcement-chain row) names ${row.owners.join(' ') || 'nobody'}, not every GOVERNED_APPROVERS account (${wanted.join(' ')})`);
830847
}
831848
if (!/GOVERNED_APPROVERS/.test(String(text ?? ''))) problems.push('the file never names `GOVERNED_APPROVERS` — its header must say which constant the owner list mirrors');
832-
return { ok: problems.length === 0, problems, tierHPatterns, rows };
849+
return { ok: problems.length === 0, problems, tierHPatterns, armPatterns, rows };
833850
}
834851

835852
// ── the landing TIER: Tier S lands on a review of record, Tier H on an approval ─
@@ -5906,17 +5923,24 @@ export async function selfTest() {
59065923
const onDisk = readFileSync(join(repoRoot, '.github', 'CODEOWNERS'), 'utf8');
59075924
const live = codeownersMirrorVerdict({ text: onDisk });
59085925
assert('⭐ the-file-on-disk-mirrors-the-register-and-the-approver-list', live.ok, live.problems.join(' | '));
5909-
assert('every-Tier-H-row-that-governs-this-repository-is-a-pattern-the-file-carries', live.tierHPatterns.length === governedSurfacesFor(REPO).filter((s) => s.tier === GOVERNED_TIER_H).length && live.tierHPatterns.every((p) => live.rows.some((r) => r.pattern === p)), JSON.stringify(live.tierHPatterns));
5910-
assert('the-patterns-are-the-register-rows-root-anchored-prefix-or-exact', live.tierHPatterns.join() === '/docs/adr/,/skills/,/AGENTS.md,/CLAUDE.md,/docs/NORTH-STAR.md,/.github/workflows/,/ui/docs/adr/,/ui/.claude/,/ui/skills/,/ui/AGENTS.md,/ui/CLAUDE.md,/ui/.github/workflows/', live.tierHPatterns.join());
5926+
assert('every-Tier-H-row-that-governs-this-repository-is-a-pattern-the-file-carries-or-an-arm-row-it-leaves-out', live.tierHPatterns.length + live.armPatterns.length === governedSurfacesFor(REPO).filter((s) => s.tier === GOVERNED_TIER_H).length && live.tierHPatterns.every((p) => live.rows.some((r) => r.pattern === p)) && live.armPatterns.every((p) => !live.rows.some((r) => r.pattern === p)), JSON.stringify([live.tierHPatterns, live.armPatterns]));
5927+
assert('the-patterns-are-the-register-rows-root-anchored-prefix-or-exact', live.tierHPatterns.join() === '/docs/adr/,/AGENTS.md,/CLAUDE.md,/docs/NORTH-STAR.md,/.github/workflows/,/ui/docs/adr/,/ui/.claude/,/ui/AGENTS.md,/ui/CLAUDE.md,/ui/.github/workflows/', live.tierHPatterns.join());
5928+
// Ruling record 6891850019: the rows carrying the low-risk arm leave the file — read off the register's `lowRisk`, never a list here.
5929+
assert('⭐ the-arm-patterns-are-the-register-rows-carrying-the-low-risk-arm-here', live.armPatterns.join() === '/skills/,/ui/skills/' && live.armPatterns.join() === governedSurfacesFor(REPO).filter((s) => s.tier === GOVERNED_TIER_H && s.lowRisk?.repos?.includes(REPO)).map((s) => `/${s.prefix ?? s.exact}`).join(), live.armPatterns.join());
59115930
assert('every-line-on-disk-names-every-approver-spelled-as-a-login', live.rows.every((r) => GOVERNED_APPROVERS.every((a) => r.owners.includes(`@${a}`))) && live.rows.length >= live.tierHPatterns.length, JSON.stringify(live.rows));
59125931
assert('the-parser-strips-comments-and-blank-lines-and-splits-owners', JSON.stringify(codeownersRows('# c\n\n/docs/adr/ @a @b # trailing\n /x.md @c\n')) === JSON.stringify([{ pattern: '/docs/adr/', owners: ['@a', '@b'], line: 3 }, { pattern: '/x.md', owners: ['@c'], line: 4 }]));
59135932
const owners = GOVERNED_APPROVERS.map((a) => `@${a}`).join(' ');
59145933
const full = (extra = '') => `# mirrors GOVERNED_APPROVERS\n${live.tierHPatterns.map((p) => `${p} ${owners}`).join('\n')}\n${extra}`;
59155934
assert('a-fixture-carrying-exactly-the-Tier-H-rows-with-every-owner-passes', codeownersMirrorVerdict({ text: full() }).ok);
59165935
const one = codeownersMirrorVerdict({ text: full().replace(`/docs/adr/ ${owners}`, `/docs/adr/ @${GOVERNED_APPROVERS[1]}`) });
59175936
assert('⛔ one-approver-on-the-adr-row-is-a-problem-naming-the-row-and-the-missing-account', !one.ok && one.problems.length === 1 && one.problems[0].includes('`/docs/adr/`') && one.problems[0].includes(`@${GOVERNED_APPROVERS[0]}`), one.problems.join(' | '));
5918-
const missing = codeownersMirrorVerdict({ text: full().split('\n').filter((l) => !l.startsWith('/skills/')).join('\n') });
5919-
assert('⛔ a-Tier-H-row-with-no-line-is-a-problem-naming-the-row', !missing.ok && missing.problems.length === 1 && missing.problems[0].includes('`skills-catalog`'), missing.problems.join(' | '));
5937+
const missing = codeownersMirrorVerdict({ text: full().split('\n').filter((l) => !l.startsWith('/AGENTS.md')).join('\n') });
5938+
assert('⛔ a-Tier-H-row-with-no-arm-and-no-line-is-a-problem-naming-the-row', !missing.ok && missing.problems.length === 1 && missing.problems[0].includes('`agents-md`'), missing.problems.join(' | '));
5939+
assert('⭐ a-per-pull-arm-row-with-no-line-passes', !/^\/(ui\/)?skills\//m.test(full()) && codeownersMirrorVerdict({ text: full() }).ok);
5940+
const armLine = codeownersMirrorVerdict({ text: full(`/skills/ ${owners}\n`) });
5941+
assert('⛔ a-line-routing-an-arm-row-is-a-problem-naming-the-row-even-with-every-owner', !armLine.ok && armLine.problems.length === 1 && armLine.problems[0].includes('`skills-catalog`') && armLine.problems[0].includes('low-risk arm'), armLine.problems.join(' | '));
5942+
const sibling = codeownersMirrorVerdict({ text: full(), repo: 'objectui' });
5943+
assert('⛔ the-arm-is-per-repository-a-sibling-copy-it-does-not-reach-still-owes-the-skills-line', sibling.tierHPatterns.includes('/skills/') && sibling.armPatterns.length === 0 && !sibling.ok && sibling.problems.some((p) => p.includes('`skills-catalog`')), sibling.problems.join(' | '));
59205944
const tierS = codeownersMirrorVerdict({ text: full(`/.claude/ ${owners}\n`) });
59215945
assert('⛔ routing-the-Tier-S-row-is-a-problem-a-seat-record-landing-summons-nobody', !tierS.ok && tierS.problems.length === 1 && tierS.problems[0].includes('`claude-tree`'), tierS.problems.join(' | '));
59225946
const enforcer = codeownersMirrorVerdict({ text: full(`/.github/CODEOWNERS @${GOVERNED_APPROVERS[1]}\n`) });
@@ -5929,9 +5953,10 @@ export async function selfTest() {
59295953
// root-anchored `/ui/…` line on disk, and a file without those lines is short exactly one per row.
59305954
const uiRows = governedSurfacesFor(REPO).filter((s) => s.id.startsWith('ui-'));
59315955
const withoutUi = GOVERNED_SURFACES.filter((s) => !s.id.startsWith('ui-'));
5932-
assert('the-ui-patterns-are-root-anchored-under-ui-the-ui-claude-tree-included', uiRows.length === 6 && live.tierHPatterns.filter((p) => p.startsWith('/ui/')).join() === '/ui/docs/adr/,/ui/.claude/,/ui/skills/,/ui/AGENTS.md,/ui/CLAUDE.md,/ui/.github/workflows/', live.tierHPatterns.join());
5956+
const uiRouted = uiRows.filter((s) => !s.lowRisk?.repos?.includes(REPO));
5957+
assert('the-ui-patterns-are-root-anchored-under-ui-the-ui-claude-tree-included', uiRows.length === 6 && uiRouted.length === 5 && live.tierHPatterns.filter((p) => p.startsWith('/ui/')).join() === '/ui/docs/adr/,/ui/.claude/,/ui/AGENTS.md,/ui/CLAUDE.md,/ui/.github/workflows/', live.tierHPatterns.join());
59335958
const noUiLines = codeownersMirrorVerdict({ text: onDisk.split('\n').filter((l) => !l.startsWith('/ui/')).join('\n') });
5934-
assert('⛔ without-its-ui-lines-the-file-on-disk-is-short-one-line-per-ui-row', !noUiLines.ok && noUiLines.problems.length === uiRows.length && uiRows.every((r) => noUiLines.problems.some((p) => p.includes(`\`${r.id}\``) && p.includes(`\`/${r.prefix ?? r.exact}\``))), noUiLines.problems.join(' | '));
5959+
assert('⛔ without-its-ui-lines-the-file-on-disk-is-short-one-line-per-ui-row-without-an-arm', !noUiLines.ok && noUiLines.problems.length === uiRouted.length && uiRouted.every((r) => noUiLines.problems.some((p) => p.includes(`\`${r.id}\``) && p.includes(`\`/${r.prefix ?? r.exact}\``))) && !noUiLines.problems.some((p) => p.includes('`ui-skills-catalog`')), noUiLines.problems.join(' | '));
59355960
const priorRegister = codeownersMirrorVerdict({ text: onDisk.split('\n').filter((l) => !l.startsWith('/ui/')).join('\n'), register: withoutUi });
59365961
assert('the-register-seam-still-reads-a-register-handed-in-the-one-without-the-ui-rows-passes-the-file-without-their-lines', priorRegister.ok && priorRegister.tierHPatterns.every((p) => !p.startsWith('/ui/')), priorRegister.problems.join(' | '));
59375962
assert('the-ui-rows-govern-objectstack-alone-so-a-sibling-copy-needs-no-ui-line', codeownersMirrorVerdict({ text: full(), repo: 'objectui' }).tierHPatterns.every((p) => !p.startsWith('/ui/')));

0 commit comments

Comments
 (0)