Skip to content

Commit fd16849

Browse files
V38 Gate 6: Harden ReadNeedComprehensionSynthesis inference
Attach source-safe inference receipts to synthesized and accepted Read Needs, including phase, agent, PTRR step, Failsafe, ThricifiedGeneration, prompt-template, schema, telemetry, and disclosure-boundary roots. Add the deterministic Gate 6 hardening artifact, protocol exports, checker/generator scripts, workflow enforcement, and V38 specification/documentation updates. Validation: pnpm run check:v38-gate1 through check:v38-gate6; pnpm --filter @bitcode/pipeline-asset-pack typecheck; pnpm --filter @bitcode/protocol typecheck; pnpm --filter @bitcode/protocol test; node scripts/run-bitcode-spec-quality.mjs --mode strict-version --version V38; git diff --check.
1 parent 1178a2b commit fd16849

22 files changed

Lines changed: 1507 additions & 11 deletions

.bitcode/v38-prompt-benchmark-report.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@
16541654
"extendsDocCodeToolPromptCount": 0,
16551655
"docCodeToolPromptCount": 0,
16561656
"formatUsableToolsCount": 0,
1657-
"readNeedComprehensionNamesCount": 7,
1657+
"readNeedComprehensionNamesCount": 15,
16581658
"readFitsFindingNamesCount": 1,
16591659
"depositorySearchToolNamesCount": 0,
16601660
"promptTemplateIdCount": 1,
Lines changed: 383 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,383 @@
1+
{
2+
"artifactId": "v38-read-need-comprehension-inference-hardening",
3+
"schemaId": "bitcode.v38.readNeedComprehensionInferenceHardening.v1",
4+
"version": "V38",
5+
"currentTarget": "V37",
6+
"sourceSafetyVerdict": "source-safe-read-need-comprehension-inference-hardening-metadata",
7+
"generatedAt": "deterministic",
8+
"artifactRoot": "v38-read-need-comprehension-hardening:113d48d4b8be28d0cfd9b9e2",
9+
"passed": true,
10+
"rows": [
11+
{
12+
"rowId": "phase:request-normalize",
13+
"phaseId": "ReadNeedComprehensionSynthesis.request",
14+
"agentId": "ReadNeedComprehensionSynthesis.request.normalize",
15+
"purpose": "Normalize the enterprise Read Request and source revision without searching deposits.",
16+
"returnTypes": [
17+
"ReadNeedSourceInput"
18+
],
19+
"receiptFields": [
20+
"phaseIds",
21+
"agentIds",
22+
"ptrrStepIds",
23+
"roots"
24+
],
25+
"telemetryIds": [
26+
"ReadNeedComprehensionSynthesis.telemetry.prompt-input",
27+
"ReadNeedComprehensionSynthesis.telemetry.source-revision",
28+
"ReadNeedComprehensionSynthesis.telemetry.target-artifact-kinds"
29+
],
30+
"rowRoot": "v38-read-need-hardening-row:4f1c2193e64a161519cf5aec",
31+
"sourceSafetyClass": "source_safe_read_need_comprehension_inference_metadata",
32+
"protectedSourceVisible": false,
33+
"rawProviderResponseVisible": false,
34+
"unpaidAssetPackSourceVisible": false,
35+
"credentialsSerialized": false,
36+
"forbiddenPayloadClasses": [
37+
"secret_values",
38+
"provider_tokens",
39+
"wallet_private_material",
40+
"protected_source_payloads",
41+
"raw_protected_prompts",
42+
"raw_model_responses_with_protected_source",
43+
"unpaid_assetpack_source",
44+
"settlement_private_payloads",
45+
"global_ledger_authority_claim"
46+
]
47+
},
48+
{
49+
"rowId": "phase:comprehend-need",
50+
"phaseId": "ReadNeedComprehensionSynthesis.comprehend",
51+
"agentId": "ReadNeedComprehensionSynthesis.comprehend.need-synthesizer",
52+
"purpose": "Run the Need synthesizer through PTRR/Failsafe/Thricified inference and return only reviewable Need fields.",
53+
"returnTypes": [
54+
"ReadNeed"
55+
],
56+
"receiptFields": [
57+
"promptTemplateIds",
58+
"interpolationContextKeys",
59+
"outputSchemaIds",
60+
"telemetryEventIds",
61+
"roots"
62+
],
63+
"telemetryIds": [
64+
"ReadNeedComprehensionSynthesis.telemetry.prompt-template",
65+
"ReadNeedComprehensionSynthesis.telemetry.interpolated-prompt",
66+
"ReadNeedComprehensionSynthesis.telemetry.raw-model-response",
67+
"ReadNeedComprehensionSynthesis.telemetry.parsed-typed-output",
68+
"ReadNeedComprehensionSynthesis.telemetry.schema-name"
69+
],
70+
"rowRoot": "v38-read-need-hardening-row:f4ad988b8f3f2ae9a68c5c2f",
71+
"sourceSafetyClass": "source_safe_read_need_comprehension_inference_metadata",
72+
"protectedSourceVisible": false,
73+
"rawProviderResponseVisible": false,
74+
"unpaidAssetPackSourceVisible": false,
75+
"credentialsSerialized": false,
76+
"forbiddenPayloadClasses": [
77+
"secret_values",
78+
"provider_tokens",
79+
"wallet_private_material",
80+
"protected_source_payloads",
81+
"raw_protected_prompts",
82+
"raw_model_responses_with_protected_source",
83+
"unpaid_assetpack_source",
84+
"settlement_private_payloads",
85+
"global_ledger_authority_claim"
86+
]
87+
},
88+
{
89+
"rowId": "phase:measure-need",
90+
"phaseId": "ReadNeedComprehensionSynthesis.measure",
91+
"agentId": "ReadNeedComprehensionSynthesis.measure.need-measurement",
92+
"purpose": "Derive deterministic Need measurement vector and Share-to-Fee input values.",
93+
"returnTypes": [
94+
"ReadNeedPricingMeasurementInputs"
95+
],
96+
"receiptFields": [
97+
"outputSchemaIds",
98+
"roots"
99+
],
100+
"telemetryIds": [
101+
"ReadNeedComprehensionSynthesis.telemetry.measurement-vector",
102+
"ReadNeedComprehensionSynthesis.telemetry.weighted-requested-volume",
103+
"ReadNeedComprehensionSynthesis.telemetry.measurement-root"
104+
],
105+
"rowRoot": "v38-read-need-hardening-row:455fb53152725a2073ed91d4",
106+
"sourceSafetyClass": "source_safe_read_need_comprehension_inference_metadata",
107+
"protectedSourceVisible": false,
108+
"rawProviderResponseVisible": false,
109+
"unpaidAssetPackSourceVisible": false,
110+
"credentialsSerialized": false,
111+
"forbiddenPayloadClasses": [
112+
"secret_values",
113+
"provider_tokens",
114+
"wallet_private_material",
115+
"protected_source_payloads",
116+
"raw_protected_prompts",
117+
"raw_model_responses_with_protected_source",
118+
"unpaid_assetpack_source",
119+
"settlement_private_payloads",
120+
"global_ledger_authority_claim"
121+
]
122+
},
123+
{
124+
"rowId": "phase:review-need",
125+
"phaseId": "ReadNeedComprehensionSynthesis.review",
126+
"agentId": "ReadNeedComprehensionSynthesis.review.operator-review",
127+
"purpose": "Record acceptance or resynthesis feedback before ReadFitsFindingSynthesis is admitted.",
128+
"returnTypes": [
129+
"AcceptedReadNeed",
130+
"ResynthesisRequestedReadNeed"
131+
],
132+
"receiptFields": [
133+
"reviewBoundary",
134+
"roots"
135+
],
136+
"telemetryIds": [
137+
"ReadNeedComprehensionSynthesis.telemetry.review-state",
138+
"ReadNeedComprehensionSynthesis.telemetry.accepted-at",
139+
"ReadNeedComprehensionSynthesis.telemetry.acceptance-root",
140+
"ReadNeedComprehensionSynthesis.telemetry.feedback-history"
141+
],
142+
"rowRoot": "v38-read-need-hardening-row:3470ef235d23236a7dba07a5",
143+
"sourceSafetyClass": "source_safe_read_need_comprehension_inference_metadata",
144+
"protectedSourceVisible": false,
145+
"rawProviderResponseVisible": false,
146+
"unpaidAssetPackSourceVisible": false,
147+
"credentialsSerialized": false,
148+
"forbiddenPayloadClasses": [
149+
"secret_values",
150+
"provider_tokens",
151+
"wallet_private_material",
152+
"protected_source_payloads",
153+
"raw_protected_prompts",
154+
"raw_model_responses_with_protected_source",
155+
"unpaid_assetpack_source",
156+
"settlement_private_payloads",
157+
"global_ledger_authority_claim"
158+
]
159+
},
160+
{
161+
"rowId": "receipt:source-safe-inference-receipt",
162+
"phaseId": "ReadNeedComprehensionSynthesis.receipt",
163+
"agentId": "ReadNeedComprehensionSynthesis.receipt.source-safe",
164+
"purpose": "Bind the produced Need to 4 phases, 4 PTRR agents, 16 PTRR steps, 48 Failsafe sequences, and 48 ThricifiedGeneration chains without exposing private payloads.",
165+
"returnTypes": [
166+
"ReadNeedComprehensionSynthesisInferenceReceipt"
167+
],
168+
"receiptFields": [
169+
"phaseIds",
170+
"agentIds",
171+
"ptrrStepIds",
172+
"failsafeSequenceIds",
173+
"thricifiedGenerationIds",
174+
"promptTemplateIds",
175+
"interpolationContextKeys",
176+
"outputSchemaIds",
177+
"telemetryEventIds",
178+
"sourceSafety",
179+
"reviewBoundary",
180+
"roots"
181+
],
182+
"telemetryIds": [
183+
"read-need-comprehension.inferenceReceipt",
184+
"read-need-comprehension.receiptRoot"
185+
],
186+
"rowRoot": "v38-read-need-hardening-row:102e145dbf4dbc50a01ab554",
187+
"sourceSafetyClass": "source_safe_read_need_comprehension_inference_metadata",
188+
"protectedSourceVisible": false,
189+
"rawProviderResponseVisible": false,
190+
"unpaidAssetPackSourceVisible": false,
191+
"credentialsSerialized": false,
192+
"forbiddenPayloadClasses": [
193+
"secret_values",
194+
"provider_tokens",
195+
"wallet_private_material",
196+
"protected_source_payloads",
197+
"raw_protected_prompts",
198+
"raw_model_responses_with_protected_source",
199+
"unpaid_assetpack_source",
200+
"settlement_private_payloads",
201+
"global_ledger_authority_claim"
202+
]
203+
}
204+
],
205+
"requiredPhaseIds": [
206+
"ReadNeedComprehensionSynthesis.request",
207+
"ReadNeedComprehensionSynthesis.comprehend",
208+
"ReadNeedComprehensionSynthesis.measure",
209+
"ReadNeedComprehensionSynthesis.review"
210+
],
211+
"requiredReturnTypes": [
212+
"ReadNeedSourceInput",
213+
"ReadNeed",
214+
"ReadNeedPricingMeasurementInputs",
215+
"AcceptedReadNeed",
216+
"ResynthesisRequestedReadNeed"
217+
],
218+
"requiredReceiptFields": [
219+
"phaseIds",
220+
"agentIds",
221+
"ptrrStepIds",
222+
"failsafeSequenceIds",
223+
"thricifiedGenerationIds",
224+
"promptTemplateIds",
225+
"interpolationContextKeys",
226+
"outputSchemaIds",
227+
"telemetryEventIds",
228+
"sourceSafety",
229+
"reviewBoundary",
230+
"roots"
231+
],
232+
"predicateResults": [
233+
{
234+
"id": "contract.names-read-need-pipeline",
235+
"sourcePath": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
236+
"passed": true
237+
},
238+
{
239+
"id": "contract.has-four-phases",
240+
"sourcePath": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
241+
"passed": true
242+
},
243+
{
244+
"id": "contract.has-four-ptrr-steps",
245+
"sourcePath": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
246+
"passed": true
247+
},
248+
{
249+
"id": "contract.has-three-failsafe-stages",
250+
"sourcePath": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
251+
"passed": true
252+
},
253+
{
254+
"id": "contract.has-thricified-generation-contract",
255+
"sourcePath": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
256+
"passed": true
257+
},
258+
{
259+
"id": "read-need.imports-contract-trace",
260+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
261+
"passed": true
262+
},
263+
{
264+
"id": "read-need.defines-receipt-type",
265+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
266+
"passed": true
267+
},
268+
{
269+
"id": "read-need.builds-receipt",
270+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
271+
"passed": true
272+
},
273+
{
274+
"id": "read-need.attaches-receipt-to-output",
275+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
276+
"passed": true
277+
},
278+
{
279+
"id": "read-need.stores-receipt-in-execution",
280+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
281+
"passed": true
282+
},
283+
{
284+
"id": "read-need.requires-accepted-need-for-fits",
285+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
286+
"passed": true
287+
},
288+
{
289+
"id": "read-need.supports-resynthesis-feedback",
290+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
291+
"passed": true
292+
},
293+
{
294+
"id": "read-need.blocks-source-disclosure",
295+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
296+
"passed": true
297+
},
298+
{
299+
"id": "read-need.blocks-credentials",
300+
"sourcePath": "packages/pipelines/asset-pack/src/read-need.ts",
301+
"passed": true
302+
},
303+
{
304+
"id": "bounded-inference-records-failsafe-stack",
305+
"sourcePath": "packages/pipelines/asset-pack/src/bounded-structured-inference.ts",
306+
"passed": true
307+
},
308+
{
309+
"id": "bounded-inference-records-thricified-stages",
310+
"sourcePath": "packages/pipelines/asset-pack/src/bounded-structured-inference.ts",
311+
"passed": true
312+
},
313+
{
314+
"id": "bounded-inference-records-prompt-output",
315+
"sourcePath": "packages/pipelines/asset-pack/src/bounded-structured-inference.ts",
316+
"passed": true
317+
},
318+
{
319+
"id": "route-uses-inference-synthesis",
320+
"sourcePath": "uapi/app/api/read-review/route.ts",
321+
"passed": true
322+
},
323+
{
324+
"id": "terminal-supports-resynthesis-feedback",
325+
"sourcePath": "uapi/app/terminal/TerminalDepositReadWorkbench.tsx",
326+
"passed": true
327+
},
328+
{
329+
"id": "tests-cover-receipt-counts",
330+
"sourcePath": "packages/pipelines/asset-pack/src/__tests__/read-need.test.ts",
331+
"passed": true
332+
},
333+
{
334+
"id": "tests-cover-real-inference-receipt",
335+
"sourcePath": "packages/pipelines/asset-pack/src/__tests__/read-need.test.ts",
336+
"passed": true
337+
},
338+
{
339+
"id": "contract-tests-cover-read-need-counts",
340+
"sourcePath": "packages/pipelines/asset-pack/src/__tests__/reading-pipeline-contract.test.ts",
341+
"passed": true
342+
}
343+
],
344+
"coverage": {
345+
"phaseCount": 4,
346+
"ptrrAgentCount": 4,
347+
"ptrrStepCount": 16,
348+
"failsafeSequenceCount": 48,
349+
"thricifiedGenerationCount": 48,
350+
"providerCallSlotCount": 144,
351+
"rowCount": 5,
352+
"requiredPredicateCount": 22,
353+
"passedPredicateCount": 22,
354+
"failedPredicateIds": [],
355+
"gate2InventoryRoot": "v38-inference-surface-inventory:3f50930549dee560db576a9a",
356+
"gate3StackRoot": "v38-ptrr-failsafe-thricified-stack:af3a75b196d4b52e921c0130",
357+
"gate4PromptBenchmarkRoot": "v38-prompt-benchmark-report:7c34a5c11c25c490aedf413d",
358+
"gate5DisclosureRoot": "v38-inference-telemetry-disclosure-report:b55a6ec83a421313cde9483c",
359+
"sourceSafeMetadataOnly": true,
360+
"protectedSourceVisible": false,
361+
"rawProviderResponseVisible": false,
362+
"unpaidAssetPackSourceVisible": false,
363+
"credentialsSerialized": false,
364+
"acceptedNeedRequiredForFindingFits": true,
365+
"resynthesisWithFeedbackCovered": true,
366+
"routeUsesInferenceSynthesis": true,
367+
"terminalSupportsResynthesis": true,
368+
"legacySourceRoots": false
369+
},
370+
"sourceRoots": {
371+
"readingContract": "packages/pipelines/asset-pack/src/reading-pipeline-contract.ts",
372+
"readNeed": "packages/pipelines/asset-pack/src/read-need.ts",
373+
"boundedStructuredInference": "packages/pipelines/asset-pack/src/bounded-structured-inference.ts",
374+
"readNeedTests": "packages/pipelines/asset-pack/src/__tests__/read-need.test.ts",
375+
"readingContractTests": "packages/pipelines/asset-pack/src/__tests__/reading-pipeline-contract.test.ts",
376+
"readReviewRoute": "uapi/app/api/read-review/route.ts",
377+
"terminalWorkbench": "uapi/app/terminal/TerminalDepositReadWorkbench.tsx",
378+
"gate2Inventory": "packages/protocol/src/canonical/inference-surface-inventory.js",
379+
"gate3Stack": "packages/protocol/src/canonical/ptrr-failsafe-thricified-stack.js",
380+
"gate4Benchmark": "packages/protocol/src/canonical/prompt-benchmark-report.js",
381+
"gate5Disclosure": "packages/protocol/src/canonical/inference-telemetry-disclosure-report.js"
382+
}
383+
}

0 commit comments

Comments
 (0)