@intentius/chant 0.13.1 → 0.15.1
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 +59 -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 +99 -0
- package/src/op/index.ts +3 -1
- package/src/ownership.test.ts +24 -26
- package/src/ownership.ts +26 -38
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License policy over an SBOM's declared licenses (#626). The SBOM already
|
|
3
|
+
* enumerates every component and its license; this evaluates those against an
|
|
4
|
+
* allow/deny list (e.g. block a copyleft license in a proprietary product).
|
|
5
|
+
*
|
|
6
|
+
* **Report-only by default.** License posture is context-dependent — GPL is a
|
|
7
|
+
* problem for a proprietary binary but fine for a GPL project — so the gate
|
|
8
|
+
* (./vuln-gate.ts) does NOT block on license violations unless a project opts
|
|
9
|
+
* in (`failOnLicense: true`). Extraction reads both SPDX
|
|
10
|
+
* (`packages[].licenseConcluded`/`licenseDeclared`) and CycloneDX
|
|
11
|
+
* (`components[].licenses[]`) without a spec dependency.
|
|
12
|
+
*/
|
|
13
|
+
import type { SbomDocument } from "./sbom-generator.js";
|
|
14
|
+
/** A package/component and the license the SBOM declares for it. */
|
|
15
|
+
export interface PackageLicense {
|
|
16
|
+
package: string;
|
|
17
|
+
/** SPDX license expression/id as the SBOM reports it, or `"NOASSERTION"`/`""` when none is declared. */
|
|
18
|
+
license: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LicensePolicy {
|
|
21
|
+
/** If set, ONLY these licenses are permitted — anything else is a violation. */
|
|
22
|
+
allow?: string[];
|
|
23
|
+
/** These licenses are violations (takes precedence; useful without an allowlist). */
|
|
24
|
+
deny?: string[];
|
|
25
|
+
}
|
|
26
|
+
/** One package whose license violates the policy. */
|
|
27
|
+
export interface LicenseViolation {
|
|
28
|
+
package: string;
|
|
29
|
+
license: string;
|
|
30
|
+
/** Which rule it broke. */
|
|
31
|
+
reason: "denied" | "not-allowed";
|
|
32
|
+
}
|
|
33
|
+
/** Extract each package's declared license from an SBOM, dispatching on media type (SPDX vs CycloneDX). Never throws on shape — a package with no license reads as `"NOASSERTION"`. */
|
|
34
|
+
export declare function extractLicenses(sbom: SbomDocument): PackageLicense[];
|
|
35
|
+
/**
|
|
36
|
+
* Split an SPDX license expression into its component license atoms, so a
|
|
37
|
+
* deny/allow list matches a license hidden inside an expression like
|
|
38
|
+
* `"GPL-3.0 OR MIT"` or `"(Apache-2.0 AND MIT)"` — an exact-string compare on
|
|
39
|
+
* the whole expression would miss `GPL-3.0` and let it through. Conservative:
|
|
40
|
+
* we only need the *set* of licenses referenced, so we split on `OR`/`AND`,
|
|
41
|
+
* drop parentheses, and strip any `WITH <exception>` suffix. A single license
|
|
42
|
+
* id returns itself unchanged.
|
|
43
|
+
*/
|
|
44
|
+
export declare function licenseAtoms(expr: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Evaluate an SBOM's licenses against `policy`. A package violates if ANY atom
|
|
47
|
+
* of its (possibly compound) SPDX license expression is in `deny`, or (when
|
|
48
|
+
* `allow` is set) any atom is not in `allow`. This is conservative on `OR`
|
|
49
|
+
* expressions — `"GPL-3.0 OR MIT"` counts as a `GPL-3.0` deny hit even though a
|
|
50
|
+
* consumer could choose MIT — because a policy gate should surface the presence
|
|
51
|
+
* of a denied license, not silently rely on the consumer picking the permissive
|
|
52
|
+
* branch. Packages with no declared license (`NOASSERTION`/empty) are not
|
|
53
|
+
* flagged — an undeclared license is not asserted to be denied.
|
|
54
|
+
*/
|
|
55
|
+
export declare function evaluateLicensePolicy(sbom: SbomDocument, policy: LicensePolicy): LicenseViolation[];
|
|
56
|
+
//# sourceMappingURL=license-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license-policy.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/license-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,wGAAwG;IACxG,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,MAAM,EAAE,QAAQ,GAAG,aAAa,CAAC;CAClC;AAcD,uLAAuL;AACvL,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,EAAE,CAapE;AAUD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAMnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,GAAG,gBAAgB,EAAE,CAcnG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermetic lockfile/manifest-derived `SbomGenerator` (#613, epic #551 closes
|
|
3
|
+
* the "HERMETIC-generator half of #610" per #613's scope note). Pure
|
|
4
|
+
* TypeScript: reads a declared-dependency manifest already on disk (Node
|
|
5
|
+
* `package-lock.json`, JVM `pom.xml`) and emits a real SPDX/CycloneDX
|
|
6
|
+
* document via ./bom-writer.ts. No `syft`, no `docker buildx`, no
|
|
7
|
+
* `cyclonedx-maven`, no network — every package in the resulting BOM comes
|
|
8
|
+
* from parsing bytes chant already has locally.
|
|
9
|
+
*
|
|
10
|
+
* **What this backend is, and isn't.** A lockfile enumerates every declared
|
|
11
|
+
* (transitive-resolved) dependency at the versions actually installed, so
|
|
12
|
+
* the resulting SBOM is complete for **declared** dependencies — accurate
|
|
13
|
+
* package identity and version for everything npm/Maven resolved. It is
|
|
14
|
+
* **not** a container-layer scan: it cannot see OS packages baked into a base
|
|
15
|
+
* image, binaries copied in by a Dockerfile `COPY`/`RUN`, or anything not
|
|
16
|
+
* expressed as a lockfile entry. That deeper, image-layer-aware scan is
|
|
17
|
+
* `syft`'s job (or BuildKit's native `--sbom` attestation) and stays exactly
|
|
18
|
+
* where #610 already scoped it: the optional *deep* path, layered on top of
|
|
19
|
+
* (never replacing) this hermetic baseline. See
|
|
20
|
+
* docs/components/build-archive.mdx's SBOM section, updated alongside this
|
|
21
|
+
* change, for the customer-facing version of this distinction.
|
|
22
|
+
*
|
|
23
|
+
* Registered as `forDir`/`forZip`/`forJar` implementations (the artifact
|
|
24
|
+
* shapes a source-tree or packaged-but-uninspected artifact naturally maps
|
|
25
|
+
* to); `forImage` still throws `SbomGeneratorNotImplementedError` — an image
|
|
26
|
+
* SBOM needs either BuildKit's attestation or a container-layer scan, neither
|
|
27
|
+
* of which a lockfile read can substitute for, so this backend deliberately
|
|
28
|
+
* does not claim to cover it (mirrors how ./sbom-generator.ts's own
|
|
29
|
+
* `notImplementedSbomGenerator` prefers a loud, specific failure over a
|
|
30
|
+
* silently wrong answer).
|
|
31
|
+
*/
|
|
32
|
+
import { type BomPackage } from "./bom-writer.js";
|
|
33
|
+
import type { SbomGenerator } from "./sbom-generator.js";
|
|
34
|
+
/**
|
|
35
|
+
* Parse a `package-lock.json` (v1, v2, or v3) into a flat `BomPackage[]`.
|
|
36
|
+
* Prefers the v2/v3 `packages` map (flat, one entry per resolved install
|
|
37
|
+
* location) since that's what `npm` >= 7 writes; falls back to the v1
|
|
38
|
+
* `dependencies` tree for older lockfiles. De-duplicates by `name@version`
|
|
39
|
+
* so a package appearing at multiple install paths (npm's dedup/hoisting)
|
|
40
|
+
* contributes one BOM entry, matching how a real scanner reports installed
|
|
41
|
+
* packages rather than filesystem paths.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseNpmPackageLock(content: string): BomPackage[];
|
|
44
|
+
/**
|
|
45
|
+
* Parse the `<dependencies>` block of a `pom.xml` into a flat `BomPackage[]`.
|
|
46
|
+
* Deliberately minimal (#613 calls this out as "add JVM pom.xml if cheap"):
|
|
47
|
+
* a small tag-scoped regex walk over `<dependency>...</dependency>` blocks
|
|
48
|
+
* extracting `groupId`/`artifactId`/`version`, no XML DOM dependency, no
|
|
49
|
+
* property (`${...}`) resolution, no transitive resolution (Maven's own
|
|
50
|
+
* dependency-mediation graph isn't reproducible without invoking `mvn`,
|
|
51
|
+
* which would break the hermetic requirement). This is deliberately narrower
|
|
52
|
+
* than the npm parser above: it covers the common case (a flat, literal
|
|
53
|
+
* `<dependencies>` list) and documents its own limits rather than silently
|
|
54
|
+
* mis-resolving a `${property}` version or a `<dependencyManagement>`
|
|
55
|
+
* inheritance chain.
|
|
56
|
+
*/
|
|
57
|
+
export declare function parsePomXml(content: string): BomPackage[];
|
|
58
|
+
export interface LockfileSbomGeneratorOptions {
|
|
59
|
+
/** Where generated SBOM documents are written on disk, as a sibling of the scanned path (see `sbomOutputPath`). Default: alongside the scanned manifest, named `sbom.<format>.json`. */
|
|
60
|
+
outDir?: string;
|
|
61
|
+
/** Clock override for deterministic tests. */
|
|
62
|
+
now?: () => Date;
|
|
63
|
+
}
|
|
64
|
+
/** Default on-disk path for a generated SBOM: `<dir>/sbom.<format>.json`, matching #613's `sbom.<format>.json` naming convention. */
|
|
65
|
+
export declare function sbomOutputPath(dir: string, format: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Build a hermetic `SbomGenerator` backed by lockfile parsing. `forDir` scans
|
|
68
|
+
* `input.path` for a known manifest (`package-lock.json`, then `pom.xml`),
|
|
69
|
+
* parses it into a `BomPackage[]`, and writes both the SBOM document (via
|
|
70
|
+
* ./bom-writer.ts) to disk and returns it as an `SbomDocument`. `forZip`/
|
|
71
|
+
* `forJar` reuse the same scan against the artifact's source directory
|
|
72
|
+
* (the directory the archive was built from is the natural place a lockfile
|
|
73
|
+
* lives — the packaged bytes themselves are not re-inspected, matching this
|
|
74
|
+
* backend's "declared deps, not a binary scan" scope). `forImage` is not
|
|
75
|
+
* implemented here: an image's dependency surface includes its base layers,
|
|
76
|
+
* which no lockfile enumerates — see this module's doc comment.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createLockfileSbomGenerator(options?: LockfileSbomGeneratorOptions): SbomGenerator;
|
|
79
|
+
/** Process-wide hermetic lockfile-backed `SbomGenerator`, ready to inject wherever ./sbom-generator.ts's `notImplementedSbomGenerator` default previously required an explicit real backend. */
|
|
80
|
+
export declare const lockfileSbomGenerator: SbomGenerator;
|
|
81
|
+
//# sourceMappingURL=lockfile-sbom-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-sbom-generator.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/lockfile-sbom-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAMV,aAAa,EACd,MAAM,kBAAkB,CAAC;AAe1B;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAkCjE;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CA8BzD;AAID,MAAM,WAAW,4BAA4B;IAC3C,wLAAwL;IACxL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAgBD,qIAAqI;AACrI,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,aAAa,CA0CrG;AAED,gMAAgM;AAChM,eAAO,MAAM,qBAAqB,EAAE,aAA6C,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable external-process boundary for the #610 deep-scan/attach
|
|
3
|
+
* backends (`ToolSbomGenerator` in ./tool-sbom-generator.ts,
|
|
4
|
+
* `OrasReferrerLookup` in ../../lifecycle/oras-referrer-lookup.ts, and
|
|
5
|
+
* `publish-image`'s referrer-attach step in ./publish.ts). Mirrors
|
|
6
|
+
* ./cloud-executor.ts's `CloudExecutor` pattern exactly: production code gets
|
|
7
|
+
* a `RealProcessRunner` that shells out via `node:child_process`, tests get a
|
|
8
|
+
* `MockProcessRunner` (./__tests__/mock-process-runner.ts) that records calls
|
|
9
|
+
* and returns canned output — no live `syft`/`buildx`/`cyclonedx-maven`/
|
|
10
|
+
* `cdxgen`/`oras`, ever, in a test run.
|
|
11
|
+
*
|
|
12
|
+
* Kept deliberately narrower than `CloudExecutor`: every one of #610's real
|
|
13
|
+
* backends reduces to "run this external CLI, capture stdout, tell me if the
|
|
14
|
+
* tool exists" — a single `ProcessRunner` interface (`run` + `available`)
|
|
15
|
+
* covers `syft`, `docker buildx`, `cyclonedx-maven`, `cdxgen`, and `oras`
|
|
16
|
+
* alike, rather than one bespoke client per tool the way `CloudExecutor`
|
|
17
|
+
* models AWS's genuinely distinct service APIs (CloudFormation, ECS,
|
|
18
|
+
* CodeDeploy, ...).
|
|
19
|
+
*/
|
|
20
|
+
/** One external command invocation's result. */
|
|
21
|
+
export interface ProcessResult {
|
|
22
|
+
stdout: string;
|
|
23
|
+
stderr: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RunOptions {
|
|
26
|
+
/** Working directory the command runs in. Defaults to the current process cwd. */
|
|
27
|
+
cwd?: string;
|
|
28
|
+
/** Max buffer size for stdout/stderr, matching ./cloud-executor.ts's `run`'s 64MB allowance (SBOM/BOM documents can be large). */
|
|
29
|
+
maxBuffer?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Injectable boundary for shelling out to a deep-scan/attach CLI tool and for
|
|
33
|
+
* checking whether one is installed. A real implementation runs the command
|
|
34
|
+
* via `node:child_process`; every method here is injected so tests substitute
|
|
35
|
+
* `MockProcessRunner` (./__tests__/mock-process-runner.ts) and never invoke a
|
|
36
|
+
* real tool.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProcessRunner {
|
|
39
|
+
/** Run a shell command, returning its stdout/stderr. Rejects (with the tool's own stderr in the error) on a non-zero exit. */
|
|
40
|
+
run(command: string, options?: RunOptions): Promise<ProcessResult>;
|
|
41
|
+
/** True if `tool` (a CLI binary name, e.g. "syft", "oras") resolves on `PATH`. Never throws — a missing tool is a normal, expected outcome the caller checks before attempting to `run` it. */
|
|
42
|
+
available(tool: string): Promise<boolean>;
|
|
43
|
+
}
|
|
44
|
+
/** Shell-quote a single argument for POSIX shells (wrap in single quotes, escaping embedded ones) — same convention as ./cloud-executor.ts's `q`. */
|
|
45
|
+
export declare function q(value: string): string;
|
|
46
|
+
/** Build a `ProcessRunner` that shells out for real via `node:child_process`. Never used in tests. */
|
|
47
|
+
export declare function realProcessExecutor(): ProcessRunner;
|
|
48
|
+
/** The default `ProcessRunner` each real #610 backend falls back to when none is supplied. */
|
|
49
|
+
export declare function defaultProcessRunner(): ProcessRunner;
|
|
50
|
+
/**
|
|
51
|
+
* Thrown when a #610 real backend needs a CLI tool that `ProcessRunner.available`
|
|
52
|
+
* reports as absent — the "graceful, actionable error if the tool is absent"
|
|
53
|
+
* #610 asks for, distinct from a generic `Error` so callers (and tests) can
|
|
54
|
+
* assert on it specifically, mirroring `SbomGeneratorNotImplementedError`'s
|
|
55
|
+
* role in ./sbom-generator.ts.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ToolNotAvailableError extends Error {
|
|
58
|
+
readonly tool: string;
|
|
59
|
+
readonly purpose: string;
|
|
60
|
+
constructor(tool: string, purpose: string);
|
|
61
|
+
}
|
|
62
|
+
/** Throw `ToolNotAvailableError` unless `tool` is available, per `runner.available`. Shared guard every #610 real backend calls before shelling out. */
|
|
63
|
+
export declare function requireTool(runner: ProcessRunner, tool: string, purpose: string): Promise<void>;
|
|
64
|
+
//# sourceMappingURL=process-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-runner.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/process-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kIAAkI;IAClI,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,8HAA8H;IAC9H,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACnE,+LAA+L;IAC/L,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED,qJAAqJ;AACrJ,wBAAgB,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvC;AAqBD,sGAAsG;AACtG,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD;AAKD,8FAA8F;AAC9F,wBAAgB,oBAAoB,IAAI,aAAa,CAGpD;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,IAAI,EAAE,MAAM;aACZ,OAAO,EAAE,MAAM;gBADf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;CAKlC;AAED,wJAAwJ;AACxJ,wBAAsB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-artifact reproducibility + provenance record (#614, epic #551 follow-up
|
|
3
|
+
* to #613's BOM-doc model). Attaches to a `BuildArchiveEntry`
|
|
4
|
+
* (./build-archive.ts) alongside the BOM entries #613 already added, so every
|
|
5
|
+
* artifact in a build archive carries not just "what's in it" (the BOM) but
|
|
6
|
+
* also "can this be reproduced, and from what source."
|
|
7
|
+
*
|
|
8
|
+
* **Honesty over convenience.** A single blanket "reproducible: true/false"
|
|
9
|
+
* bit on a *component* would misrepresent a component that builds more than
|
|
10
|
+
* one artifact type — a synthesized IaC template and a container image are
|
|
11
|
+
* not equally reproducible, and collapsing them into one flag would either
|
|
12
|
+
* overstate the image's reproducibility or understate the template's. This
|
|
13
|
+
* module therefore records `basis` **per artifact entry**, never per
|
|
14
|
+
* component:
|
|
15
|
+
*
|
|
16
|
+
* - `"deterministic-synthesis"` — chant's own synthesis produced this
|
|
17
|
+
* artifact from declarative input (a `template`-kind entry, see
|
|
18
|
+
* ../../build.ts). Re-running `chant build` against the same source
|
|
19
|
+
* reproduces byte-identical output — the same content-addressing property
|
|
20
|
+
* ./build-archive.ts's `contentDigest`/`manifestDigest` already rely on.
|
|
21
|
+
* Verification is exactly "re-synth and compare digests," expressed here
|
|
22
|
+
* as `verifyBy: "re-synth"`.
|
|
23
|
+
* - `"best-effort"` — an `image`/`asset` entry built by an external tool
|
|
24
|
+
* (`docker build`, a JVM/zip packager). Nothing here observes whether the
|
|
25
|
+
* underlying build was actually bit-for-bit reproducible (timestamps,
|
|
26
|
+
* build-arg ordering, and base-image drift are common, unglamorous causes
|
|
27
|
+
* of non-determinism that chant does not control) — `"best-effort"` is
|
|
28
|
+
* the honest default absent a real reproducible-build attestation. A
|
|
29
|
+
* future SLSA/reproducible-build-flagged backend can upgrade this to a
|
|
30
|
+
* stronger basis; nothing here forecloses that, it just refuses to claim
|
|
31
|
+
* it today.
|
|
32
|
+
*
|
|
33
|
+
* **Provenance** is the companion source -> output link: which source
|
|
34
|
+
* ref/commit produced this artifact's digest. Recorded per artifact for the
|
|
35
|
+
* same reason `basis` is — two artifacts from one component build may trace
|
|
36
|
+
* to different source trees (e.g. an image built from `services/search/` vs
|
|
37
|
+
* a template synthesized from `infra/search.component.ts`), so the link
|
|
38
|
+
* belongs on the entry, not hoisted to the component.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* How an artifact's reproducibility is established. Deliberately two values,
|
|
42
|
+
* not a spectrum: chant either produced the artifact itself via deterministic
|
|
43
|
+
* synthesis (verifiable by re-running `chant build`), or it didn't (an
|
|
44
|
+
* external build tool produced it, and no attestation proves determinism).
|
|
45
|
+
* Adding a third value (e.g. a real SLSA-attested "reproducible-build") is a
|
|
46
|
+
* later, additive change — widening `basis` never requires touching every
|
|
47
|
+
* existing artifact's recorded value, since `"best-effort"` remains true of
|
|
48
|
+
* anything not upgraded.
|
|
49
|
+
*/
|
|
50
|
+
export type ReproducibilityBasis = "deterministic-synthesis" | "best-effort";
|
|
51
|
+
/** How a claimed `basis` can actually be checked. Optional — a `"best-effort"` entry commonly has no verification path at all. */
|
|
52
|
+
export type VerificationMethod = "re-synth";
|
|
53
|
+
/** The reproducibility record for one build-archive entry (#614). */
|
|
54
|
+
export interface ArtifactReproducibility {
|
|
55
|
+
/** Honest, per-artifact basis for the claim — never inferred from a sibling artifact's basis. */
|
|
56
|
+
basis: ReproducibilityBasis;
|
|
57
|
+
/** How to verify the claim, when there is one. `"re-synth"` applies only to `"deterministic-synthesis"` entries — re-run `chant build` and compare the resulting digest. */
|
|
58
|
+
verifyBy?: VerificationMethod;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Default reproducibility basis for a given `BuildArchiveEntryKind`, absent
|
|
62
|
+
* an explicit override. A `template` entry is chant's own synthesized IaC
|
|
63
|
+
* output — deterministic by construction (the same synthesis run over the
|
|
64
|
+
* same source produces the same bytes, per ./build-archive.ts's module doc).
|
|
65
|
+
* `image`/`asset` entries are produced by an external build tool chant only
|
|
66
|
+
* orchestrates (`docker build`, a JVM/zip packager) — best-effort absent a
|
|
67
|
+
* real reproducible-build attestation. `sbom` entries describe another
|
|
68
|
+
* artifact rather than being one themselves, so they carry no
|
|
69
|
+
* reproducibility claim of their own (`undefined`) — see
|
|
70
|
+
* `../build-archive.ts`'s `BuildArchiveEntry.reproducibility` doc.
|
|
71
|
+
*/
|
|
72
|
+
export declare function defaultReproducibility(kind: "image" | "template" | "asset" | "sbom"): ArtifactReproducibility | undefined;
|
|
73
|
+
/** One source -> output link: the source ref/commit that produced a given artifact digest. */
|
|
74
|
+
export interface ProvenanceLink {
|
|
75
|
+
/** Source ref/commit the artifact was built or synthesized from (e.g. a git sha, or `"<sha>:<path>"` when a monorepo subpath matters). */
|
|
76
|
+
sourceRef: string;
|
|
77
|
+
/** The artifact digest this provenance describes — the same `BuildArchiveEntry.digest` it is attached to, repeated here so a `ProvenanceLink` remains meaningful if ever extracted/serialized apart from its entry. */
|
|
78
|
+
artifactDigest: string;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=reproducibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reproducibility.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/reproducibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,aAAa,CAAC;AAE7E,kIAAkI;AAClI,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAE5C,qEAAqE;AACrE,MAAM,WAAW,uBAAuB;IACtC,iGAAiG;IACjG,KAAK,EAAE,oBAAoB,CAAC;IAC5B,4KAA4K;IAC5K,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAC5C,uBAAuB,GAAG,SAAS,CAUrC;AAID,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC7B,0IAA0I;IAC1I,SAAS,EAAE,MAAM,CAAC;IAClB,uNAAuN;IACvN,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SBOM document type + the injectable, artifact-type-keyed `SbomGenerator`
|
|
3
|
+
* boundary (#606, epic #551 "Build & deploy observability" follow-up to
|
|
4
|
+
* #564/#568). Mirrors ./cloud-executor.ts's `CloudExecutor` pattern: a real
|
|
5
|
+
* backend may shell out to `syft`/`docker buildx --sbom`/`cyclonedx-maven`,
|
|
6
|
+
* but no test and no default import ever does — every backend here is
|
|
7
|
+
* injected, and tests construct a `MockSbomGenerator`
|
|
8
|
+
* (./__tests__/mock-sbom-generator.ts) instead.
|
|
9
|
+
*
|
|
10
|
+
* **Format-agnostic by construction.** An SBOM is stored as an opaque typed
|
|
11
|
+
* doc: `{ format, mediaType, bytes }`. Nothing downstream (the build-archive
|
|
12
|
+
* manifest, the build ledger, `chant components status`) branches on
|
|
13
|
+
* `format` — every consumer keys off `mediaType`, the same convention
|
|
14
|
+
* `BuildArchiveEntry.mediaType` already uses for image/template/asset
|
|
15
|
+
* entries (./build-archive.ts). SPDX (`application/spdx+json`) and
|
|
16
|
+
* CycloneDX (`application/vnd.cyclonedx+json`) are both first-class; neither
|
|
17
|
+
* is hardcoded as *the* format anywhere in this module or its consumers.
|
|
18
|
+
*
|
|
19
|
+
* **Default format:** SPDX, matching the epic's refinement from the
|
|
20
|
+
* devops-cloud.news SBOM article — BuildKit natively emits SPDX attestations
|
|
21
|
+
* for images, so the image/BuildKit backend defaults to SPDX; the `syft`
|
|
22
|
+
* backend can emit either and defaults to SPDX here too, for one predictable
|
|
23
|
+
* default across artifact types. Override via `chant.config.ts`'s
|
|
24
|
+
* `sbom.format` (see ../../config.ts) and/or a component's own `build.sbom`
|
|
25
|
+
* (see ../component.ts's `BuildSpec`). Documented in
|
|
26
|
+
* docs/components/build-archive.mdx.
|
|
27
|
+
*
|
|
28
|
+
* **Artifact-type-keyed generation.** "Generate an SBOM" has a different
|
|
29
|
+
* real implementation per artifact type — an image asks BuildKit or scans
|
|
30
|
+
* the built image with `syft`; a JAR is scanned with `syft` or
|
|
31
|
+
* `cyclonedx-maven`; a zip/Lambda package is scanned with `syft`; a bare
|
|
32
|
+
* source directory is scanned with `syft`/`cdxgen`. `SbomGenerator` is one
|
|
33
|
+
* interface with one method per artifact type — analogous to
|
|
34
|
+
* `PublishImageBackend` being one interface satisfied by two backends
|
|
35
|
+
* (./publish.ts) — so the *capability* (./sbom.ts) stays artifact-type
|
|
36
|
+
* agnostic and simply calls the method matching the archive entry it was
|
|
37
|
+
* handed.
|
|
38
|
+
*/
|
|
39
|
+
/** The two SBOM standards this module supports. Never hardcode one — consumers key off `mediaType`. */
|
|
40
|
+
export type SbomFormat = "spdx" | "cyclonedx";
|
|
41
|
+
/** Canonical media type per format, mirroring `BuildArchiveEntry.mediaType`'s convention (./build-archive.ts). */
|
|
42
|
+
export declare const SBOM_MEDIA_TYPES: Record<SbomFormat, string>;
|
|
43
|
+
/** Project-wide default SBOM format when neither `chant.config.ts`'s `sbom.format` nor a component's `build.sbom.format` says otherwise. Documented in docs/components/build-archive.mdx. */
|
|
44
|
+
export declare const DEFAULT_SBOM_FORMAT: SbomFormat;
|
|
45
|
+
/**
|
|
46
|
+
* The artifact types an `SbomGenerator` backend can be asked to scan —
|
|
47
|
+
* mirrors the build-family's artifact shapes (`docker-build` -> `image`,
|
|
48
|
+
* `jvm-build` -> `jar`, `zip-package` -> `zip`, a bare source tree -> `dir`),
|
|
49
|
+
* never a component/cloud name.
|
|
50
|
+
*/
|
|
51
|
+
export type SbomArtifactType = "image" | "jar" | "zip" | "dir";
|
|
52
|
+
/**
|
|
53
|
+
* An SBOM as an opaque typed document: format, its media type (what every
|
|
54
|
+
* consumer actually keys off), and the serialized bytes. Never inspected or
|
|
55
|
+
* re-parsed by chant itself — chant's job is to generate, store, and surface
|
|
56
|
+
* it, not to interpret SBOM content (that is the scan-result/VEX policy-gate
|
|
57
|
+
* fast-follow, out of scope here — see #606's "out of scope" section).
|
|
58
|
+
*/
|
|
59
|
+
export interface SbomDocument {
|
|
60
|
+
/** Which standard this document is. Informational — consumers should key off `mediaType`, not this field, for anything that dispatches on the wire format. */
|
|
61
|
+
format: SbomFormat;
|
|
62
|
+
/** The document's IANA/OCI media type (`application/spdx+json` or `application/vnd.cyclonedx+json`). This is the format-agnostic key every consumer (build-archive manifest, build ledger, `chant components status`) actually reads. */
|
|
63
|
+
mediaType: string;
|
|
64
|
+
/** Serialized SBOM content (the actual SPDX/CycloneDX JSON document, as bytes/string). */
|
|
65
|
+
bytes: string;
|
|
66
|
+
/** Number of packages/components the SBOM enumerates, when the generator reports it — surfaced by `chant components status` without parsing `bytes`. */
|
|
67
|
+
packageCount?: number;
|
|
68
|
+
/** Which tool produced this document (e.g. "syft", "buildkit", "cyclonedx-maven") — surfaced alongside format/package count so `chant components status` can report SBOM *source*, not just presence. */
|
|
69
|
+
generator: string;
|
|
70
|
+
}
|
|
71
|
+
export interface GenerateImageSbomInput {
|
|
72
|
+
/** Archive-relative or local path to the image tarball (OCI layout, as `docker save` produces — see ./build.ts's `DockerBuildOutput.archivePath`). */
|
|
73
|
+
imagePath: string;
|
|
74
|
+
/** Image digest the SBOM is being generated for (the join key with the build-archive manifest / build ledger). */
|
|
75
|
+
digest: string;
|
|
76
|
+
format?: SbomFormat;
|
|
77
|
+
}
|
|
78
|
+
export interface GenerateJarSbomInput {
|
|
79
|
+
/** Path to the built jar (see ./build.ts's `JvmBuildOutput.archivePath`). */
|
|
80
|
+
jarPath: string;
|
|
81
|
+
digest: string;
|
|
82
|
+
format?: SbomFormat;
|
|
83
|
+
}
|
|
84
|
+
export interface GenerateZipSbomInput {
|
|
85
|
+
/** Path to the built zip/Lambda package (see ./build.ts's `ZipPackageOutput.archivePath`). */
|
|
86
|
+
zipPath: string;
|
|
87
|
+
digest: string;
|
|
88
|
+
format?: SbomFormat;
|
|
89
|
+
}
|
|
90
|
+
export interface GenerateDirSbomInput {
|
|
91
|
+
/** Source directory to scan (a config-only/producer component with no packaged artifact, or a pre-build source scan). */
|
|
92
|
+
path: string;
|
|
93
|
+
format?: SbomFormat;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Injectable, artifact-type-keyed SBOM generation boundary — the SBOM-side
|
|
97
|
+
* analogue of `CloudExecutor` (./cloud-executor.ts). A real implementation
|
|
98
|
+
* shells out (BuildKit `docker buildx build --sbom=true`/`syft <target>
|
|
99
|
+
* -o spdx-json`/`cyclonedx-maven`/`cdxgen`); every method here is injected so
|
|
100
|
+
* tests substitute `MockSbomGenerator`
|
|
101
|
+
* (./__tests__/mock-sbom-generator.ts) and never invoke a real tool or the
|
|
102
|
+
* network.
|
|
103
|
+
*/
|
|
104
|
+
export interface SbomGenerator {
|
|
105
|
+
/** Generate (or attest) an SBOM for a built container image. A real implementation may prefer BuildKit's native `--sbom` attestation (defaults to SPDX, per the epic's refinement) or fall back to a `syft` scan of the saved tarball. */
|
|
106
|
+
forImage(input: GenerateImageSbomInput): Promise<SbomDocument>;
|
|
107
|
+
/** Generate an SBOM for a built JVM jar (`syft`/`cyclonedx-maven`). */
|
|
108
|
+
forJar(input: GenerateJarSbomInput): Promise<SbomDocument>;
|
|
109
|
+
/** Generate an SBOM for a built zip/Lambda deployment package (`syft` on the archive). */
|
|
110
|
+
forZip(input: GenerateZipSbomInput): Promise<SbomDocument>;
|
|
111
|
+
/** Generate an SBOM for a bare source directory (`syft`/`cdxgen`). */
|
|
112
|
+
forDir(input: GenerateDirSbomInput): Promise<SbomDocument>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Thrown by `NotImplementedSbomGenerator` — the "no real backend wired yet"
|
|
116
|
+
* signal, matching `CapabilityNotImplementedError`'s role for verb stubs
|
|
117
|
+
* (../capability.ts). Kept distinct from a generic `Error` so callers (and
|
|
118
|
+
* tests) can assert on it specifically.
|
|
119
|
+
*/
|
|
120
|
+
export declare class SbomGeneratorNotImplementedError extends Error {
|
|
121
|
+
readonly method: string;
|
|
122
|
+
constructor(method: string);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* All-throwing `SbomGenerator`: every method throws
|
|
126
|
+
* `SbomGeneratorNotImplementedError`. No longer the process-wide default (see
|
|
127
|
+
* `defaultSbomGenerator` below, #630) — kept exported for callers that
|
|
128
|
+
* deliberately want the loud, no-backend-at-all behavior (e.g. a test
|
|
129
|
+
* asserting on the thrown error itself, or a caller that wants to force
|
|
130
|
+
* "nothing is wired" rather than silently getting the hermetic backend).
|
|
131
|
+
*/
|
|
132
|
+
export declare const notImplementedSbomGenerator: SbomGenerator;
|
|
133
|
+
/**
|
|
134
|
+
* The default `SbomGenerator` the `generate-sbom` capability falls back to
|
|
135
|
+
* when none is supplied.
|
|
136
|
+
*
|
|
137
|
+
* **Hermetic by default (#630).** This is `./lockfile-sbom-generator.ts`'s
|
|
138
|
+
* `lockfileSbomGenerator` — `forDir`/`forZip`/`forJar` parse a
|
|
139
|
+
* `package-lock.json`/`pom.xml` already on disk (no `syft`, no network, no
|
|
140
|
+
* external tool) and emit a real SPDX/CycloneDX document. That means a
|
|
141
|
+
* newcomer composing `generate-sbom` over a source directory, a zip/Lambda
|
|
142
|
+
* package, or a JAR gets a working SBOM the moment they `chant run
|
|
143
|
+
* --components`, with nothing to install first — the whole point of #630's
|
|
144
|
+
* "runnable proof" bar. `forImage` still throws
|
|
145
|
+
* `SbomGeneratorNotImplementedError`: no hermetic backend can see an image's
|
|
146
|
+
* base layers, so an image SBOM still needs the real deep-scan tool backend
|
|
147
|
+
* (`syft`/`docker buildx --sbom`/`cyclonedx-maven`/`cdxgen`, #610) — a
|
|
148
|
+
* documented, deliberate gap, not an oversight. This was previously
|
|
149
|
+
* `notImplementedSbomGenerator` (every method throwing); switching the
|
|
150
|
+
* default is intentional per #630 — the prior "loud failure by default"
|
|
151
|
+
* traded newcomer runnability for a default nobody exercised without opting
|
|
152
|
+
* in, which #613 already built a hermetic backend to fix but never wired up.
|
|
153
|
+
* A project that truly wants the old all-throwing behavior can construct
|
|
154
|
+
* `createGenerateSbomCapability(notImplementedSbomGenerator)` explicitly.
|
|
155
|
+
*/
|
|
156
|
+
export declare function defaultSbomGenerator(): SbomGenerator;
|
|
157
|
+
//# sourceMappingURL=sbom-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sbom-generator.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/sbom-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAaH,uGAAuG;AACvG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9C,kHAAkH;AAClH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAGvD,CAAC;AAEF,6LAA6L;AAC7L,eAAO,MAAM,mBAAmB,EAAE,UAAmB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,8JAA8J;IAC9J,MAAM,EAAE,UAAU,CAAC;IACnB,yOAAyO;IACzO,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;IACd,wJAAwJ;IACxJ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yMAAyM;IACzM,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,sBAAsB;IACrC,sJAAsJ;IACtJ,SAAS,EAAE,MAAM,CAAC;IAClB,kHAAkH;IAClH,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,8FAA8F;IAC9F,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,yHAAyH;IACzH,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,0OAA0O;IAC1O,QAAQ,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/D,uEAAuE;IACvE,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3D,0FAA0F;IAC1F,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3D,sEAAsE;IACtE,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;aAC7B,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAO3C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,aAazC,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAGpD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `generate-sbom` capability (#606, epic #551 follow-up to #564's build
|
|
3
|
+
* archive / #568's build ledger — closes the "produce" side #568 explicitly
|
|
4
|
+
* deferred).
|
|
5
|
+
*
|
|
6
|
+
* One capability, artifact-type-keyed via the injectable `SbomGenerator`
|
|
7
|
+
* (./sbom-generator.ts — mirrors ./cloud-executor.ts's `CloudExecutor`
|
|
8
|
+
* pattern), so a build-producing component of *any* artifact type — image,
|
|
9
|
+
* JAR, zip/Lambda package, or a bare source directory for a config-only
|
|
10
|
+
* producer — generates its SBOM through the same verb. Never docker-only:
|
|
11
|
+
* dispatch is on `input.artifactType`, not on which build capability
|
|
12
|
+
* produced the artifact.
|
|
13
|
+
*
|
|
14
|
+
* Writes the result into the build-archive manifest as an `sbom`-kind entry
|
|
15
|
+
* (../verbs/build-archive.ts), content-addressed and linked to its subject
|
|
16
|
+
* artifact's digest via `subjectDigest` — the **universal home** for the
|
|
17
|
+
* SBOM regardless of artifact type or registry availability. Registering the
|
|
18
|
+
* SBOM as an OCI referrer for image artifacts at publish time is a separate,
|
|
19
|
+
* later concern (the publish step/registry tooling's job, see
|
|
20
|
+
* ../../lifecycle/build-ledger.ts's `ReferrerLookup` for the consume side);
|
|
21
|
+
* this capability only ever writes the archive-carried copy, so it works
|
|
22
|
+
* unconditionally — including the registry-less `load-image-on-host` path.
|
|
23
|
+
*
|
|
24
|
+
* Config-only / infra components have no built artifact and simply never
|
|
25
|
+
* compose this step into their `deploy`/`build` phase — "skips cleanly" is
|
|
26
|
+
* structural (no step to run), not a special case this module needs to
|
|
27
|
+
* detect. Opt-out is the same: a component that wants no SBOM omits the
|
|
28
|
+
* `generate-sbom` step from its composition.
|
|
29
|
+
*/
|
|
30
|
+
import type { Capability } from "../capability.js";
|
|
31
|
+
import { type BuildArchiveManifest } from "./build-archive.js";
|
|
32
|
+
import { type SbomArtifactType, type SbomDocument, type SbomFormat, type SbomGenerator } from "./sbom-generator.js";
|
|
33
|
+
export interface GenerateSbomInput {
|
|
34
|
+
/** Which artifact type to generate an SBOM for — selects the `SbomGenerator` method dispatched to (image -> BuildKit/syft, jar -> syft/cyclonedx-maven, zip -> syft, dir -> syft/cdxgen). */
|
|
35
|
+
artifactType: SbomArtifactType;
|
|
36
|
+
/** Archive-relative (or local, for `dir`) path to the artifact being scanned — the archive entry's `path` for `image`/`jar`/`zip`, or a source directory for `dir`. An `archive:`-prefixed reference is accepted and stripped, matching `publish-image`'s `from` convention. */
|
|
37
|
+
path: string;
|
|
38
|
+
/** Digest of the artifact this SBOM describes (the `image`/`asset` archive entry's `digest`) — omitted for `dir` scans that precede any build (no artifact digest exists yet), in which case the SBOM entry's `subjectDigest` is left unset. */
|
|
39
|
+
digest?: string;
|
|
40
|
+
/** SBOM format to request. Defaults to `chant.config.ts`'s `sbom.format`, then `DEFAULT_SBOM_FORMAT` (SPDX) when neither this input nor project config says otherwise — see ./sbom-generator.ts. */
|
|
41
|
+
format?: SbomFormat;
|
|
42
|
+
/** Where the SBOM document is written inside the build archive (e.g. `"search.sbom.json"`). Defaults to `<path>.sbom.json`. */
|
|
43
|
+
into?: string;
|
|
44
|
+
/** Manifest to extend with this SBOM's entry, rather than starting a fresh one — the same accumulation convention `docker-build`'s `manifest` input uses (./build.ts), so a component's whole build phase (image + SBOM, or JAR + SBOM) shares one manifest. */
|
|
45
|
+
manifest?: BuildArchiveManifest;
|
|
46
|
+
}
|
|
47
|
+
export interface GenerateSbomOutput {
|
|
48
|
+
/** The generated SBOM document (format, media type, bytes, package count, generator) — see ./sbom-generator.ts. */
|
|
49
|
+
sbom: SbomDocument;
|
|
50
|
+
/** Where the SBOM was written inside the build archive. */
|
|
51
|
+
archivePath: string;
|
|
52
|
+
/** Content-addressed digest of the SBOM document's own bytes. */
|
|
53
|
+
digest: string;
|
|
54
|
+
/** The build archive's manifest, now including this SBOM's entry alongside whatever `input.manifest` already held. */
|
|
55
|
+
manifest: BuildArchiveManifest;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Generate an SBOM for a build-producing component's artifact (image, JAR,
|
|
59
|
+
* zip, or source directory) via the artifact-type-keyed `SbomGenerator`, and
|
|
60
|
+
* fold the result into the build-archive manifest as an `sbom`-kind entry
|
|
61
|
+
* linked to the subject artifact's digest. Format defaults to
|
|
62
|
+
* `DEFAULT_SBOM_FORMAT` (SPDX) when neither `input.format` nor the injected
|
|
63
|
+
* generator overrides it — see ./sbom-generator.ts's module doc for the
|
|
64
|
+
* full default-resolution story. `chant.config.ts`'s `sbom.format` (see
|
|
65
|
+
* ../../config.ts's `ChantConfig.sbom` and `resolveSbomFormat`) is resolved
|
|
66
|
+
* by the caller/orchestrator into `input.format` before this capability
|
|
67
|
+
* runs, the same way env config is resolved before any other capability's
|
|
68
|
+
* `run` (this module never imports ../../config.ts directly, matching how
|
|
69
|
+
* no other verb module does either).
|
|
70
|
+
*
|
|
71
|
+
* No rollback: an already-generated SBOM sitting in the archive (or, later,
|
|
72
|
+
* projected as a registry referrer) is immutable, content-addressed
|
|
73
|
+
* evidence — nothing to compensate, the same opt-out `docker-build` and
|
|
74
|
+
* `publish-image` already take for their own no-mutable-remote-state reason.
|
|
75
|
+
*/
|
|
76
|
+
export declare function createGenerateSbomCapability(generator?: SbomGenerator): Capability<GenerateSbomInput, GenerateSbomOutput>;
|
|
77
|
+
/** Default `generate-sbom` capability, backed by the process-wide default `SbomGenerator` (throws until a real backend is injected — see ./sbom-generator.ts's `notImplementedSbomGenerator`). */
|
|
78
|
+
export declare const generateSbomCapability: Capability<GenerateSbomInput, GenerateSbomOutput>;
|
|
79
|
+
//# sourceMappingURL=sbom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sbom.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/sbom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,iBAAiB;IAChC,6LAA6L;IAC7L,YAAY,EAAE,gBAAgB,CAAC;IAC/B,gRAAgR;IAChR,IAAI,EAAE,MAAM,CAAC;IACb,gPAAgP;IAChP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oMAAoM;IACpM,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,+HAA+H;IAC/H,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gQAAgQ;IAChQ,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,mHAAmH;IACnH,IAAI,EAAE,YAAY,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,sHAAsH;IACtH,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AA8BD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,GAAE,aAAsC,GAChD,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAwBnD;AAED,kMAAkM;AAClM,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAkC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* escape hatch family — `shell`. Typed, but flagged: a raw shell step run by
|
|
3
|
+
* exactly one component is the "capability-per-component" smell the model
|
|
4
|
+
* exists to avoid (see docs/components/capabilities.mdx#the-discipline).
|
|
5
|
+
* `reason` is required so lint (COMP006) can flag an escape hatch used without
|
|
6
|
+
* a stated justification.
|
|
7
|
+
*/
|
|
8
|
+
import type { Capability } from "../capability.js";
|
|
9
|
+
import { type ProcessRunner } from "./process-runner.js";
|
|
10
|
+
export interface ShellInput {
|
|
11
|
+
/** Command to run. */
|
|
12
|
+
cmd: string;
|
|
13
|
+
/** Working directory. Default: process cwd. */
|
|
14
|
+
cwd?: string;
|
|
15
|
+
/** Additional environment variables. */
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
/** Required justification for reaching past the capability set — lint-checked. */
|
|
18
|
+
reason: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ShellOutput {
|
|
21
|
+
/** Captured stdout. */
|
|
22
|
+
stdout: string;
|
|
23
|
+
/** Process exit code. Always 0 on success — a non-zero exit rejects the run. */
|
|
24
|
+
exitCode: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Run an arbitrary shell command through the injectable {@link ProcessRunner}.
|
|
28
|
+
* The escape hatch — typed, lint-flagged, and requires a `reason`. A non-zero
|
|
29
|
+
* exit rejects (with the command's own stderr), failing the step like any other
|
|
30
|
+
* capability error, so `onFailure`/rollback fires.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createShellCapability(processRunner?: ProcessRunner): Capability<ShellInput, ShellOutput>;
|
|
33
|
+
/** Default `shell` capability, backed by the real process runner. */
|
|
34
|
+
export declare const shellCapability: Capability<ShellInput, ShellOutput>;
|
|
35
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/shell.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,GAAE,aAAsC,GAAG,UAAU,CAAC,UAAU,EAAE,WAAW,CAAC,CAYhI;AAED,qEAAqE;AACrE,eAAO,MAAM,eAAe,EAAE,UAAU,CAAC,UAAU,EAAE,WAAW,CAA2B,CAAC"}
|