@intentius/chant 0.13.1 → 0.15.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/catalog.d.ts +45 -5
- package/dist/audit/catalog.d.ts.map +1 -1
- package/dist/audit/proof.d.ts +3 -0
- package/dist/audit/proof.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +4 -1
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/report.d.ts +3 -0
- package/dist/audit/report.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts +8 -2
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/lexicon-rolling-upgrade.d.ts +37 -0
- package/dist/cli/commands/lexicon-rolling-upgrade.d.ts.map +1 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts +48 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/pinned-upgrade.d.ts +41 -0
- package/dist/cli/commands/pinned-upgrade.d.ts.map +1 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts +39 -0
- package/dist/cli/handlers/components.d.ts.map +1 -0
- package/dist/cli/handlers/dev.d.ts +3 -0
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/graph.d.ts +4 -2
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts +49 -0
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts +22 -0
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.d.ts +110 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -0
- package/dist/codegen/pinned-upgrade.d.ts +153 -0
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -0
- package/dist/codegen/rolling-upgrade.d.ts +138 -0
- package/dist/codegen/rolling-upgrade.d.ts.map +1 -0
- package/dist/codegen/surface-snapshot.d.ts +173 -0
- package/dist/codegen/surface-snapshot.d.ts.map +1 -0
- package/dist/codegen/version-bump.d.ts +21 -0
- package/dist/codegen/version-bump.d.ts.map +1 -0
- package/dist/components/auto-release.d.ts +93 -0
- package/dist/components/auto-release.d.ts.map +1 -0
- package/dist/components/builders.d.ts +37 -0
- package/dist/components/builders.d.ts.map +1 -0
- package/dist/components/capability-plugin-loader.d.ts +111 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -0
- package/dist/components/capability-plugin-schema.d.ts +24 -0
- package/dist/components/capability-plugin-schema.d.ts.map +1 -0
- package/dist/components/capability-plugin.d.ts +85 -0
- package/dist/components/capability-plugin.d.ts.map +1 -0
- package/dist/components/capability.d.ts +89 -0
- package/dist/components/capability.d.ts.map +1 -0
- package/dist/components/cli-support.d.ts +204 -0
- package/dist/components/cli-support.d.ts.map +1 -0
- package/dist/components/component.d.ts +179 -0
- package/dist/components/component.d.ts.map +1 -0
- package/dist/components/config-defaults.d.ts +41 -0
- package/dist/components/config-defaults.d.ts.map +1 -0
- package/dist/components/discover.d.ts +60 -0
- package/dist/components/discover.d.ts.map +1 -0
- package/dist/components/driver-output.d.ts +20 -0
- package/dist/components/driver-output.d.ts.map +1 -0
- package/dist/components/driver.d.ts +209 -0
- package/dist/components/driver.d.ts.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/manifest-persistence.d.ts +79 -0
- package/dist/components/manifest-persistence.d.ts.map +1 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts +27 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -0
- package/dist/components/pilots/dynamodb.pilot.d.ts +22 -0
- package/dist/components/pilots/dynamodb.pilot.d.ts.map +1 -0
- package/dist/components/pilots/jar-emr.pilot.d.ts +37 -0
- package/dist/components/pilots/jar-emr.pilot.d.ts.map +1 -0
- package/dist/components/pilots/lambda.pilot.d.ts +35 -0
- package/dist/components/pilots/lambda.pilot.d.ts.map +1 -0
- package/dist/components/pilots/neo4j-fanout.pilot.d.ts +17 -0
- package/dist/components/pilots/neo4j-fanout.pilot.d.ts.map +1 -0
- package/dist/components/pilots/project.d.ts +13 -0
- package/dist/components/pilots/project.d.ts.map +1 -0
- package/dist/components/presets/ecs-fargate.d.ts +59 -0
- package/dist/components/presets/ecs-fargate.d.ts.map +1 -0
- package/dist/components/presets/index.d.ts +29 -0
- package/dist/components/presets/index.d.ts.map +1 -0
- package/dist/components/presets/lambda.d.ts +35 -0
- package/dist/components/presets/lambda.d.ts.map +1 -0
- package/dist/components/presets/single-host-compose.d.ts +43 -0
- package/dist/components/presets/single-host-compose.d.ts.map +1 -0
- package/dist/components/registry.d.ts +29 -0
- package/dist/components/registry.d.ts.map +1 -0
- package/dist/components/starter-plugin.d.ts +51 -0
- package/dist/components/starter-plugin.d.ts.map +1 -0
- package/dist/components/temporal-codegen-loader.d.ts +27 -0
- package/dist/components/temporal-codegen-loader.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts +35 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-process-runner.d.ts +45 -0
- package/dist/components/verbs/__tests__/mock-process-runner.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts +33 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/bom-writer.d.ts +155 -0
- package/dist/components/verbs/bom-writer.d.ts.map +1 -0
- package/dist/components/verbs/build-archive.d.ts +205 -0
- package/dist/components/verbs/build-archive.d.ts.map +1 -0
- package/dist/components/verbs/build.d.ts +150 -0
- package/dist/components/verbs/build.d.ts.map +1 -0
- package/dist/components/verbs/cloud-executor.d.ts +88 -0
- package/dist/components/verbs/cloud-executor.d.ts.map +1 -0
- package/dist/components/verbs/component-bom.d.ts +103 -0
- package/dist/components/verbs/component-bom.d.ts.map +1 -0
- package/dist/components/verbs/index.d.ts +49 -0
- package/dist/components/verbs/index.d.ts.map +1 -0
- package/dist/components/verbs/license-policy.d.ts +56 -0
- package/dist/components/verbs/license-policy.d.ts.map +1 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts +81 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/process-runner.d.ts +64 -0
- package/dist/components/verbs/process-runner.d.ts.map +1 -0
- package/dist/components/verbs/reproducibility.d.ts +80 -0
- package/dist/components/verbs/reproducibility.d.ts.map +1 -0
- package/dist/components/verbs/sbom-generator.d.ts +157 -0
- package/dist/components/verbs/sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/sbom.d.ts +79 -0
- package/dist/components/verbs/sbom.d.ts.map +1 -0
- package/dist/components/verbs/shell.d.ts +35 -0
- package/dist/components/verbs/shell.d.ts.map +1 -0
- package/dist/components/verbs/sign.d.ts +222 -0
- package/dist/components/verbs/sign.d.ts.map +1 -0
- package/dist/components/verbs/stub.d.ts +18 -0
- package/dist/components/verbs/stub.d.ts.map +1 -0
- package/dist/components/verbs/tool-sbom-generator.d.ts +51 -0
- package/dist/components/verbs/tool-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/verify.d.ts +106 -0
- package/dist/components/verbs/verify.d.ts.map +1 -0
- package/dist/components/verbs/vex.d.ts +65 -0
- package/dist/components/verbs/vex.d.ts.map +1 -0
- package/dist/components/verbs/vuln-gate.d.ts +91 -0
- package/dist/components/verbs/vuln-gate.d.ts.map +1 -0
- package/dist/components/verbs/vuln-scan.d.ts +116 -0
- package/dist/components/verbs/vuln-scan.d.ts.map +1 -0
- package/dist/components/verbs/wait-verify.d.ts +85 -0
- package/dist/components/verbs/wait-verify.d.ts.map +1 -0
- package/dist/config.d.ts +205 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon.d.ts +78 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/build-ledger-store.d.ts +121 -0
- package/dist/lifecycle/build-ledger-store.d.ts.map +1 -0
- package/dist/lifecycle/build-ledger.d.ts +225 -0
- package/dist/lifecycle/build-ledger.d.ts.map +1 -0
- package/dist/lifecycle/git.d.ts +84 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +5 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/oras-referrer-lookup.d.ts +41 -0
- package/dist/lifecycle/oras-referrer-lookup.d.ts.map +1 -0
- package/dist/lifecycle/release-ledger.d.ts +122 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -0
- package/dist/lifecycle/status.d.ts +150 -0
- package/dist/lifecycle/status.d.ts.map +1 -0
- package/dist/lint/component-checks.d.ts +95 -0
- package/dist/lint/component-checks.d.ts.map +1 -0
- package/dist/lint/engine.d.ts +23 -0
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lint/presets/strict.json +8 -1
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts +10 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts +3 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts +3 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts +20 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts +28 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +39 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts +37 -0
- package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts +43 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts +22 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts +33 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts.map +1 -0
- package/dist/lint/rules/comp/index.d.ts +18 -0
- package/dist/lint/rules/comp/index.d.ts.map +1 -0
- package/dist/lint/rules/comp/support.d.ts +71 -0
- package/dist/lint/rules/comp/support.d.ts.map +1 -0
- package/dist/lsp/lexicon-providers.d.ts.map +1 -1
- package/dist/op/activity-registry.d.ts +11 -6
- package/dist/op/activity-registry.d.ts.map +1 -1
- package/dist/op/activity-runtime.d.ts +24 -0
- package/dist/op/activity-runtime.d.ts.map +1 -0
- package/dist/op/builders.d.ts +56 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/index.d.ts +2 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/ownership.d.ts +20 -14
- package/dist/ownership.d.ts.map +1 -1
- package/package.json +14 -1
- package/src/audit/catalog.test.ts +74 -22
- package/src/audit/catalog.ts +74 -471
- package/src/audit/proof.ts +4 -2
- package/src/audit/report-html.test.ts +14 -7
- package/src/audit/report-model.ts +20 -9
- package/src/audit/report.test.ts +36 -13
- package/src/audit/report.ts +2 -0
- package/src/audit/rules-doc.test.ts +8 -6
- package/src/audit/rules-doc.ts +13 -5
- package/src/cli/commands/audit.ts +23 -18
- package/src/cli/commands/component-lint.test.ts +158 -0
- package/src/cli/commands/doctor.test.ts +116 -2
- package/src/cli/commands/doctor.ts +46 -0
- package/src/cli/commands/lexicon-rolling-upgrade.ts +198 -0
- package/src/cli/commands/lexicon-surface-diff.test.ts +104 -0
- package/src/cli/commands/lexicon-surface-diff.ts +185 -0
- package/src/cli/commands/lint.ts +142 -1
- package/src/cli/commands/pinned-upgrade.ts +204 -0
- package/src/cli/handlers/build.ts +58 -1
- package/src/cli/handlers/components.test.ts +504 -0
- package/src/cli/handlers/components.ts +404 -0
- package/src/cli/handlers/dev.ts +60 -1
- package/src/cli/handlers/graph.ts +47 -2
- package/src/cli/handlers/misc.ts +45 -1
- package/src/cli/handlers/run.test.ts +967 -3
- package/src/cli/handlers/run.ts +618 -11
- package/src/cli/main.test.ts +66 -0
- package/src/cli/main.ts +105 -2
- package/src/cli/registry.ts +35 -0
- package/src/codegen/fetch.test.ts +84 -3
- package/src/codegen/fetch.ts +76 -2
- package/src/codegen/lexicon-regen.test.ts +298 -0
- package/src/codegen/lexicon-regen.ts +545 -0
- package/src/codegen/pinned-upgrade.test.ts +399 -0
- package/src/codegen/pinned-upgrade.ts +423 -0
- package/src/codegen/rolling-upgrade.test.ts +333 -0
- package/src/codegen/rolling-upgrade.ts +320 -0
- package/src/codegen/surface-snapshot.test.ts +461 -0
- package/src/codegen/surface-snapshot.ts +546 -0
- package/src/codegen/version-bump.test.ts +47 -0
- package/src/codegen/version-bump.ts +39 -0
- package/src/components/README.md +130 -0
- package/src/components/SPRAWL-VALIDATION.md +181 -0
- package/src/components/__fixtures__/alb-ecs-service.json +51 -0
- package/src/components/__fixtures__/dynamodb-infra.json +32 -0
- package/src/components/__fixtures__/emr-job-consumer.json +26 -0
- package/src/components/__fixtures__/jar-lib-producer.json +16 -0
- package/src/components/__fixtures__/lambda-image-processor.json +28 -0
- package/src/components/__fixtures__/neo4j-fanout.json +34 -0
- package/src/components/__fixtures__/single-host-compose.json +29 -0
- package/src/components/auto-release.test.ts +217 -0
- package/src/components/auto-release.ts +216 -0
- package/src/components/builders.test.ts +45 -0
- package/src/components/builders.ts +71 -0
- package/src/components/capability-plugin-loader.ts +218 -0
- package/src/components/capability-plugin-schema.ts +56 -0
- package/src/components/capability-plugin.test.ts +235 -0
- package/src/components/capability-plugin.ts +108 -0
- package/src/components/capability.ts +117 -0
- package/src/components/cli-support.test.ts +579 -0
- package/src/components/cli-support.ts +481 -0
- package/src/components/component-schema.test.ts +265 -0
- package/src/components/component.schema.json +235 -0
- package/src/components/component.test.ts +251 -0
- package/src/components/component.ts +255 -0
- package/src/components/config-defaults.test.ts +263 -0
- package/src/components/config-defaults.ts +145 -0
- package/src/components/discover.test.ts +352 -0
- package/src/components/discover.ts +167 -0
- package/src/components/driver-output.ts +71 -0
- package/src/components/driver.test.ts +638 -0
- package/src/components/driver.ts +690 -0
- package/src/components/index.ts +113 -0
- package/src/components/manifest-persistence.test.ts +152 -0
- package/src/components/manifest-persistence.ts +164 -0
- package/src/components/pilots/README.md +33 -0
- package/src/components/pilots/alb-ecs.pilot.ts +63 -0
- package/src/components/pilots/dynamodb.pilot.ts +59 -0
- package/src/components/pilots/jar-emr.pilot.ts +69 -0
- package/src/components/pilots/lambda.pilot.ts +55 -0
- package/src/components/pilots/neo4j-fanout.pilot.ts +92 -0
- package/src/components/pilots/pilots-lint-clean.test.ts +78 -0
- package/src/components/pilots/pilots.test.ts +126 -0
- package/src/components/pilots/project.ts +13 -0
- package/src/components/presets/comp007-reduction.test.ts +122 -0
- package/src/components/presets/ecs-fargate.test.ts +84 -0
- package/src/components/presets/ecs-fargate.ts +103 -0
- package/src/components/presets/index.ts +32 -0
- package/src/components/presets/lambda.test.ts +35 -0
- package/src/components/presets/lambda.ts +53 -0
- package/src/components/presets/single-host-compose.test.ts +65 -0
- package/src/components/presets/single-host-compose.ts +64 -0
- package/src/components/registry.test.ts +112 -0
- package/src/components/registry.ts +37 -0
- package/src/components/starter-plugin.ts +105 -0
- package/src/components/temporal-codegen-loader.ts +41 -0
- package/src/components/verbs/__fixtures__/package-lock.json +45 -0
- package/src/components/verbs/__fixtures__/pom.xml +37 -0
- package/src/components/verbs/__fixtures__/schemas/cyclonedx-1.5.schema.json +3800 -0
- package/src/components/verbs/__fixtures__/schemas/cyclonedx-spdx-license.schema.json +621 -0
- package/src/components/verbs/__fixtures__/schemas/jsf-0.82.schema.json +240 -0
- package/src/components/verbs/__fixtures__/schemas/spdx-2.3.schema.json +740 -0
- package/src/components/verbs/__tests__/mock-cloud-executor.ts +102 -0
- package/src/components/verbs/__tests__/mock-process-runner.ts +79 -0
- package/src/components/verbs/__tests__/mock-sbom-generator.ts +85 -0
- package/src/components/verbs/bom-writer.test.ts +331 -0
- package/src/components/verbs/bom-writer.ts +386 -0
- package/src/components/verbs/build-archive.test.ts +251 -0
- package/src/components/verbs/build-archive.ts +296 -0
- package/src/components/verbs/build.test.ts +222 -0
- package/src/components/verbs/build.ts +252 -0
- package/src/components/verbs/cloud-executor.ts +181 -0
- package/src/components/verbs/component-bom.test.ts +219 -0
- package/src/components/verbs/component-bom.ts +189 -0
- package/src/components/verbs/index.ts +49 -0
- package/src/components/verbs/license-policy.ts +115 -0
- package/src/components/verbs/lockfile-sbom-generator.test.ts +195 -0
- package/src/components/verbs/lockfile-sbom-generator.ts +236 -0
- package/src/components/verbs/process-runner.test.ts +79 -0
- package/src/components/verbs/process-runner.ts +113 -0
- package/src/components/verbs/reproducibility.test.ts +24 -0
- package/src/components/verbs/reproducibility.ts +100 -0
- package/src/components/verbs/sbom-generator.test.ts +96 -0
- package/src/components/verbs/sbom-generator.ts +209 -0
- package/src/components/verbs/sbom.test.ts +184 -0
- package/src/components/verbs/sbom.ts +152 -0
- package/src/components/verbs/shell.test.ts +36 -0
- package/src/components/verbs/shell.ts +51 -0
- package/src/components/verbs/sign.test.ts +210 -0
- package/src/components/verbs/sign.ts +350 -0
- package/src/components/verbs/stub.ts +34 -0
- package/src/components/verbs/tool-sbom-generator.test.ts +194 -0
- package/src/components/verbs/tool-sbom-generator.ts +192 -0
- package/src/components/verbs/verify.test.ts +159 -0
- package/src/components/verbs/verify.ts +179 -0
- package/src/components/verbs/vex.ts +182 -0
- package/src/components/verbs/vuln-gate.test.ts +201 -0
- package/src/components/verbs/vuln-gate.ts +170 -0
- package/src/components/verbs/vuln-scan.test.ts +145 -0
- package/src/components/verbs/vuln-scan.ts +266 -0
- package/src/components/verbs/wait-verify.test.ts +111 -0
- package/src/components/verbs/wait-verify.ts +171 -0
- package/src/config.test.ts +74 -1
- package/src/config.ts +219 -0
- package/src/index.ts +32 -0
- package/src/lexicon.ts +88 -0
- package/src/lifecycle/build-ledger-store.test.ts +217 -0
- package/src/lifecycle/build-ledger-store.ts +165 -0
- package/src/lifecycle/build-ledger.test.ts +349 -0
- package/src/lifecycle/build-ledger.ts +305 -0
- package/src/lifecycle/git.test.ts +118 -0
- package/src/lifecycle/git.ts +149 -14
- package/src/lifecycle/index.ts +5 -0
- package/src/lifecycle/oras-referrer-lookup.test.ts +116 -0
- package/src/lifecycle/oras-referrer-lookup.ts +110 -0
- package/src/lifecycle/release-ledger.test.ts +209 -0
- package/src/lifecycle/release-ledger.ts +185 -0
- package/src/lifecycle/status.test.ts +330 -0
- package/src/lifecycle/status.ts +278 -0
- package/src/lint/component-checks.ts +148 -0
- package/src/lint/config.test.ts +21 -0
- package/src/lint/engine.ts +11 -2
- package/src/lint/presets/relaxed.json +8 -1
- package/src/lint/presets/strict.json +8 -1
- package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.ts +9 -0
- package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.ts +9 -0
- package/src/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.ts +11 -0
- package/src/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.ts +11 -0
- package/src/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.ts +27 -0
- package/src/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.ts +23 -0
- package/src/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.ts +19 -0
- package/src/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.ts +20 -0
- package/src/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.ts +23 -0
- package/src/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.ts +14 -0
- package/src/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.ts +18 -0
- package/src/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.ts +14 -0
- package/src/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.ts +12 -0
- package/src/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.ts +18 -0
- package/src/lint/rules/comp/comp.test.ts +378 -0
- package/src/lint/rules/comp/comp001-publishes-never-applies.ts +78 -0
- package/src/lint/rules/comp/comp002-dangling-wiring-ref.ts +94 -0
- package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +115 -0
- package/src/lint/rules/comp/comp004-gate-needs-temporal.ts +66 -0
- package/src/lint/rules/comp/comp005-capability-kind-is-noun.ts +113 -0
- package/src/lint/rules/comp/comp006-shell-needs-reason.ts +55 -0
- package/src/lint/rules/comp/comp007-composition-sprawl.ts +71 -0
- package/src/lint/rules/comp/index.ts +37 -0
- package/src/lint/rules/comp/support.ts +173 -0
- package/src/lsp/lexicon-providers.test.ts +55 -0
- package/src/lsp/lexicon-providers.ts +13 -3
- package/src/op/activity-registry.test.ts +38 -0
- package/src/op/activity-registry.ts +31 -12
- package/src/op/activity-runtime.ts +73 -0
- package/src/op/builders.ts +92 -0
- package/src/op/index.ts +3 -1
- package/src/ownership.test.ts +24 -26
- package/src/ownership.ts +26 -38
package/dist/codegen/fetch.d.ts
CHANGED
|
@@ -19,11 +19,33 @@ export interface FetchConfig {
|
|
|
19
19
|
* Permanent failures (e.g. 404, 403) are not retried — they throw on the
|
|
20
20
|
* first response. The returned response is guaranteed `ok`.
|
|
21
21
|
*
|
|
22
|
+
* When a `Retry-After` header is present on a 429 or 503 response the delay
|
|
23
|
+
* from that header is used instead of the exponential back-off for that
|
|
24
|
+
* specific retry, capped at {@link MAX_RETRY_AFTER_MS}.
|
|
25
|
+
*
|
|
22
26
|
* `init` is passed through to `fetch` on every attempt, so callers that
|
|
23
27
|
* need request headers (e.g. the GitHub API `Accept` header) or an abort
|
|
24
28
|
* signal get retries without duplicating the loop.
|
|
29
|
+
*
|
|
30
|
+
* On exhaustion a descriptive {@link TransientFetchError} is thrown rather
|
|
31
|
+
* than the raw last error so the caller can surface a human-readable message.
|
|
25
32
|
*/
|
|
26
33
|
export declare function fetchWithRetry(url: string, retries?: number, backoffMs?: number, init?: RequestInit): Promise<Response>;
|
|
34
|
+
/**
|
|
35
|
+
* Thrown when {@link fetchWithRetry} exhausts all retry attempts on a
|
|
36
|
+
* transient failure (429 / 5xx / network error).
|
|
37
|
+
*
|
|
38
|
+
* The message is human-readable and actionable: it names the URL, the number
|
|
39
|
+
* of attempts made, and the last HTTP status (if any) so that an upstream Op
|
|
40
|
+
* can route it to a report/issue without exposing a raw stack trace.
|
|
41
|
+
*/
|
|
42
|
+
export declare class TransientFetchError extends Error {
|
|
43
|
+
readonly url: string;
|
|
44
|
+
readonly retries: number;
|
|
45
|
+
readonly lastStatus: number | undefined;
|
|
46
|
+
readonly cause?: Error | undefined;
|
|
47
|
+
constructor(url: string, retries: number, lastStatus: number | undefined, cause?: Error | undefined);
|
|
48
|
+
}
|
|
27
49
|
/**
|
|
28
50
|
* Fetch a URL with local file caching.
|
|
29
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/codegen/fetch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/codegen/fetch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA4CD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,SAAkB,EACzB,SAAS,SAAqB,EAC9B,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CA0CnB;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAE1B,GAAG,EAAE,MAAM;aACX,OAAO,EAAE,MAAM;aACf,UAAU,EAAE,MAAM,GAAG,SAAS;aAC9B,KAAK,CAAC,EAAE,KAAK;gBAHb,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,CAAC,EAAE,KAAK,YAAA;CAUhC;AAMD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BxF;AAID;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACjC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAU9B;AAID;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyDrB;AAID,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,UAAQ,GACZ,OAAO,CAAC,MAAM,CAAC,CAoDjB;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAMtD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexicon regen-validate pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Given a lexicon root directory, this module:
|
|
5
|
+
* 1. Runs the prepack chain (generate -> bundle -> validate -> build)
|
|
6
|
+
* by invoking `npm run <script>` in the lexicon directory.
|
|
7
|
+
* 2. Runs `chant lint` on any examples found under `examples/`.
|
|
8
|
+
* 3. Extracts the generated public API surface.
|
|
9
|
+
* 4. Diffs the fresh surface against the committed per-lexicon baseline
|
|
10
|
+
* (`surface.snapshot.json` at the lexicon root).
|
|
11
|
+
* 5. Returns { ok, changed, severity, delta, failures } — never throws.
|
|
12
|
+
*
|
|
13
|
+
* Supply-chain guarantee:
|
|
14
|
+
* All spec fetching happens through the lexicon's own `generate` script,
|
|
15
|
+
* which is pinned to the lexicon's existing fetch layer (cached, TTL-based).
|
|
16
|
+
* When `force` is true, the cache is bypassed and the spec is re-downloaded.
|
|
17
|
+
* This module never executes spec-provided content — it only reads the
|
|
18
|
+
* artifacts that the generate script produced.
|
|
19
|
+
*
|
|
20
|
+
* Never auto-fix:
|
|
21
|
+
* Any failure is captured into `failures` and returned. This module never
|
|
22
|
+
* rewrites examples, skips checks, or masks errors.
|
|
23
|
+
*/
|
|
24
|
+
import { type SurfaceDelta, type ChangeSeverity, type SurfaceSnapshot } from "./surface-snapshot.js";
|
|
25
|
+
export interface RegenFailure {
|
|
26
|
+
/**
|
|
27
|
+
* Which step failed:
|
|
28
|
+
* "setup" | "digest-verify" | "generate" | "bundle" | "validate"
|
|
29
|
+
* | "build" | "lint" | "examples" | "surface-extract" | "surface-diff"
|
|
30
|
+
*/
|
|
31
|
+
step: string;
|
|
32
|
+
/** Exit code from the subprocess, if applicable. */
|
|
33
|
+
exitCode?: number;
|
|
34
|
+
/** Combined stdout+stderr output captured from the subprocess. */
|
|
35
|
+
output: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RegenResult {
|
|
38
|
+
/** True only when all steps passed and (if a baseline exists) the diff completed. */
|
|
39
|
+
ok: boolean;
|
|
40
|
+
/** True when the surface changed versus the baseline. */
|
|
41
|
+
changed: boolean;
|
|
42
|
+
/** Rolled-up severity of the surface delta. "none" when unchanged. */
|
|
43
|
+
severity: ChangeSeverity;
|
|
44
|
+
/** Structured delta: what was added, changed, or removed. */
|
|
45
|
+
delta: SurfaceDelta;
|
|
46
|
+
/** Human-readable delta text (empty string when no changes). */
|
|
47
|
+
deltaText: string;
|
|
48
|
+
/** Step failures captured during the run. */
|
|
49
|
+
failures: RegenFailure[];
|
|
50
|
+
/** Fresh surface snapshot — caller can write this as the new baseline. */
|
|
51
|
+
freshSnapshot: SurfaceSnapshot | null;
|
|
52
|
+
}
|
|
53
|
+
export interface RegenOptions {
|
|
54
|
+
/**
|
|
55
|
+
* Root of the lexicon package (e.g. `/path/to/lexicons/aws`).
|
|
56
|
+
* Must contain a `package.json` with `generate`, `bundle`, `validate`, `build` scripts.
|
|
57
|
+
*/
|
|
58
|
+
lexiconDir: string;
|
|
59
|
+
/**
|
|
60
|
+
* When true, pass `CHANT_FORCE_FETCH=1` to the generate step so the spec is
|
|
61
|
+
* re-downloaded from upstream even if the cache is fresh.
|
|
62
|
+
*/
|
|
63
|
+
force?: boolean;
|
|
64
|
+
/** Print subprocess output as it runs. Default: false. */
|
|
65
|
+
verbose?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Skip the `bundle` step. Useful when testing without a full dist build.
|
|
68
|
+
* Default: false.
|
|
69
|
+
*/
|
|
70
|
+
skipBundle?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Skip the `build` (tsc) step. Useful in test contexts where tsc is not available.
|
|
73
|
+
* Default: false.
|
|
74
|
+
*/
|
|
75
|
+
skipBuild?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Skip running `chant lint` on examples.
|
|
78
|
+
* Default: false.
|
|
79
|
+
*/
|
|
80
|
+
skipLint?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Skip running example deploy harness (npm run deploy / npm run build in each example).
|
|
83
|
+
* Default: true (examples require live cloud credentials; opt-in only).
|
|
84
|
+
*/
|
|
85
|
+
skipExamples?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Path to a SHA-256 digest file pinning the spec cache file.
|
|
88
|
+
*
|
|
89
|
+
* When provided, this module verifies the digest of the cached spec file
|
|
90
|
+
* before invoking `generate`. This is the supply-chain choke point:
|
|
91
|
+
* untrusted upstream content is verified here before any downstream processing.
|
|
92
|
+
* The spec file is never executed — only checksummed and then passed to the
|
|
93
|
+
* lexicon's own generator as data.
|
|
94
|
+
*
|
|
95
|
+
* File format (shasum -a 256 style):
|
|
96
|
+
* sha256:<64-hex-chars> <relative-path-to-spec-file>
|
|
97
|
+
*/
|
|
98
|
+
pinnedDigestPath?: string;
|
|
99
|
+
}
|
|
100
|
+
export declare const SNAPSHOT_FILENAME = "surface.snapshot.json";
|
|
101
|
+
/**
|
|
102
|
+
* Run the full regen-validate pipeline for a lexicon and return the result.
|
|
103
|
+
*/
|
|
104
|
+
export declare function regenLexicon(opts: RegenOptions): Promise<RegenResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Write the fresh surface snapshot to the lexicon's committed baseline file.
|
|
107
|
+
* Call this after a successful regen when the snapshot should be updated.
|
|
108
|
+
*/
|
|
109
|
+
export declare function writeSurfaceSnapshot(lexiconDir: string, snapshot: SurfaceSnapshot): void;
|
|
110
|
+
//# sourceMappingURL=lexicon-regen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-regen.d.ts","sourceRoot":"","sources":["../../src/codegen/lexicon-regen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,qFAAqF;IACrF,EAAE,EAAE,OAAO,CAAC;IACZ,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,QAAQ,EAAE,cAAc,CAAC;IACzB,6DAA6D;IAC7D,KAAK,EAAE,YAAY,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,0EAA0E;IAC1E,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAyH3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAGxF"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pinned-version upgrade detection for k8s, gcp, docker, gitlab lexicons.
|
|
3
|
+
*
|
|
4
|
+
* For each lexicon with a pinned upstream version constant, this module:
|
|
5
|
+
* 1. Reads the currently pinned version from the source file.
|
|
6
|
+
* 2. Queries upstream for the latest stable release tag (no pre-release/rc).
|
|
7
|
+
* 3. Compares using semver ordering. If a newer version exists:
|
|
8
|
+
* a. Edits the version constant in the source file.
|
|
9
|
+
* b. Invokes regenLexicon to regenerate and surface-diff.
|
|
10
|
+
* c. Reverts the constant edit (dry-run mode — never commits the bump).
|
|
11
|
+
* 4. Returns a structured report per lexicon.
|
|
12
|
+
*
|
|
13
|
+
* The upstream-query functions are injectable — pass a mock for unit tests.
|
|
14
|
+
* The actual HTTP calls use the GitHub Releases/Tags API.
|
|
15
|
+
*
|
|
16
|
+
* Design decisions:
|
|
17
|
+
* - "Latest stable" = highest semver excluding tags containing rc/alpha/beta/preview.
|
|
18
|
+
* - The bump is always reverted after regen so the working tree is unchanged.
|
|
19
|
+
* Only the CLI reporter (#527) actually creates branches/PRs.
|
|
20
|
+
* - Each lexicon's upstream query is a pure async function: () => Promise<string | null>
|
|
21
|
+
* (returns the latest version tag, or null when no stable release is found).
|
|
22
|
+
*/
|
|
23
|
+
import { type RegenResult } from "./lexicon-regen.js";
|
|
24
|
+
import { type UpstreamPin } from "../lexicon.js";
|
|
25
|
+
/**
|
|
26
|
+
* A pinned, self-upgradable lexicon's name (e.g. "k8s"). Any lexicon whose
|
|
27
|
+
* plugin declares `upstreamPin` (../lexicon.ts) is eligible — the set is no
|
|
28
|
+
* longer hard-coded here.
|
|
29
|
+
*/
|
|
30
|
+
export type LexiconId = string;
|
|
31
|
+
export type { UpstreamPin };
|
|
32
|
+
export interface UpgradeCheckResult {
|
|
33
|
+
/** Lexicon identifier. */
|
|
34
|
+
lexicon: LexiconId;
|
|
35
|
+
/** Whether a newer stable upstream version was found. */
|
|
36
|
+
hasUpgrade: boolean;
|
|
37
|
+
/** Current pinned version string (e.g. "v1.32.0"). */
|
|
38
|
+
from: string;
|
|
39
|
+
/** Latest upstream version string, if one was found (e.g. "v1.33.0"). */
|
|
40
|
+
to: string | null;
|
|
41
|
+
/** Regen/surface-diff result — only present when hasUpgrade is true. */
|
|
42
|
+
validation: RegenResult | null;
|
|
43
|
+
/** Human-readable error when the upstream query itself failed. */
|
|
44
|
+
fetchError: string | null;
|
|
45
|
+
}
|
|
46
|
+
/** Injectable upstream version resolver. Returns the latest stable tag or null. */
|
|
47
|
+
export type UpstreamResolver = () => Promise<string | null>;
|
|
48
|
+
export interface CheckPinnedUpgradeOptions {
|
|
49
|
+
/** Resolved path to the lexicon root (e.g. /repo/lexicons/k8s). */
|
|
50
|
+
lexiconDir: string;
|
|
51
|
+
/** Which lexicon to check. */
|
|
52
|
+
lexicon: LexiconId;
|
|
53
|
+
/**
|
|
54
|
+
* Override the upstream resolver (useful in tests to inject mocks).
|
|
55
|
+
* When omitted the real GitHub API is called.
|
|
56
|
+
*/
|
|
57
|
+
resolverOverride?: UpstreamResolver;
|
|
58
|
+
/**
|
|
59
|
+
* When true, pass force=true to regenLexicon so the spec cache is bypassed.
|
|
60
|
+
* Default: false (use cached spec for the upgrade check).
|
|
61
|
+
*/
|
|
62
|
+
force?: boolean;
|
|
63
|
+
/** Forward to regenLexicon. */
|
|
64
|
+
verbose?: boolean;
|
|
65
|
+
/** Forward to regenLexicon — skip tsc step for speed in tests. */
|
|
66
|
+
skipBuild?: boolean;
|
|
67
|
+
/** Forward to regenLexicon. */
|
|
68
|
+
skipBundle?: boolean;
|
|
69
|
+
/** Forward to regenLexicon. */
|
|
70
|
+
skipLint?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parse a version string into numeric segments.
|
|
74
|
+
*
|
|
75
|
+
* Strips leading "v" and any build-metadata suffix after "-".
|
|
76
|
+
* Returns null when the string is not a parseable version.
|
|
77
|
+
*/
|
|
78
|
+
export declare function parseVersion(tag: string): number[] | null;
|
|
79
|
+
/**
|
|
80
|
+
* Compare two version tuples lexicographically.
|
|
81
|
+
* Returns -1 when a < b, 0 when equal, +1 when a > b.
|
|
82
|
+
*/
|
|
83
|
+
export declare function compareVersionTuples(a: number[], b: number[]): -1 | 0 | 1;
|
|
84
|
+
/**
|
|
85
|
+
* Return true when `candidate` is strictly newer than `current`.
|
|
86
|
+
*
|
|
87
|
+
* Strips build-metadata suffixes (e.g. "-ee") before comparing so that
|
|
88
|
+
* "v17.9.0-ee" and "v17.9.0" compare by numeric part only.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isNewer(candidate: string, current: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Return true when a release tag looks like a pre-release.
|
|
93
|
+
* Filters out rc, alpha, beta, preview, nightly, dev, canary suffixes.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isPreRelease(tag: string): boolean;
|
|
96
|
+
interface PinLocation {
|
|
97
|
+
/** Absolute path to the file containing the version constant. */
|
|
98
|
+
filePath: string;
|
|
99
|
+
/** Regex that matches the full constant line (must have a capture for the version). */
|
|
100
|
+
pattern: RegExp;
|
|
101
|
+
/** Function to build the replacement line given the new version string. */
|
|
102
|
+
buildReplacement: (newVersion: string, oldVersion: string, line: string) => string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Read the current pinned version from a source file using a regex pattern.
|
|
106
|
+
* Returns null when the pattern is not found.
|
|
107
|
+
*/
|
|
108
|
+
export declare function readPinnedVersion(location: PinLocation): string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Apply a version bump by replacing the constant in the source file.
|
|
111
|
+
* Returns the original file content so it can be reverted.
|
|
112
|
+
*/
|
|
113
|
+
export declare function applyVersionBump(location: PinLocation, newVersion: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Revert a file to its original content (undo a bump).
|
|
116
|
+
*/
|
|
117
|
+
export declare function revertVersionBump(filePath: string, original: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* Load a lexicon's `upstreamPin` descriptor from its plugin package
|
|
120
|
+
* (`@intentius/chant-lexicon-<name>`) — the lexicon's own declaration of where
|
|
121
|
+
* its version constant lives and which upstream repo to check. Returns null
|
|
122
|
+
* when the package can't be resolved or declares no `upstreamPin` (i.e. it is
|
|
123
|
+
* not self-upgradable). Mirrors ../components/capability-plugin-loader.ts's
|
|
124
|
+
* lexicon-borne loading.
|
|
125
|
+
*/
|
|
126
|
+
export declare function loadUpstreamPin(lexicon: LexiconId): Promise<UpstreamPin | null>;
|
|
127
|
+
/**
|
|
128
|
+
* Check whether a newer upstream release exists for a pinned lexicon.
|
|
129
|
+
*
|
|
130
|
+
* When a newer version is found:
|
|
131
|
+
* 1. Applies the version bump to the source constant.
|
|
132
|
+
* 2. Runs regenLexicon (surface-diff pipeline).
|
|
133
|
+
* 3. Reverts the bump unconditionally.
|
|
134
|
+
*
|
|
135
|
+
* The caller receives the full result including the regen validation output
|
|
136
|
+
* without any lasting change to the working tree.
|
|
137
|
+
*/
|
|
138
|
+
export declare function checkPinnedUpgrade(opts: CheckPinnedUpgradeOptions): Promise<UpgradeCheckResult>;
|
|
139
|
+
/**
|
|
140
|
+
* Apply a version bump for a lexicon permanently (without reverting).
|
|
141
|
+
*
|
|
142
|
+
* Called by LexiconUpgradeOp when it has already decided to commit the bump
|
|
143
|
+
* to a branch. Returns the absolute path to the modified file so the caller
|
|
144
|
+
* can stage it with `git add`.
|
|
145
|
+
*
|
|
146
|
+
* Unlike `applyVersionBump` (which is generic), this function takes only a
|
|
147
|
+
* lexicon id and directory — it resolves the pin location from the lexicon's
|
|
148
|
+
* declared `upstreamPin` descriptor.
|
|
149
|
+
*/
|
|
150
|
+
export declare function applyPinnedVersionBump(lexicon: LexiconId, lexiconDir: string, newVersion: string): Promise<{
|
|
151
|
+
filePath: string;
|
|
152
|
+
}>;
|
|
153
|
+
//# sourceMappingURL=pinned-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinned-upgrade.d.ts","sourceRoot":"","sources":["../../src/codegen/pinned-upgrade.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rolling-spec drift detection for aws, azure, and github lexicons.
|
|
3
|
+
*
|
|
4
|
+
* These lexicons have no pinned version constant — "latest" is fetched on every
|
|
5
|
+
* regen. An upgrade means regenerating from current-latest and diffing the
|
|
6
|
+
* produced API surface against the committed baseline (surface.snapshot.json).
|
|
7
|
+
* If the surface changed and validation passed, a PR can be opened with the
|
|
8
|
+
* delta as the review payload.
|
|
9
|
+
*
|
|
10
|
+
* This module contains only pure business logic (detecting drift, classifying
|
|
11
|
+
* it, formatting the report). It calls regenLexicon from #524 for the actual
|
|
12
|
+
* regen/validate work, and never runs a live regen itself.
|
|
13
|
+
*
|
|
14
|
+
* azure extra delta:
|
|
15
|
+
* The Azure regen depends on `latestVersionPerProvider`, which picks one API
|
|
16
|
+
* version per ARM provider. When new providers appear or existing ones get a
|
|
17
|
+
* newer GA/preview version, that shows up in the surface diff. In addition,
|
|
18
|
+
* this module computes an `apiVersionDelta` to surface those version changes
|
|
19
|
+
* separately, so reviewers can see "Microsoft.Compute moved 2022-03-01 →
|
|
20
|
+
* 2023-07-01" without reading the raw surface diff.
|
|
21
|
+
*/
|
|
22
|
+
import { type SurfaceDelta, type ChangeSeverity, type SurfaceSnapshot } from "./surface-snapshot.js";
|
|
23
|
+
import { type RegenOptions, type RegenResult } from "./lexicon-regen.js";
|
|
24
|
+
export type RollingLexicon = "aws" | "azure" | "github";
|
|
25
|
+
/**
|
|
26
|
+
* An API-version change for one Azure ARM provider.
|
|
27
|
+
* Only populated for the azure lexicon.
|
|
28
|
+
*/
|
|
29
|
+
export interface AzureApiVersionChange {
|
|
30
|
+
provider: string;
|
|
31
|
+
before: string | null;
|
|
32
|
+
after: string | null;
|
|
33
|
+
/** "added" when provider is new; "updated" when version bumped; "removed" when gone. */
|
|
34
|
+
kind: "added" | "updated" | "removed";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The result of a rolling-upgrade check for one lexicon.
|
|
38
|
+
*/
|
|
39
|
+
export interface RollingUpgradeResult {
|
|
40
|
+
/** Lexicon identifier. */
|
|
41
|
+
lexicon: RollingLexicon;
|
|
42
|
+
/** True when the surface changed versus the committed baseline. */
|
|
43
|
+
hasUpgrade: boolean;
|
|
44
|
+
/** Severity of the surface delta. "none" when the surface is unchanged. */
|
|
45
|
+
severity: ChangeSeverity;
|
|
46
|
+
/** Structured surface delta. */
|
|
47
|
+
delta: SurfaceDelta;
|
|
48
|
+
/** Human-readable delta text. Empty when no changes. */
|
|
49
|
+
deltaText: string;
|
|
50
|
+
/** Whether regen+validation passed. False means the delta is unreliable. */
|
|
51
|
+
validationOk: boolean;
|
|
52
|
+
/** Failures captured during regen. */
|
|
53
|
+
failures: RegenResult["failures"];
|
|
54
|
+
/** azure-only: per-provider API version changes. Empty for aws/github. */
|
|
55
|
+
apiVersionDelta: AzureApiVersionChange[];
|
|
56
|
+
/** The fresh snapshot produced by the regen. Null when regen failed. */
|
|
57
|
+
freshSnapshot: SurfaceSnapshot | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Options for checkRollingUpgrade.
|
|
61
|
+
*/
|
|
62
|
+
export interface CheckRollingUpgradeOptions {
|
|
63
|
+
/** Root of the lexicon package (must contain package.json and surface.snapshot.json). */
|
|
64
|
+
lexiconDir: string;
|
|
65
|
+
/** Force re-fetch of the upstream spec (bypass cache). Default: false. */
|
|
66
|
+
force?: boolean;
|
|
67
|
+
/** Print subprocess output while running. Default: false. */
|
|
68
|
+
verbose?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Override for the regen function — inject a mock in tests.
|
|
71
|
+
* Defaults to the production regenLexicon.
|
|
72
|
+
*/
|
|
73
|
+
_regenFn?: (opts: RegenOptions) => Promise<RegenResult>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check whether the rolling spec has drifted since the committed baseline.
|
|
77
|
+
*
|
|
78
|
+
* Calls regenLexicon (from #524) to regenerate from current-latest, then diffs
|
|
79
|
+
* the resulting surface against the committed surface.snapshot.json. Returns
|
|
80
|
+
* hasUpgrade=true when the surface changed and validation passed.
|
|
81
|
+
*
|
|
82
|
+
* For azure, also computes an apiVersionDelta showing which ARM providers gained
|
|
83
|
+
* a new latest API version since the baseline was snapshotted.
|
|
84
|
+
*
|
|
85
|
+
* Never throws — all failures are captured in the result.
|
|
86
|
+
*/
|
|
87
|
+
export declare function checkRollingUpgrade(opts: CheckRollingUpgradeOptions): Promise<RollingUpgradeResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Compute provider-level additions and removals between two azure snapshots.
|
|
90
|
+
*
|
|
91
|
+
* The snapshot resourceType values for azure look like
|
|
92
|
+
* "Microsoft.Storage/storageAccounts". This function extracts the provider
|
|
93
|
+
* name (the part before the first "/") and reports which providers appeared,
|
|
94
|
+
* disappeared, or (when version strings are supplied via diffAzureApiVersions)
|
|
95
|
+
* bumped their API version.
|
|
96
|
+
*
|
|
97
|
+
* Use diffAzureApiVersions when you have access to actual API version strings
|
|
98
|
+
* (e.g. from the lexicon's latestVersionPerProvider output in a CI run).
|
|
99
|
+
*/
|
|
100
|
+
export declare function computeAzureApiVersionDelta(baseline: SurfaceSnapshot, fresh: SurfaceSnapshot): AzureApiVersionChange[];
|
|
101
|
+
/**
|
|
102
|
+
* Extract the Azure ARM provider name from a resourceType string.
|
|
103
|
+
*
|
|
104
|
+
* Input: "Microsoft.Storage/storageAccounts"
|
|
105
|
+
* Output: "Microsoft.Storage"
|
|
106
|
+
*
|
|
107
|
+
* Returns null for non-ARM resource types (e.g. empty string or non-Microsoft prefix).
|
|
108
|
+
*/
|
|
109
|
+
export declare function extractAzureProvider(resourceType: string): string | null;
|
|
110
|
+
/**
|
|
111
|
+
* Diff actual API version strings per provider between two regen runs.
|
|
112
|
+
*
|
|
113
|
+
* Use this when the caller has access to the azure lexicon's
|
|
114
|
+
* latestVersionPerProvider output. Produces a richer delta that includes
|
|
115
|
+
* version bumps ("updated"), not just provider additions/removals.
|
|
116
|
+
*
|
|
117
|
+
* @param baseVersions Map<provider, apiVersion> from the previous regen.
|
|
118
|
+
* @param freshVersions Map<provider, apiVersion> from the current regen.
|
|
119
|
+
*/
|
|
120
|
+
export declare function diffAzureApiVersions(baseVersions: Map<string, string>, freshVersions: Map<string, string>): AzureApiVersionChange[];
|
|
121
|
+
/**
|
|
122
|
+
* Diff two surface snapshots.
|
|
123
|
+
*
|
|
124
|
+
* Pure function re-exported for callers that import rolling-upgrade and want to
|
|
125
|
+
* compute the delta without importing surface-snapshot directly.
|
|
126
|
+
*/
|
|
127
|
+
export declare function diffRollingSurface(baseline: SurfaceSnapshot, fresh: SurfaceSnapshot): SurfaceDelta;
|
|
128
|
+
/**
|
|
129
|
+
* Classify a delta as an upgrade and determine its severity.
|
|
130
|
+
*
|
|
131
|
+
* Pure function — no I/O. Unit-testable with fixture snapshots.
|
|
132
|
+
* Used by the CLI and the checkRollingUpgrade entry point.
|
|
133
|
+
*/
|
|
134
|
+
export declare function classifyDelta(delta: SurfaceDelta): {
|
|
135
|
+
hasUpgrade: boolean;
|
|
136
|
+
severity: ChangeSeverity;
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=rolling-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolling-upgrade.d.ts","sourceRoot":"","sources":["../../src/codegen/rolling-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAmC,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIvG,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,cAAc,CAAC;IACzB,gCAAgC;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAClC,0EAA0E;IAC1E,eAAe,EAAE,qBAAqB,EAAE,CAAC;IACzC,wEAAwE;IACxE,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,yFAAyF;IACzF,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACzD;AAID;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAoC/B;AA6BD;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,eAAe,GACrB,qBAAqB,EAAE,CA6BzB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKxE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,qBAAqB,EAAE,CAmBzB;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,eAAe,GACrB,YAAY,CAEd;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAIA"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexicon API surface snapshot and diff.
|
|
3
|
+
*
|
|
4
|
+
* Extracts a stable, serializable representation of a lexicon's public API
|
|
5
|
+
* surface from the generated lexicon JSON. Diffs a fresh snapshot against a
|
|
6
|
+
* committed baseline and classifies each change as additive or breaking.
|
|
7
|
+
*
|
|
8
|
+
* The surface is derived from the lexicon registry JSON that every lexicon's
|
|
9
|
+
* `generate` step writes to `src/generated/<name>.json`. Resource and
|
|
10
|
+
* property-type names, together with their structural metadata (attrs, props,
|
|
11
|
+
* kind), form the baseline. The generated .d.ts is not used for diffing
|
|
12
|
+
* because: (a) it is not self-describing without parsing TypeScript, and
|
|
13
|
+
* (b) the registry JSON already encodes everything a consumer needs.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A single entry in the surface snapshot.
|
|
17
|
+
* "resource" entries carry attrs and props; "property" entries are lightweight.
|
|
18
|
+
*/
|
|
19
|
+
export interface SurfaceEntry {
|
|
20
|
+
kind: "resource" | "property";
|
|
21
|
+
/** The cloud-provider resource type string (e.g. "AWS::S3::Bucket"). */
|
|
22
|
+
resourceType: string;
|
|
23
|
+
/** Readonly attribute names (resource entries only). */
|
|
24
|
+
attrs?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Property names with their required flag. Stored as
|
|
27
|
+
* `name:required` strings (e.g. "BucketName:false", "Tags:false").
|
|
28
|
+
* Sorting is stable so the snapshot is deterministic.
|
|
29
|
+
*/
|
|
30
|
+
props?: string[];
|
|
31
|
+
/** Names that are create-only / immutable after creation. */
|
|
32
|
+
createOnly?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Whether the resource supports tagging.
|
|
35
|
+
* Present when known; absent means not known or not applicable.
|
|
36
|
+
*/
|
|
37
|
+
taggable?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The complete surface snapshot for one lexicon.
|
|
41
|
+
*/
|
|
42
|
+
export interface SurfaceSnapshot {
|
|
43
|
+
/**
|
|
44
|
+
* Schema version for forward-compatibility. Bump when the shape changes
|
|
45
|
+
* in a way that makes old snapshots unreadable by newer tooling.
|
|
46
|
+
*/
|
|
47
|
+
schemaVersion: 1;
|
|
48
|
+
/** When this snapshot was generated (ISO 8601 UTC). */
|
|
49
|
+
generatedAt: string;
|
|
50
|
+
/**
|
|
51
|
+
* Per-entry map keyed by the TS export name (e.g. "Bucket",
|
|
52
|
+
* "Bucket_Tag"). Sorted alphabetically for stable diffs.
|
|
53
|
+
*/
|
|
54
|
+
entries: Record<string, SurfaceEntry>;
|
|
55
|
+
}
|
|
56
|
+
export type ChangeSeverity = "additive" | "breaking" | "none";
|
|
57
|
+
export interface AddedEntry {
|
|
58
|
+
name: string;
|
|
59
|
+
entry: SurfaceEntry;
|
|
60
|
+
}
|
|
61
|
+
export interface RemovedEntry {
|
|
62
|
+
name: string;
|
|
63
|
+
entry: SurfaceEntry;
|
|
64
|
+
}
|
|
65
|
+
export interface ChangedEntry {
|
|
66
|
+
name: string;
|
|
67
|
+
/** New resourceType (breaking). */
|
|
68
|
+
resourceTypeChanged?: {
|
|
69
|
+
before: string;
|
|
70
|
+
after: string;
|
|
71
|
+
};
|
|
72
|
+
/** kind changed from resource to property or vice-versa (breaking). */
|
|
73
|
+
kindChanged?: {
|
|
74
|
+
before: string;
|
|
75
|
+
after: string;
|
|
76
|
+
};
|
|
77
|
+
/** Props that were removed (breaking). */
|
|
78
|
+
removedProps?: string[];
|
|
79
|
+
/** Props that switched from optional to required (breaking). */
|
|
80
|
+
nowRequired?: string[];
|
|
81
|
+
/** Attrs that were removed (breaking). */
|
|
82
|
+
removedAttrs?: string[];
|
|
83
|
+
/** Props that were newly added. */
|
|
84
|
+
addedProps?: string[];
|
|
85
|
+
/** Props that switched from required to optional (additive). */
|
|
86
|
+
nowOptional?: string[];
|
|
87
|
+
/** Attrs that were newly added. */
|
|
88
|
+
addedAttrs?: string[];
|
|
89
|
+
/** createOnly set changed. */
|
|
90
|
+
createOnlyChanged?: {
|
|
91
|
+
before: string[];
|
|
92
|
+
after: string[];
|
|
93
|
+
};
|
|
94
|
+
/** taggable flag changed. */
|
|
95
|
+
taggableChanged?: {
|
|
96
|
+
before?: boolean;
|
|
97
|
+
after?: boolean;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface SurfaceDelta {
|
|
101
|
+
added: AddedEntry[];
|
|
102
|
+
changed: ChangedEntry[];
|
|
103
|
+
removed: RemovedEntry[];
|
|
104
|
+
/**
|
|
105
|
+
* Rolled-up severity. "none" means no surface changes at all.
|
|
106
|
+
* "additive" means only new resources / new optional props / new attrs.
|
|
107
|
+
* "breaking" means any removal or change that could break existing consumers.
|
|
108
|
+
*/
|
|
109
|
+
severity: ChangeSeverity;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Extract a surface snapshot from the lexicon JSON and the generated index.d.ts.
|
|
113
|
+
*
|
|
114
|
+
* The lexicon JSON contains the resource/property registry (names, kinds,
|
|
115
|
+
* attrs, createOnly, tagging). The .d.ts provides per-prop names and their
|
|
116
|
+
* required flags for resource constructor shapes.
|
|
117
|
+
*
|
|
118
|
+
* @param lexiconJSON Contents of `src/generated/<name>.json`
|
|
119
|
+
* @param typesDTS Contents of `src/generated/index.d.ts`
|
|
120
|
+
*/
|
|
121
|
+
export declare function extractSurface(lexiconJSON: string, typesDTS: string): SurfaceSnapshot;
|
|
122
|
+
/**
|
|
123
|
+
* Lightweight extractor: pull constructor prop names and required flags
|
|
124
|
+
* from a `.d.ts` string.
|
|
125
|
+
*
|
|
126
|
+
* Handles the pattern generated by writeConstructor:
|
|
127
|
+
* ```
|
|
128
|
+
* export declare class Bucket {
|
|
129
|
+
* constructor(props: {
|
|
130
|
+
* BucketName?: string;
|
|
131
|
+
* Tags: Bucket_Tag[];
|
|
132
|
+
* }, attributes?: CFResourceAttributes);
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* Returns a Map<className, ["PropName:required", ...]>
|
|
137
|
+
* where each entry is sorted alphabetically.
|
|
138
|
+
*/
|
|
139
|
+
export declare function extractPropsFromDts(dts: string): Map<string, string[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Diff a fresh snapshot against a committed baseline.
|
|
142
|
+
*
|
|
143
|
+
* Classification rules:
|
|
144
|
+
* - Added entry → additive
|
|
145
|
+
* - Removed entry → breaking
|
|
146
|
+
* - Changed entry:
|
|
147
|
+
* - resourceType changed → breaking
|
|
148
|
+
* - kind changed → breaking
|
|
149
|
+
* - prop removed → breaking
|
|
150
|
+
* - prop now required (was optional) → breaking
|
|
151
|
+
* - attr removed → breaking
|
|
152
|
+
* - createOnly changed → breaking (changes immutability contract)
|
|
153
|
+
* - taggable: false→undefined or true→false → breaking
|
|
154
|
+
* - prop added (optional) → additive
|
|
155
|
+
* - prop now optional (was required) → additive
|
|
156
|
+
* - attr added → additive
|
|
157
|
+
* - taggable: false→true or undefined→true → additive
|
|
158
|
+
*/
|
|
159
|
+
export declare function diffSurface(baseline: SurfaceSnapshot, fresh: SurfaceSnapshot): SurfaceDelta;
|
|
160
|
+
/**
|
|
161
|
+
* Serialize a snapshot to stable JSON. Suitable for writing to
|
|
162
|
+
* `surface.snapshot.json` at the lexicon root.
|
|
163
|
+
*/
|
|
164
|
+
export declare function serializeSnapshot(snapshot: SurfaceSnapshot): string;
|
|
165
|
+
/**
|
|
166
|
+
* Parse a snapshot from JSON.
|
|
167
|
+
*/
|
|
168
|
+
export declare function parseSnapshot(json: string): SurfaceSnapshot;
|
|
169
|
+
/**
|
|
170
|
+
* Render a surface delta as human-readable text.
|
|
171
|
+
*/
|
|
172
|
+
export declare function formatDelta(delta: SurfaceDelta): string;
|
|
173
|
+
//# sourceMappingURL=surface-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-snapshot.d.ts","sourceRoot":"","sources":["../../src/codegen/surface-snapshot.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.x-aware version bumping, shared by the pinned upgrade Op (#549) and the
|
|
3
|
+
* rolling drift re-baseline (#616). Centralised here so the single source of
|
|
4
|
+
* truth for the semver rule can't drift between the two callers.
|
|
5
|
+
*/
|
|
6
|
+
/** Surface-change severity that drives a bump. */
|
|
7
|
+
export type BumpSeverity = "additive" | "breaking" | "none";
|
|
8
|
+
/**
|
|
9
|
+
* Compute a bumped semver from a current version and a surface severity.
|
|
10
|
+
*
|
|
11
|
+
* Pre-1.0 (major 0) never auto-promotes to 1.0.0: breaking → minor, additive →
|
|
12
|
+
* patch. At >= 1.0.0: breaking → major, additive → minor. Returns null for
|
|
13
|
+
* "none" or a version string that can't be parsed as MAJOR.MINOR.PATCH.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bumpForSeverity(current: string, severity: BumpSeverity): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Read a package.json, set its `version`, and write it back — preserving all
|
|
18
|
+
* other fields, 2-space indent, and a trailing newline.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bumpPackageJsonVersion(packageJsonPath: string, newVersion: string): void;
|
|
21
|
+
//# sourceMappingURL=version-bump.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-bump.d.ts","sourceRoot":"","sources":["../../src/codegen/version-bump.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAStF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAKxF"}
|