@opensip-cli/graph 0.1.0
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/baseline-plane.test.d.ts +11 -0
- package/dist/__tests__/baseline-plane.test.d.ts.map +1 -0
- package/dist/__tests__/baseline-plane.test.js +60 -0
- package/dist/__tests__/baseline-plane.test.js.map +1 -0
- package/dist/__tests__/cache/engine-version.test.d.ts +12 -0
- package/dist/__tests__/cache/engine-version.test.d.ts.map +1 -0
- package/dist/__tests__/cache/engine-version.test.js +79 -0
- package/dist/__tests__/cache/engine-version.test.js.map +1 -0
- package/dist/__tests__/cache/invalidate.test.d.ts +9 -0
- package/dist/__tests__/cache/invalidate.test.d.ts.map +1 -0
- package/dist/__tests__/cache/invalidate.test.js +228 -0
- package/dist/__tests__/cache/invalidate.test.js.map +1 -0
- package/dist/__tests__/cli/contribution-from-signals.test.d.ts +17 -0
- package/dist/__tests__/cli/contribution-from-signals.test.d.ts.map +1 -0
- package/dist/__tests__/cli/contribution-from-signals.test.js +89 -0
- package/dist/__tests__/cli/contribution-from-signals.test.js.map +1 -0
- package/dist/__tests__/cli/detect.test.d.ts +2 -0
- package/dist/__tests__/cli/detect.test.d.ts.map +1 -0
- package/dist/__tests__/cli/detect.test.js +96 -0
- package/dist/__tests__/cli/detect.test.js.map +1 -0
- package/dist/__tests__/cli/graph-config.test.d.ts +9 -0
- package/dist/__tests__/cli/graph-config.test.d.ts.map +1 -0
- package/dist/__tests__/cli/graph-config.test.js +113 -0
- package/dist/__tests__/cli/graph-config.test.js.map +1 -0
- package/dist/__tests__/cli/graph-execute.test.d.ts +9 -0
- package/dist/__tests__/cli/graph-execute.test.d.ts.map +1 -0
- package/dist/__tests__/cli/graph-execute.test.js +434 -0
- package/dist/__tests__/cli/graph-execute.test.js.map +1 -0
- package/dist/__tests__/cli/graph.test.d.ts +12 -0
- package/dist/__tests__/cli/graph.test.d.ts.map +1 -0
- package/dist/__tests__/cli/graph.test.js +589 -0
- package/dist/__tests__/cli/graph.test.js.map +1 -0
- package/dist/__tests__/cli/heap-preflight.test.d.ts +11 -0
- package/dist/__tests__/cli/heap-preflight.test.d.ts.map +1 -0
- package/dist/__tests__/cli/heap-preflight.test.js +150 -0
- package/dist/__tests__/cli/heap-preflight.test.js.map +1 -0
- package/dist/__tests__/cli/language-mismatch.test.d.ts +10 -0
- package/dist/__tests__/cli/language-mismatch.test.d.ts.map +1 -0
- package/dist/__tests__/cli/language-mismatch.test.js +155 -0
- package/dist/__tests__/cli/language-mismatch.test.js.map +1 -0
- package/dist/__tests__/cli/lookup.test.d.ts +7 -0
- package/dist/__tests__/cli/lookup.test.d.ts.map +1 -0
- package/dist/__tests__/cli/lookup.test.js +104 -0
- package/dist/__tests__/cli/lookup.test.js.map +1 -0
- package/dist/__tests__/cli/orchestrate.test.d.ts +12 -0
- package/dist/__tests__/cli/orchestrate.test.d.ts.map +1 -0
- package/dist/__tests__/cli/orchestrate.test.js +315 -0
- package/dist/__tests__/cli/orchestrate.test.js.map +1 -0
- package/dist/__tests__/cli/positional-paths.test.d.ts +5 -0
- package/dist/__tests__/cli/positional-paths.test.d.ts.map +1 -0
- package/dist/__tests__/cli/positional-paths.test.js +87 -0
- package/dist/__tests__/cli/positional-paths.test.js.map +1 -0
- package/dist/__tests__/cli/pressure-monitor.test.d.ts +11 -0
- package/dist/__tests__/cli/pressure-monitor.test.d.ts.map +1 -0
- package/dist/__tests__/cli/pressure-monitor.test.js +94 -0
- package/dist/__tests__/cli/pressure-monitor.test.js.map +1 -0
- package/dist/__tests__/cli/sarif-export.test.d.ts +8 -0
- package/dist/__tests__/cli/sarif-export.test.d.ts.map +1 -0
- package/dist/__tests__/cli/sarif-export.test.js +94 -0
- package/dist/__tests__/cli/sarif-export.test.js.map +1 -0
- package/dist/__tests__/cli/session-contract.test.d.ts +17 -0
- package/dist/__tests__/cli/session-contract.test.d.ts.map +1 -0
- package/dist/__tests__/cli/session-contract.test.js +225 -0
- package/dist/__tests__/cli/session-contract.test.js.map +1 -0
- package/dist/__tests__/cli/symbol-index.test.d.ts +7 -0
- package/dist/__tests__/cli/symbol-index.test.d.ts.map +1 -0
- package/dist/__tests__/cli/symbol-index.test.js +117 -0
- package/dist/__tests__/cli/symbol-index.test.js.map +1 -0
- package/dist/__tests__/cli/tool-show-mode.test.d.ts +10 -0
- package/dist/__tests__/cli/tool-show-mode.test.d.ts.map +1 -0
- package/dist/__tests__/cli/tool-show-mode.test.js +128 -0
- package/dist/__tests__/cli/tool-show-mode.test.js.map +1 -0
- package/dist/__tests__/cli/workspace-runner-polyglot.test.d.ts +10 -0
- package/dist/__tests__/cli/workspace-runner-polyglot.test.d.ts.map +1 -0
- package/dist/__tests__/cli/workspace-runner-polyglot.test.js +120 -0
- package/dist/__tests__/cli/workspace-runner-polyglot.test.js.map +1 -0
- package/dist/__tests__/graph-catalog-drift.test.d.ts +24 -0
- package/dist/__tests__/graph-catalog-drift.test.d.ts.map +1 -0
- package/dist/__tests__/graph-catalog-drift.test.js +34 -0
- package/dist/__tests__/graph-catalog-drift.test.js.map +1 -0
- package/dist/__tests__/internal-surface.test.d.ts +17 -0
- package/dist/__tests__/internal-surface.test.d.ts.map +1 -0
- package/dist/__tests__/internal-surface.test.js +45 -0
- package/dist/__tests__/internal-surface.test.js.map +1 -0
- package/dist/__tests__/lang-adapter/body-digest.test.d.ts +13 -0
- package/dist/__tests__/lang-adapter/body-digest.test.d.ts.map +1 -0
- package/dist/__tests__/lang-adapter/body-digest.test.js +51 -0
- package/dist/__tests__/lang-adapter/body-digest.test.js.map +1 -0
- package/dist/__tests__/lang-adapter/edge-helpers.test.d.ts +12 -0
- package/dist/__tests__/lang-adapter/edge-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/lang-adapter/edge-helpers.test.js +147 -0
- package/dist/__tests__/lang-adapter/edge-helpers.test.js.map +1 -0
- package/dist/__tests__/lang-adapter/registry.test.d.ts +9 -0
- package/dist/__tests__/lang-adapter/registry.test.d.ts.map +1 -0
- package/dist/__tests__/lang-adapter/registry.test.js +228 -0
- package/dist/__tests__/lang-adapter/registry.test.js.map +1 -0
- package/dist/__tests__/persistence/catalog-repo.test.d.ts +2 -0
- package/dist/__tests__/persistence/catalog-repo.test.d.ts.map +1 -0
- package/dist/__tests__/persistence/catalog-repo.test.js +188 -0
- package/dist/__tests__/persistence/catalog-repo.test.js.map +1 -0
- package/dist/__tests__/persistence/session-payload.test.d.ts +2 -0
- package/dist/__tests__/persistence/session-payload.test.d.ts.map +1 -0
- package/dist/__tests__/persistence/session-payload.test.js +81 -0
- package/dist/__tests__/persistence/session-payload.test.js.map +1 -0
- package/dist/__tests__/persistence/session-replay.test.d.ts +10 -0
- package/dist/__tests__/persistence/session-replay.test.d.ts.map +1 -0
- package/dist/__tests__/persistence/session-replay.test.js +196 -0
- package/dist/__tests__/persistence/session-replay.test.js.map +1 -0
- package/dist/__tests__/public-api.test.d.ts +19 -0
- package/dist/__tests__/public-api.test.d.ts.map +1 -0
- package/dist/__tests__/public-api.test.js +96 -0
- package/dist/__tests__/public-api.test.js.map +1 -0
- package/dist/__tests__/render/catalog-json-types.test.d.ts +10 -0
- package/dist/__tests__/render/catalog-json-types.test.d.ts.map +1 -0
- package/dist/__tests__/render/catalog-json-types.test.js +121 -0
- package/dist/__tests__/render/catalog-json-types.test.js.map +1 -0
- package/dist/__tests__/render/catalog-json.test.d.ts +19 -0
- package/dist/__tests__/render/catalog-json.test.d.ts.map +1 -0
- package/dist/__tests__/render/catalog-json.test.js +435 -0
- package/dist/__tests__/render/catalog-json.test.js.map +1 -0
- package/dist/__tests__/render/opensip-id-derivation.test.d.ts +21 -0
- package/dist/__tests__/render/opensip-id-derivation.test.d.ts.map +1 -0
- package/dist/__tests__/render/opensip-id-derivation.test.js +159 -0
- package/dist/__tests__/render/opensip-id-derivation.test.js.map +1 -0
- package/dist/__tests__/render/rule-id-mapping.test.d.ts +13 -0
- package/dist/__tests__/render/rule-id-mapping.test.d.ts.map +1 -0
- package/dist/__tests__/render/rule-id-mapping.test.js +50 -0
- package/dist/__tests__/render/rule-id-mapping.test.js.map +1 -0
- package/dist/__tests__/render/sarif-opensip.test.d.ts +20 -0
- package/dist/__tests__/render/sarif-opensip.test.d.ts.map +1 -0
- package/dist/__tests__/render/sarif-opensip.test.js +235 -0
- package/dist/__tests__/render/sarif-opensip.test.js.map +1 -0
- package/dist/__tests__/resolution-mode.test.d.ts +10 -0
- package/dist/__tests__/resolution-mode.test.d.ts.map +1 -0
- package/dist/__tests__/resolution-mode.test.js +96 -0
- package/dist/__tests__/resolution-mode.test.js.map +1 -0
- package/dist/__tests__/resolve-callee.test.d.ts +2 -0
- package/dist/__tests__/resolve-callee.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-callee.test.js +119 -0
- package/dist/__tests__/resolve-callee.test.js.map +1 -0
- package/dist/__tests__/rules/_entry-points.test.d.ts +8 -0
- package/dist/__tests__/rules/_entry-points.test.d.ts.map +1 -0
- package/dist/__tests__/rules/_entry-points.test.js +74 -0
- package/dist/__tests__/rules/_entry-points.test.js.map +1 -0
- package/dist/__tests__/rules/_helpers.d.ts +18 -0
- package/dist/__tests__/rules/_helpers.d.ts.map +1 -0
- package/dist/__tests__/rules/_helpers.js +72 -0
- package/dist/__tests__/rules/_helpers.js.map +1 -0
- package/dist/__tests__/rules/always-throws-branch.test.d.ts +9 -0
- package/dist/__tests__/rules/always-throws-branch.test.d.ts.map +1 -0
- package/dist/__tests__/rules/always-throws-branch.test.js +113 -0
- package/dist/__tests__/rules/always-throws-branch.test.js.map +1 -0
- package/dist/__tests__/rules/cycle-and-coupling.test.d.ts +13 -0
- package/dist/__tests__/rules/cycle-and-coupling.test.d.ts.map +1 -0
- package/dist/__tests__/rules/cycle-and-coupling.test.js +224 -0
- package/dist/__tests__/rules/cycle-and-coupling.test.js.map +1 -0
- package/dist/__tests__/rules/duplicated-function-body-config.test.d.ts +8 -0
- package/dist/__tests__/rules/duplicated-function-body-config.test.d.ts.map +1 -0
- package/dist/__tests__/rules/duplicated-function-body-config.test.js +132 -0
- package/dist/__tests__/rules/duplicated-function-body-config.test.js.map +1 -0
- package/dist/__tests__/rules/duplicated-function-body-cross-package.test.d.ts +10 -0
- package/dist/__tests__/rules/duplicated-function-body-cross-package.test.d.ts.map +1 -0
- package/dist/__tests__/rules/duplicated-function-body-cross-package.test.js +274 -0
- package/dist/__tests__/rules/duplicated-function-body-cross-package.test.js.map +1 -0
- package/dist/__tests__/rules/feature-column-parity.test.d.ts +11 -0
- package/dist/__tests__/rules/feature-column-parity.test.d.ts.map +1 -0
- package/dist/__tests__/rules/feature-column-parity.test.js +169 -0
- package/dist/__tests__/rules/feature-column-parity.test.js.map +1 -0
- package/dist/__tests__/rules/high-blast-untested.test.d.ts +13 -0
- package/dist/__tests__/rules/high-blast-untested.test.d.ts.map +1 -0
- package/dist/__tests__/rules/high-blast-untested.test.js +108 -0
- package/dist/__tests__/rules/high-blast-untested.test.js.map +1 -0
- package/dist/__tests__/rules/large-function.test.d.ts +11 -0
- package/dist/__tests__/rules/large-function.test.d.ts.map +1 -0
- package/dist/__tests__/rules/large-function.test.js +105 -0
- package/dist/__tests__/rules/large-function.test.js.map +1 -0
- package/dist/__tests__/rules/no-side-effect-path.test.d.ts +10 -0
- package/dist/__tests__/rules/no-side-effect-path.test.d.ts.map +1 -0
- package/dist/__tests__/rules/no-side-effect-path.test.js +301 -0
- package/dist/__tests__/rules/no-side-effect-path.test.js.map +1 -0
- package/dist/__tests__/rules/orphan-subtree-config.test.d.ts +8 -0
- package/dist/__tests__/rules/orphan-subtree-config.test.d.ts.map +1 -0
- package/dist/__tests__/rules/orphan-subtree-config.test.js +176 -0
- package/dist/__tests__/rules/orphan-subtree-config.test.js.map +1 -0
- package/dist/__tests__/rules/registry.test.d.ts +11 -0
- package/dist/__tests__/rules/registry.test.d.ts.map +1 -0
- package/dist/__tests__/rules/registry.test.js +50 -0
- package/dist/__tests__/rules/registry.test.js.map +1 -0
- package/dist/__tests__/rules/severity-override.test.d.ts +11 -0
- package/dist/__tests__/rules/severity-override.test.d.ts.map +1 -0
- package/dist/__tests__/rules/severity-override.test.js +67 -0
- package/dist/__tests__/rules/severity-override.test.js.map +1 -0
- package/dist/__tests__/rules/test-only-reachable.test.d.ts +9 -0
- package/dist/__tests__/rules/test-only-reachable.test.d.ts.map +1 -0
- package/dist/__tests__/rules/test-only-reachable.test.js +142 -0
- package/dist/__tests__/rules/test-only-reachable.test.js.map +1 -0
- package/dist/__tests__/rules/wide-function.test.d.ts +9 -0
- package/dist/__tests__/rules/wide-function.test.d.ts.map +1 -0
- package/dist/__tests__/rules/wide-function.test.js +64 -0
- package/dist/__tests__/rules/wide-function.test.js.map +1 -0
- package/dist/__tests__/test-utils/with-graph-scope.d.ts +14 -0
- package/dist/__tests__/test-utils/with-graph-scope.d.ts.map +1 -0
- package/dist/__tests__/test-utils/with-graph-scope.js +26 -0
- package/dist/__tests__/test-utils/with-graph-scope.js.map +1 -0
- package/dist/__tests__/tool-branches.test.d.ts +18 -0
- package/dist/__tests__/tool-branches.test.d.ts.map +1 -0
- package/dist/__tests__/tool-branches.test.js +262 -0
- package/dist/__tests__/tool-branches.test.js.map +1 -0
- package/dist/__tests__/tool-register.test.d.ts +16 -0
- package/dist/__tests__/tool-register.test.d.ts.map +1 -0
- package/dist/__tests__/tool-register.test.js +419 -0
- package/dist/__tests__/tool-register.test.js.map +1 -0
- package/dist/__tests__/tool.test.d.ts +18 -0
- package/dist/__tests__/tool.test.d.ts.map +1 -0
- package/dist/__tests__/tool.test.js +65 -0
- package/dist/__tests__/tool.test.js.map +1 -0
- package/dist/baseline-strategy.d.ts +28 -0
- package/dist/baseline-strategy.d.ts.map +1 -0
- package/dist/baseline-strategy.js +27 -0
- package/dist/baseline-strategy.js.map +1 -0
- package/dist/cache/engine-version.d.ts +69 -0
- package/dist/cache/engine-version.d.ts.map +1 -0
- package/dist/cache/engine-version.js +60 -0
- package/dist/cache/engine-version.js.map +1 -0
- package/dist/cache/invalidate.d.ts +60 -0
- package/dist/cache/invalidate.d.ts.map +1 -0
- package/dist/cache/invalidate.js +120 -0
- package/dist/cache/invalidate.js.map +1 -0
- package/dist/cli/__tests__/build-envelope.test.d.ts +8 -0
- package/dist/cli/__tests__/build-envelope.test.d.ts.map +1 -0
- package/dist/cli/__tests__/build-envelope.test.js +70 -0
- package/dist/cli/__tests__/build-envelope.test.js.map +1 -0
- package/dist/cli/__tests__/dispatch-envelope.test.d.ts +15 -0
- package/dist/cli/__tests__/dispatch-envelope.test.d.ts.map +1 -0
- package/dist/cli/__tests__/dispatch-envelope.test.js +73 -0
- package/dist/cli/__tests__/dispatch-envelope.test.js.map +1 -0
- package/dist/cli/__tests__/dispatch-suppression-root.test.d.ts +18 -0
- package/dist/cli/__tests__/dispatch-suppression-root.test.d.ts.map +1 -0
- package/dist/cli/__tests__/dispatch-suppression-root.test.js +91 -0
- package/dist/cli/__tests__/dispatch-suppression-root.test.js.map +1 -0
- package/dist/cli/__tests__/graph-config-schema.test.d.ts +7 -0
- package/dist/cli/__tests__/graph-config-schema.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-config-schema.test.js +60 -0
- package/dist/cli/__tests__/graph-config-schema.test.js.map +1 -0
- package/dist/cli/__tests__/graph-gate-mode.test.d.ts +15 -0
- package/dist/cli/__tests__/graph-gate-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-gate-mode.test.js +99 -0
- package/dist/cli/__tests__/graph-gate-mode.test.js.map +1 -0
- package/dist/cli/__tests__/graph-recipes.test.d.ts +7 -0
- package/dist/cli/__tests__/graph-recipes.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-recipes.test.js +24 -0
- package/dist/cli/__tests__/graph-recipes.test.js.map +1 -0
- package/dist/cli/__tests__/graph-report.test.d.ts +7 -0
- package/dist/cli/__tests__/graph-report.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-report.test.js +138 -0
- package/dist/cli/__tests__/graph-report.test.js.map +1 -0
- package/dist/cli/__tests__/graph-tracer.test.d.ts +11 -0
- package/dist/cli/__tests__/graph-tracer.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-tracer.test.js +41 -0
- package/dist/cli/__tests__/graph-tracer.test.js.map +1 -0
- package/dist/cli/__tests__/graph-worker.test.d.ts +13 -0
- package/dist/cli/__tests__/graph-worker.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-worker.test.js +127 -0
- package/dist/cli/__tests__/graph-worker.test.js.map +1 -0
- package/dist/cli/__tests__/list-files.test.d.ts +12 -0
- package/dist/cli/__tests__/list-files.test.d.ts.map +1 -0
- package/dist/cli/__tests__/list-files.test.js +146 -0
- package/dist/cli/__tests__/list-files.test.js.map +1 -0
- package/dist/cli/__tests__/live-suppression-parity.test.d.ts +23 -0
- package/dist/cli/__tests__/live-suppression-parity.test.d.ts.map +1 -0
- package/dist/cli/__tests__/live-suppression-parity.test.js +136 -0
- package/dist/cli/__tests__/live-suppression-parity.test.js.map +1 -0
- package/dist/cli/__tests__/orchestrate-spans.test.d.ts +18 -0
- package/dist/cli/__tests__/orchestrate-spans.test.d.ts.map +1 -0
- package/dist/cli/__tests__/orchestrate-spans.test.js +108 -0
- package/dist/cli/__tests__/orchestrate-spans.test.js.map +1 -0
- package/dist/cli/__tests__/shard-worker.test.d.ts +10 -0
- package/dist/cli/__tests__/shard-worker.test.d.ts.map +1 -0
- package/dist/cli/__tests__/shard-worker.test.js +153 -0
- package/dist/cli/__tests__/shard-worker.test.js.map +1 -0
- package/dist/cli/__tests__/workspace-report.test.d.ts +6 -0
- package/dist/cli/__tests__/workspace-report.test.d.ts.map +1 -0
- package/dist/cli/__tests__/workspace-report.test.js +89 -0
- package/dist/cli/__tests__/workspace-report.test.js.map +1 -0
- package/dist/cli/apply-suppressions.d.ts +86 -0
- package/dist/cli/apply-suppressions.d.ts.map +1 -0
- package/dist/cli/apply-suppressions.js +101 -0
- package/dist/cli/apply-suppressions.js.map +1 -0
- package/dist/cli/apply-suppressions.test.d.ts +12 -0
- package/dist/cli/apply-suppressions.test.d.ts.map +1 -0
- package/dist/cli/apply-suppressions.test.js +85 -0
- package/dist/cli/apply-suppressions.test.js.map +1 -0
- package/dist/cli/build-envelope.d.ts +53 -0
- package/dist/cli/build-envelope.d.ts.map +1 -0
- package/dist/cli/build-envelope.js +88 -0
- package/dist/cli/build-envelope.js.map +1 -0
- package/dist/cli/detect.d.ts +37 -0
- package/dist/cli/detect.d.ts.map +1 -0
- package/dist/cli/detect.js +60 -0
- package/dist/cli/detect.js.map +1 -0
- package/dist/cli/equivalence-check-command.d.ts +45 -0
- package/dist/cli/equivalence-check-command.d.ts.map +1 -0
- package/dist/cli/equivalence-check-command.js +196 -0
- package/dist/cli/equivalence-check-command.js.map +1 -0
- package/dist/cli/graph/graph-aux-command-specs.d.ts +60 -0
- package/dist/cli/graph/graph-aux-command-specs.d.ts.map +1 -0
- package/dist/cli/graph/graph-aux-command-specs.js +390 -0
- package/dist/cli/graph/graph-aux-command-specs.js.map +1 -0
- package/dist/cli/graph/graph-command-spec.d.ts +43 -0
- package/dist/cli/graph/graph-command-spec.d.ts.map +1 -0
- package/dist/cli/graph/graph-command-spec.js +456 -0
- package/dist/cli/graph/graph-command-spec.js.map +1 -0
- package/dist/cli/graph-config-schema.d.ts +70 -0
- package/dist/cli/graph-config-schema.d.ts.map +1 -0
- package/dist/cli/graph-config-schema.js +68 -0
- package/dist/cli/graph-config-schema.js.map +1 -0
- package/dist/cli/graph-config.d.ts +53 -0
- package/dist/cli/graph-config.d.ts.map +1 -0
- package/dist/cli/graph-config.js +111 -0
- package/dist/cli/graph-config.js.map +1 -0
- package/dist/cli/graph-modes.d.ts +36 -0
- package/dist/cli/graph-modes.d.ts.map +1 -0
- package/dist/cli/graph-modes.js +161 -0
- package/dist/cli/graph-modes.js.map +1 -0
- package/dist/cli/graph-options.d.ts +143 -0
- package/dist/cli/graph-options.d.ts.map +1 -0
- package/dist/cli/graph-options.js +15 -0
- package/dist/cli/graph-options.js.map +1 -0
- package/dist/cli/graph-progress.d.ts +31 -0
- package/dist/cli/graph-progress.d.ts.map +1 -0
- package/dist/cli/graph-progress.js +56 -0
- package/dist/cli/graph-progress.js.map +1 -0
- package/dist/cli/graph-recipes.d.ts +23 -0
- package/dist/cli/graph-recipes.d.ts.map +1 -0
- package/dist/cli/graph-recipes.js +44 -0
- package/dist/cli/graph-recipes.js.map +1 -0
- package/dist/cli/graph-report.d.ts +79 -0
- package/dist/cli/graph-report.d.ts.map +1 -0
- package/dist/cli/graph-report.js +186 -0
- package/dist/cli/graph-report.js.map +1 -0
- package/dist/cli/graph-runner.d.ts +106 -0
- package/dist/cli/graph-runner.d.ts.map +1 -0
- package/dist/cli/graph-runner.js +274 -0
- package/dist/cli/graph-runner.js.map +1 -0
- package/dist/cli/graph-tracer.d.ts +27 -0
- package/dist/cli/graph-tracer.d.ts.map +1 -0
- package/dist/cli/graph-tracer.js +33 -0
- package/dist/cli/graph-tracer.js.map +1 -0
- package/dist/cli/graph-worker.d.ts +29 -0
- package/dist/cli/graph-worker.d.ts.map +1 -0
- package/dist/cli/graph-worker.js +86 -0
- package/dist/cli/graph-worker.js.map +1 -0
- package/dist/cli/graph.d.ts +171 -0
- package/dist/cli/graph.d.ts.map +1 -0
- package/dist/cli/graph.js +1041 -0
- package/dist/cli/graph.js.map +1 -0
- package/dist/cli/heap-preflight.d.ts +62 -0
- package/dist/cli/heap-preflight.d.ts.map +1 -0
- package/dist/cli/heap-preflight.js +176 -0
- package/dist/cli/heap-preflight.js.map +1 -0
- package/dist/cli/list-files.d.ts +37 -0
- package/dist/cli/list-files.d.ts.map +1 -0
- package/dist/cli/list-files.js +166 -0
- package/dist/cli/list-files.js.map +1 -0
- package/dist/cli/lookup.d.ts +19 -0
- package/dist/cli/lookup.d.ts.map +1 -0
- package/dist/cli/lookup.js +87 -0
- package/dist/cli/lookup.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/_equivalence-harness.d.ts +47 -0
- package/dist/cli/orchestrate/__tests__/_equivalence-harness.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/_equivalence-harness.js +331 -0
- package/dist/cli/orchestrate/__tests__/_equivalence-harness.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/_flat-large-fixture.d.ts +69 -0
- package/dist/cli/orchestrate/__tests__/_flat-large-fixture.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/_flat-large-fixture.js +181 -0
- package/dist/cli/orchestrate/__tests__/_flat-large-fixture.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/canonical-file-set.test.d.ts +8 -0
- package/dist/cli/orchestrate/__tests__/canonical-file-set.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/canonical-file-set.test.js +51 -0
- package/dist/cli/orchestrate/__tests__/canonical-file-set.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.d.ts +9 -0
- package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.js +147 -0
- package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.d.ts +12 -0
- package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.js +509 -0
- package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/determinism.test.d.ts +19 -0
- package/dist/cli/orchestrate/__tests__/determinism.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/determinism.test.js +163 -0
- package/dist/cli/orchestrate/__tests__/determinism.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/edge-identity.test.d.ts +9 -0
- package/dist/cli/orchestrate/__tests__/edge-identity.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/edge-identity.test.js +103 -0
- package/dist/cli/orchestrate/__tests__/edge-identity.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence-check.test.d.ts +10 -0
- package/dist/cli/orchestrate/__tests__/equivalence-check.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence-check.test.js +277 -0
- package/dist/cli/orchestrate/__tests__/equivalence-check.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.d.ts +51 -0
- package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.js +183 -0
- package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence.test.d.ts +47 -0
- package/dist/cli/orchestrate/__tests__/equivalence.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/equivalence.test.js +259 -0
- package/dist/cli/orchestrate/__tests__/equivalence.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.d.ts +9 -0
- package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.js +105 -0
- package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/export-index.test.d.ts +12 -0
- package/dist/cli/orchestrate/__tests__/export-index.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/export-index.test.js +346 -0
- package/dist/cli/orchestrate/__tests__/export-index.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.d.ts +16 -0
- package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.js +99 -0
- package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.d.ts +11 -0
- package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.js +271 -0
- package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/function-set-parity.test.d.ts +38 -0
- package/dist/cli/orchestrate/__tests__/function-set-parity.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/function-set-parity.test.js +163 -0
- package/dist/cli/orchestrate/__tests__/function-set-parity.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/incremental-merge.test.d.ts +8 -0
- package/dist/cli/orchestrate/__tests__/incremental-merge.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/incremental-merge.test.js +153 -0
- package/dist/cli/orchestrate/__tests__/incremental-merge.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/partition-files.test.d.ts +10 -0
- package/dist/cli/orchestrate/__tests__/partition-files.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/partition-files.test.js +104 -0
- package/dist/cli/orchestrate/__tests__/partition-files.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.d.ts +21 -0
- package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.js +59 -0
- package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/shard-model.test.d.ts +8 -0
- package/dist/cli/orchestrate/__tests__/shard-model.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/shard-model.test.js +77 -0
- package/dist/cli/orchestrate/__tests__/shard-model.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.d.ts +13 -0
- package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.js +103 -0
- package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/sharded-graph.test.d.ts +13 -0
- package/dist/cli/orchestrate/__tests__/sharded-graph.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/sharded-graph.test.js +257 -0
- package/dist/cli/orchestrate/__tests__/sharded-graph.test.js.map +1 -0
- package/dist/cli/orchestrate/__tests__/worker-pool.test.d.ts +6 -0
- package/dist/cli/orchestrate/__tests__/worker-pool.test.d.ts.map +1 -0
- package/dist/cli/orchestrate/__tests__/worker-pool.test.js +38 -0
- package/dist/cli/orchestrate/__tests__/worker-pool.test.js.map +1 -0
- package/dist/cli/orchestrate/cache-orchestrator.d.ts +42 -0
- package/dist/cli/orchestrate/cache-orchestrator.d.ts.map +1 -0
- package/dist/cli/orchestrate/cache-orchestrator.js +92 -0
- package/dist/cli/orchestrate/cache-orchestrator.js.map +1 -0
- package/dist/cli/orchestrate/canonical-file-set.d.ts +51 -0
- package/dist/cli/orchestrate/canonical-file-set.d.ts.map +1 -0
- package/dist/cli/orchestrate/canonical-file-set.js +58 -0
- package/dist/cli/orchestrate/canonical-file-set.js.map +1 -0
- package/dist/cli/orchestrate/catalog-builder.d.ts +121 -0
- package/dist/cli/orchestrate/catalog-builder.d.ts.map +1 -0
- package/dist/cli/orchestrate/catalog-builder.js +279 -0
- package/dist/cli/orchestrate/catalog-builder.js.map +1 -0
- package/dist/cli/orchestrate/catalog-stats.d.ts +31 -0
- package/dist/cli/orchestrate/catalog-stats.d.ts.map +1 -0
- package/dist/cli/orchestrate/catalog-stats.js +52 -0
- package/dist/cli/orchestrate/catalog-stats.js.map +1 -0
- package/dist/cli/orchestrate/cross-shard-resolve.d.ts +190 -0
- package/dist/cli/orchestrate/cross-shard-resolve.d.ts.map +1 -0
- package/dist/cli/orchestrate/cross-shard-resolve.js +523 -0
- package/dist/cli/orchestrate/cross-shard-resolve.js.map +1 -0
- package/dist/cli/orchestrate/edge-identity.d.ts +48 -0
- package/dist/cli/orchestrate/edge-identity.d.ts.map +1 -0
- package/dist/cli/orchestrate/edge-identity.js +68 -0
- package/dist/cli/orchestrate/edge-identity.js.map +1 -0
- package/dist/cli/orchestrate/equivalence-check.d.ts +227 -0
- package/dist/cli/orchestrate/equivalence-check.d.ts.map +1 -0
- package/dist/cli/orchestrate/equivalence-check.js +264 -0
- package/dist/cli/orchestrate/equivalence-check.js.map +1 -0
- package/dist/cli/orchestrate/exact-boundary-recovery.d.ts +33 -0
- package/dist/cli/orchestrate/exact-boundary-recovery.d.ts.map +1 -0
- package/dist/cli/orchestrate/exact-boundary-recovery.js +62 -0
- package/dist/cli/orchestrate/exact-boundary-recovery.js.map +1 -0
- package/dist/cli/orchestrate/flat-monorepo-strategy.d.ts +171 -0
- package/dist/cli/orchestrate/flat-monorepo-strategy.d.ts.map +1 -0
- package/dist/cli/orchestrate/flat-monorepo-strategy.js +328 -0
- package/dist/cli/orchestrate/flat-monorepo-strategy.js.map +1 -0
- package/dist/cli/orchestrate/incremental-merge.d.ts +46 -0
- package/dist/cli/orchestrate/incremental-merge.d.ts.map +1 -0
- package/dist/cli/orchestrate/incremental-merge.js +236 -0
- package/dist/cli/orchestrate/incremental-merge.js.map +1 -0
- package/dist/cli/orchestrate/partition-chunk.d.ts +36 -0
- package/dist/cli/orchestrate/partition-chunk.d.ts.map +1 -0
- package/dist/cli/orchestrate/partition-chunk.js +37 -0
- package/dist/cli/orchestrate/partition-chunk.js.map +1 -0
- package/dist/cli/orchestrate/partition-files.d.ts +52 -0
- package/dist/cli/orchestrate/partition-files.d.ts.map +1 -0
- package/dist/cli/orchestrate/partition-files.js +94 -0
- package/dist/cli/orchestrate/partition-files.js.map +1 -0
- package/dist/cli/orchestrate/resolution-trace.d.ts +11 -0
- package/dist/cli/orchestrate/resolution-trace.d.ts.map +1 -0
- package/dist/cli/orchestrate/resolution-trace.js +27 -0
- package/dist/cli/orchestrate/resolution-trace.js.map +1 -0
- package/dist/cli/orchestrate/shard-model.d.ts +99 -0
- package/dist/cli/orchestrate/shard-model.d.ts.map +1 -0
- package/dist/cli/orchestrate/shard-model.js +23 -0
- package/dist/cli/orchestrate/shard-model.js.map +1 -0
- package/dist/cli/orchestrate/shard-runner.d.ts +65 -0
- package/dist/cli/orchestrate/shard-runner.d.ts.map +1 -0
- package/dist/cli/orchestrate/shard-runner.js +169 -0
- package/dist/cli/orchestrate/shard-runner.js.map +1 -0
- package/dist/cli/orchestrate/sharded-graph.d.ts +86 -0
- package/dist/cli/orchestrate/sharded-graph.d.ts.map +1 -0
- package/dist/cli/orchestrate/sharded-graph.js +227 -0
- package/dist/cli/orchestrate/sharded-graph.js.map +1 -0
- package/dist/cli/orchestrate/types.d.ts +31 -0
- package/dist/cli/orchestrate/types.d.ts.map +1 -0
- package/dist/cli/orchestrate/types.js +24 -0
- package/dist/cli/orchestrate/types.js.map +1 -0
- package/dist/cli/orchestrate/worker-pool.d.ts +16 -0
- package/dist/cli/orchestrate/worker-pool.d.ts.map +1 -0
- package/dist/cli/orchestrate/worker-pool.js +39 -0
- package/dist/cli/orchestrate/worker-pool.js.map +1 -0
- package/dist/cli/orchestrate.d.ts +106 -0
- package/dist/cli/orchestrate.d.ts.map +1 -0
- package/dist/cli/orchestrate.js +228 -0
- package/dist/cli/orchestrate.js.map +1 -0
- package/dist/cli/positional-paths.d.ts +23 -0
- package/dist/cli/positional-paths.d.ts.map +1 -0
- package/dist/cli/positional-paths.js +64 -0
- package/dist/cli/positional-paths.js.map +1 -0
- package/dist/cli/pressure-monitor.d.ts +62 -0
- package/dist/cli/pressure-monitor.d.ts.map +1 -0
- package/dist/cli/pressure-monitor.js +110 -0
- package/dist/cli/pressure-monitor.js.map +1 -0
- package/dist/cli/profile.d.ts +82 -0
- package/dist/cli/profile.d.ts.map +1 -0
- package/dist/cli/profile.js +120 -0
- package/dist/cli/profile.js.map +1 -0
- package/dist/cli/report-data.d.ts +46 -0
- package/dist/cli/report-data.d.ts.map +1 -0
- package/dist/cli/report-data.js +48 -0
- package/dist/cli/report-data.js.map +1 -0
- package/dist/cli/resolve-adapters.d.ts +19 -0
- package/dist/cli/resolve-adapters.d.ts.map +1 -0
- package/dist/cli/resolve-adapters.js +38 -0
- package/dist/cli/resolve-adapters.js.map +1 -0
- package/dist/cli/sarif-export.d.ts +40 -0
- package/dist/cli/sarif-export.d.ts.map +1 -0
- package/dist/cli/sarif-export.js +69 -0
- package/dist/cli/sarif-export.js.map +1 -0
- package/dist/cli/shard-worker.d.ts +25 -0
- package/dist/cli/shard-worker.d.ts.map +1 -0
- package/dist/cli/shard-worker.js +98 -0
- package/dist/cli/shard-worker.js.map +1 -0
- package/dist/cli/symbol-index.d.ts +51 -0
- package/dist/cli/symbol-index.d.ts.map +1 -0
- package/dist/cli/symbol-index.js +120 -0
- package/dist/cli/symbol-index.js.map +1 -0
- package/dist/cli/workspace-report.d.ts +32 -0
- package/dist/cli/workspace-report.d.ts.map +1 -0
- package/dist/cli/workspace-report.js +107 -0
- package/dist/cli/workspace-report.js.map +1 -0
- package/dist/cli/workspace-runner.d.ts +104 -0
- package/dist/cli/workspace-runner.d.ts.map +1 -0
- package/dist/cli/workspace-runner.js +166 -0
- package/dist/cli/workspace-runner.js.map +1 -0
- package/dist/cross-package/export-index.d.ts +118 -0
- package/dist/cross-package/export-index.d.ts.map +1 -0
- package/dist/cross-package/export-index.js +296 -0
- package/dist/cross-package/export-index.js.map +1 -0
- package/dist/cross-package/posix-path.d.ts +16 -0
- package/dist/cross-package/posix-path.d.ts.map +1 -0
- package/dist/cross-package/posix-path.js +18 -0
- package/dist/cross-package/posix-path.js.map +1 -0
- package/dist/cross-package/resolve.d.ts +68 -0
- package/dist/cross-package/resolve.d.ts.map +1 -0
- package/dist/cross-package/resolve.js +83 -0
- package/dist/cross-package/resolve.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +25 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +38 -0
- package/dist/internal.js.map +1 -0
- package/dist/lang-adapter/body-digest.d.ts +46 -0
- package/dist/lang-adapter/body-digest.d.ts.map +1 -0
- package/dist/lang-adapter/body-digest.js +49 -0
- package/dist/lang-adapter/body-digest.js.map +1 -0
- package/dist/lang-adapter/edge-helpers.d.ts +104 -0
- package/dist/lang-adapter/edge-helpers.d.ts.map +1 -0
- package/dist/lang-adapter/edge-helpers.js +120 -0
- package/dist/lang-adapter/edge-helpers.js.map +1 -0
- package/dist/lang-adapter/registry.d.ts +59 -0
- package/dist/lang-adapter/registry.d.ts.map +1 -0
- package/dist/lang-adapter/registry.js +100 -0
- package/dist/lang-adapter/registry.js.map +1 -0
- package/dist/lang-adapter/selector.d.ts +39 -0
- package/dist/lang-adapter/selector.d.ts.map +1 -0
- package/dist/lang-adapter/selector.js +140 -0
- package/dist/lang-adapter/selector.js.map +1 -0
- package/dist/lang-adapter/types.d.ts +217 -0
- package/dist/lang-adapter/types.d.ts.map +1 -0
- package/dist/lang-adapter/types.js +18 -0
- package/dist/lang-adapter/types.js.map +1 -0
- package/dist/owner-key.d.ts +22 -0
- package/dist/owner-key.d.ts.map +1 -0
- package/dist/owner-key.js +25 -0
- package/dist/owner-key.js.map +1 -0
- package/dist/persistence/__tests__/shard-fragment-cache.test.d.ts +8 -0
- package/dist/persistence/__tests__/shard-fragment-cache.test.d.ts.map +1 -0
- package/dist/persistence/__tests__/shard-fragment-cache.test.js +126 -0
- package/dist/persistence/__tests__/shard-fragment-cache.test.js.map +1 -0
- package/dist/persistence/catalog-repo.d.ts +77 -0
- package/dist/persistence/catalog-repo.d.ts.map +1 -0
- package/dist/persistence/catalog-repo.js +229 -0
- package/dist/persistence/catalog-repo.js.map +1 -0
- package/dist/persistence/schema.d.ts +249 -0
- package/dist/persistence/schema.d.ts.map +1 -0
- package/dist/persistence/schema.js +53 -0
- package/dist/persistence/schema.js.map +1 -0
- package/dist/persistence/session-payload.d.ts +96 -0
- package/dist/persistence/session-payload.d.ts.map +1 -0
- package/dist/persistence/session-payload.js +116 -0
- package/dist/persistence/session-payload.js.map +1 -0
- package/dist/persistence/session-replay.d.ts +15 -0
- package/dist/persistence/session-replay.d.ts.map +1 -0
- package/dist/persistence/session-replay.js +80 -0
- package/dist/persistence/session-replay.js.map +1 -0
- package/dist/pipeline/__tests__/assign-packages.test.d.ts +2 -0
- package/dist/pipeline/__tests__/assign-packages.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/assign-packages.test.js +88 -0
- package/dist/pipeline/__tests__/assign-packages.test.js.map +1 -0
- package/dist/pipeline/__tests__/constrain-edges.test.d.ts +2 -0
- package/dist/pipeline/__tests__/constrain-edges.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/constrain-edges.test.js +228 -0
- package/dist/pipeline/__tests__/constrain-edges.test.js.map +1 -0
- package/dist/pipeline/__tests__/features.test.d.ts +9 -0
- package/dist/pipeline/__tests__/features.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/features.test.js +458 -0
- package/dist/pipeline/__tests__/features.test.js.map +1 -0
- package/dist/pipeline/__tests__/indexes-imports.test.d.ts +2 -0
- package/dist/pipeline/__tests__/indexes-imports.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/indexes-imports.test.js +114 -0
- package/dist/pipeline/__tests__/indexes-imports.test.js.map +1 -0
- package/dist/pipeline/assign-packages.d.ts +18 -0
- package/dist/pipeline/assign-packages.d.ts.map +1 -0
- package/dist/pipeline/assign-packages.js +86 -0
- package/dist/pipeline/assign-packages.js.map +1 -0
- package/dist/pipeline/constrain-edges.d.ts +34 -0
- package/dist/pipeline/constrain-edges.d.ts.map +1 -0
- package/dist/pipeline/constrain-edges.js +139 -0
- package/dist/pipeline/constrain-edges.js.map +1 -0
- package/dist/pipeline/feature-deps.d.ts +19 -0
- package/dist/pipeline/feature-deps.d.ts.map +1 -0
- package/dist/pipeline/feature-deps.js +28 -0
- package/dist/pipeline/feature-deps.js.map +1 -0
- package/dist/pipeline/features.d.ts +50 -0
- package/dist/pipeline/features.d.ts.map +1 -0
- package/dist/pipeline/features.js +462 -0
- package/dist/pipeline/features.js.map +1 -0
- package/dist/pipeline/indexes.d.ts +27 -0
- package/dist/pipeline/indexes.d.ts.map +1 -0
- package/dist/pipeline/indexes.js +159 -0
- package/dist/pipeline/indexes.js.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts +5 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js +24 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
- package/dist/recipes/__tests__/registry.test.d.ts +7 -0
- package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/registry.test.js +34 -0
- package/dist/recipes/__tests__/registry.test.js.map +1 -0
- package/dist/recipes/__tests__/resolve.test.d.ts +10 -0
- package/dist/recipes/__tests__/resolve.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/resolve.test.js +38 -0
- package/dist/recipes/__tests__/resolve.test.js.map +1 -0
- package/dist/recipes/built-in-recipes.d.ts +26 -0
- package/dist/recipes/built-in-recipes.d.ts.map +1 -0
- package/dist/recipes/built-in-recipes.js +43 -0
- package/dist/recipes/built-in-recipes.js.map +1 -0
- package/dist/recipes/registry.d.ts +31 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +48 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/resolve.d.ts +31 -0
- package/dist/recipes/resolve.d.ts.map +1 -0
- package/dist/recipes/resolve.js +70 -0
- package/dist/recipes/resolve.js.map +1 -0
- package/dist/recipes/types.d.ts +58 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +39 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/render/__tests__/catalog-json.test.d.ts +9 -0
- package/dist/render/__tests__/catalog-json.test.d.ts.map +1 -0
- package/dist/render/__tests__/catalog-json.test.js +132 -0
- package/dist/render/__tests__/catalog-json.test.js.map +1 -0
- package/dist/render/catalog-json-types.d.ts +114 -0
- package/dist/render/catalog-json-types.d.ts.map +1 -0
- package/dist/render/catalog-json-types.js +23 -0
- package/dist/render/catalog-json-types.js.map +1 -0
- package/dist/render/catalog-json.d.ts +43 -0
- package/dist/render/catalog-json.d.ts.map +1 -0
- package/dist/render/catalog-json.js +303 -0
- package/dist/render/catalog-json.js.map +1 -0
- package/dist/render/opensip-id-derivation.d.ts +73 -0
- package/dist/render/opensip-id-derivation.d.ts.map +1 -0
- package/dist/render/opensip-id-derivation.js +65 -0
- package/dist/render/opensip-id-derivation.js.map +1 -0
- package/dist/render/rule-id-mapping.d.ts +61 -0
- package/dist/render/rule-id-mapping.d.ts.map +1 -0
- package/dist/render/rule-id-mapping.js +82 -0
- package/dist/render/rule-id-mapping.js.map +1 -0
- package/dist/resolve-callee.d.ts +50 -0
- package/dist/resolve-callee.d.ts.map +1 -0
- package/dist/resolve-callee.js +80 -0
- package/dist/resolve-callee.js.map +1 -0
- package/dist/rules/__tests__/__fixtures__/catalog.fixture.d.ts +22 -0
- package/dist/rules/__tests__/__fixtures__/catalog.fixture.d.ts.map +1 -0
- package/dist/rules/__tests__/__fixtures__/catalog.fixture.js +143 -0
- package/dist/rules/__tests__/__fixtures__/catalog.fixture.js.map +1 -0
- package/dist/rules/__tests__/create-graph-signal.test.d.ts +8 -0
- package/dist/rules/__tests__/create-graph-signal.test.d.ts.map +1 -0
- package/dist/rules/__tests__/create-graph-signal.test.js +55 -0
- package/dist/rules/__tests__/create-graph-signal.test.js.map +1 -0
- package/dist/rules/__tests__/define-rule.test.d.ts +13 -0
- package/dist/rules/__tests__/define-rule.test.d.ts.map +1 -0
- package/dist/rules/__tests__/define-rule.test.js +102 -0
- package/dist/rules/__tests__/define-rule.test.js.map +1 -0
- package/dist/rules/__tests__/fingerprint-golden.test.d.ts +21 -0
- package/dist/rules/__tests__/fingerprint-golden.test.d.ts.map +1 -0
- package/dist/rules/__tests__/fingerprint-golden.test.js +69 -0
- package/dist/rules/__tests__/fingerprint-golden.test.js.map +1 -0
- package/dist/rules/__tests__/registry.test.d.ts +6 -0
- package/dist/rules/__tests__/registry.test.d.ts.map +1 -0
- package/dist/rules/__tests__/registry.test.js +37 -0
- package/dist/rules/__tests__/registry.test.js.map +1 -0
- package/dist/rules/__tests__/rule-behaviors.test.d.ts +9 -0
- package/dist/rules/__tests__/rule-behaviors.test.d.ts.map +1 -0
- package/dist/rules/__tests__/rule-behaviors.test.js +204 -0
- package/dist/rules/__tests__/rule-behaviors.test.js.map +1 -0
- package/dist/rules/__tests__/signal-output.snapshot.test.d.ts +11 -0
- package/dist/rules/__tests__/signal-output.snapshot.test.d.ts.map +1 -0
- package/dist/rules/__tests__/signal-output.snapshot.test.js +55 -0
- package/dist/rules/__tests__/signal-output.snapshot.test.js.map +1 -0
- package/dist/rules/_approximation.d.ts +23 -0
- package/dist/rules/_approximation.d.ts.map +1 -0
- package/dist/rules/_approximation.js +28 -0
- package/dist/rules/_approximation.js.map +1 -0
- package/dist/rules/_entry-points.d.ts +27 -0
- package/dist/rules/_entry-points.d.ts.map +1 -0
- package/dist/rules/_entry-points.js +81 -0
- package/dist/rules/_entry-points.js.map +1 -0
- package/dist/rules/_severity-override.d.ts +32 -0
- package/dist/rules/_severity-override.d.ts.map +1 -0
- package/dist/rules/_severity-override.js +33 -0
- package/dist/rules/_severity-override.js.map +1 -0
- package/dist/rules/always-throws-branch.d.ts +26 -0
- package/dist/rules/always-throws-branch.d.ts.map +1 -0
- package/dist/rules/always-throws-branch.js +66 -0
- package/dist/rules/always-throws-branch.js.map +1 -0
- package/dist/rules/create-graph-signal.d.ts +38 -0
- package/dist/rules/create-graph-signal.d.ts.map +1 -0
- package/dist/rules/create-graph-signal.js +35 -0
- package/dist/rules/create-graph-signal.js.map +1 -0
- package/dist/rules/cycle.d.ts +29 -0
- package/dist/rules/cycle.d.ts.map +1 -0
- package/dist/rules/cycle.js +166 -0
- package/dist/rules/cycle.js.map +1 -0
- package/dist/rules/cycle.memberlocations.test.d.ts +11 -0
- package/dist/rules/cycle.memberlocations.test.d.ts.map +1 -0
- package/dist/rules/cycle.memberlocations.test.js +84 -0
- package/dist/rules/cycle.memberlocations.test.js.map +1 -0
- package/dist/rules/define-rule.d.ts +67 -0
- package/dist/rules/define-rule.d.ts.map +1 -0
- package/dist/rules/define-rule.js +66 -0
- package/dist/rules/define-rule.js.map +1 -0
- package/dist/rules/duplicated-function-body.d.ts +40 -0
- package/dist/rules/duplicated-function-body.d.ts.map +1 -0
- package/dist/rules/duplicated-function-body.js +232 -0
- package/dist/rules/duplicated-function-body.js.map +1 -0
- package/dist/rules/high-blast-untested.d.ts +26 -0
- package/dist/rules/high-blast-untested.d.ts.map +1 -0
- package/dist/rules/high-blast-untested.js +82 -0
- package/dist/rules/high-blast-untested.js.map +1 -0
- package/dist/rules/large-function.d.ts +22 -0
- package/dist/rules/large-function.d.ts.map +1 -0
- package/dist/rules/large-function.js +72 -0
- package/dist/rules/large-function.js.map +1 -0
- package/dist/rules/no-side-effect-path.d.ts +31 -0
- package/dist/rules/no-side-effect-path.d.ts.map +1 -0
- package/dist/rules/no-side-effect-path.js +217 -0
- package/dist/rules/no-side-effect-path.js.map +1 -0
- package/dist/rules/orphan-subtree.d.ts +11 -0
- package/dist/rules/orphan-subtree.d.ts.map +1 -0
- package/dist/rules/orphan-subtree.js +104 -0
- package/dist/rules/orphan-subtree.js.map +1 -0
- package/dist/rules/registry.d.ts +35 -0
- package/dist/rules/registry.d.ts.map +1 -0
- package/dist/rules/registry.js +96 -0
- package/dist/rules/registry.js.map +1 -0
- package/dist/rules/test-only-reachable.d.ts +9 -0
- package/dist/rules/test-only-reachable.d.ts.map +1 -0
- package/dist/rules/test-only-reachable.js +101 -0
- package/dist/rules/test-only-reachable.js.map +1 -0
- package/dist/rules/unexpected-coupling.d.ts +29 -0
- package/dist/rules/unexpected-coupling.d.ts.map +1 -0
- package/dist/rules/unexpected-coupling.js +0 -0
- package/dist/rules/unexpected-coupling.js.map +1 -0
- package/dist/rules/wide-function.d.ts +18 -0
- package/dist/rules/wide-function.d.ts.map +1 -0
- package/dist/rules/wide-function.js +58 -0
- package/dist/rules/wide-function.js.map +1 -0
- package/dist/scope-augmentation.d.ts +58 -0
- package/dist/scope-augmentation.d.ts.map +1 -0
- package/dist/scope-augmentation.js +29 -0
- package/dist/scope-augmentation.js.map +1 -0
- package/dist/tool.d.ts +29 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +241 -0
- package/dist/tool.js.map +1 -0
- package/dist/types.d.ts +642 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine-version cache invalidation (ADR-0015).
|
|
3
|
+
*
|
|
4
|
+
* The persisted catalog and per-shard fragment caches let a re-run skip
|
|
5
|
+
* parse/walk/resolve when nothing relevant changed. Their validity is
|
|
6
|
+
* keyed on the adapter `cacheKey` (config + tool-version hash) and a
|
|
7
|
+
* per-file fingerprint — but NOT on the version of the graph engine that
|
|
8
|
+
* produced them. So upgrading opensip-cli to a build with changed
|
|
9
|
+
* catalog-construction logic (edge resolution, body hashing, a new
|
|
10
|
+
* rule-relevant field) would replay a stale catalog when the source was
|
|
11
|
+
* unchanged: the customer analog of running a stale compiled binary.
|
|
12
|
+
*
|
|
13
|
+
* Fix: fold the running engine's package version into the `cacheKey` at
|
|
14
|
+
* the (language-agnostic) engine boundary, so ANY tool upgrade
|
|
15
|
+
* invalidates the cache for EVERY adapter — TypeScript and the
|
|
16
|
+
* tree-sitter languages alike — and the next run rebuilds with the
|
|
17
|
+
* engine the user actually installed. Over-invalidation (a no-op release
|
|
18
|
+
* triggers one cold rebuild) is the deliberately safe default.
|
|
19
|
+
*
|
|
20
|
+
* Stamping lives in the existing `cacheKey` channel (not a parallel
|
|
21
|
+
* field) precisely because both cache paths — `classifyCatalog` for the
|
|
22
|
+
* full catalog and `planShardWork`/`loadValidShardFragment` for shard
|
|
23
|
+
* fragments — already invalidate on `cacheKey` mismatch. One stamp,
|
|
24
|
+
* both caches, all languages, and no datastore migration: a pre-stamp
|
|
25
|
+
* catalog simply mismatches the new prefix and rebuilds once.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The running `@opensip-cli/graph` package version, resolved once from
|
|
29
|
+
* the nearest `package.json`. In a published install this is the version
|
|
30
|
+
* npm placed on disk; in the monorepo it is `graph/engine`'s version.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ENGINE_VERSION: string;
|
|
33
|
+
/**
|
|
34
|
+
* The two build engines whose catalogs share the single `graph_catalog`
|
|
35
|
+
* row (id=1). The exact engine (single-program `runGraph`) and the sharded
|
|
36
|
+
* engine resolve cross-package edges through ONE shared hop (exact = the
|
|
37
|
+
* 1-shard case), held equivalent by the directional soundness invariant +
|
|
38
|
+
* completeness floor (ADR-0033, supersedes ADR-0032), but
|
|
39
|
+
* the mode is still folded into the `cacheKey` (below) so a mode switch is a
|
|
40
|
+
* clean, attributable cache miss rather than a silent cross-engine read of a
|
|
41
|
+
* row built under different orchestration — keeping the two cache lineages
|
|
42
|
+
* independent and the invalidate logs diagnosable.
|
|
43
|
+
*
|
|
44
|
+
* Determinism (ADR-0032, superseding ADR-0031): the default `graph` uses
|
|
45
|
+
* `'sharded'` when the project is shardable; `'exact'` is reached via the
|
|
46
|
+
* explicit `--exact` opt-out or when the project isn't shardable.
|
|
47
|
+
*/
|
|
48
|
+
export type EngineMode = 'exact' | 'sharded';
|
|
49
|
+
/**
|
|
50
|
+
* Prefix an adapter's `cacheKey` with the running engine version AND the
|
|
51
|
+
* build engine mode so (a) a tool upgrade invalidates persisted
|
|
52
|
+
* catalogs/fragments, and (b) the exact and sharded engines — which write
|
|
53
|
+
* the same `graph_catalog` row — keep independent cache lineages and never
|
|
54
|
+
* read each other's row. Applied at every engine-side cacheKey computation
|
|
55
|
+
* (build-time stamp + both reuse-decision comparisons), so the stamped and
|
|
56
|
+
* compared keys always agree.
|
|
57
|
+
*
|
|
58
|
+
* `mode` defaults to `'exact'` because the single-program `runGraph` path IS
|
|
59
|
+
* the exact engine and stamps the default; the (now-default) sharded path
|
|
60
|
+
* passes `'sharded'` explicitly, including when it derives the merged
|
|
61
|
+
* build-level key from the per-shard keys.
|
|
62
|
+
*
|
|
63
|
+
* The result stays an opaque string per the `Catalog.cacheKey` contract;
|
|
64
|
+
* the `eng=<version>|mode=<mode>|` prefix is human-legible in the
|
|
65
|
+
* invalidate logs (`cached:`/`current:`) so a version- or mode-driven
|
|
66
|
+
* rebuild is diagnosable.
|
|
67
|
+
*/
|
|
68
|
+
export declare function stampEngineVersion(adapterCacheKey: string, mode?: EngineMode): string;
|
|
69
|
+
//# sourceMappingURL=engine-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-version.d.ts","sourceRoot":"","sources":["../../src/cache/engine-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAsC,CAAC;AAKlE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAK7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,GAAE,UAAoB,GAAG,MAAM,CAE9F"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine-version cache invalidation (ADR-0015).
|
|
3
|
+
*
|
|
4
|
+
* The persisted catalog and per-shard fragment caches let a re-run skip
|
|
5
|
+
* parse/walk/resolve when nothing relevant changed. Their validity is
|
|
6
|
+
* keyed on the adapter `cacheKey` (config + tool-version hash) and a
|
|
7
|
+
* per-file fingerprint — but NOT on the version of the graph engine that
|
|
8
|
+
* produced them. So upgrading opensip-cli to a build with changed
|
|
9
|
+
* catalog-construction logic (edge resolution, body hashing, a new
|
|
10
|
+
* rule-relevant field) would replay a stale catalog when the source was
|
|
11
|
+
* unchanged: the customer analog of running a stale compiled binary.
|
|
12
|
+
*
|
|
13
|
+
* Fix: fold the running engine's package version into the `cacheKey` at
|
|
14
|
+
* the (language-agnostic) engine boundary, so ANY tool upgrade
|
|
15
|
+
* invalidates the cache for EVERY adapter — TypeScript and the
|
|
16
|
+
* tree-sitter languages alike — and the next run rebuilds with the
|
|
17
|
+
* engine the user actually installed. Over-invalidation (a no-op release
|
|
18
|
+
* triggers one cold rebuild) is the deliberately safe default.
|
|
19
|
+
*
|
|
20
|
+
* Stamping lives in the existing `cacheKey` channel (not a parallel
|
|
21
|
+
* field) precisely because both cache paths — `classifyCatalog` for the
|
|
22
|
+
* full catalog and `planShardWork`/`loadValidShardFragment` for shard
|
|
23
|
+
* fragments — already invalidate on `cacheKey` mismatch. One stamp,
|
|
24
|
+
* both caches, all languages, and no datastore migration: a pre-stamp
|
|
25
|
+
* catalog simply mismatches the new prefix and rebuilds once.
|
|
26
|
+
*/
|
|
27
|
+
import { readPackageVersion } from '@opensip-cli/core';
|
|
28
|
+
/**
|
|
29
|
+
* The running `@opensip-cli/graph` package version, resolved once from
|
|
30
|
+
* the nearest `package.json`. In a published install this is the version
|
|
31
|
+
* npm placed on disk; in the monorepo it is `graph/engine`'s version.
|
|
32
|
+
*/
|
|
33
|
+
export const ENGINE_VERSION = readPackageVersion(import.meta.url);
|
|
34
|
+
/** Cache-key prefix carrying the engine version. */
|
|
35
|
+
const ENGINE_VERSION_PREFIX = 'eng=';
|
|
36
|
+
/** Cache-key segment carrying the build engine mode. */
|
|
37
|
+
const ENGINE_MODE_PREFIX = 'mode=';
|
|
38
|
+
/**
|
|
39
|
+
* Prefix an adapter's `cacheKey` with the running engine version AND the
|
|
40
|
+
* build engine mode so (a) a tool upgrade invalidates persisted
|
|
41
|
+
* catalogs/fragments, and (b) the exact and sharded engines — which write
|
|
42
|
+
* the same `graph_catalog` row — keep independent cache lineages and never
|
|
43
|
+
* read each other's row. Applied at every engine-side cacheKey computation
|
|
44
|
+
* (build-time stamp + both reuse-decision comparisons), so the stamped and
|
|
45
|
+
* compared keys always agree.
|
|
46
|
+
*
|
|
47
|
+
* `mode` defaults to `'exact'` because the single-program `runGraph` path IS
|
|
48
|
+
* the exact engine and stamps the default; the (now-default) sharded path
|
|
49
|
+
* passes `'sharded'` explicitly, including when it derives the merged
|
|
50
|
+
* build-level key from the per-shard keys.
|
|
51
|
+
*
|
|
52
|
+
* The result stays an opaque string per the `Catalog.cacheKey` contract;
|
|
53
|
+
* the `eng=<version>|mode=<mode>|` prefix is human-legible in the
|
|
54
|
+
* invalidate logs (`cached:`/`current:`) so a version- or mode-driven
|
|
55
|
+
* rebuild is diagnosable.
|
|
56
|
+
*/
|
|
57
|
+
export function stampEngineVersion(adapterCacheKey, mode = 'exact') {
|
|
58
|
+
return `${ENGINE_VERSION_PREFIX}${ENGINE_VERSION}|${ENGINE_MODE_PREFIX}${mode}|${adapterCacheKey}`;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=engine-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-version.js","sourceRoot":"","sources":["../../src/cache/engine-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElE,oDAAoD;AACpD,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAmBrC,wDAAwD;AACxD,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,kBAAkB,CAAC,eAAuB,EAAE,OAAmB,OAAO;IACpF,OAAO,GAAG,qBAAqB,GAAG,cAAc,IAAI,kBAAkB,GAAG,IAAI,IAAI,eAAe,EAAE,CAAC;AACrG,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache invalidation per §6.2.
|
|
3
|
+
*
|
|
4
|
+
* v3: the catalog is content-keyed via three signals:
|
|
5
|
+
* 1. language — adapter id; mismatch invalidates immediately.
|
|
6
|
+
* 2. cacheKey — opaque per-adapter invalidation key; mismatch
|
|
7
|
+
* invalidates (e.g. TS upgrade or tsconfig change).
|
|
8
|
+
* 3. filesFingerprint — per-file mtime + size agreement; any source
|
|
9
|
+
* file change re-runs stages 1+2.
|
|
10
|
+
*
|
|
11
|
+
* Per-file fingerprinting uses mtime + size to keep the cost low.
|
|
12
|
+
*
|
|
13
|
+
* Wave 4 layered an "incremental" verdict on top: when language +
|
|
14
|
+
* cacheKey agree but some files have changed mtimes, the orchestrator
|
|
15
|
+
* can re-walk only the changed files (plus their transitive edge-
|
|
16
|
+
* dependents) instead of rebuilding everything. See `classifyCatalog`
|
|
17
|
+
* and the orchestrator's incremental path.
|
|
18
|
+
*/
|
|
19
|
+
import type { Catalog } from '../types.js';
|
|
20
|
+
export interface ValidationContext {
|
|
21
|
+
readonly currentLanguage: string;
|
|
22
|
+
readonly currentCacheKey: string;
|
|
23
|
+
readonly currentFiles: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Wave 4 verdict — three states:
|
|
27
|
+
* - 'valid': cached catalog matches current file set on every axis;
|
|
28
|
+
* orchestrator returns it untouched.
|
|
29
|
+
* - 'incremental': language + cacheKey agree, but some files changed.
|
|
30
|
+
* `changedFiles` lists the absolute paths whose cached entries
|
|
31
|
+
* must be re-walked. Orchestrator builds the program over all
|
|
32
|
+
* current files and only walks/resolves the changed set.
|
|
33
|
+
* - 'invalid': structural mismatch (language, cacheKey, missing
|
|
34
|
+
* fingerprint). Orchestrator does a full rebuild.
|
|
35
|
+
*/
|
|
36
|
+
export type CatalogVerdict = {
|
|
37
|
+
readonly kind: 'valid';
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: 'incremental';
|
|
40
|
+
readonly changedFiles: readonly string[];
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: 'invalid';
|
|
43
|
+
readonly reason: string;
|
|
44
|
+
};
|
|
45
|
+
export declare function classifyCatalog(cached: Catalog, ctx: ValidationContext): CatalogVerdict;
|
|
46
|
+
/**
|
|
47
|
+
* Compute a fingerprint over the project's source files. Uses mtime
|
|
48
|
+
* (nanosecond resolution) per file plus the file count; cheap to
|
|
49
|
+
* compute and stable for unchanged trees.
|
|
50
|
+
*/
|
|
51
|
+
export declare function computeFilesFingerprint(files: readonly string[]): string;
|
|
52
|
+
/**
|
|
53
|
+
* Diff two fingerprints (computed by `computeFilesFingerprint`) and
|
|
54
|
+
* return the absolute file paths that differ. A file appears in the
|
|
55
|
+
* result if it was added, removed, or had its mtime/size change. The
|
|
56
|
+
* leading file-count line is ignored. Used by the incremental
|
|
57
|
+
* rebuild path.
|
|
58
|
+
*/
|
|
59
|
+
export declare function diffFingerprints(cachedFingerprint: string, currentFingerprint: string): readonly string[];
|
|
60
|
+
//# sourceMappingURL=invalidate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidate.d.ts","sourceRoot":"","sources":["../../src/cache/invalidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,iBAAiB,GAAG,cAAc,CAyCvF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAWxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,iBAAiB,EAAE,MAAM,EACzB,kBAAkB,EAAE,MAAM,GACzB,SAAS,MAAM,EAAE,CAYnB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache invalidation per §6.2.
|
|
3
|
+
*
|
|
4
|
+
* v3: the catalog is content-keyed via three signals:
|
|
5
|
+
* 1. language — adapter id; mismatch invalidates immediately.
|
|
6
|
+
* 2. cacheKey — opaque per-adapter invalidation key; mismatch
|
|
7
|
+
* invalidates (e.g. TS upgrade or tsconfig change).
|
|
8
|
+
* 3. filesFingerprint — per-file mtime + size agreement; any source
|
|
9
|
+
* file change re-runs stages 1+2.
|
|
10
|
+
*
|
|
11
|
+
* Per-file fingerprinting uses mtime + size to keep the cost low.
|
|
12
|
+
*
|
|
13
|
+
* Wave 4 layered an "incremental" verdict on top: when language +
|
|
14
|
+
* cacheKey agree but some files have changed mtimes, the orchestrator
|
|
15
|
+
* can re-walk only the changed files (plus their transitive edge-
|
|
16
|
+
* dependents) instead of rebuilding everything. See `classifyCatalog`
|
|
17
|
+
* and the orchestrator's incremental path.
|
|
18
|
+
*/
|
|
19
|
+
import { statSync } from 'node:fs';
|
|
20
|
+
import { logger } from '@opensip-cli/core';
|
|
21
|
+
export function classifyCatalog(cached, ctx) {
|
|
22
|
+
if (cached.language !== ctx.currentLanguage) {
|
|
23
|
+
logger.info({
|
|
24
|
+
evt: 'graph.cache.invalidate.miss',
|
|
25
|
+
module: 'graph:cache',
|
|
26
|
+
reason: 'language-changed',
|
|
27
|
+
cached: cached.language,
|
|
28
|
+
current: ctx.currentLanguage,
|
|
29
|
+
});
|
|
30
|
+
return { kind: 'invalid', reason: 'language-changed' };
|
|
31
|
+
}
|
|
32
|
+
if (cached.cacheKey !== ctx.currentCacheKey) {
|
|
33
|
+
logger.info({
|
|
34
|
+
evt: 'graph.cache.invalidate.miss',
|
|
35
|
+
module: 'graph:cache',
|
|
36
|
+
reason: 'cache-key-changed',
|
|
37
|
+
cached: cached.cacheKey,
|
|
38
|
+
current: ctx.currentCacheKey,
|
|
39
|
+
});
|
|
40
|
+
return { kind: 'invalid', reason: 'cache-key-changed' };
|
|
41
|
+
}
|
|
42
|
+
const cachedFingerprint = cached.filesFingerprint;
|
|
43
|
+
if (typeof cachedFingerprint !== 'string') {
|
|
44
|
+
logger.info({
|
|
45
|
+
evt: 'graph.cache.invalidate.miss',
|
|
46
|
+
module: 'graph:cache',
|
|
47
|
+
reason: 'no-fingerprint',
|
|
48
|
+
});
|
|
49
|
+
return { kind: 'invalid', reason: 'no-fingerprint' };
|
|
50
|
+
}
|
|
51
|
+
const currentFingerprint = computeFilesFingerprint(ctx.currentFiles);
|
|
52
|
+
if (cachedFingerprint === currentFingerprint) {
|
|
53
|
+
return { kind: 'valid' };
|
|
54
|
+
}
|
|
55
|
+
const changedFiles = diffFingerprints(cachedFingerprint, currentFingerprint);
|
|
56
|
+
logger.info({
|
|
57
|
+
evt: 'graph.cache.invalidate.incremental',
|
|
58
|
+
module: 'graph:cache',
|
|
59
|
+
changedFiles: changedFiles.length,
|
|
60
|
+
});
|
|
61
|
+
return { kind: 'incremental', changedFiles };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Compute a fingerprint over the project's source files. Uses mtime
|
|
65
|
+
* (nanosecond resolution) per file plus the file count; cheap to
|
|
66
|
+
* compute and stable for unchanged trees.
|
|
67
|
+
*/
|
|
68
|
+
export function computeFilesFingerprint(files) {
|
|
69
|
+
const parts = [String(files.length)];
|
|
70
|
+
for (const f of files) {
|
|
71
|
+
try {
|
|
72
|
+
const st = statSync(f);
|
|
73
|
+
parts.push(`${f}|${String(st.mtimeMs)}|${String(st.size)}`);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
parts.push(`${f}|missing`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return parts.join('\n');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Diff two fingerprints (computed by `computeFilesFingerprint`) and
|
|
83
|
+
* return the absolute file paths that differ. A file appears in the
|
|
84
|
+
* result if it was added, removed, or had its mtime/size change. The
|
|
85
|
+
* leading file-count line is ignored. Used by the incremental
|
|
86
|
+
* rebuild path.
|
|
87
|
+
*/
|
|
88
|
+
export function diffFingerprints(cachedFingerprint, currentFingerprint) {
|
|
89
|
+
const cachedMap = parseFingerprint(cachedFingerprint);
|
|
90
|
+
const currentMap = parseFingerprint(currentFingerprint);
|
|
91
|
+
const changed = new Set();
|
|
92
|
+
for (const [path, mark] of cachedMap) {
|
|
93
|
+
const cur = currentMap.get(path);
|
|
94
|
+
if (cur === undefined || cur !== mark)
|
|
95
|
+
changed.add(path);
|
|
96
|
+
}
|
|
97
|
+
for (const [path] of currentMap) {
|
|
98
|
+
if (!cachedMap.has(path))
|
|
99
|
+
changed.add(path);
|
|
100
|
+
}
|
|
101
|
+
return [...changed].sort();
|
|
102
|
+
}
|
|
103
|
+
function parseFingerprint(fingerprint) {
|
|
104
|
+
const out = new Map();
|
|
105
|
+
const lines = fingerprint.split('\n');
|
|
106
|
+
// Skip the leading file-count line.
|
|
107
|
+
for (let i = 1; i < lines.length; i++) {
|
|
108
|
+
const line = lines[i];
|
|
109
|
+
if (typeof line !== 'string' || line.length === 0)
|
|
110
|
+
continue;
|
|
111
|
+
const firstPipe = line.indexOf('|');
|
|
112
|
+
if (firstPipe === -1)
|
|
113
|
+
continue;
|
|
114
|
+
const path = line.slice(0, firstPipe);
|
|
115
|
+
const mark = line.slice(firstPipe + 1);
|
|
116
|
+
out.set(path, mark);
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=invalidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidate.js","sourceRoot":"","sources":["../../src/cache/invalidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA0B3C,MAAM,UAAU,eAAe,CAAC,MAAe,EAAE,GAAsB;IACrE,IAAI,MAAM,CAAC,QAAQ,KAAK,GAAG,CAAC,eAAe,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,EAAE,6BAA6B;YAClC,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,kBAAkB;YAC1B,MAAM,EAAE,MAAM,CAAC,QAAQ;YACvB,OAAO,EAAE,GAAG,CAAC,eAAe;SAC7B,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACzD,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,GAAG,CAAC,eAAe,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,EAAE,6BAA6B;YAClC,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,mBAAmB;YAC3B,MAAM,EAAE,MAAM,CAAC,QAAQ;YACvB,OAAO,EAAE,GAAG,CAAC,eAAe;SAC7B,CAAC,CAAC;QACH,OAAO,E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AAC,CAAC,CAAC,CAAC;QACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,KAAK,CAAC,CAAC;YAAE,SAAS;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QACvC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for `buildGraphEnvelope` (ADR-0011 Phase 5) — the graph run's signal
|
|
3
|
+
* envelope assembly. Covers the Option-A rule-ID mapping (engine slug →
|
|
4
|
+
* OpenSIP rule ID on both `ruleId` and `source`), per-rule unit derivation,
|
|
5
|
+
* the verdict counts, and `resolutionMode` passthrough.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=build-envelope.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-envelope.test.d.ts","sourceRoot":"","sources":["../../../src/cli/__tests__/build-envelope.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for `buildGraphEnvelope` (ADR-0011 Phase 5) — the graph run's signal
|
|
3
|
+
* envelope assembly. Covers the Option-A rule-ID mapping (engine slug →
|
|
4
|
+
* OpenSIP rule ID on both `ruleId` and `source`), per-rule unit derivation,
|
|
5
|
+
* the verdict counts, and `resolutionMode` passthrough.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from 'vitest';
|
|
8
|
+
import { buildGraphEnvelope } from '../build-envelope.js';
|
|
9
|
+
function signal(over = {}) {
|
|
10
|
+
return {
|
|
11
|
+
id: 'sig_1',
|
|
12
|
+
source: 'graph',
|
|
13
|
+
provider: 'opensip-cli',
|
|
14
|
+
severity: 'medium',
|
|
15
|
+
category: 'quality',
|
|
16
|
+
ruleId: 'graph:orphan-subtree',
|
|
17
|
+
message: 'msg',
|
|
18
|
+
filePath: 'src/a.ts',
|
|
19
|
+
line: 1,
|
|
20
|
+
metadata: {},
|
|
21
|
+
createdAt: '2026-06-04T00:00:00.000Z',
|
|
22
|
+
...over,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const BASE = { runId: 'run-1', createdAt: '2026-06-04T00:00:00.000Z' };
|
|
26
|
+
describe('buildGraphEnvelope', () => {
|
|
27
|
+
it('maps engine slug → OpenSIP rule ID on both ruleId and source', () => {
|
|
28
|
+
const env = buildGraphEnvelope({ ...BASE, signals: [signal()] });
|
|
29
|
+
expect(env.signals[0]?.ruleId).toBe('graph.dead-code.orphan-subtree');
|
|
30
|
+
expect(env.signals[0]?.source).toBe('graph.dead-code.orphan-subtree');
|
|
31
|
+
});
|
|
32
|
+
it('derives one unit per rule that fired, keyed on the mapped slug', () => {
|
|
33
|
+
const env = buildGraphEnvelope({
|
|
34
|
+
...BASE,
|
|
35
|
+
signals: [
|
|
36
|
+
signal({ ruleId: 'graph:orphan-subtree' }),
|
|
37
|
+
signal({ ruleId: 'graph:orphan-subtree' }),
|
|
38
|
+
signal({ ruleId: 'graph:cycle', severity: 'high' }),
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
const slugs = env.units.map((u) => u.slug).sort();
|
|
42
|
+
expect(slugs).toEqual(['graph.architecture.cycle', 'graph.dead-code.orphan-subtree']);
|
|
43
|
+
const orphan = env.units.find((u) => u.slug === 'graph.dead-code.orphan-subtree');
|
|
44
|
+
expect(orphan?.violationCount).toBe(2);
|
|
45
|
+
expect(orphan?.passed).toBe(true); // medium severity ⇒ no error
|
|
46
|
+
const cycle = env.units.find((u) => u.slug === 'graph.architecture.cycle');
|
|
47
|
+
expect(cycle?.passed).toBe(false); // high severity ⇒ error ⇒ fail
|
|
48
|
+
});
|
|
49
|
+
it('computes the verdict (errors = critical|high; passed ⇔ errors === 0)', () => {
|
|
50
|
+
const clean = buildGraphEnvelope({ ...BASE, signals: [signal({ severity: 'low' })] });
|
|
51
|
+
expect(clean.verdict.passed).toBe(true);
|
|
52
|
+
expect(clean.verdict.summary.errors).toBe(0);
|
|
53
|
+
expect(clean.verdict.summary.warnings).toBe(1);
|
|
54
|
+
const failing = buildGraphEnvelope({ ...BASE, signals: [signal({ severity: 'critical' })] });
|
|
55
|
+
expect(failing.verdict.passed).toBe(false);
|
|
56
|
+
expect(failing.verdict.summary.errors).toBe(1);
|
|
57
|
+
});
|
|
58
|
+
it('is schemaVersion 2 and tool graph, with an empty units list for no signals', () => {
|
|
59
|
+
const env = buildGraphEnvelope({ ...BASE, signals: [] });
|
|
60
|
+
expect(env.schemaVersion).toBe(2);
|
|
61
|
+
expect(env.tool).toBe('graph');
|
|
62
|
+
expect(env.units).toEqual([]);
|
|
63
|
+
expect(env.verdict.passed).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
it('passes resolutionMode through only when set', () => {
|
|
66
|
+
expect(buildGraphEnvelope({ ...BASE, signals: [] }).resolutionMode).toBeUndefined();
|
|
67
|
+
expect(buildGraphEnvelope({ ...BASE, signals: [], resolutionMode: 'fast' }).resolutionMode).toBe('fast');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=build-envelope.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-envelope.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/build-envelope.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAA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,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC,cAAc,CACpF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-0011 Phase 5 (supersedes the audit-P1-2 `graph-signal-emit` test):
|
|
3
|
+
* `dispatchGraphResult` no longer emits cloud signals itself — the root owns
|
|
4
|
+
* egress (`cli.deliverSignals`). Instead it RETURNS the run's
|
|
5
|
+
* {@link GraphRunOutcome} (envelope + optional session) for every mode that
|
|
6
|
+
* should deliver (gate / catalog / default render) and `undefined` for plain
|
|
7
|
+
* `--json` (the `--workspace` child carrier, which must not trigger per-child
|
|
8
|
+
* cloud emits). These tests pin that return contract.
|
|
9
|
+
*
|
|
10
|
+
* host-owned-run-timing Phase 3: the human-render path's outcome also carries a
|
|
11
|
+
* `session` contribution (the host persists it); the export modes (gate /
|
|
12
|
+
* catalog / `--json` / `--report-to`) carry no `session`.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=dispatch-envelope.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-envelope.test.d.ts","sourceRoot":"","sources":["../../../src/cli/__tests__/dispatch-envelope.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-0011 Phase 5 (supersedes the audit-P1-2 `graph-signal-emit` test):
|
|
3
|
+
* `dispatchGraphResult` no longer emits cloud signals itself — the root owns
|
|
4
|
+
* egress (`cli.deliverSignals`). Instead it RETURNS the run's
|
|
5
|
+
* {@link GraphRunOutcome} (envelope + optional session) for every mode that
|
|
6
|
+
* should deliver (gate / catalog / default render) and `undefined` for plain
|
|
7
|
+
* `--json` (the `--workspace` child carrier, which must not trigger per-child
|
|
8
|
+
* cloud emits). These tests pin that return contract.
|
|
9
|
+
*
|
|
10
|
+
* host-owned-run-timing Phase 3: the human-render path's outcome also carries a
|
|
11
|
+
* `session` contribution (the host persists it); the export modes (gate /
|
|
12
|
+
* catalog / `--json` / `--report-to`) carry no `session`.
|
|
13
|
+
*/
|
|
14
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
15
|
+
import { dispatchGraphResult } from '../graph.js';
|
|
16
|
+
vi.mock('../graph-modes.js', () => ({
|
|
17
|
+
runGateMode: vi.fn().mockResolvedValue(undefined),
|
|
18
|
+
runCatalogJsonMode: vi.fn(),
|
|
19
|
+
}));
|
|
20
|
+
const result = { signals: [], catalog: undefined };
|
|
21
|
+
function mockCli() {
|
|
22
|
+
return {
|
|
23
|
+
setExitCode: vi.fn(),
|
|
24
|
+
emitRaw: vi.fn(),
|
|
25
|
+
emitEnvelope: vi.fn(),
|
|
26
|
+
emitError: vi.fn(),
|
|
27
|
+
render: vi.fn(() => Promise.resolve()),
|
|
28
|
+
logger: console,
|
|
29
|
+
scope: { signalSink: { emit: vi.fn() }, datastore: () => undefined },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const STARTED = '2026-06-03T00:00:00.000Z';
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
vi.clearAllMocks();
|
|
35
|
+
});
|
|
36
|
+
afterEach(() => vi.restoreAllMocks());
|
|
37
|
+
describe('dispatchGraphResult — outcome return contract (ADR-0011)', () => {
|
|
38
|
+
it('returns the envelope (no session) in --gate-save mode (root delivers it)', async () => {
|
|
39
|
+
const opts = { gateSave: true, cwd: '/x' };
|
|
40
|
+
const outcome = await dispatchGraphResult(opts, result, mockCli(), STARTED, '/x');
|
|
41
|
+
expect(outcome?.envelope?.tool).toBe('graph');
|
|
42
|
+
expect(outcome?.envelope?.schemaVersion).toBe(2);
|
|
43
|
+
// Export mode: the host must NOT persist a session for the gate path.
|
|
44
|
+
expect(outcome?.session).toBeUndefined();
|
|
45
|
+
});
|
|
46
|
+
it('returns the envelope (no session) in --catalog-output mode', async () => {
|
|
47
|
+
// runCatalogJsonMode is mocked, so the path is never written — any
|
|
48
|
+
// non-empty string exercises the branch.
|
|
49
|
+
const opts = { catalogOutput: 'out/c.json', cwd: '/x' };
|
|
50
|
+
const outcome = await dispatchGraphResult(opts, result, mockCli(), STARTED, '/x');
|
|
51
|
+
expect(outcome?.envelope?.tool).toBe('graph');
|
|
52
|
+
expect(outcome?.session).toBeUndefined();
|
|
53
|
+
});
|
|
54
|
+
it('returns the envelope AND a session in the default render mode', async () => {
|
|
55
|
+
const opts = { cwd: '/x' };
|
|
56
|
+
const outcome = await dispatchGraphResult(opts, result, mockCli(), STARTED, '/x');
|
|
57
|
+
expect(outcome?.envelope?.tool).toBe('graph');
|
|
58
|
+
// host-owned-run-timing Phase 3: the human-render path contributes the
|
|
59
|
+
// session the host persists; timing/id are host-stamped (absent here).
|
|
60
|
+
expect(outcome?.session?.tool).toBe('graph');
|
|
61
|
+
expect(outcome?.session?.cwd).toBe('/x');
|
|
62
|
+
expect(outcome?.session?.payload).toBeDefined();
|
|
63
|
+
});
|
|
64
|
+
it('returns undefined under plain --json (the --workspace child carrier)', async () => {
|
|
65
|
+
const opts = { json: true, cwd: '/x' };
|
|
66
|
+
const cli = mockCli();
|
|
67
|
+
const outcome = await dispatchGraphResult(opts, result, cli, STARTED, '/x');
|
|
68
|
+
expect(outcome).toBeUndefined();
|
|
69
|
+
// --json still emits the envelope to stdout via the seam.
|
|
70
|
+
expect(cli.emitEnvelope).toHaveBeenCalledTimes(1);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=dispatch-envelope.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-envelope.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/dispatch-envelope.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,S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AC,OAAO,CAAC,CAAC;QAC9C,uEAAuE;QACvE,uEAAuE;QACvE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACpF,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAA0D,CAAC;QAC/F,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5E,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;QAChC,0DAA0D;QAC1D,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression: `dispatchGraphResult` must waive `@graph-ignore` directives
|
|
3
|
+
* against the BUILD ROOT the signals are relative to (`suppressionRoot`), NOT
|
|
4
|
+
* `opts.cwd`.
|
|
5
|
+
*
|
|
6
|
+
* The two coincide for a bare `graph` run, but diverge for `graph <subdir>` and
|
|
7
|
+
* for every `--workspace` child (which runs `graph <unitRoot> --json` with cwd
|
|
8
|
+
* inherited from the parent = repo root). The old code resolved directive files
|
|
9
|
+
* against `opts.cwd`, so a child's package-relative `code.file` never found its
|
|
10
|
+
* directive on disk (ENOENT) and the waiver silently leaked — reproducing the
|
|
11
|
+
* cycle/large-function warnings that the single-program run correctly suppresses.
|
|
12
|
+
*
|
|
13
|
+
* These tests drive the public `dispatchGraphResult` seam with `opts.cwd` set to
|
|
14
|
+
* a directory that does NOT contain the directive, and `suppressionRoot` set to
|
|
15
|
+
* the temp dir that does. The signal must be suppressed via `suppressionRoot`.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=dispatch-suppression-root.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-suppression-root.test.d.ts","sourceRoot":"","sources":["../../../src/cli/__tests__/dispatch-suppression-root.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression: `dispatchGraphResult` must waive `@graph-ignore` directives
|
|
3
|
+
* against the BUILD ROOT the signals are relative to (`suppressionRoot`), NOT
|
|
4
|
+
* `opts.cwd`.
|
|
5
|
+
*
|
|
6
|
+
* The two coincide for a bare `graph` run, but diverge for `graph <subdir>` and
|
|
7
|
+
* for every `--workspace` child (which runs `graph <unitRoot> --json` with cwd
|
|
8
|
+
* inherited from the parent = repo root). The old code resolved directive files
|
|
9
|
+
* against `opts.cwd`, so a child's package-relative `code.file` never found its
|
|
10
|
+
* directive on disk (ENOENT) and the waiver silently leaked — reproducing the
|
|
11
|
+
* cycle/large-function warnings that the single-program run correctly suppresses.
|
|
12
|
+
*
|
|
13
|
+
* These tests drive the public `dispatchGraphResult` seam with `opts.cwd` set to
|
|
14
|
+
* a directory that does NOT contain the directive, and `suppressionRoot` set to
|
|
15
|
+
* the temp dir that does. The signal must be suppressed via `suppressionRoot`.
|
|
16
|
+
*/
|
|
17
|
+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
18
|
+
import { tmpdir } from 'node:os';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { createSignal } from '@opensip-cli/core';
|
|
21
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
22
|
+
import { dispatchGraphResult } from '../graph.js';
|
|
23
|
+
// Capture the signals each output mode receives. runGateMode is the simplest
|
|
24
|
+
// sink to assert against (it takes the post-waiver signals as arg[1]).
|
|
25
|
+
const runGateMode = vi.fn().mockResolvedValue(undefined);
|
|
26
|
+
vi.mock('../graph-modes.js', () => ({
|
|
27
|
+
runGateMode: (...args) => runGateMode(...args),
|
|
28
|
+
runCatalogJsonMode: vi.fn(),
|
|
29
|
+
}));
|
|
30
|
+
let buildRoot;
|
|
31
|
+
let otherCwd;
|
|
32
|
+
beforeEach(async () => {
|
|
33
|
+
vi.clearAllMocks();
|
|
34
|
+
buildRoot = await mkdtemp(join(tmpdir(), 'graph-disp-root-'));
|
|
35
|
+
otherCwd = await mkdtemp(join(tmpdir(), 'graph-disp-cwd-'));
|
|
36
|
+
});
|
|
37
|
+
afterEach(async () => {
|
|
38
|
+
await rm(buildRoot, { recursive: true, force: true });
|
|
39
|
+
await rm(otherCwd, { recursive: true, force: true });
|
|
40
|
+
vi.restoreAllMocks();
|
|
41
|
+
});
|
|
42
|
+
function mockCli() {
|
|
43
|
+
return {
|
|
44
|
+
setExitCode: vi.fn(),
|
|
45
|
+
emitRaw: vi.fn(),
|
|
46
|
+
emitEnvelope: vi.fn(),
|
|
47
|
+
emitError: vi.fn(),
|
|
48
|
+
render: vi.fn(() => Promise.resolve()),
|
|
49
|
+
logger: console,
|
|
50
|
+
scope: { signalSink: { emit: vi.fn() }, datastore: () => undefined },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** A graph:large-function signal anchored at `file:line` (project-relative). */
|
|
54
|
+
function sig(file, line) {
|
|
55
|
+
return createSignal({
|
|
56
|
+
source: 'graph',
|
|
57
|
+
severity: 'medium',
|
|
58
|
+
category: 'quality',
|
|
59
|
+
ruleId: 'graph:large-function',
|
|
60
|
+
message: `big at ${file}:${String(line)}`,
|
|
61
|
+
code: { file, line },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function gateOpts(cwd) {
|
|
65
|
+
return { gateSave: true, cwd };
|
|
66
|
+
}
|
|
67
|
+
const result = (signals) => ({ signals, catalog: undefined });
|
|
68
|
+
const STARTED = '2026-06-07T00:00:00.000Z';
|
|
69
|
+
describe('dispatchGraphResult — waives against suppressionRoot, not opts.cwd', () => {
|
|
70
|
+
it('suppresses a signal whose directive lives under suppressionRoot (≠ opts.cwd)', async () => {
|
|
71
|
+
// The directive file exists ONLY under buildRoot. opts.cwd points elsewhere
|
|
72
|
+
// (the repo-root stand-in a --workspace child inherits). The waiver must
|
|
73
|
+
// still apply — it is resolved against suppressionRoot.
|
|
74
|
+
await writeFile(join(buildRoot, 'walk.ts'), ['// @graph-ignore-next-line graph:large-function -- intentional', 'function big() {}'].join('\n'), 'utf8');
|
|
75
|
+
await dispatchGraphResult(gateOpts(otherCwd), result([sig('walk.ts', 2)]), mockCli(), STARTED, buildRoot);
|
|
76
|
+
expect(runGateMode).toHaveBeenCalledTimes(1);
|
|
77
|
+
// arg[1] is the post-waiver envelope runGateMode receives (ADR-0036).
|
|
78
|
+
expect(runGateMode.mock.calls[0]?.[1]?.signals).toHaveLength(0);
|
|
79
|
+
});
|
|
80
|
+
it('does NOT suppress when only opts.cwd (the wrong base) holds the directive', async () => {
|
|
81
|
+
// The directive sits under opts.cwd, NOT the build root. Resolving against
|
|
82
|
+
// opts.cwd (the old behavior) would suppress; resolving against
|
|
83
|
+
// suppressionRoot (correct) must KEEP the signal — pinning the base used.
|
|
84
|
+
await writeFile(join(otherCwd, 'walk.ts'), ['// @graph-ignore-next-line graph:large-function -- wrong base', 'function big() {}'].join('\n'), 'utf8');
|
|
85
|
+
await dispatchGraphResult(gateOpts(otherCwd), result([sig('walk.ts', 2)]), mockCli(), STARTED, buildRoot);
|
|
86
|
+
expect(runGateMode).toHaveBeenCalledTimes(1);
|
|
87
|
+
// The waiver under opts.cwd must NOT apply — the signal survives.
|
|
88
|
+
expect(runGateMode.mock.calls[0]?.[1]?.signals).toHaveLength(1);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=dispatch-suppression-root.test.js.map
|