wicked-crew 0.18.19 → 0.18.21
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 +9 -6
- package/dist/api/ask-paths.d.ts +2 -0
- package/dist/api/ask-paths.d.ts.map +1 -1
- package/dist/api/ask-paths.js +6 -0
- package/dist/api/ask-paths.js.map +1 -1
- package/dist/api/auth.d.ts +7 -5
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +23 -9
- package/dist/api/auth.js.map +1 -1
- package/dist/api/capture.d.ts +5 -2
- package/dist/api/capture.d.ts.map +1 -1
- package/dist/api/capture.js +13 -10
- package/dist/api/capture.js.map +1 -1
- package/dist/api/chat-attachments.d.ts.map +1 -1
- package/dist/api/chat-attachments.js +69 -19
- package/dist/api/chat-attachments.js.map +1 -1
- package/dist/api/chat-citations.d.ts.map +1 -1
- package/dist/api/chat-citations.js +22 -0
- package/dist/api/chat-citations.js.map +1 -1
- package/dist/api/chat-context.d.ts +16 -1
- package/dist/api/chat-context.d.ts.map +1 -1
- package/dist/api/chat-context.js +75 -14
- package/dist/api/chat-context.js.map +1 -1
- package/dist/api/chat-freshness.js +2 -2
- package/dist/api/chat-freshness.js.map +1 -1
- package/dist/api/chat-history.d.ts +13 -0
- package/dist/api/chat-history.d.ts.map +1 -1
- package/dist/api/chat-history.js +25 -0
- package/dist/api/chat-history.js.map +1 -1
- package/dist/api/chat-jobs.d.ts +67 -6
- package/dist/api/chat-jobs.d.ts.map +1 -1
- package/dist/api/chat-jobs.js +243 -22
- package/dist/api/chat-jobs.js.map +1 -1
- package/dist/api/chat-proposals.d.ts +69 -6
- package/dist/api/chat-proposals.d.ts.map +1 -1
- package/dist/api/chat-proposals.js +310 -49
- package/dist/api/chat-proposals.js.map +1 -1
- package/dist/api/chat-requirements.d.ts.map +1 -1
- package/dist/api/chat-requirements.js +4 -1
- package/dist/api/chat-requirements.js.map +1 -1
- package/dist/api/chat-scope.d.ts +17 -9
- package/dist/api/chat-scope.d.ts.map +1 -1
- package/dist/api/chat-scope.js +55 -21
- package/dist/api/chat-scope.js.map +1 -1
- package/dist/api/cluster-status.d.ts +24 -12
- package/dist/api/cluster-status.d.ts.map +1 -1
- package/dist/api/cluster-status.js +82 -4
- package/dist/api/cluster-status.js.map +1 -1
- package/dist/api/codebase-archive.d.ts +4 -3
- package/dist/api/codebase-archive.d.ts.map +1 -1
- package/dist/api/codebase-archive.js +6 -5
- package/dist/api/codebase-archive.js.map +1 -1
- package/dist/api/delivery-cache.d.ts +2 -0
- package/dist/api/delivery-cache.d.ts.map +1 -1
- package/dist/api/delivery-cache.js +1 -2
- package/dist/api/delivery-cache.js.map +1 -1
- package/dist/api/delivery-index.d.ts +2 -2
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +1 -2
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/eval-compare.d.ts +1 -1
- package/dist/api/eval-compare.js +1 -1
- package/dist/api/eval-sample.d.ts +7 -0
- package/dist/api/eval-sample.d.ts.map +1 -1
- package/dist/api/eval-sample.js +20 -0
- package/dist/api/eval-sample.js.map +1 -1
- package/dist/api/gate-cache.d.ts +1 -0
- package/dist/api/gate-cache.d.ts.map +1 -1
- package/dist/api/gate-cache.js +19 -6
- package/dist/api/gate-cache.js.map +1 -1
- package/dist/api/governance-steering.d.ts +17 -4
- package/dist/api/governance-steering.d.ts.map +1 -1
- package/dist/api/governance-steering.js +56 -7
- package/dist/api/governance-steering.js.map +1 -1
- package/dist/api/mcp.d.ts +12 -2
- package/dist/api/mcp.d.ts.map +1 -1
- package/dist/api/mcp.js +56 -12
- package/dist/api/mcp.js.map +1 -1
- package/dist/api/needs.d.ts +20 -0
- package/dist/api/needs.d.ts.map +1 -1
- package/dist/api/needs.js +120 -19
- package/dist/api/needs.js.map +1 -1
- package/dist/api/onboarding-capture.d.ts +21 -1
- package/dist/api/onboarding-capture.d.ts.map +1 -1
- package/dist/api/onboarding-capture.js +112 -8
- package/dist/api/onboarding-capture.js.map +1 -1
- package/dist/api/policy-landing.d.ts +36 -0
- package/dist/api/policy-landing.d.ts.map +1 -1
- package/dist/api/policy-landing.js +123 -4
- package/dist/api/policy-landing.js.map +1 -1
- package/dist/api/post-hoc-deliver.d.ts.map +1 -1
- package/dist/api/post-hoc-deliver.js +2 -1
- package/dist/api/post-hoc-deliver.js.map +1 -1
- package/dist/api/product.d.ts +1 -1
- package/dist/api/proposal-decisions.d.ts +44 -0
- package/dist/api/proposal-decisions.d.ts.map +1 -0
- package/dist/api/proposal-decisions.js +85 -0
- package/dist/api/proposal-decisions.js.map +1 -0
- package/dist/api/proposal-onboard.d.ts +38 -1
- package/dist/api/proposal-onboard.d.ts.map +1 -1
- package/dist/api/proposal-onboard.js +203 -14
- package/dist/api/proposal-onboard.js.map +1 -1
- package/dist/api/recording.d.ts +1 -1
- package/dist/api/recording.d.ts.map +1 -1
- package/dist/api/recording.js +4 -5
- package/dist/api/recording.js.map +1 -1
- package/dist/api/redeliver.d.ts.map +1 -1
- package/dist/api/redeliver.js +11 -7
- package/dist/api/redeliver.js.map +1 -1
- package/dist/api/repo-input.d.ts.map +1 -1
- package/dist/api/repo-input.js +5 -2
- package/dist/api/repo-input.js.map +1 -1
- package/dist/api/repo-origins.d.ts +24 -0
- package/dist/api/repo-origins.d.ts.map +1 -0
- package/dist/api/repo-origins.js +71 -0
- package/dist/api/repo-origins.js.map +1 -0
- package/dist/api/requirements.d.ts +37 -16
- package/dist/api/requirements.d.ts.map +1 -1
- package/dist/api/requirements.js +73 -2
- package/dist/api/requirements.js.map +1 -1
- package/dist/api/retry-index.d.ts +2 -0
- package/dist/api/retry-index.d.ts.map +1 -1
- package/dist/api/retry-index.js +16 -8
- package/dist/api/retry-index.js.map +1 -1
- package/dist/api/review-change.d.ts +5 -6
- package/dist/api/review-change.d.ts.map +1 -1
- package/dist/api/review-change.js +45 -8
- package/dist/api/review-change.js.map +1 -1
- package/dist/api/roster-standing.d.ts +2 -0
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +8 -1
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +55 -12
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +961 -277
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-documents.d.ts +9 -1
- package/dist/api/run-documents.d.ts.map +1 -1
- package/dist/api/run-documents.js +63 -5
- package/dist/api/run-documents.js.map +1 -1
- package/dist/api/run-sources.d.ts +11 -1
- package/dist/api/run-sources.d.ts.map +1 -1
- package/dist/api/run-sources.js +26 -3
- package/dist/api/run-sources.js.map +1 -1
- package/dist/api/run-timing-index.d.ts +47 -0
- package/dist/api/run-timing-index.d.ts.map +1 -1
- package/dist/api/run-timing-index.js +196 -86
- package/dist/api/run-timing-index.js.map +1 -1
- package/dist/api/runtime-state.d.ts +6 -0
- package/dist/api/runtime-state.d.ts.map +1 -1
- package/dist/api/runtime-state.js +14 -3
- package/dist/api/runtime-state.js.map +1 -1
- package/dist/api/seat-agents.d.ts.map +1 -1
- package/dist/api/seat-agents.js +3 -3
- package/dist/api/seat-agents.js.map +1 -1
- package/dist/api/seat-container-login.d.ts +6 -2
- package/dist/api/seat-container-login.d.ts.map +1 -1
- package/dist/api/seat-container-login.js +17 -9
- package/dist/api/seat-container-login.js.map +1 -1
- package/dist/api/seat-governance.d.ts +3 -2
- package/dist/api/seat-governance.d.ts.map +1 -1
- package/dist/api/seat-governance.js +31 -9
- package/dist/api/seat-governance.js.map +1 -1
- package/dist/api/seat-standing.d.ts +8 -0
- package/dist/api/seat-standing.d.ts.map +1 -1
- package/dist/api/seat-standing.js +26 -1
- package/dist/api/seat-standing.js.map +1 -1
- package/dist/api/server.d.ts +7 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +172 -59
- package/dist/api/server.js.map +1 -1
- package/dist/api/stall-watchdog.d.ts +6 -0
- package/dist/api/stall-watchdog.d.ts.map +1 -1
- package/dist/api/stall-watchdog.js +28 -0
- package/dist/api/stall-watchdog.js.map +1 -1
- package/dist/api/start-on-login.d.ts +4 -0
- package/dist/api/start-on-login.d.ts.map +1 -0
- package/dist/api/start-on-login.js +35 -0
- package/dist/api/start-on-login.js.map +1 -0
- package/dist/api/steering-landing.d.ts +33 -8
- package/dist/api/steering-landing.d.ts.map +1 -1
- package/dist/api/steering-landing.js +235 -51
- package/dist/api/steering-landing.js.map +1 -1
- package/dist/api/system-snapshot.d.ts +5 -0
- package/dist/api/system-snapshot.d.ts.map +1 -1
- package/dist/api/system-snapshot.js +22 -10
- package/dist/api/system-snapshot.js.map +1 -1
- package/dist/api/testing.d.ts +2 -2
- package/dist/api/ui-text.js +2 -2
- package/dist/api/ui-text.js.map +1 -1
- package/dist/api/worktree-sweep.d.ts +7 -3
- package/dist/api/worktree-sweep.d.ts.map +1 -1
- package/dist/api/worktree-sweep.js +10 -6
- package/dist/api/worktree-sweep.js.map +1 -1
- package/dist/apps/actions/api-action.js +5 -2
- package/dist/apps/actions/api-action.js.map +1 -1
- package/dist/apps/actions/write-path.d.ts +9 -0
- package/dist/apps/actions/write-path.d.ts.map +1 -1
- package/dist/apps/actions/write-path.js +17 -9
- package/dist/apps/actions/write-path.js.map +1 -1
- package/dist/apps/exec/executor.d.ts +8 -15
- package/dist/apps/exec/executor.d.ts.map +1 -1
- package/dist/apps/exec/executor.js +10 -3
- package/dist/apps/exec/executor.js.map +1 -1
- package/dist/apps/exec/recall.d.ts.map +1 -1
- package/dist/apps/exec/recall.js +4 -4
- package/dist/apps/exec/recall.js.map +1 -1
- package/dist/apps/exec/redescribe.d.ts +37 -0
- package/dist/apps/exec/redescribe.d.ts.map +1 -0
- package/dist/apps/exec/redescribe.js +86 -0
- package/dist/apps/exec/redescribe.js.map +1 -0
- package/dist/apps/exec/source-stage.d.ts +3 -1
- package/dist/apps/exec/source-stage.d.ts.map +1 -1
- package/dist/apps/exec/source-stage.js +13 -3
- package/dist/apps/exec/source-stage.js.map +1 -1
- package/dist/apps/exec/sources.d.ts +6 -0
- package/dist/apps/exec/sources.d.ts.map +1 -1
- package/dist/apps/exec/sources.js +8 -0
- package/dist/apps/exec/sources.js.map +1 -1
- package/dist/apps/git.js +2 -2
- package/dist/apps/git.js.map +1 -1
- package/dist/apps/publish/manifest.d.ts +8 -1
- package/dist/apps/publish/manifest.d.ts.map +1 -1
- package/dist/apps/publish/manifest.js +14 -3
- package/dist/apps/publish/manifest.js.map +1 -1
- package/dist/apps/publish/run.d.ts +15 -2
- package/dist/apps/publish/run.d.ts.map +1 -1
- package/dist/apps/publish/run.js +100 -17
- package/dist/apps/publish/run.js.map +1 -1
- package/dist/apps/routes.d.ts +3 -0
- package/dist/apps/routes.d.ts.map +1 -1
- package/dist/apps/routes.js +58 -2
- package/dist/apps/routes.js.map +1 -1
- package/dist/apps/store.d.ts +24 -3
- package/dist/apps/store.d.ts.map +1 -1
- package/dist/apps/store.js +26 -9
- package/dist/apps/store.js.map +1 -1
- package/dist/apps/turns.d.ts +25 -2
- package/dist/apps/turns.d.ts.map +1 -1
- package/dist/apps/turns.js +276 -11
- package/dist/apps/turns.js.map +1 -1
- package/dist/apps-server/Dockerfile +2 -2
- package/dist/apps-server/runners/sqlite-runner.mjs +67 -12
- package/dist/apps-server/server/lib/bundle/server.mjs +353 -159
- package/dist/cli/governance.d.ts +5 -2
- package/dist/cli/governance.d.ts.map +1 -1
- package/dist/cli/governance.js +8 -5
- package/dist/cli/governance.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/service.d.ts +10 -6
- package/dist/cli/service.d.ts.map +1 -1
- package/dist/cli/service.js +39 -23
- package/dist/cli/service.js.map +1 -1
- package/dist/core/adapter.d.ts +61 -29
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +214 -83
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/ado-deliver-helper.d.ts +2 -1
- package/dist/core/ado-deliver-helper.d.ts.map +1 -1
- package/dist/core/ado-deliver-helper.js +26 -1
- package/dist/core/ado-deliver-helper.js.map +1 -1
- package/dist/core/assurance.d.ts +45 -42
- package/dist/core/assurance.d.ts.map +1 -1
- package/dist/core/assurance.js +74 -67
- package/dist/core/assurance.js.map +1 -1
- package/dist/core/deliver-text.d.ts +14 -0
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +41 -2
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver.d.ts +66 -1
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +183 -10
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/engine-roster.d.ts +2 -0
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +13 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/estate-mcp-client.d.ts +13 -14
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +49 -68
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/exec.d.ts +24 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +45 -2
- package/dist/core/exec.js.map +1 -1
- package/dist/core/linked-issues.d.ts +13 -2
- package/dist/core/linked-issues.d.ts.map +1 -1
- package/dist/core/linked-issues.js +135 -4
- package/dist/core/linked-issues.js.map +1 -1
- package/dist/core/pr-checks-helper.d.ts +8 -4
- package/dist/core/pr-checks-helper.d.ts.map +1 -1
- package/dist/core/pr-checks-helper.js +39 -17
- package/dist/core/pr-checks-helper.js.map +1 -1
- package/dist/core/redeliver.js +2 -2
- package/dist/core/redeliver.js.map +1 -1
- package/dist/core/repo-clone.d.ts +64 -0
- package/dist/core/repo-clone.d.ts.map +1 -0
- package/dist/core/repo-clone.js +306 -0
- package/dist/core/repo-clone.js.map +1 -0
- package/dist/core/repoPaths.d.ts +2 -4
- package/dist/core/repoPaths.d.ts.map +1 -1
- package/dist/core/repoPaths.js +4 -6
- package/dist/core/repoPaths.js.map +1 -1
- package/dist/core/run-identity.d.ts.map +1 -1
- package/dist/core/run-identity.js +3 -0
- package/dist/core/run-identity.js.map +1 -1
- package/dist/core/run-read-lane.d.ts +30 -0
- package/dist/core/run-read-lane.d.ts.map +1 -0
- package/dist/core/run-read-lane.js +103 -0
- package/dist/core/run-read-lane.js.map +1 -0
- package/dist/core/types.d.ts +10 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/walkthrough-root.d.ts.map +1 -1
- package/dist/core/walkthrough-root.js +3 -5
- package/dist/core/walkthrough-root.js.map +1 -1
- package/dist/core/wicked-home.d.ts +9 -0
- package/dist/core/wicked-home.d.ts.map +1 -0
- package/dist/core/wicked-home.js +25 -0
- package/dist/core/wicked-home.js.map +1 -0
- package/dist/decisions/consider.d.ts +2 -1
- package/dist/decisions/consider.d.ts.map +1 -1
- package/dist/decisions/consider.js +2 -2
- package/dist/decisions/consider.js.map +1 -1
- package/dist/decisions/land.d.ts +2 -0
- package/dist/decisions/land.d.ts.map +1 -1
- package/dist/decisions/land.js +16 -3
- package/dist/decisions/land.js.map +1 -1
- package/dist/decisions/rules-brief.d.ts +4 -1
- package/dist/decisions/rules-brief.d.ts.map +1 -1
- package/dist/decisions/rules-brief.js +3 -2
- package/dist/decisions/rules-brief.js.map +1 -1
- package/dist/editors/conformance-runtime.d.ts +0 -2
- package/dist/editors/conformance-runtime.d.ts.map +1 -1
- package/dist/editors/conformance-runtime.js +0 -4
- package/dist/editors/conformance-runtime.js.map +1 -1
- package/dist/editors/csp.d.ts +6 -0
- package/dist/editors/csp.d.ts.map +1 -1
- package/dist/editors/csp.js +10 -0
- package/dist/editors/csp.js.map +1 -1
- package/dist/editors/pack-install.d.ts +11 -15
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +52 -65
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +31 -13
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +51 -18
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/routes.d.ts +4 -2
- package/dist/editors/routes.d.ts.map +1 -1
- package/dist/editors/routes.js +23 -6
- package/dist/editors/routes.js.map +1 -1
- package/dist/editors/visuals.d.ts +4 -3
- package/dist/editors/visuals.d.ts.map +1 -1
- package/dist/editors/visuals.js +17 -7
- package/dist/editors/visuals.js.map +1 -1
- package/dist/evals/runner.js +1 -1
- package/dist/evals/runner.js.map +1 -1
- package/dist/evals/shape-corrections.js +1 -1
- package/dist/evals/shape-corrections.js.map +1 -1
- package/dist/evals/shape.d.ts +7 -1
- package/dist/evals/shape.d.ts.map +1 -1
- package/dist/evals/shape.js +26 -6
- package/dist/evals/shape.js.map +1 -1
- package/dist/evals/workflow.d.ts +16 -3
- package/dist/evals/workflow.d.ts.map +1 -1
- package/dist/evals/workflow.js +32 -6
- package/dist/evals/workflow.js.map +1 -1
- package/dist/governance/rule-revision.d.ts +7 -0
- package/dist/governance/rule-revision.d.ts.map +1 -0
- package/dist/governance/rule-revision.js +23 -0
- package/dist/governance/rule-revision.js.map +1 -0
- package/dist/insights/review-service.d.ts +26 -3
- package/dist/insights/review-service.d.ts.map +1 -1
- package/dist/insights/review-service.js +101 -11
- package/dist/insights/review-service.js.map +1 -1
- package/dist/insights/routes.d.ts +2 -1
- package/dist/insights/routes.d.ts.map +1 -1
- package/dist/insights/routes.js +19 -4
- package/dist/insights/routes.js.map +1 -1
- package/dist/insights/run-facts.d.ts +5 -0
- package/dist/insights/run-facts.d.ts.map +1 -1
- package/dist/insights/run-facts.js +15 -0
- package/dist/insights/run-facts.js.map +1 -1
- package/dist/insights/workflow.d.ts +2 -1
- package/dist/insights/workflow.d.ts.map +1 -1
- package/dist/insights/workflow.js +4 -4
- package/dist/insights/workflow.js.map +1 -1
- package/dist/inspect/service.d.ts +3 -2
- package/dist/inspect/service.d.ts.map +1 -1
- package/dist/inspect/service.js +4 -4
- package/dist/inspect/service.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +2 -0
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +18 -8
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +3 -0
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +20 -5
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/doc-delete-routes.d.ts +1 -0
- package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
- package/dist/interactive/doc-delete-routes.js +126 -123
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +11 -7
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +29 -22
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +56 -3
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +129 -20
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/landing-guard.d.ts +30 -5
- package/dist/interactive/landing-guard.d.ts.map +1 -1
- package/dist/interactive/landing-guard.js +121 -5
- package/dist/interactive/landing-guard.js.map +1 -1
- package/dist/interactive/proposal-create.d.ts +9 -11
- package/dist/interactive/proposal-create.d.ts.map +1 -1
- package/dist/interactive/proposal-create.js +28 -21
- package/dist/interactive/proposal-create.js.map +1 -1
- package/dist/interactive/proposal-refine.d.ts +4 -4
- package/dist/interactive/proposal-refine.d.ts.map +1 -1
- package/dist/interactive/proposal-refine.js +40 -7
- package/dist/interactive/proposal-refine.js.map +1 -1
- package/dist/interactive/proxy-routes.d.ts +10 -5
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +108 -11
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/interactive/review-events.js +1 -1
- package/dist/interactive/review-events.js.map +1 -1
- package/dist/interactive/run-units.d.ts.map +1 -1
- package/dist/interactive/run-units.js +3 -2
- package/dist/interactive/run-units.js.map +1 -1
- package/dist/interactive/source-packet.d.ts +13 -1
- package/dist/interactive/source-packet.d.ts.map +1 -1
- package/dist/interactive/source-packet.js +108 -34
- package/dist/interactive/source-packet.js.map +1 -1
- package/dist/knowledge/adapters/toolbox/memory.d.ts +2 -0
- package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -0
- package/dist/knowledge/adapters/toolbox/memory.js +43 -0
- package/dist/knowledge/adapters/toolbox/memory.js.map +1 -0
- package/dist/knowledge/adapters/toolbox/supervisor.d.ts +30 -4
- package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
- package/dist/knowledge/adapters/toolbox/supervisor.js +112 -28
- package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
- package/dist/knowledge/estate-write.d.ts +5 -0
- package/dist/knowledge/estate-write.d.ts.map +1 -1
- package/dist/knowledge/estate-write.js +7 -0
- package/dist/knowledge/estate-write.js.map +1 -1
- package/dist/knowledge/gate/gate.d.ts.map +1 -1
- package/dist/knowledge/gate/gate.js +4 -1
- package/dist/knowledge/gate/gate.js.map +1 -1
- package/dist/knowledge/gate/record.d.ts +15 -2
- package/dist/knowledge/gate/record.d.ts.map +1 -1
- package/dist/knowledge/gate/record.js +108 -29
- package/dist/knowledge/gate/record.js.map +1 -1
- package/dist/knowledge/projector.d.ts +60 -5
- package/dist/knowledge/projector.d.ts.map +1 -1
- package/dist/knowledge/projector.js +264 -21
- package/dist/knowledge/projector.js.map +1 -1
- package/dist/knowledge/registry/entry.d.ts +7 -0
- package/dist/knowledge/registry/entry.d.ts.map +1 -1
- package/dist/knowledge/registry/entry.js +4 -0
- package/dist/knowledge/registry/entry.js.map +1 -1
- package/dist/knowledge/shapes/map.d.ts.map +1 -1
- package/dist/knowledge/shapes/map.js +12 -2
- package/dist/knowledge/shapes/map.js.map +1 -1
- package/dist/knowledge/shapes/routes.d.ts +1 -1
- package/dist/knowledge/shapes/routes.d.ts.map +1 -1
- package/dist/knowledge/shapes/routes.js +42 -16
- package/dist/knowledge/shapes/routes.js.map +1 -1
- package/dist/knowledge/shapes/shapes.d.ts +60 -13
- package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
- package/dist/knowledge/shapes/shapes.js +199 -31
- package/dist/knowledge/shapes/shapes.js.map +1 -1
- package/dist/knowledge/shapes/verified.d.ts.map +1 -1
- package/dist/knowledge/shapes/verified.js +3 -2
- package/dist/knowledge/shapes/verified.js.map +1 -1
- package/dist/knowledge/trackers/addresses.d.ts +27 -3
- package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
- package/dist/knowledge/trackers/addresses.js +33 -5
- package/dist/knowledge/trackers/addresses.js.map +1 -1
- package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
- package/dist/knowledge/trackers/gate-pm.js +4 -2
- package/dist/knowledge/trackers/gate-pm.js.map +1 -1
- package/dist/knowledge/trackers/projector.d.ts +3 -1
- package/dist/knowledge/trackers/projector.d.ts.map +1 -1
- package/dist/knowledge/trackers/projector.js +59 -8
- package/dist/knowledge/trackers/projector.js.map +1 -1
- package/dist/learn/scheduler.d.ts.map +1 -1
- package/dist/learn/scheduler.js +13 -3
- package/dist/learn/scheduler.js.map +1 -1
- package/dist/learnings/estate.d.ts.map +1 -1
- package/dist/learnings/estate.js +3 -14
- package/dist/learnings/estate.js.map +1 -1
- package/dist/learnings/extract.d.ts +9 -3
- package/dist/learnings/extract.d.ts.map +1 -1
- package/dist/learnings/extract.js +62 -4
- package/dist/learnings/extract.js.map +1 -1
- package/dist/learnings/replacement-lineage.d.ts +3 -2
- package/dist/learnings/replacement-lineage.d.ts.map +1 -1
- package/dist/learnings/replacement-lineage.js +7 -6
- package/dist/learnings/replacement-lineage.js.map +1 -1
- package/dist/learnings/service.d.ts +12 -2
- package/dist/learnings/service.d.ts.map +1 -1
- package/dist/learnings/service.js +30 -5
- package/dist/learnings/service.js.map +1 -1
- package/dist/mcp/broker.d.ts.map +1 -1
- package/dist/mcp/broker.js +19 -5
- package/dist/mcp/broker.js.map +1 -1
- package/dist/mcp/env.d.ts +12 -4
- package/dist/mcp/env.d.ts.map +1 -1
- package/dist/mcp/env.js +24 -4
- package/dist/mcp/env.js.map +1 -1
- package/dist/mcp/estate-relay.d.ts +3 -0
- package/dist/mcp/estate-relay.d.ts.map +1 -1
- package/dist/mcp/estate-relay.js +7 -6
- package/dist/mcp/estate-relay.js.map +1 -1
- package/dist/mcp/invoke.d.ts.map +1 -1
- package/dist/mcp/invoke.js +6 -5
- package/dist/mcp/invoke.js.map +1 -1
- package/dist/mcp/probe.d.ts +14 -1
- package/dist/mcp/probe.d.ts.map +1 -1
- package/dist/mcp/probe.js +55 -10
- package/dist/mcp/probe.js.map +1 -1
- package/dist/mcp/redact.d.ts +1 -1
- package/dist/mcp/redact.d.ts.map +1 -1
- package/dist/mcp/redact.js +61 -4
- package/dist/mcp/redact.js.map +1 -1
- package/dist/mcp/registry-store.d.ts +37 -0
- package/dist/mcp/registry-store.d.ts.map +1 -1
- package/dist/mcp/registry-store.js +43 -0
- package/dist/mcp/registry-store.js.map +1 -1
- package/dist/mcp/registry.d.ts +38 -6
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +145 -14
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/rest.js +4 -4
- package/dist/mcp/rest.js.map +1 -1
- package/dist/mcp/run-fence.d.ts +2 -0
- package/dist/mcp/run-fence.d.ts.map +1 -1
- package/dist/mcp/run-fence.js +9 -0
- package/dist/mcp/run-fence.js.map +1 -1
- package/dist/mcp/secrets.d.ts +1 -1
- package/dist/mcp/secrets.d.ts.map +1 -1
- package/dist/mcp/secrets.js +10 -11
- package/dist/mcp/secrets.js.map +1 -1
- package/dist/mcp/upstream-error.d.ts +6 -2
- package/dist/mcp/upstream-error.d.ts.map +1 -1
- package/dist/mcp/upstream-error.js +5 -1
- package/dist/mcp/upstream-error.js.map +1 -1
- package/dist/projects/graph.d.ts +15 -5
- package/dist/projects/graph.d.ts.map +1 -1
- package/dist/projects/graph.js +354 -26
- package/dist/projects/graph.js.map +1 -1
- package/dist/projects/repo-watch.d.ts +2 -2
- package/dist/projects/repo-watch.d.ts.map +1 -1
- package/dist/projects/repo-watch.js +26 -9
- package/dist/projects/repo-watch.js.map +1 -1
- package/dist/projects/routes.d.ts +9 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +63 -6
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home-preflight.d.ts +5 -0
- package/dist/projects/state-home-preflight.d.ts.map +1 -1
- package/dist/projects/state-home-preflight.js +48 -8
- package/dist/projects/state-home-preflight.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +9 -0
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/projects/state-home.d.ts +11 -0
- package/dist/projects/state-home.d.ts.map +1 -1
- package/dist/projects/state-home.js +14 -0
- package/dist/projects/state-home.js.map +1 -1
- package/dist/qe/author-workflow.d.ts +4 -0
- package/dist/qe/author-workflow.d.ts.map +1 -1
- package/dist/qe/author-workflow.js +4 -0
- package/dist/qe/author-workflow.js.map +1 -1
- package/dist/qe/test-sets.d.ts +5 -6
- package/dist/qe/test-sets.d.ts.map +1 -1
- package/dist/qe/test-sets.js +4 -3
- package/dist/qe/test-sets.js.map +1 -1
- package/dist/schedules/routes.d.ts +5 -0
- package/dist/schedules/routes.d.ts.map +1 -1
- package/dist/schedules/routes.js +32 -5
- package/dist/schedules/routes.js.map +1 -1
- package/dist/schedules/scheduler.d.ts +8 -1
- package/dist/schedules/scheduler.d.ts.map +1 -1
- package/dist/schedules/scheduler.js +10 -1
- package/dist/schedules/scheduler.js.map +1 -1
- package/dist/schedules/store.d.ts +7 -0
- package/dist/schedules/store.d.ts.map +1 -1
- package/dist/schedules/store.js +19 -4
- package/dist/schedules/store.js.map +1 -1
- package/dist/skills/plugin-source.js +4 -4
- package/dist/skills/plugin-source.js.map +1 -1
- package/dist/sources/ask.d.ts.map +1 -1
- package/dist/sources/ask.js +12 -12
- package/dist/sources/ask.js.map +1 -1
- package/dist/sources/dialer.d.ts +6 -1
- package/dist/sources/dialer.d.ts.map +1 -1
- package/dist/sources/dialer.js +53 -31
- package/dist/sources/dialer.js.map +1 -1
- package/dist/sources/drivers/mysql.d.ts +2 -0
- package/dist/sources/drivers/mysql.d.ts.map +1 -1
- package/dist/sources/drivers/mysql.js +18 -2
- package/dist/sources/drivers/mysql.js.map +1 -1
- package/dist/sources/drivers/postgres.d.ts +2 -0
- package/dist/sources/drivers/postgres.d.ts.map +1 -1
- package/dist/sources/drivers/postgres.js +10 -3
- package/dist/sources/drivers/postgres.js.map +1 -1
- package/dist/sources/drivers/sqlite.d.ts +33 -3
- package/dist/sources/drivers/sqlite.d.ts.map +1 -1
- package/dist/sources/drivers/sqlite.js +18 -6
- package/dist/sources/drivers/sqlite.js.map +1 -1
- package/dist/sources/drivers/types.d.ts +3 -1
- package/dist/sources/drivers/types.d.ts.map +1 -1
- package/dist/sources/drivers/types.js +3 -1
- package/dist/sources/drivers/types.js.map +1 -1
- package/dist/sources/routes.d.ts.map +1 -1
- package/dist/sources/routes.js +1 -0
- package/dist/sources/routes.js.map +1 -1
- package/dist/sources/uploads.d.ts +22 -15
- package/dist/sources/uploads.d.ts.map +1 -1
- package/dist/sources/uploads.js +124 -436
- package/dist/sources/uploads.js.map +1 -1
- package/dist/standing-orders/history.d.ts +5 -3
- package/dist/standing-orders/history.d.ts.map +1 -1
- package/dist/standing-orders/history.js +6 -2
- package/dist/standing-orders/history.js.map +1 -1
- package/dist/standing-orders/parse.d.ts +8 -0
- package/dist/standing-orders/parse.d.ts.map +1 -1
- package/dist/standing-orders/parse.js +52 -5
- package/dist/standing-orders/parse.js.map +1 -1
- package/dist/studio/apps-standalone/fixture.js +3 -3
- package/dist/studio/apps-standalone/runtime.js +1 -1
- package/dist/studio/assets/{KnowledgeGraph-DWw0I8RJ.js → KnowledgeGraph-yP4WsnST.js} +1 -1
- package/dist/studio/assets/index-DNaLjJ7M.css +32 -0
- package/dist/studio/assets/index-DW53FKuT.js +1114 -0
- package/dist/studio/editors/wicked-apps/editor.json +1 -1
- package/dist/studio/editors/wicked-apps/index.html +2 -2
- package/dist/studio/editors/wicked-deck/editor.json +1 -1
- package/dist/studio/editors/wicked-deck/index.html +2 -2
- package/dist/studio/editors/wicked-doc/editor.json +1 -1
- package/dist/studio/editors/wicked-doc/index.html +1 -1
- package/dist/studio/editors/wicked-insights/editor.json +1 -1
- package/dist/studio/editors/wicked-insights/index.html +1 -1
- package/dist/studio/editors/wicked-page/editor.json +1 -1
- package/dist/studio/editors/wicked-page/index.html +1 -1
- package/dist/studio/editors/wicked-video/editor.json +1 -1
- package/dist/studio/editors/wicked-video/index.html +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +1589 -281
- package/dist/team/routes.d.ts +11 -1
- package/dist/team/routes.d.ts.map +1 -1
- package/dist/team/routes.js +8 -4
- package/dist/team/routes.js.map +1 -1
- package/dist/voice/tts.d.ts +12 -0
- package/dist/voice/tts.d.ts.map +1 -1
- package/dist/voice/tts.js +118 -28
- package/dist/voice/tts.js.map +1 -1
- package/dist/workflow-catalog/build-v2.d.ts +34 -0
- package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
- package/dist/workflow-catalog/build-v2.js +131 -10
- package/dist/workflow-catalog/build-v2.js.map +1 -1
- package/dist/workflow-catalog/catalog-data-v2.d.ts +6 -2
- package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -1
- package/dist/workflow-catalog/catalog-data-v2.js.map +1 -1
- package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
- package/dist/workflow-catalog/catalog-data.js +0 -2
- package/dist/workflow-catalog/catalog-data.js.map +1 -1
- package/dist/workflow-catalog/detect.d.ts +18 -3
- package/dist/workflow-catalog/detect.d.ts.map +1 -1
- package/dist/workflow-catalog/detect.js +43 -8
- package/dist/workflow-catalog/detect.js.map +1 -1
- package/dist/workflow-catalog/shape.d.ts +1 -1
- package/dist/working-doc/event-lines.d.ts +12 -2
- package/dist/working-doc/event-lines.d.ts.map +1 -1
- package/dist/working-doc/event-lines.js +62 -10
- package/dist/working-doc/event-lines.js.map +1 -1
- package/dist/working-doc/sections.d.ts +3 -0
- package/dist/working-doc/sections.d.ts.map +1 -1
- package/dist/working-doc/sections.js +5 -0
- package/dist/working-doc/sections.js.map +1 -1
- package/dist/working-doc/service.d.ts +23 -3
- package/dist/working-doc/service.d.ts.map +1 -1
- package/dist/working-doc/service.js +93 -54
- package/dist/working-doc/service.js.map +1 -1
- package/endpoint-manifest.json +148 -8
- package/evals/corpora/shape-v1.json +25 -1
- package/evals/corpora/shape-v1.seat-fixture.json +25 -1
- package/package.json +4 -4
- package/runners/sqlite-runner.mjs +67 -12
- package/runners/upload-parse.d.mts +13 -0
- package/runners/upload-parse.mjs +364 -0
- package/dist/studio/assets/index-C4Xj-zxa.css +0 -32
- package/dist/studio/assets/index-CrNY3d06.js +0 -1109
package/dist/projects/graph.js
CHANGED
|
@@ -56,7 +56,7 @@ export const LINKED_NOTE = 'Linked: this answer crossed from one repo into anoth
|
|
|
56
56
|
'wicked-estate proved from package identity (listed in `crossings`; each dependent reached ' +
|
|
57
57
|
'through one names it in `via_crossing`). Other hits are per-repo results, and a dependency the ' +
|
|
58
58
|
'linker could not prove is not followed.';
|
|
59
|
-
/** Added to
|
|
59
|
+
/** Added to the answer's note when the project's link generation predates the current indexes. */
|
|
60
60
|
export const LINK_STALE_NOTE = 'The links are from an earlier refresh and some repos changed since (`link_stale_labels`): ' +
|
|
61
61
|
'refresh the code graph to relink.';
|
|
62
62
|
/**
|
|
@@ -810,9 +810,10 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
|
|
|
810
810
|
const skipped = [];
|
|
811
811
|
const failed = [];
|
|
812
812
|
const repoRows = [];
|
|
813
|
-
|
|
813
|
+
// No members and no graph: nothing to build and nothing to prune (crew#1476 prunes an existing one below).
|
|
814
|
+
if (members.repos.length === 0 && !existsSync(dbPath)) {
|
|
814
815
|
return {
|
|
815
|
-
status: buildStatus({ projectId, members, manifest: null, dbExists:
|
|
816
|
+
status: buildStatus({ projectId, members, manifest: null, dbExists: false, env }),
|
|
816
817
|
indexed,
|
|
817
818
|
skipped,
|
|
818
819
|
failed,
|
|
@@ -820,7 +821,7 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
|
|
|
820
821
|
};
|
|
821
822
|
}
|
|
822
823
|
assertLabelsUnique(members.repos);
|
|
823
|
-
if (!(await estateSupportsMultiRepo(env))) {
|
|
824
|
+
if (members.repos.length > 0 && !(await estateSupportsMultiRepo(env))) {
|
|
824
825
|
// Refusing is the ONLY safe answer. An estate without `--repo` accepts the flag, drops it, and
|
|
825
826
|
// exits 0, so proceeding would co-locate three repos into a database holding one of them, with
|
|
826
827
|
// nothing in any output to say so.
|
|
@@ -837,8 +838,27 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
|
|
|
837
838
|
budgets.set(m.label, await adapter.indexBudget(m.repo.root_path));
|
|
838
839
|
st.budgetMs = [...budgets.values()].reduce((sum, b) => sum + b.budgetMs, 0);
|
|
839
840
|
await mkdir(dirname(dbPath), { recursive: true });
|
|
840
|
-
|
|
841
|
+
let dbExisted = existsSync(dbPath);
|
|
841
842
|
const prior = dbExisted ? await readManifest(projectId, env) : null;
|
|
843
|
+
const currentLabels = new Set(members.repos.map((m) => m.label));
|
|
844
|
+
const pruned = (prior?.repos ?? []).map((r) => r.label).filter((label) => !currentLabels.has(label));
|
|
845
|
+
if (dbExisted && pruned.length > 0) {
|
|
846
|
+
// crew#1476: estate has no per-label delete; rebuild only on refresh, including journal siblings.
|
|
847
|
+
for (const suffix of ['', '-wal', '-shm', '-journal']) {
|
|
848
|
+
try {
|
|
849
|
+
await unlink(`${dbPath}${suffix}`);
|
|
850
|
+
}
|
|
851
|
+
catch (err) {
|
|
852
|
+
if (err.code !== 'ENOENT')
|
|
853
|
+
throw err;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
dbExisted = false;
|
|
857
|
+
// The old manifest describes the database just deleted. Left in place, the first member to re-index
|
|
858
|
+
// recreates the db and status reads every not-yet-rebuilt member as indexed (`ready` mid-rebuild).
|
|
859
|
+
await writeManifest(projectId, { version: 1, projectId, repos: [] }, env);
|
|
860
|
+
log?.(`project graph ${projectId}: rebuild to prune removed labels ${pruned.join(', ')}`);
|
|
861
|
+
}
|
|
842
862
|
const priorByLabel = new Map((prior?.repos ?? []).map((r) => [r.label, r]));
|
|
843
863
|
// Prior rows survive a refresh only if the database they describe does. When it does not, every
|
|
844
864
|
// repo is re-indexed and the manifest is rebuilt from this run alone.
|
|
@@ -994,6 +1014,7 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
|
|
|
994
1014
|
failed,
|
|
995
1015
|
repos: repoRows,
|
|
996
1016
|
...(link === undefined ? {} : { link }),
|
|
1017
|
+
...(pruned.length === 0 ? {} : { pruned }),
|
|
997
1018
|
};
|
|
998
1019
|
}
|
|
999
1020
|
/**
|
|
@@ -1160,7 +1181,7 @@ export async function queryable(adapter, projectId, env = process.env) {
|
|
|
1160
1181
|
* `null` when the prefix is not a CURRENT member's label: rows of a repo that has since been
|
|
1161
1182
|
* detached are still in the database (estate has no per-label delete), and returning them under a
|
|
1162
1183
|
* project-scoped query would answer about a repo the project no longer contains. They are excluded
|
|
1163
|
-
* here and named in `status.staleRepos
|
|
1184
|
+
* here and named in `status.staleRepos` until refresh rebuilds without them (crew#1476).
|
|
1164
1185
|
*/
|
|
1165
1186
|
function attribute(path, labels) {
|
|
1166
1187
|
const slash = path.indexOf('/');
|
|
@@ -1177,10 +1198,24 @@ function attribute(path, labels) {
|
|
|
1177
1198
|
* only place a result acquires its provenance — exported so the attribution rules are testable
|
|
1178
1199
|
* without a graph on disk, which is what makes the stale-label exclusion below coverable at all.
|
|
1179
1200
|
*/
|
|
1180
|
-
export function attributeHits(raw, labels) {
|
|
1181
|
-
const hits =
|
|
1182
|
-
|
|
1183
|
-
|
|
1201
|
+
export function attributeHits(raw, labels, detached = new Set()) {
|
|
1202
|
+
const hits = [];
|
|
1203
|
+
// crew#1714: the rows left out (a removed member's) are not in the answer, so a `via` edge to one
|
|
1204
|
+
// points at nothing a client can place: it goes with them, as does one to a `detached` symbol
|
|
1205
|
+
// (a removed member's end of a crossing, which may be a start rather than a row).
|
|
1206
|
+
const dropped = new Set(detached);
|
|
1207
|
+
for (const r of Array.isArray(raw) ? raw : []) {
|
|
1208
|
+
const h = toHit(r, labels);
|
|
1209
|
+
if (h !== null)
|
|
1210
|
+
hits.push(h);
|
|
1211
|
+
else if (typeof r?.id === 'string')
|
|
1212
|
+
dropped.add(r.id);
|
|
1213
|
+
}
|
|
1214
|
+
if (dropped.size > 0) {
|
|
1215
|
+
for (const h of hits)
|
|
1216
|
+
if (h.via !== undefined)
|
|
1217
|
+
h.via = h.via.filter((v) => !dropped.has(v.id));
|
|
1218
|
+
}
|
|
1184
1219
|
return { hits, byRepo: countByRepo(hits) };
|
|
1185
1220
|
}
|
|
1186
1221
|
function countByRepo(hits) {
|
|
@@ -1194,12 +1229,28 @@ function countByRepo(hits) {
|
|
|
1194
1229
|
}
|
|
1195
1230
|
return [...counts.values()].sort((a, b) => b.count - a.count || a.repo.localeCompare(b.repo));
|
|
1196
1231
|
}
|
|
1232
|
+
/** crew#1714: estate's `via` (wicked-estate#557): `{id, kind}` edges to the inner ring; `kind` is the
|
|
1233
|
+
* edge-kind wire form, a string or `{other: <tag>}`. A malformed entry is left out, never guessed. */
|
|
1234
|
+
function viaOf(raw) {
|
|
1235
|
+
if (!Array.isArray(raw))
|
|
1236
|
+
return undefined;
|
|
1237
|
+
return raw.flatMap((v) => {
|
|
1238
|
+
const { id, kind } = (v ?? {});
|
|
1239
|
+
if (typeof id !== 'string')
|
|
1240
|
+
return [];
|
|
1241
|
+
if (typeof kind === 'string')
|
|
1242
|
+
return [{ id, kind }];
|
|
1243
|
+
const other = kind?.other;
|
|
1244
|
+
return typeof other === 'string' ? [{ id, kind: { other } }] : [];
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1197
1247
|
function toHit(raw, labels) {
|
|
1198
1248
|
const file = typeof raw.file === 'string' ? raw.file : '';
|
|
1199
1249
|
const where = attribute(file, labels);
|
|
1200
1250
|
if (where === null)
|
|
1201
1251
|
return null;
|
|
1202
1252
|
const id = typeof raw.id === 'string' ? raw.id : typeof raw.symbol_id === 'string' ? raw.symbol_id : '';
|
|
1253
|
+
const via = viaOf(raw.via);
|
|
1203
1254
|
return {
|
|
1204
1255
|
repoId: where.repoId,
|
|
1205
1256
|
repo: where.repo,
|
|
@@ -1208,25 +1259,176 @@ function toHit(raw, labels) {
|
|
|
1208
1259
|
kind: typeof raw.kind === 'string' ? raw.kind : '',
|
|
1209
1260
|
file: where.file,
|
|
1210
1261
|
line: typeof raw.line === 'number' ? raw.line : 0,
|
|
1262
|
+
...(typeof raw.depth === 'number' ? { depth: raw.depth } : {}),
|
|
1263
|
+
...(raw.stale === 'modified' || raw.stale === 'deleted' ? { stale: raw.stale } : {}),
|
|
1211
1264
|
...(typeof raw.via_crossing === 'string' ? { via_crossing: raw.via_crossing } : {}),
|
|
1212
1265
|
...(raw.via_crossing_omitted === true ? { via_crossing_omitted: true } : {}),
|
|
1266
|
+
...(via === undefined ? {} : { via }),
|
|
1267
|
+
...(typeof raw.via_omitted === 'number' ? { via_omitted: raw.via_omitted } : {}),
|
|
1213
1268
|
};
|
|
1214
1269
|
}
|
|
1215
1270
|
/** Safety stop for following estate's blast-radius cursor: a server that kept issuing cursors would
|
|
1216
1271
|
* loop forever. 200 pages of ~235 rows is far past any real answer. */
|
|
1217
1272
|
const MAX_BLAST_PAGES = 200;
|
|
1273
|
+
/** crew#1556: estate's cap on the stale-file sample, retained across reply pages. */
|
|
1274
|
+
const STALE_FILES_CAP = 20;
|
|
1275
|
+
function mergeFreshness(pages) {
|
|
1276
|
+
const staleFiles = new Map();
|
|
1277
|
+
const indexing = new Set();
|
|
1278
|
+
let commitsBehind;
|
|
1279
|
+
let unindexedFiles = null;
|
|
1280
|
+
let staleFilesTotal = 0;
|
|
1281
|
+
let checkedFiles = 0;
|
|
1282
|
+
let notFileBacked = 0;
|
|
1283
|
+
let totalPartial = false;
|
|
1284
|
+
for (const page of pages) {
|
|
1285
|
+
if (page.stale_files_total_partial === true)
|
|
1286
|
+
totalPartial = true;
|
|
1287
|
+
for (const row of page.stale_files ?? []) {
|
|
1288
|
+
if (!staleFiles.has(row.file) && staleFiles.size < STALE_FILES_CAP)
|
|
1289
|
+
staleFiles.set(row.file, row);
|
|
1290
|
+
}
|
|
1291
|
+
for (const label of page.indexing ?? [])
|
|
1292
|
+
indexing.add(label);
|
|
1293
|
+
if (page.commits_behind === null)
|
|
1294
|
+
commitsBehind = null;
|
|
1295
|
+
else if (commitsBehind !== null && typeof page.commits_behind === 'number') {
|
|
1296
|
+
commitsBehind = Math.max(commitsBehind ?? 0, page.commits_behind);
|
|
1297
|
+
}
|
|
1298
|
+
if (typeof page.unindexed_files === 'number')
|
|
1299
|
+
unindexedFiles = Math.max(unindexedFiles ?? 0, page.unindexed_files);
|
|
1300
|
+
// crew#1556: per-page counts; a file spanning pages counts once on each page.
|
|
1301
|
+
if (typeof page.stale_files_total === 'number')
|
|
1302
|
+
staleFilesTotal += page.stale_files_total;
|
|
1303
|
+
if (typeof page.checked_files === 'number')
|
|
1304
|
+
checkedFiles += page.checked_files;
|
|
1305
|
+
if (typeof page.not_file_backed === 'number')
|
|
1306
|
+
notFileBacked += page.not_file_backed;
|
|
1307
|
+
}
|
|
1308
|
+
const roots = pages.at(-1)?.roots;
|
|
1309
|
+
return {
|
|
1310
|
+
stale_files: [...staleFiles.values()], stale_files_total: staleFilesTotal,
|
|
1311
|
+
...(totalPartial ? { stale_files_total_partial: true } : {}),
|
|
1312
|
+
checked_files: checkedFiles, not_file_backed: notFileBacked,
|
|
1313
|
+
...(commitsBehind === undefined ? {} : { commits_behind: commitsBehind }),
|
|
1314
|
+
unindexed_files: unindexedFiles, indexing: [...indexing],
|
|
1315
|
+
...(roots === undefined ? {} : { roots }),
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* crew#1713: ONE reply page's freshness, current members only. A removed member's rows stay in the
|
|
1320
|
+
* database until the next refresh, and estate counts their files too, so its stale files leave the
|
|
1321
|
+
* page's total (the sample's and every stale-marked row's: estate marks every drifted row unless its
|
|
1322
|
+
* budget dropped the marks, and then the sample still names them up to its cap) and its label leaves
|
|
1323
|
+
* `indexing`. Per page, before the pages are summed (crew#1556 counts a file once per page). Paths
|
|
1324
|
+
* stay estate's; {@link attributeFreshness} attributes them.
|
|
1325
|
+
*/
|
|
1326
|
+
function memberFreshness(raw, page, labels) {
|
|
1327
|
+
const dependents = page['dependents'];
|
|
1328
|
+
const member = (file) => attribute(file, labels) !== null;
|
|
1329
|
+
const removed = new Set();
|
|
1330
|
+
const kept = raw.stale_files?.filter((row) => {
|
|
1331
|
+
if (typeof row?.file === 'string' && member(row.file))
|
|
1332
|
+
return true;
|
|
1333
|
+
if (typeof row?.file === 'string')
|
|
1334
|
+
removed.add(row.file);
|
|
1335
|
+
return false;
|
|
1336
|
+
});
|
|
1337
|
+
const rows = Array.isArray(dependents) ? dependents : [];
|
|
1338
|
+
let anyMarked = false;
|
|
1339
|
+
const rowFiles = new Set();
|
|
1340
|
+
for (const row of rows) {
|
|
1341
|
+
const marked = row?.stale === 'modified' || row?.stale === 'deleted';
|
|
1342
|
+
if (marked)
|
|
1343
|
+
anyMarked = true;
|
|
1344
|
+
if (typeof row?.file === 'string')
|
|
1345
|
+
rowFiles.add(row.file);
|
|
1346
|
+
if (marked && typeof row.file === 'string' && !member(row.file))
|
|
1347
|
+
removed.add(row.file);
|
|
1348
|
+
}
|
|
1349
|
+
// crew#1797: estate's budget can drop the row marks and empty the sample while it keeps the count. A counted file
|
|
1350
|
+
// that no sample entry or mark names may then be a removed member's, and crew cannot take it out: the total is
|
|
1351
|
+
// marked partial (an upper bound). Only when the count is not explained by the named member files AND the page
|
|
1352
|
+
// carries a file outside the members that is not accounted for: removed already, or a dependents row whose missing
|
|
1353
|
+
// mark (with marks present on the page) says it is not stale. Every file the probe counted is looked at, the name
|
|
1354
|
+
// miss's `suggestions` included.
|
|
1355
|
+
const unexplained = typeof raw.stale_files_total === 'number' && raw.stale_files_total - removed.size > (kept?.length ?? 0);
|
|
1356
|
+
const probed = new Set();
|
|
1357
|
+
probedFiles(page, probed);
|
|
1358
|
+
const unknown = [...probed].some((file) => !member(file) && !removed.has(file) && !(anyMarked && rowFiles.has(file)));
|
|
1359
|
+
const partial = unexplained && unknown;
|
|
1360
|
+
const { indexing, ...rest } = raw;
|
|
1361
|
+
delete rest.stale_files;
|
|
1362
|
+
return {
|
|
1363
|
+
...rest,
|
|
1364
|
+
...(typeof raw.stale_files_total === 'number'
|
|
1365
|
+
? { stale_files_total: Math.max(kept?.length ?? 0, raw.stale_files_total - removed.size) }
|
|
1366
|
+
: {}),
|
|
1367
|
+
...(partial ? { stale_files_total_partial: true } : {}),
|
|
1368
|
+
...(Array.isArray(indexing) ? { indexing: indexing.filter((label) => labels.has(label)) } : {}),
|
|
1369
|
+
...(kept === undefined ? {} : { stale_files: kept }),
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* The files estate's freshness probe checks on a reply page: every non-empty `file` string, and every `files` /
|
|
1374
|
+
* `*_files` path list, anywhere in it but the `freshness` block (wicked-estate `freshness.rs` `collect_files`).
|
|
1375
|
+
*/
|
|
1376
|
+
function probedFiles(v, out) {
|
|
1377
|
+
if (Array.isArray(v)) {
|
|
1378
|
+
for (const item of v)
|
|
1379
|
+
probedFiles(item, out);
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
if (v === null || typeof v !== 'object')
|
|
1383
|
+
return;
|
|
1384
|
+
for (const [k, child] of Object.entries(v)) {
|
|
1385
|
+
if (k === 'freshness')
|
|
1386
|
+
continue;
|
|
1387
|
+
if (k === 'file' && typeof child === 'string') {
|
|
1388
|
+
if (child !== '')
|
|
1389
|
+
out.add(child);
|
|
1390
|
+
}
|
|
1391
|
+
else if ((k === 'files' || k.endsWith('_files')) && Array.isArray(child)) {
|
|
1392
|
+
for (const item of child) {
|
|
1393
|
+
if (typeof item === 'string') {
|
|
1394
|
+
if (item !== '')
|
|
1395
|
+
out.add(item);
|
|
1396
|
+
}
|
|
1397
|
+
else
|
|
1398
|
+
probedFiles(item, out);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
else
|
|
1402
|
+
probedFiles(child, out);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
/** crew#1555: attribute the (member-scoped, {@link memberFreshness}) sample and remove host paths. */
|
|
1406
|
+
function attributeFreshness(raw, labels) {
|
|
1407
|
+
const { stale_files, ...rest } = raw;
|
|
1408
|
+
delete rest.roots;
|
|
1409
|
+
return {
|
|
1410
|
+
...rest,
|
|
1411
|
+
...(stale_files === undefined ? {} : { stale_files: stale_files.flatMap((row) => {
|
|
1412
|
+
const where = attribute(row.file, labels);
|
|
1413
|
+
return where === null ? [] : [{ ...where, status: row.status }];
|
|
1414
|
+
}) }),
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1218
1417
|
/**
|
|
1219
1418
|
* `wicked-estate blast-radius --json`, EVERY page of it (operator ruling "full graph"; estate#279,
|
|
1220
1419
|
* wicked-estate 0.28.0+). estate pages a wide answer: a page names the rest with `next_cursor`
|
|
1221
1420
|
* (null on the last page), and `--cursor` returns the next rows of the SAME answer. The pages'
|
|
1222
|
-
* `dependents` are joined;
|
|
1421
|
+
* `dependents` are joined and freshness is merged (crew#1556); other fields are the LAST page's, so once every page is in,
|
|
1223
1422
|
* `truncated_dependents` says only what the walk itself cut (and `next_cursor` is null). A cursor
|
|
1224
1423
|
* still unread at the page cap is left on the answer with that page's `truncated_dependents`, so
|
|
1225
1424
|
* the unread rows read as cut, never as absent. An estate that does not page sends no
|
|
1226
1425
|
* `next_cursor`: one call, its JSON unchanged. Shared by the repo route and the project route.
|
|
1227
1426
|
*/
|
|
1228
|
-
export async function readBlastRadiusPages(exe, name, dbPath, opts
|
|
1427
|
+
export async function readBlastRadiusPages(exe, name, dbPath, opts,
|
|
1428
|
+
/** Applied to each page's freshness before the pages merge (the project route scopes it to members). */
|
|
1429
|
+
pageFreshness) {
|
|
1229
1430
|
const dependents = [];
|
|
1431
|
+
const freshnessPages = [];
|
|
1230
1432
|
let first = null;
|
|
1231
1433
|
let last = {};
|
|
1232
1434
|
let cursor = null;
|
|
@@ -1235,6 +1437,11 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
|
|
|
1235
1437
|
const { stdout } = await execCapped(exe, args, opts);
|
|
1236
1438
|
last = JSON.parse(stdout);
|
|
1237
1439
|
first ??= last;
|
|
1440
|
+
if (last['freshness'] !== null && typeof last['freshness'] === 'object') {
|
|
1441
|
+
if (pageFreshness !== undefined)
|
|
1442
|
+
last['freshness'] = pageFreshness(last['freshness'], last);
|
|
1443
|
+
freshnessPages.push(last['freshness']);
|
|
1444
|
+
}
|
|
1238
1445
|
if (Array.isArray(last['dependents']))
|
|
1239
1446
|
dependents.push(...last['dependents']);
|
|
1240
1447
|
cursor = typeof last['next_cursor'] === 'string' && last['next_cursor'] !== '' ? last['next_cursor'] : null;
|
|
@@ -1244,6 +1451,8 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
|
|
|
1244
1451
|
if (first === last)
|
|
1245
1452
|
return last;
|
|
1246
1453
|
const merged = { ...last, dependents };
|
|
1454
|
+
if (freshnessPages.length > 0)
|
|
1455
|
+
merged['freshness'] = mergeFreshness(freshnessPages);
|
|
1247
1456
|
// The joined rows' window: from the first page's start, over the last page's total.
|
|
1248
1457
|
const p0 = first?.['page'];
|
|
1249
1458
|
const pn = last['page'];
|
|
@@ -1254,15 +1463,12 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
|
|
|
1254
1463
|
}
|
|
1255
1464
|
/** Dependents of a symbol across every member repo, each hit attributed to the repo it is in. */
|
|
1256
1465
|
export async function projectBlastRadius(q, name, env = process.env) {
|
|
1257
|
-
const raw = (await readProjectGraph(q.dbPath, () => readBlastRadiusPages(estateExe(env), name, q.dbPath, { timeout: QUERY_TIMEOUT_MS }), env));
|
|
1258
|
-
const { hits: allHits, byRepo } = attributeHits(raw.dependents, q.labels);
|
|
1466
|
+
const raw = (await readProjectGraph(q.dbPath, () => readBlastRadiusPages(estateExe(env), name, q.dbPath, { timeout: QUERY_TIMEOUT_MS }, (freshness, page) => memberFreshness(freshness, page, q.labels)), env));
|
|
1259
1467
|
// X1: estate lists the same (shallowest, capped) crossings on every page; the last page's list.
|
|
1260
1468
|
// Only crossings between CURRENT members count: a removed member's links stay in the database
|
|
1261
1469
|
// until the next refresh relinks without it, and must not make an answer read `linked`.
|
|
1262
|
-
const
|
|
1263
|
-
const
|
|
1264
|
-
const crossings = listed.filter((c) => members.has(c.from?.repo) && members.has(c.to?.repo));
|
|
1265
|
-
const dropped = new Set(listed.filter((c) => !crossings.includes(c)).map((c) => c.id));
|
|
1470
|
+
const { crossings, dropped, detached } = memberCrossings(raw.crossings, q.labels);
|
|
1471
|
+
const { hits: allHits, byRepo } = attributeHits(raw.dependents, q.labels, detached);
|
|
1266
1472
|
// A hit reached through a dropped crossing loses its provenance claim along with the crossing.
|
|
1267
1473
|
const hits = allHits.map((h) => {
|
|
1268
1474
|
if (h.via_crossing === undefined || !dropped.has(h.via_crossing))
|
|
@@ -1273,12 +1479,7 @@ export async function projectBlastRadius(q, name, env = process.env) {
|
|
|
1273
1479
|
return kept;
|
|
1274
1480
|
});
|
|
1275
1481
|
const linked = crossings.length > 0;
|
|
1276
|
-
|
|
1277
|
-
const state = (Array.isArray(raw.link) ? raw.link : []);
|
|
1278
|
-
const stale = state.some((s) => s.stale === true);
|
|
1279
|
-
const staleLabels = state
|
|
1280
|
-
.flatMap((s) => (Array.isArray(s.stale_labels) ? s.stale_labels : []))
|
|
1281
|
-
.filter((l) => typeof l === 'string');
|
|
1482
|
+
const link = linkState(raw.link, q.status.projectId, q.labels);
|
|
1282
1483
|
// crew#751: estate's completeness causes (wicked-estate#222), carried through verbatim when the
|
|
1283
1484
|
// installed estate reports them, and ABSENT when it does not — never a fabricated `false`, which
|
|
1284
1485
|
// would read as "the walk was complete" on an estate that cannot say.
|
|
@@ -1290,6 +1491,9 @@ export async function projectBlastRadius(q, name, env = process.env) {
|
|
|
1290
1491
|
};
|
|
1291
1492
|
return {
|
|
1292
1493
|
...causes,
|
|
1494
|
+
...(typeof raw.resolved === 'boolean' ? { resolved: raw.resolved } : {}),
|
|
1495
|
+
...(raw.freshness === undefined ? {} : { freshness: attributeFreshness(raw.freshness, q.labels) }),
|
|
1496
|
+
...link.coverage,
|
|
1293
1497
|
projectId: q.status.projectId,
|
|
1294
1498
|
target: typeof raw.target === 'string' ? raw.target : name,
|
|
1295
1499
|
dependents: hits,
|
|
@@ -1301,13 +1505,137 @@ export async function projectBlastRadius(q, name, env = process.env) {
|
|
|
1301
1505
|
reposSearched: [...q.labels.keys()].sort(),
|
|
1302
1506
|
missingRepos: q.status.missingRepos,
|
|
1303
1507
|
linkage: linked ? 'linked' : 'co-located',
|
|
1304
|
-
note: linked ?
|
|
1508
|
+
note: `${linked ? LINKED_NOTE : CO_LOCATION_NOTE}${link.note}`,
|
|
1305
1509
|
...(Array.isArray(raw.crossings) ? { crossings } : {}),
|
|
1306
1510
|
...(typeof raw.crossings_total === 'number'
|
|
1307
1511
|
? { crossings_total: Math.max(crossings.length, raw.crossings_total - dropped.size) }
|
|
1308
1512
|
: {}),
|
|
1309
1513
|
...(raw.crossings_truncated === true ? { crossings_truncated: true } : {}),
|
|
1310
|
-
...
|
|
1514
|
+
...link.stale,
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
/** crew#1476: only crossings between current members can substantiate a project answer. */
|
|
1518
|
+
function memberCrossings(raw, labels) {
|
|
1519
|
+
const listed = Array.isArray(raw) ? raw : [];
|
|
1520
|
+
const crossings = listed.filter((c) => labels.has(c.from?.repo) && labels.has(c.to?.repo));
|
|
1521
|
+
const gone = listed.filter((c) => !crossings.includes(c));
|
|
1522
|
+
const detached = new Set(gone.flatMap((c) => [c.from, c.to])
|
|
1523
|
+
.filter((end) => !labels.has(end?.repo) && typeof end?.symbol === 'string')
|
|
1524
|
+
.map((end) => end.symbol));
|
|
1525
|
+
return { crossings, dropped: new Set(gone.map((c) => c.id)), detached };
|
|
1526
|
+
}
|
|
1527
|
+
/** crew#1476, crew#1477: shared coverage attribution; omitted metrics stay unknown. */
|
|
1528
|
+
function memberCoverage(state, labels) {
|
|
1529
|
+
// Untrusted shape: a coverage that is not a list, or an entry that is not an object, is no coverage.
|
|
1530
|
+
const rows = (Array.isArray(state.coverage) ? state.coverage : [])
|
|
1531
|
+
.filter((c) => c !== null && typeof c === 'object');
|
|
1532
|
+
return [...labels].sort(([a], [b]) => a.localeCompare(b)).map(([repo, repoId]) => {
|
|
1533
|
+
const row = rows.find((c) => c.label === repo);
|
|
1534
|
+
return {
|
|
1535
|
+
repoId, repo,
|
|
1536
|
+
...(typeof row?.links_in === 'number' ? { links_in: row.links_in } : {}),
|
|
1537
|
+
...(typeof row?.links_out === 'number' ? { links_out: row.links_out } : {}),
|
|
1538
|
+
...(typeof row?.incomplete === 'boolean' ? { incomplete: row.incomplete } : {}),
|
|
1539
|
+
...(typeof row?.package_imports === 'number' ? { package_imports: row.package_imports } : {}),
|
|
1540
|
+
...(typeof row?.manifests === 'number' ? { manifests: row.manifests } : {}),
|
|
1541
|
+
...(row?.boundary_counts === undefined ? {} : { boundary_counts: row.boundary_counts }),
|
|
1542
|
+
};
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* THIS project's link state from estate's `link` array (blast-radius and, wicked-estate#557, path: one
|
|
1547
|
+
* entry per project in the store): its members' coverage, and (crew#1714) whether its links predate the
|
|
1548
|
+
* current indexes. Another project's stale link says nothing about this one. Stale is stated on a
|
|
1549
|
+
* co-located answer too: a crossing the stale links miss is why it found none (estate's LINK-STALE:
|
|
1550
|
+
* "cross-repo dependents may be missing").
|
|
1551
|
+
*/
|
|
1552
|
+
function linkState(raw, projectId, labels) {
|
|
1553
|
+
const state = (Array.isArray(raw) ? raw : []).find((s) => s !== null && typeof s === 'object' && s.project === projectId);
|
|
1554
|
+
if (state === undefined)
|
|
1555
|
+
return { coverage: {}, stale: {}, note: '' };
|
|
1556
|
+
const coverage = { coverage: memberCoverage(state, labels) };
|
|
1557
|
+
if (state.stale !== true)
|
|
1558
|
+
return { coverage, stale: {}, note: '' };
|
|
1559
|
+
// A removed member can be why the link is stale; the answer still names current members only (crew#1713).
|
|
1560
|
+
const staleLabels = (Array.isArray(state.stale_labels) ? state.stale_labels : [])
|
|
1561
|
+
.filter((l) => typeof l === 'string' && labels.has(l));
|
|
1562
|
+
return { coverage, stale: { link_stale: true, link_stale_labels: [...new Set(staleLabels)].sort() }, note: ` ${LINK_STALE_NOTE}` };
|
|
1563
|
+
}
|
|
1564
|
+
function pathEnd(raw, labels) {
|
|
1565
|
+
// estate emits a bare `{symbol}` only if an endpoint is missing from its own result: not attributable.
|
|
1566
|
+
if (typeof raw.file !== 'string')
|
|
1567
|
+
return null;
|
|
1568
|
+
const where = attribute(raw.file, labels);
|
|
1569
|
+
return where === null ? null : { ...where, symbol: raw.symbol, name: raw.name, kind: raw.kind, line: raw.line_1based };
|
|
1570
|
+
}
|
|
1571
|
+
/** crew#1476: an estate route is a project answer only when every endpoint is a current member. */
|
|
1572
|
+
export async function projectGraphPath(q, from, to, maxDepth, env = process.env) {
|
|
1573
|
+
const { stdout } = await readProjectGraph(q.dbPath, () => execCapped(estateExe(env), [
|
|
1574
|
+
'path', from, to, '--db', q.dbPath, '--json', ...(maxDepth === undefined ? [] : ['--max-depth', String(maxDepth)]),
|
|
1575
|
+
], { timeout: QUERY_TIMEOUT_MS }), env);
|
|
1576
|
+
const raw = JSON.parse(stdout);
|
|
1577
|
+
const hops = [];
|
|
1578
|
+
let excluded = false;
|
|
1579
|
+
for (const hop of raw.hops) {
|
|
1580
|
+
const source = pathEnd(hop.source, q.labels);
|
|
1581
|
+
const target = pathEnd(hop.target, q.labels);
|
|
1582
|
+
if (source === null || target === null) {
|
|
1583
|
+
excluded = true;
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
hops.push({ source, target, kind: hop.kind, ...(typeof hop.confidence === 'number' ? { confidence: hop.confidence } : {}) });
|
|
1587
|
+
}
|
|
1588
|
+
const { crossings } = memberCrossings(raw.crossings, q.labels);
|
|
1589
|
+
const linked = crossings.length > 0;
|
|
1590
|
+
// crew#1714: `path --json` carries the project link state too (wicked-estate#557), read as blast-radius reads it.
|
|
1591
|
+
const link = linkState(raw.link, q.status.projectId, q.labels);
|
|
1592
|
+
return {
|
|
1593
|
+
projectId: q.status.projectId, from: raw.from, to: raw.to, found: excluded ? false : raw.found,
|
|
1594
|
+
...(typeof raw.resolved === 'boolean' ? { resolved: raw.resolved } : {}),
|
|
1595
|
+
unresolved: raw.unresolved, hops: excluded ? [] : hops,
|
|
1596
|
+
depth_bounded: raw.depth_bounded, node_bounded: raw.node_bounded,
|
|
1597
|
+
...(Array.isArray(raw.crossings) ? { crossings } : {}),
|
|
1598
|
+
...(excluded ? { excluded: 'the route found runs through a repository that is no longer in this project; refresh the project graph' } : {}),
|
|
1599
|
+
reposSearched: [...q.labels.keys()].sort(), missingRepos: q.status.missingRepos,
|
|
1600
|
+
...link.coverage,
|
|
1601
|
+
...link.stale,
|
|
1602
|
+
linkage: linked ? 'linked' : 'co-located',
|
|
1603
|
+
note: `${linked ? LINKED_NOTE : CO_LOCATION_NOTE}${link.note}${raw.depth_bounded || raw.node_bounded ? ' The search stopped at its depth or node bound, so a route it did not find may still exist.' : ''}`,
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
/** crew#1477: possible boundaries are imports the linker could not prove, never graph edges. */
|
|
1607
|
+
export async function projectGraphBoundaries(q, env = process.env) {
|
|
1608
|
+
const base = { projectId: q.status.projectId, linked: false, possible: [], members: [] };
|
|
1609
|
+
if (!(await estateSupportsLink(env)))
|
|
1610
|
+
return {
|
|
1611
|
+
...base, note: 'this wicked-estate cannot link repositories (X1, wicked-estate 0.34.0+); upgrade it to see boundaries',
|
|
1612
|
+
};
|
|
1613
|
+
const { stdout } = await readProjectGraph(q.dbPath, () => execCapped(estateExe(env), [
|
|
1614
|
+
'link', '--project', q.status.projectId, '--status', '--json', '--db', q.dbPath,
|
|
1615
|
+
], { timeout: QUERY_TIMEOUT_MS }), env);
|
|
1616
|
+
const raw = JSON.parse(stdout);
|
|
1617
|
+
if (raw === null)
|
|
1618
|
+
return { ...base, note: 'this project has not been linked yet; refresh its code graph' };
|
|
1619
|
+
const possible = [];
|
|
1620
|
+
for (const row of raw.coverage ?? []) {
|
|
1621
|
+
const repoId = q.labels.get(row.label);
|
|
1622
|
+
if (repoId === undefined)
|
|
1623
|
+
continue;
|
|
1624
|
+
for (const [reason, packages] of Object.entries(row.boundaries ?? {})) {
|
|
1625
|
+
for (const pkg of packages)
|
|
1626
|
+
possible.push({ repoId, repo: row.label, reason, package: pkg });
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
possible.sort((a, b) => a.repo.localeCompare(b.repo) || a.reason.localeCompare(b.reason) || a.package.localeCompare(b.package));
|
|
1630
|
+
return {
|
|
1631
|
+
projectId: q.status.projectId, linked: true,
|
|
1632
|
+
...(raw.generation === undefined ? {} : { generation: raw.generation }),
|
|
1633
|
+
...(raw.stale === undefined ? {} : { stale: raw.stale }),
|
|
1634
|
+
stale_labels: (raw.stale_labels ?? []).filter((label) => q.labels.has(label)),
|
|
1635
|
+
...(raw.last_error === undefined ? {} : { last_error: raw.last_error }),
|
|
1636
|
+
members: memberCoverage(raw, q.labels), possible: possible.slice(0, 500),
|
|
1637
|
+
...(possible.length > 500 ? { possible_total: possible.length, possible_truncated: true } : {}),
|
|
1638
|
+
note: 'possible = imports estate could not prove are links to another member, by reason; never edges',
|
|
1311
1639
|
};
|
|
1312
1640
|
}
|
|
1313
1641
|
/**
|