@intentius/chant 0.124.13 → 0.124.15
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/bin/chant +11 -0
- package/dist/agents/checks.js +326 -0
- package/dist/agents/discover.js +885 -0
- package/dist/agents/importer.js +17 -0
- package/dist/agents/index.js +12 -0
- package/dist/agents/types.js +19 -0
- package/dist/apply.js +151 -0
- package/dist/attrref.js +70 -0
- package/dist/audit/catalog.js +350 -0
- package/dist/audit/core.js +252 -0
- package/dist/audit/discover.js +633 -0
- package/dist/audit/fetch.js +666 -0
- package/dist/audit/lineage.js +91 -0
- package/dist/audit/nginx.js +366 -0
- package/dist/audit/prior-art.js +132 -0
- package/dist/audit/proof.js +321 -0
- package/dist/audit/report-html.js +194 -0
- package/dist/audit/report-model.js +198 -0
- package/dist/audit/report.js +102 -0
- package/dist/audit/rules-doc.js +144 -0
- package/dist/audit/secrets.js +405 -0
- package/dist/audit/terraform-state.js +140 -0
- package/dist/audit/wrangler.js +262 -0
- package/dist/behaviour-delta.js +401 -0
- package/dist/behaviour-engine.js +357 -0
- package/dist/behaviour-graph.js +83 -0
- package/dist/behaviour-http.js +188 -0
- package/dist/behaviour-kinds.js +172 -0
- package/dist/behaviour-overlay.js +50 -0
- package/dist/behaviour-predict.js +188 -0
- package/dist/behaviour-request.js +194 -0
- package/dist/behaviour.js +1325 -0
- package/dist/build-params.js +108 -0
- package/dist/build.d.ts +6 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +669 -0
- package/dist/builder.js +44 -0
- package/dist/cdk/advise.js +30 -0
- package/dist/cdk/assembly.js +122 -0
- package/dist/cdk/graph.js +444 -0
- package/dist/cdk/tier-map.js +64 -0
- package/dist/cdk/types.js +24 -0
- package/dist/change-set.d.ts +24 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +361 -0
- package/dist/child-project.js +21 -0
- package/dist/ci-jobs.d.ts +227 -0
- package/dist/ci-jobs.d.ts.map +1 -0
- package/dist/ci-jobs.js +448 -0
- package/dist/claimed-fields.js +135 -0
- package/dist/cli/build-options.js +70 -0
- package/dist/cli/build-params-cli.js +139 -0
- package/dist/cli/command-group.js +123 -0
- package/dist/cli/commands/audit-agents.js +326 -0
- package/dist/cli/commands/audit.js +571 -0
- package/dist/cli/commands/build.js +920 -0
- package/dist/cli/commands/carve-apply.js +153 -0
- package/dist/cli/commands/carve-bridge.js +201 -0
- package/dist/cli/commands/carve-emit.js +332 -0
- package/dist/cli/commands/carve-status.js +119 -0
- package/dist/cli/commands/carve.js +204 -0
- package/dist/cli/commands/check-lexicon-docs.js +79 -0
- package/dist/cli/commands/check-lexicon-examples.js +177 -0
- package/dist/cli/commands/check-lexicon-intrinsics.js +291 -0
- package/dist/cli/commands/check-lexicon-mcp.js +82 -0
- package/dist/cli/commands/check-lexicon-plugin.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-plugin.js +104 -0
- package/dist/cli/commands/check-lexicon.js +766 -0
- package/dist/cli/commands/describe.js +85 -0
- package/dist/cli/commands/diff.js +175 -0
- package/dist/cli/commands/doctor.js +350 -0
- package/dist/cli/commands/import-agents.js +155 -0
- package/dist/cli/commands/import.js +670 -0
- package/dist/cli/commands/init-lexicon/templates/codegen.js +194 -0
- package/dist/cli/commands/init-lexicon/templates/docs.js +100 -0
- package/dist/cli/commands/init-lexicon/templates/examples.js +29 -0
- package/dist/cli/commands/init-lexicon/templates/lint.js +34 -0
- package/dist/cli/commands/init-lexicon/templates/lsp.js +37 -0
- package/dist/cli/commands/init-lexicon/templates/plugin.js +108 -0
- package/dist/cli/commands/init-lexicon/templates/project.js +240 -0
- package/dist/cli/commands/init-lexicon/templates/spec.js +56 -0
- package/dist/cli/commands/init-lexicon/templates/tests.js +66 -0
- package/dist/cli/commands/init-lexicon.js +172 -0
- package/dist/cli/commands/init.js +381 -0
- package/dist/cli/commands/lexicon-rolling-upgrade.js +145 -0
- package/dist/cli/commands/lexicon-surface-diff.js +145 -0
- package/dist/cli/commands/licenses.js +125 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +948 -0
- package/dist/cli/commands/list.js +63 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +423 -0
- package/dist/cli/commands/onboard.js +403 -0
- package/dist/cli/commands/pinned-upgrade.js +191 -0
- package/dist/cli/commands/update.js +194 -0
- package/dist/cli/commands/vendor.js +217 -0
- package/dist/cli/conflict-check.js +104 -0
- package/dist/cli/debug.js +8 -0
- package/dist/cli/format.js +104 -0
- package/dist/cli/handlers/build.js +267 -0
- package/dist/cli/handlers/carve-apply.js +30 -0
- package/dist/cli/handlers/carve-bridge.js +28 -0
- package/dist/cli/handlers/carve-emit.js +50 -0
- package/dist/cli/handlers/carve-status.js +26 -0
- package/dist/cli/handlers/carve.js +40 -0
- package/dist/cli/handlers/change-set.js +46 -0
- package/dist/cli/handlers/components.js +730 -0
- package/dist/cli/handlers/dev.js +113 -0
- package/dist/cli/handlers/emulator.js +233 -0
- package/dist/cli/handlers/explain.js +54 -0
- package/dist/cli/handlers/fan-out.js +422 -0
- package/dist/cli/handlers/gate-resume.js +275 -0
- package/dist/cli/handlers/generate.js +84 -0
- package/dist/cli/handlers/graph.js +969 -0
- package/dist/cli/handlers/init.js +102 -0
- package/dist/cli/handlers/lifecycle.js +1727 -0
- package/dist/cli/handlers/lint.js +62 -0
- package/dist/cli/handlers/migrate.js +48 -0
- package/dist/cli/handlers/misc.js +391 -0
- package/dist/cli/handlers/operator.js +1162 -0
- package/dist/cli/handlers/override-approve.js +102 -0
- package/dist/cli/handlers/pr.js +503 -0
- package/dist/cli/handlers/promote.js +342 -0
- package/dist/cli/handlers/run-generate.js +206 -0
- package/dist/cli/handlers/run-wave.js +66 -0
- package/dist/cli/handlers/run.js +1191 -0
- package/dist/cli/handlers/scenario.js +325 -0
- package/dist/cli/handlers/search.js +924 -0
- package/dist/cli/handlers/serve.js +32 -0
- package/dist/cli/handlers/vendor.js +154 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/is-entry-point.js +23 -0
- package/dist/cli/lsp/capabilities.js +28 -0
- package/dist/cli/lsp/diagnostics.js +34 -0
- package/dist/cli/lsp/server.js +329 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +2540 -0
- package/dist/cli/mcp/lifecycle-tools.js +80 -0
- package/dist/cli/mcp/op-tools.js +306 -0
- package/dist/cli/mcp/resource-handlers.js +258 -0
- package/dist/cli/mcp/resources/context.js +85 -0
- package/dist/cli/mcp/server.js +353 -0
- package/dist/cli/mcp/tools/build.js +111 -0
- package/dist/cli/mcp/tools/composites.js +95 -0
- package/dist/cli/mcp/tools/explain.js +166 -0
- package/dist/cli/mcp/tools/import.js +49 -0
- package/dist/cli/mcp/tools/lint.js +41 -0
- package/dist/cli/mcp/tools/scaffold.js +111 -0
- package/dist/cli/mcp/tools/search.js +112 -0
- package/dist/cli/mcp/types.js +1 -0
- package/dist/cli/mcp/workspace-plugins.js +91 -0
- package/dist/cli/mcp/workspace-tools.d.ts +1 -1
- package/dist/cli/mcp/workspace-tools.js +564 -0
- package/dist/cli/mcp-config.js +70 -0
- package/dist/cli/plugins.js +313 -0
- package/dist/cli/registry.js +23 -0
- package/dist/cli/reporters/stylish.js +329 -0
- package/dist/cli/version.js +15 -0
- package/dist/cli/watch.js +79 -0
- package/dist/codegen/bound-property-types.js +82 -0
- package/dist/codegen/coverage.js +119 -0
- package/dist/codegen/docs-file-markers.js +60 -0
- package/dist/codegen/docs-pages.js +115 -0
- package/dist/codegen/docs-rule-scanning.js +164 -0
- package/dist/codegen/docs-rules.js +76 -0
- package/dist/codegen/docs-sections.js +117 -0
- package/dist/codegen/docs-sidebar.js +65 -0
- package/dist/codegen/docs-types.js +4 -0
- package/dist/codegen/docs.js +356 -0
- package/dist/codegen/fetch.js +340 -0
- package/dist/codegen/generate-post-synth-barrel.js +63 -0
- package/dist/codegen/generate-registry.js +71 -0
- package/dist/codegen/generate-runtime-index.js +56 -0
- package/dist/codegen/generate-typescript.js +119 -0
- package/dist/codegen/generate.js +115 -0
- package/dist/codegen/json-patch.js +141 -0
- package/dist/codegen/json-schema-to-ts.js +344 -0
- package/dist/codegen/json-schema.js +246 -0
- package/dist/codegen/lexicon-regen.js +412 -0
- package/dist/codegen/naming.js +217 -0
- package/dist/codegen/okf-lexicon.js +245 -0
- package/dist/codegen/package.js +150 -0
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
- package/dist/codegen/pinned-upgrade.js +494 -0
- package/dist/codegen/registry.js +60 -0
- package/dist/codegen/rehype-base-url.mjs +68 -0
- package/dist/codegen/rolling-upgrade.js +217 -0
- package/dist/codegen/surface-snapshot.js +537 -0
- package/dist/codegen/testdata/postgres-tags.json +242 -0
- package/dist/codegen/topo-sort.js +36 -0
- package/dist/codegen/typecheck.js +115 -0
- package/dist/codegen/validate.js +200 -0
- package/dist/codegen/version-bump.js +35 -0
- package/dist/components/auto-release.js +143 -0
- package/dist/components/builders.js +47 -0
- package/dist/components/capability-plugin-loader.js +175 -0
- package/dist/components/capability-plugin-schema.js +46 -0
- package/dist/components/capability-plugin.js +99 -0
- package/dist/components/capability.js +60 -0
- package/dist/components/changed-files.js +72 -0
- package/dist/components/cli-support.js +427 -0
- package/dist/components/component.js +120 -0
- package/dist/components/component.schema.json +271 -0
- package/dist/components/config-defaults.js +130 -0
- package/dist/components/deploy-units.js +60 -0
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/discover.js +189 -0
- package/dist/components/driver-output.js +86 -0
- package/dist/components/driver.js +728 -0
- package/dist/components/fan-out-output.js +165 -0
- package/dist/components/fan-out-record.js +94 -0
- package/dist/components/fan-out-run.js +373 -0
- package/dist/components/fan-out-support.js +60 -0
- package/dist/components/fan-out.js +273 -0
- package/dist/components/gate-plan.js +41 -0
- package/dist/components/gated-wave-pipeline.js +46 -0
- package/dist/components/index.js +24 -0
- package/dist/components/layers.js +28 -0
- package/dist/components/manifest-persistence.js +108 -0
- package/dist/components/pilots/alb-ecs.pilot.js +59 -0
- package/dist/components/pilots/dynamodb.pilot.js +51 -0
- package/dist/components/pilots/jar-emr.pilot.js +65 -0
- package/dist/components/pilots/lambda.pilot.js +52 -0
- package/dist/components/pilots/neo4j-fanout.pilot.js +68 -0
- package/dist/components/pilots/project.js +12 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +135 -0
- package/dist/components/pr-run.js +363 -0
- package/dist/components/presets/ecs-fargate.js +72 -0
- package/dist/components/presets/index.js +28 -0
- package/dist/components/presets/lambda.js +34 -0
- package/dist/components/presets/single-host-compose.js +41 -0
- package/dist/components/promote.js +549 -0
- package/dist/components/registry.js +34 -0
- package/dist/components/run-progress.js +33 -0
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/driver.js +93 -0
- package/dist/components/sandbox/run.js +115 -0
- package/dist/components/starter-plugin.js +104 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.js +68 -0
- package/dist/components/verbs/__tests__/mock-process-runner.js +45 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.js +56 -0
- package/dist/components/verbs/bom-writer.js +287 -0
- package/dist/components/verbs/build-archive.js +188 -0
- package/dist/components/verbs/build.js +142 -0
- package/dist/components/verbs/cloud-executor.js +110 -0
- package/dist/components/verbs/component-bom.js +125 -0
- package/dist/components/verbs/ensure-secret.js +50 -0
- package/dist/components/verbs/index.js +61 -0
- package/dist/components/verbs/license-policy.js +75 -0
- package/dist/components/verbs/lockfile-sbom-generator.js +191 -0
- package/dist/components/verbs/process-runner.js +78 -0
- package/dist/components/verbs/r2-sync.js +93 -0
- package/dist/components/verbs/reproducibility.js +62 -0
- package/dist/components/verbs/run-agent.js +577 -0
- package/dist/components/verbs/sbom-generator.js +119 -0
- package/dist/components/verbs/sbom.js +97 -0
- package/dist/components/verbs/shell.js +32 -0
- package/dist/components/verbs/sign.js +221 -0
- package/dist/components/verbs/stub.js +28 -0
- package/dist/components/verbs/tool-sbom-generator.js +154 -0
- package/dist/components/verbs/verify.js +112 -0
- package/dist/components/verbs/vex.js +131 -0
- package/dist/components/verbs/vuln-gate.js +152 -0
- package/dist/components/verbs/vuln-scan.js +288 -0
- package/dist/components/verbs/wait-verify.js +106 -0
- package/dist/components/verbs/wrangler.js +179 -0
- package/dist/components/wave-plan.js +102 -0
- package/dist/composite.d.ts +10 -2
- package/dist/composite.d.ts.map +1 -1
- package/dist/composite.js +313 -0
- package/dist/config-import.d.ts.map +1 -1
- package/dist/config-import.js +22 -0
- package/dist/config-sandbox.js +122 -0
- package/dist/config-static.js +206 -0
- package/dist/config.js +605 -0
- package/dist/content-digest.js +23 -0
- package/dist/declarable.js +114 -0
- package/dist/deep-observation.js +437 -0
- package/dist/detectLexicon.js +54 -0
- package/dist/discovery/cache.js +70 -0
- package/dist/discovery/collect.d.ts +2 -1
- package/dist/discovery/collect.d.ts.map +1 -1
- package/dist/discovery/collect.js +223 -0
- package/dist/discovery/cycles.js +95 -0
- package/dist/discovery/entity-wire-codec.js +391 -0
- package/dist/discovery/entity-wire.js +42 -0
- package/dist/discovery/files.js +121 -0
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +4073 -0
- package/dist/discovery/fold-rank.js +292 -0
- package/dist/discovery/graph.js +115 -0
- package/dist/discovery/host-composite.d.ts +35 -0
- package/dist/discovery/host-composite.d.ts.map +1 -0
- package/dist/discovery/host-composite.js +93 -0
- package/dist/discovery/import.d.ts.map +1 -1
- package/dist/discovery/import.js +65 -0
- package/dist/discovery/index.d.ts +9 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +333 -0
- package/dist/discovery/param-deps.js +487 -0
- package/dist/discovery/resolve.js +39 -0
- package/dist/discovery/sandbox/bundle.js +214 -0
- package/dist/discovery/sandbox/child-errors.js +26 -0
- package/dist/discovery/sandbox/config-run.js +100 -0
- package/dist/discovery/sandbox/config-wire.js +183 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.js +333 -0
- package/dist/discovery/sandbox/fork.js +229 -0
- package/dist/discovery/sandbox/policy-run.js +142 -0
- package/dist/discovery/sandbox/policy-wire.js +152 -0
- package/dist/discovery/sandbox/run.js +77 -0
- package/dist/discovery/specifier-resolve.js +320 -0
- package/dist/discovery/walk.js +284 -0
- package/dist/effect-receipt.js +340 -0
- package/dist/env.js +55 -0
- package/dist/errors.js +62 -0
- package/dist/fold/fold.js +1434 -0
- package/dist/fold/foldable-helpers.js +229 -0
- package/dist/fold/subset.js +696 -0
- package/dist/fold-provenance.js +414 -0
- package/dist/gate-decision.d.ts +20 -9
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +313 -0
- package/dist/gate-resume-run.js +154 -0
- package/dist/gated-waves.js +165 -0
- package/dist/governance.js +43 -0
- package/dist/graph-declared.js +45 -0
- package/dist/graph-detail.js +207 -0
- package/dist/graph-dot.js +54 -0
- package/dist/graph-effective.js +107 -0
- package/dist/graph-ir.js +623 -0
- package/dist/graph-layout.js +184 -0
- package/dist/graph-lens.js +105 -0
- package/dist/graph-mermaid.js +83 -0
- package/dist/graph-ops.js +39 -0
- package/dist/graph-refs.js +156 -0
- package/dist/held-elsewhere.js +87 -0
- package/dist/identity.js +251 -0
- package/dist/import/base-parser.js +34 -0
- package/dist/import/embedded.js +255 -0
- package/dist/import/generator.js +1 -0
- package/dist/import/ir-utils.js +85 -0
- package/dist/import/parser-options.js +45 -0
- package/dist/import/parser.js +1 -0
- package/dist/index.js +118 -0
- package/dist/intrinsic-interpolation.js +73 -0
- package/dist/intrinsic.js +31 -0
- package/dist/join-key.js +35 -0
- package/dist/kubectl-context.js +150 -0
- package/dist/lexicon-config.js +58 -0
- package/dist/lexicon-integrity.js +47 -0
- package/dist/lexicon-manifest.js +70 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +241 -0
- package/dist/lexicon-output.js +218 -0
- package/dist/lexicon-plugin-helpers.js +104 -0
- package/dist/lexicon-schema.js +136 -0
- package/dist/lexicon.js +130 -0
- package/dist/lifecycle/affected.js +224 -0
- package/dist/lifecycle/assert-live.js +110 -0
- package/dist/lifecycle/build-ledger-store.js +160 -0
- package/dist/lifecycle/build-ledger.js +155 -0
- package/dist/lifecycle/change-set.js +356 -0
- package/dist/lifecycle/converge-ledger.js +161 -0
- package/dist/lifecycle/deep-diff.js +233 -0
- package/dist/lifecycle/deep-observe.js +147 -0
- package/dist/lifecycle/digest.js +143 -0
- package/dist/lifecycle/disruption.js +135 -0
- package/dist/lifecycle/gate-applied.js +113 -0
- package/dist/lifecycle/gate-audit.d.ts +69 -2
- package/dist/lifecycle/gate-audit.d.ts.map +1 -1
- package/dist/lifecycle/gate-audit.js +415 -0
- package/dist/lifecycle/gate-ledger-select.js +89 -0
- package/dist/lifecycle/gate-ledger.d.ts +24 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +201 -0
- package/dist/lifecycle/gate-origin.js +117 -0
- package/dist/lifecycle/gate-pending.js +58 -0
- package/dist/lifecycle/git.js +1182 -0
- package/dist/lifecycle/identity.js +58 -0
- package/dist/lifecycle/index.js +26 -0
- package/dist/lifecycle/lease.js +283 -0
- package/dist/lifecycle/ledger-port.js +1 -0
- package/dist/lifecycle/legacy-digest.js +91 -0
- package/dist/lifecycle/live-diff.js +274 -0
- package/dist/lifecycle/local-note.js +15 -0
- package/dist/lifecycle/member-ledger.js +122 -0
- package/dist/lifecycle/observation-baseline.js +155 -0
- package/dist/lifecycle/observe.js +375 -0
- package/dist/lifecycle/oras-referrer-lookup.js +82 -0
- package/dist/lifecycle/override-ledger.js +54 -0
- package/dist/lifecycle/plan-digest.js +110 -0
- package/dist/lifecycle/plan-ledger.js +129 -0
- package/dist/lifecycle/receipt-plan.js +192 -0
- package/dist/lifecycle/release-ledger.js +155 -0
- package/dist/lifecycle/release-read.js +64 -0
- package/dist/lifecycle/replay.js +193 -0
- package/dist/lifecycle/rollback.js +102 -0
- package/dist/lifecycle/run-ledger.js +183 -0
- package/dist/lifecycle/scenario-eval.js +204 -0
- package/dist/lifecycle/scenario.js +214 -0
- package/dist/lifecycle/snapshot.js +239 -0
- package/dist/lifecycle/status.js +447 -0
- package/dist/lifecycle/symptoms.js +117 -0
- package/dist/lifecycle/teardown.js +255 -0
- package/dist/lifecycle/types.js +1 -0
- package/dist/lifecycle/unobserved-gate.js +33 -0
- package/dist/lifecycle/wave-plans.js +68 -0
- package/dist/lifecycle/work-item-id.js +36 -0
- package/dist/lifecycle/work-lease.js +393 -0
- package/dist/lint/component-checks.js +87 -0
- package/dist/lint/config.js +483 -0
- package/dist/lint/declarative.js +122 -0
- package/dist/lint/discover.d.ts.map +1 -1
- package/dist/lint/discover.js +138 -0
- package/dist/lint/engine.js +246 -0
- package/dist/lint/knowledge-checks.js +64 -0
- package/dist/lint/named-checks.js +22 -0
- package/dist/lint/output-checks.js +87 -0
- package/dist/lint/output-docs.js +163 -0
- package/dist/lint/parser.js +33 -0
- package/dist/lint/pipeline-change-gate.js +70 -0
- package/dist/lint/policy-import.d.ts +1 -1
- package/dist/lint/policy-import.d.ts.map +1 -1
- package/dist/lint/policy-import.js +62 -0
- package/dist/lint/policy-sandbox.js +86 -0
- package/dist/lint/policy.js +122 -0
- package/dist/lint/post-synth.js +87 -0
- package/dist/lint/presets/relaxed.json +26 -0
- package/dist/lint/presets/strict.json +24 -24
- package/dist/lint/receipt-checks.js +83 -0
- package/dist/lint/rule-loader.d.ts.map +1 -1
- package/dist/lint/rule-loader.js +89 -0
- package/dist/lint/rule-registry.js +86 -0
- package/dist/lint/rule.js +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.js +25 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.js +21 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.js +24 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.js +17 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.js +18 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.js +20 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.js +16 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.js +10 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.js +16 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.js +69 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.js +84 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.js +103 -0
- package/dist/lint/rules/comp/comp004-gate-needs-durable-runtime.js +70 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.js +109 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.js +49 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.js +64 -0
- package/dist/lint/rules/comp/index.js +33 -0
- package/dist/lint/rules/comp/support.js +129 -0
- package/dist/lint/rules/composite-scope.js +51 -0
- package/dist/lint/rules/cor017-composite-name-match.js +93 -0
- package/dist/lint/rules/cor018-composite-prefer-lexicon-type.js +136 -0
- package/dist/lint/rules/cor021-env-literal-name.js +100 -0
- package/dist/lint/rules/cor022-receipt-leaf.js +118 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.js +199 -0
- package/dist/lint/rules/declarable-naming-convention.js +62 -0
- package/dist/lint/rules/evl001-non-literal-expression.js +66 -0
- package/dist/lint/rules/evl002-control-flow-resource.js +69 -0
- package/dist/lint/rules/evl003-dynamic-property-access.js +44 -0
- package/dist/lint/rules/evl004-spread-non-const.js +94 -0
- package/dist/lint/rules/evl005-resource-block-body.js +41 -0
- package/dist/lint/rules/evl007-invalid-siblings.js +105 -0
- package/dist/lint/rules/evl009-composite-no-constant.js +158 -0
- package/dist/lint/rules/evl010-composite-no-transform.js +59 -0
- package/dist/lint/rules/evl011-symbolic-in-template.js +106 -0
- package/dist/lint/rules/export-required.js +115 -0
- package/dist/lint/rules/file-declarable-limit.js +88 -0
- package/dist/lint/rules/flat-declarations.js +62 -0
- package/dist/lint/rules/index.js +90 -0
- package/dist/lint/rules/no-cyclic-declarable-ref.js +138 -0
- package/dist/lint/rules/no-redundant-type-import.js +76 -0
- package/dist/lint/rules/no-redundant-value-cast.js +41 -0
- package/dist/lint/rules/no-string-ref.js +59 -0
- package/dist/lint/rules/no-unused-declarable-import.js +75 -0
- package/dist/lint/rules/no-unused-declarable.js +142 -0
- package/dist/lint/rules/op/index.js +28 -0
- package/dist/lint/rules/op/ops012-activity-contract.js +54 -0
- package/dist/lint/rules/op/ops013-step-output-ref.js +88 -0
- package/dist/lint/rules/op/ops014-converge-rule-refusals.js +114 -0
- package/dist/lint/rules/op/ops015-gate-approval.js +45 -0
- package/dist/lint/rules/op/support.js +11 -0
- package/dist/lint/rules/op/sys010-key-over-plain-http.js +100 -0
- package/dist/lint/rules/property-kind.js +56 -0
- package/dist/lint/rules/single-concern-file.js +71 -0
- package/dist/lint/rules/sys001-no-literal-key.js +60 -0
- package/dist/lint/selectors.js +168 -0
- package/dist/lint/suppressions.js +129 -0
- package/dist/lint/typescript.js +17 -0
- package/dist/live-endpoint.js +113 -0
- package/dist/live-read-session.js +76 -0
- package/dist/lsp/lexicon-providers.js +163 -0
- package/dist/lsp/types.js +5 -0
- package/dist/managed-fields.js +293 -0
- package/dist/mcp/types.js +4 -0
- package/dist/notify-verify.js +0 -1
- package/dist/notify.js +0 -1
- package/dist/notify.schema.json +72 -0
- package/dist/observation.js +266 -0
- package/dist/okf-read.js +134 -0
- package/dist/okf.js +275 -0
- package/dist/op/__fixtures__/decide-stub-backend.js +125 -0
- package/dist/op/activities/activity-contracts.d.ts +1 -1
- package/dist/op/activities/activity-contracts.js +313 -0
- package/dist/op/activities/apply.js +582 -0
- package/dist/op/activities/build.js +18 -0
- package/dist/op/activities/change-coverage.js +40 -0
- package/dist/op/activities/change-set.d.ts +8 -3
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +67 -0
- package/dist/op/activities/converge.js +492 -0
- package/dist/op/activities/decide.js +211 -0
- package/dist/op/activities/env-teardown.js +110 -0
- package/dist/op/activities/factory.js +591 -0
- package/dist/op/activities/forge-pull-request.js +82 -0
- package/dist/op/activities/gh-host.js +78 -0
- package/dist/op/activities/guard-validate.js +165 -0
- package/dist/op/activities/http-check.js +40 -0
- package/dist/op/activities/index.js +59 -0
- package/dist/op/activities/lexicon-upgrade.js +629 -0
- package/dist/op/activities/lifecycle.js +109 -0
- package/dist/op/activities/pipeline-audit.js +147 -0
- package/dist/op/activities/policy.js +26 -0
- package/dist/op/activities/predict-behaviour.js +341 -0
- package/dist/op/activities/propose-upgrade.js +165 -0
- package/dist/op/activities/reconcile.d.ts +28 -16
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/activities/reconcile.js +1011 -0
- package/dist/op/activities/shell.js +118 -0
- package/dist/op/activities/source-release.js +97 -0
- package/dist/op/activities/source-rollback.js +165 -0
- package/dist/op/activities/teardown.js +17 -0
- package/dist/op/activities/util.js +6 -0
- package/dist/op/activities/wait.js +51 -0
- package/dist/op/activities/work-evidence.js +35 -0
- package/dist/op/activities/workflow-audit.js +133 -0
- package/dist/op/activity-contract-registry.js +106 -0
- package/dist/op/activity-contract.js +232 -0
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/activity-profiles.js +129 -0
- package/dist/op/activity-registry.js +105 -0
- package/dist/op/activity-runtime.js +28 -0
- package/dist/op/builders.d.ts +1 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +801 -0
- package/dist/op/change-signal.js +118 -0
- package/dist/op/composites/apply-op.js +151 -0
- package/dist/op/composites/behaviour-op.js +65 -0
- package/dist/op/composites/converge-op.js +141 -0
- package/dist/op/composites/index.js +19 -0
- package/dist/op/composites/lexicon-upgrade-op.js +107 -0
- package/dist/op/composites/pipeline-audit-op.js +50 -0
- package/dist/op/composites/reconcile-op.js +84 -0
- package/dist/op/composites/watch-op.js +69 -0
- package/dist/op/composites/workflow-audit-op.js +57 -0
- package/dist/op/converge-rule.js +205 -0
- package/dist/op/cron.js +146 -0
- package/dist/op/decide-backend.js +181 -0
- package/dist/op/decide-config.js +68 -0
- package/dist/op/decide-read-inputs.js +141 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +213 -0
- package/dist/op/duration.js +21 -0
- package/dist/op/emulator-freshness.js +80 -0
- package/dist/op/emulator-lifecycle.js +269 -0
- package/dist/op/factory.js +83 -0
- package/dist/op/gate-approval.js +172 -0
- package/dist/op/gate-name.js +86 -0
- package/dist/op/gate-plan-context.js +167 -0
- package/dist/op/gate-point-run.js +67 -0
- package/dist/op/gate-point.js +111 -0
- package/dist/op/gate-resume-plan.js +155 -0
- package/dist/op/gate-resume.js +31 -0
- package/dist/op/gate-review.js +290 -0
- package/dist/op/gate-run-locator.js +85 -0
- package/dist/op/gate-summary.js +100 -0
- package/dist/op/gate-wait.js +56 -0
- package/dist/op/gate.js +449 -0
- package/dist/op/generate-pipeline.js +124 -0
- package/dist/op/index.js +51 -0
- package/dist/op/lifecycle-receipt-store.js +45 -0
- package/dist/op/local-executor.js +1164 -0
- package/dist/op/local-output.js +140 -0
- package/dist/op/op-ir.js +317 -0
- package/dist/op/op-verb-class.js +131 -0
- package/dist/op/op-waves-notify.js +136 -0
- package/dist/op/op-waves-run.d.ts +1 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +1657 -0
- package/dist/op/op-waves.js +409 -0
- package/dist/op/operator.js +743 -0
- package/dist/op/receipt-store.js +94 -0
- package/dist/op/resource.js +23 -0
- package/dist/op/run-context.js +28 -0
- package/dist/op/run-live.js +256 -0
- package/dist/op/runtime.js +21 -0
- package/dist/op/runtimes/local.js +195 -0
- package/dist/op/source-archive.js +131 -0
- package/dist/op/step-output-ref.js +397 -0
- package/dist/op/steward-beside.js +169 -0
- package/dist/op/steward-points.js +138 -0
- package/dist/op/steward-turn.js +59 -0
- package/dist/op/steward.js +317 -0
- package/dist/op/types.js +25 -0
- package/dist/op/work-lease-decl.js +81 -0
- package/dist/op/work-lease-run.js +393 -0
- package/dist/override-gate.js +284 -0
- package/dist/owner-chain.js +74 -0
- package/dist/ownership.js +92 -0
- package/dist/params.js +61 -0
- package/dist/plan-summary.js +711 -0
- package/dist/point-decision.js +211 -0
- package/dist/pr-forge.js +810 -0
- package/dist/pr-loop.js +203 -0
- package/dist/project-codegen.js +191 -0
- package/dist/project-root.js +74 -0
- package/dist/project-validation.js +50 -0
- package/dist/provenance.js +157 -0
- package/dist/pseudo-parameter.js +40 -0
- package/dist/reconcile.js +450 -0
- package/dist/resource-attributes.js +33 -0
- package/dist/runtime-adapter.js +77 -0
- package/dist/runtime.js +66 -0
- package/dist/secret-materialization.js +153 -0
- package/dist/secret-provenance.js +250 -0
- package/dist/serializer-walker.js +112 -0
- package/dist/serializer.js +1 -0
- package/dist/sort.js +45 -0
- package/dist/stack-output.js +115 -0
- package/dist/telemetry-attribution.js +149 -0
- package/dist/terraform/__fixtures__/build-graph.js +63 -0
- package/dist/terraform/adopt-state.js +40 -0
- package/dist/terraform/aws-resources.js +384 -0
- package/dist/terraform/bridge.js +204 -0
- package/dist/terraform/carve-provider.js +155 -0
- package/dist/terraform/carve.js +138 -0
- package/dist/terraform/data-source-shape.js +57 -0
- package/dist/terraform/emit-source.js +36 -0
- package/dist/terraform/excise.js +123 -0
- package/dist/terraform/graduate.js +128 -0
- package/dist/terraform/graph.js +435 -0
- package/dist/terraform/hcl2json.js +60 -0
- package/dist/terraform/manifest.js +149 -0
- package/dist/terraform/parse.js +81 -0
- package/dist/terraform/providers/aws.js +146 -0
- package/dist/terraform/providers/gcp.js +294 -0
- package/dist/terraform/providers/index.js +17 -0
- package/dist/terraform/providers/kubernetes.js +253 -0
- package/dist/terraform/score.js +151 -0
- package/dist/terraform/state.js +67 -0
- package/dist/terraform/tier-map.js +74 -0
- package/dist/terraform/types.js +13 -0
- package/dist/terraform/unified-diff.js +132 -0
- package/dist/testing.js +295 -0
- package/dist/toml-emit.js +153 -0
- package/dist/toml-parse.js +355 -0
- package/dist/toml-utils.js +60 -0
- package/dist/toml.js +428 -0
- package/dist/ts-loader.d.ts +46 -0
- package/dist/ts-loader.d.ts.map +1 -0
- package/dist/ts-loader.js +103 -0
- package/dist/types.js +1 -0
- package/dist/utils.js +61 -0
- package/dist/validation.js +20 -0
- package/dist/vendor/js-yaml-load.js +1662 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts +7 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.js +119 -0
- package/dist/workspace/__fixtures__/decide-workspace.js +112 -0
- package/dist/workspace/__fixtures__/sessions.d.ts +1 -1
- package/dist/workspace/__fixtures__/sessions.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/sessions.js +91 -0
- package/dist/workspace/__fixtures__/two-member-workspace.js +34 -0
- package/dist/workspace/agent-cli.js +99 -0
- package/dist/workspace/agent.schema.json +390 -0
- package/dist/workspace/answers-ledger.js +89 -0
- package/dist/workspace/box-cli.js +142 -0
- package/dist/workspace/box-factory-write.js +196 -0
- package/dist/workspace/box-factory-write.schema.json +342 -0
- package/dist/workspace/box-factory.js +88 -0
- package/dist/workspace/box-intent.js +126 -0
- package/dist/workspace/box-isolation.js +169 -0
- package/dist/workspace/box-listing-write.schema.json +204 -0
- package/dist/workspace/box-listing.js +298 -0
- package/dist/workspace/box-publish.js +352 -0
- package/dist/workspace/box-publish.schema.json +498 -0
- package/dist/workspace/box-services.js +39 -0
- package/dist/workspace/broker-protocol.js +359 -0
- package/dist/workspace/broker-protocol.schema.json +228 -0
- package/dist/workspace/change-set.schema.json +462 -0
- package/dist/workspace/changes-cli.js +56 -0
- package/dist/workspace/changes.js +446 -0
- package/dist/workspace/changes.schema.json +642 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.js +198 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.js +155 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.js +214 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.js +180 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.js +99 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +847 -0
- package/dist/workspace/chant-migrations.js +113 -0
- package/dist/workspace/check.schema.json +433 -0
- package/dist/workspace/checks/box-isolation.js +62 -0
- package/dist/workspace/checks/boxes.js +491 -0
- package/dist/workspace/checks/diagrams.js +104 -0
- package/dist/workspace/checks/generated.js +419 -0
- package/dist/workspace/checks/ledgers.js +212 -0
- package/dist/workspace/checks/links.js +191 -0
- package/dist/workspace/checks/live.js +100 -0
- package/dist/workspace/checks/pipelines.js +188 -0
- package/dist/workspace/checks/records.js +169 -0
- package/dist/workspace/checks.js +426 -0
- package/dist/workspace/ci-green-cli.js +125 -0
- package/dist/workspace/ci-green-forge.js +83 -0
- package/dist/workspace/ci-green-workflow.d.ts +3 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +202 -0
- package/dist/workspace/ci-green.js +325 -0
- package/dist/workspace/ci-last-green.schema.json +158 -0
- package/dist/workspace/class-data.d.ts +84 -0
- package/dist/workspace/class-data.d.ts.map +1 -0
- package/dist/workspace/class-data.js +238 -0
- package/dist/workspace/compose-graph.js +235 -0
- package/dist/workspace/compose-reports.js +146 -0
- package/dist/workspace/composites.js +264 -0
- package/dist/workspace/composites.schema.json +617 -0
- package/dist/workspace/conformance/__fixture__/app/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/app/src/server.mjs +29 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.kind.mjs +54 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.schema.json +512 -0
- package/dist/workspace/conformance/__fixture__/decisions/fix-001-how-the-app-is-deployed.md +40 -0
- package/dist/workspace/conformance/__fixture__/delivery/chant.config.ts +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/lexicon/index.ts +26 -0
- package/dist/workspace/conformance/__fixture__/delivery/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.component.ts +14 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.ts +4 -0
- package/dist/workspace/conformance/__fixtures__/reference-broker.js +205 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.kind.mjs +32 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +135 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.kind.mjs +37 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.schema.json +213 -0
- package/dist/workspace/conformance/__writer_fixture__/decisions/points.json +228 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.kind.mjs +15 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.schema.json +38 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.kind.mjs +54 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.schema.json +289 -0
- package/dist/workspace/conformance/__writer_fixture__/work/W-001-the-writer-suite-works-this-item.md +25 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.kind.mjs +60 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.schema.json +603 -0
- package/dist/workspace/conformance/broker.js +736 -0
- package/dist/workspace/conformance/index.js +673 -0
- package/dist/workspace/conformance/vitest.js +108 -0
- package/dist/workspace/conformance/writer.js +1080 -0
- package/dist/workspace/decide.js +879 -0
- package/dist/workspace/decision-points.schema.json +135 -135
- package/dist/workspace/declaration-write-cli.js +74 -0
- package/dist/workspace/declaration-write.js +238 -0
- package/dist/workspace/declaration.js +938 -0
- package/dist/workspace/declaration.schema.json +1413 -1413
- package/dist/workspace/declared-kinds.js +106 -0
- package/dist/workspace/environments.js +164 -0
- package/dist/workspace/evidence.schema.json +279 -0
- package/dist/workspace/export-cli.js +185 -0
- package/dist/workspace/export.js +499 -0
- package/dist/workspace/factory-rules.js +175 -0
- package/dist/workspace/generated-files.js +92 -0
- package/dist/workspace/glob.js +45 -0
- package/dist/workspace/graph-cache.js +352 -0
- package/dist/workspace/graph-cli.js +348 -0
- package/dist/workspace/graph.schema.json +1338 -0
- package/dist/workspace/identity-gate-rule.js +75 -0
- package/dist/workspace/identity.js +126 -0
- package/dist/workspace/import.js +283 -0
- package/dist/workspace/init.js +620 -0
- package/dist/workspace/intent-cli.js +263 -0
- package/dist/workspace/intent-joins.js +201 -0
- package/dist/workspace/intent-record.js +352 -0
- package/dist/workspace/intent-record.schema.json +864 -0
- package/dist/workspace/intent.js +1582 -0
- package/dist/workspace/intent.schema.json +2420 -0
- package/dist/workspace/json-edit.js +221 -0
- package/dist/workspace/jsonc.js +235 -0
- package/dist/workspace/kind-readers.js +103 -0
- package/dist/workspace/kinds.d.ts +3 -7
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +553 -0
- package/dist/workspace/lexicon-symbols.js +112 -0
- package/dist/workspace/lineage-adopt-cli.js +102 -0
- package/dist/workspace/lineage-adopt.js +360 -0
- package/dist/workspace/lineage-check.js +282 -0
- package/dist/workspace/lineage-cli.js +121 -0
- package/dist/workspace/lineage-hash-index.js +284 -0
- package/dist/workspace/lineage-init.js +507 -0
- package/dist/workspace/lineage-lock.js +387 -0
- package/dist/workspace/lineage-merge.js +45 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -1
- package/dist/workspace/lineage-migrations.js +329 -0
- package/dist/workspace/lineage-provenance.js +36 -0
- package/dist/workspace/lineage-update.js +138 -0
- package/dist/workspace/lineage-upgrade-cli.js +131 -0
- package/dist/workspace/lineage-upgrade.js +889 -0
- package/dist/workspace/lineage-vendor.js +171 -0
- package/dist/workspace/lineage-version.js +128 -0
- package/dist/workspace/lineage-versions.js +275 -0
- package/dist/workspace/links.js +330 -0
- package/dist/workspace/ls-generated.js +95 -0
- package/dist/workspace/ls.js +277 -0
- package/dist/workspace/ls.schema.json +333 -0
- package/dist/workspace/member-commands.js +508 -0
- package/dist/workspace/member-handles.js +216 -0
- package/dist/workspace/member-pipeline.js +258 -0
- package/dist/workspace/member-run.js +117 -0
- package/dist/workspace/member-write.schema.json +193 -0
- package/dist/workspace/nested-graph.js +156 -0
- package/dist/workspace/nesting.js +38 -0
- package/dist/workspace/patch.js +301 -0
- package/dist/workspace/patch.schema.json +321 -0
- package/dist/workspace/pin-cli.js +55 -0
- package/dist/workspace/pin-integrity.js +100 -0
- package/dist/workspace/plan-summary.schema.json +155 -0
- package/dist/workspace/point-answer.schema.json +129 -129
- package/dist/workspace/points-cli.js +291 -0
- package/dist/workspace/points-write.schema.json +660 -0
- package/dist/workspace/points.js +521 -0
- package/dist/workspace/points.schema.json +916 -0
- package/dist/workspace/pr-report.schema.json +108 -0
- package/dist/workspace/principal-classes.d.ts +4 -11
- package/dist/workspace/principal-classes.d.ts.map +1 -1
- package/dist/workspace/principal-classes.js +162 -0
- package/dist/workspace/reason-codes.js +326 -0
- package/dist/workspace/record-assets.js +151 -0
- package/dist/workspace/record-decided.js +105 -0
- package/dist/workspace/record-sessions.js +96 -0
- package/dist/workspace/record-source.js +114 -0
- package/dist/workspace/records-amend.schema.json +284 -0
- package/dist/workspace/records-checkout.js +76 -0
- package/dist/workspace/records-cli.js +707 -0
- package/dist/workspace/records-close.js +116 -0
- package/dist/workspace/records-close.schema.json +278 -0
- package/dist/workspace/records-new.schema.json +202 -0
- package/dist/workspace/records-review.schema.json +367 -0
- package/dist/workspace/records-since.js +317 -0
- package/dist/workspace/records-since.schema.json +218 -0
- package/dist/workspace/records-write.js +1229 -0
- package/dist/workspace/records.js +1345 -0
- package/dist/workspace/records.schema.json +604 -0
- package/dist/workspace/reference-kinds/app/package.json +10 -0
- package/dist/workspace/reference-kinds/app/workspace-kinds.json +45 -0
- package/dist/workspace/returns.js +303 -0
- package/dist/workspace/root-refusal.js +75 -0
- package/dist/workspace/run-statement.schema.json +622 -0
- package/dist/workspace/runs-cli.js +584 -0
- package/dist/workspace/runs-write.schema.json +994 -0
- package/dist/workspace/runs.js +708 -0
- package/dist/workspace/runs.schema.json +1257 -0
- package/dist/workspace/runtimes.js +76 -0
- package/dist/workspace/session-kinds.js +83 -0
- package/dist/workspace/signers.schema.json +206 -0
- package/dist/workspace/source-block.js +125 -0
- package/dist/workspace/squash.js +177 -0
- package/dist/workspace/status-gates.js +162 -0
- package/dist/workspace/status-stewards.js +330 -0
- package/dist/workspace/status.js +514 -0
- package/dist/workspace/status.schema.json +998 -0
- package/dist/workspace/steward-index.js +191 -0
- package/dist/workspace/symbols.js +188 -0
- package/dist/workspace/template-manifest.js +227 -0
- package/dist/workspace/template-pins.js +115 -0
- package/dist/workspace/trailer-joins.js +65 -0
- package/dist/workspace/trailers.js +111 -0
- package/dist/workspace/tree.js +136 -0
- package/dist/workspace/trust/attestor.js +63 -0
- package/dist/workspace/trust/dsse.js +108 -0
- package/dist/workspace/trust/evidence-cli.js +175 -0
- package/dist/workspace/trust/evidence.js +161 -0
- package/dist/workspace/trust/gate-seal.js +226 -0
- package/dist/workspace/trust/policy.js +190 -0
- package/dist/workspace/trust/provenance.js +180 -0
- package/dist/workspace/trust/rotation.js +298 -0
- package/dist/workspace/trust/run-commits.js +101 -0
- package/dist/workspace/trust/run-statement.js +182 -0
- package/dist/workspace/trust/seal.js +272 -0
- package/dist/workspace/trust/signers-cli.js +152 -0
- package/dist/workspace/trust/ssh-commit.js +178 -0
- package/dist/workspace/trust/test-repo.js +118 -0
- package/dist/workspace/trust/trust-files.js +193 -0
- package/dist/workspace/trust/verify-cli.js +63 -0
- package/dist/workspace/trust/verify.js +192 -0
- package/dist/workspace/which-chant.js +141 -0
- package/dist/workspace/wip-cli.js +95 -0
- package/dist/workspace/wip-write.schema.json +504 -0
- package/dist/workspace/wip.js +631 -0
- package/dist/workspace/wip.schema.json +334 -0
- package/dist/workspace/work-cli.js +448 -0
- package/dist/workspace/work-evidence.js +122 -0
- package/dist/workspace/work-evidence.schema.json +222 -0
- package/dist/workspace/work-history.schema.json +421 -0
- package/dist/workspace/work-lease.schema.json +246 -0
- package/dist/workspace/work-size.js +77 -0
- package/dist/workspace/work.js +283 -0
- package/dist/workspace/workspace-kinds.schema.json +259 -259
- package/dist/workspace/workspace-principals.schema.json +53 -53
- package/dist/workspace/write-lock-cli.js +105 -0
- package/dist/workspace/write-lock.js +424 -0
- package/dist/workspace/write-lock.schema.json +172 -0
- package/dist/workspace/write-scope.js +484 -0
- package/dist/yaml.js +459 -0
- package/package.json +2 -2
- package/src/build.ts +8 -0
- package/src/change-set.test.ts +48 -0
- package/src/change-set.ts +52 -2
- package/src/ci-jobs.test.ts +49 -0
- package/src/ci-jobs.ts +515 -0
- package/src/cli/commands/check-lexicon-plugin.ts +2 -0
- package/src/cli/commands/lint.ts +3 -0
- package/src/cli/commands/migrate.ts +2 -0
- package/src/cli/compiled-cli.e2e.test.ts +165 -0
- package/src/cli/main.ts +121 -27
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/codegen/pinned-upgrade.ts +2 -0
- package/src/components/discover.ts +2 -0
- package/src/components/pr-pipeline.ts +3 -2
- package/src/components/sandbox/driver.ts +3 -1
- package/src/composite.ts +15 -3
- package/src/config-import.ts +3 -0
- package/src/discovery/collect.ts +15 -1
- package/src/discovery/fold-build-parity.test.ts +71 -0
- package/src/discovery/fold-import.ts +25 -127
- package/src/discovery/fold-project-provenance.test.ts +21 -4
- package/src/discovery/host-composite.ts +101 -0
- package/src/discovery/import.ts +2 -0
- package/src/discovery/index.ts +11 -1
- package/src/discovery/sandbox/driver.ts +3 -1
- package/src/gate-decision-bundle.test.ts +5 -4
- package/src/gate-decision-identity.test.ts +59 -6
- package/src/gate-decision.ts +81 -21
- package/src/lexicon-module.ts +3 -0
- package/src/lifecycle/gate-audit.test.ts +55 -1
- package/src/lifecycle/gate-audit.ts +116 -3
- package/src/lifecycle/gate-ledger.test.ts +20 -1
- package/src/lifecycle/gate-ledger.ts +33 -1
- package/src/lint/config.ts +1 -1
- package/src/lint/discover.ts +28 -8
- package/src/lint/policy-import.ts +4 -1
- package/src/lint/rule-loader.ts +2 -0
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +11 -3
- package/src/op/activities/lexicon-upgrade.test.ts +2 -0
- package/src/op/activities/reconcile.test.ts +62 -2
- package/src/op/activities/reconcile.ts +46 -22
- package/src/op/builders.ts +1 -1
- package/src/op/discover.ts +3 -0
- package/src/op/op-waves-run.ts +4 -3
- package/src/op/op-waves.test.ts +2 -0
- package/src/op/work-lease-run.test.ts +12 -4
- package/src/ts-loader.test.ts +23 -0
- package/src/ts-loader.ts +122 -0
- package/src/workspace/__fixtures__/contract-repo.ts +17 -1
- package/src/workspace/__fixtures__/sessions.ts +3 -3
- package/src/workspace/change-set.schema.json +5 -3
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +1 -1
- package/src/workspace/ci-green-workflow.test.ts +4 -4
- package/src/workspace/ci-green-workflow.ts +5 -2
- package/src/workspace/class-data.test.ts +64 -0
- package/src/workspace/class-data.ts +236 -0
- package/src/workspace/declaration.ts +1 -1
- package/src/workspace/kinds.ts +7 -36
- package/src/workspace/lineage-migrations.ts +2 -0
- package/src/workspace/points.ts +1 -1
- package/src/workspace/principal-classes.ts +12 -95
- package/src/workspace/records-formats.test.ts +7 -2
- package/src/workspace/records-sessions-write.test.ts +3 -3
- package/src/workspace/status-contract.e2e.test.ts +37 -0
- package/src/workspace/status-contract.test.ts +23 -21
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The factory's rules (#3406, ws-087): what every orchestrator of a factory
|
|
3
|
+
* must agree on, as pure functions over what the read contract prints. The
|
|
4
|
+
* reference Op (`../op/factory.ts`) runs them; an orchestrator supplies only
|
|
5
|
+
* execution (the builder, the context, the check).
|
|
6
|
+
*
|
|
7
|
+
* - Readiness ({@link pickable}): the item names a contract, or is an ask or
|
|
8
|
+
* the box's first build from its intent ({@link isAsk}); a work item a
|
|
9
|
+
* person wrote by hand or a finding's triage item stays with its author
|
|
10
|
+
* (#3503). On top of the work kind's `ready`, the box's intent is decided,
|
|
11
|
+
* a contract the item builds is approved and in force,
|
|
12
|
+
* the item is under its attempt limit, it is not done and waiting to be
|
|
13
|
+
* applied on its branch, its slice-tier and understand questions are not
|
|
14
|
+
* open, an understand answer of redraft or ask holds it, and a failed last
|
|
15
|
+
* build holds it until a person asks for a retry ({@link retryState}).
|
|
16
|
+
* - The understand point's answers ({@link understandOutcome}): proceed
|
|
17
|
+
* builds; refuse drops the item on its branch; redraft and ask build
|
|
18
|
+
* nothing and leave it for its author. Each maps to a lease outcome, and
|
|
19
|
+
* only a build's outcome counts as an attempt (#3147).
|
|
20
|
+
* - Done ({@link doneVerdict}): the builder finished, the check ran and
|
|
21
|
+
* passed, and every criterion the factory may tick has passing evidence. A
|
|
22
|
+
* criterion verified `manual` or `runtime` is not the factory's to tick, so
|
|
23
|
+
* an item with one is not done by the factory.
|
|
24
|
+
* - Retry ({@link retryState}): a failed build is never tried again on its
|
|
25
|
+
* own. A person's request, the item's `retry: { after, by, at }`, names the
|
|
26
|
+
* lease token of the failed build it follows, so one request starts one run.
|
|
27
|
+
* - Implements ({@link proposeImplements}): a build recorded done proposes
|
|
28
|
+
* each decision in force that constrains, by path, a path it changed.
|
|
29
|
+
*/
|
|
30
|
+
/** The decision point that gates every build of a person's ask (#3150). */
|
|
31
|
+
export const UNDERSTAND_POINT = "understand";
|
|
32
|
+
/** The decision point that picks a builder tier (ws-057, #3150). */
|
|
33
|
+
export const TIER_POINT = "slice-tier";
|
|
34
|
+
/** What the understand point answers. */
|
|
35
|
+
export const UNDERSTAND_ANSWERS = ["proceed", "redraft", "ask", "refuse"];
|
|
36
|
+
/** Why an item is not picked. Closed. */
|
|
37
|
+
export const FACTORY_HOLDS = [
|
|
38
|
+
"not-ready",
|
|
39
|
+
"no-contract",
|
|
40
|
+
"intent-undecided",
|
|
41
|
+
"contract-not-approved",
|
|
42
|
+
"attempts-exhausted",
|
|
43
|
+
"awaiting-retry",
|
|
44
|
+
"built-not-applied",
|
|
45
|
+
"dropped-on-branch",
|
|
46
|
+
"question-open",
|
|
47
|
+
"redraft-or-ask",
|
|
48
|
+
"leased",
|
|
49
|
+
];
|
|
50
|
+
/** Whether a work item is a person's ask: its source names what they said, or it is the box's first build from its intent. */
|
|
51
|
+
export function isAsk(data) {
|
|
52
|
+
const source = data?.source;
|
|
53
|
+
return !!(source && typeof source === "object" && (source.ask || source.intent));
|
|
54
|
+
}
|
|
55
|
+
/** The retry request on an item: `retry: { after, by, at }`, or null. */
|
|
56
|
+
export function retryRequest(data) {
|
|
57
|
+
const r = data?.retry;
|
|
58
|
+
if (!r || typeof r !== "object" || typeof r.after !== "string" || typeof r.by !== "string")
|
|
59
|
+
return null;
|
|
60
|
+
return { after: r.after, by: r.by, at: typeof r.at === "string" ? r.at : "" };
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether a person may ask for item `data`'s failed build to run again: the
|
|
64
|
+
* last claim is a failed build, nobody holds the lease, and attempts remain.
|
|
65
|
+
* `asked` says a request naming that build is already on the item.
|
|
66
|
+
*/
|
|
67
|
+
export function retryState(data, claims, attempts, leased) {
|
|
68
|
+
if (leased)
|
|
69
|
+
return { possible: false, reason: "held", message: "someone holds the item's lease now" };
|
|
70
|
+
const last = claims.at(-1);
|
|
71
|
+
if (!last || !last.attempt)
|
|
72
|
+
return { possible: false, reason: "no-failed-build", message: "the item's last claim is not a failed build, so there is nothing to retry" };
|
|
73
|
+
if (attempts.exhausted)
|
|
74
|
+
return { possible: false, reason: "attempts-exhausted", message: "the item has used every attempt its limit allows, so it is left to people" };
|
|
75
|
+
const asked = retryRequest(data)?.after === last.token;
|
|
76
|
+
return { possible: true, after: last.token, asked };
|
|
77
|
+
}
|
|
78
|
+
/** The lease outcome an understand answer leads to: null for proceed, which builds. */
|
|
79
|
+
export function understandOutcome(answer) {
|
|
80
|
+
if (answer === "refuse")
|
|
81
|
+
return "dropped";
|
|
82
|
+
if (answer === "redraft" || answer === "ask")
|
|
83
|
+
return answer;
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const OPEN = new Set(["escalated", "proposed"]);
|
|
87
|
+
/**
|
|
88
|
+
* Whether the factory picks `item` now, or why not. The factory builds an
|
|
89
|
+
* item that names a contract, an ask, or an intent build, as studio's queue
|
|
90
|
+
* did (#3503); any other item is its author's. Asks are candidates while
|
|
91
|
+
* proposed as well as open; any other item only when the work kind reads it
|
|
92
|
+
* ready.
|
|
93
|
+
*/
|
|
94
|
+
export function pickable(item, ctx) {
|
|
95
|
+
const no = (hold, message) => ({ ok: false, hold, message });
|
|
96
|
+
if (ctx.intentDecided === false)
|
|
97
|
+
return no("intent-undecided", "the box's intent is not decided yet, so nothing is picked");
|
|
98
|
+
if (item.leased)
|
|
99
|
+
return no("leased", `${item.id} is leased`);
|
|
100
|
+
const ask = isAsk(item.data);
|
|
101
|
+
if (!item.contract && !ask)
|
|
102
|
+
return no("no-contract", `${item.id} names no contract and is not an ask or an intent build, so it is left to its author`);
|
|
103
|
+
const candidate = item.ready || (ask && item.proposedState !== null && item.state === item.proposedState);
|
|
104
|
+
if (!candidate)
|
|
105
|
+
return no("not-ready", `${item.id} is ${item.state ?? "in no state"} and not ready`);
|
|
106
|
+
if (item.contract && (item.warnings.includes("work-contract-undecided") || item.warnings.includes("work-contract-unknown"))) {
|
|
107
|
+
return no("contract-not-approved", `${item.id} builds ${item.contract.id}, which is not approved and in force`);
|
|
108
|
+
}
|
|
109
|
+
if (ctx.branch && !ctx.branch.applied && ctx.branch.state === "done")
|
|
110
|
+
return no("built-not-applied", `${item.id} is built on its branch and waits to be applied`);
|
|
111
|
+
if (ctx.branch && !ctx.branch.applied && ctx.branch.state === "dropped")
|
|
112
|
+
return no("dropped-on-branch", `${item.id} was dropped on its branch`);
|
|
113
|
+
if (ctx.attempts.exhausted)
|
|
114
|
+
return no("attempts-exhausted", `${item.id} has used every attempt, so it is left to people`);
|
|
115
|
+
const last = ctx.claims.at(-1);
|
|
116
|
+
if (last?.attempt && retryRequest(item.data)?.after !== last.token) {
|
|
117
|
+
return no("awaiting-retry", `${item.id}'s last build failed; a person asks for another with retry.after: ${last.token}`);
|
|
118
|
+
}
|
|
119
|
+
for (const [name, q] of [[TIER_POINT, item.tier === null ? ctx.questions.tier : null], [UNDERSTAND_POINT, ask ? ctx.questions.understand : null]]) {
|
|
120
|
+
if (q && OPEN.has(q.state))
|
|
121
|
+
return no("question-open", `${item.id}'s ${name} question is ${q.state}; a person answers it first`);
|
|
122
|
+
}
|
|
123
|
+
const u = ask ? ctx.questions.understand : null;
|
|
124
|
+
if (u && u.state === "answered" && (u.answer === "redraft" || u.answer === "ask")) {
|
|
125
|
+
return no("redraft-or-ask", `${item.id}'s understand question was answered ${String(u.answer)}; its author changes the item, which asks again`);
|
|
126
|
+
}
|
|
127
|
+
return { ok: true };
|
|
128
|
+
}
|
|
129
|
+
/** Whether a build is done, or why not. */
|
|
130
|
+
export function doneVerdict(build, check, criteria) {
|
|
131
|
+
if (!build.finished)
|
|
132
|
+
return { done: false, reason: "the builder did not finish" };
|
|
133
|
+
if (build.reverted.length > 0)
|
|
134
|
+
return { done: false, reason: `the guard put back what the builder changed out of scope: ${build.reverted.join(", ")}` };
|
|
135
|
+
if (!check.ran)
|
|
136
|
+
return { done: false, reason: "no check ran" };
|
|
137
|
+
if (!check.ok)
|
|
138
|
+
return { done: false, reason: "the check failed" };
|
|
139
|
+
const people = criteria.filter((c) => c.verification === "manual" || c.verification === "runtime");
|
|
140
|
+
if (people.length > 0)
|
|
141
|
+
return { done: false, reason: `criteria ${people.map((c) => c.id).join(", ")} are verified ${people.map((c) => c.verification).join("/")}, which the factory never ticks` };
|
|
142
|
+
const unmet = criteria.filter((c) => !c.met);
|
|
143
|
+
if (unmet.length > 0)
|
|
144
|
+
return { done: false, reason: `criteria ${unmet.map((c) => c.id).join(", ")} have no passing evidence` };
|
|
145
|
+
return { done: true };
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The decisions a done build proposes it implements (studio#243): from the
|
|
149
|
+
* intent graph's `constrains` edges of granularity `path` to each changed
|
|
150
|
+
* path, the decisions in force, less those the item already implements.
|
|
151
|
+
*/
|
|
152
|
+
export function proposeImplements(changed, already, inForce = ["decided", "ratified"]) {
|
|
153
|
+
const out = new Map();
|
|
154
|
+
for (const c of changed) {
|
|
155
|
+
for (const d of c.decisions) {
|
|
156
|
+
if (d.granularity !== "path" || d.state === null || !inForce.includes(d.state) || already.includes(d.id))
|
|
157
|
+
continue;
|
|
158
|
+
const paths = out.get(d.id) ?? [];
|
|
159
|
+
if (!paths.includes(c.path))
|
|
160
|
+
paths.push(c.path);
|
|
161
|
+
out.set(d.id, paths);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return [...out].map(([decision, paths]) => ({ decision, paths }));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The key of the state an item was read in, for a steward's ready step: a
|
|
168
|
+
* new key is work no run was started for. It names the item, its last claim
|
|
169
|
+
* and its open questions, so a person's answer to either point is a new key.
|
|
170
|
+
*/
|
|
171
|
+
export function readyKey(item, ctx, data) {
|
|
172
|
+
const last = ctx.claims.at(-1)?.token ?? "none";
|
|
173
|
+
const q = (x) => (x ? `${x.state}:${String(x.answer)}` : "-");
|
|
174
|
+
return `${item.id}@${last}#tier=${q(ctx.questions.tier)}#understand=${q(ctx.questions.understand)}#retry=${retryRequest(data)?.after ?? "-"}`;
|
|
175
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which files are generated, and by what (#2524 D14, #2541).
|
|
3
|
+
*
|
|
4
|
+
* One list answers the question for everyone who asks it: the drift check in
|
|
5
|
+
* `checks/generated.ts` and the lineage lock's `generated` class
|
|
6
|
+
* (`lineage-lock.ts`). The list is the member's declared `generated` entries
|
|
7
|
+
* plus the files core registers itself:
|
|
8
|
+
*
|
|
9
|
+
* | File | Class |
|
|
10
|
+
* |-----------------------|-----------|
|
|
11
|
+
* | `skills/*\/SKILL.md` | generated, by `chant update` |
|
|
12
|
+
* | `.mcp.json` | seed |
|
|
13
|
+
* | `.chant/types/` | ignored: gitignored, never listed |
|
|
14
|
+
*
|
|
15
|
+
* A declared entry wins over the implicit rules, so a member can list a
|
|
16
|
+
* `SKILL.md` it keeps by hand. A hand-written entry is the project's own
|
|
17
|
+
* file, so the lock classes it `owned`.
|
|
18
|
+
*
|
|
19
|
+
* Everything here loads only with the lineage and workspace commands.
|
|
20
|
+
*/
|
|
21
|
+
import { relative, resolve, sep } from "node:path";
|
|
22
|
+
import { findWorkspaceRoot } from "../project-root.js";
|
|
23
|
+
import { isInside, readDeclaration } from "./declaration.js";
|
|
24
|
+
import { memberHolding } from "./record-assets.js";
|
|
25
|
+
import { workingTree } from "./tree.js";
|
|
26
|
+
/** What `chant update` rewrites, registered as implicit generated entries. */
|
|
27
|
+
export const IMPLICIT_GENERATED = [{ glob: "skills/*/SKILL.md", pattern: /^skills\/[^/]+\/SKILL\.md$/, command: "chant update" }];
|
|
28
|
+
/** Written once at init and never again. */
|
|
29
|
+
export const SEED_FILES = [".mcp.json"];
|
|
30
|
+
/** Gitignored output, out of scope for both the lock and the drift check. */
|
|
31
|
+
export const IGNORED_DIRS = [".chant/types"];
|
|
32
|
+
/** The implicit entry `path` matches, if any. */
|
|
33
|
+
export function implicitGenerated(path) {
|
|
34
|
+
return IMPLICIT_GENERATED.find((i) => i.pattern.test(path));
|
|
35
|
+
}
|
|
36
|
+
/** Class a file by the declared entries first, then by the implicit rules (D14). */
|
|
37
|
+
export function classifyFile(path, declared) {
|
|
38
|
+
const entry = declared?.get(path);
|
|
39
|
+
if (entry)
|
|
40
|
+
return entry.handWritten ? { class: "owned" } : { class: "generated", command: entry.command };
|
|
41
|
+
if (IGNORED_DIRS.some((d) => path === d || path.startsWith(`${d}/`)))
|
|
42
|
+
return { class: "ignored" };
|
|
43
|
+
const implicit = implicitGenerated(path);
|
|
44
|
+
if (implicit)
|
|
45
|
+
return { class: "generated", command: implicit.command };
|
|
46
|
+
if (SEED_FILES.includes(path))
|
|
47
|
+
return { class: "seed" };
|
|
48
|
+
return { class: "owned" };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Every declared generated file of `declaration` that sits under `dir`
|
|
52
|
+
* (relative to the workspace root, `"."` for all of it), keyed by its path
|
|
53
|
+
* relative to `dir`.
|
|
54
|
+
*/
|
|
55
|
+
export function declaredFilesUnder(declaration, dir) {
|
|
56
|
+
const out = new Map();
|
|
57
|
+
for (const m of declaration.members) {
|
|
58
|
+
for (const g of m.generated) {
|
|
59
|
+
const full = m.dir === "." ? g.path : `${m.dir}/${g.path}`;
|
|
60
|
+
if (!isInside(full, dir))
|
|
61
|
+
continue;
|
|
62
|
+
out.set(dir === "." ? full : full.slice(dir.length + 1), { command: g.generator, handWritten: g.handWritten !== null });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether a workspace path (from the workspace root) is a generated file:
|
|
69
|
+
* declared in its member's `generated` entries, or one core registers. The
|
|
70
|
+
* `generated` of `graph --intent`'s region and file nodes and of `check
|
|
71
|
+
* --changes`'s paths.
|
|
72
|
+
*/
|
|
73
|
+
export function isGeneratedPath(declaration, path) {
|
|
74
|
+
const m = declaration.members.find((x) => x.name === memberHolding(path, declaration.members));
|
|
75
|
+
const dir = m?.dir ?? ".";
|
|
76
|
+
const rel = dir === "." ? path : path.slice(dir.length + 1);
|
|
77
|
+
return classifyFile(rel, declaredFilesUnder(declaration, dir)).class === "generated";
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The declared generated files for the absolute directory `absDir`, from the
|
|
81
|
+
* nearest `chant.workspace.json` above it. Empty when there is none, which is
|
|
82
|
+
* the plain-project case: only the implicit rules apply. A declaration that
|
|
83
|
+
* can't be read throws its `WorkspaceReadError`; it is never read as empty.
|
|
84
|
+
*/
|
|
85
|
+
export function declaredFilesFor(absDir) {
|
|
86
|
+
const found = findWorkspaceRoot(absDir);
|
|
87
|
+
if (!found)
|
|
88
|
+
return new Map();
|
|
89
|
+
const declaration = readDeclaration(workingTree(found.dir));
|
|
90
|
+
const rel = relative(found.dir, resolve(absDir)).split(sep).join("/");
|
|
91
|
+
return declaredFilesUnder(declaration, rel === "" ? "." : rel);
|
|
92
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expand an example group's globs to directories (ws-051).
|
|
3
|
+
*
|
|
4
|
+
* The walk goes one path segment at a time, so a glob such as
|
|
5
|
+
* `lexicons/*\/examples/*` reads only the directories it can match, never the
|
|
6
|
+
* whole tree. Within a segment, picomatch does the matching; `**` matches zero
|
|
7
|
+
* or more directories. `node_modules` and dot-directories are never entered
|
|
8
|
+
* by a wildcard, though a literal segment may name them.
|
|
9
|
+
*/
|
|
10
|
+
// @ts-ignore — picomatch has no types declaration
|
|
11
|
+
import picomatch from "picomatch";
|
|
12
|
+
import { joinPath, skippedDir } from "./tree.js";
|
|
13
|
+
const isLiteral = (segment) => !/[*?[\]{}()!+@]/.test(segment);
|
|
14
|
+
/** Every directory `glob` matches in `tree`, sorted. */
|
|
15
|
+
export function expandGlob(tree, glob) {
|
|
16
|
+
const segments = glob.split("/");
|
|
17
|
+
const matchers = segments.map((s) => s === "**" ? "**" : isLiteral(s) ? s : picomatch(s, { dot: false }));
|
|
18
|
+
const found = new Set();
|
|
19
|
+
const subdirs = (dir) => (tree.list(dir) ?? []).filter((e) => e.type === "dir" && !skippedDir(e.name)).map((e) => e.name);
|
|
20
|
+
const walk = (dir, index) => {
|
|
21
|
+
if (index === matchers.length) {
|
|
22
|
+
if (dir !== "")
|
|
23
|
+
found.add(dir);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const m = matchers[index];
|
|
27
|
+
if (m === "**") {
|
|
28
|
+
walk(dir, index + 1);
|
|
29
|
+
for (const name of subdirs(dir))
|
|
30
|
+
walk(joinPath(dir, name), index);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (typeof m === "string") {
|
|
34
|
+
const next = joinPath(dir, m);
|
|
35
|
+
if (tree.stat(next) === "dir")
|
|
36
|
+
walk(next, index + 1);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
for (const name of subdirs(dir))
|
|
40
|
+
if (m(name))
|
|
41
|
+
walk(joinPath(dir, name), index + 1);
|
|
42
|
+
};
|
|
43
|
+
walk("", 0);
|
|
44
|
+
return [...found].sort();
|
|
45
|
+
}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-member cache behind `chant workspace graph` (#2876, ws-059).
|
|
3
|
+
*
|
|
4
|
+
* ws-018 made chant the composer for declared workspaces, and a viewer
|
|
5
|
+
* rereads the composed graph on every refresh. Without a cache every read
|
|
6
|
+
* starts every member's chant again, so this module keeps each member's
|
|
7
|
+
* source read on disk and serves it while nothing the read depends on has
|
|
8
|
+
* changed.
|
|
9
|
+
*
|
|
10
|
+
* An entry is served only when every part of its key still matches:
|
|
11
|
+
*
|
|
12
|
+
* 1. The read is a source read. A member command line holding `--live`,
|
|
13
|
+
* `--overlay` or `--traffic` observes an account, which changes with
|
|
14
|
+
* nothing on disk to notice, so it is never cached or even stamped.
|
|
15
|
+
* 2. The member's stamp ({@link memberStamp}) is unchanged. It covers the
|
|
16
|
+
* member's files and the install state its toolchain resolves through.
|
|
17
|
+
* With `--at` the tree is the commit's, which never changes, so the commit
|
|
18
|
+
* id stands in for the files.
|
|
19
|
+
* 3. The toolchain is unchanged: the real path of its `bin/chant` and its
|
|
20
|
+
* package version, plus its source files when it is a checkout rather
|
|
21
|
+
* than an install.
|
|
22
|
+
* 4. The member's command line and the ambient environment are unchanged,
|
|
23
|
+
* since `--env`, build parameters and `buildParams` env mappings all
|
|
24
|
+
* reach the answer. A few variables a shell changes on its own are left
|
|
25
|
+
* out ({@link VOLATILE_ENV}); any other difference is a miss.
|
|
26
|
+
*
|
|
27
|
+
* A stamp that can't be taken caches nothing. So does a stamp that moved
|
|
28
|
+
* between the start and the end of the read, a member whose read failed, and
|
|
29
|
+
* a working-tree read whose newest file is younger than
|
|
30
|
+
* {@link FRESH_WINDOW_MS}: some file systems keep mtimes to the second, so an
|
|
31
|
+
* edit in the same tick as the read could otherwise hide behind an equal
|
|
32
|
+
* stamp.
|
|
33
|
+
*
|
|
34
|
+
* Entries live outside the workspace, in the user's cache directory
|
|
35
|
+
* ({@link graphCacheDir}), because a read never changes the workspace it
|
|
36
|
+
* reads (the conformance kit checks exactly that, #2679). One JSON file per
|
|
37
|
+
* key, written to a temporary name and renamed into place so concurrent
|
|
38
|
+
* readers never see half an entry. Each workspace holds at most
|
|
39
|
+
* {@link MAX_ENTRIES} entries and {@link MAX_BYTES} bytes; the least recently
|
|
40
|
+
* used go first.
|
|
41
|
+
*
|
|
42
|
+
* The key never looks at how a member is read, only at what the read takes
|
|
43
|
+
* in, so a member read through a generated reader project caches by its own
|
|
44
|
+
* directory's stamp like any other.
|
|
45
|
+
*/
|
|
46
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
47
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
|
|
48
|
+
import { homedir } from "node:os";
|
|
49
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
50
|
+
import { readMemberIr } from "./compose-graph.js";
|
|
51
|
+
import { memberArgv } from "./member-commands.js";
|
|
52
|
+
/** The version of the entry format. An entry of any other version is a miss. */
|
|
53
|
+
export const CACHE_FORMAT = 1;
|
|
54
|
+
/** Overrides where chant keeps caches: `$CHANT_CACHE_DIR`, else `$XDG_CACHE_HOME/chant`, else `~/.cache/chant`. */
|
|
55
|
+
export const CACHE_DIR_ENV = "CHANT_CACHE_DIR";
|
|
56
|
+
export const MAX_ENTRIES = 512;
|
|
57
|
+
export const MAX_BYTES = 128 * 1024 * 1024;
|
|
58
|
+
/** A working-tree read whose newest file is younger than this is not stored. */
|
|
59
|
+
export const FRESH_WINDOW_MS = 2000;
|
|
60
|
+
/** Member flags that make a read observe an account. Such a read is never cached. */
|
|
61
|
+
export const LIVE_FLAGS = ["--live", "--overlay", "--traffic"];
|
|
62
|
+
/** Environment variables a shell or terminal changes on its own, left out of the key. */
|
|
63
|
+
export const VOLATILE_ENV = [
|
|
64
|
+
"_",
|
|
65
|
+
"PWD",
|
|
66
|
+
"OLDPWD",
|
|
67
|
+
"SHLVL",
|
|
68
|
+
"COLUMNS",
|
|
69
|
+
"LINES",
|
|
70
|
+
"WINDOWID",
|
|
71
|
+
/^TERM/,
|
|
72
|
+
/^ITERM_/,
|
|
73
|
+
/^TMUX/,
|
|
74
|
+
/^SSH_/,
|
|
75
|
+
/^VSCODE_/,
|
|
76
|
+
/^npm_/,
|
|
77
|
+
/^VITEST/,
|
|
78
|
+
/^__/,
|
|
79
|
+
CACHE_DIR_ENV,
|
|
80
|
+
];
|
|
81
|
+
/** Directories no stamp walks into, whatever their depth. */
|
|
82
|
+
const SKIPPED = new Set(["node_modules", "dist", ".git"]);
|
|
83
|
+
/** Files, looked up from a member's directory to the file-system root, whose change means the install moved. */
|
|
84
|
+
const INSTALL_FILES = [
|
|
85
|
+
join("node_modules", ".package-lock.json"),
|
|
86
|
+
"package-lock.json",
|
|
87
|
+
"npm-shrinkwrap.json",
|
|
88
|
+
"yarn.lock",
|
|
89
|
+
"pnpm-lock.yaml",
|
|
90
|
+
"bun.lock",
|
|
91
|
+
"bun.lockb",
|
|
92
|
+
];
|
|
93
|
+
/** Whether a member command line is a source read, and so may be cached. */
|
|
94
|
+
export function isCacheableArgv(argv) {
|
|
95
|
+
return !argv.some((a) => LIVE_FLAGS.some((f) => a === f || a.startsWith(`${f}=`)));
|
|
96
|
+
}
|
|
97
|
+
function sha256(text) {
|
|
98
|
+
return createHash("sha256").update(text).digest("hex");
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Every regular file under `abs`, as `<relative path>\0<mtime ms>\0<size>`
|
|
102
|
+
* lines sorted by path. Directories named `node_modules`, `dist` or `.git`,
|
|
103
|
+
* every dot-directory, and the directories in `exclude` (relative to `abs`)
|
|
104
|
+
* are left out. Throws when the directory can't be read.
|
|
105
|
+
*/
|
|
106
|
+
function fileLines(abs, exclude) {
|
|
107
|
+
const excluded = new Set(exclude.map((e) => resolve(abs, e)));
|
|
108
|
+
const lines = [];
|
|
109
|
+
let newest = 0;
|
|
110
|
+
const walk = (at) => {
|
|
111
|
+
for (const e of readdirSync(at, { withFileTypes: true })) {
|
|
112
|
+
const path = join(at, e.name);
|
|
113
|
+
if (e.isDirectory()) {
|
|
114
|
+
if (SKIPPED.has(e.name) || e.name.startsWith(".") || excluded.has(path))
|
|
115
|
+
continue;
|
|
116
|
+
walk(path);
|
|
117
|
+
}
|
|
118
|
+
else if (e.isFile()) {
|
|
119
|
+
const st = statSync(path);
|
|
120
|
+
lines.push(`${relative(abs, path).split(sep).join("/")}\0${st.mtimeMs}\0${st.size}`);
|
|
121
|
+
if (st.mtimeMs > newest)
|
|
122
|
+
newest = st.mtimeMs;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
walk(abs);
|
|
127
|
+
lines.sort();
|
|
128
|
+
return { lines, newest };
|
|
129
|
+
}
|
|
130
|
+
/** The install files found from `abs` up to the file-system root, with their mtime and size. */
|
|
131
|
+
function installLines(abs) {
|
|
132
|
+
const lines = [];
|
|
133
|
+
for (let dir = resolve(abs);; dir = dirname(dir)) {
|
|
134
|
+
for (const name of INSTALL_FILES) {
|
|
135
|
+
const path = join(dir, name);
|
|
136
|
+
try {
|
|
137
|
+
const st = statSync(path);
|
|
138
|
+
if (st.isFile())
|
|
139
|
+
lines.push(`${path}\0${st.mtimeMs}\0${st.size}`);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// Not here.
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (dirname(dir) === dir)
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
return lines;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* A member's stamp: its files and the install state around it. `abs` is the
|
|
152
|
+
* member's directory on disk, `exclude` the directories inside it that are
|
|
153
|
+
* other members' (set for member `.`). With `at`, the commit id stands in for
|
|
154
|
+
* the files, since a commit's tree never changes. Returns `undefined` when the
|
|
155
|
+
* stamp can't be taken, and then nothing is cached.
|
|
156
|
+
*/
|
|
157
|
+
export function memberStamp(abs, exclude = [], at) {
|
|
158
|
+
try {
|
|
159
|
+
const install = installLines(abs);
|
|
160
|
+
if (at)
|
|
161
|
+
return { value: `sha256:${sha256(["at", at.commit, at.dir, ...install].join("\n"))}`, newest: 0 };
|
|
162
|
+
const { lines, newest } = fileLines(abs, exclude);
|
|
163
|
+
return { value: `sha256:${sha256(["files", ...lines, "install", ...install].join("\n"))}`, newest };
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* What distinguishes one chant from another for the key: the real path of its
|
|
171
|
+
* `bin/chant`, the version its package declares, and, for a chant that isn't
|
|
172
|
+
* installed under a `node_modules` directory (a source checkout), the stamp
|
|
173
|
+
* of its package's `src`, since a checkout changes without a version bump.
|
|
174
|
+
*/
|
|
175
|
+
export function toolchainStamp(toolchain) {
|
|
176
|
+
const pkgDir = dirname(dirname(toolchain.identity));
|
|
177
|
+
let version = "";
|
|
178
|
+
try {
|
|
179
|
+
version = String(JSON.parse(readFileSync(join(pkgDir, "package.json"), "utf-8")).version ?? "");
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// A bin outside a package: its path alone names it.
|
|
183
|
+
}
|
|
184
|
+
const installed = toolchain.identity.split(sep).includes("node_modules");
|
|
185
|
+
let source = "";
|
|
186
|
+
if (!installed && existsSync(join(pkgDir, "src"))) {
|
|
187
|
+
source = memberStamp(join(pkgDir, "src"))?.value ?? `unstamped:${Date.now()}`;
|
|
188
|
+
}
|
|
189
|
+
return `${toolchain.identity}\0${version}\0${source}`;
|
|
190
|
+
}
|
|
191
|
+
/** What a kind's reader adds to the key: its graph block, and the installed version of the package supplying it. */
|
|
192
|
+
export function readerStamp(reader) {
|
|
193
|
+
let version = "";
|
|
194
|
+
try {
|
|
195
|
+
version = String(JSON.parse(readFileSync(join(reader.packageDir, "package.json"), "utf-8")).version ?? "");
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
// An unreadable manifest keys on the directory alone.
|
|
199
|
+
}
|
|
200
|
+
return JSON.stringify([reader.lexicon, reader.config, reader.packageDir, version]);
|
|
201
|
+
}
|
|
202
|
+
/** The ambient environment, less {@link VOLATILE_ENV}, as one digest. */
|
|
203
|
+
export function environmentStamp(env = process.env) {
|
|
204
|
+
const keep = Object.keys(env)
|
|
205
|
+
.filter((k) => !VOLATILE_ENV.some((v) => (typeof v === "string" ? v === k : v.test(k))))
|
|
206
|
+
.sort();
|
|
207
|
+
return sha256(keep.map((k) => `${k}=${env[k] ?? ""}`).join("\0"));
|
|
208
|
+
}
|
|
209
|
+
export function cacheKey(parts) {
|
|
210
|
+
return sha256(JSON.stringify([CACHE_FORMAT, parts.member, parts.dir, parts.stamp, parts.toolchain, parts.argv, parts.env]));
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The directory holding the cache of the workspace rooted at `root`:
|
|
214
|
+
* `<cache dir>/workspace-graph/<first 16 hex digits of sha256(real path of root)>`,
|
|
215
|
+
* where the cache dir is `$CHANT_CACHE_DIR`, else `$XDG_CACHE_HOME/chant`,
|
|
216
|
+
* else `~/.cache/chant`.
|
|
217
|
+
*/
|
|
218
|
+
export function graphCacheDir(root, env = process.env) {
|
|
219
|
+
const base = env[CACHE_DIR_ENV] || join(env.XDG_CACHE_HOME || join(homedir(), ".cache"), "chant");
|
|
220
|
+
let real = resolve(root);
|
|
221
|
+
try {
|
|
222
|
+
real = realpathSync(real);
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
// A root that can't be resolved keys on the path as given.
|
|
226
|
+
}
|
|
227
|
+
return join(base, "workspace-graph", sha256(real).slice(0, 16));
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The cache for the workspace rooted at `root` (absolute, on disk). Nothing is
|
|
231
|
+
* created until the first `put`. Every failure to read or write is a miss or
|
|
232
|
+
* a skipped store, never an error: the cache can only make a read faster.
|
|
233
|
+
*/
|
|
234
|
+
export function openGraphCache(root, env = process.env) {
|
|
235
|
+
const dir = graphCacheDir(root, env);
|
|
236
|
+
const file = (key) => join(dir, `${key}.json`);
|
|
237
|
+
return {
|
|
238
|
+
dir,
|
|
239
|
+
get(key) {
|
|
240
|
+
try {
|
|
241
|
+
const entry = JSON.parse(readFileSync(file(key), "utf-8"));
|
|
242
|
+
if (entry.format !== CACHE_FORMAT || entry.key !== key || typeof entry.stdout !== "string")
|
|
243
|
+
return undefined;
|
|
244
|
+
const now = new Date();
|
|
245
|
+
utimesSync(file(key), now, now);
|
|
246
|
+
return entry;
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
put(entry) {
|
|
253
|
+
try {
|
|
254
|
+
mkdirSync(dir, { recursive: true });
|
|
255
|
+
const tmp = join(dir, `.${entry.key}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`);
|
|
256
|
+
writeFileSync(tmp, JSON.stringify(entry));
|
|
257
|
+
renameSync(tmp, file(entry.key));
|
|
258
|
+
prune(dir);
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
// A cache that can't be written costs the next read a run, nothing more.
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/** Drop the least recently used entries until the bounds hold. */
|
|
267
|
+
function prune(dir) {
|
|
268
|
+
const entries = readdirSync(dir)
|
|
269
|
+
.filter((n) => n.endsWith(".json") && !n.startsWith("."))
|
|
270
|
+
.map((n) => {
|
|
271
|
+
try {
|
|
272
|
+
const st = statSync(join(dir, n));
|
|
273
|
+
return { path: join(dir, n), mtime: st.mtimeMs, size: st.size };
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
.filter((e) => e !== undefined)
|
|
280
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
281
|
+
let bytes = 0;
|
|
282
|
+
entries.forEach((e, i) => {
|
|
283
|
+
bytes += e.size;
|
|
284
|
+
if (i >= MAX_ENTRIES || bytes > MAX_BYTES)
|
|
285
|
+
rmSync(e.path, { force: true });
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Look every member of a `graph` plan up in the cache. `at` is the commit
|
|
290
|
+
* being read, or null for the working tree. Members with a cacheable command
|
|
291
|
+
* line whose stamp can be taken end up in `hits` or in `pending`.
|
|
292
|
+
*/
|
|
293
|
+
export function splitCached(plan, args, cache, at, argvFor = (u) => memberArgv("graph", u, args)) {
|
|
294
|
+
const started = Date.now();
|
|
295
|
+
const env = environmentStamp();
|
|
296
|
+
const hits = [];
|
|
297
|
+
const stamps = new Map();
|
|
298
|
+
const pending = new Map();
|
|
299
|
+
for (const group of plan.groups) {
|
|
300
|
+
const tool = toolchainStamp(group.toolchain);
|
|
301
|
+
for (const unit of group.units) {
|
|
302
|
+
if (unit.group)
|
|
303
|
+
continue;
|
|
304
|
+
const argv = argvFor(unit);
|
|
305
|
+
if (!isCacheableArgv(argv))
|
|
306
|
+
continue;
|
|
307
|
+
// A member read through a generated reader project (#2874) is also keyed on
|
|
308
|
+
// the kind's graph block and the version of the package that reads it.
|
|
309
|
+
const reader = unit.reader ? readerStamp(unit.reader) : "";
|
|
310
|
+
const abs = unit.dir === "." ? plan.workspace.root : join(plan.workspace.root, ...unit.dir.split("/"));
|
|
311
|
+
const revision = at ? { commit: at, dir: unit.dir } : undefined;
|
|
312
|
+
const stamp = memberStamp(abs, unit.exclude, revision);
|
|
313
|
+
if (!stamp)
|
|
314
|
+
continue;
|
|
315
|
+
stamps.set(unit.id, stamp.value);
|
|
316
|
+
const key = cacheKey({ member: unit.member, dir: unit.dir, stamp: stamp.value, toolchain: `${tool}\0${reader}`, argv, env });
|
|
317
|
+
const entry = cache.get(key);
|
|
318
|
+
if (entry) {
|
|
319
|
+
hits.push({ unit, toolchain: group.toolchain, chant: entry.chant, mode: "member-run", id: unit.id, member: unit.member, dir: unit.dir, exclude: unit.exclude, exitCode: 0, stdout: entry.stdout, stderr: "" });
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
pending.set(unit.id, { key, stamp, abs, exclude: unit.exclude, ...(revision ? { at: revision } : {}), member: unit.member });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return { hits, stamps, pending, started };
|
|
327
|
+
}
|
|
328
|
+
/** The plan without the units in `ids`; a toolchain left with no units is dropped. */
|
|
329
|
+
export function withoutUnits(plan, ids) {
|
|
330
|
+
if (ids.size === 0)
|
|
331
|
+
return plan;
|
|
332
|
+
const groups = plan.groups.map((g) => ({ ...g, units: g.units.filter((u) => !ids.has(u.id)) })).filter((g) => g.units.length > 0);
|
|
333
|
+
return { ...plan, groups };
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Store the reads that may be cached: the member exited 0, printed an IR, and
|
|
337
|
+
* its stamp is the same after the read as before it. A working-tree read of a
|
|
338
|
+
* file younger than the window is not stored.
|
|
339
|
+
*/
|
|
340
|
+
export function storeReads(split, results, cache) {
|
|
341
|
+
for (const r of results) {
|
|
342
|
+
const p = split.pending.get(r.id);
|
|
343
|
+
if (!p || r.exitCode !== 0 || "reason" in readMemberIr(r.stdout))
|
|
344
|
+
continue;
|
|
345
|
+
if (!p.at && p.stamp.newest > split.started - FRESH_WINDOW_MS)
|
|
346
|
+
continue;
|
|
347
|
+
const after = memberStamp(p.abs, p.exclude, p.at);
|
|
348
|
+
if (!after || after.value !== p.stamp.value)
|
|
349
|
+
continue;
|
|
350
|
+
cache.put({ format: CACHE_FORMAT, key: p.key, member: p.member, stamp: p.stamp.value, chant: r.chant, stdout: r.stdout });
|
|
351
|
+
}
|
|
352
|
+
}
|