Skip to content

Commit 5424a7c

Browse files
Merge pull request #67 from engineeredsoftware/v33/gate-2-interface-contract-catalog
V33 Gate 2: Interface Contract Catalog
2 parents d6ebf12 + 7e18fb4 commit 5424a7c

15 files changed

Lines changed: 1591 additions & 14 deletions
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
{
2+
"artifactId": "v33-interface-contract-catalog",
3+
"catalogRoot": "v33-interface-contract-catalog:7d2e48f799f989b43084ee81",
4+
"closureCommand": "pnpm run check:v33-gate2",
5+
"coverage": {
6+
"activeContractCount": 5,
7+
"credentialsSerialized": false,
8+
"deferredBlockedCount": 2,
9+
"deferredSurfacesHidden": false,
10+
"missingInterfaceIds": [],
11+
"observedInterfaceIds": [
12+
"terminal_handoff",
13+
"public_api",
14+
"mcp_api",
15+
"chatgpt_app",
16+
"package_consumer",
17+
"exchange_hook",
18+
"conversations_hook"
19+
],
20+
"protectedSourceVisible": false,
21+
"routeLocalReimplementation": false
22+
},
23+
"currentTarget": "V32",
24+
"deferredInterfaceIds": [
25+
"exchange_hook",
26+
"conversations_hook"
27+
],
28+
"generatedAt": "2026-05-22T00:00:00.000Z",
29+
"passed": true,
30+
"requiredInterfaceIds": [
31+
"terminal_handoff",
32+
"public_api",
33+
"mcp_api",
34+
"chatgpt_app",
35+
"package_consumer",
36+
"exchange_hook",
37+
"conversations_hook"
38+
],
39+
"requiredRowFields": [
40+
"ownerPackage",
41+
"actionId",
42+
"schemaId",
43+
"authPolicyId",
44+
"sourceSafetyClass",
45+
"exampleFixturePath",
46+
"validationCommand",
47+
"compatibilityStatus",
48+
"failureMode",
49+
"repairPosture",
50+
"telemetryProofHookId"
51+
],
52+
"rows": [
53+
{
54+
"actionId": "terminal.reading.handoff",
55+
"authPolicyId": "interface.authorization.reader-session",
56+
"bindingKind": "terminal_handoff",
57+
"compatibilityStatus": "compatible",
58+
"exampleFixturePath": "uapi/tests/terminalInterfaceIntegrationRegression.test.ts",
59+
"failureMode": "terminal-handoff-denies-protected-assetpack-source-before-settlement",
60+
"interfaceId": "terminal_handoff",
61+
"ownerPackage": "uapi/app/terminal",
62+
"repairPosture": "review-source-safe-preview-and-settle-before-full-delivery",
63+
"rowRoot": "v33-interface-contract-catalog-row:acde7c4f416938c39cf71669",
64+
"schemaId": "bitcode.interface.terminalReadingHandoff.v1",
65+
"sourceSafetyClass": "protected-source-locked",
66+
"status": "active_contract",
67+
"telemetryProofHookId": "interface.telemetry.terminal-reading-handoff",
68+
"validationCommand": "pnpm --dir uapi exec jest --runTestsByPath tests/terminalInterfaceIntegrationRegression.test.ts --runInBand"
69+
},
70+
{
71+
"actionId": "api.reading.interface",
72+
"authPolicyId": "interface.authorization.authenticated-route",
73+
"bindingKind": "api_route",
74+
"compatibilityStatus": "compatible",
75+
"exampleFixturePath": "packages/api/src/routes/__tests__/btd-crypto.test.ts",
76+
"failureMode": "public-api-denies-missing-auth-or-stale-read-license",
77+
"interfaceId": "public_api",
78+
"ownerPackage": "packages/api/src/routes",
79+
"repairPosture": "authenticate-refresh-license-or-request-source-safe-preview",
80+
"rowRoot": "v33-interface-contract-catalog-row:0f44cfae6fc12a5ce519fa20",
81+
"schemaId": "bitcode.interface.publicApiReading.v1",
82+
"sourceSafetyClass": "source-safe-internal",
83+
"status": "active_contract",
84+
"telemetryProofHookId": "interface.telemetry.public-api-reading",
85+
"validationCommand": "pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/btd-crypto.test.ts --runInBand"
86+
},
87+
{
88+
"actionId": "mcp.reading.pipeline",
89+
"authPolicyId": "interface.authorization.pipeline-permission",
90+
"bindingKind": "mcp_tool",
91+
"compatibilityStatus": "compatible",
92+
"exampleFixturePath": "packages/executions-mcp/src/mcp-server/src/__tests__/unit/pipeline-ingress-contract.test.ts",
93+
"failureMode": "mcp-tool-denies-missing-pipelines-create-permission",
94+
"interfaceId": "mcp_api",
95+
"ownerPackage": "packages/executions-mcp/src/mcp-server",
96+
"repairPosture": "grant-pipeline-permission-or-use-source-safe-readonly-tool",
97+
"rowRoot": "v33-interface-contract-catalog-row:d9c30910e339a7c701ee16d8",
98+
"schemaId": "bitcode.interface.mcpReadingTool.v1",
99+
"sourceSafetyClass": "source-safe-internal",
100+
"status": "active_contract",
101+
"telemetryProofHookId": "interface.telemetry.mcp-reading-tool",
102+
"validationCommand": "pnpm --dir packages/executions-mcp/src/mcp-server run test:mcp -- --runTestsByPath src/__tests__/unit/pipeline-ingress-contract.test.ts --runInBand"
103+
},
104+
{
105+
"actionId": "chatgpt.reading.action",
106+
"authPolicyId": "interface.authorization.confirmed-connected-write",
107+
"bindingKind": "chatgpt_action",
108+
"compatibilityStatus": "compatible",
109+
"exampleFixturePath": "packages/chatgptapp/src/__tests__/tools.test.ts",
110+
"failureMode": "chatgpt-action-denies-missing-confirmation-read-access-or-authority",
111+
"interfaceId": "chatgpt_app",
112+
"ownerPackage": "packages/chatgptapp",
113+
"repairPosture": "confirm-action-refresh-read-access-or-repair-organization-authority",
114+
"rowRoot": "v33-interface-contract-catalog-row:1a33b4a6b38368cdfa1417be",
115+
"schemaId": "bitcode.interface.chatGptReadingAction.v1",
116+
"sourceSafetyClass": "source-safe-internal",
117+
"status": "active_contract",
118+
"telemetryProofHookId": "interface.telemetry.chatgpt-reading-action",
119+
"validationCommand": "pnpm --dir packages/chatgptapp exec jest --runTestsByPath src/__tests__/tools.test.ts --runInBand"
120+
},
121+
{
122+
"actionId": "package.interface.contract-catalog",
123+
"authPolicyId": "interface.authorization.package-consumer-source-safe",
124+
"bindingKind": "package_export",
125+
"compatibilityStatus": "compatible",
126+
"exampleFixturePath": "packages/btd/__tests__/interface-contract-catalog.test.ts",
127+
"failureMode": "package-consumer-denies-route-local-contract-reimplementation",
128+
"interfaceId": "package_consumer",
129+
"ownerPackage": "packages/btd",
130+
"repairPosture": "consume-package-export-and-regenerate-contract-artifact",
131+
"rowRoot": "v33-interface-contract-catalog-row:53c71c3b4eea4e590a65285e",
132+
"schemaId": "bitcode.interface.packageConsumerCatalog.v1",
133+
"sourceSafetyClass": "source-safe-public",
134+
"status": "active_contract",
135+
"telemetryProofHookId": "interface.telemetry.package-contract-catalog",
136+
"validationCommand": "pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-contract-catalog.test.ts"
137+
},
138+
{
139+
"actionId": "exchange.reading.hook",
140+
"authPolicyId": "interface.authorization.deferred-not-admitted",
141+
"bindingKind": "deferred_hook",
142+
"compatibilityStatus": "deferred_not_admitted",
143+
"deferredReason": "Exchange product depth is deferred beyond V33 interface cataloging.",
144+
"exampleFixturePath": "uapi/tests/terminalInterfaceIntegrationRegression.test.ts",
145+
"failureMode": "exchange-hook-remains-blocked-until-exchange-product-depth-gate",
146+
"interfaceId": "exchange_hook",
147+
"ownerPackage": "uapi/app/exchange",
148+
"repairPosture": "wait-for-exchange-depth-gate-before-interface-admission",
149+
"rowRoot": "v33-interface-contract-catalog-row:48e0e1303fcd41f9869cc8c0",
150+
"schemaId": "bitcode.interface.exchangeHook.v1",
151+
"sourceSafetyClass": "deferred-blocker",
152+
"status": "deferred_blocked",
153+
"telemetryProofHookId": "interface.telemetry.exchange-hook-blocker",
154+
"validationCommand": "pnpm --dir uapi exec jest --runTestsByPath tests/terminalInterfaceIntegrationRegression.test.ts --runInBand"
155+
},
156+
{
157+
"actionId": "conversations.reading.hook",
158+
"authPolicyId": "interface.authorization.deferred-not-admitted",
159+
"bindingKind": "deferred_hook",
160+
"compatibilityStatus": "deferred_not_admitted",
161+
"deferredReason": "Website Conversations product depth is deferred beyond V33 interface cataloging.",
162+
"exampleFixturePath": "uapi/tests/api/conversationsRouteRead.test.ts",
163+
"failureMode": "conversations-hook-remains-blocked-until-conversations-product-depth-gate",
164+
"interfaceId": "conversations_hook",
165+
"ownerPackage": "uapi/app/conversations",
166+
"repairPosture": "wait-for-conversations-depth-gate-before-interface-admission",
167+
"rowRoot": "v33-interface-contract-catalog-row:bca048866c37837b5a5d7200",
168+
"schemaId": "bitcode.interface.conversationsHook.v1",
169+
"sourceSafetyClass": "deferred-blocker",
170+
"status": "deferred_blocked",
171+
"telemetryProofHookId": "interface.telemetry.conversations-hook-blocker",
172+
"validationCommand": "pnpm --dir uapi exec jest --runTestsByPath tests/api/conversationsRouteRead.test.ts --runInBand"
173+
}
174+
],
175+
"schemaId": "bitcode.v33.interfaceContractCatalog.v1",
176+
"sharedFixtureFiles": [
177+
"packages/btd/src/interface-contract-catalog.ts",
178+
"packages/btd/src/index.ts",
179+
"BITCODE_SPEC_V33.md",
180+
"BITCODE_SPEC_V33_DELTA.md",
181+
"BITCODE_SPEC_V33_PARITY_MATRIX.md",
182+
"packages/btd/__tests__/interface-contract-catalog.test.ts",
183+
"scripts/check-v33-gate2-interface-contract-catalog.mjs"
184+
],
185+
"sourceEvidence": [
186+
{
187+
"digest": "sha256:36110f21b7743a3642d6ea38760b56cf2141fdad1007d8379e46ddd73d43bd0e",
188+
"relativePath": "packages/btd/src/interface-contract-catalog.ts",
189+
"requiredTokens": [
190+
{
191+
"present": true,
192+
"token": "buildBtdInterfaceContractCatalog"
193+
},
194+
{
195+
"present": true,
196+
"token": "terminal_handoff"
197+
},
198+
{
199+
"present": true,
200+
"token": "public_api"
201+
},
202+
{
203+
"present": true,
204+
"token": "mcp_api"
205+
},
206+
{
207+
"present": true,
208+
"token": "chatgpt_app"
209+
},
210+
{
211+
"present": true,
212+
"token": "package_consumer"
213+
},
214+
{
215+
"present": true,
216+
"token": "conversations_hook"
217+
},
218+
{
219+
"present": true,
220+
"token": "deferred_not_admitted"
221+
}
222+
]
223+
},
224+
{
225+
"digest": "sha256:c8df35e424491484dcd72b26044ed53cef54c30d35d40dd089ea4e25bd6e4bda",
226+
"relativePath": "packages/btd/src/index.ts",
227+
"requiredTokens": [
228+
{
229+
"present": true,
230+
"token": "interface-contract-catalog"
231+
}
232+
]
233+
},
234+
{
235+
"digest": "sha256:ba4069d85192fa7b62a3c393baf5a2ebd38f9a661b19f81a01793cd09414852c",
236+
"relativePath": "BITCODE_SPEC_V33.md",
237+
"requiredTokens": [
238+
{
239+
"present": true,
240+
"token": "InterfaceContractCatalog"
241+
},
242+
{
243+
"present": true,
244+
"token": ".bitcode/v33-interface-contract-catalog.json"
245+
}
246+
]
247+
}
248+
],
249+
"sourceSafetyVerdict": "source-safe-interface-contract-catalog-metadata",
250+
"testEvidence": [
251+
{
252+
"digest": "sha256:fc7643fec28d633c907038164c3ad2eb49418a03d5217d989f3e8475f8130010",
253+
"relativePath": "packages/btd/__tests__/interface-contract-catalog.test.ts",
254+
"requiredTokens": [
255+
{
256+
"present": true,
257+
"token": "catalogs Terminal handoff, public API, MCP API, ChatGPT App, package consumers, and deferred hooks"
258+
},
259+
{
260+
"present": true,
261+
"token": "fails closed when a required interface catalog row is missing"
262+
},
263+
{
264+
"present": true,
265+
"token": "fails closed when deferred hooks are accidentally admitted as compatible active contracts"
266+
},
267+
{
268+
"present": true,
269+
"token": "fails closed on secret-shaped or protected-source catalog text"
270+
}
271+
]
272+
},
273+
{
274+
"digest": "sha256:dfa6c8231a615b5f078f2f4e85ff1a7003946ef80284d84c05b29291eb29f5ae",
275+
"relativePath": "scripts/check-v33-gate2-interface-contract-catalog.mjs",
276+
"requiredTokens": [
277+
{
278+
"present": true,
279+
"token": "check:v33-interface-contract-catalog"
280+
},
281+
{
282+
"present": true,
283+
"token": "interface-contract-catalog.test.ts"
284+
},
285+
{
286+
"present": true,
287+
"token": "Gate 2 interface contract catalog"
288+
}
289+
]
290+
}
291+
],
292+
"version": "V33"
293+
}

