PR: #420: feat(agentic): check:catalog + check:terms CI gates [Story-1714] by @ankitmaheshwari-com
View PR →
Story-1714 · app lane · agentic substrate · EPIC-1646

check:catalog + check:terms CI gates

Two CI gates that keep the Atlas Surface Operator substrate honest as it grows. check:catalog enforces RFD-AGT-002 D-2/D-3: every L1 surface declares a Page Card or an explicit unsupported entry, and no card may claim a permission outside the real backend namespace. check:terms enforces D-6: the retired agent aliases stay dead in code.

Why these gates exist

RFD-AGT-002 D-2 forbids shipping a surface with neither a Page Card nor an explicit unsupported declaration — silence makes the model guess what a page can do. D-3 locks the backend permission namespace to three write strings plus their reads; a card claiming a fiction like firm:manage must be rejected. D-6 locks the agent's name layers and bans zombie aliases (assistant · bot · Orient · Atlas Presence Bar · app CCB) in code, not just docs. These gates make all three checkable in CI.

What changed

The three acceptance criteria, proven

Acceptance criterionHow it is enforced
CI fails on a surface with neither a Page Card nor unsupported. findCatalogViolations diffs the L1 surface keys against the catalog; a missing key is a violation. Test: "fails when an L1 surface is missing from the catalog".
CI fails on a card claiming a non-existent permission (e.g. firm:manage). Every card permission is checked against BACKEND_PERMISSIONS. Test: "fails on a card claiming a non-existent permission (firm:manage)".
CI fails on a banned alias in code. scanForBannedAliases flags each banned alias on a whole-word/phrase match. Tests cover every alias + the no-false-positive case.

Verification

Both gates pass on the current tree, and the full pipeline is green:

$ pnpm check:catalog
check:catalog OK — 22 L1 surfaces, all carded or explicitly unsupported.

$ pnpm check:terms
check:terms OK — no banned agent aliases in code.

$ pnpm lint        # 0 errors (1 pre-existing unrelated img warning)
$ pnpm typecheck   # clean
$ pnpm test        # 121 files, 782 tests passed
$ pnpm build       # success

Scope notes

Files changed

11 file(s), +614 / -1 lines

Path Role + -
.github/workflows/ci.ymlWorkflow+11-0
package.jsonConfig+2-0
scripts/page-card/check-catalog.tsScript+54-0
scripts/page-card/check-terms.tsScript+84-0
src/components/settings/audit-log/actor-badge.tsxComponent+2-1
src/lib/clerk-error-messages.tsLibrary+1-0
src/lib/surface-registry/page-card/banned-terms.test.tsLibrary+38-0
src/lib/surface-registry/page-card/banned-terms.tsLibrary+94-0
src/lib/surface-registry/page-card/catalog.test.tsLibrary+76-0
src/lib/surface-registry/page-card/catalog.tsLibrary+214-0
src/lib/surface-registry/page-card/permissions.tsLibrary+38-0