{"data":[{"id":"9b4c9edd-aa89-4fd3-b161-ecbb3bc5b596","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"44080c3db9b01dd0617421a93dedc0bba5d7f8dda6ecb761576b5f7f0d55d878","forgejoWorkflowProof":{"runId":11436,"source":"exact_live_cc_execution_runtime_identity","status":"running","liveSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","results":{},"proofGate":"cc_execution_exact_live_runtime_substitutes_transient_workflow_receipt","sourceSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","conclusion":"running","deploymentId":"forgejo-main-4adb69a0ae8ce16346faceecf4459b75663e003d","targetStates":{"ccExecution":"pending"},"runtimeVersion":"1.58.244-gate-outcome-classification","targetJobCount":7,"observedTargetStates":{"ccExecution":"pending"},"workflowReceiptSubstituted":true},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-4adb69a0ae8ce16346faceecf4459b75663e003d","compareStatus":"identical","workflowRunId":11436,"identitySource":"local_build_metadata","runtimeVersion":"1.58.244-gate-outcome-classification","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:43:57.141401+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"4adb69a0ae8ce16346faceecf4459b75663e003d","external_id":"forgejo-main-4adb69a0ae8c","receipt_type":"canonical_release_status","idempotency_key":"mission:2eb50ca1-56b9-4fa2-bb02-5d1be9a71472:forgejo-release-status:4adb69a0ae8ce16346faceecf4459b75663e003d:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"cf6837c7-ace2-49a4-a872-41690ca63760","command_center_event_id":"2eb50ca1-56b9-4fa2-bb02-5d1be9a71472"},{"id":"7e3ca953-18d3-433e-998a-13a3831b1c02","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"4adb69a0ae8ce16346faceecf4459b75663e003d","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":true,"statement":"Expected freshness races self-heal without being treated as deterministic Gate failures, while real failures remain blocking.","proofConditionIds":["proof-production"]}],"satisfied":true,"constraints":[{"id":"safety","satisfied":true,"statement":"Do not weaken hard-safety, freshness, deterministic source/test/build blocking, or the single canonical Gate.","proofConditionIds":["proof-production"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"44080c3db9b01dd0617421a93dedc0bba5d7f8dda6ecb761576b5f7f0d55d878","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"ccExecution":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"44080c3db9b01dd0617421a93dedc0bba5d7f8dda6ecb761576b5f7f0d55d878"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["ccExecution"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:43:58.637953+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"4adb69a0ae8ce16346faceecf4459b75663e003d","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:2eb50ca1-56b9-4fa2-bb02-5d1be9a71472:request-contract:44080c3db9b01dd0617421a93dedc0bba5d7f8dda6ecb761576b5f7f0d55d878:4adb69a0ae8ce16346faceecf4459b75663e003d:verified:","mission_step_id":"cf6837c7-ace2-49a4-a872-41690ca63760","command_center_event_id":"2eb50ca1-56b9-4fa2-bb02-5d1be9a71472"},{"id":"91458444-dfc6-4082-9521-110f065f3cb4","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-d0429ae419c8","writes":[],"patches":[],"version":1,"approved":true,"missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f","objective":"Create one complete corrective generation from current main for release Actions query parity. In workers/cc-execution/src/index-mission-control.js change the pre-dispatch queue scan URL from `/actions/runs?limit=10` to `/actions/runs?limit=10&page=1`, and change the post-dispatch readback URL the same way. In workers/cc-execution/test/release-orchestration-invariants.test.js update the `releaseQueueReadIndex` lookup in the fresh leaf frontend validation contract so it searches for the new `?limit=10&page=1` form. In src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts add a regression assertion that at least two `/actions/runs?limit=10&page=1` references exist. Bump workers/cc-execution/src/version.js from 1.58.259-release-main-reread-eliminated to 1.58.260-release-actions-query-parity. One fresh corrective ai branch, one PR, canonical Gate, squash merge, deploy cc-execution, verify exact runtime. PRs #3626 and #3627 are superseded evidence and must not be merged.","sourceSha":"ddbb0865b7874e5e8fa60ef3aa4f1ce66e600856","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","workers/cc-execution/src/version.js"],"anchored_edits":[{"path":"workers/cc-execution/src/index-mission-control.js","new_content":"    const existingRunsResponse = await releaseGet(`${apiBase}/actions/runs?limit=10&page=1`);\n    const existingRunsPayload = await existingRunsResponse.json().catch(() => ({}));","old_content":"    const existingRunsResponse = await releaseGet(`${apiBase}/actions/runs?limit=10`);\n    const existingRunsPayload = await existingRunsResponse.json().catch(() => ({}));"},{"path":"workers/cc-execution/src/index-mission-control.js","new_content":"          const runsResponse = await releaseGet(`${apiBase}/actions/runs?limit=10&page=1`);\n          const runsPayload = await runsResponse.json().catch(() => ({}));","old_content":"          const runsResponse = await releaseGet(`${apiBase}/actions/runs?limit=10`);\n          const runsPayload = await runsResponse.json().catch(() => ({}));"},{"path":"workers/cc-execution/test/release-orchestration-invariants.test.js","new_content":"  const releaseQueueReadIndex = missionControlSource.indexOf('releaseGet(`${apiBase}/actions/runs?limit=10&page=1`', exactLiveReuseIndex);","old_content":"  const releaseQueueReadIndex = missionControlSource.indexOf('releaseGet(`${apiBase}/actions/runs?limit=10`', exactLiveReuseIndex);"},{"path":"src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","new_content":"    expect(missionControlSource).toContain('? explicitProtectedMainSourceSha');\n    expect(missionControlSource.match(/\\/actions\\/runs\\?limit=10&page=1/g)?.length).toBeGreaterThanOrEqual(2);\n  });","old_content":"    expect(missionControlSource).toContain('? explicitProtectedMainSourceSha');\n  });"},{"path":"workers/cc-execution/src/version.js","new_content":"export const CC_EXECUTION_VERSION = \"1.58.260-release-actions-query-parity\";","old_content":"export const CC_EXECUTION_VERSION = \"1.58.259-release-main-reread-eliminated\";"}],"implementation":{"files":[],"writes":[]},"requestContract":{"intent":{"rawUtterance":"Connection interrupted. Jesus christ.","wordingChanged":true,"canonicalIntent":"Continue the interrupted release-conductor repair to completion without partial PRs: make both release Actions list reads use page=1 and update every stale invariant that references the old query.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"owner_explicit","version":1,"outcomes":[{"id":"query-parity-complete","statement":"Both release Actions list reads use ?limit=10&page=1 and all corresponding regression invariants match that exact query shape.","proofConditionIds":["proof-runtime"]}],"objective":"Corrective generation containing the complete release Actions query-parity repair and its regression updates.","constraints":[{"id":"complete-corrective","statement":"Create one complete corrective generation from current main; no partial test-only merge.","proofConditionIds":["proof-runtime"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-runtime","kind":"runtime","claim":"The complete release Actions query-parity repair is merged and live in cc-execution.","required":true,"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"]}]},"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":null,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","workers/cc-execution/src/version.js"],"requestContract":{"intent":{"rawUtterance":"Connection interrupted. Jesus christ.","wordingChanged":true,"canonicalIntent":"Continue the interrupted release-conductor repair to completion without partial PRs: make both release Actions list reads use page=1 and update every stale invariant that references the old query.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"owner_explicit","version":1,"outcomes":[{"id":"query-parity-complete","statement":"Both release Actions list reads use ?limit=10&page=1 and all corresponding regression invariants match that exact query shape.","proofConditionIds":["proof-runtime"]}],"objective":"Corrective generation containing the complete release Actions query-parity repair and its regression updates.","constraints":[{"id":"complete-corrective","statement":"Create one complete corrective generation from current main; no partial test-only merge.","proofConditionIds":["proof-runtime"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-runtime","kind":"runtime","claim":"The complete release Actions query-parity repair is merged and live in cc-execution.","required":true,"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"]}]},"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","workers/cc-execution/src/version.js"],"controlPlaneMaintenanceReason":"Complete the release Actions query-parity repair after interrupted partial generations."},"proofRequirements":null,"controlPlaneUnfreeze":true,"durableMutationResume":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","workers/cc-execution/src/version.js"],"controlPlaneMaintenanceReason":"Complete the release Actions query-parity repair after interrupted partial generations."},"recovery":false,"fingerprint":"cddd661b65c83ec11afaf5fdd7541ed1820b034e3f01a5d7ea06125f73449f80","replayCount":0,"serializedBytes":7616},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:46:17.362184+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:d0429ae4-19c8-46ba-a8c7-eca5d7b3927f:repository-mutation-intent:cddd661b65c83ec11afaf5fdd7541ed1820b034e3f01a5d7ea06125f73449f80:0","mission_step_id":"1c54b4e9-0f73-46dd-aca3-2d3ffd028af2","command_center_event_id":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},{"id":"13b956ea-76e8-4c3e-a65c-268938ea797f","source":"cc-execution","status":"authorized","payload":{"paths":["src/__tests__/contracts/command-center-release-reconciliation-budget.contract.test.ts","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Complete the release Actions query-parity repair after interrupted partial generations.","baseSha":"ddbb0865b7874e5e8fa60ef3aa4f1ce66e600856","issuedAt":1790261178387,"expiresAt":1790261358387,"missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f","authorizationId":"c89c1075-f0c4-4993-b107-06697e272baa","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:46:18.687773+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"ddbb0865b7874e5e8fa60ef3aa4f1ce66e600856","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:c89c1075-f0c4-4993-b107-06697e272baa","mission_step_id":"2bbad39a-6b10-4f86-9b44-3d84f883e89f","command_center_event_id":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},{"id":"82f78427-5fed-42b9-849c-a057c7f95eeb","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-bec0ca4dd03e","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":null,"terminal":false,"missionId":"bec0ca4d-d03e-474e-ba35-1b51b751cf76","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":342,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":562,"providerAuthMs":0,"ledgerPrepareMs":562,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":562,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":562,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"bec0ca4d-d03e-474e-ba35-1b51b751cf76"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":6969,"likelyAffectedFiles":["src/PrivateAppShell.tsx","src/__tests__/contracts/big-papis-canonical-customer-proposals.contract.test.ts","config/capabilities/big-papis-proposal-workflow.json","config/capabilities/big-papis-proposal-screenshot-intake.json","config/contracts/PREHISTORIC-002-UNIVERSAL-PROPOSALS.json","src/OAuthConsentBridge.tsx","src/__tests__/contracts/proposal-editor-canonical-source.contract.test.ts","scripts/audit-customer-copy-cohesion.mjs","scripts/visual-witness-hosted-runner/src/auth-state-refresh.mjs","scripts/visual-witness-hosted-runner/src/bounded-mission-queue.mjs","scripts/visual-witness-hosted-runner/src/mission-gateway.mjs","scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"766cfaa7-ac42-46c8-bbef-69d13268a29d","created_at":"2026-09-17T17:06:53.452367+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:bec0ca4d-d03e-474e-ba35-1b51b751cf76:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"b5469866-b757-44be-98eb-18eef95f18d2","command_center_event_id":"bec0ca4d-d03e-474e-ba35-1b51b751cf76"},{"id":"1ff0a0ab-bcf9-417b-ae89-d6a9b775e2db","source":"cc-execution","status":"source_resolution_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"source_resolution_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755","operation":"execute_mission","proofGate":"repair_mission_source_resolution_required","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":568,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":436,"providerAuthMs":0,"ledgerPrepareMs":436,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":436,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":436,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Supply exact sourceTargets on the same mission; planner guesses cannot replace missing mission scope.","receiptRef":{"mode":"full","missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1175,"likelyAffectedFiles":[],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T17:48:30.620345+00:00","proof_gate":"repair_mission_source_resolution_required","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:6cebe545-6b72-468c-9a0c-d8a2c0936755:execute_mission:repair_mission_source_resolution_required:current-generation","mission_step_id":"a019473f-6d1b-48bf-ad6e-7cd13c7d898f","command_center_event_id":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},{"id":"5c925d2d-4b10-48ff-82f2-075916225131","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-0a680ea028cd","prNumber":3598,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:47:17.916107+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","external_id":"3598","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:merged-pr:3598:73e6e462c7a9cba64327b0c32c4926a3176a30da","mission_step_id":"34188583-ba2e-4984-99a5-9e8470d7138a","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"1596dbce-fa90-49a3-a528-e9ff619b63cf","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-0ef5b04dfc4d","reason":"anchored_edit_invalid","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":null,"terminal":false,"missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1816,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1816,"missionSetupMs":1481,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1367,"ledgerReconcileMs":0,"lineageReconcileMs":114,"resolvePreflightMs":1481,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1367,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1429,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:14:42.794751+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:0ef5b04d-fc4d-4f23-9444-d44a932136e3:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"cbd1e01b-7440-45c1-a66c-cdee9adfbad1","command_center_event_id":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},{"id":"938d7205-64cc-41ad-ab00-0dab19cae32e","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-d0429ae419c8","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":7762,"releaseCount":0,"toolCallCount":1,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":"2026-09-24T14:46:17.304Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.259-release-main-reread-eliminated","prNumber":3628,"terminal":false,"missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":6018,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1571,"missionSetupMs":339,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":339,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":339,"repositoryMutationMs":4447,"repositoryProviderMs":4447,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2622,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":339,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1825},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4138,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:46:24.706886+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3628","receipt_type":"execute_mission","idempotency_key":"mission:d0429ae4-19c8-46ba-a8c7-eca5d7b3927f:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"1c54b4e9-0f73-46dd-aca3-2d3ffd028af2","command_center_event_id":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},{"id":"8b37853d-f2ce-4396-85f7-59af21533f32","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-0ef5b04dfc4d","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":null,"terminal":false,"missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":128,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":4363,"providerAuthMs":0,"ledgerPrepareMs":4363,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":4363,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":4363,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":5289,"likelyAffectedFiles":["src/pages/proposals/UniversalProposalWorkspace.tsx"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:10:19.108544+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:0ef5b04d-fc4d-4f23-9444-d44a932136e3:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"adee5fe3-4985-4b08-af01-69ee8de1b26b","command_center_event_id":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},{"id":"c7630fc3-5ebe-4851-8395-581795cfdffb","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-0ef5b04dfc4d","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":3019,"terminal":false,"missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":6790,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2323,"missionSetupMs":1129,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":765,"ledgerReconcileMs":0,"lineageReconcileMs":364,"resolvePreflightMs":1129,"repositoryMutationMs":4467,"repositoryProviderMs":4467,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":4226,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":765,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":241},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3076,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:17:20.761348+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3019","receipt_type":"execute_mission","idempotency_key":"mission:0ef5b04d-fc4d-4f23-9444-d44a932136e3:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"cbd1e01b-7440-45c1-a66c-cdee9adfbad1","command_center_event_id":"0ef5b04d-fc4d-4f23-9444-d44a932136e3"},{"id":"de794e64-3789-4150-9e8b-640c33f0d2cf","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-b5a2170b506f","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":null,"terminal":false,"missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":156,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":4517,"providerAuthMs":0,"ledgerPrepareMs":4517,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":4517,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":4517,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":10857,"likelyAffectedFiles":["scripts/visual-witness-hosted-runner/src/operator-session-broker.mjs","src/__tests__/contracts/command-palette-platform-authority.contract.test.ts","config/capabilities/tenant-workspace-ui-contract-v2.json","config/contracts/PREHISTORIC-001-TENANT-MEDIA.json","config/contracts/PREHISTORIC-002-UNIVERSAL-PROPOSALS.json","config/mcp-connection-contract.json","src/__tests__/contracts/build-my-demo-completion-workflow.test.ts","config/capabilities/tenant-brand-character.json","config/platform-standards.json","scripts/operator-visual-smoke.mjs","scripts/validate-public-seo-contract.mjs","scripts/verify-production-contracts.mjs"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:31:26.204212+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"1cef0dd5-27b7-422b-94cc-70cd52cae7fe","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"4f67eed0-ad43-462c-9ad4-de3dd17f513f","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","frontend-cloudflare/live":"success"},"mainSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","frontend-cloudflare/live"],"sourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"frontend":"success"},"requestContractHash":"767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/11438","runId":11438,"status":"running","sourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"frontend":"success"},"targetJobCount":7,"observedTargetStates":{"frontend":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:47:26.40192+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","external_id":"forgejo-main-73e6e462c7a9","receipt_type":"canonical_release_status","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:forgejo-release-status:73e6e462c7a9cba64327b0c32c4926a3176a30da:verified:forgejo-main/source=success|forgejo-release/workflow=success|frontend-cloudflare/live=success","mission_step_id":"17b53691-1b97-40a2-8810-29374aae5548","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"981959c6-e59f-4333-b3bc-af68f59c8ee6","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-289e3d5a4d61","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":null,"terminal":false,"missionId":"289e3d5a-4d61-4c79-abbd-bddad4986453","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":14,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":1366,"providerAuthMs":0,"ledgerPrepareMs":1366,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1366,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":1366,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"289e3d5a-4d61-4c79-abbd-bddad4986453"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":7817,"likelyAffectedFiles":["src/PrivateAppShell.tsx","config/capabilities/big-papis-proposal-workflow.json","config/contracts/PREHISTORIC-002-UNIVERSAL-PROPOSALS.json","config/capabilities/platform-application-registry.json","config/capabilities/big-papis-proposal-screenshot-intake.json","config/platform-standards.json","config/capabilities/tenant-brand-character.json","config/capabilities/tenant-workspace-experience.json","config/capabilities/tenant-workspace-search.json","config/capabilities/tenant-workspace-ui-contract-v2.json","src/__tests__/contracts/big-papis-canonical-customer-proposals.contract.test.ts","config/capabilities/platform-health.json"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:32:46.742743+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:289e3d5a-4d61-4c79-abbd-bddad4986453:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"b963f58e-57f2-49ae-adb3-894d60376d00","command_center_event_id":"289e3d5a-4d61-4c79-abbd-bddad4986453"},{"id":"fd78928d-0d63-428a-bde3-87bf3b85fb1f","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-289e3d5a4d61","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":3020,"terminal":false,"missionId":"289e3d5a-4d61-4c79-abbd-bddad4986453","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":9899,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1469,"missionSetupMs":891,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":891,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":891,"repositoryMutationMs":8430,"repositoryProviderMs":8430,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":4686,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":891,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":3744},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"289e3d5a-4d61-4c79-abbd-bddad4986453"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3324,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:38:30.259035+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3020","receipt_type":"execute_mission","idempotency_key":"mission:289e3d5a-4d61-4c79-abbd-bddad4986453:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"932f1d3e-44fc-4032-b3aa-f466e4577a03","command_center_event_id":"289e3d5a-4d61-4c79-abbd-bddad4986453"},{"id":"9c4099de-5159-4762-92f6-02a46295da94","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-b5a2170b506f","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":3021,"terminal":false,"missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":20653,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":11348,"missionSetupMs":1233,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1141,"ledgerReconcileMs":0,"lineageReconcileMs":92,"resolvePreflightMs":1233,"repositoryMutationMs":9305,"repositoryProviderMs":9305,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":4242,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1141,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":5063},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},"performance":null,"deploymentId":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4399,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:40:42.302046+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3021","receipt_type":"execute_mission","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"38cd1ff7-0c74-4a25-a746-e194f8f02e7e","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"3364c443-0efa-4363-9dc4-9a7cdc9691ad","source":"cc-execution","status":"recorded","payload":{"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Unfreeze control plane for done means live enforcement hardening. Enforce that KNOCKLAUNCH cannot report behavioral work LIVE from source, Gate, merge, deploy, runtime availability, or HTTP availability alone. Behavioral outcomes require executable claim-matched interaction proof bound to the active request contract and active source generation. Stale witness evidence must not satisfy a later repair generation. Owner-facing LIVE must fail closed unless the current request contract is verified. Preserve the single canonical mission, Gate, merge, and release lane.","wordingChanged":false,"canonicalIntent":"Unfreeze control plane for done means live enforcement hardening. Enforce that KNOCKLAUNCH cannot report behavioral work LIVE from source, Gate, merge, deploy, runtime availability, or HTTP availability alone. Behavioral outcomes require executable claim-matched interaction proof bound to the active request contract and active source generation. Stale witness evidence must not satisfy a later repair generation. Owner-facing LIVE must fail closed unless the current request contract is verified. Preserve the single canonical mission, Gate, merge, and release lane.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"done-means-live-enforced","statement":"The live KNOCKLAUNCH control plane prevents behavioral work from being reported LIVE until executable claim-matched proof for the exact requested behavior is verified against the active request contract and active source generation.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"stale-proof-blocked","statement":"Stale witness evidence, deploy receipts, green Gate state, merge state, and runtime availability alone cannot satisfy a behavioral completion claim.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]}],"objective":"Unfreeze control plane for done means live enforcement hardening. Enforce that KNOCKLAUNCH cannot report behavioral work LIVE from source, Gate, merge, deploy, runtime availability, or HTTP availability alone. Behavioral outcomes require executable claim-matched interaction proof bound to the active request contract and active source generation. Stale witness evidence must not satisfy a later repair generation. Owner-facing LIVE must fail closed unless the current request contract is verified. Preserve the single canonical mission, Gate, merge, and release lane.","constraints":[{"id":"single-canonical-lane","statement":"Preserve the existing mission ledger, canonical Gate, squash merge, unified release supervisor, and one-release architecture.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"done-means-live-test-source","kind":"repository","claim":"The exact merged source contains the done-means-live regression suite.","route":"workers/cc-execution/test/done-means-live-invariants.test.js","roleRef":null,"userRef":null,"required":true,"expectedText":"owner-facing LIVE fails closed while the current request contract is not verified","targetedActions":[],"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"cc-test-runner","kind":"repository","claim":"The exact merged cc-execution package runs every test/*.test.js file under its test command.","route":"workers/cc-execution/package.json","roleRef":null,"userRef":null,"required":true,"expectedText":"node --test test/*.test.js","targetedActions":[],"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"cc-runtime-live","kind":"runtime","claim":"The exact hardened source is running in the live cc-execution runtime.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Unfreeze-control-plane-for-done-means-live-enforcement-hardening.-Enforce-that-KNOCKLAUNCH-cannot-re","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":["ccExecution"],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestContractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","requestContractRevision":3,"previousRequestContractHash":"ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:43:43.183119+00:00","proof_gate":"request_contract_revision_recorded","source_sha":null,"external_id":null,"receipt_type":"request_contract_revision","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:request-contract:0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","mission_step_id":"38cd1ff7-0c74-4a25-a746-e194f8f02e7e","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"bf363d35-e22c-41f0-8798-1422bc04fe09","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":false,"statement":"Refactor the Big Papi owner desktop route family into a dedicated tenant-first MODES presentation shell. Remove visible generic CRM/PrivateAppShell presentation from the Big Papi experience while preserving shared platform infrastructure underneath. Enforce canonical MODEs Plan the Week, Pop-Up, Event, Back Office; compact desktop density with readable text; fixed contextual workflow headers directly below the tenant header; Big Papi-owned navigation/theme/search/avatar/settings/utility placement; no ghost mobile nav, generic CRM leakage, duplicated generic controls, or tenant-selection/loading flash. Keep Calendar and Pop-Up as the design baseline for the other Big Papi applications. Add focused frontend contracts. Ship through one ai branch, one PR, canonical gate, squash merge, production deploy, and live verification.","proofConditionIds":["proof-production","proof-visual"]}],"satisfied":false,"constraints":[{"id":"visual-content-truth","satisfied":false,"statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","satisfied":false,"statement":"Visual work is isolated to requested tenant. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","satisfied":false,"statement":"The requested desktop viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","proofConditionIds":["proof-production","proof-visual"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac","releaseBound":true,"witnessBound":false,"visualRequested":true,"visualSatisfied":false,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac"},"required":true,"satisfied":true},{"id":"proof-visual","kind":"visual","evidence":{"modeBound":true,"claimBound":true,"routeBound":true,"witnessMode":"observe","witnessRoute":"/big-papis/owner","currentSourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","witnessSourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","verificationState":"failed","witnessRequestContractHash":"767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac"},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["visual"],"activeReleaseTargets":["frontend"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:47:27.905723+00:00","proof_gate":"request_contract_pending","source_sha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:request-contract:767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac:73e6e462c7a9cba64327b0c32c4926a3176a30da:pending:visual","mission_step_id":"17b53691-1b97-40a2-8810-29374aae5548","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"eca47eb9-5825-4785-a886-6234b5ee122f","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-289e3d5a4d61","prNumber":3020,"nextAction":null,"mergeCommitSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:51:42.365766+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","external_id":"3020","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:289e3d5a-4d61-4c79-abbd-bddad4986453:merged-pr:3020:6c0aae1227b24a2e0741b75f09631e88ac9337c6","mission_step_id":"3409e590-df06-4ed1-b759-c91e30ade01b","command_center_event_id":"289e3d5a-4d61-4c79-abbd-bddad4986453"},{"id":"d64a66d8-c939-4a24-b73f-89581d54d42a","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/objective-first-repair-b5a2170b506f","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.177-tenant-source-scope","prNumber":3021,"terminal":false,"missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1555,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":193,"approvedPlanMs":0,"missionSetupMs":2620,"providerAuthMs":0,"shipAndProveMs":913,"ledgerPrepareMs":415,"ledgerReconcileMs":0,"lineageReconcileMs":2205,"resolvePreflightMs":2620,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":415,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},"performance":null,"deploymentId":"forgejo-main-adfac956dff7","workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2862,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:41:38.508576+00:00","proof_gate":"canonical_release_dispatched","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":"forgejo-main-adfac956dff7","receipt_type":"execute_mission","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"a4a41a8b-7390-43bb-9379-f1aadaf41287","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"98e50435-02bc-4504-b399-1a3331f4a427","source":"forgejo","status":"waiting","payload":{"branch":"ai/done-means-live-terminal-receipt-guard","prNumber":3022,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:46:53.282327+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","external_id":"3022","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:fbc90a92-20eb-4060-91b4-9e503255820d:merged-pr:3022:5315de21d1ccaeff5c3e5654e7be7dab4be9a076","mission_step_id":"e92521fc-02b4-487b-9751-c4bb1ece0b73","command_center_event_id":"fbc90a92-20eb-4060-91b4-9e503255820d"},{"id":"16824d71-5572-45aa-acb5-ae56c76af07c","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"done-means-live-enforced","satisfied":false,"statement":"The live KNOCKLAUNCH control plane prevents behavioral work from being reported LIVE until executable claim-matched proof for the exact requested behavior is verified against the active request contract and active source generation.","proofConditionIds":["done-means-live-gate","cc-runtime-live"]},{"id":"stale-proof-blocked","satisfied":false,"statement":"Stale witness evidence, deploy receipts, green Gate state, merge state, and runtime availability alone cannot satisfy a behavioral completion claim.","proofConditionIds":["done-means-live-gate","cc-runtime-live"]}],"satisfied":false,"constraints":[{"id":"single-canonical-lane","satisfied":false,"statement":"Preserve the existing mission ledger, canonical Gate, squash merge, unified release supervisor, and one-release architecture.","proofConditionIds":["done-means-live-gate","cc-runtime-live"]},{"id":"capability-completeness","satisfied":false,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["done-means-live-gate","cc-runtime-live"]},{"id":"atomic-capability-lifecycle","satisfied":false,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["done-means-live-gate","cc-runtime-live"]}],"contractHash":"ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"done-means-live-gate","kind":"repository","evidence":{"reason":null,"gateRunId":null,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":"workers/cc-execution/test/done-means-live-invariants.test.js","releaseTargetStates":{"ccExecution":"success"},"repositoryProofGate":null,"repositoryProofPath":null,"requestContractHash":"ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e","unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":["ccExecution"],"repositoryProofStatus":"required","expectedRepositoryPath":null,"namedGateTestSatisfied":false,"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"repositoryConditionBound":false,"repositoryProofSourceSha":null},"required":true,"satisfied":false},{"id":"cc-runtime-live","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"ccExecution":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"releaseRequestContractHash":"ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":["repository"],"activeReleaseTargets":["ccExecution"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":2},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:42:51.588463+00:00","proof_gate":"request_contract_pending","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:request-contract:ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e:adfac956dff77608d07c9d3d4127a4a104418853:pending:repository","mission_step_id":"cd5c019f-b096-4595-b0d3-aed889927c73","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"6583b332-7ba7-46c0-8614-8575cf6d4ff4","source":"forgejo-exact-source","status":"verified","payload":{"sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","repository":"noel/KnockLaunchOS","repositoryProofs":[{"id":"done-means-live-test-source","path":"workers/cc-execution/test/done-means-live-invariants.test.js","blobSha":"d25f3e178e2a1ad915794dfb2b86afec7ff0793f","expectedText":"owner-facing LIVE fails closed while the current request contract is not verified"},{"id":"cc-test-runner","path":"workers/cc-execution/package.json","blobSha":"532c6a641ce978c8471527b9dcf032046a60fd3e","expectedText":"node --test test/*.test.js"}],"requestContractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","namedGateEvidenceReceiptVersion":null},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:44:45.487061+00:00","proof_gate":"request_contract_repository_verified","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":null,"receipt_type":"request_contract_repository_status","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:request-contract-repository:0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198:adfac956dff77608d07c9d3d4127a4a104418853","mission_step_id":"cd5c019f-b096-4595-b0d3-aed889927c73","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"7df97638-3b7e-464f-8050-6112d8468a2a","source":"cc-execution","status":"authorized","payload":{"paths":["config/control-plane-capabilities.json","workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/done-means-live-invariants.test.js"],"reason":"Live verification of the done-means-live hardening exposed a remaining raw receipt path that emitted verified/terminal before request-contract reconciliation, even though owner-facing state correctly stayed IN_PROGRESS. This closes that false-completion reporting loophole.","baseSha":"adfac956dff77608d07c9d3d4127a4a104418853","issuedAt":1789667148627,"expiresAt":1789667328627,"missionId":"fbc90a92-20eb-4060-91b4-9e503255820d","authorizationId":"8cdba8da-1995-40ef-b41d-9fa2c3b56628","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:45:50.383164+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:8cdba8da-1995-40ef-b41d-9fa2c3b56628","mission_step_id":"22f102b3-21ad-41f6-bb48-c13eec636086","command_center_event_id":"fbc90a92-20eb-4060-91b4-9e503255820d"},{"id":"1210ae8a-c88c-4da7-b195-c3fd62ca8e4e","source":"onrunner","status":"failed","payload":{"ok":false,"jobId":"c71f9411-5561-44b6-9bdc-f45c2ab85e51","phase":"universal_visual_witness_poll_failed","branch":"ai/objective-first-repair-0a680ea028cd","reason":"application_shell_readiness_timeout:43500","status":"blocked","metrics":{"receiptBytes":199618,"releaseCount":0,"toolCallCount":31,"repeatedCallCount":12,"executorlessWaitMs":1082050,"firstUsefulResultAt":"2026-09-24T05:29:25.812Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3598,"terminal":true,"missionId":"0a680ea0-28cd-4751-b264-c7ac0f65951b","operation":"visual_proof_status","proofGate":"interactive_visual_witness_failed","sourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","timingsMs":{"queue":111152,"total":176556,"execution":65404},"nextAction":null,"receiptRef":{"mode":"full","missionId":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},"performance":null,"deploymentId":"forgejo-main-73e6e462c7a9","releaseState":"verified","visualWitness":{"role":"GodMode","jobId":"c71f9411-5561-44b6-9bdc-f45c2ab85e51","tenant":null,"runnerUrl":"https://knocklaunchcrm.onrender.com","runnerLane":"primary","attemptsUsed":3,"supervisorId":"c71f9411-5561-44b6-9bdc-f45c2ab85e51","failureReason":"application_shell_readiness_timeout:43500","observedRoute":"/big-papis/owner","runnerVersion":"onrunner-666a1bc23410","attemptLineage":[{"jobId":"1379decb-c3fa-4c7a-8d65-d10717d3c6b5","attempt":1,"category":"transient_infrastructure","sourceSha":"666a1bc23410865196d34a9fca1b1a916365b964","startedAt":"2026-09-24T05:36:49.437Z","completedAt":"2026-09-24T05:38:02.228Z","runtimeLane":"cc-execution -> Render OnRunner -> universal-witness.mjs","browserEngine":"chromium","failureReason":"application_shell_readiness_timeout:43500","retryRecovery":{"completed":true,"fromEngine":"chromium","nextEngine":"firefox","recoveryMode":"engine_ladder","failureReason":"application_shell_readiness_timeout:43500","browserRecycled":true,"browserRestartScheduled":true},"runnerVersion":"onrunner-666a1bc23410","browserLaunchReason":"managed_display","checkpointAccounting":{"route":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner","mobile::/big-papis/owner"]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":4,"resumed":0,"complete":false,"evidence":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner::evidence::preflight","mobile::/big-papis/owner::evidence::preflight"]},"completed":0,"remaining":4,"duplicates":0,"duplicateIds":[],"expectedTotal":4}},{"jobId":"3a0d2d5e-8fcc-4405-9208-c956a763c408","attempt":2,"category":"transient_infrastructure","sourceSha":"666a1bc23410865196d34a9fca1b1a916365b964","startedAt":"2026-09-24T05:38:07.336Z","completedAt":"2026-09-24T05:38:35.974Z","runtimeLane":"cc-execution -> Render OnRunner -> universal-witness.mjs","browserEngine":"firefox","failureReason":"browser_context_create_timeout:20000","retryRecovery":{"completed":true,"fromEngine":"firefox","nextEngine":"chromium","recoveryMode":"canonical_chromium_fresh_browser","failureReason":"browser_context_create_timeout:20000","browserRecycled":true,"browserRestartScheduled":true},"runnerVersion":"onrunner-666a1bc23410","browserLaunchReason":"transient_renderer_firefox_retry","checkpointAccounting":{"route":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner","mobile::/big-papis/owner"]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":4,"resumed":0,"complete":false,"evidence":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner::evidence::preflight","mobile::/big-papis/owner::evidence::preflight"]},"completed":0,"remaining":4,"duplicates":0,"duplicateIds":[],"expectedTotal":4}},{"jobId":"c82a70a4-359a-43b7-93b2-134ab5d08c3b","attempt":3,"category":"transient_infrastructure","sourceSha":"666a1bc23410865196d34a9fca1b1a916365b964","startedAt":"2026-09-24T05:38:39.924Z","completedAt":"2026-09-24T05:39:46.520Z","runtimeLane":"cc-execution -> Render OnRunner -> universal-witness.mjs","browserEngine":"webkit","failureReason":"application_shell_readiness_timeout:43500","retryRecovery":null,"runnerVersion":"onrunner-666a1bc23410","browserLaunchReason":"transient_renderer_webkit_retry","checkpointAccounting":{"route":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner","mobile::/big-papis/owner"]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":4,"resumed":0,"complete":false,"evidence":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner::evidence::preflight","mobile::/big-papis/owner::evidence::preflight"]},"completed":0,"remaining":4,"duplicates":0,"duplicateIds":[],"expectedTotal":4}}],"missionOutcome":"transient_infrastructure","requestedRoute":"/big-papis/owner","runnerSourceSha":"666a1bc23410865196d34a9fca1b1a916365b964","selectedViewports":["desktop","mobile"],"checkpointAccounting":{"route":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner","mobile::/big-papis/owner"]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":4,"resumed":0,"complete":false,"evidence":{"required":2,"completed":0,"missingIds":["desktop::/big-papis/owner::evidence::preflight","mobile::/big-papis/owner::evidence::preflight"]},"completed":0,"remaining":4,"duplicates":0,"duplicateIds":[],"expectedTotal":4},"correctiveGeneration":0,"restartReplayHistory":[]},"workflowRunId":11438,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":6518,"ownerActionRequired":false,"ownerFacingTerminal":false,"requestContractHash":"767ffeda39cbbd7026179b97e8fe00a8855624f34e7d1bf6a63a1b782c7860ac","continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:47:29.105135+00:00","proof_gate":"interactive_visual_witness_failed","source_sha":"onrunner-666a1bc23410","external_id":"c71f9411-5561-44b6-9bdc-f45c2ab85e51","receipt_type":"visual_proof_status","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:visual:c71f9411-5561-44b6-9bdc-f45c2ab85e51:failed","mission_step_id":"bc1c9699-c3b7-4421-8408-5db65a339b97","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"24615309-1b61-47ca-86a3-5da165292e80","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-d0429ae419c8","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":10441,"releaseCount":0,"toolCallCount":3,"repeatedCallCount":0,"executorlessWaitMs":7364,"firstUsefulResultAt":"2026-09-24T14:46:17.304Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3628,"terminal":false,"missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f","operation":"automatic_mission_resume","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"prReadinessMs":675,"approvedPlanMs":0,"shipAndProveMs":0,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1285,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:46:28.548189+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"3628","receipt_type":"automatic_mission_resume","idempotency_key":"mission:d0429ae4-19c8-46ba-a8c7-eca5d7b3927f:automatic-mission-resume:3628:repair_mission_waiting_for_gate","mission_step_id":"16692fd3-aedb-4b3c-b1a6-163c0e803877","command_center_event_id":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},{"id":"f7c10369-6146-462e-92e0-c87697be84fa","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"adfac956dff77608d07c9d3d4127a4a104418853","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"ec1fdc64a09c3f564e1b1ed72a5bdd69b00b54b7d8af87a1128346b1ef4df42e","forgejoWorkflowProof":{"runId":9248,"source":"exact_live_cc_execution_runtime_identity","status":"running","liveSha":"adfac956dff77608d07c9d3d4127a4a104418853","results":{},"proofGate":"cc_execution_exact_live_runtime_substitutes_transient_workflow_receipt","sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","conclusion":"running","deploymentId":"forgejo-main-adfac956dff77608d07c9d3d4127a4a104418853","targetStates":{"ccExecution":"pending"},"runtimeVersion":"1.58.178-done-means-live-proof","targetJobCount":7,"observedTargetStates":{"ccExecution":"pending"},"workflowReceiptSubstituted":true},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"adfac956dff77608d07c9d3d4127a4a104418853","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-adfac956dff77608d07c9d3d4127a4a104418853","compareStatus":"identical","workflowRunId":9248,"identitySource":"local_build_metadata","runtimeVersion":"1.58.178-done-means-live-proof","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:42:41.160473+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":"forgejo-main-adfac956dff7","receipt_type":"canonical_release_status","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:forgejo-release-status:adfac956dff77608d07c9d3d4127a4a104418853:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"cd5c019f-b096-4595-b0d3-aed889927c73","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"510d51b1-e5b4-4e3b-89b8-177c91da1b42","source":"cc-execution","status":"verified","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-b5a2170b506f","reason":null,"status":"verified","metrics":{"receiptBytes":0,"releaseCount":1,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.178-done-means-live-proof","prNumber":3021,"terminal":true,"missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d","operation":"execute_mission","proofGate":"canonical_release_already_verified","sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":3395,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":817,"approvedPlanMs":0,"missionSetupMs":2132,"providerAuthMs":0,"shipAndProveMs":1665,"ledgerPrepareMs":2132,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":2132,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":2132,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},"performance":null,"deploymentId":"forgejo-main-adfac956dff7","releaseState":null,"workflowRunId":9248,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2653,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:43:50.315335+00:00","proof_gate":"canonical_release_already_verified","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":"forgejo-main-adfac956dff7","receipt_type":"execute_mission","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:execute_mission:canonical_release_already_verified:current-generation","mission_step_id":"38cd1ff7-0c74-4a25-a746-e194f8f02e7e","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"79b6fc84-83f8-47d8-ad22-0a47f4872989","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"adfac956dff77608d07c9d3d4127a4a104418853","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"done-means-live-enforced","satisfied":true,"statement":"The live KNOCKLAUNCH control plane prevents behavioral work from being reported LIVE until executable claim-matched proof for the exact requested behavior is verified against the active request contract and active source generation.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"stale-proof-blocked","satisfied":true,"statement":"Stale witness evidence, deploy receipts, green Gate state, merge state, and runtime availability alone cannot satisfy a behavioral completion claim.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]}],"satisfied":true,"constraints":[{"id":"single-canonical-lane","satisfied":true,"statement":"Preserve the existing mission ledger, canonical Gate, squash merge, unified release supervisor, and one-release architecture.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["done-means-live-test-source","cc-test-runner","cc-runtime-live"]}],"contractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"done-means-live-test-source","kind":"repository","evidence":{"reason":null,"gateRunId":null,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":null,"releaseTargetStates":{"ccExecution":"success"},"repositoryProofGate":"request_contract_repository_verified","repositoryProofPath":"workers/cc-execution/test/done-means-live-invariants.test.js","requestContractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":["ccExecution"],"repositoryProofStatus":"verified","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"repositoryConditionBound":true,"repositoryProofSourceSha":"adfac956dff77608d07c9d3d4127a4a104418853"},"required":true,"satisfied":true},{"id":"cc-test-runner","kind":"repository","evidence":{"reason":null,"gateRunId":null,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":null,"releaseTargetStates":{"ccExecution":"success"},"repositoryProofGate":"request_contract_repository_verified","repositoryProofPath":"workers/cc-execution/package.json","requestContractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198","unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":["ccExecution"],"repositoryProofStatus":"verified","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"repositoryConditionBound":true,"repositoryProofSourceSha":"adfac956dff77608d07c9d3d4127a4a104418853"},"required":true,"satisfied":true},{"id":"cc-runtime-live","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"ccExecution":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":["ccExecution"],"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"releaseRequestContractHash":"0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["ccExecution"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":3},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:44:52.927549+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"adfac956dff77608d07c9d3d4127a4a104418853","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:b5a2170b-506f-4fd5-b6a9-c6d14ef5031d:request-contract:0282a8f3cf20c76d35569fe09a60e404268fa7335169fd5d52aaf69a6a3bc198:adfac956dff77608d07c9d3d4127a4a104418853:verified:","mission_step_id":"cd5c019f-b096-4595-b0d3-aed889927c73","command_center_event_id":"b5a2170b-506f-4fd5-b6a9-c6d14ef5031d"},{"id":"a5927b93-b129-487f-9fdb-1c067cb2b2c0","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/done-means-live-terminal-receipt-guard","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.178-done-means-live-proof","prNumber":3022,"terminal":false,"missionId":"fbc90a92-20eb-4060-91b4-9e503255820d","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":15174,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":11007,"missionSetupMs":940,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":940,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":940,"repositoryMutationMs":4167,"repositoryProviderMs":4167,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2475,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":940,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1692},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"fbc90a92-20eb-4060-91b4-9e503255820d"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4207,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:46:05.423948+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3022","receipt_type":"execute_mission","idempotency_key":"mission:fbc90a92-20eb-4060-91b4-9e503255820d:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"8bd227a7-9cb1-49e7-9d4c-2f1c58b6c33b","command_center_event_id":"fbc90a92-20eb-4060-91b4-9e503255820d"},{"id":"d883c3c7-55e3-4bd2-8468-75a6893e0763","source":"cc-execution","status":"pending","payload":{"ok":true,"jobId":"7bcea1ce-d954-4ea6-9618-847ef35821d7","phase":"universal_visual_witness_supervised","branch":"ai/objective-first-repair-0a680ea028cd","reason":null,"status":"pending","metrics":{"receiptBytes":205640,"releaseCount":0,"toolCallCount":32,"repeatedCallCount":12,"executorlessWaitMs":1083259,"firstUsefulResultAt":"2026-09-24T05:29:25.812Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3598,"terminal":false,"missionId":"0a680ea0-28cd-4751-b264-c7ac0f65951b","operation":"visual_proof_started","proofGate":"universal_visual_witness_pending","sourceSha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","timingsMs":{"queue":236,"total":257,"execution":21},"nextAction":"Execution is pending; poll inspect_route_status only when fresh progress is expected, or cancel with inspect_route_cancel.","receiptRef":{"mode":"full","missionId":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},"performance":null,"deploymentId":"forgejo-main-73e6e462c7a9","releaseState":"verified","visualWitness":{"role":"GodMode","jobId":"7bcea1ce-d954-4ea6-9618-847ef35821d7","tenant":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","runnerUrl":"https://knocklaunchcrm.onrender.com","runnerLane":"primary","attemptsUsed":0,"supervisorId":"7bcea1ce-d954-4ea6-9618-847ef35821d7","failureReason":null,"observedRoute":null,"runnerVersion":null,"attemptLineage":[],"missionOutcome":null,"requestedRoute":"/big-papis/owner","runnerSourceSha":null,"selectedViewports":["desktop","mobile"],"checkpointAccounting":null,"correctiveGeneration":1,"restartReplayHistory":[]},"workflowRunId":11438,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["visual"],"verificationState":"failed","workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1804,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:47:30.314822+00:00","proof_gate":"post_release_visual_proof_started","source_sha":"73e6e462c7a9cba64327b0c32c4926a3176a30da","external_id":"7bcea1ce-d954-4ea6-9618-847ef35821d7","receipt_type":"visual_proof_started","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:visual-start:7bcea1ce-d954-4ea6-9618-847ef35821d7","mission_step_id":"bc1c9699-c3b7-4421-8408-5db65a339b97","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"dec2c211-8b7b-4eb2-ab44-8f1d1c46fb0d","source":"cc-execution","status":"release_reconciliation_pending","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-d0429ae419c8","reason":null,"status":"release_reconciliation_pending","metrics":{"receiptBytes":11979,"releaseCount":0,"toolCallCount":4,"repeatedCallCount":0,"executorlessWaitMs":11194,"firstUsefulResultAt":"2026-09-24T14:46:17.304Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.259-release-main-reread-eliminated","prNumber":3628,"terminal":false,"missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f","operation":"execute_mission","proofGate":"canonical_release_reconciliation_pending","sourceSha":"6d9b56783d9e04e68a7981de0150f8fc1ebad486","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4224,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":487,"approvedPlanMs":0,"missionSetupMs":622,"providerAuthMs":0,"shipAndProveMs":2973,"ledgerPrepareMs":443,"ledgerReconcileMs":0,"lineageReconcileMs":179,"resolvePreflightMs":622,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":443,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"reconcile_release","receiptRef":{"mode":"full","missionId":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},"performance":null,"deploymentId":"forgejo-main-6d9b56783d9e","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2662,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:48:07.78184+00:00","proof_gate":"canonical_release_reconciliation_pending","source_sha":"6d9b56783d9e04e68a7981de0150f8fc1ebad486","external_id":"forgejo-main-6d9b56783d9e","receipt_type":"execute_mission","idempotency_key":"mission:d0429ae4-19c8-46ba-a8c7-eca5d7b3927f:execute_mission:canonical_release_reconciliation_pending:current-generation","mission_step_id":"843a9298-cb6d-439d-b246-7acfefa71efe","command_center_event_id":"d0429ae4-19c8-46ba-a8c7-eca5d7b3927f"},{"id":"4bf8c54f-30c1-4d04-81cb-b0b5a3d959d1","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/done-means-live-terminal-receipt-guard","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.178-done-means-live-proof","prNumber":3022,"terminal":false,"missionId":"fbc90a92-20eb-4060-91b4-9e503255820d","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5697,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":561,"approvedPlanMs":0,"missionSetupMs":991,"providerAuthMs":0,"shipAndProveMs":4805,"ledgerPrepareMs":635,"ledgerReconcileMs":0,"lineageReconcileMs":356,"resolvePreflightMs":991,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":635,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"fbc90a92-20eb-4060-91b4-9e503255820d"},"performance":null,"deploymentId":"forgejo-main-5315de21d1cc","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2754,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:46:44.00283+00:00","proof_gate":"canonical_release_dispatched","source_sha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","external_id":"forgejo-main-5315de21d1cc","receipt_type":"execute_mission","idempotency_key":"mission:fbc90a92-20eb-4060-91b4-9e503255820d:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"e92521fc-02b4-487b-9751-c4bb1ece0b73","command_center_event_id":"fbc90a92-20eb-4060-91b4-9e503255820d"},{"id":"b51846e5-a0cd-4243-95dd-626296f819b4","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"6dc1f9a237359aa2de6d1749294749cd64bb1ca074bee4ff8ec56c8aae208083","forgejoWorkflowProof":{"runId":9252,"source":"signed_push_receipt","status":"success","results":{},"conclusion":"success","targetStates":{"ccExecution":"success"},"targetJobCount":7,"observedTargetStates":{"ccExecution":"success"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-5315de21d1ccaeff5c3e5654e7be7dab4be9a076","compareStatus":"target_job_success_runtime_verified","workflowRunId":9252,"identitySource":"canonical_release_target_job","runtimeVersion":"1.58.179-terminal-receipt-guard","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:48:44.395526+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","external_id":"forgejo-main-5315de21d1cc","receipt_type":"canonical_release_status","idempotency_key":"mission:fbc90a92-20eb-4060-91b4-9e503255820d:forgejo-release-status:5315de21d1ccaeff5c3e5654e7be7dab4be9a076:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"6d74ea10-39ce-42df-9a16-1055263dd355","command_center_event_id":"fbc90a92-20eb-4060-91b4-9e503255820d"},{"id":"1d758d38-de61-45bc-8f7f-4764d4a72d3f","source":"cc-execution","status":"waiting","payload":{"kind":"heartbeat","message":"Still active in visual proof.","nextAction":{"lane":"onrunner","action":"verify_visual","reason":"release_verified_existing_visual_job_pending_reconciliation","automationAllowed":true,"ownerActionRequired":false},"silenceBudgetMs":15000,"semanticCheckpointSignature":"{\"stateMachineVersion\":1,\"phase\":\"visual_proof\",\"ownerFacingState\":null,\"latest\":{\"kind\":\"receipt\",\"key\":\"visual_proof_started\",\"status\":\"pending\",\"proofGate\":\"post_release_visual_proof_started\"},\"activeStep\":{\"key\":\"pull_request\",\"status\":\"waiting\",\"lane\":\"cc-execution\"},\"nextStep\":{\"key\":\"release\",\"status\":\"waiting\",\"lane\":\"production-release-conductor\"},\"nextSafeAction\":{\"action\":\"verify_visual\",\"lane\":\"onrunner\",\"reason\":\"release_verified_existing_visual_job_pending_reconciliation\",\"automationAllowed\":true,\"ownerActionRequired\":false},\"executionOwnership\":{\"active\":false,\"state\":\"waiting\",\"executor\":null,\"lane\":\"cc-execution\",\"nextAction\":\"verify_visual\",\"recoveryOwner\":\"onrunner\"},\"acceptance\":{\"total\":2,\"verified\":1,\"pending\":1,\"percent\":50,\"satisfied\":false,\"verifiedIds\":[\"proof-production\"],\"pendingIds\":[\"proof-visual\"]},\"stall\":{\"stalled\":false,\"reason\":\"within_deadline\",\"step\":\"visual_proof\",\"deadlineAt\":\"2026-09-24T09:29:25.221989+00:00\",\"recoveryAction\":null},\"blocker\":null,\"terminal\":false,\"branch\":\"ai/objective-first-repair-0a680ea028cd\",\"prNumber\":3598,\"sourceSha\":\"73e6e462c7a9cba64327b0c32c4926a3176a30da\",\"deploymentId\":\"forgejo-main-73e6e462c7a9\"}"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:48:15.435335+00:00","proof_gate":"owner_progress_heartbeat","source_sha":null,"external_id":null,"receipt_type":"owner_progress_heartbeat","idempotency_key":"mission:0a680ea0-28cd-4751-b264-c7ac0f65951b:owner-progress-heartbeat:119348593","mission_step_id":"a91cc319-4b1a-439c-98d7-d8e076a6440b","command_center_event_id":"0a680ea0-28cd-4751-b264-c7ac0f65951b"},{"id":"5be3e384-953c-4a3c-bdb8-3eb21e5414a1","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"objective_received","branch":null,"reason":"canonical_release_queue_busy:11504","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"029b9c68-2623-44fe-b8f7-9e229d77e5dc","operation":"execute_mission","proofGate":"canonical_release_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":467,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":356,"providerAuthMs":0,"shipAndProveMs":151,"ledgerPrepareMs":356,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":356,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":356,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"029b9c68-2623-44fe-b8f7-9e229d77e5dc"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1393,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:49:21.829895+00:00","proof_gate":"canonical_release_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:029b9c68-2623-44fe-b8f7-9e229d77e5dc:execute_mission:canonical_release_blocked:current-generation","mission_step_id":"49252273-3dc7-4521-8b61-eeb4cab2fa88","command_center_event_id":"029b9c68-2623-44fe-b8f7-9e229d77e5dc"},{"id":"fe93fed9-d9ad-4382-ad04-03a89e609469","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-4489b794fe0b","prNumber":4178,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:37:15.1212+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6","external_id":"4178","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:4489b794-fe0b-4298-b860-3ec38862b32d:merged-pr:4178:df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6","mission_step_id":"dc7ade8b-0029-4a5d-ad0d-f343700f81e5","command_center_event_id":"4489b794-fe0b-4298-b860-3ec38862b32d"},{"id":"4be6394a-9dd2-4aca-bce8-4f5b005c3d45","source":"cc-execution","status":"release_verified_contract_pending","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/done-means-live-terminal-receipt-guard","reason":null,"status":"release_verified_contract_pending","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3022,"terminal":false,"missionId":"8fc15acd-376e-4e45-84e7-42bebd952fe5","operation":"execute_mission","proofGate":"canonical_release_already_verified","sourceSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":443,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":72,"approvedPlanMs":0,"missionSetupMs":3735,"providerAuthMs":0,"shipAndProveMs":290,"ledgerPrepareMs":991,"ledgerReconcileMs":0,"lineageReconcileMs":2744,"resolvePreflightMs":3735,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":991,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"8fc15acd-376e-4e45-84e7-42bebd952fe5"},"performance":null,"deploymentId":"forgejo-main-5315de21d1cc","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2668,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:49:33.327233+00:00","proof_gate":"canonical_release_already_verified","source_sha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","external_id":"forgejo-main-5315de21d1cc","receipt_type":"execute_mission","idempotency_key":"mission:8fc15acd-376e-4e45-84e7-42bebd952fe5:execute_mission:canonical_release_already_verified:current-generation","mission_step_id":"2a09d368-0e3e-4a52-be6b-f9bfcfc2cdaf","command_center_event_id":"8fc15acd-376e-4e45-84e7-42bebd952fe5"},{"id":"f1a23455-359e-4cb4-a2af-7811b2641cca","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-2274c364f228","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":null,"terminal":false,"missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":594,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":485,"providerAuthMs":0,"ledgerPrepareMs":485,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":485,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":485,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":7075,"likelyAffectedFiles":["src/routes/ownerRoutes.tsx"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:55:04.815498+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"453fd82c-6afa-4236-8d04-bb9c38e067d7","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"2a4235ce-1719-4016-9205-304b1f0e0e63","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":null,"reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":1766,"releaseCount":0,"toolCallCount":1,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":"2026-09-24T14:49:21.783Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"029b9c68-2623-44fe-b8f7-9e229d77e5dc","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"6d9b56783d9e04e68a7981de0150f8fc1ebad486","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1015,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":362,"providerAuthMs":0,"shipAndProveMs":708,"ledgerPrepareMs":362,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":362,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":362,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"029b9c68-2623-44fe-b8f7-9e229d77e5dc"},"performance":null,"deploymentId":"forgejo-main-6d9b56783d9e","releaseState":null,"workflowRunId":11505,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2682,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:49:44.833238+00:00","proof_gate":"canonical_release_dispatched","source_sha":"6d9b56783d9e04e68a7981de0150f8fc1ebad486","external_id":"forgejo-main-6d9b56783d9e","receipt_type":"execute_mission","idempotency_key":"mission:029b9c68-2623-44fe-b8f7-9e229d77e5dc:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"73ac36bc-d68e-4b4a-a56e-76aaf7361c07","command_center_event_id":"029b9c68-2623-44fe-b8f7-9e229d77e5dc"},{"id":"33f5532f-07ac-4dfd-b56f-c8d05868f424","source":"cc-execution","status":"release_reconciliation_pending","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/objective-first-repair-9f2c0fa6a524","reason":null,"status":"release_reconciliation_pending","metrics":{"receiptBytes":22559,"releaseCount":0,"toolCallCount":13,"repeatedCallCount":5,"executorlessWaitMs":1106385,"firstUsefulResultAt":"2026-09-24T18:47:09.844Z","recoveryAttemptCount":1,"ownerInterruptionCount":0},"version":"1.58.261-nonvisual-proof-precedence","prNumber":3657,"terminal":false,"missionId":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8","operation":"execute_mission","proofGate":"canonical_release_reconciliation_pending","sourceSha":"93d519f283443e94374143d6b253eeb8c232a355","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1274,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":150,"approvedPlanMs":0,"missionSetupMs":1327,"providerAuthMs":0,"shipAndProveMs":708,"ledgerPrepareMs":338,"ledgerReconcileMs":0,"lineageReconcileMs":989,"resolvePreflightMs":1327,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":338,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"reconcile_release","receiptRef":{"mode":"full","missionId":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8"},"performance":null,"deploymentId":"forgejo-main-93d519f28344","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2547,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T19:05:30.095903+00:00","proof_gate":"canonical_release_reconciliation_pending","source_sha":"93d519f283443e94374143d6b253eeb8c232a355","external_id":"forgejo-main-93d519f28344","receipt_type":"execute_mission","idempotency_key":"mission:9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8:execute_mission:canonical_release_reconciliation_pending:current-generation","mission_step_id":"f2e00e13-442c-4918-bfaa-70713bf49ac3","command_center_event_id":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8"},{"id":"5cf78abf-44be-42f1-9bee-eaa551a71545","source":"cc-execution","status":"recorded","payload":{"objective":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","tenantRef":"pcg","receivedAt":"2026-09-29T19:55:29.662Z","fingerprint":"4a601be97446043e6a2315e4f17f68b99cf76f647d7ed128e4dd188e00f8fbd6","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":false,"objective":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","proofKinds":[],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","wordingChanged":false,"canonicalIntent":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","constraints":[{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"standard","blastRadius":"scoped"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"targeted","interactionRequired":false,"runtimeProofRequired":true},"scope":{"route":"https://whatsmyprogress.com/pcg","roleRef":null,"tenantRef":"pcg","sourceTargets":[]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"normal","deadlineSignals":[],"deadlineExplicit":false},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":["source_targets_until_repository_resolution","release_targets_until_changed_paths","deadline"],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"parallel_non_overlapping_tenant_work","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["mobile","desktop"],"behavioral":false,"visualProofScope":"targeted"},"dependencies":{"requiredDomains":["frontend","release_ownership","live_production_proof"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":[]},"inputSignals":{"rawUtterance":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","canonicalIntent":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","route":"https://whatsmyprogress.com/pcg","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","route":"https://whatsmyprogress.com/pcg","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Gate-is-green-for-existing-PR-4174-at-head-ec96b6f1d63eafc36da1d39c38b99b317b29add7.-Squash-merge-th","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:55:29.995004+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:835f8c32-adf3-415d-a1ad-0c1d8d46234a:tenant-workstream-contribution:4a601be97446043e6a2315e4f17f68b99cf76f647d7ed128e4dd188e00f8fbd6","mission_step_id":null,"command_center_event_id":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},{"id":"a3d1a235-d718-474d-91fe-d47db58f0154","source":"cc-execution","status":"recorded","payload":{"objective":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","tenantRef":"pcg","receivedAt":"2026-09-29T20:39:02.843Z","fingerprint":"fc8db657a77e455893a5d3871224fa3ed491951b73d46d7049d6160e228ab787","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":false,"objective":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","proofKinds":[],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","wordingChanged":false,"canonicalIntent":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","constraints":[{"id":"visual-artifact-scope","statement":"The requested visual artifact type is authoritative: workspace only; must not include website. Do not add unrelated or mixed visual surfaces unless the owner explicitly requested them.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-content-truth","statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"brand-asset-authority","statement":"Supplied brand assets are source-authoritative. They must not be redrawn, morphed, recolored, restyled, substituted, cropped, or regenerated unless the owner explicitly requests that transformation.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","statement":"Visual work is isolated to pcg. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","statement":"The requested mobile viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"reference-visual-fidelity","statement":"The approved reference owns the material visual composition: hierarchy, major geometry, typography scale, spacing rhythm, image placement/crop, color treatment, radii, shadows/glow, and overall density. Material deviation is a failed visual acceptance, not a stylistic reinterpretation.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-visual"]},{"id":"responsive-visual-continuity","statement":"Responsive adaptation may reflow for the target viewport, but it must preserve information hierarchy, branding, functionality, and design language. It must not invent a second design.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-visual"]},{"id":"reference-visual-authority","statement":"The supplied or approved reference visual is immutable acceptance evidence. Generating another mockup, image, or concept cannot satisfy this implementation request; completion requires source implementation, deployment, and reference-matched visual proof.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-visual"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"elevated","blastRadius":"broad"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"broad","interactionRequired":false,"runtimeProofRequired":true},"scope":{"route":"/pcg/workspace?tool=settings&section=profile","roleRef":"owner","tenantRef":"pcg","sourceTargets":["src/components/platform/TenantBrandMediaSettings.tsx","src/components/platform/PlatformProfileEditor.tsx","src/pages/settings/TenantSettingsPageWithWebsiteAssets.tsx","src/lib/tenantMedia.ts","src/lib/tenants/tenantMediaBranding.ts","src/shells/modesTenantShell.ts","supabase/functions/tenant-media-library/index.ts"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"normal","deadlineSignals":[],"deadlineExplicit":false},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":["deadline"],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"parallel_non_overlapping_tenant_work","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["desktop","mobile"],"behavioral":false,"visualProofScope":"broad"},"dependencies":{"requiredDomains":["frontend","backend_runtime","schema_data_storage","provider_configuration","release_ownership","live_production_proof"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["frontend","supabaseEdge"]},"inputSignals":{"rawUtterance":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","canonicalIntent":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live on /pcg/workspace?tool=settings&section=profile desktop/mobile plus runtime proof for one background video and one MODES card video.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live","route":"/pcg/workspace?tool=settings&section=profile","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Platform-wide Profile/Settings media upgrade: every configurable visual media slot must support video uploads where the destination supports motion media, with opacity and scale/zoom controls in Profile. Update shared TenantBrandMediaSettings background/hero and MODES media controls to accept images plus MP4/M4V/MOV/WebM; keep logos image-only. Previews and actual consumers must render video muted, looped, autoplay, playsInline, no controls, with the same position/scale/opacity/blur/fit behavior as images. Upgrade tenant-media-library promotion for background/hero/MODES from image-only to image-or-video; never request image transformation variants for video. Persist mime/media kind and preserve all existing image assets/settings. Apply the same media-type-aware controls to WMP/BMD Profile/Settings hero/background/cover/general slots while preserving WMP loading-video behavior. Do not redesign Profile/Settings. Gate, merge, release frontend + tenant-media-library backend, and prove live","route":"/pcg/workspace?tool=settings&section=profile","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Platform-wide-Profile-Settings-media-upgrade:-every-configurable-visual-media-slot-must-support-vide","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"a965e1f5f0e1e648f0747259ca6fa3febedefe2c3c0b868ee273fa7dc339fd7a","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:39:03.554344+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:25e1b513-2e66-40ae-8aea-013e14872817:tenant-workstream-contribution:fc8db657a77e455893a5d3871224fa3ed491951b73d46d7049d6160e228ab787","mission_step_id":null,"command_center_event_id":"25e1b513-2e66-40ae-8aea-013e14872817"},{"id":"cd9629b4-dd30-454d-a8fe-5dc6eaf67e06","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","frontend-cloudflare/live":"pending"},"mainSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","missing":[],"pending":["forgejo-release/workflow","frontend-cloudflare/live"],"required":["forgejo-main/source","forgejo-release/workflow","frontend-cloudflare/live"],"sourceSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"frontend":"pending"},"requestContractHash":"0a51398bd6ad2d7c9c234db2e351a96075c2845e869c23faafc1c149aaa938a3","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9254","runId":9254,"status":"running","sourceSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"frontend":"pending"},"targetJobCount":7,"observedTargetStates":{"frontend":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"5315de21d1ccaeff5c3e5654e7be7dab4be9a076","sourceSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","changedPaths":["src/__tests__/contracts/big-papis-canonical-customer-proposals.contract.test.ts","src/pages/proposals/UniversalProposalWorkspace.tsx"],"changedPathCount":2,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T17:52:33.558176+00:00","proof_gate":"canonical_release_pending","source_sha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:289e3d5a-4d61-4c79-abbd-bddad4986453:forgejo-release-status:6c0aae1227b24a2e0741b75f09631e88ac9337c6:pending:forgejo-main/source=success|forgejo-release/workflow=pending|frontend-cloudflare/live=pending","mission_step_id":"e99d9824-27ba-4c3f-a0f7-3c1d8d85d9ac","command_center_event_id":"289e3d5a-4d61-4c79-abbd-bddad4986453"},{"id":"bd0a572a-3f0c-46c9-bcbc-27dc05933366","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-5ea67245081d","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3023,"terminal":false,"missionId":"5ea67245-081d-4e7f-b1ab-b6c933019c4d","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":14095,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":7502,"missionSetupMs":540,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":540,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":540,"repositoryMutationMs":6593,"repositoryProviderMs":6593,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":3395,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":540,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":3198},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"5ea67245-081d-4e7f-b1ab-b6c933019c4d"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3688,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:23:45.907221+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3023","receipt_type":"execute_mission","idempotency_key":"mission:5ea67245-081d-4e7f-b1ab-b6c933019c4d:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"e623052d-107c-4b29-b4d2-4f5006cf0201","command_center_event_id":"5ea67245-081d-4e7f-b1ab-b6c933019c4d"},{"id":"3309df29-f551-4f8e-9362-bb152f29f1c4","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/proposal-render-fallback-cc3807e4","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3024,"terminal":false,"missionId":"cc3807e4-6a0c-4ae6-942e-81b659759c2b","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4716,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1394,"missionSetupMs":421,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":421,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":421,"repositoryMutationMs":3322,"repositoryProviderMs":3322,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":1814,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":421,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1508},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"cc3807e4-6a0c-4ae6-942e-81b659759c2b"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","interaction"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3318,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"766cfaa7-ac42-46c8-bbef-69d13268a29d","created_at":"2026-09-17T18:27:49.335416+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3024","receipt_type":"execute_mission","idempotency_key":"mission:cc3807e4-6a0c-4ae6-942e-81b659759c2b:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"716d55d0-6811-4ac1-8153-7d7a270f3e3b","command_center_event_id":"cc3807e4-6a0c-4ae6-942e-81b659759c2b"},{"id":"779b25e1-2ab0-4436-a4de-49ec2770bfa1","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-c23cb8e10825","writes":[],"patches":[],"approved":true,"missionId":"c23cb8e1-0825-40c0-befd-36be72161100","repository":"noel/KnockLaunchOS","ownerApproved":true,"anchored_edits":[{"path":"src/pages/applications/CreativeStudioApplicationRoute.tsx","after":"type LeftRailTab = 'layouts' | 'saved' | 'assets' | 'layers';\ntype MobilePanel = 'canvas' | 'layouts' | 'saved' | 'assets' | 'layers' | 'edit';","before":"type LeftRailTab = 'layouts' | 'saved' | 'assets' | 'layers';"}],"implementation":{"files":[],"writes":[]},"durableMutationResume":true},"recovery":false,"fingerprint":"d3a798f9d2212a5f28d8c3897d3c4f20860268bdb8cc7ca68a6af15378bddcd3","replayCount":0,"serializedBytes":608},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:12:01.120751+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:c23cb8e1-0825-40c0-befd-36be72161100:repository-mutation-intent:d3a798f9d2212a5f28d8c3897d3c4f20860268bdb8cc7ca68a6af15378bddcd3:0","mission_step_id":"52d6ff09-15a2-43ba-b1fc-305723fa4905","command_center_event_id":"c23cb8e1-0825-40c0-befd-36be72161100"},{"id":"de286434-a866-4848-b5b0-eb3b764dfa4d","source":"cc-execution","status":"blocked","payload":{"reason":"anchored_edit_invalid","fingerprint":"d3a798f9d2212a5f28d8c3897d3c4f20860268bdb8cc7ca68a6af15378bddcd3"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:12:03.051294+00:00","proof_gate":"repository_mutation_intent_deterministic_failure","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent_blocked","idempotency_key":"mission:c23cb8e1-0825-40c0-befd-36be72161100:repository-mutation-intent-blocked:d3a798f9d2212a5f28d8c3897d3c4f20860268bdb8cc7ca68a6af15378bddcd3","mission_step_id":"52d6ff09-15a2-43ba-b1fc-305723fa4905","command_center_event_id":"c23cb8e1-0825-40c0-befd-36be72161100"},{"id":"57da2df5-ede5-463e-851e-687297cb14b5","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"src/routes/ownerRoutes.tsx","content":"/**\n * Owner Routes Configuration\n * Routes for tenant owners — all lazy-loaded to keep initial bundle small.\n */\n\nimport React, { Suspense } from 'react';\nimport { Navigate, Route, useLocation, useParams } from 'react-router-dom';\nimport { Loader2 } from 'lucide-react';\nimport { UnifiedProtectedRoute } from '@/components/UnifiedProtectedRoute';\nimport { PageLoadingSkeleton } from '@/components/ux/PageLoadingSkeleton';\nimport { WorkspaceTenantBoundary } from '@/components/WorkspaceTenantBoundary';\nimport { lazyWithRetry } from '@/lib/lazyWithRetry';\nimport {\n  BIG_PAPIS_LEGACY_OWNER_BASE_PATH,\n  BIG_PAPIS_OWNER_BASE_PATH,\n  BIG_PAPIS_OWNER_DASHBOARD_PATH,\n  FINANCIAL_RECORDS_OWNER_BASE_PATH,\n  SAVAGE_PIZZA_OWNER_BASE_PATH,\n} from '@/lib/tenantUtils';\nimport { useAuth } from '@/contexts/AuthContext';\nimport { useMultiTenant, type Tenant } from '@/contexts/MultiTenantContext';\nimport TenantModesShell from '@/shells/TenantModesShell';\nimport { UNIVERSAL_TENANT_PROFILE_ROUTE } from '@/lib/tenants/tenantAvatarMenuContract';\nimport { BIG_PAPIS_BUSINESS_DESTINATIONS } from '@/lib/mobileVendor/bigPapisBusinessContext';\n\nconst BigPapisToday = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisToday'));\n\nconst CafeQsrWorkspace = lazyWithRetry(() => import('@/pages/mobile-vendor/ThirstyPandaWorkspace'));\nconst BigPapisOwner = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisOwner'));\nconst BigPapisOwnerShell = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisOwnerShell'));\nconst BigPapisInventory = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisInventory'));\nconst BigPapisStartPopup = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisStartPopup'));\nconst BigPapisBusinessTools = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisBusinessTools'));\nconst BigPapisEventDay = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisEventDay'));\nconst BigPapisCustomers = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisCustomersPremium'));\nconst BigPapisCustomerDetail = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisCustomersPremium').then((module) => ({ default: module.BigPapisCustomerDetail })));\nconst BigPapisMoney = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisMoney'));\nconst BigPapisInbox = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisInbox'));\nconst BigPapisTeam = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisTeam'));\nconst BigPapisBrand = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisBrand'));\nconst BigPapisQuotes = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisQuotes'));\nconst BigPapisOperations = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisOperations'));\nconst BigPapisBusinessPulse = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisBusinessPulse'));\nconst BigPapisAds = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisAds'));\nconst BigPapisFoodTruckLove = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisFoodTruckLove'));\nconst MailWorkspace = lazyWithRetry(() => import('@/components/communications/email/MailWorkspace'));\nconst BigPapisEventsHub = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisEventsHub'));\nconst BigPapisEventsAdvanced = lazyWithRetry(() => import('@/pages/mobile-vendor/BigPapisEvents'));\nconst OwnerDashboard = lazyWithRetry(() => import('@/pages/owner/OwnerDashboard'));\nconst OwnerRouteDirectory = lazyWithRetry(() => import('@/pages/owner/OwnerRouteDirectory'));\nconst OwnerQrCodeCreator = lazyWithRetry(() => import('@/pages/owner/OwnerQrCodeCreator'));\nconst LeadWorkspace = lazyWithRetry(() => import('@/pages/crm/LeadWorkspace/index'));\nconst UnifiedWorkspaceShell = lazyWithRetry(() => import('@/pages/crm/UnifiedWorkspace/index'));\nconst OwnerContacts = lazyWithRetry(() => import('@/pages/owner/OwnerContacts'));\nconst OwnerRebuttals = lazyWithRetry(() => import('@/pages/owner/OwnerRebuttals'));\nconst RebuttalEffectiveness = lazyWithRetry(() => import('@/pages/owner/RebuttalEffectiveness'));\nconst OwnerSettings = lazyWithRetry(() => import('@/pages/owner/OwnerSettings'));\nconst OwnerPipelines = lazyWithRetry(() => import('@/pages/owner/OwnerPipelines'));\nconst OwnerUsers = lazyWithRetry(() => import('@/pages/owner/OwnerUsers'));\nconst OwnerOnboarding = lazyWithRetry(() => import('@/pages/owner/OwnerOnboarding'));\nconst OwnerReports = lazyWithRetry(() => import('@/pages/owner/OwnerReports'));\nconst OwnerControlHub = lazyWithRetry(() => import('@/pages/owner/OwnerControlHub'));\nconst OwnerFieldOps = lazyWithRetry(() => import('@/pages/owner/OwnerFieldOps'));\nconst OwnerCrewDispatch = lazyWithRetry(() => import('@/pages/owner/OwnerCrewDispatch'));\nconst OwnerDrive = lazyWithRetry(() => import('@/pages/owner/OwnerDrive'));\nconst OwnerAppointments = lazyWithRetry(() => import('@/pages/owner/OwnerAppointments'));\nconst OwnerPDFTemplates = lazyWithRetry(() => import('@/pages/owner/OwnerPDFTemplates'));\nconst OwnerAcademyOversight = lazyWithRetry(() => import('@/pages/owner/OwnerAcademyOversight'));\nconst OwnerBranding = lazyWithRetry(() => import('@/pages/owner/OwnerBranding'));\nconst OwnerInvoices = lazyWithRetry(() => import('@/pages/owner/OwnerInvoices'));\nconst OwnerEmailSuite = lazyWithRetry(() => import('@/pages/owner/OwnerEmailSuite'));\nconst OwnerVoicemailPresets = lazyWithRetry(() => import('@/pages/owner/OwnerVoicemailPresets'));\nconst OwnerWorkflows = lazyWithRetry(() => import('@/pages/owner/OwnerWorkflows'));\nconst OwnerDocuments = lazyWithRetry(() => import('@/pages/owner/OwnerDocuments'));\nconst OwnerPricing = lazyWithRetry(() => import('@/pages/owner/OwnerPricing'));\nconst OwnerStorms = lazyWithRetry(() => import('@/pages/owner/OwnerStorms'));\nconst OwnerAgreements = lazyWithRetry(() => import('@/pages/owner/OwnerAgreements'));\nconst OwnerAutomations = lazyWithRetry(() => import('@/pages/owner/OwnerAutomations'));\nconst OwnerDNCPortal = lazyWithRetry(() => import('@/pages/owner/OwnerDNCPortal'));\nconst OwnerPlan = lazyWithRetry(() => import('@/pages/owner/OwnerPlan'));\nconst OwnerLeadCampaigns = lazyWithRetry(() => import('@/pages/owner/OwnerLeadCampaigns'));\nconst OwnerImport = lazyWithRetry(() => import('@/pages/owner/OwnerImport'));\nconst OwnerPADashboard = lazyWithRetry(() => import('@/pages/owner/OwnerPADashboard'));\nconst OwnerPAFinancialCenter = lazyWithRetry(() => import('@/pages/owner/OwnerPAFinancialCenter'));\nconst OwnerPAStaffCompliance = lazyWithRetry(() => import('@/pages/owner/OwnerPAStaffCompliance'));\nconst OwnerFeatureOverrides = lazyWithRetry(() => import('@/pages/owner/OwnerFeatureOverrides'));\nconst OwnerPermitSources = lazyWithRetry(() => import('@/pages/owner/OwnerPermitSources'));\nconst OwnerScoring = lazyWithRetry(() => import('@/pages/owner/OwnerScoring'));\nconst OwnerWeeklyReports = lazyWithRetry(() => import('@/pages/owner/OwnerWeeklyReports'));\nconst OwnerSidekickLogs = lazyWithRetry(() => import('@/pages/owner/OwnerSidekickLogs'));\nconst CommunicationsInbox = lazyWithRetry(() => import('@/pages/communications/CommunicationsInbox'));\nconst SavagePizzaWorkspace = lazyWithRetry(() => import('@/pages/finance-vendor/SavagePizzaWorkspace'));\nconst CafeQsrStorefront = lazyWithRetry(() => import('@/pages/cafe-qsr/ThirstyPandaPublic'));\nconst UniversalFinanceWorkspace = lazyWithRetry(() => import('@/pages/finance-vendor/SavagePizzaWorkspace').then((module) => ({ default: module.UniversalFinanceWorkspace })));\n\nconst lazy = (Component: React.LazyExoticComponent<React.ComponentType<any>>) => (\n  <UnifiedProtectedRoute requireOwner>\n    <Suspense fallback={<PageLoadingSkeleton variant=\"minimal\" />}>\n      <Component />\n    </Suspense>\n  </UnifiedProtectedRoute>\n);\n\nconst authenticated = (Component: React.LazyExoticComponent<React.ComponentType<any>>) => (\n  <UnifiedProtectedRoute>\n    <Suspense fallback={<PageLoadingSkeleton variant=\"minimal\" />}>\n      <Component />\n    </Suspense>\n  </UnifiedProtectedRoute>\n);\n\nfunction isBigPapisWorkspaceTenant(tenant?: Tenant | null): boolean {\n  if (!tenant) return false;\n  const slug = String(tenant.company_slug || '').trim().toLowerCase();\n  const tenantType = String(tenant.tenant_type || '').trim().toLowerCase();\n  const workspaceType = String((tenant.settings as { workspace_type?: string } | null)?.workspace_type || '').trim().toLowerCase();\n  const isMobileVendor = tenantType === 'mobile_vendor' || workspaceType === 'mobile_vendor';\n  return isMobileVendor && (slug === 'big-papis' || slug === 'big-papis-coquito-iceys');\n}\n\nfunction BigPapisTenantBoundary({ children }: { children: React.ReactNode }) {\n  const { activeTenant, memberships, isLoading, switchTenant } = useMultiTenant();\n  const matchingMembership = React.useMemo(\n    () => memberships.find((membership) => isBigPapisWorkspaceTenant(membership.tenant)) || null,\n    [memberships],\n  );\n  const activeMatches = isBigPapisWorkspaceTenant(activeTenant);\n\n  return (\n    <WorkspaceTenantBoundary\n      activeMatches={activeMatches}\n      isLoading={isLoading}\n      matchingTenantId={matchingMembership?.tenant_id}\n      switchTenant={switchTenant}\n      redirectTo=\"/select-tenant?workspace=big-papis\"\n      loading={<PageLoadingSkeleton variant=\"minimal\" />}\n      logLabel=\"BigPapisTenantBoundary\"\n    >\n      {children}\n    </WorkspaceTenantBoundary>\n  );\n}\n\nfunction BigPapisOwnerAccessBoundary({ children }: { children: React.ReactNode }) {\n  const { user, session, loading: authLoading } = useAuth();\n  const {\n    activeTenant,\n    roles,\n    isLoading: tenantLoading,\n    isTenantOwner,\n    isAdminOrHigher,\n    hasGodModeAnywhere,\n  } = useMultiTenant();\n  const [roleGraceElapsed, setRoleGraceElapsed] = React.useState(false);\n  const activeTenantId = activeTenant?.id || '';\n  const directOwner = Boolean(user?.id && activeTenant?.owner_id === user.id);\n  const hasOwnerAccess = Boolean(\n    directOwner\n    || isTenantOwner()\n    || isAdminOrHigher()\n    || hasGodModeAnywhere()\n  );\n  const waitingForRoles = Boolean(\n    user?.id\n    && activeTenantId\n    && !hasOwnerAccess\n    && roles.length === 0\n  );\n\n  React.useEffect(() => {\n    setRoleGraceElapsed(false);\n    if (!waitingForRoles) return undefined;\n    const timeoutId = window.setTimeout(() => setRoleGraceElapsed(true), 1800);\n    return () => window.clearTimeout(timeoutId);\n  }, [activeTenantId, user?.id, waitingForRoles]);\n\n  // A verified active Big Papi tenant stays interactive while background tenant hydration finishes.\n  const activeBigPapisTenantReady = Boolean(activeTenantId && isBigPapisWorkspaceTenant(activeTenant));\n  if (authLoading || (!activeBigPapisTenantReady && tenantLoading) || (waitingForRoles && !roleGraceElapsed)) {\n    return <BigPapisRouteLoading />;\n  }\n  if (!user || !session) {\n    return <Navigate to=\"/\" replace />;\n  }\n  if (!isBigPapisWorkspaceTenant(activeTenant)) {\n    return <Navigate to=\"/select-tenant?workspace=big-papis\" replace />;\n  }\n  if (!hasOwnerAccess) {\n    return <Navigate to=\"/select-tenant?workspace=big-papis\" replace />;\n  }\n  return <>{children}</>;\n}\n\nfunction BigPapisCustomersRoute() {\n  return bigPapisLazyContent(BigPapisCustomers);\n}\n\nfunction LegacyBigPapisOwnerRedirect() {\n  const params = useParams();\n  const location = useLocation();\n  const splat = String(params['*'] || '').replace(/^\\/+|\\/+$/g, '');\n  const suffix = splat ? `/${splat}` : '/dashboard';\n  return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}${suffix}${location.search || ''}${location.hash || ''}`} replace />;\n}\n\nfunction LegacyBigPapisMailRedirect() {\n  const location = useLocation();\n  return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/mail${location.search || ''}${location.hash || ''}`} replace />;\n}\n\nfunction BigPapisRouteLoading() {\n  return (\n    <div data-big-papis-route-loading=\"true\" className=\"flex min-h-[38vh] items-start justify-center px-4 pt-16\">\n      <div className=\"inline-flex items-center gap-2 rounded-full border border-white/10 bg-[#071019] px-4 py-2.5 text-xs font-black text-white/70 shadow-xl shadow-black/20\">\n        <Loader2 className=\"h-4 w-4 animate-spin text-[#72dbff]\" />\n        Opening…\n      </div>\n    </div>\n  );\n}\n\nfunction bigPapisLazyContent(Component: React.LazyExoticComponent<React.ComponentType<any>>) {\n  return (\n    <Suspense fallback={<BigPapisRouteLoading />}>\n      <Component />\n    </Suspense>\n  );\n}\n\nfunction BigPapisWorkspaceContent() {\n  const location = useLocation();\n  const { memberships } = useMultiTenant();\n  const bigPapisTenantId = React.useMemo(\n    () => memberships.find((membership) => isBigPapisWorkspaceTenant(membership.tenant))?.tenant_id || '',\n    [memberships],\n  );\n  const normalized = location.pathname.toLowerCase().replace(/\\/+$/g, '');\n  const suffix = normalized.startsWith(BIG_PAPIS_OWNER_BASE_PATH)\n    ? normalized.slice(BIG_PAPIS_OWNER_BASE_PATH.length).replace(/^\\/+/, '')\n    : '';\n  const [section = 'dashboard', detail] = suffix.split('/').filter(Boolean);\n\n  switch (section) {\n    case 'dashboard': return detail === 'advanced' ? bigPapisLazyContent(BigPapisOwner) : bigPapisLazyContent(BigPapisToday);\n    case 'pop-up': return detail === 'start' ? bigPapisLazyContent(BigPapisStartPopup) : <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/pop-up/start?bpMode=popup`} replace />;\n    case 'booking': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/events/advanced?new=1`} replace />;\n    case 'events': return detail === 'advanced' ? bigPapisLazyContent(BigPapisEventsAdvanced) : bigPapisLazyContent(BigPapisEventsHub);\n    case 'appointments':\n    case 'calendar': return bigPapisLazyContent(BigPapisEventsHub);\n    case 'tasks': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/calendar?bpMode=plan&tasks=1`} replace />;\n    case 'proposals':\n    case 'quotes': return bigPapisLazyContent(BigPapisQuotes);\n    case 'flavors': return bigPapisLazyContent(BigPapisBrand);\n    case 'customers':\n    case 'contacts': return detail ? <Suspense fallback={<BigPapisRouteLoading />}><BigPapisCustomerDetail customerId={detail} /></Suspense> : <BigPapisCustomersRoute />;\n    case 'leads': return bigPapisLazyContent(BigPapisCustomers);\n    case 'event-day': return bigPapisLazyContent(BigPapisEventDay);\n    case 'drive': return bigPapisLazyContent(OwnerDrive);\n    case 'inbox': return bigPapisLazyContent(BigPapisInbox);\n    case 'communications': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/inbox`} replace />;\n    case 'sms': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/inbox/texts`} replace />;\n    case 'invoices': return bigPapisLazyContent(BigPapisMoney);\n    case 'operations': return bigPapisLazyContent(BigPapisOperations);\n    case 'inventory': return bigPapisLazyContent(BigPapisInventory);\n    case 'more': return bigPapisLazyContent(BigPapisBusinessTools);\n    case 'email':\n    case 'emails': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/mail${location.search || ''}${location.hash || ''}`} replace />;\n    case 'mail': return bigPapisTenantId\n      ? <Suspense fallback={<BigPapisRouteLoading />}><MailWorkspace tenantId={bigPapisTenantId} applicationMode shellIntegrated appearance=\"big-papis\" businessDestinations={BIG_PAPIS_BUSINESS_DESTINATIONS} /></Suspense>\n      : <BigPapisRouteLoading />;\n    case 'grow': return bigPapisLazyContent(OwnerAutomations);\n    case 'automations': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/grow`} replace />;\n    case 'profile': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/${UNIVERSAL_TENANT_PROFILE_ROUTE}`} replace />;\n    case 'settings': return bigPapisLazyContent(OwnerSettings);\n    case 'workflows': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/operations${location.search || ''}${location.hash || ''}`} replace />;\n    case 'documents': return bigPapisLazyContent(OwnerDocuments);\n    case 'agreements': return bigPapisLazyContent(OwnerAgreements);\n    case 'forms': return bigPapisLazyContent(OwnerPDFTemplates);\n    case 'users': return bigPapisLazyContent(BigPapisTeam);\n    case 'team': return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/users`} replace />;\n    case 'onboarding': return bigPapisLazyContent(OwnerOnboarding);\n    case 'import': return bigPapisLazyContent(OwnerImport);\n    case 'reports': return bigPapisLazyContent(BigPapisBusinessPulse);\n    case 'branding': return bigPapisLazyContent(BigPapisBrand);\n    case 'ads': return bigPapisLazyContent(BigPapisAds);\n    case 'community': return bigPapisLazyContent(BigPapisFoodTruckLove);\n    case 'qr': return bigPapisLazyContent(OwnerQrCodeCreator);\n    case 'feature-access': return bigPapisLazyContent(OwnerFeatureOverrides);\n    default: return <Navigate to={BIG_PAPIS_OWNER_DASHBOARD_PATH} replace />;\n  }\n}\n\nfunction BigPapisWorkspaceRoute() {\n  const location = useLocation();\n  // Query parameters select views within a page; they must not destroy its state.\n  const routeIdentity = location.pathname;\n  const normalizedPath = location.pathname.toLowerCase().replace(/\\/+$/g, '');\n  const params = new URLSearchParams(location.search);\n  const genericMode = String(params.get('mode') || '').trim().toLowerCase();\n  const canonicalMode = ['plan', 'popup', 'event', 'office'].includes(genericMode) ? genericMode : '';\n  if (canonicalMode) {\n    params.delete('mode');\n    params.delete('modeApp');\n    params.set('bpMode', canonicalMode);\n    let pathname = location.pathname;\n    if (normalizedPath === BIG_PAPIS_OWNER_DASHBOARD_PATH.toLowerCase()) {\n      pathname = canonicalMode === 'plan'\n        ? `${BIG_PAPIS_OWNER_BASE_PATH}/calendar`\n        : canonicalMode === 'popup'\n          ? `${BIG_PAPIS_OWNER_BASE_PATH}/pop-up/start`\n          : canonicalMode === 'event'\n            ? `${BIG_PAPIS_OWNER_BASE_PATH}/events`\n            : BIG_PAPIS_OWNER_DASHBOARD_PATH;\n    }\n    const search = params.toString();\n    return <Navigate to={`${pathname}${search ? `?${search}` : ''}${location.hash || ''}`} replace />;\n  }\n\n  const isBareModesLanding = normalizedPath === BIG_PAPIS_OWNER_DASHBOARD_PATH.toLowerCase()\n    && !params.get('bpMode');\n\n  const content = (\n    <Suspense fallback={<BigPapisRouteLoading />}>\n      <BigPapisWorkspaceContent key={routeIdentity} />\n    </Suspense>\n  );\n\n  return (\n    <BigPapisTenantBoundary>\n      <BigPapisOwnerAccessBoundary>\n        {isBareModesLanding\n          ? <TenantModesShell>{content}</TenantModesShell>\n          : <BigPapisOwnerShell>{content}</BigPapisOwnerShell>}\n      </BigPapisOwnerAccessBoundary>\n    </BigPapisTenantBoundary>\n  );\n}\n\nfunction OwnerMailApplicationRedirect() {\n  const { activeTenant } = useMultiTenant();\n  const location = useLocation();\n  const suffix = `${location.search || ''}${location.hash || ''}`;\n  if (!activeTenant?.company_slug) return <Navigate to=\"/select-tenant?app=mail\" replace />;\n  if (isBigPapisWorkspaceTenant(activeTenant)) {\n    return <Navigate to={`${BIG_PAPIS_OWNER_BASE_PATH}/mail${suffix}`} replace />;\n  }\n  return <Navigate to={`/${encodeURIComponent(activeTenant.company_slug)}/mail${suffix}`} replace />;\n}\n\nfunction OwnerUsersRoute() {\n  const { activeTenant, getPath } = useMultiTenant();\n  if (activeTenant?.tenant_type === 'PUBLIC_ADJUSTER_FIRM') {\n    return <Navigate to={`${getPath('team-compliance')}?tab=access`} replace />;\n  }\n  return lazy(OwnerUsers);\n}\n\nfunction OwnerCommunicationsRoute() {\n  const { user, session, loading: authLoading } = useAuth();\n  const { activeTenant, roles, isLoading: tenantLoading, getPath, isTenantOwner, isAdminOrHigher } = useMultiTenant();\n  const hasGlobalOwnerRole = roles.some((r) => ['Owner', 'Tenant Owner', 'GodMode', 'Admin'].includes(r.role));\n  const hasOwnerAccess = activeTenant ? (isTenantOwner() || isAdminOrHigher()) : hasGlobalOwnerRole;\n\n  if (authLoading || (tenantLoading && roles.length === 0)) {\n    return <PageLoadingSkeleton variant=\"minimal\" />;\n  }\n\n  if (!user || !session) {\n    return <Navigate to=\"/\" replace />;\n  }\n\n  if (!hasOwnerAccess) {\n    return <Navigate to={`${getPath('communications')}?section=voicemails`} replace />;\n  }\n\n  return (\n    <Suspense fallback={<PageLoadingSkeleton variant=\"minimal\" />}>\n      <CommunicationsInbox ownerShell />\n    </Suspense>\n  );\n}\n\nexport const ownerRoutes = (\n  <>\n    <Route path=\"/owner\" element={lazy(OwnerDashboard)} />\n    <Route path=\"/owner/route-directory\" element={lazy(OwnerRouteDirectory)} />\n    <Route path=\"/owner/qr-code\" element={authenticated(OwnerQrCodeCreator)} />\n    <Route path=\"/owner/qr\" element={<Navigate to=\"/owner/qr-code\" replace />} />\n    <Route path=\"/owner/links\" element={<Navigate to=\"/owner/route-directory\" replace />} />\n\n    {/* Big Papi owns one deterministic wildcard workspace. The shell stays mounted,\n        while BigPapisWorkspaceContent resolves the visible page directly from location.pathname.\n        This intentionally avoids a nested Outlet handoff because Big Papi must update immediately\n        on in-app navigation without requiring a browser refresh. */}\n    <Route path=\"/big-papis/mail\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis/email\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis/emails\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis/email-suite\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path={`${BIG_PAPIS_OWNER_BASE_PATH}/email`} element={<LegacyBigPapisMailRedirect />} />\n    <Route path={`${BIG_PAPIS_OWNER_BASE_PATH}/emails`} element={<LegacyBigPapisMailRedirect />} />\n    <Route path={`${BIG_PAPIS_OWNER_BASE_PATH}/*`} element={<BigPapisWorkspaceRoute />} />\n    <Route path=\"/big-papis-coquito-iceys/email\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis-coquito-iceys/emails\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis-coquito-iceys/mail\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path=\"/big-papis-coquito-iceys/email-suite\" element={<LegacyBigPapisMailRedirect />} />\n    <Route path={`${BIG_PAPIS_LEGACY_OWNER_BASE_PATH}/*`} element={<LegacyBigPapisOwnerRedirect />} />\n    <Route path=\"/owner/big-papis\" element={<Navigate to={BIG_PAPIS_OWNER_DASHBOARD_PATH} replace />} />\n    <Route path=\"/owner/big-papis/*\" element={<LegacyBigPapisOwnerRedirect />} />\n\n    <Route\n      path=\"/cafe-qsr\"\n      element={\n        <UnifiedProtectedRoute>\n          <Suspense fallback={<PageLoadingSkeleton variant=\"minimal\" />}>\n            <CafeQsrStorefront />\n          </Suspense>\n        </UnifiedProtectedRoute>\n      }\n    />\n    <Route path=\"/cafe-qsr/dashboard\" element={<Navigate to=\"/cafe-qsr/owner/dashboard\" replace />} />\n    <Route path=\"/cafe-qsr/owner/*\" element={<UnifiedProtectedRoute requireOwner><CafeQsrWorkspace /></UnifiedProtectedRoute>} />\n\n    <Route path={`${SAVAGE_PIZZA_OWNER_BASE_PATH}/*`} element={<Suspense fallback={<PageLoadingSkeleton variant=\"minimal\" />}><SavagePizzaWorkspace /></Suspense>} />\n    <Route path={`${FINANCIAL_RECORDS_OWNER_BASE_PATH}/*`} element={lazy(UniversalFinanceWorkspace)} />\n\n    <Route path=\"/owner/lead-workspace/:id\" element={lazy(UnifiedWorkspaceShell)} />\n    <Route path=\"/owner/call-logs\" element={<Navigate to=\"/owner/communications?section=calls\" replace />} />\n    <Route path=\"/owner/contacts\" element={lazy(OwnerContacts)} />\n    <Route path=\"/owner/leads\" element={<Navigate to=\"/owner/contacts?view=new-leads\" replace />} />\n    <Route path=\"/owner/clients\" element={<Navigate to=\"/owner/contacts?view=active-clients\" replace />} />\n    <Route path=\"/owner/import\" element={lazy(OwnerImport)} />\n    <Route path=\"/owner/contacts/import\" element={<Navigate to=\"/owner/import\" replace />} />\n    <Route path=\"/owner/appointments\" element={lazy(OwnerAppointments)} />\n    <Route path=\"/owner/rebuttals\" element={lazy(OwnerRebuttals)} />\n    <Route path=\"/owner/rebuttals/effectiveness\" element={lazy(RebuttalEffectiveness)} />\n    <Route path=\"/owner/settings/*\" element={lazy(OwnerSettings)} />\n    <Route path=\"/owner/pipelines\" element={lazy(OwnerPipelines)} />\n    <Route path=\"/owner/users\" element={<OwnerUsersRoute />} />\n    <Route path=\"/owner/onboarding\" element={lazy(OwnerOnboarding)} />\n    <Route path=\"/owner/reports\" element={lazy(OwnerReports)} />\n    <Route path=\"/owner/control-hub\" element={lazy(OwnerControlHub)} />\n    <Route path=\"/owner/field-ops\" element={lazy(OwnerFieldOps)} />\n    <Route path=\"/owner/crew-dispatch\" element={lazy(OwnerCrewDispatch)} />\n    <Route path=\"/owner/drive\" element={lazy(OwnerDrive)} />\n    <Route path=\"/owner/pdf-templates\" element={lazy(OwnerPDFTemplates)} />\n    <Route path=\"/owner/academy-oversight\" element={lazy(OwnerAcademyOversight)} />\n    <Route path=\"/owner/branding\" element={lazy(OwnerBranding)} />\n    <Route path=\"/owner/invoices\" element={lazy(OwnerInvoices)} />\n    <Route path=\"/owner/emails\" element={<OwnerMailApplicationRedirect />} />\n    <Route path=\"/owner/email\" element={<OwnerMailApplicationRedirect />} />\n    <Route path=\"/owner/mail\" element={<OwnerMailApplicationRedirect />} />\n    <Route path=\"/owner/email-templates\" element={lazy(OwnerEmailSuite)} />\n    <Route path=\"/owner/voicemail-presets\" element={lazy(OwnerVoicemailPresets)} />\n    <Route path=\"/owner/workflows\" element={lazy(OwnerWorkflows)} />\n    <Route path=\"/owner/documents\" element={lazy(OwnerDocuments)} />\n    <Route path=\"/owner/pricing\" element={lazy(OwnerPricing)} />\n    <Route path=\"/owner/storms\" element={lazy(OwnerStorms)} />\n    <Route path=\"/owner/agreements\" element={lazy(OwnerAgreements)} />\n    <Route path=\"/owner/automations\" element={lazy(OwnerAutomations)} />\n    <Route path=\"/owner/profile\" element={<Navigate to={`/${UNIVERSAL_TENANT_PROFILE_ROUTE}`} replace />} />\n    <Route path=\"/owner/dnc-portal\" element={lazy(OwnerDNCPortal)} />\n    <Route path=\"/owner/plan\" element={lazy(OwnerPlan)} />\n    <Route path=\"/owner/lead-campaigns\" element={lazy(OwnerLeadCampaigns)} />\n    <Route path=\"/owner/pa-dashboard\" element={lazy(OwnerPADashboard)} />\n    <Route path=\"/owner/pa-financials\" element={lazy(OwnerPAFinancialCenter)} />\n    <Route path=\"/owner/pa-team-compliance\" element={lazy(OwnerPAStaffCompliance)} />\n    <Route path=\"/owner/pa-lor-templates\" element={<Navigate to=\"/owner/documents?tab=documents\" replace />} />\n    <Route path=\"/owner/phone-numbers\" element={<Navigate to=\"/owner/communications?section=numbers\" replace />} />\n    <Route path=\"/owner/outbound-numbers\" element={<Navigate to=\"/owner/communications?section=numbers\" replace />} />\n    <Route path=\"/owner/communications\" element={<OwnerCommunicationsRoute />} />\n    <Route path=\"/owner/feature-access\" element={lazy(OwnerFeatureOverrides)} />\n    <Route path=\"/owner/permit-sources\" element={lazy(OwnerPermitSources)} />\n    <Route path=\"/owner/scoring\" element={lazy(OwnerScoring)} />\n    <Route path=\"/owner/weekly-reports\" element={lazy(OwnerWeeklyReports)} />\n    <Route path=\"/owner/ai-conversations\" element={lazy(OwnerSidekickLogs)} />\n    <Route path=\"/owner/dashboard\" element={<Navigate to=\"/owner\" replace />} />\n    <Route path=\"/owner/setup\" element={<Navigate to=\"/owner/onboarding\" replace />} />\n  </>\n);\n"}],"route":"/big-papis/owner/dashboard","branch":"ai/objective-first-repair-2274c364f228","writes":[],"patches":[],"version":1,"approved":true,"viewport":"desktop","missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","objective":"Apply the exact split-shell Big Papi regression repair on the existing mission/branch. Preserve the bare four-card dashboard in TenantModesShell, restore BigPapisOwnerShell everywhere else, and normalize legacy generic mode/modeApp query state into canonical bpMode routing. Frontend-only. One PR, canonical Gate, squash merge, protected-main frontend release. Do not run Visual Witness.","proofRoute":"/big-papis/owner/calendar?bpMode=plan","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":[],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","ownerApproved":true,"releaseIntent":null,"sourceTargets":[],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"75ee8a15eeabb5e971fe412193135897867a23aae467c2f99072a4b11c1183f4","replayCount":0,"serializedBytes":29261},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:55:21.025984+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:repository-mutation-intent:75ee8a15eeabb5e971fe412193135897867a23aae467c2f99072a4b11c1183f4:0","mission_step_id":"e5f86e85-24d8-4acc-9a94-c173e0c4b5cb","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"dd093af1-2108-4c64-a93e-24130a6f3c0b","source":"cc-execution","status":"recorded","payload":{"objective":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request flow, routes, service scope, and desktop layout. Frontend-only, one fresh ai/* branch, one PR, canonical Gate, squash merge, Cloudflare release.","tenantRef":"321-auto-unlock","receivedAt":"2026-09-24T19:10:25.368Z","fingerprint":"ac5dda21f7033d385ee6bae593b9c6da7fa023745f4efad71e96248d642822ed","workstreamRef":"321autounlock","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request flow, routes, service scope, and desktop layout. Frontend-only, one fresh ai/* branch, one PR, canonical Gate, squash merge, Cloudflare release.","wordingChanged":false,"canonicalIntent":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request flow, routes, service scope, and desktop layout. Frontend-only, one fresh ai/* branch, one PR, canonical Gate, squash merge, Cloudflare release.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request flow, routes, service scope, and desktop layout. Frontend-only, one fresh ai/* branch, one PR, canonical Gate, squash merge, Cloudflare release.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request flow, routes, service scope, and desktop layout. Frontend-only, one fresh ai/* branch, one PR, canonical Gate, squash merge, Cloudflare release.","constraints":[{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request f","route":"https://321autounlock.com/","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Correct the 321 Auto Unlock mobile regression proven by owner: sticky video still scrolls away, white text is still hard to read over the bright waterfront background, and the mobile page is a vertical sprawl. Mobile-only (< lg). Make the video hero FIXED beneath the sticky mobile header (not sticky) so it remains visible while the page scrolls; reserve exact document space so it never covers content or traps scrolling. Keep desktop unchanged. Compact the mobile page aggressively: hero copy becomes a short high-contrast intro panel; emergency notice stays compact; hide the full desktop-style How It Works stack on mobile and replace it with a compact 3-step mobile summary row/card; tighten all vertical gaps/paddings. Improve readability with a localized dark glass/gradient behind mobile hero copy and near-opaque white text plus text-shadow—no full-page black overlay. Align every mobile block to the same centered max-width/gutters. Preserve uploaded background, real video, CTA, request f","route":"https://321autounlock.com/","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Correct-the-321-Auto-Unlock-mobile-regression-proven-by-owner:-sticky-video-still-scrolls-away-white","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"c6baa9b3f74f4b30de7e65ceaa0bb11d4a22c1abd409a196f1b36cf336e7714f","requestContractRevision":1},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T19:10:25.710588+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:91117032-db0b-4d7b-8607-fc41d7e92106:tenant-workstream-contribution:ac5dda21f7033d385ee6bae593b9c6da7fa023745f4efad71e96248d642822ed","mission_step_id":null,"command_center_event_id":"91117032-db0b-4d7b-8607-fc41d7e92106"},{"id":"3ec96af7-88e9-4892-aeb7-3db27505436e","source":"cc-execution","status":"verified","payload":{"ownerWaitSloMs":{"merge_to_live_ms":null,"owner_action_to_pr_ms":null,"green_gate_to_merge_ms":null,"owner_action_to_useful_response_ms":null},"ownerWaitLiveAt":"2026-09-24T19:12:15.132Z"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T19:11:23.197066+00:00","proof_gate":"owner_wait_live_milestone_recorded","source_sha":null,"external_id":null,"receipt_type":"owner_wait_live_milestone","idempotency_key":"mission:9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8:owner-wait-live","mission_step_id":"5dfdb8d0-e589-455f-94e1-832876c4a0bd","command_center_event_id":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8"},{"id":"3cd5633e-cb06-42c8-8cf7-7694bac47988","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"b3be4602184049984dd76da137adc8fb8f299a0c","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"b3be4602184049984dd76da137adc8fb8f299a0c","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"51143220e94a483edbe51e5a46f79d1c80c89c5730217d7957797781e9b6078d","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9258","runId":9258,"status":"success","sourceSha":"b3be4602184049984dd76da137adc8fb8f299a0c","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"ccExecution":"success"},"targetJobCount":7,"observedTargetStates":{"ccExecution":"success"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"b3be4602184049984dd76da137adc8fb8f299a0c","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-b3be4602184049984dd76da137adc8fb8f299a0c","compareStatus":"target_job_success_runtime_verified","workflowRunId":9258,"identitySource":"canonical_release_target_job","runtimeVersion":"1.58.179-terminal-receipt-guard","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"6c0aae1227b24a2e0741b75f09631e88ac9337c6","sourceSha":"b3be4602184049984dd76da137adc8fb8f299a0c","changedPaths":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"changedPathCount":2,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:28:48.59961+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"b3be4602184049984dd76da137adc8fb8f299a0c","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:5ea67245-081d-4e7f-b1ab-b6c933019c4d:forgejo-release-status:b3be4602184049984dd76da137adc8fb8f299a0c:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"faa3663a-a0e7-40c3-94f6-6b97d9baf245","command_center_event_id":"5ea67245-081d-4e7f-b1ab-b6c933019c4d"},{"id":"7f1ce38c-6217-4b7a-a104-8005155367d3","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","frontend-cloudflare/live":"success"},"mainSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","frontend-cloudflare/live"],"sourceSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"frontend":"success"},"requestContractHash":"e4e1f70faf2f9cb7af3368d4e98e81fb3b588671e0bb0f52a21a871b2e512111","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9261","runId":9261,"status":"success","sourceSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"frontend":"success"},"targetJobCount":7,"observedTargetStates":{"frontend":"success"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"b3be4602184049984dd76da137adc8fb8f299a0c","sourceSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","changedPaths":["src/__tests__/contracts/big-papis-proposal-render-fallback.contract.test.ts","src/pages/proposals/UniversalProposalWorkspace.tsx"],"changedPathCount":2,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"766cfaa7-ac42-46c8-bbef-69d13268a29d","created_at":"2026-09-17T18:34:15.994355+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:cc3807e4-6a0c-4ae6-942e-81b659759c2b:forgejo-release-status:09f7a2b645fd5cf9b50dab453a864ffd23892aa4:verified:forgejo-main/source=success|forgejo-release/workflow=success|frontend-cloudflare/live=success","mission_step_id":"669eadb2-90d7-4956-93ca-2367645ef565","command_center_event_id":"cc3807e4-6a0c-4ae6-942e-81b659759c2b"},{"id":"a6626063-d1b2-46f7-8360-43be14f2954f","source":"cc-execution","status":"pending","payload":{"ok":true,"jobId":"a5b466ed-8d80-4c5c-961b-39b575da0204","phase":"universal_visual_witness_supervised","branch":"ai/proposal-render-fallback-cc3807e4","reason":null,"status":"pending","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3024,"terminal":false,"missionId":"cc3807e4-6a0c-4ae6-942e-81b659759c2b","operation":"visual_proof_started","proofGate":"universal_visual_witness_pending","sourceSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","timingsMs":{"wake":215,"total":1665,"submit":1450,"wakeAttempts":1},"nextAction":"Poll inspect_route_status or cancel with inspect_route_cancel.","receiptRef":{"mode":"full","missionId":"cc3807e4-6a0c-4ae6-942e-81b659759c2b"},"performance":null,"deploymentId":null,"releaseState":"verified","workflowRunId":9261,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":715,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"766cfaa7-ac42-46c8-bbef-69d13268a29d","created_at":"2026-09-17T18:34:23.287396+00:00","proof_gate":"post_release_visual_proof_started","source_sha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","external_id":"a5b466ed-8d80-4c5c-961b-39b575da0204","receipt_type":"visual_proof_started","idempotency_key":"mission:cc3807e4-6a0c-4ae6-942e-81b659759c2b:visual-start:a5b466ed-8d80-4c5c-961b-39b575da0204","mission_step_id":"294aa173-5ad3-4638-a99d-bce447e2fd87","command_center_event_id":"cc3807e4-6a0c-4ae6-942e-81b659759c2b"},{"id":"d7cb0342-ccac-4418-85d7-bb1ea159aa37","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-be9ca79b8d4a","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"be9ca79b-8d4a-4989-915e-5caf2dc34b28","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":185,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":872,"providerAuthMs":0,"ledgerPrepareMs":872,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":872,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":872,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"be9ca79b-8d4a-4989-915e-5caf2dc34b28"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3972,"likelyAffectedFiles":["scripts/generate-cc-execution-action-schema.mjs","scripts/visual-witness-hosted-runner/src/bounded-mission-queue.mjs","scripts/visual-witness-hosted-runner/src/mission-gateway.mjs","scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:35:50.86339+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:be9ca79b-8d4a-4989-915e-5caf2dc34b28:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"aa4df150-f315-4114-b02e-9a5f2a5ae03d","command_center_event_id":"be9ca79b-8d4a-4989-915e-5caf2dc34b28"},{"id":"9db665dc-0b63-4960-b1b7-689a554e6a9c","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized corrective-release hardening PR; repair only the stale invariant exposed by Gate 11020.","baseSha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","issuedAt":1790129652417,"expiresAt":1790129832417,"missionId":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1","authorizationId":"d910b98b-26f2-4268-9ce9-975603b1e57d","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:14:12.936053+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:d910b98b-26f2-4268-9ce9-975603b1e57d","mission_step_id":"bf00bfdb-1966-4997-bb8b-167cb5a62899","command_center_event_id":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1"},{"id":"5383c85f-7442-4e41-b4bd-086860f5b590","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/visual-witness-supervisor-restart-exhaustion","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3025,"terminal":false,"missionId":"69d431e5-958f-4e10-9308-2c1c436ef276","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5684,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2043,"missionSetupMs":5301,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":5301,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":5301,"repositoryMutationMs":3641,"repositoryProviderMs":3641,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2008,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":5301,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1633},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"69d431e5-958f-4e10-9308-2c1c436ef276"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3371,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:41:51.320771+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3025","receipt_type":"execute_mission","idempotency_key":"mission:69d431e5-958f-4e10-9308-2c1c436ef276:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"2e69859d-bc18-4b8f-a4e2-b3d07c644512","command_center_event_id":"69d431e5-958f-4e10-9308-2c1c436ef276"},{"id":"e99779d6-c707-42bb-97a0-ab1dcbfd8ff4","source":"cc-execution","status":"source_resolution_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-2274c364f228","reason":null,"status":"source_resolution_required","metrics":{"receiptBytes":31242,"releaseCount":0,"toolCallCount":2,"repeatedCallCount":0,"executorlessWaitMs":16210,"firstUsefulResultAt":"2026-09-24T05:55:04.761Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":null,"terminal":false,"missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","operation":"execute_mission","proofGate":"repair_mission_source_resolution_required","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":6,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":254,"providerAuthMs":0,"ledgerPrepareMs":254,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":254,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":254,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Resolve bounded authoritative Forgejo source targets, then call /mission/execute again with this same missionId and exact files or anchored_edits. Do not switch workflows.","receiptRef":{"mode":"full","missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2803,"likelyAffectedFiles":[],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:55:27.083541+00:00","proof_gate":"repair_mission_source_resolution_required","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:execute_mission:repair_mission_source_resolution_required:current-generation","mission_step_id":"453fd82c-6afa-4236-8d04-bb9c38e067d7","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"64deb84f-b735-4d95-939e-83ccfa31e476","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-2274c364f228","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":33329,"releaseCount":0,"toolCallCount":3,"repeatedCallCount":0,"executorlessWaitMs":22422,"firstUsefulResultAt":"2026-09-24T05:55:04.761Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":3599,"terminal":false,"missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":6226,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":681,"approvedPlanMs":1453,"missionSetupMs":445,"providerAuthMs":0,"shipAndProveMs":3689,"ledgerPrepareMs":265,"ledgerReconcileMs":0,"lineageReconcileMs":180,"resolvePreflightMs":445,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":265,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},"performance":null,"deploymentId":"forgejo-main-e36498d7001d","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2842,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:55:55.54154+00:00","proof_gate":"canonical_release_dispatched","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":"forgejo-main-e36498d7001d","receipt_type":"execute_mission","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"32e491b8-2981-40be-a89c-1e762af66a9b","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"ebe90caf-4f3a-4f3f-bf33-f7c99c7321fd","source":"cc-execution","status":"source_resolution_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"source_resolution_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"4146dad0-8b95-4ec6-9332-823bd583c2f1","operation":"execute_mission","proofGate":"repair_mission_source_resolution_required","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":532,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":328,"providerAuthMs":0,"ledgerPrepareMs":328,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":328,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":328,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Supply exact sourceTargets on the same mission; planner guesses cannot replace missing mission scope.","receiptRef":{"mode":"full","missionId":"4146dad0-8b95-4ec6-9332-823bd583c2f1"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1175,"likelyAffectedFiles":[],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T14:50:00.174163+00:00","proof_gate":"repair_mission_source_resolution_required","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:4146dad0-8b95-4ec6-9332-823bd583c2f1:execute_mission:repair_mission_source_resolution_required:current-generation","mission_step_id":"d54cf54a-462a-419b-ad80-73f641bf029e","command_center_event_id":"4146dad0-8b95-4ec6-9332-823bd583c2f1"},{"id":"317c1880-aa12-4e8a-b678-7dfabd012283","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"c2ca31e10110f4888944ec96bff2c894acc89ac6","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":false,"statement":"Replace the just-released PCG beige/light redesign with a cleaner and simpler PCG operating UI. The user dislikes both the color scheme and the confusing layout. Use a cool neutral white/light-gray/charcoal palette with PCG gold only as a restrained accent. Flatten the owner landing page to one compact header, one obvious Receive new cards action, and a numbered 1-to-4 workflow: Receive Cards, Grade Cards, Publish & Sell, Fulfill & Ship. Remove lifestyle/hero framing and decorative imagery blocks from the owner landing page. Keep setup visually secondary. Fix PCG Settings specifically: do not embed the entire universal Settings & Profile home inside PCG. Show a small PCG-specific settings launcher first with Brand & workspace, Google & connections, Email & customers, Notifications, Profile & staff, and Workspace behavior; only render the relevant universal settings section after Anthony chooses one. Payments remains in the separate Payments tool. Preserve all business logic, routes, grading rules, data actions, provider state, and owner approval safeguards. Frontend-only change. Ship through fast UI gate, squash merge, frontend release, then visually verify PCG root and PCG Setting","proofConditionIds":["proof-production","proof-visual"]}],"satisfied":false,"constraints":[{"id":"visual-artifact-scope","satisfied":false,"statement":"The requested visual artifact type is authoritative: workspace, website only; must not include website. Do not add unrelated or mixed visual surfaces unless the owner explicitly requested them.","proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-content-truth","satisfied":false,"statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","satisfied":false,"statement":"Visual work is isolated to pcg. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","satisfied":false,"statement":"The requested mobile viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","proofConditionIds":["proof-production","proof-visual"]},{"id":"reference-visual-fidelity","satisfied":false,"statement":"The approved reference owns the material visual composition: hierarchy, major geometry, typography scale, spacing rhythm, image placement/crop, color treatment, radii, shadows/glow, and overall density. Material deviation is a failed visual acceptance, not a stylistic reinterpretation.","proofConditionIds":["proof-visual"]},{"id":"responsive-visual-continuity","satisfied":false,"statement":"Responsive adaptation may reflow for the target viewport, but it must preserve information hierarchy, branding, functionality, and design language. It must not invent a second design.","proofConditionIds":["proof-visual"]},{"id":"reference-visual-authority","satisfied":false,"statement":"The supplied or approved reference visual is immutable acceptance evidence. Generating another mockup, image, or concept cannot satisfy this implementation request; completion requires source implementation, deployment, and reference-matched visual proof.","proofConditionIds":["proof-visual"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"eaaf1bad54d9771818003f0ab5d10bbc401c76260cc3b846e5f45f891a1526c8","releaseBound":true,"witnessBound":false,"visualRequested":true,"visualSatisfied":false,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"eaaf1bad54d9771818003f0ab5d10bbc401c76260cc3b846e5f45f891a1526c8"},"required":true,"satisfied":true},{"id":"proof-visual","kind":"visual","evidence":{"modeBound":true,"claimBound":false,"routeBound":false,"witnessMode":null,"witnessRoute":null,"currentSourceSha":"c2ca31e10110f4888944ec96bff2c894acc89ac6","witnessSourceSha":null,"verificationState":"verified","witnessRequestContractHash":null},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["visual"],"activeReleaseTargets":["frontend"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:36:06.802666+00:00","proof_gate":"request_contract_pending","source_sha":"c2ca31e10110f4888944ec96bff2c894acc89ac6","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:88715ace-54dc-4957-a3cc-b4f76e98b1bf:request-contract:eaaf1bad54d9771818003f0ab5d10bbc401c76260cc3b846e5f45f891a1526c8:c2ca31e10110f4888944ec96bff2c894acc89ac6:pending:visual","mission_step_id":"70889653-a123-4a92-a5c7-4c5aa44e68e0","command_center_event_id":"88715ace-54dc-4957-a3cc-b4f76e98b1bf"},{"id":"0cabf8f3-8998-4e1b-a7f7-e74d2418c836","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":true,"statement":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","proofConditionIds":["proof-production"]}],"satisfied":true,"constraints":[{"id":"private-originals","satisfied":true,"statement":"Canonical tenant buckets and private customer/doc media remain private. Only assets already published for public surfaces may be mirrored.","proofConditionIds":["proof-production"]},{"id":"single-loader","satisfied":true,"statement":"Do not reintroduce a second branded loading screen; preserve the existing single WMP loader and 3-second minimum.","proofConditionIds":["proof-production"]},{"id":"bounded-release","satisfied":true,"statement":"Release only affected frontend and Supabase Edge Functions.","proofConditionIds":["proof-production"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"e50361b4580f4e15320c1697e2b8ca9ef15ed02f7a51dfb2a7b93ca4e34b6dd8","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"e50361b4580f4e15320c1697e2b8ca9ef15ed02f7a51dfb2a7b93ca4e34b6dd8"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["frontend","supabaseEdge"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:40:46.513794+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:4489b794-fe0b-4298-b860-3ec38862b32d:request-contract:e50361b4580f4e15320c1697e2b8ca9ef15ed02f7a51dfb2a7b93ca4e34b6dd8:df0053b2741b95cbbb4eba6d281c6bc5d3ed5ee6:verified:","mission_step_id":"63569f9a-5696-479b-863b-3e217d05d978","command_center_event_id":"4489b794-fe0b-4298-b860-3ec38862b32d"},{"id":"05cc3f83-c0c6-4a9e-82cb-d4078275f84c","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","render-onrunner/runtime-proof":"success"},"mainSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"onrunner":"success"},"requestContractHash":"0da15ff509d0bf4457d4a95f3f996ef018218f2a5a77279e551bc179cfd157f3","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9263","runId":9263,"status":"success","sourceSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"onrunner":"success"},"targetJobCount":7,"observedTargetStates":{"onrunner":"success"}},"onrunnerRuntimeProof":{"reason":null,"hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":true,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","runnerVersion":"onrunner-81f17af8a2c2","expectedSourceSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"09f7a2b645fd5cf9b50dab453a864ffd23892aa4","sourceSha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","changedPaths":["scripts/visual-witness-hosted-runner/test/mission-supervisor-restart-exhaustion.test.mjs","scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs"],"changedPathCount":2,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:46:36.785331+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"81f17af8a2c2b2eaf72cc338726f56420d9363f5","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:69d431e5-958f-4e10-9308-2c1c436ef276:forgejo-release-status:81f17af8a2c2b2eaf72cc338726f56420d9363f5:verified:forgejo-main/source=success|forgejo-release/workflow=success|render-onrunner/runtime-proof=success","mission_step_id":"eaed4627-c9b1-4da5-a2e6-be9175bb62b6","command_center_event_id":"69d431e5-958f-4e10-9308-2c1c436ef276"},{"id":"c38f0868-0ef3-408e-8275-f12b40aef730","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-be9ca79b8d4a","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3026,"terminal":false,"missionId":"be9ca79b-8d4a-4989-915e-5caf2dc34b28","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5977,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2419,"missionSetupMs":1874,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1623,"ledgerReconcileMs":0,"lineageReconcileMs":251,"resolvePreflightMs":1874,"repositoryMutationMs":3558,"repositoryProviderMs":3558,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":3303,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1623,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":255},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"be9ca79b-8d4a-4989-915e-5caf2dc34b28"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3083,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:45:43.209988+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3026","receipt_type":"execute_mission","idempotency_key":"mission:be9ca79b-8d4a-4989-915e-5caf2dc34b28:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"a00e9bd8-c603-40a0-b9cc-93100aeed17a","command_center_event_id":"be9ca79b-8d4a-4989-915e-5caf2dc34b28"},{"id":"d06bb6dc-af55-42a7-aaed-59295e4c22d4","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized corrective-release hardening PR; exact stale invariant repair from Gate 11020.","baseSha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","issuedAt":1790129686005,"expiresAt":1790129866005,"missionId":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1","authorizationId":"2f938ac2-1ed4-41c7-a9cc-304c4a58c81e","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:14:46.425165+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:2f938ac2-1ed4-41c7-a9cc-304c4a58c81e","mission_step_id":"bf00bfdb-1966-4997-bb8b-167cb5a62899","command_center_event_id":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1"},{"id":"3915d2b9-83cf-4428-99e0-e97451443ed9","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized #3474 hardening; exact second stale invariant from Gate 11024.","baseSha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","issuedAt":1790129737284,"expiresAt":1790129917284,"missionId":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1","authorizationId":"1468b818-e04d-49fe-a2c0-84982760d39d","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:15:37.975546+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"c6a23942639ff1e9dee24d39bfc5dfb5ceb728c5","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:1468b818-e04d-49fe-a2c0-84982760d39d","mission_step_id":"bf00bfdb-1966-4997-bb8b-167cb5a62899","command_center_event_id":"b0f8cc68-96a4-48b4-8696-5fd33d1c91e1"},{"id":"786a0a22-5983-458e-8b8b-34d25d775e47","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-01018640eadf","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.218-durable-async-repository-mutation","prNumber":3476,"terminal":false,"missionId":"01018640-eadf-4b23-a2f6-266526b06bd6","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5799,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":731,"missionSetupMs":265,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":265,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":265,"repositoryMutationMs":5068,"repositoryProviderMs":5068,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2722,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":265,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":2346},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"01018640-eadf-4b23-a2f6-266526b06bd6"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3747,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:16:01.397415+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3476","receipt_type":"execute_mission","idempotency_key":"mission:01018640-eadf-4b23-a2f6-266526b06bd6:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"c8339d00-a006-45ae-9788-2b94e316dacc","command_center_event_id":"01018640-eadf-4b23-a2f6-266526b06bd6"},{"id":"d64e98a4-167e-412f-b91d-05ced6a781ed","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Exact stale invariant correction on existing control-plane PR #3474.","baseSha":"89dd27cfe4d92548470dbc75f9d86883d055c678","issuedAt":1790129820525,"expiresAt":1790130000525,"missionId":"6835a574-b9f1-4152-bbfd-cd6a4940045e","authorizationId":"1ff58eac-fc43-48d7-873a-8b7a1f766409","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:17:01.091536+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"89dd27cfe4d92548470dbc75f9d86883d055c678","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:1ff58eac-fc43-48d7-873a-8b7a1f766409","mission_step_id":"234830ba-550e-4c02-aaf7-e09bcec22907","command_center_event_id":"6835a574-b9f1-4152-bbfd-cd6a4940045e"},{"id":"8817e031-f51a-4cc4-966b-9ec95304425e","source":"cc-execution","status":"recorded","payload":{"objective":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","tenantRef":"321-auto-unlock","receivedAt":"2026-09-24T14:59:33.812Z","fingerprint":"c2126bfcd5082072ff2eb2b568ed314098df5ea1177d0cabe5eec21bca080fba","workstreamRef":"321autounlock","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","wordingChanged":false,"canonicalIntent":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","constraints":[{"id":"visual-content-truth","statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","statement":"Visual work is isolated to 321-auto-unlock. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","route":"/321-auto-unlock","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Repair the Visual Witness application-shell readiness timeout for the exact production route /321-auto-unlock. Current failure is application_shell_readiness_timeout:43500 with shellTimeoutMs=36000. Inspect the exact current-main readiness predicate and focused budget test, fix the first causal readiness contract defect rather than merely extending the timer, add a regression for this public route class, then create one ai/* branch, one PR, run canonical Gate, squash merge, release the affected visual-witness runner, and verify /321-auto-unlock completes without the readiness timeout.","route":"/321-auto-unlock","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Repair-the-Visual-Witness-application-shell-readiness-timeout-for-the-exact-production-route-321-aut","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"06a04bbf47bcd2e19b8071570f08c99ce04b5d0ba2fdead9b89fea7125d761aa","requestContractRevision":1},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T14:59:34.105204+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:tenant-workstream-contribution:c2126bfcd5082072ff2eb2b568ed314098df5ea1177d0cabe5eec21bca080fba","mission_step_id":null,"command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"50f866d6-c386-4355-b9a2-1e2fe066bcd5","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/visual-witness-durable-engine-ladder","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3027,"terminal":false,"missionId":"56f938a1-585f-4c6a-8379-f50f5964fdcc","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":14623,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2987,"missionSetupMs":4145,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":4145,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":4145,"repositoryMutationMs":11636,"repositoryProviderMs":11636,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":5755,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":4145,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":5881},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"56f938a1-585f-4c6a-8379-f50f5964fdcc"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3509,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T18:55:45.18736+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3027","receipt_type":"execute_mission","idempotency_key":"mission:56f938a1-585f-4c6a-8379-f50f5964fdcc:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"501c78b9-01bd-4283-814e-e46f42fe1257","command_center_event_id":"56f938a1-585f-4c6a-8379-f50f5964fdcc"},{"id":"8f8e38b6-38af-4e38-827b-117bce3d8d73","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","render-onrunner/runtime-proof":"success"},"mainSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"onrunner":"success"},"requestContractHash":"d7dc5c45ddfc28850c4b4dd0b1e87eef56264b1f5d0fc4f476ad6a5ab6496e18","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9270","runId":9270,"status":"running","sourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"onrunner":"success"},"targetJobCount":7,"observedTargetStates":{"onrunner":"success"}},"onrunnerRuntimeProof":{"reason":null,"hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":true,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","runnerVersion":"onrunner-daa6b81fb205","expectedSourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"8f9fc314ab9818d0ac5baed5aa4b9d7497bf3a9b","sourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","changedPaths":["scripts/visual-witness-hosted-runner/test/mission-supervisor-engine-ladder.test.mjs","scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs","scripts/visual-witness-hosted-runner/src/universal-witness.mjs"],"changedPathCount":3,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:00:19.545131+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:56f938a1-585f-4c6a-8379-f50f5964fdcc:forgejo-release-status:daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23:verified:forgejo-main/source=success|forgejo-release/workflow=success|render-onrunner/runtime-proof=success","mission_step_id":"fe694794-13bd-46e1-b1f9-9b3533257d43","command_center_event_id":"56f938a1-585f-4c6a-8379-f50f5964fdcc"},{"id":"75eafaf9-c55a-4fce-b52b-3b1e27caba61","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-5fd1b3e57883","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":263,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":934,"providerAuthMs":0,"ledgerPrepareMs":823,"ledgerReconcileMs":0,"lineageReconcileMs":111,"resolvePreflightMs":934,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":823,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4200,"likelyAffectedFiles":["supabase/functions/tenant-media-library/index.ts"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:00:38.643869+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:5fd1b3e5-7883-4776-9295-af13f67470ea:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"3d3534e5-4b45-4b08-8f28-73e798ef6274","command_center_event_id":"5fd1b3e5-7883-4776-9295-af13f67470ea"},{"id":"4dc4c7de-92fe-4b2f-bca3-9e807e61b8de","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"453c4317a610952c48346e6d3e2fb191539a9583","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"edge-registry-live","satisfied":true,"statement":"One deployable canonical tenant-type registry drives frontend and tenant-media-library, with the health contract live.","proofConditionIds":["repo-correction","release-correction","runtime-correction"]}],"satisfied":true,"constraints":[{"id":"preserve-taxonomy","satisfied":true,"statement":"Preserve the accepted tenant taxonomy and resolver behavior exactly.","proofConditionIds":["repo-correction","runtime-correction"]},{"id":"single-source","satisfied":true,"statement":"No duplicate taxonomy; frontend and Edge runtime consume the same shared registry file.","proofConditionIds":["repo-correction"]},{"id":"bounded","satisfied":true,"statement":"No schema/data changes, visual redesign, or unrelated edits.","proofConditionIds":["repo-correction"]},{"id":"release","satisfied":true,"statement":"Canonical gate, squash merge, affected production release, and claim-matched canary.","proofConditionIds":["release-correction","runtime-correction"]},{"id":"capability-completeness","satisfied":true,"statement":"All applicable frontend, runtime, data/storage, authorization, provider, state, release, and live-proof dependencies remain wired.","proofConditionIds":["repo-correction","release-correction","runtime-correction"]},{"id":"atomic-lifecycle","satisfied":true,"statement":"The capability remains nonterminal until exact release and live canary proof; failure isolates the tenant-type capability.","proofConditionIds":["release-correction","runtime-correction"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["repo-correction","release-correction","runtime-correction"]}],"contractHash":"62e6b5fcf85e0d4b35a330c9785e5803dc2704b6c584a041f0c6c970d41e52f5","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"repo-correction","kind":"repository","evidence":{"reason":null,"gateRunId":9272,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":null,"releaseTargetStates":{"frontend":"success","supabaseEdge":"success"},"repositoryProofGate":"request_contract_repository_verified","repositoryProofPath":null,"requestContractHash":"62e6b5fcf85e0d4b35a330c9785e5803dc2704b6c584a041f0c6c970d41e52f5","unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge"],"allowedReleaseTargets":[],"repositoryProofStatus":"verified","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":[],"migrationReleaseVerified":null,"repositoryConditionBound":true,"repositoryProofSourceSha":"453c4317a610952c48346e6d3e2fb191539a9583"},"required":true,"satisfied":true},{"id":"release-correction","kind":"release","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"62e6b5fcf85e0d4b35a330c9785e5803dc2704b6c584a041f0c6c970d41e52f5"},"required":true,"satisfied":true},{"id":"runtime-correction","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"62e6b5fcf85e0d4b35a330c9785e5803dc2704b6c584a041f0c6c970d41e52f5"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["frontend","supabaseEdge"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:15:49.183297+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"453c4317a610952c48346e6d3e2fb191539a9583","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:5fd1b3e5-7883-4776-9295-af13f67470ea:request-contract:62e6b5fcf85e0d4b35a330c9785e5803dc2704b6c584a041f0c6c970d41e52f5:453c4317a610952c48346e6d3e2fb191539a9583:verified:","mission_step_id":"8868ae81-6a42-496d-afb8-5281a22a37ed","command_center_event_id":"5fd1b3e5-7883-4776-9295-af13f67470ea"},{"id":"72156ba0-435d-41e8-98a3-1da86bb0ac77","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized control-plane hardening on #3474; this is the exact stale invariant line from Gate 11024/11025.","baseSha":"89dd27cfe4d92548470dbc75f9d86883d055c678","issuedAt":1790129888563,"expiresAt":1790130068563,"missionId":"6835a574-b9f1-4152-bbfd-cd6a4940045e","authorizationId":"a8b0859c-bd41-4a60-9b76-58b1b680f887","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:18:08.953498+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"89dd27cfe4d92548470dbc75f9d86883d055c678","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:a8b0859c-bd41-4a60-9b76-58b1b680f887","mission_step_id":"234830ba-550e-4c02-aaf7-e09bcec22907","command_center_event_id":"6835a574-b9f1-4152-bbfd-cd6a4940045e"},{"id":"b682be84-3c5f-4bb8-9a59-ffd72127be8c","source":"cc-execution","status":"no_change","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"no_change","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.219-contract-release-target-forwarding","prNumber":null,"terminal":false,"missionId":"e97d1251-36df-46f7-b193-6bb6f4bb62b5","operation":"execute_mission","proofGate":"repair_mission_prepared","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":126,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":367,"providerAuthMs":0,"ledgerPrepareMs":367,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":367,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":367,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"pull_request_required","receiptRef":{"mode":"full","missionId":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1350,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:34:15.317512+00:00","proof_gate":"repair_mission_prepared","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:e97d1251-36df-46f7-b193-6bb6f4bb62b5:execute_mission:repair_mission_prepared:current-generation","mission_step_id":"0c55f64b-9865-46bd-95ae-c23c9fda3a8b","command_center_event_id":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},{"id":"286fd078-cd9b-4979-8416-8eb4f883d44c","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-5fd1b3e57883","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3028,"terminal":false,"missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":13426,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1756,"missionSetupMs":430,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":430,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":430,"repositoryMutationMs":11670,"repositoryProviderMs":11670,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":6557,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":430,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":5113},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3682,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:06:35.532333+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3028","receipt_type":"execute_mission","idempotency_key":"mission:5fd1b3e5-7883-4776-9295-af13f67470ea:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"81d829cf-0cd1-4676-990b-775d609dfe57","command_center_event_id":"5fd1b3e5-7883-4776-9295-af13f67470ea"},{"id":"0f7929f2-5783-478a-af3e-3f61a753c106","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-2274c364f228","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":31242,"releaseCount":0,"toolCallCount":2,"repeatedCallCount":0,"executorlessWaitMs":16210,"firstUsefulResultAt":"2026-09-24T05:55:04.761Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":3599,"terminal":false,"missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5252,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":648,"missionSetupMs":232,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":232,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":232,"repositoryMutationMs":4604,"repositoryProviderMs":4604,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2692,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":232,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1912},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3711,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:55:27.219263+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3599","receipt_type":"execute_mission","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"e5f86e85-24d8-4acc-9a94-c173e0c4b5cb","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"28802a87-9a01-42b1-9274-8605dc710261","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-5fd1b3e57883","prNumber":3028,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"453c4317a610952c48346e6d3e2fb191539a9583","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:15:04.851184+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"453c4317a610952c48346e6d3e2fb191539a9583","external_id":"3028","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:5fd1b3e5-7883-4776-9295-af13f67470ea:merged-pr:3028:453c4317a610952c48346e6d3e2fb191539a9583","mission_step_id":"1a54ebd1-ebde-4691-b1f5-d547c33ff976","command_center_event_id":"5fd1b3e5-7883-4776-9295-af13f67470ea"},{"id":"e71557f0-c33e-42c9-8523-06fdf8604a74","source":"cc-execution","status":"waiting","payload":{"kind":"heartbeat","message":"Still active in release.","nextAction":{"lane":"production-release-conductor","action":"reconcile_release","reason":"merged_source_requires_release_proof","automationAllowed":true,"ownerActionRequired":false},"silenceBudgetMs":15000,"semanticCheckpointSignature":"{\"stateMachineVersion\":1,\"phase\":\"release\",\"ownerFacingState\":null,\"latest\":{\"kind\":\"receipt\",\"key\":\"canonical_release_status\",\"status\":\"pending\",\"proofGate\":\"canonical_release_pending\"},\"activeStep\":{\"key\":\"pull_request\",\"status\":\"ready\",\"lane\":\"cc-execution\"},\"nextStep\":{\"key\":\"release\",\"status\":\"waiting\",\"lane\":\"production-release-conductor\"},\"nextSafeAction\":{\"action\":\"reconcile_release\",\"lane\":\"production-release-conductor\",\"reason\":\"merged_source_requires_release_proof\",\"automationAllowed\":true,\"ownerActionRequired\":false},\"executionOwnership\":{\"active\":false,\"state\":\"waiting\",\"executor\":null,\"lane\":\"cc-execution\",\"nextAction\":\"reconcile_release\",\"recoveryOwner\":\"production-release-conductor\"},\"acceptance\":{\"total\":1,\"verified\":0,\"pending\":1,\"percent\":0,\"satisfied\":false,\"verifiedIds\":[],\"pendingIds\":[\"proof-production\"]},\"stall\":{\"stalled\":false,\"reason\":\"within_deadline\",\"step\":\"release\",\"deadlineAt\":\"2026-09-24T08:55:03.709602+00:00\",\"recoveryAction\":null},\"blocker\":null,\"terminal\":false,\"branch\":\"ai/objective-first-repair-2274c364f228\",\"prNumber\":3599,\"sourceSha\":\"e36498d7001d5b55f5665c9230d81a6c5fe20229\",\"deploymentId\":\"forgejo-main-e36498d7001d\"}"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:22.913374+00:00","proof_gate":"owner_progress_heartbeat","source_sha":null,"external_id":null,"receipt_type":"owner_progress_heartbeat","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:owner-progress-heartbeat:119348625","mission_step_id":"c86310a0-29a2-46ed-8c6f-8868f08d0da7","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"9621e243-a4f5-44cb-8e6b-39babc3d9fca","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-8a48b182e2f4","prNumber":3596,"nextAction":null,"mergeCommitSha":"6a2c360c7d28b43447099cfc3b8f9c61f260543a","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:49.195076+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"6a2c360c7d28b43447099cfc3b8f9c61f260543a","external_id":"3596","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:8a48b182-e2f4-47a6-af51-f3f109eadfe1:merged-pr:3596:6a2c360c7d28b43447099cfc3b8f9c61f260543a","mission_step_id":"f581d7e2-f7c2-4dae-90ea-02804e1a846e","command_center_event_id":"8a48b182-e2f4-47a6-af51-f3f109eadfe1"},{"id":"0bb9311f-e2cf-47dd-a949-6c8e183145fb","source":"visual-sandbox","status":"completed_with_findings","payload":{"ok":true,"jobId":"2cecc7bd-bea6-48f0-b013-6365578298d1","phase":"universal_visual_witness_status","branch":"ai/objective-first-repair-f2fee72c5de9","reason":null,"status":"verification_pending","metrics":{"receiptBytes":188788,"releaseCount":0,"toolCallCount":41,"repeatedCallCount":20,"executorlessWaitMs":5573462,"firstUsefulResultAt":"2026-09-29T18:03:39.192Z","recoveryAttemptCount":11,"ownerInterruptionCount":0},"version":null,"prNumber":4167,"terminal":false,"missionId":"f2fee72c-5de9-49db-9562-8404efc431e6","operation":"visual_proof_status","proofGate":"interactive_visual_witness_completed_with_findings","sourceSha":"23347e586cb7ae0ff25223a76f28269338b82cd3","timingsMs":{"queue":1416,"total":22902,"execution":21486},"nextAction":null,"receiptRef":{"mode":"full","missionId":"f2fee72c-5de9-49db-9562-8404efc431e6"},"performance":null,"deploymentId":"forgejo-main-23347e586cb7","releaseState":"verified","visualWitness":{"role":"GodMode","jobId":"2cecc7bd-bea6-48f0-b013-6365578298d1","tenant":"knock-launch-os","runnerUrl":"https://laptop-witness.knocklaunch.app","runnerLane":"laptop","attemptsUsed":1,"supervisorId":"2cecc7bd-bea6-48f0-b013-6365578298d1","failureReason":null,"observedRoute":"/knock-launch-os/video-studio","runnerVersion":"laptop-bb1e9c24fd5d","attemptLineage":[{"jobId":"f82d9a89-f894-4296-bed4-863afdc778a9","attempt":1,"category":"completed_with_findings","sourceSha":"bb1e9c24fd5d6d6526aafb737dbeb2f9755ca0f4","startedAt":"2026-09-29T19:28:41.959Z","completedAt":"2026-09-29T19:29:04.977Z","runtimeLane":"cc-execution -> Local Laptop -> universal-witness.mjs","browserEngine":"chromium","failureReason":null,"retryRecovery":null,"runnerVersion":"laptop-bb1e9c24fd5d","browserLaunchReason":"display_unavailable_headless","checkpointAccounting":{"route":{"required":2,"completed":2,"missingIds":[]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":0,"resumed":0,"complete":true,"evidence":{"required":2,"completed":2,"missingIds":[]},"completed":4,"remaining":0,"duplicates":0,"duplicateIds":[],"expectedTotal":4}}],"missionOutcome":"completed_with_findings","requestedRoute":"/knock-launch-os/video-studio","runnerSourceSha":"bb1e9c24fd5d6d6526aafb737dbeb2f9755ca0f4","selectedViewports":["desktop","mobile"],"checkpointAccounting":{"route":{"required":2,"completed":2,"missingIds":[]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":0,"resumed":0,"complete":true,"evidence":{"required":2,"completed":2,"missingIds":[]},"completed":4,"remaining":0,"duplicates":0,"duplicateIds":[],"expectedTotal":4},"correctiveGeneration":0,"restartReplayHistory":[]},"workflowRunId":13168,"releaseTargets":{"frontend":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":48020,"ownerActionRequired":false,"ownerFacingTerminal":false,"requestContractHash":"be7f03f9a57b29242035ef34f8f5b83ee8e44dc4ebc2ad341f51178431fd81a5","continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-29T19:36:36.189338+00:00","proof_gate":"interactive_visual_witness_completed_with_findings","source_sha":"laptop-bb1e9c24fd5d","external_id":"2cecc7bd-bea6-48f0-b013-6365578298d1","receipt_type":"visual_proof_status","idempotency_key":"mission:f2fee72c-5de9-49db-9562-8404efc431e6:visual:2cecc7bd-bea6-48f0-b013-6365578298d1:completed_with_findings","mission_step_id":"c157599f-2243-4693-aaf6-40426c3db32d","command_center_event_id":"f2fee72c-5de9-49db-9562-8404efc431e6"},{"id":"ae5a5643-13ef-45fd-9256-750f762b0e19","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-8383247bc3ec","prNumber":4176,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"f7b9bca1e862b0b82917f5011bbd723fa6f89a0f","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:12:15.107855+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"f7b9bca1e862b0b82917f5011bbd723fa6f89a0f","external_id":"4176","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:8383247b-c3ec-459c-944c-0592b7b4e340:merged-pr:4176:f7b9bca1e862b0b82917f5011bbd723fa6f89a0f","mission_step_id":"8024ffaa-2c02-46e1-9b5e-d4ecf62e8df9","command_center_event_id":"8383247b-c3ec-459c-944c-0592b7b4e340"},{"id":"f677aa90-1099-4b57-b7ed-9f98d5c9ff41","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-5fd1b3e57883","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3028,"terminal":false,"missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"453c4317a610952c48346e6d3e2fb191539a9583","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5839,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":2009,"approvedPlanMs":0,"missionSetupMs":819,"providerAuthMs":0,"shipAndProveMs":3193,"ledgerPrepareMs":451,"ledgerReconcileMs":0,"lineageReconcileMs":368,"resolvePreflightMs":819,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":451,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"5fd1b3e5-7883-4776-9295-af13f67470ea"},"performance":null,"deploymentId":"forgejo-main-453c4317a610","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["tenant-media-library"]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2775,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:11:42.701232+00:00","proof_gate":"canonical_release_dispatched","source_sha":"453c4317a610952c48346e6d3e2fb191539a9583","external_id":"forgejo-main-453c4317a610","receipt_type":"execute_mission","idempotency_key":"mission:5fd1b3e5-7883-4776-9295-af13f67470ea:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"1a54ebd1-ebde-4691-b1f5-d547c33ff976","command_center_event_id":"5fd1b3e5-7883-4776-9295-af13f67470ea"},{"id":"94aea278-69c5-40ee-b44f-659e6e392fe2","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-2274c364f228","prNumber":3599,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:02.893801+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":"3599","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:merged-pr:3599:e36498d7001d5b55f5665c9230d81a6c5fe20229","mission_step_id":"32e491b8-2981-40be-a89c-1e762af66a9b","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"183ca269-4a06-4921-a385-ebf33f136d92","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-2e59bcafa7cb","prNumber":3029,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:20:12.285519+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"ee384af9a40035680895bdd7fc1315d9272ffabf","external_id":"3029","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:2e59bcaf-a7cb-454a-a797-3ad6ca302f1c:merged-pr:3029:ee384af9a40035680895bdd7fc1315d9272ffabf","mission_step_id":"9d2f3b04-5bdc-467e-998e-0344d233cba2","command_center_event_id":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},{"id":"79a51f40-d728-4d29-a756-8d880b0ec7ad","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-0618a5ffb7bd","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":16114,"releaseCount":0,"toolCallCount":4,"repeatedCallCount":1,"executorlessWaitMs":74410,"firstUsefulResultAt":"2026-09-24T14:59:35.634Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":3629,"terminal":false,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","operation":"execute_mission","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":929,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":645,"approvedPlanMs":0,"missionSetupMs":490,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":331,"ledgerReconcileMs":0,"lineageReconcileMs":159,"resolvePreflightMs":490,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":331,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1970,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:00:59.057036+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"3629","receipt_type":"execute_mission","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:execute_mission:repair_mission_waiting_for_gate:current-generation","mission_step_id":"cd0d25b5-236d-4fd7-9b94-40d803e943d7","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"f941b775-1db8-4e60-b141-e5342a76e9ee","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-0618a5ffb7bd","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":1998,"releaseCount":0,"toolCallCount":1,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":"2026-09-24T14:59:35.634Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1015,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":287,"providerAuthMs":0,"ledgerPrepareMs":287,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":287,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":287,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3834,"likelyAffectedFiles":["src/pages/auto-lockout/AutoUnlockWorkspaceRouter.tsx","src/pages/auto-lockout/AutoUnlockPublic.tsx","src/pages/auto-lockout/AutoUnlockComingSoon.tsx"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T14:59:35.674341+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"803b8762-fb61-437c-8d03-be80b0909f2d","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"c2403bcc-3116-4f39-8a2b-3700dde09fee","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"23347e586cb7ae0ff25223a76f28269338b82cd3","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-video-studio","satisfied":false,"statement":"Build and ship KNOCKLAUNCH Video Studio at /knock-launch-os/video-studio as one complete production capability. Reuse current KNOCKLAUNCH owner OS shell/auth/routing, tenant media contract and canonical Videos storage, Supabase conventions, health/self-heal patterns, and Windows/local autoconnect machinery. Deliver a professional local-first, provider-neutral, tenant-aware Video Studio with Text-to-Video and Image-to-Video; tenant media upload/reference picking; exact tenant Brand Lock; aspect/resolution/duration/FPS controls constrained by renderer capabilities; real motion presets; seed/quality controls; renderer/model selection; Generate/Cancel/Retry/Duplicate/Same Seed/Download; honest queue/progress/finalization/error states; history/preview/metadata; automatic canonical Videos registration; compact mobile UX. Implement durable tenant-isolated generation jobs with scoped auth, leases/heartbeats, cancellation, bounded retry, idempotent completion and offline queue persistence. Implement an outbound local renderer worker that keeps ComfyUI private, claims jobs, uses versioned workflows and real queue/history/websocket progress, finalizes with FFmpeg, uploads canonical outputs an","proofConditionIds":["proof-production","proof-visual"]}],"satisfied":false,"constraints":[{"id":"visual-artifact-scope","satisfied":false,"statement":"The requested visual artifact is the complete live KNOCKLAUNCH Video Studio application page at /knock-launch-os/video-studio, not a logo, poster, image, or mockup.","proofConditionIds":["proof-visual"]},{"id":"visual-content-truth","satisfied":false,"statement":"Do not present invented business facts, renderer/model availability, job results, metrics, tenant content, or generation success as real. Unknown or unavailable dependencies must be shown honestly.","proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","satisfied":false,"statement":"Video Studio may operate across tenant contexts only through current authorized tenant selection; it must never leak one tenant's logo, media, data, or identity into another tenant.","proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","satisfied":false,"statement":"Both desktop and mobile are authoritative acceptance viewports for the same responsive Video Studio design.","proofConditionIds":["proof-visual"]},{"id":"no-fake-renderer","satisfied":false,"statement":"Never claim local renderer readiness or completed generation unless a real renderer reports healthy and an actual output is produced; unavailable physical dependencies must appear as prerequisite_required/offline states.","proofConditionIds":["proof-production","proof-visual"]},{"id":"reuse-canonical-media","satisfied":true,"statement":"Reuse existing tenant media authority, private tenant buckets, tenant_media_assets and canonical Videos folder; do not create app-specific media buckets or a parallel control plane.","proofConditionIds":["proof-production"]},{"id":"reference-visual-fidelity","satisfied":false,"statement":"The approved reference owns the material visual composition: hierarchy, major geometry, typography scale, spacing rhythm, image placement/crop, color treatment, radii, shadows/glow, and overall density. Material deviation is a failed visual acceptance, not a stylistic reinterpretation.","proofConditionIds":["proof-visual"]},{"id":"responsive-visual-continuity","satisfied":false,"statement":"Responsive adaptation may reflow for the target viewport, but it must preserve information hierarchy, branding, functionality, and design language. It must not invent a second design.","proofConditionIds":["proof-visual"]},{"id":"reference-visual-authority","satisfied":false,"statement":"The supplied or approved reference visual is immutable acceptance evidence. Generating another mockup, image, or concept cannot satisfy this implementation request; completion requires source implementation, deployment, and reference-matched visual proof.","proofConditionIds":["proof-visual"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"be7f03f9a57b29242035ef34f8f5b83ee8e44dc4ebc2ad341f51178431fd81a5","releaseBound":true,"witnessBound":false,"visualRequested":true,"visualSatisfied":false,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"be7f03f9a57b29242035ef34f8f5b83ee8e44dc4ebc2ad341f51178431fd81a5"},"required":true,"satisfied":true},{"id":"proof-visual","kind":"visual","evidence":{"modeBound":true,"claimBound":true,"routeBound":true,"witnessMode":"observe","witnessRoute":"/knock-launch-os/video-studio","currentSourceSha":"23347e586cb7ae0ff25223a76f28269338b82cd3","witnessSourceSha":"23347e586cb7ae0ff25223a76f28269338b82cd3","verificationState":"completed_with_findings","witnessRequestContractHash":"be7f03f9a57b29242035ef34f8f5b83ee8e44dc4ebc2ad341f51178431fd81a5"},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["visual"],"activeReleaseTargets":["frontend"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-29T19:28:39.486707+00:00","proof_gate":"request_contract_pending","source_sha":"23347e586cb7ae0ff25223a76f28269338b82cd3","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:f2fee72c-5de9-49db-9562-8404efc431e6:request-contract:be7f03f9a57b29242035ef34f8f5b83ee8e44dc4ebc2ad341f51178431fd81a5:23347e586cb7ae0ff25223a76f28269338b82cd3:pending:visual","mission_step_id":"9a696e68-c222-4ea5-960b-15315d3e6df1","command_center_event_id":"f2fee72c-5de9-49db-9562-8404efc431e6"},{"id":"d74c1fbc-1c53-45f3-a136-62df55d2ca22","source":"cc-execution","status":"recorded","payload":{"objective":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","tenantRef":"pcg","receivedAt":"2026-09-29T20:24:59.415Z","fingerprint":"96b8f6912de07d49f2712bef79f52f9a705192df95b96c603581504fb6186246","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":false,"objective":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","proofKinds":[],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","wordingChanged":false,"canonicalIntent":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","constraints":[{"id":"visual-content-truth","statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","statement":"Visual work is isolated to pcg. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","statement":"The requested mobile viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"standard","blastRadius":"scoped"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"targeted","interactionRequired":true,"runtimeProofRequired":true},"scope":{"route":"/pcg/workspace","roleRef":null,"tenantRef":"pcg","sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx","src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"urgent","deadlineSignals":["URGENT"],"deadlineExplicit":true},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":[],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"parallel_non_overlapping_tenant_work","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["mobile","desktop"],"behavioral":true,"visualProofScope":"targeted"},"dependencies":{"requiredDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","release_ownership","live_production_proof"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["frontend"]},"inputSignals":{"rawUtterance":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","canonicalIntent":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"URGENT-PCG-pre-meeting-contrast-repair.-Keep-the-current-dark-MODES-design-and-all-existing-workflow","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"97b1f78786dd4c38ccc67526e7e033fd6940a04337ee9cdf9790df40665ca2c7","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:24:59.893097+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6:tenant-workstream-contribution:96b8f6912de07d49f2712bef79f52f9a705192df95b96c603581504fb6186246","mission_step_id":null,"command_center_event_id":"e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6"},{"id":"36787b45-d6a5-414a-8027-309703669258","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"c84c6e80b9e8d228e20089026561f65071964924","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":false,"statement":"Gate is green for existing PR #4174 at head ec96b6f1d63eafc36da1d39c38b99b317b29add7. Squash merge this exact PR with no source changes, release the affected frontend, and verify https://whatsmyprogress.com/pcg on desktop and mobile. Acceptance: no visible preliminary P/text loader, only the configured WMP loading video as the branded loader after media resolves, substantially larger tenant logo with premium orbit/glow/float/sheen animation, and the 3-second minimum preserved.","proofConditionIds":["proof-production","proof-visual"]}],"satisfied":false,"constraints":[{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd","releaseBound":true,"witnessBound":false,"visualRequested":true,"visualSatisfied":false,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd"},"required":true,"satisfied":true},{"id":"proof-visual","kind":"visual","evidence":{"modeBound":true,"claimBound":true,"routeBound":true,"witnessMode":"observe","witnessRoute":"https://whatsmyprogress.com/pcg","currentSourceSha":"c84c6e80b9e8d228e20089026561f65071964924","witnessSourceSha":"c84c6e80b9e8d228e20089026561f65071964924","verificationState":null,"witnessRequestContractHash":"2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd"},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["visual"],"activeReleaseTargets":["frontend"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:57:12.45754+00:00","proof_gate":"request_contract_pending","source_sha":"c84c6e80b9e8d228e20089026561f65071964924","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:835f8c32-adf3-415d-a1ad-0c1d8d46234a:request-contract:2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd:c84c6e80b9e8d228e20089026561f65071964924:pending:visual","mission_step_id":"962d4b1a-1708-4cc5-8a54-7242edd35cda","command_center_event_id":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},{"id":"6c9b3500-e1de-4975-9eac-d43877b5bf77","source":"cc-execution","status":"source_resolution_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-2e59bcafa7cb","reason":null,"status":"source_resolution_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c","operation":"execute_mission","proofGate":"repair_mission_source_resolution_required","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":212,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":2945,"providerAuthMs":0,"ledgerPrepareMs":2945,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":2945,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":2945,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Resolve bounded authoritative Forgejo source targets, then call /mission/execute again with this same missionId and exact files or anchored_edits. Do not switch workflows.","receiptRef":{"mode":"full","missionId":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":6090,"likelyAffectedFiles":[],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:17:19.679259+00:00","proof_gate":"repair_mission_source_resolution_required","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:2e59bcaf-a7cb-454a-a797-3ad6ca302f1c:execute_mission:repair_mission_source_resolution_required:current-generation","mission_step_id":"27b40368-eb57-4055-8696-51c00d896e43","command_center_event_id":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},{"id":"1151c2aa-a68e-4b0f-8520-715efda73b35","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-2e59bcafa7cb","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3029,"terminal":false,"missionId":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":9605,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2157,"missionSetupMs":2915,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":2915,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":2915,"repositoryMutationMs":7448,"repositoryProviderMs":7448,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":3408,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":2915,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":4040},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3335,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:18:43.558605+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3029","receipt_type":"execute_mission","idempotency_key":"mission:2e59bcaf-a7cb-454a-a797-3ad6ca302f1c:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"f0f6488b-bf0e-42b8-94cf-3c03ca58fd7a","command_center_event_id":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},{"id":"1e4e97ca-c9fb-41c8-8b55-60e8c7d0d444","source":"forgejo-runtime","status":"failed","payload":{"failed":["render-onrunner/runtime-proof"],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","render-onrunner/runtime-proof":"failure"},"mainSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","missing":[],"pending":["forgejo-release/workflow"],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","releaseState":"failed","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"onrunner":"pending"},"requestContractHash":"0d296b7f8c1c1ae465be73ea700577d2057354aeb52208ef01f91c25b5e16373","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9277","runId":9277,"status":"running","sourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"onrunner":"pending"},"targetJobCount":7,"observedTargetStates":{"onrunner":"pending"}},"onrunnerRuntimeProof":{"reason":"render_onrunner_source_mismatch","hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":false,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"daa6b81fb205e3d2cab2ecd2e0d5bb1a7e94dc23","runnerVersion":"onrunner-daa6b81fb205","expectedSourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"453c4317a610952c48346e6d3e2fb191539a9583","sourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","changedPaths":["scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs","scripts/visual-witness-hosted-runner/test/mission-supervisor-engine-ladder.test.mjs"],"changedPathCount":2,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:23:05.187084+00:00","proof_gate":"canonical_release_terminal_failed","source_sha":"ee384af9a40035680895bdd7fc1315d9272ffabf","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:2e59bcaf-a7cb-454a-a797-3ad6ca302f1c:forgejo-release-status:ee384af9a40035680895bdd7fc1315d9272ffabf:failed:forgejo-main/source=success|forgejo-release/workflow=pending|render-onrunner/runtime-proof=failure","mission_step_id":"e617734d-c6a9-452c-b549-177bab4feb3a","command_center_event_id":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},{"id":"9664a4e6-fe32-4d16-8bac-3aa1a9368b38","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-b0f8cc6896a4","prNumber":3474,"nextAction":null,"mergeCommitSha":"f852d7571ae237f049f53ecc3e497cfaa98c3d43","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:20:18.034595+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"f852d7571ae237f049f53ecc3e497cfaa98c3d43","external_id":"3474","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:6835a574-b9f1-4152-bbfd-cd6a4940045e:merged-pr:3474:f852d7571ae237f049f53ecc3e497cfaa98c3d43","mission_step_id":"a4faf037-3bab-4609-9bc0-9486d3592e8f","command_center_event_id":"6835a574-b9f1-4152-bbfd-cd6a4940045e"},{"id":"25e179a1-2408-4949-a75b-6269e8ad78ce","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/mission-ledger.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized false-red terminal mission projection hardening.","baseSha":"2da51587dfc680a8b153807d568ed2ce687953e0","issuedAt":1790130880540,"expiresAt":1790131060540,"missionId":"e97d1251-36df-46f7-b193-6bb6f4bb62b5","authorizationId":"461af641-b7ba-4474-8f2c-784d3cd251af","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:34:40.831025+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"2da51587dfc680a8b153807d568ed2ce687953e0","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:461af641-b7ba-4474-8f2c-784d3cd251af","mission_step_id":"0c55f64b-9865-46bd-95ae-c23c9fda3a8b","command_center_event_id":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},{"id":"c4dc9392-bf6f-4e9d-934d-361613cd465d","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"scripts/visual-witness-hosted-runner/src/observe-route-contract.mjs","content":"const INTERACTION_INTENT = /\\b(click|tap|press|submit|save|edit|create|delete|drag|drop|type|enter|select|toggle|check|uncheck|upload|download)\\b/i;\n\nexport function resolveWitnessMode({ requestedMode = '', objective = '', targetedActions = [] } = {}) {\n  if (['observe', 'interactive_audit', 'authorized_operation'].includes(requestedMode)) return requestedMode;\n  if (Array.isArray(targetedActions) && targetedActions.length > 0) return 'interactive_audit';\n  return INTERACTION_INTENT.test(String(objective || '')) ? 'interactive_audit' : 'observe';\n}\n\nexport function isExpectedBrowserRequestAbort(errorText = '') {\n  const value = String(errorText || '').trim();\n  return /(?:net::ERR_ABORTED|NS_BINDING_ABORTED|cancelled|canceled|Load request cancelled)/i.test(value);\n}\n\nexport function loadingSurfaceBlocksViewport({\n  visible = false,\n  left = 0,\n  top = 0,\n  right = 0,\n  bottom = 0,\n  width = 0,\n  height = 0,\n} = {}, { width: viewportWidth = 0, height: viewportHeight = 0 } = {}) {\n  const vw = Math.max(0, Number(viewportWidth));\n  const vh = Math.max(0, Number(viewportHeight));\n  if (!visible || Number(width) <= 0 || Number(height) <= 0 || vw <= 0 || vh <= 0) return false;\n  const intersectionWidth = Math.max(0, Math.min(Number(right), vw) - Math.max(Number(left), 0));\n  const intersectionHeight = Math.max(0, Math.min(Number(bottom), vh) - Math.max(Number(top), 0));\n  if (intersectionWidth <= 0 || intersectionHeight <= 0) return false;\n  const viewportCoverage = (intersectionWidth * intersectionHeight) / (vw * vh);\n  return viewportCoverage >= 0.5;\n}\n\nexport function applicationShellReadyFromSnapshot({\n  readyState = '',\n  loadingSurfaceVisible = false,\n  loadingSurfaceTopmost = loadingSurfaceVisible,\n  shellVisible = false,\n  genericVisible = false,\n  rootChildCount = 0,\n  rootTextLength = 0,\n} = {}) {\n  const domReady = readyState === 'interactive' || readyState === 'complete';\n  const hydratedRoot = Number(rootChildCount) > 0 && Number(rootTextLength) >= 16;\n  const hydratedShell = shellVisible || genericVisible || hydratedRoot;\n  const authoritativeLoadingSurface = loadingSurfaceVisible && loadingSurfaceTopmost;\n  return domReady && hydratedShell && !authoritativeLoadingSurface;\n}\n\nexport function applicationShellBrowserReady() {\n  const visible = (node) => {\n    if (!(node instanceof HTMLElement)) return false;\n    const style = getComputedStyle(node);\n    const rect = node.getBoundingClientRect();\n    if (rect.width <= 0 || rect.height <= 0\n      || style.display === 'none'\n      || style.visibility === 'hidden'\n      || style.visibility === 'collapse'\n      || Number(style.opacity || 1) <= 0.01) return false;\n    for (let current = node.parentElement; current instanceof HTMLElement; current = current.parentElement) {\n      const ancestorStyle = getComputedStyle(current);\n      if (ancestorStyle.display === 'none'\n        || ancestorStyle.visibility === 'hidden'\n        || ancestorStyle.visibility === 'collapse'\n        || Number(ancestorStyle.opacity || 1) <= 0.01) return false;\n    }\n    return true;\n  };\n  const blocksViewport = (node) => {\n    if (!visible(node)) return false;\n    const rect = node.getBoundingClientRect();\n    const left = Math.max(0, rect.left);\n    const right = Math.min(window.innerWidth, rect.right);\n    const top = Math.max(0, rect.top);\n    const bottom = Math.min(window.innerHeight, rect.bottom);\n    if (right <= left || bottom <= top) return false;\n    const viewportArea = Math.max(1, window.innerWidth * window.innerHeight);\n    const viewportCoverage = ((right - left) * (bottom - top)) / viewportArea;\n    if (viewportCoverage < 0.5) return false;\n    const points = [\n      [(left + right) / 2, (top + bottom) / 2],\n      [left + (right - left) * 0.25, top + (bottom - top) * 0.25],\n      [left + (right - left) * 0.75, top + (bottom - top) * 0.25],\n      [left + (right - left) * 0.25, top + (bottom - top) * 0.75],\n      [left + (right - left) * 0.75, top + (bottom - top) * 0.75],\n    ];\n    return points.some(([x, y]) => {\n      const topmost = document.elementFromPoint(x, y);\n      return Boolean(topmost && (topmost === node || node.contains(topmost)));\n    });\n  };\n  const root = document.getElementById('root');\n  const loadingSurfaceVisible = Array.from(document.querySelectorAll('[data-kl-loading-surface]')).some(blocksViewport);\n  const domReady = document.readyState === 'interactive' || document.readyState === 'complete';\n  if (!domReady || loadingSurfaceVisible) return false;\n\n  const explicitTenantShellVisible = Array.from(document.querySelectorAll(\n    '[data-big-papis-owner-shell=\"true\"], [data-tenant-modes-shell=\"true\"], [data-workspace-model=\"modes-v1\"], [data-encore-owner-shell=\"true\"], [data-auto-unlock-shell]',\n  )).some(visible);\n  if (explicitTenantShellVisible) return true;\n\n  const shellVisible = Array.from(document.querySelectorAll('#app-main > *, [data-single-role-tenant-avatar=\"true\"], [data-sidebar=\"sidebar\"]')).some(visible);\n  const genericVisible = Array.from(document.querySelectorAll('form, [role=\"main\"], section, h1, h2, h3, button, a[href], input:not([type=\"hidden\"]), select, textarea')).some(visible);\n  const rootChildCount = root?.childElementCount || 0;\n  const rootTextLength = (root?.textContent || '').trim().length;\n  const hydratedRoot = rootChildCount > 0 && rootTextLength >= 16;\n  return shellVisible || genericVisible || hydratedRoot;\n}\n\nexport function useFastObserve(mission = {}) {\n  return mission?.mode === 'observe'\n    && (!Array.isArray(mission?.targetedActions) || mission.targetedActions.length === 0);\n}\n"},{"path":"scripts/visual-witness-hosted-runner/test/shell-readiness-budget.test.mjs","content":"import assert from 'node:assert/strict';\nimport { readFile } from 'node:fs/promises';\nimport test from 'node:test';\n\nconst sourceUrl = new URL('../src/universal-witness.mjs', import.meta.url);\nconst observeRouteUrl = new URL('../src/observe-route-contract.mjs', import.meta.url);\n\nasync function timeoutConstants() {\n  const source = await readFile(sourceUrl, 'utf8');\n  const read = (name) => {\n    const match = source.match(new RegExp(`const ${name} = ([0-9_]+);`));\n    assert.ok(match, `${name} must remain explicit in universal-witness.mjs`);\n    return Number(match[1].replaceAll('_', ''));\n  };\n  return {\n    source,\n    allowance: read('AUTHENTICATED_BOOTSTRAP_ALLOWANCE_MS'),\n    quick: read('QUICK_INITIAL_ROUTE_SHELL_TIMEOUT_MS'),\n    initial: read('INITIAL_ROUTE_SHELL_TIMEOUT_MS'),\n    contextCreate: read('BROWSER_CONTEXT_CREATE_TIMEOUT_MS'),\n    watchdog: 120_000,\n  };\n}\n\ntest('initial and quick shell readiness outlive the canonical authenticated bootstrap allowance', async () => {\n  const { allowance, quick, initial, contextCreate, watchdog } = await timeoutConstants();\n  assert.equal(allowance, 32_000);\n  assert.ok(quick > allowance, `quick shell timeout ${quick} must exceed authenticated allowance ${allowance}`);\n  assert.ok(initial > allowance, `initial shell timeout ${initial} must exceed authenticated allowance ${allowance}`);\n  assert.ok(contextCreate >= 20_000, `browser context creation timeout ${contextCreate} must tolerate a cold renderer`);\n  assert.ok(initial < watchdog, `initial shell timeout ${initial} must remain below watchdog ${watchdog}`);\n});\n\ntest('fast observe does not reintroduce a shorter initial application-shell deadline', async () => {\n  const { source } = await timeoutConstants();\n  assert.doesNotMatch(source, /useFastObserve\\(mission\\)\\s*\\?\\s*8_000\\s*:/);\n  assert.match(source, /const initialShellTimeoutMs = Math\\.max\\(baseShellTimeoutMs, AUTHENTICATED_BOOTSTRAP_ALLOWANCE_MS\\);/);\n  assert.match(source, /useFastObserve\\(mission\\) \\? QUICK_INITIAL_ROUTE_SHELL_TIMEOUT_MS : APPLICATION_SHELL_TIMEOUT_MS/);\n});\n\ntest('321 Auto Unlock self-contained shell is an authoritative readiness surface', async () => {\n  const source = await readFile(observeRouteUrl, 'utf8');\n  assert.match(source, /\\[data-auto-unlock-shell\\]/);\n});\n"}],"route":"/321-auto-unlock","branch":"ai/objective-first-repair-0618a5ffb7bd","writes":[],"patches":[],"version":1,"approved":true,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","objective":"Apply the exact bounded witness readiness repair already diagnosed: recognize the existing 321 Auto Unlock data-auto-unlock-shell as an authoritative self-contained application shell, add the focused regression, then carry the same mission through PR, canonical Gate, squash merge, affected runner release, and rerun /321-auto-unlock proof.","tenantRef":"321-auto-unlock","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["scripts/visual-witness-hosted-runner/src/observe-route-contract.mjs","scripts/visual-witness-hosted-runner/test/shell-readiness-budget.test.mjs"],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","ownerApproved":true,"releaseIntent":null,"sourceTargets":["scripts/visual-witness-hosted-runner/src/observe-route-contract.mjs","scripts/visual-witness-hosted-runner/test/shell-readiness-budget.test.mjs"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"5532721fed5b1ef2dd6ff51ccff5f202e1b0994ca2b36e2d0b274d3f400a5f73","replayCount":0,"serializedBytes":9876},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:00:44.355836+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:repository-mutation-intent:5532721fed5b1ef2dd6ff51ccff5f202e1b0994ca2b36e2d0b274d3f400a5f73:0","mission_step_id":"2b5fc5ae-18d8-44ba-b671-ba1834de76eb","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"f4666bf0-9953-4f8a-996f-b6a6b8407048","source":"cc-execution","status":"recorded","payload":{"objective":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","tenantRef":"pcg","receivedAt":"2026-09-29T19:48:47.683Z","fingerprint":"9eeba5cf925ae32e1a850abcdda4e3cebb2affe9ef9de70e4e5e08be5d0b0ff1","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":false,"objective":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","proofKinds":[],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","wordingChanged":false,"canonicalIntent":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","constraints":[{"id":"visual-artifact-scope","statement":"The requested visual artifact type is authoritative: workspace only; must not include website. Do not add unrelated or mixed visual surfaces unless the owner explicitly requested them.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-content-truth","statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","statement":"Visual work is isolated to pcg. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","statement":"The requested mobile viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"high","blastRadius":"sensitive"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"targeted","interactionRequired":true,"runtimeProofRequired":true},"scope":{"route":"/pcg/workspace","roleRef":null,"tenantRef":"pcg","sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"normal","deadlineSignals":[],"deadlineExplicit":false},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":["deadline"],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"serialize_overlapping_mutations","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["mobile","desktop"],"behavioral":true,"visualProofScope":"targeted"},"dependencies":{"requiredDomains":["frontend","backend_runtime","schema_data_storage","provider_configuration","release_ownership","live_production_proof"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["frontend"]},"inputSignals":{"rawUtterance":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","canonicalIntent":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show ","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show ","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Owner-explicitly-rejected-the-white-numbered-PCG-dashboard-and-said-throw-the-whole-thing-away-and-r","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"13df5ff2c9afd58f47015418ea7e822d6976f6a0b86695a6c9a3d7667c2ece07","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:48:48.059438+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:538b64ed-50e3-43c7-81f9-1f8b380bc166:tenant-workstream-contribution:9eeba5cf925ae32e1a850abcdda4e3cebb2affe9ef9de70e4e5e08be5d0b0ff1","mission_step_id":null,"command_center_event_id":"538b64ed-50e3-43c7-81f9-1f8b380bc166"},{"id":"cd2b4eaa-7aa2-48e6-a632-1f4eaf5cbbfc","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"src/pages/card-grading/PCGModesWorkspace.tsx","content":"import React from 'react';\n// PCG owner-requested MODES restore anchor: preserves the known-good pre-redesign presentation.\nimport {ArrowLeft,ArrowRight,Boxes,CheckCircle2,ClipboardCheck,Clock3,CreditCard,Database,Images,Settings,Truck,Users} from 'lucide-react';\nimport {useLocation,useNavigate} from 'react-router-dom';\nimport PcgWorkspace from '@/pages/crm/PcgWorkspace';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport PCGCompletionCenter from '@/pages/card-grading/PCGCompletionCenter';\nimport TenantLogo from '@/components/branding/TenantLogo';\nimport MiscAwareAccountMenu from '@/components/MiscAwareAccountMenu';\nimport {CanonicalWorkspaceSidebarTrigger} from '@/components/layout/TenantLayoutControl';\nimport {supabase} from '@/integrations/supabase/client';\nimport {PCG_WORKSPACE_BACKGROUND} from '@/assets/pcgWorkspaceBackground';\nimport {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';\nimport {tenantMediaAssetUrl} from '@/lib/tenantMedia';\nimport {getTenantModeCards} from '@/shells/modesTenantShell';\n\ntype ModeId='submissions'|'grading'|'listings'|'orders';\ntype WorkspaceTab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';\ntype VaultMode='overview'|'single'|'batch'|'growth';\ntype ModeCounts={submissions:number;grading:number;listings:number;orders:number};\ntype UnknownRecord=Record<string,any>;\n\nfunction record(value:unknown):UnknownRecord{return value&&typeof value==='object'&&!Array.isArray(value)?value as UnknownRecord:{}}\nfunction resolvePcgHeroImage(tenant:any):string{\n  const settings=record(tenant?.settings);\n  const media=record(settings.media_branding);\n  const direct=String(media.hero_background_url||'').trim();\n  const assetId=String(media.resolved_hero_asset_id||media.hero_background_asset_id||'').trim();\n  const version=String(media.resolved_hero_version||media.hero_background_version||media.updated_at||'').trim();\n  return assetId?tenantMediaAssetUrl(assetId,version||null):direct;\n}\n\nconst MODE_TAB:Record<ModeId,WorkspaceTab>={submissions:'submissions',grading:'queue',listings:'inventory',orders:'shipping'};\nconst MODE_TOOLS:Record<ModeId,readonly {id:WorkspaceTab;label:string;vault?:VaultMode}[]>={\n  submissions:[{id:'submissions',label:'Receive Cards'},{id:'vault',label:'Capture Cards'},{id:'collectors',label:'Customers'}],\n  grading:[{id:'queue',label:'Grade Cards'},{id:'certs',label:'Certificates'}],\n  listings:[],\n  orders:[{id:'shipping',label:'Fulfill & Ship'}]\n};\nconst ADMIN_TOOLS=[{id:'settings' as WorkspaceTab,label:'Settings',icon:Settings},{id:'money' as WorkspaceTab,label:'Payments',icon:CreditCard},{id:'readiness' as WorkspaceTab,label:'Readiness',icon:ClipboardCheck},{id:'migration' as WorkspaceTab,label:'Migration',icon:Database}] as const;\nconst ADMIN_TOOL_IDS=new Set<WorkspaceTab>(ADMIN_TOOLS.map(item=>item.id));\nconst TOOL_LABEL:Record<WorkspaceTab,string>={today:'Work Queue',vault:'Capture Cards',queue:'Grade Cards',submissions:'Receive Cards',certs:'Certificates',collectors:'Customers',inventory:'Publish & Sell',shipping:'Fulfill & Ship',money:'Payments',migration:'Migration',readiness:'Readiness',settings:'Settings'};\nconst PCG_CARD_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/7fd5d898-1ff3-4bc2-9f7d-c7f2f2d6ee07/IMG_8111.jpg';\nconst PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';\nconst MODES=[\n  {id:'submissions' as ModeId,assetKey:'received',title:'Receive Cards',short:'To Receive',copy:'Start here when cards arrive. Add the customer, capture the cards and begin the submission.',icon:Images,accent:'#168cff',image:PCG_CARD_IMAGE,position:'38% 45%'},\n  {id:'grading' as ModeId,assetKey:'grading',title:'Grade Cards',short:'To Grade',copy:'Open the grading queue, score cards, assign certificates and clear QA.',icon:Clock3,accent:'#a83cff',image:PCG_WORKSPACE_BACKGROUND,position:'68% 52%'},\n  {id:'listings' as ModeId,assetKey:'completed',title:'Publish & Sell',short:'Ready to Publish',copy:'Finish completed cards, approve sale pricing and publish to the PCG website and eBay.',icon:CheckCircle2,accent:'#00e676',image:PCG_CARD_IMAGE,position:'62% 48%'},\n  {id:'orders' as ModeId,assetKey:'mailed',title:'Fulfill & Ship',short:'To Fulfill',copy:'Handle completed returns, pickups, tracking and customer shipment updates.',icon:Truck,accent:'#ffd740',image:PCG_STORE_IMAGE,position:'76% 58%'},\n] as const;\n\nconst PCGBatchPublishingCenter=React.lazy(()=>import('@/pages/card-grading/PCGBatchPublishingCenter'));\n\nfunction isModeId(value:string|null):value is ModeId{return MODES.some(item=>item.id===value)}\nfunction isWorkspaceTab(value:string|null):value is WorkspaceTab{return Boolean(value)&&['today','vault','queue','submissions','certs','collectors','inventory','shipping','money','migration','readiness','settings'].includes(value as WorkspaceTab)}\nfunction bucket(status:string):ModeId|null{\n  if(['received','intake_imaging','authentication'].includes(status))return'submissions';\n  if(['grading','encapsulation','qa'].includes(status))return'grading';\n  if(status==='ready')return'listings';\n  if(['shipped','picked_up','delivered','closed'].includes(status))return'orders';\n  return null;\n}\n\nexport default function PCGModesWorkspace(){\n  const{activeTenant}=useMultiTenant();\n  const location=useLocation();\n  const navigate=useNavigate();\n  const tenantId=activeTenant?.id||'';\n  const slug=String(activeTenant?.company_slug||'pcg').trim().toLowerCase()||'pcg';\n  const wmpUrl='https://whatsmyprogress.com/'+encodeURIComponent(slug)+'/';\n  const branding=React.useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);\n  const workspaceBackground=branding.backgroundUrl||PCG_WORKSPACE_BACKGROUND;\n  const heroImage=React.useMemo(()=>resolvePcgHeroImage(activeTenant)||workspaceBackground,[activeTenant,workspaceBackground]);\n  const configuredModeCards=React.useMemo(()=>getTenantModeCards(activeTenant as any),[activeTenant]);\n  const modes=React.useMemo(()=>MODES.map((entry)=>{\n    const configured=configuredModeCards.find((card)=>card.key===entry.assetKey);\n    const x=configured?.image_position_x;\n    const y=configured?.image_position_y;\n    const assetId=String(configured?.image_asset_id||'').trim();\n    const image=assetId?tenantMediaAssetUrl(assetId):String(configured?.image_url||configured?.fallback_image_url||entry.image);\n    return {...entry,image,position:typeof x==='number'&&typeof y==='number'?`${x}% ${y}%`:entry.position};\n  }),[configuredModeCards]);\n  const searchParams=new URLSearchParams(location.search);\n  const requestedMode=searchParams.get('mode');\n  const requestedTool=searchParams.get('tool');\n  const requestedVault=searchParams.get('vault');\n  const requestedSubmissionId=searchParams.get('submissionId')||'';\n  const mode=isModeId(requestedMode)?requestedMode:null;\n  const tool=isWorkspaceTab(requestedTool)?requestedTool:null;\n  const adminTool=!mode&&tool&&ADMIN_TOOL_IDS.has(tool)?tool:null;\n  const vaultMode:VaultMode=requestedVault==='batch'?'batch':requestedVault==='single'?'single':requestedVault==='growth'?'growth':'overview';\n  const[counts,setCounts]=React.useState<ModeCounts>({submissions:0,grading:0,listings:0,orders:0});\n\n  React.useEffect(()=>{\n    let cancelled=false;\n    if(!tenantId)return;\n    void (supabase as any).from('card_grading_submissions').select('status').eq('tenant_id',tenantId).then(({data}:any)=>{\n      if(cancelled)return;\n      const next:ModeCounts={submissions:0,grading:0,listings:0,orders:0};\n      for(const row of data||[]){const id=bucket(String(row?.status||''));if(id)next[id]+=1}\n      setCounts(next);\n    }).catch(()=>{});\n    return()=>{cancelled=true};\n  },[tenantId]);\n\n  const setMode=React.useCallback((next:ModeId|null)=>{\n    const params=new URLSearchParams(location.search);\n    if(next){params.set('mode',next);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}else{params.delete('mode');params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openTool=React.useCallback((nextMode:ModeId,nextTool:WorkspaceTab,nextVault?:VaultMode)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode',nextMode);params.set('tool',nextTool);\n    if(nextVault)params.set('vault',nextVault);else params.delete('vault');\n    params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openCaptureForSubmission=React.useCallback((submissionId:string)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode','submissions');params.set('tool','vault');params.set('vault','batch');params.set('submissionId',submissionId);params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openAdminTool=React.useCallback((nextTool:WorkspaceTab)=>{\n    const params=new URLSearchParams(location.search);\n    params.delete('mode');params.delete('vault');params.set('tool',nextTool);params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const closeAdminTool=React.useCallback(()=>{const params=new URLSearchParams(location.search);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId');const search=params.toString();navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false})},[location.hash,location.pathname,location.search,navigate]);\n\n  if(mode){\n    const current=modes.find(item=>item.id===mode)!;\n    const modeTools=MODE_TOOLS[mode];\n    const allowedTabs=modeTools.map(item=>item.id);\n    const scopedTool=tool&&allowedTabs.includes(tool)?tool:null;\n    const activeTab=scopedTool||MODE_TAB[mode];\n    const headerLabel=scopedTool?TOOL_LABEL[scopedTool]:current.title;\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-active-mode={mode} data-pcg-mode-target={activeTab} className=\"min-h-screen bg-[#050607] text-white\">\n      <div data-pcg-mode-header=\"true\" className=\"sticky left-0 right-0 top-0 z-[65] box-border w-screen max-w-none border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\">\n        <div className=\"flex w-full items-center gap-3\">\n          <button type=\"button\" onClick={()=>setMode(null)} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 shrink-0 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button>\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Workflow</div><div className=\"truncate text-sm font-black\">{headerLabel}</div></div>\n          <div className=\"ml-auto hidden min-w-0 items-center gap-2 lg:flex\"><CanonicalWorkspaceSidebarTrigger className=\"h-10 w-[clamp(14rem,28vw,24rem)] border-white/[.10] bg-black/35 text-white/50 hover:bg-white/[.06] hover:text-white/80\"/></div><div className=\"ml-auto lg:ml-0\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-mode-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div>\n        </div>\n        {modeTools.length>1?<div className=\"mt-2 flex flex-wrap gap-1 pb-0.5\">{modeTools.map(item=><button key={item.id} type=\"button\" onClick={()=>openTool(mode,item.id,item.vault)} className={`whitespace-nowrap rounded-xl border px-3 py-2 text-[10px] font-black uppercase tracking-[.08em] ${activeTab===item.id?'border-[#b08a36]/35 bg-[#f2e7ce] text-[#72561a] shadow-sm':'border-black/[.08] bg-white text-black/48 hover:bg-[#f6f2ea]'}`}>{item.label}</button>)}</div>:null}\n      </div>\n      {mode==='listings'?<><PCGCompletionCenter mode=\"completed\"/><React.Suspense fallback={null}><PCGBatchPublishingCenter tenantId={tenantId}/></React.Suspense></>:null}\n      {mode==='orders'?<><PCGCompletionCenter mode=\"mailed\"/><PcgWorkspace initialTab=\"shipping\" embedded navigationScope={['shipping']}/></>:null}\n      {mode==='submissions'||mode==='grading'?<PcgWorkspace initialTab={activeTab} initialVaultMode={vaultMode} initialVaultSubmissionId={requestedSubmissionId} onSubmissionCreated={mode==='submissions'?({id})=>openCaptureForSubmission(id):undefined} embedded navigationScope={allowedTabs}/>:null}\n    </div>\n  }\n\n  if(adminTool){\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-admin-tool={adminTool} className=\"min-h-screen bg-[#050607] text-white\">\n      <div className=\"sticky left-0 right-0 top-0 z-[65] border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\"><div className=\"flex items-center gap-3\"><button type=\"button\" onClick={closeAdminTool} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button><div className=\"grid h-10 w-10 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Admin</div><div className=\"text-sm font-black\">{TOOL_LABEL[adminTool]}</div></div><div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-admin-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div></div></div>\n      <PcgWorkspace initialTab={adminTool} embedded navigationScope={[adminTool]}/>\n    </div>\n  }\n\n\n\n\n  return <main data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-modes-workspace=\"true\" data-pcg-media-contract=\"tenant-configured\" className=\"relative min-h-dvh overflow-x-hidden bg-[#050607] pb-8 text-white\">\n    <div aria-hidden=\"true\" className=\"pointer-events-none fixed inset-0 z-0 bg-[#050607]\" style={{backgroundImage:'linear-gradient(108deg,rgba(3,4,5,.96) 0%,rgba(3,4,5,.90) 48%,rgba(3,4,5,.82) 100%),url(\"'+workspaceBackground+'\")',backgroundSize:'cover',backgroundPosition:branding.backgroundPosition||'center',backgroundRepeat:'no-repeat',backgroundAttachment:'fixed'}}/>\n\n    <header className=\"sticky left-0 right-0 top-0 z-[70] border-b border-white/[.08] bg-[#050607]/92 backdrop-blur-xl\">\n      <div className=\"flex min-h-[64px] items-center gap-3 px-3 sm:px-5 lg:px-7\">\n        <CanonicalWorkspaceSidebarTrigger className=\"h-11 w-[clamp(13rem,34vw,28rem)] border-white/[.10] bg-black/35 text-white/55 hover:bg-white/[.06] hover:text-white/85 max-sm:w-11 max-sm:px-0 max-sm:[&>span]:hidden\"/>\n        <div className=\"flex min-w-0 items-center gap-2.5\">\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={38} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Prestigious Card Grading</div><div className=\"truncate text-sm font-black text-white\">Work Queue</div></div>\n        </div>\n        <div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={'pcg-dashboard-avatar:'+(tenantId||'workspace')} tenantShellOwner/></div>\n      </div>\n    </header>\n\n    <div className=\"relative z-10 mx-auto max-w-[1560px] px-3 pb-7 pt-4 sm:px-5 sm:pt-5 lg:px-7 lg:pt-6\">\n      <section className=\"relative overflow-hidden rounded-[24px] border border-white/[.10] bg-black/45 shadow-2xl\">\n        <div className=\"absolute inset-0 opacity-55\" style={{backgroundImage:'url(\"'+heroImage+'\")',backgroundSize:'cover',backgroundPosition:'center 48%'}}/>\n        <div className=\"absolute inset-0 bg-gradient-to-r from-black/95 via-black/72 to-black/40\"/>\n        <div className=\"relative flex min-h-[158px] flex-col justify-end p-5 sm:min-h-[190px] sm:p-7 lg:p-8\">\n          <div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">PCG MODES</div>\n          <h1 className=\"mt-2 text-[clamp(2rem,4vw,3.8rem)] font-black leading-[.92] tracking-[-.05em] text-white\">Your grading command center.</h1>\n          <p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/58\">Pick the part of the shop you are working in. Each mode keeps only the tools for that job in front of you.</p>\n        </div>\n      </section>\n\n      <section className=\"mt-4\">\n        <div className=\"mb-2.5 flex items-end justify-between gap-4 px-1\">\n          <div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Work Queue</div><h2 className=\"mt-1 text-xl font-black tracking-[-.025em] text-white sm:text-2xl\">Choose a mode</h2></div>\n          <div className=\"hidden text-xs font-semibold text-white/32 sm:block\">Receive → Grade → Publish → Fulfill</div>\n        </div>\n        <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4\">{modes.map(({id,title,short,copy,icon:Icon,accent,image,position})=><button key={id} type=\"button\" data-pcg-mode-id={id} aria-label={'Open '+title} onClick={()=>setMode(id)} className=\"group relative min-h-[230px] overflow-hidden rounded-[22px] border border-white/[.10] bg-[#090a0b] text-left shadow-2xl transition duration-200 hover:-translate-y-0.5 hover:border-white/[.18]\">\n          <div className=\"absolute inset-0 opacity-55 transition duration-300 group-hover:scale-[1.025] group-hover:opacity-70\" style={{backgroundImage:'url(\"'+image+'\")',backgroundSize:'cover',backgroundPosition:position}}/>\n          <div className=\"absolute inset-0 bg-gradient-to-t from-black via-black/78 to-black/22\"/>\n          <div className=\"absolute inset-x-0 top-0 h-[3px]\" style={{backgroundColor:accent}}/>\n          <div className=\"relative flex h-full min-h-[230px] flex-col justify-end p-4 sm:p-5\">\n            <div className=\"mb-auto flex items-start justify-between gap-3\">\n              <span className=\"grid h-10 w-10 place-items-center rounded-xl border border-white/[.12] bg-black/45 backdrop-blur\"><Icon className=\"h-5 w-5\" style={{color:accent}}/></span>\n              <div className=\"text-right\"><div className=\"text-3xl font-black leading-none text-white\">{counts[id]}</div><div className=\"mt-1 text-[8px] font-black uppercase tracking-[.12em] text-white/38\">{short}</div></div>\n            </div>\n            <h3 className=\"text-xl font-black tracking-[-.025em] text-white\">{title}</h3>\n            <p className=\"mt-1.5 line-clamp-2 text-[11px] leading-5 text-white/46\">{copy}</p>\n            <div className=\"mt-3 flex items-center gap-1 text-[9px] font-black uppercase tracking-[.12em]\" style={{color:accent}}>Open mode <ArrowRight className=\"h-3.5 w-3.5 transition group-hover:translate-x-0.5\"/></div>\n          </div>\n        </button>)}</div>\n      </section>\n\n      <section className=\"mt-4 rounded-[18px] border border-white/[.08] bg-black/28 p-3 backdrop-blur-sm\">\n        <div className=\"flex flex-wrap items-center gap-2\">\n          <span className=\"mr-1 text-[9px] font-black uppercase tracking-[.16em] text-white/28\">Admin</span>\n          {ADMIN_TOOLS.map(({id,label,icon:Icon})=><button key={id} type=\"button\" onClick={()=>openAdminTool(id)} className=\"inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[.09] bg-white/[.04] px-3 text-[10px] font-black text-white/48 transition hover:bg-white/[.08] hover:text-white/78\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</button>)}\n        </div>\n      </section>\n    </div>\n  </main>\n}\n"}],"route":"/pcg/workspace","branch":"ai/objective-first-repair-538b64ed50e3","writes":[],"patches":[],"pr_body":"Owner-requested replacement of the rejected white numbered PCG dashboard with the image-backed PCG MODES shell using existing tenant media and live mode counts.","version":1,"approved":true,"pr_title":"PCG: restore true MODES workspace","missionId":"538b64ed-50e3-43c7-81f9-1f8b380bc166","objective":"Owner explicitly rejected the white numbered PCG dashboard and said throw the whole thing away and revert to MODES. Replace the current simplified PCG owner landing shell with a genuine MODES presentation using the existing tenant-configured workspace background, PCG hero image, per-mode imagery, per-mode colors, live counts, and four canonical modes. Remove 'Run the shop from here', numbered 1-4 workflow cards, white SaaS dashboard framing, beige/neutral redesign language, and the large standalone Receive new cards CTA. Restore a dark cinematic PCG MODES shell with compact hero, four image-backed mode cards, Work Queue framing, and compact admin tools. Also restore the active-mode/admin shell chrome to the dark MODES treatment. Preserve all existing workflows, routes, data actions, receive-to-capture handoff, grading scale, publishing, fulfillment, settings behavior, and provider state. Frontend only. Ship through fast UI gate, squash merge, and frontend release. Live proof must show /pcg/workspace no longer contains 'Run the shop from here' and does show 'PCG MODES', 'Your grading command center.', 'Choose a mode', and the four mode titles on desktop and mobile.","tenantRef":"pcg","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx"],"commit_message":"Restore PCG MODES workspace shell","implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":null,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"f1f22dd9dcca05fcfc90697df62a4f874c7c0be6ccc29067fb619107c4308623","replayCount":0,"serializedBytes":23893},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:48:48.795722+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:538b64ed-50e3-43c7-81f9-1f8b380bc166:repository-mutation-intent:f1f22dd9dcca05fcfc90697df62a4f874c7c0be6ccc29067fb619107c4308623:0","mission_step_id":"ab67952c-88cc-40ba-ba6f-6ae8798b8897","command_center_event_id":"538b64ed-50e3-43c7-81f9-1f8b380bc166"},{"id":"6f8d656c-55a8-424d-9a0a-5c32f3672816","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/tenant-type-alias-completion","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3030,"terminal":false,"missionId":"e79cea42-9ffa-4834-b086-ed143c9b262a","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":8013,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":3880,"missionSetupMs":1244,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":872,"ledgerReconcileMs":0,"lineageReconcileMs":372,"resolvePreflightMs":1244,"repositoryMutationMs":4133,"repositoryProviderMs":4133,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":3575,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":872,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":558},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"e79cea42-9ffa-4834-b086-ed143c9b262a"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3074,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:19:10.807005+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3030","receipt_type":"execute_mission","idempotency_key":"mission:e79cea42-9ffa-4834-b086-ed143c9b262a:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"71162f1a-02e7-49c5-937b-cee1c70917d8","command_center_event_id":"e79cea42-9ffa-4834-b086-ed143c9b262a"},{"id":"e3d3e43a-f719-4199-8b54-a56fc3c90372","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","render-onrunner/runtime-proof":"success"},"mainSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"onrunner":"success"},"requestContractHash":"0d296b7f8c1c1ae465be73ea700577d2057354aeb52208ef01f91c25b5e16373","forgejoWorkflowProof":{"runId":9277,"source":"signed_push_receipt","status":"success","results":{},"conclusion":"success","targetStates":{"onrunner":"success"},"targetJobCount":7,"observedTargetStates":{"onrunner":"success"}},"onrunnerRuntimeProof":{"reason":null,"hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":true,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","runnerVersion":"onrunner-ee384af9a400","expectedSourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:23:42.263242+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"ee384af9a40035680895bdd7fc1315d9272ffabf","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:2e59bcaf-a7cb-454a-a797-3ad6ca302f1c:forgejo-release-status:ee384af9a40035680895bdd7fc1315d9272ffabf:verified:forgejo-main/source=success|forgejo-release/workflow=success|render-onrunner/runtime-proof=success","mission_step_id":"c5790ff7-35f4-4733-9cc6-de9e7bf60fe2","command_center_event_id":"2e59bcaf-a7cb-454a-a797-3ad6ca302f1c"},{"id":"85818dd6-febf-4f25-846a-d5acf1fe31f8","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/tenant-type-alias-completion","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3030,"terminal":false,"missionId":"e79cea42-9ffa-4834-b086-ed143c9b262a","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4969,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":430,"approvedPlanMs":0,"missionSetupMs":1094,"providerAuthMs":0,"shipAndProveMs":4346,"ledgerPrepareMs":963,"ledgerReconcileMs":0,"lineageReconcileMs":131,"resolvePreflightMs":1094,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":963,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"e79cea42-9ffa-4834-b086-ed143c9b262a"},"performance":null,"deploymentId":"forgejo-main-29fc0a9e0f68","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":true,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","release","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2852,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:28:13.954499+00:00","proof_gate":"canonical_release_dispatched","source_sha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","external_id":"forgejo-main-29fc0a9e0f68","receipt_type":"execute_mission","idempotency_key":"mission:e79cea42-9ffa-4834-b086-ed143c9b262a:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"33cfb76a-6129-4ed2-b2c6-dbbb7a98cebe","command_center_event_id":"e79cea42-9ffa-4834-b086-ed143c9b262a"},{"id":"59907e3e-24b0-481d-a227-105a31163ee9","source":"forgejo-exact-source","status":"verified","payload":{"sourceSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","repository":"noel/KnockLaunchOS","repositoryProofs":[{"id":"repo-map","path":null,"proof":"forgejo_merged_pr_exact_head_gate","headSha":"3693ce24b09a8f661b174b4d07df07deeac92955","prNumber":3030,"gateRunId":9280,"gateContext":"KnockLaunch Gate / KnockLaunch Gate (pull_request)","expectedText":null,"gateTargetUrl":"/noel/KnockLaunchOS/actions/runs/9280/jobs/1","mergeCommitSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b"}],"requestContractHash":"d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1","namedGateEvidenceReceiptVersion":null},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:34:02.081363+00:00","proof_gate":"request_contract_repository_verified","source_sha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","external_id":null,"receipt_type":"request_contract_repository_status","idempotency_key":"mission:e79cea42-9ffa-4834-b086-ed143c9b262a:request-contract-repository:d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1:29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","mission_step_id":"dc2a13f3-92e7-4771-ab4d-08f38a53c2f2","command_center_event_id":"e79cea42-9ffa-4834-b086-ed143c9b262a"},{"id":"eeb6c25a-594d-4d8a-b5d5-f6498b4fcb12","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"current-tenants-deterministically-typed","satisfied":true,"statement":"All current authoritative tenant_type values resolve to a platform archetype except genuinely ambiguous MISC tenants.","proofConditionIds":["repo-map","release-map","runtime-map"]}],"satisfied":true,"constraints":[{"id":"authoritative-only","satisfied":true,"statement":"Map only from authoritative tenant_type tokens; never tenant names or slugs.","proofConditionIds":["repo-map","runtime-map"]},{"id":"preserve-owner-edits","satisfied":true,"statement":"Migration updates only migration-owned currently-unclassified rows and never overwrites owner/admin classifications.","proofConditionIds":["repo-map","runtime-map"]},{"id":"misc-unclassified","satisfied":true,"statement":"MISC remains explicitly unclassified and prerequisite_required.","proofConditionIds":["repo-map","runtime-map"]},{"id":"backward-compatible","satisfied":true,"statement":"Additive change preserves branding, routes, data, permissions, integrations, and working workflows.","proofConditionIds":["repo-map","release-map","runtime-map"]},{"id":"capability-completeness","satisfied":true,"statement":"All applicable frontend, runtime, data/storage, authorization, states, release ownership, and live proof are wired.","proofConditionIds":["repo-map","release-map","runtime-map"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Activation follows exact release and canary proof; failures isolate tenant classification behavior.","proofConditionIds":["release-map","runtime-map"]}],"contractHash":"d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"repo-map","kind":"repository","evidence":{"reason":null,"gateRunId":9280,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":true,"namedGateTestPath":null,"releaseTargetStates":{"frontend":"success","migrations":"success","supabaseEdge":"success"},"repositoryProofGate":"request_contract_repository_verified","repositoryProofPath":null,"requestContractHash":"d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1","unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge","migrations"],"allowedReleaseTargets":[],"repositoryProofStatus":"verified","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":["migrations"],"migrationReleaseVerified":true,"repositoryConditionBound":true,"repositoryProofSourceSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b"},"required":true,"satisfied":true},{"id":"release-map","kind":"release","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","migrations":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge","migrations"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1"},"required":true,"satisfied":true},{"id":"runtime-map","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","migrations":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge","migrations"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["frontend","supabaseEdge","migrations"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:34:13.927413+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:e79cea42-9ffa-4834-b086-ed143c9b262a:request-contract:d10dc89389f263ae2cb53b821b27e1068f8294f32b7e24c16c1d0666a53611e1:29fc0a9e0f680d55f6f2107ca81696c5ed4d183b:verified:","mission_step_id":"dc2a13f3-92e7-4771-ab4d-08f38a53c2f2","command_center_event_id":"e79cea42-9ffa-4834-b086-ed143c9b262a"},{"id":"67cfae6b-14fc-45b5-9bd3-87ae2a0a7e4e","source":"cc-execution","status":"verified","payload":{"ownerWaitSloMs":{"merge_to_live_ms":100340,"owner_action_to_pr_ms":7606,"green_gate_to_merge_ms":1919,"owner_action_to_useful_response_ms":7606},"ownerWaitLiveAt":"2026-09-29T19:57:16.340Z"},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:57:16.657899+00:00","proof_gate":"owner_wait_live_milestone_recorded","source_sha":null,"external_id":null,"receipt_type":"owner_wait_live_milestone","idempotency_key":"mission:835f8c32-adf3-415d-a1ad-0c1d8d46234a:owner-wait-live","mission_step_id":"962d4b1a-1708-4cc5-8a54-7242edd35cda","command_center_event_id":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},{"id":"96955bbf-6432-46ff-aebd-ebc824594eaf","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"src/pages/card-grading/PCGModesWorkspace.tsx","content":"import React from 'react';\n// PCG owner-requested MODES restore anchor: preserves the known-good pre-redesign presentation.\nimport {ArrowLeft,ArrowRight,Boxes,CheckCircle2,ClipboardCheck,Clock3,CreditCard,Database,Images,Settings,Truck,Users} from 'lucide-react';\nimport {useLocation,useNavigate} from 'react-router-dom';\nimport PcgWorkspace from '@/pages/crm/PcgWorkspace';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport PCGCompletionCenter from '@/pages/card-grading/PCGCompletionCenter';\nimport TenantLogo from '@/components/branding/TenantLogo';\nimport MiscAwareAccountMenu from '@/components/MiscAwareAccountMenu';\nimport {CanonicalWorkspaceSidebarTrigger} from '@/components/layout/TenantLayoutControl';\nimport {supabase} from '@/integrations/supabase/client';\nimport {PCG_WORKSPACE_BACKGROUND} from '@/assets/pcgWorkspaceBackground';\nimport {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';\nimport {tenantMediaAssetUrl} from '@/lib/tenantMedia';\nimport {getTenantModeCards} from '@/shells/modesTenantShell';\n\ntype ModeId='submissions'|'grading'|'listings'|'orders';\ntype WorkspaceTab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';\ntype VaultMode='overview'|'single'|'batch'|'growth';\ntype ModeCounts={submissions:number;grading:number;listings:number;orders:number};\ntype UnknownRecord=Record<string,any>;\n\nfunction record(value:unknown):UnknownRecord{return value&&typeof value==='object'&&!Array.isArray(value)?value as UnknownRecord:{}}\nfunction resolvePcgHeroImage(tenant:any):string{\n  const settings=record(tenant?.settings);\n  const media=record(settings.media_branding);\n  const direct=String(media.hero_background_url||'').trim();\n  const assetId=String(media.resolved_hero_asset_id||media.hero_background_asset_id||'').trim();\n  const version=String(media.resolved_hero_version||media.hero_background_version||media.updated_at||'').trim();\n  return assetId?tenantMediaAssetUrl(assetId,version||null):direct;\n}\n\nconst MODE_TAB:Record<ModeId,WorkspaceTab>={submissions:'submissions',grading:'queue',listings:'inventory',orders:'shipping'};\nconst MODE_TOOLS:Record<ModeId,readonly {id:WorkspaceTab;label:string;vault?:VaultMode}[]>={\n  submissions:[{id:'submissions',label:'Receive Cards'},{id:'vault',label:'Capture Cards'},{id:'collectors',label:'Customers'}],\n  grading:[{id:'queue',label:'Grade Cards'},{id:'certs',label:'Certificates'}],\n  listings:[],\n  orders:[{id:'shipping',label:'Fulfill & Ship'}]\n};\nconst ADMIN_TOOLS=[{id:'settings' as WorkspaceTab,label:'Settings',icon:Settings},{id:'money' as WorkspaceTab,label:'Payments',icon:CreditCard},{id:'readiness' as WorkspaceTab,label:'Readiness',icon:ClipboardCheck},{id:'migration' as WorkspaceTab,label:'Migration',icon:Database}] as const;\nconst ADMIN_TOOL_IDS=new Set<WorkspaceTab>(ADMIN_TOOLS.map(item=>item.id));\nconst TOOL_LABEL:Record<WorkspaceTab,string>={today:'Work Queue',vault:'Capture Cards',queue:'Grade Cards',submissions:'Receive Cards',certs:'Certificates',collectors:'Customers',inventory:'Publish & Sell',shipping:'Fulfill & Ship',money:'Payments',migration:'Migration',readiness:'Readiness',settings:'Settings'};\nconst PCG_CARD_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/7fd5d898-1ff3-4bc2-9f7d-c7f2f2d6ee07/IMG_8111.jpg';\nconst PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';\nconst MODES=[\n  {id:'submissions' as ModeId,assetKey:'received',title:'Receive Cards',short:'To Receive',copy:'Start here when cards arrive. Add the customer, capture the cards and begin the submission.',icon:Images,accent:'#168cff',image:PCG_CARD_IMAGE,position:'38% 45%'},\n  {id:'grading' as ModeId,assetKey:'grading',title:'Grade Cards',short:'To Grade',copy:'Open the grading queue, score cards, assign certificates and clear QA.',icon:Clock3,accent:'#a83cff',image:PCG_WORKSPACE_BACKGROUND,position:'68% 52%'},\n  {id:'listings' as ModeId,assetKey:'completed',title:'Publish & Sell',short:'Ready to Publish',copy:'Finish completed cards, approve sale pricing and publish to the PCG website and eBay.',icon:CheckCircle2,accent:'#00e676',image:PCG_CARD_IMAGE,position:'62% 48%'},\n  {id:'orders' as ModeId,assetKey:'mailed',title:'Fulfill & Ship',short:'To Fulfill',copy:'Handle completed returns, pickups, tracking and customer shipment updates.',icon:Truck,accent:'#ffd740',image:PCG_STORE_IMAGE,position:'76% 58%'},\n] as const;\n\nconst PCGBatchPublishingCenter=React.lazy(()=>import('@/pages/card-grading/PCGBatchPublishingCenter'));\n\nfunction isModeId(value:string|null):value is ModeId{return MODES.some(item=>item.id===value)}\nfunction isWorkspaceTab(value:string|null):value is WorkspaceTab{return Boolean(value)&&['today','vault','queue','submissions','certs','collectors','inventory','shipping','money','migration','readiness','settings'].includes(value as WorkspaceTab)}\nfunction bucket(status:string):ModeId|null{\n  if(['received','intake_imaging','authentication'].includes(status))return'submissions';\n  if(['grading','encapsulation','qa'].includes(status))return'grading';\n  if(status==='ready')return'listings';\n  if(['shipped','picked_up','delivered','closed'].includes(status))return'orders';\n  return null;\n}\n\nexport default function PCGModesWorkspace(){\n  const{activeTenant}=useMultiTenant();\n  const location=useLocation();\n  const navigate=useNavigate();\n  const tenantId=activeTenant?.id||'';\n  const slug=String(activeTenant?.company_slug||'pcg').trim().toLowerCase()||'pcg';\n  const wmpUrl='https://whatsmyprogress.com/'+encodeURIComponent(slug)+'/';\n  const branding=React.useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);\n  const workspaceBackground=branding.backgroundUrl||PCG_WORKSPACE_BACKGROUND;\n  const heroImage=React.useMemo(()=>resolvePcgHeroImage(activeTenant)||workspaceBackground,[activeTenant,workspaceBackground]);\n  const configuredModeCards=React.useMemo(()=>getTenantModeCards(activeTenant as any),[activeTenant]);\n  const modes=React.useMemo(()=>MODES.map((entry)=>{\n    const configured=configuredModeCards.find((card)=>card.key===entry.assetKey);\n    const x=configured?.image_position_x;\n    const y=configured?.image_position_y;\n    const assetId=String(configured?.image_asset_id||'').trim();\n    const image=assetId?tenantMediaAssetUrl(assetId):String(configured?.image_url||configured?.fallback_image_url||entry.image);\n    return {...entry,image,position:typeof x==='number'&&typeof y==='number'?`${x}% ${y}%`:entry.position};\n  }),[configuredModeCards]);\n  const searchParams=new URLSearchParams(location.search);\n  const requestedMode=searchParams.get('mode');\n  const requestedTool=searchParams.get('tool');\n  const requestedVault=searchParams.get('vault');\n  const requestedSubmissionId=searchParams.get('submissionId')||'';\n  const mode=isModeId(requestedMode)?requestedMode:null;\n  const tool=isWorkspaceTab(requestedTool)?requestedTool:null;\n  const adminTool=!mode&&tool&&ADMIN_TOOL_IDS.has(tool)?tool:null;\n  const vaultMode:VaultMode=requestedVault==='batch'?'batch':requestedVault==='single'?'single':requestedVault==='growth'?'growth':'overview';\n  const[counts,setCounts]=React.useState<ModeCounts>({submissions:0,grading:0,listings:0,orders:0});\n\n  React.useEffect(()=>{\n    let cancelled=false;\n    if(!tenantId)return;\n    void (supabase as any).from('card_grading_submissions').select('status').eq('tenant_id',tenantId).then(({data}:any)=>{\n      if(cancelled)return;\n      const next:ModeCounts={submissions:0,grading:0,listings:0,orders:0};\n      for(const row of data||[]){const id=bucket(String(row?.status||''));if(id)next[id]+=1}\n      setCounts(next);\n    }).catch(()=>{});\n    return()=>{cancelled=true};\n  },[tenantId]);\n\n  const setMode=React.useCallback((next:ModeId|null)=>{\n    const params=new URLSearchParams(location.search);\n    if(next){params.set('mode',next);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}else{params.delete('mode');params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openTool=React.useCallback((nextMode:ModeId,nextTool:WorkspaceTab,nextVault?:VaultMode)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode',nextMode);params.set('tool',nextTool);\n    if(nextVault)params.set('vault',nextVault);else params.delete('vault');\n    params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openCaptureForSubmission=React.useCallback((submissionId:string)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode','submissions');params.set('tool','vault');params.set('vault','batch');params.set('submissionId',submissionId);params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openAdminTool=React.useCallback((nextTool:WorkspaceTab)=>{\n    const params=new URLSearchParams(location.search);\n    params.delete('mode');params.delete('vault');params.set('tool',nextTool);params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const closeAdminTool=React.useCallback(()=>{const params=new URLSearchParams(location.search);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId');const search=params.toString();navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false})},[location.hash,location.pathname,location.search,navigate]);\n\n  if(mode){\n    const current=modes.find(item=>item.id===mode)!;\n    const modeTools=MODE_TOOLS[mode];\n    const allowedTabs=modeTools.map(item=>item.id);\n    const scopedTool=tool&&allowedTabs.includes(tool)?tool:null;\n    const activeTab=scopedTool||MODE_TAB[mode];\n    const headerLabel=scopedTool?TOOL_LABEL[scopedTool]:current.title;\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-active-mode={mode} data-pcg-mode-target={activeTab} className=\"min-h-screen bg-[#050607] text-white\">\n      <div data-pcg-mode-header=\"true\" className=\"sticky left-0 right-0 top-0 z-[65] box-border w-screen max-w-none border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\">\n        <div className=\"flex w-full items-center gap-3\">\n          <button type=\"button\" onClick={()=>setMode(null)} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 shrink-0 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button>\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Workflow</div><div className=\"truncate text-sm font-black\">{headerLabel}</div></div>\n          <div className=\"ml-auto hidden min-w-0 items-center gap-2 lg:flex\"><CanonicalWorkspaceSidebarTrigger className=\"h-10 w-[clamp(14rem,28vw,24rem)] border-white/[.10] bg-black/35 text-white/50 hover:bg-white/[.06] hover:text-white/80\"/></div><div className=\"ml-auto lg:ml-0\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-mode-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div>\n        </div>\n        {modeTools.length>1?<div className=\"mt-2 flex flex-wrap gap-1 pb-0.5\">{modeTools.map(item=><button key={item.id} type=\"button\" onClick={()=>openTool(mode,item.id,item.vault)} className={`whitespace-nowrap rounded-xl border px-3 py-2 text-[10px] font-black uppercase tracking-[.08em] transition ${activeTab===item.id?'border-[#d8bb78]/40 bg-[#d8bb78]/[.12] text-[#f2d99f]':'border-white/[.09] bg-white/[.035] text-white/52 hover:bg-white/[.08] hover:text-white/82'}`}>{item.label}</button>)}</div>:null}\n      </div>\n      {mode==='listings'?<><PCGCompletionCenter mode=\"completed\"/><React.Suspense fallback={null}><PCGBatchPublishingCenter tenantId={tenantId}/></React.Suspense></>:null}\n      {mode==='orders'?<><PCGCompletionCenter mode=\"mailed\"/><PcgWorkspace initialTab=\"shipping\" embedded navigationScope={['shipping']}/></>:null}\n      {mode==='submissions'||mode==='grading'?<PcgWorkspace initialTab={activeTab} initialVaultMode={vaultMode} initialVaultSubmissionId={requestedSubmissionId} onSubmissionCreated={mode==='submissions'?({id})=>openCaptureForSubmission(id):undefined} embedded navigationScope={allowedTabs}/>:null}\n    </div>\n  }\n\n  if(adminTool){\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-admin-tool={adminTool} className=\"min-h-screen bg-[#050607] text-white\">\n      <div className=\"sticky left-0 right-0 top-0 z-[65] border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\"><div className=\"flex items-center gap-3\"><button type=\"button\" onClick={closeAdminTool} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button><div className=\"grid h-10 w-10 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Admin</div><div className=\"text-sm font-black\">{TOOL_LABEL[adminTool]}</div></div><div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-admin-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div></div></div>\n      <PcgWorkspace initialTab={adminTool} embedded navigationScope={[adminTool]}/>\n    </div>\n  }\n\n\n\n\n  return <main data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-modes-workspace=\"true\" data-pcg-media-contract=\"tenant-configured\" className=\"relative min-h-dvh overflow-x-hidden bg-[#050607] pb-8 text-white\">\n    <div aria-hidden=\"true\" className=\"pointer-events-none fixed inset-0 z-0 bg-[#050607]\" style={{backgroundImage:'linear-gradient(108deg,rgba(3,4,5,.96) 0%,rgba(3,4,5,.90) 48%,rgba(3,4,5,.82) 100%),url(\"'+workspaceBackground+'\")',backgroundSize:'cover',backgroundPosition:branding.backgroundPosition||'center',backgroundRepeat:'no-repeat',backgroundAttachment:'fixed'}}/>\n\n    <header className=\"sticky left-0 right-0 top-0 z-[70] border-b border-white/[.08] bg-[#050607]/92 backdrop-blur-xl\">\n      <div className=\"flex min-h-[64px] items-center gap-3 px-3 sm:px-5 lg:px-7\">\n        <CanonicalWorkspaceSidebarTrigger className=\"h-11 w-[clamp(13rem,34vw,28rem)] border-white/[.10] bg-black/35 text-white/55 hover:bg-white/[.06] hover:text-white/85 max-sm:w-11 max-sm:px-0 max-sm:[&>span]:hidden\"/>\n        <div className=\"flex min-w-0 items-center gap-2.5\">\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={38} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Prestigious Card Grading</div><div className=\"truncate text-sm font-black text-white\">Work Queue</div></div>\n        </div>\n        <div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={'pcg-dashboard-avatar:'+(tenantId||'workspace')} tenantShellOwner/></div>\n      </div>\n    </header>\n\n    <div className=\"relative z-10 mx-auto max-w-[1560px] px-3 pb-7 pt-4 sm:px-5 sm:pt-5 lg:px-7 lg:pt-6\">\n      <section className=\"relative overflow-hidden rounded-[24px] border border-white/[.10] bg-black/45 shadow-2xl\">\n        <div className=\"absolute inset-0 opacity-55\" style={{backgroundImage:'url(\"'+heroImage+'\")',backgroundSize:'cover',backgroundPosition:'center 48%'}}/>\n        <div className=\"absolute inset-0 bg-gradient-to-r from-black/95 via-black/72 to-black/40\"/>\n        <div className=\"relative flex min-h-[158px] flex-col justify-end p-5 sm:min-h-[190px] sm:p-7 lg:p-8\">\n          <div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">PCG MODES</div>\n          <h1 className=\"mt-2 text-[clamp(2rem,4vw,3.8rem)] font-black leading-[.92] tracking-[-.05em] text-white\">Your grading command center.</h1>\n          <p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/58\">Pick the part of the shop you are working in. Each mode keeps only the tools for that job in front of you.</p>\n        </div>\n      </section>\n\n      <section className=\"mt-4\">\n        <div className=\"mb-2.5 flex items-end justify-between gap-4 px-1\">\n          <div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Work Queue</div><h2 className=\"mt-1 text-xl font-black tracking-[-.025em] text-white sm:text-2xl\">Choose a mode</h2></div>\n          <div className=\"hidden text-xs font-semibold text-white/32 sm:block\">Receive → Grade → Publish → Fulfill</div>\n        </div>\n        <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4\">{modes.map(({id,title,short,copy,icon:Icon,accent,image,position})=><button key={id} type=\"button\" data-pcg-mode-id={id} aria-label={'Open '+title} onClick={()=>setMode(id)} className=\"group relative min-h-[230px] overflow-hidden rounded-[22px] border border-white/[.10] bg-[#090a0b] text-left shadow-2xl transition duration-200 hover:-translate-y-0.5 hover:border-white/[.18]\">\n          <div className=\"absolute inset-0 opacity-55 transition duration-300 group-hover:scale-[1.025] group-hover:opacity-70\" style={{backgroundImage:'url(\"'+image+'\")',backgroundSize:'cover',backgroundPosition:position}}/>\n          <div className=\"absolute inset-0 bg-gradient-to-t from-black via-black/78 to-black/22\"/>\n          <div className=\"absolute inset-x-0 top-0 h-[3px]\" style={{backgroundColor:accent}}/>\n          <div className=\"relative flex h-full min-h-[230px] flex-col justify-end p-4 sm:p-5\">\n            <div className=\"mb-auto flex items-start justify-between gap-3\">\n              <span className=\"grid h-10 w-10 place-items-center rounded-xl border border-white/[.12] bg-black/45 backdrop-blur\"><Icon className=\"h-5 w-5\" style={{color:accent}}/></span>\n              <div className=\"text-right\"><div className=\"text-3xl font-black leading-none text-white\">{counts[id]}</div><div className=\"mt-1 text-[8px] font-black uppercase tracking-[.12em] text-white/38\">{short}</div></div>\n            </div>\n            <h3 className=\"text-xl font-black tracking-[-.025em] text-white\">{title}</h3>\n            <p className=\"mt-1.5 line-clamp-2 text-[11px] leading-5 text-white/46\">{copy}</p>\n            <div className=\"mt-3 flex items-center gap-1 text-[9px] font-black uppercase tracking-[.12em]\" style={{color:accent}}>Open mode <ArrowRight className=\"h-3.5 w-3.5 transition group-hover:translate-x-0.5\"/></div>\n          </div>\n        </button>)}</div>\n      </section>\n\n      <section className=\"mt-4 rounded-[18px] border border-white/[.08] bg-black/28 p-3 backdrop-blur-sm\">\n        <div className=\"flex flex-wrap items-center gap-2\">\n          <span className=\"mr-1 text-[9px] font-black uppercase tracking-[.16em] text-white/28\">Admin</span>\n          {ADMIN_TOOLS.map(({id,label,icon:Icon})=><button key={id} type=\"button\" onClick={()=>openAdminTool(id)} className=\"inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[.09] bg-white/[.04] px-3 text-[10px] font-black text-white/48 transition hover:bg-white/[.08] hover:text-white/78\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</button>)}\n        </div>\n      </section>\n    </div>\n  </main>\n}\n"},{"path":"src/pages/crm/PcgWorkspace.tsx","content":"import {useEffect,useMemo,useState,type ComponentType} from 'react';\nimport {useLocation} from 'react-router-dom';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';import {supabase} from '@/integrations/supabase/client';import {toast} from '@/lib/notify';import {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';import {PCGCardVaultContent} from '@/pages/card-grading/PCGWorkspace';import PCGLegacyMigrationCenter from '@/pages/card-grading/PCGLegacyMigrationCenter';import PCGOnboardingReadiness from '@/pages/card-grading/PCGOnboardingReadiness';\nimport {Award,BadgeDollarSign,Boxes,Check,ChevronRight,CircleDollarSign,ClipboardCheck,CreditCard,Database,ExternalLink,FileCheck2,Menu,PackageCheck,Plus,Search,Settings,ShieldCheck,Truck,UploadCloud,Users,X} from 'lucide-react';\nimport {PCG_GRADING_SCALE,findPCGGrade,formatPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nimport TenantSettingsPage from '@/pages/settings/TenantSettingsPage';\nimport PCGBatchPublishingCenter from '@/pages/card-grading/PCGBatchPublishingCenter';\ntype Submission={id:string;submission_number:string;customer_name:string|null;customer_email:string|null;customer_phone:string|null;service_tier:string;service_price:number;expected_card_count:number;status:string;delivery_method:string|null;received_at:string;due_at:string|null;tracking_in:string|null;tracking_out:string|null;notes:string|null;payment_status:string|null;payment_reference:string|null;paid_at:string|null};type Card={id:string;submission_id:string;sequence_number:number;cert_number:string|null;category:string|null;year:string|null;brand_set:string|null;player_character:string|null;card_number:string|null;card_description:string|null;autograph_present:boolean|null;variation:string|null;declared_value:number|null;grade:number|null;grade_label:string|null;status:string;front_image_url:string|null;back_image_url:string|null;slab_image_url:string|null;grader_notes:string|null;population_count:number|null};type CardDraft={category:string;year:string;brand_set:string;player_character:string;card_number:string;card_description:string;autograph_present:''|'yes'|'no';declared_value:string;grade:string;grade_label:string;cert_number:string;grader_notes:string};type DetailDraft={tracking_in:string;tracking_out:string;notes:string;payment_status:string;payment_reference:string};type Tab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';type IconType=ComponentType<{className?:string}>;\nconst tabs:[Tab,string,IconType][]=[['today','Work Queue',Award],['vault','Capture Cards',UploadCloud],['queue','Grade Cards',Award],['submissions','Receive Cards',Boxes],['certs','Certificates',ShieldCheck],['collectors','Customers',Users],['shipping','Fulfill & Ship',Truck],['inventory','Publish & Sell',PackageCheck],['money','Payments',CircleDollarSign],['migration','Migration',Database],['readiness','Readiness',ClipboardCheck],['settings','Settings',Settings]];const mobilePrimary:[Tab,string,IconType][]=[['today','Queue',Award],['vault','Capture',UploadCloud],['queue','Grade',Award],['certs','Certs',ShieldCheck]];\nconst tiers={two_weeks:{label:'2 Weeks',price:12,days:14},one_week:{label:'1 Week',price:15,days:7},three_days:{label:'3 Days',price:20,days:3},same_day:{label:'Same Day',price:25,days:0}} as const;const statuses=['received','intake_imaging','authentication','grading','encapsulation','qa','ready','shipped','picked_up'] as const;const terminalStatuses=new Set(['shipped','picked_up']);const PCG_STRIPE_FALLBACK='https://buy.stripe.com/3clbJ05UQc3w9KLcBR5Ne00';const PCG_LOGO='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/2c2615b1-2fab-4ba1-8cff-8d8e49b6b184/diamond%2Blogo.png';const PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';const pretty=(value:string)=>value.replaceAll('_',' ').replace(/\\b\\w/g,char=>char.toUpperCase());const inputClass='w-full border border-white/[0.10] bg-black/30 px-3.5 py-3 text-sm text-white outline-none transition placeholder:text-white/28 focus:border-[#d8bb78]/55';const panelClass='border border-white/[0.08] bg-[#09090a]/88';\nconst hasCanonicalGrade=(card:Pick<Card,'grade_label'>)=>Boolean(findPCGGrade(card.grade_label));\nfunction PCGGradeSelect({draft,onChange}:{draft:CardDraft;onChange:(next:CardDraft)=>void}){const selected=findPCGGrade(draft.grade_label);const legacyLabel=String(draft.grade_label||'').trim();const legacyNumeric=!legacyLabel&&draft.grade.trim()?draft.grade.trim():'';return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[9px] font-black uppercase tracking-[.14em] text-[#d8bb78]\">Official PCG grade</span><select value={draft.grade_label} onChange={event=>{const option=findPCGGrade(event.target.value);onChange({...draft,grade:option?.numeric==null?'':String(option.numeric),grade_label:option?.designation||event.target.value})}} className={inputClass}><option value=\"\">Select official PCG designation</option>{legacyLabel&&!selected?<option value={legacyLabel}>Legacy · {legacyLabel}</option>:null}{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<div className=\"mt-2 border border-white/[0.08] bg-black/28 px-3 py-2\"><div className=\"text-[10px] font-black text-[#e8cc8d]\">{selected.designation}</div><div className=\"mt-1 text-[11px] leading-5 text-white/45\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</div></div>:legacyLabel?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy grade label. Choose an official PCG designation before advancing this card.</div>:legacyNumeric?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy numeric grade {legacyNumeric}. Choose the exact official PCG designation before advancing this card.</div>:null}</div>}\nfunction cardToDraft(card:Card):CardDraft{return{category:card.category||'',year:card.year||'',brand_set:card.brand_set||'',player_character:card.player_character||'',card_number:card.card_number||'',card_description:card.card_description||card.variation||'',autograph_present:card.autograph_present==null?'':card.autograph_present?'yes':'no',declared_value:card.declared_value==null?'':String(card.declared_value),grade:card.grade==null?'':String(card.grade),grade_label:card.grade_label||'',cert_number:card.cert_number||'',grader_notes:card.grader_notes||''}}function slaMeta(sub:Submission){if(!sub.due_at||terminalStatuses.has(sub.status))return{label:terminalStatuses.has(sub.status)?pretty(sub.status):'No due date',tone:'text-white/42 border-white/10'};const diff=new Date(sub.due_at).getTime()-Date.now();const days=Math.ceil(diff/86400000);if(diff<0)return{label:`${Math.abs(days)}d overdue`,tone:'text-rose-300 border-rose-400/25'};if(days===0)return{label:'Due today',tone:'text-amber-200 border-amber-300/25'};if(days<=2)return{label:`Due in ${days}d`,tone:'text-amber-200 border-amber-300/25'};return{label:`Due ${new Date(sub.due_at).toLocaleDateString()}`,tone:'text-white/46 border-white/10'}}\nexport default function PcgWorkspace({initialTab='today',embedded=false,initialVaultMode='overview',initialVaultSubmissionId='',onSubmissionCreated,navigationScope}:{initialTab?:Tab;embedded?:boolean;initialVaultMode?:'overview'|'single'|'batch'|'growth';initialVaultSubmissionId?:string;onSubmissionCreated?:(submission:{id:string;submission_number:string})=>void;navigationScope?:Tab[]}={}){const location=useLocation();const{activeTenant}=useMultiTenant();const tenantId=activeTenant?.id;const settings=((activeTenant as any)?.settings||{}) as Record<string,unknown>;const mediaBranding=useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);const workspaceBackground=mediaBranding.backgroundUrl||String(settings.background_image_url||settings.backgroundImageUrl||'').trim();const stripePaymentLink=String(settings.stripe_payment_link||PCG_STRIPE_FALLBACK);const stripeSyncConnected=String(settings.stripe_sync_status||'not_connected')==='connected';const[tab,setTab]=useState<Tab>(initialTab);const visibleTabs=useMemo(()=>navigationScope?.length?tabs.filter(([id])=>navigationScope.includes(id)):tabs,[navigationScope]);useEffect(()=>{setTab(initialTab)},[initialTab]);useEffect(()=>{if(navigationScope?.length&&!navigationScope.includes(tab))setTab(navigationScope.includes(initialTab)?initialTab:navigationScope[0])},[initialTab,navigationScope,tab]);const[subs,setSubs]=useState<Submission[]>([]);const[cards,setCards]=useState<Card[]>([]);const[loading,setLoading]=useState(true);const[showNew,setShowNew]=useState(false);const[showMore,setShowMore]=useState(false);const[selectedId,setSelectedId]=useState<string|null>(null);const[query,setQuery]=useState('');const[statusFilter,setStatusFilter]=useState('all');const[certQuery,setCertQuery]=useState('');const[busy,setBusy]=useState(false);const[cardDrafts,setCardDrafts]=useState<Record<string,CardDraft>>({});const[detailDraft,setDetailDraft]=useState<DetailDraft>({tracking_in:'',tracking_out:'',notes:'',payment_status:'unverified',payment_reference:''});const[form,setForm]=useState({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});const settingsSection=String(new URLSearchParams(location.search).get('section')||'').trim().toLowerCase();const selectedTier=tiers[form.tier as keyof typeof tiers]||tiers.two_weeks;const selectedCardCount=Math.max(1,Math.min(100000,Number(form.cardCount)||1));const expectedTotal=selectedCardCount*selectedTier.price;const openStripe=()=>window.open(stripePaymentLink,'_blank','noopener,noreferrer');\nasync function load(){if(!tenantId)return;setLoading(true);const[s,c]=await Promise.all([(supabase as any).from('card_grading_submissions').select('*').eq('tenant_id',tenantId).order('created_at',{ascending:false}),(supabase as any).from('card_grading_cards').select('*').eq('tenant_id',tenantId).order('sequence_number',{ascending:true})]);if(s.error)toast.error(s.error.message);if(c.error)toast.error(c.error.message);setSubs((s.data||[]) as Submission[]);setCards((c.data||[]) as Card[]);setLoading(false)}useEffect(()=>{void load()},[tenantId]);\nconst orderCardCount=(sub:Submission)=>Math.max(Number(sub.expected_card_count||0),cards.filter(card=>card.submission_id===sub.id).length);const counts=useMemo(()=>Object.fromEntries(statuses.map(status=>[status,subs.filter(item=>item.status===status).length])),[subs]);const openSubs=subs.filter(item=>!terminalStatuses.has(item.status));const overdue=openSubs.filter(item=>item.due_at&&new Date(item.due_at)<new Date()).length;const dueSoon=openSubs.filter(item=>item.due_at&&new Date(item.due_at)>=new Date()&&new Date(item.due_at).getTime()-Date.now()<=2*86400000).length;const serviceValue=subs.reduce((sum,item)=>sum+Number(item.service_price||0)*orderCardCount(item),0);const prioritySubs=[...openSubs].sort((a,b)=>(a.due_at?new Date(a.due_at).getTime():Number.MAX_SAFE_INTEGER)-(b.due_at?new Date(b.due_at).getTime():Number.MAX_SAFE_INTEGER)).slice(0,6);const filteredSubs=subs.filter(item=>{const hay=`${item.submission_number} ${item.customer_name||''} ${item.customer_email||''} ${item.customer_phone||''}`.toLowerCase();return(!query||hay.includes(query.toLowerCase()))&&(statusFilter==='all'||item.status===statusFilter)});const filteredCards=cards.filter(card=>!certQuery||`${card.cert_number||''} ${card.year||''} ${card.brand_set||''} ${card.player_character||''} ${card.card_description||card.variation||''} ${card.card_number||''}`.toLowerCase().includes(certQuery.toLowerCase()));const selected=subs.find(item=>item.id===selectedId)||null;const selectedCards=selected?cards.filter(card=>card.submission_id===selected.id):[];const selectedTotal=selected?orderCardCount(selected)*Number(selected.service_price||0):0;\nfunction openSubmission(sub:Submission){setSelectedId(sub.id);setDetailDraft({tracking_in:sub.tracking_in||'',tracking_out:sub.tracking_out||'',notes:sub.notes||'',payment_status:sub.payment_status||'unverified',payment_reference:sub.payment_reference||''});const next:Record<string,CardDraft>={};cards.filter(card=>card.submission_id===sub.id).forEach(card=>{next[card.id]=cardToDraft(card)});setCardDrafts(next)}\nasync function createSubmission(){if(!tenantId)return;if(!form.name.trim()){toast.error('Customer name is required.');return}const count=selectedCardCount,tier=selectedTier,now=new Date(),due=new Date(now);due.setDate(due.getDate()+tier.days);const submissionNumber=`PCG-${now.getFullYear()}-${String(Date.now()).slice(-7)}`;setBusy(true);const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:submissionNumber,customer_name:form.name.trim(),customer_email:form.email.trim()||null,customer_phone:form.phone.trim()||null,service_tier:form.tier,service_price:tier.price,expected_card_count:count,status:'received',payment_status:'unverified',delivery_method:form.delivery,notes:form.notes.trim()||null,received_at:now.toISOString(),due_at:due.toISOString()}).select('*').single();if(error||!data){toast.error(error?.message||'Unable to create submission');setBusy(false);return}toast.success(`${submissionNumber} created for ${count.toLocaleString()} card${count===1?'':'s'}. Opening Capture Cards for this order.`);setShowNew(false);setForm({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});await load();setBusy(false);onSubmissionCreated?.({id:String(data.id),submission_number:String(data.submission_number||submissionNumber)})}\nfunction transitionIssue(sub:Submission,nextStatus:string,ownCards:Card[]){if(nextStatus==='authentication'){if(!ownCards.length)return 'Add cards before authentication.';const missing=ownCards.filter(card=>!card.front_image_url&&!card.back_image_url&&!card.slab_image_url).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' a saved intake image before authentication.'):''}if(nextStatus==='encapsulation'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' an official PCG grade before encapsulation.'):''}if(nextStatus==='qa'){const missingGrade=ownCards.filter(card=>!hasCanonicalGrade(card)).length,missingCert=ownCards.filter(card=>!String(card.cert_number||'').trim()).length;return missingGrade||missingCert?('Save '+(missingGrade?(missingGrade+' missing official PCG grade'+(missingGrade===1?'':'s')):'')+(missingGrade&&missingCert?' and ':'')+(missingCert?(missingCert+' missing cert number'+(missingCert===1?'':'s')):'')+' before QA.'):''}if(nextStatus==='ready'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)||!String(card.cert_number||'').trim()||(!card.slab_image_url&&!card.front_image_url&&!card.back_image_url)).length;return missing?(missing+' card'+(missing===1?' is':'s are')+' missing official PCG grade, cert, or customer-visible imagery.'):''}if(nextStatus==='shipped'&&!String(sub.tracking_out||'').trim())return 'Save outbound tracking before marking this order shipped.';return ''}async function advanceBatch(nextStatus:string){if(!tenantId||!selected)return;const issue=transitionIssue(selected,nextStatus,selectedCards);if(issue){toast.error(issue);return}setBusy(true);const{error}=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selected.id,p_status:nextStatus});if(error)toast.error(error.message||'Unable to advance submission');else{toast.success(`${selected.submission_number} moved to ${pretty(nextStatus)}.`);await load()}setBusy(false)}\nasync function saveSubmissionDetails(){if(!tenantId||!selected)return;setBusy(true);const manual=detailDraft.payment_status==='manually_verified';const{error}=await(supabase as any).from('card_grading_submissions').update({tracking_in:detailDraft.tracking_in.trim()||null,tracking_out:detailDraft.tracking_out.trim()||null,notes:detailDraft.notes.trim()||null,payment_status:detailDraft.payment_status,payment_reference:detailDraft.payment_reference.trim()||null,paid_at:manual?(selected.paid_at||new Date().toISOString()):null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',selected.id);if(error)toast.error(error.message);else{toast.success('Submission details saved.');await load()}setBusy(false)}\nasync function saveCard(card:Card){if(!tenantId)return;const draft=cardDrafts[card.id];if(!draft)return;setBusy(true);const gradeDefinition=findPCGGrade(draft.grade_label);const grade=gradeDefinition?gradeDefinition.numeric:(draft.grade.trim()===''?null:Number(draft.grade));const gradeLabel=gradeDefinition?.designation||draft.grade_label.trim()||null;const declared=draft.declared_value.trim()===''?null:Number(draft.declared_value);if(grade!=null&&(Number.isNaN(grade)||grade<0||grade>10)){toast.error('Legacy numeric grade is invalid. Choose an official PCG grade.');setBusy(false);return}const{error}=await(supabase as any).from('card_grading_cards').update({category:draft.category.trim()||null,year:draft.year.trim()||null,brand_set:draft.brand_set.trim()||null,player_character:draft.player_character.trim()||null,card_number:draft.card_number.trim()||null,card_description:draft.card_description.trim()||null,autograph_present:draft.autograph_present===''?null:draft.autograph_present==='yes',variation:draft.card_description.trim()||null,declared_value:declared,grade,grade_label:gradeLabel,cert_number:draft.cert_number.trim()||null,grader_notes:draft.grader_notes.trim()||null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',card.id);if(error)toast.error(error.message);else{toast.success(`Card #${card.sequence_number} saved.`);await load()}setBusy(false)}\nconst metric=(label:string,value:string|number,sub:string)=><div className=\"py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">{label}</div><div className=\"mt-1 text-3xl font-black tracking-[-.04em]\">{value}</div><div className=\"mt-1 text-[11px] text-white/36\">{sub}</div></div>;\nconst empty=(title:string,copy:string,action?:()=>void,actionLabel?:string)=><div className=\"border border-dashed border-white/[0.10] bg-[#09090a]/94 p-9 text-center\"><FileCheck2 className=\"mx-auto h-6 w-6 text-[#d8bb78]\"/><div className=\"mt-4 text-lg font-black\">{title}</div><p className=\"mx-auto mt-2 max-w-md text-sm leading-6 text-white/38\">{copy}</p>{action&&<button onClick={action} className=\"mt-5 bg-[#d8bb78] px-5 py-2.5 text-sm font-black text-black\">{actionLabel}</button>}</div>;\nconst row=(sub:Submission)=>{const cardCount=cards.filter(card=>card.submission_id===sub.id).length;const expected=Math.max(Number(sub.expected_card_count||0),cardCount);const payment=sub.payment_status==='manually_verified'?'Paid':sub.payment_status==='waived'?'Waived':'Unverified';return <button key={sub.id} onClick={()=>openSubmission(sub)} className=\"group grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-2 py-2.5 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"min-w-0\"><div className=\"flex flex-wrap items-center gap-2\"><span className=\"text-xs font-black tracking-wide text-[#e4c47b]\">{sub.submission_number}</span><span className=\"text-[9px] font-black uppercase tracking-[.12em] text-white/32\">{pretty(sub.status)}</span></div><div className=\"mt-1 truncate text-sm font-black sm:text-[15px]\">{sub.customer_name||'Collector not named'}</div><div className=\"mt-0.5 flex flex-wrap gap-x-3 text-[10px] text-white/34 sm:text-[11px]\"><span>{expected>cardCount?`${cardCount.toLocaleString()} / ${expected.toLocaleString()} cards ingested`:`${cardCount.toLocaleString()} card${cardCount===1?'':'s'}`}</span><span>{tiers[sub.service_tier as keyof typeof tiers]?.label||pretty(sub.service_tier)}</span><span>{payment}</span></div></div><div className=\"flex items-center gap-2\"><span className={`border px-2.5 py-1 text-[10px] font-black ${slaMeta(sub).tone}`}>{slaMeta(sub).label}</span><ChevronRight className=\"h-4 w-4 text-white/18\"/></div></button>};\nconst renderList=(heading:string,eyebrow:string,source:Submission[])=><section><div className=\"mb-6 flex flex-col gap-4 border-b border-white/[0.08] pb-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">{eyebrow}</div><h1 className=\"mt-1.5 text-2xl font-black tracking-[-.035em] sm:text-3xl\">{heading}</h1><p className=\"mt-2 text-sm text-white/38\">Open a batch to grade cards, verify payment, update tracking or move it forward.</p></div><button onClick={()=>setShowNew(true)} className=\"inline-flex items-center justify-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div><div className=\"mb-5 grid gap-2 sm:grid-cols-[1fr_220px]\"><div className=\"relative\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={query} onChange={event=>setQuery(event.target.value)} placeholder=\"Search submission or collector\" className={`${inputClass} pl-11`}/></div><select value={statusFilter} onChange={event=>setStatusFilter(event.target.value)} className={inputClass}><option value=\"all\">Every grading stage</option>{statuses.map(status=><option key={status} value={status}>{pretty(status)}</option>)}</select></div>{source.length?<div className=\"border-y border-white/[0.08]\">{source.map(row)}</div>:empty('Nothing needs attention','Receive a new card submission when work arrives.',()=>setShowNew(true),'Receive cards')}</section>;\nconst brandName=activeTenant?.company_dba_name||activeTenant?.company_legal_name||activeTenant?.name||'Prestigious Card Grading';\nreturn <div data-pcg-mode-workspace-background={workspaceBackground||'solid'} className=\"relative min-h-screen overflow-x-hidden bg-[#050506] text-white\" style={{backgroundImage:workspaceBackground?`linear-gradient(108deg,rgba(4,4,5,.98) 0%,rgba(4,4,5,.91) 35%,rgba(4,4,5,.68) 70%,rgba(4,4,5,.88) 100%),url(\"${workspaceBackground}\")`:undefined,backgroundSize:'cover',backgroundPosition:mediaBranding.backgroundPosition||'center',backgroundRepeat:'no-repeat',backgroundAttachment:'fixed'}}><div className=\"pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_78%_15%,rgba(216,187,120,.10),transparent_28rem)]\"/>\n{!embedded?<header className=\"fixed inset-x-0 top-0 z-50 h-16 border-b border-white/[0.07] bg-[#09090a]/95 backdrop-blur-xl\"><div className=\"flex h-full items-center gap-3 px-4 sm:px-6\"><div className=\"grid h-9 w-9 place-items-center border border-[#d8bb78]/20 bg-[#d8bb78]/[0.06]\"><img src={PCG_LOGO} alt=\"PCG\" className=\"h-full w-full object-contain p-1\"/></div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black tracking-tight\">{brandName}</div><div className=\"hidden text-[9px] font-bold uppercase tracking-[.17em] text-white/30 sm:block\">PCG daily work</div></div><div className=\"ml-auto flex items-center gap-3\"><span className=\"hidden text-xs font-semibold text-white/32 md:inline\">{openSubs.length} active batches</span><button onClick={()=>setShowNew(true)} className=\"inline-flex h-9 items-center gap-2 bg-[#d8bb78] px-3.5 text-xs font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div></div></header>:null}\n{!embedded?<aside className=\"fixed bottom-0 left-0 top-16 z-40 hidden w-[230px] border-r border-white/[0.07] bg-[#09090a]/95 px-4 py-5 backdrop-blur-xl lg:flex lg:flex-col\"><div className=\"px-2\"><div className=\"text-[9px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">PCG Work Queue</div><div className=\"mt-2 text-sm leading-5 text-white/40\">Receive, grade, publish, and fulfill cards.</div></div><nav className=\"mt-7 space-y-1\">{visibleTabs.map(([id,label,Icon])=><button key={id} onClick={()=>setTab(id)} className={`flex h-11 w-full items-center gap-3 px-3 text-left text-sm font-bold transition ${tab===id?'bg-white/[0.07] text-white shadow-[inset_2px_0_0_#d8bb78]':'text-white/40 hover:bg-white/[0.035] hover:text-white/80'}`}><Icon className={`h-[17px] w-[17px] ${tab===id?'text-[#d8bb78]':'text-white/30'}`}/><span className=\"flex-1\">{label}</span>{id==='queue'&&openSubs.length?<span className=\"text-[10px] font-black text-[#d8bb78]\">{openSubs.length}</span>:null}</button>)}</nav><div className=\"mt-auto border-t border-white/[0.07] px-2 pt-4\"><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-white/25\">Prestigious Card Grading</div><div className=\"mt-2 text-xs leading-5 text-white/36\">14170 US Highway 1<br/>Sebastian, FL 32958</div></div></aside>:null}\n<main className={`relative z-10 min-h-screen px-4 pb-24 sm:px-6 lg:px-8 lg:pb-10 xl:px-10 ${embedded?'pt-4 sm:pt-6':'pt-20 lg:ml-[230px]'}`}>{loading?<div className=\"grid min-h-[70vh] place-items-center\"><div className=\"text-center\"><img src={PCG_LOGO} alt=\"PCG\" className=\"mx-auto h-16 w-16 object-contain opacity-70\"/><div className=\"mt-4 text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Opening PCG…</div></div></div>:<>\n{tab==='today'?<><section className=\"border-b border-white/[0.08] pb-7 pt-3\"><div className=\"flex flex-col gap-7 xl:flex-row xl:items-end xl:justify-between\"><div className=\"max-w-3xl\"><div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Daily work</div><h1 className=\"mt-2 text-3xl font-black leading-none tracking-[-.045em] sm:text-4xl\">PCG Work Queue</h1><p className=\"mt-2 max-w-2xl text-sm leading-5 text-white/42\">See what needs attention and move each submission through the next clear step.</p></div><div className=\"grid w-full max-w-xl grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08] sm:grid-cols-3\"><button onClick={()=>setShowNew(true)} className=\"bg-[#09090a]/94 p-4 text-left\"><Plus className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Receive Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Start a submission</div></button><button onClick={()=>setTab('vault')} className=\"bg-[#09090a]/94 p-4 text-left\"><UploadCloud className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Capture Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Single or batch intake</div></button><button onClick={()=>setTab('queue')} className=\"col-span-2 bg-[#09090a]/94 p-4 text-left sm:col-span-1\"><Award className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Grade Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Work the grading queue</div></button></div></div><div className=\"mt-8 grid sm:grid-cols-2 xl:grid-cols-4\">{metric('Batches on floor',openSubs.length,'Active submissions')}{metric('Cards in house',cards.filter(card=>!terminalStatuses.has(card.status)).length,'Individual cards')}{metric('SLA attention',overdue+dueSoon,overdue?`${overdue} overdue · ${dueSoon} due soon`:`${dueSoon} due within 48 hours`)}{metric('Recorded work',`$${serviceValue.toFixed(0)}`,stripeSyncConnected?'Stripe sync connected':'Stripe sync not connected')}</div></section><div className=\"mt-8 grid gap-8 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,.8fr)]\"><section><div className=\"mb-3 flex items-end justify-between\"><div><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Priority work</div><h2 className=\"mt-1 text-2xl font-black\">Next on the grading bench</h2></div><button onClick={()=>setTab('queue')} className=\"text-xs font-black text-[#d8bb78]\">Grade cards →</button></div><div className=\"border-y border-white/[0.08]\">{prioritySubs.length?prioritySubs.map(row):empty('Nothing needs grading','No grading batches need attention right now.',()=>setShowNew(true),'Receive cards')}</div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Stage pressure</div><h2 className=\"mt-1 text-2xl font-black\">Where the cards are</h2><div className=\"mt-5 divide-y divide-white/[0.07]\">{statuses.map((status,index)=><button key={status} onClick={()=>{setStatusFilter(status);setTab('queue')}} className=\"grid w-full grid-cols-[28px_1fr_auto] items-center gap-3 py-3 text-left\"><span className=\"text-[9px] font-black text-white/18\">{String(index+1).padStart(2,'0')}</span><span className=\"text-xs font-bold text-white/48\">{pretty(status)}</span><span className=\"text-base font-black\">{counts[status]||0}</span></button>)}</div></section></div></>:null}\n{tab==='vault'?<PCGCardVaultContent initialMode={initialVaultMode} initialSubmissionId={initialVaultSubmissionId}/>:null}{tab==='queue'?renderList('Grade Cards','Active grading work',filteredSubs.filter(item=>!terminalStatuses.has(item.status))):null}{tab==='submissions'?renderList('Receive Cards','All submissions',filteredSubs):null}{tab==='shipping'?renderList('Fulfill & Ship','Ready · shipped · pickup',filteredSubs.filter(item=>['ready','shipped','picked_up'].includes(item.status)||Boolean(item.tracking_in)||Boolean(item.tracking_out))):null}\n{tab==='certs'?<section><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Card lookup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Certificates</h1></div><div className=\"relative mt-3 max-w-2xl\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={certQuery} onChange={event=>setCertQuery(event.target.value)} placeholder=\"Search certificate, card, player, or set\" className={`${inputClass} pl-11`}/></div>{filteredCards.length?<div className=\"mt-3 overflow-hidden border border-white/[0.08] bg-black/20\">{filteredCards.map(card=>{const image=card.slab_image_url||card.front_image_url;const title=[card.year,card.brand_set,card.player_character,card.card_description||card.variation,card.card_number?`#${card.card_number}`:null].filter(Boolean).join(' · ')||`Card #${card.sequence_number}`;const grade=hasCanonicalGrade(card)?formatPCGGrade(card.grade,card.grade_label):'';return <button key={card.id} onClick={()=>{const sub=subs.find(item=>item.id===card.submission_id);if(sub)openSubmission(sub)}} className=\"grid min-h-[68px] w-full grid-cols-[44px_minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-3 py-2 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"grid h-14 w-11 shrink-0 place-items-center overflow-hidden border border-white/[0.08] bg-[#09090a]/94\">{image?<img src={image} alt=\"Graded card\" className=\"h-full w-full object-cover\"/>:<ShieldCheck className=\"h-5 w-5 text-[#d8bb78]/55\"/>}</div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black leading-tight\">{title}</div><div className=\"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-white/35\"><span>{card.cert_number||'Cert pending'}</span>{grade?<span className=\"font-black text-[#e8cc8d]/75\">{grade}</span>:null}</div></div><ChevronRight className=\"h-4 w-4 shrink-0 text-white/20\"/></button>})}</div>:<div className=\"mt-4\">{empty('No certificates yet','Certificate records appear here as grading is completed.')}</div>}</section>:null}\n{tab==='collectors'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Customer records</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Customers</h1></div>{subs.some(item=>item.customer_name)?<div className=\"mt-6 border-y border-white/[0.08]\">{Array.from(new Map(subs.filter(item=>item.customer_name).map(item=>[item.customer_name,item])).values()).map(sub=>{const related=subs.filter(item=>item.customer_name===sub.customer_name);const relatedCards=cards.filter(card=>related.some(item=>item.id===card.submission_id));return <button key={sub.customer_name!} onClick={()=>openSubmission(related[0])} className=\"grid w-full grid-cols-[1fr_auto_auto] items-center gap-4 border-b border-white/[0.07] px-1 py-4 text-left\"><div><div className=\"font-black\">{sub.customer_name}</div><div className=\"mt-1 text-xs text-white/32\">{sub.customer_email||sub.customer_phone||'Contact info not captured'}</div></div><div className=\"text-right\"><div className=\"text-lg font-black\">{related.length}</div><div className=\"text-[9px] text-white/25\">SUBMISSIONS</div></div><div className=\"text-right\"><div className=\"text-lg font-black text-[#d8bb78]\">{relatedCards.length}</div><div className=\"text-[9px] text-white/25\">CARDS</div></div></button>})}</div>:empty('No customers yet','Customers appear automatically when a card submission is received.',()=>setShowNew(true),'Receive cards')}</section>:null}\n{tab==='inventory'?<PCGBatchPublishingCenter tenantId={tenantId||''}/>:null}\n{tab==='migration'?<PCGLegacyMigrationCenter/>:null}\n{tab==='readiness'?<PCGOnboardingReadiness/>:null}\n{tab==='settings'?<section>\n    <div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG setup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Settings</h1><p className=\"mt-1.5 max-w-2xl text-sm leading-6 text-white/45\">Only the controls Anthony needs to run PCG. Pick a category instead of digging through platform settings.</p></div>\n    {!settingsSection?<div className=\"mt-4 grid gap-2 sm:grid-cols-2 xl:grid-cols-3\">\n      {[\n        ['business','Brand & workspace','Logo, backgrounds, public-facing identity and workspace presentation.'],\n        ['connections','Google & connections','Google Drive, eBay and other connected services.'],\n        ['mail','Email & customers','Business email continuity and customer-facing channels.'],\n        ['notifications','Notifications','What PCG alerts you about and where they go.'],\n        ['profile','Profile & staff','Owner profile and people using this workspace.'],\n        ['workspace','Workspace behavior','Layout, experience and workspace health.']\n      ].map(([section,title,copy])=><a key={section} href={'?tool=settings&section='+section} className=\"group flex min-h-[112px] items-start justify-between gap-4 rounded-2xl border border-white/[0.08] bg-[#09090a]/94 p-4 shadow-sm transition hover:border-white/[0.16] hover:bg-white/[.025]\"><span><span className=\"block text-sm font-black\">{title}</span><span className=\"mt-1 block text-xs leading-5 text-white/42\">{copy}</span></span><ChevronRight className=\"mt-1 h-4 w-4 shrink-0 text-white/28 transition group-hover:translate-x-0.5\"/></a>)}\n    </div>:<div className=\"pcg-settings-dark mt-4\"><style>{`.pcg-settings-dark{color:#fff}.pcg-settings-dark .bg-card,.pcg-settings-dark [class*=\"bg-card\"],.pcg-settings-dark .bg-background,.pcg-settings-dark [class*=\"bg-background\"]{background:#09090a!important}.pcg-settings-dark .text-foreground{color:#fff!important}.pcg-settings-dark .text-muted-foreground{color:rgba(255,255,255,.55)!important}.pcg-settings-dark [class*=\"border\"]{border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark button:not([role=\"switch\"]){background:#111214!important;color:#fff!important;border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark button:not([role=\"switch\"]):hover{background:#191b1e!important}.pcg-settings-dark input,.pcg-settings-dark select,.pcg-settings-dark textarea{background:#090a0b!important;color:#fff!important;border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark input::placeholder,.pcg-settings-dark textarea::placeholder{color:rgba(255,255,255,.35)!important}`}</style><a href=\"?tool=settings\" className=\"mb-3 inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[0.08] bg-[#09090a]/94 px-3 text-xs font-black text-white/55\">← All PCG settings</a><TenantSettingsPage/></div>}\n  </section>:null}\n{tab==='money'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Admin · payments</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Payments</h1></div><div className=\"mt-6 grid gap-8 xl:grid-cols-[1.15fr_.85fr]\"><section><div className=\"flex items-center justify-between border-b border-white/[0.08] pb-4\"><div className=\"flex items-center gap-3\"><CreditCard className=\"h-5 w-5 text-[#635bff]\"/><div><div className=\"text-sm font-black\">Stripe hosted checkout</div><div className=\"text-xs text-white/30\">PCG grading payments</div></div></div><span className={stripeSyncConnected?'text-xs font-black text-emerald-300':'text-xs font-black text-amber-200'}>{stripeSyncConnected?'Data sync connected':'Data sync not connected'}</span></div><div className=\"mt-6 text-[10px] font-black uppercase tracking-[.18em] text-white/30\">Recorded grading service value</div><div className=\"mt-2 text-3xl font-black sm:text-4xl\">${serviceValue.toFixed(2)}</div><p className=\"mt-3 text-sm leading-6 text-white/38\">This is grading work recorded in KnockLaunch, not a claimed Stripe balance unless sync is authenticated.</p><button onClick={openStripe} className=\"mt-7 inline-flex items-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\">Open PCG Stripe checkout <ExternalLink className=\"h-4 w-4\"/></button></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading menu</div><div className=\"mt-5 divide-y divide-white/[0.07]\">{Object.entries(tiers).map(([id,tier])=><div key={id} className=\"flex items-center justify-between py-4\"><div><div className=\"font-black\">{tier.label}</div><div className=\"text-xs text-white/28\">Per card · no up-charges</div></div><div className=\"text-2xl font-black text-[#d8bb78]\">${tier.price}</div></div>)}</div></section></div></section>:null}</>}</main>\n{!embedded?<nav className=\"fixed inset-x-3 bottom-3 z-50 grid grid-cols-5 border border-white/[0.09] bg-[#09090a]/95 p-1.5 shadow-2xl backdrop-blur-xl lg:hidden\">{mobilePrimary.map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className={`flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black ${tab===id?'bg-white/[0.07] text-white':'text-white/38'}`}><Icon className={`h-[18px] w-[18px] ${tab===id?'text-[#d8bb78]':'text-white/28'}`}/><span>{label}</span></button>)}<button onClick={()=>setShowMore(true)} className=\"flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black text-white/38\"><Menu className=\"h-[18px] w-[18px] text-white/28\"/>More</button></nav>:null}\n{!embedded&&showMore?<div className=\"fixed inset-0 z-[70] bg-black/74 lg:hidden\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowMore(false)}}><div className=\"absolute inset-x-0 bottom-0 border-t border-white/[0.10] bg-[#09090a]/94 p-4\"><div className=\"mb-4 text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">More PCG tools</div><div className=\"grid grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08]\">{visibleTabs.filter(([id])=>!mobilePrimary.some(([primary])=>primary===id)).map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className=\"flex items-center gap-3 bg-[#09090a]/94 px-4 py-3 text-sm font-bold\"><Icon className=\"h-4 w-4 text-[#d8bb78]\"/>{label}</button>)}</div><button onClick={()=>setShowMore(false)} className=\"mt-3 w-full border border-white/[0.08] py-3 text-sm font-bold text-white/45\">Close</button></div></div>:null}\n{showNew?<div className=\"fixed inset-0 z-[80] grid place-items-center overflow-y-auto bg-black/82 p-4 backdrop-blur-md\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowNew(false)}}><div className=\"w-full max-w-2xl border border-white/[0.10] bg-[#09090a]/94\"><div className=\"flex items-center justify-between border-b border-white/[0.08] p-5\"><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading intake</div><h2 className=\"mt-1 text-2xl font-black\">Receive cards into PCG</h2></div><button onClick={()=>setShowNew(false)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><div className=\"p-5\"><div className=\"grid gap-3 sm:grid-cols-2\"><input value={form.name} onChange={event=>setForm({...form,name:event.target.value})} placeholder=\"Collector name\" className={inputClass}/><input value={form.email} onChange={event=>setForm({...form,email:event.target.value})} placeholder=\"Email\" className={inputClass}/><input value={form.phone} onChange={event=>setForm({...form,phone:event.target.value})} placeholder=\"Phone\" className={inputClass}/><input value={form.cardCount} onChange={event=>setForm({...form,cardCount:event.target.value})} type=\"number\" min=\"1\" max=\"100000\" placeholder=\"Expected card count\" className={inputClass}/><select value={form.tier} onChange={event=>setForm({...form,tier:event.target.value})} className={inputClass}>{Object.entries(tiers).map(([id,tier])=><option key={id} value={id}>{tier.label} · ${tier.price}/card</option>)}</select><select value={form.delivery} onChange={event=>setForm({...form,delivery:event.target.value})} className={inputClass}><option value=\"walk_in\">Walk-in</option><option value=\"mail_in\">Mail-in</option><option value=\"ship_back\">Ship back</option><option value=\"pickup\">Pickup</option></select><textarea value={form.notes} onChange={event=>setForm({...form,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><div className=\"mt-4 flex items-end justify-between border-t border-white/[0.08] pt-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.15em] text-[#d8bb78]\">Expected grading total</div><div className=\"mt-1 text-3xl font-black\">${expectedTotal.toFixed(2)}</div></div><div className=\"text-right text-xs text-white/30\">{selectedCardCount} card{selectedCardCount===1?'':'s'} × ${selectedTier.price}</div></div><div className=\"mt-5 grid gap-2 sm:grid-cols-2\"><button onClick={openStripe} className=\"inline-flex items-center justify-center gap-2 border border-white/10 px-4 py-3 font-black\"><CreditCard className=\"h-4 w-4\"/>Collect in Stripe</button><button disabled={busy} onClick={()=>void createSubmission()} className=\"bg-[#d8bb78] px-4 py-3 font-black text-black disabled:opacity-50\">{busy?'Creating…':'Create submission'}</button></div><p className=\"mt-3 text-center text-xs text-white/28\">Creating the submission never marks it paid.</p></div></div></div>:null}\n{selected?<div className=\"fixed inset-0 z-[80] bg-black/72\" onMouseDown={event=>{if(event.currentTarget===event.target)setSelectedId(null)}}><aside className=\"absolute inset-y-0 right-0 w-full max-w-3xl overflow-y-auto border-l border-white/10 bg-[#09090a]/94 p-4 pb-24 sm:p-6\"><div className=\"flex items-start justify-between gap-4 border-b border-white/[0.08] pb-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-[#d8bb78]\">Submission workbench</div><h2 className=\"mt-1 text-2xl font-black\">{selected.submission_number}</h2><div className=\"mt-1 text-sm text-white/34\">{selected.customer_name||'Collector not named'} · {selectedCards.length.toLocaleString()} ingested / {orderCardCount(selected).toLocaleString()} expected · ${selectedTotal.toFixed(2)}</div></div><button onClick={()=>setSelectedId(null)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Grading stage</div><div className=\"mt-4 flex flex-wrap gap-2\">{statuses.map(status=><div key={status} className={`border px-2.5 py-1 text-[9px] font-black ${selected.status===status?'border-[#d8bb78]/45 text-[#e8cc8d]':'border-white/10 text-white/28'}`}>{pretty(status)}</div>)}</div><div className=\"mt-4\">{(()=>{const index=statuses.indexOf(selected.status as any);const next=index>=0&&index<statuses.length-1?statuses[index+1]:null;const issue=next?transitionIssue(selected,next,selectedCards):'';return <>{terminalStatuses.has(selected.status)?<div className=\"mb-3 text-xs font-black text-emerald-300\"><Check className=\"mr-1 inline h-3.5 w-3.5\"/>Lifecycle complete</div>:next?<div className={'mb-3 text-xs leading-5 '+(issue?'text-amber-200':'text-emerald-300')}>{issue||<>Ready to advance to {pretty(next)}.</>}</div>:null}{next&&!terminalStatuses.has(selected.status)&&selected.status!=='ready'?<button disabled={busy||Boolean(issue)} onClick={()=>void advanceBatch(next)} className=\"inline-flex items-center gap-2 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Advance to {pretty(next)} <ChevronRight className=\"h-4 w-4\"/></button>:null}{selected.status==='ready'?<><button disabled={busy||Boolean(transitionIssue(selected,'shipped',selectedCards))} onClick={()=>void advanceBatch('shipped')} className=\"bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black disabled:cursor-not-allowed disabled:opacity-35\">Mark shipped</button><button disabled={busy} onClick={()=>void advanceBatch('picked_up')} className=\"ml-2 border border-white/10 px-4 py-2.5 text-sm font-black\">Mark picked up</button></>:null}</>})()}</div></section><section className={`${panelClass} mt-4 p-4`}><div className=\"flex items-center justify-between\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Collector & payment</div><BadgeDollarSign className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><select value={detailDraft.payment_status} onChange={event=>setDetailDraft({...detailDraft,payment_status:event.target.value})} className={inputClass}><option value=\"unverified\">Payment not verified</option><option value=\"manually_verified\">Manually verified paid</option><option value=\"waived\">Waived</option><option value=\"refunded\">Refunded</option></select><input value={detailDraft.payment_reference} onChange={event=>setDetailDraft({...detailDraft,payment_reference:event.target.value})} placeholder=\"Reference / Stripe receipt ID\" className={inputClass}/></div><button onClick={openStripe} className=\"mt-3 inline-flex items-center gap-2 text-sm font-black text-[#d8bb78]\"><ExternalLink className=\"h-4 w-4\"/>Open PCG Stripe checkout</button></section><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Shipping & notes</div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><input value={detailDraft.tracking_in} onChange={event=>setDetailDraft({...detailDraft,tracking_in:event.target.value})} placeholder=\"Inbound tracking\" className={inputClass}/><input value={detailDraft.tracking_out} onChange={event=>setDetailDraft({...detailDraft,tracking_out:event.target.value})} placeholder=\"Outbound tracking\" className={inputClass}/><textarea value={detailDraft.notes} onChange={event=>setDetailDraft({...detailDraft,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveSubmissionDetails()} className=\"mt-3 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black transition hover:bg-[#e6ca8d]\">Save submission details</button></section><section className=\"mt-6\"><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Cards in batch</div><h3 className=\"mt-1 text-xl font-black\">Card workbench</h3></div>{selectedCards.map(card=>{const draft=cardDrafts[card.id]||cardToDraft(card);return <div key={card.id} className=\"border-b border-white/[0.07] py-5\"><div className=\"flex items-center justify-between\"><div><div className=\"text-sm font-black\">Card #{card.sequence_number}</div><div className=\"mt-1 text-xs text-white/28\">{draft.cert_number||'Cert not assigned'} · {pretty(card.status)}</div></div>{draft.cert_number&&findPCGGrade(draft.grade_label)?<span className=\"inline-flex items-center gap-1 text-[10px] font-black text-emerald-300\"><Check className=\"h-3 w-3\"/>Graded</span>:null}</div><div className=\"mt-4 grid gap-2 sm:grid-cols-2\"><input value={draft.category} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,category:event.target.value}})} placeholder=\"Category\" className={inputClass}/><input value={draft.year} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,year:event.target.value}})} placeholder=\"Year\" className={inputClass}/><input value={draft.brand_set} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,brand_set:event.target.value}})} placeholder=\"Set Name\" className={inputClass}/><input value={draft.player_character} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,player_character:event.target.value}})} placeholder=\"Player Name(s)\" className={inputClass}/><input value={draft.card_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_number:event.target.value}})} placeholder=\"Card #\" className={inputClass}/><input value={draft.card_description} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_description:event.target.value}})} placeholder=\"Card Description\" className={inputClass}/><select value={draft.autograph_present} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,autograph_present:event.target.value as CardDraft['autograph_present']}})} className={inputClass}><option value=\"\">Auto Y/N</option><option value=\"yes\">Auto Yes</option><option value=\"no\">Auto No</option></select><input value={draft.declared_value} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,declared_value:event.target.value}})} type=\"number\" placeholder=\"Declared Value\" className={inputClass}/><input value={draft.cert_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,cert_number:event.target.value}})} placeholder=\"PCG#/CERT#\" className={inputClass}/><PCGGradeSelect draft={draft} onChange={next=>setCardDrafts({...cardDrafts,[card.id]:next})}/><textarea value={draft.grader_notes} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,grader_notes:event.target.value}})} placeholder=\"Grader notes\" className={`${inputClass} min-h-20 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveCard(card)} className=\"mt-3 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Save card</button></div>})}</section></aside></div>:null}</div>}"},{"path":"src/pages/card-grading/PCGWorkspace.tsx","content":"import React,{useEffect,useRef,useState} from 'react';\nimport {Archive,ArrowUpRight,CheckCircle2,Database,FileSpreadsheet,ImagePlus,Layers3,Loader2,PackageCheck,PauseCircle,Radar,RefreshCw,ScanLine,ShieldCheck,UploadCloud,XCircle} from 'lucide-react';\nimport {supabase} from '@/integrations/supabase/client';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport {useToast} from '@/hooks/use-toast';\nimport {CRMShell} from '@/components/crm/CRMShell';\nimport {cn} from '@/lib/utils';\nimport PCGGrowthLab,{PCGGrowthPulse} from '@/pages/card-grading/PCGGrowthLab';\nimport {PCG_AUTOGRAPH_NOTE,PCG_CARD_THICKNESSES,PCG_GRADING_SCALE,findPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nconst DRIVE_MEDIA_FN=`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/pcg-google-drive-media`;const CONCURRENCY=4;type DriveMedia={url:string;fileId:string};\ntype CsvRow=Record<string,string>;type BatchItem={key:string;front?:File;back?:File;row?:CsvRow;status:'queued'|'uploading'|'done'|'failed';error?:string};type CardForm={title:string;player:string;year:string;set:string;number:string;category:string;grader:string;grade:string;cert:string;condition:string;qty:string;cost:string;value:string;tags:string;notes:string};type StoredCard={id:string;player_character?:string|null;brand_set?:string|null;year?:string|null;card_number?:string|null;front_image_url?:string|null;grade?:number|null;cert_number?:string|null;metadata?:Record<string,unknown>|null};type SubmissionOption={id:string;submission_number:string;customer_name:string|null;status:string};type DriveState='checking'|'ready'|'missing'|'reconnect';type ExistingBatchCard={id:string;sequence_number:number;import_key:string|null;front_image_url:string|null;back_image_url:string|null};type VaultMode='overview'|'single'|'batch'|'growth';\nconst EMPTY_FORM:CardForm={title:'',player:'',year:'',set:'',number:'',category:'',grader:'',grade:'',cert:'',condition:'',qty:'1',cost:'',value:'',tags:'',notes:''};\nconst fileStem=(name:string)=>name.replace(/\\.[^.]+$/,'').replace(/[-_ ](?:front|back|obverse|reverse)$/i,'');const isBack=(name:string)=>/[-_ ](?:back|reverse)\\.[^.]+$/i.test(name);const rowValue=(row:CsvRow|undefined,...keys:string[])=>keys.map(key=>row?.[key]).find(Boolean)||'';const money=(value:string)=>{const parsed=Number((value||'').replace(/[$,]/g,''));return Number.isFinite(parsed)?parsed:null};\nconst normalizeHeader=(value:string)=>String(value||'').trim().toLowerCase().replace(/[^a-z0-9]+/g,'_').replace(/^_+|_+$/g,'');\nfunction parseDelimited(text:string){const sample=String(text||'').split(/\\r?\\n/,1)[0]||'';const delimiter=(sample.match(/\\t/g)||[]).length>(sample.match(/,/g)||[]).length?'\\t':',';const matrix:string[][]=[];let row:string[]=[];let value='';let quoted=false;for(let index=0;index<text.length;index+=1){const char=text[index];if(quoted){if(char==='\"'&&text[index+1]==='\"'){value+='\"';index+=1}else if(char==='\"'){quoted=false}else{value+=char}continue}if(char==='\"'){quoted=true;continue}if(char===delimiter){row.push(value);value='';continue}if(char==='\\n'){row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);row=[];value='';continue}if(char!=='\\r')value+=char}row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);const headerRow=matrix.shift()||[];const seen=new Map<string,number>();const headers=headerRow.map((cell,index)=>{const base=normalizeHeader(cell)||'column_'+(index+1);const count=(seen.get(base)||0)+1;seen.set(base,count);return count===1?base:base+'_'+count});const rows=matrix.map(cells=>Object.fromEntries(headers.map((header,index)=>[header,String(cells[index]??'').trim()]))) as CsvRow[];return{headers,rows,delimiter}}\nfunction parseCsv(text:string){return parseDelimited(text).rows}\nfunction pairFiles(files:File[],rows:CsvRow[]){const map=new Map<string,BatchItem>();for(const file of files.filter(item=>item.type.startsWith('image/'))){const key=fileStem(file.name);const item=map.get(key)||{key,status:'queued' as const};if(isBack(file.name))item.back=file;else if(!item.front)item.front=file;else map.set(`${key}-${map.size+1}`,{key:`${key}-${map.size+1}`,front:file,status:'queued'});map.set(key,item)}for(const item of map.values())item.row=rows.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase());return[...map.values()]}\nfunction ModeButton({active,children,onClick}:{active:boolean;children:React.ReactNode;onClick:()=>void}){return <button onClick={onClick} className={cn('rounded-full px-4 py-2 text-xs font-bold transition sm:text-sm',active?'bg-[#d8bb78] text-[#0b0b0c]':'text-white/48 hover:bg-white/[0.05] hover:text-white')}>{children}</button>}\nfunction Stat({label,value,detail,icon:Icon}:{label:string;value:string;detail:string;icon:React.ComponentType<{className?:string}>}){return <div className=\"min-w-0 py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.16em] text-white/32\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</div><div className=\"mt-2 text-2xl font-black tracking-tight text-white\">{value}</div><div className=\"mt-1 truncate text-xs text-white/35\">{detail}</div></div>}\nfunction Field({label,value,onChange,placeholder}:{label:string;value:string;onChange:(value:string)=>void;placeholder?:string}){return <label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">{label}</span><input value={value} onChange={event=>onChange(event.target.value)} placeholder={placeholder} className=\"mt-2 h-11 w-full border-b border-white/[0.12] bg-transparent text-sm text-white outline-none transition placeholder:text-white/18 focus:border-[#d8bb78]/65\"/></label>}\nfunction PCGGradeField({grade:_grade,designation,onChange}:{grade:string;designation:string;onChange:(grade:string,designation:string)=>void}){const selected=findPCGGrade(designation);return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">PCG grade</span><select value={designation} onChange={event=>{const option=findPCGGrade(event.target.value);onChange(option?.numeric==null?'':String(option.numeric),option?.designation||'')}} className=\"mt-2 h-11 w-full border border-white/[0.12] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/65\"><option value=\"\">Select official PCG designation</option>{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<details className=\"mt-2 border border-white/[0.08] bg-[#09090a]/94/[.025] px-3 py-2\"><summary className=\"cursor-pointer text-[10px] font-black uppercase tracking-[.13em] text-[#d8bb78]\">Official criteria</summary><p className=\"mt-2 text-xs leading-5 text-white/55\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</p><div className=\"mt-2 text-[10px] text-white/35\">Card sizes: {PCG_CARD_THICKNESSES.join(' · ')} · {PCG_AUTOGRAPH_NOTE}</div></details>:null}</div>}\nfunction ImageTile({label,file,onFile}:{label:string;file:File|null;onFile:(file:File|null)=>void}){return <label className=\"group flex min-h-36 cursor-pointer flex-col justify-between border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 transition hover:border-[#d8bb78]/30 hover:bg-[#d8bb78]/[0.035]\"><input type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={event=>onFile(event.target.files?.[0]||null)}/><div className=\"flex items-center justify-between\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/35\">{label}</span>{file?<CheckCircle2 className=\"h-5 w-5 text-emerald-400\"/>:<ImagePlus className=\"h-5 w-5 text-[#d8bb78]\"/>}</div><div><div className=\"truncate text-sm font-bold text-white/82\">{file?.name||`Choose ${label.toLowerCase()} image`}</div><div className=\"mt-1 text-xs text-white/28\">Private PCG card photography.</div></div></label>}\nfunction DemoCardFace({card}:{card:StoredCard}){const subject=String(card.player_character||card.brand_set||'Trading Card').replace(/^DEMO\\s*[—-]\\s*/i,'');const detail=[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ');return <div className=\"absolute inset-1.5 flex flex-col overflow-hidden rounded-[14px] border border-[#d8bb78]/45 bg-[radial-gradient(circle_at_72%_18%,rgba(216,187,120,.26),transparent_38%),linear-gradient(145deg,rgba(30,27,20,.98),rgba(7,7,8,.98)_58%,rgba(27,23,15,.98))] p-2.5 shadow-[inset_0_0_0_1px_rgba(255,255,255,.06),0_14px_32px_rgba(0,0,0,.26)]\"><div className=\"flex items-center justify-between gap-1\"><div className=\"flex items-center gap-1.5 text-[8px] font-black uppercase tracking-[.14em] text-[#ecd797]\"><ScanLine className=\"h-3 w-3\"/>PCG Demo</div><div className=\"rounded-full border border-white/10 bg-black/35 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-[.08em] text-white/46\">Trading card</div></div><div className=\"my-auto grid place-items-center\"><div className=\"grid h-14 w-14 place-items-center rounded-[16px] border border-[#d8bb78]/25 bg-[#d8bb78]/[0.08] shadow-[0_0_36px_rgba(216,187,120,.10)]\"><Archive className=\"h-6 w-6 text-[#d8bb78]\"/></div></div><div><div className=\"line-clamp-2 text-sm font-black leading-tight text-white\">{subject}</div><div className=\"mt-1.5 line-clamp-2 text-[9px] font-bold uppercase tracking-[.06em] text-white/42\">{detail||card.cert_number||'PCG sample record'}</div></div></div>}\n\nexport function PCGCardVaultContent({initialMode='overview',initialSubmissionId=''}:{initialMode?:VaultMode;initialSubmissionId?:string}={}){const{activeTenant}=useMultiTenant();const{toast}=useToast();const tenantId=activeTenant?.id||'';const[mode,setMode]=useState<VaultMode>(initialMode);useEffect(()=>{setMode(initialMode)},[initialMode]);const[form,setForm]=useState<CardForm>(EMPTY_FORM);const[front,setFront]=useState<File|null>(null);const[reverse,setReverse]=useState<File|null>(null);const[saving,setSaving]=useState(false);const[rows,setRows]=useState<CsvRow[]>([]);const[items,setItems]=useState<BatchItem[]>([]);const[session,setSession]=useState('');const[running,setRunning]=useState(false);const[recent,setRecent]=useState<StoredCard[]>([]);const[total,setTotal]=useState(0);const[submissionOptions,setSubmissionOptions]=useState<SubmissionOption[]>([]);const[selectedSubmissionId,setSelectedSubmissionId]=useState('');const[driveState,setDriveState]=useState<DriveState>('checking');const stop=useRef(false);const done=items.filter(item=>item.status==='done').length;const failed=items.filter(item=>item.status==='failed').length;const remaining=items.filter(item=>item.status==='queued'||item.status==='failed');const progress=items.length?Math.round(((done+failed)/items.length)*100):0;const selectedSubmission=submissionOptions.find(item=>item.id===selectedSubmissionId)||null;const driveReady=driveState==='ready';\nasync function load(){if(!tenantId)return;setDriveState('checking');const[cardsResult,submissionResult,googleResult]=await Promise.all([(supabase as any).from('card_grading_cards').select('id,player_character,brand_set,year,card_number,front_image_url,grade,cert_number,metadata',{count:'exact'}).eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(12),(supabase as any).from('card_grading_submissions').select('id,submission_number,customer_name,status').eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(50),(supabase as any).from('tenant_provider_credentials').select('credential_status,metadata').eq('tenant_id',tenantId).eq('provider','google_workspace').maybeSingle()]);setRecent(cardsResult.data||[]);setTotal(Number(cardsResult.count||0));const eligible=((submissionResult.data||[]) as SubmissionOption[]).filter(item=>['received','intake_imaging','authentication','grading','encapsulation','qa'].includes(String(item.status||'')));setSubmissionOptions(eligible);setSelectedSubmissionId(current=>eligible.some(item=>item.id===initialSubmissionId)?initialSubmissionId:(eligible.some(item=>item.id===current)?current:(eligible[0]?.id||'')));const google=googleResult.data as any;const scopes=Array.isArray(google?.metadata?.granted_scopes)?google.metadata.granted_scopes.map((value:unknown)=>String(value)):[];setDriveState(google?.credential_status==='active'?(scopes.includes('https://www.googleapis.com/auth/drive.file')?'ready':'reconnect'):'missing')}useEffect(()=>{void load()},[tenantId,initialSubmissionId]);\nasync function createSubmission(label:string){const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:`VAULT-${Date.now()}-${crypto.randomUUID().slice(0,6)}`,customer_name:'PCG Internal Inventory',service_tier:'inventory',service_price:0,status:'received',notes:label,payment_status:'unverified'}).select('id').single();if(error)throw error;return data.id}\nasync function upload(file:File,sessionKey:string,key:string,side:string,importKey:string):Promise<DriveMedia>{const{data}=await supabase.auth.getSession();if(!data.session?.access_token)throw new Error('Please sign in again.');const params=new URLSearchParams({tenant_id:tenantId,session_key:sessionKey,import_key:importKey,key,side,name:file.name,content_type:file.type||'application/octet-stream'});const response=await fetch(DRIVE_MEDIA_FN+'/upload?'+params.toString(),{method:'POST',headers:{Authorization:'Bearer '+data.session.access_token,'Content-Type':file.type||'application/octet-stream'},body:file});const payload=await response.json().catch(()=>null);if(!response.ok||!payload?.ok)throw new Error(payload?.error||'Google Drive upload failed');return{url:String(payload.url||''),fileId:String(payload.file_id||'')}}\nasync function storeCard(submissionId:string,importKey:string,frontMedia:DriveMedia|null,backMedia:DriveMedia|null,row?:CsvRow,values:Partial<CardForm>={},target?:{id?:string;sequenceNumber?:number}){const metadata={title:values.title||rowValue(row,'title','name'),grading_company:values.grader||rowValue(row,'grading_company','grader'),condition:values.condition||rowValue(row,'condition'),quantity:Number(values.qty||rowValue(row,'quantity')||1)||1,acquisition_cost:money(values.cost||rowValue(row,'acquisition_cost','cost')),estimated_value:money(values.value||rowValue(row,'estimated_value','value')),tags:String(values.tags||rowValue(row,'tags')).split(/[;,]/).map(item=>item.trim()).filter(Boolean),notes:values.notes||rowValue(row,'notes'),...(frontMedia?.fileId||backMedia?.fileId?{image_storage:'google_workspace_drive',drive_media:{provider:'google_workspace',front_file_id:frontMedia?.fileId||null,back_file_id:backMedia?.fileId||null}}:{})};const payload={tenant_id:tenantId,submission_id:submissionId,sequence_number:target?.sequenceNumber||1,category:values.category||rowValue(row,'category','sport'),year:values.year||rowValue(row,'year'),brand_set:values.set||rowValue(row,'brand_set','set','brand'),player_character:values.player||rowValue(row,'player','subject'),card_number:values.number||rowValue(row,'card_number','card_no'),declared_value:money(values.value||rowValue(row,'estimated_value','value')),grade:money(values.grade||rowValue(row,'grade')),grade_label:values.condition||rowValue(row,'condition'),cert_number:values.cert||rowValue(row,'cert_number','cert','serial'),front_image_url:frontMedia?.url||null,back_image_url:backMedia?.url||null,grader_notes:values.notes||rowValue(row,'notes')||null,status:'received',import_key:importKey,metadata};if(target?.id){const{error}=await(supabase as any).from('card_grading_cards').update(payload).eq('tenant_id',tenantId).eq('id',target.id);if(error)throw error;return}const{error}=await(supabase as any).from('card_grading_cards').upsert(payload,{onConflict:'tenant_id,import_key',ignoreDuplicates:true});if(error)throw error}\nasync function saveSingle(){if(!front&&!reverse)return toast({title:'Add at least one card image'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before storing new PCG card images.',variant:'destructive'});setSaving(true);try{const sessionKey='single-'+crypto.randomUUID();const submissionId=await createSubmission('Internal inventory card upload');const frontMedia=front?await upload(front,sessionKey,'card','front',sessionKey):null;const backMedia=reverse?await upload(reverse,sessionKey,'card','back',sessionKey):null;await storeCard(submissionId,sessionKey,frontMedia,backMedia,undefined,form);setForm(EMPTY_FORM);setFront(null);setReverse(null);toast({title:'Card stored in PCG',description:'Master imagery is stored in the connected PCG Google Drive.'});await load()}catch(error){toast({title:'Could not save card',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setSaving(false)}}\nasync function runBatch(batch:BatchItem[]){if(!session||!batch.length)return;if(!selectedSubmissionId)return toast({title:'Select a grading order first',description:'Mass Intake attaches images to an existing collector order.',variant:'destructive'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before starting image intake.',variant:'destructive'});const selected=submissionOptions.find(item=>item.id===selectedSubmissionId);if(!selected)return toast({title:'That grading order is no longer available',description:'Choose another open PCG order.',variant:'destructive'});setRunning(true);stop.current=false;let failedCount=0;try{const existingResult=await(supabase as any).from('card_grading_cards').select('id,sequence_number,import_key,front_image_url,back_image_url').eq('tenant_id',tenantId).eq('submission_id',selectedSubmissionId).order('sequence_number',{ascending:true});if(existingResult.error)throw existingResult.error;const existingCards=(existingResult.data||[]) as ExistingBatchCard[];const byImport=new Map(existingCards.filter(card=>card.import_key).map(card=>[String(card.import_key),card]));const blankSlots=existingCards.filter(card=>!card.import_key&&!card.front_image_url&&!card.back_image_url).sort((a,b)=>a.sequence_number-b.sequence_number);let nextSequence=Math.max(0,...existingCards.map(card=>Number(card.sequence_number)||0))+1;const plans=batch.map(item=>{const importKey=('pcg:'+selectedSubmissionId+':'+item.key).toLowerCase().replace(/[^a-z0-9:._-]+/g,'-');const existing=byImport.get(importKey);if(existing)return{item,importKey,existing:true,targetId:existing.id,sequenceNumber:existing.sequence_number};const slot=blankSlots.shift();return{item,importKey,existing:false,targetId:slot?.id,sequenceNumber:slot?.sequence_number||nextSequence++}});let cursor=0;const worker=async()=>{while(!stop.current){const index=cursor++;if(index>=plans.length)return;const plan=plans[index];const item=plan.item;try{setItems(current=>current.map(row=>row.key===item.key?{...row,status:'uploading',error:undefined}:row));if(!plan.existing){const frontMedia=item.front?await upload(item.front,session,item.key,'front',plan.importKey):null;const backMedia=item.back?await upload(item.back,session,item.key,'back',plan.importKey):null;await storeCard(selectedSubmissionId,plan.importKey,frontMedia,backMedia,item.row,undefined,{id:plan.targetId,sequenceNumber:plan.sequenceNumber})}setItems(current=>current.map(row=>row.key===item.key?{...row,status:'done'}:row))}catch(error){failedCount+=1;setItems(current=>current.map(row=>row.key===item.key?{...row,status:'failed',error:error instanceof Error?error.message:String(error)}:row))}}};await Promise.all(Array.from({length:Math.min(CONCURRENCY,plans.length)},worker));if(!stop.current&&failedCount===0&&selected.status==='received'){const advanced=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selectedSubmissionId,p_status:'intake_imaging'});if(advanced.error)throw advanced.error}toast({title:stop.current?'Batch paused':failedCount?'Batch needs attention':'Order intake complete',description:failedCount?failedCount+' card'+(failedCount===1?'':'s')+' can be retried safely.':selected.submission_number+' now owns these canonical card records and Drive images.'});await load()}catch(error){toast({title:'Mass intake could not finish',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setRunning(false)}}const update=(key:keyof CardForm,value:string)=>setForm(current=>({...current,[key]:value}));\nreturn <div className=\"pcg-card-vault w-full text-white\"><style>{`.pcg-card-vault .text-white\\\\/18,.pcg-card-vault .text-white\\\\/24,.pcg-card-vault .text-white\\\\/28,.pcg-card-vault .text-white\\\\/30,.pcg-card-vault .text-white\\\\/32,.pcg-card-vault .text-white\\\\/34,.pcg-card-vault .text-white\\\\/35,.pcg-card-vault .text-white\\\\/36,.pcg-card-vault .text-white\\\\/38,.pcg-card-vault .text-white\\\\/42,.pcg-card-vault .text-white\\\\/44,.pcg-card-vault .text-white\\\\/48{color:rgba(255,255,255,.68)!important}`}</style><section className=\"border-b border-white/[0.08] pb-6\"><div className=\"flex flex-col gap-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"flex items-center gap-2 text-[10px] font-black uppercase tracking-[.19em] text-[#d8bb78]\"><ScanLine className=\"h-4 w-4\"/>PCG Card Vault</div><h1 className=\"mt-3 text-[34px] font-black leading-none tracking-[-0.045em] sm:text-[46px]\">Card Vault</h1><p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/44\">Capture one card or move an entire collection into PCG. Master imagery stays in the connected PCG Google Drive.</p></div><div className=\"flex max-w-full flex-wrap items-center rounded-2xl border border-white/[0.08] bg-[#09090a]/94/[.025] p-1\"><ModeButton active={mode==='overview'} onClick={()=>setMode('overview')}>Overview</ModeButton><ModeButton active={mode==='single'} onClick={()=>setMode('single')}>Internal inventory</ModeButton><ModeButton active={mode==='batch'} onClick={()=>setMode('batch')}>Mass intake</ModeButton><ModeButton active={mode==='growth'} onClick={()=>setMode('growth')}>Growth Lab</ModeButton></div></div><div className=\"mt-7 grid sm:grid-cols-4\"><Stat icon={Archive} label=\"Cards on file\" value={total.toLocaleString()} detail=\"Canonical PCG records\"/><Stat icon={Layers3} label=\"Current batch\" value={items.length.toLocaleString()} detail={items.length?`${done} stored so far`:'No intake running'}/><Stat icon={PackageCheck} label=\"Exceptions\" value={failed.toLocaleString()} detail={failed?'Ready to retry safely':'No failed uploads'}/><Stat icon={ShieldCheck} label=\"Storage\" value=\"Google Drive\" detail=\"PCG-owned master imagery\"/></div></section>{mode==='overview'?<PCGGrowthPulse tenantId={tenantId} onOpen={()=>setMode('growth')}/>:null}\n{mode==='overview'?<div className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.15fr)_minmax(350px,.85fr)]\"><section><div className=\"mb-3 text-[10px] font-black uppercase tracking-[.17em] text-white/30\">Start an intake</div><div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] sm:grid-cols-2\"><button onClick={()=>setMode('single')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-white/[.025]\"><div className=\"flex items-start justify-between\"><ImagePlus className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Internal inventory card</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Create a standalone PCG-owned inventory record. This is not a collector grading submission.</p></div></button><button onClick={()=>setMode('batch')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-white/[.025]\"><div className=\"flex items-start justify-between\"><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Mass card intake</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Hundreds or thousands, front/back pairing, optional CSV, pause and safe retry.</p></div></button></div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"flex items-center justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Storage contract</div><h2 className=\"mt-2 text-lg font-black\">Built for volume</h2></div><Database className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-5 divide-y divide-white/[0.07]\">{[['Google Drive masters','New originals live in the connected PCG Google Workspace, not KnockLaunch storage.'],['Safe retry','Completed imports keep a stable identity.'],['Canonical records','Single and batch intake write to the same card records.']].map(([title,copy])=><div key={title} className=\"py-4 first:pt-0\"><div className=\"flex items-center gap-2 text-sm font-bold text-white/80\"><CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>{title}</div><p className=\"mt-1.5 pl-6 text-xs leading-5 text-white/32\">{copy}</p></div>)}</div></section></div>:null}\n{mode==='growth'?<div className=\"mt-7\"><PCGGrowthLab tenantId={tenantId}/></div>:null}\n{mode==='single'?<section className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,.65fr)]\"><div><div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Internal inventory</div><h2 className=\"mt-2 text-xl font-black\">Inventory card details</h2></div><div className=\"mt-6 grid gap-x-7 gap-y-5 sm:grid-cols-2\"><Field label=\"Title\" value={form.title} onChange={value=>update('title',value)}/><Field label=\"Player / subject\" value={form.player} onChange={value=>update('player',value)}/><Field label=\"Year\" value={form.year} onChange={value=>update('year',value)}/><Field label=\"Set / brand\" value={form.set} onChange={value=>update('set',value)}/><Field label=\"Card number\" value={form.number} onChange={value=>update('number',value)}/><Field label=\"Sport / category\" value={form.category} onChange={value=>update('category',value)}/><Field label=\"Grading company\" value={form.grader} onChange={value=>update('grader',value)}/><Field label=\"Certification / serial\" value={form.cert} onChange={value=>update('cert',value)}/><PCGGradeField grade={form.grade} designation={form.condition} onChange={(grade,designation)=>setForm(current=>({...current,grade,condition:designation}))}/><Field label=\"Quantity\" value={form.qty} onChange={value=>update('qty',value)}/><Field label=\"Acquisition cost\" value={form.cost} onChange={value=>update('cost',value)} placeholder=\"$0.00\"/><Field label=\"Estimated value\" value={form.value} onChange={value=>update('value',value)} placeholder=\"$0.00\"/><Field label=\"Tags\" value={form.tags} onChange={value=>update('tags',value)} placeholder=\"rookie, refractor, auto\"/></div><label className=\"mt-6 block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">Internal notes</span><textarea value={form.notes} onChange={event=>update('notes',event.target.value)} rows={4} className=\"mt-2 w-full border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 text-sm leading-6 text-white outline-none focus:border-[#d8bb78]/40\"/></label></div><div className=\"self-start border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card imagery</div><div className=\"mt-4 grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08]\"><ImageTile label=\"Front\" file={front} onFile={setFront}/><ImageTile label=\"Back\" file={reverse} onFile={setReverse}/></div><button onClick={()=>void saveSingle()} disabled={saving} className=\"mt-4 flex h-12 w-full items-center justify-center gap-2 bg-[#d8bb78] text-sm font-black text-[#09090a] transition hover:bg-[#e3c886] disabled:opacity-50\">{saving?<Loader2 className=\"h-4 w-4 animate-spin\"/>:<Archive className=\"h-4 w-4\"/>}{saving?'Storing card…':'Store inventory card'}</button></div></section>:null}\n{mode==='batch'?<section className=\"mt-7 space-y-5\"><div className=\"border border-white/[0.08] bg-[#09090a]/94 p-5\"><div className=\"flex flex-col gap-4 lg:flex-row lg:items-end\"><label className=\"min-w-0 flex-1\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">1 · Collector order</span><select value={selectedSubmissionId} onChange={event=>{setSelectedSubmissionId(event.target.value);setSession('');setRows([]);setItems([])}} disabled={running} className=\"mt-2 h-12 w-full border border-white/[0.10] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/55\"><option value=\"\">Select an open PCG order</option>{submissionOptions.map(option=><option key={option.id} value={option.id}>{option.submission_number} · {option.customer_name||'Collector'} · {option.status.replaceAll('_',' ')}</option>)}</select></label><div className=\"flex flex-wrap items-center gap-2 lg:justify-end\"><span className={cn('inline-flex h-10 items-center gap-2 border px-3 text-xs font-black',driveReady?'border-emerald-400/25 bg-emerald-400/[.07] text-emerald-200':'border-amber-400/25 bg-amber-400/[.07] text-amber-100')}><ShieldCheck className=\"h-4 w-4\"/>{driveState==='checking'?'Checking Drive…':driveReady?'Google Drive ready':driveState==='reconnect'?'Reconnect Google Workspace':'Google Workspace required'}</span><a href=\"?mode=submissions&tool=submissions\" className=\"inline-flex min-h-11 items-center border border-white/[0.10] px-3 py-2 text-xs font-black text-white/65\">Receive Cards</a>{!driveReady&&driveState!=='checking'?<a href=\"?tool=settings\" className=\"inline-flex min-h-11 items-center border border-[#d8bb78]/25 px-3 py-2 text-xs font-black text-[#d8bb78]\">Open settings</a>:null}</div></div><p className=\"mt-3 text-xs leading-5 text-white/42\">{selectedSubmission?'Images and CSV details will become the canonical cards for '+selectedSubmission.submission_number+' · '+(selectedSubmission.customer_name||'Collector')+'. No second submission is created.':'Create or choose the customer’s grading order before loading card images.'}</p></div>{!submissionOptions.length?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5 text-sm text-amber-100/80\">No open PCG grading orders are available. Create the collector order from <a href=\"?mode=submissions&tool=submissions\" className=\"font-black text-[#d8bb78] underline underline-offset-4\">Receive Cards</a>, then return to Mass Intake.</div>:null}{driveState==='missing'||driveState==='reconnect'?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5\"><div className=\"text-sm font-black text-amber-100\">{driveState==='reconnect'?'Google Workspace needs Drive permission':'Connect PCG Google Workspace before image intake'}</div><p className=\"mt-1 text-xs leading-5 text-white/45\">New PCG master images are stored in Anthony’s Google Drive. Intake stays locked until that private Drive connection is ready.</p></div>:null}<div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] lg:grid-cols-2\"><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',selectedSubmissionId&&driveReady&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" multiple accept=\"image/*\" disabled={!selectedSubmissionId||!driveReady||running} className=\"hidden\" onChange={event=>{if(!event.target.files)return;setSession('batch-'+crypto.randomUUID());setRows([]);setItems(pairFiles(Array.from(event.target.files),[]))}}/><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">2 · Choose the card image batch</h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Front/back filenames pair automatically. The selected order owns every imported card.</p></div></label><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',items.length&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" accept=\".csv,text/csv\" disabled={!items.length||running} className=\"hidden\" onChange={event=>event.target.files?.[0]?.text().then(text=>{const parsed=parseCsv(text);setRows(parsed);setItems(current=>current.map(item=>({...item,row:parsed.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase())})))})}/><FileSpreadsheet className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">3 · Attach CSV details <span className=\"text-white/30\">(optional)</span></h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Map filenames, player, set, year and card number into those same canonical order records.</p></div></label></div><div className=\"border border-white/[0.08] bg-[#09090a]/94\"><div className=\"flex flex-col gap-4 border-b border-white/[0.07] p-5 sm:flex-row sm:items-center\"><div className=\"mr-auto\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Mass intake queue</div><div className=\"mt-1 text-lg font-black\">{items.length.toLocaleString()} cards <span className=\"font-medium text-white/30\">· {done} stored · {failed} failed</span></div>{selectedSubmission?<div className=\"mt-1 text-xs font-bold text-[#d8bb78]/80\">{selectedSubmission.submission_number} · {selectedSubmission.customer_name||'Collector'}</div>:null}</div>{running?<button onClick={()=>{stop.current=true}} className=\"inline-flex h-10 items-center gap-2 border border-white/[0.10] px-4 text-xs font-bold\"><PauseCircle className=\"h-4 w-4\"/>Pause intake</button>:<button disabled={!remaining.length||!selectedSubmissionId||!driveReady} onClick={()=>void runBatch(remaining)} className=\"inline-flex h-10 items-center gap-2 bg-[#d8bb78] px-4 text-xs font-black text-black disabled:opacity-35\"><UploadCloud className=\"h-4 w-4\"/>{!driveReady?'Google Drive required':!selectedSubmissionId?'Select an order':failed?'Retry remaining':'Start mass intake'}</button>}</div><div className=\"h-1 bg-white/[0.05]\"><div className=\"h-full bg-[#d8bb78]\" style={{width:`${progress}%`}}/></div><div className=\"max-h-[360px] overflow-auto p-2\">{!items.length?<div className=\"grid min-h-44 place-items-center text-center\"><div><Layers3 className=\"mx-auto h-7 w-7 text-white/16\"/><div className=\"mt-3 text-sm font-bold text-white/48\">No card batch loaded</div><div className=\"mt-1 text-xs text-white/28\">Choose an order, then load its card images.</div></div></div>:items.slice(0,2000).map((item,index)=><div key={`${item.key}-${index}`} className=\"grid grid-cols-[1fr_auto] items-center gap-3 px-3 py-2.5 text-sm\"><div className=\"min-w-0\"><div className=\"truncate font-semibold text-white/72\">{item.key}</div><div className=\"truncate text-[10px] text-white/24\">{item.front?.name}{item.back?' + back':''}</div></div>{item.status==='done'?<CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>:item.status==='failed'?<XCircle className=\"h-4 w-4 text-rose-400\"/>:item.status==='uploading'?<Loader2 className=\"h-4 w-4 animate-spin text-[#d8bb78]\"/>:<span className=\"text-[10px] text-white/24\">Queued</span>}</div>)}</div></div></section>:null}\n<section className=\"mt-8 border-t border-white/[0.08] pt-6\"><div className=\"flex items-end justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card Vault</div><h2 className=\"mt-1 text-lg font-black\">Recently stored</h2></div><button onClick={()=>void load()} aria-label=\"Refresh stored cards\" className=\"grid h-11 w-11 place-items-center border border-white/[0.08] text-white/36\"><RefreshCw className=\"h-4 w-4\"/></button></div>{recent.length?<div className=\"mt-4 grid grid-cols-2 gap-px overflow-hidden border border-white/[0.07] bg-white/[0.07] sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-9\">{recent.map(card=><article key={card.id} className=\"bg-black/48\"><div className=\"relative aspect-[3/4] overflow-hidden bg-[#080809]\">{card.metadata?.demo?<DemoCardFace card={card}/>:card.front_image_url?<img src={card.front_image_url} alt=\"\" className=\"h-full w-full object-contain p-2\"/>:<div className=\"grid h-full place-items-center\"><Archive className=\"h-7 w-7 text-white/12\"/></div>}{card.grade?<div className=\"absolute right-2 top-2 z-10 bg-black/78 px-2 py-1 text-[10px] font-black text-[#e5cd93]\">{card.grade}</div>:null}</div><div className=\"p-2.5\"><div className=\"truncate text-xs font-bold\">{card.player_character||card.brand_set||'Card'}</div><div className=\"mt-1 truncate text-[10px] text-white/30\">{[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ')||card.cert_number||'PCG record'}</div></div></article>)}</div>:<div className=\"mt-4 grid min-h-36 place-items-center border border-dashed border-white/[0.08] bg-black/20 text-center\"><div><Archive className=\"mx-auto h-7 w-7 text-white/12\"/><div className=\"mt-2 text-sm font-bold text-white/42\">The vault is ready.</div></div></div>}</section></div>}\nexport default function PCGWorkspace(){return <CRMShell><div className=\"mx-auto w-full max-w-[1500px] px-4 py-5 sm:px-6 sm:py-7 xl:px-9 xl:py-8\"><PCGCardVaultContent/></div></CRMShell>}\n"}],"route":"/pcg/workspace","branch":"ai/objective-first-repair-e9f1d8c4fc4d","writes":[],"patches":[],"pr_body":"Urgent pre-meeting repair for confirmed dark-mode contrast regressions and malformed carryover classes without changing PCG workflow behavior.","version":1,"approved":true,"pr_title":"PCG: fix dark MODES contrast regressions","missionId":"e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6","objective":"URGENT PCG pre-meeting contrast repair. Keep the current dark MODES design and all existing workflow behavior. Fix only the confirmed visual regressions: dark-mode sub-tabs must never use the old light-theme white/beige classes; Save submission details must be a legible gold button with black text; normalize malformed dark background utility carryovers; and harden the PCG Settings embedded section so buttons, inputs, selects, textareas, cards, borders, and muted text always have valid dark-mode contrast and cannot render white-on-white/light-on-light. Also normalize the malformed Card Vault hover utility. No redesign, no workflow changes, no backend/data/auth/provider changes. Ship one fast UI PR, Gate, squash merge, frontend release. Live visual proof must cover Receive Cards submission workbench, Capture Cards, Grade Cards sub-tabs, and PCG Settings on desktop, plus root/mobile sanity.","tenantRef":"pcg","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx","src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx"],"commit_message":"Fix PCG dark-mode contrast regressions","implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":null,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/card-grading/PCGModesWorkspace.tsx","src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"5424491ac4ca7cec38f97b056774618b0efe1033ca7ec229505c861394fd4ec0","replayCount":0,"serializedBytes":112907},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:25:00.934241+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6:repository-mutation-intent:5424491ac4ca7cec38f97b056774618b0efe1033ca7ec229505c861394fd4ec0:0","mission_step_id":"0b8f8558-bd31-42a1-8489-036ebf1588c0","command_center_event_id":"e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6"},{"id":"c86afa30-6769-40fa-a42d-0ed4b4a12fc5","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-bf688521a4b8","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":373,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":4708,"providerAuthMs":0,"ledgerPrepareMs":4708,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":4708,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":4708,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4837,"likelyAffectedFiles":["src/PrivateAppShell.tsx","config/capabilities/tenant-brand-character.json","config/platform-standards.json","scripts/phase3b-sanitize-and-publish-v2.ts","scripts/generate-cc-execution-action-schema.mjs","scripts/visual-witness-hosted-runner/src/bounded-mission-queue.mjs","scripts/visual-witness-hosted-runner/src/mission-gateway.mjs","scripts/visual-witness-hosted-runner/src/mission-supervisor.mjs"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:47:28.588235+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"62b34fd7-7c49-4a4e-844f-6917f5aae349","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"eae95f00-ffee-4a80-82f0-4167f82c7d15","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","frontend-cloudflare/live":"pending"},"mainSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","missing":[],"pending":["forgejo-release/workflow","frontend-cloudflare/live"],"required":["forgejo-main/source","forgejo-release/workflow","frontend-cloudflare/live"],"sourceSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":true,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"frontend":"pending"},"requestContractHash":"d65bf3d980a285c0035e1ff61e8542ec23e3b0471ffa6faa968f10a2ec5b7587","forgejoWorkflowProof":{"runId":11440,"source":"signed_push_receipt","status":"running","results":{},"conclusion":"running","targetStates":{"frontend":"pending"},"targetJobCount":7,"observedTargetStates":{"frontend":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:04.200085+00:00","proof_gate":"canonical_release_pending","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":"forgejo-main-e36498d7001d","receipt_type":"canonical_release_status","idempotency_key":"mission:2274c364-f228-4996-a5ab-a38acc2ac0d7:forgejo-release-status:e36498d7001d5b55f5665c9230d81a6c5fe20229:pending:forgejo-main/source=success|forgejo-release/workflow=pending|frontend-cloudflare/live=pending","mission_step_id":"32e491b8-2981-40be-a89c-1e762af66a9b","command_center_event_id":"2274c364-f228-4996-a5ab-a38acc2ac0d7"},{"id":"62b4eee2-058a-4e58-bfa2-d8ea928da8f1","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","supabase-edge-production/live":"pending"},"mainSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","missing":[],"pending":["forgejo-release/workflow","supabase-edge-production/live"],"required":["forgejo-main/source","forgejo-release/workflow","supabase-edge-production/live"],"sourceSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["tenant-media-library"]},"releaseTargetStates":{"supabaseEdge":"pending"},"requestContractHash":"613fd24e856d540215f548eeb2d9a033c600f63cc90fb2ace1dacecac1bc6123","forgejoWorkflowProof":{"runId":11440,"source":"signed_push_receipt","status":"running","results":{},"conclusion":"running","targetStates":{"supabaseEdge":"pending"},"targetJobCount":7,"observedTargetStates":{"supabaseEdge":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:52.481774+00:00","proof_gate":"canonical_release_pending","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":"forgejo-main-e36498d7001d","receipt_type":"canonical_release_status","idempotency_key":"mission:8a48b182-e2f4-47a6-af51-f3f109eadfe1:forgejo-release-status:e36498d7001d5b55f5665c9230d81a6c5fe20229:pending:forgejo-main/source=success|forgejo-release/workflow=pending|supabase-edge-production/live=pending","mission_step_id":"12dcffac-a771-4d8e-9575-46da9b582f8b","command_center_event_id":"8a48b182-e2f4-47a6-af51-f3f109eadfe1"},{"id":"04c2aeb8-48bc-4aaa-b890-258a6cf84dd6","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-dc59705999e9","prNumber":3031,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:50:48.546886+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","external_id":"3031","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:merged-pr:3031:e7022c14272fd5c1d3d58cc0a209f38d368e0178","mission_step_id":"282d87c4-cf79-471c-82cd-8a705996b9c1","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"f654dbea-1328-4027-bb60-764ebc8e4439","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-5693c2750c78","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":1549,"releaseCount":0,"toolCallCount":1,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":"2026-09-24T05:57:10.230Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":null,"terminal":false,"missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":390,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":238,"providerAuthMs":0,"ledgerPrepareMs":238,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":238,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":238,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4406,"likelyAffectedFiles":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/test/release-orchestration-invariants.test.js","workers/cc-execution/src/version.js","config/control-plane-capabilities.json"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:57:17.324487+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:5693c275-0c78-4aa2-80c1-5877ffe96682:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"8d8beeb0-89d3-493e-8cd8-3001a5d6c4bc","command_center_event_id":"5693c275-0c78-4aa2-80c1-5877ffe96682"},{"id":"0efad8c0-2446-4310-8c8f-dbb4e55fa418","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-dc59705999e9","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3031,"terminal":false,"missionId":"dc597059-99e9-47a7-9342-698e7cb00adf","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":10136,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1639,"missionSetupMs":1236,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1236,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1236,"repositoryMutationMs":8497,"repositoryProviderMs":8497,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":4948,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1236,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":3549},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"dc597059-99e9-47a7-9342-698e7cb00adf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3205,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:49:37.863691+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3031","receipt_type":"execute_mission","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"253e8af7-7943-4d52-8830-37f23fc3f122","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"ad02dd85-5071-4322-a7e1-b8b659e804b5","source":"forgejo-runtime","status":"failed","payload":{"failed":["render-onrunner/runtime-proof"],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","render-onrunner/runtime-proof":"failure"},"mainSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","missing":[],"pending":["forgejo-release/workflow"],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","releaseState":"failed","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false},"releaseTargetStates":{"onrunner":"pending"},"requestContractHash":"827525e41277d3a7edffb7cb3cbe2a07dc84b41f4208b6e2c0ef5b25e1b215f7","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9285","runId":9285,"status":"running","sourceSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"onrunner":"pending"},"targetJobCount":7,"observedTargetStates":{"onrunner":"pending"}},"onrunnerRuntimeProof":{"reason":"render_onrunner_source_mismatch","hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":false,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","runnerVersion":"onrunner-ee384af9a400","expectedSourceSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":{"exact":true,"source":"exact_source_parent_diff_shared_release_owner_mapping","parentSha":"29fc0a9e0f680d55f6f2107ca81696c5ed4d183b","sourceSha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","changedPaths":["scripts/visual-witness-hosted-runner/test/interaction-headless-launch.contract.test.mjs"],"changedPathCount":1,"independentOfCurrentMainCompare":true},"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:51:06.240713+00:00","proof_gate":"canonical_release_terminal_failed","source_sha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","external_id":null,"receipt_type":"canonical_release_status","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:forgejo-release-status:e7022c14272fd5c1d3d58cc0a209f38d368e0178:failed:forgejo-main/source=success|forgejo-release/workflow=pending|render-onrunner/runtime-proof=failure","mission_step_id":"623a07e5-241a-4d08-8efb-7ca2239debb9","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"5a048d3f-9751-4db7-a5d9-4ec5c0f0af0f","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-dc59705999e9-g1","reason":"forgejo_pr_create_failed:404","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3032,"terminal":false,"missionId":"dc597059-99e9-47a7-9342-698e7cb00adf","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":3170,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":3170,"missionSetupMs":1717,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1180,"ledgerReconcileMs":0,"lineageReconcileMs":537,"resolvePreflightMs":1717,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1180,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"dc597059-99e9-47a7-9342-698e7cb00adf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1445,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T19:54:48.94969+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":"e7022c14272fd5c1d3d58cc0a209f38d368e0178","external_id":"3031","receipt_type":"execute_mission","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"253e8af7-7943-4d52-8830-37f23fc3f122","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"5cad4bf1-072c-4d8b-b11a-a6033d87eb5d","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-dc59705999e9-g1","prNumber":3032,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:03:25.402439+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","external_id":"3032","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:merged-pr:3032:28ce6a631ebf93d3dbd65bb39facd77a083f4b68","mission_step_id":"282d87c4-cf79-471c-82cd-8a705996b9c1","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"ac52bfe8-34eb-450b-b77e-082575d202a6","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-8a48b182e2f4","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":7085,"releaseCount":0,"toolCallCount":3,"repeatedCallCount":0,"executorlessWaitMs":9844,"firstUsefulResultAt":"2026-09-24T05:34:05.427Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3596,"terminal":false,"missionId":"8a48b182-e2f4-47a6-af51-f3f109eadfe1","operation":"automatic_mission_resume","proofGate":"canonical_release_dispatched","sourceSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","timingsMs":{"prReadinessMs":116,"approvedPlanMs":0,"shipAndProveMs":950,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"8a48b182-e2f4-47a6-af51-f3f109eadfe1"},"performance":null,"deploymentId":"forgejo-main-e36498d7001d","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["tenant-media-library"]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1958,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:56:51.274997+00:00","proof_gate":"canonical_release_dispatched","source_sha":null,"external_id":"3596","receipt_type":"automatic_mission_resume","idempotency_key":"mission:8a48b182-e2f4-47a6-af51-f3f109eadfe1:automatic-mission-resume:3596:canonical_release_dispatched","mission_step_id":"12dcffac-a771-4d8e-9575-46da9b582f8b","command_center_event_id":"8a48b182-e2f4-47a6-af51-f3f109eadfe1"},{"id":"6641a252-ab1f-42a4-b07c-d65cd79b7830","source":"visual-sandbox","status":"waiting","payload":{"ok":false,"jobId":"1e406296-d7d2-44a6-baaf-37cce2b24813","phase":"universal_visual_witness_status","branch":null,"reason":null,"status":"completed_unverified","metrics":{"receiptBytes":20859,"releaseCount":0,"toolCallCount":16,"repeatedCallCount":8,"executorlessWaitMs":249151,"firstUsefulResultAt":"2026-09-29T19:55:37.195Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":4174,"terminal":true,"missionId":"835f8c32-adf3-415d-a1ad-0c1d8d46234a","operation":"visual_proof_status","proofGate":"visual_witness_objective_acceptance_unproven","sourceSha":"c84c6e80b9e8d228e20089026561f65071964924","timingsMs":{"queue":1525,"total":24902,"execution":23377},"nextAction":null,"receiptRef":{"mode":"full","missionId":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},"performance":null,"deploymentId":"forgejo-main-c84c6e80b9e8","releaseState":"verified","visualWitness":{"role":"GodMode","jobId":"1e406296-d7d2-44a6-baaf-37cce2b24813","tenant":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","runnerUrl":"https://laptop-witness.knocklaunch.app","runnerLane":"laptop","attemptsUsed":1,"supervisorId":"1e406296-d7d2-44a6-baaf-37cce2b24813","failureReason":null,"observedRoute":"https://whatsmyprogress.com/pcg","runnerVersion":"laptop-bb1e9c24fd5d","attemptLineage":[{"jobId":"f2ddc5f2-5319-4069-8a27-03167625ccdf","attempt":1,"category":"completed_with_findings","sourceSha":"bb1e9c24fd5d6d6526aafb737dbeb2f9755ca0f4","startedAt":"2026-09-29T19:57:14.959Z","completedAt":"2026-09-29T19:57:39.797Z","runtimeLane":"cc-execution -> Local Laptop -> universal-witness.mjs","browserEngine":"chromium","failureReason":null,"retryRecovery":null,"runnerVersion":"laptop-bb1e9c24fd5d","browserLaunchReason":"display_unavailable_headless","checkpointAccounting":{"route":{"required":2,"completed":2,"missingIds":[]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":0,"resumed":0,"complete":true,"evidence":{"required":2,"completed":2,"missingIds":[]},"completed":4,"remaining":0,"duplicates":0,"duplicateIds":[],"expectedTotal":4}}],"missionOutcome":"completed_with_findings","requestedRoute":"https://whatsmyprogress.com/pcg","runnerSourceSha":"bb1e9c24fd5d6d6526aafb737dbeb2f9755ca0f4","selectedViewports":["desktop","mobile"],"checkpointAccounting":{"route":{"required":2,"completed":2,"missingIds":[]},"action":{"required":0,"completed":0,"missingIds":[]},"missing":0,"resumed":0,"complete":true,"evidence":{"required":2,"completed":2,"missingIds":[]},"completed":4,"remaining":0,"duplicates":0,"duplicateIds":[],"expectedTotal":4},"correctiveGeneration":0,"restartReplayHistory":[]},"workflowRunId":13183,"releaseTargets":{"frontend":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"ENDED","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":40665,"ownerActionRequired":false,"ownerFacingTerminal":true,"requestContractHash":"2754b5f70bdfcc6717e558fbc17dd1caed6d092461803bcc8e598fcd4882ddbd","continuationRequired":false,"requestContractState":"pending"},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T19:59:48.286777+00:00","proof_gate":"visual_witness_infrastructure_retry_required","source_sha":"laptop-bb1e9c24fd5d","external_id":"1e406296-d7d2-44a6-baaf-37cce2b24813","receipt_type":"visual_proof_status","idempotency_key":"mission:835f8c32-adf3-415d-a1ad-0c1d8d46234a:visual:1e406296-d7d2-44a6-baaf-37cce2b24813:waiting","mission_step_id":"cb560835-e79f-4807-835d-26097c8b0171","command_center_event_id":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},{"id":"2d760469-c546-468e-b505-ebe70f77907b","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-dc59705999e9-g1","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3032,"terminal":false,"missionId":"dc597059-99e9-47a7-9342-698e7cb00adf","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":14678,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":3721,"missionSetupMs":2012,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":2012,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":2012,"repositoryMutationMs":10957,"repositoryProviderMs":10957,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":5080,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":2012,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":5877},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"dc597059-99e9-47a7-9342-698e7cb00adf"},"performance":null,"deploymentId":null,"releaseState":"failed","workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3160,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:00:19.570243+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3032","receipt_type":"execute_mission","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:execute_mission:repair_mission_pr_handed_off_to_supervisor:generation-1","mission_step_id":"253e8af7-7943-4d52-8830-37f23fc3f122","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"a33af132-0957-465d-a2d0-6fa191ec12f7","source":"forgejo-runtime","status":"failed","payload":{"failed":["render-onrunner/runtime-proof"],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","render-onrunner/runtime-proof":"failure"},"mainSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","missing":[],"pending":["forgejo-release/workflow"],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","releaseState":"failed","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"onrunner":"pending"},"requestContractHash":"827525e41277d3a7edffb7cb3cbe2a07dc84b41f4208b6e2c0ef5b25e1b215f7","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9288","runId":9288,"status":"running","sourceSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"onrunner":"pending"},"targetJobCount":7,"observedTargetStates":{"onrunner":"pending"}},"onrunnerRuntimeProof":{"reason":"render_onrunner_source_mismatch","hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":false,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"ee384af9a40035680895bdd7fc1315d9272ffabf","runnerVersion":"onrunner-ee384af9a400","expectedSourceSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:06:11.035634+00:00","proof_gate":"canonical_release_terminal_failed","source_sha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","external_id":"forgejo-main-28ce6a631ebf","receipt_type":"canonical_release_status","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:forgejo-release-status:28ce6a631ebf93d3dbd65bb39facd77a083f4b68:failed:forgejo-main/source=success|forgejo-release/workflow=pending|render-onrunner/runtime-proof=failure","mission_step_id":"623a07e5-241a-4d08-8efb-7ca2239debb9","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"70603a10-f08a-4889-9df9-4893f7ca5516","source":"cc-execution","status":"in_progress","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/objective-first-repair-dc59705999e9-g1","reason":null,"status":"in_progress","metrics":{"receiptBytes":0,"releaseCount":1,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3032,"terminal":false,"missionId":"dc597059-99e9-47a7-9342-698e7cb00adf","operation":"automatic_mission_resume","proofGate":"canonical_release_reconciliation_pending","sourceSha":"28ce6a631ebf93d3dbd65bb39facd77a083f4b68","timingsMs":{"prReadinessMs":172,"approvedPlanMs":0,"shipAndProveMs":3525,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request automatically; do not create replacement work.","receiptRef":{"mode":"full","missionId":"dc597059-99e9-47a7-9342-698e7cb00adf"},"performance":null,"deploymentId":"forgejo-main-28ce6a631ebf","releaseState":"failed","workflowRunId":9288,"releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":793,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:06:24.496076+00:00","proof_gate":"canonical_release_reconciliation_pending","source_sha":null,"external_id":"3032","receipt_type":"automatic_mission_resume","idempotency_key":"mission:dc597059-99e9-47a7-9342-698e7cb00adf:automatic-mission-resume:3032:canonical_release_reconciliation_pending","mission_step_id":"282d87c4-cf79-471c-82cd-8a705996b9c1","command_center_event_id":"dc597059-99e9-47a7-9342-698e7cb00adf"},{"id":"3fa94759-fc97-4593-a633-346443e85ffb","source":"cc-execution","status":"complete","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-bf688521a4b8","reason":null,"status":"complete","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3033,"terminal":false,"missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee","operation":"execute_mission","proofGate":"repair_mission_prepared","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":8947,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":882,"providerAuthMs":0,"ledgerPrepareMs":464,"ledgerReconcileMs":0,"lineageReconcileMs":418,"resolvePreflightMs":882,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":464,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"continue_batch_or_ship_and_prove","receiptRef":{"mode":"full","missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2488,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:08:52.94195+00:00","proof_gate":"repair_mission_prepared","source_sha":null,"external_id":"3033","receipt_type":"execute_mission","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:execute_mission:repair_mission_prepared:current-generation","mission_step_id":"58bbd356-7fb1-4086-be95-bcbf8de4c81f","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"9df976de-ae9f-402f-af08-7e4346cf4a00","source":"cc-execution","status":"no_change","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"no_change","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":null,"terminal":false,"missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682","operation":"execute_mission","proofGate":"repair_mission_prepared","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":5,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":353,"providerAuthMs":0,"ledgerPrepareMs":353,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":353,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":353,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"pull_request_required","receiptRef":{"mode":"full","missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1347,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:57:10.26845+00:00","proof_gate":"repair_mission_prepared","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:5693c275-0c78-4aa2-80c1-5877ffe96682:execute_mission:repair_mission_prepared:current-generation","mission_step_id":"8d8beeb0-89d3-493e-8cd8-3001a5d6c4bc","command_center_event_id":"5693c275-0c78-4aa2-80c1-5877ffe96682"},{"id":"de6b5cfe-a869-43a6-aac0-7698e01baa03","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/explicit-target-readiness-ac995fd0","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3034,"terminal":false,"missionId":"ac995fd0-b494-472a-9e10-5f6c182ebd03","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":24651,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":6813,"missionSetupMs":1841,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1841,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1841,"repositoryMutationMs":17838,"repositoryProviderMs":17838,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":7802,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1841,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":10036},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"ac995fd0-b494-472a-9e10-5f6c182ebd03"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3338,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:14:27.148035+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3034","receipt_type":"execute_mission","idempotency_key":"mission:ac995fd0-b494-472a-9e10-5f6c182ebd03:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"54df742d-4476-4eeb-bda8-4f562c3a7470","command_center_event_id":"ac995fd0-b494-472a-9e10-5f6c182ebd03"},{"id":"5003b2cb-aedd-44e9-b0de-40a94011ff4d","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"workers/cc-execution/src/version.js","content":"// Release marker: Forgejo is the canonical repository and self-hosted Actions control plane.\nexport const CC_EXECUTION_VERSION = \"1.58.245-durable-truth-authority\";\n"}],"branch":"ai/objective-first-repair-e6e7a510db4d","writes":[],"patches":[],"version":1,"approved":true,"missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390","objective":"Close the two remaining durable mission truth gaps: (1) a valid persisted repository mutation body remains authoritative during waiting, dispatched, or retryable in-flight states so bare mission continuation cannot fall back into fresh synthesis; blocked/completed/failed states remain non-replayable. (2) source-lineage reconciliation recovers a missing mission/context prNumber from PR-specific durable receipt externalId values before Forgejo lookup, so a merged PR remains discoverable and authoritative even after its ai branch is deleted. Preserve all existing release, merge, request-contract, and safety behavior. Add regression assertions and ship live; no visual proof.","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","workers/cc-execution/src/version.js"],"anchored_edits":[{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"  const context = mission.context && typeof mission.context === \"object\" ? mission.context : {};\n  const branch = String(context.branch || mission.branch || \"\").trim();\n  let prNumber = Number(context.prNumber || mission.prNumber);","replacement":"  const context = mission.context && typeof mission.context === \"object\" ? mission.context : {};\n  const branch = String(context.branch || mission.branch || \"\").trim();\n  const receiptPrNumber = [...(Array.isArray(mission.recentReceipts) ? mission.recentReceipts : []), ...(Array.isArray(mission.receipts) ? mission.receipts : [])]\n    .find((receipt) => {\n      const type = String(receipt?.type || receipt?.receiptType || receipt?.receipt_type || \"\").trim();\n      const proofGate = String(receipt?.proofGate || receipt?.proof_gate || \"\").trim();\n      const externalId = Number(receipt?.externalId ?? receipt?.external_id);\n      return Number.isInteger(externalId)\n        && externalId > 0\n        && /(?:pull_request|(?:^|_)pr(?:_|$)|forgejo.*(?:pr|merge)|repair_mission_pr_handed_off_to_supervisor|source_lineage_merged_pr)/i.test(`${type} ${proofGate}`);\n    });\n  let prNumber = Number(context.prNumber || mission.prNumber || receiptPrNumber?.externalId || receiptPrNumber?.external_id);"},{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"        && persistedIntentState === \"dispatched\"\n        && persistedIntentBody","replacement":"        && [\"waiting\", \"dispatched\", \"retryable\"].includes(persistedIntentState.toLowerCase())\n        && persistedIntentBody"},{"path":"workers/cc-execution/test/release-orchestration-invariants.test.js","anchor":"  assert.match(missionControl, /persistedIntentState === \"dispatched\"/);\n  assert.match(missionControl, /explicitMutationPaths\\(persistedIntentBody\\)\\.length > 0/);","replacement":"  assert.match(missionControl, /\\[\"waiting\", \"dispatched\", \"retryable\"\\]\\.includes\\(persistedIntentState\\.toLowerCase\\(\\)\\)/);\n  assert.match(missionControl, /explicitMutationPaths\\(persistedIntentBody\\)\\.length > 0/);\n  assert.match(missionControl, /const receiptPrNumber = \\[\\.\\.\\.\\(Array\\.isArray\\(mission\\.recentReceipts\\)/);\n  assert.match(missionControl, /repair_mission_pr_handed_off_to_supervisor\\|source_lineage_merged_pr/);\n  assert.match(missionControl, /context\\.prNumber \\|\\| mission\\.prNumber \\|\\| receiptPrNumber\\?\\.externalId/);"}],"implementation":{"files":[],"writes":[]},"requestContract":{"source":"explicit","version":1,"outcomes":[{"id":"intent-authority-window","statement":"Persisted exact mutation intent remains authoritative across waiting/dispatched/retryable in-flight states and cannot leak into fresh synthesis.","proofConditionIds":["runtime"]},{"id":"receipt-lineage-authority","statement":"PR-specific durable receipts can restore missing prNumber for merged-source reconciliation after branch deletion.","proofConditionIds":["runtime"]}],"objective":"Close the two remaining durable mission truth gaps: (1) a valid persisted repository mutation body remains authoritative during waiting, dispatched, or retryable in-flight states so bare mission continuation cannot fall back into fresh synthesis; blocked/completed/failed states remain non-replayable. (2) source-lineage reconciliation recovers a missing mission/context prNumber from PR-specific durable receipt externalId values before Forgejo lookup, so a merged PR remains discoverable and authoritative even after its ai branch is deleted. Preserve all existing release, merge, request-contract, and safety behavior. Add regression assertions and ship live; no visual proof.","constraints":[{"id":"nonreplay-terminal-intents","statement":"Blocked, completed, failed, or otherwise terminal mutation intents are not replayed.","proofConditionIds":["runtime"]},{"id":"receipt-filtering","statement":"Only PR-specific receipt/proof types may contribute an externalId as a recovered PR number.","proofConditionIds":["runtime"]},{"id":"nonvisual","statement":"No visual proof.","proofConditionIds":["runtime"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"runtime","kind":"runtime","claim":"Live cc-execution contains durable intent-state authority and receipt-based PR lineage recovery with regression coverage.","required":true}]},"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":null,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/test/release-orchestration-invariants.test.js","workers/cc-execution/src/version.js"],"requestContract":{"source":"explicit","version":1,"outcomes":[{"id":"intent-authority-window","statement":"Persisted exact mutation intent remains authoritative across waiting/dispatched/retryable in-flight states and cannot leak into fresh synthesis.","proofConditionIds":["runtime"]},{"id":"receipt-lineage-authority","statement":"PR-specific durable receipts can restore missing prNumber for merged-source reconciliation after branch deletion.","proofConditionIds":["runtime"]}],"objective":"Close the two remaining durable mission truth gaps: (1) a valid persisted repository mutation body remains authoritative during waiting, dispatched, or retryable in-flight states so bare mission continuation cannot fall back into fresh synthesis; blocked/completed/failed states remain non-replayable. (2) source-lineage reconciliation recovers a missing mission/context prNumber from PR-specific durable receipt externalId values before Forgejo lookup, so a merged PR remains discoverable and authoritative even after its ai branch is deleted. Preserve all existing release, merge, request-contract, and safety behavior. Add regression assertions and ship live; no visual proof.","constraints":[{"id":"nonreplay-terminal-intents","statement":"Blocked, completed, failed, or otherwise terminal mutation intents are not replayed.","proofConditionIds":["runtime"]},{"id":"receipt-filtering","statement":"Only PR-specific receipt/proof types may contribute an externalId as a recovered PR number.","proofConditionIds":["runtime"]},{"id":"nonvisual","statement":"No visual proof.","proofConditionIds":["runtime"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"runtime","kind":"runtime","claim":"Live cc-execution contains durable intent-state authority and receipt-based PR lineage recovery with regression coverage.","required":true}]},"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"controlPlaneMaintenanceReason":"Owner-authorized durable mission truth hardening: persisted intent authority across transient states and receipt-backed PR lineage recovery."},"proofRequirements":null,"controlPlaneUnfreeze":true,"durableMutationResume":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"controlPlaneMaintenanceReason":"Owner-authorized durable mission truth hardening: persisted intent authority across transient states and receipt-backed PR lineage recovery."},"recovery":false,"fingerprint":"1ef50c7b326538228a0af51a9eba846af785ba06f87abeb570001fede74d1df5","replayCount":0,"serializedBytes":8974},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:26.09726+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:repository-mutation-intent:1ef50c7b326538228a0af51a9eba846af785ba06f87abeb570001fede74d1df5:0","mission_step_id":"2f29ba64-e48f-40bf-a66f-5a613953a150","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"3bce49c2-cbda-4ab8-ac4f-3a4d2e06a0c1","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Enforce the existing Gate dependency/prerequisite contract in runtime failure normalization without weakening deterministic source/test/build failure blocking.","baseSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","issuedAt":1790229527974,"expiresAt":1790229707974,"missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682","authorizationId":"b124d80a-c4a7-413e-a7b2-4471ecadc1a3","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:48.385202+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:b124d80a-c4a7-413e-a7b2-4471ecadc1a3","mission_step_id":"8d8beeb0-89d3-493e-8cd8-3001a5d6c4bc","command_center_event_id":"5693c275-0c78-4aa2-80c1-5877ffe96682"},{"id":"c60af908-797f-4ae9-ad9f-684f51ca19b8","source":"cc-execution","status":"release_reconciliation_pending","payload":{"ok":true,"jobId":"ee42ebec-6dc3-4065-92ab-d68af72cf3eb","phase":"release","branch":"ai/objective-first-repair-0618a5ffb7bd","reason":null,"status":"release_reconciliation_pending","metrics":{"receiptBytes":80586,"releaseCount":0,"toolCallCount":38,"repeatedCallCount":18,"executorlessWaitMs":1083668,"firstUsefulResultAt":"2026-09-24T14:59:35.634Z","recoveryAttemptCount":1,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":3631,"terminal":false,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","operation":"execute_mission","proofGate":"canonical_release_reconciliation_pending","sourceSha":"710b363912911cd6ef14113f1c6ebded8c252c84","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":1873,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":116,"approvedPlanMs":0,"missionSetupMs":355,"providerAuthMs":0,"shipAndProveMs":966,"ledgerPrepareMs":355,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":355,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":355,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"reconcile_release","receiptRef":{"mode":"full","missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},"performance":null,"deploymentId":"forgejo-main-710b36391291","releaseState":"failed","visualWitness":{"role":null,"jobId":"ee42ebec-6dc3-4065-92ab-d68af72cf3eb","tenant":null,"runnerUrl":null,"runnerLane":null,"attemptsUsed":null,"supervisorId":null,"failureReason":null,"observedRoute":null,"runnerVersion":null,"attemptLineage":[],"missionOutcome":null,"requestedRoute":null,"runnerSourceSha":null,"selectedViewports":[],"checkpointAccounting":null,"correctiveGeneration":1,"restartReplayHistory":[]},"workflowRunId":11512,"releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2858,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:01:17.412229+00:00","proof_gate":"canonical_release_reconciliation_pending","source_sha":"e1efa7ac76f792ce93365b88233ae35637ab2194","external_id":"forgejo-main-e1efa7ac76f7","receipt_type":"execute_mission","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:execute_mission:canonical_release_reconciliation_pending:current-generation","mission_step_id":"fa619a83-3c4b-438e-8822-e8e730fcb2ef","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"2ad696c1-3791-4a4b-81d8-b6cdf25ce68d","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-6cebe5456b72","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":3609,"releaseCount":0,"toolCallCount":2,"repeatedCallCount":0,"executorlessWaitMs":5009,"firstUsefulResultAt":"2026-09-24T17:48:30.568Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":null,"terminal":false,"missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":913,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":304,"providerAuthMs":0,"ledgerPrepareMs":304,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":304,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":304,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3485,"likelyAffectedFiles":["src/__tests__/contracts/tenantStartupSafety.test.ts","src/PrivateAppShell.tsx"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T17:48:35.630568+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:6cebe545-6b72-468c-9a0c-d8a2c0936755:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"a019473f-6d1b-48bf-ad6e-7cd13c7d898f","command_center_event_id":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},{"id":"3601ab24-fc7c-40bc-81d9-4bb2fc4b1412","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":"ee42ebec-6dc3-4065-92ab-d68af72cf3eb","phase":"implementation","branch":"ai/objective-first-repair-0618a5ffb7bd","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":66200,"releaseCount":0,"toolCallCount":31,"repeatedCallCount":14,"executorlessWaitMs":787116,"firstUsefulResultAt":"2026-09-24T14:59:35.634Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.260-release-actions-query-parity","prNumber":3631,"terminal":false,"missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4527,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":733,"missionSetupMs":422,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":301,"ledgerReconcileMs":0,"lineageReconcileMs":121,"resolvePreflightMs":422,"repositoryMutationMs":3794,"repositoryProviderMs":3794,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2236,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":301,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1558},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},"performance":null,"deploymentId":null,"releaseState":null,"visualWitness":{"role":null,"jobId":"ee42ebec-6dc3-4065-92ab-d68af72cf3eb","tenant":null,"runnerUrl":null,"runnerLane":null,"attemptsUsed":null,"supervisorId":null,"failureReason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","observedRoute":null,"runnerVersion":null,"attemptLineage":[],"missionOutcome":null,"requestedRoute":null,"runnerSourceSha":null,"selectedViewports":[],"checkpointAccounting":null,"correctiveGeneration":1,"restartReplayHistory":[]},"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3315,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:00:50.083352+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3629","receipt_type":"execute_mission","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"2b5fc5ae-18d8-44ba-b671-ba1834de76eb","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"8d69a6c1-88ef-4b44-9ac8-1ba87d602e76","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-9f2c0fa6a524","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":8072,"releaseCount":0,"toolCallCount":4,"repeatedCallCount":0,"executorlessWaitMs":77323,"firstUsefulResultAt":"2026-09-24T18:47:09.844Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.261-nonvisual-proof-precedence","prNumber":3657,"terminal":false,"missionId":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":3093,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":971,"missionSetupMs":421,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":272,"ledgerReconcileMs":0,"lineageReconcileMs":149,"resolvePreflightMs":421,"repositoryMutationMs":2122,"repositoryProviderMs":2122,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":1993,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":272,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":129},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3043,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T18:47:31.834113+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3657","receipt_type":"execute_mission","idempotency_key":"mission:9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"d3d486f5-8474-4025-b37c-bcf7bdf00383","command_center_event_id":"9f2c0fa6-a524-4a29-a729-a7bd0ce54ca8"},{"id":"358475a4-4e9b-46ed-a53f-47118b910c87","source":"cc-execution","status":"cancelled","payload":{"cancelled":true,"missionId":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:00:43.199712+00:00","proof_gate":"durable_mission_cancelled","source_sha":null,"external_id":null,"receipt_type":"owner_mission_cancelled","idempotency_key":"mission:835f8c32-adf3-415d-a1ad-0c1d8d46234a:mission-cancel:835f8c32-adf3-415d-a1ad-0c1d8d46234a","mission_step_id":"cb560835-e79f-4807-835d-26097c8b0171","command_center_event_id":"835f8c32-adf3-415d-a1ad-0c1d8d46234a"},{"id":"cf380d6f-43a1-4607-bc0b-793d71c73fba","source":"cc-execution","status":"recorded","payload":{"objective":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* branch from current main, one PR, canonical Gate, squash merge, frontend release, then verify live.","tenantRef":"321-auto-unlock","receivedAt":"2026-09-24T18:49:52.236Z","fingerprint":"fbbaee86a5199fd5c43bb1fdf54186585ef051611b0fb1db5faad09d957d1be7","workstreamRef":"321autounlock","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* branch from current main, one PR, canonical Gate, squash merge, frontend release, then verify live.","wordingChanged":false,"canonicalIntent":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* branch from current main, one PR, canonical Gate, squash merge, frontend release, then verify live.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* branch from current main, one PR, canonical Gate, squash merge, frontend release, then verify live.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* branch from current main, one PR, canonical Gate, squash merge, frontend release, then verify live.","constraints":[{"id":"visual-artifact-scope","statement":"The requested visual artifact type is authoritative: logo only. Do not add unrelated or mixed visual surfaces unless the owner explicitly requested them.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-content-truth","statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"tenant-visual-isolation","statement":"Visual work is isolated to 321-auto-unlock. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"visual-viewport-authority","statement":"The requested desktop viewport/form factor is authoritative. Do not create a mixed-device composite or add another viewport unless explicitly requested.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* br","route":"https://321autounlock.com/","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Correct the live 321 Auto Unlock desktop header and text-contrast issues shown by the owner screenshot. Current nav is visually off-center because it is centered inside the middle grid track while logo and CTA widths are unequal. In `src/pages/auto-lockout/AutoUnlockPublic.tsx`, make the desktop nav geometrically centered on the viewport/header shell using absolute 50% positioning (`left-1/2` + translateX) or an equivalent true-center technique that is independent of logo/CTA widths, while preserving logo left and Get Help right. Also improve readability of white hero text over the bright uploaded background: increase white text opacity where currently semi-transparent, add restrained text-shadow and/or subtle localized backdrop/gradient behind the left copy, and keep the cyan accent intact. Do not add opaque cards or change copy/layout scale. Preserve video, request flow, background, routes, CTA behavior, and current overall composition. Frontend-only, smallest diff, one fresh ai/* br","route":"https://321autounlock.com/","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Correct-the-live-321-Auto-Unlock-desktop-header-and-text-contrast-issues-shown-by-the-owner-screensh","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"854f09662b7a37e49e39110cff9eb2e8998efc9f69b522f5c323dccaff403d43","requestContractRevision":1},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T18:49:52.47533+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:22d71bd6-e399-480c-89a4-d01455819897:tenant-workstream-contribution:fbbaee86a5199fd5c43bb1fdf54186585ef051611b0fb1db5faad09d957d1be7","mission_step_id":null,"command_center_event_id":"22d71bd6-e399-480c-89a4-d01455819897"},{"id":"41d4268a-2127-4b00-b466-8d7d05d2dc5c","source":"cc-execution","status":"source_resolution_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-94dc4229b32e","reason":null,"status":"source_resolution_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","operation":"execute_mission","proofGate":"repair_mission_source_resolution_required","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":717,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":721,"providerAuthMs":0,"ledgerPrepareMs":721,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":721,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":721,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Resolve bounded authoritative Forgejo source targets, then call /mission/execute again with this same missionId and exact files or anchored_edits. Do not switch workflows.","receiptRef":{"mode":"full","missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4580,"likelyAffectedFiles":[],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:19:32.003548+00:00","proof_gate":"repair_mission_source_resolution_required","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:execute_mission:repair_mission_source_resolution_required:current-generation","mission_step_id":"ef1520c7-57b8-42f1-ab72-9855ec94a11c","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"603f6464-e590-4b46-b3c4-5ad87669a5d9","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-94dc4229b32e","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":9,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":756,"providerAuthMs":0,"ledgerPrepareMs":756,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":756,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":756,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4639,"likelyAffectedFiles":["workers/cc-execution/src/forgejo-provider.js","workers/cc-execution/test/forgejo-provider-singleflight.test.js","config/control-plane-capabilities.json"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:19:55.203001+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"ef1520c7-57b8-42f1-ab72-9855ec94a11c","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"36f12716-20c7-44e5-8b13-d82577e6f1cf","source":"cc-execution","status":"no_change","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"no_change","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.218-durable-async-repository-mutation","prNumber":null,"terminal":false,"missionId":"80a641a9-6336-4d0e-8b9e-6207e8751773","operation":"execute_mission","proofGate":"repair_mission_prepared","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":191,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":409,"providerAuthMs":0,"ledgerPrepareMs":409,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":409,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":409,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"pull_request_required","receiptRef":{"mode":"full","missionId":"80a641a9-6336-4d0e-8b9e-6207e8751773"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1350,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:06:05.526577+00:00","proof_gate":"repair_mission_prepared","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:80a641a9-6336-4d0e-8b9e-6207e8751773:execute_mission:repair_mission_prepared:current-generation","mission_step_id":"0b0dc2ec-4344-4543-b201-02808f9c6fe9","command_center_event_id":"80a641a9-6336-4d0e-8b9e-6207e8751773"},{"id":"8304ab73-d9c2-4fbd-a21e-8adedefbee58","source":"cc-execution","status":"no_change","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":null,"reason":null,"status":"no_change","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.218-durable-async-repository-mutation","prNumber":null,"terminal":false,"missionId":"3e398a97-cf59-4472-ac68-d44ab00fcd65","operation":"execute_mission","proofGate":"repair_mission_prepared","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":7,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":362,"providerAuthMs":0,"ledgerPrepareMs":362,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":362,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":362,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"pull_request_required","receiptRef":{"mode":"full","missionId":"3e398a97-cf59-4472-ac68-d44ab00fcd65"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1346,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:22:38.141949+00:00","proof_gate":"repair_mission_prepared","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:3e398a97-cf59-4472-ac68-d44ab00fcd65:execute_mission:repair_mission_prepared:current-generation","mission_step_id":"18cbe8f3-52ee-45a3-9292-069d5967659f","command_center_event_id":"3e398a97-cf59-4472-ac68-d44ab00fcd65"},{"id":"7798dff4-c4fd-4b1b-9ce1-1369765c55be","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Same authorized test-only false-red Gate hardening mission.","baseSha":"f852d7571ae237f049f53ecc3e497cfaa98c3d43","issuedAt":1790130179067,"expiresAt":1790130359067,"missionId":"3e398a97-cf59-4472-ac68-d44ab00fcd65","authorizationId":"78fc9f41-43dc-4a58-a127-a4a6488b5b04","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:22:59.471667+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"f852d7571ae237f049f53ecc3e497cfaa98c3d43","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:78fc9f41-43dc-4a58-a127-a4a6488b5b04","mission_step_id":"18cbe8f3-52ee-45a3-9292-069d5967659f","command_center_event_id":"3e398a97-cf59-4472-ac68-d44ab00fcd65"},{"id":"8d14225c-4c14-47e0-8e78-7ec1c9b3b31b","source":"cc-execution","status":"blocked","payload":{"reason":"anchored_edit_anchor_missing:workers/cc-execution/src/index-mission-control.js","fingerprint":"6bd27b868d995b59ca01755802fe699a5ef0af2eea638778774ddf41555d4eab"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:34:42.535269+00:00","proof_gate":"repository_mutation_intent_deterministic_failure","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent_blocked","idempotency_key":"mission:e97d1251-36df-46f7-b193-6bb6f4bb62b5:repository-mutation-intent-blocked:6bd27b868d995b59ca01755802fe699a5ef0af2eea638778774ddf41555d4eab","mission_step_id":"64b398cd-1ba9-4808-9eeb-114220b0d621","command_center_event_id":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},{"id":"b97c0940-f40d-4fe7-8fbd-06e1302188bb","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-bf688521a4b8","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3033,"terminal":false,"missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee","operation":"execute_mission","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":2157,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":1237,"approvedPlanMs":0,"missionSetupMs":1411,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":669,"ledgerReconcileMs":0,"lineageReconcileMs":742,"resolvePreflightMs":1411,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":669,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1971,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:18:25.484683+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"3033","receipt_type":"execute_mission","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:execute_mission:repair_mission_waiting_for_gate:current-generation","mission_step_id":"58bbd356-7fb1-4086-be95-bcbf8de4c81f","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"21a3b909-63ae-401f-afb4-5322a91359d1","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-bf688521a4b8","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3033,"terminal":false,"missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":9705,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":869,"approvedPlanMs":0,"missionSetupMs":1863,"providerAuthMs":0,"shipAndProveMs":8338,"ledgerPrepareMs":1294,"ledgerReconcileMs":0,"lineageReconcileMs":569,"resolvePreflightMs":1863,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1294,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee"},"performance":null,"deploymentId":"forgejo-main-4faa48a4a6e8","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":true,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["documents","generate-tarping-invoice-pdf","invoices","invoices-manage"]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3244,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:28:05.308177+00:00","proof_gate":"canonical_release_dispatched","source_sha":"4faa48a4a6e81063cf997425f9c23f885d553b93","external_id":"forgejo-main-4faa48a4a6e8","receipt_type":"execute_mission","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"00f1b85f-fe8e-47ff-8178-a9565502a840","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"d3b61595-ce21-4360-a400-0472ce044933","source":"cc-execution","status":"authorized","payload":{"paths":["workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"reason":"Owner-authorized durable mission truth hardening: persisted intent authority across transient states and receipt-backed PR lineage recovery.","baseSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","issuedAt":1790229507077,"expiresAt":1790229687077,"missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390","authorizationId":"19c220f9-b0ae-44cc-92cb-5304e0dfcbab","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:27.364655+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:19c220f9-b0ae-44cc-92cb-5304e0dfcbab","mission_step_id":"91c11f99-b1ca-4fb4-bcac-e825496b9690","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"5ea4a762-466f-4c64-b8fd-cfd996a96d51","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-80a641a96336","writes":[],"patches":[],"approved":true,"missionId":"80a641a9-6336-4d0e-8b9e-6207e8751773","objective":"Harden the Canonical Gate so historical Supabase migration files cannot be silently edited again. The current validator enforces immutability only when MIGRATION_INTEGRITY_BASE is set, while Gate already fetches origin/main and currently validates changed migrations without that base. Make scripts/validate-supabase-migration-integrity.mjs automatically use origin/main when no explicit base is supplied; in CI, fail closed if no comparison base can be resolved; outside CI, preserve local usability. Keep new-migration validation unchanged. Do not touch tenant/product code or production data.","sourceSha":"9a8d43ce9207634c79361312e96f140f091862a9","repository":"noel/KnockLaunchOS","autoProgress":true,"ownerApproved":true,"anchored_edits":[{"path":"scripts/validate-supabase-migration-integrity.mjs","edits":[{"new_content":"const configuredBaseRef = process.env.MIGRATION_INTEGRITY_BASE?.trim();","old_content":"const baseRef = process.env.MIGRATION_INTEGRITY_BASE?.trim();"},{"new_content":"function fail(message) {\n  console.error(`::error::${message}`);\n  process.exitCode = 1;\n}\n\nfunction gitRefExists(ref) {\n  try {\n    execFileSync(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", `${ref}^{commit}`], { stdio: \"ignore\" });\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nfunction resolveBaseRef() {\n  if (configuredBaseRef) return configuredBaseRef;\n  if (gitRefExists(\"origin/main\")) return \"origin/main\";\n  return null;\n}\n\nconst baseRef = resolveBaseRef();\nconst ci = String(process.env.CI || \"\").trim().toLowerCase() === \"true\";\nif (ci && !baseRef) {\n  fail(\"Migration integrity cannot resolve a comparison base in CI. Set MIGRATION_INTEGRITY_BASE or fetch origin/main; historical migration immutability may not be skipped.\");\n}\n\nconst files = readdirSync(migrationDir).filter((name) => name.endsWith(\".sql\")).sort();","old_content":"function fail(message) {\n  console.error(`::error::${message}`);\n  process.exitCode = 1;\n}\n\nconst files = readdirSync(migrationDir).filter((name) => name.endsWith(\".sql\")).sort();"}]}],"implementation":{"files":[],"writes":[]},"durableMutationResume":true},"recovery":false,"fingerprint":"51736116146efeb2ed71d23d25bfc67fcbd4f3dc70f6ce11dd07c5e6d8285a70","replayCount":0,"serializedBytes":2340},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:06:20.190193+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:80a641a9-6336-4d0e-8b9e-6207e8751773:repository-mutation-intent:51736116146efeb2ed71d23d25bfc67fcbd4f3dc70f6ce11dd07c5e6d8285a70:0","mission_step_id":"6255b901-59f3-43df-b391-11df91cd45dc","command_center_event_id":"80a641a9-6336-4d0e-8b9e-6207e8751773"},{"id":"b1125eab-b25f-4fe0-97e4-75feef3a0804","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-3e398a97cf59","prNumber":3477,"nextAction":null,"mergeCommitSha":"00a8fe37a861723fc730417e8d78ab799123f207","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:24:27.111517+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"00a8fe37a861723fc730417e8d78ab799123f207","external_id":"3477","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:3e398a97-cf59-4472-ac68-d44ab00fcd65:merged-pr:3477:00a8fe37a861723fc730417e8d78ab799123f207","mission_step_id":"21f64a19-5f26-4dd8-ad9c-8aac35cc07b3","command_center_event_id":"3e398a97-cf59-4472-ac68-d44ab00fcd65"},{"id":"6de04c2c-93f4-49bd-9f7c-18fe843543a3","source":"cc-execution","status":"recorded","payload":{"objective":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","tenantRef":"pcg","receivedAt":"2026-09-29T20:11:21.960Z","fingerprint":"d139b3caad93e4a26fea3ae7f81844f1854fa729e346b622edcde78a805c1e80","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":false,"objective":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","proofKinds":[],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","wordingChanged":false,"canonicalIntent":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"legacy_derived","version":1,"outcomes":[{"id":"outcome-1","statement":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","provenance":{"reason":null,"source":"current_request_inference","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","constraints":[{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"heuristic_current_objective","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"standard","blastRadius":"scoped"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"targeted","interactionRequired":false,"runtimeProofRequired":true},"scope":{"route":"/pcg/workspace","roleRef":null,"tenantRef":"pcg","sourceTargets":["src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx","src/pages/card-grading/PCGCompletionCenter.tsx","src/pages/card-grading/PCGBatchPublishingCenter.tsx"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"normal","deadlineSignals":[],"deadlineExplicit":false},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":["deadline"],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"parallel_non_overlapping_tenant_work","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["mobile"],"behavioral":false,"visualProofScope":"targeted"},"dependencies":{"requiredDomains":["frontend","provider_configuration"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["frontend"]},"inputSignals":{"rawUtterance":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","canonicalIntent":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batc","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batc","route":"/pcg/workspace","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Complete-the-owner-requested-PCG-revert-consistently-across-every-inner-route.-The-MODES-shell-is-da","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"591026320f27fb700acc862a836db6e92a3db33427d02dda1093c37048436e28","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:11:22.766151+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:8383247b-c3ec-459c-944c-0592b7b4e340:tenant-workstream-contribution:d139b3caad93e4a26fea3ae7f81844f1854fa729e346b622edcde78a805c1e80","mission_step_id":null,"command_center_event_id":"8383247b-c3ec-459c-944c-0592b7b4e340"},{"id":"e52832a1-deba-4551-ab35-20cd51da04df","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"00a8fe37a861723fc730417e8d78ab799123f207","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"semantic-invariants","satisfied":false,"statement":"Control-plane Gate validates release-dispatch semantics without exact optional-argument arity coupling, preventing this false-red class.","proofConditionIds":["repo-proof"]}],"satisfied":false,"constraints":[{"id":"safety-preserved","satisfied":false,"statement":"Keep all release-path safety semantics enforced; only remove brittle source-shape coupling.","proofConditionIds":["repo-proof"]},{"id":"capability-completeness","satisfied":false,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["repo-proof"]},{"id":"atomic-capability-lifecycle","satisfied":false,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["repo-proof"]}],"contractHash":"3a7d2b3d9f102720fdb2ac1b1dbdb40f82e2248306196181b99f87203f83bf79","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"repo-proof","kind":"repository","evidence":{"reason":"missing_required_release_targets:ccExecution","gateRunId":11032,"satisfied":false,"gateTestProof":null,"gateTestPassed":false,"missingTargets":["ccExecution"],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":null,"releaseTargetStates":{},"repositoryProofGate":"request_contract_repository_verified","repositoryProofPath":null,"requestContractHash":"3a7d2b3d9f102720fdb2ac1b1dbdb40f82e2248306196181b99f87203f83bf79","unsuccessfulTargets":[],"activeReleaseTargets":[],"allowedReleaseTargets":["ccExecution"],"repositoryProofStatus":"verified","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"repositoryConditionBound":true,"repositoryProofSourceSha":"00a8fe37a861723fc730417e8d78ab799123f207"},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["repository"],"activeReleaseTargets":[]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:24:32.037251+00:00","proof_gate":"request_contract_pending","source_sha":"00a8fe37a861723fc730417e8d78ab799123f207","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:3e398a97-cf59-4472-ac68-d44ab00fcd65:request-contract:3a7d2b3d9f102720fdb2ac1b1dbdb40f82e2248306196181b99f87203f83bf79:00a8fe37a861723fc730417e8d78ab799123f207:pending:repository","mission_step_id":"f2a144ef-72ff-4ba1-b3c6-9672012ca300","command_center_event_id":"3e398a97-cf59-4472-ac68-d44ab00fcd65"},{"id":"c84aff2a-0b28-4dc8-bd8f-e01409eb56a3","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-e97d125136df","writes":[],"patches":[],"approved":true,"missionId":"e97d1251-36df-46f7-b193-6bb6f4bb62b5","objective":"Continue the same terminal-step projection hardening mission after correcting the exact index-mission-control anchors. Preserve raw ledger history, project terminal accepted missions to effective verified owner-facing lifecycle states, add regression coverage, bump runtime identity, and ship only ccExecution.","sourceSha":"2da51587dfc680a8b153807d568ed2ce687953e0","repository":"noel/KnockLaunchOS","autoProgress":true,"ownerApproved":true,"anchored_edits":[{"path":"workers/cc-execution/src/mission-ledger.js","edits":[{"new_content":"export function ownerFacingMissionStepSummary(mission = {}) {\n  const steps = (Array.isArray(mission.stepSummary) ? mission.stepSummary : []).map((step) => ({ ...record(step) }));\n  if (mission.terminal !== true) return steps;\n  const acceptance = ownerMissionAcceptanceProgress(mission);\n  if (!acceptance.satisfied) return steps;\n\n  const context = record(mission.context);\n  const hasMergedSource = Boolean(text(mission.sourceSha || context.sourceSha, 100));\n  const releaseVerified = text(context.releaseState, 80).toLowerCase() === \"verified\";\n  const visualRequired = requestContractVisualProofRequired(context);\n  const contractProof = record(context.requestContractProof);\n  const visualVerified = context.verificationState === \"verified\" || contractProof.visualSatisfied === true;\n\n  return steps.map((step) => {\n    const key = text(step.key, 120).toLowerCase();\n    const historicalStatus = text(step.status, 80) || null;\n    let status = historicalStatus;\n    if (key === \"preflight\") status = \"verified\";\n    else if (key === \"implementation\" && hasMergedSource) status = \"verified\";\n    else if (key === \"pull_request\" && hasMergedSource) status = \"verified\";\n    else if (key === \"release\" && releaseVerified) status = \"verified\";\n    else if (key === \"runtime_proof\") status = \"verified\";\n    else if (key === \"visual_proof\") status = visualRequired ? (visualVerified ? \"verified\" : historicalStatus) : \"skipped\";\n    if (status === historicalStatus) return step;\n    return { ...step, status, historicalStatus, statusProjection: \"terminal_acceptance_verified\" };\n  });\n}\n\nexport function ownerMissionStallState(mission = {}, nowMs = Date.now()) {","old_content":"export function ownerMissionStallState(mission = {}, nowMs = Date.now()) {"}]},{"path":"workers/cc-execution/src/index-mission-control.js","edits":[{"new_content":"import { OWNER_PROGRESS_RECENT_LIMIT, OWNER_PROGRESS_SILENCE_BUDGET_MS, appendMissionReceipt, ensureMission, listActiveMissions, namedGateTestRequirement, ownerFacingMissionStepSummary, ownerMissionCheckpoint, ownerMissionNextSafeAction, ownerMissionProgressState, readMission, synchronizeRelease } from \"./mission-ledger.js\";","old_content":"import { OWNER_PROGRESS_RECENT_LIMIT, OWNER_PROGRESS_SILENCE_BUDGET_MS, appendMissionReceipt, ensureMission, listActiveMissions, namedGateTestRequirement, ownerMissionCheckpoint, ownerMissionNextSafeAction, ownerMissionProgressState, readMission, synchronizeRelease } from \"./mission-ledger.js\";"},{"new_content":"      ...detailed.data,\n      stepSummary: ownerFacingMissionStepSummary(detailed.data),\n      ownerFacingState: ownerFacingMissionState(detailed.data),","old_content":"      ...detailed.data,\n      ownerFacingState: ownerFacingMissionState(detailed.data),"},{"new_content":"      ...reconciled,\n      stepSummary: ownerFacingMissionStepSummary(reconciled),\n      ownerFacingState: ownerFacingMissionState(reconciled),\n      ownerCheckpoint: ownerMissionCheckpoint(reconciled),","old_content":"      ...reconciled,\n      ownerFacingState: ownerFacingMissionState(reconciled),\n      ownerCheckpoint: ownerMissionCheckpoint(reconciled),"},{"new_content":"    return json({ ...reconciled, stepSummary: ownerFacingMissionStepSummary(reconciled), ownerFacingState: ownerFacingMissionState(reconciled), ownerCheckpoint: ownerMissionCheckpoint(reconciled), ...ownerMissionProgressProjection(reconciled), reconciliationWarning: reconciliationWarning || {","old_content":"    return json({ ...reconciled, ownerFacingState: ownerFacingMissionState(reconciled), ownerCheckpoint: ownerMissionCheckpoint(reconciled), ...ownerMissionProgressProjection(reconciled), reconciliationWarning: reconciliationWarning || {"},{"new_content":"      ...reconciled,\n      stepSummary: ownerFacingMissionStepSummary(reconciled),\n      ownerFacingState: ownerFacingMissionState(reconciled),\n      ownerCheckpoint: ownerMissionCheckpoint(reconciled),\n      ...ownerMissionProgressProjection(reconciled),\n      compactTerminalSummary: {","old_content":"      ...reconciled,\n      ownerFacingState: ownerFacingMissionState(reconciled),\n      ownerCheckpoint: ownerMissionCheckpoint(reconciled),\n      ...ownerMissionProgressProjection(reconciled),\n      compactTerminalSummary: {"},{"new_content":"  return json({ ...reconciled, stepSummary: ownerFacingMissionStepSummary(reconciled), ownerFacingState: ownerFacingMissionState(reconciled), ownerCheckpoint: ownerMissionCheckpoint(reconciled), ownerWaitSloMs: ownerWaitSloMs(reconciled), ...ownerMissionProgressProjection(reconciled) }, 202);","old_content":"  return json({ ...reconciled, ownerFacingState: ownerFacingMissionState(reconciled), ownerCheckpoint: ownerMissionCheckpoint(reconciled), ownerWaitSloMs: ownerWaitSloMs(reconciled), ...ownerMissionProgressProjection(reconciled) }, 202);"}]},{"path":"workers/cc-execution/src/version.js","edits":[{"new_content":"export const CC_EXECUTION_VERSION = \"1.58.220-terminal-step-projection\";","old_content":"export const CC_EXECUTION_VERSION = \"1.58.219-contract-release-target-forwarding\";"}]},{"path":"workers/cc-execution/test/release-orchestration-invariants.test.js","edits":[{"new_content":"import { appendMissionReceipt, durableMissionKey, ensureMission, namedGateTestRequirement, ownerFacingMissionStepSummary, ownerMissionAcceptanceProgress, ownerMissionCheckpoint, ownerMissionNextSafeAction, ownerMissionStallState, readMission, requestContractProofState, requestContractVisualProofRequired, selectVerifiedRepositoryReceipt, verifiedReleaseReceiptMatchesContract } from \"../src/mission-ledger.js\";","old_content":"import { appendMissionReceipt, durableMissionKey, ensureMission, namedGateTestRequirement, ownerMissionAcceptanceProgress, ownerMissionCheckpoint, ownerMissionNextSafeAction, ownerMissionStallState, readMission, requestContractProofState, requestContractVisualProofRequired, selectVerifiedRepositoryReceipt, verifiedReleaseReceiptMatchesContract } from \"../src/mission-ledger.js\";"},{"new_content":"test(\"terminal accepted missions project superseded failed steps to effective verified owner status\", () => {\n  const mission = {\n    terminal: true,\n    sourceSha: \"2da51587dfc680a8b153807d568ed2ce687953e0\",\n    stepSummary: [\n      { key: \"preflight\", status: \"verified\" },\n      { key: \"implementation\", status: \"failed\" },\n      { key: \"pull_request\", status: \"skipped\" },\n      { key: \"release\", status: \"skipped\" },\n      { key: \"runtime_proof\", status: \"verified\" },\n      { key: \"visual_proof\", status: \"skipped\" },\n    ],\n    context: {\n      releaseState: \"verified\",\n      verificationState: null,\n      requestContract: { version: 1, proofConditions: [{ id: \"repo-proof\", required: true, kind: \"repository\" }] },\n      requestContractProof: { conditionResults: [{ id: \"repo-proof\", satisfied: true }], visualSatisfied: true },\n    },\n  };\n  const projected = ownerFacingMissionStepSummary(mission);\n  assert.equal(projected.find((step) => step.key === \"implementation\").status, \"verified\");\n  assert.equal(projected.find((step) => step.key === \"implementation\").historicalStatus, \"failed\");\n  assert.equal(projected.find((step) => step.key === \"pull_request\").status, \"verified\");\n  assert.equal(projected.find((step) => step.key === \"release\").status, \"verified\");\n  assert.equal(projected.find((step) => step.key === \"visual_proof\").status, \"skipped\");\n  assert.equal(mission.stepSummary.find((step) => step.key === \"implementation\").status, \"failed\");\n});\n\ntest(\"corrective release generations carry every still-unverified target forward\", () => {","old_content":"test(\"corrective release generations carry every still-unverified target forward\", () => {"}]}],"implementation":{"files":[],"writes":[]},"controlPlaneUnfreeze":true,"durableMutationResume":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/mission-ledger.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"controlPlaneMaintenanceReason":"Same authorized false-red terminal mission projection hardening; previous attempt failed only because index-mission-control import/response anchors were stale."},"recovery":false,"fingerprint":"00411245501c8c1a7a10b5202f01e8e119225dc146f240a4e2a90e25952d23b3","replayCount":0,"serializedBytes":9130},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:35:17.899895+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:e97d1251-36df-46f7-b193-6bb6f4bb62b5:repository-mutation-intent:00411245501c8c1a7a10b5202f01e8e119225dc146f240a4e2a90e25952d23b3:0","mission_step_id":"64b398cd-1ba9-4808-9eeb-114220b0d621","command_center_event_id":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},{"id":"e0eaa051-a01d-48d7-a10b-0e2bd46ee9bc","source":"cc-execution","status":"waiting","payload":{"kind":"heartbeat","message":"Still active in release.","nextAction":{"lane":"production-release-conductor","action":"reconcile_release","reason":"merged_source_requires_release_proof","automationAllowed":true,"ownerActionRequired":false},"silenceBudgetMs":15000,"semanticCheckpointSignature":"{\"stateMachineVersion\":1,\"phase\":\"release\",\"ownerFacingState\":null,\"latest\":{\"kind\":\"receipt\",\"key\":\"canonical_release_status\",\"status\":\"pending\",\"proofGate\":\"canonical_release_pending\"},\"activeStep\":{\"key\":\"preflight\",\"status\":\"ready\",\"lane\":\"cc-execution\"},\"nextStep\":{\"key\":\"pull_request\",\"status\":\"ready\",\"lane\":\"cc-execution\"},\"nextSafeAction\":{\"action\":\"reconcile_release\",\"lane\":\"production-release-conductor\",\"reason\":\"merged_source_requires_release_proof\",\"automationAllowed\":true,\"ownerActionRequired\":false},\"acceptance\":{\"total\":2,\"verified\":0,\"pending\":2,\"percent\":0,\"satisfied\":false,\"verifiedIds\":[],\"pendingIds\":[\"proof-production\",\"proof-visual\"]},\"stall\":{\"stalled\":false,\"reason\":\"within_deadline\",\"step\":\"release\",\"deadlineAt\":\"2026-09-23T05:35:36.426776+00:00\",\"recoveryAction\":null},\"blocker\":null,\"terminal\":false,\"branch\":\"ai/objective-first-repair-a3866c7d0884\",\"prNumber\":3479,\"sourceSha\":\"0c4fdc3b653d6ccf3fb8b437a37a6ff1f3fe30e3\",\"deploymentId\":\"forgejo-main-0c4fdc3b653d\"}"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:36:16.578613+00:00","proof_gate":"owner_progress_heartbeat","source_sha":null,"external_id":null,"receipt_type":"owner_progress_heartbeat","idempotency_key":"mission:a3866c7d-0884-49f1-a995-957f59fb63d3:owner-progress-heartbeat:119342065","mission_step_id":"3af96de5-eb7e-45f1-8b0e-931d1f269813","command_center_event_id":"a3866c7d-0884-49f1-a995-957f59fb63d3"},{"id":"0f18c0af-9d9b-47a6-b738-b2b356ec2ca9","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"objective_received","branch":null,"reason":"branch_must_start_with_ai","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.180-forgejo-source-read-resilience","prNumber":null,"terminal":false,"missionId":"2a62ee39-ed80-4917-a7e9-fdb4ddf5b469","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":0,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":670,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":670,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":670,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":670,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"2a62ee39-ed80-4917-a7e9-fdb4ddf5b469"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1293,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:20:27.345642+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:2a62ee39-ed80-4917-a7e9-fdb4ddf5b469:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"966a438d-381e-45f9-8c69-b65930ccc7c2","command_center_event_id":"2a62ee39-ed80-4917-a7e9-fdb4ddf5b469"},{"id":"8d70a0b5-0e9f-450d-ae2b-ce0934ff3fef","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","frontend-cloudflare/live":"pending","supabase-migrations/live":"pending","supabase-edge-production/live":"pending"},"mainSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","missing":[],"pending":["forgejo-release/workflow","supabase-edge-production/live","frontend-cloudflare/live","supabase-migrations/live"],"required":["forgejo-main/source","forgejo-release/workflow","supabase-edge-production/live","frontend-cloudflare/live","supabase-migrations/live"],"sourceSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":true,"onrunner":false,"migrations":true,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["documents","generate-tarping-invoice-pdf","invoices","invoices-manage"]},"releaseTargetStates":{"frontend":"pending","migrations":"pending","supabaseEdge":"pending"},"requestContractHash":"2e871c1827f233b3c5f9cfe281c4faf89a5a38e34a4ae5332044eebb4c3d345b","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9302","runId":9302,"status":"running","sourceSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"frontend":"pending","migrations":"pending","supabaseEdge":"pending"},"targetJobCount":7,"observedTargetStates":{"frontend":"pending","migrations":"pending","supabaseEdge":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:28:23.970455+00:00","proof_gate":"canonical_release_pending","source_sha":"4faa48a4a6e81063cf997425f9c23f885d553b93","external_id":"forgejo-main-4faa48a4a6e8","receipt_type":"canonical_release_status","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:forgejo-release-status:4faa48a4a6e81063cf997425f9c23f885d553b93:pending:forgejo-main/source=success|forgejo-release/workflow=pending|supabase-edge-production/live=pending|frontend-cloudflare/live=pending|supabase-migrations/live=pending","mission_step_id":"00f1b85f-fe8e-47ff-8178-a9565502a840","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"948f51ff-63af-4d1a-92e4-330921ebb6af","source":"cc-execution","status":"in_progress","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/objective-first-repair-bf688521a4b8","reason":null,"status":"in_progress","metrics":{"receiptBytes":0,"releaseCount":1,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3033,"terminal":false,"missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee","operation":"automatic_mission_resume","proofGate":"canonical_release_reconciliation_pending","sourceSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","timingsMs":{"prReadinessMs":430,"approvedPlanMs":0,"shipAndProveMs":4246,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request automatically; do not create replacement work.","receiptRef":{"mode":"full","missionId":"bf688521-a4b8-4905-b11a-dd615cf361ee"},"performance":null,"deploymentId":"forgejo-main-4faa48a4a6e8","releaseState":"pending","workflowRunId":9302,"releaseTargets":{"frontend":true,"onrunner":false,"migrations":true,"ccExecution":false,"supabaseEdge":true,"edgeFunctionSlugs":["documents","generate-tarping-invoice-pdf","invoices","invoices-manage"]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":793,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:28:50.89394+00:00","proof_gate":"canonical_release_reconciliation_pending","source_sha":null,"external_id":"3033","receipt_type":"automatic_mission_resume","idempotency_key":"mission:bf688521-a4b8-4905-b11a-dd615cf361ee:automatic-mission-resume:3033:canonical_release_reconciliation_pending","mission_step_id":"f1612680-04c1-4f5b-8101-7214199f1206","command_center_event_id":"bf688521-a4b8-4905-b11a-dd615cf361ee"},{"id":"3ff0611f-a65f-416c-9135-1dd63e8305da","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"c6b5123cc0f0c9e0e809486585323cbb7a50cc582aad2c65902a7ece8d75dcd2","forgejoWorkflowProof":{"runId":9309,"source":"signed_push_receipt","status":"success","results":{},"conclusion":"success","targetStates":{"ccExecution":"success"},"targetJobCount":7,"observedTargetStates":{"ccExecution":"success"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-0895ede911fc028e7f9af15056bdc73b8ae29503","compareStatus":"target_job_success_runtime_verified","workflowRunId":9309,"identitySource":"canonical_release_target_job","runtimeVersion":"1.58.180-forgejo-source-read-resilience","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:45:55.715463+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"0895ede911fc028e7f9af15056bdc73b8ae29503","external_id":"forgejo-main-0895ede911fc","receipt_type":"canonical_release_status","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:forgejo-release-status:0895ede911fc028e7f9af15056bdc73b8ae29503:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"65cb9cde-2752-48f3-9097-eee6f8d3ef89","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"46623230-82f0-408f-88eb-4ba2288c51f3","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"objective_received","branch":null,"reason":"branch_must_start_with_ai","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.180-forgejo-source-read-resilience","prNumber":null,"terminal":false,"missionId":"176c19aa-3e71-43cf-bc90-851d893ba5f7","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":0,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":1637,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1637,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1637,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1637,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"176c19aa-3e71-43cf-bc90-851d893ba5f7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1296,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:32:49.549273+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:176c19aa-3e71-43cf-bc90-851d893ba5f7:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"4e948496-4b25-4e90-83a6-a06a1eefa99b","command_center_event_id":"176c19aa-3e71-43cf-bc90-851d893ba5f7"},{"id":"edc9651d-9390-4362-b4e4-6cee34997dd2","source":"cc-execution","status":"recorded","payload":{"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Correct the exact same owner-authorized hydration line after strict Gate proved the existing release invariant requires the contiguous sequence `index.html src public vite.config.ts`. Preserve that sequence and move the added supabase/functions/_shared/tenantTypeRegistry.json path later in the same release-frontend fallback sparse-checkout command. No other changes.","wordingChanged":false,"canonicalIntent":"Correct the exact same owner-authorized hydration line after strict Gate proved the existing release invariant requires the contiguous sequence `index.html src public vite.config.ts`. Preserve that sequence and move the added supabase/functions/_shared/tenantTypeRegistry.json path later in the same release-frontend fallback sparse-checkout command. No other changes.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"complete-hydration","statement":"The release-frontend fallback sparse checkout includes supabase/functions/_shared/tenantTypeRegistry.json without altering the invariant-tested existing path sequence.","proofConditionIds":["repository-proof","gate-proof","release-proof"]}],"objective":"Correct the exact same owner-authorized hydration line after strict Gate proved the existing release invariant requires the contiguous sequence `index.html src public vite.config.ts`. Preserve that sequence and move the added supabase/functions/_shared/tenantTypeRegistry.json path later in the same release-frontend fallback sparse-checkout command. No other changes.","constraints":[{"id":"bounded-workflow-scope","statement":"Only .forgejo/workflows/knocklaunch.yml changes and only ordering of the single added hydration path is adjusted.","proofConditionIds":["repository-proof"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["repository-proof","gate-proof","release-proof"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["repository-proof","gate-proof","release-proof"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"repository-proof","kind":"repository","claim":"Fallback sparse checkout includes tenantTypeRegistry.json and preserves `index.html src public vite.config.ts`.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"gate-proof","kind":"runtime","claim":"Strict canonical Gate passes on the corrected exact head.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"release-proof","kind":"runtime","claim":"Protected-main frontend release builds without tenantTypeRegistry.json module resolution failure.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Correct-the-exact-same-owner-authorized-hydration-line-after-strict-Gate-proved-the-existing-release","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["repository-proof","gate-proof","release-proof"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestContractHash":"d5979929b1bd4175cf780fda0ec233c27f92d95f2896463af32567040c8f4f4a","requestContractRevision":3,"previousRequestContractHash":"14f11341ce77e7dd2495f9ef1f21baa11353f2ae7efd2a234cf7cedb070bbefd"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:46:16.877925+00:00","proof_gate":"request_contract_revision_recorded","source_sha":null,"external_id":null,"receipt_type":"request_contract_revision","idempotency_key":"mission:b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9:request-contract:d5979929b1bd4175cf780fda0ec233c27f92d95f2896463af32567040c8f4f4a","mission_step_id":"4e86d8d6-2499-4c73-a667-ecfc6b195b9c","command_center_event_id":"b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9"},{"id":"948d6039-261c-4bc7-b3c3-a0b203a9f87a","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-786ea34cda53","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":119,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":711,"providerAuthMs":0,"ledgerPrepareMs":711,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":711,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":711,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":5429,"likelyAffectedFiles":["src/PrivateAppShell.tsx","config/capabilities/tenant-brand-character.json","config/capabilities/tenant-type-registry.json","config/capabilities/tenant-workspace-experience.json","config/capabilities/tenant-workspace-search.json","config/capabilities/tenant-workspace-ui-contract-v2.json","scripts/visual-witness-hosted-runner/src/server-tenant-projection.mjs","scripts/visual-witness-hosted-runner/src/tenant-owner-preflight.mjs","config/capabilities/tenant-bootstrap.json","config/capabilities/tenant-creation.json","config/capabilities/tenant-type-platform-primitive.json","config/contracts/PREHISTORIC-001-TENANT-MEDIA.json"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:36:02.821842+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:786ea34c-da53-4b4c-8634-96ca6c310fdf:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"567714de-34ff-4bc7-a07c-15883b74af27","command_center_event_id":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},{"id":"e60845c2-2cda-44b4-a01d-dbd70d4e98cd","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-443096a42ca9","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"443096a4-2ca9-48e9-bc2b-620da04f5fe7","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":364,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":1132,"providerAuthMs":0,"ledgerPrepareMs":1132,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1132,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":1132,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"443096a4-2ca9-48e9-bc2b-620da04f5fe7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":7361,"likelyAffectedFiles":["src/lib/proposals/proposalEngine.ts","src/lib/auth/persistedSession.ts"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:37:45.876962+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:443096a4-2ca9-48e9-bc2b-620da04f5fe7:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"95051009-8e73-41c9-acef-4a29192e8841","command_center_event_id":"443096a4-2ca9-48e9-bc2b-620da04f5fe7"},{"id":"2f95ee26-0f50-46cd-a548-2a87085b6662","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-786ea34cda53","reason":"anchored_edit_anchor_not_unique:src/components/CRMUserMenu.tsx","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":2869,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":2869,"missionSetupMs":1557,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1557,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":1557,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1557,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1509,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:37:54.558539+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:786ea34c-da53-4b4c-8634-96ca6c310fdf:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"c0855d37-a924-4732-bd57-8bcd3ecdc983","command_center_event_id":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},{"id":"16f25eca-6e98-4639-bc4c-71c317900f79","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":true,"statement":"Forgejo large-file source fetch reliability is repaired in the shared Command Center source reader while preserving exact-SHA reads, single-flight, immutable edge cache, SHA verification, caller-supplied tighter budgets, and the 4 MiB cap; focused regressions cover retryable recovery, single-flight, oversize fail-closed behavior, and non-retryable responses; the capability contract matches the implementation; cc-execution is deployed and a representative exact repository_inspect source fetch succeeds.","proofConditionIds":["proof-production"]}],"satisfied":true,"constraints":[{"id":"scope","satisfied":true,"statement":"Change only the shared Command Center Forgejo source-read reliability implementation, its focused regression test, runtime version marker, and control-plane capability contract.","proofConditionIds":["proof-production"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"c6b5123cc0f0c9e0e809486585323cbb7a50cc582aad2c65902a7ece8d75dcd2","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"ccExecution":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["ccExecution"],"allowedReleaseTargets":[],"requiredReleaseTargets":["ccExecution"],"migrationReleaseVerified":null,"releaseRequestContractHash":"c6b5123cc0f0c9e0e809486585323cbb7a50cc582aad2c65902a7ece8d75dcd2"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["ccExecution"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":2},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:45:58.32833+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"0895ede911fc028e7f9af15056bdc73b8ae29503","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:request-contract:c6b5123cc0f0c9e0e809486585323cbb7a50cc582aad2c65902a7ece8d75dcd2:0895ede911fc028e7f9af15056bdc73b8ae29503:verified:","mission_step_id":"65cb9cde-2752-48f3-9097-eee6f8d3ef89","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"2824e77b-036f-4196-9782-1f095fcb5936","source":"cc-execution","status":"recorded","payload":{"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Unfreeze control plane for the owner-authorized canonical Gate hydration repair. Complete only the missing tenantTypeRegistry.json hydration in the release-frontend fallback sparse checkout of .forgejo/workflows/knocklaunch.yml.","wordingChanged":false,"canonicalIntent":"Unfreeze control plane for the owner-authorized canonical Gate hydration repair. Complete only the missing tenantTypeRegistry.json hydration in the release-frontend fallback sparse checkout of .forgejo/workflows/knocklaunch.yml.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"complete-hydration","statement":"The production release-frontend fallback sparse checkout hydrates supabase/functions/_shared/tenantTypeRegistry.json so the production Vite build can resolve src/lib/tenants/tenantTypeRegistry.ts.","proofConditionIds":["repository-proof","gate-proof","release-proof"]}],"objective":"Unfreeze control plane for the owner-authorized canonical Gate hydration repair. Complete only the missing tenantTypeRegistry.json hydration in the release-frontend fallback sparse checkout of .forgejo/workflows/knocklaunch.yml.","constraints":[{"id":"bounded-workflow-scope","statement":"Only .forgejo/workflows/knocklaunch.yml changes and only the one missing sparse-checkout path is added; no other workflow logic, application source, data, auth, merge, Gate, or release ownership changes.","proofConditionIds":["repository-proof"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["repository-proof","gate-proof","release-proof"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["repository-proof","gate-proof","release-proof"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"repository-proof","kind":"repository","claim":"The release-frontend fallback sparse checkout contains supabase/functions/_shared/tenantTypeRegistry.json on the exact repair head.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"gate-proof","kind":"runtime","claim":"Strict canonical KnockLaunch Gate passes on the exact repair head.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"release-proof","kind":"runtime","claim":"A protected-main frontend release completes without the tenantTypeRegistry.json module-resolution failure.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Unfreeze-control-plane-for-the-owner-authorized-canonical-Gate-hydration-repair.-Complete-only-the-m","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["repository-proof","gate-proof","release-proof"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestContractHash":"14f11341ce77e7dd2495f9ef1f21baa11353f2ae7efd2a234cf7cedb070bbefd","requestContractRevision":2,"previousRequestContractHash":"f0dd9634b8cfd755c0a0dcd1aef2f02a7c5945b1c6a896b12b8814d0376eec8b"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:44:55.996808+00:00","proof_gate":"request_contract_revision_recorded","source_sha":null,"external_id":null,"receipt_type":"request_contract_revision","idempotency_key":"mission:b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9:request-contract:14f11341ce77e7dd2495f9ef1f21baa11353f2ae7efd2a234cf7cedb070bbefd","mission_step_id":"4e86d8d6-2499-4c73-a667-ecfc6b195b9c","command_center_event_id":"b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9"},{"id":"9b8f58d4-8472-463f-baaf-b89d8910e296","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-72771f9aaa4f","prNumber":3040,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"2a7d1692a08c34fb3d9155bd45653c5fabde2307","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:28:49.028797+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"2a7d1692a08c34fb3d9155bd45653c5fabde2307","external_id":"3040","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:72771f9a-aa4f-4ee9-af5d-e668cf3d8540:merged-pr:3040:2a7d1692a08c34fb3d9155bd45653c5fabde2307","mission_step_id":"b74223ad-8f22-4e52-af6e-906404d67368","command_center_event_id":"72771f9a-aa4f-4ee9-af5d-e668cf3d8540"},{"id":"833aeea2-af31-4fe9-a78d-799a34dfd389","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-80a641a96336","prNumber":3473,"nextAction":null,"mergeCommitSha":"a55dfd793c19729b8ac5ce2713412b614eae99f3","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:08:37.909359+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"a55dfd793c19729b8ac5ce2713412b614eae99f3","external_id":"3473","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:80a641a9-6336-4d0e-8b9e-6207e8751773:merged-pr:3473:a55dfd793c19729b8ac5ce2713412b614eae99f3","mission_step_id":"b7a70dcc-6657-422a-ae7f-8d0673da2ca2","command_center_event_id":"80a641a9-6336-4d0e-8b9e-6207e8751773"},{"id":"63f31e3b-df8e-48b9-9687-d93fe0336da4","source":"cc-execution","status":"blocked","payload":{"reason":"anchored_edit_anchor_not_unique:workers/cc-execution/src/index-mission-control.js","fingerprint":"00411245501c8c1a7a10b5202f01e8e119225dc146f240a4e2a90e25952d23b3"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-23T02:35:20.59303+00:00","proof_gate":"repository_mutation_intent_deterministic_failure","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent_blocked","idempotency_key":"mission:e97d1251-36df-46f7-b193-6bb6f4bb62b5:repository-mutation-intent-blocked:00411245501c8c1a7a10b5202f01e8e119225dc146f240a4e2a90e25952d23b3","mission_step_id":"64b398cd-1ba9-4808-9eeb-114220b0d621","command_center_event_id":"e97d1251-36df-46f7-b193-6bb6f4bb62b5"},{"id":"3f304dbc-f263-4d5e-b4be-413960234afd","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-443096a42ca9","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3036,"terminal":false,"missionId":"443096a4-2ca9-48e9-bc2b-620da04f5fe7","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":8092,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1487,"missionSetupMs":528,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":528,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":528,"repositoryMutationMs":6605,"repositoryProviderMs":6605,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":2730,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":528,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":3875},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"443096a4-2ca9-48e9-bc2b-620da04f5fe7"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3308,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:38:53.850677+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3036","receipt_type":"execute_mission","idempotency_key":"mission:443096a4-2ca9-48e9-bc2b-620da04f5fe7:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"8e386715-4c95-49cf-befb-83a132dd647e","command_center_event_id":"443096a4-2ca9-48e9-bc2b-620da04f5fe7"},{"id":"f79a0963-f402-4497-b57e-2bac32065b7a","source":"cc-execution","status":"retryable","payload":{"ok":false,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-786ea34cda53","reason":"auto_progress_pr_read_failed:The operation was aborted due to timeout","status":"retryable","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3035,"terminal":false,"missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf","operation":"execute_mission","proofGate":"repair_mission_auto_progress_authorization_retryable","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4000,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":1658,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":634,"ledgerReconcileMs":0,"lineageReconcileMs":1024,"resolvePreflightMs":1658,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":634,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request automatically; do not create a replacement branch or PR.","receiptRef":{"mode":"full","missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1492,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:39:02.928157+00:00","proof_gate":"repair_mission_auto_progress_authorization_retryable","source_sha":null,"external_id":"3035","receipt_type":"execute_mission","idempotency_key":"mission:786ea34c-da53-4b4c-8634-96ca6c310fdf:execute_mission:repair_mission_auto_progress_authorization_retryable:current-generation","mission_step_id":"c0855d37-a924-4732-bd57-8bcd3ecdc983","command_center_event_id":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},{"id":"f71c5680-0a97-4d69-a7a7-fd5be5cd9ebd","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-94dc4229b32e","reason":"control_plane_maintenance_authorization_required","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":0,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":0,"missionSetupMs":1065,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":876,"ledgerReconcileMs":0,"lineageReconcileMs":189,"resolvePreflightMs":1065,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":876,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1599,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:29:55.472243+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"250f27d9-98da-487b-b7d3-449eadcacee6","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"44a71716-38fb-484b-959d-dc7d6b328cee","source":"cc-execution","status":"verified","payload":{"ownerWaitSloMs":{"merge_to_live_ms":null,"owner_action_to_pr_ms":null,"green_gate_to_merge_ms":null,"owner_action_to_useful_response_ms":null},"ownerWaitLiveAt":"2026-09-17T20:56:32.851Z"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:56:33.77635+00:00","proof_gate":"owner_wait_live_milestone_recorded","source_sha":null,"external_id":null,"receipt_type":"owner_wait_live_milestone","idempotency_key":"mission:443096a4-2ca9-48e9-bc2b-620da04f5fe7:owner-wait-live","mission_step_id":"1236a1dd-d25e-4672-934a-898026060f94","command_center_event_id":"443096a4-2ca9-48e9-bc2b-620da04f5fe7"},{"id":"65931a8b-3e09-488f-b7c3-dda628d07df9","source":"cc-execution","status":"authorized","payload":{"paths":[".forgejo/workflows/knocklaunch.yml"],"reason":"Owner explicitly said: I permit yout to unfreeze the control plane for the canonical Gate hydration repair. The same missing tenantTypeRegistry.json dependency remains omitted from the release-frontend fallback hydration in the same canonical workflow.","baseSha":"4b3a65455071a9d148dd9254d6660d786c44d2ce","issuedAt":1789681498373,"expiresAt":1789681678373,"missionId":"b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9","authorizationId":"72e12e66-d35b-4bcf-ae45-8e11b07ae7f1","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T21:44:59.907851+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"4b3a65455071a9d148dd9254d6660d786c44d2ce","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:72e12e66-d35b-4bcf-ae45-8e11b07ae7f1","mission_step_id":"01dc404b-c420-4824-b64a-671012db74d4","command_center_event_id":"b12df2e2-d4e9-4369-abcd-4df0cf3e7fb9"},{"id":"353dfc72-5d2e-464b-bb46-ba2bf0dc22d8","source":"cc-execution","status":"waiting","payload":{"kind":"heartbeat","message":"Still active in objective received.","nextAction":{"lane":"cc-execution","action":"resolve_preflight","reason":"durable_state:preflight","automationAllowed":false,"ownerActionRequired":false},"silenceBudgetMs":15000,"semanticCheckpointSignature":"{\"stateMachineVersion\":1,\"phase\":\"objective_received\",\"ownerFacingState\":null,\"latest\":null,\"activeStep\":{\"key\":\"preflight\",\"status\":\"ready\",\"lane\":\"cc-execution\"},\"nextStep\":{\"key\":\"implementation\",\"status\":\"pending\",\"lane\":\"cc-execution\"},\"nextSafeAction\":{\"action\":\"resolve_preflight\",\"lane\":\"cc-execution\",\"reason\":\"durable_state:preflight\",\"automationAllowed\":false,\"ownerActionRequired\":false},\"acceptance\":{\"total\":6,\"verified\":0,\"pending\":6,\"percent\":0,\"satisfied\":false,\"verifiedIds\":[],\"pendingIds\":[\"preflight\",\"implementation\",\"pull_request\",\"release\",\"runtime_proof\",\"visual_proof\"]},\"stall\":{\"stalled\":true,\"reason\":\"step_deadline_exceeded\",\"step\":\"preflight\",\"deadlineAt\":\"2026-08-04T15:12:58.580893+00:00\",\"recoveryAction\":\"resolve_preflight\"},\"blocker\":null,\"terminal\":false,\"branch\":null,\"prNumber\":null,\"sourceSha\":null,\"deploymentId\":null}"},"tenant_id":"a2929648-19db-46c8-9e93-07378ed1aa5f","created_at":"2026-09-20T22:44:01.143757+00:00","proof_gate":"owner_progress_heartbeat","source_sha":null,"external_id":null,"receipt_type":"owner_progress_heartbeat","idempotency_key":"mission:c252aaa4-7d46-408c-a2db-621c9d7a989a:owner-progress-heartbeat:119329616","mission_step_id":"18afcbcd-4636-4cef-b471-c9b804280360","command_center_event_id":"c252aaa4-7d46-408c-a2db-621c9d7a989a"},{"id":"9c8967e7-e8b0-4a45-997c-b4aa022bf040","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-af2b80659f26","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":null,"terminal":false,"missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":318,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":2401,"providerAuthMs":0,"ledgerPrepareMs":2401,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":2401,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":2401,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":6530,"likelyAffectedFiles":["src/lib/tenants/tenantTypeRegistry.ts","supabase/functions/_shared/tenantTypeRegistry.json","supabase/functions/_shared"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:41:04.599539+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"b8d95f63-19ec-4912-837e-c81c8f1c9930","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"54c37373-47d6-434f-9c38-a83bc27e5513","source":"cc-execution","status":"authorized","payload":{"paths":["config/control-plane-capabilities.json","workers/cc-execution/src/forgejo-provider.js","workers/cc-execution/src/version.js","workers/cc-execution/test/forgejo-provider-singleflight.test.js"],"reason":"Owner explicitly unfreezes the control plane to repair the proven Forgejo large-file source fetch reliability defect in the shared Command Center source reader.","baseSha":"4faa48a4a6e81063cf997425f9c23f885d553b93","issuedAt":1789677765029,"expiresAt":1789677945029,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","authorizationId":"2ca80200-9793-4e66-8a48-86bb8dfdd94a","retryableWithinExactScope":true},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:42:47.294443+00:00","proof_gate":"control_plane_maintenance_scope_authorized","source_sha":"4faa48a4a6e81063cf997425f9c23f885d553b93","external_id":null,"receipt_type":"control_plane_maintenance_authorization","idempotency_key":"control-plane-maintenance-authorize:2ca80200-9793-4e66-8a48-86bb8dfdd94a","mission_step_id":"ef1520c7-57b8-42f1-ab72-9855ec94a11c","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"2293aac4-315a-49d6-ad17-92ccda2dec01","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-e6e7a510db4d","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":9120,"releaseCount":0,"toolCallCount":1,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":"2026-09-24T05:58:26.029Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.244-gate-outcome-classification","prNumber":3600,"terminal":false,"missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":6405,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":1646,"missionSetupMs":462,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":462,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":462,"repositoryMutationMs":4759,"repositoryProviderMs":4759,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":3041,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":462,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":1718},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3827,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:33.659847+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3600","receipt_type":"execute_mission","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"2f29ba64-e48f-40bf-a66f-5a613953a150","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"52ed6cab-65f9-45ee-99ac-27c586ecad39","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-94dc4229b32e","prNumber":3037,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:44:25.638999+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"0895ede911fc028e7f9af15056bdc73b8ae29503","external_id":"3037","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:merged-pr:3037:0895ede911fc028e7f9af15056bdc73b8ae29503","mission_step_id":"c301da23-0af8-4ccc-93fa-3db5f5d438dc","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"5fe1b688-e408-460b-9016-533518d6b5d2","source":"durable-mission-ledger","status":"pending","payload":{"sourceSha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-hydration","satisfied":false,"statement":"Targeted frontend KnockLaunch Gate hydrates the existing shared tenant type registry JSON before TypeScript semantic validation.","proofConditionIds":["proof-repository","proof-gate"]}],"satisfied":false,"constraints":[{"id":"bounded-scope","satisfied":false,"statement":"No source changes beyond the already-gated .forgejo/workflows/knocklaunch.yml repair.","proofConditionIds":["proof-repository"]},{"id":"preserve-gate-authority","satisfied":false,"statement":"Canonical KnockLaunch Gate remains the single PR Gate and release ownership remains unchanged.","proofConditionIds":["proof-gate"]},{"id":"capability-completeness","satisfied":false,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-repository","proof-gate"]},{"id":"atomic-capability-lifecycle","satisfied":false,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-repository","proof-gate"]}],"contractHash":"ba2e889b195d877d3ef2e88f75341af6f7564ee76c847e51354463076d8436a5","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"proof-repository","kind":"repository","evidence":{"reason":null,"gateRunId":null,"satisfied":true,"gateTestProof":null,"gateTestPassed":false,"missingTargets":[],"gateTestExecuted":false,"disallowedTargets":[],"migrationRequired":false,"namedGateTestPath":null,"releaseTargetStates":{},"repositoryProofGate":null,"repositoryProofPath":null,"requestContractHash":"ba2e889b195d877d3ef2e88f75341af6f7564ee76c847e51354463076d8436a5","unsuccessfulTargets":[],"activeReleaseTargets":[],"allowedReleaseTargets":[],"repositoryProofStatus":"required","expectedRepositoryPath":null,"namedGateTestSatisfied":true,"requiredReleaseTargets":[],"migrationReleaseVerified":null,"repositoryConditionBound":false,"repositoryProofSourceSha":null},"required":true,"satisfied":false},{"id":"proof-gate","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{},"unsuccessfulTargets":[],"activeReleaseTargets":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"ba2e889b195d877d3ef2e88f75341af6f7564ee76c847e51354463076d8436a5"},"required":true,"satisfied":false}],"validationErrors":[],"pendingProofKinds":["repository","runtime"],"activeReleaseTargets":[]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":3},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:48:41.23668+00:00","proof_gate":"request_contract_pending","source_sha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:request-contract:ba2e889b195d877d3ef2e88f75341af6f7564ee76c847e51354463076d8436a5:55bb3260a414fc2fdaeed341295ddb4d6ed17f9f:pending:repository,runtime","mission_step_id":"d0fc057f-e323-4ee9-97ef-5fea518bbde9","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"7e931735-269d-4d37-aee5-8d6546856f79","source":"cc-execution","status":"retryable","payload":{"ok":false,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-eebc422bda9f","reason":"pull_request_checks_failed","status":"retryable","metrics":{"receiptBytes":32351,"releaseCount":0,"toolCallCount":10,"repeatedCallCount":5,"executorlessWaitMs":739915,"firstUsefulResultAt":"2026-09-24T17:36:42.599Z","recoveryAttemptCount":1,"ownerInterruptionCount":0},"version":null,"prNumber":3649,"terminal":false,"missionId":"eebc422b-da9f-4a84-9518-15f7f7162ff9","operation":"automatic_mission_resume","proofGate":"repair_mission_pr_ready_retryable","sourceSha":null,"timingsMs":{"prReadinessMs":712,"approvedPlanMs":0,"shipAndProveMs":0,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request automatically; do not create a replacement branch or PR.","receiptRef":{"mode":"full","missionId":"eebc422b-da9f-4a84-9518-15f7f7162ff9"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1359,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T17:49:02.571592+00:00","proof_gate":"repair_mission_pr_ready_retryable","source_sha":null,"external_id":"3649","receipt_type":"automatic_mission_resume","idempotency_key":"mission:eebc422b-da9f-4a84-9518-15f7f7162ff9:automatic-mission-resume:3649:repair_mission_pr_ready_retryable","mission_step_id":"0adb1c52-2318-4db8-938d-f2c2f8a15bbf","command_center_event_id":"eebc422b-da9f-4a84-9518-15f7f7162ff9"},{"id":"ba5ddb61-6b29-4478-8552-dd228521a01b","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"src/pages/crm/PcgWorkspace.tsx","content":"import {useEffect,useMemo,useState,type ComponentType} from 'react';\nimport {useLocation} from 'react-router-dom';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';import {supabase} from '@/integrations/supabase/client';import {toast} from '@/lib/notify';import {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';import {PCGCardVaultContent} from '@/pages/card-grading/PCGWorkspace';import PCGLegacyMigrationCenter from '@/pages/card-grading/PCGLegacyMigrationCenter';import PCGOnboardingReadiness from '@/pages/card-grading/PCGOnboardingReadiness';\nimport {Award,BadgeDollarSign,Boxes,Check,ChevronRight,CircleDollarSign,ClipboardCheck,CreditCard,Database,ExternalLink,FileCheck2,Menu,PackageCheck,Plus,Search,Settings,ShieldCheck,Truck,UploadCloud,Users,X} from 'lucide-react';\nimport {PCG_GRADING_SCALE,findPCGGrade,formatPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nimport TenantSettingsPage from '@/pages/settings/TenantSettingsPage';\nimport PCGBatchPublishingCenter from '@/pages/card-grading/PCGBatchPublishingCenter';\ntype Submission={id:string;submission_number:string;customer_name:string|null;customer_email:string|null;customer_phone:string|null;service_tier:string;service_price:number;expected_card_count:number;status:string;delivery_method:string|null;received_at:string;due_at:string|null;tracking_in:string|null;tracking_out:string|null;notes:string|null;payment_status:string|null;payment_reference:string|null;paid_at:string|null};type Card={id:string;submission_id:string;sequence_number:number;cert_number:string|null;category:string|null;year:string|null;brand_set:string|null;player_character:string|null;card_number:string|null;card_description:string|null;autograph_present:boolean|null;variation:string|null;declared_value:number|null;grade:number|null;grade_label:string|null;status:string;front_image_url:string|null;back_image_url:string|null;slab_image_url:string|null;grader_notes:string|null;population_count:number|null};type CardDraft={category:string;year:string;brand_set:string;player_character:string;card_number:string;card_description:string;autograph_present:''|'yes'|'no';declared_value:string;grade:string;grade_label:string;cert_number:string;grader_notes:string};type DetailDraft={tracking_in:string;tracking_out:string;notes:string;payment_status:string;payment_reference:string};type Tab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';type IconType=ComponentType<{className?:string}>;\nconst tabs:[Tab,string,IconType][]=[['today','Work Queue',Award],['vault','Capture Cards',UploadCloud],['queue','Grade Cards',Award],['submissions','Receive Cards',Boxes],['certs','Certificates',ShieldCheck],['collectors','Customers',Users],['shipping','Fulfill & Ship',Truck],['inventory','Publish & Sell',PackageCheck],['money','Payments',CircleDollarSign],['migration','Migration',Database],['readiness','Readiness',ClipboardCheck],['settings','Settings',Settings]];const mobilePrimary:[Tab,string,IconType][]=[['today','Queue',Award],['vault','Capture',UploadCloud],['queue','Grade',Award],['certs','Certs',ShieldCheck]];\nconst tiers={two_weeks:{label:'2 Weeks',price:12,days:14},one_week:{label:'1 Week',price:15,days:7},three_days:{label:'3 Days',price:20,days:3},same_day:{label:'Same Day',price:25,days:0}} as const;const statuses=['received','intake_imaging','authentication','grading','encapsulation','qa','ready','shipped','picked_up'] as const;const terminalStatuses=new Set(['shipped','picked_up']);const PCG_STRIPE_FALLBACK='https://buy.stripe.com/3clbJ05UQc3w9KLcBR5Ne00';const PCG_LOGO='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/2c2615b1-2fab-4ba1-8cff-8d8e49b6b184/diamond%2Blogo.png';const PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';const pretty=(value:string)=>value.replaceAll('_',' ').replace(/\\b\\w/g,char=>char.toUpperCase());const inputClass='w-full border border-white/[0.10] bg-black/30 px-3.5 py-3 text-sm text-white outline-none transition placeholder:text-white/28 focus:border-[#d8bb78]/55';const panelClass='border border-white/[0.08] bg-[#09090a]/88';\nconst hasCanonicalGrade=(card:Pick<Card,'grade_label'>)=>Boolean(findPCGGrade(card.grade_label));\nfunction PCGGradeSelect({draft,onChange}:{draft:CardDraft;onChange:(next:CardDraft)=>void}){const selected=findPCGGrade(draft.grade_label);const legacyLabel=String(draft.grade_label||'').trim();const legacyNumeric=!legacyLabel&&draft.grade.trim()?draft.grade.trim():'';return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[9px] font-black uppercase tracking-[.14em] text-[#d8bb78]\">Official PCG grade</span><select value={draft.grade_label} onChange={event=>{const option=findPCGGrade(event.target.value);onChange({...draft,grade:option?.numeric==null?'':String(option.numeric),grade_label:option?.designation||event.target.value})}} className={inputClass}><option value=\"\">Select official PCG designation</option>{legacyLabel&&!selected?<option value={legacyLabel}>Legacy · {legacyLabel}</option>:null}{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<div className=\"mt-2 border border-white/[0.08] bg-black/28 px-3 py-2\"><div className=\"text-[10px] font-black text-[#e8cc8d]\">{selected.designation}</div><div className=\"mt-1 text-[11px] leading-5 text-white/45\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</div></div>:legacyLabel?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy grade label. Choose an official PCG designation before advancing this card.</div>:legacyNumeric?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy numeric grade {legacyNumeric}. Choose the exact official PCG designation before advancing this card.</div>:null}</div>}\nfunction cardToDraft(card:Card):CardDraft{return{category:card.category||'',year:card.year||'',brand_set:card.brand_set||'',player_character:card.player_character||'',card_number:card.card_number||'',card_description:card.card_description||card.variation||'',autograph_present:card.autograph_present==null?'':card.autograph_present?'yes':'no',declared_value:card.declared_value==null?'':String(card.declared_value),grade:card.grade==null?'':String(card.grade),grade_label:card.grade_label||'',cert_number:card.cert_number||'',grader_notes:card.grader_notes||''}}function slaMeta(sub:Submission){if(!sub.due_at||terminalStatuses.has(sub.status))return{label:terminalStatuses.has(sub.status)?pretty(sub.status):'No due date',tone:'text-white/42 border-white/10'};const diff=new Date(sub.due_at).getTime()-Date.now();const days=Math.ceil(diff/86400000);if(diff<0)return{label:`${Math.abs(days)}d overdue`,tone:'text-rose-300 border-rose-400/25'};if(days===0)return{label:'Due today',tone:'text-amber-200 border-amber-300/25'};if(days<=2)return{label:`Due in ${days}d`,tone:'text-amber-200 border-amber-300/25'};return{label:`Due ${new Date(sub.due_at).toLocaleDateString()}`,tone:'text-white/46 border-white/10'}}\nexport default function PcgWorkspace({initialTab='today',embedded=false,initialVaultMode='overview',initialVaultSubmissionId='',onSubmissionCreated,navigationScope}:{initialTab?:Tab;embedded?:boolean;initialVaultMode?:'overview'|'single'|'batch'|'growth';initialVaultSubmissionId?:string;onSubmissionCreated?:(submission:{id:string;submission_number:string})=>void;navigationScope?:Tab[]}={}){const location=useLocation();const{activeTenant}=useMultiTenant();const tenantId=activeTenant?.id;const settings=((activeTenant as any)?.settings||{}) as Record<string,unknown>;const mediaBranding=useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);const workspaceBackground=mediaBranding.backgroundUrl||String(settings.background_image_url||settings.backgroundImageUrl||'').trim();const stripePaymentLink=String(settings.stripe_payment_link||PCG_STRIPE_FALLBACK);const stripeSyncConnected=String(settings.stripe_sync_status||'not_connected')==='connected';const[tab,setTab]=useState<Tab>(initialTab);const visibleTabs=useMemo(()=>navigationScope?.length?tabs.filter(([id])=>navigationScope.includes(id)):tabs,[navigationScope]);useEffect(()=>{setTab(initialTab)},[initialTab]);useEffect(()=>{if(navigationScope?.length&&!navigationScope.includes(tab))setTab(navigationScope.includes(initialTab)?initialTab:navigationScope[0])},[initialTab,navigationScope,tab]);const[subs,setSubs]=useState<Submission[]>([]);const[cards,setCards]=useState<Card[]>([]);const[loading,setLoading]=useState(true);const[showNew,setShowNew]=useState(false);const[showMore,setShowMore]=useState(false);const[selectedId,setSelectedId]=useState<string|null>(null);const[query,setQuery]=useState('');const[statusFilter,setStatusFilter]=useState('all');const[certQuery,setCertQuery]=useState('');const[busy,setBusy]=useState(false);const[cardDrafts,setCardDrafts]=useState<Record<string,CardDraft>>({});const[detailDraft,setDetailDraft]=useState<DetailDraft>({tracking_in:'',tracking_out:'',notes:'',payment_status:'unverified',payment_reference:''});const[form,setForm]=useState({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});const settingsSection=String(new URLSearchParams(location.search).get('section')||'').trim().toLowerCase();const selectedTier=tiers[form.tier as keyof typeof tiers]||tiers.two_weeks;const selectedCardCount=Math.max(1,Math.min(100000,Number(form.cardCount)||1));const expectedTotal=selectedCardCount*selectedTier.price;const openStripe=()=>window.open(stripePaymentLink,'_blank','noopener,noreferrer');\nasync function load(){if(!tenantId)return;setLoading(true);const[s,c]=await Promise.all([(supabase as any).from('card_grading_submissions').select('*').eq('tenant_id',tenantId).order('created_at',{ascending:false}),(supabase as any).from('card_grading_cards').select('*').eq('tenant_id',tenantId).order('sequence_number',{ascending:true})]);if(s.error)toast.error(s.error.message);if(c.error)toast.error(c.error.message);setSubs((s.data||[]) as Submission[]);setCards((c.data||[]) as Card[]);setLoading(false)}useEffect(()=>{void load()},[tenantId]);\nconst orderCardCount=(sub:Submission)=>Math.max(Number(sub.expected_card_count||0),cards.filter(card=>card.submission_id===sub.id).length);const counts=useMemo(()=>Object.fromEntries(statuses.map(status=>[status,subs.filter(item=>item.status===status).length])),[subs]);const openSubs=subs.filter(item=>!terminalStatuses.has(item.status));const overdue=openSubs.filter(item=>item.due_at&&new Date(item.due_at)<new Date()).length;const dueSoon=openSubs.filter(item=>item.due_at&&new Date(item.due_at)>=new Date()&&new Date(item.due_at).getTime()-Date.now()<=2*86400000).length;const serviceValue=subs.reduce((sum,item)=>sum+Number(item.service_price||0)*orderCardCount(item),0);const prioritySubs=[...openSubs].sort((a,b)=>(a.due_at?new Date(a.due_at).getTime():Number.MAX_SAFE_INTEGER)-(b.due_at?new Date(b.due_at).getTime():Number.MAX_SAFE_INTEGER)).slice(0,6);const filteredSubs=subs.filter(item=>{const hay=`${item.submission_number} ${item.customer_name||''} ${item.customer_email||''} ${item.customer_phone||''}`.toLowerCase();return(!query||hay.includes(query.toLowerCase()))&&(statusFilter==='all'||item.status===statusFilter)});const filteredCards=cards.filter(card=>!certQuery||`${card.cert_number||''} ${card.year||''} ${card.brand_set||''} ${card.player_character||''} ${card.card_description||card.variation||''} ${card.card_number||''}`.toLowerCase().includes(certQuery.toLowerCase()));const selected=subs.find(item=>item.id===selectedId)||null;const selectedCards=selected?cards.filter(card=>card.submission_id===selected.id):[];const selectedTotal=selected?orderCardCount(selected)*Number(selected.service_price||0):0;\nfunction openSubmission(sub:Submission){setSelectedId(sub.id);setDetailDraft({tracking_in:sub.tracking_in||'',tracking_out:sub.tracking_out||'',notes:sub.notes||'',payment_status:sub.payment_status||'unverified',payment_reference:sub.payment_reference||''});const next:Record<string,CardDraft>={};cards.filter(card=>card.submission_id===sub.id).forEach(card=>{next[card.id]=cardToDraft(card)});setCardDrafts(next)}\nasync function createSubmission(){if(!tenantId)return;if(!form.name.trim()){toast.error('Customer name is required.');return}const count=selectedCardCount,tier=selectedTier,now=new Date(),due=new Date(now);due.setDate(due.getDate()+tier.days);const submissionNumber=`PCG-${now.getFullYear()}-${String(Date.now()).slice(-7)}`;setBusy(true);const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:submissionNumber,customer_name:form.name.trim(),customer_email:form.email.trim()||null,customer_phone:form.phone.trim()||null,service_tier:form.tier,service_price:tier.price,expected_card_count:count,status:'received',payment_status:'unverified',delivery_method:form.delivery,notes:form.notes.trim()||null,received_at:now.toISOString(),due_at:due.toISOString()}).select('*').single();if(error||!data){toast.error(error?.message||'Unable to create submission');setBusy(false);return}toast.success(`${submissionNumber} created for ${count.toLocaleString()} card${count===1?'':'s'}. Opening Capture Cards for this order.`);setShowNew(false);setForm({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});await load();setBusy(false);onSubmissionCreated?.({id:String(data.id),submission_number:String(data.submission_number||submissionNumber)})}\nfunction transitionIssue(sub:Submission,nextStatus:string,ownCards:Card[]){if(nextStatus==='authentication'){if(!ownCards.length)return 'Add cards before authentication.';const missing=ownCards.filter(card=>!card.front_image_url&&!card.back_image_url&&!card.slab_image_url).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' a saved intake image before authentication.'):''}if(nextStatus==='encapsulation'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' an official PCG grade before encapsulation.'):''}if(nextStatus==='qa'){const missingGrade=ownCards.filter(card=>!hasCanonicalGrade(card)).length,missingCert=ownCards.filter(card=>!String(card.cert_number||'').trim()).length;return missingGrade||missingCert?('Save '+(missingGrade?(missingGrade+' missing official PCG grade'+(missingGrade===1?'':'s')):'')+(missingGrade&&missingCert?' and ':'')+(missingCert?(missingCert+' missing cert number'+(missingCert===1?'':'s')):'')+' before QA.'):''}if(nextStatus==='ready'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)||!String(card.cert_number||'').trim()||(!card.slab_image_url&&!card.front_image_url&&!card.back_image_url)).length;return missing?(missing+' card'+(missing===1?' is':'s are')+' missing official PCG grade, cert, or customer-visible imagery.'):''}if(nextStatus==='shipped'&&!String(sub.tracking_out||'').trim())return 'Save outbound tracking before marking this order shipped.';return ''}async function advanceBatch(nextStatus:string){if(!tenantId||!selected)return;const issue=transitionIssue(selected,nextStatus,selectedCards);if(issue){toast.error(issue);return}setBusy(true);const{error}=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selected.id,p_status:nextStatus});if(error)toast.error(error.message||'Unable to advance submission');else{toast.success(`${selected.submission_number} moved to ${pretty(nextStatus)}.`);await load()}setBusy(false)}\nasync function saveSubmissionDetails(){if(!tenantId||!selected)return;setBusy(true);const manual=detailDraft.payment_status==='manually_verified';const{error}=await(supabase as any).from('card_grading_submissions').update({tracking_in:detailDraft.tracking_in.trim()||null,tracking_out:detailDraft.tracking_out.trim()||null,notes:detailDraft.notes.trim()||null,payment_status:detailDraft.payment_status,payment_reference:detailDraft.payment_reference.trim()||null,paid_at:manual?(selected.paid_at||new Date().toISOString()):null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',selected.id);if(error)toast.error(error.message);else{toast.success('Submission details saved.');await load()}setBusy(false)}\nasync function saveCard(card:Card){if(!tenantId)return;const draft=cardDrafts[card.id];if(!draft)return;setBusy(true);const gradeDefinition=findPCGGrade(draft.grade_label);const grade=gradeDefinition?gradeDefinition.numeric:(draft.grade.trim()===''?null:Number(draft.grade));const gradeLabel=gradeDefinition?.designation||draft.grade_label.trim()||null;const declared=draft.declared_value.trim()===''?null:Number(draft.declared_value);if(grade!=null&&(Number.isNaN(grade)||grade<0||grade>10)){toast.error('Legacy numeric grade is invalid. Choose an official PCG grade.');setBusy(false);return}const{error}=await(supabase as any).from('card_grading_cards').update({category:draft.category.trim()||null,year:draft.year.trim()||null,brand_set:draft.brand_set.trim()||null,player_character:draft.player_character.trim()||null,card_number:draft.card_number.trim()||null,card_description:draft.card_description.trim()||null,autograph_present:draft.autograph_present===''?null:draft.autograph_present==='yes',variation:draft.card_description.trim()||null,declared_value:declared,grade,grade_label:gradeLabel,cert_number:draft.cert_number.trim()||null,grader_notes:draft.grader_notes.trim()||null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',card.id);if(error)toast.error(error.message);else{toast.success(`Card #${card.sequence_number} saved.`);await load()}setBusy(false)}\nconst metric=(label:string,value:string|number,sub:string)=><div className=\"py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">{label}</div><div className=\"mt-1 text-3xl font-black tracking-[-.04em]\">{value}</div><div className=\"mt-1 text-[11px] text-white/36\">{sub}</div></div>;\nconst empty=(title:string,copy:string,action?:()=>void,actionLabel?:string)=><div className=\"border border-dashed border-white/[0.10] bg-[#09090a]/94 p-9 text-center\"><FileCheck2 className=\"mx-auto h-6 w-6 text-[#d8bb78]\"/><div className=\"mt-4 text-lg font-black\">{title}</div><p className=\"mx-auto mt-2 max-w-md text-sm leading-6 text-white/38\">{copy}</p>{action&&<button onClick={action} className=\"mt-5 bg-[#d8bb78] px-5 py-2.5 text-sm font-black text-black\">{actionLabel}</button>}</div>;\nconst row=(sub:Submission)=>{const cardCount=cards.filter(card=>card.submission_id===sub.id).length;const expected=Math.max(Number(sub.expected_card_count||0),cardCount);const payment=sub.payment_status==='manually_verified'?'Paid':sub.payment_status==='waived'?'Waived':'Unverified';return <button key={sub.id} onClick={()=>openSubmission(sub)} className=\"group grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-2 py-2.5 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"min-w-0\"><div className=\"flex flex-wrap items-center gap-2\"><span className=\"text-xs font-black tracking-wide text-[#e4c47b]\">{sub.submission_number}</span><span className=\"text-[9px] font-black uppercase tracking-[.12em] text-white/32\">{pretty(sub.status)}</span></div><div className=\"mt-1 truncate text-sm font-black sm:text-[15px]\">{sub.customer_name||'Collector not named'}</div><div className=\"mt-0.5 flex flex-wrap gap-x-3 text-[10px] text-white/34 sm:text-[11px]\"><span>{expected>cardCount?`${cardCount.toLocaleString()} / ${expected.toLocaleString()} cards ingested`:`${cardCount.toLocaleString()} card${cardCount===1?'':'s'}`}</span><span>{tiers[sub.service_tier as keyof typeof tiers]?.label||pretty(sub.service_tier)}</span><span>{payment}</span></div></div><div className=\"flex items-center gap-2\"><span className={`border px-2.5 py-1 text-[10px] font-black ${slaMeta(sub).tone}`}>{slaMeta(sub).label}</span><ChevronRight className=\"h-4 w-4 text-white/18\"/></div></button>};\nconst renderList=(heading:string,eyebrow:string,source:Submission[])=><section><div className=\"mb-6 flex flex-col gap-4 border-b border-white/[0.08] pb-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">{eyebrow}</div><h1 className=\"mt-1.5 text-2xl font-black tracking-[-.035em] sm:text-3xl\">{heading}</h1><p className=\"mt-2 text-sm text-white/38\">Open a batch to grade cards, verify payment, update tracking or move it forward.</p></div><button onClick={()=>setShowNew(true)} className=\"inline-flex items-center justify-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div><div className=\"mb-5 grid gap-2 sm:grid-cols-[1fr_220px]\"><div className=\"relative\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={query} onChange={event=>setQuery(event.target.value)} placeholder=\"Search submission or collector\" className={`${inputClass} pl-11`}/></div><select value={statusFilter} onChange={event=>setStatusFilter(event.target.value)} className={inputClass}><option value=\"all\">Every grading stage</option>{statuses.map(status=><option key={status} value={status}>{pretty(status)}</option>)}</select></div>{source.length?<div className=\"border-y border-white/[0.08]\">{source.map(row)}</div>:empty('Nothing needs attention','Receive a new card submission when work arrives.',()=>setShowNew(true),'Receive cards')}</section>;\nconst brandName=activeTenant?.company_dba_name||activeTenant?.company_legal_name||activeTenant?.name||'Prestigious Card Grading';\nreturn <div data-pcg-mode-workspace-background={workspaceBackground||'solid'} className=\"relative min-h-screen overflow-x-hidden bg-[#050506] text-white\" style={{backgroundImage:workspaceBackground?`linear-gradient(108deg,rgba(4,4,5,.98) 0%,rgba(4,4,5,.91) 35%,rgba(4,4,5,.68) 70%,rgba(4,4,5,.88) 100%),url(\"${workspaceBackground}\")`:undefined,backgroundSize:'cover',backgroundPosition:mediaBranding.backgroundPosition||'center',backgroundRepeat:'no-repeat',backgroundAttachment:'fixed'}}><div className=\"pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_78%_15%,rgba(216,187,120,.10),transparent_28rem)]\"/>\n{!embedded?<header className=\"fixed inset-x-0 top-0 z-50 h-16 border-b border-white/[0.07] bg-[#09090a]/94/95 backdrop-blur-xl\"><div className=\"flex h-full items-center gap-3 px-4 sm:px-6\"><div className=\"grid h-9 w-9 place-items-center border border-[#d8bb78]/20 bg-[#d8bb78]/[0.06]\"><img src={PCG_LOGO} alt=\"PCG\" className=\"h-full w-full object-contain p-1\"/></div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black tracking-tight\">{brandName}</div><div className=\"hidden text-[9px] font-bold uppercase tracking-[.17em] text-white/30 sm:block\">PCG daily work</div></div><div className=\"ml-auto flex items-center gap-3\"><span className=\"hidden text-xs font-semibold text-white/32 md:inline\">{openSubs.length} active batches</span><button onClick={()=>setShowNew(true)} className=\"inline-flex h-9 items-center gap-2 bg-[#d8bb78] px-3.5 text-xs font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div></div></header>:null}\n{!embedded?<aside className=\"fixed bottom-0 left-0 top-16 z-40 hidden w-[230px] border-r border-white/[0.07] bg-[#09090a]/94/95 px-4 py-5 backdrop-blur-xl lg:flex lg:flex-col\"><div className=\"px-2\"><div className=\"text-[9px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">PCG Work Queue</div><div className=\"mt-2 text-sm leading-5 text-white/40\">Receive, grade, publish, and fulfill cards.</div></div><nav className=\"mt-7 space-y-1\">{visibleTabs.map(([id,label,Icon])=><button key={id} onClick={()=>setTab(id)} className={`flex h-11 w-full items-center gap-3 px-3 text-left text-sm font-bold transition ${tab===id?'bg-white/[0.07] text-white shadow-[inset_2px_0_0_#d8bb78]':'text-white/40 hover:bg-white/[0.035] hover:text-white/80'}`}><Icon className={`h-[17px] w-[17px] ${tab===id?'text-[#d8bb78]':'text-white/30'}`}/><span className=\"flex-1\">{label}</span>{id==='queue'&&openSubs.length?<span className=\"text-[10px] font-black text-[#d8bb78]\">{openSubs.length}</span>:null}</button>)}</nav><div className=\"mt-auto border-t border-white/[0.07] px-2 pt-4\"><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-white/25\">Prestigious Card Grading</div><div className=\"mt-2 text-xs leading-5 text-white/36\">14170 US Highway 1<br/>Sebastian, FL 32958</div></div></aside>:null}\n<main className={`relative z-10 min-h-screen px-4 pb-24 sm:px-6 lg:px-8 lg:pb-10 xl:px-10 ${embedded?'pt-4 sm:pt-6':'pt-20 lg:ml-[230px]'}`}>{loading?<div className=\"grid min-h-[70vh] place-items-center\"><div className=\"text-center\"><img src={PCG_LOGO} alt=\"PCG\" className=\"mx-auto h-16 w-16 object-contain opacity-70\"/><div className=\"mt-4 text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Opening PCG…</div></div></div>:<>\n{tab==='today'?<><section className=\"border-b border-white/[0.08] pb-7 pt-3\"><div className=\"flex flex-col gap-7 xl:flex-row xl:items-end xl:justify-between\"><div className=\"max-w-3xl\"><div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Daily work</div><h1 className=\"mt-2 text-3xl font-black leading-none tracking-[-.045em] sm:text-4xl\">PCG Work Queue</h1><p className=\"mt-2 max-w-2xl text-sm leading-5 text-white/42\">See what needs attention and move each submission through the next clear step.</p></div><div className=\"grid w-full max-w-xl grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08] sm:grid-cols-3\"><button onClick={()=>setShowNew(true)} className=\"bg-[#09090a]/94 p-4 text-left\"><Plus className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Receive Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Start a submission</div></button><button onClick={()=>setTab('vault')} className=\"bg-[#09090a]/94 p-4 text-left\"><UploadCloud className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Capture Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Single or batch intake</div></button><button onClick={()=>setTab('queue')} className=\"col-span-2 bg-[#09090a]/94 p-4 text-left sm:col-span-1\"><Award className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Grade Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Work the grading queue</div></button></div></div><div className=\"mt-8 grid sm:grid-cols-2 xl:grid-cols-4\">{metric('Batches on floor',openSubs.length,'Active submissions')}{metric('Cards in house',cards.filter(card=>!terminalStatuses.has(card.status)).length,'Individual cards')}{metric('SLA attention',overdue+dueSoon,overdue?`${overdue} overdue · ${dueSoon} due soon`:`${dueSoon} due within 48 hours`)}{metric('Recorded work',`$${serviceValue.toFixed(0)}`,stripeSyncConnected?'Stripe sync connected':'Stripe sync not connected')}</div></section><div className=\"mt-8 grid gap-8 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,.8fr)]\"><section><div className=\"mb-3 flex items-end justify-between\"><div><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Priority work</div><h2 className=\"mt-1 text-2xl font-black\">Next on the grading bench</h2></div><button onClick={()=>setTab('queue')} className=\"text-xs font-black text-[#d8bb78]\">Grade cards →</button></div><div className=\"border-y border-white/[0.08]\">{prioritySubs.length?prioritySubs.map(row):empty('Nothing needs grading','No grading batches need attention right now.',()=>setShowNew(true),'Receive cards')}</div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Stage pressure</div><h2 className=\"mt-1 text-2xl font-black\">Where the cards are</h2><div className=\"mt-5 divide-y divide-white/[0.07]\">{statuses.map((status,index)=><button key={status} onClick={()=>{setStatusFilter(status);setTab('queue')}} className=\"grid w-full grid-cols-[28px_1fr_auto] items-center gap-3 py-3 text-left\"><span className=\"text-[9px] font-black text-white/18\">{String(index+1).padStart(2,'0')}</span><span className=\"text-xs font-bold text-white/48\">{pretty(status)}</span><span className=\"text-base font-black\">{counts[status]||0}</span></button>)}</div></section></div></>:null}\n{tab==='vault'?<PCGCardVaultContent initialMode={initialVaultMode} initialSubmissionId={initialVaultSubmissionId}/>:null}{tab==='queue'?renderList('Grade Cards','Active grading work',filteredSubs.filter(item=>!terminalStatuses.has(item.status))):null}{tab==='submissions'?renderList('Receive Cards','All submissions',filteredSubs):null}{tab==='shipping'?renderList('Fulfill & Ship','Ready · shipped · pickup',filteredSubs.filter(item=>['ready','shipped','picked_up'].includes(item.status)||Boolean(item.tracking_in)||Boolean(item.tracking_out))):null}\n{tab==='certs'?<section><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Card lookup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Certificates</h1></div><div className=\"relative mt-3 max-w-2xl\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={certQuery} onChange={event=>setCertQuery(event.target.value)} placeholder=\"Search certificate, card, player, or set\" className={`${inputClass} pl-11`}/></div>{filteredCards.length?<div className=\"mt-3 overflow-hidden border border-white/[0.08] bg-black/20\">{filteredCards.map(card=>{const image=card.slab_image_url||card.front_image_url;const title=[card.year,card.brand_set,card.player_character,card.card_description||card.variation,card.card_number?`#${card.card_number}`:null].filter(Boolean).join(' · ')||`Card #${card.sequence_number}`;const grade=hasCanonicalGrade(card)?formatPCGGrade(card.grade,card.grade_label):'';return <button key={card.id} onClick={()=>{const sub=subs.find(item=>item.id===card.submission_id);if(sub)openSubmission(sub)}} className=\"grid min-h-[68px] w-full grid-cols-[44px_minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-3 py-2 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"grid h-14 w-11 shrink-0 place-items-center overflow-hidden border border-white/[0.08] bg-[#09090a]/94\">{image?<img src={image} alt=\"Graded card\" className=\"h-full w-full object-cover\"/>:<ShieldCheck className=\"h-5 w-5 text-[#d8bb78]/55\"/>}</div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black leading-tight\">{title}</div><div className=\"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-white/35\"><span>{card.cert_number||'Cert pending'}</span>{grade?<span className=\"font-black text-[#e8cc8d]/75\">{grade}</span>:null}</div></div><ChevronRight className=\"h-4 w-4 shrink-0 text-white/20\"/></button>})}</div>:<div className=\"mt-4\">{empty('No certificates yet','Certificate records appear here as grading is completed.')}</div>}</section>:null}\n{tab==='collectors'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Customer records</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Customers</h1></div>{subs.some(item=>item.customer_name)?<div className=\"mt-6 border-y border-white/[0.08]\">{Array.from(new Map(subs.filter(item=>item.customer_name).map(item=>[item.customer_name,item])).values()).map(sub=>{const related=subs.filter(item=>item.customer_name===sub.customer_name);const relatedCards=cards.filter(card=>related.some(item=>item.id===card.submission_id));return <button key={sub.customer_name!} onClick={()=>openSubmission(related[0])} className=\"grid w-full grid-cols-[1fr_auto_auto] items-center gap-4 border-b border-white/[0.07] px-1 py-4 text-left\"><div><div className=\"font-black\">{sub.customer_name}</div><div className=\"mt-1 text-xs text-white/32\">{sub.customer_email||sub.customer_phone||'Contact info not captured'}</div></div><div className=\"text-right\"><div className=\"text-lg font-black\">{related.length}</div><div className=\"text-[9px] text-white/25\">SUBMISSIONS</div></div><div className=\"text-right\"><div className=\"text-lg font-black text-[#d8bb78]\">{relatedCards.length}</div><div className=\"text-[9px] text-white/25\">CARDS</div></div></button>})}</div>:empty('No customers yet','Customers appear automatically when a card submission is received.',()=>setShowNew(true),'Receive cards')}</section>:null}\n{tab==='inventory'?<PCGBatchPublishingCenter tenantId={tenantId||''}/>:null}\n{tab==='migration'?<PCGLegacyMigrationCenter/>:null}\n{tab==='readiness'?<PCGOnboardingReadiness/>:null}\n{tab==='settings'?<section>\n    <div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG setup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Settings</h1><p className=\"mt-1.5 max-w-2xl text-sm leading-6 text-white/45\">Only the controls Anthony needs to run PCG. Pick a category instead of digging through platform settings.</p></div>\n    {!settingsSection?<div className=\"mt-4 grid gap-2 sm:grid-cols-2 xl:grid-cols-3\">\n      {[\n        ['business','Brand & workspace','Logo, backgrounds, public-facing identity and workspace presentation.'],\n        ['connections','Google & connections','Google Drive, eBay and other connected services.'],\n        ['mail','Email & customers','Business email continuity and customer-facing channels.'],\n        ['notifications','Notifications','What PCG alerts you about and where they go.'],\n        ['profile','Profile & staff','Owner profile and people using this workspace.'],\n        ['workspace','Workspace behavior','Layout, experience and workspace health.']\n      ].map(([section,title,copy])=><a key={section} href={'?tool=settings&section='+section} className=\"group flex min-h-[112px] items-start justify-between gap-4 rounded-2xl border border-white/[0.08] bg-[#09090a]/94 p-4 shadow-sm transition hover:border-white/[0.16] hover:bg-[#09090a]/94/[.025]\"><span><span className=\"block text-sm font-black\">{title}</span><span className=\"mt-1 block text-xs leading-5 text-white/42\">{copy}</span></span><ChevronRight className=\"mt-1 h-4 w-4 shrink-0 text-white/28 transition group-hover:translate-x-0.5\"/></a>)}\n    </div>:<div className=\"pcg-settings-dark mt-4\"><style>{`.pcg-settings-dark .bg-card,.pcg-settings-dark [class*=\"bg-card\"]{background:#09090a!important}.pcg-settings-dark .bg-background,.pcg-settings-dark [class*=\"bg-background\"]{background:#050506!important}.pcg-settings-dark .text-foreground{color:#fff!important}.pcg-settings-dark .text-muted-foreground{color:rgba(255,255,255,.48)!important}.pcg-settings-dark [class*=\"border\"]{border-color:rgba(255,255,255,.10)}`}</style><a href=\"?tool=settings\" className=\"mb-3 inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[0.08] bg-[#09090a]/94 px-3 text-xs font-black text-white/55\">← All PCG settings</a><TenantSettingsPage/></div>}\n  </section>:null}\n{tab==='money'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Admin · payments</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Payments</h1></div><div className=\"mt-6 grid gap-8 xl:grid-cols-[1.15fr_.85fr]\"><section><div className=\"flex items-center justify-between border-b border-white/[0.08] pb-4\"><div className=\"flex items-center gap-3\"><CreditCard className=\"h-5 w-5 text-[#635bff]\"/><div><div className=\"text-sm font-black\">Stripe hosted checkout</div><div className=\"text-xs text-white/30\">PCG grading payments</div></div></div><span className={stripeSyncConnected?'text-xs font-black text-emerald-300':'text-xs font-black text-amber-200'}>{stripeSyncConnected?'Data sync connected':'Data sync not connected'}</span></div><div className=\"mt-6 text-[10px] font-black uppercase tracking-[.18em] text-white/30\">Recorded grading service value</div><div className=\"mt-2 text-3xl font-black sm:text-4xl\">${serviceValue.toFixed(2)}</div><p className=\"mt-3 text-sm leading-6 text-white/38\">This is grading work recorded in KnockLaunch, not a claimed Stripe balance unless sync is authenticated.</p><button onClick={openStripe} className=\"mt-7 inline-flex items-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\">Open PCG Stripe checkout <ExternalLink className=\"h-4 w-4\"/></button></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading menu</div><div className=\"mt-5 divide-y divide-white/[0.07]\">{Object.entries(tiers).map(([id,tier])=><div key={id} className=\"flex items-center justify-between py-4\"><div><div className=\"font-black\">{tier.label}</div><div className=\"text-xs text-white/28\">Per card · no up-charges</div></div><div className=\"text-2xl font-black text-[#d8bb78]\">${tier.price}</div></div>)}</div></section></div></section>:null}</>}</main>\n{!embedded?<nav className=\"fixed inset-x-3 bottom-3 z-50 grid grid-cols-5 border border-white/[0.09] bg-[#09090a]/94/95 p-1.5 shadow-2xl backdrop-blur-xl lg:hidden\">{mobilePrimary.map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className={`flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black ${tab===id?'bg-white/[0.07] text-white':'text-white/38'}`}><Icon className={`h-[18px] w-[18px] ${tab===id?'text-[#d8bb78]':'text-white/28'}`}/><span>{label}</span></button>)}<button onClick={()=>setShowMore(true)} className=\"flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black text-white/38\"><Menu className=\"h-[18px] w-[18px] text-white/28\"/>More</button></nav>:null}\n{!embedded&&showMore?<div className=\"fixed inset-0 z-[70] bg-black/74 lg:hidden\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowMore(false)}}><div className=\"absolute inset-x-0 bottom-0 border-t border-white/[0.10] bg-[#09090a]/94 p-4\"><div className=\"mb-4 text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">More PCG tools</div><div className=\"grid grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08]\">{visibleTabs.filter(([id])=>!mobilePrimary.some(([primary])=>primary===id)).map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className=\"flex items-center gap-3 bg-[#09090a]/94 px-4 py-3 text-sm font-bold\"><Icon className=\"h-4 w-4 text-[#d8bb78]\"/>{label}</button>)}</div><button onClick={()=>setShowMore(false)} className=\"mt-3 w-full border border-white/[0.08] py-3 text-sm font-bold text-white/45\">Close</button></div></div>:null}\n{showNew?<div className=\"fixed inset-0 z-[80] grid place-items-center overflow-y-auto bg-black/82 p-4 backdrop-blur-md\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowNew(false)}}><div className=\"w-full max-w-2xl border border-white/[0.10] bg-[#09090a]/94\"><div className=\"flex items-center justify-between border-b border-white/[0.08] p-5\"><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading intake</div><h2 className=\"mt-1 text-2xl font-black\">Receive cards into PCG</h2></div><button onClick={()=>setShowNew(false)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><div className=\"p-5\"><div className=\"grid gap-3 sm:grid-cols-2\"><input value={form.name} onChange={event=>setForm({...form,name:event.target.value})} placeholder=\"Collector name\" className={inputClass}/><input value={form.email} onChange={event=>setForm({...form,email:event.target.value})} placeholder=\"Email\" className={inputClass}/><input value={form.phone} onChange={event=>setForm({...form,phone:event.target.value})} placeholder=\"Phone\" className={inputClass}/><input value={form.cardCount} onChange={event=>setForm({...form,cardCount:event.target.value})} type=\"number\" min=\"1\" max=\"100000\" placeholder=\"Expected card count\" className={inputClass}/><select value={form.tier} onChange={event=>setForm({...form,tier:event.target.value})} className={inputClass}>{Object.entries(tiers).map(([id,tier])=><option key={id} value={id}>{tier.label} · ${tier.price}/card</option>)}</select><select value={form.delivery} onChange={event=>setForm({...form,delivery:event.target.value})} className={inputClass}><option value=\"walk_in\">Walk-in</option><option value=\"mail_in\">Mail-in</option><option value=\"ship_back\">Ship back</option><option value=\"pickup\">Pickup</option></select><textarea value={form.notes} onChange={event=>setForm({...form,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><div className=\"mt-4 flex items-end justify-between border-t border-white/[0.08] pt-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.15em] text-[#d8bb78]\">Expected grading total</div><div className=\"mt-1 text-3xl font-black\">${expectedTotal.toFixed(2)}</div></div><div className=\"text-right text-xs text-white/30\">{selectedCardCount} card{selectedCardCount===1?'':'s'} × ${selectedTier.price}</div></div><div className=\"mt-5 grid gap-2 sm:grid-cols-2\"><button onClick={openStripe} className=\"inline-flex items-center justify-center gap-2 border border-white/10 px-4 py-3 font-black\"><CreditCard className=\"h-4 w-4\"/>Collect in Stripe</button><button disabled={busy} onClick={()=>void createSubmission()} className=\"bg-[#d8bb78] px-4 py-3 font-black text-black disabled:opacity-50\">{busy?'Creating…':'Create submission'}</button></div><p className=\"mt-3 text-center text-xs text-white/28\">Creating the submission never marks it paid.</p></div></div></div>:null}\n{selected?<div className=\"fixed inset-0 z-[80] bg-black/72\" onMouseDown={event=>{if(event.currentTarget===event.target)setSelectedId(null)}}><aside className=\"absolute inset-y-0 right-0 w-full max-w-3xl overflow-y-auto border-l border-white/10 bg-[#09090a]/94 p-4 pb-24 sm:p-6\"><div className=\"flex items-start justify-between gap-4 border-b border-white/[0.08] pb-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-[#d8bb78]\">Submission workbench</div><h2 className=\"mt-1 text-2xl font-black\">{selected.submission_number}</h2><div className=\"mt-1 text-sm text-white/34\">{selected.customer_name||'Collector not named'} · {selectedCards.length.toLocaleString()} ingested / {orderCardCount(selected).toLocaleString()} expected · ${selectedTotal.toFixed(2)}</div></div><button onClick={()=>setSelectedId(null)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Grading stage</div><div className=\"mt-4 flex flex-wrap gap-2\">{statuses.map(status=><div key={status} className={`border px-2.5 py-1 text-[9px] font-black ${selected.status===status?'border-[#d8bb78]/45 text-[#e8cc8d]':'border-white/10 text-white/28'}`}>{pretty(status)}</div>)}</div><div className=\"mt-4\">{(()=>{const index=statuses.indexOf(selected.status as any);const next=index>=0&&index<statuses.length-1?statuses[index+1]:null;const issue=next?transitionIssue(selected,next,selectedCards):'';return <>{terminalStatuses.has(selected.status)?<div className=\"mb-3 text-xs font-black text-emerald-300\"><Check className=\"mr-1 inline h-3.5 w-3.5\"/>Lifecycle complete</div>:next?<div className={'mb-3 text-xs leading-5 '+(issue?'text-amber-200':'text-emerald-300')}>{issue||<>Ready to advance to {pretty(next)}.</>}</div>:null}{next&&!terminalStatuses.has(selected.status)&&selected.status!=='ready'?<button disabled={busy||Boolean(issue)} onClick={()=>void advanceBatch(next)} className=\"inline-flex items-center gap-2 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Advance to {pretty(next)} <ChevronRight className=\"h-4 w-4\"/></button>:null}{selected.status==='ready'?<><button disabled={busy||Boolean(transitionIssue(selected,'shipped',selectedCards))} onClick={()=>void advanceBatch('shipped')} className=\"bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black disabled:cursor-not-allowed disabled:opacity-35\">Mark shipped</button><button disabled={busy} onClick={()=>void advanceBatch('picked_up')} className=\"ml-2 border border-white/10 px-4 py-2.5 text-sm font-black\">Mark picked up</button></>:null}</>})()}</div></section><section className={`${panelClass} mt-4 p-4`}><div className=\"flex items-center justify-between\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Collector & payment</div><BadgeDollarSign className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><select value={detailDraft.payment_status} onChange={event=>setDetailDraft({...detailDraft,payment_status:event.target.value})} className={inputClass}><option value=\"unverified\">Payment not verified</option><option value=\"manually_verified\">Manually verified paid</option><option value=\"waived\">Waived</option><option value=\"refunded\">Refunded</option></select><input value={detailDraft.payment_reference} onChange={event=>setDetailDraft({...detailDraft,payment_reference:event.target.value})} placeholder=\"Reference / Stripe receipt ID\" className={inputClass}/></div><button onClick={openStripe} className=\"mt-3 inline-flex items-center gap-2 text-sm font-black text-[#d8bb78]\"><ExternalLink className=\"h-4 w-4\"/>Open PCG Stripe checkout</button></section><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Shipping & notes</div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><input value={detailDraft.tracking_in} onChange={event=>setDetailDraft({...detailDraft,tracking_in:event.target.value})} placeholder=\"Inbound tracking\" className={inputClass}/><input value={detailDraft.tracking_out} onChange={event=>setDetailDraft({...detailDraft,tracking_out:event.target.value})} placeholder=\"Outbound tracking\" className={inputClass}/><textarea value={detailDraft.notes} onChange={event=>setDetailDraft({...detailDraft,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveSubmissionDetails()} className=\"mt-3 bg-[#09090a]/94 px-4 py-2.5 text-sm font-black text-black\">Save submission details</button></section><section className=\"mt-6\"><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Cards in batch</div><h3 className=\"mt-1 text-xl font-black\">Card workbench</h3></div>{selectedCards.map(card=>{const draft=cardDrafts[card.id]||cardToDraft(card);return <div key={card.id} className=\"border-b border-white/[0.07] py-5\"><div className=\"flex items-center justify-between\"><div><div className=\"text-sm font-black\">Card #{card.sequence_number}</div><div className=\"mt-1 text-xs text-white/28\">{draft.cert_number||'Cert not assigned'} · {pretty(card.status)}</div></div>{draft.cert_number&&findPCGGrade(draft.grade_label)?<span className=\"inline-flex items-center gap-1 text-[10px] font-black text-emerald-300\"><Check className=\"h-3 w-3\"/>Graded</span>:null}</div><div className=\"mt-4 grid gap-2 sm:grid-cols-2\"><input value={draft.category} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,category:event.target.value}})} placeholder=\"Category\" className={inputClass}/><input value={draft.year} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,year:event.target.value}})} placeholder=\"Year\" className={inputClass}/><input value={draft.brand_set} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,brand_set:event.target.value}})} placeholder=\"Set Name\" className={inputClass}/><input value={draft.player_character} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,player_character:event.target.value}})} placeholder=\"Player Name(s)\" className={inputClass}/><input value={draft.card_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_number:event.target.value}})} placeholder=\"Card #\" className={inputClass}/><input value={draft.card_description} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_description:event.target.value}})} placeholder=\"Card Description\" className={inputClass}/><select value={draft.autograph_present} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,autograph_present:event.target.value as CardDraft['autograph_present']}})} className={inputClass}><option value=\"\">Auto Y/N</option><option value=\"yes\">Auto Yes</option><option value=\"no\">Auto No</option></select><input value={draft.declared_value} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,declared_value:event.target.value}})} type=\"number\" placeholder=\"Declared Value\" className={inputClass}/><input value={draft.cert_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,cert_number:event.target.value}})} placeholder=\"PCG#/CERT#\" className={inputClass}/><PCGGradeSelect draft={draft} onChange={next=>setCardDrafts({...cardDrafts,[card.id]:next})}/><textarea value={draft.grader_notes} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,grader_notes:event.target.value}})} placeholder=\"Grader notes\" className={`${inputClass} min-h-20 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveCard(card)} className=\"mt-3 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Save card</button></div>})}</section></aside></div>:null}</div>}"},{"path":"src/pages/card-grading/PCGWorkspace.tsx","content":"import React,{useEffect,useRef,useState} from 'react';\nimport {Archive,ArrowUpRight,CheckCircle2,Database,FileSpreadsheet,ImagePlus,Layers3,Loader2,PackageCheck,PauseCircle,Radar,RefreshCw,ScanLine,ShieldCheck,UploadCloud,XCircle} from 'lucide-react';\nimport {supabase} from '@/integrations/supabase/client';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport {useToast} from '@/hooks/use-toast';\nimport {CRMShell} from '@/components/crm/CRMShell';\nimport {cn} from '@/lib/utils';\nimport PCGGrowthLab,{PCGGrowthPulse} from '@/pages/card-grading/PCGGrowthLab';\nimport {PCG_AUTOGRAPH_NOTE,PCG_CARD_THICKNESSES,PCG_GRADING_SCALE,findPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nconst DRIVE_MEDIA_FN=`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/pcg-google-drive-media`;const CONCURRENCY=4;type DriveMedia={url:string;fileId:string};\ntype CsvRow=Record<string,string>;type BatchItem={key:string;front?:File;back?:File;row?:CsvRow;status:'queued'|'uploading'|'done'|'failed';error?:string};type CardForm={title:string;player:string;year:string;set:string;number:string;category:string;grader:string;grade:string;cert:string;condition:string;qty:string;cost:string;value:string;tags:string;notes:string};type StoredCard={id:string;player_character?:string|null;brand_set?:string|null;year?:string|null;card_number?:string|null;front_image_url?:string|null;grade?:number|null;cert_number?:string|null;metadata?:Record<string,unknown>|null};type SubmissionOption={id:string;submission_number:string;customer_name:string|null;status:string};type DriveState='checking'|'ready'|'missing'|'reconnect';type ExistingBatchCard={id:string;sequence_number:number;import_key:string|null;front_image_url:string|null;back_image_url:string|null};type VaultMode='overview'|'single'|'batch'|'growth';\nconst EMPTY_FORM:CardForm={title:'',player:'',year:'',set:'',number:'',category:'',grader:'',grade:'',cert:'',condition:'',qty:'1',cost:'',value:'',tags:'',notes:''};\nconst fileStem=(name:string)=>name.replace(/\\.[^.]+$/,'').replace(/[-_ ](?:front|back|obverse|reverse)$/i,'');const isBack=(name:string)=>/[-_ ](?:back|reverse)\\.[^.]+$/i.test(name);const rowValue=(row:CsvRow|undefined,...keys:string[])=>keys.map(key=>row?.[key]).find(Boolean)||'';const money=(value:string)=>{const parsed=Number((value||'').replace(/[$,]/g,''));return Number.isFinite(parsed)?parsed:null};\nconst normalizeHeader=(value:string)=>String(value||'').trim().toLowerCase().replace(/[^a-z0-9]+/g,'_').replace(/^_+|_+$/g,'');\nfunction parseDelimited(text:string){const sample=String(text||'').split(/\\r?\\n/,1)[0]||'';const delimiter=(sample.match(/\\t/g)||[]).length>(sample.match(/,/g)||[]).length?'\\t':',';const matrix:string[][]=[];let row:string[]=[];let value='';let quoted=false;for(let index=0;index<text.length;index+=1){const char=text[index];if(quoted){if(char==='\"'&&text[index+1]==='\"'){value+='\"';index+=1}else if(char==='\"'){quoted=false}else{value+=char}continue}if(char==='\"'){quoted=true;continue}if(char===delimiter){row.push(value);value='';continue}if(char==='\\n'){row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);row=[];value='';continue}if(char!=='\\r')value+=char}row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);const headerRow=matrix.shift()||[];const seen=new Map<string,number>();const headers=headerRow.map((cell,index)=>{const base=normalizeHeader(cell)||'column_'+(index+1);const count=(seen.get(base)||0)+1;seen.set(base,count);return count===1?base:base+'_'+count});const rows=matrix.map(cells=>Object.fromEntries(headers.map((header,index)=>[header,String(cells[index]??'').trim()]))) as CsvRow[];return{headers,rows,delimiter}}\nfunction parseCsv(text:string){return parseDelimited(text).rows}\nfunction pairFiles(files:File[],rows:CsvRow[]){const map=new Map<string,BatchItem>();for(const file of files.filter(item=>item.type.startsWith('image/'))){const key=fileStem(file.name);const item=map.get(key)||{key,status:'queued' as const};if(isBack(file.name))item.back=file;else if(!item.front)item.front=file;else map.set(`${key}-${map.size+1}`,{key:`${key}-${map.size+1}`,front:file,status:'queued'});map.set(key,item)}for(const item of map.values())item.row=rows.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase());return[...map.values()]}\nfunction ModeButton({active,children,onClick}:{active:boolean;children:React.ReactNode;onClick:()=>void}){return <button onClick={onClick} className={cn('rounded-full px-4 py-2 text-xs font-bold transition sm:text-sm',active?'bg-[#d8bb78] text-[#0b0b0c]':'text-white/48 hover:bg-white/[0.05] hover:text-white')}>{children}</button>}\nfunction Stat({label,value,detail,icon:Icon}:{label:string;value:string;detail:string;icon:React.ComponentType<{className?:string}>}){return <div className=\"min-w-0 py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.16em] text-white/32\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</div><div className=\"mt-2 text-2xl font-black tracking-tight text-white\">{value}</div><div className=\"mt-1 truncate text-xs text-white/35\">{detail}</div></div>}\nfunction Field({label,value,onChange,placeholder}:{label:string;value:string;onChange:(value:string)=>void;placeholder?:string}){return <label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">{label}</span><input value={value} onChange={event=>onChange(event.target.value)} placeholder={placeholder} className=\"mt-2 h-11 w-full border-b border-white/[0.12] bg-transparent text-sm text-white outline-none transition placeholder:text-white/18 focus:border-[#d8bb78]/65\"/></label>}\nfunction PCGGradeField({grade:_grade,designation,onChange}:{grade:string;designation:string;onChange:(grade:string,designation:string)=>void}){const selected=findPCGGrade(designation);return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">PCG grade</span><select value={designation} onChange={event=>{const option=findPCGGrade(event.target.value);onChange(option?.numeric==null?'':String(option.numeric),option?.designation||'')}} className=\"mt-2 h-11 w-full border border-white/[0.12] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/65\"><option value=\"\">Select official PCG designation</option>{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<details className=\"mt-2 border border-white/[0.08] bg-[#09090a]/94/[.025] px-3 py-2\"><summary className=\"cursor-pointer text-[10px] font-black uppercase tracking-[.13em] text-[#d8bb78]\">Official criteria</summary><p className=\"mt-2 text-xs leading-5 text-white/55\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</p><div className=\"mt-2 text-[10px] text-white/35\">Card sizes: {PCG_CARD_THICKNESSES.join(' · ')} · {PCG_AUTOGRAPH_NOTE}</div></details>:null}</div>}\nfunction ImageTile({label,file,onFile}:{label:string;file:File|null;onFile:(file:File|null)=>void}){return <label className=\"group flex min-h-36 cursor-pointer flex-col justify-between border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 transition hover:border-[#d8bb78]/30 hover:bg-[#d8bb78]/[0.035]\"><input type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={event=>onFile(event.target.files?.[0]||null)}/><div className=\"flex items-center justify-between\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/35\">{label}</span>{file?<CheckCircle2 className=\"h-5 w-5 text-emerald-400\"/>:<ImagePlus className=\"h-5 w-5 text-[#d8bb78]\"/>}</div><div><div className=\"truncate text-sm font-bold text-white/82\">{file?.name||`Choose ${label.toLowerCase()} image`}</div><div className=\"mt-1 text-xs text-white/28\">Private PCG card photography.</div></div></label>}\nfunction DemoCardFace({card}:{card:StoredCard}){const subject=String(card.player_character||card.brand_set||'Trading Card').replace(/^DEMO\\s*[—-]\\s*/i,'');const detail=[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ');return <div className=\"absolute inset-1.5 flex flex-col overflow-hidden rounded-[14px] border border-[#d8bb78]/45 bg-[radial-gradient(circle_at_72%_18%,rgba(216,187,120,.26),transparent_38%),linear-gradient(145deg,rgba(30,27,20,.98),rgba(7,7,8,.98)_58%,rgba(27,23,15,.98))] p-2.5 shadow-[inset_0_0_0_1px_rgba(255,255,255,.06),0_14px_32px_rgba(0,0,0,.26)]\"><div className=\"flex items-center justify-between gap-1\"><div className=\"flex items-center gap-1.5 text-[8px] font-black uppercase tracking-[.14em] text-[#ecd797]\"><ScanLine className=\"h-3 w-3\"/>PCG Demo</div><div className=\"rounded-full border border-white/10 bg-black/35 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-[.08em] text-white/46\">Trading card</div></div><div className=\"my-auto grid place-items-center\"><div className=\"grid h-14 w-14 place-items-center rounded-[16px] border border-[#d8bb78]/25 bg-[#d8bb78]/[0.08] shadow-[0_0_36px_rgba(216,187,120,.10)]\"><Archive className=\"h-6 w-6 text-[#d8bb78]\"/></div></div><div><div className=\"line-clamp-2 text-sm font-black leading-tight text-white\">{subject}</div><div className=\"mt-1.5 line-clamp-2 text-[9px] font-bold uppercase tracking-[.06em] text-white/42\">{detail||card.cert_number||'PCG sample record'}</div></div></div>}\n\nexport function PCGCardVaultContent({initialMode='overview',initialSubmissionId=''}:{initialMode?:VaultMode;initialSubmissionId?:string}={}){const{activeTenant}=useMultiTenant();const{toast}=useToast();const tenantId=activeTenant?.id||'';const[mode,setMode]=useState<VaultMode>(initialMode);useEffect(()=>{setMode(initialMode)},[initialMode]);const[form,setForm]=useState<CardForm>(EMPTY_FORM);const[front,setFront]=useState<File|null>(null);const[reverse,setReverse]=useState<File|null>(null);const[saving,setSaving]=useState(false);const[rows,setRows]=useState<CsvRow[]>([]);const[items,setItems]=useState<BatchItem[]>([]);const[session,setSession]=useState('');const[running,setRunning]=useState(false);const[recent,setRecent]=useState<StoredCard[]>([]);const[total,setTotal]=useState(0);const[submissionOptions,setSubmissionOptions]=useState<SubmissionOption[]>([]);const[selectedSubmissionId,setSelectedSubmissionId]=useState('');const[driveState,setDriveState]=useState<DriveState>('checking');const stop=useRef(false);const done=items.filter(item=>item.status==='done').length;const failed=items.filter(item=>item.status==='failed').length;const remaining=items.filter(item=>item.status==='queued'||item.status==='failed');const progress=items.length?Math.round(((done+failed)/items.length)*100):0;const selectedSubmission=submissionOptions.find(item=>item.id===selectedSubmissionId)||null;const driveReady=driveState==='ready';\nasync function load(){if(!tenantId)return;setDriveState('checking');const[cardsResult,submissionResult,googleResult]=await Promise.all([(supabase as any).from('card_grading_cards').select('id,player_character,brand_set,year,card_number,front_image_url,grade,cert_number,metadata',{count:'exact'}).eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(12),(supabase as any).from('card_grading_submissions').select('id,submission_number,customer_name,status').eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(50),(supabase as any).from('tenant_provider_credentials').select('credential_status,metadata').eq('tenant_id',tenantId).eq('provider','google_workspace').maybeSingle()]);setRecent(cardsResult.data||[]);setTotal(Number(cardsResult.count||0));const eligible=((submissionResult.data||[]) as SubmissionOption[]).filter(item=>['received','intake_imaging','authentication','grading','encapsulation','qa'].includes(String(item.status||'')));setSubmissionOptions(eligible);setSelectedSubmissionId(current=>eligible.some(item=>item.id===initialSubmissionId)?initialSubmissionId:(eligible.some(item=>item.id===current)?current:(eligible[0]?.id||'')));const google=googleResult.data as any;const scopes=Array.isArray(google?.metadata?.granted_scopes)?google.metadata.granted_scopes.map((value:unknown)=>String(value)):[];setDriveState(google?.credential_status==='active'?(scopes.includes('https://www.googleapis.com/auth/drive.file')?'ready':'reconnect'):'missing')}useEffect(()=>{void load()},[tenantId,initialSubmissionId]);\nasync function createSubmission(label:string){const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:`VAULT-${Date.now()}-${crypto.randomUUID().slice(0,6)}`,customer_name:'PCG Internal Inventory',service_tier:'inventory',service_price:0,status:'received',notes:label,payment_status:'unverified'}).select('id').single();if(error)throw error;return data.id}\nasync function upload(file:File,sessionKey:string,key:string,side:string,importKey:string):Promise<DriveMedia>{const{data}=await supabase.auth.getSession();if(!data.session?.access_token)throw new Error('Please sign in again.');const params=new URLSearchParams({tenant_id:tenantId,session_key:sessionKey,import_key:importKey,key,side,name:file.name,content_type:file.type||'application/octet-stream'});const response=await fetch(DRIVE_MEDIA_FN+'/upload?'+params.toString(),{method:'POST',headers:{Authorization:'Bearer '+data.session.access_token,'Content-Type':file.type||'application/octet-stream'},body:file});const payload=await response.json().catch(()=>null);if(!response.ok||!payload?.ok)throw new Error(payload?.error||'Google Drive upload failed');return{url:String(payload.url||''),fileId:String(payload.file_id||'')}}\nasync function storeCard(submissionId:string,importKey:string,frontMedia:DriveMedia|null,backMedia:DriveMedia|null,row?:CsvRow,values:Partial<CardForm>={},target?:{id?:string;sequenceNumber?:number}){const metadata={title:values.title||rowValue(row,'title','name'),grading_company:values.grader||rowValue(row,'grading_company','grader'),condition:values.condition||rowValue(row,'condition'),quantity:Number(values.qty||rowValue(row,'quantity')||1)||1,acquisition_cost:money(values.cost||rowValue(row,'acquisition_cost','cost')),estimated_value:money(values.value||rowValue(row,'estimated_value','value')),tags:String(values.tags||rowValue(row,'tags')).split(/[;,]/).map(item=>item.trim()).filter(Boolean),notes:values.notes||rowValue(row,'notes'),...(frontMedia?.fileId||backMedia?.fileId?{image_storage:'google_workspace_drive',drive_media:{provider:'google_workspace',front_file_id:frontMedia?.fileId||null,back_file_id:backMedia?.fileId||null}}:{})};const payload={tenant_id:tenantId,submission_id:submissionId,sequence_number:target?.sequenceNumber||1,category:values.category||rowValue(row,'category','sport'),year:values.year||rowValue(row,'year'),brand_set:values.set||rowValue(row,'brand_set','set','brand'),player_character:values.player||rowValue(row,'player','subject'),card_number:values.number||rowValue(row,'card_number','card_no'),declared_value:money(values.value||rowValue(row,'estimated_value','value')),grade:money(values.grade||rowValue(row,'grade')),grade_label:values.condition||rowValue(row,'condition'),cert_number:values.cert||rowValue(row,'cert_number','cert','serial'),front_image_url:frontMedia?.url||null,back_image_url:backMedia?.url||null,grader_notes:values.notes||rowValue(row,'notes')||null,status:'received',import_key:importKey,metadata};if(target?.id){const{error}=await(supabase as any).from('card_grading_cards').update(payload).eq('tenant_id',tenantId).eq('id',target.id);if(error)throw error;return}const{error}=await(supabase as any).from('card_grading_cards').upsert(payload,{onConflict:'tenant_id,import_key',ignoreDuplicates:true});if(error)throw error}\nasync function saveSingle(){if(!front&&!reverse)return toast({title:'Add at least one card image'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before storing new PCG card images.',variant:'destructive'});setSaving(true);try{const sessionKey='single-'+crypto.randomUUID();const submissionId=await createSubmission('Internal inventory card upload');const frontMedia=front?await upload(front,sessionKey,'card','front',sessionKey):null;const backMedia=reverse?await upload(reverse,sessionKey,'card','back',sessionKey):null;await storeCard(submissionId,sessionKey,frontMedia,backMedia,undefined,form);setForm(EMPTY_FORM);setFront(null);setReverse(null);toast({title:'Card stored in PCG',description:'Master imagery is stored in the connected PCG Google Drive.'});await load()}catch(error){toast({title:'Could not save card',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setSaving(false)}}\nasync function runBatch(batch:BatchItem[]){if(!session||!batch.length)return;if(!selectedSubmissionId)return toast({title:'Select a grading order first',description:'Mass Intake attaches images to an existing collector order.',variant:'destructive'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before starting image intake.',variant:'destructive'});const selected=submissionOptions.find(item=>item.id===selectedSubmissionId);if(!selected)return toast({title:'That grading order is no longer available',description:'Choose another open PCG order.',variant:'destructive'});setRunning(true);stop.current=false;let failedCount=0;try{const existingResult=await(supabase as any).from('card_grading_cards').select('id,sequence_number,import_key,front_image_url,back_image_url').eq('tenant_id',tenantId).eq('submission_id',selectedSubmissionId).order('sequence_number',{ascending:true});if(existingResult.error)throw existingResult.error;const existingCards=(existingResult.data||[]) as ExistingBatchCard[];const byImport=new Map(existingCards.filter(card=>card.import_key).map(card=>[String(card.import_key),card]));const blankSlots=existingCards.filter(card=>!card.import_key&&!card.front_image_url&&!card.back_image_url).sort((a,b)=>a.sequence_number-b.sequence_number);let nextSequence=Math.max(0,...existingCards.map(card=>Number(card.sequence_number)||0))+1;const plans=batch.map(item=>{const importKey=('pcg:'+selectedSubmissionId+':'+item.key).toLowerCase().replace(/[^a-z0-9:._-]+/g,'-');const existing=byImport.get(importKey);if(existing)return{item,importKey,existing:true,targetId:existing.id,sequenceNumber:existing.sequence_number};const slot=blankSlots.shift();return{item,importKey,existing:false,targetId:slot?.id,sequenceNumber:slot?.sequence_number||nextSequence++}});let cursor=0;const worker=async()=>{while(!stop.current){const index=cursor++;if(index>=plans.length)return;const plan=plans[index];const item=plan.item;try{setItems(current=>current.map(row=>row.key===item.key?{...row,status:'uploading',error:undefined}:row));if(!plan.existing){const frontMedia=item.front?await upload(item.front,session,item.key,'front',plan.importKey):null;const backMedia=item.back?await upload(item.back,session,item.key,'back',plan.importKey):null;await storeCard(selectedSubmissionId,plan.importKey,frontMedia,backMedia,item.row,undefined,{id:plan.targetId,sequenceNumber:plan.sequenceNumber})}setItems(current=>current.map(row=>row.key===item.key?{...row,status:'done'}:row))}catch(error){failedCount+=1;setItems(current=>current.map(row=>row.key===item.key?{...row,status:'failed',error:error instanceof Error?error.message:String(error)}:row))}}};await Promise.all(Array.from({length:Math.min(CONCURRENCY,plans.length)},worker));if(!stop.current&&failedCount===0&&selected.status==='received'){const advanced=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selectedSubmissionId,p_status:'intake_imaging'});if(advanced.error)throw advanced.error}toast({title:stop.current?'Batch paused':failedCount?'Batch needs attention':'Order intake complete',description:failedCount?failedCount+' card'+(failedCount===1?'':'s')+' can be retried safely.':selected.submission_number+' now owns these canonical card records and Drive images.'});await load()}catch(error){toast({title:'Mass intake could not finish',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setRunning(false)}}const update=(key:keyof CardForm,value:string)=>setForm(current=>({...current,[key]:value}));\nreturn <div className=\"pcg-card-vault w-full text-white\"><style>{`.pcg-card-vault .text-white\\\\/18,.pcg-card-vault .text-white\\\\/24,.pcg-card-vault .text-white\\\\/28,.pcg-card-vault .text-white\\\\/30,.pcg-card-vault .text-white\\\\/32,.pcg-card-vault .text-white\\\\/34,.pcg-card-vault .text-white\\\\/35,.pcg-card-vault .text-white\\\\/36,.pcg-card-vault .text-white\\\\/38,.pcg-card-vault .text-white\\\\/42,.pcg-card-vault .text-white\\\\/44,.pcg-card-vault .text-white\\\\/48{color:rgba(255,255,255,.68)!important}`}</style><section className=\"border-b border-white/[0.08] pb-6\"><div className=\"flex flex-col gap-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"flex items-center gap-2 text-[10px] font-black uppercase tracking-[.19em] text-[#d8bb78]\"><ScanLine className=\"h-4 w-4\"/>PCG Card Vault</div><h1 className=\"mt-3 text-[34px] font-black leading-none tracking-[-0.045em] sm:text-[46px]\">Card Vault</h1><p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/44\">Capture one card or move an entire collection into PCG. Master imagery stays in the connected PCG Google Drive.</p></div><div className=\"flex max-w-full flex-wrap items-center rounded-2xl border border-white/[0.08] bg-[#09090a]/94/[.025] p-1\"><ModeButton active={mode==='overview'} onClick={()=>setMode('overview')}>Overview</ModeButton><ModeButton active={mode==='single'} onClick={()=>setMode('single')}>Internal inventory</ModeButton><ModeButton active={mode==='batch'} onClick={()=>setMode('batch')}>Mass intake</ModeButton><ModeButton active={mode==='growth'} onClick={()=>setMode('growth')}>Growth Lab</ModeButton></div></div><div className=\"mt-7 grid sm:grid-cols-4\"><Stat icon={Archive} label=\"Cards on file\" value={total.toLocaleString()} detail=\"Canonical PCG records\"/><Stat icon={Layers3} label=\"Current batch\" value={items.length.toLocaleString()} detail={items.length?`${done} stored so far`:'No intake running'}/><Stat icon={PackageCheck} label=\"Exceptions\" value={failed.toLocaleString()} detail={failed?'Ready to retry safely':'No failed uploads'}/><Stat icon={ShieldCheck} label=\"Storage\" value=\"Google Drive\" detail=\"PCG-owned master imagery\"/></div></section>{mode==='overview'?<PCGGrowthPulse tenantId={tenantId} onOpen={()=>setMode('growth')}/>:null}\n{mode==='overview'?<div className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.15fr)_minmax(350px,.85fr)]\"><section><div className=\"mb-3 text-[10px] font-black uppercase tracking-[.17em] text-white/30\">Start an intake</div><div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] sm:grid-cols-2\"><button onClick={()=>setMode('single')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-[#09090a]/94/[.025]\"><div className=\"flex items-start justify-between\"><ImagePlus className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Internal inventory card</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Create a standalone PCG-owned inventory record. This is not a collector grading submission.</p></div></button><button onClick={()=>setMode('batch')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-[#09090a]/94/[.025]\"><div className=\"flex items-start justify-between\"><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Mass card intake</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Hundreds or thousands, front/back pairing, optional CSV, pause and safe retry.</p></div></button></div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"flex items-center justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Storage contract</div><h2 className=\"mt-2 text-lg font-black\">Built for volume</h2></div><Database className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-5 divide-y divide-white/[0.07]\">{[['Google Drive masters','New originals live in the connected PCG Google Workspace, not KnockLaunch storage.'],['Safe retry','Completed imports keep a stable identity.'],['Canonical records','Single and batch intake write to the same card records.']].map(([title,copy])=><div key={title} className=\"py-4 first:pt-0\"><div className=\"flex items-center gap-2 text-sm font-bold text-white/80\"><CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>{title}</div><p className=\"mt-1.5 pl-6 text-xs leading-5 text-white/32\">{copy}</p></div>)}</div></section></div>:null}\n{mode==='growth'?<div className=\"mt-7\"><PCGGrowthLab tenantId={tenantId}/></div>:null}\n{mode==='single'?<section className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,.65fr)]\"><div><div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Internal inventory</div><h2 className=\"mt-2 text-xl font-black\">Inventory card details</h2></div><div className=\"mt-6 grid gap-x-7 gap-y-5 sm:grid-cols-2\"><Field label=\"Title\" value={form.title} onChange={value=>update('title',value)}/><Field label=\"Player / subject\" value={form.player} onChange={value=>update('player',value)}/><Field label=\"Year\" value={form.year} onChange={value=>update('year',value)}/><Field label=\"Set / brand\" value={form.set} onChange={value=>update('set',value)}/><Field label=\"Card number\" value={form.number} onChange={value=>update('number',value)}/><Field label=\"Sport / category\" value={form.category} onChange={value=>update('category',value)}/><Field label=\"Grading company\" value={form.grader} onChange={value=>update('grader',value)}/><Field label=\"Certification / serial\" value={form.cert} onChange={value=>update('cert',value)}/><PCGGradeField grade={form.grade} designation={form.condition} onChange={(grade,designation)=>setForm(current=>({...current,grade,condition:designation}))}/><Field label=\"Quantity\" value={form.qty} onChange={value=>update('qty',value)}/><Field label=\"Acquisition cost\" value={form.cost} onChange={value=>update('cost',value)} placeholder=\"$0.00\"/><Field label=\"Estimated value\" value={form.value} onChange={value=>update('value',value)} placeholder=\"$0.00\"/><Field label=\"Tags\" value={form.tags} onChange={value=>update('tags',value)} placeholder=\"rookie, refractor, auto\"/></div><label className=\"mt-6 block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">Internal notes</span><textarea value={form.notes} onChange={event=>update('notes',event.target.value)} rows={4} className=\"mt-2 w-full border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 text-sm leading-6 text-white outline-none focus:border-[#d8bb78]/40\"/></label></div><div className=\"self-start border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card imagery</div><div className=\"mt-4 grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08]\"><ImageTile label=\"Front\" file={front} onFile={setFront}/><ImageTile label=\"Back\" file={reverse} onFile={setReverse}/></div><button onClick={()=>void saveSingle()} disabled={saving} className=\"mt-4 flex h-12 w-full items-center justify-center gap-2 bg-[#d8bb78] text-sm font-black text-[#09090a] transition hover:bg-[#e3c886] disabled:opacity-50\">{saving?<Loader2 className=\"h-4 w-4 animate-spin\"/>:<Archive className=\"h-4 w-4\"/>}{saving?'Storing card…':'Store inventory card'}</button></div></section>:null}\n{mode==='batch'?<section className=\"mt-7 space-y-5\"><div className=\"border border-white/[0.08] bg-[#09090a]/94 p-5\"><div className=\"flex flex-col gap-4 lg:flex-row lg:items-end\"><label className=\"min-w-0 flex-1\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">1 · Collector order</span><select value={selectedSubmissionId} onChange={event=>{setSelectedSubmissionId(event.target.value);setSession('');setRows([]);setItems([])}} disabled={running} className=\"mt-2 h-12 w-full border border-white/[0.10] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/55\"><option value=\"\">Select an open PCG order</option>{submissionOptions.map(option=><option key={option.id} value={option.id}>{option.submission_number} · {option.customer_name||'Collector'} · {option.status.replaceAll('_',' ')}</option>)}</select></label><div className=\"flex flex-wrap items-center gap-2 lg:justify-end\"><span className={cn('inline-flex h-10 items-center gap-2 border px-3 text-xs font-black',driveReady?'border-emerald-400/25 bg-emerald-400/[.07] text-emerald-200':'border-amber-400/25 bg-amber-400/[.07] text-amber-100')}><ShieldCheck className=\"h-4 w-4\"/>{driveState==='checking'?'Checking Drive…':driveReady?'Google Drive ready':driveState==='reconnect'?'Reconnect Google Workspace':'Google Workspace required'}</span><a href=\"?mode=submissions&tool=submissions\" className=\"inline-flex min-h-11 items-center border border-white/[0.10] px-3 py-2 text-xs font-black text-white/65\">Receive Cards</a>{!driveReady&&driveState!=='checking'?<a href=\"?tool=settings\" className=\"inline-flex min-h-11 items-center border border-[#d8bb78]/25 px-3 py-2 text-xs font-black text-[#d8bb78]\">Open settings</a>:null}</div></div><p className=\"mt-3 text-xs leading-5 text-white/42\">{selectedSubmission?'Images and CSV details will become the canonical cards for '+selectedSubmission.submission_number+' · '+(selectedSubmission.customer_name||'Collector')+'. No second submission is created.':'Create or choose the customer’s grading order before loading card images.'}</p></div>{!submissionOptions.length?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5 text-sm text-amber-100/80\">No open PCG grading orders are available. Create the collector order from <a href=\"?mode=submissions&tool=submissions\" className=\"font-black text-[#d8bb78] underline underline-offset-4\">Receive Cards</a>, then return to Mass Intake.</div>:null}{driveState==='missing'||driveState==='reconnect'?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5\"><div className=\"text-sm font-black text-amber-100\">{driveState==='reconnect'?'Google Workspace needs Drive permission':'Connect PCG Google Workspace before image intake'}</div><p className=\"mt-1 text-xs leading-5 text-white/45\">New PCG master images are stored in Anthony’s Google Drive. Intake stays locked until that private Drive connection is ready.</p></div>:null}<div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] lg:grid-cols-2\"><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',selectedSubmissionId&&driveReady&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" multiple accept=\"image/*\" disabled={!selectedSubmissionId||!driveReady||running} className=\"hidden\" onChange={event=>{if(!event.target.files)return;setSession('batch-'+crypto.randomUUID());setRows([]);setItems(pairFiles(Array.from(event.target.files),[]))}}/><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">2 · Choose the card image batch</h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Front/back filenames pair automatically. The selected order owns every imported card.</p></div></label><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',items.length&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" accept=\".csv,text/csv\" disabled={!items.length||running} className=\"hidden\" onChange={event=>event.target.files?.[0]?.text().then(text=>{const parsed=parseCsv(text);setRows(parsed);setItems(current=>current.map(item=>({...item,row:parsed.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase())})))})}/><FileSpreadsheet className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">3 · Attach CSV details <span className=\"text-white/30\">(optional)</span></h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Map filenames, player, set, year and card number into those same canonical order records.</p></div></label></div><div className=\"border border-white/[0.08] bg-[#09090a]/94\"><div className=\"flex flex-col gap-4 border-b border-white/[0.07] p-5 sm:flex-row sm:items-center\"><div className=\"mr-auto\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Mass intake queue</div><div className=\"mt-1 text-lg font-black\">{items.length.toLocaleString()} cards <span className=\"font-medium text-white/30\">· {done} stored · {failed} failed</span></div>{selectedSubmission?<div className=\"mt-1 text-xs font-bold text-[#d8bb78]/80\">{selectedSubmission.submission_number} · {selectedSubmission.customer_name||'Collector'}</div>:null}</div>{running?<button onClick={()=>{stop.current=true}} className=\"inline-flex h-10 items-center gap-2 border border-white/[0.10] px-4 text-xs font-bold\"><PauseCircle className=\"h-4 w-4\"/>Pause intake</button>:<button disabled={!remaining.length||!selectedSubmissionId||!driveReady} onClick={()=>void runBatch(remaining)} className=\"inline-flex h-10 items-center gap-2 bg-[#d8bb78] px-4 text-xs font-black text-black disabled:opacity-35\"><UploadCloud className=\"h-4 w-4\"/>{!driveReady?'Google Drive required':!selectedSubmissionId?'Select an order':failed?'Retry remaining':'Start mass intake'}</button>}</div><div className=\"h-1 bg-white/[0.05]\"><div className=\"h-full bg-[#d8bb78]\" style={{width:`${progress}%`}}/></div><div className=\"max-h-[360px] overflow-auto p-2\">{!items.length?<div className=\"grid min-h-44 place-items-center text-center\"><div><Layers3 className=\"mx-auto h-7 w-7 text-white/16\"/><div className=\"mt-3 text-sm font-bold text-white/48\">No card batch loaded</div><div className=\"mt-1 text-xs text-white/28\">Choose an order, then load its card images.</div></div></div>:items.slice(0,2000).map((item,index)=><div key={`${item.key}-${index}`} className=\"grid grid-cols-[1fr_auto] items-center gap-3 px-3 py-2.5 text-sm\"><div className=\"min-w-0\"><div className=\"truncate font-semibold text-white/72\">{item.key}</div><div className=\"truncate text-[10px] text-white/24\">{item.front?.name}{item.back?' + back':''}</div></div>{item.status==='done'?<CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>:item.status==='failed'?<XCircle className=\"h-4 w-4 text-rose-400\"/>:item.status==='uploading'?<Loader2 className=\"h-4 w-4 animate-spin text-[#d8bb78]\"/>:<span className=\"text-[10px] text-white/24\">Queued</span>}</div>)}</div></div></section>:null}\n<section className=\"mt-8 border-t border-white/[0.08] pt-6\"><div className=\"flex items-end justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card Vault</div><h2 className=\"mt-1 text-lg font-black\">Recently stored</h2></div><button onClick={()=>void load()} aria-label=\"Refresh stored cards\" className=\"grid h-11 w-11 place-items-center border border-white/[0.08] text-white/36\"><RefreshCw className=\"h-4 w-4\"/></button></div>{recent.length?<div className=\"mt-4 grid grid-cols-2 gap-px overflow-hidden border border-white/[0.07] bg-white/[0.07] sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-9\">{recent.map(card=><article key={card.id} className=\"bg-black/48\"><div className=\"relative aspect-[3/4] overflow-hidden bg-[#080809]\">{card.metadata?.demo?<DemoCardFace card={card}/>:card.front_image_url?<img src={card.front_image_url} alt=\"\" className=\"h-full w-full object-contain p-2\"/>:<div className=\"grid h-full place-items-center\"><Archive className=\"h-7 w-7 text-white/12\"/></div>}{card.grade?<div className=\"absolute right-2 top-2 z-10 bg-black/78 px-2 py-1 text-[10px] font-black text-[#e5cd93]\">{card.grade}</div>:null}</div><div className=\"p-2.5\"><div className=\"truncate text-xs font-bold\">{card.player_character||card.brand_set||'Card'}</div><div className=\"mt-1 truncate text-[10px] text-white/30\">{[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ')||card.cert_number||'PCG record'}</div></div></article>)}</div>:<div className=\"mt-4 grid min-h-36 place-items-center border border-dashed border-white/[0.08] bg-black/20 text-center\"><div><Archive className=\"mx-auto h-7 w-7 text-white/12\"/><div className=\"mt-2 text-sm font-bold text-white/42\">The vault is ready.</div></div></div>}</section></div>}\nexport default function PCGWorkspace(){return <CRMShell><div className=\"mx-auto w-full max-w-[1500px] px-4 py-5 sm:px-6 sm:py-7 xl:px-9 xl:py-8\"><PCGCardVaultContent/></div></CRMShell>}\n"},{"path":"src/pages/card-grading/PCGCompletionCenter.tsx","content":"import React from 'react';\nimport {AlertTriangle,CheckCircle2,Mail,Truck} from 'lucide-react';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport {supabase} from '@/integrations/supabase/client';\nimport {formatPCGGrade} from '@/pages/card-grading/pcgGradingScale';\n\ntype Sub={id:string;submission_number:string;customer_name:string|null;customer_email:string|null;status:string;tracking_out:string|null};\ntype Card={id:string;submission_id:string;sequence_number:number;player_character:string|null;year:string|null;brand_set:string|null;grade:number|null;grade_label:string|null;cert_number:string|null;front_image_url:string|null;slab_image_url:string|null};\ntype HandoffStats={total:number;graded:number;certified:number;imaged:number};\nconst esc=(v:unknown)=>String(v??'').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\"/g,'&quot;');\n\nexport default function PCGCompletionCenter({mode}:{mode:'completed'|'mailed'}){\n  const{activeTenant}=useMultiTenant();const tenantId=activeTenant?.id||'';const slug=String(activeTenant?.company_slug||'pcg').trim().toLowerCase()||'pcg';const wmpUrl='https://whatsmyprogress.com/'+encodeURIComponent(slug)+'/';\n  const[subs,setSubs]=React.useState<Sub[]>([]);const[cards,setCards]=React.useState<Card[]>([]);const[loading,setLoading]=React.useState(true);const[sending,setSending]=React.useState<string|null>(null);const[armed,setArmed]=React.useState<string|null>(null);const[message,setMessage]=React.useState('');\n  const load=React.useCallback(async()=>{if(!tenantId)return;setLoading(true);const statuses=mode==='completed'?['ready']:['shipped','picked_up'];const s=await(supabase as any).from('card_grading_submissions').select('id,submission_number,customer_name,customer_email,status,tracking_out').eq('tenant_id',tenantId).in('status',statuses).order('updated_at',{ascending:false}).limit(30);const ids=(s.data||[]).map((x:any)=>x.id);let c:any={data:[]};if(ids.length)c=await(supabase as any).from('card_grading_cards').select('id,submission_id,sequence_number,player_character,year,brand_set,grade,grade_label,cert_number,front_image_url,slab_image_url').eq('tenant_id',tenantId).in('submission_id',ids).order('sequence_number',{ascending:true});setSubs(s.data||[]);setCards(c.data||[]);setArmed(null);setLoading(false)},[mode,tenantId]);\n  React.useEffect(()=>{void load()},[load]);\n  const ownCards=(sub:Sub)=>cards.filter(card=>card.submission_id===sub.id);\n  const stats=(sub:Sub):HandoffStats=>{const own=ownCards(sub);return{total:own.length,graded:own.filter(card=>card.grade!=null||Boolean(card.grade_label)).length,certified:own.filter(card=>Boolean(card.cert_number)).length,imaged:own.filter(card=>Boolean(card.slab_image_url||card.front_image_url)).length}};\n  const issues=(sub:Sub)=>{const value:string[]=[];const s=stats(sub);if(mode==='completed'){if(!s.total)value.push('no cards are attached');else{if(s.graded<s.total)value.push(`${s.total-s.graded} card${s.total-s.graded===1?' is':'s are'} missing a grade`);if(s.certified<s.total)value.push(`${s.total-s.certified} card${s.total-s.certified===1?' is':'s are'} missing a cert number`);if(s.imaged<s.total)value.push(`${s.total-s.imaged} card${s.total-s.imaged===1?' is':'s are'} missing a customer-visible image`)}}if(mode==='mailed'&&!sub.tracking_out)value.push('outbound tracking is missing');return value};\n  const send=async(sub:Sub)=>{if(!sub.customer_email||sending)return;setSending(sub.id);setMessage('');const own=ownCards(sub);const images=own.map(card=>card.slab_image_url||card.front_image_url).filter(Boolean) as string[];const shipped=mode==='mailed';const summary=own.length?`<h2 style=\"margin:24px 0 10px\">Your cards</h2><table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse\">${own.map(card=>{const name=[card.year,card.brand_set,card.player_character].filter(Boolean).join(' · ')||`Card #${card.sequence_number}`;const grade=formatPCGGrade(card.grade,card.grade_label);const cert=card.cert_number?`PCG#/CERT# ${card.cert_number}`:'Cert pending';return`<tr><td style=\"padding:10px 0;border-bottom:1px solid #e6e2d9\"><strong>${esc(name)}</strong><br><span style=\"color:#68645b;font-size:13px\">${esc(grade)} · ${esc(cert)}</span></td></tr>`}).join('')}</table>`:'';const body=`<!doctype html><html><body data-knocklaunch-email=\"pcg-order-update\" style=\"font-family:Arial,sans-serif;color:#171614;line-height:1.5\"><h1 style=\"margin:0 0 12px\">${shipped?'Your PCG order is on the way':'Your PCG grading order is complete'}</h1><p>Hi ${esc(sub.customer_name||'there')},</p><p>${shipped?'Your graded cards have been mailed back to you.':'Your cards have completed grading and are being prepared for return.'}</p><p><strong>Order:</strong> ${esc(sub.submission_number)}</p>${sub.tracking_out?`<p><strong>Tracking:</strong> ${esc(sub.tracking_out)}</p>`:''}<p><a href=\"${wmpUrl}\">View your live grading progress</a></p>${summary}${images.length?`<h2 style=\"margin:24px 0 10px\">Card images</h2><div>${images.slice(0,20).map((url,index)=>`<img src=\"${esc(url)}\" alt=\"Graded card ${index+1}\" style=\"width:150px;max-width:45%;height:auto;margin:6px;border:1px solid #ddd\"/>`).join('')}</div>`:''}<p style=\"margin-top:24px\">Thank you for choosing Prestigious Card Grading.</p></body></html>`;\n    const result=await supabase.functions.invoke('send-email',{body:{tenantId,to:sub.customer_email,subject:shipped?`Your PCG order ${sub.submission_number} has shipped`:`Your PCG order ${sub.submission_number} is complete`,body,idempotencyKey:`pcg-${mode}:${sub.id}:${sub.status}`,eventType:shipped?'pcg_order_shipped':'pcg_grading_completed',fromName:'Prestigious Card Grading'}});\n    if(result.error||!result.data?.ok)setMessage(result.data?.error||result.error?.message||'Email could not be sent. Check the PCG business mailbox connection.');else setMessage(result.data?.deduped?'This customer update was already sent.':'Customer update sent.');setArmed(null);setSending(null)};\n  const requestSend=(sub:Sub)=>{const warnings=issues(sub);if(warnings.length&&armed!==sub.id){setArmed(sub.id);setMessage(`${sub.submission_number} needs review: ${warnings.join('; ')}. Fix the record, or click Send anyway if this is intentional.`);return}void send(sub)};\n  return <section className=\"mx-auto max-w-[1600px] px-4 pt-4 sm:px-6 lg:px-8\"><div className=\"border border-white/10 bg-[#09090a]/94 p-4\"><div className=\"flex items-center gap-3\">{mode==='mailed'?<Truck className=\"h-5 w-5 text-[#d8bb78]\"/>:<CheckCircle2 className=\"h-5 w-5 text-[#d8bb78]\"/>}<div><div className=\"text-[10px] font-black uppercase tracking-[.17em] text-[#d8bb78]\">{mode==='mailed'?'Shipment handoff':'Completion handoff'}</div><h2 className=\"mt-1 text-xl font-black\">{mode==='mailed'?'Tracking + customer update':'Review & notify customer'}</h2></div></div>{message?<div className=\"mt-4 border border-white/10 bg-white/[.04] p-3 text-sm text-white/65\">{message}</div>:null}{loading?<div className=\"mt-5 text-sm text-white/35\">Loading customer handoffs…</div>:subs.length?<div className=\"mt-5 divide-y divide-white/8\">{subs.map(sub=>{const s=stats(sub);const warnings=issues(sub);const isArmed=armed===sub.id;return <div key={sub.id} className=\"py-3\"><div className=\"flex flex-col gap-4 xl:flex-row xl:items-center\"><div className=\"min-w-0 flex-1\"><div className=\"font-black\">{sub.submission_number} · {sub.customer_name||'Collector'}</div><div className=\"mt-1 truncate text-xs text-white/35\">{sub.customer_email||'Customer email missing'}{sub.tracking_out?` · Tracking ${sub.tracking_out}`:''}</div><div className=\"mt-3 grid max-w-xl grid-cols-4 gap-px overflow-hidden border border-white/[.07] bg-white/[.07]\"><div className=\"bg-[#09090a]/94/[.025] p-2.5\"><div className=\"text-[9px] font-black uppercase text-white/30\">Cards</div><div className=\"mt-1 font-black\">{s.total}</div></div><div className=\"bg-[#09090a]/94/[.025] p-2.5\"><div className=\"text-[9px] font-black uppercase text-white/30\">Graded</div><div className=\"mt-1 font-black\">{s.graded}/{s.total}</div></div><div className=\"bg-[#09090a]/94/[.025] p-2.5\"><div className=\"text-[9px] font-black uppercase text-white/30\">Certs</div><div className=\"mt-1 font-black\">{s.certified}/{s.total}</div></div><div className=\"bg-[#09090a]/94/[.025] p-2.5\"><div className=\"text-[9px] font-black uppercase text-white/30\">Images</div><div className=\"mt-1 font-black\">{s.imaged}/{s.total}</div></div></div>{warnings.length?<div className=\"mt-3 flex max-w-2xl items-start gap-2 text-xs leading-5 text-amber-100/80\"><AlertTriangle className=\"mt-0.5 h-4 w-4 shrink-0 text-amber-300\"/><span>{warnings.join(' · ')}</span></div>:<div className=\"mt-3 inline-flex items-center gap-2 text-xs font-black text-emerald-300\"><CheckCircle2 className=\"h-4 w-4\"/>Customer handoff ready</div>}</div><button disabled={!sub.customer_email||sending===sub.id} onClick={()=>requestSend(sub)} className={`inline-flex min-h-11 shrink-0 items-center justify-center gap-2 px-4 text-xs font-black disabled:opacity-35 ${isArmed&&warnings.length?'border border-amber-300/30 bg-amber-300/[.08] text-amber-100':'bg-[#d8bb78] text-black'}`}><Mail className=\"h-4 w-4\"/>{sending===sub.id?'Sending…':isArmed&&warnings.length?'Send anyway':mode==='mailed'?'Send shipment update':'Send completion email'}</button></div></div>})}</div>:<div className=\"mt-5 border border-dashed border-white/10 p-5 text-sm text-white/35\">No orders are currently in this stage.</div>}</div></section>\n}\n"},{"path":"src/pages/card-grading/PCGBatchPublishingCenter.tsx","content":"import React from 'react';\nimport {supabase} from '@/integrations/supabase/client';\n\ntype Row={id:string;card_id:string;sku:string;title:string;price:number;quantity:number;website_status:string;website_url?:string|null;ebay_status:string;ebay_url?:string|null;error_message?:string|null;card?:any};\nconst label=(v:string)=>v==='live'?'Live':v==='prerequisite_required'?'Setup required':v==='needs_attention'?'Needs attention':v==='sold'?'Sold':v==='uploaded'?'Not listed':v||'Not listed';\n\nexport default function PCGBatchPublishingCenter({tenantId}:{tenantId:string}){\n  const[rows,setRows]=React.useState<Row[]>([]);\n  const[prices,setPrices]=React.useState<Record<string,string>>({});\n  const[busy,setBusy]=React.useState<string[]>([]);\n  const[message,setMessage]=React.useState('');\n\n  const load=React.useCallback(async()=>{\n    if(!tenantId)return;\n    const {data}=await supabase.functions.invoke('pcg-commerce-publisher',{body:{action:'list',tenant_id:tenantId}});\n    if(data?.ok){\n      const items=Array.isArray(data.items)?data.items:[];\n      setRows(items);\n      setPrices(prev=>{\n        const next={...prev};\n        for(const row of items) if(!next[row.card_id]&&Number(row.price)>0) next[row.card_id]=String(row.price);\n        return next;\n      });\n    }\n  },[tenantId]);\n\n  const publish=React.useCallback(async(cardIds:string[])=>{\n    if(!cardIds.length)return;\n    setBusy(v=>Array.from(new Set([...v,...cardIds])));\n    const entries=cardIds.map(id=>[id,Number(prices[id]||0)] as const).filter(([,value])=>value>0);\n    const priceByCard=Object.fromEntries(entries);\n    const {data,error}=await supabase.functions.invoke('pcg-commerce-publisher',{body:{action:'publish_batch',tenant_id:tenantId,card_ids:cardIds,price_by_card:priceByCard}});\n    setBusy(v=>v.filter(id=>!cardIds.includes(id)));\n    if(error||!data?.ok)setMessage(data?.error||'Publishing could not start. Try again.');\n    else setMessage('Publishing pass complete. Any item that needs attention is isolated below.');\n    await load();\n  },[load,prices,tenantId]);\n\n  React.useEffect(()=>{void load()},[load]);\n  React.useEffect(()=>{\n    if(!tenantId)return;\n    const channel=supabase.channel('pcg-commerce-'+tenantId)\n      .on('postgres_changes',{event:'*',schema:'public',table:'card_grading_cards',filter:'tenant_id=eq.'+tenantId},()=>void load())\n      .subscribe();\n    const timer=window.setInterval(()=>void load(),10000);\n    return()=>{window.clearInterval(timer);void supabase.removeChannel(channel)};\n  },[load,tenantId]);\n\n  return <section data-pcg-batch-publishing=\"true\" className=\"relative z-10 mx-auto mb-5 w-full max-w-[1500px] px-3 sm:px-5 lg:px-7\">\n    <div className=\"rounded-3xl border border-white/10 bg-[#09090a]/94 p-4 shadow-[0_10px_28px_rgba(0,0,0,.22)] backdrop-blur-xl sm:p-5\">\n      <div className=\"flex flex-wrap items-center gap-3\">\n        <div className=\"min-w-0 flex-1\"><div className=\"text-[10px] font-black uppercase tracking-[.2em] text-[#d8bb78]/70\">Publishing command center</div><h2 className=\"mt-1 text-xl font-black text-white\">Website + eBay</h2><p className=\"mt-1 text-sm text-white/55\">Completed cards are candidates only. Nothing is listed until you enter an explicit sale price and press Publish.</p><p className=\"mt-1 text-xs font-semibold text-amber-100/75\">A card’s declared or grading value is never treated as permission to sell it.</p></div>\n        <div className=\"rounded-full border border-[#d8bb78]/25 bg-[#d8bb78]/10 px-3 py-1.5 text-[11px] font-black uppercase tracking-[.12em] text-[#d8bb78]\">Owner approval required</div>\n      </div>\n      {message?<div className=\"mt-3 rounded-xl border border-white/10 bg-white/[.05] px-3 py-2 text-sm text-white/70\">{message}</div>:null}\n      <div className=\"mt-4 grid gap-2\">\n        {!rows.length?<div className=\"rounded-2xl border border-white/8 bg-white/[.03] p-4 text-sm text-white/55\">Completed graded cards appear here as sale candidates. Set an explicit sale price and press Publish only for cards PCG is actually authorized to sell.</div>:rows.map(row=>{\n          const working=busy.includes(row.card_id);\n          const price=prices[row.card_id]??String(row.price||'');\n          return <article key={row.id||row.card_id} className=\"grid gap-3 rounded-2xl border border-white/8 bg-white/[.035] p-3 lg:grid-cols-[minmax(0,1fr)_140px_auto] lg:items-center\">\n            <div className=\"min-w-0\"><div className=\"truncate text-sm font-black text-white\">{row.title||row.sku}</div><div className=\"mt-1 flex flex-wrap gap-2 text-[11px] font-bold\"><span className=\"rounded-full bg-white/[.06] px-2 py-1 text-white/65\">{row.sku}</span><span className=\"rounded-full bg-white/[.06] px-2 py-1 text-white/65\">Website: {label(row.website_status)}</span><span className=\"rounded-full bg-white/[.06] px-2 py-1 text-white/65\">eBay: {label(row.ebay_status)}</span></div>{row.error_message?<div className=\"mt-2 text-xs font-semibold text-amber-100/75\">{row.error_message}</div>:null}</div>\n            <label className=\"grid gap-1 text-[10px] font-black uppercase tracking-[.12em] text-white/45\">Explicit sale price<input inputMode=\"decimal\" value={price} onChange={e=>setPrices(v=>({...v,[row.card_id]:e.target.value}))} className=\"h-10 min-w-0 rounded-xl border border-white/10 bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/60\" placeholder=\"0.00\"/></label>\n            <div className=\"flex flex-wrap gap-2 lg:justify-end\">{row.website_url?<a className=\"rounded-lg border border-white/10 px-2.5 py-2 text-xs font-black text-white/75\" href={row.website_url} target=\"_blank\" rel=\"noreferrer\">Website</a>:null}{row.ebay_url?<a className=\"rounded-lg border border-white/10 px-2.5 py-2 text-xs font-black text-white/75\" href={row.ebay_url} target=\"_blank\" rel=\"noreferrer\">eBay</a>:null}<button type=\"button\" disabled={working||!(Number(price)>0)} onClick={()=>void publish([row.card_id])} className=\"rounded-lg border border-[#d8bb78]/30 bg-[#d8bb78]/10 px-2.5 py-2 text-xs font-black text-[#d8bb78] disabled:opacity-40\">{working?'Publishing…':row.website_status==='live'||row.ebay_status==='live'?'Update listing':row.website_status==='uploaded'&&row.ebay_status==='uploaded'?'Publish website + eBay':'Retry'}</button></div>\n          </article>\n        })}\n      </div>\n    </div>\n  </section>;\n}\n"}],"route":"/pcg/workspace","branch":"ai/objective-first-repair-8383247bc3ec","writes":[],"patches":[],"pr_body":"Completes the owner-requested revert by removing the rejected light treatment from all inner PCG routes, not just the MODES landing shell.","version":1,"approved":true,"pr_title":"PCG: complete dark MODES revert","missionId":"8383247b-c3ec-459c-944c-0592b7b4e340","objective":"Complete the owner-requested PCG revert consistently across every inner route. The MODES shell is dark but Receive Cards, Capture/Card Vault, Grade Cards, Publish & Sell, Fulfill/Completion, and PCG Settings still carry the rejected light redesign. Revert those presentation layers together to the dark PCG MODES visual system: near-black workspace/background panels, white text, white low-opacity borders, dark inputs, gold accent, dark completion/publishing cards, dark mobile nav/modal surfaces, and dark PCG settings launcher/embedded settings treatment. Do not redesign, renumber, or restructure workflows. Preserve all current functional fixes: /pcg/workspace routing, Receive->Capture preselection, official grading scale, publishing approval, fulfillment, payments, provider prerequisites, and mobile touch targets. Frontend-only. Completion requires no light-route split on the representative owner paths /pcg/workspace?mode=submissions, /pcg/workspace?mode=submissions&tool=vault&vault=batch, /pcg/workspace?mode=grading, /pcg/workspace?mode=listings, /pcg/workspace?mode=orders, and ?tool=settings.","tenantRef":"pcg","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx","src/pages/card-grading/PCGCompletionCenter.tsx","src/pages/card-grading/PCGBatchPublishingCenter.tsx"],"commit_message":"Revert all PCG routes to dark MODES","implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":null,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/crm/PcgWorkspace.tsx","src/pages/card-grading/PCGWorkspace.tsx","src/pages/card-grading/PCGCompletionCenter.tsx","src/pages/card-grading/PCGBatchPublishingCenter.tsx"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"70f34ba53679a706cb5a3e9e8aa6a1b58f38ce18286c758e554932011c65536a","replayCount":0,"serializedBytes":107478},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:11:26.413745+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:8383247b-c3ec-459c-944c-0592b7b4e340:repository-mutation-intent:70f34ba53679a706cb5a3e9e8aa6a1b58f38ce18286c758e554932011c65536a:0","mission_step_id":"72689ac2-79fe-4480-8ad3-b08ddfe56498","command_center_event_id":"8383247b-c3ec-459c-944c-0592b7b4e340"},{"id":"9d20acdc-a295-446d-8c25-dd89a634e3e2","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[{"path":"src/pages/card-grading/PCGModesWorkspace.tsx","content":"import React from 'react';\n// PCG owner-requested MODES restore anchor: preserves the known-good pre-redesign presentation.\nimport {ArrowLeft,ArrowRight,Boxes,CheckCircle2,ClipboardCheck,Clock3,CreditCard,Database,Images,Settings,Truck,Users} from 'lucide-react';\nimport {useLocation,useNavigate} from 'react-router-dom';\nimport PcgWorkspace from '@/pages/crm/PcgWorkspace';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport PCGCompletionCenter from '@/pages/card-grading/PCGCompletionCenter';\nimport TenantLogo from '@/components/branding/TenantLogo';\nimport MiscAwareAccountMenu from '@/components/MiscAwareAccountMenu';\nimport {CanonicalWorkspaceSidebarTrigger} from '@/components/layout/TenantLayoutControl';\nimport {supabase} from '@/integrations/supabase/client';\nimport {PCG_WORKSPACE_BACKGROUND} from '@/assets/pcgWorkspaceBackground';\nimport {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';\nimport {tenantMediaAssetUrl} from '@/lib/tenantMedia';\nimport {getTenantModeCards} from '@/shells/modesTenantShell';\n\ntype ModeId='submissions'|'grading'|'listings'|'orders';\ntype WorkspaceTab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';\ntype VaultMode='overview'|'single'|'batch'|'growth';\ntype ModeCounts={submissions:number;grading:number;listings:number;orders:number};\ntype UnknownRecord=Record<string,any>;\n\nfunction record(value:unknown):UnknownRecord{return value&&typeof value==='object'&&!Array.isArray(value)?value as UnknownRecord:{}}\nfunction resolvePcgHeroImage(tenant:any):string{\n  const settings=record(tenant?.settings);\n  const media=record(settings.media_branding);\n  const direct=String(media.hero_background_url||'').trim();\n  const assetId=String(media.resolved_hero_asset_id||media.hero_background_asset_id||'').trim();\n  const version=String(media.resolved_hero_version||media.hero_background_version||media.updated_at||'').trim();\n  return assetId?tenantMediaAssetUrl(assetId,version||null):direct;\n}\n\nconst MODE_TAB:Record<ModeId,WorkspaceTab>={submissions:'submissions',grading:'queue',listings:'inventory',orders:'shipping'};\nconst MODE_TOOLS:Record<ModeId,readonly {id:WorkspaceTab;label:string;vault?:VaultMode}[]>={\n  submissions:[{id:'submissions',label:'Receive Cards'},{id:'vault',label:'Capture Cards'},{id:'collectors',label:'Customers'}],\n  grading:[{id:'queue',label:'Grade Cards'},{id:'certs',label:'Certificates'}],\n  listings:[],\n  orders:[{id:'shipping',label:'Fulfill & Ship'}]\n};\nconst ADMIN_TOOLS=[{id:'settings' as WorkspaceTab,label:'Settings',icon:Settings},{id:'money' as WorkspaceTab,label:'Payments',icon:CreditCard},{id:'readiness' as WorkspaceTab,label:'Readiness',icon:ClipboardCheck},{id:'migration' as WorkspaceTab,label:'Migration',icon:Database}] as const;\nconst ADMIN_TOOL_IDS=new Set<WorkspaceTab>(ADMIN_TOOLS.map(item=>item.id));\nconst TOOL_LABEL:Record<WorkspaceTab,string>={today:'Work Queue',vault:'Capture Cards',queue:'Grade Cards',submissions:'Receive Cards',certs:'Certificates',collectors:'Customers',inventory:'Publish & Sell',shipping:'Fulfill & Ship',money:'Payments',migration:'Migration',readiness:'Readiness',settings:'Settings'};\nconst PCG_CARD_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/7fd5d898-1ff3-4bc2-9f7d-c7f2f2d6ee07/IMG_8111.jpg';\nconst PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';\nconst MODES=[\n  {id:'submissions' as ModeId,assetKey:'received',title:'Receive Cards',short:'To Receive',copy:'Start here when cards arrive. Add the customer, capture the cards and begin the submission.',icon:Images,accent:'#168cff',image:PCG_CARD_IMAGE,position:'38% 45%'},\n  {id:'grading' as ModeId,assetKey:'grading',title:'Grade Cards',short:'To Grade',copy:'Open the grading queue, score cards, assign certificates and clear QA.',icon:Clock3,accent:'#a83cff',image:PCG_WORKSPACE_BACKGROUND,position:'68% 52%'},\n  {id:'listings' as ModeId,assetKey:'completed',title:'Publish & Sell',short:'Ready to Publish',copy:'Finish completed cards, approve sale pricing and publish to the PCG website and eBay.',icon:CheckCircle2,accent:'#00e676',image:PCG_CARD_IMAGE,position:'62% 48%'},\n  {id:'orders' as ModeId,assetKey:'mailed',title:'Fulfill & Ship',short:'To Fulfill',copy:'Handle completed returns, pickups, tracking and customer shipment updates.',icon:Truck,accent:'#ffd740',image:PCG_STORE_IMAGE,position:'76% 58%'},\n] as const;\n\nconst PCGBatchPublishingCenter=React.lazy(()=>import('@/pages/card-grading/PCGBatchPublishingCenter'));\n\nfunction isModeId(value:string|null):value is ModeId{return MODES.some(item=>item.id===value)}\nfunction isWorkspaceTab(value:string|null):value is WorkspaceTab{return Boolean(value)&&['today','vault','queue','submissions','certs','collectors','inventory','shipping','money','migration','readiness','settings'].includes(value as WorkspaceTab)}\nfunction bucket(status:string):ModeId|null{\n  if(['received','intake_imaging','authentication'].includes(status))return'submissions';\n  if(['grading','encapsulation','qa'].includes(status))return'grading';\n  if(status==='ready')return'listings';\n  if(['shipped','picked_up','delivered','closed'].includes(status))return'orders';\n  return null;\n}\n\nexport default function PCGModesWorkspace(){\n  const{activeTenant}=useMultiTenant();\n  const location=useLocation();\n  const navigate=useNavigate();\n  const tenantId=activeTenant?.id||'';\n  const slug=String(activeTenant?.company_slug||'pcg').trim().toLowerCase()||'pcg';\n  const wmpUrl='https://whatsmyprogress.com/'+encodeURIComponent(slug)+'/';\n  const branding=React.useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);\n  const workspaceBackground=branding.backgroundUrl||PCG_WORKSPACE_BACKGROUND;\n  const mediaBranding=(activeTenant?.settings?.media_branding&&typeof activeTenant.settings.media_branding==='object'&&!Array.isArray(activeTenant.settings.media_branding)?activeTenant.settings.media_branding:{}) as Record<string,any>;\n  const heroImage=React.useMemo(()=>resolvePcgHeroImage(activeTenant)||workspaceBackground,[activeTenant,workspaceBackground]);\n  const heroOpacityRaw=Number(mediaBranding.hero_background_opacity??1);\n  const heroZoomRaw=Number(mediaBranding.hero_background_zoom??1);\n  const heroBlurRaw=Number(mediaBranding.hero_background_blur_px??0);\n  const heroXRaw=Number(mediaBranding.hero_background_position_x??50);\n  const heroYRaw=Number(mediaBranding.hero_background_position_y??50);\n  const heroOpacity=Number.isFinite(heroOpacityRaw)?Math.max(0,Math.min(1,heroOpacityRaw)):1;\n  const heroZoom=Number.isFinite(heroZoomRaw)?Math.max(1,Math.min(2.5,heroZoomRaw)):1;\n  const heroBlur=Number.isFinite(heroBlurRaw)?Math.max(0,Math.min(20,heroBlurRaw)):0;\n  const heroX=Number.isFinite(heroXRaw)?Math.max(0,Math.min(100,heroXRaw)):50;\n  const heroY=Number.isFinite(heroYRaw)?Math.max(0,Math.min(100,heroYRaw)):50;\n  const configuredModeCards=React.useMemo(()=>getTenantModeCards(activeTenant as any),[activeTenant]);\n  const modes=React.useMemo(()=>MODES.map((entry)=>{\n    const configured=configuredModeCards.find((card)=>card.key===entry.assetKey);\n    const x=configured?.image_position_x;\n    const y=configured?.image_position_y;\n    const assetId=String(configured?.image_asset_id||'').trim();\n    const image=assetId?tenantMediaAssetUrl(assetId):String(configured?.image_url||configured?.fallback_image_url||entry.image);\n    const zoom=Number(configured?.image_zoom??1);\n    const opacity=Number(configured?.image_opacity??1);\n    const blur=Number(configured?.image_blur_px??0);\n    return {...entry,image,position:typeof x==='number'&&typeof y==='number'?`${x}% ${y}%`:entry.position,zoom:Number.isFinite(zoom)?Math.max(1,Math.min(2.5,zoom)):1,opacity:Number.isFinite(opacity)?Math.max(0,Math.min(1,opacity)):1,blur:Number.isFinite(blur)?Math.max(0,Math.min(20,blur)):0};\n  }),[configuredModeCards]);\n  const searchParams=new URLSearchParams(location.search);\n  const requestedMode=searchParams.get('mode');\n  const requestedTool=searchParams.get('tool');\n  const requestedVault=searchParams.get('vault');\n  const requestedSubmissionId=searchParams.get('submissionId')||'';\n  const mode=isModeId(requestedMode)?requestedMode:null;\n  const tool=isWorkspaceTab(requestedTool)?requestedTool:null;\n  const adminTool=!mode&&tool&&ADMIN_TOOL_IDS.has(tool)?tool:null;\n  const vaultMode:VaultMode=requestedVault==='batch'?'batch':requestedVault==='single'?'single':requestedVault==='growth'?'growth':'overview';\n  const[counts,setCounts]=React.useState<ModeCounts>({submissions:0,grading:0,listings:0,orders:0});\n\n  React.useEffect(()=>{\n    let cancelled=false;\n    if(!tenantId)return;\n    void (supabase as any).from('card_grading_submissions').select('status').eq('tenant_id',tenantId).then(({data}:any)=>{\n      if(cancelled)return;\n      const next:ModeCounts={submissions:0,grading:0,listings:0,orders:0};\n      for(const row of data||[]){const id=bucket(String(row?.status||''));if(id)next[id]+=1}\n      setCounts(next);\n    }).catch(()=>{});\n    return()=>{cancelled=true};\n  },[tenantId]);\n\n  const setMode=React.useCallback((next:ModeId|null)=>{\n    const params=new URLSearchParams(location.search);\n    if(next){params.set('mode',next);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}else{params.delete('mode');params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId')}\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openTool=React.useCallback((nextMode:ModeId,nextTool:WorkspaceTab,nextVault?:VaultMode)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode',nextMode);params.set('tool',nextTool);\n    if(nextVault)params.set('vault',nextVault);else params.delete('vault');\n    params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openCaptureForSubmission=React.useCallback((submissionId:string,expectedCardCount:number)=>{\n    const params=new URLSearchParams(location.search);\n    params.set('mode','submissions');params.set('tool','vault');params.set('vault',expectedCardCount===1?'single':'batch');params.set('submissionId',submissionId);params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const openAdminTool=React.useCallback((nextTool:WorkspaceTab)=>{\n    const params=new URLSearchParams(location.search);\n    params.delete('mode');params.delete('vault');params.set('tool',nextTool);params.delete('submissionId');params.delete('cardId');\n    const search=params.toString();\n    navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false});\n  },[location.hash,location.pathname,location.search,navigate]);\n  const closeAdminTool=React.useCallback(()=>{const params=new URLSearchParams(location.search);params.delete('tool');params.delete('vault');params.delete('submissionId');params.delete('cardId');const search=params.toString();navigate({pathname:location.pathname,search:search?'?'+search:'',hash:location.hash},{replace:false})},[location.hash,location.pathname,location.search,navigate]);\n\n  if(mode){\n    const current=modes.find(item=>item.id===mode)!;\n    const modeTools=MODE_TOOLS[mode];\n    const allowedTabs=modeTools.map(item=>item.id);\n    const scopedTool=tool&&allowedTabs.includes(tool)?tool:null;\n    const activeTab=scopedTool||MODE_TAB[mode];\n    const headerLabel=scopedTool?TOOL_LABEL[scopedTool]:current.title;\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-active-mode={mode} data-pcg-mode-target={activeTab} className=\"min-h-screen bg-[#050607] text-white\">\n      <div data-pcg-mode-header=\"true\" className=\"sticky left-0 right-0 top-0 z-[65] box-border w-screen max-w-none border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\">\n        <div className=\"flex w-full items-center gap-3\">\n          <button type=\"button\" onClick={()=>setMode(null)} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 shrink-0 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button>\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Workflow</div><div className=\"truncate text-sm font-black\">{headerLabel}</div></div>\n          <div className=\"ml-auto hidden min-w-0 items-center gap-2 lg:flex\"><CanonicalWorkspaceSidebarTrigger className=\"h-10 w-[clamp(14rem,28vw,24rem)] border-white/[.10] bg-black/35 text-white/50 hover:bg-white/[.06] hover:text-white/80\"/></div><div className=\"ml-auto lg:ml-0\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-mode-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div>\n        </div>\n        {modeTools.length>1?<div className=\"mt-2 flex flex-wrap gap-1 pb-0.5\">{modeTools.map(item=><button key={item.id} type=\"button\" onClick={()=>openTool(mode,item.id,item.vault)} className={`whitespace-nowrap rounded-xl border px-3 py-2 text-[10px] font-black uppercase tracking-[.08em] transition ${activeTab===item.id?'border-[#d8bb78]/40 bg-[#d8bb78]/[.12] text-[#f2d99f]':'border-white/[.09] bg-white/[.035] text-white/52 hover:bg-white/[.08] hover:text-white/82'}`}>{item.label}</button>)}</div>:null}\n      </div>\n      {mode==='listings'?<><PCGCompletionCenter mode=\"completed\"/><React.Suspense fallback={null}><PCGBatchPublishingCenter tenantId={tenantId}/></React.Suspense></>:null}\n      {mode==='orders'?<><PCGCompletionCenter mode=\"mailed\"/><PcgWorkspace initialTab=\"shipping\" embedded navigationScope={['shipping']}/></>:null}\n      {mode==='submissions'||mode==='grading'?<PcgWorkspace initialTab={activeTab} initialVaultMode={vaultMode} initialVaultSubmissionId={requestedSubmissionId} onSubmissionCreated={mode==='submissions'?({id,expected_card_count})=>openCaptureForSubmission(id,expected_card_count):undefined} embedded navigationScope={allowedTabs}/>:null}\n    </div>\n  }\n\n  if(adminTool){\n    return <div data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-admin-tool={adminTool} className=\"min-h-screen bg-[#050607] text-white\">\n      <div className=\"sticky left-0 right-0 top-0 z-[65] border-b border-white/[.08] bg-[#050607]/92 px-3 py-2.5 backdrop-blur-xl sm:px-5 lg:px-7\"><div className=\"flex items-center gap-3\"><button type=\"button\" onClick={closeAdminTool} aria-label=\"Back to PCG work queue\" className=\"grid h-11 w-11 place-items-center rounded-xl border border-white/[.10] bg-white/[.04] text-white/72\"><ArrowLeft className=\"h-4 w-4\"/></button><div className=\"grid h-10 w-10 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={40} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG Admin</div><div className=\"text-sm font-black\">{TOOL_LABEL[adminTool]}</div></div><div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={`pcg-admin-avatar:${tenantId||'workspace'}`} tenantShellOwner/></div></div></div>\n      <PcgWorkspace initialTab={adminTool} embedded navigationScope={[adminTool]}/>\n    </div>\n  }\n\n\n\n\n  return <main data-tenant-modes-shell=\"true\" data-tenant-id={tenantId||undefined} data-tenant-experience-family=\"modes\" data-pcg-modes-workspace=\"true\" data-pcg-media-contract=\"tenant-configured\" className=\"relative min-h-dvh overflow-x-hidden bg-[#050607] pb-8 text-white\">\n    <div aria-hidden=\"true\" className=\"pointer-events-none fixed inset-0 z-0 overflow-hidden bg-[#050607]\"><div className=\"absolute inset-0\" style={{backgroundImage:'url(\"'+workspaceBackground+'\")',backgroundSize:branding.backgroundFit==='contain'?'contain':'cover',backgroundPosition:branding.backgroundPosition||'center',backgroundRepeat:'no-repeat',opacity:branding.backgroundOpacity,filter:`blur(${branding.backgroundBlurPx}px)`,transform:`scale(${branding.backgroundZoom})`,transformOrigin:branding.backgroundPosition||'center'}}/><div className=\"absolute inset-0\" style={{background:'linear-gradient(108deg,rgba(3,4,5,.96) 0%,rgba(3,4,5,.90) 48%,rgba(3,4,5,.82) 100%)'}}/></div>\n\n    <header className=\"sticky left-0 right-0 top-0 z-[70] border-b border-white/[.08] bg-[#050607]/92 backdrop-blur-xl\">\n      <div className=\"flex min-h-[64px] items-center gap-3 px-3 sm:px-5 lg:px-7\">\n        <CanonicalWorkspaceSidebarTrigger className=\"h-11 w-[clamp(13rem,34vw,28rem)] border-white/[.10] bg-black/35 text-white/55 hover:bg-white/[.06] hover:text-white/85 max-sm:w-11 max-sm:px-0 max-sm:[&>span]:hidden\"/>\n        <div className=\"flex min-w-0 items-center gap-2.5\">\n          <div className=\"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-xl border border-[#d8bb78]/25 bg-black/45\"><TenantLogo tenant={activeTenant as any} size={38} rounded=\"lg\" fallbackVariant=\"initial\" className=\"border-0 bg-transparent\"/></div>\n          <div className=\"min-w-0\"><div className=\"truncate text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Prestigious Card Grading</div><div className=\"truncate text-sm font-black text-white\">Work Queue</div></div>\n        </div>\n        <div className=\"ml-auto\"><MiscAwareAccountMenu placement=\"inline\" avatarMode=\"tenant\" singletonKey={'pcg-dashboard-avatar:'+(tenantId||'workspace')} tenantShellOwner/></div>\n      </div>\n    </header>\n\n    <div className=\"relative z-10 mx-auto max-w-[1560px] px-3 pb-7 pt-4 sm:px-5 sm:pt-5 lg:px-7 lg:pt-6\">\n      <section className=\"relative overflow-hidden rounded-[24px] border border-white/[.10] bg-black/45 shadow-2xl\">\n        <div className=\"absolute inset-0\" style={{backgroundImage:'url(\"'+heroImage+'\")',backgroundSize:'cover',backgroundPosition:`${heroX}% ${heroY}%`,opacity:heroOpacity,filter:`blur(${heroBlur}px)`,transform:`scale(${heroZoom})`,transformOrigin:`${heroX}% ${heroY}%`}}/>\n        <div className=\"absolute inset-0 bg-gradient-to-r from-black/95 via-black/72 to-black/40\"/>\n        <div className=\"relative flex min-h-[158px] flex-col justify-end p-5 sm:min-h-[190px] sm:p-7 lg:p-8\">\n          <div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">PCG MODES</div>\n          <h1 className=\"mt-2 text-[clamp(2rem,4vw,3.8rem)] font-black leading-[.92] tracking-[-.05em] text-white\">Your grading command center.</h1>\n          <p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/58\">Pick the part of the shop you are working in. Each mode keeps only the tools for that job in front of you.</p>\n        </div>\n      </section>\n\n      <section className=\"mt-4\">\n        <div className=\"mb-2.5 flex items-end justify-between gap-4 px-1\">\n          <div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Work Queue</div><h2 className=\"mt-1 text-xl font-black tracking-[-.025em] text-white sm:text-2xl\">Choose a mode</h2></div>\n          <div className=\"hidden text-xs font-semibold text-white/32 sm:block\">Receive → Grade → Publish → Fulfill</div>\n        </div>\n        <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4\">{modes.map(({id,title,short,copy,icon:Icon,accent,image,position,zoom,opacity,blur})=><button key={id} type=\"button\" data-pcg-mode-id={id} aria-label={'Open '+title} onClick={()=>setMode(id)} className=\"group relative min-h-[230px] overflow-hidden rounded-[22px] border border-white/[.10] bg-[#090a0b] text-left shadow-2xl transition duration-200 hover:-translate-y-0.5 hover:border-white/[.18]\">\n          <div className=\"absolute inset-0 transition duration-300\" style={{backgroundImage:'url(\"'+image+'\")',backgroundSize:'cover',backgroundPosition:position,opacity,filter:`blur(${blur}px)`,transform:`scale(${zoom})`,transformOrigin:position}}/>\n          <div className=\"absolute inset-0 bg-gradient-to-t from-black via-black/78 to-black/22\"/>\n          <div className=\"absolute inset-x-0 top-0 h-[3px]\" style={{backgroundColor:accent}}/>\n          <div className=\"relative flex h-full min-h-[230px] flex-col justify-end p-4 sm:p-5\">\n            <div className=\"mb-auto flex items-start justify-between gap-3\">\n              <span className=\"grid h-10 w-10 place-items-center rounded-xl border border-white/[.12] bg-black/45 backdrop-blur\"><Icon className=\"h-5 w-5\" style={{color:accent}}/></span>\n              <div className=\"text-right\"><div className=\"text-3xl font-black leading-none text-white\">{counts[id]}</div><div className=\"mt-1 text-[8px] font-black uppercase tracking-[.12em] text-white/38\">{short}</div></div>\n            </div>\n            <h3 className=\"text-xl font-black tracking-[-.025em] text-white\">{title}</h3>\n            <p className=\"mt-1.5 line-clamp-2 text-[11px] leading-5 text-white/46\">{copy}</p>\n            <div className=\"mt-3 flex items-center gap-1 text-[9px] font-black uppercase tracking-[.12em]\" style={{color:accent}}>Open mode <ArrowRight className=\"h-3.5 w-3.5 transition group-hover:translate-x-0.5\"/></div>\n          </div>\n        </button>)}</div>\n      </section>\n\n      <section className=\"mt-4 rounded-[18px] border border-white/[.08] bg-black/28 p-3 backdrop-blur-sm\">\n        <div className=\"flex flex-wrap items-center gap-2\">\n          <span className=\"mr-1 text-[9px] font-black uppercase tracking-[.16em] text-white/28\">Admin</span>\n          {ADMIN_TOOLS.map(({id,label,icon:Icon})=><button key={id} type=\"button\" onClick={()=>openAdminTool(id)} className=\"inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[.09] bg-white/[.04] px-3 text-[10px] font-black text-white/48 transition hover:bg-white/[.08] hover:text-white/78\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</button>)}\n        </div>\n      </section>\n    </div>\n  </main>\n}\n"},{"path":"src/pages/crm/PcgWorkspace.tsx","content":"import {useEffect,useMemo,useState,type ComponentType} from 'react';\nimport {useLocation} from 'react-router-dom';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';import {supabase} from '@/integrations/supabase/client';import {toast} from '@/lib/notify';import {resolveTenantMediaBranding} from '@/lib/tenants/tenantMediaBranding';import {PCGCardVaultContent} from '@/pages/card-grading/PCGWorkspace';import PCGLegacyMigrationCenter from '@/pages/card-grading/PCGLegacyMigrationCenter';import PCGOnboardingReadiness from '@/pages/card-grading/PCGOnboardingReadiness';\nimport {Award,BadgeDollarSign,Boxes,Check,ChevronRight,CircleDollarSign,ClipboardCheck,CreditCard,Database,ExternalLink,FileCheck2,Menu,PackageCheck,Plus,Search,Settings,ShieldCheck,Truck,UploadCloud,Users,X} from 'lucide-react';\nimport {PCG_GRADING_SCALE,findPCGGrade,formatPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nimport TenantSettingsPage from '@/pages/settings/TenantSettingsPage';\nimport PCGBatchPublishingCenter from '@/pages/card-grading/PCGBatchPublishingCenter';\ntype Submission={id:string;submission_number:string;customer_name:string|null;customer_email:string|null;customer_phone:string|null;service_tier:string;service_price:number;expected_card_count:number;status:string;delivery_method:string|null;received_at:string;due_at:string|null;tracking_in:string|null;tracking_out:string|null;notes:string|null;payment_status:string|null;payment_reference:string|null;paid_at:string|null};type Card={id:string;submission_id:string;sequence_number:number;cert_number:string|null;category:string|null;year:string|null;brand_set:string|null;player_character:string|null;card_number:string|null;card_description:string|null;autograph_present:boolean|null;variation:string|null;declared_value:number|null;grade:number|null;grade_label:string|null;status:string;front_image_url:string|null;back_image_url:string|null;slab_image_url:string|null;grader_notes:string|null;population_count:number|null};type CardDraft={category:string;year:string;brand_set:string;player_character:string;card_number:string;card_description:string;autograph_present:''|'yes'|'no';declared_value:string;grade:string;grade_label:string;cert_number:string;grader_notes:string};type DetailDraft={tracking_in:string;tracking_out:string;notes:string;payment_status:string;payment_reference:string};type Tab='today'|'vault'|'queue'|'submissions'|'certs'|'collectors'|'inventory'|'shipping'|'money'|'migration'|'readiness'|'settings';type IconType=ComponentType<{className?:string}>;\nconst tabs:[Tab,string,IconType][]=[['today','Work Queue',Award],['vault','Capture Cards',UploadCloud],['queue','Grade Cards',Award],['submissions','Receive Cards',Boxes],['certs','Certificates',ShieldCheck],['collectors','Customers',Users],['shipping','Fulfill & Ship',Truck],['inventory','Publish & Sell',PackageCheck],['money','Payments',CircleDollarSign],['migration','Migration',Database],['readiness','Readiness',ClipboardCheck],['settings','Settings',Settings]];const mobilePrimary:[Tab,string,IconType][]=[['today','Queue',Award],['vault','Capture',UploadCloud],['queue','Grade',Award],['certs','Certs',ShieldCheck]];\nconst tiers={two_weeks:{label:'2 Weeks',price:12,days:14},one_week:{label:'1 Week',price:15,days:7},three_days:{label:'3 Days',price:20,days:3},same_day:{label:'Same Day',price:25,days:0}} as const;const statuses=['received','intake_imaging','authentication','grading','encapsulation','qa','ready','shipped','picked_up'] as const;const terminalStatuses=new Set(['shipped','picked_up']);const PCG_STRIPE_FALLBACK='https://buy.stripe.com/3clbJ05UQc3w9KLcBR5Ne00';const PCG_LOGO='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/2c2615b1-2fab-4ba1-8cff-8d8e49b6b184/diamond%2Blogo.png';const PCG_STORE_IMAGE='https://images.squarespace-cdn.com/content/v1/6853034cd711cc2240276cf3/83d3ec70-169f-4d22-8916-15e422fb0e52/IMG_8156%2B%281%29.jpeg';const pretty=(value:string)=>value.replaceAll('_',' ').replace(/\\b\\w/g,char=>char.toUpperCase());const inputClass='w-full border border-white/[0.10] bg-black/30 px-3.5 py-3 text-sm text-white outline-none transition placeholder:text-white/28 focus:border-[#d8bb78]/55';const panelClass='border border-white/[0.08] bg-[#09090a]/88';\nconst hasCanonicalGrade=(card:Pick<Card,'grade_label'>)=>Boolean(findPCGGrade(card.grade_label));\nfunction PCGGradeSelect({draft,onChange}:{draft:CardDraft;onChange:(next:CardDraft)=>void}){const selected=findPCGGrade(draft.grade_label);const legacyLabel=String(draft.grade_label||'').trim();const legacyNumeric=!legacyLabel&&draft.grade.trim()?draft.grade.trim():'';return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[9px] font-black uppercase tracking-[.14em] text-[#d8bb78]\">Official PCG grade</span><select value={draft.grade_label} onChange={event=>{const option=findPCGGrade(event.target.value);onChange({...draft,grade:option?.numeric==null?'':String(option.numeric),grade_label:option?.designation||event.target.value})}} className={inputClass}><option value=\"\">Select official PCG designation</option>{legacyLabel&&!selected?<option value={legacyLabel}>Legacy · {legacyLabel}</option>:null}{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<div className=\"mt-2 border border-white/[0.08] bg-black/28 px-3 py-2\"><div className=\"text-[10px] font-black text-[#e8cc8d]\">{selected.designation}</div><div className=\"mt-1 text-[11px] leading-5 text-white/45\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</div></div>:legacyLabel?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy grade label. Choose an official PCG designation before advancing this card.</div>:legacyNumeric?<div className=\"mt-2 text-[11px] leading-5 text-amber-200/75\">Legacy numeric grade {legacyNumeric}. Choose the exact official PCG designation before advancing this card.</div>:null}</div>}\nfunction cardToDraft(card:Card):CardDraft{return{category:card.category||'',year:card.year||'',brand_set:card.brand_set||'',player_character:card.player_character||'',card_number:card.card_number||'',card_description:card.card_description||card.variation||'',autograph_present:card.autograph_present==null?'':card.autograph_present?'yes':'no',declared_value:card.declared_value==null?'':String(card.declared_value),grade:card.grade==null?'':String(card.grade),grade_label:card.grade_label||'',cert_number:card.cert_number||'',grader_notes:card.grader_notes||''}}function slaMeta(sub:Submission){if(!sub.due_at||terminalStatuses.has(sub.status))return{label:terminalStatuses.has(sub.status)?pretty(sub.status):'No due date',tone:'text-white/42 border-white/10'};const diff=new Date(sub.due_at).getTime()-Date.now();const days=Math.ceil(diff/86400000);if(diff<0)return{label:`${Math.abs(days)}d overdue`,tone:'text-rose-300 border-rose-400/25'};if(days===0)return{label:'Due today',tone:'text-amber-200 border-amber-300/25'};if(days<=2)return{label:`Due in ${days}d`,tone:'text-amber-200 border-amber-300/25'};return{label:`Due ${new Date(sub.due_at).toLocaleDateString()}`,tone:'text-white/46 border-white/10'}}\nexport default function PcgWorkspace({initialTab='today',embedded=false,initialVaultMode='overview',initialVaultSubmissionId='',onSubmissionCreated,navigationScope}:{initialTab?:Tab;embedded?:boolean;initialVaultMode?:'overview'|'single'|'batch'|'growth';initialVaultSubmissionId?:string;onSubmissionCreated?:(submission:{id:string;submission_number:string;expected_card_count:number})=>void;navigationScope?:Tab[]}={}){const location=useLocation();const{activeTenant}=useMultiTenant();const tenantId=activeTenant?.id;const settings=((activeTenant as any)?.settings||{}) as Record<string,unknown>;const mediaBranding=useMemo(()=>resolveTenantMediaBranding(activeTenant as any),[activeTenant]);const workspaceBackground=mediaBranding.backgroundUrl||String(settings.background_image_url||settings.backgroundImageUrl||'').trim();const stripePaymentLink=String(settings.stripe_payment_link||PCG_STRIPE_FALLBACK);const stripeSyncConnected=String(settings.stripe_sync_status||'not_connected')==='connected';const[tab,setTab]=useState<Tab>(initialTab);const visibleTabs=useMemo(()=>navigationScope?.length?tabs.filter(([id])=>navigationScope.includes(id)):tabs,[navigationScope]);useEffect(()=>{setTab(initialTab)},[initialTab]);useEffect(()=>{if(navigationScope?.length&&!navigationScope.includes(tab))setTab(navigationScope.includes(initialTab)?initialTab:navigationScope[0])},[initialTab,navigationScope,tab]);const[subs,setSubs]=useState<Submission[]>([]);const[cards,setCards]=useState<Card[]>([]);const[loading,setLoading]=useState(true);const[showNew,setShowNew]=useState(false);const[showMore,setShowMore]=useState(false);const[selectedId,setSelectedId]=useState<string|null>(null);const[query,setQuery]=useState('');const[statusFilter,setStatusFilter]=useState('all');const[certQuery,setCertQuery]=useState('');const[busy,setBusy]=useState(false);const[cardDrafts,setCardDrafts]=useState<Record<string,CardDraft>>({});const[detailDraft,setDetailDraft]=useState<DetailDraft>({tracking_in:'',tracking_out:'',notes:'',payment_status:'unverified',payment_reference:''});const[form,setForm]=useState({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});const settingsSection=String(new URLSearchParams(location.search).get('section')||'').trim().toLowerCase();const selectedTier=tiers[form.tier as keyof typeof tiers]||tiers.two_weeks;const selectedCardCount=Math.max(1,Math.min(100000,Number(form.cardCount)||1));const expectedTotal=selectedCardCount*selectedTier.price;const openStripe=()=>window.open(stripePaymentLink,'_blank','noopener,noreferrer');\nasync function load(){if(!tenantId)return;setLoading(true);const[s,c]=await Promise.all([(supabase as any).from('card_grading_submissions').select('*').eq('tenant_id',tenantId).order('created_at',{ascending:false}),(supabase as any).from('card_grading_cards').select('*').eq('tenant_id',tenantId).order('sequence_number',{ascending:true})]);if(s.error)toast.error(s.error.message);if(c.error)toast.error(c.error.message);setSubs((s.data||[]) as Submission[]);setCards((c.data||[]) as Card[]);setLoading(false)}useEffect(()=>{void load()},[tenantId]);\nconst orderCardCount=(sub:Submission)=>Math.max(Number(sub.expected_card_count||0),cards.filter(card=>card.submission_id===sub.id).length);const counts=useMemo(()=>Object.fromEntries(statuses.map(status=>[status,subs.filter(item=>item.status===status).length])),[subs]);const openSubs=subs.filter(item=>!terminalStatuses.has(item.status));const overdue=openSubs.filter(item=>item.due_at&&new Date(item.due_at)<new Date()).length;const dueSoon=openSubs.filter(item=>item.due_at&&new Date(item.due_at)>=new Date()&&new Date(item.due_at).getTime()-Date.now()<=2*86400000).length;const serviceValue=subs.reduce((sum,item)=>sum+Number(item.service_price||0)*orderCardCount(item),0);const prioritySubs=[...openSubs].sort((a,b)=>(a.due_at?new Date(a.due_at).getTime():Number.MAX_SAFE_INTEGER)-(b.due_at?new Date(b.due_at).getTime():Number.MAX_SAFE_INTEGER)).slice(0,6);const filteredSubs=subs.filter(item=>{const hay=`${item.submission_number} ${item.customer_name||''} ${item.customer_email||''} ${item.customer_phone||''}`.toLowerCase();return(!query||hay.includes(query.toLowerCase()))&&(statusFilter==='all'||item.status===statusFilter)});const filteredCards=cards.filter(card=>!certQuery||`${card.cert_number||''} ${card.year||''} ${card.brand_set||''} ${card.player_character||''} ${card.card_description||card.variation||''} ${card.card_number||''}`.toLowerCase().includes(certQuery.toLowerCase()));const selected=subs.find(item=>item.id===selectedId)||null;const selectedCards=selected?cards.filter(card=>card.submission_id===selected.id):[];const selectedTotal=selected?orderCardCount(selected)*Number(selected.service_price||0):0;\nfunction openSubmission(sub:Submission){setSelectedId(sub.id);setDetailDraft({tracking_in:sub.tracking_in||'',tracking_out:sub.tracking_out||'',notes:sub.notes||'',payment_status:sub.payment_status||'unverified',payment_reference:sub.payment_reference||''});const next:Record<string,CardDraft>={};cards.filter(card=>card.submission_id===sub.id).forEach(card=>{next[card.id]=cardToDraft(card)});setCardDrafts(next)}\nasync function createSubmission(){if(!tenantId)return;if(!form.name.trim()){toast.error('Customer name is required.');return}const count=selectedCardCount,tier=selectedTier,now=new Date(),due=new Date(now);due.setDate(due.getDate()+tier.days);const submissionNumber=`PCG-${now.getFullYear()}-${String(Date.now()).slice(-7)}`;setBusy(true);const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:submissionNumber,customer_name:form.name.trim(),customer_email:form.email.trim()||null,customer_phone:form.phone.trim()||null,service_tier:form.tier,service_price:tier.price,expected_card_count:count,status:'received',payment_status:'unverified',delivery_method:form.delivery,notes:form.notes.trim()||null,received_at:now.toISOString(),due_at:due.toISOString()}).select('*').single();if(error||!data){toast.error(error?.message||'Unable to create submission');setBusy(false);return}toast.success(`${submissionNumber} created for ${count.toLocaleString()} card${count===1?'':'s'}. Opening Capture Cards for this order.`);setShowNew(false);setForm({name:'',email:'',phone:'',tier:'two_weeks',cardCount:'1',delivery:'walk_in',notes:''});await load();setBusy(false);onSubmissionCreated?.({id:String(data.id),submission_number:String(data.submission_number||submissionNumber),expected_card_count:count})}\nfunction transitionIssue(sub:Submission,nextStatus:string,ownCards:Card[]){if(nextStatus==='authentication'){if(!ownCards.length)return 'Add cards before authentication.';const missing=ownCards.filter(card=>!card.front_image_url&&!card.back_image_url&&!card.slab_image_url).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' a saved intake image before authentication.'):''}if(nextStatus==='encapsulation'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)).length;return missing?(missing+' card'+(missing===1?' needs':'s need')+' an official PCG grade before encapsulation.'):''}if(nextStatus==='qa'){const missingGrade=ownCards.filter(card=>!hasCanonicalGrade(card)).length,missingCert=ownCards.filter(card=>!String(card.cert_number||'').trim()).length;return missingGrade||missingCert?('Save '+(missingGrade?(missingGrade+' missing official PCG grade'+(missingGrade===1?'':'s')):'')+(missingGrade&&missingCert?' and ':'')+(missingCert?(missingCert+' missing cert number'+(missingCert===1?'':'s')):'')+' before QA.'):''}if(nextStatus==='ready'){const missing=ownCards.filter(card=>!hasCanonicalGrade(card)||!String(card.cert_number||'').trim()||(!card.slab_image_url&&!card.front_image_url&&!card.back_image_url)).length;return missing?(missing+' card'+(missing===1?' is':'s are')+' missing official PCG grade, cert, or customer-visible imagery.'):''}if(nextStatus==='shipped'&&!String(sub.tracking_out||'').trim())return 'Save outbound tracking before marking this order shipped.';return ''}async function advanceBatch(nextStatus:string){if(!tenantId||!selected)return;const issue=transitionIssue(selected,nextStatus,selectedCards);if(issue){toast.error(issue);return}setBusy(true);const{error}=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selected.id,p_status:nextStatus});if(error)toast.error(error.message||'Unable to advance submission');else{toast.success(`${selected.submission_number} moved to ${pretty(nextStatus)}.`);await load()}setBusy(false)}\nasync function saveSubmissionDetails(){if(!tenantId||!selected)return;setBusy(true);const manual=detailDraft.payment_status==='manually_verified';const{error}=await(supabase as any).from('card_grading_submissions').update({tracking_in:detailDraft.tracking_in.trim()||null,tracking_out:detailDraft.tracking_out.trim()||null,notes:detailDraft.notes.trim()||null,payment_status:detailDraft.payment_status,payment_reference:detailDraft.payment_reference.trim()||null,paid_at:manual?(selected.paid_at||new Date().toISOString()):null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',selected.id);if(error)toast.error(error.message);else{toast.success('Submission details saved.');await load()}setBusy(false)}\nasync function saveCard(card:Card){if(!tenantId)return;const draft=cardDrafts[card.id];if(!draft)return;setBusy(true);const gradeDefinition=findPCGGrade(draft.grade_label);const grade=gradeDefinition?gradeDefinition.numeric:(draft.grade.trim()===''?null:Number(draft.grade));const gradeLabel=gradeDefinition?.designation||draft.grade_label.trim()||null;const declared=draft.declared_value.trim()===''?null:Number(draft.declared_value);if(grade!=null&&(Number.isNaN(grade)||grade<0||grade>10)){toast.error('Legacy numeric grade is invalid. Choose an official PCG grade.');setBusy(false);return}const{error}=await(supabase as any).from('card_grading_cards').update({category:draft.category.trim()||null,year:draft.year.trim()||null,brand_set:draft.brand_set.trim()||null,player_character:draft.player_character.trim()||null,card_number:draft.card_number.trim()||null,card_description:draft.card_description.trim()||null,autograph_present:draft.autograph_present===''?null:draft.autograph_present==='yes',variation:draft.card_description.trim()||null,declared_value:declared,grade,grade_label:gradeLabel,cert_number:draft.cert_number.trim()||null,grader_notes:draft.grader_notes.trim()||null,updated_at:new Date().toISOString()}).eq('tenant_id',tenantId).eq('id',card.id);if(error)toast.error(error.message);else{toast.success(`Card #${card.sequence_number} saved.`);await load()}setBusy(false)}\nconst metric=(label:string,value:string|number,sub:string)=><div className=\"py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">{label}</div><div className=\"mt-1 text-3xl font-black tracking-[-.04em]\">{value}</div><div className=\"mt-1 text-[11px] text-white/36\">{sub}</div></div>;\nconst empty=(title:string,copy:string,action?:()=>void,actionLabel?:string)=><div className=\"border border-dashed border-white/[0.10] bg-[#09090a]/94 p-9 text-center\"><FileCheck2 className=\"mx-auto h-6 w-6 text-[#d8bb78]\"/><div className=\"mt-4 text-lg font-black\">{title}</div><p className=\"mx-auto mt-2 max-w-md text-sm leading-6 text-white/38\">{copy}</p>{action&&<button onClick={action} className=\"mt-5 bg-[#d8bb78] px-5 py-2.5 text-sm font-black text-black\">{actionLabel}</button>}</div>;\nconst row=(sub:Submission)=>{const cardCount=cards.filter(card=>card.submission_id===sub.id).length;const expected=Math.max(Number(sub.expected_card_count||0),cardCount);const payment=sub.payment_status==='manually_verified'?'Paid':sub.payment_status==='waived'?'Waived':'Unverified';return <button key={sub.id} onClick={()=>openSubmission(sub)} className=\"group grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-2 py-2.5 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"min-w-0\"><div className=\"flex flex-wrap items-center gap-2\"><span className=\"text-xs font-black tracking-wide text-[#e4c47b]\">{sub.submission_number}</span><span className=\"text-[9px] font-black uppercase tracking-[.12em] text-white/32\">{pretty(sub.status)}</span></div><div className=\"mt-1 truncate text-sm font-black sm:text-[15px]\">{sub.customer_name||'Collector not named'}</div><div className=\"mt-0.5 flex flex-wrap gap-x-3 text-[10px] text-white/34 sm:text-[11px]\"><span>{expected>cardCount?`${cardCount.toLocaleString()} / ${expected.toLocaleString()} cards ingested`:`${cardCount.toLocaleString()} card${cardCount===1?'':'s'}`}</span><span>{tiers[sub.service_tier as keyof typeof tiers]?.label||pretty(sub.service_tier)}</span><span>{payment}</span></div></div><div className=\"flex items-center gap-2\"><span className={`border px-2.5 py-1 text-[10px] font-black ${slaMeta(sub).tone}`}>{slaMeta(sub).label}</span><ChevronRight className=\"h-4 w-4 text-white/18\"/></div></button>};\nconst renderList=(heading:string,eyebrow:string,source:Submission[])=><section><div className=\"mb-6 flex flex-col gap-4 border-b border-white/[0.08] pb-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">{eyebrow}</div><h1 className=\"mt-1.5 text-2xl font-black tracking-[-.035em] sm:text-3xl\">{heading}</h1><p className=\"mt-2 text-sm text-white/38\">Open a batch to grade cards, verify payment, update tracking or move it forward.</p></div><button onClick={()=>setShowNew(true)} className=\"inline-flex items-center justify-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div><div className=\"mb-5 grid gap-2 sm:grid-cols-[1fr_220px]\"><div className=\"relative\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={query} onChange={event=>setQuery(event.target.value)} placeholder=\"Search submission or collector\" className={`${inputClass} pl-11`}/></div><select value={statusFilter} onChange={event=>setStatusFilter(event.target.value)} className={inputClass}><option value=\"all\">Every grading stage</option>{statuses.map(status=><option key={status} value={status}>{pretty(status)}</option>)}</select></div>{source.length?<div className=\"border-y border-white/[0.08]\">{source.map(row)}</div>:empty('Nothing needs attention','Receive a new card submission when work arrives.',()=>setShowNew(true),'Receive cards')}</section>;\nconst brandName=activeTenant?.company_dba_name||activeTenant?.company_legal_name||activeTenant?.name||'Prestigious Card Grading';\nreturn <div data-pcg-mode-workspace-background={workspaceBackground||'solid'} className=\"relative min-h-screen overflow-x-hidden bg-[#050506] text-white\" style={{backgroundImage:workspaceBackground?`linear-gradient(108deg,rgba(4,4,5,.98) 0%,rgba(4,4,5,.91) 35%,rgba(4,4,5,.68) 70%,rgba(4,4,5,.88) 100%),url(\"${workspaceBackground}\")`:undefined,backgroundSize:'cover',backgroundPosition:mediaBranding.backgroundPosition||'center',backgroundRepeat:'no-repeat',backgroundAttachment:'fixed'}}><div className=\"pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_78%_15%,rgba(216,187,120,.10),transparent_28rem)]\"/>\n{!embedded?<header className=\"fixed inset-x-0 top-0 z-50 h-16 border-b border-white/[0.07] bg-[#09090a]/95 backdrop-blur-xl\"><div className=\"flex h-full items-center gap-3 px-4 sm:px-6\"><div className=\"grid h-9 w-9 place-items-center border border-[#d8bb78]/20 bg-[#d8bb78]/[0.06]\"><img src={PCG_LOGO} alt=\"PCG\" className=\"h-full w-full object-contain p-1\"/></div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black tracking-tight\">{brandName}</div><div className=\"hidden text-[9px] font-bold uppercase tracking-[.17em] text-white/30 sm:block\">PCG daily work</div></div><div className=\"ml-auto flex items-center gap-3\"><span className=\"hidden text-xs font-semibold text-white/32 md:inline\">{openSubs.length} active batches</span><button onClick={()=>setShowNew(true)} className=\"inline-flex h-9 items-center gap-2 bg-[#d8bb78] px-3.5 text-xs font-black text-black\"><Plus className=\"h-4 w-4\"/>Receive cards</button></div></div></header>:null}\n{!embedded?<aside className=\"fixed bottom-0 left-0 top-16 z-40 hidden w-[230px] border-r border-white/[0.07] bg-[#09090a]/95 px-4 py-5 backdrop-blur-xl lg:flex lg:flex-col\"><div className=\"px-2\"><div className=\"text-[9px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">PCG Work Queue</div><div className=\"mt-2 text-sm leading-5 text-white/40\">Receive, grade, publish, and fulfill cards.</div></div><nav className=\"mt-7 space-y-1\">{visibleTabs.map(([id,label,Icon])=><button key={id} onClick={()=>setTab(id)} className={`flex h-11 w-full items-center gap-3 px-3 text-left text-sm font-bold transition ${tab===id?'bg-white/[0.07] text-white shadow-[inset_2px_0_0_#d8bb78]':'text-white/40 hover:bg-white/[0.035] hover:text-white/80'}`}><Icon className={`h-[17px] w-[17px] ${tab===id?'text-[#d8bb78]':'text-white/30'}`}/><span className=\"flex-1\">{label}</span>{id==='queue'&&openSubs.length?<span className=\"text-[10px] font-black text-[#d8bb78]\">{openSubs.length}</span>:null}</button>)}</nav><div className=\"mt-auto border-t border-white/[0.07] px-2 pt-4\"><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-white/25\">Prestigious Card Grading</div><div className=\"mt-2 text-xs leading-5 text-white/36\">14170 US Highway 1<br/>Sebastian, FL 32958</div></div></aside>:null}\n<main className={`relative z-10 min-h-screen px-4 pb-24 sm:px-6 lg:px-8 lg:pb-10 xl:px-10 ${embedded?'pt-4 sm:pt-6':'pt-20 lg:ml-[230px]'}`}>{loading?<div className=\"grid min-h-[70vh] place-items-center\"><div className=\"text-center\"><img src={PCG_LOGO} alt=\"PCG\" className=\"mx-auto h-16 w-16 object-contain opacity-70\"/><div className=\"mt-4 text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Opening PCG…</div></div></div>:<>\n{tab==='today'?<><section className=\"border-b border-white/[0.08] pb-7 pt-3\"><div className=\"flex flex-col gap-7 xl:flex-row xl:items-end xl:justify-between\"><div className=\"max-w-3xl\"><div className=\"text-[10px] font-black uppercase tracking-[.22em] text-[#d8bb78]\">Daily work</div><h1 className=\"mt-2 text-3xl font-black leading-none tracking-[-.045em] sm:text-4xl\">PCG Work Queue</h1><p className=\"mt-2 max-w-2xl text-sm leading-5 text-white/42\">See what needs attention and move each submission through the next clear step.</p></div><div className=\"grid w-full max-w-xl grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08] sm:grid-cols-3\"><button onClick={()=>setShowNew(true)} className=\"bg-[#09090a]/94 p-4 text-left\"><Plus className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Receive Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Start a submission</div></button><button onClick={()=>setTab('vault')} className=\"bg-[#09090a]/94 p-4 text-left\"><UploadCloud className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Capture Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Single or batch intake</div></button><button onClick={()=>setTab('queue')} className=\"col-span-2 bg-[#09090a]/94 p-4 text-left sm:col-span-1\"><Award className=\"h-5 w-5 text-[#d8bb78]\"/><div className=\"mt-3 text-sm font-black\">Grade Cards</div><div className=\"mt-1 text-[11px] text-white/30\">Work the grading queue</div></button></div></div><div className=\"mt-8 grid sm:grid-cols-2 xl:grid-cols-4\">{metric('Batches on floor',openSubs.length,'Active submissions')}{metric('Cards in house',cards.filter(card=>!terminalStatuses.has(card.status)).length,'Individual cards')}{metric('SLA attention',overdue+dueSoon,overdue?`${overdue} overdue · ${dueSoon} due soon`:`${dueSoon} due within 48 hours`)}{metric('Recorded work',`$${serviceValue.toFixed(0)}`,stripeSyncConnected?'Stripe sync connected':'Stripe sync not connected')}</div></section><div className=\"mt-8 grid gap-8 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,.8fr)]\"><section><div className=\"mb-3 flex items-end justify-between\"><div><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Priority work</div><h2 className=\"mt-1 text-2xl font-black\">Next on the grading bench</h2></div><button onClick={()=>setTab('queue')} className=\"text-xs font-black text-[#d8bb78]\">Grade cards →</button></div><div className=\"border-y border-white/[0.08]\">{prioritySubs.length?prioritySubs.map(row):empty('Nothing needs grading','No grading batches need attention right now.',()=>setShowNew(true),'Receive cards')}</div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[9px] font-black uppercase tracking-[.19em] text-[#d8bb78]\">Stage pressure</div><h2 className=\"mt-1 text-2xl font-black\">Where the cards are</h2><div className=\"mt-5 divide-y divide-white/[0.07]\">{statuses.map((status,index)=><button key={status} onClick={()=>{setStatusFilter(status);setTab('queue')}} className=\"grid w-full grid-cols-[28px_1fr_auto] items-center gap-3 py-3 text-left\"><span className=\"text-[9px] font-black text-white/18\">{String(index+1).padStart(2,'0')}</span><span className=\"text-xs font-bold text-white/48\">{pretty(status)}</span><span className=\"text-base font-black\">{counts[status]||0}</span></button>)}</div></section></div></>:null}\n{tab==='vault'?<PCGCardVaultContent initialMode={initialVaultMode} initialSubmissionId={initialVaultSubmissionId}/>:null}{tab==='queue'?renderList('Grade Cards','Active grading work',filteredSubs.filter(item=>!terminalStatuses.has(item.status))):null}{tab==='submissions'?renderList('Receive Cards','All submissions',filteredSubs):null}{tab==='shipping'?renderList('Fulfill & Ship','Ready · shipped · pickup',filteredSubs.filter(item=>['ready','shipped','picked_up'].includes(item.status)||Boolean(item.tracking_in)||Boolean(item.tracking_out))):null}\n{tab==='certs'?<section><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Card lookup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Certificates</h1></div><div className=\"relative mt-3 max-w-2xl\"><Search className=\"absolute left-4 top-3.5 h-4 w-4 text-white/28\"/><input value={certQuery} onChange={event=>setCertQuery(event.target.value)} placeholder=\"Search certificate, card, player, or set\" className={`${inputClass} pl-11`}/></div>{filteredCards.length?<div className=\"mt-3 overflow-hidden border border-white/[0.08] bg-black/20\">{filteredCards.map(card=>{const image=card.slab_image_url||card.front_image_url;const title=[card.year,card.brand_set,card.player_character,card.card_description||card.variation,card.card_number?`#${card.card_number}`:null].filter(Boolean).join(' · ')||`Card #${card.sequence_number}`;const grade=hasCanonicalGrade(card)?formatPCGGrade(card.grade,card.grade_label):'';return <button key={card.id} onClick={()=>{const sub=subs.find(item=>item.id===card.submission_id);if(sub)openSubmission(sub)}} className=\"grid min-h-[68px] w-full grid-cols-[44px_minmax(0,1fr)_auto] items-center gap-3 border-b border-white/[0.07] px-3 py-2 text-left transition last:border-b-0 hover:bg-white/[0.025]\"><div className=\"grid h-14 w-11 shrink-0 place-items-center overflow-hidden border border-white/[0.08] bg-[#09090a]/94\">{image?<img src={image} alt=\"Graded card\" className=\"h-full w-full object-cover\"/>:<ShieldCheck className=\"h-5 w-5 text-[#d8bb78]/55\"/>}</div><div className=\"min-w-0\"><div className=\"truncate text-sm font-black leading-tight\">{title}</div><div className=\"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-white/35\"><span>{card.cert_number||'Cert pending'}</span>{grade?<span className=\"font-black text-[#e8cc8d]/75\">{grade}</span>:null}</div></div><ChevronRight className=\"h-4 w-4 shrink-0 text-white/20\"/></button>})}</div>:<div className=\"mt-4\">{empty('No certificates yet','Certificate records appear here as grading is completed.')}</div>}</section>:null}\n{tab==='collectors'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Customer records</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Customers</h1></div>{subs.some(item=>item.customer_name)?<div className=\"mt-6 border-y border-white/[0.08]\">{Array.from(new Map(subs.filter(item=>item.customer_name).map(item=>[item.customer_name,item])).values()).map(sub=>{const related=subs.filter(item=>item.customer_name===sub.customer_name);const relatedCards=cards.filter(card=>related.some(item=>item.id===card.submission_id));return <button key={sub.customer_name!} onClick={()=>openSubmission(related[0])} className=\"grid w-full grid-cols-[1fr_auto_auto] items-center gap-4 border-b border-white/[0.07] px-1 py-4 text-left\"><div><div className=\"font-black\">{sub.customer_name}</div><div className=\"mt-1 text-xs text-white/32\">{sub.customer_email||sub.customer_phone||'Contact info not captured'}</div></div><div className=\"text-right\"><div className=\"text-lg font-black\">{related.length}</div><div className=\"text-[9px] text-white/25\">SUBMISSIONS</div></div><div className=\"text-right\"><div className=\"text-lg font-black text-[#d8bb78]\">{relatedCards.length}</div><div className=\"text-[9px] text-white/25\">CARDS</div></div></button>})}</div>:empty('No customers yet','Customers appear automatically when a card submission is received.',()=>setShowNew(true),'Receive cards')}</section>:null}\n{tab==='inventory'?<PCGBatchPublishingCenter tenantId={tenantId||''}/>:null}\n{tab==='migration'?<PCGLegacyMigrationCenter/>:null}\n{tab==='readiness'?<PCGOnboardingReadiness/>:null}\n{tab==='settings'?<section>\n    <div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">PCG setup</div><h1 className=\"mt-1 text-2xl font-black sm:text-3xl\">Settings</h1><p className=\"mt-1.5 max-w-2xl text-sm leading-6 text-white/45\">Only the controls Anthony needs to run PCG. Pick a category instead of digging through platform settings.</p></div>\n    {!settingsSection?<div className=\"mt-4 grid gap-2 sm:grid-cols-2 xl:grid-cols-3\">\n      {[\n        ['business','Brand & workspace','Logo, backgrounds, public-facing identity and workspace presentation.'],\n        ['connections','Google & connections','Google Drive, eBay and other connected services.'],\n        ['mail','Email & customers','Business email continuity and customer-facing channels.'],\n        ['notifications','Notifications','What PCG alerts you about and where they go.'],\n        ['profile','Profile & staff','Owner profile and people using this workspace.'],\n        ['workspace','Workspace behavior','Layout, experience and workspace health.']\n      ].map(([section,title,copy])=><a key={section} href={'?tool=settings&section='+section} className=\"group flex min-h-[112px] items-start justify-between gap-4 rounded-2xl border border-white/[0.08] bg-[#09090a]/94 p-4 shadow-sm transition hover:border-white/[0.16] hover:bg-white/[.025]\"><span><span className=\"block text-sm font-black\">{title}</span><span className=\"mt-1 block text-xs leading-5 text-white/42\">{copy}</span></span><ChevronRight className=\"mt-1 h-4 w-4 shrink-0 text-white/28 transition group-hover:translate-x-0.5\"/></a>)}\n    </div>:<div className=\"pcg-settings-dark mt-4\"><style>{`.pcg-settings-dark{color:#fff}.pcg-settings-dark .bg-card,.pcg-settings-dark [class*=\"bg-card\"],.pcg-settings-dark .bg-background,.pcg-settings-dark [class*=\"bg-background\"]{background:#09090a!important}.pcg-settings-dark .text-foreground{color:#fff!important}.pcg-settings-dark .text-muted-foreground{color:rgba(255,255,255,.55)!important}.pcg-settings-dark [class*=\"border\"]{border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark button:not([role=\"switch\"]){background:#111214!important;color:#fff!important;border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark button:not([role=\"switch\"]):hover{background:#191b1e!important}.pcg-settings-dark input,.pcg-settings-dark select,.pcg-settings-dark textarea{background:#090a0b!important;color:#fff!important;border-color:rgba(255,255,255,.12)!important}.pcg-settings-dark input::placeholder,.pcg-settings-dark textarea::placeholder{color:rgba(255,255,255,.35)!important}`}</style><a href=\"?tool=settings\" className=\"mb-3 inline-flex min-h-10 items-center gap-2 rounded-lg border border-white/[0.08] bg-[#09090a]/94 px-3 text-xs font-black text-white/55\">← All PCG settings</a><TenantSettingsPage/></div>}\n  </section>:null}\n{tab==='money'?<section><div className=\"border-b border-white/[0.08] pb-5\"><div className=\"text-[10px] font-black uppercase tracking-[.20em] text-[#d8bb78]\">Admin · payments</div><h1 className=\"mt-1.5 text-2xl font-black sm:text-3xl\">Payments</h1></div><div className=\"mt-6 grid gap-8 xl:grid-cols-[1.15fr_.85fr]\"><section><div className=\"flex items-center justify-between border-b border-white/[0.08] pb-4\"><div className=\"flex items-center gap-3\"><CreditCard className=\"h-5 w-5 text-[#635bff]\"/><div><div className=\"text-sm font-black\">Stripe hosted checkout</div><div className=\"text-xs text-white/30\">PCG grading payments</div></div></div><span className={stripeSyncConnected?'text-xs font-black text-emerald-300':'text-xs font-black text-amber-200'}>{stripeSyncConnected?'Data sync connected':'Data sync not connected'}</span></div><div className=\"mt-6 text-[10px] font-black uppercase tracking-[.18em] text-white/30\">Recorded grading service value</div><div className=\"mt-2 text-3xl font-black sm:text-4xl\">${serviceValue.toFixed(2)}</div><p className=\"mt-3 text-sm leading-6 text-white/38\">This is grading work recorded in KnockLaunch, not a claimed Stripe balance unless sync is authenticated.</p><button onClick={openStripe} className=\"mt-7 inline-flex items-center gap-2 bg-[#d8bb78] px-5 py-3 text-sm font-black text-black\">Open PCG Stripe checkout <ExternalLink className=\"h-4 w-4\"/></button></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading menu</div><div className=\"mt-5 divide-y divide-white/[0.07]\">{Object.entries(tiers).map(([id,tier])=><div key={id} className=\"flex items-center justify-between py-4\"><div><div className=\"font-black\">{tier.label}</div><div className=\"text-xs text-white/28\">Per card · no up-charges</div></div><div className=\"text-2xl font-black text-[#d8bb78]\">${tier.price}</div></div>)}</div></section></div></section>:null}</>}</main>\n{!embedded?<nav className=\"fixed inset-x-3 bottom-3 z-50 grid grid-cols-5 border border-white/[0.09] bg-[#09090a]/95 p-1.5 shadow-2xl backdrop-blur-xl lg:hidden\">{mobilePrimary.map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className={`flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black ${tab===id?'bg-white/[0.07] text-white':'text-white/38'}`}><Icon className={`h-[18px] w-[18px] ${tab===id?'text-[#d8bb78]':'text-white/28'}`}/><span>{label}</span></button>)}<button onClick={()=>setShowMore(true)} className=\"flex flex-col items-center gap-1 px-1 py-2 text-[9px] font-black text-white/38\"><Menu className=\"h-[18px] w-[18px] text-white/28\"/>More</button></nav>:null}\n{!embedded&&showMore?<div className=\"fixed inset-0 z-[70] bg-black/74 lg:hidden\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowMore(false)}}><div className=\"absolute inset-x-0 bottom-0 border-t border-white/[0.10] bg-[#09090a]/94 p-4\"><div className=\"mb-4 text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">More PCG tools</div><div className=\"grid grid-cols-2 gap-px border border-white/[0.08] bg-white/[0.08]\">{visibleTabs.filter(([id])=>!mobilePrimary.some(([primary])=>primary===id)).map(([id,label,Icon])=><button key={id} onClick={()=>{setTab(id);setShowMore(false)}} className=\"flex items-center gap-3 bg-[#09090a]/94 px-4 py-3 text-sm font-bold\"><Icon className=\"h-4 w-4 text-[#d8bb78]\"/>{label}</button>)}</div><button onClick={()=>setShowMore(false)} className=\"mt-3 w-full border border-white/[0.08] py-3 text-sm font-bold text-white/45\">Close</button></div></div>:null}\n{showNew?<div className=\"fixed inset-0 z-[80] grid place-items-center overflow-y-auto bg-black/82 p-4 backdrop-blur-md\" onMouseDown={event=>{if(event.currentTarget===event.target)setShowNew(false)}}><div className=\"w-full max-w-2xl border border-white/[0.10] bg-[#09090a]/94\"><div className=\"flex items-center justify-between border-b border-white/[0.08] p-5\"><div><div className=\"text-[9px] font-black uppercase tracking-[.18em] text-[#d8bb78]\">Grading intake</div><h2 className=\"mt-1 text-2xl font-black\">Receive cards into PCG</h2></div><button onClick={()=>setShowNew(false)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><div className=\"p-5\"><div className=\"grid gap-3 sm:grid-cols-2\"><input value={form.name} onChange={event=>setForm({...form,name:event.target.value})} placeholder=\"Collector name\" className={inputClass}/><input value={form.email} onChange={event=>setForm({...form,email:event.target.value})} placeholder=\"Email\" className={inputClass}/><input value={form.phone} onChange={event=>setForm({...form,phone:event.target.value})} placeholder=\"Phone\" className={inputClass}/><input value={form.cardCount} onChange={event=>setForm({...form,cardCount:event.target.value})} type=\"number\" min=\"1\" max=\"100000\" placeholder=\"Expected card count\" className={inputClass}/><select value={form.tier} onChange={event=>setForm({...form,tier:event.target.value})} className={inputClass}>{Object.entries(tiers).map(([id,tier])=><option key={id} value={id}>{tier.label} · ${tier.price}/card</option>)}</select><select value={form.delivery} onChange={event=>setForm({...form,delivery:event.target.value})} className={inputClass}><option value=\"walk_in\">Walk-in</option><option value=\"mail_in\">Mail-in</option><option value=\"ship_back\">Ship back</option><option value=\"pickup\">Pickup</option></select><textarea value={form.notes} onChange={event=>setForm({...form,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><div className=\"mt-4 flex items-end justify-between border-t border-white/[0.08] pt-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.15em] text-[#d8bb78]\">Expected grading total</div><div className=\"mt-1 text-3xl font-black\">${expectedTotal.toFixed(2)}</div></div><div className=\"text-right text-xs text-white/30\">{selectedCardCount} card{selectedCardCount===1?'':'s'} × ${selectedTier.price}</div></div><div className=\"mt-5 grid gap-2 sm:grid-cols-2\"><button onClick={openStripe} className=\"inline-flex items-center justify-center gap-2 border border-white/10 px-4 py-3 font-black\"><CreditCard className=\"h-4 w-4\"/>Collect in Stripe</button><button disabled={busy} onClick={()=>void createSubmission()} className=\"bg-[#d8bb78] px-4 py-3 font-black text-black disabled:opacity-50\">{busy?'Creating…':'Create submission'}</button></div><p className=\"mt-3 text-center text-xs text-white/28\">Creating the submission never marks it paid.</p></div></div></div>:null}\n{selected?<div className=\"fixed inset-0 z-[80] bg-black/72\" onMouseDown={event=>{if(event.currentTarget===event.target)setSelectedId(null)}}><aside className=\"absolute inset-y-0 right-0 w-full max-w-3xl overflow-y-auto border-l border-white/10 bg-[#09090a]/94 p-4 pb-24 sm:p-6\"><div className=\"flex items-start justify-between gap-4 border-b border-white/[0.08] pb-4\"><div><div className=\"text-[9px] font-black uppercase tracking-[.17em] text-[#d8bb78]\">Submission workbench</div><h2 className=\"mt-1 text-2xl font-black\">{selected.submission_number}</h2><div className=\"mt-1 text-sm text-white/34\">{selected.customer_name||'Collector not named'} · {selectedCards.length.toLocaleString()} ingested / {orderCardCount(selected).toLocaleString()} expected · ${selectedTotal.toFixed(2)}</div></div><button onClick={()=>setSelectedId(null)} className=\"border border-white/10 p-2 text-white/35\"><X className=\"h-5 w-5\"/></button></div><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Grading stage</div><div className=\"mt-4 flex flex-wrap gap-2\">{statuses.map(status=><div key={status} className={`border px-2.5 py-1 text-[9px] font-black ${selected.status===status?'border-[#d8bb78]/45 text-[#e8cc8d]':'border-white/10 text-white/28'}`}>{pretty(status)}</div>)}</div><div className=\"mt-4\">{(()=>{const index=statuses.indexOf(selected.status as any);const next=index>=0&&index<statuses.length-1?statuses[index+1]:null;const issue=next?transitionIssue(selected,next,selectedCards):'';return <>{terminalStatuses.has(selected.status)?<div className=\"mb-3 text-xs font-black text-emerald-300\"><Check className=\"mr-1 inline h-3.5 w-3.5\"/>Lifecycle complete</div>:next?<div className={'mb-3 text-xs leading-5 '+(issue?'text-amber-200':'text-emerald-300')}>{issue||<>Ready to advance to {pretty(next)}.</>}</div>:null}{next&&!terminalStatuses.has(selected.status)&&selected.status!=='ready'?<button disabled={busy||Boolean(issue)} onClick={()=>void advanceBatch(next)} className=\"inline-flex items-center gap-2 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Advance to {pretty(next)} <ChevronRight className=\"h-4 w-4\"/></button>:null}{selected.status==='ready'?<><button disabled={busy||Boolean(transitionIssue(selected,'shipped',selectedCards))} onClick={()=>void advanceBatch('shipped')} className=\"bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black disabled:cursor-not-allowed disabled:opacity-35\">Mark shipped</button><button disabled={busy} onClick={()=>void advanceBatch('picked_up')} className=\"ml-2 border border-white/10 px-4 py-2.5 text-sm font-black\">Mark picked up</button></>:null}</>})()}</div></section><section className={`${panelClass} mt-4 p-4`}><div className=\"flex items-center justify-between\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Collector & payment</div><BadgeDollarSign className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><select value={detailDraft.payment_status} onChange={event=>setDetailDraft({...detailDraft,payment_status:event.target.value})} className={inputClass}><option value=\"unverified\">Payment not verified</option><option value=\"manually_verified\">Manually verified paid</option><option value=\"waived\">Waived</option><option value=\"refunded\">Refunded</option></select><input value={detailDraft.payment_reference} onChange={event=>setDetailDraft({...detailDraft,payment_reference:event.target.value})} placeholder=\"Reference / Stripe receipt ID\" className={inputClass}/></div><button onClick={openStripe} className=\"mt-3 inline-flex items-center gap-2 text-sm font-black text-[#d8bb78]\"><ExternalLink className=\"h-4 w-4\"/>Open PCG Stripe checkout</button></section><section className={`${panelClass} mt-4 p-4`}><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Shipping & notes</div><div className=\"mt-4 grid gap-3 sm:grid-cols-2\"><input value={detailDraft.tracking_in} onChange={event=>setDetailDraft({...detailDraft,tracking_in:event.target.value})} placeholder=\"Inbound tracking\" className={inputClass}/><input value={detailDraft.tracking_out} onChange={event=>setDetailDraft({...detailDraft,tracking_out:event.target.value})} placeholder=\"Outbound tracking\" className={inputClass}/><textarea value={detailDraft.notes} onChange={event=>setDetailDraft({...detailDraft,notes:event.target.value})} placeholder=\"Submission notes\" className={`${inputClass} min-h-24 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveSubmissionDetails()} className=\"mt-3 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black transition hover:bg-[#e6ca8d]\">Save submission details</button></section><section className=\"mt-6\"><div className=\"border-b border-white/[0.08] pb-3\"><div className=\"text-[9px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">Cards in batch</div><h3 className=\"mt-1 text-xl font-black\">Card workbench</h3></div>{selectedCards.map(card=>{const draft=cardDrafts[card.id]||cardToDraft(card);return <div key={card.id} className=\"border-b border-white/[0.07] py-5\"><div className=\"flex items-center justify-between\"><div><div className=\"text-sm font-black\">Card #{card.sequence_number}</div><div className=\"mt-1 text-xs text-white/28\">{draft.cert_number||'Cert not assigned'} · {pretty(card.status)}</div></div>{draft.cert_number&&findPCGGrade(draft.grade_label)?<span className=\"inline-flex items-center gap-1 text-[10px] font-black text-emerald-300\"><Check className=\"h-3 w-3\"/>Graded</span>:null}</div><div className=\"mt-4 grid gap-2 sm:grid-cols-2\"><input value={draft.category} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,category:event.target.value}})} placeholder=\"Category\" className={inputClass}/><input value={draft.year} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,year:event.target.value}})} placeholder=\"Year\" className={inputClass}/><input value={draft.brand_set} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,brand_set:event.target.value}})} placeholder=\"Set Name\" className={inputClass}/><input value={draft.player_character} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,player_character:event.target.value}})} placeholder=\"Player Name(s)\" className={inputClass}/><input value={draft.card_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_number:event.target.value}})} placeholder=\"Card #\" className={inputClass}/><input value={draft.card_description} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,card_description:event.target.value}})} placeholder=\"Card Description\" className={inputClass}/><select value={draft.autograph_present} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,autograph_present:event.target.value as CardDraft['autograph_present']}})} className={inputClass}><option value=\"\">Auto Y/N</option><option value=\"yes\">Auto Yes</option><option value=\"no\">Auto No</option></select><input value={draft.declared_value} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,declared_value:event.target.value}})} type=\"number\" placeholder=\"Declared Value\" className={inputClass}/><input value={draft.cert_number} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,cert_number:event.target.value}})} placeholder=\"PCG#/CERT#\" className={inputClass}/><PCGGradeSelect draft={draft} onChange={next=>setCardDrafts({...cardDrafts,[card.id]:next})}/><textarea value={draft.grader_notes} onChange={event=>setCardDrafts({...cardDrafts,[card.id]:{...draft,grader_notes:event.target.value}})} placeholder=\"Grader notes\" className={`${inputClass} min-h-20 sm:col-span-2`}/></div><button disabled={busy} onClick={()=>void saveCard(card)} className=\"mt-3 bg-[#d8bb78] px-4 py-2.5 text-sm font-black text-black\">Save card</button></div>})}</section></aside></div>:null}</div>}"},{"path":"src/pages/card-grading/PCGWorkspace.tsx","content":"import React,{useEffect,useRef,useState} from 'react';\nimport {Archive,ArrowUpRight,CheckCircle2,Database,FileSpreadsheet,ImagePlus,Layers3,Loader2,PackageCheck,PauseCircle,Radar,RefreshCw,ScanLine,ShieldCheck,UploadCloud,XCircle} from 'lucide-react';\nimport {supabase} from '@/integrations/supabase/client';\nimport {useMultiTenant} from '@/contexts/MultiTenantContext';\nimport {useToast} from '@/hooks/use-toast';\nimport {CRMShell} from '@/components/crm/CRMShell';\nimport {cn} from '@/lib/utils';\nimport PCGGrowthLab,{PCGGrowthPulse} from '@/pages/card-grading/PCGGrowthLab';\nimport {PCG_AUTOGRAPH_NOTE,PCG_CARD_THICKNESSES,PCG_GRADING_SCALE,findPCGGrade} from '@/pages/card-grading/pcgGradingScale';\nconst DRIVE_MEDIA_FN=`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/pcg-google-drive-media`;const CONCURRENCY=4;type DriveMedia={url:string;fileId:string};\ntype CsvRow=Record<string,string>;type BatchItem={key:string;front?:File;back?:File;row?:CsvRow;status:'queued'|'uploading'|'done'|'failed';error?:string};type CardForm={title:string;player:string;year:string;set:string;number:string;category:string;description:string;autograph:string;grader:string;grade:string;cert:string;condition:string;qty:string;cost:string;value:string;tags:string;notes:string};type StoredCard={id:string;player_character?:string|null;brand_set?:string|null;year?:string|null;card_number?:string|null;front_image_url?:string|null;grade?:number|null;cert_number?:string|null;metadata?:Record<string,unknown>|null};type SubmissionOption={id:string;submission_number:string;customer_name:string|null;customer_email:string|null;customer_phone:string|null;expected_card_count:number;status:string};type DriveState='checking'|'ready'|'missing'|'reconnect';type ExistingBatchCard={id:string;sequence_number:number;import_key:string|null;front_image_url:string|null;back_image_url:string|null};type VaultMode='overview'|'single'|'batch'|'growth';\nconst EMPTY_FORM:CardForm={title:'',player:'',year:'',set:'',number:'',category:'',description:'',autograph:'',grader:'',grade:'',cert:'',condition:'',qty:'1',cost:'',value:'',tags:'',notes:''};\nconst fileStem=(name:string)=>name.replace(/\\.[^.]+$/,'').replace(/[-_ ](?:front|back|obverse|reverse)$/i,'');const isBack=(name:string)=>/[-_ ](?:back|reverse)\\.[^.]+$/i.test(name);const rowValue=(row:CsvRow|undefined,...keys:string[])=>keys.map(key=>row?.[key]).find(Boolean)||'';const money=(value:string)=>{const parsed=Number((value||'').replace(/[$,]/g,''));return Number.isFinite(parsed)?parsed:null};const yesNo=(value:string)=>{const normalized=String(value||'').trim().toLowerCase();if(['yes','y','true','1'].includes(normalized))return true;if(['no','n','false','0'].includes(normalized))return false;return null};\nconst normalizeHeader=(value:string)=>String(value||'').trim().toLowerCase().replace(/[^a-z0-9]+/g,'_').replace(/^_+|_+$/g,'');\nfunction parseDelimited(text:string){const sample=String(text||'').split(/\\r?\\n/,1)[0]||'';const delimiter=(sample.match(/\\t/g)||[]).length>(sample.match(/,/g)||[]).length?'\\t':',';const matrix:string[][]=[];let row:string[]=[];let value='';let quoted=false;for(let index=0;index<text.length;index+=1){const char=text[index];if(quoted){if(char==='\"'&&text[index+1]==='\"'){value+='\"';index+=1}else if(char==='\"'){quoted=false}else{value+=char}continue}if(char==='\"'){quoted=true;continue}if(char===delimiter){row.push(value);value='';continue}if(char==='\\n'){row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);row=[];value='';continue}if(char!=='\\r')value+=char}row.push(value);if(row.some(cell=>cell.trim()))matrix.push(row);const headerRow=matrix.shift()||[];const seen=new Map<string,number>();const headers=headerRow.map((cell,index)=>{const base=normalizeHeader(cell)||'column_'+(index+1);const count=(seen.get(base)||0)+1;seen.set(base,count);return count===1?base:base+'_'+count});const rows=matrix.map(cells=>Object.fromEntries(headers.map((header,index)=>[header,String(cells[index]??'').trim()]))) as CsvRow[];return{headers,rows,delimiter}}\nfunction parseCsv(text:string){return parseDelimited(text).rows}\nfunction pairFiles(files:File[],rows:CsvRow[]){const map=new Map<string,BatchItem>();for(const file of files.filter(item=>item.type.startsWith('image/'))){const key=fileStem(file.name);const item=map.get(key)||{key,status:'queued' as const};if(isBack(file.name))item.back=file;else if(!item.front)item.front=file;else map.set(`${key}-${map.size+1}`,{key:`${key}-${map.size+1}`,front:file,status:'queued'});map.set(key,item)}for(const item of map.values())item.row=rows.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase());return[...map.values()]}\nfunction ModeButton({active,children,onClick}:{active:boolean;children:React.ReactNode;onClick:()=>void}){return <button onClick={onClick} className={cn('rounded-full px-4 py-2 text-xs font-bold transition sm:text-sm',active?'bg-[#d8bb78] text-[#0b0b0c]':'text-white/48 hover:bg-white/[0.05] hover:text-white')}>{children}</button>}\nfunction Stat({label,value,detail,icon:Icon}:{label:string;value:string;detail:string;icon:React.ComponentType<{className?:string}>}){return <div className=\"min-w-0 py-3 sm:border-l sm:border-white/[0.08] sm:px-5 first:sm:border-l-0 first:sm:pl-0\"><div className=\"flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.16em] text-white/32\"><Icon className=\"h-3.5 w-3.5 text-[#d8bb78]\"/>{label}</div><div className=\"mt-2 text-2xl font-black tracking-tight text-white\">{value}</div><div className=\"mt-1 truncate text-xs text-white/35\">{detail}</div></div>}\nfunction Field({label,value,onChange,placeholder}:{label:string;value:string;onChange:(value:string)=>void;placeholder?:string}){return <label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">{label}</span><input value={value} onChange={event=>onChange(event.target.value)} placeholder={placeholder} className=\"mt-2 h-11 w-full border-b border-white/[0.12] bg-transparent text-sm text-white outline-none transition placeholder:text-white/18 focus:border-[#d8bb78]/65\"/></label>}\nfunction PCGGradeField({grade:_grade,designation,onChange}:{grade:string;designation:string;onChange:(grade:string,designation:string)=>void}){const selected=findPCGGrade(designation);return <div className=\"sm:col-span-2\"><label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">PCG grade</span><select value={designation} onChange={event=>{const option=findPCGGrade(event.target.value);onChange(option?.numeric==null?'':String(option.numeric),option?.designation||'')}} className=\"mt-2 h-11 w-full border border-white/[0.12] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/65\"><option value=\"\">Select official PCG designation</option>{PCG_GRADING_SCALE.map(option=><option key={option.id} value={option.designation}>{option.designation}</option>)}</select></label>{selected?<details className=\"mt-2 border border-white/[0.08] bg-[#09090a]/94/[.025] px-3 py-2\"><summary className=\"cursor-pointer text-[10px] font-black uppercase tracking-[.13em] text-[#d8bb78]\">Official criteria</summary><p className=\"mt-2 text-xs leading-5 text-white/55\">{selected.criteria||'PCG’s published page does not currently provide usable criteria text for this designation.'}</p><div className=\"mt-2 text-[10px] text-white/35\">Card sizes: {PCG_CARD_THICKNESSES.join(' · ')} · {PCG_AUTOGRAPH_NOTE}</div></details>:null}</div>}\nfunction ImageTile({label,file,onFile}:{label:string;file:File|null;onFile:(file:File|null)=>void}){return <label className=\"group flex min-h-36 cursor-pointer flex-col justify-between border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 transition hover:border-[#d8bb78]/30 hover:bg-[#d8bb78]/[0.035]\"><input type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={event=>onFile(event.target.files?.[0]||null)}/><div className=\"flex items-center justify-between\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/35\">{label}</span>{file?<CheckCircle2 className=\"h-5 w-5 text-emerald-400\"/>:<ImagePlus className=\"h-5 w-5 text-[#d8bb78]\"/>}</div><div><div className=\"truncate text-sm font-bold text-white/82\">{file?.name||`Choose ${label.toLowerCase()} image`}</div><div className=\"mt-1 text-xs text-white/28\">Private PCG card photography.</div></div></label>}\nfunction DemoCardFace({card}:{card:StoredCard}){const subject=String(card.player_character||card.brand_set||'Trading Card').replace(/^DEMO\\s*[—-]\\s*/i,'');const detail=[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ');return <div className=\"absolute inset-1.5 flex flex-col overflow-hidden rounded-[14px] border border-[#d8bb78]/45 bg-[radial-gradient(circle_at_72%_18%,rgba(216,187,120,.26),transparent_38%),linear-gradient(145deg,rgba(30,27,20,.98),rgba(7,7,8,.98)_58%,rgba(27,23,15,.98))] p-2.5 shadow-[inset_0_0_0_1px_rgba(255,255,255,.06),0_14px_32px_rgba(0,0,0,.26)]\"><div className=\"flex items-center justify-between gap-1\"><div className=\"flex items-center gap-1.5 text-[8px] font-black uppercase tracking-[.14em] text-[#ecd797]\"><ScanLine className=\"h-3 w-3\"/>PCG Demo</div><div className=\"rounded-full border border-white/10 bg-black/35 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-[.08em] text-white/46\">Trading card</div></div><div className=\"my-auto grid place-items-center\"><div className=\"grid h-14 w-14 place-items-center rounded-[16px] border border-[#d8bb78]/25 bg-[#d8bb78]/[0.08] shadow-[0_0_36px_rgba(216,187,120,.10)]\"><Archive className=\"h-6 w-6 text-[#d8bb78]\"/></div></div><div><div className=\"line-clamp-2 text-sm font-black leading-tight text-white\">{subject}</div><div className=\"mt-1.5 line-clamp-2 text-[9px] font-bold uppercase tracking-[.06em] text-white/42\">{detail||card.cert_number||'PCG sample record'}</div></div></div>}\n\nexport function PCGCardVaultContent({initialMode='overview',initialSubmissionId=''}:{initialMode?:VaultMode;initialSubmissionId?:string}={}){const{activeTenant}=useMultiTenant();const{toast}=useToast();const tenantId=activeTenant?.id||'';const[mode,setMode]=useState<VaultMode>(initialMode);useEffect(()=>{setMode(initialMode)},[initialMode]);const[form,setForm]=useState<CardForm>(EMPTY_FORM);const[front,setFront]=useState<File|null>(null);const[reverse,setReverse]=useState<File|null>(null);const[saving,setSaving]=useState(false);const[rows,setRows]=useState<CsvRow[]>([]);const[items,setItems]=useState<BatchItem[]>([]);const[session,setSession]=useState('');const[running,setRunning]=useState(false);const[recent,setRecent]=useState<StoredCard[]>([]);const[total,setTotal]=useState(0);const[submissionOptions,setSubmissionOptions]=useState<SubmissionOption[]>([]);const[selectedSubmissionId,setSelectedSubmissionId]=useState('');const[captured,setCaptured]=useState(0);const[driveState,setDriveState]=useState<DriveState>('checking');const stop=useRef(false);const done=items.filter(item=>item.status==='done').length;const failed=items.filter(item=>item.status==='failed').length;const remaining=items.filter(item=>item.status==='queued'||item.status==='failed');const progress=items.length?Math.round(((done+failed)/items.length)*100):0;const selectedSubmission=submissionOptions.find(item=>item.id===selectedSubmissionId)||null;const boundToSubmission=Boolean(initialSubmissionId);const expectedCount=Math.max(Number(selectedSubmission?.expected_card_count||0),captured);const driveReady=driveState==='ready';\nasync function load(){if(!tenantId)return;setDriveState('checking');const[cardsResult,submissionResult,googleResult,boundCountResult]=await Promise.all([(supabase as any).from('card_grading_cards').select('id,player_character,brand_set,year,card_number,front_image_url,grade,cert_number,metadata',{count:'exact'}).eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(12),(supabase as any).from('card_grading_submissions').select('id,submission_number,customer_name,customer_email,customer_phone,expected_card_count,status').eq('tenant_id',tenantId).order('created_at',{ascending:false}).limit(50),(supabase as any).from('tenant_provider_credentials').select('credential_status,metadata').eq('tenant_id',tenantId).eq('provider','google_workspace').maybeSingle(),initialSubmissionId?(supabase as any).from('card_grading_cards').select('id',{count:'exact',head:true}).eq('tenant_id',tenantId).eq('submission_id',initialSubmissionId):Promise.resolve({count:0})]);setRecent(cardsResult.data||[]);setTotal(Number(cardsResult.count||0));setCaptured(Number((boundCountResult as any)?.count||0));const eligible=((submissionResult.data||[]) as SubmissionOption[]).filter(item=>['received','intake_imaging','authentication','grading','encapsulation','qa'].includes(String(item.status||'')));setSubmissionOptions(eligible);setSelectedSubmissionId(current=>eligible.some(item=>item.id===initialSubmissionId)?initialSubmissionId:(eligible.some(item=>item.id===current)?current:(eligible[0]?.id||'')));const google=googleResult.data as any;const scopes=Array.isArray(google?.metadata?.granted_scopes)?google.metadata.granted_scopes.map((value:unknown)=>String(value)):[];setDriveState(google?.credential_status==='active'?(scopes.includes('https://www.googleapis.com/auth/drive.file')?'ready':'reconnect'):'missing')}useEffect(()=>{void load()},[tenantId,initialSubmissionId]);\nasync function createSubmission(label:string){const{data,error}=await(supabase as any).from('card_grading_submissions').insert({tenant_id:tenantId,submission_number:`VAULT-${Date.now()}-${crypto.randomUUID().slice(0,6)}`,customer_name:'PCG Internal Inventory',service_tier:'inventory',service_price:0,status:'received',notes:label,payment_status:'unverified'}).select('id').single();if(error)throw error;return data.id}\nasync function upload(file:File,sessionKey:string,key:string,side:string,importKey:string):Promise<DriveMedia>{const{data}=await supabase.auth.getSession();if(!data.session?.access_token)throw new Error('Please sign in again.');const params=new URLSearchParams({tenant_id:tenantId,session_key:sessionKey,import_key:importKey,key,side,name:file.name,content_type:file.type||'application/octet-stream'});const response=await fetch(DRIVE_MEDIA_FN+'/upload?'+params.toString(),{method:'POST',headers:{Authorization:'Bearer '+data.session.access_token,'Content-Type':file.type||'application/octet-stream'},body:file});const payload=await response.json().catch(()=>null);if(!response.ok||!payload?.ok)throw new Error(payload?.error||'Google Drive upload failed');return{url:String(payload.url||''),fileId:String(payload.file_id||'')}}\nasync function storeCard(submissionId:string,importKey:string,frontMedia:DriveMedia|null,backMedia:DriveMedia|null,row?:CsvRow,values:Partial<CardForm>={},target?:{id?:string;sequenceNumber?:number}){const description=values.description||rowValue(row,'card_description','description','variation');const autograph=values.autograph||rowValue(row,'autograph_present','autograph','auto','auto_y_n');const declaredValue=values.value||rowValue(row,'declared_value','estimated_value','value');const metadata={title:values.title||rowValue(row,'title','name'),grading_company:values.grader||rowValue(row,'grading_company','grader'),condition:values.condition||rowValue(row,'condition'),quantity:Number(values.qty||rowValue(row,'quantity')||1)||1,acquisition_cost:money(values.cost||rowValue(row,'acquisition_cost','cost')),estimated_value:money(declaredValue),tags:String(values.tags||rowValue(row,'tags')).split(/[;,]/).map(item=>item.trim()).filter(Boolean),notes:values.notes||rowValue(row,'notes'),...(frontMedia?.fileId||backMedia?.fileId?{image_storage:'google_workspace_drive',drive_media:{provider:'google_workspace',front_file_id:frontMedia?.fileId||null,back_file_id:backMedia?.fileId||null}}:{})};const payload={tenant_id:tenantId,submission_id:submissionId,sequence_number:target?.sequenceNumber||1,category:values.category||rowValue(row,'category','sport'),year:values.year||rowValue(row,'year'),brand_set:values.set||rowValue(row,'brand_set','set','brand'),player_character:values.player||rowValue(row,'player','player_name','player_names','subject'),card_number:values.number||rowValue(row,'card_number','card_no'),card_description:description||null,variation:description||null,autograph_present:yesNo(autograph),declared_value:money(declaredValue),grade:money(values.grade||rowValue(row,'grade')),grade_label:values.condition||rowValue(row,'grade_label','condition'),cert_number:values.cert||rowValue(row,'cert_number','cert','pcg_number','serial'),front_image_url:frontMedia?.url||null,back_image_url:backMedia?.url||null,grader_notes:values.notes||rowValue(row,'notes')||null,status:'received',import_key:importKey,metadata};if(target?.id){const{error}=await(supabase as any).from('card_grading_cards').update(payload).eq('tenant_id',tenantId).eq('id',target.id);if(error)throw error;return}const{error}=await(supabase as any).from('card_grading_cards').upsert(payload,{onConflict:'tenant_id,import_key',ignoreDuplicates:true});if(error)throw error}\nasync function saveSingle(){if(!front&&!reverse)return toast({title:'Add at least one card image'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before storing new PCG card images.',variant:'destructive'});setSaving(true);try{const sessionKey='single-'+crypto.randomUUID();const bound=initialSubmissionId?submissionOptions.find(item=>item.id===initialSubmissionId)||null:null;if(initialSubmissionId&&!bound)throw new Error('This PCG submission is no longer available for card capture.');const submissionId=bound?.id||await createSubmission('Internal inventory card upload');const importKey=bound?('pcg:'+submissionId+':card-1'):sessionKey;const existing=bound?await(supabase as any).from('card_grading_cards').select('id,sequence_number').eq('tenant_id',tenantId).eq('submission_id',submissionId).order('sequence_number',{ascending:true}).limit(1).maybeSingle():{data:null,error:null};if(existing.error)throw existing.error;const frontMedia=front?await upload(front,sessionKey,'card-1','front',importKey):null;const backMedia=reverse?await upload(reverse,sessionKey,'card-1','back',importKey):null;await storeCard(submissionId,importKey,frontMedia,backMedia,undefined,form,bound?{id:existing.data?.id,sequenceNumber:Number(existing.data?.sequence_number||1)}:undefined);if(bound&&bound.status==='received'){const countResult=await(supabase as any).from('card_grading_cards').select('id',{count:'exact',head:true}).eq('tenant_id',tenantId).eq('submission_id',submissionId);if(countResult.error)throw countResult.error;const capturedTotal=Number(countResult.count||0),expected=Math.max(Number(bound.expected_card_count||1),1);setCaptured(capturedTotal);if(capturedTotal>=expected){const advanced=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:submissionId,p_status:'intake_imaging'});if(advanced.error)throw advanced.error}}setForm(EMPTY_FORM);setFront(null);setReverse(null);toast({title:bound?'Card captured for '+bound.submission_number:'Card stored in PCG',description:'Master imagery is stored in the connected PCG Google Drive and the canonical card record is ready.'});await load()}catch(error){toast({title:'Could not save card',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setSaving(false)}}\nasync function runBatch(batch:BatchItem[]){if(!session||!batch.length)return;if(!selectedSubmissionId)return toast({title:'Select a grading order first',description:'Mass Intake attaches images to an existing collector order.',variant:'destructive'});if(!driveReady)return toast({title:'Google Workspace Drive required',description:driveState==='reconnect'?'Reconnect Google Workspace so PCG has Drive file access.':'Connect Google Workspace before starting image intake.',variant:'destructive'});const selected=submissionOptions.find(item=>item.id===selectedSubmissionId);if(!selected)return toast({title:'That grading order is no longer available',description:'Choose another open PCG order.',variant:'destructive'});setRunning(true);stop.current=false;let failedCount=0;try{const existingResult=await(supabase as any).from('card_grading_cards').select('id,sequence_number,import_key,front_image_url,back_image_url').eq('tenant_id',tenantId).eq('submission_id',selectedSubmissionId).order('sequence_number',{ascending:true});if(existingResult.error)throw existingResult.error;const existingCards=(existingResult.data||[]) as ExistingBatchCard[];const byImport=new Map(existingCards.filter(card=>card.import_key).map(card=>[String(card.import_key),card]));const blankSlots=existingCards.filter(card=>!card.import_key&&!card.front_image_url&&!card.back_image_url).sort((a,b)=>a.sequence_number-b.sequence_number);let nextSequence=Math.max(0,...existingCards.map(card=>Number(card.sequence_number)||0))+1;const plans=batch.map(item=>{const importKey=('pcg:'+selectedSubmissionId+':'+item.key).toLowerCase().replace(/[^a-z0-9:._-]+/g,'-');const existing=byImport.get(importKey);if(existing)return{item,importKey,existing:true,targetId:existing.id,sequenceNumber:existing.sequence_number};const slot=blankSlots.shift();return{item,importKey,existing:false,targetId:slot?.id,sequenceNumber:slot?.sequence_number||nextSequence++}});let cursor=0;const worker=async()=>{while(!stop.current){const index=cursor++;if(index>=plans.length)return;const plan=plans[index];const item=plan.item;try{setItems(current=>current.map(row=>row.key===item.key?{...row,status:'uploading',error:undefined}:row));if(!plan.existing){const frontMedia=item.front?await upload(item.front,session,item.key,'front',plan.importKey):null;const backMedia=item.back?await upload(item.back,session,item.key,'back',plan.importKey):null;await storeCard(selectedSubmissionId,plan.importKey,frontMedia,backMedia,item.row,undefined,{id:plan.targetId,sequenceNumber:plan.sequenceNumber})}setItems(current=>current.map(row=>row.key===item.key?{...row,status:'done'}:row))}catch(error){failedCount+=1;setItems(current=>current.map(row=>row.key===item.key?{...row,status:'failed',error:error instanceof Error?error.message:String(error)}:row))}}};await Promise.all(Array.from({length:Math.min(CONCURRENCY,plans.length)},worker));const countResult=await(supabase as any).from('card_grading_cards').select('id',{count:'exact',head:true}).eq('tenant_id',tenantId).eq('submission_id',selectedSubmissionId);if(countResult.error)throw countResult.error;const capturedTotal=Number(countResult.count||0),expected=Math.max(Number(selected.expected_card_count||0),capturedTotal),complete=expected===0||capturedTotal>=expected;if(boundToSubmission)setCaptured(capturedTotal);if(!stop.current&&failedCount===0&&complete&&selected.status==='received'){const advanced=await(supabase as any).rpc('advance_pcg_grading_submission',{p_tenant_id:tenantId,p_submission_id:selectedSubmissionId,p_status:'intake_imaging'});if(advanced.error)throw advanced.error}toast({title:stop.current?'Batch paused':failedCount?'Batch needs attention':complete?'Order intake complete':'Cards captured — intake still open',description:failedCount?failedCount+' card'+(failedCount===1?'':'s')+' can be retried safely.':complete?selected.submission_number+' now owns '+capturedTotal.toLocaleString()+' canonical card record'+(capturedTotal===1?'':'s')+' and Drive images.':capturedTotal.toLocaleString()+' / '+expected.toLocaleString()+' cards captured. Add the remaining cards before the order advances.'});await load()}catch(error){toast({title:'Mass intake could not finish',description:error instanceof Error?error.message:String(error),variant:'destructive'})}finally{setRunning(false)}}const update=(key:keyof CardForm,value:string)=>setForm(current=>({...current,[key]:value}));\nreturn <div className=\"pcg-card-vault w-full text-white\"><style>{`.pcg-card-vault .text-white\\\\/18,.pcg-card-vault .text-white\\\\/24,.pcg-card-vault .text-white\\\\/28,.pcg-card-vault .text-white\\\\/30,.pcg-card-vault .text-white\\\\/32,.pcg-card-vault .text-white\\\\/34,.pcg-card-vault .text-white\\\\/35,.pcg-card-vault .text-white\\\\/36,.pcg-card-vault .text-white\\\\/38,.pcg-card-vault .text-white\\\\/42,.pcg-card-vault .text-white\\\\/44,.pcg-card-vault .text-white\\\\/48{color:rgba(255,255,255,.68)!important}`}</style><section className=\"border-b border-white/[0.08] pb-6\"><div className=\"flex flex-col gap-5 xl:flex-row xl:items-end xl:justify-between\"><div><div className=\"flex items-center gap-2 text-[10px] font-black uppercase tracking-[.19em] text-[#d8bb78]\"><ScanLine className=\"h-4 w-4\"/>PCG Card Vault</div><h1 className=\"mt-3 text-[34px] font-black leading-none tracking-[-0.045em] sm:text-[46px]\">Card Vault</h1><p className=\"mt-3 max-w-2xl text-sm leading-6 text-white/44\">Capture one card or move an entire collection into PCG. Master imagery stays in the connected PCG Google Drive.</p></div>{!boundToSubmission?<div className=\"flex max-w-full flex-wrap items-center rounded-2xl border border-white/[0.08] bg-[#09090a]/94/[.025] p-1\"><ModeButton active={mode==='overview'} onClick={()=>setMode('overview')}>Overview</ModeButton><ModeButton active={mode==='single'} onClick={()=>setMode('single')}>Internal inventory</ModeButton><ModeButton active={mode==='batch'} onClick={()=>setMode('batch')}>Mass intake</ModeButton><ModeButton active={mode==='growth'} onClick={()=>setMode('growth')}>Growth Lab</ModeButton></div>:null}</div><div className=\"mt-7 grid sm:grid-cols-4\"><Stat icon={Archive} label=\"Cards on file\" value={total.toLocaleString()} detail=\"Canonical PCG records\"/><Stat icon={Layers3} label=\"Current batch\" value={items.length.toLocaleString()} detail={items.length?`${done} stored so far`:'No intake running'}/><Stat icon={PackageCheck} label=\"Exceptions\" value={failed.toLocaleString()} detail={failed?'Ready to retry safely':'No failed uploads'}/><Stat icon={ShieldCheck} label=\"Storage\" value=\"Google Drive\" detail=\"PCG-owned master imagery\"/></div></section>{mode==='overview'?<PCGGrowthPulse tenantId={tenantId} onOpen={()=>setMode('growth')}/>:null}\n{mode==='overview'?<div className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.15fr)_minmax(350px,.85fr)]\"><section><div className=\"mb-3 text-[10px] font-black uppercase tracking-[.17em] text-white/30\">Start an intake</div><div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] sm:grid-cols-2\"><button onClick={()=>setMode('single')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-white/[.025]\"><div className=\"flex items-start justify-between\"><ImagePlus className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Internal inventory card</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Create a standalone PCG-owned inventory record. This is not a collector grading submission.</p></div></button><button onClick={()=>setMode('batch')} className=\"group min-h-[210px] bg-[#09090a]/94 p-5 text-left transition hover:bg-white/[.025]\"><div className=\"flex items-start justify-between\"><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><ArrowUpRight className=\"h-5 w-5 text-white/18 transition group-hover:text-[#d8bb78]\"/></div><div className=\"mt-14\"><h2 className=\"text-xl font-black tracking-tight\">Mass card intake</h2><p className=\"mt-2 text-sm leading-6 text-white/38\">Hundreds or thousands, front/back pairing, optional CSV, pause and safe retry.</p></div></button></div></section><section className=\"border-l border-white/[0.08] xl:pl-7\"><div className=\"flex items-center justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Storage contract</div><h2 className=\"mt-2 text-lg font-black\">Built for volume</h2></div><Database className=\"h-5 w-5 text-[#d8bb78]\"/></div><div className=\"mt-5 divide-y divide-white/[0.07]\">{[['Google Drive masters','New originals live in the connected PCG Google Workspace, not KnockLaunch storage.'],['Safe retry','Completed imports keep a stable identity.'],['Canonical records','Single and batch intake write to the same card records.']].map(([title,copy])=><div key={title} className=\"py-4 first:pt-0\"><div className=\"flex items-center gap-2 text-sm font-bold text-white/80\"><CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>{title}</div><p className=\"mt-1.5 pl-6 text-xs leading-5 text-white/32\">{copy}</p></div>)}</div></section></div>:null}\n{mode==='growth'?<div className=\"mt-7\"><PCGGrowthLab tenantId={tenantId}/></div>:null}\n{mode==='single'?<section className=\"mt-7 grid gap-7 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,.65fr)]\"><div><div className=\"border-b border-white/[0.08] pb-4\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">{boundToSubmission?'Collector submission':'Internal inventory'}</div><h2 className=\"mt-2 text-xl font-black\">{boundToSubmission?'Capture card details':'Inventory card details'}</h2>{boundToSubmission&&selectedSubmission?<div className=\"mt-2 text-xs font-bold text-[#d8bb78]\">{selectedSubmission.submission_number} · {selectedSubmission.customer_name||'Collector'} · {captured.toLocaleString()} / {expectedCount.toLocaleString()} captured</div>:null}</div><div className=\"mt-6 grid gap-x-7 gap-y-5 sm:grid-cols-2\">{!boundToSubmission?<Field label=\"Title\" value={form.title} onChange={value=>update('title',value)}/>:null}<Field label=\"Player Name(s)\" value={form.player} onChange={value=>update('player',value)}/><Field label=\"Year\" value={form.year} onChange={value=>update('year',value)}/><Field label=\"Set Name / brand\" value={form.set} onChange={value=>update('set',value)}/><Field label=\"Card #\" value={form.number} onChange={value=>update('number',value)}/><Field label=\"Sport / category\" value={form.category} onChange={value=>update('category',value)}/><Field label=\"Card Description / variation\" value={form.description} onChange={value=>update('description',value)}/><label className=\"block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">Auto Y/N</span><select value={form.autograph} onChange={event=>update('autograph',event.target.value)} className=\"mt-2 h-11 w-full border border-white/[0.12] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/65\"><option value=\"\">Not specified</option><option value=\"yes\">Yes</option><option value=\"no\">No</option></select></label><Field label={boundToSubmission?\"Declared Value\":\"Estimated value\"} value={form.value} onChange={value=>update('value',value)} placeholder=\"$0.00\"/>{!boundToSubmission?<><Field label=\"Grading company\" value={form.grader} onChange={value=>update('grader',value)}/><Field label=\"Certification / serial\" value={form.cert} onChange={value=>update('cert',value)}/><PCGGradeField grade={form.grade} designation={form.condition} onChange={(grade,designation)=>setForm(current=>({...current,grade,condition:designation}))}/><Field label=\"Quantity\" value={form.qty} onChange={value=>update('qty',value)}/><Field label=\"Acquisition cost\" value={form.cost} onChange={value=>update('cost',value)} placeholder=\"$0.00\"/><Field label=\"Tags\" value={form.tags} onChange={value=>update('tags',value)} placeholder=\"rookie, refractor, auto\"/></>:null}</div><label className=\"mt-6 block\"><span className=\"text-[10px] font-bold uppercase tracking-[.13em] text-white/34\">Internal notes</span><textarea value={form.notes} onChange={event=>update('notes',event.target.value)} rows={4} className=\"mt-2 w-full border border-white/[0.09] bg-[#09090a]/94/[.025] p-4 text-sm leading-6 text-white outline-none focus:border-[#d8bb78]/40\"/></label></div><div className=\"self-start border-l border-white/[0.08] xl:pl-7\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card imagery</div><div className=\"mt-4 grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08]\"><ImageTile label=\"Front\" file={front} onFile={setFront}/><ImageTile label=\"Back\" file={reverse} onFile={setReverse}/></div><button onClick={()=>void saveSingle()} disabled={saving} className=\"mt-4 flex h-12 w-full items-center justify-center gap-2 bg-[#d8bb78] text-sm font-black text-[#09090a] transition hover:bg-[#e3c886] disabled:opacity-50\">{saving?<Loader2 className=\"h-4 w-4 animate-spin\"/>:<Archive className=\"h-4 w-4\"/>}{saving?'Storing card…':boundToSubmission?'Save card to submission':'Store inventory card'}</button></div></section>:null}\n{mode==='batch'?<section className=\"mt-7 space-y-5\"><div className=\"border border-white/[0.08] bg-[#09090a]/94 p-5\"><div className=\"flex flex-col gap-4 lg:flex-row lg:items-end\"><label className=\"min-w-0 flex-1\"><span className=\"text-[10px] font-black uppercase tracking-[.16em] text-[#d8bb78]\">{boundToSubmission?'1 · Bound collector order':'1 · Collector order'}</span><select value={selectedSubmissionId} onChange={event=>{setSelectedSubmissionId(event.target.value);setSession('');setRows([]);setItems([])}} disabled={running||boundToSubmission} className=\"mt-2 h-12 w-full border border-white/[0.10] bg-[#09090a]/94 px-3 text-sm font-bold text-white outline-none focus:border-[#d8bb78]/55\"><option value=\"\">Select an open PCG order</option>{submissionOptions.map(option=><option key={option.id} value={option.id}>{option.submission_number} · {option.customer_name||'Collector'} · {option.status.replaceAll('_',' ')}</option>)}</select></label><div className=\"flex flex-wrap items-center gap-2 lg:justify-end\"><span className={cn('inline-flex h-10 items-center gap-2 border px-3 text-xs font-black',driveReady?'border-emerald-400/25 bg-emerald-400/[.07] text-emerald-200':'border-amber-400/25 bg-amber-400/[.07] text-amber-100')}><ShieldCheck className=\"h-4 w-4\"/>{driveState==='checking'?'Checking Drive…':driveReady?'Google Drive ready':driveState==='reconnect'?'Reconnect Google Workspace':'Google Workspace required'}</span><a href=\"?mode=submissions&tool=submissions\" className=\"inline-flex min-h-11 items-center border border-white/[0.10] px-3 py-2 text-xs font-black text-white/65\">Receive Cards</a>{!driveReady&&driveState!=='checking'?<a href=\"?tool=settings\" className=\"inline-flex min-h-11 items-center border border-[#d8bb78]/25 px-3 py-2 text-xs font-black text-[#d8bb78]\">Open settings</a>:null}</div></div><p className=\"mt-3 text-xs leading-5 text-white/42\">{selectedSubmission?'Images and CSV details become the canonical cards for '+selectedSubmission.submission_number+' · '+(selectedSubmission.customer_name||'Collector')+'. '+(boundToSubmission?(captured.toLocaleString()+' / '+expectedCount.toLocaleString()+' captured. This order is locked to the submission you just received.'):'No second submission is created.'):'Create or choose the customer’s grading order before loading card images.'}</p></div>{!submissionOptions.length?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5 text-sm text-amber-100/80\">No open PCG grading orders are available. Create the collector order from <a href=\"?mode=submissions&tool=submissions\" className=\"font-black text-[#d8bb78] underline underline-offset-4\">Receive Cards</a>, then return to Mass Intake.</div>:null}{driveState==='missing'||driveState==='reconnect'?<div className=\"border border-dashed border-amber-300/20 bg-amber-300/[.04] p-5\"><div className=\"text-sm font-black text-amber-100\">{driveState==='reconnect'?'Google Workspace needs Drive permission':'Connect PCG Google Workspace before image intake'}</div><p className=\"mt-1 text-xs leading-5 text-white/45\">New PCG master images are stored in Anthony’s Google Drive. Intake stays locked until that private Drive connection is ready.</p></div>:null}<div className=\"grid gap-px overflow-hidden border border-white/[0.08] bg-white/[0.08] lg:grid-cols-2\"><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',selectedSubmissionId&&driveReady&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" multiple accept=\"image/*\" disabled={!selectedSubmissionId||!driveReady||running} className=\"hidden\" onChange={event=>{if(!event.target.files)return;setSession('batch-'+crypto.randomUUID());setRows([]);setItems(pairFiles(Array.from(event.target.files),[]))}}/><UploadCloud className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">2 · Choose the card image batch</h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Front/back filenames pair automatically. The selected order owns every imported card.</p></div></label><label className={cn('group flex min-h-[180px] flex-col justify-between bg-[#09090a]/94 p-5',items.length&&!running?'cursor-pointer':'cursor-not-allowed opacity-45')}><input type=\"file\" accept=\".csv,text/csv\" disabled={!items.length||running} className=\"hidden\" onChange={event=>event.target.files?.[0]?.text().then(text=>{const parsed=parseCsv(text);setRows(parsed);setItems(current=>current.map(item=>({...item,row:parsed.find(row=>fileStem(rowValue(row,'filename','file','front','image')).toLowerCase()===item.key.toLowerCase())})))})}/><FileSpreadsheet className=\"h-6 w-6 text-[#d8bb78]\"/><div><h2 className=\"text-xl font-black\">3 · Attach CSV details <span className=\"text-white/30\">(optional)</span></h2><p className=\"mt-2 text-sm leading-6 text-white/36\">Map filenames, player, set, year, card number, description/variation, Auto Y/N and declared value into those same canonical order records.</p></div></label></div><div className=\"border border-white/[0.08] bg-[#09090a]/94\"><div className=\"flex flex-col gap-4 border-b border-white/[0.07] p-5 sm:flex-row sm:items-center\"><div className=\"mr-auto\"><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Mass intake queue</div><div className=\"mt-1 text-lg font-black\">{items.length.toLocaleString()} cards <span className=\"font-medium text-white/30\">· {done} stored · {failed} failed</span></div>{selectedSubmission?<div className=\"mt-1 text-xs font-bold text-[#d8bb78]/80\">{selectedSubmission.submission_number} · {selectedSubmission.customer_name||'Collector'}{boundToSubmission?' · '+captured.toLocaleString()+' / '+expectedCount.toLocaleString()+' captured':''}</div>:null}</div>{running?<button onClick={()=>{stop.current=true}} className=\"inline-flex h-10 items-center gap-2 border border-white/[0.10] px-4 text-xs font-bold\"><PauseCircle className=\"h-4 w-4\"/>Pause intake</button>:<button disabled={!remaining.length||!selectedSubmissionId||!driveReady} onClick={()=>void runBatch(remaining)} className=\"inline-flex h-10 items-center gap-2 bg-[#d8bb78] px-4 text-xs font-black text-black disabled:opacity-35\"><UploadCloud className=\"h-4 w-4\"/>{!driveReady?'Google Drive required':!selectedSubmissionId?'Select an order':failed?'Retry remaining':'Start mass intake'}</button>}</div><div className=\"h-1 bg-white/[0.05]\"><div className=\"h-full bg-[#d8bb78]\" style={{width:`${progress}%`}}/></div><div className=\"max-h-[360px] overflow-auto p-2\">{!items.length?<div className=\"grid min-h-44 place-items-center text-center\"><div><Layers3 className=\"mx-auto h-7 w-7 text-white/16\"/><div className=\"mt-3 text-sm font-bold text-white/48\">No card batch loaded</div><div className=\"mt-1 text-xs text-white/28\">Choose an order, then load its card images.</div></div></div>:items.slice(0,2000).map((item,index)=><div key={`${item.key}-${index}`} className=\"grid grid-cols-[1fr_auto] items-center gap-3 px-3 py-2.5 text-sm\"><div className=\"min-w-0\"><div className=\"truncate font-semibold text-white/72\">{item.key}</div><div className=\"truncate text-[10px] text-white/24\">{item.front?.name}{item.back?' + back':''}</div></div>{item.status==='done'?<CheckCircle2 className=\"h-4 w-4 text-emerald-400\"/>:item.status==='failed'?<XCircle className=\"h-4 w-4 text-rose-400\"/>:item.status==='uploading'?<Loader2 className=\"h-4 w-4 animate-spin text-[#d8bb78]\"/>:<span className=\"text-[10px] text-white/24\">Queued</span>}</div>)}</div></div></section>:null}\n<section className=\"mt-8 border-t border-white/[0.08] pt-6\"><div className=\"flex items-end justify-between\"><div><div className=\"text-[10px] font-black uppercase tracking-[.16em] text-white/28\">Card Vault</div><h2 className=\"mt-1 text-lg font-black\">Recently stored</h2></div><button onClick={()=>void load()} aria-label=\"Refresh stored cards\" className=\"grid h-11 w-11 place-items-center border border-white/[0.08] text-white/36\"><RefreshCw className=\"h-4 w-4\"/></button></div>{recent.length?<div className=\"mt-4 grid grid-cols-2 gap-px overflow-hidden border border-white/[0.07] bg-white/[0.07] sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-9\">{recent.map(card=><article key={card.id} className=\"bg-black/48\"><div className=\"relative aspect-[3/4] overflow-hidden bg-[#080809]\">{card.metadata?.demo?<DemoCardFace card={card}/>:card.front_image_url?<img src={card.front_image_url} alt=\"\" className=\"h-full w-full object-contain p-2\"/>:<div className=\"grid h-full place-items-center\"><Archive className=\"h-7 w-7 text-white/12\"/></div>}{card.grade?<div className=\"absolute right-2 top-2 z-10 bg-black/78 px-2 py-1 text-[10px] font-black text-[#e5cd93]\">{card.grade}</div>:null}</div><div className=\"p-2.5\"><div className=\"truncate text-xs font-bold\">{card.player_character||card.brand_set||'Card'}</div><div className=\"mt-1 truncate text-[10px] text-white/30\">{[card.year,card.brand_set,card.card_number&&`#${card.card_number}`].filter(Boolean).join(' · ')||card.cert_number||'PCG record'}</div></div></article>)}</div>:<div className=\"mt-4 grid min-h-36 place-items-center border border-dashed border-white/[0.08] bg-black/20 text-center\"><div><Archive className=\"mx-auto h-7 w-7 text-white/12\"/><div className=\"mt-2 text-sm font-bold text-white/42\">The vault is ready.</div></div></div>}</section></div>}\nexport default function PCGWorkspace(){return <CRMShell><div className=\"mx-auto w-full max-w-[1500px] px-4 py-5 sm:px-6 sm:py-7 xl:px-9 xl:py-8\"><PCGCardVaultContent/></div></CRMShell>}\n"}],"branch":"ai/objective-first-repair-cdff1014e047","writes":[],"patches":[],"version":1,"approved":true,"missionId":"cdff1014-e047-4b89-81b9-a49c6b0439e0","objective":"Continue the exact same PCG mission with these three complete exact file writes synthesized from the current mission branch. Apply the bounded canonical submission-flow repair, then continue through PR, Gate, squash merge, affected release, and live production proof.","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":[],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"cdff1014-e047-4b89-81b9-a49c6b0439e0","ownerApproved":true,"releaseIntent":null,"sourceTargets":[],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"576d2a1578592ad29dcbb24051595542862a54d87a843afe430466e096366e0a","replayCount":0,"serializedBytes":118539},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T21:07:29.064555+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:cdff1014-e047-4b89-81b9-a49c6b0439e0:repository-mutation-intent:576d2a1578592ad29dcbb24051595542862a54d87a843afe430466e096366e0a:0","mission_step_id":"a8e1bd41-30dc-4ba4-b8bd-206e74009d00","command_center_event_id":"cdff1014-e047-4b89-81b9-a49c6b0439e0"},{"id":"0d6ee5f4-6265-4e41-99c1-e1d399bfe589","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-786ea34cda53","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3035,"terminal":false,"missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf","operation":"execute_mission","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":2910,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":1660,"approvedPlanMs":0,"missionSetupMs":5733,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":1063,"ledgerReconcileMs":0,"lineageReconcileMs":4670,"resolvePreflightMs":5733,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1063,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1974,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:39:23.084507+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"3035","receipt_type":"execute_mission","idempotency_key":"mission:786ea34c-da53-4b4c-8634-96ca6c310fdf:execute_mission:repair_mission_waiting_for_gate:current-generation","mission_step_id":"c0855d37-a924-4732-bd57-8bcd3ecdc983","command_center_event_id":"786ea34c-da53-4b4c-8634-96ca6c310fdf"},{"id":"39d14310-51de-447e-be50-d9458981aa08","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-e6e7a510db4d","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":11761,"releaseCount":0,"toolCallCount":3,"repeatedCallCount":0,"executorlessWaitMs":7591,"firstUsefulResultAt":"2026-09-24T05:58:26.029Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3600,"terminal":false,"missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390","operation":"automatic_mission_resume","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"prReadinessMs":620,"approvedPlanMs":0,"shipAndProveMs":0,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1285,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:41.25226+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"3600","receipt_type":"automatic_mission_resume","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:automatic-mission-resume:3600:repair_mission_waiting_for_gate","mission_step_id":"e8888bb6-9a57-4d10-9066-0320427f86b9","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"2a89706c-e48a-4d04-b61f-d85fd8393558","source":"cc-execution","status":"synthesis_required","payload":{"ok":true,"jobId":null,"phase":"objective_received","branch":"ai/objective-first-repair-22d71bd6e399","reason":null,"status":"synthesis_required","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"executorlessWaitMs":0,"firstUsefulResultAt":null,"recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":"1.58.261-nonvisual-proof-precedence","prNumber":null,"terminal":false,"missionId":"22d71bd6-e399-480c-89a4-d01455819897","operation":"execute_mission","proofGate":"repair_mission_synthesis_ready","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":985,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"missionSetupMs":933,"providerAuthMs":0,"ledgerPrepareMs":485,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":933,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"totalSynchronousLedgerMs":485,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0},"nextAction":"Inspect the bounded repository paths, synthesize exact files or anchored_edits, and call /mission/execute again automatically with this same missionId without another owner prompt or workflow switch.","receiptRef":{"mode":"full","missionId":"22d71bd6-e399-480c-89a4-d01455819897"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":4413,"likelyAffectedFiles":["src/pages/auto-lockout/AutoUnlockPublic.tsx"],"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T18:49:53.996545+00:00","proof_gate":"repair_mission_synthesis_ready","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:22d71bd6-e399-480c-89a4-d01455819897:execute_mission:repair_mission_synthesis_ready:current-generation","mission_step_id":"85420e57-b6ee-4378-a126-56d770d2c808","command_center_event_id":"22d71bd6-e399-480c-89a4-d01455819897"},{"id":"d5d71455-741c-4964-adca-760974b6b2fd","source":"cc-execution","status":"recorded","payload":{"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":true,"objective":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","proofKinds":["runtime","visual"],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","wordingChanged":false,"canonicalIntent":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"outcome-1","statement":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","provenance":{"reason":null,"source":"current_request_explicit","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production","proof-visual"]}],"objective":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","constraints":[{"id":"pcg-compatibility","statement":"Preserve existing PCG rows, tenant-scoped RLS, current advancement RPC behavior, and existing WMP branding/layout; no raw payment-card data.","provenance":{"reason":null,"source":"current_request_explicit","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"hard_safety_invariant","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"hard_safety_invariant","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"high","blastRadius":"sensitive"},"proof":{"requiredKinds":["runtime","visual"],"visualProofScope":"none","interactionRequired":true,"runtimeProofRequired":true},"scope":{"route":null,"roleRef":null,"tenantRef":null,"sourceTargets":["src/pages/WhatsMyProgressTenantHome.tsx","src/components/WhatsMyProgressTenantHome.tsx","src/features/whats-my-progress/WhatsMyProgressTenantHome.tsx","supabase/functions/customer-portal/index.ts","supabase/migrations","src/__tests__/contracts/pcg-card-data-contract.contract.test.ts","config/capabilities/pcg-card-grading-modes.json"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"normal","deadlineSignals":[],"deadlineExplicit":false},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":["tenant","route","deadline"],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"serialize_overlapping_mutations","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":false,"viewports":["desktop","mobile"],"behavioral":true,"visualProofScope":"none"},"dependencies":{"requiredDomains":["frontend","backend_runtime","schema_data_storage","release_ownership","live_production_proof","provider_configuration"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["frontend","supabaseEdge"]},"inputSignals":{"rawUtterance":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","canonicalIntent":"Correct and ship PCG's production grading data contract and public WMP terminology. Create compatibility-first Supabase schema/migrations so the order/batch identifier is canonical order_number displayed as \"Order #\", while card cert_number is displayed as \"PCG # / Cert #\"; support canonical PCG card fields Set Name, Card Description, Player Name(s), Card #, Auto Y/N, Declared Value; support numeric grades plus A (AUTHENTIC) and Altered; use current Standard Level 14 days or less at $10/card for new PCG intake; preserve legacy data/RLS/RPC compatibility. On https://whatsmyprogress.com/pcg, replace \"Submission Number\" with \"Order # or PCG / Cert #\", make both order and cert lookup actually resolve through customer-portal/API, show Order # and per-card Cert #, use PCG-native stage labels Received, Card Review & Labeling, Professional Grading, Slab & Label, Final Check, Ready for Pickup / Return Shipping, and add a compact \"How the PCG process works\" section plus the factual note that PCG grades card quality and does not authenticate in-person autographs. Preserve existing PCG WMP visuals. Add regression tests. One PR, Gate, squash merge, affected release, production proof.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"PCG database and public WMP behavior are live with Order # and PCG/Cert # semantics.","route":"https://whatsmyprogress.com/pcg","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-visual","kind":"visual","claim":"The public PCG WMP page preserves its existing visual direction while showing corrected PCG terminology/process content.","route":"https://whatsmyprogress.com/pcg","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Correct-and-ship-PCG-s-production-grading-data-contract-and-public-WMP-terminology.-Create-compatibi","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestContractHash":"076e76c1b4af9bad6949be9ea875508d199babeb907b80391254b2d18940afb0","requestContractRevision":2,"previousRequestContractHash":"5ada9734c01c00480dbcf596a1e21d97ba54015e737707a1807569631248e35a"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-29T21:08:39.07968+00:00","proof_gate":"request_contract_revision_recorded","source_sha":null,"external_id":null,"receipt_type":"request_contract_revision","idempotency_key":"mission:a124cc96-b263-442e-acb2-a598cf858a14:request-contract:076e76c1b4af9bad6949be9ea875508d199babeb907b80391254b2d18940afb0","mission_step_id":"f30e601f-91ea-40d5-8101-77dae55a43ad","command_center_event_id":"a124cc96-b263-442e-acb2-a598cf858a14"},{"id":"200e7c61-3b99-4a9f-bbc8-a1c31d2ad496","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-0618a5ffb7bd","prNumber":3629,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"e1efa7ac76f792ce93365b88233ae35637ab2194","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:01:22.289435+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"e1efa7ac76f792ce93365b88233ae35637ab2194","external_id":"3629","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:merged-pr:3629:e1efa7ac76f792ce93365b88233ae35637ab2194","mission_step_id":"fa619a83-3c4b-438e-8822-e8e730fcb2ef","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"8d9d1b00-63c0-4e68-8af8-0717b83c99dc","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-6cebe5456b72","writes":[],"patches":[],"version":1,"approved":true,"missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/__tests__/contracts/tenantStartupSafety.test.ts","src/PrivateAppShell.tsx"],"anchored_edits":[{"path":"src/__tests__/contracts/tenantStartupSafety.test.ts","anchor":"it('keeps Big Papi canonical MODES routing and responsive avatar ownership deterministic'","replace":"Within this test block, delete only the assertions that expect `[data-application-frame=\"true\"] [data-application-scroll-region=\"true\"]`, `[data-experience-runtime-root][data-route-scroll-owner=\"tenant\"]`, selector ordering, or `location.search` from the Big Papi shell source. Leave all Big Papi routing/avatar assertions intact."},{"path":"src/__tests__/contracts/tenantStartupSafety.test.ts","anchor":"it('resolves the requested tenant identity before rendering tenant runtime or sidebar chrome'","insert_after":"\n\n  it('restores tenant route scrolling through the canonical application scroll owner', () => {\n    const source = readFileSync(resolve(process.cwd(), 'src/PrivateAppShell.tsx'), 'utf8');\n    const start = source.indexOf('function TenantRouteScrollRestoration()');\n    const end = source.indexOf('function ', start + 'function TenantRouteScrollRestoration()'.length);\n    const restoration = source.slice(start, end > start ? end : undefined);\n    const applicationScrollSelector = '[data-application-frame=\"true\"] [data-application-scroll-region=\"true\"]';\n    const tenantScrollOwnerSelector = '[data-experience-runtime-root][data-route-scroll-owner=\"tenant\"]';\n\n    expect(start).toBeGreaterThanOrEqual(0);\n    expect(restoration).toContain(applicationScrollSelector);\n    expect(restoration).toContain(tenantScrollOwnerSelector);\n    expect(restoration.indexOf(applicationScrollSelector)).toBeLessThan(restoration.indexOf(tenantScrollOwnerSelector));\n    expect(restoration).toContain('location.search');\n  });\n"}],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"6cebe545-6b72-468c-9a0c-d8a2c0936755","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/__tests__/contracts/tenantStartupSafety.test.ts","src/PrivateAppShell.tsx"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"d4ba891be95b846aaca25b54732bb2313f7523c2c020b8a3f6ad168686589368","replayCount":0,"serializedBytes":2839},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T17:49:05.540061+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:6cebe545-6b72-468c-9a0c-d8a2c0936755:repository-mutation-intent:d4ba891be95b846aaca25b54732bb2313f7523c2c020b8a3f6ad168686589368:0","mission_step_id":"05204441-5588-461e-896e-fe66778c8a84","command_center_event_id":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},{"id":"37694110-63c5-45a1-8116-5f92c5839047","source":"cc-execution","status":"recorded","payload":{"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"rawUtterance":"Unfreeze control plane for targeted Gate hydration repair. Repair only the canonical KnockLaunch Gate sparse checkout so targeted frontend Gate hydrates the existing shared tenant type registry JSON imported by src/lib/tenants/tenantTypeRegistry.ts before TypeScript validation. Do not alter application behavior, proposal code, tenant data, auth semantics, release ownership, or any unrelated Gate logic. Require canonical Gate, squash merge, and protected-main verification that the workflow contains the exact hydration path. This is the bounded blocker repair required to continue proposal PR #3036.","wordingChanged":false,"canonicalIntent":"Unfreeze control plane for targeted Gate hydration repair. Repair only the canonical KnockLaunch Gate sparse checkout so targeted frontend Gate hydrates the existing shared tenant type registry JSON imported by src/lib/tenants/tenantTypeRegistry.ts before TypeScript validation. Do not alter application behavior, proposal code, tenant data, auth semantics, release ownership, or any unrelated Gate logic. Require canonical Gate, squash merge, and protected-main verification that the workflow contains the exact hydration path. This is the bounded blocker repair required to continue proposal PR #3036.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"outcome-hydration","statement":"Targeted frontend KnockLaunch Gate hydrates the existing shared tenant type registry JSON before TypeScript semantic validation so frontend PRs cannot fail solely because that imported repository file is absent from sparse checkout.","proofConditionIds":["proof-repository","proof-gate"]}],"objective":"Unfreeze control plane for targeted Gate hydration repair. Repair only the canonical KnockLaunch Gate sparse checkout so targeted frontend Gate hydrates the existing shared tenant type registry JSON imported by src/lib/tenants/tenantTypeRegistry.ts before TypeScript validation. Do not alter application behavior, proposal code, tenant data, auth semantics, release ownership, or any unrelated Gate logic. Require canonical Gate, squash merge, and protected-main verification that the workflow contains the exact hydration path. This is the bounded blocker repair required to continue proposal PR #3036.","constraints":[{"id":"bounded-scope","statement":"Only .forgejo/workflows/knocklaunch.yml may change; no application, data, auth, proposal, release-owner, or unrelated Gate behavior changes.","proofConditionIds":["proof-repository"]},{"id":"preserve-gate-authority","statement":"Canonical KnockLaunch Gate remains the single PR Gate and release ownership remains unchanged.","proofConditionIds":["proof-gate"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-repository","proof-gate"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-repository","proof-gate"]}],"terminalPolicy":"all_required_proof_conditions_satisfied_after_merge","proofConditions":[{"id":"proof-repository","kind":"repository","claim":"Protected main contains /supabase/functions/_shared/tenantTypeRegistry.json in the frontend_toolchain sparse checkout hydration list in .forgejo/workflows/knocklaunch.yml.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false},{"id":"proof-gate","kind":"runtime","claim":"The canonical Gate for this exact repair generation passes before squash merge.","route":null,"roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Unfreeze-control-plane-for-targeted-Gate-hydration-repair.-Repair-only-the-canonical-KnockLaunch-Gat","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-repository","proof-gate"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestContractHash":"81e590f18559ccad77c95266e445df7a874d47abd6fa74b42fcdf3fa5f2eee6d","requestContractRevision":2,"previousRequestContractHash":"4849176253a6a31c30a43a53dc1a77770c5829c37414c31c37d0dc6deb716aa2"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:45:34.556532+00:00","proof_gate":"request_contract_revision_recorded","source_sha":null,"external_id":null,"receipt_type":"request_contract_revision","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:request-contract:81e590f18559ccad77c95266e445df7a874d47abd6fa74b42fcdf3fa5f2eee6d","mission_step_id":"91bfe3e5-71bf-46ee-914a-ba8244d5d6fa","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"f53eb0e3-8296-434f-b476-342af8661de8","source":"cc-execution","status":"blocked","payload":{"ok":false,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-af2b80659f26","reason":"control_plane_maintenance_base_sha_mismatch","status":"blocked","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.180-forgejo-source-read-resilience","prNumber":null,"terminal":false,"missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e","operation":"execute_mission","proofGate":"repair_mission_execution_blocked","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":487,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":487,"missionSetupMs":5016,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":5016,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":5016,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":5016,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1444,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:41:45.20558+00:00","proof_gate":"repair_mission_execution_blocked","source_sha":null,"external_id":null,"receipt_type":"execute_mission","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:execute_mission:repair_mission_execution_blocked:current-generation","mission_step_id":"91bfe3e5-71bf-46ee-914a-ba8244d5d6fa","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"bb8ce498-8d52-4d2b-a3bc-a2015dde75e0","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"branch":"ai/objective-first-repair-5693c2750c78","writes":[],"patches":[],"version":1,"approved":true,"missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682","objective":"Apply the exact dependency/prerequisite Gate classification repair on the prepared mission. Preserve all existing refresh_required, infrastructure_transient, source_failure, protected-main, and canonical Gate behavior. Continue through one PR, canonical Gate, squash merge, cc-execution release, and live request-contract proof. No Visual Witness.","sourceSha":"e36498d7001d5b55f5665c9230d81a6c5fe20229","repository":"noel/KnockLaunchOS","autoProgress":true,"ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"anchored_edits":[{"path":"workers/cc-execution/src/command-center-contracts.js","anchor":"  if (/checkout|cache|npm|dependency/.test(failure)) return \"runner_dependency\";","replacement":"  if (/dependency_required_unresolvable|prerequisite_required|optional_dependency_unavailable|owner_authorized_dependency_unavailable/.test(failure)) return \"dependency_prerequisite\";\n  if (/checkout|cache|npm|dependency/.test(failure)) return \"runner_dependency\";"},{"path":"workers/cc-execution/src/command-center-contracts.js","anchor":"  if (failureClass === \"mission_bookkeeping\") return automatic(\"continue_from_authoritative_provider_truth\");","replacement":"  if (failureClass === \"mission_bookkeeping\") return automatic(\"continue_from_authoritative_provider_truth\");\n  if (failureClass === \"dependency_prerequisite\") return automatic(\"hold_capability_at_prerequisite_required_preserve_unrelated_working_capabilities\");"},{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"function gateFailureLooksRefreshRequired(evidence = \"\") {\n  const text = String(evidence || \"\");\n  const qaPassed = /KnockLaunch Gate passed for/i.test(text);\n  const freshnessTripwire = /protected main advanced during Gate|refresh \\+ re-gate required|pull_request_stale_refresh_required/i.test(text);\n  return qaPassed && freshnessTripwire;\n}\n","replacement":"function gateFailureLooksRefreshRequired(evidence = \"\") {\n  const text = String(evidence || \"\");\n  const qaPassed = /KnockLaunch Gate passed for/i.test(text);\n  const freshnessTripwire = /protected main advanced during Gate|refresh \\+ re-gate required|pull_request_stale_refresh_required/i.test(text);\n  return qaPassed && freshnessTripwire;\n}\n\nfunction gateFailureLooksDependencyPrerequisite(evidence = \"\") {\n  const text = String(evidence || \"\");\n  return /dependency_required_unresolvable|prerequisite_required|optional_dependency_unavailable|owner_authorized_dependency_unavailable/i.test(text);\n}\n"},{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"    const logTransient = response.ok && gateFailureLooksTransientInfrastructure(evidence);\n    const refreshRequired = response.ok && gateFailureLooksRefreshRequired(evidence);\n    return {\n      transient: !refreshRequired && (stateTransient || logTransient),\n      refreshRequired,\n      failureCategory: refreshRequired ? \"refresh_required\" : (stateTransient || logTransient) ? \"infrastructure_transient\" : \"source_failure\",","replacement":"    const logTransient = response.ok && gateFailureLooksTransientInfrastructure(evidence);\n    const refreshRequired = response.ok && gateFailureLooksRefreshRequired(evidence);\n    const dependencyPrerequisite = response.ok && gateFailureLooksDependencyPrerequisite(evidence);\n    return {\n      transient: !refreshRequired && !dependencyPrerequisite && (stateTransient || logTransient),\n      refreshRequired,\n      dependencyPrerequisite,\n      failureCategory: refreshRequired ? \"refresh_required\" : dependencyPrerequisite ? \"dependency_required_unresolvable\" : (stateTransient || logTransient) ? \"infrastructure_transient\" : \"source_failure\","},{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"    const diagnosticsProveTransient = gateDiagnostics?.transient === true;\n    const diagnosticsRequireRefresh = gateDiagnostics?.refreshRequired === true;\n    if (diagnosticsRequireRefresh) {","replacement":"    const diagnosticsProveTransient = gateDiagnostics?.transient === true;\n    const diagnosticsRequireRefresh = gateDiagnostics?.refreshRequired === true;\n    const diagnosticsRequireDependency = gateDiagnostics?.dependencyPrerequisite === true;\n    if (diagnosticsRequireDependency) {\n      const prerequisiteData = {\n        ok: false,\n        status: \"prerequisite_required\",\n        terminal: false,\n        ownerActionRequired: false,\n        continuationRequired: true,\n        proofGate: \"gate_dependency_prerequisite_required\",\n        reason: \"dependency_required_unresolvable\",\n        failureCategory: \"dependency_required_unresolvable\",\n        gateRunId,\n        recoveryDecision: operationalRecoveryDecision(\"dependency_required_unresolvable\", \"gate\"),\n        capabilityIsolation: \"preserve_unrelated_working_capabilities\",\n      };\n      ready = { response: json(prerequisiteData, 409), data: prerequisiteData };\n    } else if (diagnosticsRequireRefresh) {"},{"path":"workers/cc-execution/src/index-mission-control.js","anchor":"  const alreadyMerged = readyReason === \"pull_request_already_merged\";\n  const waitingForGate = readyReason === \"pull_request_checks_pending\" || readyReason === \"pull_request_gate_missing\";\n  if (waitingForGate) {","replacement":"  const alreadyMerged = readyReason === \"pull_request_already_merged\";\n  const waitingForGate = readyReason === \"pull_request_checks_pending\" || readyReason === \"pull_request_gate_missing\";\n  const prerequisiteRequired = readyReason === \"dependency_required_unresolvable\" || readyData?.status === \"prerequisite_required\";\n  if (prerequisiteRequired) {\n    return json({\n      ok: true,\n      status: \"prerequisite_required\",\n      terminal: false,\n      continuationRequired: true,\n      ownerActionRequired: false,\n      proofGate: \"repair_mission_dependency_prerequisite_required\",\n      reason: \"dependency_required_unresolvable\",\n      failureCategory: \"dependency_required_unresolvable\",\n      prNumber,\n      readyProof: readyData,\n      timingsMs: repairTimings,\n      nextAction: \"Keep this capability non-active until the declared prerequisite becomes resolvable; preserve unrelated working capabilities and re-evaluate this same PR/mission without replacement work.\",\n      destructiveActionsAllowed: false,\n    }, 202);\n  }\n  if (waitingForGate) {"},{"path":"workers/cc-execution/test/release-orchestration-invariants.test.js","anchor":"test(\"post-QA main movement is refresh-required, not a deterministic Gate failure\", async () => {","replacement":"test(\"dependency prerequisites stay nonterminal and distinct from source failure\", async () => {\n  const [missionControlSource, contractsSource] = await Promise.all([\n    readFile(\"workers/cc-execution/src/index-mission-control.js\", \"utf8\"),\n    readFile(\"workers/cc-execution/src/command-center-contracts.js\", \"utf8\"),\n  ]);\n  assert.match(missionControlSource, /function gateFailureLooksDependencyPrerequisite/);\n  assert.match(missionControlSource, /dependency_required_unresolvable\\|prerequisite_required\\|optional_dependency_unavailable\\|owner_authorized_dependency_unavailable/);\n  assert.match(missionControlSource, /failureCategory: refreshRequired \\? \"refresh_required\" : dependencyPrerequisite \\? \"dependency_required_unresolvable\"/);\n  assert.match(missionControlSource, /status: \"prerequisite_required\"/);\n  assert.match(missionControlSource, /capabilityIsolation: \"preserve_unrelated_working_capabilities\"/);\n  assert.match(missionControlSource, /repair_mission_dependency_prerequisite_required/);\n  assert.match(contractsSource, /dependency_prerequisite/);\n  assert.match(contractsSource, /hold_capability_at_prerequisite_required_preserve_unrelated_working_capabilities/);\n  assert.match(contractsSource, /checkout\\|cache\\|npm\\|dependency/);\n});\n\ntest(\"post-QA main movement is refresh-required, not a deterministic Gate failure\", async () => {"},{"path":"workers/cc-execution/src/version.js","anchor":"export const CC_EXECUTION_VERSION = \"1.58.244-gate-outcome-classification\";","replacement":"export const CC_EXECUTION_VERSION = \"1.58.245-gate-dependency-classification\";"}],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"5693c275-0c78-4aa2-80c1-5877ffe96682","ownerApproved":true,"releaseIntent":null,"sourceTargets":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"controlPlaneMaintenanceReason":"Enforce the existing Gate dependency/prerequisite contract in runtime failure normalization without weakening deterministic source/test/build failure blocking."},"proofRequirements":null,"controlPlaneUnfreeze":true,"durableMutationResume":true,"controlPlaneMaintenance":true,"controlPlaneMaintenancePaths":["workers/cc-execution/src/command-center-contracts.js","workers/cc-execution/src/index-mission-control.js","workers/cc-execution/src/version.js","workers/cc-execution/test/release-orchestration-invariants.test.js"],"controlPlaneMaintenanceReason":"Enforce the existing Gate dependency/prerequisite contract in runtime failure normalization without weakening deterministic source/test/build failure blocking."},"recovery":false,"fingerprint":"effb373043b7868bf0165f66ae16786da7fb6898c0ef58ccf2ae289e2051d190","replayCount":0,"serializedBytes":10260},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:58:47.205115+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:5693c275-0c78-4aa2-80c1-5877ffe96682:repository-mutation-intent:effb373043b7868bf0165f66ae16786da7fb6898c0ef58ccf2ae289e2051d190:0","mission_step_id":"e9d5b22b-0349-4230-a452-cef6ee85aa26","command_center_event_id":"5693c275-0c78-4aa2-80c1-5877ffe96682"},{"id":"d06bfd17-7f68-49d9-836a-46bfd1f7da7a","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-e6e7a510db4d","prNumber":3600,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"a01846565e641e4b52116f84adaad80b3d180024","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T06:00:01.059176+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"a01846565e641e4b52116f84adaad80b3d180024","external_id":"3600","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:merged-pr:3600:a01846565e641e4b52116f84adaad80b3d180024","mission_step_id":"8277f546-060e-4967-a66c-1691b83aad0b","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"235852d7-6905-403f-8b1f-fa8c3cf76d93","source":"forgejo-runtime","status":"verified","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"success","cc-execution/runtime-proof":"success"},"mainSha":"a01846565e641e4b52116f84adaad80b3d180024","missing":[],"pending":[],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"a01846565e641e4b52116f84adaad80b3d180024","releaseState":"verified","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"success"},"requestContractHash":"e24c08976756499dac475f1ccd52e1609fec9e633a0be11cccef3edabbff7e66","forgejoWorkflowProof":{"runId":11443,"source":"signed_push_receipt","status":"success","results":{},"conclusion":"success","targetStates":{"ccExecution":"success"},"targetJobCount":7,"observedTargetStates":{"ccExecution":"success"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"a01846565e641e4b52116f84adaad80b3d180024","proofGate":"cc_execution_target_aware_runtime_identity_verified","deploymentId":"forgejo-main-a01846565e641e4b52116f84adaad80b3d180024","compareStatus":"target_job_success_runtime_verified","workflowRunId":11443,"identitySource":"canonical_release_target_job","runtimeVersion":"1.58.245-durable-truth-authority","workflowFailed":false,"containsSourceSha":true},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T06:00:27.258223+00:00","proof_gate":"canonical_release_terminal_verified","source_sha":"a01846565e641e4b52116f84adaad80b3d180024","external_id":"forgejo-main-a01846565e64","receipt_type":"canonical_release_status","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:forgejo-release-status:a01846565e641e4b52116f84adaad80b3d180024:verified:forgejo-main/source=success|forgejo-release/workflow=success|cc-execution/runtime-proof=success","mission_step_id":"fd2870cd-7f33-442f-ba8b-77f3391a9770","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"ed4ad4a8-0630-4f21-8431-61bdfeece0bf","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","render-onrunner/runtime-proof":"pending"},"mainSha":"e1efa7ac76f792ce93365b88233ae35637ab2194","missing":[],"pending":["forgejo-release/workflow","render-onrunner/runtime-proof"],"required":["forgejo-main/source","forgejo-release/workflow","render-onrunner/runtime-proof"],"sourceSha":"e1efa7ac76f792ce93365b88233ae35637ab2194","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":true,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"onrunner":"pending"},"requestContractHash":"06a04bbf47bcd2e19b8071570f08c99ce04b5d0ba2fdead9b89fea7125d761aa","forgejoWorkflowProof":{"runId":11507,"source":"signed_push_receipt","status":"running","results":{},"conclusion":"running","targetStates":{"onrunner":"pending"},"targetJobCount":7,"observedTargetStates":{"onrunner":"pending"}},"onrunnerRuntimeProof":{"reason":"render_onrunner_source_mismatch","hostedUrl":"https://knocklaunchcrm.onrender.com","brokerReady":true,"exactSource":false,"healthStatus":200,"runtimeReady":true,"liveSourceSha":"666a1bc23410865196d34a9fca1b1a916365b964","runnerVersion":"onrunner-666a1bc23410","expectedSourceSha":"e1efa7ac76f792ce93365b88233ae35637ab2194"},"releaseSourceVerified":true,"ccExecutionRuntimeProof":null,"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:01:31.309692+00:00","proof_gate":"canonical_release_pending","source_sha":"e1efa7ac76f792ce93365b88233ae35637ab2194","external_id":"forgejo-main-e1efa7ac76f7","receipt_type":"canonical_release_status","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:forgejo-release-status:e1efa7ac76f792ce93365b88233ae35637ab2194:pending:forgejo-main/source=success|forgejo-release/workflow=pending|render-onrunner/runtime-proof=pending","mission_step_id":"fa619a83-3c4b-438e-8822-e8e730fcb2ef","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"},{"id":"ff455553-2c9a-4ad5-94ef-9c863edfea70","source":"cc-execution","status":"blocked","payload":{"reason":"anchored_edit_invalid","fingerprint":"d4ba891be95b846aaca25b54732bb2313f7523c2c020b8a3f6ad168686589368"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T17:49:07.093315+00:00","proof_gate":"repository_mutation_intent_deterministic_failure","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent_blocked","idempotency_key":"mission:6cebe545-6b72-468c-9a0c-d8a2c0936755:repository-mutation-intent-blocked:d4ba891be95b846aaca25b54732bb2313f7523c2c020b8a3f6ad168686589368","mission_step_id":"05204441-5588-461e-896e-fe66778c8a84","command_center_event_id":"6cebe545-6b72-468c-9a0c-d8a2c0936755"},{"id":"3cb6876c-86c0-4e5a-bc84-4d544eb3f130","source":"cc-execution","status":"waiting","payload":{"body":{"ship":true,"files":[],"route":"https://321autounlock.com/","branch":"ai/objective-first-repair-22d71bd6e399","writes":[],"patches":[],"version":1,"approved":true,"missionId":"22d71bd6-e399-480c-89a4-d01455819897","objective":"Continue the SAME corrective mission. Apply the exact source fix now: make the desktop nav truly centered on the header/viewport independent of logo and CTA widths by changing the header inner wrapper to a relative flex shell and positioning nav absolute at left-1/2/top-1/2 with -translate-x/y-1/2. Improve white-text legibility over the bright waterfront background without adding opaque boxes: increase opacity of hero body/location text and StepCard body text, and add restrained text-shadow/drop-shadow to the hero headline/body and step-card titles. Preserve cyan accent, layout scale, background, video, routes, CTA, and all behavior. Same branch/PR only.","tenantRef":"321-auto-unlock","repository":"noel/KnockLaunchOS","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/auto-lockout/AutoUnlockPublic.tsx"],"anchored_edits":[{"path":"src/pages/auto-lockout/AutoUnlockPublic.tsx","edits":[{"new_content":"function StepCard({ number, icon: Icon, title, text }: { number: string; icon: React.ComponentType<{ className?: string }>; title: string; text: string }) {\n  return <div className=\"flex gap-3 rounded-xl border border-sky-300/20 bg-[#03101a]/56 p-3 shadow-[inset_0_1px_0_rgba(255,255,255,.045),0_12px_35px_rgba(0,0,0,.12),0_0_28px_rgba(14,165,233,.045)] backdrop-blur-xl\"><div className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-sky-400 text-xs font-black text-[#03101a]\">{number}</div><div className=\"min-w-0\"><div className=\"flex items-start gap-1.5 text-sm font-black leading-5 drop-shadow-[0_1px_2px_rgba(0,0,0,.9)]\"><Icon className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-sky-400\" />{title}</div><p className=\"mt-1 text-xs leading-5 text-white/80 drop-shadow-[0_1px_2px_rgba(0,0,0,.75)]\">{text}</p></div></div>;\n}","old_content":"function StepCard({ number, icon: Icon, title, text }: { number: string; icon: React.ComponentType<{ className?: string }>; title: string; text: string }) {\n  return <div className=\"flex gap-3 rounded-xl border border-sky-300/20 bg-[#03101a]/56 p-3 shadow-[inset_0_1px_0_rgba(255,255,255,.045),0_12px_35px_rgba(0,0,0,.12),0_0_28px_rgba(14,165,233,.045)] backdrop-blur-xl\"><div className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-sky-400 text-xs font-black text-[#03101a]\">{number}</div><div className=\"min-w-0\"><div className=\"flex items-start gap-1.5 text-sm font-black leading-5\"><Icon className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-sky-400\" />{title}</div><p className=\"mt-1 text-xs leading-5 text-white/60\">{text}</p></div></div>;\n}"},{"new_content":"<header className=\"relative z-20 border-b border-sky-300/20 bg-[#010712]/42 shadow-[0_12px_50px_rgba(0,0,0,.22),0_1px_0_rgba(56,189,248,.12)] backdrop-blur-2xl\"><div className=\"relative mx-auto flex w-full max-w-[1580px] items-center justify-between gap-4 px-6 py-2.5 lg:px-8\"><BrandLogo /><nav className=\"absolute left-1/2 top-1/2 hidden -translate-x-1/2 -translate-y-1/2 rounded-xl border border-sky-300/15 bg-[#03101a]/42 p-1 backdrop-blur-xl lg:flex\">","old_content":"<header className=\"relative z-20 border-b border-sky-300/20 bg-[#010712]/42 shadow-[0_12px_50px_rgba(0,0,0,.22),0_1px_0_rgba(56,189,248,.12)] backdrop-blur-2xl\"><div className=\"mx-auto grid w-full max-w-[1580px] grid-cols-[auto_1fr_auto] items-center gap-4 px-6 py-2.5 lg:px-8\"><BrandLogo /><nav className=\"hidden justify-self-center rounded-xl border border-sky-300/15 bg-[#03101a]/42 p-1 backdrop-blur-xl lg:flex\">"},{"new_content":"<h1 className=\"max-w-[390px] text-[2.85rem] font-black leading-[.9] tracking-[-.055em] drop-shadow-[0_2px_5px_rgba(0,0,0,.85)] sm:text-[3.2rem] lg:text-[3.45rem] xl:text-[3.7rem]\">","old_content":"<h1 className=\"max-w-[390px] text-[2.85rem] font-black leading-[.9] tracking-[-.055em] sm:text-[3.2rem] lg:text-[3.45rem] xl:text-[3.7rem]\">"},{"new_content":"<p className=\"mt-5 max-w-xl text-sm leading-6 text-white/95 drop-shadow-[0_1px_3px_rgba(0,0,0,.9)] sm:text-base sm:leading-7 lg:text-lg lg:leading-8\">Tell us where you are and what you're driving. We'll confirm the details and get your unlock request moving.</p><div className=\"mt-7 text-sm font-semibold text-white/90 drop-shadow-[0_1px_3px_rgba(0,0,0,.9)]\">Palm Bay · Melbourne · Titusville · Space Coast</div>","old_content":"<p className=\"mt-5 max-w-xl text-sm leading-6 text-white/78 sm:text-base sm:leading-7 lg:text-lg lg:leading-8\">Tell us where you are and what you're driving. We'll confirm the details and get your unlock request moving.</p><div className=\"mt-7 text-sm font-semibold text-white/68\">Palm Bay · Melbourne · Titusville · Space Coast</div>"}]}],"implementation":{"files":[],"writes":[]},"requestContract":null,"repairGeneration":null,"executionEnvelope":{"ship":true,"version":1,"approved":true,"missionId":"22d71bd6-e399-480c-89a4-d01455819897","ownerApproved":true,"releaseIntent":null,"sourceTargets":["src/pages/auto-lockout/AutoUnlockPublic.tsx"],"requestContract":null,"repairGeneration":null,"proofRequirements":null,"controlPlaneUnfreeze":false,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"proofRequirements":null,"controlPlaneUnfreeze":false,"durableMutationResume":true,"controlPlaneMaintenance":false,"controlPlaneMaintenancePaths":[],"controlPlaneMaintenanceReason":null},"recovery":false,"fingerprint":"bc2ea8159ff9aad22c286358b72bfebf44990f278a6e65c3ba93f5ccc616eac3","replayCount":0,"serializedBytes":5578},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T18:50:22.322918+00:00","proof_gate":"repository_mutation_intent_persisted","source_sha":null,"external_id":null,"receipt_type":"repository_mutation_intent","idempotency_key":"mission:22d71bd6-e399-480c-89a4-d01455819897:repository-mutation-intent:bc2ea8159ff9aad22c286358b72bfebf44990f278a6e65c3ba93f5ccc616eac3:0","mission_step_id":"b1237295-caba-4ba5-9327-20e802b9d34f","command_center_event_id":"22d71bd6-e399-480c-89a4-d01455819897"},{"id":"bc0b4206-2be5-4560-9618-b053c651827e","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-e9f1d8c4fc4d","prNumber":4177,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"a3610a057c761aa233acda553740a373578d4bc3","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:26:39.733536+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"a3610a057c761aa233acda553740a373578d4bc3","external_id":"4177","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6:merged-pr:4177:a3610a057c761aa233acda553740a373578d4bc3","mission_step_id":"937fb642-3d0f-4ba4-b7de-6530963e39d1","command_center_event_id":"e9f1d8c4-fc4d-46ec-be81-0765a3a20bb6"},{"id":"70a25de7-57d7-4c13-abb2-f7c16815c4f2","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-316c710ac63f","prNumber":4180,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"fa47e38cbd9caf4f939e9348b076164c197c534e","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-29T20:57:01.828223+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"fa47e38cbd9caf4f939e9348b076164c197c534e","external_id":"4180","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:316c710a-c63f-4818-8b2b-3eeb7db4761c:merged-pr:4180:fa47e38cbd9caf4f939e9348b076164c197c534e","mission_step_id":"32fffeb4-9fa4-4ad1-8acf-995511d18682","command_center_event_id":"316c710a-c63f-4818-8b2b-3eeb7db4761c"},{"id":"20cc755f-9cc2-432d-b470-cfcf986a0b76","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"implementation","branch":"ai/objective-first-repair-94dc4229b32e","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3037,"terminal":false,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":25427,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":9480,"missionSetupMs":3062,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":3062,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":3062,"repositoryMutationMs":15947,"repositoryProviderMs":15947,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":6733,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":3062,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":9214},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3995,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:43:10.697333+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3037","receipt_type":"execute_mission","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"250f27d9-98da-487b-b7d3-449eadcacee6","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"e500cbae-3eaa-49f1-8127-e5e19a4c4ed3","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"runtime_proof","branch":"ai/objective-first-repair-94dc4229b32e","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.179-terminal-receipt-guard","prNumber":3037,"terminal":false,"missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4971,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":760,"approvedPlanMs":0,"missionSetupMs":695,"providerAuthMs":0,"shipAndProveMs":3526,"ledgerPrepareMs":695,"ledgerReconcileMs":0,"lineageReconcileMs":0,"resolvePreflightMs":695,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":695,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},"performance":null,"deploymentId":"forgejo-main-0895ede911fc","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2757,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:44:51.08373+00:00","proof_gate":"canonical_release_dispatched","source_sha":"0895ede911fc028e7f9af15056bdc73b8ae29503","external_id":"forgejo-main-0895ede911fc","receipt_type":"execute_mission","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"6e7cdb68-1565-4c64-b664-48a4b8f96d22","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"e1dd6fd7-de30-449f-bbd4-a498d278c475","source":"forgejo-runtime","status":"pending","payload":{"failed":[],"states":{"forgejo-main/source":"success","forgejo-release/workflow":"pending","cc-execution/runtime-proof":"pending"},"mainSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","missing":[],"pending":["forgejo-release/workflow","cc-execution/runtime-proof"],"required":["forgejo-main/source","forgejo-release/workflow","cc-execution/runtime-proof"],"sourceSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","releaseState":"pending","sourceInMain":true,"compareStatus":"protected_main_push_exact_source","releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"releaseTargetStates":{"ccExecution":"pending"},"requestContractHash":"c6b5123cc0f0c9e0e809486585323cbb7a50cc582aad2c65902a7ece8d75dcd2","forgejoWorkflowProof":{"url":"https://git.knocklaunch.app/noel/KnockLaunchOS/actions/runs/9309","runId":9309,"status":"running","sourceSha":"0895ede911fc028e7f9af15056bdc73b8ae29503","conclusion":null,"failedJobs":[],"diagnostics":null,"exactSource":true,"targetStates":{"ccExecution":"pending"},"targetJobCount":7,"observedTargetStates":{"ccExecution":"pending"}},"onrunnerRuntimeProof":null,"releaseSourceVerified":true,"ccExecutionRuntimeProof":{"liveSha":"1d4d5a2ccfced96ce6a9bb89797f6212ff881c3c","deploymentId":"forgejo-main-1d4d5a2ccfced96ce6a9bb89797f6212ff881c3c","compareStatus":null,"identitySource":"local_build_metadata","runtimeVersion":"1.58.179-terminal-receipt-guard","containsSourceSha":false},"releaseTargetRecoveryProof":null,"exactReleaseVerifiedAfterMainAdvanced":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:45:19.507509+00:00","proof_gate":"canonical_release_pending","source_sha":"0895ede911fc028e7f9af15056bdc73b8ae29503","external_id":"forgejo-main-0895ede911fc","receipt_type":"canonical_release_status","idempotency_key":"mission:94dc4229-b32e-4017-8207-4c3ee8ecb8bd:forgejo-release-status:0895ede911fc028e7f9af15056bdc73b8ae29503:pending:forgejo-main/source=success|forgejo-release/workflow=pending|cc-execution/runtime-proof=pending","mission_step_id":"6e7cdb68-1565-4c64-b664-48a4b8f96d22","command_center_event_id":"94dc4229-b32e-4017-8207-4c3ee8ecb8bd"},{"id":"0004b7fd-ef99-4d2b-8df9-9902ff030dd8","source":"cc-execution","status":"recorded","payload":{"objective":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","tenantRef":"pcg","receivedAt":"2026-09-29T20:27:15.539Z","fingerprint":"ab7ffce1f25b0bd471fba8b12b92dafd902fef312430eb97a0e995eb3ed30a57","workstreamRef":"pcg","conversationId":null,"canonicalBranch":null,"requestContract":{"valid":true,"intent":{"evidence":[],"confidence":null,"compilation":{"stages":["owner_intent","conversation_context","scope","live_state","mutation_authority","affected_systems","dependencies","risk_and_blast_radius","execution_tactics","required_proof","release_plan","recovery_plan"],"version":2,"explicit":true,"objective":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","proofKinds":["runtime"],"adaptiveDomains":["intent","tenant_route_role_viewport","urgency_deadline","dependency_scope","risk_blast_radius","runner_capacity","queue_active_work","provider_failure_circuits","qa_scope","retry_recovery","release_ownership","proof_depth"],"expansionPolicy":"later_stages_may_only_narrow_or_expand_with_machine_readable_dependency_evidence","dynamicStatePolicy":"live_state_may_change_execution_tactics_but_never_owner_outcome_or_explicit_constraints","dynamicRefreshStages":["preflight","gate","release","runtime_proof"],"adaptiveCompilerVersion":"paul-adaptive-objective-v1","inheritedContextBlockingAuthority":false},"rawUtterance":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","wordingChanged":false,"canonicalIntent":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","resolutionStatus":"exact","uniqueResolution":true,"clarificationRequired":false},"source":"explicit","version":1,"outcomes":[{"id":"outcome-1","statement":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","provenance":{"reason":null,"source":"explicit_request_contract","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"objective":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","constraints":[{"id":"private-originals","statement":"Canonical tenant buckets and private customer/doc media remain private. Only assets already published for public surfaces may be mirrored.","provenance":{"reason":null,"source":"explicit_request_contract","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"single-loader","statement":"Do not reintroduce a second branded loading screen; preserve the existing single WMP loader and 3-second minimum.","provenance":{"reason":null,"source":"explicit_request_contract","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"bounded-release","statement":"Release only affected frontend and Supabase Edge Functions.","provenance":{"reason":null,"source":"explicit_request_contract","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"capability-completeness","statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","provenance":{"reason":null,"source":"hard_safety_invariant","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","provenance":{"reason":null,"source":"hard_safety_invariant","inherited":false,"blockingAuthority":true},"proofConditionIds":["proof-production"]}],"adaptivePolicy":{"risk":{"tier":"elevated","blastRadius":"broad"},"proof":{"requiredKinds":["runtime"],"visualProofScope":"broad","interactionRequired":false,"runtimeProofRequired":true},"scope":{"route":"https://whatsmyprogress.com/pcg","roleRef":null,"tenantRef":"pcg","sourceTargets":["supabase/functions/tenant-media-library/index.ts","supabase/functions/customer-portal/index.ts","supabase/functions/_shared/publicSurfaceMediaDelivery.ts","src/pages/whats-my-progress/WmpLoadingScreen.tsx","src/pages/whats-my-progress/PCGWhatsMyProgressHome.tsx","src/pages/whats-my-progress/WhatsMyProgressTenantHome.tsx","src/__tests__/contracts/prehistoric-001-tenant-media.contract.test.ts"]},"dynamic":{"variables":["main_and_runtime_lineage","runner_capacity","queue_and_active_work","provider_health","failure_clusters_and_circuits","release_target_state","current_pr_and_gate_state"],"refreshStages":["preflight","gate","release","runtime_proof"],"refreshMayChange":["runner_selection","parallelism","retry_path","qa_depth","release_recovery","proof_timing"],"refreshMayNotChange":["owner_outcome","explicit_no_go_constraints","tenant_identity","credential_boundary","hard_safety_invariants"]},"urgency":{"priority":"urgent","deadlineSignals":["by tenant slug and slot","immediately","before public-presence resolves","before reveal"],"deadlineExplicit":true},"version":"paul-adaptive-objective-v1","recovery":{"transient":"one_bounded_retry_then_alternate_eligible_pool_or_provider_path","deterministic":"repair_source_or_contract_do_not_blind_rerun","mutationDependencyFailure":"prerequisite_required_or_targeted_recovery_never_invent","readOnlyDependencyFailure":"degrade_to_available_grounded_context_and_keep_conversation_alive"},"unknowns":[],"authority":{"outcome":"current_explicit_owner_request","tactics":"live_prime_truth","unknownPolicy":"preserve_unknown_never_invent","historicalContext":"advisory_unless_current_request_confirms"},"execution":{"mutation":true,"concurrency":"parallel_non_overlapping_tenant_work","scopePolicy":"start_bounded_expand_only_with_machine_readable_dependency_evidence","staleStatePolicy":"refresh_dynamic_state_before_irreversible_or_acceptance_stage","conversationIsolation":true,"ownerOutcomeMayBeChangedByAdaptation":false},"experience":{"visual":true,"viewports":["desktop","mobile"],"behavioral":false,"visualProofScope":"broad"},"dependencies":{"requiredDomains":["frontend","schema_data_storage","release_ownership","live_production_proof","backend_runtime","provider_configuration"],"capabilityDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"releaseTargetHints":["supabaseEdge","frontend"]},"inputSignals":{"rawUtterance":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","canonicalIntent":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6s signing hop.","conversationContextPresent":false}},"terminalPolicy":"all_required_proof_conditions_satisfied_after_live_release","proofConditions":[{"id":"proof-production","kind":"runtime","claim":"Eliminate the multi-second public-media latency for WMP/BMD/public-site imagery platform-wide without exposing private tenant originals. Implement PUBLIC_SURFACE_MEDIA_CDN_V1: keep tenant buckets private; mirror only published public-surface/branding/background assets into one public Supabase Storage bucket with deterministic extensionless aliases by tenant slug and slot; optimize image variants and copy public video bytes; customer-portal must return direct versioned public Storage CDN URLs instead of per-request signed-media function URLs; existing assets self-heal/backfill with safe fallback; WMP frontend must begin deterministic alias requests immediately from tenantSlug before public-presence resolves, preserve the single loader and 3-second minimum, and await full image decode before reveal. One focused PR, Gate, squash merge, affected frontend + Edge Functions only, then prewarm PCG and verify repeated PCG media loads are direct CDN and materially faster than the current 0.4-1.6","route":"https://whatsmyprogress.com/pcg","roleRef":null,"userRef":null,"required":true,"expectedText":null,"targetedActions":[],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"requireCapacityAdmissible":false,"expectedWatchdogPolicyVersion":null,"minConsecutiveHealthyHeartbeats":1,"requirePositiveMemoryAttribution":false,"requireMemoryAdmissionPressureFalse":false}],"validationErrors":[],"capabilityManifest":{"id":"Eliminate-the-multi-second-public-media-latency-for-WMP-BMD-public-site-imagery-platform-wide-withou","driftPolicy":"exact_manifest_source_release_dependency_or_runtime_identity_mismatch_is_nonterminal","proofLedger":"command_center_mission_ledger_request_contract_hash_bound","schemaVersion":1,"releaseTargets":[],"lifecycleStates":["prepare","deploy","verify","activate"],"activationPolicy":"dependencies_and_claim_matched_live_proof_before_exposure","dependencyDomains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_required_not_runtime_failures","compatibilityWindow":["N","N-1"],"failureIsolationPolicy":"quarantine_or_rollback_affected_capability_only_preserve_unrelated_working_capabilities","canaryProofConditionIds":["proof-production"]},"capabilityCompleteness":{"domains":["frontend","backend_runtime","schema_data_storage","authentication_authorization","provider_configuration","prerequisite_loading_empty_error_states","release_ownership","live_production_proof"],"required":true,"prerequisitePolicy":"expected_unavailable_dependencies_are_prerequisite_states_not_runtime_failures"}},"requestedBranch":null,"conversationContext":null,"requestContractHash":"e50361b4580f4e15320c1697e2b8ca9ef15ed02f7a51dfb2a7b93ca4e34b6dd8","requestContractRevision":1},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T20:27:16.024623+00:00","proof_gate":"tenant_workstream_contribution_recorded","source_sha":null,"external_id":null,"receipt_type":"tenant_workstream_contribution","idempotency_key":"mission:4489b794-fe0b-4298-b860-3ec38862b32d:tenant-workstream-contribution:ab7ffce1f25b0bd471fba8b12b92dafd902fef312430eb97a0e995eb3ed30a57","mission_step_id":null,"command_center_event_id":"4489b794-fe0b-4298-b860-3ec38862b32d"},{"id":"8f2a6dfc-ca15-47b0-9e2b-f8b75a9b4d83","source":"durable-mission-ledger","status":"verified","payload":{"sourceSha":"fa47e38cbd9caf4f939e9348b076164c197c534e","requestContractProof":{"legacy":false,"present":true,"outcomes":[{"id":"outcome-1","satisfied":true,"statement":"Add a real tenant Profile Video control to the shared KNOCKLAUNCH Profile media settings and wire it end-to-end. Today Big Papi's animated avatar is hard-coded in CRMUserMenu and cannot be changed by Will from Profile. Replace that trap with a shared tenant-scoped Profile Video media primitive: Profile shows an explicit Profile Video card, accepts MP4/WebM only, previews muted/looping/playsInline, uploads through tenant-media-library, promotes a profile_video brand asset, and resolves the stable URL from settings.media_branding. The tenant avatar should use the uploaded profile video for tenant-avatar mode; user-avatar mode remains personal user imagery. Big Papi's existing approved animated logo video remains the fallback only when no uploaded Profile Video exists, preserving current behavior. Static logo remains the fallback for other tenants and static/document contexts. Keep the implementation platform-wide, tenant-isolated, and compatible with existing brand image controls. Add focused contract coverage. Require canonical Gate, squash merge, release frontend plus tenant-media-library edge function, and live proof that Big Papi Profile exposes Profile Video and the tenant avata","proofConditionIds":["proof-production"]}],"satisfied":true,"constraints":[{"id":"visual-artifact-scope","satisfied":true,"statement":"The requested visual artifact type is authoritative: logo only. Do not add unrelated or mixed visual surfaces unless the owner explicitly requested them.","proofConditionIds":["proof-production"]},{"id":"visual-content-truth","satisfied":true,"statement":"Do not present invented names, metrics, prices, dates, services, testimonials, credentials, customer records, or other unknown business facts as real. Omit unknowns or mark them clearly as placeholder/example content.","proofConditionIds":["proof-production"]},{"id":"tenant-visual-isolation","satisfied":true,"statement":"Visual work is isolated to requested tenant. Do not import another tenant's logo, colors, imagery, copy, shell, customer data, business facts, or visual identity unless explicitly requested.","proofConditionIds":["proof-production"]},{"id":"reference-visual-fidelity","satisfied":true,"statement":"The approved reference owns the material visual composition: hierarchy, major geometry, typography scale, spacing rhythm, image placement/crop, color treatment, radii, shadows/glow, and overall density. Material deviation is a failed visual acceptance, not a stylistic reinterpretation.","proofConditionIds":["proof-production"]},{"id":"responsive-visual-continuity","satisfied":true,"statement":"Responsive adaptation may reflow for the target viewport, but it must preserve information hierarchy, branding, functionality, and design language. It must not invent a second design.","proofConditionIds":["proof-production"]},{"id":"reference-visual-authority","satisfied":true,"statement":"The supplied or approved reference visual is immutable acceptance evidence. Generating another mockup, image, or concept cannot satisfy this implementation request; completion requires source implementation, deployment, and reference-matched visual proof.","proofConditionIds":["proof-production"]},{"id":"capability-completeness","satisfied":true,"statement":"Every dependency the implementation declares or relies on must be wired and proven across applicable frontend, backend/runtime, schema/data/storage, authentication/authorization, provider configuration, prerequisite/loading/empty/error states, release ownership, and live production behavior; owner-authorized unavailable dependencies must become explicit prerequisite states rather than runtime failures.","proofConditionIds":["proof-production"]},{"id":"atomic-capability-lifecycle","satisfied":true,"statement":"Changed capabilities remain non-active until dependency readiness, N/N-1 compatibility, affected-target release, and claim-matched production canary proof are satisfied; missing optional dependencies become prerequisite_required, and runtime drift or health-contract violation quarantines only the affected capability instead of breaking unrelated working capability.","proofConditionIds":["proof-production"]}],"contractHash":"87799f1d449c808f655392fa4cd4aa28009307551b8171ffcf239abfc5e85018","releaseBound":true,"witnessBound":false,"visualRequested":false,"visualSatisfied":true,"conditionResults":[{"id":"proof-production","kind":"runtime","evidence":{"reason":null,"satisfied":true,"releaseState":"verified","missingTargets":[],"disallowedTargets":[],"migrationRequired":false,"releaseTargetStates":{"frontend":"success","supabaseEdge":"success"},"unsuccessfulTargets":[],"activeReleaseTargets":["frontend","supabaseEdge"],"allowedReleaseTargets":[],"requiredReleaseTargets":[],"migrationReleaseVerified":null,"releaseRequestContractHash":"87799f1d449c808f655392fa4cd4aa28009307551b8171ffcf239abfc5e85018"},"required":true,"satisfied":true}],"validationErrors":[],"pendingProofKinds":[],"activeReleaseTargets":["frontend","supabaseEdge"]},"authoritativeMissionRefresh":true,"evaluatedRequestContractRevision":1},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-29T20:57:06.135132+00:00","proof_gate":"request_contract_terminal_verified","source_sha":"fa47e38cbd9caf4f939e9348b076164c197c534e","external_id":null,"receipt_type":"request_contract_reconciliation","idempotency_key":"mission:316c710a-c63f-4818-8b2b-3eeb7db4761c:request-contract:87799f1d449c808f655392fa4cd4aa28009307551b8171ffcf239abfc5e85018:fa47e38cbd9caf4f939e9348b076164c197c534e:verified:","mission_step_id":"e2a3a1c0-b79a-4897-b1dc-f05831447f24","command_center_event_id":"316c710a-c63f-4818-8b2b-3eeb7db4761c"},{"id":"f82a3c38-1f06-41f7-a7d5-7f08b3012bdc","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-25e1b5132e66","reason":"pull_request_checks_pending","status":"waiting_for_gate","metrics":{"receiptBytes":26454,"releaseCount":0,"toolCallCount":17,"repeatedCallCount":7,"executorlessWaitMs":1302389,"firstUsefulResultAt":"2026-09-29T20:39:06.233Z","recoveryAttemptCount":8,"ownerInterruptionCount":0},"version":"1.64.10-paul-eval-precision","prNumber":4182,"terminal":false,"missionId":"25e1b513-2e66-40ae-8aea-013e14872817","operation":"execute_mission","proofGate":"repair_mission_waiting_for_gate","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":4099,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":4000,"approvedPlanMs":0,"missionSetupMs":436,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":274,"ledgerReconcileMs":0,"lineageReconcileMs":162,"resolvePreflightMs":436,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":274,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":"Reconcile this same mission and pull request after the exact-head KnockLaunch Gate changes state.","receiptRef":{"mode":"full","missionId":"25e1b513-2e66-40ae-8aea-013e14872817"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["runtime","visual"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1692,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"9602e177-0cbb-496c-bdf5-2fbc93f1b859","created_at":"2026-09-29T21:01:04.707074+00:00","proof_gate":"repair_mission_waiting_for_gate","source_sha":null,"external_id":"4182","receipt_type":"execute_mission","idempotency_key":"mission:25e1b513-2e66-40ae-8aea-013e14872817:execute_mission:repair_mission_waiting_for_gate:current-generation","mission_step_id":"0000f3c9-be46-4de6-8b28-6634a8a0bee8","command_center_event_id":"25e1b513-2e66-40ae-8aea-013e14872817"},{"id":"972c32b9-a938-4b45-96ac-1dad25ef3e4a","source":"cc-execution","status":"waiting_for_gate","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-af2b80659f26","reason":"provider_verified_auto_progress_owns_gate_merge_release_outside_owner_response","status":"waiting_for_gate","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.180-forgejo-source-read-resilience","prNumber":3038,"terminal":false,"missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e","operation":"execute_mission","proofGate":"repair_mission_pr_handed_off_to_supervisor","sourceSha":null,"timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":17744,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":0,"approvedPlanMs":4425,"missionSetupMs":857,"providerAuthMs":0,"shipAndProveMs":0,"ledgerPrepareMs":566,"ledgerReconcileMs":0,"lineageReconcileMs":291,"resolvePreflightMs":857,"repositoryMutationMs":13319,"repositoryProviderMs":13319,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":6274,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":566,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":7045},"nextAction":"Canonical KnockLaunch Gate notifier and durable mission supervisor own Gate, merge, release, and proof progression from this exact PR head outside the owner response path.","receiptRef":{"mode":"full","missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e"},"performance":null,"deploymentId":null,"releaseState":null,"workflowRunId":null,"releaseTargets":null,"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":3407,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:46:12.568326+00:00","proof_gate":"repair_mission_pr_handed_off_to_supervisor","source_sha":null,"external_id":"3038","receipt_type":"execute_mission","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:execute_mission:repair_mission_pr_handed_off_to_supervisor:current-generation","mission_step_id":"91bfe3e5-71bf-46ee-914a-ba8244d5d6fa","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"85c49fcc-b5cf-4e4e-991f-c5ddedd76689","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"release","branch":"ai/objective-first-repair-af2b80659f26","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":0,"releaseCount":0,"toolCallCount":0,"repeatedCallCount":0,"ownerInterruptionCount":0},"version":"1.58.180-forgejo-source-read-resilience","prNumber":3038,"terminal":false,"missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e","operation":"execute_mission","proofGate":"canonical_release_dispatched","sourceSha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","timingsMs":{"gateMs":0,"proofMs":0,"handlerMs":3722,"releaseMs":0,"mutationMs":0,"repositoryMs":0,"prReadinessMs":792,"approvedPlanMs":0,"missionSetupMs":3686,"providerAuthMs":0,"shipAndProveMs":1867,"ledgerPrepareMs":1583,"ledgerReconcileMs":0,"lineageReconcileMs":2103,"resolvePreflightMs":3686,"repositoryMutationMs":0,"repositoryProviderMs":0,"authoritativeLedgerMs":0,"ledgerAsyncDispatchMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"totalSynchronousLedgerMs":1583,"asyncBookkeepingDispatchMs":0,"ledgerAuthoritativeCommitMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"af2b8065-9f26-4375-8d96-fdd740d8606e"},"performance":null,"deploymentId":"forgejo-main-55bb3260a414","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":false,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":["repository","runtime"],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":2280,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:48:08.416897+00:00","proof_gate":"canonical_release_dispatched","source_sha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","external_id":"forgejo-main-55bb3260a414","receipt_type":"execute_mission","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:execute_mission:canonical_release_dispatched:current-generation","mission_step_id":"c78dd453-5338-4dd5-bd0b-f751e3f7f4f7","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"b8dd59e5-6d48-4407-8902-7f1a7972631b","source":"forgejo","status":"waiting","payload":{"branch":"ai/objective-first-repair-af2b80659f26","prNumber":3038,"nextAction":"Follow the existing canonical release to terminal proof.","mergeCommitSha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","branchDeletedAfterMerge":true,"correctiveGenerationCreated":false},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-17T20:48:01.287015+00:00","proof_gate":"forgejo_merged_pr_is_authoritative_source_lineage","source_sha":"55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","external_id":"3038","receipt_type":"source_lineage_merged_pr_authoritative","idempotency_key":"mission:af2b8065-9f26-4375-8d96-fdd740d8606e:merged-pr:3038:55bb3260a414fc2fdaeed341295ddb4d6ed17f9f","mission_step_id":"c78dd453-5338-4dd5-bd0b-f751e3f7f4f7","command_center_event_id":"af2b8065-9f26-4375-8d96-fdd740d8606e"},{"id":"bfd3bc68-c8ca-46b5-94a4-b26eff92ceef","source":"cc-execution","status":"deployment_dispatched","payload":{"ok":true,"jobId":null,"phase":"pull_request","branch":"ai/objective-first-repair-e6e7a510db4d","reason":null,"status":"deployment_dispatched","metrics":{"receiptBytes":13299,"releaseCount":0,"toolCallCount":4,"repeatedCallCount":0,"executorlessWaitMs":15171,"firstUsefulResultAt":"2026-09-24T05:58:26.029Z","recoveryAttemptCount":0,"ownerInterruptionCount":0},"version":null,"prNumber":3600,"terminal":false,"missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390","operation":"automatic_mission_resume","proofGate":"canonical_release_dispatched","sourceSha":"a01846565e641e4b52116f84adaad80b3d180024","timingsMs":{"prReadinessMs":602,"approvedPlanMs":0,"shipAndProveMs":3509,"repositoryMutationMs":0,"repositoryProviderMs":0,"repositoryAtomicCommitMs":0,"repositoryBranchCreateMs":0,"repositoryPullRequestCreateMs":0},"nextAction":null,"receiptRef":{"mode":"full","missionId":"e6e7a510-db4d-4152-bd16-7a53e692b390"},"performance":null,"deploymentId":"forgejo-main-a01846565e64","releaseState":null,"workflowRunId":null,"releaseTargets":{"frontend":false,"onrunner":false,"migrations":false,"ccExecution":true,"supabaseEdge":false,"edgeFunctionSlugs":[]},"detailsAvailable":true,"ownerFacingState":"IN_PROGRESS","pendingProofKinds":[],"verificationState":null,"workflowInvariant":{"oneBranch":true,"oneMission":true,"oneRelease":true,"invariantScope":"repair_generation","onePullRequest":true,"terminalProofRequired":true,"correctiveGenerationsAllowed":true},"sourceReceiptBytes":1978,"ownerActionRequired":false,"ownerFacingTerminal":false,"continuationRequired":true,"requestContractState":"pending"},"tenant_id":"a3ffa31f-0c88-4fdd-b872-051db013ca3e","created_at":"2026-09-24T05:59:21.471204+00:00","proof_gate":"canonical_release_dispatched","source_sha":null,"external_id":"3600","receipt_type":"automatic_mission_resume","idempotency_key":"mission:e6e7a510-db4d-4152-bd16-7a53e692b390:automatic-mission-resume:3600:canonical_release_dispatched","mission_step_id":"8277f546-060e-4967-a66c-1691b83aad0b","command_center_event_id":"e6e7a510-db4d-4152-bd16-7a53e692b390"},{"id":"2109cdbc-214a-43fb-bd6d-1b7fb465d057","source":"cc-execution","status":"waiting","payload":{"kind":"heartbeat","message":"Still active in release.","nextAction":{"lane":"production-release-conductor","action":"reconcile_release","reason":"merged_source_requires_release_proof","automationAllowed":true,"ownerActionRequired":false},"silenceBudgetMs":15000,"semanticCheckpointSignature":"{\"stateMachineVersion\":1,\"phase\":\"release\",\"ownerFacingState\":null,\"latest\":{\"kind\":\"receipt\",\"key\":\"canonical_release_status\",\"status\":\"pending\",\"proofGate\":\"canonical_release_pending\"},\"activeStep\":{\"key\":\"pull_request\",\"status\":\"waiting\",\"lane\":\"cc-execution\"},\"nextStep\":{\"key\":\"release\",\"status\":\"waiting\",\"lane\":\"production-release-conductor\"},\"nextSafeAction\":{\"action\":\"reconcile_release\",\"lane\":\"production-release-conductor\",\"reason\":\"merged_source_requires_release_proof\",\"automationAllowed\":true,\"ownerActionRequired\":false},\"executionOwnership\":{\"active\":false,\"state\":\"waiting\",\"executor\":null,\"lane\":\"cc-execution\",\"nextAction\":\"reconcile_release\",\"recoveryOwner\":\"production-release-conductor\"},\"acceptance\":{\"total\":2,\"verified\":0,\"pending\":2,\"percent\":0,\"satisfied\":false,\"verifiedIds\":[],\"pendingIds\":[\"proof-production\",\"proof-visual\"]},\"stall\":{\"stalled\":false,\"reason\":\"within_deadline\",\"step\":\"release\",\"deadlineAt\":\"2026-09-24T17:59:33.570692+00:00\",\"recoveryAction\":null},\"blocker\":null,\"terminal\":false,\"branch\":\"ai/objective-first-repair-0618a5ffb7bd\",\"prNumber\":3629,\"sourceSha\":\"e1efa7ac76f792ce93365b88233ae35637ab2194\",\"deploymentId\":\"forgejo-main-e1efa7ac76f7\"}"},"tenant_id":"d60e3c27-73ed-4a5f-a49b-c37636455daf","created_at":"2026-09-24T15:01:46.845967+00:00","proof_gate":"owner_progress_heartbeat","source_sha":null,"external_id":null,"receipt_type":"owner_progress_heartbeat","idempotency_key":"mission:0618a5ff-b7bd-4db6-a975-5b9689bf2c05:owner-progress-heartbeat:119350807","mission_step_id":"cd0d25b5-236d-4fd7-9b94-40d803e943d7","command_center_event_id":"0618a5ff-b7bd-4db6-a975-5b9689bf2c05"}],"rows":200,"limit":200,"table":"command_center_receipts","format":"knocklaunch-table-chunk-v1","offset":20800,"schema":"public"}