@intentius/chant 0.80.0 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/discover.d.ts +8 -16
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/report-html.d.ts +5 -0
- package/dist/audit/report-html.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +13 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/terraform-state.d.ts +4 -5
- package/dist/audit/terraform-state.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +25 -9
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +8 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/import-agents.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/vendor.d.ts +5 -0
- package/dist/cli/commands/vendor.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +7 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/promote.d.ts +7 -4
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/run-generate.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts +4 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/vendor.d.ts +8 -3
- package/dist/cli/handlers/vendor.d.ts.map +1 -1
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +12 -7
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +32 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts +10 -0
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +3 -1
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/driver.d.ts +16 -2
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/gate-plan.d.ts +40 -0
- package/dist/components/gate-plan.d.ts.map +1 -0
- package/dist/components/promote.d.ts +60 -7
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/run.d.ts.map +1 -1
- package/dist/components/verbs/build-archive.d.ts +22 -11
- package/dist/components/verbs/build-archive.d.ts.map +1 -1
- package/dist/components/verbs/run-agent.d.ts.map +1 -1
- package/dist/config-static.d.ts +59 -0
- package/dist/config-static.d.ts.map +1 -0
- package/dist/config.d.ts +32 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/content-digest.d.ts +17 -0
- package/dist/content-digest.d.ts.map +1 -0
- package/dist/discovery/files.d.ts +10 -5
- package/dist/discovery/files.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +20 -4
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.d.ts +20 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/fork.d.ts +20 -0
- package/dist/discovery/sandbox/fork.d.ts.map +1 -1
- package/dist/discovery/walk.d.ts +119 -0
- package/dist/discovery/walk.d.ts.map +1 -0
- package/dist/graph-ir.d.ts +4 -1
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/join-key.d.ts +31 -0
- package/dist/join-key.d.ts.map +1 -0
- package/dist/lexicon-module.d.ts +51 -6
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon.d.ts +58 -1
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/build-ledger-store.d.ts.map +1 -1
- package/dist/lifecycle/digest.d.ts +5 -1
- package/dist/lifecycle/digest.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +20 -5
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +64 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/lease.d.ts +8 -1
- package/dist/lifecycle/lease.d.ts.map +1 -1
- package/dist/lifecycle/legacy-digest.d.ts +41 -8
- package/dist/lifecycle/legacy-digest.d.ts.map +1 -1
- package/dist/lifecycle/member-ledger.d.ts +67 -0
- package/dist/lifecycle/member-ledger.d.ts.map +1 -0
- package/dist/lifecycle/plan-digest.d.ts +4 -3
- package/dist/lifecycle/plan-digest.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.d.ts +18 -2
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/status.d.ts +90 -5
- package/dist/lifecycle/status.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +32 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +2 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +75 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/gate-name.d.ts +7 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-summary.d.ts +16 -0
- package/dist/op/gate-summary.d.ts.map +1 -1
- package/dist/op/gate.d.ts +16 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/project-root.d.ts +26 -0
- package/dist/project-root.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.d.ts +37 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts +11 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts.map +1 -0
- package/dist/workspace/checks/generated.d.ts +156 -0
- package/dist/workspace/checks/generated.d.ts.map +1 -0
- package/dist/workspace/checks/ledgers.d.ts +78 -0
- package/dist/workspace/checks/ledgers.d.ts.map +1 -0
- package/dist/workspace/checks/links.d.ts +25 -0
- package/dist/workspace/checks/links.d.ts.map +1 -0
- package/dist/workspace/checks/pipelines.d.ts +76 -0
- package/dist/workspace/checks/pipelines.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +161 -0
- package/dist/workspace/checks.d.ts.map +1 -0
- package/dist/workspace/compose-graph.d.ts +115 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -0
- package/dist/workspace/compose-reports.d.ts +68 -0
- package/dist/workspace/compose-reports.d.ts.map +1 -0
- package/dist/workspace/declaration.d.ts +220 -0
- package/dist/workspace/declaration.d.ts.map +1 -0
- package/dist/workspace/declaration.schema.json +434 -0
- package/dist/workspace/generated-files.d.ts +65 -0
- package/dist/workspace/generated-files.d.ts.map +1 -0
- package/dist/workspace/glob.d.ts +13 -0
- package/dist/workspace/glob.d.ts.map +1 -0
- package/dist/workspace/graph-cli.d.ts +75 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -0
- package/dist/workspace/init.d.ts +96 -0
- package/dist/workspace/init.d.ts.map +1 -0
- package/dist/workspace/jsonc.d.ts +38 -0
- package/dist/workspace/jsonc.d.ts.map +1 -0
- package/dist/workspace/kinds.d.ts +192 -0
- package/dist/workspace/kinds.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +84 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -0
- package/dist/workspace/lineage-cli.d.ts +31 -0
- package/dist/workspace/lineage-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-init.d.ts +101 -0
- package/dist/workspace/lineage-init.d.ts.map +1 -0
- package/dist/workspace/lineage-lock.d.ts +258 -0
- package/dist/workspace/lineage-lock.d.ts.map +1 -0
- package/dist/workspace/lineage-merge.d.ts +14 -0
- package/dist/workspace/lineage-merge.d.ts.map +1 -0
- package/dist/workspace/lineage-migrations.d.ts +178 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -0
- package/dist/workspace/lineage-update.d.ts +59 -0
- package/dist/workspace/lineage-update.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts +40 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade.d.ts +146 -0
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -0
- package/dist/workspace/lineage-vendor.d.ts +63 -0
- package/dist/workspace/lineage-vendor.d.ts.map +1 -0
- package/dist/workspace/lineage-version.d.ts +32 -0
- package/dist/workspace/lineage-version.d.ts.map +1 -0
- package/dist/workspace/links.d.ts +150 -0
- package/dist/workspace/links.d.ts.map +1 -0
- package/dist/workspace/ls.d.ts +99 -0
- package/dist/workspace/ls.d.ts.map +1 -0
- package/dist/workspace/member-commands.d.ts +139 -0
- package/dist/workspace/member-commands.d.ts.map +1 -0
- package/dist/workspace/member-handles.d.ts +54 -0
- package/dist/workspace/member-handles.d.ts.map +1 -0
- package/dist/workspace/member-pipeline.d.ts +143 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -0
- package/dist/workspace/member-run.d.ts +67 -0
- package/dist/workspace/member-run.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +65 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +28 -4
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/root-refusal.d.ts +53 -0
- package/dist/workspace/root-refusal.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +150 -0
- package/dist/workspace/status.d.ts.map +1 -0
- package/dist/workspace/template-manifest.d.ts +90 -0
- package/dist/workspace/template-manifest.d.ts.map +1 -0
- package/dist/workspace/tree.d.ts +36 -0
- package/dist/workspace/tree.d.ts.map +1 -0
- package/dist/workspace/trust/attestor.d.ts +67 -0
- package/dist/workspace/trust/attestor.d.ts.map +1 -0
- package/dist/workspace/trust/policy.d.ts +111 -0
- package/dist/workspace/trust/policy.d.ts.map +1 -0
- package/dist/workspace/trust/provenance.d.ts +67 -0
- package/dist/workspace/trust/provenance.d.ts.map +1 -0
- package/dist/workspace/trust/ssh-commit.d.ts +43 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -0
- package/dist/workspace/trust/test-repo.d.ts +42 -0
- package/dist/workspace/trust/test-repo.d.ts.map +1 -0
- package/dist/workspace/trust/verify-cli.d.ts +9 -0
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -0
- package/dist/workspace/trust/verify.d.ts +66 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -0
- package/dist/workspace/which-chant.d.ts +58 -0
- package/dist/workspace/which-chant.d.ts.map +1 -0
- package/dist/workspace/workspace-kinds.schema.json +133 -0
- package/package.json +2 -1
- package/src/audit/discover.ts +66 -78
- package/src/audit/report-html.ts +3 -1
- package/src/audit/report-model.ts +14 -1
- package/src/audit/terraform-state.test.ts +4 -9
- package/src/audit/terraform-state.ts +4 -5
- package/src/cli/commands/audit-truncation.test.ts +167 -0
- package/src/cli/commands/audit.ts +89 -60
- package/src/cli/commands/check-lexicon.ts +24 -0
- package/src/cli/commands/doctor.test.ts +30 -0
- package/src/cli/commands/doctor.ts +18 -0
- package/src/cli/commands/import-agents.ts +6 -2
- package/src/cli/commands/init.ts +22 -3
- package/src/cli/commands/lint.test.ts +17 -23
- package/src/cli/commands/lint.ts +24 -84
- package/src/cli/commands/update.ts +13 -4
- package/src/cli/commands/vendor.ts +11 -6
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +38 -0
- package/src/cli/handlers/build-member.test.ts +127 -0
- package/src/cli/handlers/build.ts +35 -1
- package/src/cli/handlers/components.test.ts +127 -0
- package/src/cli/handlers/components.ts +70 -8
- package/src/cli/handlers/dev.ts +5 -3
- package/src/cli/handlers/fan-out.ts +9 -2
- package/src/cli/handlers/init.ts +54 -1
- package/src/cli/handlers/operator.test.ts +68 -0
- package/src/cli/handlers/operator.ts +37 -9
- package/src/cli/handlers/promote.test.ts +118 -2
- package/src/cli/handlers/promote.ts +82 -16
- package/src/cli/handlers/run-generate-member.test.ts +83 -0
- package/src/cli/handlers/run-generate.test.ts +6 -8
- package/src/cli/handlers/run-generate.ts +36 -1
- package/src/cli/handlers/run.test.ts +47 -0
- package/src/cli/handlers/run.ts +28 -5
- package/src/cli/handlers/vendor.ts +147 -43
- package/src/cli/main.test.ts +105 -1
- package/src/cli/main.ts +230 -17
- package/src/cli/plugins.ts +17 -17
- package/src/cli/registry.ts +32 -0
- package/src/cli/static-config-read.test.ts +208 -0
- package/src/codegen/fetch.test.ts +63 -1
- package/src/codegen/fetch.ts +30 -1
- package/src/components/cli-support.ts +6 -1
- package/src/components/discover.test.ts +27 -57
- package/src/components/discover.ts +13 -68
- package/src/components/driver.test.ts +78 -1
- package/src/components/driver.ts +43 -7
- package/src/components/gate-plan.ts +53 -0
- package/src/components/promote.test.ts +276 -2
- package/src/components/promote.ts +119 -15
- package/src/components/sandbox/driver.ts +8 -8
- package/src/components/sandbox/run.ts +4 -1
- package/src/components/verbs/build-archive.ts +27 -21
- package/src/components/verbs/run-agent.ts +3 -5
- package/src/config-static.test.ts +136 -0
- package/src/config-static.ts +232 -0
- package/src/config.test.ts +2 -2
- package/src/config.ts +48 -15
- package/src/content-digest.test.ts +120 -0
- package/src/content-digest.ts +21 -0
- package/src/discovery/files.test.ts +10 -10
- package/src/discovery/files.ts +25 -81
- package/src/discovery/fold-import.ts +49 -5
- package/src/discovery/index.ts +1 -0
- package/src/discovery/sandbox/driver.ts +73 -35
- package/src/discovery/sandbox/fork-diagnostic.test.ts +136 -13
- package/src/discovery/sandbox/fork.ts +83 -43
- package/src/discovery/sandbox/path-lexicon-multifile.test.ts +285 -0
- package/src/discovery/walk.test.ts +263 -0
- package/src/discovery/walk.ts +334 -0
- package/src/effect-receipt.ts +2 -2
- package/src/graph-ir.ts +4 -1
- package/src/join-key.test.ts +25 -0
- package/src/join-key.ts +39 -0
- package/src/lexicon-module.ts +108 -10
- package/src/lexicon.ts +79 -1
- package/src/lifecycle/build-ledger-store.ts +11 -10
- package/src/lifecycle/digest.ts +9 -5
- package/src/lifecycle/gate-ledger.test.ts +20 -0
- package/src/lifecycle/gate-ledger.ts +28 -6
- package/src/lifecycle/git.test.ts +13 -1
- package/src/lifecycle/git.ts +221 -176
- package/src/lifecycle/lease.ts +25 -10
- package/src/lifecycle/legacy-digest.test.ts +115 -23
- package/src/lifecycle/legacy-digest.ts +60 -19
- package/src/lifecycle/member-ledger.test.ts +319 -0
- package/src/lifecycle/member-ledger.ts +145 -0
- package/src/lifecycle/plan-digest.ts +7 -7
- package/src/lifecycle/release-ledger.test.ts +20 -0
- package/src/lifecycle/release-ledger.ts +23 -7
- package/src/lifecycle/status.test.ts +151 -1
- package/src/lifecycle/status.ts +228 -7
- package/src/op/activities/activity-contracts.ts +37 -0
- package/src/op/activities/index.ts +10 -0
- package/src/op/activities/propose-upgrade.ts +206 -0
- package/src/op/discover.test.ts +14 -4
- package/src/op/discover.ts +19 -27
- package/src/op/gate-name.ts +8 -0
- package/src/op/gate-summary.test.ts +14 -0
- package/src/op/gate-summary.ts +25 -2
- package/src/op/gate.ts +36 -7
- package/src/op/generate-pipeline.test.ts +14 -5
- package/src/project-root.test.ts +66 -1
- package/src/project-root.ts +48 -0
- package/src/workspace/__fixtures__/contract-repo.ts +100 -0
- package/src/workspace/__fixtures__/two-member-workspace.ts +35 -0
- package/src/workspace/behold-kinds.test.ts +162 -0
- package/src/workspace/check-contract.test.ts +127 -0
- package/src/workspace/check.schema.json +347 -0
- package/src/workspace/checks/generated.test.ts +287 -0
- package/src/workspace/checks/generated.ts +475 -0
- package/src/workspace/checks/ledgers.test.ts +139 -0
- package/src/workspace/checks/ledgers.ts +246 -0
- package/src/workspace/checks/links.ts +183 -0
- package/src/workspace/checks/pipelines.test.ts +133 -0
- package/src/workspace/checks/pipelines.ts +225 -0
- package/src/workspace/checks-repo.test.ts +71 -0
- package/src/workspace/checks.test.ts +450 -0
- package/src/workspace/checks.ts +461 -0
- package/src/workspace/compose-graph.test.ts +146 -0
- package/src/workspace/compose-graph.ts +228 -0
- package/src/workspace/compose-reports.test.ts +109 -0
- package/src/workspace/compose-reports.ts +186 -0
- package/src/workspace/declaration.schema.json +434 -0
- package/src/workspace/declaration.test.ts +347 -0
- package/src/workspace/declaration.ts +623 -0
- package/src/workspace/generated-files.test.ts +114 -0
- package/src/workspace/generated-files.ts +94 -0
- package/src/workspace/glob.ts +49 -0
- package/src/workspace/graph-cli.ts +220 -0
- package/src/workspace/graph-contract.test.ts +204 -0
- package/src/workspace/graph.schema.json +662 -0
- package/src/workspace/init.test.ts +223 -0
- package/src/workspace/init.ts +585 -0
- package/src/workspace/jsonc.test.ts +65 -0
- package/src/workspace/jsonc.ts +231 -0
- package/src/workspace/kinds.test.ts +288 -0
- package/src/workspace/kinds.ts +506 -0
- package/src/workspace/lineage-check.ts +264 -0
- package/src/workspace/lineage-cli.ts +114 -0
- package/src/workspace/lineage-init.test.ts +231 -0
- package/src/workspace/lineage-init.ts +365 -0
- package/src/workspace/lineage-lock.test.ts +224 -0
- package/src/workspace/lineage-lock.ts +357 -0
- package/src/workspace/lineage-merge.ts +44 -0
- package/src/workspace/lineage-migrations.test.ts +178 -0
- package/src/workspace/lineage-migrations.ts +343 -0
- package/src/workspace/lineage-update.ts +160 -0
- package/src/workspace/lineage-upgrade-cli.ts +151 -0
- package/src/workspace/lineage-upgrade.test.ts +474 -0
- package/src/workspace/lineage-upgrade.ts +624 -0
- package/src/workspace/lineage-vendor.test.ts +126 -0
- package/src/workspace/lineage-vendor.ts +215 -0
- package/src/workspace/lineage-version.ts +127 -0
- package/src/workspace/links.test.ts +344 -0
- package/src/workspace/links.ts +331 -0
- package/src/workspace/ls-contract.test.ts +200 -0
- package/src/workspace/ls.schema.json +190 -0
- package/src/workspace/ls.ts +254 -0
- package/src/workspace/member-commands.e2e.test.ts +244 -0
- package/src/workspace/member-commands.test.ts +217 -0
- package/src/workspace/member-commands.ts +540 -0
- package/src/workspace/member-handles.test.ts +76 -0
- package/src/workspace/member-handles.ts +228 -0
- package/src/workspace/member-pipeline.test.ts +135 -0
- package/src/workspace/member-pipeline.ts +317 -0
- package/src/workspace/member-run.ts +146 -0
- package/src/workspace/read-contract.test.ts +129 -0
- package/src/workspace/reason-codes.test.ts +113 -0
- package/src/workspace/reason-codes.ts +81 -0
- package/src/workspace/records-cli.ts +86 -14
- package/src/workspace/records-contract.test.ts +5 -0
- package/src/workspace/records.schema.json +32 -2
- package/src/workspace/records.ts +3 -2
- package/src/workspace/root-refusal.ts +97 -0
- package/src/workspace/status-contract.test.ts +308 -0
- package/src/workspace/status.schema.json +210 -0
- package/src/workspace/status.ts +412 -0
- package/src/workspace/template-manifest.test.ts +79 -0
- package/src/workspace/template-manifest.ts +221 -0
- package/src/workspace/tree.ts +132 -0
- package/src/workspace/trust/attestor.ts +93 -0
- package/src/workspace/trust/policy.ts +306 -0
- package/src/workspace/trust/provenance.ts +181 -0
- package/src/workspace/trust/ssh-commit.ts +138 -0
- package/src/workspace/trust/test-repo.ts +138 -0
- package/src/workspace/trust/trust.test.ts +397 -0
- package/src/workspace/trust/verify-cli.ts +56 -0
- package/src/workspace/trust/verify.ts +194 -0
- package/src/workspace/which-chant.test.ts +117 -0
- package/src/workspace/which-chant.ts +151 -0
- package/src/workspace/workspace-kinds.schema.json +133 -0
- package/dist/components/unbound-gate-approval.d.ts +0 -24
- package/dist/components/unbound-gate-approval.d.ts.map +0 -1
- package/dist/discovery/convergence.d.ts +0 -97
- package/dist/discovery/convergence.d.ts.map +0 -1
- package/src/cli/commands/audit-walk-warnings.test.ts +0 -156
- package/src/components/unbound-gate-approval.test.ts +0 -82
- package/src/components/unbound-gate-approval.ts +0 -51
- package/src/discovery/convergence.test.ts +0 -231
- package/src/discovery/convergence.ts +0 -399
- package/src/op/discover-convergence.test.ts +0 -70
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers the read-contract tests share (#2536): throwaway git repositories,
|
|
3
|
+
* a draft 2020-12 validator, and a fake chant toolchain.
|
|
4
|
+
*/
|
|
5
|
+
import Ajv2020 from "ajv/dist/2020";
|
|
6
|
+
/** The chant checkout these tests run in. */
|
|
7
|
+
export declare const REPO: string;
|
|
8
|
+
/** Remove every directory {@link scratchDir} and {@link repo} made. Call it from `afterAll`. */
|
|
9
|
+
export declare function cleanScratch(): void;
|
|
10
|
+
export declare function scratchDir(prefix?: string): string;
|
|
11
|
+
export declare function git(cwd: string, ...args: string[]): string;
|
|
12
|
+
/** Write `files` under `root`; a value of `{ text, mode }` sets the mode too. */
|
|
13
|
+
export declare function writeFiles(root: string, files: Record<string, string | {
|
|
14
|
+
text: string;
|
|
15
|
+
mode: number;
|
|
16
|
+
}>): void;
|
|
17
|
+
/** A git repository holding `files`, with nothing committed unless `commit` is set. */
|
|
18
|
+
export declare function repo(files: Record<string, string | {
|
|
19
|
+
text: string;
|
|
20
|
+
mode: number;
|
|
21
|
+
}>, commit?: boolean): string;
|
|
22
|
+
export declare function commitAll(root: string, message?: string): string;
|
|
23
|
+
declare const ajv: Ajv2020;
|
|
24
|
+
/** A validator for `schema`, and an assertion that a document passes it. */
|
|
25
|
+
export declare function contract(schema: object): {
|
|
26
|
+
validate: ReturnType<typeof ajv.compile>;
|
|
27
|
+
expectValid(doc: unknown): void;
|
|
28
|
+
};
|
|
29
|
+
export declare function validSchema(schema: object): boolean;
|
|
30
|
+
export declare const declaration: (members: unknown[], extra?: Record<string, unknown>) => string;
|
|
31
|
+
/**
|
|
32
|
+
* A chant older than `workspace member-run`: it answers `chant graph` in the
|
|
33
|
+
* member's directory with one node per line of the member's `ids.txt`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const FAKE_GRAPH_CHANT = "#!/bin/sh\ncase \"$1\" in\n graph)\n printf '{\"version\":1,\"nodes\":['\n sep=\"\"\n while read -r id; do printf '%s{\"id\":\"%s\",\"kind\":\"Thing\",\"lexicon\":\"fake\",\"attrs\":{}}' \"$sep\" \"$id\"; sep=\",\"; done < ids.txt\n printf '],\"edges\":[],\"groups\":{\"byLexicon\":{}}}\\n'\n ;;\n *) echo \"Error: Unknown command: $1\" >&2; exit 1 ;;\nesac\n";
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=contract-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-repo.d.ts","sourceRoot":"","sources":["../../../src/workspace/__fixtures__/contract-repo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,6CAA6C;AAC7C,eAAO,MAAM,IAAI,QAAwE,CAAC;AAI1F,gGAAgG;AAChG,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,wBAAgB,UAAU,CAAC,MAAM,SAAoB,GAAG,MAAM,CAI7D;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAM1D;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAO7G;AAED,uFAAuF;AACvF,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,MAAM,UAAQ,GAAG,MAAM,CAS3G;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,SAAS,GAAG,MAAM,CAIhE;AAED,QAAA,MAAM,GAAG,SAAiD,CAAC;AAE3D,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,CAStH;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,EAAE,EAAE,QAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,WACV,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6XAU5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A throwaway git repository holding a workspace with two members (api and
|
|
3
|
+
* web), optionally a root member, and an example group with one match. Used
|
|
4
|
+
* by the per-member pipeline tests (#2542).
|
|
5
|
+
*/
|
|
6
|
+
/** A git repository holding a workspace with two members, a root member and an example group. */
|
|
7
|
+
export declare function twoMemberWorkspace(options?: {
|
|
8
|
+
root?: boolean;
|
|
9
|
+
prefix?: string;
|
|
10
|
+
}): string;
|
|
11
|
+
//# sourceMappingURL=two-member-workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"two-member-workspace.d.ts","sourceRoot":"","sources":["../../../src/workspace/__fixtures__/two-member-workspace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAsB5F"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generated-file checks (#2541, #2524 D14).
|
|
3
|
+
*
|
|
4
|
+
* A member lists the files a command writes in its `generated` entries, each
|
|
5
|
+
* with the command line that writes it and the sources it reads. Core adds
|
|
6
|
+
* the files `chant update` rewrites, `skills/*\/SKILL.md`, as implicit entries
|
|
7
|
+
* of every `chant` member (`../generated-files.ts` holds that list, and the
|
|
8
|
+
* lineage lock classes files from the same list).
|
|
9
|
+
*
|
|
10
|
+
* - `WSP101`: a generated file differs from what its generator writes.
|
|
11
|
+
* - `WSP102`: a declared generated file does not exist.
|
|
12
|
+
* - `WSP103`: a generator could not be run, failed, or wrote nothing.
|
|
13
|
+
* - `WSP104` (info): an entry is kept by hand, with the reason it gives.
|
|
14
|
+
* - `WSP105` (info): an entry was not compared, because its generator runs
|
|
15
|
+
* only on request or its output can't be produced without running code.
|
|
16
|
+
* - `WSP106`: an entry names a source that does not exist.
|
|
17
|
+
*
|
|
18
|
+
* They were WSP081 to WSP086 until #2641 moved them, since the pipeline
|
|
19
|
+
* checks of #2542 hold WSP081 to WSP083.
|
|
20
|
+
*
|
|
21
|
+
* What runs by default is what needs no member code: the file and its
|
|
22
|
+
* sources exist, and each implicit `SKILL.md` matches what the member's
|
|
23
|
+
* lexicons render, with the lexicons read from its config statically.
|
|
24
|
+
* Declared generators are commands that load member code and take seconds
|
|
25
|
+
* each, so they run only when asked ({@link GatherOptions.runGenerators},
|
|
26
|
+
* `chant workspace check --generated`).
|
|
27
|
+
*
|
|
28
|
+
* The checks are a pure function over {@link GeneratedFileFacts};
|
|
29
|
+
* {@link gatherGeneratedFacts} collects those facts from a checkout, and
|
|
30
|
+
* `chant workspace check` gathers them before it runs
|
|
31
|
+
* {@link GENERATED_CHECKS} (#2641).
|
|
32
|
+
*/
|
|
33
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
34
|
+
import type { Declaration } from "../declaration.js";
|
|
35
|
+
export declare const WSP_GENERATED_DRIFT = "WSP101";
|
|
36
|
+
export declare const WSP_GENERATED_MISSING = "WSP102";
|
|
37
|
+
export declare const WSP_GENERATOR_FAILED = "WSP103";
|
|
38
|
+
export declare const WSP_GENERATED_HAND_WRITTEN = "WSP104";
|
|
39
|
+
export declare const WSP_GENERATED_NOT_COMPARED = "WSP105";
|
|
40
|
+
export declare const WSP_GENERATED_SOURCE_MISSING = "WSP106";
|
|
41
|
+
export type GeneratedCheckId = typeof WSP_GENERATED_DRIFT | typeof WSP_GENERATED_MISSING | typeof WSP_GENERATOR_FAILED | typeof WSP_GENERATED_HAND_WRITTEN | typeof WSP_GENERATED_NOT_COMPARED | typeof WSP_GENERATED_SOURCE_MISSING;
|
|
42
|
+
export interface GeneratedFinding {
|
|
43
|
+
id: GeneratedCheckId;
|
|
44
|
+
severity: "error" | "info";
|
|
45
|
+
member: string;
|
|
46
|
+
/** The file, relative to the workspace root. A glob for an implicit entry that could not be rendered. */
|
|
47
|
+
path: string;
|
|
48
|
+
/** A JSON Pointer into the declaration: the entry, or the member for an implicit file. */
|
|
49
|
+
pointer: string;
|
|
50
|
+
message: string;
|
|
51
|
+
}
|
|
52
|
+
/** What the generator produced for one file. */
|
|
53
|
+
export type GeneratorOutput = {
|
|
54
|
+
status: "produced";
|
|
55
|
+
sha256: string;
|
|
56
|
+
} | {
|
|
57
|
+
status: "failed";
|
|
58
|
+
message: string;
|
|
59
|
+
} | {
|
|
60
|
+
status: "not-run";
|
|
61
|
+
reason: string;
|
|
62
|
+
};
|
|
63
|
+
/** What the checks need to know about one generated file. */
|
|
64
|
+
export interface GeneratedFileFacts {
|
|
65
|
+
member: string;
|
|
66
|
+
/** The member's directory, relative to the workspace root. */
|
|
67
|
+
memberDir: string;
|
|
68
|
+
/** The file, relative to the workspace root. */
|
|
69
|
+
path: string;
|
|
70
|
+
pointer: string;
|
|
71
|
+
/** The command line that writes the file. */
|
|
72
|
+
generator: string;
|
|
73
|
+
/** True for a file core registers (`skills/*\/SKILL.md`), false for a declared entry. */
|
|
74
|
+
implicit: boolean;
|
|
75
|
+
/** The reason, when the entry is kept by hand. */
|
|
76
|
+
handWritten: string | null;
|
|
77
|
+
/** Declared sources that do not exist, relative to the workspace root. */
|
|
78
|
+
missingSources: string[];
|
|
79
|
+
/** sha256 hex of the file in the tree, or null when it is missing. */
|
|
80
|
+
current: string | null;
|
|
81
|
+
output: GeneratorOutput;
|
|
82
|
+
}
|
|
83
|
+
/** Every generated-file finding, in the order of the facts. */
|
|
84
|
+
export declare function checkGenerated(facts: readonly GeneratedFileFacts[]): GeneratedFinding[];
|
|
85
|
+
/** The generated-file checks, which read `ctx.facts.generated`. They find nothing when the facts were not gathered. */
|
|
86
|
+
export declare const GENERATED_CHECKS: readonly WorkspaceCheck[];
|
|
87
|
+
/** The skills a member's lexicons render, keyed by path relative to the member. */
|
|
88
|
+
export type SkillRender = {
|
|
89
|
+
status: "rendered";
|
|
90
|
+
files: Map<string, string>;
|
|
91
|
+
unread?: string;
|
|
92
|
+
} | {
|
|
93
|
+
status: "unknown";
|
|
94
|
+
reason: string;
|
|
95
|
+
};
|
|
96
|
+
export type RenderSkills = (memberDir: string) => Promise<SkillRender>;
|
|
97
|
+
export interface GeneratorRun {
|
|
98
|
+
cwd: string;
|
|
99
|
+
argv: string[];
|
|
100
|
+
env: NodeJS.ProcessEnv;
|
|
101
|
+
}
|
|
102
|
+
export type RunGenerator = (run: GeneratorRun) => {
|
|
103
|
+
ok: true;
|
|
104
|
+
} | {
|
|
105
|
+
ok: false;
|
|
106
|
+
message: string;
|
|
107
|
+
};
|
|
108
|
+
export interface GatherOptions {
|
|
109
|
+
/** Run each declared generator and compare its output. Off by default: generators run member code. */
|
|
110
|
+
runGenerators?: boolean;
|
|
111
|
+
/** How implicit skills are rendered. Defaults to {@link renderSkillsStatically}. */
|
|
112
|
+
renderSkills?: RenderSkills;
|
|
113
|
+
/** How a generator runs. Defaults to {@link spawnGenerator}. */
|
|
114
|
+
runGenerator?: RunGenerator;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Collect {@link GeneratedFileFacts} for every member of `declaration`, whose
|
|
118
|
+
* workspace root is `root`: its declared entries, then, for a `chant`
|
|
119
|
+
* member, its implicit `SKILL.md` files.
|
|
120
|
+
*/
|
|
121
|
+
export declare function gatherGeneratedFacts(root: string, declaration: Declaration, options?: GatherOptions): Promise<GeneratedFileFacts[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Render the skills `chant update` would write for the member at `memberDir`,
|
|
124
|
+
* in this process. The member's `lexicons` are read from its config
|
|
125
|
+
* statically, never by running it. Lexicons declared by module path are left
|
|
126
|
+
* out, since loading one runs member code.
|
|
127
|
+
*/
|
|
128
|
+
export declare function renderSkillsStatically(memberDir: string): Promise<SkillRender>;
|
|
129
|
+
/**
|
|
130
|
+
* Split a command line into words, with '...' and "..." quoting and
|
|
131
|
+
* backslash escapes. Returns undefined for anything a shell would interpret:
|
|
132
|
+
* pipes, redirections, `;`, `&`, substitutions. A generator is one command.
|
|
133
|
+
*/
|
|
134
|
+
export declare function splitCommandLine(line: string): string[] | undefined;
|
|
135
|
+
/** `node_modules/.bin` directories from `dir` up, nearest first, so `chant` is the member's own. */
|
|
136
|
+
export declare function binPath(dir: string): string[];
|
|
137
|
+
/** Run a generator with no shell, for up to ten minutes. */
|
|
138
|
+
export declare const spawnGenerator: RunGenerator;
|
|
139
|
+
/**
|
|
140
|
+
* Produce the file at `target` (absolute) with `generator`, run in
|
|
141
|
+
* `memberAbs`, without leaving anything changed in the tree. When the
|
|
142
|
+
* command passes `-o` or `--output` with the file's path, that flag gets a
|
|
143
|
+
* temporary path instead. Otherwise the generator writes in place, and the
|
|
144
|
+
* git working tree is put back as it was afterwards.
|
|
145
|
+
*/
|
|
146
|
+
export declare function regenerate(root: string, memberAbs: string, target: string, generator: string, run: RunGenerator): GeneratorOutput;
|
|
147
|
+
/**
|
|
148
|
+
* Run `fn`, then put the working tree of the repository at `top` back as it
|
|
149
|
+
* was: files that were clean are checked out from the index again, new
|
|
150
|
+
* untracked files are removed, and files that were already changed get their
|
|
151
|
+
* earlier bytes back. `extra` files (absolute) are restored too, whatever
|
|
152
|
+
* git says about them, which covers a gitignored target. Files a generator
|
|
153
|
+
* writes under ignored paths are otherwise left.
|
|
154
|
+
*/
|
|
155
|
+
export declare function withTreeRestored<T>(top: string, extra: string[], fn: () => T): T;
|
|
156
|
+
//# sourceMappingURL=generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAU,MAAM,gBAAgB,CAAC;AAG1D,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,4BAA4B,WAAW,CAAC;AAErD,MAAM,MAAM,gBAAgB,GACxB,OAAO,mBAAmB,GAC1B,OAAO,qBAAqB,GAC5B,OAAO,oBAAoB,GAC3B,OAAO,0BAA0B,GACjC,OAAO,0BAA0B,GACjC,OAAO,4BAA4B,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,yGAAyG;IACzG,IAAI,EAAE,MAAM,CAAC;IACb,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,gDAAgD;AAChD,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CA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AE,EAAE,MAAM,CAAC,GAAG,CAAC,CAyChF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace checks behind member ledgers (#2538, #2524 D7, ws-036 and
|
|
3
|
+
* ws-037).
|
|
4
|
+
*
|
|
5
|
+
* - `WSP071`: every `chant` member that stamps ownership markers uses its own
|
|
6
|
+
* `ownership.stack`. Markers carry no member key, so the stack is what tells
|
|
7
|
+
* two members' resources and receipts apart.
|
|
8
|
+
* - `WSP072`: members that write the flat ledger layout never share an
|
|
9
|
+
* environment name. A member whose own chant is older than
|
|
10
|
+
* {@link MEMBER_LEDGER_FLOOR} still writes `<env>/...` at the top of
|
|
11
|
+
* `chant/lifecycle`, and so does the root member `.`; two flat writers with
|
|
12
|
+
* one environment name would write the same files.
|
|
13
|
+
* - `WSP073` (info): a member's ledger settings could not be read without
|
|
14
|
+
* running its config, so the two checks above could not compare it.
|
|
15
|
+
*
|
|
16
|
+
* The checks are pure functions over {@link MemberLedgerFacts}.
|
|
17
|
+
* {@link gatherLedgerFacts} collects those facts from a checkout, and
|
|
18
|
+
* `chant workspace check` gathers them before it runs {@link LEDGER_CHECKS}
|
|
19
|
+
* (#2641). WSP071 and WSP072 are fixed: a member that ignores either one
|
|
20
|
+
* writes its records or marks its resources as another member's. Member
|
|
21
|
+
* configs are read statically and never run.
|
|
22
|
+
*/
|
|
23
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
24
|
+
import { type Declaration } from "../declaration.js";
|
|
25
|
+
export declare const WSP_DISTINCT_STACKS = "WSP071";
|
|
26
|
+
export declare const WSP_FLAT_LEDGER_ENVIRONMENTS = "WSP072";
|
|
27
|
+
export declare const WSP_LEDGER_SETTINGS_UNREAD = "WSP073";
|
|
28
|
+
export interface LedgerFinding {
|
|
29
|
+
id: typeof WSP_DISTINCT_STACKS | typeof WSP_FLAT_LEDGER_ENVIRONMENTS;
|
|
30
|
+
severity: "error";
|
|
31
|
+
/** The members the finding is about, in declaration order. */
|
|
32
|
+
members: string[];
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
/** What the ledger checks need to know about one `chant` member. */
|
|
36
|
+
export interface MemberLedgerFacts {
|
|
37
|
+
name: string;
|
|
38
|
+
/** Relative to the workspace root; `"."` is the root member. */
|
|
39
|
+
dir: string;
|
|
40
|
+
/** `ownership.stack` when marking is on, else null. */
|
|
41
|
+
stack: string | null;
|
|
42
|
+
/** The environment names the member declares (`environments`, and a literal `ownership.env`). */
|
|
43
|
+
environments: string[];
|
|
44
|
+
/** The chant the member's own toolchain resolves, or null when none is installed. */
|
|
45
|
+
chantVersion: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Why the member's ledger settings could not be read without running its
|
|
48
|
+
* config. Such a member has no stack and no environments here, so neither
|
|
49
|
+
* check compares it; `WSP073` reports it instead.
|
|
50
|
+
*/
|
|
51
|
+
unread?: string;
|
|
52
|
+
}
|
|
53
|
+
/** `WSP071`: no two members share an `ownership.stack`. */
|
|
54
|
+
export declare function checkDistinctStacks(facts: readonly MemberLedgerFacts[]): LedgerFinding[];
|
|
55
|
+
/** Whether `f` writes the flat ledger layout: the root member, or a member on a chant below the floor. */
|
|
56
|
+
export declare function writesFlatLedger(f: MemberLedgerFacts, floor?: string): boolean;
|
|
57
|
+
/** `WSP072`: flat-layout writers never share an environment name. */
|
|
58
|
+
export declare function checkFlatLedgerEnvironments(facts: readonly MemberLedgerFacts[], floor?: string): LedgerFinding[];
|
|
59
|
+
/** Both ledger checks, stack findings first. */
|
|
60
|
+
export declare function checkLedgers(facts: readonly MemberLedgerFacts[], floor?: string): LedgerFinding[];
|
|
61
|
+
/** The ledger checks, which read `ctx.facts.ledgers`. They find nothing when the facts were not gathered. */
|
|
62
|
+
export declare const LEDGER_CHECKS: readonly WorkspaceCheck[];
|
|
63
|
+
/**
|
|
64
|
+
* The version of `@intentius/chant` that `dir`'s own toolchain resolves: the
|
|
65
|
+
* nearest `node_modules/@intentius/chant/package.json` walking up from `dir`,
|
|
66
|
+
* as Node's resolution would find it. Null when there is none.
|
|
67
|
+
*/
|
|
68
|
+
export declare function memberChantVersion(dir: string): string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Collect {@link MemberLedgerFacts} for every `chant` member of `declaration`,
|
|
71
|
+
* whose workspace root is `root`. `ownership` and `environments` are read
|
|
72
|
+
* from each member's config statically (../../config-static.ts), the way
|
|
73
|
+
* `chant audit` reads lexicons: the config is never run (#2641). A member
|
|
74
|
+
* whose settings can't be read that way gets {@link MemberLedgerFacts.unread}
|
|
75
|
+
* with the reason, and no stack or environments.
|
|
76
|
+
*/
|
|
77
|
+
export declare function gatherLedgerFacts(root: string, declaration: Declaration): Promise<MemberLedgerFacts[]>;
|
|
78
|
+
//# sourceMappingURL=ledgers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledgers.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/ledgers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAA8C,MAAM,WAAW,CAAC;AAC5F,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,4BAA4B,WAAW,CAAC;AACrD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,mBAAmB,GAAG,OAAO,4BAA4B,CAAC;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iGAAiG;IACjG,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,qFAAqF;IACrF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,2DAA2D;AAC3D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,aAAa,EAAE,CAqBxF;AAED,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,GAAE,MAA4B,GAAG,OAAO,CASnG;AAED,qEAAqE;AACrE,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,KAAK,GAAE,MAA4B,GAClC,aAAa,EAAE,CAsBjB;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EAAE,KAAK,GAAE,MAA4B,GAAG,aAAa,EAAE,CAEtH;AAcD,6GAA6G;AAC7G,eAAO,MAAM,aAAa,EAAE,SAAS,cAAc,EAuClD,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAa7D;AAKD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA6B5G"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The member-link checks, WSP091 to WSP097 (#2539; #2524 D6, ws-008).
|
|
3
|
+
*
|
|
4
|
+
* `chant workspace check` resolves every declared link in source: the
|
|
5
|
+
* producer's outputs come from its kind, and a `chant` producer's are read
|
|
6
|
+
* from its TypeScript without running it (`../member-handles.ts`). Nothing
|
|
7
|
+
* here reaches the network or starts a process. The rows themselves come
|
|
8
|
+
* from `../links.ts`, which `chant workspace graph` shares.
|
|
9
|
+
*
|
|
10
|
+
* | Id | Fails when |
|
|
11
|
+
* |---|---|
|
|
12
|
+
* | WSP091 | a link names no member, an example group, or its own member (fixed) |
|
|
13
|
+
* | WSP092 | a link's kind is not a link kind chant knows (fixed) |
|
|
14
|
+
* | WSP093 | the producer exposes no output of that name, as when it was renamed |
|
|
15
|
+
* | WSP094 | the producer's outputs can't be read in source, so the link is kept unresolved |
|
|
16
|
+
* | WSP095 | an inferred join is ambiguous: a parameter matches two or more outputs |
|
|
17
|
+
* | WSP096 | a consumer states the same link twice |
|
|
18
|
+
* | WSP097 | an entry lists `outputs` for a kind that doesn't take them from the entry |
|
|
19
|
+
*/
|
|
20
|
+
import type { WorkspaceCheck, WorkspaceCheckContext } from "../checks.js";
|
|
21
|
+
import { type LinkTableRow } from "../links.js";
|
|
22
|
+
/** The link rows for a check run, resolved once and shared by every link check. */
|
|
23
|
+
export declare function linkTable(ctx: WorkspaceCheckContext): LinkTableRow[];
|
|
24
|
+
export declare const LINK_CHECKS: readonly WorkspaceCheck[];
|
|
25
|
+
//# sourceMappingURL=links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAuB,MAAM,WAAW,CAAC;AAG5F,OAAO,EAAmG,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAI9I,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,GAAG,EAAE,qBAAqB,GAAG,YAAY,EAAE,CAOpE;AAUD,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAyIhD,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace checks behind per-member pipelines (#2542; #2524 D19,
|
|
3
|
+
* ws-040, ws-041 and ws-042).
|
|
4
|
+
*
|
|
5
|
+
* - `WSP081`: each generated file has exactly one declarer. Two members that
|
|
6
|
+
* both list `.github/workflows/deploy.yml` would each overwrite the other's
|
|
7
|
+
* pipeline on every regeneration.
|
|
8
|
+
* - `WSP082`: a member declares generated files only inside its own
|
|
9
|
+
* directory, with one exception: forge CI files, which forges read from
|
|
10
|
+
* fixed paths at the repository root ({@link isForgePath}).
|
|
11
|
+
* - `WSP083`: linked members share at least one environment name. Names are
|
|
12
|
+
* matched exactly, with no mapping (ws-040), so this is a warning: a
|
|
13
|
+
* member with its own names still builds.
|
|
14
|
+
*
|
|
15
|
+
* The checks are pure functions over {@link MemberPipelineFacts}.
|
|
16
|
+
* {@link gatherPipelineFacts} collects those facts from a checkout, reading
|
|
17
|
+
* each member's generated-file record (../member-pipeline.ts), and
|
|
18
|
+
* `chant workspace check` gathers them before it runs {@link PIPELINE_CHECKS}
|
|
19
|
+
* (#2641).
|
|
20
|
+
*/
|
|
21
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
22
|
+
import type { Declaration } from "../declaration.js";
|
|
23
|
+
export declare const WSP_ONE_DECLARER = "WSP081";
|
|
24
|
+
export declare const WSP_GENERATED_PLACEMENT = "WSP082";
|
|
25
|
+
export declare const WSP_LINKED_ENVIRONMENTS = "WSP083";
|
|
26
|
+
export interface PipelineFinding {
|
|
27
|
+
id: typeof WSP_ONE_DECLARER | typeof WSP_GENERATED_PLACEMENT | typeof WSP_LINKED_ENVIRONMENTS;
|
|
28
|
+
severity: "error" | "warning";
|
|
29
|
+
/** The members the finding is about, in declaration order. */
|
|
30
|
+
members: string[];
|
|
31
|
+
/** The generated file the finding is about, when there is one. */
|
|
32
|
+
path?: string;
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
/** What the pipeline checks need to know about one member. */
|
|
36
|
+
export interface MemberPipelineFacts {
|
|
37
|
+
name: string;
|
|
38
|
+
/** Relative to the repository root, with `/` separators; `"."` is the root. */
|
|
39
|
+
dir: string;
|
|
40
|
+
/** The generated files the member declares, relative to the repository root. */
|
|
41
|
+
generated: string[];
|
|
42
|
+
/** The environment names the member's pipelines deploy. */
|
|
43
|
+
environments: string[];
|
|
44
|
+
}
|
|
45
|
+
/** A link between two members: `consumer` reads something `producer` exposes (#2524 D6). */
|
|
46
|
+
export interface MemberLink {
|
|
47
|
+
consumer: string;
|
|
48
|
+
producer: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether `path` (repository-relative) is a forge CI file: a file directly in
|
|
52
|
+
* `.github/workflows/`, `.forgejo/workflows/` or `.gitea/workflows/`, the
|
|
53
|
+
* root `.gitlab-ci.yml`, or a file directly in `.gitlab/ci/`, which the root
|
|
54
|
+
* `.gitlab-ci.yml` includes. The exemption is this narrow on purpose (ws-042).
|
|
55
|
+
*/
|
|
56
|
+
export declare function isForgePath(path: string): boolean;
|
|
57
|
+
/** `WSP081`: no two members declare the same generated file. */
|
|
58
|
+
export declare function checkOneDeclarer(facts: readonly MemberPipelineFacts[]): PipelineFinding[];
|
|
59
|
+
/** `WSP082`: a member's generated files sit in its own directory, or are forge CI files. */
|
|
60
|
+
export declare function checkGeneratedPlacement(facts: readonly MemberPipelineFacts[]): PipelineFinding[];
|
|
61
|
+
/** `WSP083`: every link joins members that share an environment name, when both name any. */
|
|
62
|
+
export declare function checkLinkedEnvironments(facts: readonly MemberPipelineFacts[], links: readonly MemberLink[]): PipelineFinding[];
|
|
63
|
+
/**
|
|
64
|
+
* Collect the facts from a checkout. `prefix` is the workspace root relative
|
|
65
|
+
* to the repository root (`"."` when they are the same). Each member's
|
|
66
|
+
* generated files and environments come from its generated-file record.
|
|
67
|
+
*/
|
|
68
|
+
export declare function gatherPipelineFacts(workspaceRoot: string, declaration: Declaration, prefix?: string): MemberPipelineFacts[];
|
|
69
|
+
/**
|
|
70
|
+
* Run the three checks. `links` defaults to none; `chant workspace check`
|
|
71
|
+
* passes the declared member links (#2539).
|
|
72
|
+
*/
|
|
73
|
+
export declare function checkPipelines(facts: readonly MemberPipelineFacts[], links?: readonly MemberLink[]): PipelineFinding[];
|
|
74
|
+
/** The pipeline checks, which read `ctx.facts.pipelines`. They find nothing when the facts were not gathered. */
|
|
75
|
+
export declare const PIPELINE_CHECKS: readonly WorkspaceCheck[];
|
|
76
|
+
//# sourceMappingURL=pipelines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/pipelines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,cAAc,EAA8C,MAAM,WAAW,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,gBAAgB,GAAG,OAAO,uBAAuB,GAAG,OAAO,uBAAuB,CAAC;IAC9F,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,4FAA4F;AAC5F,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGjD;AAMD,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,GAAG,eAAe,EAAE,CAoBzF;AAED,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,GAAG,eAAe,EAAE,CAkBhG;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EAAE,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,eAAe,EAAE,CA6B9H;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAM,GAAG,mBAAmB,EAAE,CAWxH;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EAAE,KAAK,GAAE,SAAS,UAAU,EAAO,GAAG,eAAe,EAAE,CAE1H;AAmBD,iHAAiH;AACjH,eAAO,MAAM,eAAe,EAAE,SAAS,cAAc,EA+BpD,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaration checks (#2535; #2524 D16, ws-028).
|
|
3
|
+
*
|
|
4
|
+
* A {@link WorkspaceCheck} looks at the declaration, the tree it describes
|
|
5
|
+
* and the kinds the workspace can read, and returns findings in the
|
|
6
|
+
* post-synth diagnostic shape with a `WSP` id. `chant workspace check` runs
|
|
7
|
+
* them and prints the findings through lint's reporters, so `--format json`
|
|
8
|
+
* and `--format sarif` come for free. `chant lint` never loads this module.
|
|
9
|
+
*
|
|
10
|
+
* The declaration sets the severity of a check through `checks`, and
|
|
11
|
+
* suppresses a check for one entry through that entry's `suppress`. Some
|
|
12
|
+
* checks are fixed: an unknown kind, a tie between probes and a probe that
|
|
13
|
+
* claims an `other` directory always fail (#2524 D3), and a declaration that
|
|
14
|
+
* can't be read has no settings to apply.
|
|
15
|
+
*
|
|
16
|
+
* Checks that need more than the declaration and the tree read facts
|
|
17
|
+
* gathered before any check runs ({@link WorkspaceFacts}): member ledgers
|
|
18
|
+
* (./checks/ledgers.ts), recorded pipelines (./checks/pipelines.ts) and
|
|
19
|
+
* generated files (./checks/generated.ts). All of them share one id range
|
|
20
|
+
* (#2641):
|
|
21
|
+
*
|
|
22
|
+
* | Ids | Checks |
|
|
23
|
+
* |---|---|
|
|
24
|
+
* | WSP001 to WSP011 | the declaration and member kinds (this file) |
|
|
25
|
+
* | WSP071, WSP072 | member ledgers |
|
|
26
|
+
* | WSP081 to WSP083 | recorded pipelines |
|
|
27
|
+
* | WSP091 to WSP097 | member links (#2539) |
|
|
28
|
+
* | WSP101 to WSP106 | generated files |
|
|
29
|
+
*/
|
|
30
|
+
import type { LintDiagnostic, LintRule, Severity } from "../lint/rule.js";
|
|
31
|
+
import type { PostSynthDiagnostic } from "../lint/post-synth.js";
|
|
32
|
+
import { type Declaration, type ResolvedGroup } from "./declaration.js";
|
|
33
|
+
import type { ReasonCode } from "./reason-codes.js";
|
|
34
|
+
import { type KindLoadProblem, type KindRegistry } from "./kinds.js";
|
|
35
|
+
import { type WorkspaceTree } from "./tree.js";
|
|
36
|
+
import type { LinkTableRow } from "./links.js";
|
|
37
|
+
import { type GeneratedFileFacts } from "./checks/generated.js";
|
|
38
|
+
import { type MemberLedgerFacts } from "./checks/ledgers.js";
|
|
39
|
+
import { type MemberPipelineFacts } from "./checks/pipelines.js";
|
|
40
|
+
/**
|
|
41
|
+
* What the checks beyond the declaration read, gathered from the checkout
|
|
42
|
+
* before any check runs. A field left out was not gathered, and the checks
|
|
43
|
+
* that read it find nothing.
|
|
44
|
+
*/
|
|
45
|
+
export interface WorkspaceFacts {
|
|
46
|
+
/** Each `chant` member's ownership stack, environments and chant version. */
|
|
47
|
+
ledgers?: readonly MemberLedgerFacts[];
|
|
48
|
+
/** Each member's recorded generated files and the environments they deploy. */
|
|
49
|
+
pipelines?: readonly MemberPipelineFacts[];
|
|
50
|
+
/** Each declared or implicit generated file, with what its generator produced. */
|
|
51
|
+
generated?: readonly GeneratedFileFacts[];
|
|
52
|
+
}
|
|
53
|
+
/** What every declaration check reads. */
|
|
54
|
+
export interface WorkspaceCheckContext {
|
|
55
|
+
declaration: Declaration;
|
|
56
|
+
tree: WorkspaceTree;
|
|
57
|
+
groups: ResolvedGroup[];
|
|
58
|
+
kinds: KindRegistry;
|
|
59
|
+
/** Why some pinned kinds could not be read. */
|
|
60
|
+
kindProblems: KindLoadProblem[];
|
|
61
|
+
/** The facts gathered before the checks ran. */
|
|
62
|
+
facts?: WorkspaceFacts;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A finding from a declaration check: the post-synth diagnostic shape, with
|
|
66
|
+
* `entity` naming the entry it is about and `pointer` the place in the
|
|
67
|
+
* declaration to show.
|
|
68
|
+
*/
|
|
69
|
+
export interface WorkspaceDiagnostic extends PostSynthDiagnostic {
|
|
70
|
+
/** A JSON Pointer into the declaration. */
|
|
71
|
+
pointer: string;
|
|
72
|
+
}
|
|
73
|
+
export interface WorkspaceCheck {
|
|
74
|
+
/** `WSP` and three digits. Public once shipped. */
|
|
75
|
+
id: string;
|
|
76
|
+
/** A short name, for listings. */
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
severity: Severity;
|
|
80
|
+
/** False when the declaration may neither change the severity nor suppress it. */
|
|
81
|
+
configurable: boolean;
|
|
82
|
+
check(ctx: WorkspaceCheckContext): WorkspaceDiagnostic[];
|
|
83
|
+
}
|
|
84
|
+
/** A diagnostic ready for lint's reporters, with the entry it is about. */
|
|
85
|
+
export interface WorkspaceFinding extends LintDiagnostic {
|
|
86
|
+
entity?: string;
|
|
87
|
+
/** The read contract's reason code, for a WSP001 finding: why the declaration can't be read (#2536). */
|
|
88
|
+
code?: ReasonCode;
|
|
89
|
+
}
|
|
90
|
+
export interface SuppressedFinding extends WorkspaceFinding {
|
|
91
|
+
reason: string;
|
|
92
|
+
}
|
|
93
|
+
export interface DeclarationCheckReport {
|
|
94
|
+
/** The declaration file, relative to the directory the report was made for. */
|
|
95
|
+
file: string;
|
|
96
|
+
diagnostics: WorkspaceFinding[];
|
|
97
|
+
suppressed: SuppressedFinding[];
|
|
98
|
+
/** The member links, declared and inferred, as resolved in source (#2539). */
|
|
99
|
+
links: LinkTableRow[];
|
|
100
|
+
/** Whether an error-severity finding is active. */
|
|
101
|
+
ok: boolean;
|
|
102
|
+
}
|
|
103
|
+
/** The first id of the read failure, used by {@link runDeclarationChecks} when the declaration can't be read. */
|
|
104
|
+
export declare const UNREADABLE_CHECK_ID = "WSP001";
|
|
105
|
+
export declare const WORKSPACE_CHECKS: readonly WorkspaceCheck[];
|
|
106
|
+
/**
|
|
107
|
+
* The checks' metadata as lint rules, for the SARIF reporter's rule list.
|
|
108
|
+
* They are never run as lint rules.
|
|
109
|
+
*/
|
|
110
|
+
export declare function workspaceCheckRules(): LintRule[];
|
|
111
|
+
/** Run every check over a readable declaration. The settings are not applied yet. */
|
|
112
|
+
export declare function runWorkspaceChecks(ctx: WorkspaceCheckContext): WorkspaceDiagnostic[];
|
|
113
|
+
/**
|
|
114
|
+
* Apply the declaration's `checks` severities and entries' `suppress` to the
|
|
115
|
+
* findings. Fixed checks keep their severity and can't be suppressed; a
|
|
116
|
+
* setting that tries is itself a WSP011 finding.
|
|
117
|
+
*/
|
|
118
|
+
export declare function applyCheckSettings(declaration: Declaration, findings: WorkspaceDiagnostic[]): {
|
|
119
|
+
active: WorkspaceDiagnostic[];
|
|
120
|
+
suppressed: (WorkspaceDiagnostic & {
|
|
121
|
+
reason: string;
|
|
122
|
+
})[];
|
|
123
|
+
};
|
|
124
|
+
export interface DeclarationCheckOptions {
|
|
125
|
+
/**
|
|
126
|
+
* Gather the facts the ledger, pipeline and generated-file checks read.
|
|
127
|
+
* On by default. Off, only the declaration and kind checks find anything,
|
|
128
|
+
* and no member config is read.
|
|
129
|
+
*/
|
|
130
|
+
gather?: boolean;
|
|
131
|
+
/** Run each declared generator and compare its output (`--generated`). Off by default: generators run member code. */
|
|
132
|
+
runGenerators?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The files to check, such as a revision's (`chant workspace check --at`,
|
|
135
|
+
* #2536); the working tree under `root` by default. Kinds still come from
|
|
136
|
+
* the packages installed under `root`. With a tree, no facts are
|
|
137
|
+
* gathered: they describe the working tree, not the revision.
|
|
138
|
+
*/
|
|
139
|
+
tree?: WorkspaceTree;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Gather {@link WorkspaceFacts} for the declaration in `root`. Member
|
|
143
|
+
* configs are read statically, never run: the ledger facts read `ownership`
|
|
144
|
+
* and `environments`, and the generated-file facts read `lexicons`. Declared
|
|
145
|
+
* generators run only when `runGenerators` says so, and they are the only
|
|
146
|
+
* member code this runs.
|
|
147
|
+
*/
|
|
148
|
+
export declare function gatherWorkspaceFacts(root: string, declaration: Declaration, options?: {
|
|
149
|
+
runGenerators?: boolean;
|
|
150
|
+
}): Promise<WorkspaceFacts>;
|
|
151
|
+
/**
|
|
152
|
+
* Read the declaration in `root` (an absolute directory holding one, or the
|
|
153
|
+
* files of `options.tree` when given, such as a revision's), load the kinds
|
|
154
|
+
* its pins supply from `root`, gather the facts the member checks read, run
|
|
155
|
+
* every check and apply the declaration's settings. `file` in the findings
|
|
156
|
+
* is the declaration's path as `display` says, relative to where the
|
|
157
|
+
* command runs. Never throws a {@link WorkspaceReadError}: a declaration that
|
|
158
|
+
* can't be read is one WSP001 finding.
|
|
159
|
+
*/
|
|
160
|
+
export declare function runDeclarationChecks(root: string, display?: (file: string) => string, options?: DeclarationCheckOptions): Promise<DeclarationCheckReport>;
|
|
161
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src/workspace/checks.ts"],"names":[],"mapp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