@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,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gate step's name field, and the one-version bridge for the key it used
|
|
3
|
+
* to carry (chant #2202).
|
|
4
|
+
*
|
|
5
|
+
* A gate is a fact on the gate ledger, not a channel: since #2119 nothing is
|
|
6
|
+
* running and nothing is signalled, so the field that names a gate is called
|
|
7
|
+
* `gate` — the same word `chant approve <op> <gate>` takes on the command
|
|
8
|
+
* line. It was called `signalName` through 0.58.0.
|
|
9
|
+
*
|
|
10
|
+
* `signalName` is still read, on `GateStep`, on the component `Gate` step and
|
|
11
|
+
* on the composites' gate options, and a build that sees only the old key
|
|
12
|
+
* warns once. It goes away in 0.60.0: delete this module's
|
|
13
|
+
* {@link DEPRECATED_GATE_KEY_WARNING}, {@link usesDeprecatedGateKey}, the
|
|
14
|
+
* `signalName` branch of {@link gateName}, the optional `signalName` fields
|
|
15
|
+
* that call it, and the schema's `oneOf` once that release is out, leaving
|
|
16
|
+
* `gate` as the only key.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The op name a `chant components fan-out` gate is recorded under (#2420).
|
|
20
|
+
*
|
|
21
|
+
* A fan-out is a command rather than an authored `*.op.ts`, so `chant approve`
|
|
22
|
+
* has nothing to discover for this name and must not report that as a problem.
|
|
23
|
+
* It lives here, next to the other thing that decides what a gate is called,
|
|
24
|
+
* so both the command that records the pending fact and the command that
|
|
25
|
+
* answers it read one constant instead of agreeing by hand.
|
|
26
|
+
*/
|
|
27
|
+
export const FAN_OUT_GATE_OP = "fan-out";
|
|
28
|
+
/**
|
|
29
|
+
* The op name a `chant workspace upgrade` gate is recorded under (#2550). The
|
|
30
|
+
* gate is the scope (`.` for a plain project), and it binds the digest of the
|
|
31
|
+
* upgrade's patch. Like a fan-out, the upgrade is a command with no `*.op.ts`
|
|
32
|
+
* behind it, so `chant approve` must not warn that it found none.
|
|
33
|
+
*/
|
|
34
|
+
export const WORKSPACE_UPGRADE_GATE_OP = "workspace-upgrade";
|
|
35
|
+
/**
|
|
36
|
+
* The op name the override gate records denials and overrides under (#3760):
|
|
37
|
+
* `_gates/policy-override.jsonl`, gate the subject a policy denied. Like a
|
|
38
|
+
* fan-out it has no `*.op.ts`, and an override is a person's, never a model's.
|
|
39
|
+
*/
|
|
40
|
+
export const OVERRIDE_GATE_OP = "policy-override";
|
|
41
|
+
/**
|
|
42
|
+
* The pull-request loop records its gate under `pr-<number>`, or
|
|
43
|
+
* `pr-<number>-<member>` in a workspace member (`prOp` in `pr-loop.ts`), and
|
|
44
|
+
* no `*.op.ts` stands behind that name either.
|
|
45
|
+
*/
|
|
46
|
+
const PR_GATE_OP = /^pr-\d+(?:-[a-z0-9][a-z0-9-]*)?$/;
|
|
47
|
+
/**
|
|
48
|
+
* Whether gates recorded under this op name are never resolved over MCP or ACP
|
|
49
|
+
* (chant#3485, chant#3513). These are the gate-only names MCP cannot discover:
|
|
50
|
+
* `fan-out`, `workspace-upgrade`, `policy-override` (#3760) and the
|
|
51
|
+
* pull-request gate `pr-<number>`. With
|
|
52
|
+
* no Op config to read `neverOverMcp` from, the pending record carries it.
|
|
53
|
+
*/
|
|
54
|
+
export function isNeverOverMcpGateOp(op) {
|
|
55
|
+
return op === FAN_OUT_GATE_OP || op === WORKSPACE_UPGRADE_GATE_OP || op === OVERRIDE_GATE_OP || PR_GATE_OP.test(op);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The gate's name, from whichever key carries it. One place reads the old key,
|
|
59
|
+
* so removing the bridge is a one-file edit rather than a sweep.
|
|
60
|
+
*/
|
|
61
|
+
export function gateName(step) {
|
|
62
|
+
return step.gate ?? step.signalName ?? "";
|
|
63
|
+
}
|
|
64
|
+
/** True when a step names its gate only with the deprecated key. */
|
|
65
|
+
export function usesDeprecatedGateKey(step) {
|
|
66
|
+
return step.gate === undefined && typeof step.signalName === "string";
|
|
67
|
+
}
|
|
68
|
+
/** What a build prints once when it finds a gate step still using the old key. */
|
|
69
|
+
export const DEPRECATED_GATE_KEY_WARNING = 'Gate steps still using "signalName": the key is now "gate" (chant #2202). ' +
|
|
70
|
+
'"signalName" is accepted through 0.59.0 and removed in 0.60.0.';
|
|
71
|
+
/**
|
|
72
|
+
* True when any gate step in an Op's phases (main or `onFailure`, at any
|
|
73
|
+
* nesting depth inside an `effect()`) names itself only with the deprecated
|
|
74
|
+
* key. `chant build` calls this to warn once per build.
|
|
75
|
+
*/
|
|
76
|
+
export function opUsesDeprecatedGateKey(config) {
|
|
77
|
+
const inStep = (step) => {
|
|
78
|
+
if (step.kind === "gate")
|
|
79
|
+
return usesDeprecatedGateKey(step);
|
|
80
|
+
if (step.kind === "effect")
|
|
81
|
+
return step.steps.some(inStep);
|
|
82
|
+
return false;
|
|
83
|
+
};
|
|
84
|
+
const inPhases = (phases) => (phases ?? []).some((p) => p.steps.some(inStep));
|
|
85
|
+
return inPhases(config.phases) || inPhases(config.onFailure);
|
|
86
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plan summary a gate's policy reads (#3182).
|
|
3
|
+
*
|
|
4
|
+
* A gate's Cedar request used to carry `planDigest` and whatever the Op put
|
|
5
|
+
* in `approval.context` by hand, so a rule like "deny an agent a plan that
|
|
6
|
+
* deletes a database" needed every Op to compute and pass the plan's deletes
|
|
7
|
+
* itself. A gate whose `plan` names the step that planned the change now gets
|
|
8
|
+
* `context.plan` from that step's change-set document (#3181), with no code in
|
|
9
|
+
* the Op:
|
|
10
|
+
*
|
|
11
|
+
* - `terraformPlan` returns `changeSet`, one member's part;
|
|
12
|
+
* - `lifecyclePlanChangeSet` and `readChangeSetPart` return `part`;
|
|
13
|
+
* - `composeChangeSet` returns `document`, the whole run's change set.
|
|
14
|
+
*
|
|
15
|
+
* {@link gatePlanSummary} is the summary, shaped for Cedar: flat counts
|
|
16
|
+
* (`no-op` is not a Cedar identifier), sets of names, and no nulls or floats.
|
|
17
|
+
* The cedar lexicon's `GATE_CEDAR_SCHEMA` declares it as `Chant::PlanSummary`,
|
|
18
|
+
* and its policy pack is written against it.
|
|
19
|
+
*
|
|
20
|
+
* The summary rides on the pending fact with the rest of the resolved context,
|
|
21
|
+
* so `chant approve` evaluates the policy against the plan the run produced.
|
|
22
|
+
* It comes from the same step result as the digest the gate binds, and a new
|
|
23
|
+
* plan is a new digest, so an approval never stands on a summary of another
|
|
24
|
+
* plan.
|
|
25
|
+
*
|
|
26
|
+
* Imports types only, so the module bundles without TypeScript (#3421).
|
|
27
|
+
*/
|
|
28
|
+
/** The `approval.context` key the summary lands under. An authored context may not use it. */
|
|
29
|
+
export const GATE_PLAN_CONTEXT_KEY = "plan";
|
|
30
|
+
/** How many addresses each address set carries before it is cut and {@link GatePlanSummary.truncated} is set. */
|
|
31
|
+
export const GATE_PLAN_ADDRESS_LIMIT = 500;
|
|
32
|
+
/** The attributes that hold a resource's tags or labels, read in this order. */
|
|
33
|
+
const TAG_ATTRIBUTES = ["tags", "tags_all", "labels"];
|
|
34
|
+
const isObject = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
35
|
+
function isMember(v) {
|
|
36
|
+
return isObject(v) && typeof v.member === "string";
|
|
37
|
+
}
|
|
38
|
+
function isPart(v) {
|
|
39
|
+
return isObject(v) && isMember(v.member) && Array.isArray(v.entries);
|
|
40
|
+
}
|
|
41
|
+
function isDocument(v) {
|
|
42
|
+
return isObject(v) && Array.isArray(v.members) && v.members.every(isMember) && Array.isArray(v.entries);
|
|
43
|
+
}
|
|
44
|
+
/** The members and entries a step result carries, when it carries a change set. */
|
|
45
|
+
export function changeSetOfResult(result) {
|
|
46
|
+
if (isDocument(result))
|
|
47
|
+
return result;
|
|
48
|
+
if (isPart(result))
|
|
49
|
+
return { members: [result.member], entries: result.entries };
|
|
50
|
+
if (!isObject(result))
|
|
51
|
+
return undefined;
|
|
52
|
+
if (isDocument(result.document))
|
|
53
|
+
return result.document;
|
|
54
|
+
for (const key of ["changeSet", "part"]) {
|
|
55
|
+
const part = result[key];
|
|
56
|
+
if (isPart(part))
|
|
57
|
+
return { members: [part.member], entries: part.entries };
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const CHANGES = new Set(["create", "update", "replace", "delete"]);
|
|
62
|
+
function tagKeysOf(entry) {
|
|
63
|
+
let keys;
|
|
64
|
+
for (const name of TAG_ATTRIBUTES) {
|
|
65
|
+
const attr = entry.attributes.find((a) => a.path === name);
|
|
66
|
+
if (!attr)
|
|
67
|
+
continue;
|
|
68
|
+
keys ?? (keys = new Set());
|
|
69
|
+
if (isObject(attr.after))
|
|
70
|
+
for (const k of Object.keys(attr.after))
|
|
71
|
+
keys.add(k);
|
|
72
|
+
}
|
|
73
|
+
return keys ? [...keys] : undefined;
|
|
74
|
+
}
|
|
75
|
+
function isTagOnlyUpdate(entry) {
|
|
76
|
+
return (entry.action === "update" &&
|
|
77
|
+
entry.attributes.length > 0 &&
|
|
78
|
+
entry.attributes.every((a) => TAG_ATTRIBUTES.includes(a.path)));
|
|
79
|
+
}
|
|
80
|
+
const sorted = (s) => [...s].sort();
|
|
81
|
+
/** The plan summary of a change set's members and entries. */
|
|
82
|
+
export function gatePlanSummary(changeSet) {
|
|
83
|
+
const count = { create: 0, update: 0, replace: 0, delete: 0, read: 0, "no-op": 0, forget: 0 };
|
|
84
|
+
const typesBy = { create: new Set(), update: new Set(), replace: new Set(), delete: new Set() };
|
|
85
|
+
const types = new Set();
|
|
86
|
+
const membersChanged = new Set();
|
|
87
|
+
const regions = new Set();
|
|
88
|
+
const scopes = new Set();
|
|
89
|
+
const lexicons = new Set();
|
|
90
|
+
const deleted = [];
|
|
91
|
+
const replaced = [];
|
|
92
|
+
let taggedCreates = 0;
|
|
93
|
+
let untaggedCreates = 0;
|
|
94
|
+
let createTagKeys;
|
|
95
|
+
let tagOnly = true;
|
|
96
|
+
for (const e of changeSet.entries) {
|
|
97
|
+
if (e.action in count)
|
|
98
|
+
count[e.action]++;
|
|
99
|
+
if (!CHANGES.has(e.action))
|
|
100
|
+
continue;
|
|
101
|
+
const action = e.action;
|
|
102
|
+
typesBy[action].add(e.type);
|
|
103
|
+
types.add(e.type);
|
|
104
|
+
membersChanged.add(e.member);
|
|
105
|
+
lexicons.add(e.lexicon);
|
|
106
|
+
if (e.region)
|
|
107
|
+
regions.add(e.region);
|
|
108
|
+
if (e.scope)
|
|
109
|
+
scopes.add(e.scope);
|
|
110
|
+
if (action === "delete")
|
|
111
|
+
deleted.push(e.address);
|
|
112
|
+
if (action === "replace")
|
|
113
|
+
replaced.push(e.address);
|
|
114
|
+
if (!isTagOnlyUpdate(e))
|
|
115
|
+
tagOnly = false;
|
|
116
|
+
if (action === "create") {
|
|
117
|
+
const keys = tagKeysOf(e);
|
|
118
|
+
if (keys === undefined) {
|
|
119
|
+
untaggedCreates++;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
taggedCreates++;
|
|
123
|
+
createTagKeys = createTagKeys === undefined ? new Set(keys) : new Set(keys.filter((k) => createTagKeys.has(k)));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const failedMembers = new Set(changeSet.members.filter((m) => m.status === "failed").map((m) => m.member));
|
|
128
|
+
const changes = count.create + count.update + count.replace + count.delete;
|
|
129
|
+
const cap = (list) => [...new Set(list)].sort().slice(0, GATE_PLAN_ADDRESS_LIMIT);
|
|
130
|
+
const truncated = new Set(deleted).size > GATE_PLAN_ADDRESS_LIMIT || new Set(replaced).size > GATE_PLAN_ADDRESS_LIMIT;
|
|
131
|
+
return {
|
|
132
|
+
members: sorted(new Set(changeSet.members.map((m) => m.member))),
|
|
133
|
+
membersChanged: sorted(membersChanged),
|
|
134
|
+
failedMembers: sorted(failedMembers),
|
|
135
|
+
failed: failedMembers.size,
|
|
136
|
+
holes: changeSet.members.reduce((n, m) => n + (Array.isArray(m.holes) ? m.holes.length : 0), 0),
|
|
137
|
+
entries: changeSet.entries.length,
|
|
138
|
+
changes,
|
|
139
|
+
creates: count.create,
|
|
140
|
+
updates: count.update,
|
|
141
|
+
replaces: count.replace,
|
|
142
|
+
deletes: count.delete,
|
|
143
|
+
reads: count.read,
|
|
144
|
+
noOps: count["no-op"],
|
|
145
|
+
forgets: count.forget,
|
|
146
|
+
types: sorted(types),
|
|
147
|
+
createdTypes: sorted(typesBy.create),
|
|
148
|
+
updatedTypes: sorted(typesBy.update),
|
|
149
|
+
replacedTypes: sorted(typesBy.replace),
|
|
150
|
+
deletedTypes: sorted(typesBy.delete),
|
|
151
|
+
deleted: cap(deleted),
|
|
152
|
+
replaced: cap(replaced),
|
|
153
|
+
regions: sorted(regions),
|
|
154
|
+
scopes: sorted(scopes),
|
|
155
|
+
lexicons: sorted(lexicons),
|
|
156
|
+
taggedCreates,
|
|
157
|
+
untaggedCreates,
|
|
158
|
+
createTagKeys: createTagKeys ? sorted(createTagKeys) : [],
|
|
159
|
+
tagOnly: changes > 0 && tagOnly,
|
|
160
|
+
truncated,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/** The summary of a step result, when the result carries a change set. */
|
|
164
|
+
export function gatePlanSummaryOfResult(result) {
|
|
165
|
+
const changeSet = changeSetOfResult(result);
|
|
166
|
+
return changeSet ? gatePlanSummary(changeSet) : undefined;
|
|
167
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reaching a gate that asks a declared decision point (#3170). The shape of
|
|
3
|
+
* the declaration is in `./gate-point.ts`.
|
|
4
|
+
*
|
|
5
|
+
* The run asks the point with the gate's own `gate.*` inputs (those the point
|
|
6
|
+
* declares) and the authored ones, through the `decide` activity's path
|
|
7
|
+
* (`./activities/decide.ts`), so the chain, the model's threshold, the reuse
|
|
8
|
+
* of an answer the same inputs already have and the escalation to people are
|
|
9
|
+
* the decide activity's. Then:
|
|
10
|
+
*
|
|
11
|
+
* - The question is open (escalated to people, or a model's proposal waiting
|
|
12
|
+
* for a person): the run records a pending fact on the gate ledger that
|
|
13
|
+
* cites the question, as a plain gate records one, and ends `waiting` on
|
|
14
|
+
* the question. A person answers it with `chant workspace points answer
|
|
15
|
+
* <id>` (or through hud), and the next run, or the local operator's next
|
|
16
|
+
* round, asks again and finds the answer.
|
|
17
|
+
* - It is answered with an answer the gate passes on (`pass`, default yes):
|
|
18
|
+
* the run appends a resolution to the gate ledger that cites the answer
|
|
19
|
+
* record, once per answer and plan, and walks through.
|
|
20
|
+
* - It is answered otherwise: the gate step fails, naming the record. `points
|
|
21
|
+
* retract` takes the answer back and asks people again.
|
|
22
|
+
*
|
|
23
|
+
* `chant approve` does not pass such a gate: only the point's answer does.
|
|
24
|
+
* The answer record names the gate in its `constrains` (`gate:<op>/<gate>`)
|
|
25
|
+
* and, when the point declares them, in its `gate.*` inputs.
|
|
26
|
+
*/
|
|
27
|
+
import { defaultGatePointStore, gatePointInputs } from "./gate-point.js";
|
|
28
|
+
import { isPointWait } from "./steward-points.js";
|
|
29
|
+
// The decision itself bundles without the workspace (#3816): `@intentius/chant/point-decision`.
|
|
30
|
+
export { evaluatePointGate, pointGateResumable, } from "../point-decision.js";
|
|
31
|
+
/**
|
|
32
|
+
* The real asker: the workspace that holds `cwd`. It reads the point's
|
|
33
|
+
* declared inputs from `points`, adds the `gate.*` ones the point declares,
|
|
34
|
+
* and asks through the decide activity. A point with no model decider is
|
|
35
|
+
* asked with no backends, so the run needs no `decide.backends`. A question
|
|
36
|
+
* goes where the gate's `point.store` says, and to the ledger in a CI job
|
|
37
|
+
* when it says nothing (`defaultGatePointStore`, #3815).
|
|
38
|
+
*/
|
|
39
|
+
export function workspaceGatePointAsker(cwd) {
|
|
40
|
+
return {
|
|
41
|
+
async ask(request) {
|
|
42
|
+
const { workspacePoints } = await import("../workspace/points-cli.js");
|
|
43
|
+
const doc = await workspacePoints({ cwd });
|
|
44
|
+
if ("error" in doc)
|
|
45
|
+
throw new Error(`decision point ${request.point}: ${doc.error.code}: ${doc.error.message}`);
|
|
46
|
+
const point = doc.points.find((p) => p.name === request.point);
|
|
47
|
+
if (!point) {
|
|
48
|
+
const bad = doc.sources.find((s) => s.reason);
|
|
49
|
+
throw new Error(`gate "${request.facts.name}" asks decision point ${request.point}, and no points file declares it${bad ? ` (${bad.kind}: ${bad.reason.message})` : ""}`);
|
|
50
|
+
}
|
|
51
|
+
const inputs = gatePointInputs(request.point, point.inputs.map((i) => i.name), request.facts, request.inputs);
|
|
52
|
+
const { runDecide } = await import("./activities/decide.js");
|
|
53
|
+
const asksModel = point.deciders.some((d) => d.kind === "model");
|
|
54
|
+
try {
|
|
55
|
+
const store = request.store ?? defaultGatePointStore();
|
|
56
|
+
const r = await runDecide({ point: request.point, inputs, subject: request.subject, cwd, ...(store ? { store } : {}), ...(asksModel ? {} : { backends: {} }) });
|
|
57
|
+
return { id: r.id, point: request.point, path: r.path, state: r.state, answer: r.answer, decider: r.decider, answeredBy: r.answeredBy, subject: request.subject, steward: null };
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
if (!isPointWait(err))
|
|
61
|
+
throw err;
|
|
62
|
+
const q = err.question;
|
|
63
|
+
return { id: q.id, point: q.point, path: q.path, state: q.state, answer: null, decider: "quorum", answeredBy: [], subject: q.subject, steward: q.steward };
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A gate that asks a declared decision point (#3170): the declaration's
|
|
3
|
+
* shape. What a run does when it reaches one is in `./gate-point-run.ts`.
|
|
4
|
+
*
|
|
5
|
+
* A plain gate is a pair of facts on the gate ledger: the run records a
|
|
6
|
+
* pending fact, and `chant approve` records the resolution. A gate that names
|
|
7
|
+
* a point asks it instead, the way the `decide` activity does (#2740): the
|
|
8
|
+
* point's deciders (a table, a model, people) and its quorum decide, the
|
|
9
|
+
* answer is an answer record in the workspace, and an open question is
|
|
10
|
+
* answered with `chant workspace points answer` or through hud. The run then
|
|
11
|
+
* passes the gate on that answer and writes the resolution itself, citing the
|
|
12
|
+
* record. So the gate ledger and the workspace's decision history both show
|
|
13
|
+
* the approval, and each names the other.
|
|
14
|
+
*
|
|
15
|
+
* This module imports nothing at run time, so the `gate` builder can check a
|
|
16
|
+
* declaration without loading the ledger or the workspace.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Where a gate's question goes when its `point` names no `store` (#3815): the
|
|
20
|
+
* ledger in a CI job, whose checkout is thrown away when the job ends, so the
|
|
21
|
+
* question outlives it; otherwise undefined, and `points ask`'s own rule
|
|
22
|
+
* holds (the ledger in a steward's turn, the tree otherwise). A CI job is one
|
|
23
|
+
* whose environment sets `CI`, as GitHub Actions and GitLab CI do.
|
|
24
|
+
*/
|
|
25
|
+
export function defaultGatePointStore(env = process.env) {
|
|
26
|
+
const ci = env.CI?.trim().toLowerCase();
|
|
27
|
+
return ci && ci !== "false" && ci !== "0" ? "ledger" : undefined;
|
|
28
|
+
}
|
|
29
|
+
/** The answers a gate passes on when it names none: a noul point's yes. */
|
|
30
|
+
export const DEFAULT_GATE_POINT_PASS = [true];
|
|
31
|
+
/** A gate's `point` as a {@link GatePoint}, or undefined for a plain gate. */
|
|
32
|
+
export function gatePointOf(point) {
|
|
33
|
+
if (point === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
return typeof point === "string" ? { name: point } : point;
|
|
36
|
+
}
|
|
37
|
+
const POINT_NAME = /^[a-z][a-z0-9-]*$/;
|
|
38
|
+
/** What is wrong with a gate's `point`, empty when nothing is. `withApproval` is whether the gate also declares `approval`. */
|
|
39
|
+
export function gatePointProblems(point, withApproval = false) {
|
|
40
|
+
const problems = [];
|
|
41
|
+
if (withApproval)
|
|
42
|
+
problems.push("a gate that asks a decision point takes its quorum from the point: give `approval` or `point`, not both");
|
|
43
|
+
const p = typeof point === "string" ? { name: point } : point;
|
|
44
|
+
if (p === null || typeof p !== "object" || Array.isArray(p))
|
|
45
|
+
return [...problems, "`point` is a decision point's name or { name, inputs?, pass?, store? }"];
|
|
46
|
+
const { name, inputs, pass, store, ...rest } = p;
|
|
47
|
+
if (typeof name !== "string" || !POINT_NAME.test(name))
|
|
48
|
+
problems.push("`point.name` is a decision point's name: lower case letters, digits and hyphens, starting with a letter");
|
|
49
|
+
if (inputs !== undefined && (inputs === null || typeof inputs !== "object" || Array.isArray(inputs)))
|
|
50
|
+
problems.push("`point.inputs` is an object of input name to value");
|
|
51
|
+
if (inputs && typeof inputs === "object") {
|
|
52
|
+
const own = Object.keys(inputs).filter((k) => k in GATE_POINT_INPUTS);
|
|
53
|
+
if (own.length > 0)
|
|
54
|
+
problems.push(`\`point.inputs\` gives ${own.join(", ")}, which the gate passes itself`);
|
|
55
|
+
}
|
|
56
|
+
if (pass !== undefined && (!Array.isArray(pass) || pass.length === 0 || pass.some((a) => typeof a !== "string" && typeof a !== "boolean"))) {
|
|
57
|
+
problems.push("`point.pass` is a non-empty list of the answers that pass the gate");
|
|
58
|
+
}
|
|
59
|
+
if (store !== undefined && store !== "tree" && store !== "ledger")
|
|
60
|
+
problems.push("`point.store` is tree or ledger: where the question is held");
|
|
61
|
+
const extra = Object.keys(rest);
|
|
62
|
+
if (extra.length > 0)
|
|
63
|
+
problems.push(`\`point\` takes name, inputs, pass and store, not ${extra.join(", ")}`);
|
|
64
|
+
return problems;
|
|
65
|
+
}
|
|
66
|
+
/** The `gate.*` inputs a gate passes to its point, each from a {@link GatePointFacts} field. */
|
|
67
|
+
export const GATE_POINT_INPUTS = {
|
|
68
|
+
"gate.component": "component",
|
|
69
|
+
"gate.name": "name",
|
|
70
|
+
"gate.env": "env",
|
|
71
|
+
"gate.planDigest": "planDigest",
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The inputs a gate asks its point with: the `gate.*` inputs the point
|
|
75
|
+
* declares, from `facts`, and the authored ones. A gate that binds a plan
|
|
76
|
+
* asks a point that declares `gate.planDigest`, so each plan is its own
|
|
77
|
+
* question and an answer for one plan never passes another: it throws
|
|
78
|
+
* otherwise, naming the input to declare.
|
|
79
|
+
*/
|
|
80
|
+
export function gatePointInputs(point, declared, facts, authored = {}) {
|
|
81
|
+
if (facts.planDigest !== null && !declared.includes("gate.planDigest")) {
|
|
82
|
+
throw new Error(`gate "${facts.name}" binds a plan and asks decision point ${point}, which does not declare the input gate.planDigest: ` +
|
|
83
|
+
`declare it in the points file, so each plan is its own question and an answer for one plan never passes another`);
|
|
84
|
+
}
|
|
85
|
+
const inputs = {};
|
|
86
|
+
for (const [input, field] of Object.entries(GATE_POINT_INPUTS)) {
|
|
87
|
+
if (declared.includes(input) && facts[field] !== null)
|
|
88
|
+
inputs[input] = facts[field];
|
|
89
|
+
}
|
|
90
|
+
return { ...authored, ...inputs };
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What an answer record's `constrains` names a gate by: `gate:<op>/<gate>`,
|
|
94
|
+
* with `@<env>` when the run names an environment. It is how the record
|
|
95
|
+
* names the gate ledger entry that cites it.
|
|
96
|
+
*/
|
|
97
|
+
export function gateSubject(op, gate, env) {
|
|
98
|
+
return `gate:${op}/${gate}${env ? `@${env}` : ""}`;
|
|
99
|
+
}
|
|
100
|
+
/** The gate a {@link gateSubject} names, or undefined for a subject that names none (#3835). */
|
|
101
|
+
export function parseGateSubject(subject) {
|
|
102
|
+
if (!subject || !subject.startsWith("gate:"))
|
|
103
|
+
return undefined;
|
|
104
|
+
const rest = subject.slice("gate:".length);
|
|
105
|
+
const at = rest.lastIndexOf("@");
|
|
106
|
+
const named = at > 0 ? rest.slice(0, at) : rest;
|
|
107
|
+
const slash = named.indexOf("/");
|
|
108
|
+
if (slash <= 0 || slash === named.length - 1)
|
|
109
|
+
return undefined;
|
|
110
|
+
return { op: named.slice(0, slash), gate: named.slice(slash + 1), ...(at > 0 ? { env: rest.slice(at + 1) } : {}) };
|
|
111
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a resume would start again, decided from the ledger alone (#3858).
|
|
3
|
+
*
|
|
4
|
+
* `chant run resume` starts again the CI job behind a gate an approval now
|
|
5
|
+
* answers (`./gate-resume.ts`). A product that resumes in its own job, such
|
|
6
|
+
* as terragucci's GitHub and Forgejo resume job, which applies the waves
|
|
7
|
+
* itself from wave 1 with a read-only token, needs the same decision without
|
|
8
|
+
* the forge call. {@link planGateResumes} makes it, per gate:
|
|
9
|
+
*
|
|
10
|
+
* - A standing pending fact (the newest per gate and environment, not
|
|
11
|
+
* expired) is resumable when an approval answers it, or when the decision
|
|
12
|
+
* point it cites has an answer the gate passes on. One whose answering
|
|
13
|
+
* approval a wave already applied under (`approvals.spend`,
|
|
14
|
+
* `_gates/<op>/applied.jsonl`, #3784) is `spent`: that apply ran, so there
|
|
15
|
+
* is nothing to resume, and a resumed run would only wait again.
|
|
16
|
+
* - An apply that stopped: the newest applied line of a gate carries a run
|
|
17
|
+
* locator (`resume`), no `finished` line says how it ended, and no pending
|
|
18
|
+
* fact of the gate is newer. It is resumable once the run that applied is
|
|
19
|
+
* gone, which only the forge can say: the caller checks that
|
|
20
|
+
* (`resumeGateRun` does, and `chant run resume --dry-run` asks it without
|
|
21
|
+
* starting anything). The resumed wave applies the rest under the same
|
|
22
|
+
* approval.
|
|
23
|
+
*
|
|
24
|
+
* Pure: no git, no forge, no clock, no Ajv. It imports the run locator's
|
|
25
|
+
* check, the ledger's selection rules and `pointGateResumable`, all of which
|
|
26
|
+
* bundle on their own, so a product can bundle
|
|
27
|
+
* `@intentius/chant/op/gate-resume-plan` (`gate-resume-plan-bundle.test.ts`).
|
|
28
|
+
*/
|
|
29
|
+
import { isPendingGateExpired, latestResolutionForPlan } from "../lifecycle/gate-ledger-select.js";
|
|
30
|
+
import { finishedApply, isApprovalSpent } from "../lifecycle/gate-applied.js";
|
|
31
|
+
import { samePlanDigest } from "../lifecycle/plan-digest.js";
|
|
32
|
+
import { pointGateResumable } from "../point-decision.js";
|
|
33
|
+
import { isGateRunLocator } from "./gate-run-locator.js";
|
|
34
|
+
const time = (iso) => new Date(iso).getTime();
|
|
35
|
+
/** The newest pending fact per gate and environment: the facts a run still waits on. */
|
|
36
|
+
export function standingGateFacts(pending, gate) {
|
|
37
|
+
const newest = new Map();
|
|
38
|
+
for (const p of pending) {
|
|
39
|
+
if (gate !== undefined && p.gate !== gate)
|
|
40
|
+
continue;
|
|
41
|
+
const key = `${p.gate}\u0000${p.environment ?? ""}`;
|
|
42
|
+
const prior = newest.get(key);
|
|
43
|
+
if (!prior || time(p.timestamp) >= time(prior.timestamp))
|
|
44
|
+
newest.set(key, p);
|
|
45
|
+
}
|
|
46
|
+
return [...newest.values()];
|
|
47
|
+
}
|
|
48
|
+
/** The newest approval of the fact's plan since the fact, when it has no approval block. */
|
|
49
|
+
const defaultAnswering = (resolutions, standing) => {
|
|
50
|
+
if (standing.approval)
|
|
51
|
+
return undefined;
|
|
52
|
+
const mine = resolutions.filter((r) => standing.environment === undefined || r.environment === standing.environment);
|
|
53
|
+
return latestResolutionForPlan(mine, standing.gate, standing.timestamp, standing.planDigest).resolution;
|
|
54
|
+
};
|
|
55
|
+
/** The applied line that spent an approval of `gate` and `digest` made at `approvedAt`, if one did. */
|
|
56
|
+
function spentBy(applied, gate, digest, approval) {
|
|
57
|
+
if (digest === undefined)
|
|
58
|
+
return undefined;
|
|
59
|
+
const probe = { gate, planDigest: digest, timestamp: approval.timestamp, ...(approval.review ? { review: { pr: approval.review.pr, head: approval.review.head } } : {}) };
|
|
60
|
+
if (!isApprovalSpent(applied, probe))
|
|
61
|
+
return undefined;
|
|
62
|
+
return applied.find((a) => isApprovalSpent([a], probe));
|
|
63
|
+
}
|
|
64
|
+
/** Decide, for each standing pending fact and each stopped apply of an op, whether a resume would start its job again and why. */
|
|
65
|
+
export function planGateResumes(input) {
|
|
66
|
+
const applied = input.applied ?? [];
|
|
67
|
+
const finished = input.finished ?? [];
|
|
68
|
+
const answering = input.answering ?? defaultAnswering;
|
|
69
|
+
const out = [];
|
|
70
|
+
const standing = standingGateFacts(input.pending, input.gate).filter((p) => !isPendingGateExpired(p, input.now));
|
|
71
|
+
for (const p of standing) {
|
|
72
|
+
const base = {
|
|
73
|
+
source: "pending",
|
|
74
|
+
op: p.op || input.op,
|
|
75
|
+
gate: p.gate,
|
|
76
|
+
...(p.environment !== undefined ? { environment: p.environment } : {}),
|
|
77
|
+
...(p.planDigest !== undefined ? { planDigest: p.planDigest } : {}),
|
|
78
|
+
...(isGateRunLocator(p.resume) ? { run: p.resume } : {}),
|
|
79
|
+
pending: p,
|
|
80
|
+
};
|
|
81
|
+
if (p.answer) {
|
|
82
|
+
const check = pointGateResumable(p, input.questions?.get(p.answer.id));
|
|
83
|
+
if (!check.resumable) {
|
|
84
|
+
out.push({ ...base, resumable: false, reason: "not-approved", message: check.message });
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// The resolution a wave recorded when it went through on this answer, if one did, is what an apply spends.
|
|
88
|
+
const cited = input.resolutions.filter((r) => r.gate === p.gate && r.answer?.id === p.answer.id && samePlanDigest(r.planDigest, p.planDigest));
|
|
89
|
+
const used = cited.map((r) => ({ r, by: spentBy(applied, p.gate, p.planDigest, r) })).find((x) => x.by);
|
|
90
|
+
if (used?.by) {
|
|
91
|
+
out.push({ ...base, resumable: false, reason: "spent", approvedBy: check.answeredBy, approvedAt: used.r.timestamp, message: spentMessage(used.by), spent: spentOf(used.by) });
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
out.push({ ...base, resumable: true, reason: "answered", approvedBy: check.answeredBy, ...(check.answeredOn ? { approvedAt: check.answeredOn } : {}), message: `question ${p.answer.id} has an answer the gate passes on` });
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const answer = answering(input.resolutions, p, input.pending);
|
|
98
|
+
if (!answer) {
|
|
99
|
+
out.push({ ...base, resumable: false, reason: "not-approved", message: p.approval && !input.answering ? "its gate has an approval block, which needs chant's tally (pass answering)" : "no approval answers it yet" });
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const by = spentBy(applied, p.gate, p.planDigest, answer);
|
|
103
|
+
if (by) {
|
|
104
|
+
out.push({ ...base, resumable: false, reason: "spent", approvedBy: answer.resolvedBy, approvedAt: answer.timestamp, message: spentMessage(by), spent: spentOf(by) });
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
out.push({ ...base, resumable: true, reason: "approved", approvedBy: answer.resolvedBy, approvedAt: answer.timestamp, message: `approved by ${answer.resolvedBy} at ${answer.timestamp}` });
|
|
108
|
+
}
|
|
109
|
+
for (const line of stoppedApplies(applied, finished, input.pending, input.gate)) {
|
|
110
|
+
out.push({
|
|
111
|
+
source: "stopped",
|
|
112
|
+
op: line.op || input.op,
|
|
113
|
+
gate: line.gate,
|
|
114
|
+
planDigest: line.planDigest,
|
|
115
|
+
resumable: true,
|
|
116
|
+
reason: "stopped",
|
|
117
|
+
approvedBy: line.approvedBy,
|
|
118
|
+
approvedAt: line.approvedAt,
|
|
119
|
+
run: line.resume,
|
|
120
|
+
stopped: { appliedAt: line.timestamp, approvedAt: line.approvedAt, kind: line.kind, ...(line.wave ? { wave: line.wave } : {}) },
|
|
121
|
+
message: `the apply of ${line.planDigest} under the approval by ${line.approvedBy || "?"} began at ${line.timestamp} and never recorded how it ended; it resumes once run ${line.resume.run} is gone`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return out;
|
|
125
|
+
}
|
|
126
|
+
const spentOf = (a) => ({ appliedAt: a.timestamp, approvedAt: a.approvedAt, ...(a.wave ? { wave: a.wave } : {}) });
|
|
127
|
+
const spentMessage = (a) => `the approval that answers it is spent: ${a.wave ? `wave ${a.wave.number} (${a.wave.name})` : "a wave"} applied under it at ${a.timestamp}`;
|
|
128
|
+
/**
|
|
129
|
+
* Per gate, the apply that may have stopped: the gate's newest applied line,
|
|
130
|
+
* or the line that names the same approval and carries a run locator, with
|
|
131
|
+
* no finished line for it and no pending fact of the gate since.
|
|
132
|
+
*/
|
|
133
|
+
function stoppedApplies(applied, finished, pending, gate) {
|
|
134
|
+
const newest = new Map();
|
|
135
|
+
for (const a of applied) {
|
|
136
|
+
if (gate !== undefined && a.gate !== gate)
|
|
137
|
+
continue;
|
|
138
|
+
const prior = newest.get(a.gate);
|
|
139
|
+
if (!prior || time(a.timestamp) >= time(prior.timestamp))
|
|
140
|
+
newest.set(a.gate, a);
|
|
141
|
+
}
|
|
142
|
+
const out = [];
|
|
143
|
+
for (const [g, last] of newest) {
|
|
144
|
+
const sameApply = applied.filter((a) => a.gate === g && samePlanDigest(a.planDigest, last.planDigest) && time(a.approvedAt) === time(last.approvedAt) && isGateRunLocator(a.resume));
|
|
145
|
+
const line = sameApply.reduce((n, a) => (!n || time(a.timestamp) >= time(n.timestamp) ? a : n), undefined);
|
|
146
|
+
if (!line)
|
|
147
|
+
continue;
|
|
148
|
+
if (sameApply.some((a) => finishedApply(finished, a)))
|
|
149
|
+
continue;
|
|
150
|
+
if (pending.some((p) => p.gate === g && time(p.timestamp) > time(line.timestamp)))
|
|
151
|
+
continue;
|
|
152
|
+
out.push(line);
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resume the job that waits at a gate (#3683). The forge calls,
|
|
3
|
+
* {@link resumeGateRun} and {@link resumeTokenFromEnv}, live in
|
|
4
|
+
* `../gate-resume-run.ts`, which bundles without the workspace code (#3854),
|
|
5
|
+
* and are re-exported here so `@intentius/chant/op/gate-resume` keeps working.
|
|
6
|
+
* This module adds {@link resolutionAnswering}, which decides whether an
|
|
7
|
+
* approval answers a pending fact the way a run decides the gate, and so reads
|
|
8
|
+
* `./gate`'s quorum rules.
|
|
9
|
+
*/
|
|
10
|
+
import { latestResolutionForPlan } from "../lifecycle/gate-ledger.js";
|
|
11
|
+
import { humanQuorumSince, tallyGateApprovals } from "./gate.js";
|
|
12
|
+
export { isGateRunLocator, resolveGateRunLocator, resumeGateRun, resumeTokenFromEnv, } from "../gate-resume-run.js";
|
|
13
|
+
/**
|
|
14
|
+
* The resolution that answers `standing`, read the way a run decides the gate
|
|
15
|
+
* (the plan, the environment, the quorum), or undefined. `pending` is the
|
|
16
|
+
* gate ledger's pending facts, which place the human quorum's anchor (#3206);
|
|
17
|
+
* without them it is `standing` itself. A workspace's
|
|
18
|
+
* `identity.gates` rule is not applied here: the resumed job applies it, and
|
|
19
|
+
* waits again when the approval does not count.
|
|
20
|
+
*/
|
|
21
|
+
export function resolutionAnswering(resolutions, standing, pending = [standing]) {
|
|
22
|
+
const env = standing.environment;
|
|
23
|
+
const mine = resolutions.filter((r) => env === undefined || r.environment === env);
|
|
24
|
+
if (standing.approval) {
|
|
25
|
+
const tally = tallyGateApprovals(mine, standing.gate, standing.timestamp, standing.planDigest, standing.approval, humanQuorumSince(pending, standing));
|
|
26
|
+
if (tally.permit)
|
|
27
|
+
return tally.permit;
|
|
28
|
+
return tally.counted.length >= tally.need ? tally.counted[tally.counted.length - 1] : undefined;
|
|
29
|
+
}
|
|
30
|
+
return latestResolutionForPlan(mine, standing.gate, standing.timestamp, standing.planDigest).resolution;
|
|
31
|
+
}
|