@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
|
@@ -124,15 +124,15 @@ describe("the token the tick pushes its tags with (#3573)", () => {
|
|
|
124
124
|
expect(steps[2].env.GITHUB_TOKEN).toBe("${{ github.token }}");
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
test("--token-secret checks out with the secret,
|
|
127
|
+
test("--token-secret checks out with the secret, or the Actions token where it is unset (#3624), and nothing else changes", () => {
|
|
128
128
|
const plain = renderCiGreenWorkflow(base);
|
|
129
129
|
const text = renderCiGreenWorkflow({ ...base, push: { secret: "CI_GREEN_TOKEN" } });
|
|
130
130
|
const steps = (parseYAMLDocument(text) as Yaml).jobs.tick.steps;
|
|
131
|
-
expect(steps[0]).toEqual({ uses: "actions/checkout@v6", with: { ref: "main", "fetch-depth": 0, token: "${{ secrets.CI_GREEN_TOKEN }}" } });
|
|
131
|
+
expect(steps[0]).toEqual({ uses: "actions/checkout@v6", with: { ref: "main", "fetch-depth": 0, token: "${{ secrets.CI_GREEN_TOKEN || github.token }}" } });
|
|
132
132
|
// Check runs are still read with the Actions token: a fine-grained token can't call the Checks API.
|
|
133
133
|
expect(steps[2].env.GITHUB_TOKEN).toBe("${{ github.token }}");
|
|
134
134
|
expect((parseYAMLDocument(text) as Yaml).permissions).toEqual({ contents: "write", checks: "read" });
|
|
135
|
-
expect(text.replace(" token: ${{ secrets.CI_GREEN_TOKEN }}\n", "")).toBe(plain);
|
|
135
|
+
expect(text.replace(" token: ${{ secrets.CI_GREEN_TOKEN || github.token }}\n", "")).toBe(plain);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
test("--app-id-var and --app-key-secret mint an App token before the checkout and check out with it", () => {
|
|
@@ -228,7 +228,7 @@ describe("chant ci workflow (#3573)", () => {
|
|
|
228
228
|
const withToken = readFileSync(file, "utf-8");
|
|
229
229
|
expect(withToken.split("\n")[0]).toBe(`# ${GENERATED_MARKER}. Regenerate with: chant ci workflow --token-secret CI_GREEN_TOKEN (in the workspace root)`);
|
|
230
230
|
const steps = (parseYAMLDocument(withToken) as Yaml).jobs.tick.steps;
|
|
231
|
-
expect(steps[0].with.token).toBe("${{ secrets.CI_GREEN_TOKEN }}");
|
|
231
|
+
expect(steps[0].with.token).toBe("${{ secrets.CI_GREEN_TOKEN || github.token }}");
|
|
232
232
|
expect(steps[2].env.GITHUB_TOKEN).toBe("${{ github.token }}");
|
|
233
233
|
|
|
234
234
|
const app = { args: { ciAppIdVar: "CI_GREEN_APP_ID", ciAppKeySecret: "CI_GREEN_APP_KEY" } } as unknown as CommandContext;
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
* commit whose workflow files differ from the default branch's as an update
|
|
28
28
|
* to those workflows, and the Actions token can never hold the `workflows`
|
|
29
29
|
* permission, so it is refused there. `--token-secret <NAME>` checks out
|
|
30
|
-
* with `secrets.<NAME>` instead,
|
|
30
|
+
* with `secrets.<NAME>` instead, falling back to the Actions token where the
|
|
31
|
+
* secret is unset (#3624), so a fork or a fresh clone still tags the commits
|
|
32
|
+
* that change no workflow file; and `--app-id-var <VAR> --app-key-secret
|
|
31
33
|
* <NAME>` mints a GitHub App token first and checks out with that. The
|
|
32
34
|
* tick's own `GITHUB_TOKEN`, which reads check runs, stays the Actions token:
|
|
33
35
|
* a fine-grained personal access token can't call the Checks API.
|
|
@@ -44,6 +46,7 @@ import { GENERATED_MARKER } from "../discovery/files";
|
|
|
44
46
|
import { parseYAMLDocument } from "../yaml";
|
|
45
47
|
import type { CiGreen } from "./declaration";
|
|
46
48
|
import { matchesCheckRun } from "./ci-green";
|
|
49
|
+
import { githubSecretOrJobToken } from "../ci-jobs";
|
|
47
50
|
|
|
48
51
|
/** Where the workflow goes, relative to the repository root. */
|
|
49
52
|
export const CI_GREEN_WORKFLOW_FILE = ".github/workflows/chant-ci-green.yml";
|
|
@@ -185,7 +188,7 @@ export function renderCiGreenWorkflow(input: WorkflowInput): string {
|
|
|
185
188
|
` private-key: \${{ secrets.${push.appKeySecret} }}`,
|
|
186
189
|
]
|
|
187
190
|
: [];
|
|
188
|
-
const token = !push ? [] : ["secret" in push ? ` token:
|
|
191
|
+
const token = !push ? [] : ["secret" in push ? ` token: ${githubSecretOrJobToken(push.secret)}` : " token: ${{ steps.app-token.outputs.token }}"];
|
|
189
192
|
const lines = [
|
|
190
193
|
`name: ${CI_GREEN_WORKFLOW_NAME}`,
|
|
191
194
|
"",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #3888: the principals file read by hand, for the gate-decision bundle,
|
|
3
|
+
* accepts and refuses what chant's ajv-checked `parseClassData` does.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from "vitest";
|
|
7
|
+
import { classDataShapeProblems, parseClassDataByHand } from "./class-data";
|
|
8
|
+
import { parseClassData } from "./principal-classes";
|
|
9
|
+
|
|
10
|
+
const ok = { name: "operator", description: "people who apply infrastructure", role: "ops" };
|
|
11
|
+
|
|
12
|
+
const FILES: unknown[] = [
|
|
13
|
+
{ schema: 1, classes: [ok] },
|
|
14
|
+
{ $schema: "x", $comment: "y", "x-note": 3, schema: 1, classes: [{ ...ok, "x-extra": true }] },
|
|
15
|
+
{ schema: 1, classes: [ok, { name: "reviewer", description: "r", role: "reviewer" }] },
|
|
16
|
+
{ schema: 1, classes: [ok, { ...ok, role: "other" }] },
|
|
17
|
+
{ schema: 1, classes: [{ ...ok, name: "agent" }] },
|
|
18
|
+
{ schema: 1, classes: [{ ...ok, role: "runner" }] },
|
|
19
|
+
{ schema: 1, classes: [ok, { ...ok, name: "other" }] },
|
|
20
|
+
{ schema: 2, classes: [ok] },
|
|
21
|
+
{ schema: "1", classes: [ok] },
|
|
22
|
+
{ classes: [ok] },
|
|
23
|
+
{ schema: 1 },
|
|
24
|
+
{ schema: 1, classes: [] },
|
|
25
|
+
{ schema: 1, classes: {} },
|
|
26
|
+
{ schema: 1, classes: [ok], extra: 1 },
|
|
27
|
+
{ $schema: 3, schema: 1, classes: [ok] },
|
|
28
|
+
{ $comment: null, schema: 1, classes: [ok] },
|
|
29
|
+
{ schema: 1, classes: [{ ...ok, other: 1 }] },
|
|
30
|
+
{ schema: 1, classes: [{ name: ok.name, role: ok.role }] },
|
|
31
|
+
{ schema: 1, classes: [{ name: ok.name, description: ok.description }] },
|
|
32
|
+
{ schema: 1, classes: [{ description: ok.description, role: ok.role }] },
|
|
33
|
+
{ schema: 1, classes: [{ ...ok, name: "Operator" }] },
|
|
34
|
+
{ schema: 1, classes: [{ ...ok, name: "x-operator" }] },
|
|
35
|
+
{ schema: 1, classes: [{ ...ok, name: "a".repeat(40) }] },
|
|
36
|
+
{ schema: 1, classes: [{ ...ok, name: "a".repeat(41) }] },
|
|
37
|
+
{ schema: 1, classes: [{ ...ok, name: "1op" }] },
|
|
38
|
+
{ schema: 1, classes: [{ ...ok, name: 7 }] },
|
|
39
|
+
{ schema: 1, classes: [{ ...ok, description: "" }] },
|
|
40
|
+
{ schema: 1, classes: [{ ...ok, description: 1 }] },
|
|
41
|
+
{ schema: 1, classes: [{ ...ok, role: "Ops" }] },
|
|
42
|
+
{ schema: 1, classes: [{ ...ok, role: "ops role" }] },
|
|
43
|
+
{ schema: 1, classes: [{ ...ok, role: "op-s2" }] },
|
|
44
|
+
{ schema: 1, classes: [null] },
|
|
45
|
+
{ schema: 1, classes: ["operator"] },
|
|
46
|
+
[],
|
|
47
|
+
null,
|
|
48
|
+
"text",
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
describe("the principals file read without ajv", () => {
|
|
52
|
+
test.each(FILES.map((f) => [JSON.stringify(f), f]))("%s reads to the classes ajv's check gives", (_, file) => {
|
|
53
|
+
const text = JSON.stringify(file);
|
|
54
|
+
const byAjv = parseClassData(text, "@acme/p");
|
|
55
|
+
const byHand = parseClassDataByHand(text, "@acme/p");
|
|
56
|
+
expect(byHand.classes).toEqual(byAjv.classes);
|
|
57
|
+
expect(byHand.problems.length > 0).toBe(byAjv.problems.length > 0);
|
|
58
|
+
expect(classDataShapeProblems(file, "@acme/p").length === 0).toBe(byAjv.classes.length > 0 || byAjv.problems.every((p) => /core|twice|another class/.test(p)));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("text that is not JSON", () => {
|
|
62
|
+
expect(parseClassDataByHand("{", "@acme/p")).toEqual(parseClassData("{", "@acme/p"));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the principal classes a pinned package supplies, without ajv or
|
|
3
|
+
* any package code (#3888).
|
|
4
|
+
*
|
|
5
|
+
* `./principal-classes.ts` reads a package's `./workspace-principals` file
|
|
6
|
+
* for chant, validating it with ajv against
|
|
7
|
+
* `workspace-principals.schema.json`. `@intentius/chant/gate-decision` reads
|
|
8
|
+
* the same files from a bare clone and must bundle without ajv, so the rules
|
|
9
|
+
* both share live here: where a package's export points, where an installed
|
|
10
|
+
* package is, what a file must hold beyond its schema, and how classes from
|
|
11
|
+
* several pins merge. {@link classDataShapeProblems} is the schema written
|
|
12
|
+
* out by hand for the bundle; `class-data.test.ts` holds it to ajv's answer.
|
|
13
|
+
*
|
|
14
|
+
* The module imports node:fs and node:path and nothing else.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
18
|
+
import { dirname, join, posix, resolve } from "node:path";
|
|
19
|
+
import { CORE_CLASSES, CORE_PRINCIPAL_CLASSES, type PrincipalClass } from "./identity-gate-rule";
|
|
20
|
+
|
|
21
|
+
/** The subpath a package publishes its principal classes at. */
|
|
22
|
+
export const PRINCIPALS_SUBPATH = "./workspace-principals";
|
|
23
|
+
|
|
24
|
+
export interface ClassData {
|
|
25
|
+
classes: PrincipalClass[];
|
|
26
|
+
/** Why some of the data can't be used, one line each. Empty when all of it can. */
|
|
27
|
+
problems: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A package's files, by a `/`-separated path inside it, or undefined when one is not there. */
|
|
31
|
+
export type PackageFiles = (path: string) => string | undefined;
|
|
32
|
+
|
|
33
|
+
/** A package directory on disk. */
|
|
34
|
+
export function diskFiles(dir: string): PackageFiles {
|
|
35
|
+
return (path) => {
|
|
36
|
+
try {
|
|
37
|
+
return readFileSync(join(dir, ...path.split("/")), "utf-8");
|
|
38
|
+
} catch {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The directory of an installed package `name`, found the way Node finds a
|
|
46
|
+
* bare import: `node_modules/<name>` in `fromDir` and each directory above it.
|
|
47
|
+
* It looks for the directory, not for an entry point, so it works for a
|
|
48
|
+
* package whose `exports` don't expose `package.json`.
|
|
49
|
+
*/
|
|
50
|
+
export function findInstalledPackage(name: string, fromDir: string): string | undefined {
|
|
51
|
+
for (let dir = resolve(fromDir); ; dir = dirname(dir)) {
|
|
52
|
+
const candidate = join(dir, "node_modules", ...name.split("/"));
|
|
53
|
+
try {
|
|
54
|
+
if (statSync(candidate).isDirectory() && existsSync(join(candidate, "package.json"))) return candidate;
|
|
55
|
+
} catch {
|
|
56
|
+
// Not here; keep walking.
|
|
57
|
+
}
|
|
58
|
+
if (dirname(dir) === dir) return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The file a package's `exports[subpath]` names: undefined when it names
|
|
64
|
+
* none, a problem when it is not one `.json` file inside the package.
|
|
65
|
+
*/
|
|
66
|
+
export function dataExportTarget(pkg: Record<string, unknown>, subpath: string): string | undefined | { problem: string } {
|
|
67
|
+
const exports = pkg.exports;
|
|
68
|
+
if (!exports || typeof exports !== "object" || Array.isArray(exports)) return undefined;
|
|
69
|
+
const entry = (exports as Record<string, unknown>)[subpath];
|
|
70
|
+
if (entry === undefined) return undefined;
|
|
71
|
+
let target: unknown = entry;
|
|
72
|
+
if (target && typeof target === "object" && !Array.isArray(target)) {
|
|
73
|
+
const conditions = target as Record<string, unknown>;
|
|
74
|
+
target = conditions.default ?? conditions.import ?? conditions.require;
|
|
75
|
+
}
|
|
76
|
+
if (typeof target !== "string") {
|
|
77
|
+
return { problem: `exports["${subpath}"] must name one file, as a string or a "default" condition` };
|
|
78
|
+
}
|
|
79
|
+
if (!target.startsWith("./") || !target.endsWith(".json")) {
|
|
80
|
+
return { problem: `exports["${subpath}"] is ${target}; it must name a .json file inside the package, since chant reads plugin data as data and never runs a package's code` };
|
|
81
|
+
}
|
|
82
|
+
return target;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ── The file ─────────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
const NAME = /^(?!x-)[a-z][a-z0-9-]{0,39}$/u;
|
|
88
|
+
const ROLE = /^[a-z][a-z0-9-]*$/u;
|
|
89
|
+
const isObject = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
90
|
+
const extra = (key: string, known: readonly string[]) => !known.includes(key) && !key.startsWith("x-");
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* What `workspace-principals.schema.json` refuses in `raw`, one line each,
|
|
94
|
+
* written out by hand so the gate-decision bundle needs no ajv. Empty when
|
|
95
|
+
* the schema accepts it.
|
|
96
|
+
*/
|
|
97
|
+
export function classDataShapeProblems(raw: unknown, source: string): string[] {
|
|
98
|
+
const p: string[] = [];
|
|
99
|
+
const say = (where: string, what: string) => p.push(`${source}: ${where || "the principals file"} ${what}`);
|
|
100
|
+
if (!isObject(raw)) {
|
|
101
|
+
say("", "must be object");
|
|
102
|
+
return p;
|
|
103
|
+
}
|
|
104
|
+
for (const key of Object.keys(raw)) if (extra(key, ["$schema", "$comment", "schema", "classes"])) say("", `must NOT have additional property ${key}`);
|
|
105
|
+
for (const key of ["$schema", "$comment"]) if (key in raw && typeof raw[key] !== "string") say(`/${key}`, "must be string");
|
|
106
|
+
if (!("schema" in raw)) say("", "must have required property 'schema'");
|
|
107
|
+
else if (raw.schema !== 1) say("/schema", "must be equal to constant 1");
|
|
108
|
+
if (!("classes" in raw)) say("", "must have required property 'classes'");
|
|
109
|
+
else if (!Array.isArray(raw.classes)) say("/classes", "must be array");
|
|
110
|
+
else {
|
|
111
|
+
if (raw.classes.length < 1) say("/classes", "must NOT have fewer than 1 items");
|
|
112
|
+
raw.classes.forEach((c: unknown, i: number) => {
|
|
113
|
+
const at = `/classes/${i}`;
|
|
114
|
+
if (!isObject(c)) return say(at, "must be object");
|
|
115
|
+
for (const key of Object.keys(c)) if (extra(key, ["name", "description", "role"])) say(at, `must NOT have additional property ${key}`);
|
|
116
|
+
for (const key of ["name", "description", "role"]) if (!(key in c)) say(at, `must have required property '${key}'`);
|
|
117
|
+
if ("name" in c && (typeof c.name !== "string" || !NAME.test(c.name))) say(`${at}/name`, "must be a class name");
|
|
118
|
+
if ("description" in c && (typeof c.description !== "string" || [...c.description].length < 1)) say(`${at}/description`, "must be a non-empty string");
|
|
119
|
+
if ("role" in c && (typeof c.role !== "string" || !ROLE.test(c.role))) say(`${at}/role`, "must be a role name");
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return [...new Set(p)];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const CORE_ROLES = new Set(CORE_CLASSES.map((c) => c.role).filter((r): r is string => r !== null));
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The classes in a principals file the schema accepts, under the rules the
|
|
129
|
+
* schema can't say: no core name or core role, and no name or role twice.
|
|
130
|
+
* `source` names the pin in the classes and in the messages.
|
|
131
|
+
*/
|
|
132
|
+
export function checkClassData(valid: { classes: { name: string; description: string; role: string }[] }, source: string): ClassData {
|
|
133
|
+
const problems: string[] = [];
|
|
134
|
+
const classes: PrincipalClass[] = [];
|
|
135
|
+
const names = new Set<string>();
|
|
136
|
+
const roles = new Set<string>();
|
|
137
|
+
for (const c of valid.classes) {
|
|
138
|
+
if ((CORE_PRINCIPAL_CLASSES as readonly string[]).includes(c.name)) {
|
|
139
|
+
problems.push(`${source}: class ${c.name} is a core class and can't be supplied by a package`);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (CORE_ROLES.has(c.role)) {
|
|
143
|
+
problems.push(`${source}: class ${c.name} names the role ${c.role}, which puts a principal in the core ${c.role} class`);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (names.has(c.name)) {
|
|
147
|
+
problems.push(`${source}: class ${c.name} is listed twice`);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (roles.has(c.role)) {
|
|
151
|
+
problems.push(`${source}: class ${c.name} names the role ${c.role}, which another class in the file names; a role puts a principal in one class`);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
names.add(c.name);
|
|
155
|
+
roles.add(c.role);
|
|
156
|
+
classes.push({ name: c.name, description: c.description, role: c.role, source });
|
|
157
|
+
}
|
|
158
|
+
return { classes, problems };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** A principals file's text read with {@link classDataShapeProblems} for the schema: what chant's ajv-checked `parseClassData` reads, by the same rules. */
|
|
162
|
+
export function parseClassDataByHand(text: string, source: string): ClassData {
|
|
163
|
+
let raw: unknown;
|
|
164
|
+
try {
|
|
165
|
+
raw = JSON.parse(text);
|
|
166
|
+
} catch (err) {
|
|
167
|
+
return { classes: [], problems: [`${source}: the principals file is not JSON (${(err as Error).message})`] };
|
|
168
|
+
}
|
|
169
|
+
const problems = classDataShapeProblems(raw, source);
|
|
170
|
+
return problems.length > 0 ? { classes: [], problems } : checkClassData(raw as Parameters<typeof checkClassData>[0], source);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Read the classes a package publishes at `./workspace-principals` through `files`, checking the file with `parse`. Imports nothing. A package that publishes none supplies none. */
|
|
174
|
+
export function readClassFiles(files: PackageFiles, source: string, parse: (text: string, source: string) => ClassData): ClassData {
|
|
175
|
+
const manifest = files("package.json");
|
|
176
|
+
if (manifest === undefined) return { classes: [], problems: [`${source}: no readable package.json`] };
|
|
177
|
+
let pkg: Record<string, unknown>;
|
|
178
|
+
try {
|
|
179
|
+
pkg = JSON.parse(manifest) as Record<string, unknown>;
|
|
180
|
+
} catch {
|
|
181
|
+
return { classes: [], problems: [`${source}: package.json is not JSON`] };
|
|
182
|
+
}
|
|
183
|
+
const target = dataExportTarget(pkg, PRINCIPALS_SUBPATH);
|
|
184
|
+
if (target === undefined) return { classes: [], problems: [] };
|
|
185
|
+
if (typeof target !== "string") return { classes: [], problems: [`${source}: ${target.problem}`] };
|
|
186
|
+
const inside = posix.normalize(target.slice(2));
|
|
187
|
+
if (inside.startsWith("../") || inside === "..") return { classes: [], problems: [`${source}: exports["${PRINCIPALS_SUBPATH}"] points outside the package`] };
|
|
188
|
+
const text = files(inside);
|
|
189
|
+
if (text === undefined) return { classes: [], problems: [`${source}: exports["${PRINCIPALS_SUBPATH}"] names ${target}, which does not exist`] };
|
|
190
|
+
return parse(text, source);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** One pin's classes, as read. */
|
|
194
|
+
export interface PinClassRead {
|
|
195
|
+
/** The pin's index in the declaration's `pins`. */
|
|
196
|
+
pin: number;
|
|
197
|
+
source: string;
|
|
198
|
+
read: ClassData;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The domain classes of every pin, in pin order and file order. A class
|
|
203
|
+
* name, or a role, two pins both supply is a problem, and every class
|
|
204
|
+
* involved is left out, so a rule naming it reads it as unknown and fails
|
|
205
|
+
* closed.
|
|
206
|
+
*/
|
|
207
|
+
export function mergePinClasses(reads: readonly PinClassRead[]): { classes: PrincipalClass[]; problems: { pin: number; message: string }[] } {
|
|
208
|
+
const problems: { pin: number; message: string }[] = [];
|
|
209
|
+
const extra: PrincipalClass[] = [];
|
|
210
|
+
const byName = new Map<string, string>();
|
|
211
|
+
const byRole = new Map<string, string>();
|
|
212
|
+
const clashing = new Set<string>();
|
|
213
|
+
for (const { pin: i, source, read } of reads) {
|
|
214
|
+
for (const p of read.problems) problems.push({ pin: i, message: p });
|
|
215
|
+
for (const c of read.classes) {
|
|
216
|
+
const named = byName.get(c.name);
|
|
217
|
+
const roled = byRole.get(c.role!);
|
|
218
|
+
if (named !== undefined || roled !== undefined) {
|
|
219
|
+
clashing.add(c.name);
|
|
220
|
+
if (named !== undefined) {
|
|
221
|
+
problems.push({ pin: i, message: `class ${c.name} is supplied by both ${named} and ${source}; a class name has one source` });
|
|
222
|
+
} else {
|
|
223
|
+
const other = extra.find((e) => e.role === c.role)!;
|
|
224
|
+
clashing.add(other.name);
|
|
225
|
+
problems.push({ pin: i, message: `class ${c.name} (${source}) names the role ${c.role}, which class ${other.name} (${roled}) names; a role puts a principal in one class` });
|
|
226
|
+
}
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
byName.set(c.name, source);
|
|
230
|
+
byRole.set(c.role!, source);
|
|
231
|
+
extra.push(c);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// A name or role two pins both supply is left out altogether: neither reading is safe.
|
|
235
|
+
return { classes: extra.filter((c) => !clashing.has(c.name)), problems };
|
|
236
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { readFileSync } from "node:fs";
|
|
20
20
|
import { createRequire } from "node:module";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
|
-
import schema from "./declaration.schema.json";
|
|
22
|
+
import schema from "./declaration.schema.json" with { type: "json" };
|
|
23
23
|
import { expandGlob } from "./glob";
|
|
24
24
|
import { EXAMPLES_KIND, holdsChantProject } from "./kinds";
|
|
25
25
|
import { parseJsonText, pointerToken, type TextLocation } from "./jsonc";
|
package/src/workspace/kinds.ts
CHANGED
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
* fails ({@link resolveKind}).
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
21
21
|
import { createRequire } from "node:module";
|
|
22
|
-
import {
|
|
23
|
-
import schema from "./workspace-kinds.schema.json";
|
|
22
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
23
|
+
import schema from "./workspace-kinds.schema.json" with { type: "json" };
|
|
24
24
|
import type { WorkspaceTree } from "./tree";
|
|
25
25
|
import { joinPath, skippedDir } from "./tree";
|
|
26
26
|
import { checkPinIntegrity } from "./pin-integrity";
|
|
27
|
+
import { dataExportTarget, findInstalledPackage } from "./class-data";
|
|
27
28
|
|
|
28
29
|
export const KINDS_SCHEMA_ID = schema.$id;
|
|
29
30
|
|
|
@@ -428,22 +429,7 @@ export interface PackageKinds extends KindData {
|
|
|
428
429
|
* subpath to code, which chant never runs for plugin data.
|
|
429
430
|
*/
|
|
430
431
|
export function kindsExportTarget(pkg: Record<string, unknown>, subpath: string = KINDS_SUBPATH): string | undefined | { problem: string } {
|
|
431
|
-
|
|
432
|
-
if (!exports || typeof exports !== "object" || Array.isArray(exports)) return undefined;
|
|
433
|
-
const entry = (exports as Record<string, unknown>)[subpath];
|
|
434
|
-
if (entry === undefined) return undefined;
|
|
435
|
-
let target: unknown = entry;
|
|
436
|
-
if (target && typeof target === "object" && !Array.isArray(target)) {
|
|
437
|
-
const conditions = target as Record<string, unknown>;
|
|
438
|
-
target = conditions.default ?? conditions.import ?? conditions.require;
|
|
439
|
-
}
|
|
440
|
-
if (typeof target !== "string") {
|
|
441
|
-
return { problem: `exports["${subpath}"] must name one file, as a string or a "default" condition` };
|
|
442
|
-
}
|
|
443
|
-
if (!target.startsWith("./") || !target.endsWith(".json")) {
|
|
444
|
-
return { problem: `exports["${subpath}"] is ${target}; it must name a .json file inside the package, since chant reads plugin data as data and never runs a package's code` };
|
|
445
|
-
}
|
|
446
|
-
return target;
|
|
432
|
+
return dataExportTarget(pkg, subpath);
|
|
447
433
|
}
|
|
448
434
|
|
|
449
435
|
/** Read the kinds a package directory publishes. Reads files only; imports nothing. */
|
|
@@ -515,23 +501,8 @@ export function substituteGraphConfig(config: Record<string, unknown>, at: Graph
|
|
|
515
501
|
return walk(config) as Record<string, unknown>;
|
|
516
502
|
}
|
|
517
503
|
|
|
518
|
-
/**
|
|
519
|
-
|
|
520
|
-
* bare import: `node_modules/<name>` in `fromDir` and each directory above it.
|
|
521
|
-
* It looks for the directory, not for an entry point, so it works for a
|
|
522
|
-
* package whose `exports` don't expose `package.json`.
|
|
523
|
-
*/
|
|
524
|
-
export function findInstalledPackage(name: string, fromDir: string): string | undefined {
|
|
525
|
-
for (let dir = resolve(fromDir); ; dir = dirname(dir)) {
|
|
526
|
-
const candidate = join(dir, "node_modules", ...name.split("/"));
|
|
527
|
-
try {
|
|
528
|
-
if (statSync(candidate).isDirectory() && existsSync(join(candidate, "package.json"))) return candidate;
|
|
529
|
-
} catch {
|
|
530
|
-
// Not here; keep walking.
|
|
531
|
-
}
|
|
532
|
-
if (dirname(dir) === dir) return undefined;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
504
|
+
/** Where an installed package is, as Node finds a bare import (`./class-data.ts`, so the gate-decision bundle shares it). */
|
|
505
|
+
export { findInstalledPackage };
|
|
535
506
|
|
|
536
507
|
export interface PinLike {
|
|
537
508
|
package: string | null;
|
|
@@ -25,6 +25,7 @@ import { pathToFileURL } from "node:url";
|
|
|
25
25
|
import { z } from "zod";
|
|
26
26
|
import { LockError, type Lineage } from "./lineage-lock";
|
|
27
27
|
import { compareVersions, formatVersion, parseVersion, satisfies, validateRange, VersionRangeError, type Version } from "./lineage-version";
|
|
28
|
+
import { ensureTypeScriptLoader } from "../ts-loader";
|
|
28
29
|
|
|
29
30
|
/** Where a template keeps its migrations, relative to the template's directory. */
|
|
30
31
|
export const MIGRATIONS_DIR = ".chant/migrations";
|
|
@@ -281,6 +282,7 @@ export async function runMigration(m: LoadedMigration, opts: RunMigrationOptions
|
|
|
281
282
|
mkdirSync(dirname(abs), { recursive: true });
|
|
282
283
|
writeFileSync(abs, data);
|
|
283
284
|
}
|
|
285
|
+
ensureTypeScriptLoader();
|
|
284
286
|
const mod = (await import(pathToFileURL(file).href)) as { default?: unknown };
|
|
285
287
|
if (typeof mod.default !== "function") throw new MigrationError(`${migration.id}: ${body.module} has no default export function`);
|
|
286
288
|
await (mod.default as (ctx: { dir: string }) => unknown)({ dir: opts.dir });
|
package/src/workspace/points.ts
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
import { createHash } from "node:crypto";
|
|
36
36
|
import { createRequire } from "node:module";
|
|
37
37
|
import { dirname, posix, relative, resolve, sep } from "node:path";
|
|
38
|
-
import schema from "./decision-points.schema.json";
|
|
38
|
+
import schema from "./decision-points.schema.json" with { type: "json" };
|
|
39
39
|
import type { ReasonCode } from "./reason-codes";
|
|
40
40
|
import type { RecordSource } from "./record-source";
|
|
41
41
|
import type { LoadedRecordKind, ReadRecordsOptions, RecordEntry } from "./records";
|
|
@@ -22,19 +22,17 @@
|
|
|
22
22
|
* installed package, which must be at the version the base pins.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { readFileSync } from "node:fs";
|
|
26
25
|
import { createRequire } from "node:module";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import schema from "./workspace-principals.schema.json";
|
|
26
|
+
import { checkClassData, diskFiles, mergePinClasses, readClassFiles, type ClassData, type PackageFiles, type PinClassRead } from "./class-data";
|
|
27
|
+
import { pinnedPackageDir, type KindLoadProblem, type PinLike } from "./kinds";
|
|
28
|
+
import schema from "./workspace-principals.schema.json" with { type: "json" };
|
|
30
29
|
import type { TrustPolicy } from "./trust/policy";
|
|
31
30
|
import { joinPath, type WorkspaceTree } from "./tree";
|
|
32
31
|
import { CORE_CLASSES, CORE_PRINCIPAL_CLASSES, grantedClasses, type PrincipalClass } from "./identity-gate-rule";
|
|
33
32
|
|
|
34
33
|
export const PRINCIPALS_SCHEMA_ID = schema.$id;
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
export const PRINCIPALS_SUBPATH = "./workspace-principals";
|
|
35
|
+
export { PRINCIPALS_SUBPATH } from "./class-data";
|
|
38
36
|
|
|
39
37
|
export { CORE_CLASSES, CORE_PRINCIPAL_CLASSES, type CorePrincipalClass, type PrincipalClass } from "./identity-gate-rule";
|
|
40
38
|
|
|
@@ -44,8 +42,6 @@ export type PrincipalClassName = string;
|
|
|
44
42
|
/** The grammar of a class name, as `workspace-principals.schema.json` and the declaration's writeScope keys say it. */
|
|
45
43
|
export const CLASS_NAME = /^(?!x-)[a-z][a-z0-9-]{0,39}$/;
|
|
46
44
|
|
|
47
|
-
const CORE_ROLES = new Set(CORE_CLASSES.map((c) => c.role).filter((r): r is string => r !== null));
|
|
48
|
-
|
|
49
45
|
export interface ClassRegistry {
|
|
50
46
|
get(name: string): PrincipalClass | undefined;
|
|
51
47
|
/** Every class name, core first, for "unknown class" messages. */
|
|
@@ -111,11 +107,8 @@ function validator(): Validate {
|
|
|
111
107
|
return compiled;
|
|
112
108
|
}
|
|
113
109
|
|
|
114
|
-
export
|
|
115
|
-
|
|
116
|
-
/** Why some of the data can't be used, one line each. Empty when all of it can. */
|
|
117
|
-
problems: string[];
|
|
118
|
-
}
|
|
110
|
+
export type { ClassData, PackageFiles } from "./class-data";
|
|
111
|
+
export { diskFiles } from "./class-data";
|
|
119
112
|
|
|
120
113
|
/**
|
|
121
114
|
* Check the text of a principals file against
|
|
@@ -135,46 +128,7 @@ export function parseClassData(text: string, source: string): ClassData {
|
|
|
135
128
|
const problems = (validate.errors ?? []).map((e) => `${source}: ${e.instancePath || "the principals file"} ${e.message ?? "is invalid"}`);
|
|
136
129
|
return { classes: [], problems: [...new Set(problems)] };
|
|
137
130
|
}
|
|
138
|
-
|
|
139
|
-
const classes: PrincipalClass[] = [];
|
|
140
|
-
const names = new Set<string>();
|
|
141
|
-
const roles = new Set<string>();
|
|
142
|
-
for (const c of (raw as { classes: { name: string; description: string; role: string }[] }).classes) {
|
|
143
|
-
if ((CORE_PRINCIPAL_CLASSES as readonly string[]).includes(c.name)) {
|
|
144
|
-
problems.push(`${source}: class ${c.name} is a core class and can't be supplied by a package`);
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
if (CORE_ROLES.has(c.role)) {
|
|
148
|
-
problems.push(`${source}: class ${c.name} names the role ${c.role}, which puts a principal in the core ${c.role} class`);
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
if (names.has(c.name)) {
|
|
152
|
-
problems.push(`${source}: class ${c.name} is listed twice`);
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
if (roles.has(c.role)) {
|
|
156
|
-
problems.push(`${source}: class ${c.name} names the role ${c.role}, which another class in the file names; a role puts a principal in one class`);
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
names.add(c.name);
|
|
160
|
-
roles.add(c.role);
|
|
161
|
-
classes.push({ name: c.name, description: c.description, role: c.role, source });
|
|
162
|
-
}
|
|
163
|
-
return { classes, problems };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/** A package's files, by a `/`-separated path inside it, or undefined when one is not there. */
|
|
167
|
-
export type PackageFiles = (path: string) => string | undefined;
|
|
168
|
-
|
|
169
|
-
/** A package directory on disk. */
|
|
170
|
-
export function diskFiles(dir: string): PackageFiles {
|
|
171
|
-
return (path) => {
|
|
172
|
-
try {
|
|
173
|
-
return readFileSync(join(dir, ...path.split("/")), "utf-8");
|
|
174
|
-
} catch {
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
131
|
+
return checkClassData(raw as Parameters<typeof checkClassData>[0], source);
|
|
178
132
|
}
|
|
179
133
|
|
|
180
134
|
/** A package directory at `dir` in `tree`, such as the workspace at the base revision. */
|
|
@@ -192,22 +146,7 @@ export function treeFiles(tree: WorkspaceTree, dir: string): PackageFiles {
|
|
|
192
146
|
|
|
193
147
|
/** Read the classes a package publishes at `./workspace-principals`. Reads files only; imports nothing. A package that publishes none supplies none. */
|
|
194
148
|
export function readPackageClasses(files: PackageFiles, source: string): ClassData {
|
|
195
|
-
|
|
196
|
-
if (manifest === undefined) return { classes: [], problems: [`${source}: no readable package.json`] };
|
|
197
|
-
let pkg: Record<string, unknown>;
|
|
198
|
-
try {
|
|
199
|
-
pkg = JSON.parse(manifest) as Record<string, unknown>;
|
|
200
|
-
} catch {
|
|
201
|
-
return { classes: [], problems: [`${source}: package.json is not JSON`] };
|
|
202
|
-
}
|
|
203
|
-
const target = kindsExportTarget(pkg, PRINCIPALS_SUBPATH);
|
|
204
|
-
if (target === undefined) return { classes: [], problems: [] };
|
|
205
|
-
if (typeof target !== "string") return { classes: [], problems: [`${source}: ${target.problem}`] };
|
|
206
|
-
const inside = posix.normalize(target.slice(2));
|
|
207
|
-
if (inside.startsWith("../") || inside === "..") return { classes: [], problems: [`${source}: exports["${PRINCIPALS_SUBPATH}"] points outside the package`] };
|
|
208
|
-
const text = files(inside);
|
|
209
|
-
if (text === undefined) return { classes: [], problems: [`${source}: exports["${PRINCIPALS_SUBPATH}"] names ${target}, which does not exist`] };
|
|
210
|
-
return parseClassData(text, source);
|
|
149
|
+
return readClassFiles(files, source, parseClassData);
|
|
211
150
|
}
|
|
212
151
|
|
|
213
152
|
export interface LoadedClasses {
|
|
@@ -227,10 +166,7 @@ export interface LoadedClasses {
|
|
|
227
166
|
*/
|
|
228
167
|
export function loadClassRegistry(pins: readonly PinLike[], workspaceRoot: string, opts: { tree?: WorkspaceTree } = {}): LoadedClasses {
|
|
229
168
|
const problems: KindLoadProblem[] = [];
|
|
230
|
-
const
|
|
231
|
-
const byName = new Map<string, string>();
|
|
232
|
-
const byRole = new Map<string, string>();
|
|
233
|
-
const clashing = new Set<string>();
|
|
169
|
+
const reads: PinClassRead[] = [];
|
|
234
170
|
pins.forEach((pin, i) => {
|
|
235
171
|
let files: PackageFiles;
|
|
236
172
|
let source: string;
|
|
@@ -247,29 +183,10 @@ export function loadClassRegistry(pins: readonly PinLike[], workspaceRoot: strin
|
|
|
247
183
|
files = diskFiles(found.dir);
|
|
248
184
|
source = found.source;
|
|
249
185
|
}
|
|
250
|
-
|
|
251
|
-
for (const p of read.problems) problems.push({ pin: i, message: p });
|
|
252
|
-
for (const c of read.classes) {
|
|
253
|
-
const named = byName.get(c.name);
|
|
254
|
-
const roled = byRole.get(c.role!);
|
|
255
|
-
if (named !== undefined || roled !== undefined) {
|
|
256
|
-
clashing.add(c.name);
|
|
257
|
-
if (named !== undefined) {
|
|
258
|
-
problems.push({ pin: i, message: `class ${c.name} is supplied by both ${named} and ${source}; a class name has one source` });
|
|
259
|
-
} else {
|
|
260
|
-
const other = extra.find((e) => e.role === c.role)!;
|
|
261
|
-
clashing.add(other.name);
|
|
262
|
-
problems.push({ pin: i, message: `class ${c.name} (${source}) names the role ${c.role}, which class ${other.name} (${roled}) names; a role puts a principal in one class` });
|
|
263
|
-
}
|
|
264
|
-
continue;
|
|
265
|
-
}
|
|
266
|
-
byName.set(c.name, source);
|
|
267
|
-
byRole.set(c.role!, source);
|
|
268
|
-
extra.push(c);
|
|
269
|
-
}
|
|
186
|
+
reads.push({ pin: i, source, read: readPackageClasses(files, source) });
|
|
270
187
|
});
|
|
271
|
-
|
|
272
|
-
return { registry: createClassRegistry(
|
|
188
|
+
const merged = mergePinClasses(reads);
|
|
189
|
+
return { registry: createClassRegistry(merged.classes), problems: [...problems, ...merged.problems].sort((a, b) => a.pin - b.pin) };
|
|
273
190
|
}
|
|
274
191
|
|
|
275
192
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { execFileSync } from "node:child_process";
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
15
|
-
import { mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
15
|
+
import { cpSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { tmpdir } from "node:os";
|
|
17
17
|
import { dirname, join } from "node:path";
|
|
18
18
|
import Ajv2020 from "ajv/dist/2020";
|
|
@@ -472,7 +472,12 @@ describe("the write commands through a declared kind (#2680)", () => {
|
|
|
472
472
|
|
|
473
473
|
describe("the decision kind", () => {
|
|
474
474
|
test("still reads as markdown front matter, and says so", async () => {
|
|
475
|
-
|
|
475
|
+
// The repository's own decision records, copied into a one-commit repository:
|
|
476
|
+
// a read in the real checkout asks git for the history of every pinned path
|
|
477
|
+
// across thousands of commits, which took 12 s alone and 20+ s under load.
|
|
478
|
+
cpSync(join(REPO, "docs", "design", "decisions"), join(root, "docs", "design", "decisions"), { recursive: true });
|
|
479
|
+
commit();
|
|
480
|
+
const doc = await queryRecords({ kind: "docs/design/decisions/decision.kind.mjs", cwd: root });
|
|
476
481
|
expect(validateOutput(doc)).toBe(true);
|
|
477
482
|
if ("error" in doc) throw new Error(doc.error.message);
|
|
478
483
|
expect(doc.kind.format).toBe("markdown-front-matter");
|