.github/workflows/bitcode-gate-quality.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
fi
131131
node scripts/check-v32-gate10-promotion-readiness.mjs --promotion-mode --skip-branch-check
132132
node scripts/check-v33-gate1-interface-roadmap-opening.mjs --skip-branch-check
133+
node scripts/check-v33-gate2-interface-contract-catalog.mjs --skip-branch-check
133134
else
134135
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
135136
exit 1
@@ -157,6 +158,7 @@ jobs:
157158
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/btd.test.ts
158159
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-ledger-btd-settlement-failure-states.test.ts
159160
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-interface-contract-regression.test.ts
161+
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-contract-catalog.test.ts
160162
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-testnet-mainnet-readiness-rehearsal.test.ts
161163
pnpm --dir packages/protocol exec node --test --test-force-exit test/v32-promotion-proof-generation.test.js
162164
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/btd-crypto.test.ts --runInBand

BITCODE_SPEC_V33.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
- Current canonical/latest target: `V32`
88
- Prior canonical anchor: `BITCODE_SPEC_V32.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V32_PROVEN.md`
10-
- Generated structured artifact inventory: draft V33 specifying artifacts `.bitcode/v33-spec-family-report.json` and `.bitcode/v33-canonical-input-report.json`; later V33 gates may add source-safe interface proof artifacts
11-
- Source parity state: Gate 1 opens source parity tracking for interface-depth work; implementation begins only through scoped V33 gates
10+
- Generated structured artifact inventory: draft V33 specifying artifacts `.bitcode/v33-spec-family-report.json`, `.bitcode/v33-canonical-input-report.json`, and Gate 2 `.bitcode/v33-interface-contract-catalog.json`; later V33 gates may add additional source-safe interface proof artifacts
11+
- Source parity state: Gate 2 adds package-owned `InterfaceContractCatalog` source and generated proof coverage for active and deferred interface surfaces
1212
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V32`
1313
- Notes companion: `BITCODE_SPEC_V33_NOTES.md`
1414
- Delta companion: `BITCODE_SPEC_V33_DELTA.md`
@@ -224,7 +224,7 @@ The V33 operator chain keeps V32 behavior and adds interface consistency:
224224
- Current invariants and fail-closed conditions: invalid deposit, missing source proof, unsupported provider, policy denial, or protected-source leakage blocks interface projection.
225225
- Current proof obligations: deposit measurement proof, source-safety class, and interface projection test.
226226
- Current source-bearing implementation basis: commercial package and `uapi` routes, not `protocol-demonstration`.
227-
- Current validating commands and parity basis: V32 canonical proofs plus V33 Gate 2 interface catalog checks.
227+
- Current validating commands and parity basis: V32 canonical proofs plus V33 Gate 2 interface catalog checks, including `.bitcode/v33-interface-contract-catalog.json`.
228228
- Current accepted boundaries: V33 does not change deposit ownership law.
229229

230230
### Reading and prompt/inference ownership
@@ -487,6 +487,11 @@ V33 is complete when all ten gates are closed, source-safe interface contracts a
487487
Primary V33 types: `InterfaceContractCatalog`, `InterfaceAuthorizationPolicy`, `McpToolContract`, `ChatGptAppActionContract`, `PublicApiRouteContract`, `ReadLicenseInterfaceContract`, `AssetPackRightsInterfaceContract`, `APISchemaCompatibilityMatrix`, and `InterfaceTelemetryProofHook`.
488488
Primary surfaces: MCP API, ChatGPT App, public API, Terminal handoff, package consumers, ledger projection, database projection, object-storage projection, and proof replay.
489489

490+
Gate 2 `InterfaceContractCatalog` rows are package-owned source-safe metadata.
491+
The required row ids are `terminal_handoff`, `public_api`, `mcp_api`, `chatgpt_app`, `package_consumer`, `exchange_hook`, and `conversations_hook`.
492+
Each row names an owner package, action/tool/route id, schema id, auth policy id, source-safety class, example fixture path, validation command, compatibility status, failure mode, repair posture, telemetry proof hook id, and deterministic proof root.
493+
The `exchange_hook` and `conversations_hook` rows are visible as `deferred_not_admitted` rather than hidden.
494+
490495
## Appendix B. Proof family closure catalog
491496

492497
The V33 proof-family catalog is the nine-family catalog in `V33 proof-family canon`.
@@ -521,11 +526,13 @@ V33 inherits the V20 operator-quality expectation that interface-facing proof is
521526
| --- | --- | --- | --- | --- |
522527
| `.bitcode/v33-spec-family-report.json` | spec-family report builder | `check-bitcode-spec-family` | source-safe-generated-proof | draft-required |
523528
| `.bitcode/v33-canonical-input-report.json` | canonical-input report builder | `check-bitcode-canonical-inputs` | source-safe-generated-proof | draft-required |
529+
| `.bitcode/v33-interface-contract-catalog.json` | `scripts/generate-v33-interface-contract-catalog.mjs` | `check:v33-interface-contract-catalog` and `check:v33-gate2` | source-safe-interface-contract-catalog-metadata | Gate 2 required |
524530

525531
### V33 specifying generated artifacts
526532

527533
V33 starts with `.bitcode/v33-spec-family-report.json` and `.bitcode/v33-canonical-input-report.json`.
528-
Later gates may add interface catalog, authorization policy, schema compatibility, telemetry replay, and promotion readiness artifacts.
534+
Gate 2 adds `.bitcode/v33-interface-contract-catalog.json`, which serializes source-safe `InterfaceContractCatalog` metadata for `terminal_handoff`, `public_api`, `mcp_api`, `chatgpt_app`, `package_consumer`, `exchange_hook`, and `conversations_hook` with deferred hooks marked `deferred_not_admitted`.
535+
Later gates may add authorization policy, schema compatibility, telemetry replay, and promotion readiness artifacts.
529536

530537
### Shared generated-artifact fields
531538

0 commit comments

Comments
 (0)