diff --git a/.bitcode/v46-interface-claim-contracts.json b/.bitcode/v46-interface-claim-contracts.json index 838ac417d..e0441d553 100644 --- a/.bitcode/v46-interface-claim-contracts.json +++ b/.bitcode/v46-interface-claim-contracts.json @@ -8,22 +8,22 @@ "artifactRoot": "v46-interface-claim-contracts:e336eab9588d13d70bf55365", "sourceRoots": { "BITCODE_SPEC.txt": "BITCODE_SPEC.txt:674f33696f4048b636f67e13", - "BITCODE_SPEC_V46.md": "BITCODE_SPEC_V46.md:009872679425104535947045", - "BITCODE_SPEC_V46_DELTA.md": "BITCODE_SPEC_V46_DELTA.md:508fa749abdad4c294fef507", - "BITCODE_SPEC_V46_NOTES.md": "BITCODE_SPEC_V46_NOTES.md:8041973f6b9db38b565008b4", - "BITCODE_SPEC_V46_PARITY_MATRIX.md": "BITCODE_SPEC_V46_PARITY_MATRIX.md:cd7df12991c31a2b95e8dbd6", - "SPECIFICATIONS_ROADMAP.md": "SPECIFICATIONS_ROADMAP.md:4ef6602f19fc9f0d1a25ab4f", - "README.md": "README.md:2c7f6204927f16e8a5da94a2", - "packages/protocol/README.md": "packages/protocol/README.md:fc9ae7ef5297a5127a407267", - "package.json": "package.json:85e5be572a1904c4a439cfe6", - "packages/protocol/src/index.js": "packages/protocol/src/index.js:c4536f5d4e30be2dd345a81d", - "packages/protocol/src/index.d.ts": "packages/protocol/src/index.d.ts:d79dee28d095eb4d74a4436d", + "BITCODE_SPEC_V46.md": "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5", + "BITCODE_SPEC_V46_DELTA.md": "BITCODE_SPEC_V46_DELTA.md:7920d7f42161931f93cba093", + "BITCODE_SPEC_V46_NOTES.md": "BITCODE_SPEC_V46_NOTES.md:189e67fc2acbf4811ebac052", + "BITCODE_SPEC_V46_PARITY_MATRIX.md": "BITCODE_SPEC_V46_PARITY_MATRIX.md:b133273fc254880a52286b25", + "SPECIFICATIONS_ROADMAP.md": "SPECIFICATIONS_ROADMAP.md:b2e9e71006d861deb008fc48", + "README.md": "README.md:f6aaae9cb46c3c5ea9f88257", + "packages/protocol/README.md": "packages/protocol/README.md:cf41e9679273e5b70040dbb3", + "package.json": "package.json:163b54e4f8fd7d1e74369695", + "packages/protocol/src/index.js": "packages/protocol/src/index.js:982ea139bf7924bc9d8060f8", + "packages/protocol/src/index.d.ts": "packages/protocol/src/index.d.ts:69da86d924bf5e58a83a194c", "packages/protocol/src/canonical/v46-interface-claim-contracts.js": "packages/protocol/src/canonical/v46-interface-claim-contracts.js:7bacc41bc1e35d1513baf796", "packages/protocol/test/v46-interface-claim-contracts.test.js": "packages/protocol/test/v46-interface-claim-contracts.test.js:f1dcb481edcbadee07f42127", "scripts/generate-v46-interface-claim-contracts.mjs": "scripts/generate-v46-interface-claim-contracts.mjs:c6faeaf341acbb26e4e51179", "scripts/check-v46-gate5-interface-claim-contracts.mjs": "scripts/check-v46-gate5-interface-claim-contracts.mjs:b6be899067bc320750689824", - ".github/workflows/bitcode-gate-quality.yml": ".github/workflows/bitcode-gate-quality.yml:51171a1ceff781d3a2e6c2b9", - ".github/workflows/bitcode-canon-quality.yml": ".github/workflows/bitcode-canon-quality.yml:a9b24db5df436aed023707e6", + ".github/workflows/bitcode-gate-quality.yml": ".github/workflows/bitcode-gate-quality.yml:6cbd2dbd8db154eef0c2c060", + ".github/workflows/bitcode-canon-quality.yml": ".github/workflows/bitcode-canon-quality.yml:eceb3e65f32dcf806f3a4ea9", "packages/btd/src/api-schema-compatibility-matrix.ts": "packages/btd/src/api-schema-compatibility-matrix.ts:21527a4ab84909ce72247fab", "packages/btd/__tests__/api-schema-compatibility-matrix.test.ts": "packages/btd/__tests__/api-schema-compatibility-matrix.test.ts:32fa0cfd7301dc44808b3eac", "packages/btd/src/mcp-tool-contract.ts": "packages/btd/src/mcp-tool-contract.ts:ed7ff68bb55bd47afc9c538b", diff --git a/.bitcode/v46-local-interface-comprehension-rehearsal.json b/.bitcode/v46-local-interface-comprehension-rehearsal.json new file mode 100644 index 000000000..14fe61ff3 --- /dev/null +++ b/.bitcode/v46-local-interface-comprehension-rehearsal.json @@ -0,0 +1,914 @@ +{ + "artifactId": "v46-local-interface-comprehension-rehearsal", + "schemaId": "bitcode.v46.localInterfaceComprehensionRehearsal.v1", + "version": "V46", + "currentTarget": "V45", + "sourceSafetyVerdict": "source-safe-local-interface-comprehension-rehearsal", + "generatedAt": "deterministic", + "artifactRoot": "v46-local-interface-comprehension-rehearsal:a0412888725a2842ee1357af", + "rehearsalStatus": "completed_source_safe_local", + "passed": true, + "surfaceIds": [ + "docs_landing", + "packs_route", + "read_route", + "deposit_route", + "api_mcp", + "chatgpt_bitcode_chat", + "proof_telemetry_repair" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredArtifactIds": [ + "v46-protocol-comprehension-object-model", + "v46-public-operator-claim-boundaries", + "v46-product-route-comprehension-readback", + "v46-interface-claim-contracts", + "v46-proof-readback-operator-explanation" + ], + "rows": [ + { + "surfaceId": "docs_landing", + "surfaceLabel": "Public Docs And Landing", + "sourcePaths": [ + "uapi/app/page.tsx", + "uapi/app/docs/page.tsx", + "uapi/app/(root)/components/PublicDocsPageContent.tsx" + ], + "claimIds": [ + "assetpack-is-commodity", + "btd-is-weighted-scalar-volume-and-settled-rights", + "operator-evidence-is-source-safe-readback" + ], + "claimCategoryIds": [ + "protocol-law", + "product-guidance", + "operator-evidence" + ], + "authorityIds": [ + "canonical-specification", + "generated-proof", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "Bitcode public home for AssetPacks", + "Learn Bitcode from AssetPacks to proof.", + "Public docs explain; proof readback decides." + ], + "expectedReadback": "The local public route and docs route explain AssetPacks, BTD scalar volume and rights, BTC settlement, proof readback, and interface boundaries without live state authority.", + "repairExpectation": "If public copy overclaims state authority, route copy returns to source-safe explanation and proof readback remains decisive.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:fb1b98a0d2c9e17fc883f230", + "sourceRoots": [ + "uapi/app/page.tsx:b1b707e58f8917b8a97717b4", + "uapi/app/docs/page.tsx:75e5011c78a308e60f95cbd5", + "uapi/app/(root)/components/PublicDocsPageContent.tsx:6efbf77a6f292e9e0c25b70e" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "packs_route", + "surfaceLabel": "/packs", + "sourcePaths": [ + "uapi/app/packs/page.tsx", + "uapi/app/packs/PacksPageClient.tsx", + "uapi/components/base/bitcode/activity/pack-activity-model.ts" + ], + "claimIds": [ + "operator-evidence-is-source-safe-readback", + "preview-is-source-safe-measurement", + "repair-fails-closed", + "telemetry-is-observability-only" + ], + "claimCategoryIds": [ + "product-guidance", + "operator-evidence", + "preview-claim", + "repair-claim" + ], + "authorityIds": [ + "canonical-specification", + "database-projection", + "generated-proof", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "Search pack activity", + "Search titles, measurements, values, proof roots", + "assertPackActivitySourceSafe", + "unpaidAssetPackSourceVisible: false" + ], + "expectedReadback": "/packs rehearses searchable PackActivity master-detail readback with source-safe measurements, values, proof roots, settlement, delivery, compensation, and repair state.", + "repairExpectation": "If PackActivity source-safety assertion fails, the route must hold the row in repair instead of projecting source-bearing detail.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:d744aeb10f86283529f10544", + "sourceRoots": [ + "uapi/app/packs/page.tsx:1b3d7a1cc00500a13042e8dd", + "uapi/app/packs/PacksPageClient.tsx:68c61c8fd312e6c750d742ba", + "uapi/components/base/bitcode/activity/pack-activity-model.ts:88d0334af8bc699e071ca2a1" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "read_route", + "surfaceLabel": "/read", + "sourcePaths": [ + "uapi/app/read/page.tsx", + "uapi/app/read/ReadPageClient.tsx" + ], + "claimIds": [ + "operator-evidence-is-source-safe-readback", + "preview-is-source-safe-measurement", + "quote-is-source-safe-offer", + "finality-authorizes-rights-and-delivery" + ], + "claimCategoryIds": [ + "product-guidance", + "preview-claim", + "quote-claim", + "settlement-claim", + "rights-claim" + ], + "authorityIds": [ + "canonical-specification", + "generated-proof", + "interface-guidance-only", + "ledger-readback" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "Request Reading, review synthesized Needs", + "Read request -> Need -> Finding Fits -> Preview -> Settlement.", + "Visible: Need measurements, fit ids, proof roots, fee quotes", + "Withheld until paid" + ], + "expectedReadback": "/read rehearses the five-step Reading path from request through Need review, Finding Fits, source-safe preview, quote, settlement, BTD rights, and delivery boundary.", + "repairExpectation": "If Need, quote, finality, or delivery proof is missing, the route keeps the Reader at the narrowest source-safe step.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:24860b3d7668bfd1be49225b", + "sourceRoots": [ + "uapi/app/read/page.tsx:37a723ed87feac05c0504249", + "uapi/app/read/ReadPageClient.tsx:860bec675640bf466752bc7e" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "deposit_route", + "surfaceLabel": "/deposit", + "sourcePaths": [ + "uapi/app/deposit/page.tsx", + "uapi/app/deposit/DepositPageClient.tsx" + ], + "claimIds": [ + "deposit-option-is-potential-supply", + "assetpack-is-commodity", + "operator-evidence-is-source-safe-readback", + "compensation-follows-source-to-shares" + ], + "claimCategoryIds": [ + "product-guidance", + "protocol-law", + "operator-evidence", + "compensation-claim" + ], + "authorityIds": [ + "canonical-specification", + "generated-proof", + "database-projection", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "source-safe AssetPack deposit options", + "Source-safe AssetPack proposals", + "Criticality, demand, ROI, BTD potential, compensation.", + "Withheld: raw source, unpaid AssetPack source" + ], + "expectedReadback": "/deposit rehearses source-safe deposit option synthesis, review, policy, admission, BTD potential, and compensation posture without final Need-relative BTD claims.", + "repairExpectation": "If source criticality, ROI, or admission evidence is unsafe or missing, the route blocks Depository admission and keeps raw source withheld.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:4353b716ad3db5bd7833d76f", + "sourceRoots": [ + "uapi/app/deposit/page.tsx:6bab6a9debab3f4350d0ddca", + "uapi/app/deposit/DepositPageClient.tsx:8526b7980e568ab7d5228e8f" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "api_mcp", + "surfaceLabel": "API And MCP", + "sourcePaths": [ + "packages/btd/src/api-schema-compatibility-matrix.ts", + "packages/btd/src/mcp-tool-contract.ts", + "packages/executions-mcp/src/mcp-server/docs/mcp/mcp-api-reference.md" + ], + "claimIds": [ + "operator-evidence-is-source-safe-readback", + "preview-is-source-safe-measurement", + "finality-authorizes-rights-and-delivery", + "repair-fails-closed" + ], + "claimCategoryIds": [ + "product-guidance", + "operator-evidence", + "preview-claim", + "rights-claim", + "repair-claim" + ], + "authorityIds": [ + "canonical-specification", + "generated-proof", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "BTD_API_SCHEMA_COMPATIBILITY_CONSUMER_SURFACES", + "bitcode://pipelines/asset-pack/create", + "protected-source-locked", + "MCP API Reference" + ], + "expectedReadback": "API and MCP rehearse versionless source-safe request/response contracts, proof-root projection, protected-source locks, and denied-state repair.", + "repairExpectation": "If schema, permission, provider binding, or protected-source lock evidence is missing, machine interfaces deny writes and emit repair state.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:4e46d397b6d4e4ac21c5b557", + "sourceRoots": [ + "packages/btd/src/api-schema-compatibility-matrix.ts:21527a4ab84909ce72247fab", + "packages/btd/src/mcp-tool-contract.ts:ed7ff68bb55bd47afc9c538b", + "packages/executions-mcp/src/mcp-server/docs/mcp/mcp-api-reference.md:39ae38737d2c48c96eebb5ea" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "chatgpt_bitcode_chat", + "surfaceLabel": "ChatGPT App And Bitcode Chat", + "sourcePaths": [ + "packages/btd/src/chatgpt-app-action-contract.ts", + "packages/chatgptapp/src/tools.ts", + "uapi/app/conversations/conversation-terminal-handoff.ts", + "uapi/app/conversations/conversation-telemetry-proof-hooks.ts", + "uapi/tests/api/conversationReadingInterfaceParity.test.ts" + ], + "claimIds": [ + "preview-is-source-safe-measurement", + "payment-observation-is-not-finality", + "delivery-is-entitled-source-unlock", + "telemetry-is-observability-only" + ], + "claimCategoryIds": [ + "product-guidance", + "preview-claim", + "settlement-claim", + "delivery-claim", + "telemetry-observability" + ], + "authorityIds": [ + "canonical-specification", + "generated-proof", + "telemetry-observability-only", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "BTD_CHATGPT_APP_ACTION_CONTRACT_IDS", + "bitcode_request_read", + "terminal-delegated-handoff", + "source_safe_conversation_telemetry_metadata", + "source_bearing_delivery_locked_until_settlement_and_rights" + ], + "expectedReadback": "ChatGPT App and Bitcode Chat rehearse guided Reading actions, source-safe response rendering, delegated handoff, telemetry proof roots, and delivery lock boundaries.", + "repairExpectation": "If conversational state conflicts with route/proof state, conversation remains guidance-only and hands off to product proof readback.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:10d2d1b870ff147f062b1775", + "sourceRoots": [ + "packages/btd/src/chatgpt-app-action-contract.ts:a24a464bd0910f8b8284ddfe", + "packages/chatgptapp/src/tools.ts:01098e7c683c6394a4ff6918", + "uapi/app/conversations/conversation-terminal-handoff.ts:0eb848817ddf44fc2946aa05", + "uapi/app/conversations/conversation-telemetry-proof-hooks.ts:44c7ff1620bfa9f329f07c4d", + "uapi/tests/api/conversationReadingInterfaceParity.test.ts:e31d05980a03ff7c966df485" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + }, + { + "surfaceId": "proof_telemetry_repair", + "surfaceLabel": "Proof, Telemetry, And Repair Readback", + "sourcePaths": [ + "uapi/components/base/bitcode/execution/pipeline-execution-log.tsx", + "packages/protocol/src/canonical/v39-operational-telemetry-repair-readback.js", + "uapi/app/bitcode-ledger-storage-sync.ts", + ".bitcode/v46-proof-readback-operator-explanation.json" + ], + "claimIds": [ + "operator-evidence-is-source-safe-readback", + "telemetry-is-observability-only", + "repair-fails-closed", + "payment-observation-is-not-finality" + ], + "claimCategoryIds": [ + "operator-evidence", + "telemetry-observability", + "repair-claim", + "settlement-claim" + ], + "authorityIds": [ + "generated-proof", + "telemetry-observability-only", + "database-projection", + "ledger-readback", + "interface-guidance-only" + ], + "stepIds": [ + "load-local-source", + "identify-interface-claims", + "verify-source-safe-disclosure", + "verify-evidence-authority", + "verify-denied-state-repair", + "emit-source-safe-rehearsal-root" + ], + "requiredCopyTokens": [ + "promptDisclosurePosture", + "source_safe_reading_operational_telemetry_repair_readback_metadata", + "BITCODE_LEDGER_STORAGE_SYNC_CONTRACT", + "v46-proof-readback-operator-explanation" + ], + "expectedReadback": "Proof, telemetry, and repair rehearsal confirms local stream UI can show phases, steps, proof roots, disclosure posture, and metadata while preserving evidence authority hierarchy.", + "repairExpectation": "If telemetry, database projection, ledger, storage, wallet, or delivery evidence disagree, repair fails closed and telemetry stays observability only.", + "localOnly": true, + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ], + "rowRoot": "v46-local-interface-rehearsal-row:5dab113b96d09fc833b28ccc", + "sourceRoots": [ + "uapi/components/base/bitcode/execution/pipeline-execution-log.tsx:bb7e1773303e04b9027ae2c7", + "packages/protocol/src/canonical/v39-operational-telemetry-repair-readback.js:1647b3a170af58333c1553a3", + "uapi/app/bitcode-ledger-storage-sync.ts:0907056993c1ebae7e9b921d", + ".bitcode/v46-proof-readback-operator-explanation.json:7792db1741defb2d2a3b697a" + ], + "sourceFilesPresent": true, + "requiredCopyPresent": true + } + ], + "priorArtifactResults": [ + { + "artifactId": "v46-protocol-comprehension-object-model", + "sourcePath": ".bitcode/v46-protocol-comprehension-object-model.json", + "passed": true, + "sourceRoot": ".bitcode/v46-protocol-comprehension-object-model.json:0a6c4f6f197f4ade34902bb4" + }, + { + "artifactId": "v46-public-operator-claim-boundaries", + "sourcePath": ".bitcode/v46-public-operator-claim-boundaries.json", + "passed": true, + "sourceRoot": ".bitcode/v46-public-operator-claim-boundaries.json:b5b401be52a23560170c3de6" + }, + { + "artifactId": "v46-product-route-comprehension-readback", + "sourcePath": ".bitcode/v46-product-route-comprehension-readback.json", + "passed": true, + "sourceRoot": ".bitcode/v46-product-route-comprehension-readback.json:97548fb00fad41b77e0232b1" + }, + { + "artifactId": "v46-interface-claim-contracts", + "sourcePath": ".bitcode/v46-interface-claim-contracts.json", + "passed": true, + "sourceRoot": ".bitcode/v46-interface-claim-contracts.json:53b19b6e563b7622f79355e3" + }, + { + "artifactId": "v46-proof-readback-operator-explanation", + "sourcePath": ".bitcode/v46-proof-readback-operator-explanation.json", + "passed": true, + "sourceRoot": ".bitcode/v46-proof-readback-operator-explanation.json:7792db1741defb2d2a3b697a" + } + ], + "predicateResults": [ + { + "id": "active-pointer-remains-v45", + "sourcePath": "BITCODE_SPEC.txt", + "passed": true + }, + { + "id": "spec-defines-gate7-law", + "sourcePath": "BITCODE_SPEC_V46.md", + "passed": true + }, + { + "id": "delta-records-gate7", + "sourcePath": "BITCODE_SPEC_V46_DELTA.md", + "passed": true + }, + { + "id": "notes-records-gate7", + "sourcePath": "BITCODE_SPEC_V46_NOTES.md", + "passed": true + }, + { + "id": "parity-records-gate7", + "sourcePath": "BITCODE_SPEC_V46_PARITY_MATRIX.md", + "passed": true + }, + { + "id": "roadmap-advanced-to-gate7", + "sourcePath": "SPECIFICATIONS_ROADMAP.md", + "passed": true + }, + { + "id": "readmes-document-gate7", + "sourcePath": "README.md", + "passed": true + }, + { + "id": "prior-v46-artifacts-pass", + "sourcePath": ".bitcode/v46-protocol-comprehension-object-model.json", + "passed": true + }, + { + "id": "package-exports-gate7", + "sourcePath": "packages/protocol/src/index.js", + "passed": true + }, + { + "id": "package-test-covers-gate7", + "sourcePath": "packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js", + "passed": true + }, + { + "id": "generator-and-checker-exist", + "sourcePath": "scripts/generate-v46-local-interface-comprehension-rehearsal.mjs", + "passed": true + }, + { + "id": "package-json-scripts", + "sourcePath": "package.json", + "passed": true + }, + { + "id": "workflows-run-gate7", + "sourcePath": ".github/workflows/bitcode-gate-quality.yml", + "passed": true + } + ], + "sourceRoots": { + "activePointer": "BITCODE_SPEC.txt:674f33696f4048b636f67e13", + "spec": "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5", + "delta": "BITCODE_SPEC_V46_DELTA.md:7920d7f42161931f93cba093", + "notes": "BITCODE_SPEC_V46_NOTES.md:189e67fc2acbf4811ebac052", + "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:b133273fc254880a52286b25", + "roadmap": "SPECIFICATIONS_ROADMAP.md:b2e9e71006d861deb008fc48", + "readme": "README.md:f6aaae9cb46c3c5ea9f88257", + "protocolReadme": "packages/protocol/README.md:cf41e9679273e5b70040dbb3", + "packageJson": "package.json:163b54e4f8fd7d1e74369695", + "packageIndex": "packages/protocol/src/index.js:982ea139bf7924bc9d8060f8", + "packageTypes": "packages/protocol/src/index.d.ts:69da86d924bf5e58a83a194c", + "packageSource": "packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js:c52b528dbbf885b76de6ceb7", + "packageTest": "packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js:5b6ad282088791ea76ec2bbf", + "generator": "scripts/generate-v46-local-interface-comprehension-rehearsal.mjs:d6a9dadb6f8ee51de50a529f", + "checker": "scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs:beb49c72404e73e730640a72", + "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:6cbd2dbd8db154eef0c2c060", + "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:eceb3e65f32dcf806f3a4ea9", + "v46ProtocolArtifact": ".bitcode/v46-protocol-comprehension-object-model.json:0a6c4f6f197f4ade34902bb4", + "v46PublicArtifact": ".bitcode/v46-public-operator-claim-boundaries.json:b5b401be52a23560170c3de6", + "v46ProductArtifact": ".bitcode/v46-product-route-comprehension-readback.json:97548fb00fad41b77e0232b1", + "v46InterfaceArtifact": ".bitcode/v46-interface-claim-contracts.json:53b19b6e563b7622f79355e3", + "v46ProofArtifact": ".bitcode/v46-proof-readback-operator-explanation.json:7792db1741defb2d2a3b697a", + "landingPage": "uapi/app/page.tsx:b1b707e58f8917b8a97717b4", + "docsPage": "uapi/app/docs/page.tsx:75e5011c78a308e60f95cbd5", + "docsContent": "uapi/app/(root)/components/PublicDocsPageContent.tsx:6efbf77a6f292e9e0c25b70e", + "packsPage": "uapi/app/packs/page.tsx:1b3d7a1cc00500a13042e8dd", + "packsClient": "uapi/app/packs/PacksPageClient.tsx:68c61c8fd312e6c750d742ba", + "packActivityModel": "uapi/components/base/bitcode/activity/pack-activity-model.ts:88d0334af8bc699e071ca2a1", + "readPage": "uapi/app/read/page.tsx:37a723ed87feac05c0504249", + "readClient": "uapi/app/read/ReadPageClient.tsx:860bec675640bf466752bc7e", + "depositPage": "uapi/app/deposit/page.tsx:6bab6a9debab3f4350d0ddca", + "depositClient": "uapi/app/deposit/DepositPageClient.tsx:8526b7980e568ab7d5228e8f", + "btdApiSchema": "packages/btd/src/api-schema-compatibility-matrix.ts:21527a4ab84909ce72247fab", + "btdMcpContract": "packages/btd/src/mcp-tool-contract.ts:ed7ff68bb55bd47afc9c538b", + "mcpDocsReference": "packages/executions-mcp/src/mcp-server/docs/mcp/mcp-api-reference.md:39ae38737d2c48c96eebb5ea", + "btdChatGptContract": "packages/btd/src/chatgpt-app-action-contract.ts:a24a464bd0910f8b8284ddfe", + "chatGptTools": "packages/chatgptapp/src/tools.ts:01098e7c683c6394a4ff6918", + "conversationHandoff": "uapi/app/conversations/conversation-terminal-handoff.ts:0eb848817ddf44fc2946aa05", + "conversationTelemetry": "uapi/app/conversations/conversation-telemetry-proof-hooks.ts:44c7ff1620bfa9f329f07c4d", + "conversationParityTest": "uapi/tests/api/conversationReadingInterfaceParity.test.ts:e31d05980a03ff7c966df485", + "pipelineLogUi": "uapi/components/base/bitcode/execution/pipeline-execution-log.tsx:bb7e1773303e04b9027ae2c7", + "v39OperationalTelemetryReadback": "packages/protocol/src/canonical/v39-operational-telemetry-repair-readback.js:1647b3a170af58333c1553a3", + "uapiLedgerStorageSync": "uapi/app/bitcode-ledger-storage-sync.ts:0907056993c1ebae7e9b921d" + }, + "coverage": { + "predicateCount": 13, + "failedPredicateIds": [], + "surfaceCount": 7, + "stepCount": 6, + "allSurfacesCovered": true, + "allStepsCovered": true, + "allPriorArtifactsPassed": true, + "allClaimIdsKnown": true, + "allCategoryIdsKnown": true, + "allAuthorityIdsKnown": true, + "sourceFilesPresent": true, + "rowsMissingSourceFiles": [], + "rowsMissingRequiredCopy": [], + "localOnly": true, + "sourceSafeMetadataOnly": true, + "noParallelStateAuthority": true, + "stateAdvanceRequiresProofRoot": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "forbiddenPhraseHits": [], + "secretMarkerHits": [] + }, + "sourceSafety": { + "sourceSafetyVerdict": "source-safe-local-interface-comprehension-rehearsal", + "sourceSafeMetadataOnly": true, + "protectedSourceVisible": false, + "unpaidAssetPackSourceVisible": false, + "rawPromptVisible": false, + "interpolatedPromptVisible": false, + "rawProviderResponseVisible": false, + "credentialsSerialized": false, + "walletPrivateMaterialVisible": false, + "settlementPrivatePayloadVisible": false, + "valueBearingMainnetAdmitted": false, + "sourceSafeFieldIds": [ + "objectId", + "claimId", + "claimCategoryId", + "authorityId", + "surfaceId", + "stateId", + "measurementRoot", + "proofRoot", + "ledgerRoot", + "databaseProjectionRoot", + "storageRoot", + "walletReceiptRoot", + "repositoryReceiptRoot", + "telemetryRoot", + "repairCaseId" + ], + "privatePayloadIdsNeverSerialized": [ + "protected-source-payloads", + "unpaid-assetpack-source", + "source-snippets", + "raw-prompts", + "interpolated-prompts", + "raw-provider-responses", + "credentials", + "wallet-private-material", + "private-settlement-payloads", + "private-read-context", + "value-bearing-mainnet-admission" + ] + } +} diff --git a/.bitcode/v46-product-route-comprehension-readback.json b/.bitcode/v46-product-route-comprehension-readback.json index 0dbc4a458..1a98579cd 100644 --- a/.bitcode/v46-product-route-comprehension-readback.json +++ b/.bitcode/v46-product-route-comprehension-readback.json @@ -8,20 +8,20 @@ "sourceSafetyVerdict": "source-safe-product-route-comprehension-readback", "sourceRoots": { "activePointer": "BITCODE_SPEC.txt:674f33696f4048b636f67e13", - "spec": "BITCODE_SPEC_V46.md:009872679425104535947045", - "delta": "BITCODE_SPEC_V46_DELTA.md:508fa749abdad4c294fef507", - "notes": "BITCODE_SPEC_V46_NOTES.md:8041973f6b9db38b565008b4", - "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:cd7df12991c31a2b95e8dbd6", - "roadmap": "SPECIFICATIONS_ROADMAP.md:4ef6602f19fc9f0d1a25ab4f", - "packageJson": "package.json:85e5be572a1904c4a439cfe6", - "packageIndex": "packages/protocol/src/index.js:c4536f5d4e30be2dd345a81d", - "packageTypes": "packages/protocol/src/index.d.ts:d79dee28d095eb4d74a4436d", + "spec": "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5", + "delta": "BITCODE_SPEC_V46_DELTA.md:7920d7f42161931f93cba093", + "notes": "BITCODE_SPEC_V46_NOTES.md:189e67fc2acbf4811ebac052", + "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:b133273fc254880a52286b25", + "roadmap": "SPECIFICATIONS_ROADMAP.md:b2e9e71006d861deb008fc48", + "packageJson": "package.json:163b54e4f8fd7d1e74369695", + "packageIndex": "packages/protocol/src/index.js:982ea139bf7924bc9d8060f8", + "packageTypes": "packages/protocol/src/index.d.ts:69da86d924bf5e58a83a194c", "packageSource": "packages/protocol/src/canonical/v46-product-route-comprehension-readback.js:c7b3e44d22703ca4b8f17ac3", "packageTest": "packages/protocol/test/v46-product-route-comprehension-readback.test.js:3118d40ad600a9fb1d025bf6", "generator": "scripts/generate-v46-product-route-comprehension-readback.mjs:131473a8dcd0d665f74f56a7", "checker": "scripts/check-v46-gate4-product-route-comprehension-readback.mjs:483822ed6cd2809c20ee8fe5", - "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:51171a1ceff781d3a2e6c2b9", - "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:a9b24db5df436aed023707e6", + "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:6cbd2dbd8db154eef0c2c060", + "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:eceb3e65f32dcf806f3a4ea9", "productRouteShell": "uapi/components/base/bitcode/routes/product-route-shell.tsx:e71f90c289dec52fd158568a", "packsClient": "uapi/app/packs/PacksPageClient.tsx:68c61c8fd312e6c750d742ba", "packsModel": "uapi/components/base/bitcode/activity/pack-activity-model.ts:88d0334af8bc699e071ca2a1", diff --git a/.bitcode/v46-proof-readback-operator-explanation.json b/.bitcode/v46-proof-readback-operator-explanation.json index fd5afd9cd..e9ba6f393 100644 --- a/.bitcode/v46-proof-readback-operator-explanation.json +++ b/.bitcode/v46-proof-readback-operator-explanation.json @@ -123,7 +123,7 @@ "sourceRoots": [ "BITCODE_SPEC_V45.md:303eba5e7ebde2132d729f1f", "BITCODE_SPEC_V45_PROVEN.md:49cae72f47df688d9d02b655", - "BITCODE_SPEC_V46.md:009872679425104535947045" + "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5" ], "sourceFilesPresent": true, "requiredCopyPresent": true @@ -913,7 +913,7 @@ "passed": true }, { - "id": "roadmap-advanced-to-gate6", + "id": "roadmap-records-gate6-closure", "sourcePath": "SPECIFICATIONS_ROADMAP.md", "passed": true }, @@ -1029,9 +1029,9 @@ }, "proofRoots": { "rowSetRoot": "sha256:771d03cf064bc688ebd33cfa", - "predicateRoot": "sha256:1396b883c151f14662e7dd8b", + "predicateRoot": "sha256:9a92745e9d201f5f2746a59a", "coverageRoot": "sha256:bb649799af3d38991e70cb31", - "artifactRoot": "sha256:778f1be4964418b44855bd40" + "artifactRoot": "sha256:8dc431603385b71168794b4c" }, "sourceSafety": { "sourceSafeMetadataOnly": true, diff --git a/.bitcode/v46-protocol-comprehension-object-model.json b/.bitcode/v46-protocol-comprehension-object-model.json index 5e78bd7b5..cc211a9bd 100644 --- a/.bitcode/v46-protocol-comprehension-object-model.json +++ b/.bitcode/v46-protocol-comprehension-object-model.json @@ -8,18 +8,18 @@ "sourceSafetyVerdict": "source-safe-protocol-comprehension-metadata", "sourceRoots": { "activePointer": "BITCODE_SPEC.txt:674f33696f4048b636f67e13", - "spec": "BITCODE_SPEC_V46.md:009872679425104535947045", - "delta": "BITCODE_SPEC_V46_DELTA.md:508fa749abdad4c294fef507", - "notes": "BITCODE_SPEC_V46_NOTES.md:8041973f6b9db38b565008b4", - "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:cd7df12991c31a2b95e8dbd6", - "roadmap": "SPECIFICATIONS_ROADMAP.md:4ef6602f19fc9f0d1a25ab4f", - "readme": "README.md:2c7f6204927f16e8a5da94a2", - "protocolReadme": "packages/protocol/README.md:fc9ae7ef5297a5127a407267", - "packageJson": "package.json:85e5be572a1904c4a439cfe6", - "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:51171a1ceff781d3a2e6c2b9", - "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:a9b24db5df436aed023707e6", - "packageIndex": "packages/protocol/src/index.js:c4536f5d4e30be2dd345a81d", - "packageTypes": "packages/protocol/src/index.d.ts:d79dee28d095eb4d74a4436d", + "spec": "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5", + "delta": "BITCODE_SPEC_V46_DELTA.md:7920d7f42161931f93cba093", + "notes": "BITCODE_SPEC_V46_NOTES.md:189e67fc2acbf4811ebac052", + "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:b133273fc254880a52286b25", + "roadmap": "SPECIFICATIONS_ROADMAP.md:b2e9e71006d861deb008fc48", + "readme": "README.md:f6aaae9cb46c3c5ea9f88257", + "protocolReadme": "packages/protocol/README.md:cf41e9679273e5b70040dbb3", + "packageJson": "package.json:163b54e4f8fd7d1e74369695", + "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:6cbd2dbd8db154eef0c2c060", + "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:eceb3e65f32dcf806f3a4ea9", + "packageIndex": "packages/protocol/src/index.js:982ea139bf7924bc9d8060f8", + "packageTypes": "packages/protocol/src/index.d.ts:69da86d924bf5e58a83a194c", "packageSource": "packages/protocol/src/canonical/v46-protocol-comprehension-object-model.js:a55974c399c15656961c7370", "packageTest": "packages/protocol/test/v46-protocol-comprehension-object-model.test.js:b3dd4b276e9c00b76becb15e", "generator": "scripts/generate-v46-protocol-comprehension-object-model.mjs:814f07e809e47d359485ba46", diff --git a/.bitcode/v46-public-operator-claim-boundaries.json b/.bitcode/v46-public-operator-claim-boundaries.json index 0e64f43f5..1ee1b9b6a 100644 --- a/.bitcode/v46-public-operator-claim-boundaries.json +++ b/.bitcode/v46-public-operator-claim-boundaries.json @@ -8,22 +8,22 @@ "sourceSafetyVerdict": "source-safe-public-operator-claim-boundary-metadata", "sourceRoots": { "activePointer": "BITCODE_SPEC.txt:674f33696f4048b636f67e13", - "spec": "BITCODE_SPEC_V46.md:009872679425104535947045", - "delta": "BITCODE_SPEC_V46_DELTA.md:508fa749abdad4c294fef507", - "notes": "BITCODE_SPEC_V46_NOTES.md:8041973f6b9db38b565008b4", - "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:cd7df12991c31a2b95e8dbd6", - "roadmap": "SPECIFICATIONS_ROADMAP.md:4ef6602f19fc9f0d1a25ab4f", - "readme": "README.md:2c7f6204927f16e8a5da94a2", - "protocolReadme": "packages/protocol/README.md:fc9ae7ef5297a5127a407267", - "packageJson": "package.json:85e5be572a1904c4a439cfe6", - "packageIndex": "packages/protocol/src/index.js:c4536f5d4e30be2dd345a81d", - "packageTypes": "packages/protocol/src/index.d.ts:d79dee28d095eb4d74a4436d", + "spec": "BITCODE_SPEC_V46.md:b8ecb2f2cbe1f3d8cb9c71f5", + "delta": "BITCODE_SPEC_V46_DELTA.md:7920d7f42161931f93cba093", + "notes": "BITCODE_SPEC_V46_NOTES.md:189e67fc2acbf4811ebac052", + "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:b133273fc254880a52286b25", + "roadmap": "SPECIFICATIONS_ROADMAP.md:b2e9e71006d861deb008fc48", + "readme": "README.md:f6aaae9cb46c3c5ea9f88257", + "protocolReadme": "packages/protocol/README.md:cf41e9679273e5b70040dbb3", + "packageJson": "package.json:163b54e4f8fd7d1e74369695", + "packageIndex": "packages/protocol/src/index.js:982ea139bf7924bc9d8060f8", + "packageTypes": "packages/protocol/src/index.d.ts:69da86d924bf5e58a83a194c", "packageSource": "packages/protocol/src/canonical/v46-public-operator-claim-boundaries.js:03799d116974cb5d9efba096", "packageTest": "packages/protocol/test/v46-public-operator-claim-boundaries.test.js:0afae65791ef7d7081b2a87a", "generator": "scripts/generate-v46-public-operator-claim-boundaries.mjs:5a7e5f8c9013c83e3c3818fb", "checker": "scripts/check-v46-gate3-public-operator-claim-boundaries.mjs:b958086681492633958639bf", - "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:51171a1ceff781d3a2e6c2b9", - "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:a9b24db5df436aed023707e6", + "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:6cbd2dbd8db154eef0c2c060", + "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:eceb3e65f32dcf806f3a4ea9", "publicCopy": "uapi/components/base/bitcode/layout/bitcode-public-copy.ts:9b39322f872b899e1c752701", "publicExplainers": "uapi/components/base/bitcode/layout/bitcode-public-explainers.ts:4e3b84dda50607ea8ea2b73e", "landingShared": "uapi/app/(root)/components/landing/marketing-landing-shared.tsx:27c33bd46ea46fd7608fd093", diff --git a/.github/workflows/bitcode-canon-quality.yml b/.github/workflows/bitcode-canon-quality.yml index 28cdd1a4d..de31ca0c5 100644 --- a/.github/workflows/bitcode-canon-quality.yml +++ b/.github/workflows/bitcode-canon-quality.yml @@ -437,6 +437,9 @@ jobs: if [ -f scripts/check-v46-gate6-proof-readback-operator-explanation.mjs ]; then node scripts/check-v46-gate6-proof-readback-operator-explanation.mjs --skip-branch-check --skip-package-tests fi + if [ -f scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs ]; then + node scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs --skip-branch-check --skip-package-tests + fi fi else echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2 diff --git a/.github/workflows/bitcode-gate-quality.yml b/.github/workflows/bitcode-gate-quality.yml index e1f4a6564..b11f90a05 100644 --- a/.github/workflows/bitcode-gate-quality.yml +++ b/.github/workflows/bitcode-gate-quality.yml @@ -566,6 +566,9 @@ jobs: if [ -f scripts/check-v46-gate6-proof-readback-operator-explanation.mjs ]; then node scripts/check-v46-gate6-proof-readback-operator-explanation.mjs --skip-branch-check --skip-package-tests fi + if [ -f scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs ]; then + node scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs --skip-branch-check --skip-package-tests + fi fi else echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2 @@ -622,6 +625,9 @@ jobs: if [ -f BITCODE_SPEC_V46.md ] && [ -f scripts/check-v46-gate6-proof-readback-operator-explanation.mjs ]; then node scripts/check-v46-gate6-proof-readback-operator-explanation.mjs --skip-branch-check --skip-package-tests fi + if [ -f BITCODE_SPEC_V46.md ] && [ -f scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs ]; then + node scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs --skip-branch-check --skip-package-tests + fi fi if [ "$POINTER" = "V43" ] && [ -f scripts/check-v44-gate1-scaled-economy-roadmap-opening.mjs ]; then node scripts/check-v44-gate1-scaled-economy-roadmap-opening.mjs --skip-branch-check diff --git a/BITCODE_SPEC_V46.md b/BITCODE_SPEC_V46.md index 7514fa68f..e299696fd 100644 --- a/BITCODE_SPEC_V46.md +++ b/BITCODE_SPEC_V46.md @@ -8,7 +8,7 @@ - Draft proof-source commit: not generated - Prior canonical anchor: `BITCODE_SPEC_V45.md` - Prior generated proof appendix: `BITCODE_SPEC_V45_PROVEN.md` -- Generated structured artifact inventory: draft `.bitcode/v46-spec-family-report.json`, `.bitcode/v46-canonical-input-report.json`, `.bitcode/v46-protocol-comprehension-object-model.json`, and `.bitcode/v46-public-operator-claim-boundaries.json`; later V46 gates must add proof, rehearsal, workflow, and promotion artifacts only after their scope is accepted +- Generated structured artifact inventory: draft `.bitcode/v46-spec-family-report.json`, `.bitcode/v46-canonical-input-report.json`, `.bitcode/v46-protocol-comprehension-object-model.json`, `.bitcode/v46-public-operator-claim-boundaries.json`, `.bitcode/v46-product-route-comprehension-readback.json`, `.bitcode/v46-interface-claim-contracts.json`, `.bitcode/v46-proof-readback-operator-explanation.json`, and `.bitcode/v46-local-interface-comprehension-rehearsal.json`; later V46 gates must add proof-family, workflow, and promotion artifacts only after their scope is accepted - Source parity state: V46 source parity is not audited yet; Gate 1 opens the draft-target roadmap only - Notes companion: `BITCODE_SPEC_V46_NOTES.md` - Delta companion: `BITCODE_SPEC_V46_DELTA.md` @@ -493,6 +493,30 @@ receipt, and repository delivery receipt. Telemetry is observability only. Provider observation is not final settlement until reconciled with quote, wallet authority, and finality policy. +## V46 local interface comprehension rehearsal law + +V46 Gate 7 proves local interface comprehension before promotion. The local +rehearsal loads public docs and landing surfaces, `/packs`, `/read`, +`/deposit`, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, and repair +readback source roots, then checks that each surface explains only the claims +authorized by the Gate 2 object model, Gate 3 public/operator boundaries, Gate +4 route readback, Gate 5 interface contracts, and Gate 6 proof authority +ladder. + +The rehearsal is local-only and source-safe. It does not launch value-bearing +mainnet behavior, does not run live payment finality, does not deliver +source-bearing AssetPacks, and does not serialize protected source, unpaid +AssetPack source, raw prompts, interpolated prompts, raw model/provider +responses, credentials, wallet private material, private settlement payloads, +or private repository access. It may emit deterministic roots, source-safe +metadata, surface ids, claim ids, authority ids, repair expectations, and +prior artifact pass/fail state. + +The source-safe generated artifact for this Gate 7 atom is +`.bitcode/v46-local-interface-comprehension-rehearsal.json`; it is generated +by `buildV46LocalInterfaceComprehensionRehearsal` and checked by +`check:v46-gate7`. + ## V46 gate taxonomy law V46 gates are classified as `notes-specification-atom`, @@ -892,6 +916,7 @@ and quality summary. | `.bitcode/v46-product-route-comprehension-readback.json` | product route comprehension readback artifact | Gate 4 | | `.bitcode/v46-interface-claim-contracts.json` | API/MCP, ChatGPT App, Bitcode Chat, and package-consumer claim-contract artifact | Gate 5 | | `.bitcode/v46-proof-readback-operator-explanation.json` | proof readback and source-safe operator explanation artifact | Gate 6 | +| `.bitcode/v46-local-interface-comprehension-rehearsal.json` | local interface comprehension rehearsal artifact | Gate 7 | | `.bitcode/v46-inference-synthesis-proof.json` | inference proof-family artifact | future proof gate | | `.bitcode/v46-prompt-completeness-proof.json` | prompt proof-family artifact | future proof gate | | `.bitcode/v46-static-code-analysis-proof.json` | static-code proof-family artifact | future proof gate | @@ -913,7 +938,8 @@ V46 specifying generated artifacts must include `.bitcode/v46-spec-family-report `.bitcode/v46-public-operator-claim-boundaries.json`, `.bitcode/v46-product-route-comprehension-readback.json`, `.bitcode/v46-interface-claim-contracts.json`, -`.bitcode/v46-proof-readback-operator-explanation.json`, all nine V46 +`.bitcode/v46-proof-readback-operator-explanation.json`, +`.bitcode/v46-local-interface-comprehension-rehearsal.json`, all nine V46 proof-family artifacts, `.bitcode/v46-source-safe-e2e-rehearsal.json`, `.bitcode/v46-promotion-readiness-report.json`, and future `BITCODE_SPEC_V46_PROVEN.md`; each artifact becomes required only when its own @@ -971,6 +997,7 @@ Gate 1 validates only active V45 plus draft V46 posture: - `pnpm run check:v46-gate4` - `pnpm run check:v46-gate5` - `pnpm run check:v46-gate6` +- `pnpm run check:v46-gate7` ## V46 promotion canon @@ -1083,7 +1110,7 @@ artifact roots. Validation commands include `check:v46-gate1`, `check:v46-gate2`, `check:v46-gate3`, `check:v46-gate4`, `check:v46-gate5`, -`check:v46-gate6`, draft V46 +`check:v46-gate6`, `check:v46-gate7`, draft V46 spec-family checks, active V45 promoted checks, V45/V46 canon posture drift checks, and later parity, proof, implementation, rehearsal, and promotion commands. diff --git a/BITCODE_SPEC_V46_DELTA.md b/BITCODE_SPEC_V46_DELTA.md index 30ac87640..d44ea7734 100644 --- a/BITCODE_SPEC_V46_DELTA.md +++ b/BITCODE_SPEC_V46_DELTA.md @@ -204,6 +204,32 @@ Accepted Gate 6 decisions: authorize source disclosure, settlement, delivery, rights transfer, or value-bearing mainnet behavior. +## Gate 7: Local Interface Comprehension Rehearsal + +Gate 7 adds `V46LocalInterfaceComprehensionRehearsal` as a source-safe +generated artifact at `.bitcode/v46-local-interface-comprehension-rehearsal.json`. +It rehearses local docs/landing, `/packs`, `/read`, `/deposit`, API/MCP, +ChatGPT App, Bitcode Chat, proof telemetry, and repair readback surfaces +against the Gate 2 through Gate 6 claim and authority artifacts. + +Accepted Gate 7 decisions: + +- The rehearsal is local-only and does not run value-bearing mainnet, + live BTC finality, source-bearing delivery, or external settlement. +- Each rehearsed surface binds to Gate 2 claim ids, claim categories, and + authority ids. +- Gate 2 through Gate 6 generated artifacts must pass before the rehearsal + can pass. +- Public and product routes may explain source-safe state, but proof readback + remains state authority. +- API/MCP, ChatGPT App, and Bitcode Chat remain source-safe guidance or machine + interfaces; they cannot create parallel protocol authority. +- Proof telemetry and repair readback can show phases, steps, proof roots, + disclosure posture, and metadata, but telemetry remains observability only. +- Gate 7 does not expose protected source, unpaid AssetPack source, prompts, + provider responses, credentials, wallet private material, private settlement + payloads, or private repository access. + ## Commit-Body Direction V46 commit bodies should name the gate class, protocol law or interface claim diff --git a/BITCODE_SPEC_V46_NOTES.md b/BITCODE_SPEC_V46_NOTES.md index fb885fd25..cadd907ba 100644 --- a/BITCODE_SPEC_V46_NOTES.md +++ b/BITCODE_SPEC_V46_NOTES.md @@ -210,6 +210,29 @@ repair states, source-safe disclosure exclusions, package exports, generated artifact freshness, workflow wiring, and focused protocol tests. The artifact path is `.bitcode/v46-proof-readback-operator-explanation.json`. +## V46 local interface comprehension rehearsal atom: local surface readback rehearsal + +Audit classification: Gates 2 through 6 now define the claim taxonomy, public +and product wording boundaries, machine/conversation contracts, and proof +authority ladder. Gate 7 must rehearse those artifacts together against local +source roots before promotion work can claim the interface explanation is +coherent. + +Local rehearsal law: + +The local rehearsal reads source roots for public docs, landing, `/packs`, +`/read`, `/deposit`, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, and +repair readback. It checks that each surface maps back to Gate 2 claim ids, +uses accepted evidence authority, keeps source-safe disclosure labels, and +names repair expectations when proof roots or stronger evidence are missing. + +Acceptance for this atom: `V46LocalInterfaceComprehensionRehearsal` must bind +all local surface ids, required local step ids, Gate 2 claim ids, claim +categories, authority ids, source roots, prior V46 artifact pass states, +source-safe disclosure exclusions, package exports, generated artifact +freshness, workflow wiring, and focused protocol tests. The artifact path is +`.bitcode/v46-local-interface-comprehension-rehearsal.json`. + ## V46 product route comprehension atom: route readback for Packs, Reading, and Depositing Audit classification: V43 through V45 created the route-product skeleton and diff --git a/BITCODE_SPEC_V46_PARITY_MATRIX.md b/BITCODE_SPEC_V46_PARITY_MATRIX.md index ed85359ac..8d3c8ab93 100644 --- a/BITCODE_SPEC_V46_PARITY_MATRIX.md +++ b/BITCODE_SPEC_V46_PARITY_MATRIX.md @@ -65,7 +65,7 @@ source files and generated artifacts that implement or explain each row. | Product route comprehension | `/packs`, `/read`, and `/deposit` expose low-detail default UX with expandable proof and consistent commercial terms | implemented prerequisite | Gate 4 owns package-backed `V46ProductRouteComprehensionReadback`, deterministic `.bitcode/v46-product-route-comprehension-readback.json`, route ids, route paths, low-detail defaults, route-owned state, Packs search/filter/sort, Reading five-step readback, Depositing five-step readback, source-safe proof detail, package exports, focused tests, and workflow wiring. | Gate 4 | | Machine and conversation interfaces | API/MCP, ChatGPT App, Bitcode Chat, and package consumers expose the same claim boundaries as website routes | implemented prerequisite | Gate 5 owns package-backed `V46InterfaceClaimContracts`, deterministic `.bitcode/v46-interface-claim-contracts.json`, public API schema compatibility, MCP tool contracts, ChatGPT App action contracts, Bitcode Chat conversation/stream/handoff contracts, package-consumer read contracts, proof-root projection, denied-state repair, source-safe disclosure exclusions, focused tests, and workflow wiring. | Gate 5 | | Proof readback explanation | Users and operators can understand why proof, ledger, database, storage, wallet/provider, and repository receipts have different authority | implemented prerequisite | Gate 6 owns package-backed `V46ProofReadbackOperatorExplanation`, deterministic `.bitcode/v46-proof-readback-operator-explanation.json`, canonical/generated proof rows, execution/workflow receipt rows, ledger journal rows, database projection rows, object-storage root rows, telemetry stream rows, wallet/provider receipt rows, repository delivery receipt rows, repair/reconciliation rows, source-safe operator explanation, focused tests, and workflow wiring. | Gate 6 | -| Local interface rehearsal | A source-safe local rehearsal verifies docs/routes/interfaces explain the protocol without exposing unpaid source | pending | No V46 rehearsal is authorized in Gate 1. | Gate 7 | +| Local interface rehearsal | A source-safe local rehearsal verifies docs/routes/interfaces explain the protocol without exposing unpaid source | implemented prerequisite | Gate 7 owns package-backed `V46LocalInterfaceComprehensionRehearsal`, deterministic `.bitcode/v46-local-interface-comprehension-rehearsal.json`, local docs/landing, `/packs`, `/read`, `/deposit`, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, repair readback rows, prior V46 artifact pass checks, source-safe disclosure exclusions, focused tests, package exports, and workflow wiring. | Gate 7 | | Promotion readiness | V46 can promote only after all accepted comprehension, parity, proof, interface, rehearsal, and source-safety gates close | accepted boundary | V45 remains active canon until a future promotion workflow advances the pointer. | Gate 8 | ## V46 Implementation Checklist @@ -83,6 +83,7 @@ source files and generated artifacts that implement or explain each row. | Product route comprehension readback artifact | `/packs`, `/read`, and `/deposit` expose route-specific source-safe readback without collapsing preview, quote, finality, delivery, compensation, or repair claims | implemented prerequisite | `V46ProductRouteComprehensionReadback` binds route rows to claim ids, authority ids, required copy anchors, low-detail defaults, expandable proof readback, route-owned state, no-source/no-secret checks, and `.bitcode/v46-product-route-comprehension-readback.json`. | Gate 4 | | Interface claim contracts artifact | API/MCP, ChatGPT App, Bitcode Chat, and package consumers expose source-safe contracts without parallel state authority | implemented prerequisite | `V46InterfaceClaimContracts` binds public API, MCP API, ChatGPT App, Bitcode Chat, and package-consumer rows to claim ids, category ids, authority ids, capability ids, source roots, proof-root projection, denied-state repair, no-source/no-secret checks, and `.bitcode/v46-interface-claim-contracts.json`. | Gate 5 | | Proof readback operator explanation artifact | Proof, ledger, database, storage, wallet/provider, repository, telemetry, execution, and repair evidence classes remain distinct and source-safe | implemented prerequisite | `V46ProofReadbackOperatorExplanation` binds all evidence class ids to Gate 2 authority ids, required operator questions, stronger evidence requirements, conflict behavior, fail-closed repair states, no-source/no-secret checks, and `.bitcode/v46-proof-readback-operator-explanation.json`. | Gate 6 | +| Local interface comprehension rehearsal artifact | Local docs, product routes, machine interfaces, conversation surfaces, proof telemetry, and repair readback rehearse V46 comprehension without external state authority | implemented prerequisite | `V46LocalInterfaceComprehensionRehearsal` binds local surface ids to Gate 2 claim ids, claim categories, authority ids, source roots, copy anchors, prior V46 artifact pass checks, no-source/no-secret checks, and `.bitcode/v46-local-interface-comprehension-rehearsal.json`. | Gate 7 | ## Grouped Closure Gates @@ -115,12 +116,15 @@ more maintainable closure order. ## Current completion condition -V46 Gate 6 is complete when `V46ProofReadbackOperatorExplanation`, -`.bitcode/v46-proof-readback-operator-explanation.json`, proof/ledger/database/ -storage/wallet/provider/repository/telemetry/execution/repair evidence -authority anchors, package exports, workflow checks, focused tests, and -`check:v46-gate6` validate active V45 plus draft V46 and the gate branch is -committed, pushed, and pull-requested into `version/v46`. +V46 Gate 7 is complete when `V46LocalInterfaceComprehensionRehearsal`, +`.bitcode/v46-local-interface-comprehension-rehearsal.json`, docs/landing, +`/packs`, `/read`, `/deposit`, API/MCP, ChatGPT App, Bitcode Chat, proof +telemetry, repair readback rows, prior V46 artifact pass checks, package +exports, workflow checks, focused tests, and `check:v46-gate7` validate active +V45 plus draft V46 and the gate branch is committed, pushed, and pull-requested +into `version/v46`. + +Historical Gate 6 completion condition: V46 Gate 6 is complete when `V46ProofReadbackOperatorExplanation`, `.bitcode/v46-proof-readback-operator-explanation.json`, proof/ledger/database/storage/wallet/provider/repository/telemetry/execution/repair evidence authority anchors, package exports, workflow checks, focused tests, and `check:v46-gate6` validate active V45 plus draft V46 and the gate branch is committed, pushed, and pull-requested into `version/v46`. Historical Gate 5 completion condition: V46 Gate 5 is complete when `V46InterfaceClaimContracts`, `.bitcode/v46-interface-claim-contracts.json`, public API, MCP API, ChatGPT App, Bitcode Chat, and package-consumer claim contract anchors, package exports, workflow checks, focused tests, and `check:v46-gate5` validate active V45 plus draft V46 and the gate branch is committed, pushed, and pull-requested into `version/v46`. diff --git a/README.md b/README.md index 6cc0fd70d..a2ed57bb8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,17 @@ database projections, object-storage roots, telemetry streams, wallet/provider receipts, repository delivery receipts, and repair reconciliation receipts into a source-safe operator authority ladder. +V46 Gate 7 adds `V46LocalInterfaceComprehensionRehearsal` through +`packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js`, +`.bitcode/v46-local-interface-comprehension-rehearsal.json`, +`generate:v46-local-interface-comprehension-rehearsal`, +`check:v46-local-interface-comprehension-rehearsal`, and `check:v46-gate7`. +It rehearses local docs/landing, `/packs`, `/read`, `/deposit`, API/MCP, +ChatGPT App, Bitcode Chat, proof telemetry, and repair readback against the +V46 claim and authority artifacts without exposing protected source, unpaid +AssetPack source, prompts, provider responses, credentials, wallet private +material, private settlement payloads, or value-bearing mainnet behavior. + V41 Gate 1 opens the prompts-as-programs specification family over active V40 with `check:v41-gate1`. V41 will catalogue every raw PromptPart and composed Prompt, map registry composition and interpolation contracts, benchmark Reading diff --git a/SPECIFICATIONS_ROADMAP.md b/SPECIFICATIONS_ROADMAP.md index 05568aec1..c72959e83 100644 --- a/SPECIFICATIONS_ROADMAP.md +++ b/SPECIFICATIONS_ROADMAP.md @@ -5,9 +5,9 @@ - Current active canonical pointer: `BITCODE_SPEC.txt` -> `V45` - Current active canon: `BITCODE_SPEC_V45.md` - Current draft target: `BITCODE_SPEC_V46.md` -- Current working gate: V46 Gate 6 Proof Readback And Source-Safe Operator Explanation. -- Next queued work after V46 Gate 6: V46 Gate 7 Local Interface Comprehension Rehearsal. -- Latest closed gate: V46 Gate 5 API/MCP, ChatGPT App, And Bitcode Chat Claim Contracts, which added `V46InterfaceClaimContracts`, `.bitcode/v46-interface-claim-contracts.json`, public API, MCP API, ChatGPT App, Bitcode Chat, package-consumer claim contracts, proof-root projection, denied-state repair, package exports, focused tests, workflow wiring, and `check:v46-gate5`. +- Current working gate: V46 Gate 7 Local Interface Comprehension Rehearsal. +- Next queued work after V46 Gate 7: V46 Gate 8 Promotion Readiness And Canonical Promotion. +- Latest closed gate: V46 Gate 6 Proof Readback And Source-Safe Operator Explanation, which added `V46ProofReadbackOperatorExplanation`, `.bitcode/v46-proof-readback-operator-explanation.json`, proof/ledger/database/storage/wallet/provider/repository/telemetry/execution/repair evidence authority anchors, package exports, focused tests, workflow wiring, and `check:v46-gate6`. - V45 Gate 19 closure anchor: promoted V45 spec-family checks, canonical-input checks, canon-posture drift checks, promoted-stale-posture tests, generated artifact freshness checks, `check:v45-gate19`, and diff hygiene passed before merge to `main`. - V46 Gate 1 closure target: open the V46 draft family over active V45, name commercial protocol comprehension as the V46 focus, list provisional V46 gates, expose `check:v46-gate1`, and wire CI to validate active V45 plus draft V46 without claiming V46 promotion. - V46 Gate 1 closure anchor: Gate 1 is closed when V46 SPEC, DELTA, NOTES, and PARITY files validate in draft mode, this roadmap lists V46 as active draft target, V45 remains the active pointer, CI runs draft V46 checks when V46 files exist, `check:v46-gate1` passes, and the gate branch is committed, pushed, and pull-requested into `version/v46`. @@ -21,6 +21,8 @@ - V46 Gate 5 closure anchor: Gate 5 is closed when public API schema compatibility, MCP tool registry contracts, ChatGPT App action contracts, Bitcode Chat conversation/stream/handoff contracts, and package-consumer read contracts are bound to Gate 2 claim ids, source-safe fields, proof roots, denied states, no-source/no-secret exclusions, generated metadata freshness, package exports, focused protocol tests, gate/canon workflow wiring, and the gate branch is committed, pushed, and pull-requested into `version/v46`. - V46 Gate 6 closure target: add package-backed `V46ProofReadbackOperatorExplanation`, deterministic `.bitcode/v46-proof-readback-operator-explanation.json`, canonical/generated proof, execution/workflow receipt, ledger journal, database projection, object-storage root, telemetry stream, wallet/provider receipt, repository delivery receipt, and repair/reconciliation receipt rows, source-safe operator explanation, workflow wiring, focused tests, and `check:v46-gate6` while preserving `BITCODE_SPEC.txt` -> `V45`. - V46 Gate 6 closure anchor: Gate 6 is closed when evidence authority classes are bound to Gate 2 authority ids and claim ids, required operator questions, stronger evidence requirements, conflict behavior, fail-closed repair states, no-source/no-secret exclusions, generated metadata freshness, package exports, focused protocol tests, gate/canon workflow wiring, and the gate branch is committed, pushed, and pull-requested into `version/v46`. +- V46 Gate 7 closure target: add package-backed `V46LocalInterfaceComprehensionRehearsal`, deterministic `.bitcode/v46-local-interface-comprehension-rehearsal.json`, local docs/landing, `/packs`, `/read`, `/deposit`, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, and repair readback rehearsal rows, workflow wiring, focused tests, and `check:v46-gate7` while preserving `BITCODE_SPEC.txt` -> `V45`. +- V46 Gate 7 closure anchor: Gate 7 is closed when all Gate 2 through Gate 6 artifacts pass, local interface surfaces rehearse their source-safe claims and evidence authority without source/secret leakage, denied repair states remain fail-closed, generated metadata is fresh, package exports, focused protocol tests, gate/canon workflow wiring, and the gate branch is committed, pushed, and pull-requested into `version/v46`. - V45 Gate 18 closure anchor: promotion readiness closed with a source-safe artifact, `BITCODE_SPEC_V45_PROVEN.md`, V45 promotion workflow, promotion dry-run, gate/canon workflow posture, package exports, tests, docs, and `check:v45-gate18` current and green. - Latest closed version: V43 Route Product Cleanup, which promoted `/packs`, `/read`, and `/deposit`; PackActivity master-detail; five-step Reading route UX; deposit AssetPack option synthesis; deposit criticality/ROI/compensation policy; option admission; product route UX; cross-route rehearsal; and V43 promotion readiness. - Recent V43 canonical promotion anchor: V43 canonical promotion updated `BITCODE_SPEC.txt` to `V43`, generated `BITCODE_SPEC_V43_PROVEN.md`, preserved active V43 / draft V44 runtime posture, and closed route-product cleanup canon. diff --git a/package.json b/package.json index 2e8ac8e3b..d38cc0d6f 100644 --- a/package.json +++ b/package.json @@ -428,6 +428,9 @@ "generate:v46-proof-readback-operator-explanation": "node scripts/generate-v46-proof-readback-operator-explanation.mjs", "check:v46-proof-readback-operator-explanation": "node scripts/generate-v46-proof-readback-operator-explanation.mjs --check", "check:v46-gate6": "node scripts/check-v46-gate6-proof-readback-operator-explanation.mjs", + "generate:v46-local-interface-comprehension-rehearsal": "node scripts/generate-v46-local-interface-comprehension-rehearsal.mjs", + "check:v46-local-interface-comprehension-rehearsal": "node scripts/generate-v46-local-interface-comprehension-rehearsal.mjs --check", + "check:v46-gate7": "node scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs", "generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs", "check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check", "check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs", diff --git a/packages/protocol/README.md b/packages/protocol/README.md index 1e666cbee..a7f3526d0 100644 --- a/packages/protocol/README.md +++ b/packages/protocol/README.md @@ -68,6 +68,7 @@ Current exported commercial helpers include: - `V46PublicOperatorClaimBoundaries` helpers for V46 source-safe public/operator claim boundary metadata across public docs, landing, operator docs, README surfaces, workflow checks, and forbidden overclaim scans; - `V46ProductRouteComprehensionReadback` helpers for V46 source-safe `/packs`, `/read`, and `/deposit` route comprehension metadata, low-detail defaults, expandable proof readback, route-owned state, and forbidden product-route overclaim scans; - `V46InterfaceClaimContracts` helpers for V46 source-safe API/MCP, ChatGPT App, Bitcode Chat, and package-consumer claim contracts, proof-root projection, denied-state repair, no parallel state authority, and forbidden interface overclaim scans; +- `V46LocalInterfaceComprehensionRehearsal` helpers for V46 source-safe local docs, route, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, and repair readback rehearsal metadata over prior V46 claim and authority artifacts; - canonical proven-generation helpers; - the package app/server context used by commercial interfaces. @@ -390,6 +391,17 @@ wallet/provider receipts, repository delivery receipts, and repair reconciliation receipts without creating parallel state authority or exposing private payloads. +V46 Gate 7 adds `V46LocalInterfaceComprehensionRehearsal` through +`packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js`, +`packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js`, +`.bitcode/v46-local-interface-comprehension-rehearsal.json`, +`generate:v46-local-interface-comprehension-rehearsal`, +`check:v46-local-interface-comprehension-rehearsal`, and `check:v46-gate7`. +It rehearses local docs/landing, `/packs`, `/read`, `/deposit`, API/MCP, +ChatGPT App, Bitcode Chat, proof telemetry, and repair readback against Gate 2 +through Gate 6 generated artifacts while remaining local-only and +source-safe. + Historical V39 promotion moved this package through the `V39` active, `V40` draft posture. V40 promotion has since advanced the current package posture to `V40` active, `V41` draft. diff --git a/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js b/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js new file mode 100644 index 000000000..99ee90036 --- /dev/null +++ b/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js @@ -0,0 +1,657 @@ +// @ts-check + +import crypto from 'node:crypto'; +import { existsSync, readFileSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import { + V46_PROTOCOL_CLAIM_AUTHORITY_IDS, + V46_PROTOCOL_CLAIM_CATEGORY_IDS, + V46_PROTOCOL_CLAIM_ROWS, + V46_PROTOCOL_PRIVATE_PAYLOAD_IDS, + V46_PROTOCOL_SOURCE_SAFE_FIELD_IDS, +} from './v46-protocol-comprehension-object-model.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const DEFAULT_REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..'); + +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH = + '.bitcode/v46-local-interface-comprehension-rehearsal.json'; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID = + 'bitcode.v46.localInterfaceComprehensionRehearsal.v1'; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_VERSION = 'V46'; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_CURRENT_TARGET = 'V45'; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT = + 'source-safe-local-interface-comprehension-rehearsal'; + +export const V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS = Object.freeze([ + 'docs_landing', + 'packs_route', + 'read_route', + 'deposit_route', + 'api_mcp', + 'chatgpt_bitcode_chat', + 'proof_telemetry_repair', +]); + +export const V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS = Object.freeze([ + 'load-local-source', + 'identify-interface-claims', + 'verify-source-safe-disclosure', + 'verify-evidence-authority', + 'verify-denied-state-repair', + 'emit-source-safe-rehearsal-root', +]); + +export const V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS = Object.freeze([ + 'v46-protocol-comprehension-object-model', + 'v46-public-operator-claim-boundaries', + 'v46-product-route-comprehension-readback', + 'v46-interface-claim-contracts', + 'v46-proof-readback-operator-explanation', +]); + +const SOURCE_PATHS = Object.freeze({ + activePointer: 'BITCODE_SPEC.txt', + spec: 'BITCODE_SPEC_V46.md', + delta: 'BITCODE_SPEC_V46_DELTA.md', + notes: 'BITCODE_SPEC_V46_NOTES.md', + parity: 'BITCODE_SPEC_V46_PARITY_MATRIX.md', + roadmap: 'SPECIFICATIONS_ROADMAP.md', + readme: 'README.md', + protocolReadme: 'packages/protocol/README.md', + packageJson: 'package.json', + packageIndex: 'packages/protocol/src/index.js', + packageTypes: 'packages/protocol/src/index.d.ts', + packageSource: 'packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js', + packageTest: 'packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js', + generator: 'scripts/generate-v46-local-interface-comprehension-rehearsal.mjs', + checker: 'scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs', + gateWorkflow: '.github/workflows/bitcode-gate-quality.yml', + canonWorkflow: '.github/workflows/bitcode-canon-quality.yml', + v46ProtocolArtifact: '.bitcode/v46-protocol-comprehension-object-model.json', + v46PublicArtifact: '.bitcode/v46-public-operator-claim-boundaries.json', + v46ProductArtifact: '.bitcode/v46-product-route-comprehension-readback.json', + v46InterfaceArtifact: '.bitcode/v46-interface-claim-contracts.json', + v46ProofArtifact: '.bitcode/v46-proof-readback-operator-explanation.json', + landingPage: 'uapi/app/page.tsx', + docsPage: 'uapi/app/docs/page.tsx', + docsContent: 'uapi/app/(root)/components/PublicDocsPageContent.tsx', + packsPage: 'uapi/app/packs/page.tsx', + packsClient: 'uapi/app/packs/PacksPageClient.tsx', + packActivityModel: 'uapi/components/base/bitcode/activity/pack-activity-model.ts', + readPage: 'uapi/app/read/page.tsx', + readClient: 'uapi/app/read/ReadPageClient.tsx', + depositPage: 'uapi/app/deposit/page.tsx', + depositClient: 'uapi/app/deposit/DepositPageClient.tsx', + btdApiSchema: 'packages/btd/src/api-schema-compatibility-matrix.ts', + btdMcpContract: 'packages/btd/src/mcp-tool-contract.ts', + mcpDocsReference: 'packages/executions-mcp/src/mcp-server/docs/mcp/mcp-api-reference.md', + btdChatGptContract: 'packages/btd/src/chatgpt-app-action-contract.ts', + chatGptTools: 'packages/chatgptapp/src/tools.ts', + conversationHandoff: 'uapi/app/conversations/conversation-terminal-handoff.ts', + conversationTelemetry: 'uapi/app/conversations/conversation-telemetry-proof-hooks.ts', + conversationParityTest: 'uapi/tests/api/conversationReadingInterfaceParity.test.ts', + pipelineLogUi: 'uapi/components/base/bitcode/execution/pipeline-execution-log.tsx', + v39OperationalTelemetryReadback: + 'packages/protocol/src/canonical/v39-operational-telemetry-repair-readback.js', + uapiLedgerStorageSync: 'uapi/app/bitcode-ledger-storage-sync.ts', +}); + +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_ROOTS = Object.freeze({ + ...SOURCE_PATHS, +}); + +const SECRET_MARKERS = Object.freeze([ + `${['sk', 'proj'].join('-')}-`, + `${['sb', 'secret'].join('_')}__`, + ['service', 'role'].join('_'), + ['eyJ', 'hbGciOiJI', 'UzI1NiIsInR5cCI6IkpXVCJ9'].join(''), + ['SUPABASE', 'SERVICE', 'ROLE'].join('_'), + ['OPENAI', 'API', 'KEY'].join('_'), + ['VERCEL', 'TOKEN'].join('_'), + ['VERCEL', 'OIDC', 'TOKEN'].join('_'), + ['PRIVATE', 'KEY'].join('_'), +]); + +const FORBIDDEN_REHEARSAL_PHRASES = Object.freeze([ + 'preview discloses source', + 'quote is payment', + 'payment observation is finality', + 'database is ledger truth', + 'telemetry advances state', + 'conversation advances state', + 'ChatGPT App advances state', + 'MCP advances state', + 'proof roots reveal source', + 'value-bearing mainnet operation is live', +]); + +function digest(value) { + return crypto.createHash('sha256').update(String(value)).digest('hex').slice(0, 24); +} + +function root(prefix, value) { + return `${prefix}:${digest(typeof value === 'string' ? value : JSON.stringify(value))}`; +} + +function readSource(repoRoot, sourcePath) { + const absolutePath = path.join(repoRoot, sourcePath); + return existsSync(absolutePath) ? readFileSync(absolutePath, 'utf8') : ''; +} + +function sourceExists(repoRoot, sourcePath) { + return existsSync(path.join(repoRoot, sourcePath)); +} + +function sourceRoot(repoRoot, sourcePath) { + return `${sourcePath}:${digest(readSource(repoRoot, sourcePath))}`; +} + +function predicateResult(id, sourcePath, passed) { + return { id, sourcePath, passed: Boolean(passed) }; +} + +function artifactPassed(repoRoot, sourcePath, artifactId) { + const text = readSource(repoRoot, sourcePath); + if (!text) return false; + try { + const parsed = JSON.parse(text); + return parsed.artifactId === artifactId && parsed.passed === true; + } catch { + return false; + } +} + +function scanSourcesForMarkers(repoRoot, sourcePaths, markers) { + const joined = sourcePaths.map((sourcePath) => readSource(repoRoot, sourcePath)).join('\n'); + return markers.filter((marker) => marker && joined.includes(marker)); +} + +function claimExists(claimId) { + return V46_PROTOCOL_CLAIM_ROWS.some((row) => row.claimId === claimId); +} + +function categoryExists(categoryId) { + return V46_PROTOCOL_CLAIM_CATEGORY_IDS.includes(categoryId); +} + +function authorityExists(authorityId) { + return V46_PROTOCOL_CLAIM_AUTHORITY_IDS.includes(authorityId); +} + +function requiredTokensPresent(repoRoot, row) { + const joined = row.sourcePaths.map((sourcePath) => readSource(repoRoot, sourcePath)).join('\n'); + return row.requiredCopyTokens.every((token) => joined.includes(token)); +} + +function rehearsalRow({ + surfaceId, + surfaceLabel, + sourcePaths, + claimIds, + claimCategoryIds, + authorityIds, + requiredCopyTokens, + expectedReadback, + repairExpectation, +}) { + return { + surfaceId, + surfaceLabel, + sourcePaths, + claimIds, + claimCategoryIds, + authorityIds, + stepIds: [...V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS], + requiredCopyTokens, + expectedReadback, + repairExpectation, + localOnly: true, + sourceSafeMetadataOnly: true, + protectedSourceVisible: false, + unpaidAssetPackSourceVisible: false, + rawPromptVisible: false, + interpolatedPromptVisible: false, + rawProviderResponseVisible: false, + credentialsSerialized: false, + walletPrivateMaterialVisible: false, + settlementPrivatePayloadVisible: false, + valueBearingMainnetAdmitted: false, + noParallelStateAuthority: true, + stateAdvanceRequiresProofRoot: true, + sourceSafeFieldIds: [...V46_PROTOCOL_SOURCE_SAFE_FIELD_IDS], + privatePayloadIdsNeverSerialized: [...V46_PROTOCOL_PRIVATE_PAYLOAD_IDS], + rowRoot: root('v46-local-interface-rehearsal-row', { surfaceId, claimIds, authorityIds }), + }; +} + +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS = Object.freeze([ + rehearsalRow({ + surfaceId: 'docs_landing', + surfaceLabel: 'Public Docs And Landing', + sourcePaths: [SOURCE_PATHS.landingPage, SOURCE_PATHS.docsPage, SOURCE_PATHS.docsContent], + claimIds: [ + 'assetpack-is-commodity', + 'btd-is-weighted-scalar-volume-and-settled-rights', + 'operator-evidence-is-source-safe-readback', + ], + claimCategoryIds: ['protocol-law', 'product-guidance', 'operator-evidence'], + authorityIds: ['canonical-specification', 'generated-proof', 'interface-guidance-only'], + requiredCopyTokens: [ + 'Bitcode public home for AssetPacks', + 'Learn Bitcode from AssetPacks to proof.', + 'Public docs explain; proof readback decides.', + ], + expectedReadback: + 'The local public route and docs route explain AssetPacks, BTD scalar volume and rights, BTC settlement, proof readback, and interface boundaries without live state authority.', + repairExpectation: + 'If public copy overclaims state authority, route copy returns to source-safe explanation and proof readback remains decisive.', + }), + rehearsalRow({ + surfaceId: 'packs_route', + surfaceLabel: '/packs', + sourcePaths: [SOURCE_PATHS.packsPage, SOURCE_PATHS.packsClient, SOURCE_PATHS.packActivityModel], + claimIds: [ + 'operator-evidence-is-source-safe-readback', + 'preview-is-source-safe-measurement', + 'repair-fails-closed', + 'telemetry-is-observability-only', + ], + claimCategoryIds: ['product-guidance', 'operator-evidence', 'preview-claim', 'repair-claim'], + authorityIds: ['canonical-specification', 'database-projection', 'generated-proof', 'interface-guidance-only'], + requiredCopyTokens: [ + 'Search pack activity', + 'Search titles, measurements, values, proof roots', + 'assertPackActivitySourceSafe', + 'unpaidAssetPackSourceVisible: false', + ], + expectedReadback: + '/packs rehearses searchable PackActivity master-detail readback with source-safe measurements, values, proof roots, settlement, delivery, compensation, and repair state.', + repairExpectation: + 'If PackActivity source-safety assertion fails, the route must hold the row in repair instead of projecting source-bearing detail.', + }), + rehearsalRow({ + surfaceId: 'read_route', + surfaceLabel: '/read', + sourcePaths: [SOURCE_PATHS.readPage, SOURCE_PATHS.readClient], + claimIds: [ + 'operator-evidence-is-source-safe-readback', + 'preview-is-source-safe-measurement', + 'quote-is-source-safe-offer', + 'finality-authorizes-rights-and-delivery', + ], + claimCategoryIds: ['product-guidance', 'preview-claim', 'quote-claim', 'settlement-claim', 'rights-claim'], + authorityIds: ['canonical-specification', 'generated-proof', 'interface-guidance-only', 'ledger-readback'], + requiredCopyTokens: [ + 'Request Reading, review synthesized Needs', + 'Read request -> Need -> Finding Fits -> Preview -> Settlement.', + 'Visible: Need measurements, fit ids, proof roots, fee quotes', + 'Withheld until paid', + ], + expectedReadback: + '/read rehearses the five-step Reading path from request through Need review, Finding Fits, source-safe preview, quote, settlement, BTD rights, and delivery boundary.', + repairExpectation: + 'If Need, quote, finality, or delivery proof is missing, the route keeps the Reader at the narrowest source-safe step.', + }), + rehearsalRow({ + surfaceId: 'deposit_route', + surfaceLabel: '/deposit', + sourcePaths: [SOURCE_PATHS.depositPage, SOURCE_PATHS.depositClient], + claimIds: [ + 'deposit-option-is-potential-supply', + 'assetpack-is-commodity', + 'operator-evidence-is-source-safe-readback', + 'compensation-follows-source-to-shares', + ], + claimCategoryIds: ['product-guidance', 'protocol-law', 'operator-evidence', 'compensation-claim'], + authorityIds: ['canonical-specification', 'generated-proof', 'database-projection', 'interface-guidance-only'], + requiredCopyTokens: [ + 'source-safe AssetPack deposit options', + 'Source-safe AssetPack proposals', + 'Criticality, demand, ROI, BTD potential, compensation.', + 'Withheld: raw source, unpaid AssetPack source', + ], + expectedReadback: + '/deposit rehearses source-safe deposit option synthesis, review, policy, admission, BTD potential, and compensation posture without final Need-relative BTD claims.', + repairExpectation: + 'If source criticality, ROI, or admission evidence is unsafe or missing, the route blocks Depository admission and keeps raw source withheld.', + }), + rehearsalRow({ + surfaceId: 'api_mcp', + surfaceLabel: 'API And MCP', + sourcePaths: [SOURCE_PATHS.btdApiSchema, SOURCE_PATHS.btdMcpContract, SOURCE_PATHS.mcpDocsReference], + claimIds: [ + 'operator-evidence-is-source-safe-readback', + 'preview-is-source-safe-measurement', + 'finality-authorizes-rights-and-delivery', + 'repair-fails-closed', + ], + claimCategoryIds: ['product-guidance', 'operator-evidence', 'preview-claim', 'rights-claim', 'repair-claim'], + authorityIds: ['canonical-specification', 'generated-proof', 'interface-guidance-only'], + requiredCopyTokens: [ + 'BTD_API_SCHEMA_COMPATIBILITY_CONSUMER_SURFACES', + 'bitcode://pipelines/asset-pack/create', + 'protected-source-locked', + 'MCP API Reference', + ], + expectedReadback: + 'API and MCP rehearse versionless source-safe request/response contracts, proof-root projection, protected-source locks, and denied-state repair.', + repairExpectation: + 'If schema, permission, provider binding, or protected-source lock evidence is missing, machine interfaces deny writes and emit repair state.', + }), + rehearsalRow({ + surfaceId: 'chatgpt_bitcode_chat', + surfaceLabel: 'ChatGPT App And Bitcode Chat', + sourcePaths: [ + SOURCE_PATHS.btdChatGptContract, + SOURCE_PATHS.chatGptTools, + SOURCE_PATHS.conversationHandoff, + SOURCE_PATHS.conversationTelemetry, + SOURCE_PATHS.conversationParityTest, + ], + claimIds: [ + 'preview-is-source-safe-measurement', + 'payment-observation-is-not-finality', + 'delivery-is-entitled-source-unlock', + 'telemetry-is-observability-only', + ], + claimCategoryIds: ['product-guidance', 'preview-claim', 'settlement-claim', 'delivery-claim', 'telemetry-observability'], + authorityIds: ['canonical-specification', 'generated-proof', 'telemetry-observability-only', 'interface-guidance-only'], + requiredCopyTokens: [ + 'BTD_CHATGPT_APP_ACTION_CONTRACT_IDS', + 'bitcode_request_read', + 'terminal-delegated-handoff', + 'source_safe_conversation_telemetry_metadata', + 'source_bearing_delivery_locked_until_settlement_and_rights', + ], + expectedReadback: + 'ChatGPT App and Bitcode Chat rehearse guided Reading actions, source-safe response rendering, delegated handoff, telemetry proof roots, and delivery lock boundaries.', + repairExpectation: + 'If conversational state conflicts with route/proof state, conversation remains guidance-only and hands off to product proof readback.', + }), + rehearsalRow({ + surfaceId: 'proof_telemetry_repair', + surfaceLabel: 'Proof, Telemetry, And Repair Readback', + sourcePaths: [ + SOURCE_PATHS.pipelineLogUi, + SOURCE_PATHS.v39OperationalTelemetryReadback, + SOURCE_PATHS.uapiLedgerStorageSync, + SOURCE_PATHS.v46ProofArtifact, + ], + claimIds: [ + 'operator-evidence-is-source-safe-readback', + 'telemetry-is-observability-only', + 'repair-fails-closed', + 'payment-observation-is-not-finality', + ], + claimCategoryIds: ['operator-evidence', 'telemetry-observability', 'repair-claim', 'settlement-claim'], + authorityIds: [ + 'generated-proof', + 'telemetry-observability-only', + 'database-projection', + 'ledger-readback', + 'interface-guidance-only', + ], + requiredCopyTokens: [ + 'promptDisclosurePosture', + 'source_safe_reading_operational_telemetry_repair_readback_metadata', + 'BITCODE_LEDGER_STORAGE_SYNC_CONTRACT', + 'v46-proof-readback-operator-explanation', + ], + expectedReadback: + 'Proof, telemetry, and repair rehearsal confirms local stream UI can show phases, steps, proof roots, disclosure posture, and metadata while preserving evidence authority hierarchy.', + repairExpectation: + 'If telemetry, database projection, ledger, storage, wallet, or delivery evidence disagree, repair fails closed and telemetry stays observability only.', + }), +]); + +function buildPredicateResults(repoRoot) { + const sources = Object.fromEntries( + Object.entries(SOURCE_PATHS).map(([key, sourcePath]) => [key, readSource(repoRoot, sourcePath)]), + ); + + return [ + predicateResult('active-pointer-remains-v45', SOURCE_PATHS.activePointer, sources.activePointer.trim() === 'V45'), + predicateResult( + 'spec-defines-gate7-law', + SOURCE_PATHS.spec, + sources.spec.includes('V46 local interface comprehension rehearsal law') && + sources.spec.includes(V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH), + ), + predicateResult( + 'delta-records-gate7', + SOURCE_PATHS.delta, + sources.delta.includes('Gate 7: Local Interface Comprehension Rehearsal') && + sources.delta.includes(V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH), + ), + predicateResult( + 'notes-records-gate7', + SOURCE_PATHS.notes, + sources.notes.includes('V46 local interface comprehension rehearsal atom') && + sources.notes.includes('local surface readback rehearsal'), + ), + predicateResult( + 'parity-records-gate7', + SOURCE_PATHS.parity, + sources.parity.includes('V46LocalInterfaceComprehensionRehearsal') && + sources.parity.includes(V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH), + ), + predicateResult( + 'roadmap-advanced-to-gate7', + SOURCE_PATHS.roadmap, + sources.roadmap.includes('Current working gate: V46 Gate 7 Local Interface Comprehension Rehearsal') && + sources.roadmap.includes('V46 Gate 6 closure anchor'), + ), + predicateResult( + 'readmes-document-gate7', + SOURCE_PATHS.readme, + sources.readme.includes('V46 Gate 7') && sources.protocolReadme.includes('V46LocalInterfaceComprehensionRehearsal'), + ), + predicateResult( + 'prior-v46-artifacts-pass', + SOURCE_PATHS.v46ProtocolArtifact, + V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS.every((artifactId) => { + const sourcePath = + artifactId === 'v46-protocol-comprehension-object-model' + ? SOURCE_PATHS.v46ProtocolArtifact + : artifactId === 'v46-public-operator-claim-boundaries' + ? SOURCE_PATHS.v46PublicArtifact + : artifactId === 'v46-product-route-comprehension-readback' + ? SOURCE_PATHS.v46ProductArtifact + : artifactId === 'v46-interface-claim-contracts' + ? SOURCE_PATHS.v46InterfaceArtifact + : SOURCE_PATHS.v46ProofArtifact; + return artifactPassed(repoRoot, sourcePath, artifactId); + }), + ), + predicateResult( + 'package-exports-gate7', + SOURCE_PATHS.packageIndex, + sources.packageIndex.includes('v46-local-interface-comprehension-rehearsal.js') && + sources.packageTypes.includes('V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH'), + ), + predicateResult( + 'package-test-covers-gate7', + SOURCE_PATHS.packageTest, + sources.packageTest.includes('V46 local interface comprehension rehearsal') && + sources.packageTest.includes('chatgpt_bitcode_chat'), + ), + predicateResult( + 'generator-and-checker-exist', + SOURCE_PATHS.generator, + sources.generator.includes('buildV46LocalInterfaceComprehensionRehearsal') && + sources.checker.includes('V46 Gate 7 local interface comprehension rehearsal check'), + ), + predicateResult( + 'package-json-scripts', + SOURCE_PATHS.packageJson, + sources.packageJson.includes('generate:v46-local-interface-comprehension-rehearsal') && + sources.packageJson.includes('check:v46-gate7'), + ), + predicateResult( + 'workflows-run-gate7', + SOURCE_PATHS.gateWorkflow, + sources.gateWorkflow.includes('check-v46-gate7-local-interface-comprehension-rehearsal.mjs') && + sources.canonWorkflow.includes('check-v46-gate7-local-interface-comprehension-rehearsal.mjs'), + ), + ]; +} + +export function buildV46LocalInterfaceComprehensionRehearsal(input = {}) { + const repoRoot = input.repoRoot ? path.resolve(input.repoRoot) : DEFAULT_REPO_ROOT; + const rows = V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS.map((row) => ({ + ...row, + sourceRoots: row.sourcePaths.map((sourcePath) => sourceRoot(repoRoot, sourcePath)), + sourceFilesPresent: row.sourcePaths.every((sourcePath) => sourceExists(repoRoot, sourcePath)), + requiredCopyPresent: requiredTokensPresent(repoRoot, row), + })); + const predicateResults = buildPredicateResults(repoRoot); + const failedPredicateIds = predicateResults.filter((predicate) => !predicate.passed).map((predicate) => predicate.id); + const allClaimIds = rows.flatMap((row) => row.claimIds); + const allCategoryIds = rows.flatMap((row) => row.claimCategoryIds); + const allAuthorityIds = rows.flatMap((row) => row.authorityIds); + const rowsMissingRequiredCopy = rows.filter((row) => !row.requiredCopyPresent).map((row) => row.surfaceId); + const rowsMissingSourceFiles = rows.filter((row) => !row.sourceFilesPresent).map((row) => row.surfaceId); + const sourcePathsToScan = [ + SOURCE_PATHS.spec, + SOURCE_PATHS.delta, + SOURCE_PATHS.notes, + SOURCE_PATHS.parity, + SOURCE_PATHS.roadmap, + SOURCE_PATHS.readme, + SOURCE_PATHS.protocolReadme, + SOURCE_PATHS.packageTest, + SOURCE_PATHS.generator, + SOURCE_PATHS.checker, + ]; + const forbiddenPhraseHits = scanSourcesForMarkers(repoRoot, sourcePathsToScan, FORBIDDEN_REHEARSAL_PHRASES); + const secretMarkerHits = scanSourcesForMarkers(repoRoot, sourcePathsToScan, SECRET_MARKERS); + const priorArtifactResults = V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS.map((artifactId) => { + const sourcePath = + artifactId === 'v46-protocol-comprehension-object-model' + ? SOURCE_PATHS.v46ProtocolArtifact + : artifactId === 'v46-public-operator-claim-boundaries' + ? SOURCE_PATHS.v46PublicArtifact + : artifactId === 'v46-product-route-comprehension-readback' + ? SOURCE_PATHS.v46ProductArtifact + : artifactId === 'v46-interface-claim-contracts' + ? SOURCE_PATHS.v46InterfaceArtifact + : SOURCE_PATHS.v46ProofArtifact; + return { + artifactId, + sourcePath, + passed: artifactPassed(repoRoot, sourcePath, artifactId), + sourceRoot: sourceRoot(repoRoot, sourcePath), + }; + }); + + const coverage = { + predicateCount: predicateResults.length, + failedPredicateIds, + surfaceCount: rows.length, + stepCount: V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS.length, + allSurfacesCovered: V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS.every((id) => + rows.some((row) => row.surfaceId === id), + ), + allStepsCovered: rows.every((row) => + V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS.every((id) => row.stepIds.includes(id)), + ), + allPriorArtifactsPassed: priorArtifactResults.every((artifact) => artifact.passed), + allClaimIdsKnown: allClaimIds.every(claimExists), + allCategoryIdsKnown: allCategoryIds.every(categoryExists), + allAuthorityIdsKnown: allAuthorityIds.every(authorityExists), + sourceFilesPresent: rows.every((row) => row.sourceFilesPresent), + rowsMissingSourceFiles, + rowsMissingRequiredCopy, + localOnly: rows.every((row) => row.localOnly), + sourceSafeMetadataOnly: rows.every((row) => row.sourceSafeMetadataOnly), + noParallelStateAuthority: rows.every((row) => row.noParallelStateAuthority), + stateAdvanceRequiresProofRoot: rows.every((row) => row.stateAdvanceRequiresProofRoot), + protectedSourceVisible: rows.some((row) => row.protectedSourceVisible), + unpaidAssetPackSourceVisible: rows.some((row) => row.unpaidAssetPackSourceVisible), + rawPromptVisible: rows.some((row) => row.rawPromptVisible), + interpolatedPromptVisible: rows.some((row) => row.interpolatedPromptVisible), + rawProviderResponseVisible: rows.some((row) => row.rawProviderResponseVisible), + credentialsSerialized: rows.some((row) => row.credentialsSerialized), + walletPrivateMaterialVisible: rows.some((row) => row.walletPrivateMaterialVisible), + settlementPrivatePayloadVisible: rows.some((row) => row.settlementPrivatePayloadVisible), + valueBearingMainnetAdmitted: rows.some((row) => row.valueBearingMainnetAdmitted), + forbiddenPhraseHits, + secretMarkerHits, + }; + + const passed = + failedPredicateIds.length === 0 && + coverage.allSurfacesCovered && + coverage.allStepsCovered && + coverage.allPriorArtifactsPassed && + coverage.allClaimIdsKnown && + coverage.allCategoryIdsKnown && + coverage.allAuthorityIdsKnown && + coverage.sourceFilesPresent && + rowsMissingRequiredCopy.length === 0 && + coverage.localOnly && + coverage.sourceSafeMetadataOnly && + coverage.noParallelStateAuthority && + coverage.stateAdvanceRequiresProofRoot && + coverage.protectedSourceVisible === false && + coverage.unpaidAssetPackSourceVisible === false && + coverage.rawPromptVisible === false && + coverage.interpolatedPromptVisible === false && + coverage.rawProviderResponseVisible === false && + coverage.credentialsSerialized === false && + coverage.walletPrivateMaterialVisible === false && + coverage.settlementPrivatePayloadVisible === false && + coverage.valueBearingMainnetAdmitted === false && + forbiddenPhraseHits.length === 0 && + secretMarkerHits.length === 0; + + const sourceRoots = Object.fromEntries( + Object.entries(SOURCE_PATHS).map(([key, sourcePath]) => [key, sourceRoot(repoRoot, sourcePath)]), + ); + const artifactRoot = root('v46-local-interface-comprehension-rehearsal', { + surfaceIds: V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS, + stepIds: V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS, + rows, + predicateResults, + priorArtifactResults, + }); + + return { + artifactId: 'v46-local-interface-comprehension-rehearsal', + schemaId: V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID, + version: V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_VERSION, + currentTarget: V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_CURRENT_TARGET, + sourceSafetyVerdict: V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT, + generatedAt: 'deterministic', + artifactRoot, + rehearsalStatus: passed ? 'completed_source_safe_local' : 'repair_required', + passed, + surfaceIds: [...V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS], + stepIds: [...V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS], + requiredArtifactIds: [...V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS], + rows, + priorArtifactResults, + predicateResults, + sourceRoots, + coverage, + sourceSafety: { + sourceSafetyVerdict: V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT, + sourceSafeMetadataOnly: true, + protectedSourceVisible: false, + unpaidAssetPackSourceVisible: false, + rawPromptVisible: false, + interpolatedPromptVisible: false, + rawProviderResponseVisible: false, + credentialsSerialized: false, + walletPrivateMaterialVisible: false, + settlementPrivatePayloadVisible: false, + valueBearingMainnetAdmitted: false, + sourceSafeFieldIds: [...V46_PROTOCOL_SOURCE_SAFE_FIELD_IDS], + privatePayloadIdsNeverSerialized: [...V46_PROTOCOL_PRIVATE_PAYLOAD_IDS], + }, + }; +} diff --git a/packages/protocol/src/canonical/v46-proof-readback-operator-explanation.js b/packages/protocol/src/canonical/v46-proof-readback-operator-explanation.js index 402915bdc..4823929ab 100644 --- a/packages/protocol/src/canonical/v46-proof-readback-operator-explanation.js +++ b/packages/protocol/src/canonical/v46-proof-readback-operator-explanation.js @@ -457,10 +457,11 @@ function buildPredicateResults(repoRoot) { sources.parity.includes(V46_PROOF_READBACK_OPERATOR_EXPLANATION_ARTIFACT_PATH), ), predicateResult( - 'roadmap-advanced-to-gate6', + 'roadmap-records-gate6-closure', SOURCE_PATHS.roadmap, - sources.roadmap.includes('Current working gate: V46 Gate 6 Proof Readback And Source-Safe Operator Explanation') && - sources.roadmap.includes('V46 Gate 5 closure anchor'), + sources.roadmap.includes('V46 Gate 6 closure anchor') && + sources.roadmap.includes('V46ProofReadbackOperatorExplanation') && + sources.roadmap.includes(V46_PROOF_READBACK_OPERATOR_EXPLANATION_ARTIFACT_PATH), ), predicateResult( 'readmes-document-gate6', diff --git a/packages/protocol/src/index.d.ts b/packages/protocol/src/index.d.ts index a38d7159d..2816e245f 100644 --- a/packages/protocol/src/index.d.ts +++ b/packages/protocol/src/index.d.ts @@ -892,6 +892,17 @@ export const V46_PROOF_READBACK_REQUIRED_OPERATOR_QUESTION_IDS: readonly string[ export const V46_PROOF_READBACK_OPERATOR_DECISION_IDS: readonly string[]; export const V46_PROOF_READBACK_OPERATOR_EXPLANATION_ROWS: readonly Record[]; export function buildV46ProofReadbackOperatorExplanation(input?: Record): BitcodeProtocolReport; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH: string; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_CURRENT_TARGET: string; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID: string; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_VERSION: string; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT: string; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_ROOTS: Readonly>; +export const V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS: readonly string[]; +export const V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS: readonly string[]; +export const V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS: readonly string[]; +export const V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS: readonly Record[]; +export function buildV46LocalInterfaceComprehensionRehearsal(input?: Record): BitcodeProtocolReport; export const EXCHANGE_INTENT_ORDER_CONTRACTS_ARTIFACT_PATH: string; export const EXCHANGE_INTENT_ORDER_CONTRACTS_CURRENT_TARGET: string; export const EXCHANGE_INTENT_ORDER_CONTRACTS_SCHEMA_ID: string; diff --git a/packages/protocol/src/index.js b/packages/protocol/src/index.js index abbea2f94..4d5e6acc0 100644 --- a/packages/protocol/src/index.js +++ b/packages/protocol/src/index.js @@ -1016,6 +1016,19 @@ export { V46_PROOF_READBACK_REQUIRED_OPERATOR_QUESTION_IDS, buildV46ProofReadbackOperatorExplanation } from './canonical/v46-proof-readback-operator-explanation.js'; +export { + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_CURRENT_TARGET, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_ROOTS, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_VERSION, + V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS, + V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS, + V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS, + buildV46LocalInterfaceComprehensionRehearsal +} from './canonical/v46-local-interface-comprehension-rehearsal.js'; export { EXCHANGE_INTENT_ACTION_KINDS, EXCHANGE_INTENT_ORDER_CONTRACTS_ARTIFACT_PATH, diff --git a/packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js b/packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js new file mode 100644 index 000000000..77cc62459 --- /dev/null +++ b/packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js @@ -0,0 +1,78 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; +import { + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID, + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT, + V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS, + V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS, + V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS, + buildV46LocalInterfaceComprehensionRehearsal, +} from '../src/canonical/v46-local-interface-comprehension-rehearsal.js'; + +test('V46 local interface comprehension rehearsal binds every local surface', () => { + const report = buildV46LocalInterfaceComprehensionRehearsal(); + + assert.equal( + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + '.bitcode/v46-local-interface-comprehension-rehearsal.json', + ); + assert.equal(report.artifactId, 'v46-local-interface-comprehension-rehearsal'); + assert.equal(report.schemaId, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SCHEMA_ID); + assert.equal(report.version, 'V46'); + assert.equal(report.currentTarget, 'V45'); + assert.equal(report.sourceSafetyVerdict, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_SOURCE_SAFETY_VERDICT); + assert.deepEqual(report.surfaceIds, [...V46_LOCAL_INTERFACE_REHEARSAL_SURFACE_IDS]); + assert.deepEqual(report.stepIds, [...V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS]); + assert.deepEqual(report.requiredArtifactIds, [...V46_LOCAL_INTERFACE_REHEARSAL_REQUIRED_ARTIFACT_IDS]); + assert.equal(report.rows.length, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ROWS.length); + assert.equal(report.coverage.allSurfacesCovered, true); + assert.equal(report.coverage.allStepsCovered, true); + assert.equal(report.coverage.allPriorArtifactsPassed, true); + assert.equal(report.coverage.allClaimIdsKnown, true); + assert.equal(report.coverage.allCategoryIdsKnown, true); + assert.equal(report.coverage.allAuthorityIdsKnown, true); + assert.equal(report.coverage.sourceFilesPresent, true); + assert.equal(report.coverage.rowsMissingRequiredCopy.length, 0); + assert.equal(report.passed, true); +}); + +test('V46 local interface comprehension rehearsal remains source-safe and local-only', () => { + const report = buildV46LocalInterfaceComprehensionRehearsal(); + + assert.equal(report.coverage.localOnly, true); + assert.equal(report.coverage.sourceSafeMetadataOnly, true); + assert.equal(report.coverage.noParallelStateAuthority, true); + assert.equal(report.coverage.stateAdvanceRequiresProofRoot, true); + assert.equal(report.coverage.protectedSourceVisible, false); + assert.equal(report.coverage.unpaidAssetPackSourceVisible, false); + assert.equal(report.coverage.rawPromptVisible, false); + assert.equal(report.coverage.interpolatedPromptVisible, false); + assert.equal(report.coverage.rawProviderResponseVisible, false); + assert.equal(report.coverage.credentialsSerialized, false); + assert.equal(report.coverage.walletPrivateMaterialVisible, false); + assert.equal(report.coverage.settlementPrivatePayloadVisible, false); + assert.equal(report.coverage.valueBearingMainnetAdmitted, false); + assert.deepEqual(report.coverage.forbiddenPhraseHits, []); + assert.deepEqual(report.coverage.secretMarkerHits, []); +}); + +test('V46 local interface rows rehearse product and machine interfaces distinctly', () => { + const report = buildV46LocalInterfaceComprehensionRehearsal(); + const rowBySurface = new Map(report.rows.map((row) => [row.surfaceId, row])); + + assert.equal(rowBySurface.get('packs_route')?.claimIds.includes('repair-fails-closed'), true); + assert.equal(rowBySurface.get('read_route')?.claimIds.includes('quote-is-source-safe-offer'), true); + assert.equal(rowBySurface.get('deposit_route')?.claimIds.includes('deposit-option-is-potential-supply'), true); + assert.equal(rowBySurface.get('api_mcp')?.authorityIds.includes('interface-guidance-only'), true); + assert.equal(rowBySurface.get('chatgpt_bitcode_chat')?.claimIds.includes('delivery-is-entitled-source-unlock'), true); + assert.equal(rowBySurface.get('proof_telemetry_repair')?.authorityIds.includes('telemetry-observability-only'), true); + + for (const row of report.rows) { + assert.equal(row.localOnly, true); + assert.equal(row.sourceSafeMetadataOnly, true); + assert.ok(row.rowRoot.startsWith('v46-local-interface-rehearsal-row:')); + assert.ok(row.stepIds.length >= V46_LOCAL_INTERFACE_REHEARSAL_STEP_IDS.length); + } +}); diff --git a/scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs b/scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs new file mode 100644 index 000000000..4e58c3130 --- /dev/null +++ b/scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs @@ -0,0 +1,189 @@ +#!/usr/bin/env node + +import { execFileSync } from 'node:child_process'; +import { existsSync, readFileSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + buildV46LocalInterfaceComprehensionRehearsal, +} from '../packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const defaultRepoRoot = path.resolve(__dirname, '..'); + +function read(root, relativePath) { + return readFileSync(path.join(root, relativePath), 'utf8'); +} + +function exists(root, relativePath) { + return existsSync(path.join(root, relativePath)); +} + +function git(root, args) { + return execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim(); +} + +function run(root, command, args) { + execFileSync(command, args, { cwd: root, stdio: 'pipe', encoding: 'utf8' }); +} + +function assertCheck(failures, condition, message) { + if (!condition) failures.push(message); +} + +function parseArgs(argv) { + const args = { repoRoot: defaultRepoRoot, skipBranchCheck: false, skipPackageTests: false }; + for (let index = 0; index < argv.length; index += 1) { + const arg = argv[index]; + if (arg === '--repo-root') args.repoRoot = path.resolve(argv[++index]); + else if (arg === '--skip-branch-check') args.skipBranchCheck = true; + else if (arg === '--skip-package-tests') args.skipPackageTests = true; + else if (arg === '--help' || arg === '-h') args.help = true; + else throw new Error(`Unknown argument ${arg}`); + } + return args; +} + +function printHelp() { + process.stdout.write( + [ + 'Usage: node scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs [--skip-branch-check] [--skip-package-tests] [--repo-root ]', + '', + 'V46 Gate 7 local interface comprehension rehearsal check: validates source-safe local docs, routes, API/MCP, ChatGPT App, Bitcode Chat, proof telemetry, generated artifact freshness, package exports, docs, workflow wiring, and focused protocol tests.', + ].join('\n'), + ); + process.stdout.write('\n'); +} + +function main() { + const args = parseArgs(process.argv.slice(2)); + if (args.help) { + printHelp(); + return; + } + + const root = args.repoRoot; + const failures = []; + const pointer = read(root, 'BITCODE_SPEC.txt').trim(); + + assertCheck(failures, pointer === 'V45', `BITCODE_SPEC.txt must remain V45 during V46 gate work. Observed ${pointer || 'empty'}.`); + + if (!args.skipBranchCheck) { + const branch = git(root, ['branch', '--show-current']); + assertCheck( + failures, + branch === 'version/v46' || /^v46\/gate-\d+-[a-z0-9][a-z0-9-]*$/u.test(branch), + `V46 work must occur on version/v46 or v46/gate-N-* branches. Observed ${branch || 'detached HEAD'}.`, + ); + } + + for (const relativePath of [ + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + 'packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js', + 'packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js', + 'scripts/generate-v46-local-interface-comprehension-rehearsal.mjs', + 'scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs', + 'BITCODE_SPEC_V46.md', + 'BITCODE_SPEC_V46_DELTA.md', + 'BITCODE_SPEC_V46_NOTES.md', + 'BITCODE_SPEC_V46_PARITY_MATRIX.md', + 'SPECIFICATIONS_ROADMAP.md', + 'uapi/app/packs/PacksPageClient.tsx', + 'uapi/app/read/ReadPageClient.tsx', + 'uapi/app/deposit/DepositPageClient.tsx', + 'packages/btd/src/api-schema-compatibility-matrix.ts', + 'packages/btd/src/mcp-tool-contract.ts', + 'packages/btd/src/chatgpt-app-action-contract.ts', + 'uapi/app/conversations/conversation-terminal-handoff.ts', + 'uapi/components/base/bitcode/execution/pipeline-execution-log.tsx', + '.github/workflows/bitcode-gate-quality.yml', + '.github/workflows/bitcode-canon-quality.yml', + 'package.json', + ]) { + assertCheck(failures, exists(root, relativePath), `Missing required V46 Gate 7 file: ${relativePath}`); + } + + const artifact = buildV46LocalInterfaceComprehensionRehearsal({ repoRoot: root }); + assertCheck(failures, artifact.passed, `V46 local interface rehearsal predicates failed: ${artifact.coverage.failedPredicateIds.join(', ')}`); + assertCheck(failures, artifact.coverage.allSurfacesCovered === true, 'All local interface rehearsal surfaces must be covered.'); + assertCheck(failures, artifact.coverage.allStepsCovered === true, 'All rehearsal rows must cover the required local steps.'); + assertCheck(failures, artifact.coverage.allPriorArtifactsPassed === true, 'Gate 7 must rehearse passed V46 Gate 2 through Gate 6 artifacts.'); + assertCheck(failures, artifact.coverage.allClaimIdsKnown === true, 'All local rehearsal claim ids must be known to Gate 2.'); + assertCheck(failures, artifact.coverage.allCategoryIdsKnown === true, 'All local rehearsal claim categories must be known to Gate 2.'); + assertCheck(failures, artifact.coverage.allAuthorityIdsKnown === true, 'All local rehearsal authorities must be known to Gate 2.'); + assertCheck(failures, artifact.coverage.sourceFilesPresent === true, `Missing local rehearsal source files for rows: ${artifact.coverage.rowsMissingSourceFiles.join(', ')}`); + assertCheck(failures, artifact.coverage.rowsMissingRequiredCopy.length === 0, `Missing required local rehearsal copy tokens for rows: ${artifact.coverage.rowsMissingRequiredCopy.join(', ')}`); + assertCheck(failures, artifact.coverage.localOnly === true, 'Gate 7 rehearsal must remain local-only.'); + assertCheck(failures, artifact.coverage.sourceSafeMetadataOnly === true, 'Gate 7 artifact must be source-safe metadata only.'); + assertCheck(failures, artifact.coverage.noParallelStateAuthority === true, 'Gate 7 must not create parallel state authority.'); + assertCheck(failures, artifact.coverage.stateAdvanceRequiresProofRoot === true, 'State advancement must require proof roots.'); + assertCheck(failures, artifact.coverage.protectedSourceVisible === false, 'Gate 7 must not expose protected source.'); + assertCheck(failures, artifact.coverage.unpaidAssetPackSourceVisible === false, 'Gate 7 must not expose unpaid AssetPack source.'); + assertCheck(failures, artifact.coverage.rawPromptVisible === false, 'Gate 7 must not expose raw prompts.'); + assertCheck(failures, artifact.coverage.interpolatedPromptVisible === false, 'Gate 7 must not expose interpolated prompts.'); + assertCheck(failures, artifact.coverage.rawProviderResponseVisible === false, 'Gate 7 must not expose raw provider responses.'); + assertCheck(failures, artifact.coverage.credentialsSerialized === false, 'Gate 7 must not serialize credentials.'); + assertCheck(failures, artifact.coverage.walletPrivateMaterialVisible === false, 'Gate 7 must not expose wallet private material.'); + assertCheck(failures, artifact.coverage.settlementPrivatePayloadVisible === false, 'Gate 7 must not expose private settlement payloads.'); + assertCheck(failures, artifact.coverage.valueBearingMainnetAdmitted === false, 'Gate 7 must not admit value-bearing mainnet operation.'); + assertCheck(failures, artifact.coverage.forbiddenPhraseHits.length === 0, `Forbidden local rehearsal phrases found: ${artifact.coverage.forbiddenPhraseHits.join(', ')}`); + assertCheck(failures, artifact.coverage.secretMarkerHits.length === 0, `Secret markers found in local rehearsal sources: ${artifact.coverage.secretMarkerHits.join(', ')}`); + + const serialized = `${JSON.stringify(artifact, null, 2)}\n`; + assertCheck( + failures, + exists(root, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH) && + read(root, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH) === serialized, + `${V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH} must be generated and current.`, + ); + + const packageJson = read(root, 'package.json'); + const gateWorkflow = read(root, '.github/workflows/bitcode-gate-quality.yml'); + const canonWorkflow = read(root, '.github/workflows/bitcode-canon-quality.yml'); + assertCheck(failures, packageJson.includes('"generate:v46-local-interface-comprehension-rehearsal"'), 'package.json must expose generate:v46-local-interface-comprehension-rehearsal.'); + assertCheck(failures, packageJson.includes('"check:v46-local-interface-comprehension-rehearsal"'), 'package.json must expose check:v46-local-interface-comprehension-rehearsal.'); + assertCheck(failures, packageJson.includes('"check:v46-gate7"'), 'package.json must expose check:v46-gate7.'); + assertCheck(failures, gateWorkflow.includes('check-v46-gate7-local-interface-comprehension-rehearsal.mjs'), 'Gate workflow must run V46 Gate 7 checker.'); + assertCheck(failures, canonWorkflow.includes('check-v46-gate7-local-interface-comprehension-rehearsal.mjs'), 'Canon workflow must run V46 Gate 7 checker.'); + + try { + run(root, 'node', ['scripts/generate-v46-local-interface-comprehension-rehearsal.mjs', '--check']); + } catch { + failures.push('V46 local interface comprehension rehearsal artifact must be fresh.'); + } + + if (!args.skipPackageTests) { + try { + run(root, 'pnpm', [ + '--dir', + 'packages/protocol', + 'exec', + 'node', + '--test', + '--test-force-exit', + 'test/v46-local-interface-comprehension-rehearsal.test.js', + ]); + } catch { + failures.push('packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js must pass.'); + } + } + + if (failures.length > 0) { + process.stderr.write('V46 Gate 7 local interface comprehension rehearsal check failed:\n'); + for (const failure of failures.filter(Boolean)) process.stderr.write(`- ${failure}\n`); + process.exitCode = 1; + return; + } + + process.stdout.write('V46 Gate 7 local interface comprehension rehearsal check passed.\n'); +} + +try { + main(); +} catch (error) { + const detail = error instanceof Error ? error.message : String(error); + process.stderr.write(`${detail}\n`); + process.exitCode = 1; +} diff --git a/scripts/generate-v46-local-interface-comprehension-rehearsal.mjs b/scripts/generate-v46-local-interface-comprehension-rehearsal.mjs new file mode 100644 index 000000000..8b545a793 --- /dev/null +++ b/scripts/generate-v46-local-interface-comprehension-rehearsal.mjs @@ -0,0 +1,30 @@ +#!/usr/bin/env node + +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { + V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH, + buildV46LocalInterfaceComprehensionRehearsal, +} from '../packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const repoRoot = path.resolve(__dirname, '..'); +const checkOnly = process.argv.includes('--check'); +const artifact = buildV46LocalInterfaceComprehensionRehearsal({ repoRoot }); +const serialized = `${JSON.stringify(artifact, null, 2)}\n`; +const artifactPath = path.join(repoRoot, V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH); + +if (checkOnly) { + if (!existsSync(artifactPath) || readFileSync(artifactPath, 'utf8') !== serialized) { + process.stderr.write( + `${V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH} is stale. Run pnpm run generate:v46-local-interface-comprehension-rehearsal.\n`, + ); + process.exitCode = 1; + } +} else { + mkdirSync(path.dirname(artifactPath), { recursive: true }); + writeFileSync(artifactPath, serialized); + process.stdout.write(`wrote ${V46_LOCAL_INTERFACE_COMPREHENSION_REHEARSAL_ARTIFACT_PATH}\n`); +}