Repository navigation
fix(spec): register document-print-and-mail in loadBuiltinCsds (board N64) - #435
Merged
Merged
Conversation
… N64)
The reference vertical's workflow CSD (print + hand-off + mail) was added on
8/27, after the builtin list was written, and never registered. So the
gateway's shared registry could not resolve its capability type:
csdForType("document-print-and-mail") was null in production, and R10
could not resolve the print leg. The real-state trace (#433) proved this.
Scope: one entry in the builtins array. The CSD stays status "draft",
kind "workflow", with no composition block.
- The D2 registry snapshot takes only active CSDs with a composition
block, so its digest is unchanged. A new test pins it byte-identical
with and without this CSD.
- findUrlByType matches exactly (URL slug, then an explicit type, then
the name). The CSD has no type field, so it cannot capture an existing
type such as 2d-print.
Tests:
- Count assertions move 8 -> 9 (spec csd and evidence-primitives,
contract-builder babel-pcc) and 9 -> 10 (gateway csd, which adds the
dashboard manifest).
- New tests pin the N64 resolution and the unchanged snapshot digest.
- Mutations: dropping the builtin fails 6 tests; disabling the slug pass
fails the N64 test.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… proof No builtin carries a composition block today, so both snapshots in the test hold no builtin contracts. The adapter filter itself is proven elsewhere (registry-contract-adapter.test.ts, the gateway draft/retired test). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
LamaSu
marked this pull request as ready for review
September 30, 2026 19:16
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Board row N64 (Gate E; blocks R46). Steward ruling #3523.
document-print-and-mail.csd.jsonis the reference vertical's workflow CSD (print, then hand-off, then mail). It was added on 8/27, after theloadBuiltinCsds()list was written, and was never registered. The gateway's shared registry (getCsdRegistry(),packages/gateway/src/routes/csd.ts) is built from that list, so:getCsdRegistry().findUrlByType("document-print-and-mail")returnsundefined;/api/agent-plans/validate, on the stack at feat(gateway): live provider re-read for externally authored plans (R10) #355, not yet on master) reads that same registry throughcsdForType. Once the stack lands, it would returnnullfor the print leg, and the reference vertical could not validate.The real-state trace (#433) proved the gap against real DB rows and the real registry. It then had to close the gap with a test-local
register()call.This PR adds one entry to the builtins array (
packages/spec/src/csd/registry.ts) and updates the tests that count builtins.What changes, and what does not
The CSD is unchanged:
status: "draft",kind: "workflow", nocompositionblock, notypefield./api/compose/registry-snapshot) is unchanged. The adapter projects onlyactiveCSDs that carry acompositionblock (registry-contract-adapter.ts:126-129), and this CSD fails both tests.activewith a composition block. It does not prove the filter.registry-contract-adapter.test.tsand by the gateway test "excludes draft and retired CSDs from the served snapshot".findUrlByTypetakes exact matches only: the URL slug first, then an explicittypefield, then the name. This CSD has notypefield, so2d-print,courier-routeand the other types resolve as before.GET /api/csd.routes/capabilities.ts(csdRegisteredTypes).pcc-suggest-templates(kind: workflow).document-print-and-mail.findUrlByType,list()andsuggest()do not filter onstatus, and neither does R10'scsdForTypeor the compile path. Only the D2 snapshot identity does (capability-contract-identity.ts:124). So with this PR, the type of a draft CSD resolves for R10. That is N64's intent, and it is the membership question below.loadBuiltinCsdsandgetCsdRegistryacross the repo:csd,capabilities,registry-snapshot,discoveranda2a-tasks;compileAll, which is used only in tests.Tests
Head
bef59df9:2d808180(the fix) plus a comment-only commit that states the tripwire.pnpm -C packages/spec exec vitest runbabel-pcc+liquid-handling-plrCount assertions:
csd.test.ts, specevidence-primitives.test.ts, contract-builderbabel-pcc.test.ts.csd.test.ts, whose count includes the compiled-in dashboard manifest.The "all built-in CSDs have kind = 'base'" test becomes "the 8 capability built-ins are base; the reference vertical is the one workflow".
New tests in spec
csd.test.ts:resolves the reference vertical's capability type (board N64);leaves the D2 registry snapshot digest unchanged (draft, no composition block).Mutation checks on
registry.ts, run against speccsd.test.ts(57 tests):Note: on master,
babel-pcc.test.tsfails at file level in a worktree without a built@pcc/specdist. That failure predates this PR and is unrelated to it. I ran it with a source alias. CI builds first.Follow-up (not in this PR)
#433 (the real-state trace, stacked on #415) asserts the gap before seeding:
external-plan-real-state-trace.test.ts:139,toBeUndefined(). Once this lands and the stack picks up master, that line flips. I will replace the prove-then-seed step with a resolve-via-builtin assertion then. #433 has no queued review pack.Review asks
draftworkflow CSD be a builtin, visible in/api/csdand in template suggestions, and resolvable by R10 (nothing on that path gates on status)?activefirst.compositionblock.🤖 Generated with Claude Code