@productbrain/cli 0.1.0-beta.104 → 0.1.0-beta.10403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/__tests__/adapters.test.js +79 -53
- package/dist/__tests__/adapters.test.js.map +1 -1
- package/dist/__tests__/adminConfig.test.d.ts +18 -0
- package/dist/__tests__/adminConfig.test.d.ts.map +1 -0
- package/dist/__tests__/adminConfig.test.js +221 -0
- package/dist/__tests__/adminConfig.test.js.map +1 -0
- package/dist/__tests__/batch-transformations.test.js +2 -26
- package/dist/__tests__/batch-transformations.test.js.map +1 -1
- package/dist/__tests__/canonicalRefs.vocab.test.d.ts +2 -0
- package/dist/__tests__/canonicalRefs.vocab.test.d.ts.map +1 -0
- package/dist/__tests__/canonicalRefs.vocab.test.js +251 -0
- package/dist/__tests__/canonicalRefs.vocab.test.js.map +1 -0
- package/dist/__tests__/capture-receipt-coaching.test.d.ts +2 -0
- package/dist/__tests__/capture-receipt-coaching.test.d.ts.map +1 -0
- package/dist/__tests__/capture-receipt-coaching.test.js +109 -0
- package/dist/__tests__/capture-receipt-coaching.test.js.map +1 -0
- package/dist/__tests__/capture-receipt-role-hint.test.d.ts +2 -0
- package/dist/__tests__/capture-receipt-role-hint.test.d.ts.map +1 -0
- package/dist/__tests__/capture-receipt-role-hint.test.js +67 -0
- package/dist/__tests__/capture-receipt-role-hint.test.js.map +1 -0
- package/dist/__tests__/capture-receipt-spine-floor.test.d.ts +2 -0
- package/dist/__tests__/capture-receipt-spine-floor.test.d.ts.map +1 -0
- package/dist/__tests__/capture-receipt-spine-floor.test.js +45 -0
- package/dist/__tests__/capture-receipt-spine-floor.test.js.map +1 -0
- package/dist/__tests__/capture.test.js +1365 -182
- package/dist/__tests__/capture.test.js.map +1 -1
- package/dist/__tests__/client-binding-guard.test.d.ts +2 -0
- package/dist/__tests__/client-binding-guard.test.d.ts.map +1 -0
- package/dist/__tests__/client-binding-guard.test.js +84 -0
- package/dist/__tests__/client-binding-guard.test.js.map +1 -0
- package/dist/__tests__/coaching-mirror-drift.test.d.ts +2 -0
- package/dist/__tests__/coaching-mirror-drift.test.d.ts.map +1 -0
- package/dist/__tests__/coaching-mirror-drift.test.js +50 -0
- package/dist/__tests__/coaching-mirror-drift.test.js.map +1 -0
- package/dist/__tests__/codex-prep-parity.test.d.ts +2 -0
- package/dist/__tests__/codex-prep-parity.test.d.ts.map +1 -0
- package/dist/__tests__/codex-prep-parity.test.js +84 -0
- package/dist/__tests__/codex-prep-parity.test.js.map +1 -0
- package/dist/__tests__/collection-registry-seed-drift.test.d.ts +2 -0
- package/dist/__tests__/collection-registry-seed-drift.test.d.ts.map +1 -0
- package/dist/__tests__/collection-registry-seed-drift.test.js +102 -0
- package/dist/__tests__/collection-registry-seed-drift.test.js.map +1 -0
- package/dist/__tests__/config-prod-fallthrough.test.d.ts +2 -0
- package/dist/__tests__/config-prod-fallthrough.test.d.ts.map +1 -0
- package/dist/__tests__/config-prod-fallthrough.test.js +93 -0
- package/dist/__tests__/config-prod-fallthrough.test.js.map +1 -0
- package/dist/__tests__/config.test.js +821 -32
- package/dist/__tests__/config.test.js.map +1 -1
- package/dist/__tests__/constants.test.js +6 -1
- package/dist/__tests__/constants.test.js.map +1 -1
- package/dist/__tests__/constellation.test.js +26 -14
- package/dist/__tests__/constellation.test.js.map +1 -1
- package/dist/__tests__/conversation.test.d.ts +2 -0
- package/dist/__tests__/conversation.test.d.ts.map +1 -0
- package/dist/__tests__/conversation.test.js +113 -0
- package/dist/__tests__/conversation.test.js.map +1 -0
- package/dist/__tests__/entry-formatter.test.d.ts +2 -0
- package/dist/__tests__/entry-formatter.test.d.ts.map +1 -0
- package/dist/__tests__/entry-formatter.test.js +159 -0
- package/dist/__tests__/entry-formatter.test.js.map +1 -0
- package/dist/__tests__/entry-preflight.test.d.ts +2 -0
- package/dist/__tests__/entry-preflight.test.d.ts.map +1 -0
- package/dist/__tests__/entry-preflight.test.js +58 -0
- package/dist/__tests__/entry-preflight.test.js.map +1 -0
- package/dist/__tests__/entryAccept-batch.test.d.ts +2 -0
- package/dist/__tests__/entryAccept-batch.test.d.ts.map +1 -0
- package/dist/__tests__/entryAccept-batch.test.js +305 -0
- package/dist/__tests__/entryAccept-batch.test.js.map +1 -0
- package/dist/__tests__/entryAccept.test.d.ts +2 -0
- package/dist/__tests__/entryAccept.test.d.ts.map +1 -0
- package/dist/__tests__/entryAccept.test.js +526 -0
- package/dist/__tests__/entryAccept.test.js.map +1 -0
- package/dist/__tests__/entryDiscardResolve.test.d.ts +2 -0
- package/dist/__tests__/entryDiscardResolve.test.d.ts.map +1 -0
- package/dist/__tests__/entryDiscardResolve.test.js +28 -0
- package/dist/__tests__/entryDiscardResolve.test.js.map +1 -0
- package/dist/__tests__/entryOwn.test.d.ts +2 -0
- package/dist/__tests__/entryOwn.test.d.ts.map +1 -0
- package/dist/__tests__/entryOwn.test.js +50 -0
- package/dist/__tests__/entryOwn.test.js.map +1 -0
- package/dist/__tests__/entryTick.test.d.ts +2 -0
- package/dist/__tests__/entryTick.test.d.ts.map +1 -0
- package/dist/__tests__/entryTick.test.js +40 -0
- package/dist/__tests__/entryTick.test.js.map +1 -0
- package/dist/__tests__/envelope-contract.test.js +31 -3
- package/dist/__tests__/envelope-contract.test.js.map +1 -1
- package/dist/__tests__/errors.test.js +42 -0
- package/dist/__tests__/errors.test.js.map +1 -1
- package/dist/__tests__/fields.test.js +14 -3
- package/dist/__tests__/fields.test.js.map +1 -1
- package/dist/__tests__/gateway-dry-run-timeout.test.d.ts +2 -0
- package/dist/__tests__/gateway-dry-run-timeout.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-dry-run-timeout.test.js +70 -0
- package/dist/__tests__/gateway-dry-run-timeout.test.js.map +1 -0
- package/dist/__tests__/gateway-timeout-body-phase.test.d.ts +2 -0
- package/dist/__tests__/gateway-timeout-body-phase.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-timeout-body-phase.test.js +116 -0
- package/dist/__tests__/gateway-timeout-body-phase.test.js.map +1 -0
- package/dist/__tests__/handshake-augment.test.d.ts +2 -0
- package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-augment.test.js +407 -0
- package/dist/__tests__/handshake-augment.test.js.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.js +24 -0
- package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
- package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
- package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-formatter.test.js +111 -0
- package/dist/__tests__/handshake-formatter.test.js.map +1 -0
- package/dist/__tests__/handshake-preview.test.js +358 -137
- package/dist/__tests__/handshake-preview.test.js.map +1 -1
- package/dist/__tests__/handshake-session-threading.test.d.ts +2 -0
- package/dist/__tests__/handshake-session-threading.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-session-threading.test.js +185 -0
- package/dist/__tests__/handshake-session-threading.test.js.map +1 -0
- package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
- package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/handshake.e2e.test.js +226 -0
- package/dist/__tests__/handshake.e2e.test.js.map +1 -0
- package/dist/__tests__/handshake.test.js +794 -309
- package/dist/__tests__/handshake.test.js.map +1 -1
- package/dist/__tests__/health-gap-kinds-drift.test.d.ts +2 -0
- package/dist/__tests__/health-gap-kinds-drift.test.d.ts.map +1 -0
- package/dist/__tests__/health-gap-kinds-drift.test.js +43 -0
- package/dist/__tests__/health-gap-kinds-drift.test.js.map +1 -0
- package/dist/__tests__/hook-intents.test.js +31 -43
- package/dist/__tests__/hook-intents.test.js.map +1 -1
- package/dist/__tests__/ingest.test.js +9 -0
- package/dist/__tests__/ingest.test.js.map +1 -1
- package/dist/__tests__/init.test.js +51 -14
- package/dist/__tests__/init.test.js.map +1 -1
- package/dist/__tests__/kernel-value-sets-drift.test.d.ts +2 -0
- package/dist/__tests__/kernel-value-sets-drift.test.d.ts.map +1 -0
- package/dist/__tests__/kernel-value-sets-drift.test.js +46 -0
- package/dist/__tests__/kernel-value-sets-drift.test.js.map +1 -0
- package/dist/__tests__/kernel-value-sets-generator.test.d.ts +2 -0
- package/dist/__tests__/kernel-value-sets-generator.test.d.ts.map +1 -0
- package/dist/__tests__/kernel-value-sets-generator.test.js +108 -0
- package/dist/__tests__/kernel-value-sets-generator.test.js.map +1 -0
- package/dist/__tests__/login.test.js +18 -1
- package/dist/__tests__/login.test.js.map +1 -1
- package/dist/__tests__/manifest.test.js +118 -1
- package/dist/__tests__/manifest.test.js.map +1 -1
- package/dist/__tests__/method-registry.integration.test.js +2 -3
- package/dist/__tests__/method-registry.integration.test.js.map +1 -1
- package/dist/__tests__/method-registry.test.d.ts +6 -8
- package/dist/__tests__/method-registry.test.d.ts.map +1 -1
- package/dist/__tests__/method-registry.test.js +22 -70
- package/dist/__tests__/method-registry.test.js.map +1 -1
- package/dist/__tests__/missingPin.test.d.ts +11 -0
- package/dist/__tests__/missingPin.test.d.ts.map +1 -0
- package/dist/__tests__/missingPin.test.js +232 -0
- package/dist/__tests__/missingPin.test.js.map +1 -0
- package/dist/__tests__/notice-marker.test.d.ts +2 -0
- package/dist/__tests__/notice-marker.test.d.ts.map +1 -0
- package/dist/__tests__/notice-marker.test.js +176 -0
- package/dist/__tests__/notice-marker.test.js.map +1 -0
- package/dist/__tests__/orient.test.js +473 -20
- package/dist/__tests__/orient.test.js.map +1 -1
- package/dist/__tests__/perimeter.test.d.ts +2 -0
- package/dist/__tests__/perimeter.test.d.ts.map +1 -0
- package/dist/__tests__/perimeter.test.js +165 -0
- package/dist/__tests__/perimeter.test.js.map +1 -0
- package/dist/__tests__/personal-layer.test.d.ts +1 -2
- package/dist/__tests__/personal-layer.test.d.ts.map +1 -1
- package/dist/__tests__/personal-layer.test.js +12 -48
- package/dist/__tests__/personal-layer.test.js.map +1 -1
- package/dist/__tests__/preview-key-refresh.test.d.ts +2 -0
- package/dist/__tests__/preview-key-refresh.test.d.ts.map +1 -0
- package/dist/__tests__/preview-key-refresh.test.js +186 -0
- package/dist/__tests__/preview-key-refresh.test.js.map +1 -0
- package/dist/__tests__/profiles.test.js +597 -3
- package/dist/__tests__/profiles.test.js.map +1 -1
- package/dist/__tests__/prompts.test.js +18 -1
- package/dist/__tests__/prompts.test.js.map +1 -1
- package/dist/__tests__/proof-run.test.d.ts +2 -0
- package/dist/__tests__/proof-run.test.d.ts.map +1 -0
- package/dist/__tests__/proof-run.test.js +255 -0
- package/dist/__tests__/proof-run.test.js.map +1 -0
- package/dist/__tests__/rate-limit-resilience.test.d.ts +7 -0
- package/dist/__tests__/rate-limit-resilience.test.d.ts.map +1 -0
- package/dist/__tests__/rate-limit-resilience.test.js +209 -0
- package/dist/__tests__/rate-limit-resilience.test.js.map +1 -0
- package/dist/__tests__/read-target-notice.test.d.ts +2 -0
- package/dist/__tests__/read-target-notice.test.d.ts.map +1 -0
- package/dist/__tests__/read-target-notice.test.js +125 -0
- package/dist/__tests__/read-target-notice.test.js.map +1 -0
- package/dist/__tests__/relate.test.js +246 -14
- package/dist/__tests__/relate.test.js.map +1 -1
- package/dist/__tests__/reply-commands-registered.test.d.ts +2 -0
- package/dist/__tests__/reply-commands-registered.test.d.ts.map +1 -0
- package/dist/__tests__/reply-commands-registered.test.js +81 -0
- package/dist/__tests__/reply-commands-registered.test.js.map +1 -0
- package/dist/__tests__/repo-detect.test.js +18 -38
- package/dist/__tests__/repo-detect.test.js.map +1 -1
- package/dist/__tests__/reportedProfile.test.d.ts +2 -0
- package/dist/__tests__/reportedProfile.test.d.ts.map +1 -0
- package/dist/__tests__/reportedProfile.test.js +328 -0
- package/dist/__tests__/reportedProfile.test.js.map +1 -0
- package/dist/__tests__/restore.test.d.ts +2 -0
- package/dist/__tests__/restore.test.d.ts.map +1 -0
- package/dist/__tests__/restore.test.js +85 -0
- package/dist/__tests__/restore.test.js.map +1 -0
- package/dist/__tests__/route-latency-budget.test.d.ts +2 -0
- package/dist/__tests__/route-latency-budget.test.d.ts.map +1 -0
- package/dist/__tests__/route-latency-budget.test.js +107 -0
- package/dist/__tests__/route-latency-budget.test.js.map +1 -0
- package/dist/__tests__/runner.test.js +59 -44
- package/dist/__tests__/runner.test.js.map +1 -1
- package/dist/__tests__/session-binding-refusal-tenant.test.d.ts +2 -0
- package/dist/__tests__/session-binding-refusal-tenant.test.d.ts.map +1 -0
- package/dist/__tests__/session-binding-refusal-tenant.test.js +112 -0
- package/dist/__tests__/session-binding-refusal-tenant.test.js.map +1 -0
- package/dist/__tests__/session-close-loop.test.d.ts +2 -0
- package/dist/__tests__/session-close-loop.test.d.ts.map +1 -0
- package/dist/__tests__/session-close-loop.test.js +227 -0
- package/dist/__tests__/session-close-loop.test.js.map +1 -0
- package/dist/__tests__/session-label.test.d.ts +2 -0
- package/dist/__tests__/session-label.test.d.ts.map +1 -0
- package/dist/__tests__/session-label.test.js +46 -0
- package/dist/__tests__/session-label.test.js.map +1 -0
- package/dist/__tests__/session-list-show.test.d.ts +2 -0
- package/dist/__tests__/session-list-show.test.d.ts.map +1 -0
- package/dist/__tests__/session-list-show.test.js +173 -0
- package/dist/__tests__/session-list-show.test.js.map +1 -0
- package/dist/__tests__/session-pinned-role.test.d.ts +2 -0
- package/dist/__tests__/session-pinned-role.test.d.ts.map +1 -0
- package/dist/__tests__/session-pinned-role.test.js +305 -0
- package/dist/__tests__/session-pinned-role.test.js.map +1 -0
- package/dist/__tests__/session-reset.test.d.ts +2 -0
- package/dist/__tests__/session-reset.test.d.ts.map +1 -0
- package/dist/__tests__/session-reset.test.js +138 -0
- package/dist/__tests__/session-reset.test.js.map +1 -0
- package/dist/__tests__/session-resume-backstop.test.d.ts +2 -0
- package/dist/__tests__/session-resume-backstop.test.d.ts.map +1 -0
- package/dist/__tests__/session-resume-backstop.test.js +139 -0
- package/dist/__tests__/session-resume-backstop.test.js.map +1 -0
- package/dist/__tests__/session-role-name-sanitize.test.d.ts +2 -0
- package/dist/__tests__/session-role-name-sanitize.test.d.ts.map +1 -0
- package/dist/__tests__/session-role-name-sanitize.test.js +122 -0
- package/dist/__tests__/session-role-name-sanitize.test.js.map +1 -0
- package/dist/__tests__/session-start-key-refresh.test.d.ts +2 -0
- package/dist/__tests__/session-start-key-refresh.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-key-refresh.test.js +197 -0
- package/dist/__tests__/session-start-key-refresh.test.js.map +1 -0
- package/dist/__tests__/session-state-machine.test.js +235 -10
- package/dist/__tests__/session-state-machine.test.js.map +1 -1
- package/dist/__tests__/session-switch.test.d.ts +2 -0
- package/dist/__tests__/session-switch.test.d.ts.map +1 -0
- package/dist/__tests__/session-switch.test.js +343 -0
- package/dist/__tests__/session-switch.test.js.map +1 -0
- package/dist/__tests__/session-touch.test.js +6 -1
- package/dist/__tests__/session-touch.test.js.map +1 -1
- package/dist/__tests__/sessionBinding.test.d.ts +2 -0
- package/dist/__tests__/sessionBinding.test.d.ts.map +1 -0
- package/dist/__tests__/sessionBinding.test.js +118 -0
- package/dist/__tests__/sessionBinding.test.js.map +1 -0
- package/dist/__tests__/sessionByIdLookup.test.d.ts +2 -0
- package/dist/__tests__/sessionByIdLookup.test.d.ts.map +1 -0
- package/dist/__tests__/sessionByIdLookup.test.js +63 -0
- package/dist/__tests__/sessionByIdLookup.test.js.map +1 -0
- package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
- package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
- package/dist/__tests__/skill-vocabulary.test.js +192 -0
- package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
- package/dist/__tests__/state.test.js +21 -1
- package/dist/__tests__/state.test.js.map +1 -1
- package/dist/__tests__/stillTrue.test.d.ts +2 -0
- package/dist/__tests__/stillTrue.test.d.ts.map +1 -0
- package/dist/__tests__/stillTrue.test.js +52 -0
- package/dist/__tests__/stillTrue.test.js.map +1 -0
- package/dist/__tests__/strip.test.js +57 -3
- package/dist/__tests__/strip.test.js.map +1 -1
- package/dist/__tests__/surfaces.test.js +3 -4
- package/dist/__tests__/surfaces.test.js.map +1 -1
- package/dist/__tests__/tenant-notice-write-path.test.d.ts +2 -0
- package/dist/__tests__/tenant-notice-write-path.test.d.ts.map +1 -0
- package/dist/__tests__/tenant-notice-write-path.test.js +169 -0
- package/dist/__tests__/tenant-notice-write-path.test.js.map +1 -0
- package/dist/__tests__/update-check.test.d.ts +2 -0
- package/dist/__tests__/update-check.test.d.ts.map +1 -0
- package/dist/__tests__/update-check.test.js +215 -0
- package/dist/__tests__/update-check.test.js.map +1 -0
- package/dist/__tests__/update.test.js +458 -8
- package/dist/__tests__/update.test.js.map +1 -1
- package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
- package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
- package/dist/__tests__/upgrade-runner.test.js +54 -0
- package/dist/__tests__/upgrade-runner.test.js.map +1 -0
- package/dist/__tests__/upgrade.test.d.ts +2 -0
- package/dist/__tests__/upgrade.test.d.ts.map +1 -0
- package/dist/__tests__/upgrade.test.js +56 -0
- package/dist/__tests__/upgrade.test.js.map +1 -0
- package/dist/__tests__/verify-formatter.test.d.ts +2 -0
- package/dist/__tests__/verify-formatter.test.d.ts.map +1 -0
- package/dist/__tests__/verify-formatter.test.js +85 -0
- package/dist/__tests__/verify-formatter.test.js.map +1 -0
- package/dist/__tests__/vocabulary-leak.test.d.ts +33 -0
- package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
- package/dist/__tests__/vocabulary-leak.test.js +427 -0
- package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
- package/dist/__tests__/workspace.test.js +16 -77
- package/dist/__tests__/workspace.test.js.map +1 -1
- package/dist/__tests__/workspaceNotice.test.d.ts +2 -0
- package/dist/__tests__/workspaceNotice.test.d.ts.map +1 -0
- package/dist/__tests__/workspaceNotice.test.js +571 -0
- package/dist/__tests__/workspaceNotice.test.js.map +1 -0
- package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
- package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
- package/dist/commands/__tests__/connect-handoff.test.js +111 -0
- package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
- package/dist/commands/__tests__/quality.test.d.ts +2 -0
- package/dist/commands/__tests__/quality.test.d.ts.map +1 -0
- package/dist/commands/__tests__/quality.test.js +171 -0
- package/dist/commands/__tests__/quality.test.js.map +1 -0
- package/dist/commands/__tests__/rework.test.d.ts +2 -0
- package/dist/commands/__tests__/rework.test.d.ts.map +1 -0
- package/dist/commands/__tests__/rework.test.js +149 -0
- package/dist/commands/__tests__/rework.test.js.map +1 -0
- package/dist/commands/__tests__/tensionsList.test.d.ts +2 -0
- package/dist/commands/__tests__/tensionsList.test.d.ts.map +1 -0
- package/dist/commands/__tests__/tensionsList.test.js +63 -0
- package/dist/commands/__tests__/tensionsList.test.js.map +1 -0
- package/dist/commands/accept-policy.d.ts +10 -0
- package/dist/commands/accept-policy.d.ts.map +1 -0
- package/dist/commands/accept-policy.js +107 -0
- package/dist/commands/accept-policy.js.map +1 -0
- package/dist/commands/admin/cockpit.d.ts +2 -13
- package/dist/commands/admin/cockpit.d.ts.map +1 -1
- package/dist/commands/admin/cockpit.js +5 -5
- package/dist/commands/admin/cockpit.js.map +1 -1
- package/dist/commands/admin/index.d.ts +49 -0
- package/dist/commands/admin/index.d.ts.map +1 -1
- package/dist/commands/admin/index.js +148 -29
- package/dist/commands/admin/index.js.map +1 -1
- package/dist/commands/admin/index.test.d.ts +2 -0
- package/dist/commands/admin/index.test.d.ts.map +1 -0
- package/dist/commands/admin/index.test.js +94 -0
- package/dist/commands/admin/index.test.js.map +1 -0
- package/dist/commands/admin/inspect.d.ts.map +1 -1
- package/dist/commands/admin/inspect.js +2 -7
- package/dist/commands/admin/inspect.js.map +1 -1
- package/dist/commands/admin/probe.d.ts +75 -0
- package/dist/commands/admin/probe.d.ts.map +1 -0
- package/dist/commands/admin/probe.js +224 -0
- package/dist/commands/admin/probe.js.map +1 -0
- package/dist/commands/admin/probe.test.d.ts +2 -0
- package/dist/commands/admin/probe.test.d.ts.map +1 -0
- package/dist/commands/admin/probe.test.js +193 -0
- package/dist/commands/admin/probe.test.js.map +1 -0
- package/dist/commands/admin/run.d.ts +43 -0
- package/dist/commands/admin/run.d.ts.map +1 -0
- package/dist/commands/admin/run.js +78 -0
- package/dist/commands/admin/run.js.map +1 -0
- package/dist/commands/admin/run.test.d.ts +18 -0
- package/dist/commands/admin/run.test.d.ts.map +1 -0
- package/dist/commands/admin/run.test.js +168 -0
- package/dist/commands/admin/run.test.js.map +1 -0
- package/dist/commands/admin/seed.d.ts +29 -14
- package/dist/commands/admin/seed.d.ts.map +1 -1
- package/dist/commands/admin/seed.js +303 -326
- package/dist/commands/admin/seed.js.map +1 -1
- package/dist/commands/admin/seed.test.d.ts +3 -4
- package/dist/commands/admin/seed.test.d.ts.map +1 -1
- package/dist/commands/admin/seed.test.js +26 -69
- package/dist/commands/admin/seed.test.js.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.generated.js +36 -0
- package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.test.d.ts +13 -0
- package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.test.js +101 -0
- package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
- package/dist/commands/admin/seedRowType.d.ts +22 -0
- package/dist/commands/admin/seedRowType.d.ts.map +1 -0
- package/dist/commands/admin/seedRowType.js +2 -0
- package/dist/commands/admin/seedRowType.js.map +1 -0
- package/dist/commands/admin/seedStatusColor.d.ts +9 -0
- package/dist/commands/admin/seedStatusColor.d.ts.map +1 -0
- package/dist/commands/admin/seedStatusColor.js +19 -0
- package/dist/commands/admin/seedStatusColor.js.map +1 -0
- package/dist/commands/admin/seedStatusColor.test.d.ts +2 -0
- package/dist/commands/admin/seedStatusColor.test.d.ts.map +1 -0
- package/dist/commands/admin/seedStatusColor.test.js +31 -0
- package/dist/commands/admin/seedStatusColor.test.js.map +1 -0
- package/dist/commands/brief.d.ts.map +1 -1
- package/dist/commands/brief.js +24 -2
- package/dist/commands/brief.js.map +1 -1
- package/dist/commands/capture.d.ts +17 -9
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +178 -228
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/chain-walk.d.ts.map +1 -1
- package/dist/commands/chain-walk.js.map +1 -1
- package/dist/commands/changes.d.ts.map +1 -1
- package/dist/commands/changes.js.map +1 -1
- package/dist/commands/codex-prep.d.ts +12 -1
- package/dist/commands/codex-prep.d.ts.map +1 -1
- package/dist/commands/codex-prep.js +18 -84
- package/dist/commands/codex-prep.js.map +1 -1
- package/dist/commands/collections.d.ts +1 -1
- package/dist/commands/collections.d.ts.map +1 -1
- package/dist/commands/collections.js +1 -1
- package/dist/commands/collections.js.map +1 -1
- package/dist/commands/conflicts.d.ts +35 -0
- package/dist/commands/conflicts.d.ts.map +1 -0
- package/dist/commands/conflicts.js +194 -0
- package/dist/commands/conflicts.js.map +1 -0
- package/dist/commands/conflicts.test.d.ts +2 -0
- package/dist/commands/conflicts.test.d.ts.map +1 -0
- package/dist/commands/conflicts.test.js +179 -0
- package/dist/commands/conflicts.test.js.map +1 -0
- package/dist/commands/connect-config.test.d.ts +2 -0
- package/dist/commands/connect-config.test.d.ts.map +1 -0
- package/dist/commands/connect-config.test.js +52 -0
- package/dist/commands/connect-config.test.js.map +1 -0
- package/dist/commands/connect-context.d.ts +55 -0
- package/dist/commands/connect-context.d.ts.map +1 -0
- package/dist/commands/connect-context.js +78 -0
- package/dist/commands/connect-context.js.map +1 -0
- package/dist/commands/connect-context.test.d.ts +2 -0
- package/dist/commands/connect-context.test.d.ts.map +1 -0
- package/dist/commands/connect-context.test.js +148 -0
- package/dist/commands/connect-context.test.js.map +1 -0
- package/dist/commands/connect-decline.test.d.ts +2 -0
- package/dist/commands/connect-decline.test.d.ts.map +1 -0
- package/dist/commands/connect-decline.test.js +70 -0
- package/dist/commands/connect-decline.test.js.map +1 -0
- package/dist/commands/connect-handoff.d.ts +51 -0
- package/dist/commands/connect-handoff.d.ts.map +1 -0
- package/dist/commands/connect-handoff.js +70 -0
- package/dist/commands/connect-handoff.js.map +1 -0
- package/dist/commands/connect-integration.test.js +37 -19
- package/dist/commands/connect-integration.test.js.map +1 -1
- package/dist/commands/connect-legacy-migration.test.d.ts +2 -0
- package/dist/commands/connect-legacy-migration.test.d.ts.map +1 -0
- package/dist/commands/connect-legacy-migration.test.js +109 -0
- package/dist/commands/connect-legacy-migration.test.js.map +1 -0
- package/dist/commands/connect-redeem-failure.test.d.ts +2 -0
- package/dist/commands/connect-redeem-failure.test.d.ts.map +1 -0
- package/dist/commands/connect-redeem-failure.test.js +134 -0
- package/dist/commands/connect-redeem-failure.test.js.map +1 -0
- package/dist/commands/connect-screens.d.ts +18 -8
- package/dist/commands/connect-screens.d.ts.map +1 -1
- package/dist/commands/connect-screens.js +83 -37
- package/dist/commands/connect-screens.js.map +1 -1
- package/dist/commands/connect-seal.test.d.ts +2 -0
- package/dist/commands/connect-seal.test.d.ts.map +1 -0
- package/dist/commands/connect-seal.test.js +55 -0
- package/dist/commands/connect-seal.test.js.map +1 -0
- package/dist/commands/connect.d.ts +22 -6
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +249 -107
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/connect.test.js +226 -23
- package/dist/commands/connect.test.js.map +1 -1
- package/dist/commands/constellation.d.ts.map +1 -1
- package/dist/commands/constellation.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/cross-cut.d.ts.map +1 -1
- package/dist/commands/cross-cut.js.map +1 -1
- package/dist/commands/digest.d.ts +17 -0
- package/dist/commands/digest.d.ts.map +1 -0
- package/dist/commands/digest.js +58 -0
- package/dist/commands/digest.js.map +1 -0
- package/dist/commands/digest.test.d.ts +2 -0
- package/dist/commands/digest.test.d.ts.map +1 -0
- package/dist/commands/digest.test.js +36 -0
- package/dist/commands/digest.test.js.map +1 -0
- package/dist/commands/direction.d.ts +10 -0
- package/dist/commands/direction.d.ts.map +1 -0
- package/dist/commands/direction.js +79 -0
- package/dist/commands/direction.js.map +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +173 -38
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +352 -6
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/entryAccept.d.ts +26 -0
- package/dist/commands/entryAccept.d.ts.map +1 -0
- package/dist/commands/entryAccept.js +308 -0
- package/dist/commands/entryAccept.js.map +1 -0
- package/dist/commands/entryDiscardResolve.d.ts +9 -0
- package/dist/commands/entryDiscardResolve.d.ts.map +1 -0
- package/dist/commands/entryDiscardResolve.js +27 -0
- package/dist/commands/entryDiscardResolve.js.map +1 -0
- package/dist/commands/entryOwn.d.ts +5 -0
- package/dist/commands/entryOwn.d.ts.map +1 -0
- package/dist/commands/entryOwn.js +17 -0
- package/dist/commands/entryOwn.js.map +1 -0
- package/dist/commands/entryPreflight.d.ts +8 -0
- package/dist/commands/entryPreflight.d.ts.map +1 -0
- package/dist/commands/entryPreflight.js +48 -0
- package/dist/commands/entryPreflight.js.map +1 -0
- package/dist/commands/entryTick.d.ts +8 -0
- package/dist/commands/entryTick.d.ts.map +1 -0
- package/dist/commands/entryTick.js +43 -0
- package/dist/commands/entryTick.js.map +1 -0
- package/dist/commands/feedback.d.ts +36 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +171 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/feedback.test.d.ts +2 -0
- package/dist/commands/feedback.test.d.ts.map +1 -0
- package/dist/commands/feedback.test.js +109 -0
- package/dist/commands/feedback.test.js.map +1 -0
- package/dist/commands/fields.d.ts.map +1 -1
- package/dist/commands/fields.js +1 -1
- package/dist/commands/fields.js.map +1 -1
- package/dist/commands/files.d.ts +26 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +160 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/files.test.d.ts +2 -0
- package/dist/commands/files.test.d.ts.map +1 -0
- package/dist/commands/files.test.js +278 -0
- package/dist/commands/files.test.js.map +1 -0
- package/dist/commands/handshake.d.ts +48 -112
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +725 -715
- package/dist/commands/handshake.js.map +1 -1
- package/dist/commands/handshakeCursorSkillCleanup.d.ts +36 -0
- package/dist/commands/handshakeCursorSkillCleanup.d.ts.map +1 -0
- package/dist/commands/handshakeCursorSkillCleanup.js +110 -0
- package/dist/commands/handshakeCursorSkillCleanup.js.map +1 -0
- package/dist/commands/handshakeDriftClassification.d.ts +33 -0
- package/dist/commands/handshakeDriftClassification.d.ts.map +1 -0
- package/dist/commands/handshakeDriftClassification.js +62 -0
- package/dist/commands/handshakeDriftClassification.js.map +1 -0
- package/dist/commands/history.d.ts +30 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +62 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/history.test.d.ts +2 -0
- package/dist/commands/history.test.d.ts.map +1 -0
- package/dist/commands/history.test.js +106 -0
- package/dist/commands/history.test.js.map +1 -0
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +9 -0
- package/dist/commands/ingest.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +22 -13
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +15 -11
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/organisation.d.ts +12 -0
- package/dist/commands/organisation.d.ts.map +1 -0
- package/dist/commands/organisation.js +147 -0
- package/dist/commands/organisation.js.map +1 -0
- package/dist/commands/organisation.test.d.ts +2 -0
- package/dist/commands/organisation.test.d.ts.map +1 -0
- package/dist/commands/organisation.test.js +116 -0
- package/dist/commands/organisation.test.js.map +1 -0
- package/dist/commands/organisationHierarchy.d.ts +8 -0
- package/dist/commands/organisationHierarchy.d.ts.map +1 -0
- package/dist/commands/organisationHierarchy.js +75 -0
- package/dist/commands/organisationHierarchy.js.map +1 -0
- package/dist/commands/organisationHierarchy.test.d.ts +2 -0
- package/dist/commands/organisationHierarchy.test.d.ts.map +1 -0
- package/dist/commands/organisationHierarchy.test.js +72 -0
- package/dist/commands/organisationHierarchy.test.js.map +1 -0
- package/dist/commands/organisationWrite.d.ts +18 -0
- package/dist/commands/organisationWrite.d.ts.map +1 -0
- package/dist/commands/organisationWrite.js +71 -0
- package/dist/commands/organisationWrite.js.map +1 -0
- package/dist/commands/orient.d.ts +75 -67
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +162 -21
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/outcome.d.ts +92 -0
- package/dist/commands/outcome.d.ts.map +1 -0
- package/dist/commands/outcome.js +206 -0
- package/dist/commands/outcome.js.map +1 -0
- package/dist/commands/outcome.test.d.ts +2 -0
- package/dist/commands/outcome.test.d.ts.map +1 -0
- package/dist/commands/outcome.test.js +324 -0
- package/dist/commands/outcome.test.js.map +1 -0
- package/dist/commands/people.d.ts +6 -0
- package/dist/commands/people.d.ts.map +1 -0
- package/dist/commands/people.js +22 -0
- package/dist/commands/people.js.map +1 -0
- package/dist/commands/people.test.d.ts +2 -0
- package/dist/commands/people.test.d.ts.map +1 -0
- package/dist/commands/people.test.js +61 -0
- package/dist/commands/people.test.js.map +1 -0
- package/dist/commands/profile.d.ts +24 -16
- package/dist/commands/profile.d.ts.map +1 -1
- package/dist/commands/profile.js +272 -98
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/proof-run.d.ts +51 -0
- package/dist/commands/proof-run.d.ts.map +1 -0
- package/dist/commands/proof-run.js +209 -0
- package/dist/commands/proof-run.js.map +1 -0
- package/dist/commands/quality.d.ts +21 -0
- package/dist/commands/quality.d.ts.map +1 -0
- package/dist/commands/quality.js +52 -0
- package/dist/commands/quality.js.map +1 -0
- package/dist/commands/questions.d.ts +23 -0
- package/dist/commands/questions.d.ts.map +1 -0
- package/dist/commands/questions.js +238 -0
- package/dist/commands/questions.js.map +1 -0
- package/dist/commands/questions.test.d.ts +2 -0
- package/dist/commands/questions.test.d.ts.map +1 -0
- package/dist/commands/questions.test.js +159 -0
- package/dist/commands/questions.test.js.map +1 -0
- package/dist/commands/relate.d.ts +1 -0
- package/dist/commands/relate.d.ts.map +1 -1
- package/dist/commands/relate.js +89 -15
- package/dist/commands/relate.js.map +1 -1
- package/dist/commands/restore.d.ts +2 -0
- package/dist/commands/restore.d.ts.map +1 -0
- package/dist/commands/restore.js +83 -0
- package/dist/commands/restore.js.map +1 -0
- package/dist/commands/rework.d.ts +24 -0
- package/dist/commands/rework.d.ts.map +1 -0
- package/dist/commands/rework.js +97 -0
- package/dist/commands/rework.js.map +1 -0
- package/dist/commands/role.d.ts +67 -0
- package/dist/commands/role.d.ts.map +1 -0
- package/dist/commands/role.js +164 -0
- package/dist/commands/role.js.map +1 -0
- package/dist/commands/role.test.d.ts +2 -0
- package/dist/commands/role.test.d.ts.map +1 -0
- package/dist/commands/role.test.js +290 -0
- package/dist/commands/role.test.js.map +1 -0
- package/dist/commands/scoreboard.d.ts +26 -0
- package/dist/commands/scoreboard.d.ts.map +1 -0
- package/dist/commands/scoreboard.js +40 -0
- package/dist/commands/scoreboard.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +7 -1
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts +61 -7
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +419 -80
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +102 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/status.test.d.ts +2 -0
- package/dist/commands/status.test.d.ts.map +1 -0
- package/dist/commands/status.test.js +75 -0
- package/dist/commands/status.test.js.map +1 -0
- package/dist/commands/stillTrue.d.ts +14 -0
- package/dist/commands/stillTrue.d.ts.map +1 -0
- package/dist/commands/stillTrue.js +48 -0
- package/dist/commands/stillTrue.js.map +1 -0
- package/dist/commands/tensionsList.d.ts +5 -0
- package/dist/commands/tensionsList.d.ts.map +1 -0
- package/dist/commands/tensionsList.js +27 -0
- package/dist/commands/tensionsList.js.map +1 -0
- package/dist/commands/update.d.ts +21 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +157 -42
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.d.ts +5 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +110 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/usage.d.ts.map +1 -1
- package/dist/commands/usage.js +0 -18
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +7 -1
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/welcome.d.ts.map +1 -1
- package/dist/commands/welcome.js +5 -2
- package/dist/commands/welcome.js.map +1 -1
- package/dist/commands/whoami.d.ts +20 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +126 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/whoami.test.d.ts +2 -0
- package/dist/commands/whoami.test.d.ts.map +1 -0
- package/dist/commands/whoami.test.js +130 -0
- package/dist/commands/whoami.test.js.map +1 -0
- package/dist/commands/workspace.d.ts +8 -75
- package/dist/commands/workspace.d.ts.map +1 -1
- package/dist/commands/workspace.js +10 -71
- package/dist/commands/workspace.js.map +1 -1
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.d.ts +2 -0
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.js +49 -0
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.js.map +1 -0
- package/dist/formatters/__tests__/orient-provenance.test.d.ts +6 -0
- package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/orient-provenance.test.js +319 -0
- package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
- package/dist/formatters/__tests__/orient-ruleLists.test.d.ts +2 -0
- package/dist/formatters/__tests__/orient-ruleLists.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/orient-ruleLists.test.js +93 -0
- package/dist/formatters/__tests__/orient-ruleLists.test.js.map +1 -0
- package/dist/formatters/__tests__/session-list-show.test.d.ts +2 -0
- package/dist/formatters/__tests__/session-list-show.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/session-list-show.test.js +195 -0
- package/dist/formatters/__tests__/session-list-show.test.js.map +1 -0
- package/dist/formatters/__tests__/session.test.d.ts +2 -0
- package/dist/formatters/__tests__/session.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/session.test.js +265 -0
- package/dist/formatters/__tests__/session.test.js.map +1 -0
- package/dist/formatters/__tests__/tensionsList.test.d.ts +2 -0
- package/dist/formatters/__tests__/tensionsList.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/tensionsList.test.js +30 -0
- package/dist/formatters/__tests__/tensionsList.test.js.map +1 -0
- package/dist/formatters/brief.d.ts +6 -15
- package/dist/formatters/brief.d.ts.map +1 -1
- package/dist/formatters/brief.js +16 -14
- package/dist/formatters/brief.js.map +1 -1
- package/dist/formatters/brief.test.d.ts +2 -0
- package/dist/formatters/brief.test.d.ts.map +1 -0
- package/dist/formatters/brief.test.js +21 -0
- package/dist/formatters/brief.test.js.map +1 -0
- package/dist/formatters/capture.d.ts +17 -10
- package/dist/formatters/capture.d.ts.map +1 -1
- package/dist/formatters/capture.js +33 -10
- package/dist/formatters/capture.js.map +1 -1
- package/dist/formatters/coaching.d.ts +60 -0
- package/dist/formatters/coaching.d.ts.map +1 -0
- package/dist/formatters/coaching.js +51 -0
- package/dist/formatters/coaching.js.map +1 -0
- package/dist/formatters/collections.d.ts +0 -1
- package/dist/formatters/collections.d.ts.map +1 -1
- package/dist/formatters/collections.js +14 -5
- package/dist/formatters/collections.js.map +1 -1
- package/dist/formatters/conflicts.d.ts +69 -0
- package/dist/formatters/conflicts.d.ts.map +1 -0
- package/dist/formatters/conflicts.js +87 -0
- package/dist/formatters/conflicts.js.map +1 -0
- package/dist/formatters/conflicts.test.d.ts +2 -0
- package/dist/formatters/conflicts.test.d.ts.map +1 -0
- package/dist/formatters/conflicts.test.js +136 -0
- package/dist/formatters/conflicts.test.js.map +1 -0
- package/dist/formatters/context.d.ts +1 -1
- package/dist/formatters/context.d.ts.map +1 -1
- package/dist/formatters/context.js.map +1 -1
- package/dist/formatters/digest.d.ts +13 -0
- package/dist/formatters/digest.d.ts.map +1 -0
- package/dist/formatters/digest.js +98 -0
- package/dist/formatters/digest.js.map +1 -0
- package/dist/formatters/digest.test.d.ts +2 -0
- package/dist/formatters/digest.test.d.ts.map +1 -0
- package/dist/formatters/digest.test.js +166 -0
- package/dist/formatters/digest.test.js.map +1 -0
- package/dist/formatters/direction.d.ts +48 -0
- package/dist/formatters/direction.d.ts.map +1 -0
- package/dist/formatters/direction.js +75 -0
- package/dist/formatters/direction.js.map +1 -0
- package/dist/formatters/direction.test.d.ts +2 -0
- package/dist/formatters/direction.test.d.ts.map +1 -0
- package/dist/formatters/direction.test.js +70 -0
- package/dist/formatters/direction.test.js.map +1 -0
- package/dist/formatters/entry.d.ts +65 -1
- package/dist/formatters/entry.d.ts.map +1 -1
- package/dist/formatters/entry.js +102 -11
- package/dist/formatters/entry.js.map +1 -1
- package/dist/formatters/entryAccept.d.ts +79 -0
- package/dist/formatters/entryAccept.d.ts.map +1 -0
- package/dist/formatters/entryAccept.js +78 -0
- package/dist/formatters/entryAccept.js.map +1 -0
- package/dist/formatters/feedback.d.ts +58 -0
- package/dist/formatters/feedback.d.ts.map +1 -0
- package/dist/formatters/feedback.js +91 -0
- package/dist/formatters/feedback.js.map +1 -0
- package/dist/formatters/feedback.test.d.ts +2 -0
- package/dist/formatters/feedback.test.d.ts.map +1 -0
- package/dist/formatters/feedback.test.js +123 -0
- package/dist/formatters/feedback.test.js.map +1 -0
- package/dist/formatters/fields.d.ts +7 -1
- package/dist/formatters/fields.d.ts.map +1 -1
- package/dist/formatters/fields.js +9 -3
- package/dist/formatters/fields.js.map +1 -1
- package/dist/formatters/fields.test.d.ts +2 -0
- package/dist/formatters/fields.test.d.ts.map +1 -0
- package/dist/formatters/fields.test.js +42 -0
- package/dist/formatters/fields.test.js.map +1 -0
- package/dist/formatters/handshake.d.ts +43 -9
- package/dist/formatters/handshake.d.ts.map +1 -1
- package/dist/formatters/handshake.js +83 -29
- package/dist/formatters/handshake.js.map +1 -1
- package/dist/formatters/orient.coherencyCheckTag.test.d.ts +2 -0
- package/dist/formatters/orient.coherencyCheckTag.test.d.ts.map +1 -0
- package/dist/formatters/orient.coherencyCheckTag.test.js +22 -0
- package/dist/formatters/orient.coherencyCheckTag.test.js.map +1 -0
- package/dist/formatters/orient.d.ts +121 -97
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +198 -135
- package/dist/formatters/orient.js.map +1 -1
- package/dist/formatters/orient.rcrtMiss.test.d.ts +2 -0
- package/dist/formatters/orient.rcrtMiss.test.d.ts.map +1 -0
- package/dist/formatters/orient.rcrtMiss.test.js +77 -0
- package/dist/formatters/orient.rcrtMiss.test.js.map +1 -0
- package/dist/formatters/orient.rituals.test.d.ts +2 -0
- package/dist/formatters/orient.rituals.test.d.ts.map +1 -0
- package/dist/formatters/orient.rituals.test.js +72 -0
- package/dist/formatters/orient.rituals.test.js.map +1 -0
- package/dist/formatters/orientDegradation.d.ts +38 -0
- package/dist/formatters/orientDegradation.d.ts.map +1 -0
- package/dist/formatters/orientDegradation.js +50 -0
- package/dist/formatters/orientDegradation.js.map +1 -0
- package/dist/formatters/orientDegradation.test.d.ts +2 -0
- package/dist/formatters/orientDegradation.test.d.ts.map +1 -0
- package/dist/formatters/orientDegradation.test.js +28 -0
- package/dist/formatters/orientDegradation.test.js.map +1 -0
- package/dist/formatters/orientDirection.d.ts +25 -0
- package/dist/formatters/orientDirection.d.ts.map +1 -0
- package/dist/formatters/orientDirection.js +7 -0
- package/dist/formatters/orientDirection.js.map +1 -0
- package/dist/formatters/orientDirection.test.d.ts +2 -0
- package/dist/formatters/orientDirection.test.d.ts.map +1 -0
- package/dist/formatters/orientDirection.test.js +48 -0
- package/dist/formatters/orientDirection.test.js.map +1 -0
- package/dist/formatters/orientRetrievalMiss.d.ts +22 -0
- package/dist/formatters/orientRetrievalMiss.d.ts.map +1 -0
- package/dist/formatters/orientRetrievalMiss.js +17 -0
- package/dist/formatters/orientRetrievalMiss.js.map +1 -0
- package/dist/formatters/plannedWorkCounts.d.ts +19 -0
- package/dist/formatters/plannedWorkCounts.d.ts.map +1 -0
- package/dist/formatters/plannedWorkCounts.js +17 -0
- package/dist/formatters/plannedWorkCounts.js.map +1 -0
- package/dist/formatters/qualityChecks.d.ts +8 -0
- package/dist/formatters/qualityChecks.d.ts.map +1 -0
- package/dist/formatters/qualityChecks.js +19 -0
- package/dist/formatters/qualityChecks.js.map +1 -0
- package/dist/formatters/questions.d.ts +72 -0
- package/dist/formatters/questions.d.ts.map +1 -0
- package/dist/formatters/questions.js +116 -0
- package/dist/formatters/questions.js.map +1 -0
- package/dist/formatters/questions.test.d.ts +2 -0
- package/dist/formatters/questions.test.d.ts.map +1 -0
- package/dist/formatters/questions.test.js +144 -0
- package/dist/formatters/questions.test.js.map +1 -0
- package/dist/formatters/relate.d.ts +13 -2
- package/dist/formatters/relate.d.ts.map +1 -1
- package/dist/formatters/relate.js +15 -5
- package/dist/formatters/relate.js.map +1 -1
- package/dist/formatters/relate.test.d.ts +2 -0
- package/dist/formatters/relate.test.d.ts.map +1 -0
- package/dist/formatters/relate.test.js +91 -0
- package/dist/formatters/relate.test.js.map +1 -0
- package/dist/formatters/scoreboard.d.ts +11 -0
- package/dist/formatters/scoreboard.d.ts.map +1 -0
- package/dist/formatters/scoreboard.js +162 -0
- package/dist/formatters/scoreboard.js.map +1 -0
- package/dist/formatters/scoreboard.test.d.ts +2 -0
- package/dist/formatters/scoreboard.test.d.ts.map +1 -0
- package/dist/formatters/scoreboard.test.js +301 -0
- package/dist/formatters/scoreboard.test.js.map +1 -0
- package/dist/formatters/search.d.ts +3 -0
- package/dist/formatters/search.d.ts.map +1 -1
- package/dist/formatters/search.js +15 -1
- package/dist/formatters/search.js.map +1 -1
- package/dist/formatters/search.test.d.ts +2 -0
- package/dist/formatters/search.test.d.ts.map +1 -0
- package/dist/formatters/search.test.js +76 -0
- package/dist/formatters/search.test.js.map +1 -0
- package/dist/formatters/session-feedback.test.d.ts +2 -0
- package/dist/formatters/session-feedback.test.d.ts.map +1 -0
- package/dist/formatters/session-feedback.test.js +118 -0
- package/dist/formatters/session-feedback.test.js.map +1 -0
- package/dist/formatters/session.d.ts +123 -5
- package/dist/formatters/session.d.ts.map +1 -1
- package/dist/formatters/session.js +333 -21
- package/dist/formatters/session.js.map +1 -1
- package/dist/formatters/spineCheck.d.ts +14 -0
- package/dist/formatters/spineCheck.d.ts.map +1 -0
- package/dist/formatters/spineCheck.js +113 -0
- package/dist/formatters/spineCheck.js.map +1 -0
- package/dist/formatters/spineCheck.test.d.ts +2 -0
- package/dist/formatters/spineCheck.test.d.ts.map +1 -0
- package/dist/formatters/spineCheck.test.js +76 -0
- package/dist/formatters/spineCheck.test.js.map +1 -0
- package/dist/formatters/tensionsList.d.ts +17 -0
- package/dist/formatters/tensionsList.d.ts.map +1 -0
- package/dist/formatters/tensionsList.js +33 -0
- package/dist/formatters/tensionsList.js.map +1 -0
- package/dist/formatters/update.d.ts +22 -0
- package/dist/formatters/update.d.ts.map +1 -1
- package/dist/formatters/update.js +36 -7
- package/dist/formatters/update.js.map +1 -1
- package/dist/formatters/update.test.d.ts +2 -0
- package/dist/formatters/update.test.d.ts.map +1 -0
- package/dist/formatters/update.test.js +59 -0
- package/dist/formatters/update.test.js.map +1 -0
- package/dist/formatters/verify.d.ts +12 -4
- package/dist/formatters/verify.d.ts.map +1 -1
- package/dist/formatters/verify.js +20 -2
- package/dist/formatters/verify.js.map +1 -1
- package/dist/generated/healthGapKinds.generated.d.ts +12 -0
- package/dist/generated/healthGapKinds.generated.d.ts.map +1 -0
- package/dist/generated/healthGapKinds.generated.js +16 -0
- package/dist/generated/healthGapKinds.generated.js.map +1 -0
- package/dist/generated/organisationalAuthorityRefusalCodes.generated.d.ts +12 -0
- package/dist/generated/organisationalAuthorityRefusalCodes.generated.d.ts.map +1 -0
- package/dist/generated/organisationalAuthorityRefusalCodes.generated.js +11 -0
- package/dist/generated/organisationalAuthorityRefusalCodes.generated.js.map +1 -0
- package/dist/generated/relationTypes.generated.d.ts +12 -0
- package/dist/generated/relationTypes.generated.d.ts.map +1 -0
- package/dist/generated/relationTypes.generated.js +11 -0
- package/dist/generated/relationTypes.generated.js.map +1 -0
- package/dist/generated/routeLatencyBudget.generated.d.ts +55 -0
- package/dist/generated/routeLatencyBudget.generated.d.ts.map +1 -0
- package/dist/generated/routeLatencyBudget.generated.js +268 -0
- package/dist/generated/routeLatencyBudget.generated.js.map +1 -0
- package/dist/generated/sourceSurfaces.generated.d.ts +12 -0
- package/dist/generated/sourceSurfaces.generated.d.ts.map +1 -0
- package/dist/generated/sourceSurfaces.generated.js +11 -0
- package/dist/generated/sourceSurfaces.generated.js.map +1 -0
- package/dist/generators/adapters.d.ts +39 -6
- package/dist/generators/adapters.d.ts.map +1 -1
- package/dist/generators/adapters.js +88 -89
- package/dist/generators/adapters.js.map +1 -1
- package/dist/generators/adapters.test.js +14 -6
- package/dist/generators/adapters.test.js.map +1 -1
- package/dist/generators/boundary-manifest.real-file.test.d.ts +2 -0
- package/dist/generators/boundary-manifest.real-file.test.d.ts.map +1 -0
- package/dist/generators/boundary-manifest.real-file.test.js +70 -0
- package/dist/generators/boundary-manifest.real-file.test.js.map +1 -0
- package/dist/generators/briefing-projections.test.d.ts +2 -0
- package/dist/generators/briefing-projections.test.d.ts.map +1 -0
- package/dist/generators/briefing-projections.test.js +98 -0
- package/dist/generators/briefing-projections.test.js.map +1 -0
- package/dist/generators/context-md.d.ts +7 -2
- package/dist/generators/context-md.d.ts.map +1 -1
- package/dist/generators/context-md.js +18 -57
- package/dist/generators/context-md.js.map +1 -1
- package/dist/generators/everyone-rules-md.d.ts +9 -0
- package/dist/generators/everyone-rules-md.d.ts.map +1 -0
- package/dist/generators/everyone-rules-md.js +21 -0
- package/dist/generators/everyone-rules-md.js.map +1 -0
- package/dist/generators/manifest.d.ts +76 -0
- package/dist/generators/manifest.d.ts.map +1 -1
- package/dist/generators/manifest.js +125 -14
- package/dist/generators/manifest.js.map +1 -1
- package/dist/generators/noProjectionAssets.d.ts +15 -0
- package/dist/generators/noProjectionAssets.d.ts.map +1 -0
- package/dist/generators/noProjectionAssets.js +6 -0
- package/dist/generators/noProjectionAssets.js.map +1 -0
- package/dist/generators/portable-knowledge.d.ts +15 -38
- package/dist/generators/portable-knowledge.d.ts.map +1 -1
- package/dist/generators/portable-knowledge.js +13 -144
- package/dist/generators/portable-knowledge.js.map +1 -1
- package/dist/generators/portable-knowledge.test.js +82 -267
- package/dist/generators/portable-knowledge.test.js.map +1 -1
- package/dist/generators/region-projections.d.ts +17 -0
- package/dist/generators/region-projections.d.ts.map +1 -0
- package/dist/generators/region-projections.js +51 -0
- package/dist/generators/region-projections.js.map +1 -0
- package/dist/generators/region-projections.test.d.ts +2 -0
- package/dist/generators/region-projections.test.d.ts.map +1 -0
- package/dist/generators/region-projections.test.js +58 -0
- package/dist/generators/region-projections.test.js.map +1 -0
- package/dist/generators/region.d.ts +24 -0
- package/dist/generators/region.d.ts.map +1 -0
- package/dist/generators/region.js +87 -0
- package/dist/generators/region.js.map +1 -0
- package/dist/generators/region.test.d.ts +2 -0
- package/dist/generators/region.test.d.ts.map +1 -0
- package/dist/generators/region.test.js +126 -0
- package/dist/generators/region.test.js.map +1 -0
- package/dist/generators/retired-projections.d.ts +12 -0
- package/dist/generators/retired-projections.d.ts.map +1 -0
- package/dist/generators/retired-projections.js +75 -0
- package/dist/generators/retired-projections.js.map +1 -0
- package/dist/generators/retired-projections.test.d.ts +2 -0
- package/dist/generators/retired-projections.test.d.ts.map +1 -0
- package/dist/generators/retired-projections.test.js +64 -0
- package/dist/generators/retired-projections.test.js.map +1 -0
- package/dist/generators/surface-profiles.d.ts +1 -2
- package/dist/generators/surface-profiles.d.ts.map +1 -1
- package/dist/generators/surface-profiles.js.map +1 -1
- package/dist/handleCliError.d.ts +2 -0
- package/dist/handleCliError.d.ts.map +1 -0
- package/dist/handleCliError.js +56 -0
- package/dist/handleCliError.js.map +1 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +212 -475
- package/dist/index.js.map +1 -1
- package/dist/lib/__tests__/legalRelationTypes.test.d.ts +2 -0
- package/dist/lib/__tests__/legalRelationTypes.test.d.ts.map +1 -0
- package/dist/lib/__tests__/legalRelationTypes.test.js +61 -0
- package/dist/lib/__tests__/legalRelationTypes.test.js.map +1 -0
- package/dist/lib/__tests__/parseFields.test.d.ts +2 -0
- package/dist/lib/__tests__/parseFields.test.d.ts.map +1 -0
- package/dist/lib/__tests__/parseFields.test.js +40 -0
- package/dist/lib/__tests__/parseFields.test.js.map +1 -0
- package/dist/lib/adminConfig.d.ts +48 -0
- package/dist/lib/adminConfig.d.ts.map +1 -0
- package/dist/lib/adminConfig.js +130 -0
- package/dist/lib/adminConfig.js.map +1 -0
- package/dist/lib/canonicalRefs.d.ts +96 -5
- package/dist/lib/canonicalRefs.d.ts.map +1 -1
- package/dist/lib/canonicalRefs.js +89 -3
- package/dist/lib/canonicalRefs.js.map +1 -1
- package/dist/lib/captureGrounding.d.ts +48 -0
- package/dist/lib/captureGrounding.d.ts.map +1 -0
- package/dist/lib/captureGrounding.js +54 -0
- package/dist/lib/captureGrounding.js.map +1 -0
- package/dist/lib/captureGrounding.test.d.ts +2 -0
- package/dist/lib/captureGrounding.test.d.ts.map +1 -0
- package/dist/lib/captureGrounding.test.js +74 -0
- package/dist/lib/captureGrounding.test.js.map +1 -0
- package/dist/lib/captureLink.d.ts +26 -0
- package/dist/lib/captureLink.d.ts.map +1 -0
- package/dist/lib/captureLink.js +110 -0
- package/dist/lib/captureLink.js.map +1 -0
- package/dist/lib/checklist.d.ts +32 -0
- package/dist/lib/checklist.d.ts.map +1 -0
- package/dist/lib/checklist.js +77 -0
- package/dist/lib/checklist.js.map +1 -0
- package/dist/lib/client.d.ts +32 -19
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +214 -60
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/collectionRegistry.d.ts +40 -5
- package/dist/lib/collectionRegistry.d.ts.map +1 -1
- package/dist/lib/collectionRegistry.js +71 -48
- package/dist/lib/collectionRegistry.js.map +1 -1
- package/dist/lib/commanderOptions.d.ts +8 -0
- package/dist/lib/commanderOptions.d.ts.map +1 -0
- package/dist/lib/commanderOptions.js +10 -0
- package/dist/lib/commanderOptions.js.map +1 -0
- package/dist/lib/compose-wrapup-view.d.ts +56 -0
- package/dist/lib/compose-wrapup-view.d.ts.map +1 -0
- package/dist/lib/compose-wrapup-view.js +39 -0
- package/dist/lib/compose-wrapup-view.js.map +1 -0
- package/dist/lib/config.d.ts +97 -68
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +213 -205
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/configResult.d.ts +102 -0
- package/dist/lib/configResult.d.ts.map +1 -0
- package/dist/lib/configResult.js +179 -0
- package/dist/lib/configResult.js.map +1 -0
- package/dist/lib/connectProfileName.d.ts +36 -0
- package/dist/lib/connectProfileName.d.ts.map +1 -0
- package/dist/lib/connectProfileName.js +72 -0
- package/dist/lib/connectProfileName.js.map +1 -0
- package/dist/lib/connectProfileName.test.d.ts +2 -0
- package/dist/lib/connectProfileName.test.d.ts.map +1 -0
- package/dist/lib/connectProfileName.test.js +100 -0
- package/dist/lib/connectProfileName.test.js.map +1 -0
- package/dist/lib/constants.d.ts +5 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +8 -1
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/conversation.d.ts +36 -0
- package/dist/lib/conversation.d.ts.map +1 -0
- package/dist/lib/conversation.js +66 -0
- package/dist/lib/conversation.js.map +1 -0
- package/dist/lib/createEntryResult.d.ts +34 -0
- package/dist/lib/createEntryResult.d.ts.map +1 -0
- package/dist/lib/createEntryResult.js +12 -0
- package/dist/lib/createEntryResult.js.map +1 -0
- package/dist/lib/deployment.js +2 -2
- package/dist/lib/deployment.js.map +1 -1
- package/dist/lib/deployment.test.js +20 -1
- package/dist/lib/deployment.test.js.map +1 -1
- package/dist/lib/envKeySnapshot.d.ts +10 -0
- package/dist/lib/envKeySnapshot.d.ts.map +1 -0
- package/dist/lib/envKeySnapshot.js +30 -0
- package/dist/lib/envKeySnapshot.js.map +1 -0
- package/dist/lib/errors.d.ts +91 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +84 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/frontmatter.d.ts +55 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +92 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/frontmatter.test.d.ts +15 -0
- package/dist/lib/frontmatter.test.d.ts.map +1 -0
- package/dist/lib/frontmatter.test.js +98 -0
- package/dist/lib/frontmatter.test.js.map +1 -0
- package/dist/lib/gatewayTimeout.d.ts +88 -0
- package/dist/lib/gatewayTimeout.d.ts.map +1 -0
- package/dist/lib/gatewayTimeout.js +118 -0
- package/dist/lib/gatewayTimeout.js.map +1 -0
- package/dist/lib/gitEnvLeakKeysParity.test.d.ts +2 -0
- package/dist/lib/gitEnvLeakKeysParity.test.d.ts.map +1 -0
- package/dist/lib/gitEnvLeakKeysParity.test.js +73 -0
- package/dist/lib/gitEnvLeakKeysParity.test.js.map +1 -0
- package/dist/lib/glossary.js +1 -1
- package/dist/lib/glossary.js.map +1 -1
- package/dist/lib/hook-intents.d.ts +9 -4
- package/dist/lib/hook-intents.d.ts.map +1 -1
- package/dist/lib/hook-intents.js +10 -11
- package/dist/lib/hook-intents.js.map +1 -1
- package/dist/lib/judgeWait.d.ts +50 -0
- package/dist/lib/judgeWait.d.ts.map +1 -0
- package/dist/lib/judgeWait.js +64 -0
- package/dist/lib/judgeWait.js.map +1 -0
- package/dist/lib/kernelEnvelope.d.ts +42 -0
- package/dist/lib/kernelEnvelope.d.ts.map +1 -0
- package/dist/lib/kernelEnvelope.js +67 -0
- package/dist/lib/kernelEnvelope.js.map +1 -0
- package/dist/lib/legalRelationTypes.d.ts +19 -0
- package/dist/lib/legalRelationTypes.d.ts.map +1 -0
- package/dist/lib/legalRelationTypes.js +64 -0
- package/dist/lib/legalRelationTypes.js.map +1 -0
- package/dist/lib/localBinding.d.ts +86 -0
- package/dist/lib/localBinding.d.ts.map +1 -0
- package/dist/lib/localBinding.js +173 -0
- package/dist/lib/localBinding.js.map +1 -0
- package/dist/lib/method-registry.d.ts +16 -11
- package/dist/lib/method-registry.d.ts.map +1 -1
- package/dist/lib/method-registry.js +13 -25
- package/dist/lib/method-registry.js.map +1 -1
- package/dist/lib/normalizeMaterializedFilename.d.ts +3 -3
- package/dist/lib/normalizeMaterializedFilename.js +3 -3
- package/dist/lib/notice-marker.d.ts +3 -0
- package/dist/lib/notice-marker.d.ts.map +1 -0
- package/dist/lib/notice-marker.js +223 -0
- package/dist/lib/notice-marker.js.map +1 -0
- package/dist/lib/outcomeObjectiveLines.d.ts +30 -0
- package/dist/lib/outcomeObjectiveLines.d.ts.map +1 -0
- package/dist/lib/outcomeObjectiveLines.js +29 -0
- package/dist/lib/outcomeObjectiveLines.js.map +1 -0
- package/dist/lib/ownerLine.d.ts +91 -0
- package/dist/lib/ownerLine.d.ts.map +1 -0
- package/dist/lib/ownerLine.js +78 -0
- package/dist/lib/ownerLine.js.map +1 -0
- package/dist/lib/parseFields.d.ts +19 -0
- package/dist/lib/parseFields.d.ts.map +1 -0
- package/dist/lib/parseFields.js +49 -0
- package/dist/lib/parseFields.js.map +1 -0
- package/dist/lib/pinnedRole.d.ts +28 -0
- package/dist/lib/pinnedRole.d.ts.map +1 -0
- package/dist/lib/pinnedRole.js +106 -0
- package/dist/lib/pinnedRole.js.map +1 -0
- package/dist/lib/platformGlossary.d.ts +22 -0
- package/dist/lib/platformGlossary.d.ts.map +1 -0
- package/dist/lib/platformGlossary.js +34 -0
- package/dist/lib/platformGlossary.js.map +1 -0
- package/dist/lib/previewBanner.d.ts +9 -0
- package/dist/lib/previewBanner.d.ts.map +1 -0
- package/dist/lib/previewBanner.js +37 -0
- package/dist/lib/previewBanner.js.map +1 -0
- package/dist/lib/productbrain-files.d.ts +108 -0
- package/dist/lib/productbrain-files.d.ts.map +1 -0
- package/dist/lib/productbrain-files.js +240 -0
- package/dist/lib/productbrain-files.js.map +1 -0
- package/dist/lib/productbrain-files.test.d.ts +2 -0
- package/dist/lib/productbrain-files.test.d.ts.map +1 -0
- package/dist/lib/productbrain-files.test.js +518 -0
- package/dist/lib/productbrain-files.test.js.map +1 -0
- package/dist/lib/profiles.d.ts +55 -5
- package/dist/lib/profiles.d.ts.map +1 -1
- package/dist/lib/profiles.js +81 -27
- package/dist/lib/profiles.js.map +1 -1
- package/dist/lib/projectConfig.d.ts +121 -0
- package/dist/lib/projectConfig.d.ts.map +1 -0
- package/dist/lib/projectConfig.js +226 -0
- package/dist/lib/projectConfig.js.map +1 -0
- package/dist/lib/prompts.d.ts +2 -0
- package/dist/lib/prompts.d.ts.map +1 -1
- package/dist/lib/prompts.js +2 -0
- package/dist/lib/prompts.js.map +1 -1
- package/dist/lib/proseBody.d.ts +14 -0
- package/dist/lib/proseBody.d.ts.map +1 -0
- package/dist/lib/proseBody.js +25 -0
- package/dist/lib/proseBody.js.map +1 -0
- package/dist/lib/rate-limit.d.ts +38 -0
- package/dist/lib/rate-limit.d.ts.map +1 -0
- package/dist/lib/rate-limit.js +83 -0
- package/dist/lib/rate-limit.js.map +1 -0
- package/dist/lib/readinessNotices.d.ts +12 -0
- package/dist/lib/readinessNotices.d.ts.map +1 -0
- package/dist/lib/readinessNotices.js +15 -0
- package/dist/lib/readinessNotices.js.map +1 -0
- package/dist/lib/repo-detect.d.ts +8 -2
- package/dist/lib/repo-detect.d.ts.map +1 -1
- package/dist/lib/repo-detect.js +11 -6
- package/dist/lib/repo-detect.js.map +1 -1
- package/dist/lib/reportedProfile.d.ts +18 -0
- package/dist/lib/reportedProfile.d.ts.map +1 -0
- package/dist/lib/reportedProfile.js +144 -0
- package/dist/lib/reportedProfile.js.map +1 -0
- package/dist/lib/ruleListRender.d.ts +253 -0
- package/dist/lib/ruleListRender.d.ts.map +1 -0
- package/dist/lib/ruleListRender.js +335 -0
- package/dist/lib/ruleListRender.js.map +1 -0
- package/dist/lib/runner.d.ts +9 -1
- package/dist/lib/runner.d.ts.map +1 -1
- package/dist/lib/runner.js +30 -4
- package/dist/lib/runner.js.map +1 -1
- package/dist/lib/seatSentence.d.ts +42 -0
- package/dist/lib/seatSentence.d.ts.map +1 -0
- package/dist/lib/seatSentence.js +25 -0
- package/dist/lib/seatSentence.js.map +1 -0
- package/dist/lib/session.d.ts +90 -6
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/lib/session.js +261 -17
- package/dist/lib/session.js.map +1 -1
- package/dist/lib/sessionBinding.d.ts +61 -0
- package/dist/lib/sessionBinding.d.ts.map +1 -0
- package/dist/lib/sessionBinding.js +125 -0
- package/dist/lib/sessionBinding.js.map +1 -0
- package/dist/lib/sessionNotices.d.ts +54 -0
- package/dist/lib/sessionNotices.d.ts.map +1 -0
- package/dist/lib/sessionNotices.js +130 -0
- package/dist/lib/sessionNotices.js.map +1 -0
- package/dist/lib/sessionNotices.test.d.ts +2 -0
- package/dist/lib/sessionNotices.test.d.ts.map +1 -0
- package/dist/lib/sessionNotices.test.js +55 -0
- package/dist/lib/sessionNotices.test.js.map +1 -0
- package/dist/lib/spineVerdictRead.d.ts +70 -0
- package/dist/lib/spineVerdictRead.d.ts.map +1 -0
- package/dist/lib/spineVerdictRead.js +73 -0
- package/dist/lib/spineVerdictRead.js.map +1 -0
- package/dist/lib/spinner.js +2 -2
- package/dist/lib/spinner.js.map +1 -1
- package/dist/lib/startup-resolution-signals.d.ts +34 -0
- package/dist/lib/startup-resolution-signals.d.ts.map +1 -0
- package/dist/lib/startup-resolution-signals.js +116 -0
- package/dist/lib/startup-resolution-signals.js.map +1 -0
- package/dist/lib/startup-resolution-signals.test.d.ts +2 -0
- package/dist/lib/startup-resolution-signals.test.d.ts.map +1 -0
- package/dist/lib/startup-resolution-signals.test.js +113 -0
- package/dist/lib/startup-resolution-signals.test.js.map +1 -0
- package/dist/lib/startup-signals.d.ts +12 -0
- package/dist/lib/startup-signals.d.ts.map +1 -0
- package/dist/lib/startup-signals.js +179 -0
- package/dist/lib/startup-signals.js.map +1 -0
- package/dist/lib/startup-signals.test.d.ts +2 -0
- package/dist/lib/startup-signals.test.d.ts.map +1 -0
- package/dist/lib/startup-signals.test.js +165 -0
- package/dist/lib/startup-signals.test.js.map +1 -0
- package/dist/lib/state.d.ts +11 -2
- package/dist/lib/state.d.ts.map +1 -1
- package/dist/lib/state.js +11 -4
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/statusCategories.d.ts +160 -0
- package/dist/lib/statusCategories.d.ts.map +1 -0
- package/dist/lib/statusCategories.js +284 -0
- package/dist/lib/statusCategories.js.map +1 -0
- package/dist/lib/strip.d.ts +17 -0
- package/dist/lib/strip.d.ts.map +1 -1
- package/dist/lib/strip.js +48 -1
- package/dist/lib/strip.js.map +1 -1
- package/dist/lib/style.d.ts +8 -2
- package/dist/lib/style.d.ts.map +1 -1
- package/dist/lib/style.js +24 -17
- package/dist/lib/style.js.map +1 -1
- package/dist/lib/tokenConstants.d.ts +2 -0
- package/dist/lib/tokenConstants.d.ts.map +1 -1
- package/dist/lib/tokenConstants.js +2 -0
- package/dist/lib/tokenConstants.js.map +1 -1
- package/dist/lib/update-check.d.ts +42 -7
- package/dist/lib/update-check.d.ts.map +1 -1
- package/dist/lib/update-check.js +213 -62
- package/dist/lib/update-check.js.map +1 -1
- package/dist/lib/upgrade-runner.d.ts +22 -0
- package/dist/lib/upgrade-runner.d.ts.map +1 -0
- package/dist/lib/upgrade-runner.js +110 -0
- package/dist/lib/upgrade-runner.js.map +1 -0
- package/dist/lib/workspaceNotice.d.ts +202 -0
- package/dist/lib/workspaceNotice.d.ts.map +1 -0
- package/dist/lib/workspaceNotice.js +345 -0
- package/dist/lib/workspaceNotice.js.map +1 -0
- package/dist/lib/workspaceVocabCache.d.ts +60 -0
- package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
- package/dist/lib/workspaceVocabCache.js +98 -0
- package/dist/lib/workspaceVocabCache.js.map +1 -0
- package/dist/lib/writePerimeter.d.ts +72 -0
- package/dist/lib/writePerimeter.d.ts.map +1 -0
- package/dist/lib/writePerimeter.js +128 -0
- package/dist/lib/writePerimeter.js.map +1 -0
- package/dist/registerEntryCommands.d.ts +18 -0
- package/dist/registerEntryCommands.d.ts.map +1 -0
- package/dist/registerEntryCommands.js +123 -0
- package/dist/registerEntryCommands.js.map +1 -0
- package/dist/registerHistoryCommand.d.ts +8 -0
- package/dist/registerHistoryCommand.d.ts.map +1 -0
- package/dist/registerHistoryCommand.js +14 -0
- package/dist/registerHistoryCommand.js.map +1 -0
- package/dist/registerOutcomeCommands.d.ts +27 -0
- package/dist/registerOutcomeCommands.d.ts.map +1 -0
- package/dist/registerOutcomeCommands.js +27 -0
- package/dist/registerOutcomeCommands.js.map +1 -0
- package/dist/registerRoleCommands.d.ts +11 -0
- package/dist/registerRoleCommands.d.ts.map +1 -0
- package/dist/registerRoleCommands.js +38 -0
- package/dist/registerRoleCommands.js.map +1 -0
- package/dist/registerTensionsCommands.d.ts +10 -0
- package/dist/registerTensionsCommands.d.ts.map +1 -0
- package/dist/registerTensionsCommands.js +15 -0
- package/dist/registerTensionsCommands.js.map +1 -0
- package/dist/scoreboard/diagnose.d.ts +190 -0
- package/dist/scoreboard/diagnose.d.ts.map +1 -0
- package/dist/scoreboard/diagnose.js +282 -0
- package/dist/scoreboard/diagnose.js.map +1 -0
- package/dist/scoreboard/diagnose.test.d.ts +15 -0
- package/dist/scoreboard/diagnose.test.d.ts.map +1 -0
- package/dist/scoreboard/diagnose.test.js +288 -0
- package/dist/scoreboard/diagnose.test.js.map +1 -0
- package/dist/scoreboard/floors.d.ts +47 -0
- package/dist/scoreboard/floors.d.ts.map +1 -0
- package/dist/scoreboard/floors.js +33 -0
- package/dist/scoreboard/floors.js.map +1 -0
- package/dist/scoreboard/localDrift.d.ts +23 -0
- package/dist/scoreboard/localDrift.d.ts.map +1 -0
- package/dist/scoreboard/localDrift.js +111 -0
- package/dist/scoreboard/localDrift.js.map +1 -0
- package/dist/scoreboard/localDrift.test.d.ts +9 -0
- package/dist/scoreboard/localDrift.test.d.ts.map +1 -0
- package/dist/scoreboard/localDrift.test.js +82 -0
- package/dist/scoreboard/localDrift.test.js.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.js +86 -0
- package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
- package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.d.ts +2 -0
- package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.js +179 -0
- package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.js.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.js +55 -0
- package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
- package/dist/surfaces/adapter.d.ts +70 -0
- package/dist/surfaces/adapter.d.ts.map +1 -0
- package/dist/surfaces/adapter.js +2 -0
- package/dist/surfaces/adapter.js.map +1 -0
- package/dist/surfaces/adapters/claude.d.ts +3 -0
- package/dist/surfaces/adapters/claude.d.ts.map +1 -0
- package/dist/surfaces/adapters/claude.js +72 -0
- package/dist/surfaces/adapters/claude.js.map +1 -0
- package/dist/surfaces/adapters/codex.d.ts +3 -0
- package/dist/surfaces/adapters/codex.d.ts.map +1 -0
- package/dist/surfaces/adapters/codex.js +61 -0
- package/dist/surfaces/adapters/codex.js.map +1 -0
- package/dist/surfaces/adapters/copilot.d.ts +3 -0
- package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
- package/dist/surfaces/adapters/copilot.js +59 -0
- package/dist/surfaces/adapters/copilot.js.map +1 -0
- package/dist/surfaces/adapters/cursor.d.ts +3 -0
- package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
- package/dist/surfaces/adapters/cursor.js +78 -0
- package/dist/surfaces/adapters/cursor.js.map +1 -0
- package/dist/surfaces/registry.d.ts +58 -2
- package/dist/surfaces/registry.d.ts.map +1 -1
- package/dist/surfaces/registry.js +83 -8
- package/dist/surfaces/registry.js.map +1 -1
- package/dist/surfaces/telemetry.d.ts +17 -0
- package/dist/surfaces/telemetry.d.ts.map +1 -0
- package/dist/surfaces/telemetry.js +31 -0
- package/dist/surfaces/telemetry.js.map +1 -0
- package/package.json +9 -5
- package/dist/__tests__/audit.test.d.ts +0 -2
- package/dist/__tests__/audit.test.d.ts.map +0 -1
- package/dist/__tests__/audit.test.js +0 -394
- package/dist/__tests__/audit.test.js.map +0 -1
- package/dist/__tests__/authority-domains.test.d.ts +0 -2
- package/dist/__tests__/authority-domains.test.d.ts.map +0 -1
- package/dist/__tests__/authority-domains.test.js +0 -48
- package/dist/__tests__/authority-domains.test.js.map +0 -1
- package/dist/__tests__/onboarding-path-b.test.d.ts +0 -2
- package/dist/__tests__/onboarding-path-b.test.d.ts.map +0 -1
- package/dist/__tests__/onboarding-path-b.test.js +0 -46
- package/dist/__tests__/onboarding-path-b.test.js.map +0 -1
- package/dist/__tests__/onboarding.test.d.ts +0 -6
- package/dist/__tests__/onboarding.test.d.ts.map +0 -1
- package/dist/__tests__/onboarding.test.js +0 -347
- package/dist/__tests__/onboarding.test.js.map +0 -1
- package/dist/__tests__/promote.test.d.ts +0 -2
- package/dist/__tests__/promote.test.d.ts.map +0 -1
- package/dist/__tests__/promote.test.js +0 -230
- package/dist/__tests__/promote.test.js.map +0 -1
- package/dist/__tests__/proposals.test.d.ts +0 -2
- package/dist/__tests__/proposals.test.d.ts.map +0 -1
- package/dist/__tests__/proposals.test.js +0 -167
- package/dist/__tests__/proposals.test.js.map +0 -1
- package/dist/__tests__/setup-ingest.test.d.ts +0 -2
- package/dist/__tests__/setup-ingest.test.d.ts.map +0 -1
- package/dist/__tests__/setup-ingest.test.js +0 -55
- package/dist/__tests__/setup-ingest.test.js.map +0 -1
- package/dist/__tests__/setup-resolver.test.d.ts +0 -14
- package/dist/__tests__/setup-resolver.test.d.ts.map +0 -1
- package/dist/__tests__/setup-resolver.test.js +0 -228
- package/dist/__tests__/setup-resolver.test.js.map +0 -1
- package/dist/__tests__/setup.test.d.ts +0 -2
- package/dist/__tests__/setup.test.d.ts.map +0 -1
- package/dist/__tests__/setup.test.js +0 -141
- package/dist/__tests__/setup.test.js.map +0 -1
- package/dist/commands/accept.d.ts +0 -18
- package/dist/commands/accept.d.ts.map +0 -1
- package/dist/commands/accept.js +0 -76
- package/dist/commands/accept.js.map +0 -1
- package/dist/commands/audit.d.ts +0 -25
- package/dist/commands/audit.d.ts.map +0 -1
- package/dist/commands/audit.js +0 -188
- package/dist/commands/audit.js.map +0 -1
- package/dist/commands/authority-domains.d.ts +0 -140
- package/dist/commands/authority-domains.d.ts.map +0 -1
- package/dist/commands/authority-domains.js +0 -268
- package/dist/commands/authority-domains.js.map +0 -1
- package/dist/commands/brand-pack.d.ts +0 -2
- package/dist/commands/brand-pack.d.ts.map +0 -1
- package/dist/commands/brand-pack.js +0 -25
- package/dist/commands/brand-pack.js.map +0 -1
- package/dist/commands/method.d.ts +0 -99
- package/dist/commands/method.d.ts.map +0 -1
- package/dist/commands/method.js +0 -781
- package/dist/commands/method.js.map +0 -1
- package/dist/commands/migrate-setup.d.ts +0 -18
- package/dist/commands/migrate-setup.d.ts.map +0 -1
- package/dist/commands/migrate-setup.js +0 -198
- package/dist/commands/migrate-setup.js.map +0 -1
- package/dist/commands/promote.d.ts +0 -12
- package/dist/commands/promote.d.ts.map +0 -1
- package/dist/commands/promote.js +0 -113
- package/dist/commands/promote.js.map +0 -1
- package/dist/commands/proposals.d.ts +0 -9
- package/dist/commands/proposals.d.ts.map +0 -1
- package/dist/commands/proposals.js +0 -24
- package/dist/commands/proposals.js.map +0 -1
- package/dist/commands/reject.d.ts +0 -14
- package/dist/commands/reject.d.ts.map +0 -1
- package/dist/commands/reject.js +0 -43
- package/dist/commands/reject.js.map +0 -1
- package/dist/commands/setup-ingest.d.ts +0 -17
- package/dist/commands/setup-ingest.d.ts.map +0 -1
- package/dist/commands/setup-ingest.js +0 -224
- package/dist/commands/setup-ingest.js.map +0 -1
- package/dist/commands/setup-resolver.d.ts +0 -58
- package/dist/commands/setup-resolver.d.ts.map +0 -1
- package/dist/commands/setup-resolver.js +0 -150
- package/dist/commands/setup-resolver.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -15
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -148
- package/dist/commands/setup.js.map +0 -1
- package/dist/formatters/audit.d.ts +0 -46
- package/dist/formatters/audit.d.ts.map +0 -1
- package/dist/formatters/audit.js +0 -81
- package/dist/formatters/audit.js.map +0 -1
- package/dist/formatters/promote.d.ts +0 -30
- package/dist/formatters/promote.d.ts.map +0 -1
- package/dist/formatters/promote.js +0 -39
- package/dist/formatters/promote.js.map +0 -1
- package/dist/formatters/proposals.d.ts +0 -45
- package/dist/formatters/proposals.d.ts.map +0 -1
- package/dist/formatters/proposals.js +0 -62
- package/dist/formatters/proposals.js.map +0 -1
- package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
- package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
- package/dist/generators/__tests__/surface-profiles.test.js +0 -89
- package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
- package/dist/generators/archetypes.d.ts +0 -52
- package/dist/generators/archetypes.d.ts.map +0 -1
- package/dist/generators/archetypes.js +0 -153
- package/dist/generators/archetypes.js.map +0 -1
- package/dist/generators/archetypes.test.d.ts +0 -2
- package/dist/generators/archetypes.test.d.ts.map +0 -1
- package/dist/generators/archetypes.test.js +0 -237
- package/dist/generators/archetypes.test.js.map +0 -1
- package/dist/generators/chain-classifier.d.ts +0 -49
- package/dist/generators/chain-classifier.d.ts.map +0 -1
- package/dist/generators/chain-classifier.js +0 -180
- package/dist/generators/chain-classifier.js.map +0 -1
- package/dist/generators/chain-classifier.test.d.ts +0 -2
- package/dist/generators/chain-classifier.test.d.ts.map +0 -1
- package/dist/generators/chain-classifier.test.js +0 -257
- package/dist/generators/chain-classifier.test.js.map +0 -1
- package/dist/generators/chain-rules.d.ts +0 -42
- package/dist/generators/chain-rules.d.ts.map +0 -1
- package/dist/generators/chain-rules.js +0 -144
- package/dist/generators/chain-rules.js.map +0 -1
- package/dist/generators/chain-rules.test.d.ts +0 -2
- package/dist/generators/chain-rules.test.d.ts.map +0 -1
- package/dist/generators/chain-rules.test.js +0 -179
- package/dist/generators/chain-rules.test.js.map +0 -1
- package/dist/generators/handshake-diff.d.ts +0 -67
- package/dist/generators/handshake-diff.d.ts.map +0 -1
- package/dist/generators/handshake-diff.js +0 -183
- package/dist/generators/handshake-diff.js.map +0 -1
- package/dist/generators/handshake-diff.test.d.ts +0 -2
- package/dist/generators/handshake-diff.test.d.ts.map +0 -1
- package/dist/generators/handshake-diff.test.js +0 -264
- package/dist/generators/handshake-diff.test.js.map +0 -1
- package/dist/lib/activation.d.ts +0 -28
- package/dist/lib/activation.d.ts.map +0 -1
- package/dist/lib/activation.js +0 -57
- package/dist/lib/activation.js.map +0 -1
- package/dist/lib/activation.test.d.ts +0 -6
- package/dist/lib/activation.test.d.ts.map +0 -1
- package/dist/lib/activation.test.js +0 -121
- package/dist/lib/activation.test.js.map +0 -1
- package/dist/lib/conversation-engine.d.ts +0 -45
- package/dist/lib/conversation-engine.d.ts.map +0 -1
- package/dist/lib/conversation-engine.js +0 -112
- package/dist/lib/conversation-engine.js.map +0 -1
- package/dist/lib/conversation-phases.d.ts +0 -59
- package/dist/lib/conversation-phases.d.ts.map +0 -1
- package/dist/lib/conversation-phases.js +0 -11
- package/dist/lib/conversation-phases.js.map +0 -1
- package/dist/lib/conversation-signals.d.ts +0 -30
- package/dist/lib/conversation-signals.d.ts.map +0 -1
- package/dist/lib/conversation-signals.js +0 -64
- package/dist/lib/conversation-signals.js.map +0 -1
- package/dist/lib/inferSourceDate.d.ts +0 -12
- package/dist/lib/inferSourceDate.d.ts.map +0 -1
- package/dist/lib/inferSourceDate.js +0 -44
- package/dist/lib/inferSourceDate.js.map +0 -1
- package/dist/lib/onboarding-path-b.d.ts +0 -10
- package/dist/lib/onboarding-path-b.d.ts.map +0 -1
- package/dist/lib/onboarding-path-b.js +0 -214
- package/dist/lib/onboarding-path-b.js.map +0 -1
- package/dist/lib/onboarding-phases.d.ts +0 -9
- package/dist/lib/onboarding-phases.d.ts.map +0 -1
- package/dist/lib/onboarding-phases.js +0 -120
- package/dist/lib/onboarding-phases.js.map +0 -1
- package/dist/lib/onboarding-shared.d.ts +0 -81
- package/dist/lib/onboarding-shared.d.ts.map +0 -1
- package/dist/lib/onboarding-shared.js +0 -190
- package/dist/lib/onboarding-shared.js.map +0 -1
- package/dist/lib/onboarding-topics.d.ts +0 -27
- package/dist/lib/onboarding-topics.d.ts.map +0 -1
- package/dist/lib/onboarding-topics.js +0 -57
- package/dist/lib/onboarding-topics.js.map +0 -1
- package/dist/lib/onboarding.d.ts +0 -17
- package/dist/lib/onboarding.d.ts.map +0 -1
- package/dist/lib/onboarding.js +0 -350
- package/dist/lib/onboarding.js.map +0 -1
- package/templates/archetypes/boundary.md +0 -23
- package/templates/archetypes/constraint.md +0 -23
- package/templates/archetypes/convention.md +0 -23
- package/templates/archetypes/policy.md +0 -23
- package/templates/archetypes/quality-gate.md +0 -23
- package/templates/archetypes/workflow.md +0 -23
|
@@ -2,179 +2,44 @@
|
|
|
2
2
|
* pb handshake — generate context files for AI developer tools.
|
|
3
3
|
* Context export wiring (read-only filesystem bridge; GLO-63, DEC-161) — not a product surface.
|
|
4
4
|
*/
|
|
5
|
-
import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, copyFileSync,
|
|
6
|
-
import { join, dirname, resolve, basename } from 'path';
|
|
5
|
+
import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, copyFileSync, realpathSync } from 'fs';
|
|
6
|
+
import { join, dirname, resolve, basename, relative, sep } from 'path';
|
|
7
7
|
import { homedir } from 'os';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
|
-
import {
|
|
9
|
+
import { execSync } from 'child_process';
|
|
10
10
|
import { getConfigOrGuide } from '../lib/config.js';
|
|
11
|
-
import { select as promptSelect } from '../lib/prompts.js';
|
|
12
|
-
import { composeHooksFromIntents, getHookStatusForSurface } from '../lib/hook-intents.js';
|
|
13
|
-
import { kernelCall
|
|
11
|
+
import { select as promptSelect, confirm as promptConfirm } from '../lib/prompts.js';
|
|
12
|
+
import { HOOK_INTENT_CONFIGS, composeHooksFromIntents, getHookStatusForSurface } from '../lib/hook-intents.js';
|
|
13
|
+
import { kernelCall } from '../lib/client.js';
|
|
14
14
|
import { readSession } from '../lib/session.js';
|
|
15
15
|
import { detectRepo, extractWorkspaceProfile } from '../lib/repo-detect.js';
|
|
16
16
|
import { generateContextMd } from '../generators/context-md.js';
|
|
17
17
|
import { generateBriefingMd } from '../generators/briefing-md.js';
|
|
18
|
-
import { MARKER, generateAgentsMd, generateClaudeMd, generateCursorMdc, generateCopilotMd } from '../generators/adapters.js';
|
|
19
|
-
import { readCanonicalSkills, readCanonicalRules, readPersonalLayer, readPersonalSkillsLayer, generateCursorSkill, generateCursorRule, generateCodexSkill, generateCodexSkillIndex,
|
|
20
|
-
import {
|
|
21
|
-
import { saveHandshakeState, loadPreviousState, diffHandshakeState, formatDiff, buildCurrentState, } from '../generators/handshake-diff.js';
|
|
18
|
+
import { MARKER, generateAgentsMd, generateClaudeMd, generateCursorMdc, generateCopilotMd, generateCopilotInstructionFiles } from '../generators/adapters.js';
|
|
19
|
+
import { readCanonicalSkills, readCanonicalRules, readPersonalLayer, readPersonalSkillsLayer, generateCursorSkill, generateCursorRule, generateCodexSkill, generateCodexSkillIndex, shouldEmitToTarget, filterByLevel, validateCodexSkills, evaluateConditions, } from '../generators/portable-knowledge.js';
|
|
20
|
+
import { findNoProjectionAssets } from '../generators/noProjectionAssets.js'; // WP-660 S2 combine
|
|
22
21
|
import { resolveSurfaceProfile } from '../generators/surface-profiles.js';
|
|
22
|
+
import { generateEveryoneRulesMd } from '../generators/everyone-rules-md.js';
|
|
23
|
+
import { removeStaleBriefingProjections, retireGeneratedProjections } from '../generators/retired-projections.js';
|
|
24
|
+
import { formatWorkspaceBriefingLines } from '../lib/ruleListRender.js';
|
|
23
25
|
import { formatHandshakeReport } from '../formatters/handshake.js';
|
|
24
|
-
import {
|
|
26
|
+
import { classifyAdapterFile, detectEol, spliceAppend, spliceReplace } from '../generators/region.js';
|
|
27
|
+
import { REGION_PROJECTIONS } from '../generators/region-projections.js';
|
|
28
|
+
import { readManifest, readManifestStatus, filterByAdoptionState } from '../generators/manifest.js';
|
|
25
29
|
import { generateBoundaryManifest, getBoundaryEnforcementMode } from '../generators/boundary-manifest.js';
|
|
26
30
|
import { loadMethodRegistry } from '../lib/method-registry.js';
|
|
27
31
|
import { CLIError, ErrorCode } from '../lib/errors.js';
|
|
28
|
-
import {
|
|
32
|
+
import { isJsonMode } from '../lib/runner.js';
|
|
33
|
+
import { stripConvexInternals } from '../lib/strip.js';
|
|
34
|
+
import { replaceVocabTokens } from '../lib/canonicalRefs.js';
|
|
35
|
+
// WP-436 S3: vocab projector — resolves {{vocab:...}} tokens before writing to disk.
|
|
36
|
+
import { getOrFetchVocabCtx } from '../lib/workspaceVocabCache.js';
|
|
29
37
|
import { normalizeMaterializedFilename } from '../lib/normalizeMaterializedFilename.js';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* DORMANT_MARKER — appended to previously-projected asset files when the asset's
|
|
36
|
-
* gate deactivates (e.g. workspace readiness exceeds the max threshold).
|
|
37
|
-
*
|
|
38
|
-
* Contract:
|
|
39
|
-
* - The file is NOT deleted. It persists on disk so that history is preserved
|
|
40
|
-
* and the agent surface remains inspectable.
|
|
41
|
-
* - The marker is appended at the end of the file, idempotent — if it already
|
|
42
|
-
* exists, no second append occurs.
|
|
43
|
-
* - The marker does NOT trigger a drift TEN. Dormant files are intentionally
|
|
44
|
-
* deactivated, not accidentally forked.
|
|
45
|
-
* - The marker is never included in active file writes — only dormant writes.
|
|
46
|
-
*
|
|
47
|
-
* Used by: writeDormantMarker() (write) and hasDormantMarker() (idempotency check).
|
|
48
|
-
* Exported for use in tests.
|
|
49
|
-
*
|
|
50
|
-
* Chain: WP-379 S4.
|
|
51
|
-
*/
|
|
52
|
-
export const DORMANT_MARKER = '<!-- pb-status: dormant -->';
|
|
53
|
-
/**
|
|
54
|
-
* hasDormantMarker — check whether a file on disk already has the dormant marker.
|
|
55
|
-
* Used for idempotency: if the marker is already present, skip the append.
|
|
56
|
-
*/
|
|
57
|
-
function hasDormantMarker(content) {
|
|
58
|
-
return content.includes(DORMANT_MARKER);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* writeDormantMarker — append the dormant marker to a previously-projected file.
|
|
62
|
-
*
|
|
63
|
-
* Idempotent: if DORMANT_MARKER is already present, no-op.
|
|
64
|
-
* Only operates on files that have the auto-gen MARKER — we never touch
|
|
65
|
-
* manually-authored files.
|
|
66
|
-
*
|
|
67
|
-
* @param filePath Absolute path to the file.
|
|
68
|
-
* @returns 'written' | 'already-dormant' | 'skipped' (no auto-gen marker)
|
|
69
|
-
*/
|
|
70
|
-
export function writeDormantMarkerToFile(filePath) {
|
|
71
|
-
if (!existsSync(filePath))
|
|
72
|
-
return 'skipped';
|
|
73
|
-
const content = readFileSync(filePath, 'utf8');
|
|
74
|
-
// Only mark files that were originally projected by pb handshake.
|
|
75
|
-
// Files without the auto-gen MARKER are manually authored — leave them alone.
|
|
76
|
-
if (!content.includes(MARKER))
|
|
77
|
-
return 'skipped';
|
|
78
|
-
if (hasDormantMarker(content))
|
|
79
|
-
return 'already-dormant';
|
|
80
|
-
// Append the marker on its own line. No trailing newline assumption —
|
|
81
|
-
// appendFileSync adds to whatever is already there.
|
|
82
|
-
appendFileSync(filePath, `\n${DORMANT_MARKER}\n`);
|
|
83
|
-
return 'written';
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* deriveDormantFilePaths — compute the set of on-disk file paths that would have
|
|
87
|
-
* been projected for a given dormant asset (by name and assetKind).
|
|
88
|
-
*
|
|
89
|
-
* Assets are projected to one or more surfaces (cursor/claude/codex) depending
|
|
90
|
-
* on shouldEmitToTarget. Since we don't re-run shouldEmitToTarget here, we
|
|
91
|
-
* speculatively probe all known surface paths and let writeDormantMarkerToFile
|
|
92
|
-
* decide whether each exists and has the auto-gen MARKER.
|
|
93
|
-
*
|
|
94
|
-
* @param asset The dormant asset from the server.
|
|
95
|
-
* @param cwd Current working directory (project root).
|
|
96
|
-
* @returns Array of absolute file paths to probe.
|
|
97
|
-
*/
|
|
98
|
-
function deriveDormantFilePaths(asset, cwd) {
|
|
99
|
-
// Defense-in-depth: even though `name` originates from platform-seeded DB
|
|
100
|
-
// entries (not user input), validate it against a strict charset before
|
|
101
|
-
// interpolating into a filesystem path. Reject anything that could traverse
|
|
102
|
-
// out of the expected directories. WP-379 S4 review finding.
|
|
103
|
-
if (!/^[A-Za-z0-9 ._-]+$/.test(asset.name)) {
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
const paths = [];
|
|
107
|
-
const { name, assetKind } = asset;
|
|
108
|
-
if (assetKind === 'skill') {
|
|
109
|
-
// Cursor skill
|
|
110
|
-
paths.push(join(cwd, '.cursor', 'skills', name, 'SKILL.md'));
|
|
111
|
-
// Codex skill
|
|
112
|
-
paths.push(join(cwd, '.codex', 'skills', `${name}.md`));
|
|
113
|
-
}
|
|
114
|
-
else if (assetKind === 'rule' || assetKind === 'hook') {
|
|
115
|
-
// Cursor rule
|
|
116
|
-
paths.push(join(cwd, '.cursor', 'rules', `${name}.mdc`));
|
|
117
|
-
// Claude rule
|
|
118
|
-
paths.push(join(cwd, '.claude', 'rules', `${name}.md`));
|
|
119
|
-
}
|
|
120
|
-
return paths;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Single-shot health probe — calls `workspace.health` and inspects
|
|
124
|
-
* `starterSetupSeeded`. Does NOT poll internally; polling is the caller's
|
|
125
|
-
* responsibility (connect-screens.tsx).
|
|
126
|
-
*
|
|
127
|
-
* Returns:
|
|
128
|
-
* - `seeds-ready` — health query succeeded AND starterSetupSeeded is true
|
|
129
|
-
* - `seeds-pending` — health query succeeded but starterSetupSeeded is false
|
|
130
|
-
* - `probe-failed` — health query threw (network, auth, etc.)
|
|
131
|
-
*/
|
|
132
|
-
export async function probeStarterSetupSeeded() {
|
|
133
|
-
try {
|
|
134
|
-
const health = await kernelCall('workspace.health', {});
|
|
135
|
-
if (health.starterSetupSeeded) {
|
|
136
|
-
return { status: 'seeds-ready' };
|
|
137
|
-
}
|
|
138
|
-
const starterGaps = (health.gaps ?? []).filter((g) => g.kind === 'starter-setup-missing' || g.kind === 'platform-domains-missing');
|
|
139
|
-
return {
|
|
140
|
-
status: 'seeds-pending',
|
|
141
|
-
gaps: starterGaps.length > 0 ? starterGaps : [
|
|
142
|
-
{
|
|
143
|
-
kind: 'starter-setup-missing',
|
|
144
|
-
severity: 'warn',
|
|
145
|
-
message: 'Starter setup seeds are still running.',
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
catch (err) {
|
|
151
|
-
return {
|
|
152
|
-
status: 'probe-failed',
|
|
153
|
-
error: err instanceof Error ? err.message : String(err),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Poll `probeStarterSetupSeeded` up to MAX_POLLS times (10s at 500ms intervals).
|
|
159
|
-
* Returns the final probe result — caller decides how to render the outcome.
|
|
160
|
-
*
|
|
161
|
-
* Exported so connect-screens.tsx can use it without re-implementing the loop.
|
|
162
|
-
*/
|
|
163
|
-
export async function pollUntilSeedsReady() {
|
|
164
|
-
for (let poll = 0; poll < MAX_POLLS; poll++) {
|
|
165
|
-
const result = await probeStarterSetupSeeded();
|
|
166
|
-
if (result.status === 'seeds-ready')
|
|
167
|
-
return result;
|
|
168
|
-
if (result.status === 'probe-failed')
|
|
169
|
-
return result; // don't retry on auth/network errors
|
|
170
|
-
// seeds-pending — wait before next poll
|
|
171
|
-
if (poll < MAX_POLLS - 1) {
|
|
172
|
-
await new Promise((res) => setTimeout(res, POLL_INTERVAL_MS));
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Final probe after exhausting waits — return whatever state we have
|
|
176
|
-
return probeStarterSetupSeeded();
|
|
177
|
-
}
|
|
38
|
+
import { findLeftoverCursorSkills, LEFTOVER_FILES_MAX } from './handshakeCursorSkillCleanup.js';
|
|
39
|
+
import { classifyDriftBucket } from './handshakeDriftClassification.js';
|
|
40
|
+
import { sanitizeStartupResolutionSignals } from '../lib/startup-resolution-signals.js';
|
|
41
|
+
import { assertSetupWritePath } from '../lib/writePerimeter.js';
|
|
42
|
+
import { SURFACE_GOVERN_NO_SURFACES, SURFACE_REGISTRY, validateSurfacesForMode, } from '../surfaces/registry.js';
|
|
178
43
|
const LEVELS = {
|
|
179
44
|
guide: {
|
|
180
45
|
label: 'Guide me',
|
|
@@ -203,8 +68,7 @@ const LEVELS = {
|
|
|
203
68
|
};
|
|
204
69
|
// Explicit ordering — determines menu numbering in promptLevel(). Do not reorder.
|
|
205
70
|
const LEVEL_KEYS = ['guide', 'work', 'silent', 'full-trust'];
|
|
206
|
-
// Hook failure contract (TEN-712):
|
|
207
|
-
// so Claude Code always starts even if pb is unavailable. Never remove this suffix.
|
|
71
|
+
// Hook failure contract (TEN-712): every hook command MUST end with '|| true' so Claude Code always starts even if pb is unavailable.
|
|
208
72
|
const INIT_PERMISSION = 'Bash(pb:*)';
|
|
209
73
|
function readSettings(filePath) {
|
|
210
74
|
if (!existsSync(filePath))
|
|
@@ -232,7 +96,16 @@ function writeTeamSettings(cwd, dryRun) {
|
|
|
232
96
|
}
|
|
233
97
|
settings.permissions = permissions;
|
|
234
98
|
const hooks = (settings.hooks ?? {});
|
|
235
|
-
const hookAdditions = composeHooksFromIntents(['session-start', 'session-close'
|
|
99
|
+
const hookAdditions = composeHooksFromIntents(['session-start', 'session-close'], hooks);
|
|
100
|
+
const close = HOOK_INTENT_CONFIGS['session-close'].command; // TASK-763 (DEC-2038): an older init closed on Stop, every turn
|
|
101
|
+
const stop = (hooks.Stop ?? []).map((g) => ({ ...g, hooks: g.hooks.filter((h) => h.command !== close) })).filter((g) => g.hooks.length > 0);
|
|
102
|
+
if (JSON.stringify(stop) !== JSON.stringify(hooks.Stop ?? [])) {
|
|
103
|
+
if (stop.length)
|
|
104
|
+
hooks.Stop = stop;
|
|
105
|
+
else
|
|
106
|
+
delete hooks.Stop;
|
|
107
|
+
added.push('Stop → pb session close removed (closed every turn)');
|
|
108
|
+
}
|
|
236
109
|
for (const addition of hookAdditions) {
|
|
237
110
|
hooks[addition.event] = [...(hooks[addition.event] ?? []), addition.entry];
|
|
238
111
|
added.push(addition.label);
|
|
@@ -305,8 +178,7 @@ export async function runHandshakeInit(options = {}) {
|
|
|
305
178
|
for (const item of teamAdded)
|
|
306
179
|
console.log(` + ${item}`);
|
|
307
180
|
}
|
|
308
|
-
// Step 2: Personal config — wizard or --level flag
|
|
309
|
-
// Cast is safe: LEVEL_KEYS.includes() validated above; invalid level already threw CLIError.
|
|
181
|
+
// Step 2: Personal config — wizard or --level flag. Cast is safe: LEVEL_KEYS.includes() validated above.
|
|
310
182
|
const levelKey = options.level ? options.level : await promptLevel();
|
|
311
183
|
const level = LEVELS[levelKey];
|
|
312
184
|
const personalAdded = writePersonalSettings(levelKey, dryRun);
|
|
@@ -328,11 +200,7 @@ export async function runHandshakeInit(options = {}) {
|
|
|
328
200
|
if (!dryRun)
|
|
329
201
|
console.log('Reload /hooks in Claude Code (or restart) to activate.');
|
|
330
202
|
console.log('Run `pb handshake --init --level <guide|work|silent|full-trust>` to change level.');
|
|
331
|
-
// Step 2b: Report multi-surface hook opt-in status (WP-310 E3b)
|
|
332
|
-
// Reads manifest.hooks.{cursor,copilot} and prints an informational note for
|
|
333
|
-
// each opted-in surface. Silence = no manifest or no hooks flags set.
|
|
334
|
-
// DEC-536: Claude-native default is already wired above; this block only fires
|
|
335
|
-
// when the user has explicitly opted in via manifest.
|
|
203
|
+
// Step 2b: Report multi-surface hook opt-in status (WP-310 E3b) — manifest.hooks.{cursor,copilot}, silence = no manifest/flags (DEC-536).
|
|
336
204
|
const pbDirForManifest = join(cwd, '.productbrain');
|
|
337
205
|
const initManifest = readManifest(pbDirForManifest);
|
|
338
206
|
const multiSurfaceOptIns = [];
|
|
@@ -401,24 +269,237 @@ export async function runHandshakeInit(options = {}) {
|
|
|
401
269
|
}
|
|
402
270
|
}
|
|
403
271
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
272
|
+
const LOCAL_REF_REGEX = /\b(?:WP|TEN|DEC|BET|FEAT|INS|STD|PRI|ARCH)[-\s#]*\d+\b|\bPR\s*#?\s*\d+\b/gi;
|
|
273
|
+
const STARTUP_RESOLUTION_RESOLVER_VERSION = 'startup-resolution-v1';
|
|
274
|
+
// Global cap on collected refs (spec "Contract: StartupResolutionSignals" — arrays are capped).
|
|
275
|
+
const LOCAL_REF_GLOBAL_CAP = 25;
|
|
276
|
+
// Per-source cap so a broad source (context.md) can't starve briefing.md's task-specific refs (Codex@677).
|
|
277
|
+
const LOCAL_REF_PER_SOURCE_CAP = 18;
|
|
278
|
+
// Time-boxed so an unauthed/slow `gh` can't stall session-start (F4).
|
|
279
|
+
const PR_DIFF_TIMEOUT_MS = 4_000;
|
|
280
|
+
// Bounds worst-case `gh` subprocess invocations per handshake.
|
|
281
|
+
const PR_DIFF_MAX_REFS = 5;
|
|
282
|
+
function runGitText(cwd, command) {
|
|
283
|
+
try {
|
|
284
|
+
const value = execSync(command, {
|
|
285
|
+
cwd,
|
|
286
|
+
encoding: 'utf8',
|
|
287
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
288
|
+
}).trim();
|
|
289
|
+
return value.length > 0 ? value : undefined;
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/** Dereference a "PR #N" ref to its changed paths via `gh pr diff <N> --name-only` (F4: server
|
|
296
|
+
* resolver has no git/gh access). Guarded/time-boxed; `run` is injectable for tests. */
|
|
297
|
+
export function dereferencePrRefToPaths(cwd, prNumber, run = runGitTextTimeboxed) {
|
|
298
|
+
if (!Number.isInteger(prNumber) || prNumber <= 0)
|
|
299
|
+
return [];
|
|
300
|
+
const raw = run(cwd, `gh pr diff ${prNumber} --name-only`, PR_DIFF_TIMEOUT_MS);
|
|
301
|
+
if (!raw)
|
|
302
|
+
return [];
|
|
303
|
+
return raw.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
304
|
+
}
|
|
305
|
+
/** Time-boxed variant of runGitText for the PR-diff dereference (F4). */
|
|
306
|
+
function runGitTextTimeboxed(cwd, command, timeoutMs) {
|
|
307
|
+
try {
|
|
308
|
+
const value = execSync(command, {
|
|
309
|
+
cwd,
|
|
310
|
+
encoding: 'utf8',
|
|
311
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
312
|
+
timeout: timeoutMs,
|
|
313
|
+
}).trim();
|
|
314
|
+
return value.length > 0 ? value : undefined;
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function readOptionalLocalText(cwd, path) {
|
|
321
|
+
const fullPath = join(cwd, path);
|
|
322
|
+
if (!existsSync(fullPath))
|
|
323
|
+
return undefined;
|
|
324
|
+
try {
|
|
325
|
+
return readFileSync(fullPath, 'utf8');
|
|
326
|
+
}
|
|
327
|
+
catch {
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function normalizeLocalRef(ref) {
|
|
332
|
+
const trimmed = ref.trim().replace(/\s+/g, ' ');
|
|
333
|
+
const pr = trimmed.match(/^PR\s*#?\s*(\d+)$/i);
|
|
334
|
+
if (pr)
|
|
335
|
+
return `PR #${pr[1]}`;
|
|
336
|
+
const entry = trimmed.match(/^([A-Z]+)[-\s#]*(\d+)$/i);
|
|
337
|
+
if (entry)
|
|
338
|
+
return `${entry[1].toUpperCase()}-${entry[2]}`;
|
|
339
|
+
return trimmed;
|
|
340
|
+
}
|
|
341
|
+
/** Collect normalized local refs across several text sources, deduped. Codex@677: a per-source
|
|
342
|
+
* cap alongside the global one, so a broad source (context.md) can't starve a later,
|
|
343
|
+
* task-specific source (briefing.md); already-collected refs dedupe without spending later quota. */
|
|
344
|
+
function collectLocalRefs(texts) {
|
|
345
|
+
const refs = [];
|
|
346
|
+
const seen = new Set();
|
|
347
|
+
for (const text of texts) {
|
|
348
|
+
if (!text)
|
|
349
|
+
continue;
|
|
350
|
+
let fromThisSource = 0;
|
|
351
|
+
for (const match of text.matchAll(LOCAL_REF_REGEX)) {
|
|
352
|
+
const ref = normalizeLocalRef(match[0]);
|
|
353
|
+
const key = ref.toLowerCase();
|
|
354
|
+
if (seen.has(key))
|
|
355
|
+
continue;
|
|
356
|
+
if (fromThisSource >= LOCAL_REF_PER_SOURCE_CAP)
|
|
357
|
+
break;
|
|
358
|
+
seen.add(key);
|
|
359
|
+
refs.push(ref);
|
|
360
|
+
fromThisSource++;
|
|
361
|
+
if (refs.length >= LOCAL_REF_GLOBAL_CAP)
|
|
362
|
+
return refs;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return refs;
|
|
366
|
+
}
|
|
367
|
+
function deriveHandshakeStartupTask(refs, changedPaths, callerTask) {
|
|
368
|
+
if (callerTask && callerTask.trim())
|
|
369
|
+
return callerTask.trim();
|
|
370
|
+
const parts = [];
|
|
371
|
+
if (refs.length > 0)
|
|
372
|
+
parts.push(refs.join(' '));
|
|
373
|
+
if (changedPaths.length > 0)
|
|
374
|
+
parts.push(`changed paths ${changedPaths.slice(0, 5).join(' ')}`);
|
|
375
|
+
return parts.length > 0 ? parts.join(' ') : undefined;
|
|
376
|
+
}
|
|
377
|
+
const DEFAULT_HANDSHAKE_SIGNAL_DEPS = {
|
|
378
|
+
runGit: runGitText,
|
|
379
|
+
prDiff: (cwd, prNumber) => dereferencePrRefToPaths(cwd, prNumber),
|
|
380
|
+
};
|
|
381
|
+
/** Extract the PR number from a normalized "PR #N" ref, else null. */
|
|
382
|
+
function prNumberFromRef(ref) {
|
|
383
|
+
const m = ref.match(/^PR\s*#?\s*(\d+)$/i);
|
|
384
|
+
if (!m)
|
|
385
|
+
return null;
|
|
386
|
+
const n = Number(m[1]);
|
|
387
|
+
return Number.isInteger(n) && n > 0 ? n : null;
|
|
388
|
+
}
|
|
389
|
+
export function deriveHandshakeStartupSignals(cwd, callerSignals = {}, deps = DEFAULT_HANDSHAKE_SIGNAL_DEPS) {
|
|
390
|
+
const { runGit, prDiff } = deps;
|
|
391
|
+
const branchName = runGit(cwd, 'git branch --show-current');
|
|
392
|
+
const commitSha = runGit(cwd, 'git rev-parse --short HEAD');
|
|
393
|
+
// Changed paths, unioned + deduped: (1) dirty worktree; (2) committed branch delta vs origin/main's
|
|
394
|
+
// merge-base (Codex@665, invisible once the tree is clean); (3) PR-ref dereference (F4), appended later.
|
|
395
|
+
const dirtyChangedPaths = runGit(cwd, 'git diff --name-only HEAD')?.split(/\r?\n/).filter(Boolean) ?? [];
|
|
396
|
+
const mergeBase = runGit(cwd, 'git merge-base HEAD origin/main');
|
|
397
|
+
const branchChangedPaths = mergeBase
|
|
398
|
+
? (runGit(cwd, `git diff --name-only ${mergeBase} HEAD`)?.split(/\r?\n/).filter(Boolean) ?? [])
|
|
399
|
+
: [];
|
|
400
|
+
const worktreeName = basename(cwd);
|
|
401
|
+
const contextText = readOptionalLocalText(cwd, '.productbrain/context.md');
|
|
402
|
+
const briefingText = readOptionalLocalText(cwd, '.productbrain/briefing.md');
|
|
403
|
+
const callerRefs = Array.isArray(callerSignals.reviewedArtifactRefs) ? callerSignals.reviewedArtifactRefs.join('\n') : undefined;
|
|
404
|
+
// Codex@677: briefing.md (task-specific) reads BEFORE context.md (broad) so its refs collect first — with the per-source cap, context.md can't starve briefing.
|
|
405
|
+
const refs = collectLocalRefs([
|
|
406
|
+
callerSignals.taskText ?? undefined,
|
|
407
|
+
callerSignals.explicitScope ?? undefined,
|
|
408
|
+
callerRefs,
|
|
409
|
+
branchName,
|
|
410
|
+
worktreeName,
|
|
411
|
+
briefingText,
|
|
412
|
+
contextText,
|
|
413
|
+
]);
|
|
414
|
+
// F4: dereference "PR #N" refs to diff paths, folded into changedPaths — the only place this can happen (server records dereferenced:false, no git access). Time-boxed; absent/unauthed gh no-ops.
|
|
415
|
+
const prDiffPaths = [];
|
|
416
|
+
if (callerSignals.changedPaths === undefined) {
|
|
417
|
+
let derefed = 0;
|
|
418
|
+
for (const ref of refs) {
|
|
419
|
+
const prNumber = prNumberFromRef(ref);
|
|
420
|
+
if (prNumber === null)
|
|
421
|
+
continue;
|
|
422
|
+
if (derefed >= PR_DIFF_MAX_REFS)
|
|
423
|
+
break;
|
|
424
|
+
derefed++;
|
|
425
|
+
try {
|
|
426
|
+
for (const p of prDiff(cwd, prNumber))
|
|
427
|
+
prDiffPaths.push(p);
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
// gh absent / unauthed / PR missing — skip gracefully, leave existing behavior.
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
// Caller-supplied changedPaths win (backward compat); otherwise union the
|
|
435
|
+
// three local sources, deduped, order-stable.
|
|
436
|
+
const unionedChangedPaths = callerSignals.changedPaths ??
|
|
437
|
+
Array.from(new Set([...dirtyChangedPaths, ...branchChangedPaths, ...prDiffPaths]));
|
|
438
|
+
const baseSignals = sanitizeStartupResolutionSignals({
|
|
439
|
+
...callerSignals,
|
|
440
|
+
sourceSurface: callerSignals.sourceSurface ?? 'cli',
|
|
441
|
+
resolverVersion: callerSignals.resolverVersion ?? STARTUP_RESOLUTION_RESOLVER_VERSION,
|
|
442
|
+
branchName: callerSignals.branchName ?? branchName,
|
|
443
|
+
worktreeName: callerSignals.worktreeName ?? worktreeName,
|
|
444
|
+
changedPaths: unionedChangedPaths,
|
|
445
|
+
reviewedArtifactRefs: callerSignals.reviewedArtifactRefs ?? refs,
|
|
446
|
+
commitSha: callerSignals.commitSha ?? commitSha,
|
|
447
|
+
});
|
|
448
|
+
const taskText = deriveHandshakeStartupTask(baseSignals.reviewedArtifactRefs ?? [], baseSignals.changedPaths ?? [], baseSignals.taskText);
|
|
449
|
+
const sanitized = sanitizeStartupResolutionSignals({
|
|
450
|
+
...baseSignals,
|
|
451
|
+
taskText,
|
|
452
|
+
});
|
|
453
|
+
const hasMeaningfulEvidence = Boolean(sanitized.taskText) ||
|
|
454
|
+
(sanitized.changedPaths?.length ?? 0) > 0 ||
|
|
455
|
+
(sanitized.reviewedArtifactRefs?.length ?? 0) > 0 ||
|
|
456
|
+
Boolean(sanitized.explicitScope);
|
|
457
|
+
if (hasMeaningfulEvidence)
|
|
458
|
+
return sanitized;
|
|
459
|
+
// Codex@704: even with no evidence, emit a minimal envelope carrying attribution — {} would
|
|
460
|
+
// drop the whole startup block, losing the loud domain-unresolved signal (spec "Loud Unresolved State", AC #4).
|
|
461
|
+
return sanitizeStartupResolutionSignals({
|
|
462
|
+
sourceSurface: sanitized.sourceSurface ?? 'cli',
|
|
463
|
+
resolverVersion: sanitized.resolverVersion ?? STARTUP_RESOLUTION_RESOLVER_VERSION,
|
|
464
|
+
branchName: sanitized.branchName,
|
|
465
|
+
worktreeName: sanitized.worktreeName,
|
|
466
|
+
commitSha: sanitized.commitSha,
|
|
467
|
+
changeId: sanitized.changeId,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
/** Normalize volatile handshake-only timestamps before comparing generated files — keeps visible
|
|
471
|
+
* timestamps in artifacts while avoiding meaningless rewrites when content is unchanged. */
|
|
409
472
|
export function normalizeHandshakeContentForComparison(content) {
|
|
410
473
|
return content
|
|
411
474
|
.replace(/<!-- auto-generated by pb handshake — [0-9]{4}-[0-9]{2}-[0-9]{2}T[^>]+ -->/g, '<!-- auto-generated by pb handshake — <TIMESTAMP> -->')
|
|
412
475
|
.replace(/^_Generated: [0-9]{4}-[0-9]{2}-[0-9]{2}T.*_$/gm, '_Generated: <TIMESTAMP>_');
|
|
413
476
|
}
|
|
414
477
|
function shouldWriteAdapter(filePath, force) {
|
|
415
|
-
|
|
416
|
-
return true;
|
|
478
|
+
// An absent file at an adapter path is a projection target → materialize it.
|
|
417
479
|
if (!existsSync(filePath))
|
|
418
480
|
return true;
|
|
419
481
|
const content = readFileSync(filePath, 'utf8');
|
|
482
|
+
// No MARKER → user-owned/committed-static (CLAUDE.md, AGENTS.md, Copilot instructions) — never overwritten, not even under --force.
|
|
483
|
+
void force;
|
|
420
484
|
return content.includes(MARKER);
|
|
421
485
|
}
|
|
486
|
+
function normalizeSurfaceName(surface) {
|
|
487
|
+
const stripped = surface.startsWith('.') ? surface.slice(1) : surface;
|
|
488
|
+
const normalized = stripped === 'github' ? 'copilot' : stripped;
|
|
489
|
+
return normalized in SURFACE_REGISTRY ? normalized : null;
|
|
490
|
+
}
|
|
491
|
+
function surfacePerimeterRoots(surface) {
|
|
492
|
+
if (surface === 'codex')
|
|
493
|
+
return ['.codex', SURFACE_REGISTRY.codex.hookFilePath];
|
|
494
|
+
if (surface === 'copilot')
|
|
495
|
+
return ['.github', SURFACE_REGISTRY.copilot.hookFilePath];
|
|
496
|
+
if (surface === 'claude')
|
|
497
|
+
return ['.claude', 'CLAUDE.md'];
|
|
498
|
+
return [`.${surface}`];
|
|
499
|
+
}
|
|
500
|
+
// ── WP-421 S3: Three-bucket drift classification (doneWhen #17) — now its own module (STD-2/DEC-1504
|
|
501
|
+
// shrink-only offset). Re-exported so existing imports `from '../commands/handshake.js'` keep working.
|
|
502
|
+
export { classifyDriftBucket };
|
|
422
503
|
function deduplicateEntries(entries) {
|
|
423
504
|
const seen = new Set();
|
|
424
505
|
const result = [];
|
|
@@ -432,46 +513,35 @@ function deduplicateEntries(entries) {
|
|
|
432
513
|
return result;
|
|
433
514
|
}
|
|
434
515
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
* Marker-scoped orphan unlink: enumerates target dirs (.cursor/rules/,
|
|
438
|
-
* .claude/rules/, .claude/skills/, .codex/skills/); for each file that has
|
|
439
|
-
* the auto-gen MARKER whose lowercase-normalized filename does NOT match any
|
|
440
|
-
* current active-asset materializedFilename, the file is unlinked.
|
|
516
|
+
* findLeftoverProjections — WP-379 S5b
|
|
441
517
|
*
|
|
442
|
-
*
|
|
518
|
+
* Lists marker-bearing files under .cursor/rules/, .claude/rules/, .claude/skills/, .codex/skills/
|
|
519
|
+
* (plus the nested .cursor/skills/<name>/SKILL.md layout) that look stale: orphan (no canonical
|
|
520
|
+
* asset), stale case/punctuation variant, or a leftover `.dormant` copy. User-owned (no MARKER)
|
|
521
|
+
* files and unselected `allowedTargets` are never reported.
|
|
443
522
|
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
* 3. Ambiguous (zero exact, multiple case-variants with MARKER):
|
|
448
|
-
* newest mtime wins; all others are unlinked; a collision TEN is
|
|
449
|
-
* appended to the session capture queue (not fired inline).
|
|
523
|
+
* Round 12: stops once `LEFTOVER_FILES_MAX + 1` matches are found across the flat + merged
|
|
524
|
+
* nested-Cursor scan combined — bounds read/enumerate I/O, not just the reported list.
|
|
525
|
+
* `truncated` says more exist beyond the capped, returned `files`.
|
|
450
526
|
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* @param assetNames The current set of canonical asset names from the server
|
|
455
|
-
* (e.g. ["Setup-ProductBrain", "chain-rules"]).
|
|
456
|
-
* @param log Progress log function.
|
|
457
|
-
* @param logErr Error log function.
|
|
527
|
+
* @param cursorSkillNames Cursor-specific, SKILL-kind-only canon (falls back to `assetNames`).
|
|
528
|
+
* @param exactRelativePaths Round 11: exact write-plan paths (forward-slash), exempted from both
|
|
529
|
+
* checks — covers asset-less generated files and a canonical raw name not already normalized.
|
|
458
530
|
*/
|
|
459
|
-
export function
|
|
460
|
-
// Target directories by extension suffix.
|
|
531
|
+
export function findLeftoverProjections(cwd, assetNames, allowedTargets, cursorSkillNames, exactRelativePaths) {
|
|
461
532
|
const TARGET_DIRS_BY_EXT = [
|
|
462
|
-
{ dir: join(cwd, '.cursor', 'rules'), ext: '.mdc' },
|
|
463
|
-
{ dir: join(cwd, '.claude', 'rules'), ext: '.md' },
|
|
464
|
-
{ dir: join(cwd, '.claude', 'skills'), ext: '.md' },
|
|
465
|
-
{ dir: join(cwd, '.codex', 'skills'), ext: '.md' },
|
|
533
|
+
{ dir: join(cwd, '.cursor', 'rules'), ext: '.mdc', surface: 'cursor' },
|
|
534
|
+
{ dir: join(cwd, '.claude', 'rules'), ext: '.md', surface: 'claude' },
|
|
535
|
+
{ dir: join(cwd, '.claude', 'skills'), ext: '.md', surface: 'claude' },
|
|
536
|
+
{ dir: join(cwd, '.codex', 'skills'), ext: '.md', surface: 'codex' },
|
|
466
537
|
];
|
|
467
|
-
// Build a set of normalized canonical names (without extension) for fast lookup.
|
|
468
|
-
// We normalize all asset names to detect case-variant collisions.
|
|
469
|
-
// For each asset name we derive the normalized basename (the part before the ext).
|
|
470
|
-
// canonicalNormalizedNames: Set<normalized-stem> (lowercase + slug).
|
|
471
538
|
const canonicalNormalizedStems = new Set(assetNames.map((n) => normalizeMaterializedFilename(n)));
|
|
472
|
-
const
|
|
473
|
-
const
|
|
474
|
-
|
|
539
|
+
const exactPaths = exactRelativePaths ?? new Set();
|
|
540
|
+
const leftovers = [];
|
|
541
|
+
let truncated = false;
|
|
542
|
+
scanLoop: for (const { dir, ext, surface } of TARGET_DIRS_BY_EXT) {
|
|
543
|
+
if (!allowedTargets.has(surface))
|
|
544
|
+
continue;
|
|
475
545
|
if (!existsSync(dir))
|
|
476
546
|
continue;
|
|
477
547
|
let files;
|
|
@@ -481,14 +551,10 @@ export function resolveProjectionCollision(cwd, assetNames, log, logErr) {
|
|
|
481
551
|
catch {
|
|
482
552
|
continue; // unreadable dir — skip
|
|
483
553
|
}
|
|
484
|
-
// Group files by their normalized stem.
|
|
485
|
-
// normalizedStem → [ { filename, fullPath } ]
|
|
486
|
-
const groups = new Map();
|
|
487
554
|
for (const filename of files) {
|
|
488
|
-
if (!filename.endsWith(ext))
|
|
555
|
+
if (!filename.endsWith(ext) && !filename.endsWith(`${ext}.dormant`))
|
|
489
556
|
continue;
|
|
490
557
|
const fullPath = join(dir, filename);
|
|
491
|
-
// Only operate on files that have the auto-gen MARKER.
|
|
492
558
|
let content;
|
|
493
559
|
try {
|
|
494
560
|
content = readFileSync(fullPath, 'utf8');
|
|
@@ -497,115 +563,82 @@ export function resolveProjectionCollision(cwd, assetNames, log, logErr) {
|
|
|
497
563
|
continue; // unreadable file — skip
|
|
498
564
|
}
|
|
499
565
|
if (!content.includes(MARKER))
|
|
500
|
-
continue; // user-
|
|
501
|
-
const
|
|
566
|
+
continue; // user-owned — never reported
|
|
567
|
+
const isDormant = filename.endsWith('.dormant');
|
|
568
|
+
// A live file the write plan targets by this exact path is canonical by construction.
|
|
569
|
+
if (!isDormant) {
|
|
570
|
+
const relativePath = relative(cwd, fullPath).split(sep).join('/');
|
|
571
|
+
if (exactPaths.has(relativePath))
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
const stem = basename(isDormant ? filename.slice(0, -'.dormant'.length) : filename, ext);
|
|
502
575
|
const normalizedStem = normalizeMaterializedFilename(stem);
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
// Evaluate each normalized stem group.
|
|
508
|
-
for (const [normalizedStem, members] of groups) {
|
|
509
|
-
const isKnownCanonical = canonicalNormalizedStems.has(normalizedStem);
|
|
510
|
-
if (!isKnownCanonical) {
|
|
511
|
-
// All members of this group are orphans (no canonical asset with this stem).
|
|
512
|
-
// Unlink them all — they're stale projections of an asset no longer in the server.
|
|
513
|
-
for (const { filename, fullPath } of members) {
|
|
514
|
-
try {
|
|
515
|
-
unlinkSync(fullPath);
|
|
516
|
-
log(`Orphan unlinked: ${fullPath}`);
|
|
517
|
-
results.push({ action: 'unlinked', filePath: fullPath, reason: 'orphan-no-canonical-match' });
|
|
518
|
-
}
|
|
519
|
-
catch (err) {
|
|
520
|
-
logErr(`Warning: could not unlink orphan ${fullPath} — ${err instanceof Error ? err.message : String(err)}`);
|
|
521
|
-
results.push({ action: 'kept', filePath: fullPath, reason: 'unlink-failed' });
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
continue;
|
|
576
|
+
let entry = null;
|
|
577
|
+
if (!canonicalNormalizedStems.has(normalizedStem)) {
|
|
578
|
+
entry = { path: fullPath, reason: 'orphan — no canonical asset matches this name' };
|
|
525
579
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
// Single file — no collision.
|
|
529
|
-
results.push({ action: 'kept', filePath: members[0].fullPath, reason: 'canonical-exact' });
|
|
530
|
-
continue;
|
|
580
|
+
else if (isDormant) {
|
|
581
|
+
entry = { path: fullPath, reason: 'leftover .dormant file from an older binary version' };
|
|
531
582
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
const exactMatches = members.filter(({ filename }) => {
|
|
535
|
-
const stem = basename(filename, ext);
|
|
536
|
-
return stem === normalizedStem; // lowercase-equal means already normalized
|
|
537
|
-
});
|
|
538
|
-
if (exactMatches.length === 1) {
|
|
539
|
-
// Rule 1: exactly one exact match → keep it, unlink all case-variants.
|
|
540
|
-
const keeper = exactMatches[0];
|
|
541
|
-
results.push({ action: 'kept', filePath: keeper.fullPath, reason: 'case-exact-match-wins' });
|
|
542
|
-
for (const member of members) {
|
|
543
|
-
if (member.fullPath === keeper.fullPath)
|
|
544
|
-
continue;
|
|
545
|
-
try {
|
|
546
|
-
unlinkSync(member.fullPath);
|
|
547
|
-
log(`Case-variant unlinked: ${member.fullPath} (kept: ${keeper.filename})`);
|
|
548
|
-
results.push({ action: 'unlinked', filePath: member.fullPath, reason: 'case-variant-unlinked' });
|
|
549
|
-
}
|
|
550
|
-
catch (err) {
|
|
551
|
-
logErr(`Warning: could not unlink case-variant ${member.fullPath} — ${err instanceof Error ? err.message : String(err)}`);
|
|
552
|
-
results.push({ action: 'kept', filePath: member.fullPath, reason: 'unlink-failed' });
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
continue;
|
|
583
|
+
else if (stem !== normalizedStem) {
|
|
584
|
+
entry = { path: fullPath, reason: `stale case/punctuation variant — canonical form is "${normalizedStem}${ext}"` };
|
|
556
585
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
catch {
|
|
566
|
-
return { filename, fullPath, mtimeMs: 0 };
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
withStats.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
570
|
-
const winner = withStats[0];
|
|
571
|
-
log(`Case-collision ambiguous for ${normalizedStem}${ext}: newest mtime wins (${winner.filename})`);
|
|
572
|
-
results.push({ action: 'collision-ten', filePath: winner.fullPath, reason: 'ambiguous-newest-mtime-wins' });
|
|
573
|
-
const tenMsg = `Handshake case-collision: ambiguous filename for stem "${normalizedStem}${ext}" ` +
|
|
574
|
-
`(${members.map((m) => m.filename).join(', ')}). ` +
|
|
575
|
-
`Kept newest: ${winner.filename}. Consider renaming to ${normalizedStem}${ext}.`;
|
|
576
|
-
collisionTens.push(tenMsg);
|
|
577
|
-
for (const member of withStats.slice(1)) {
|
|
578
|
-
try {
|
|
579
|
-
unlinkSync(member.fullPath);
|
|
580
|
-
log(`Case-variant (ambiguous) unlinked: ${member.fullPath}`);
|
|
581
|
-
results.push({ action: 'unlinked', filePath: member.fullPath, reason: 'ambiguous-case-variant-unlinked' });
|
|
582
|
-
}
|
|
583
|
-
catch (err) {
|
|
584
|
-
logErr(`Warning: could not unlink ambiguous case-variant ${member.fullPath} — ${err instanceof Error ? err.message : String(err)}`);
|
|
585
|
-
results.push({ action: 'kept', filePath: member.fullPath, reason: 'unlink-failed' });
|
|
586
|
-
}
|
|
586
|
+
if (!entry)
|
|
587
|
+
continue;
|
|
588
|
+
leftovers.push(entry);
|
|
589
|
+
if (leftovers.length > LEFTOVER_FILES_MAX) {
|
|
590
|
+
truncated = true;
|
|
591
|
+
leftovers.pop();
|
|
592
|
+
break scanLoop;
|
|
587
593
|
}
|
|
588
594
|
}
|
|
589
595
|
}
|
|
590
|
-
|
|
596
|
+
// Nested Cursor skills — extracted to its own module (STD-2/DEC-1504 shrink-only offset).
|
|
597
|
+
// Skipped once the flat scan already hit the cap; the remaining budget keeps the combined
|
|
598
|
+
// total across both scans stopping at LEFTOVER_FILES_MAX + 1.
|
|
599
|
+
if (!truncated && allowedTargets.has('cursor')) {
|
|
600
|
+
const nested = findLeftoverCursorSkills(cwd, cursorSkillNames ?? assetNames, LEFTOVER_FILES_MAX - leftovers.length);
|
|
601
|
+
leftovers.push(...nested.files);
|
|
602
|
+
truncated = nested.truncated;
|
|
603
|
+
}
|
|
604
|
+
return { files: leftovers, truncated };
|
|
605
|
+
}
|
|
606
|
+
/** Round 13 (Codex P1, security): strips a `user:token@` userinfo segment from an https remote
|
|
607
|
+
* so a credential never reaches JSON output. SSH remotes (`git@host:...`) are untouched — that
|
|
608
|
+
* `git@` is a fixed public username, not a secret. */
|
|
609
|
+
function redactGitRemote(remote) {
|
|
610
|
+
return remote ? remote.replace(/^(https?:\/\/)[^@/]+@/i, '$1') : remote;
|
|
611
|
+
}
|
|
612
|
+
/** Round 13 (Codex P1, security): `pb --json handshake` serialized the report directly — leaking
|
|
613
|
+
* an HTTPS git-remote credential and raw Convex `_id`/`_creationTime` on `matchedEntries` (never
|
|
614
|
+
* went through the shared runner's `stripConvexInternals`). One public shape, both JSON paths. */
|
|
615
|
+
function toPublicJsonReport(report) {
|
|
616
|
+
return stripConvexInternals({ ...report, repo: { ...report.repo, gitRemote: redactGitRemote(report.repo.gitRemote) } });
|
|
617
|
+
}
|
|
618
|
+
/** TASK-554 (RULE-659): getOrientView always serves the briefing's facts; a view without them is a broken contract. */
|
|
619
|
+
function servedBriefing(view) {
|
|
620
|
+
if (view.briefing)
|
|
621
|
+
return view.briefing;
|
|
622
|
+
throw new CLIError('The orient view carried no briefing; getOrientView always serves one.', { code: ErrorCode.INTERNAL, category: 'internal' });
|
|
591
623
|
}
|
|
592
624
|
export async function runHandshake(options = {}) {
|
|
593
|
-
const config = await getConfigOrGuide(() => runHandshake(options));
|
|
625
|
+
const config = await getConfigOrGuide(async () => { await runHandshake(options); });
|
|
594
626
|
if (!config)
|
|
595
|
-
return;
|
|
627
|
+
return undefined;
|
|
596
628
|
const cwd = process.cwd();
|
|
597
629
|
const force = options.force ?? false;
|
|
598
630
|
const dryRun = options.dryRun ?? false;
|
|
599
|
-
// Preview mode: default when neither --apply nor --dry-run is passed.
|
|
600
|
-
// --dry-run is kept as a backward-compat alias for preview (same behavior).
|
|
631
|
+
// Preview mode: default when neither --apply nor --dry-run is passed (--dry-run is a backward-compat alias).
|
|
601
632
|
const preview = !options.apply && !dryRun;
|
|
602
633
|
const applyMode = options.apply === true && !dryRun;
|
|
603
634
|
const level = options.level;
|
|
635
|
+
// `quiet` gates the final report write (`--json` alone still prints). `suppressProgress`
|
|
636
|
+
// also silences stdout log() prose in JSON mode. logErr() stays on `quiet` alone (stderr).
|
|
604
637
|
const quiet = options.quiet ?? false;
|
|
605
|
-
const
|
|
638
|
+
const suppressProgress = quiet || isJsonMode();
|
|
606
639
|
const timestamp = new Date().toISOString();
|
|
607
|
-
// Helper: emit progress line only when not
|
|
608
|
-
const log = (msg) => { if (!
|
|
640
|
+
// Helper: emit progress line only when not suppressed. logErr is gated on `quiet` alone.
|
|
641
|
+
const log = (msg) => { if (!suppressProgress)
|
|
609
642
|
process.stdout.write(msg + '\n'); };
|
|
610
643
|
const logErr = (msg) => { if (!quiet)
|
|
611
644
|
process.stderr.write(msg + '\n'); };
|
|
@@ -624,6 +657,21 @@ export async function runHandshake(options = {}) {
|
|
|
624
657
|
if (repo.detectedStack.length > 0) {
|
|
625
658
|
log(`Stack: ${repo.detectedStack.join(', ')}`);
|
|
626
659
|
}
|
|
660
|
+
const startupSignals = deriveHandshakeStartupSignals(cwd, options.startupSignals ?? {});
|
|
661
|
+
const orientArgs = { tier: 'standard' };
|
|
662
|
+
if (options.invocationPath)
|
|
663
|
+
orientArgs.invocationPath = options.invocationPath;
|
|
664
|
+
if (Object.keys(startupSignals).length > 0) {
|
|
665
|
+
orientArgs.startupSignals = startupSignals;
|
|
666
|
+
if (startupSignals.taskText)
|
|
667
|
+
orientArgs.task = startupSignals.taskText;
|
|
668
|
+
}
|
|
669
|
+
// Scopes the role rule lists this orient call returns to THIS session, not a sibling's.
|
|
670
|
+
const activeSession = readSession();
|
|
671
|
+
if (activeSession?.sessionId)
|
|
672
|
+
orientArgs.sessionId = activeSession.sessionId;
|
|
673
|
+
if (activeSession?.conversationId)
|
|
674
|
+
orientArgs.conversationId = activeSession.conversationId;
|
|
627
675
|
// 2. Fetch orient view + workspace readiness in parallel (budget max +200ms added latency)
|
|
628
676
|
log('Fetching workspace context...');
|
|
629
677
|
let orientView = null;
|
|
@@ -631,7 +679,7 @@ export async function runHandshake(options = {}) {
|
|
|
631
679
|
try {
|
|
632
680
|
const workspaceReadinessPromise = kernelCall('chain.workspaceReadiness', {}).catch(() => null);
|
|
633
681
|
const [orientResult, readinessRaw] = await Promise.all([
|
|
634
|
-
kernelCall('chain.getOrientView',
|
|
682
|
+
kernelCall('chain.getOrientView', orientArgs).catch((err) => {
|
|
635
683
|
logErr(`Warning: could not fetch workspace context — ${err instanceof Error ? err.message : err}`);
|
|
636
684
|
logErr('Continuing with limited context (Chain search + portable knowledge only).');
|
|
637
685
|
return null;
|
|
@@ -646,7 +694,7 @@ export async function runHandshake(options = {}) {
|
|
|
646
694
|
logErr('Continuing with limited context (Chain search + portable knowledge only).');
|
|
647
695
|
}
|
|
648
696
|
if (workspaceProfile) {
|
|
649
|
-
log(`Workspace profile:
|
|
697
|
+
log(`Workspace profile: entries=${workspaceProfile.totalEntries}`);
|
|
650
698
|
}
|
|
651
699
|
// 3. Build search queries from repo context
|
|
652
700
|
const searchQueries = [];
|
|
@@ -668,211 +716,56 @@ export async function runHandshake(options = {}) {
|
|
|
668
716
|
const searchResults = await Promise.all(uniqueQueries.map((q) => kernelCall('chain.searchEntries', { query: q }).catch(() => [])));
|
|
669
717
|
matchedEntries = deduplicateEntries(searchResults.flat());
|
|
670
718
|
}
|
|
671
|
-
// 5. Read canonical skills & rules — DB-first (WP-345 S0c, TEN-1459), FS fallback.
|
|
672
|
-
// Primary: query setup.listAssetsForUser from DB (workspace SSOT).
|
|
673
|
-
// Fallback: read from .productbrain/ filesystem (legacy — used when DB is empty or unavailable).
|
|
719
|
+
// 5. Read canonical skills & rules — DB-first (WP-345 S0c, TEN-1459): query setup.listAssetsForUser, FS fallback.
|
|
674
720
|
const pbDir = join(cwd, '.productbrain');
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
const dbProjectionHashes = new Map();
|
|
685
|
-
try {
|
|
686
|
-
// WP-379 S4: listAssetsForUser now returns { activeAssets, dormantAssets }.
|
|
687
|
-
// Wire format changed from DbAsset[] to { activeAssets: DbAsset[], dormantAssets: DbAsset[] }.
|
|
688
|
-
// Fall back to empty arrays if the server returns the old flat-array shape (graceful degradation).
|
|
689
|
-
const rawResponse = await kernelCall('setup.listAssetsForUser', {}).catch(() => null);
|
|
690
|
-
let dbAssets = [];
|
|
691
|
-
if (rawResponse !== null) {
|
|
692
|
-
if (Array.isArray(rawResponse)) {
|
|
693
|
-
// Pre-S4 server — treat entire response as active assets with no dormant list.
|
|
694
|
-
dbAssets = rawResponse;
|
|
695
|
-
dormantDbAssetRows = [];
|
|
696
|
-
hasAnyReceipt = undefined; // unknown on legacy servers
|
|
697
|
-
}
|
|
698
|
-
else {
|
|
699
|
-
dbAssets = rawResponse.activeAssets ?? [];
|
|
700
|
-
dormantDbAssetRows = rawResponse.dormantAssets ?? [];
|
|
701
|
-
// WP-379 S5b: extract hasAnyReceipt when provided by the server.
|
|
702
|
-
// undefined means pre-S5b server — we treat as unknown (no receipts assumed).
|
|
703
|
-
hasAnyReceipt = rawResponse.hasAnyReceipt;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
if (dbAssets.length > 0) {
|
|
707
|
-
dbAssetRows = dbAssets;
|
|
708
|
-
// Map DB assets to CanonicalSkill/CanonicalRule shapes
|
|
709
|
-
for (const asset of dbAssets) {
|
|
710
|
-
if (asset.disabledByOwner)
|
|
711
|
-
continue;
|
|
712
|
-
if (asset.assetKind === 'skill') {
|
|
713
|
-
dbSkills.push({
|
|
714
|
-
name: asset.name,
|
|
715
|
-
description: asset.description,
|
|
716
|
-
triggers: asset.triggers ?? [],
|
|
717
|
-
body: asset.body,
|
|
718
|
-
sourcePath: `db:${asset.entryId}`,
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
else if (asset.assetKind === 'rule' || asset.assetKind === 'hook') {
|
|
722
|
-
dbRules.push({
|
|
723
|
-
name: asset.name,
|
|
724
|
-
description: asset.description,
|
|
725
|
-
autoApply: false,
|
|
726
|
-
body: asset.body,
|
|
727
|
-
sourcePath: `db:${asset.entryId}`,
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
usedDbSource = true;
|
|
732
|
-
log(`Setup assets: ${dbSkills.length} skills, ${dbRules.length} rules/hooks from DB (WP-345 DB-first path)`);
|
|
733
|
-
if (dormantDbAssetRows.length > 0) {
|
|
734
|
-
log(`Setup assets: ${dormantDbAssetRows.length} dormant (gate-filtered) asset(s) will be marked on disk`);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
catch {
|
|
739
|
-
// DB source unavailable — silently fall through to FS path
|
|
721
|
+
const manifestStatus = readManifestStatus(pbDir);
|
|
722
|
+
const manifest = manifestStatus.manifest;
|
|
723
|
+
const surfaceValidation = validateSurfacesForMode(manifestStatus.mode, manifestStatus.surfaces);
|
|
724
|
+
if (applyMode && surfaceValidation.error === SURFACE_GOVERN_NO_SURFACES) {
|
|
725
|
+
throw new CLIError('materialize: govern requires at least one registered manifest surface.', {
|
|
726
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
727
|
+
category: 'validation',
|
|
728
|
+
guidance: 'Add surfaces such as `.cursor` or `.claude` to .productbrain/manifest.yaml.',
|
|
729
|
+
});
|
|
740
730
|
}
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
if (!usedDbSource) {
|
|
744
|
-
log('Setup assets: reading from filesystem (DB source unavailable or empty)');
|
|
731
|
+
for (const surface of surfaceValidation.unregisteredSurfaces) {
|
|
732
|
+
logErr(`Warning: manifest surface "${surface}" is not registered; skipping it.`);
|
|
745
733
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
if (assetsWithRefs.length > 0) {
|
|
754
|
-
log(`Resolving semantic refs for ${assetsWithRefs.length} asset(s)...`);
|
|
755
|
-
// Collect unique ref keys across all assets
|
|
756
|
-
const allRefKeys = [...new Set(assetsWithRefs.flatMap((a) => a.semanticRefs))];
|
|
757
|
-
// Resolve all refs in a single batch call. Shape: SetupRefResolution[]
|
|
758
|
-
// (DEC-767 / WP-354 Build-Order #6 — kind + status discriminator).
|
|
759
|
-
let resolvedRefs = [];
|
|
760
|
-
try {
|
|
761
|
-
resolvedRefs = await kernelCall('setup.resolveSemanticRefs', { semanticRefs: allRefKeys });
|
|
762
|
-
}
|
|
763
|
-
catch (err) {
|
|
764
|
-
trackEvent('setup.refs.resolve_failed', { error: err instanceof Error ? err.message : String(err) });
|
|
765
|
-
logErr(`Warning: could not resolve semantic refs — ${err instanceof Error ? err.message : String(err)}`);
|
|
766
|
-
}
|
|
767
|
-
// Build resolved map: canonicalKey → display name. Only required refs
|
|
768
|
-
// count as unresolved warnings; seed/unknown refs are not gates.
|
|
769
|
-
const resolvedMap = new Map();
|
|
770
|
-
let unresolvedCount = 0;
|
|
771
|
-
for (const result of resolvedRefs) {
|
|
772
|
-
if (result.status === 'resolved' && result.localEntryId) {
|
|
773
|
-
resolvedMap.set(result.ref, result.localEntryId);
|
|
774
|
-
trackEvent('skill.ref.resolved', { ref: result.ref, kind: result.kind });
|
|
775
|
-
}
|
|
776
|
-
else if (result.status === 'unsupported-future') {
|
|
777
|
-
// seed: refs are explicitly future scope per WP-354 Build-Order #6 — not a warning.
|
|
778
|
-
trackEvent('skill.ref.future', { ref: result.ref, kind: result.kind });
|
|
779
|
-
}
|
|
780
|
-
else if (result.required) {
|
|
781
|
-
unresolvedCount++;
|
|
782
|
-
trackEvent('skill.ref.unresolved', { ref: result.ref, kind: result.kind, status: result.status });
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
if (unresolvedCount > 0) {
|
|
786
|
-
logErr(`Warning: ${unresolvedCount} required semantic ref(s) could not be resolved.`);
|
|
787
|
-
}
|
|
788
|
-
// Projection must preserve ref tokens as portable machine-readable refs.
|
|
789
|
-
// resolvedMap is only used for validation/telemetry here; generated setup
|
|
790
|
-
// artifacts keep {{ref:domain:...}} / {{ref:entry:...}} intact.
|
|
791
|
-
}
|
|
792
|
-
// Compute projection hash for each projected DB asset (DEC-K).
|
|
793
|
-
// The stored hash is sha256 of the normalized resolved asset body; DB persistence
|
|
794
|
-
// is deferred until the write loop confirms a matching file was emitted.
|
|
795
|
-
// Strip existing hash trailer and timestamp lines, normalize to LF, then hash.
|
|
796
|
-
const HASH_TRAILER_REGEX = /^<!--\s*pb-hash:.*-->\s*$/gm;
|
|
797
|
-
const TIMESTAMP_REGEX = /^<!--\s*pb-generated-at:.*-->\s*$/gm;
|
|
798
|
-
for (const rawAsset of projectableDbAssets) {
|
|
799
|
-
const resolvedAsset = [...dbSkills, ...dbRules].find((a) => a.sourcePath === `db:${rawAsset.entryId}`);
|
|
800
|
-
if (!resolvedAsset)
|
|
801
|
-
continue;
|
|
802
|
-
try {
|
|
803
|
-
// Build the projected body (what will be written to disk)
|
|
804
|
-
const projectedBody = resolvedAsset.body;
|
|
805
|
-
// Normalize: strip existing hash/timestamp trailers, convert to LF
|
|
806
|
-
const normalized = projectedBody
|
|
807
|
-
.replace(HASH_TRAILER_REGEX, '')
|
|
808
|
-
.replace(TIMESTAMP_REGEX, '')
|
|
809
|
-
.replace(/\r\n/g, '\n')
|
|
810
|
-
.replace(/\r/g, '\n')
|
|
811
|
-
.trimEnd();
|
|
812
|
-
// Compute sha256 hash
|
|
813
|
-
const hash = createHash('sha256').update(normalized, 'utf8').digest('hex');
|
|
814
|
-
const hashTrailer = `<!-- pb-hash: sha256:${hash} -->`;
|
|
815
|
-
// Append hash trailer to the projected body
|
|
816
|
-
resolvedAsset.body = `${normalized}\n${hashTrailer}`;
|
|
817
|
-
dbProjectionHashes.set(rawAsset.entryId, {
|
|
818
|
-
hash: `sha256:${hash}`,
|
|
819
|
-
assetKind: rawAsset.assetKind,
|
|
820
|
-
});
|
|
821
|
-
// Drift detection: compare against last known hash
|
|
822
|
-
if (rawAsset.lastProjectedHash && rawAsset.lastProjectedHash !== `sha256:${hash}`) {
|
|
823
|
-
trackEvent('skill.drift.detected', {
|
|
824
|
-
entryId: rawAsset.entryId,
|
|
825
|
-
assetKind: rawAsset.assetKind,
|
|
826
|
-
});
|
|
827
|
-
log(`Drift detected for asset ${rawAsset.entryId} — projecting updated version.`);
|
|
828
|
-
}
|
|
829
|
-
trackEvent('skill.projection.succeeded', {
|
|
830
|
-
entryId: rawAsset.entryId,
|
|
831
|
-
assetKind: rawAsset.assetKind,
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
catch (err) {
|
|
835
|
-
trackEvent('skill.projection.failed', {
|
|
836
|
-
entryId: rawAsset.entryId,
|
|
837
|
-
assetKind: rawAsset.assetKind,
|
|
838
|
-
});
|
|
839
|
-
logErr(`Warning: projection failed for ${rawAsset.entryId} — ${err instanceof Error ? err.message : String(err)}`);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
// 5a. Optionally fetch and merge Chain-derived rules (--generate flag)
|
|
844
|
-
let chainRulesStats = null;
|
|
845
|
-
let chainGaps = [];
|
|
846
|
-
let allRules = manualRules;
|
|
847
|
-
if (generate) {
|
|
848
|
-
log('Generating Chain-derived rules...');
|
|
849
|
-
const chainResult = await generateChainRules(kernelCall, manualRules);
|
|
850
|
-
if (chainResult.sentinel) {
|
|
851
|
-
// MCP unavailable — inject sentinel rule and warn
|
|
852
|
-
allRules = [...manualRules, chainResult.sentinel];
|
|
853
|
-
logErr('Warning: Chain MCP unavailable — generated rules are disabled. Sentinel rule injected.');
|
|
734
|
+
const manifestTargets = new Set(surfaceValidation.registeredSurfaces);
|
|
735
|
+
const cliTargets = new Set();
|
|
736
|
+
const ignoredCliSurfaces = [];
|
|
737
|
+
for (const surface of options.surfaces ?? []) {
|
|
738
|
+
const normalized = normalizeSurfaceName(surface);
|
|
739
|
+
if (normalized && manifestTargets.has(normalized)) {
|
|
740
|
+
cliTargets.add(normalized);
|
|
854
741
|
}
|
|
855
742
|
else {
|
|
856
|
-
|
|
857
|
-
allRules = [...manualRules, ...chainResult.rules];
|
|
858
|
-
chainRulesStats = chainResult.stats;
|
|
859
|
-
chainGaps = chainResult.gaps;
|
|
860
|
-
const { generatedRules, suppressedByManual, suppressedByZeroEntries } = chainResult.stats;
|
|
861
|
-
log(`Chain-derived rules: ${generatedRules} generated, ${suppressedByManual} suppressed by manual, ${suppressedByZeroEntries} gaps`);
|
|
862
|
-
if (chainGaps.length > 0) {
|
|
863
|
-
log(`Gaps (no matching governance entries): ${chainGaps.join(', ')}`);
|
|
864
|
-
}
|
|
865
|
-
// Diff: compare current state against previous run
|
|
866
|
-
const previousState = loadPreviousState(pbDir);
|
|
867
|
-
const currentState = buildCurrentState(chainResult.rules, chainResult.classified);
|
|
868
|
-
saveHandshakeState(pbDir, chainResult.rules, chainResult.classified);
|
|
869
|
-
const diff = diffHandshakeState(currentState, previousState);
|
|
870
|
-
const diffText = formatDiff(diff);
|
|
871
|
-
log(diffText);
|
|
743
|
+
ignoredCliSurfaces.push(surface);
|
|
872
744
|
}
|
|
873
745
|
}
|
|
874
|
-
|
|
875
|
-
|
|
746
|
+
if (ignoredCliSurfaces.length > 0) {
|
|
747
|
+
logErr(`Warning: --surfaces ignored outside manifest.surfaces: ${ignoredCliSurfaces.join(', ')}`);
|
|
748
|
+
}
|
|
749
|
+
const allowedTargets = options.surfaces && options.surfaces.length > 0
|
|
750
|
+
? cliTargets
|
|
751
|
+
: manifestTargets;
|
|
752
|
+
const perimeterManifest = {
|
|
753
|
+
surfaces: [...manifestTargets].flatMap(surfacePerimeterRoots),
|
|
754
|
+
};
|
|
755
|
+
const authorityCanWrite = manifestStatus.mode === 'project' || manifestStatus.mode === 'govern';
|
|
756
|
+
const authorityPreviewOnly = applyMode && !authorityCanWrite;
|
|
757
|
+
const writeMode = applyMode && authorityCanWrite;
|
|
758
|
+
// TASK-554 (TEN-4036): materialize governs the coding-tool surfaces (DEC-951). PB's own files
|
|
759
|
+
// under .productbrain/ (context.md, briefing.md, generated/) refresh on every --apply wherever
|
|
760
|
+
// that folder exists; mode `off` means it does not (DEC-955), and then nothing is created.
|
|
761
|
+
const pbOwnedWriteMode = applyMode && manifestStatus.mode !== 'off';
|
|
762
|
+
// Skills and rules are read from the filesystem only (WP-776 S3f, DEC-1771).
|
|
763
|
+
const allSkills = readCanonicalSkills(pbDir);
|
|
764
|
+
const manualRules = readCanonicalRules(pbDir);
|
|
765
|
+
// The --generate flag and its chain-rules generator are gone: the everyone/team/role rule lists
|
|
766
|
+
// (DEC-1774) are the rule-delivery path (context.md, chain.mdc, everyone-rules.md).
|
|
767
|
+
let allRules = manualRules;
|
|
768
|
+
// 5b. Read personal layer (WP-310 E2) — machine-local rules/skills from .productbrain/.local/, [] if absent, all persist: 'local'.
|
|
876
769
|
const personalRules = readPersonalLayer(pbDir);
|
|
877
770
|
if (personalRules.length > 0) {
|
|
878
771
|
// Name collision detection — warn when a personal rule overrides a team rule
|
|
@@ -895,14 +788,12 @@ export async function runHandshake(options = {}) {
|
|
|
895
788
|
}
|
|
896
789
|
allSkills.push(...personalSkills);
|
|
897
790
|
}
|
|
898
|
-
//
|
|
899
|
-
//
|
|
900
|
-
const manifest = readManifest(pbDir);
|
|
901
|
-
// 5d. Load method registry (WP-310 E4) — only when manifest is present.
|
|
791
|
+
// 5d. Load method registry (WP-310 E4) — only when manifest is present. Unrelated to the
|
|
792
|
+
// setup-assets system (WP-329's own "methods" Chain collection, no setup.* coupling) — kept.
|
|
902
793
|
let registrySource;
|
|
903
794
|
let registryStale;
|
|
904
795
|
if (manifest) {
|
|
905
|
-
const registryResult = await loadMethodRegistry(
|
|
796
|
+
const registryResult = await loadMethodRegistry().catch(() => null);
|
|
906
797
|
if (registryResult) {
|
|
907
798
|
registrySource = registryResult.source;
|
|
908
799
|
registryStale = registryResult.stale;
|
|
@@ -913,24 +804,10 @@ export async function runHandshake(options = {}) {
|
|
|
913
804
|
// Compute adoption counts for report (only meaningful when manifest is present)
|
|
914
805
|
const adoptedRulesCount = manifest ? adoptionFilteredRules.length : undefined;
|
|
915
806
|
const rejectedRulesCount = manifest ? allRules.length - adoptionFilteredRules.length : undefined;
|
|
916
|
-
//
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
const levelFilteredSkills = filterByLevel(adoptionFilteredSkills, level, profileStage);
|
|
921
|
-
const levelFilteredRules = filterByLevel(adoptionFilteredRules, level, profileStage);
|
|
922
|
-
// Log when stage gating changes the effective level
|
|
923
|
-
if (profileStage) {
|
|
924
|
-
const stageCap = STAGE_TO_MAX_LEVEL[profileStage];
|
|
925
|
-
if (stageCap) {
|
|
926
|
-
const requestedIdx = level ? LEVEL_ORDER.indexOf(level) : LEVEL_ORDER.length - 1;
|
|
927
|
-
const capIdx = LEVEL_ORDER.indexOf(stageCap);
|
|
928
|
-
if (capIdx < requestedIdx) {
|
|
929
|
-
log(`Stage "${profileStage}" caps level from ${level || 'expert'} to ${stageCap}`);
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
// Apply when-condition filtering (stage-aware, workspace profile + repo context)
|
|
807
|
+
// Level filtering: requested level only (WP-762 C4e-2, DEC-1800 — no more stage cap).
|
|
808
|
+
const levelFilteredSkills = filterByLevel(adoptionFilteredSkills, level);
|
|
809
|
+
const levelFilteredRules = filterByLevel(adoptionFilteredRules, level);
|
|
810
|
+
// Apply when-condition filtering (workspace profile + repo context)
|
|
934
811
|
const canonicalSkills = levelFilteredSkills.filter((skill) => {
|
|
935
812
|
const result = evaluateConditions(skill.conditions ?? {}, workspaceProfile, repo);
|
|
936
813
|
if (dryRun && !result.included) {
|
|
@@ -951,26 +828,23 @@ export async function runHandshake(options = {}) {
|
|
|
951
828
|
if (dryRun && canonicalRules.length > 0) {
|
|
952
829
|
log(` INCLUDED rules: ${canonicalRules.map((r) => r.name).join(', ')}`);
|
|
953
830
|
}
|
|
831
|
+
const noProjectionAssets = findNoProjectionAssets(canonicalSkills, canonicalRules);
|
|
954
832
|
if (canonicalSkills.length > 0 || canonicalRules.length > 0) {
|
|
955
833
|
const levelSuffix = level ? ` (level: ${level})` : '';
|
|
956
|
-
const stageSuffix = profileStage ? `, stage: ${profileStage}` : '';
|
|
957
834
|
const stackSuffix = repo.detectedStack.length > 0 ? `, stack: [${repo.detectedStack.join(', ')}]` : '';
|
|
958
835
|
const totalSkills = allSkills.length;
|
|
959
836
|
const totalRules = allRules.length;
|
|
960
|
-
log(`Portable knowledge: ${canonicalSkills.length}/${totalSkills} skills, ${canonicalRules.length}/${totalRules} rules${levelSuffix}${
|
|
837
|
+
log(`Portable knowledge: ${canonicalSkills.length}/${totalSkills} skills, ${canonicalRules.length}/${totalRules} rules${levelSuffix}${stackSuffix}`);
|
|
961
838
|
}
|
|
962
839
|
// 6. Generate file contents
|
|
963
|
-
// Build workspace context for AGENTS.md enrichment (
|
|
840
|
+
// Build workspace context for AGENTS.md enrichment (focus, entry count) — TASK-435 (C4c) deleted `stage` from it.
|
|
964
841
|
const agentsWorkspaceContext = workspaceProfile
|
|
965
842
|
? {
|
|
966
|
-
|
|
967
|
-
focus: orientView?.strategicContext?.currentBet ?? undefined,
|
|
968
|
-
governanceMode: workspaceProfile.governanceMode,
|
|
843
|
+
focus: orientView?.strategicContext?.currentWorkPackage ?? undefined,
|
|
969
844
|
totalEntries: workspaceProfile.totalEntries,
|
|
970
845
|
}
|
|
971
846
|
: undefined;
|
|
972
|
-
// Collect codex-targeted skills for AGENTS.md skill directory
|
|
973
|
-
// Exclude persist: 'local' rules — committed adapter files must never include local-only rules.
|
|
847
|
+
// Collect codex-targeted skills for AGENTS.md skill directory — persist: 'local' entries included (all projections are local-only now).
|
|
974
848
|
const agentsCodexSkills = canonicalSkills
|
|
975
849
|
.filter((s) => shouldEmitToTarget(s, 'codex'))
|
|
976
850
|
.map((s) => ({
|
|
@@ -1000,15 +874,27 @@ export async function runHandshake(options = {}) {
|
|
|
1000
874
|
skills: copilotSkills.length > 0 ? copilotSkills : undefined,
|
|
1001
875
|
rules: copilotRules.length > 0 ? copilotRules : undefined,
|
|
1002
876
|
};
|
|
1003
|
-
|
|
877
|
+
// TASK-554 (WP-777, DEC-1888): one workspace briefing (spine and the Everyone rule list, from
|
|
878
|
+
// the kernel builder) feeds context.md, everyone-rules.md and chain.mdc. `null` means the orient
|
|
879
|
+
// fetch failed: the two briefing files are not written (and a stale copy is removed in apply
|
|
880
|
+
// mode below), and chain.mdc says the briefing is unavailable.
|
|
881
|
+
const workspaceBriefingLines = orientView ? formatWorkspaceBriefingLines(servedBriefing(orientView), orientView.ruleLists) : null;
|
|
882
|
+
const contextContent = orientView && workspaceBriefingLines ? generateContextMd(orientView, workspaceBriefingLines, repo, timestamp) : null;
|
|
883
|
+
const everyoneRulesContent = workspaceBriefingLines ? generateEveryoneRulesMd(workspaceBriefingLines, timestamp) : null;
|
|
1004
884
|
const briefingContent = generateBriefingMd(matchedEntries, repo, uniqueQueries, timestamp);
|
|
1005
885
|
const agentsContent = generateAgentsMd(timestamp, {
|
|
1006
886
|
workspaceContext: agentsWorkspaceContext,
|
|
1007
887
|
skills: agentsCodexSkills.length > 0 ? agentsCodexSkills : undefined,
|
|
1008
888
|
});
|
|
1009
889
|
const claudeContent = generateClaudeMd(timestamp);
|
|
1010
|
-
const cursorContent = generateCursorMdc(timestamp);
|
|
890
|
+
const cursorContent = generateCursorMdc(timestamp, workspaceBriefingLines);
|
|
1011
891
|
const copilotContent = generateCopilotMd(timestamp, copilotOptions);
|
|
892
|
+
// DEC-1343: one committed .github/instructions/<slug>.instructions.md per copilot rule with applyTo; repo-wide rules stay above.
|
|
893
|
+
const copilotInstructionFiles = generateCopilotInstructionFiles(canonicalRules
|
|
894
|
+
.filter((r) => shouldEmitToTarget(r, 'copilot'))
|
|
895
|
+
// `.github/instructions/` is COMMITTED — never project a machine-local (persist: 'local') rule into it.
|
|
896
|
+
.filter((r) => r.persist !== 'local')
|
|
897
|
+
.map((r) => ({ name: r.name, body: r.body, applyTo: r.applyTo, sourcePath: r.sourcePath })), timestamp);
|
|
1012
898
|
const boundaryEnforcementMode = getBoundaryEnforcementMode(manifest);
|
|
1013
899
|
const boundaryManifestContent = boundaryEnforcementMode === 'advisory'
|
|
1014
900
|
? null
|
|
@@ -1017,17 +903,30 @@ export async function runHandshake(options = {}) {
|
|
|
1017
903
|
const filesWritten = [];
|
|
1018
904
|
const filesSkipped = [];
|
|
1019
905
|
const previewPlan = [];
|
|
1020
|
-
// Surface filtering: skip adapter writes for targets not in the allowed set
|
|
1021
|
-
const allowedTargets = options.surfaces && options.surfaces.length > 0
|
|
1022
|
-
? new Set(options.surfaces)
|
|
1023
|
-
: null; // null = write all
|
|
1024
906
|
const writes = [
|
|
1025
907
|
...(contextContent ? [{ path: join(cwd, '.productbrain', 'context.md'), relative: '.productbrain/context.md', content: contextContent, dirs: join(cwd, '.productbrain'), isAdapter: false }] : []),
|
|
908
|
+
...(everyoneRulesContent
|
|
909
|
+
? [{
|
|
910
|
+
path: join(cwd, '.productbrain', 'generated', 'everyone-rules.md'),
|
|
911
|
+
relative: '.productbrain/generated/everyone-rules.md',
|
|
912
|
+
content: everyoneRulesContent,
|
|
913
|
+
dirs: join(cwd, '.productbrain', 'generated'),
|
|
914
|
+
isAdapter: false,
|
|
915
|
+
}]
|
|
916
|
+
: []),
|
|
1026
917
|
{ path: join(cwd, '.productbrain', 'briefing.md'), relative: '.productbrain/briefing.md', content: briefingContent, isAdapter: false },
|
|
1027
|
-
{ path: join(cwd, 'AGENTS.md'), relative: 'AGENTS.md', content: agentsContent, isAdapter: true, target: 'codex' },
|
|
1028
|
-
{ path: join(cwd, 'CLAUDE.md'), relative: 'CLAUDE.md', content: claudeContent, isAdapter: true, target: 'claude' },
|
|
918
|
+
{ path: join(cwd, 'AGENTS.md'), relative: 'AGENTS.md', content: agentsContent, isAdapter: true, target: 'codex', augmentTarget: true },
|
|
919
|
+
{ path: join(cwd, 'CLAUDE.md'), relative: 'CLAUDE.md', content: claudeContent, isAdapter: true, target: 'claude', augmentTarget: true },
|
|
1029
920
|
{ path: join(cwd, '.cursor', 'rules', 'chain.mdc'), relative: '.cursor/rules/chain.mdc', content: cursorContent, dirs: join(cwd, '.cursor', 'rules'), isAdapter: true, target: 'cursor' },
|
|
1030
921
|
{ path: join(cwd, '.github', 'copilot-instructions.md'), relative: '.github/copilot-instructions.md', content: copilotContent, dirs: join(cwd, '.github'), isAdapter: true, target: 'copilot' },
|
|
922
|
+
...copilotInstructionFiles.map((f) => ({
|
|
923
|
+
path: join(cwd, f.relativePath),
|
|
924
|
+
relative: f.relativePath,
|
|
925
|
+
content: f.content,
|
|
926
|
+
dirs: join(cwd, '.github', 'instructions'),
|
|
927
|
+
isAdapter: true,
|
|
928
|
+
target: 'copilot',
|
|
929
|
+
})),
|
|
1031
930
|
...(boundaryManifestContent ? [{
|
|
1032
931
|
path: join(cwd, '.productbrain', 'generated', 'boundaries.json'),
|
|
1033
932
|
relative: '.productbrain/generated/boundaries.json',
|
|
@@ -1093,76 +992,163 @@ export async function runHandshake(options = {}) {
|
|
|
1093
992
|
dbAssetEntryId,
|
|
1094
993
|
});
|
|
1095
994
|
}
|
|
1096
|
-
//
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
});
|
|
995
|
+
// 7a. WP-379 S5b: find leftover projections (apply mode) — REPORT-ONLY (coordinator ruling, PR
|
|
996
|
+
// #912 round 10), see findLeftoverProjections's own header. WP-776 S3f: gated on writeMode
|
|
997
|
+
// alone now — the DB source (dbQuerySucceeded) is gone, so activeAssetNames comes from the
|
|
998
|
+
// filesystem-sourced allSkills/allRules (which already include the personal layer, merged in
|
|
999
|
+
// above) instead of dbAssetRows.
|
|
1000
|
+
let leftoverFiles = [];
|
|
1001
|
+
let leftoverFilesTruncated = false;
|
|
1002
|
+
// TASK-554 (RULE-659): a failed orient fetch is named in the report, and apply removes stale briefing copies.
|
|
1003
|
+
if (orientView === null) {
|
|
1004
|
+
for (const path of ['.productbrain/context.md', '.productbrain/generated/everyone-rules.md'])
|
|
1005
|
+
filesSkipped.push({ path, reason: 'briefing unavailable — the orient fetch failed' });
|
|
1006
|
+
const stale = pbOwnedWriteMode ? removeStaleBriefingProjections(cwd) : [];
|
|
1007
|
+
if (stale.length > 0)
|
|
1008
|
+
logErr(`Warning: the workspace briefing could not be fetched; removed the stale ${stale.join(', ')}.`);
|
|
1111
1009
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1010
|
+
if (writeMode) {
|
|
1011
|
+
retireGeneratedProjections(cwd, log);
|
|
1012
|
+
const activeAssetNames = [
|
|
1013
|
+
...allSkills.map((s) => s.name),
|
|
1014
|
+
...allRules.map((r) => r.name),
|
|
1015
|
+
];
|
|
1016
|
+
// Nested .cursor/skills scan gets its OWN canon: canonicalSkills is SKILL-kind only and
|
|
1017
|
+
// shouldEmitToTarget(_, 'cursor') respects per-skill target routing.
|
|
1018
|
+
const cursorSkillNames = canonicalSkills.filter((s) => shouldEmitToTarget(s, 'cursor')).map((s) => s.name);
|
|
1019
|
+
// Round 11: exempt exact write-plan paths from the leftover scan (see findLeftoverProjections's own doc).
|
|
1020
|
+
const exactRelativePaths = new Set(writes.map((w) => w.relative));
|
|
1021
|
+
const scanResult = findLeftoverProjections(cwd, activeAssetNames, allowedTargets, cursorSkillNames, exactRelativePaths);
|
|
1022
|
+
leftoverFiles = scanResult.files;
|
|
1023
|
+
leftoverFilesTruncated = scanResult.truncated;
|
|
1124
1024
|
}
|
|
1125
|
-
//
|
|
1126
|
-
//
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1025
|
+
// ── WP-436 S3: Vocab projector — fetch workspace vocab context once per handshake. Source-side
|
|
1026
|
+
// stays tokenized; resolves {{vocab:...}} before writing. Fail-open: a failed fetch writes the raw token.
|
|
1027
|
+
const handshakeVocabCtx = await getOrFetchVocabCtx(config.apiKey, async () => {
|
|
1028
|
+
try {
|
|
1029
|
+
const vocab = await kernelCall('chain.getVocabulary', {});
|
|
1030
|
+
if (vocab?.collectionLabels || vocab?.collectionDefaults) {
|
|
1031
|
+
return {
|
|
1032
|
+
...(vocab.collectionLabels ? { collectionLabels: vocab.collectionLabels } : {}),
|
|
1033
|
+
...(vocab.collectionDefaults ? { collectionDefaults: vocab.collectionDefaults } : {}),
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
return null;
|
|
1037
|
+
}
|
|
1038
|
+
catch {
|
|
1039
|
+
return null; // fail-open
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
const userOwnedSkipped = [];
|
|
1043
|
+
const cleanBucketPaths = [];
|
|
1044
|
+
const tamperedBucket = [];
|
|
1045
|
+
// TEN-2155: region augmentation context + symlink dedupe — codexActive gates the AGENTS.md skills-index pointer.
|
|
1046
|
+
const regionCtx = { codexActive: allowedTargets.has('codex') };
|
|
1047
|
+
const malformedRegionPaths = [];
|
|
1048
|
+
// Same inode for two augment targets (e.g. CLAUDE.md symlinked to AGENTS.md): augment only first-seen.
|
|
1049
|
+
const seenAugmentRealpaths = new Set();
|
|
1050
|
+
const augmentTargetSkip = new Set();
|
|
1051
|
+
for (const w of writes) {
|
|
1052
|
+
if (!w.augmentTarget || !w.target || !allowedTargets.has(w.target) || !existsSync(w.path))
|
|
1053
|
+
continue;
|
|
1054
|
+
let real;
|
|
1055
|
+
try {
|
|
1056
|
+
real = realpathSync(w.path);
|
|
1057
|
+
}
|
|
1058
|
+
catch {
|
|
1059
|
+
real = w.path;
|
|
1060
|
+
}
|
|
1061
|
+
if (seenAugmentRealpaths.has(real))
|
|
1062
|
+
augmentTargetSkip.add(w.path);
|
|
1063
|
+
else
|
|
1064
|
+
seenAugmentRealpaths.add(real);
|
|
1138
1065
|
}
|
|
1139
|
-
const forkedPaths = [];
|
|
1140
|
-
const projectedHashUpdates = new Map();
|
|
1141
|
-
const recordProjectedHash = (entryId) => {
|
|
1142
|
-
if (!applyMode || !entryId)
|
|
1143
|
-
return;
|
|
1144
|
-
const projection = dbProjectionHashes.get(entryId);
|
|
1145
|
-
if (projection)
|
|
1146
|
-
projectedHashUpdates.set(entryId, projection.hash);
|
|
1147
|
-
};
|
|
1148
1066
|
for (const w of writes) {
|
|
1149
1067
|
// Surface filtering: skip adapter writes for targets not in the allowed set
|
|
1150
|
-
if (
|
|
1068
|
+
if (w.target && !allowedTargets.has(w.target)) {
|
|
1151
1069
|
filesSkipped.push({ path: w.relative, reason: `filtered (surface: ${w.target})` });
|
|
1152
1070
|
if (preview)
|
|
1153
1071
|
previewPlan.push({ path: w.relative, status: 'filtered' });
|
|
1154
1072
|
continue;
|
|
1155
1073
|
}
|
|
1074
|
+
// ── TEN-2155: augment user-owned CLAUDE.md / AGENTS.md with a marked PB region — runs ahead
|
|
1075
|
+
// of the legacy MARKER gates; absent/legacy-pb-managed fall through to the legacy path.
|
|
1076
|
+
if (w.augmentTarget) {
|
|
1077
|
+
const projection = REGION_PROJECTIONS[w.target];
|
|
1078
|
+
if (projection && existsSync(w.path)) {
|
|
1079
|
+
if (augmentTargetSkip.has(w.path)) {
|
|
1080
|
+
filesSkipped.push({ path: w.relative, reason: 'symlinked to another augment target — augmented once' });
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
const disk = readFileSync(w.path, 'utf8');
|
|
1084
|
+
const cls = classifyAdapterFile(disk);
|
|
1085
|
+
if (cls === 'augmentable' || cls === 'region-present') {
|
|
1086
|
+
const eol = detectEol(disk);
|
|
1087
|
+
const region = replaceVocabTokens(projection.build(regionCtx, eol), handshakeVocabCtx);
|
|
1088
|
+
// Defense-in-depth: the composed region (post vocab-token resolution) must itself be a
|
|
1089
|
+
// single well-formed region. v1 content has no vocab tokens so this is a no-op, but it
|
|
1090
|
+
// guards the documented future override/vocab seam from injecting a stray sentinel/MARKER.
|
|
1091
|
+
if (classifyAdapterFile(region) !== 'region-present') {
|
|
1092
|
+
filesSkipped.push({ path: w.relative, reason: 'internal: composed PB region malformed — skipped to protect your file' });
|
|
1093
|
+
if (preview)
|
|
1094
|
+
previewPlan.push({ path: w.relative, status: 'needs-attention' });
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
const candidate = cls === 'augmentable' ? spliceAppend(disk, region, eol) : spliceReplace(disk, region);
|
|
1098
|
+
if (candidate === disk) {
|
|
1099
|
+
filesSkipped.push({ path: w.relative, reason: 'unchanged' });
|
|
1100
|
+
if (preview)
|
|
1101
|
+
previewPlan.push({ path: w.relative, status: 'unchanged' });
|
|
1102
|
+
continue;
|
|
1103
|
+
}
|
|
1104
|
+
if (preview || dryRun) {
|
|
1105
|
+
filesWritten.push(w.relative + (dryRun ? ' (dry run)' : ''));
|
|
1106
|
+
if (preview)
|
|
1107
|
+
previewPlan.push({ path: w.relative, status: 'would-augment' });
|
|
1108
|
+
continue;
|
|
1109
|
+
}
|
|
1110
|
+
if (authorityPreviewOnly) {
|
|
1111
|
+
// apply + materialize observe/off: honor authority — do NOT write; mirror the legacy
|
|
1112
|
+
// preview-only skip so the report does not falsely list it as written.
|
|
1113
|
+
filesSkipped.push({ path: w.relative, reason: `preview-only (materialize: ${manifestStatus.mode})` });
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
assertSetupWritePath(w.path, perimeterManifest);
|
|
1117
|
+
writeFileSync(w.path, candidate);
|
|
1118
|
+
filesWritten.push(w.relative);
|
|
1119
|
+
continue;
|
|
1120
|
+
}
|
|
1121
|
+
if (cls === 'malformed') {
|
|
1122
|
+
filesSkipped.push({ path: w.relative, reason: 'malformed PB region — left untouched; fix the pb:region sentinels' });
|
|
1123
|
+
if (preview)
|
|
1124
|
+
previewPlan.push({ path: w.relative, status: 'needs-attention' });
|
|
1125
|
+
malformedRegionPaths.push(w.relative);
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
// cls 'pb-managed' falls through to legacy re-projection; 'opt-out' (pb:no-augment) falls through to the user-owned skip.
|
|
1129
|
+
}
|
|
1130
|
+
// absent file → fall through to legacy whole-file CREATE.
|
|
1131
|
+
}
|
|
1156
1132
|
if (w.isAdapter && !shouldWriteAdapter(w.path, force)) {
|
|
1157
|
-
|
|
1133
|
+
// User-owned: a file at an adapter path without our auto-gen MARKER is the
|
|
1134
|
+
// user's own file. Leave it untouched — never overwrite, never treat as drift
|
|
1135
|
+
// or log a TEN (TEN-2150). Relayed to the connect screen via userOwnedSkipped.
|
|
1136
|
+
filesSkipped.push({ path: w.relative, reason: 'user-owned — left untouched (pb won\'t overwrite your file)' });
|
|
1158
1137
|
if (preview) {
|
|
1159
|
-
previewPlan.push({ path: w.relative, status: '
|
|
1138
|
+
previewPlan.push({ path: w.relative, status: 'user-owned' });
|
|
1160
1139
|
}
|
|
1161
1140
|
else {
|
|
1162
|
-
|
|
1141
|
+
userOwnedSkipped.push(w.relative);
|
|
1163
1142
|
}
|
|
1164
1143
|
continue;
|
|
1165
1144
|
}
|
|
1145
|
+
if (w.isAdapter ? authorityPreviewOnly : applyMode && !pbOwnedWriteMode) {
|
|
1146
|
+
filesSkipped.push({
|
|
1147
|
+
path: w.relative,
|
|
1148
|
+
reason: `preview-only (materialize: ${manifestStatus.mode})`,
|
|
1149
|
+
});
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1166
1152
|
if (preview || dryRun) {
|
|
1167
1153
|
// In preview/dry-run mode: check content to distinguish new/update/unchanged
|
|
1168
1154
|
if (existsSync(w.path)) {
|
|
@@ -1187,140 +1173,150 @@ export async function runHandshake(options = {}) {
|
|
|
1187
1173
|
}
|
|
1188
1174
|
continue;
|
|
1189
1175
|
}
|
|
1176
|
+
// ── WP-421 S3: defer tampered adapter writes (doneWhen #17) — classify pb-managed-clean vs
|
|
1177
|
+
// pb-managed-tampered, deferred not overwritten; post-loop resolves. --force bypasses the defer.
|
|
1178
|
+
if (w.isAdapter && !force) {
|
|
1179
|
+
const drift = classifyDriftBucket(w.path);
|
|
1180
|
+
if (drift && drift.bucket === 'pb-managed-tampered') {
|
|
1181
|
+
tamperedBucket.push({
|
|
1182
|
+
path: w.path,
|
|
1183
|
+
relative: w.relative,
|
|
1184
|
+
content: w.content,
|
|
1185
|
+
expectedHash: drift.expectedHash,
|
|
1186
|
+
actualHash: drift.actualHash,
|
|
1187
|
+
dirs: w.dirs,
|
|
1188
|
+
});
|
|
1189
|
+
// Do NOT write — defer until prompt/refusal resolves the file.
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
if (drift && drift.bucket === 'pb-managed-clean') {
|
|
1193
|
+
cleanBucketPaths.push(w.relative);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
assertSetupWritePath(w.path, perimeterManifest);
|
|
1190
1197
|
if (w.dirs)
|
|
1191
1198
|
mkdirSync(w.dirs, { recursive: true });
|
|
1199
|
+
// WP-436 S3: resolve {{vocab:...}} tokens before writing projected adapter files only
|
|
1200
|
+
// (source-side stays tokenized). Fail-open: undefined vocabCtx falls back to canonicalKey literals.
|
|
1201
|
+
const resolvedContent = w.isAdapter
|
|
1202
|
+
? replaceVocabTokens(w.content, handshakeVocabCtx)
|
|
1203
|
+
: w.content;
|
|
1192
1204
|
if (existsSync(w.path)) {
|
|
1193
1205
|
const current = readFileSync(w.path, 'utf8');
|
|
1194
|
-
const nextNormalized = normalizeHandshakeContentForComparison(
|
|
1206
|
+
const nextNormalized = normalizeHandshakeContentForComparison(resolvedContent);
|
|
1195
1207
|
const currentNormalized = normalizeHandshakeContentForComparison(current);
|
|
1196
1208
|
if (nextNormalized === currentNormalized) {
|
|
1197
1209
|
filesSkipped.push({ path: w.relative, reason: 'unchanged' });
|
|
1198
|
-
recordProjectedHash(w.dbAssetEntryId);
|
|
1199
1210
|
continue;
|
|
1200
1211
|
}
|
|
1201
1212
|
}
|
|
1202
|
-
writeFileSync(w.path,
|
|
1213
|
+
writeFileSync(w.path, resolvedContent);
|
|
1203
1214
|
filesWritten.push(w.relative);
|
|
1204
|
-
recordProjectedHash(w.dbAssetEntryId);
|
|
1205
1215
|
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
entryId,
|
|
1214
|
-
reason: result.reason instanceof Error ? result.reason.message : String(result.reason),
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1216
|
+
// Runs AFTER the write loop (malformed files were never written, nothing to record). TEN-2155:
|
|
1217
|
+
// non-interactive apply refuses on a malformed region — gated on applyMode per STD-263 vi.
|
|
1218
|
+
if (applyMode && malformedRegionPaths.length > 0 && (options.noPrompt || !process.stdout.isTTY)) {
|
|
1219
|
+
throw new CLIError(`Malformed PB region in: ${malformedRegionPaths.join(', ')}`, {
|
|
1220
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
1221
|
+
category: 'validation',
|
|
1222
|
+
guidance: 'Fix the `<!-- pb:region:start -->` / `<!-- pb:region:end -->` sentinels (one balanced pair), then re-run `pb handshake`.',
|
|
1217
1223
|
});
|
|
1218
1224
|
}
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
//
|
|
1222
|
-
//
|
|
1223
|
-
//
|
|
1224
|
-
//
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
//
|
|
1228
|
-
//
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
logErr(`Warning: could not write dormant marker to ${filePath} — ${err instanceof Error ? err.message : String(err)}`);
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
// 8. Drift logging — if apply mode encountered forked adapters and a session is active, log a draft TEN.
|
|
1253
|
-
// Dormant-marked files are NOT forked — they were intentionally deactivated and have the auto-gen MARKER.
|
|
1254
|
-
// They will never appear in forkedPaths because they are excluded from the `writes` array entirely.
|
|
1255
|
-
//
|
|
1256
|
-
// WP-379 S5b — First-run UX rule:
|
|
1257
|
-
// When `hasAnyReceipt` is false OR undefined (unknown / pre-S5b server), drift TENs are suppressed.
|
|
1258
|
-
// Rationale: on the first handshake, users may have pre-existing non-marked files from manual
|
|
1259
|
-
// setup; we must not flood them with TENs before they've even had one successful materialization.
|
|
1260
|
-
// A TEN fires only after setup_receipt.count >= 1 for this workspace.
|
|
1261
|
-
//
|
|
1262
|
-
// Conservative unknown-treatment: if the server does not provide hasAnyReceipt (old server),
|
|
1263
|
-
// we treat it as "no receipt exists" and suppress the TEN. The day-1 experience is more important
|
|
1264
|
-
// than catching every early drift case; the TEN will fire on the next run once the server is updated.
|
|
1265
|
-
const isFirstRun = hasAnyReceipt !== true; // true when no receipts or unknown
|
|
1266
|
-
if (forkedPaths.length > 0) {
|
|
1267
|
-
if (isFirstRun) {
|
|
1268
|
-
log(`Info: ${forkedPaths.length} adapter(s) skipped (user files without auto-gen marker). ` +
|
|
1269
|
-
'Drift TEN suppressed — first run (no setup receipt yet). Files: ' +
|
|
1270
|
-
forkedPaths.join(', '));
|
|
1271
|
-
}
|
|
1272
|
-
else {
|
|
1273
|
-
const session = readSession();
|
|
1274
|
-
if (session) {
|
|
1275
|
-
const names = forkedPaths.join(', ');
|
|
1276
|
-
kernelCallWithSession('chain.createEntry', {
|
|
1277
|
-
collectionSlug: 'tensions',
|
|
1278
|
-
name: `TEN: handshake drift — ${forkedPaths.length} adapter(s) forked, sync blocked`,
|
|
1279
|
-
status: 'draft',
|
|
1280
|
-
data: {
|
|
1281
|
-
description: `pb handshake --apply encountered forked adapters that blocked sync. Files: ${names}. Use --force to overwrite or resolve drift manually.`,
|
|
1282
|
-
},
|
|
1283
|
-
sessionId: session.sessionId,
|
|
1284
|
-
createdBy: `agent:${session.sessionId}`,
|
|
1285
|
-
}).catch(() => { });
|
|
1225
|
+
// ── WP-421 S3: tampered-bucket resolution (doneWhen #17), apply mode only — headless (--no-prompt
|
|
1226
|
+
// / non-TTY) refuses, exit non-zero. WP-776 S3d/S3f: the setup-assets system this resolution used
|
|
1227
|
+
// to offer as an "adopt" alternative (capture tampered edits as a personal-scoped draft via
|
|
1228
|
+
// setup.ingestSetupAsset) is deleted, and with it the only OTHER option besides overwriting —
|
|
1229
|
+
// per DEC-1771 (delete, never hide) there is no shim standing in for that capability. Revert
|
|
1230
|
+
// (re-project canonical content) is the only resolution left; this is a real capability loss
|
|
1231
|
+
// for anyone who was relying on "adopt" to preserve hand-edits, named here rather than silently
|
|
1232
|
+
// dropped. The refusal receipt (`setup.recordTamperRefusal`) is deleted along with the rest of
|
|
1233
|
+
// the setup-assets gateway routes — headless mode still refuses and reports, it just no longer
|
|
1234
|
+
// writes an audit row for the refusal.
|
|
1235
|
+
const revertedTamperedPaths = [];
|
|
1236
|
+
if (writeMode && tamperedBucket.length > 0) {
|
|
1237
|
+
const headless = options.noPrompt === true || !process.stdout.isTTY;
|
|
1238
|
+
if (headless) {
|
|
1239
|
+
// ── Headless refusal path (doneWhen #17) ────────────────────────────────
|
|
1240
|
+
logErr('');
|
|
1241
|
+
logErr(`pb handshake: ${tamperedBucket.length} PB-managed projection file(s) were edited downstream of the auto-gen marker.`);
|
|
1242
|
+
logErr('Headless mode (--no-prompt or no TTY) cannot confirm an overwrite — refusing.');
|
|
1243
|
+
logErr('');
|
|
1244
|
+
const refusedTamperedFiles = tamperedBucket.map((t) => ({
|
|
1245
|
+
path: t.relative,
|
|
1246
|
+
expectedHash: t.expectedHash,
|
|
1247
|
+
actualHash: t.actualHash,
|
|
1248
|
+
}));
|
|
1249
|
+
for (const refused of refusedTamperedFiles) {
|
|
1250
|
+
// Per #17: stderr enumerates each tampered file as
|
|
1251
|
+
// {path, expectedHash, actualHash, bucket}.
|
|
1252
|
+
logErr(` ${JSON.stringify({ ...refused, bucket: 'pb-managed-tampered' })}`);
|
|
1286
1253
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1254
|
+
logErr('');
|
|
1255
|
+
logErr('Re-run interactively to resolve, or use --force to overwrite (data loss).');
|
|
1256
|
+
// Surface the report counts before exit (visibility for CI logs).
|
|
1257
|
+
if (!quiet) {
|
|
1258
|
+
const refusalReport = {
|
|
1259
|
+
filesWritten,
|
|
1260
|
+
filesSkipped,
|
|
1261
|
+
matchedEntries,
|
|
1262
|
+
searchQueries: uniqueQueries,
|
|
1263
|
+
repo,
|
|
1264
|
+
codexWarnings: codexWarnings.length > 0 ? codexWarnings : undefined,
|
|
1265
|
+
adoptedCount: adoptedRulesCount,
|
|
1266
|
+
rejectedCount: rejectedRulesCount,
|
|
1267
|
+
personalRuleCount: personalRules.length > 0 ? personalRules.length : undefined,
|
|
1268
|
+
personalSkillCount: personalSkills.length > 0 ? personalSkills.length : undefined,
|
|
1269
|
+
registrySource,
|
|
1270
|
+
registryStale,
|
|
1271
|
+
userOwnedSkipped: userOwnedSkipped.length > 0 ? userOwnedSkipped : undefined,
|
|
1272
|
+
managedCleanCount: cleanBucketPaths.length || undefined,
|
|
1273
|
+
tamperedFiles: refusedTamperedFiles,
|
|
1274
|
+
leftoverFiles: leftoverFiles.length > 0 ? leftoverFiles : undefined,
|
|
1275
|
+
leftoverFilesTruncated: leftoverFilesTruncated || undefined, noProjectionAssets: noProjectionAssets.length > 0 ? noProjectionAssets : undefined, // same-line combine, shrink-only budget
|
|
1276
|
+
};
|
|
1277
|
+
process.stdout.write('\n');
|
|
1278
|
+
process.stdout.write(isJsonMode() ? JSON.stringify(toPublicJsonReport(refusalReport)) + '\n' : formatHandshakeReport(refusalReport) + '\n');
|
|
1305
1279
|
}
|
|
1280
|
+
// Exit non-zero per #17.
|
|
1281
|
+
process.exit(1);
|
|
1306
1282
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1283
|
+
// ── Interactive path: confirm, then revert every tampered file ─────────────
|
|
1284
|
+
log('');
|
|
1285
|
+
log(`pb handshake: ${tamperedBucket.length} PB-managed projection file(s) were edited downstream of the auto-gen marker.`);
|
|
1286
|
+
log('These will be REVERTED (overwritten with canonical content) — there is no adopt/draft path any more.');
|
|
1287
|
+
const proceed = await promptConfirm({
|
|
1288
|
+
message: `Overwrite ${tamperedBucket.length} tampered file(s) with canonical content?`,
|
|
1289
|
+
initialValue: false,
|
|
1290
|
+
});
|
|
1291
|
+
if (proceed) {
|
|
1292
|
+
for (const tamper of tamperedBucket) {
|
|
1293
|
+
log('');
|
|
1294
|
+
log(`Reverting: ${tamper.relative}`);
|
|
1295
|
+
log(` expected: ${tamper.expectedHash}`);
|
|
1296
|
+
log(` actual: ${tamper.actualHash}`);
|
|
1297
|
+
// Re-project canonical content over the tampered file.
|
|
1298
|
+
// WP-436 S3: resolve vocab tokens before writing (all tampered files are adapters).
|
|
1299
|
+
if (tamper.dirs)
|
|
1300
|
+
mkdirSync(tamper.dirs, { recursive: true });
|
|
1301
|
+
assertSetupWritePath(tamper.path, perimeterManifest);
|
|
1302
|
+
writeFileSync(tamper.path, replaceVocabTokens(tamper.content, handshakeVocabCtx));
|
|
1303
|
+
revertedTamperedPaths.push(tamper.relative);
|
|
1317
1304
|
}
|
|
1318
1305
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1306
|
+
else {
|
|
1307
|
+
logErr('Skipped — tampered files left as-is; re-run to resolve.');
|
|
1308
|
+
process.exit(1); // doneWhen #17: never exit 0 with a tampered file unresolved (codex review round 3)
|
|
1322
1309
|
}
|
|
1323
1310
|
}
|
|
1311
|
+
// DEC-1690: a dormant (gate-failed) asset is simply not projected — dbAssets already comes
|
|
1312
|
+
// from the server's activeAssets list. The WP-379 S4 / WP-426 E4 on-disk marker/rename/restore
|
|
1313
|
+
// machinery (and its .authoring-sync.json registries) is retired: nothing to reconcile.
|
|
1314
|
+
// 8. User-owned files left untouched are NOT drift (TEN-2150) — a marker-less adapter-path
|
|
1315
|
+
// file is the user's own; handshake never wrote it, so no "sync", no draft TEN, just a benign
|
|
1316
|
+
// "Skipped:" surfaced via report.userOwnedSkipped.
|
|
1317
|
+
// 8. Case-collision and dormant-drift TENs are gone (coordinator ruling, PR #912 round 10) —
|
|
1318
|
+
// they existed only to audit automated deletions that no longer happen; `report.leftoverFiles`
|
|
1319
|
+
// below is the single reporting surface now.
|
|
1324
1320
|
// 9. Report
|
|
1325
1321
|
const report = {
|
|
1326
1322
|
filesWritten,
|
|
@@ -1329,8 +1325,6 @@ export async function runHandshake(options = {}) {
|
|
|
1329
1325
|
searchQueries: uniqueQueries,
|
|
1330
1326
|
repo,
|
|
1331
1327
|
codexWarnings: codexWarnings.length > 0 ? codexWarnings : undefined,
|
|
1332
|
-
chainRulesStats: chainRulesStats ?? undefined,
|
|
1333
|
-
chainGaps: chainGaps.length > 0 ? chainGaps : undefined,
|
|
1334
1328
|
adoptedCount: adoptedRulesCount,
|
|
1335
1329
|
rejectedCount: rejectedRulesCount,
|
|
1336
1330
|
personalRuleCount: personalRules.length > 0 ? personalRules.length : undefined,
|
|
@@ -1339,11 +1333,27 @@ export async function runHandshake(options = {}) {
|
|
|
1339
1333
|
registryStale,
|
|
1340
1334
|
preview: preview ? true : undefined,
|
|
1341
1335
|
previewPlan: preview && previewPlan.length > 0 ? previewPlan : undefined,
|
|
1342
|
-
|
|
1336
|
+
userOwnedSkipped: userOwnedSkipped.length > 0 ? userOwnedSkipped : undefined,
|
|
1337
|
+
// WP-421 S3: three-bucket drift report (doneWhen #17). PB-managed-clean is
|
|
1338
|
+
// the count of files whose marker + hash matched. Tampered files were
|
|
1339
|
+
// resolved (reverted) above and are reported separately. WP-776 S3d/S3f:
|
|
1340
|
+
// adoptedTamperedPaths is gone — "adopt" is no longer an option (see the
|
|
1341
|
+
// tampered-bucket resolution comment above).
|
|
1342
|
+
managedCleanCount: cleanBucketPaths.length > 0 ? cleanBucketPaths.length : undefined,
|
|
1343
|
+
revertedTamperedPaths: revertedTamperedPaths.length > 0 ? revertedTamperedPaths : undefined,
|
|
1344
|
+
// REPORT-ONLY leftover-file listing (coordinator ruling, PR #912 round 10) — the human removes these.
|
|
1345
|
+
leftoverFiles: leftoverFiles.length > 0 ? leftoverFiles : undefined,
|
|
1346
|
+
leftoverFilesTruncated: leftoverFilesTruncated || undefined, noProjectionAssets: noProjectionAssets.length > 0 ? noProjectionAssets : undefined, // WP-660 S2 combine
|
|
1343
1347
|
};
|
|
1344
1348
|
if (!quiet) {
|
|
1345
1349
|
process.stdout.write('\n');
|
|
1346
|
-
process.stdout.write(formatHandshakeReport(report) + '\n');
|
|
1350
|
+
process.stdout.write(isJsonMode() ? JSON.stringify(toPublicJsonReport(report)) + '\n' : formatHandshakeReport(report) + '\n');
|
|
1347
1351
|
}
|
|
1352
|
+
// Return the report so non-UI callers (e.g. prepareConnectContext) can surface
|
|
1353
|
+
// skipped/user-owned files without re-deriving the skip logic (TEN-2107).
|
|
1354
|
+
return report;
|
|
1348
1355
|
}
|
|
1356
|
+
// WP-426 E3/E4: exported test-only surface (not part of the public CLI API). setupAuthoringPath
|
|
1357
|
+
// and loadAuthoringSyncState are gone with the setup-authoring sync machinery (WP-776 S3d/S3f).
|
|
1358
|
+
export const __test = { MARKER };
|
|
1349
1359
|
//# sourceMappingURL=handshake.js.map
|