@agent-teams/engineering-foundation 0.6.0 → 0.8.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/README.md +6 -2
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/crypto/node-sha256-digest.d.ts +6 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/crypto/node-sha256-digest.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/crypto/node-sha256-digest.js +7 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/crypto/node-sha256-digest.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/qualification/filesystem-buf-breaking-qualification-evidence.d.ts +8 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/qualification/filesystem-buf-breaking-qualification-evidence.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/qualification/filesystem-buf-breaking-qualification-evidence.js +131 -0
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/qualification/filesystem-buf-breaking-qualification-evidence.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.d.ts +37 -0
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.js +258 -0
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/model/protobuf-release-evidence.d.ts +52 -2
- package/dist/capabilities/contract-protobuf-evolution/application/model/protobuf-release-evidence.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/application/policies/evaluate-protobuf-evolution.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/application/policies/evaluate-protobuf-evolution.js +0 -3
- package/dist/capabilities/contract-protobuf-evolution/application/policies/evaluate-protobuf-evolution.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/application/ports/buf-breaking-qualification-evidence.d.ts +14 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/buf-breaking-qualification-evidence.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/buf-breaking-qualification-evidence.js +2 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/buf-breaking-qualification-evidence.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/sha256-digest.d.ts +5 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/sha256-digest.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/sha256-digest.js +2 -0
- package/dist/capabilities/contract-protobuf-evolution/application/ports/sha256-digest.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/application/use-cases/resolve-protobuf-evolution-policy.d.ts +2 -0
- package/dist/capabilities/contract-protobuf-evolution/application/use-cases/resolve-protobuf-evolution-policy.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/application/use-cases/resolve-protobuf-evolution-policy.js +10 -1
- package/dist/capabilities/contract-protobuf-evolution/application/use-cases/resolve-protobuf-evolution-policy.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.d.ts +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.js +33 -18
- package/dist/capabilities/contract-protobuf-evolution/contract/config.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/module.d.ts +3 -1
- package/dist/capabilities/contract-protobuf-evolution/module.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/module.js +4 -1
- package/dist/capabilities/contract-protobuf-evolution/module.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.d.ts +21 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.js +301 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.d.ts +2 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.js +28 -41
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.d.ts +8 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.js +102 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/module.d.ts +14 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/module.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/qualification/module.js +22 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/module.js.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-artifacts.d.ts +21 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-artifacts.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-artifacts.js +2 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-artifacts.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-runner.d.ts +18 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-runner.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-runner.js +2 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/ports/buf-qualification-runner.js.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/use-cases/qualify-buf-breaking-evidence.d.ts +22 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/use-cases/qualify-buf-breaking-evidence.d.ts.map +1 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/use-cases/qualify-buf-breaking-evidence.js +221 -0
- package/dist/capabilities/contract-protobuf-evolution/qualification/use-cases/qualify-buf-breaking-evidence.js.map +1 -0
- package/dist/capabilities/source-dependencies/application/model/source-workspace.d.ts +2 -6
- package/dist/capabilities/source-dependencies/application/model/source-workspace.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/model/source-workspace.js +0 -1
- package/dist/capabilities/source-dependencies/application/model/source-workspace.js.map +1 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-resolved-source-dependency.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-resolved-source-dependency.js +1 -3
- package/dist/capabilities/source-dependencies/application/policies/evaluate-resolved-source-dependency.js.map +1 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-source-dependencies.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-source-dependencies.js +1 -6
- package/dist/capabilities/source-dependencies/application/policies/evaluate-source-dependencies.js.map +1 -1
- package/dist/capabilities/source-dependencies/application/rules.js +2 -2
- package/dist/capabilities/source-dependencies/application/rules.js.map +1 -1
- package/dist/capabilities/source-dependencies/application/use-cases/analyze-source-dependencies.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/use-cases/analyze-source-dependencies.js +1 -3
- package/dist/capabilities/source-dependencies/application/use-cases/analyze-source-dependencies.js.map +1 -1
- package/dist/capabilities/source-dependencies/contract/config.d.ts +1 -1
- package/dist/capabilities/source-dependencies/contract/config.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/contract/config.js +17 -25
- package/dist/capabilities/source-dependencies/contract/config.js.map +1 -1
- package/dist/cli-arguments.d.ts +2 -0
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +34 -2
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli.js +40 -1
- package/dist/cli.js.map +1 -1
- package/dist/scaffolding/adapters/memory/memory-workspace.js +1 -1
- package/dist/scaffolding/adapters/memory/memory-workspace.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts +13 -0
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js +257 -0
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-authority.d.ts +20 -0
- package/dist/scaffolding/adapters/node/filesystem-authority.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-authority.js +55 -0
- package/dist/scaffolding/adapters/node/filesystem-authority.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-file-identity.d.ts +20 -0
- package/dist/scaffolding/adapters/node/filesystem-file-identity.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-file-identity.js +122 -0
- package/dist/scaffolding/adapters/node/filesystem-file-identity.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts +22 -0
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-finalization.js +169 -0
- package/dist/scaffolding/adapters/node/filesystem-finalization.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-journal-state.d.ts +25 -0
- package/dist/scaffolding/adapters/node/filesystem-journal-state.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js +119 -0
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts +7 -4
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.js +104 -29
- package/dist/scaffolding/adapters/node/filesystem-journal.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts +23 -0
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +182 -0
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-path-guard.d.ts +2 -2
- package/dist/scaffolding/adapters/node/filesystem-path-guard.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-path-guard.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.d.ts +6 -0
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.js +80 -0
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts +1 -0
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-workspace.js +22 -151
- package/dist/scaffolding/adapters/node/filesystem-workspace.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-authority-error.d.ts +4 -0
- package/dist/scaffolding/adapters/node/node-authority-error.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-authority-error.js +7 -0
- package/dist/scaffolding/adapters/node/node-authority-error.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-authority-input-loader.d.ts +20 -0
- package/dist/scaffolding/adapters/node/node-authority-input-loader.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-authority-input-loader.js +180 -0
- package/dist/scaffolding/adapters/node/node-authority-input-loader.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.d.ts +4 -0
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.js +10 -0
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-input-loader.d.ts +1 -1
- package/dist/scaffolding/adapters/node/node-input-loader.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/node-input-loader.js +6 -56
- package/dist/scaffolding/adapters/node/node-input-loader.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-owner-document-resolver.d.ts +17 -0
- package/dist/scaffolding/adapters/node/node-owner-document-resolver.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-owner-document-resolver.js +161 -0
- package/dist/scaffolding/adapters/node/node-owner-document-resolver.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-plan-authority.d.ts +14 -2
- package/dist/scaffolding/adapters/node/node-plan-authority.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/node-plan-authority.js +28 -9
- package/dist/scaffolding/adapters/node/node-plan-authority.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-receipt-validator.d.ts +1 -1
- package/dist/scaffolding/adapters/node/node-receipt-validator.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/node-receipt-validator.js +2 -2
- package/dist/scaffolding/adapters/node/node-receipt-validator.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.d.ts +3 -0
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.js +18 -0
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-repository-file.d.ts +9 -0
- package/dist/scaffolding/adapters/node/node-repository-file.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-repository-file.js +65 -0
- package/dist/scaffolding/adapters/node/node-repository-file.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-limits.d.ts +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-limits.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-limits.js +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-limits.js.map +1 -0
- package/dist/scaffolding/authority-service.d.ts +7 -0
- package/dist/scaffolding/authority-service.d.ts.map +1 -0
- package/dist/scaffolding/authority-service.js +15 -0
- package/dist/scaffolding/authority-service.js.map +1 -0
- package/dist/scaffolding/canonical-api.d.ts +14 -0
- package/dist/scaffolding/canonical-api.d.ts.map +1 -0
- package/dist/scaffolding/canonical-api.js +32 -0
- package/dist/scaffolding/canonical-api.js.map +1 -0
- package/dist/scaffolding/cli-command.d.ts.map +1 -1
- package/dist/scaffolding/cli-command.js +1 -2
- package/dist/scaffolding/cli-command.js.map +1 -1
- package/dist/scaffolding/contract/receipt-authority-types.d.ts +125 -0
- package/dist/scaffolding/contract/receipt-authority-types.d.ts.map +1 -0
- package/dist/scaffolding/contract/receipt-authority-types.js +2 -0
- package/dist/scaffolding/contract/receipt-authority-types.js.map +1 -0
- package/dist/scaffolding/contract/scaffold-contract.d.ts +329 -0
- package/dist/scaffolding/contract/scaffold-contract.d.ts.map +1 -0
- package/dist/scaffolding/contract/scaffold-contract.js +2 -0
- package/dist/scaffolding/contract/scaffold-contract.js.map +1 -0
- package/dist/scaffolding/contract/types.d.ts +177 -35
- package/dist/scaffolding/contract/types.d.ts.map +1 -1
- package/dist/scaffolding/definitions/node-typescript-library.d.ts +3 -0
- package/dist/scaffolding/definitions/node-typescript-library.d.ts.map +1 -0
- package/dist/scaffolding/definitions/node-typescript-library.js +134 -0
- package/dist/scaffolding/definitions/node-typescript-library.js.map +1 -0
- package/dist/scaffolding/definitions/registry.d.ts +2 -1
- package/dist/scaffolding/definitions/registry.d.ts.map +1 -1
- package/dist/scaffolding/definitions/registry.js +8 -1
- package/dist/scaffolding/definitions/registry.js.map +1 -1
- package/dist/scaffolding/index.d.ts +4 -8
- package/dist/scaffolding/index.d.ts.map +1 -1
- package/dist/scaffolding/index.js +2 -7
- package/dist/scaffolding/index.js.map +1 -1
- package/dist/scaffolding/internal-rendering-regression-api.d.ts +8 -0
- package/dist/scaffolding/internal-rendering-regression-api.d.ts.map +1 -0
- package/dist/scaffolding/internal-rendering-regression-api.js +8 -0
- package/dist/scaffolding/internal-rendering-regression-api.js.map +1 -0
- package/dist/scaffolding/kernel/authority-compiler.d.ts +4 -0
- package/dist/scaffolding/kernel/authority-compiler.d.ts.map +1 -0
- package/dist/scaffolding/kernel/authority-compiler.js +78 -0
- package/dist/scaffolding/kernel/authority-compiler.js.map +1 -0
- package/dist/scaffolding/kernel/authority-evidence.d.ts +13 -0
- package/dist/scaffolding/kernel/authority-evidence.d.ts.map +1 -0
- package/dist/scaffolding/kernel/authority-evidence.js +79 -0
- package/dist/scaffolding/kernel/authority-evidence.js.map +1 -0
- package/dist/scaffolding/kernel/authority-receipt.d.ts +11 -0
- package/dist/scaffolding/kernel/authority-receipt.d.ts.map +1 -0
- package/dist/scaffolding/kernel/authority-receipt.js +189 -0
- package/dist/scaffolding/kernel/authority-receipt.js.map +1 -0
- package/dist/scaffolding/kernel/compiler.d.ts +28 -2
- package/dist/scaffolding/kernel/compiler.d.ts.map +1 -1
- package/dist/scaffolding/kernel/compiler.js +22 -36
- package/dist/scaffolding/kernel/compiler.js.map +1 -1
- package/dist/scaffolding/kernel/definition-registry.d.ts +6 -3
- package/dist/scaffolding/kernel/definition-registry.d.ts.map +1 -1
- package/dist/scaffolding/kernel/definition-registry.js +17 -1
- package/dist/scaffolding/kernel/definition-registry.js.map +1 -1
- package/dist/scaffolding/kernel/plan-content-validation.d.ts +3 -0
- package/dist/scaffolding/kernel/plan-content-validation.d.ts.map +1 -0
- package/dist/scaffolding/kernel/plan-content-validation.js +44 -0
- package/dist/scaffolding/kernel/plan-content-validation.js.map +1 -0
- package/dist/scaffolding/kernel/plan-validation.d.ts +2 -2
- package/dist/scaffolding/kernel/plan-validation.d.ts.map +1 -1
- package/dist/scaffolding/kernel/plan-validation.js +16 -40
- package/dist/scaffolding/kernel/plan-validation.js.map +1 -1
- package/dist/scaffolding/kernel/receipt.js +1 -1
- package/dist/scaffolding/kernel/receipt.js.map +1 -1
- package/dist/scaffolding/kernel/rendering-plan-compiler.d.ts +4 -0
- package/dist/scaffolding/kernel/rendering-plan-compiler.d.ts.map +1 -0
- package/dist/scaffolding/kernel/rendering-plan-compiler.js +43 -0
- package/dist/scaffolding/kernel/rendering-plan-compiler.js.map +1 -0
- package/dist/scaffolding/kernel/rendering-plan-validation.d.ts +3 -0
- package/dist/scaffolding/kernel/rendering-plan-validation.d.ts.map +1 -0
- package/dist/scaffolding/kernel/rendering-plan-validation.js +10 -0
- package/dist/scaffolding/kernel/rendering-plan-validation.js.map +1 -0
- package/dist/scaffolding/scaffold-defaults.d.ts +2 -0
- package/dist/scaffolding/scaffold-defaults.d.ts.map +1 -0
- package/dist/scaffolding/scaffold-defaults.js +2 -0
- package/dist/scaffolding/scaffold-defaults.js.map +1 -0
- package/dist/scaffolding/scaffold-error.d.ts +3 -3
- package/dist/scaffolding/scaffold-error.d.ts.map +1 -1
- package/dist/scaffolding/scaffold-error.js.map +1 -1
- package/dist/scaffolding/service.d.ts +1 -1
- package/dist/scaffolding/service.d.ts.map +1 -1
- package/dist/scaffolding/service.js +5 -4
- package/dist/scaffolding/service.js.map +1 -1
- package/dist/schema-catalog.d.ts +2 -2
- package/dist/schema-catalog.d.ts.map +1 -1
- package/dist/schema-catalog.js +41 -8
- package/dist/schema-catalog.js.map +1 -1
- package/dist/schema-ids.d.ts +5 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +14 -3
- package/dist/schema-ids.js.map +1 -1
- package/package.json +30 -2
- package/schemas/architecture-source-dependencies/v1.schema.json +6 -1
- package/schemas/contract-protobuf-breaking-qualification/v1.schema.json +89 -0
- package/schemas/contract-protobuf-breaking-qualification/v2.schema.json +93 -0
- package/schemas/contract-protobuf-evolution/v2.schema.json +147 -0
- package/schemas/scaffold-authority-evidence.schema.json +103 -0
- package/schemas/{scaffold-intent/v1.schema.json → scaffold-intent.schema.json} +2 -2
- package/schemas/{scaffold-plan/v1.schema.json → scaffold-plan.schema.json} +89 -11
- package/schemas/scaffold-receipt.schema.json +180 -0
- package/schemas/scaffold-recovery-journal.schema.json +31 -0
- package/schemas/{scaffold-target-catalog/v1.schema.json → scaffold-target-catalog.schema.json} +11 -10
- package/schemas/{scaffolding-config/v1.schema.json → scaffolding-config.schema.json} +40 -4
- package/schemas/architecture-source-dependencies/v2.schema.json +0 -102
- package/schemas/scaffold-receipt/v1.schema.json +0 -299
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { open, mkdir, mkdtemp, realpath, rename, rm, stat } from "node:fs/promises";
|
|
2
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { setTimeout as wait } from "node:timers/promises";
|
|
4
|
+
import { lock } from "proper-lockfile";
|
|
5
|
+
import { CapabilityInputError } from "../../../../../../capability-runtime.js";
|
|
6
|
+
import { assertNotCancelled } from "../../../../../../cancellation.js";
|
|
7
|
+
import { ContainedFileReadError, pathTraversesSymbolicLink, readContainedRegularFile } from "../../../../../../filesystem-path-safety.js";
|
|
8
|
+
const MAX_EVIDENCE_BYTES = 8 * 1024 * 1024;
|
|
9
|
+
const WRITE_LOCK_OPTIONS = Object.freeze({
|
|
10
|
+
realpath: false,
|
|
11
|
+
retries: 0,
|
|
12
|
+
stale: 30_000,
|
|
13
|
+
update: 10_000
|
|
14
|
+
});
|
|
15
|
+
const WRITE_LOCK_RETRIES = 30;
|
|
16
|
+
const WRITE_LOCK_MIN_DELAY_MS = 25;
|
|
17
|
+
const WRITE_LOCK_MAX_DELAY_MS = 100;
|
|
18
|
+
const WRITE_LOCK_BACKOFF = 1.2;
|
|
19
|
+
function inputError(code, message) {
|
|
20
|
+
throw qualificationError(code, message);
|
|
21
|
+
}
|
|
22
|
+
function qualificationError(code, message) {
|
|
23
|
+
return new CapabilityInputError({
|
|
24
|
+
code,
|
|
25
|
+
message,
|
|
26
|
+
phase: "protobuf-buf-qualification-artifacts",
|
|
27
|
+
retryable: false
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function errorCode(error) {
|
|
31
|
+
return typeof error === "object" && error !== null && "code" in error
|
|
32
|
+
? String(error.code)
|
|
33
|
+
: undefined;
|
|
34
|
+
}
|
|
35
|
+
function errorObject(error, message) {
|
|
36
|
+
return error instanceof Error ? error : new Error(message, { cause: error });
|
|
37
|
+
}
|
|
38
|
+
function contained(root, candidate) {
|
|
39
|
+
const relation = relative(root, candidate);
|
|
40
|
+
return (relation === "" ||
|
|
41
|
+
(!isAbsolute(relation) && relation !== ".." && !relation.startsWith(`..${sep}`)));
|
|
42
|
+
}
|
|
43
|
+
function readFailure(error, path, optional) {
|
|
44
|
+
if (optional && error.failure === "missing") {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
inputError(error.failure === "symlink" || error.failure === "escape"
|
|
48
|
+
? "BUF_QUALIFICATION_PATH_UNSAFE"
|
|
49
|
+
: "BUF_QUALIFICATION_INPUT_UNAVAILABLE", `Qualification artifact is unavailable, unsafe, or changed while reading: ${path}.`);
|
|
50
|
+
}
|
|
51
|
+
async function readContained(input) {
|
|
52
|
+
try {
|
|
53
|
+
return await readContainedRegularFile({
|
|
54
|
+
candidate: resolve(input.consumerRoot, input.path),
|
|
55
|
+
maxBytes: input.maxBytes,
|
|
56
|
+
root: input.consumerRoot
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (!(error instanceof ContainedFileReadError)) {
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
readFailure(error, input.path, input.optional);
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function assertSafeCandidate(target) {
|
|
68
|
+
if ((await pathTraversesSymbolicLink(target.root, target.parent)) ||
|
|
69
|
+
(await pathTraversesSymbolicLink(target.root, target.candidate))) {
|
|
70
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence target cannot traverse a symbolic link.");
|
|
71
|
+
}
|
|
72
|
+
const canonicalParent = await realpath(target.parent);
|
|
73
|
+
const parentMetadata = await stat(canonicalParent, { bigint: true });
|
|
74
|
+
if (canonicalParent !== target.parent ||
|
|
75
|
+
!contained(target.root, canonicalParent) ||
|
|
76
|
+
!parentMetadata.isDirectory() ||
|
|
77
|
+
String(parentMetadata.dev) !== target.parentDevice ||
|
|
78
|
+
String(parentMetadata.ino) !== target.parentInode) {
|
|
79
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence directory identity changed during qualification.");
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const metadata = await stat(target.candidate);
|
|
83
|
+
if (!metadata.isFile()) {
|
|
84
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence target must be a regular file.");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (errorCode(error) !== "ENOENT") {
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function canonicalWriteTarget(consumerRoot, path) {
|
|
94
|
+
const root = await realpath(consumerRoot);
|
|
95
|
+
const lexicalCandidate = resolve(root, path);
|
|
96
|
+
if (!contained(root, lexicalCandidate)) {
|
|
97
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence path escapes the consumer repository.");
|
|
98
|
+
}
|
|
99
|
+
const parent = dirname(lexicalCandidate);
|
|
100
|
+
if (await pathTraversesSymbolicLink(root, parent)) {
|
|
101
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence directory cannot traverse a symbolic link.");
|
|
102
|
+
}
|
|
103
|
+
await mkdir(parent, { recursive: true });
|
|
104
|
+
if (await pathTraversesSymbolicLink(root, parent)) {
|
|
105
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence directory cannot traverse a symbolic link.");
|
|
106
|
+
}
|
|
107
|
+
const canonicalParent = await realpath(parent);
|
|
108
|
+
const parentMetadata = await stat(canonicalParent, { bigint: true });
|
|
109
|
+
if (!contained(root, canonicalParent) || !parentMetadata.isDirectory()) {
|
|
110
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence directory escapes the consumer repository.");
|
|
111
|
+
}
|
|
112
|
+
const target = {
|
|
113
|
+
candidate: join(canonicalParent, basename(lexicalCandidate)),
|
|
114
|
+
parent: canonicalParent,
|
|
115
|
+
parentDevice: String(parentMetadata.dev),
|
|
116
|
+
parentInode: String(parentMetadata.ino),
|
|
117
|
+
root
|
|
118
|
+
};
|
|
119
|
+
await assertSafeCandidate(target);
|
|
120
|
+
return target;
|
|
121
|
+
}
|
|
122
|
+
async function flushParentDirectory(parent) {
|
|
123
|
+
if (process.platform === "win32") {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const directory = await open(parent, "r");
|
|
127
|
+
try {
|
|
128
|
+
await directory.sync();
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
await directory.close();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function waitForLockRetry(delayMs, signal) {
|
|
135
|
+
assertNotCancelled(signal);
|
|
136
|
+
try {
|
|
137
|
+
await wait(delayMs, undefined, signal === undefined ? {} : { signal });
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
assertNotCancelled(signal);
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
assertNotCancelled(signal);
|
|
144
|
+
}
|
|
145
|
+
async function acquireWriteLock(path, signal) {
|
|
146
|
+
for (let attempt = 0; attempt <= WRITE_LOCK_RETRIES; attempt += 1) {
|
|
147
|
+
assertNotCancelled(signal);
|
|
148
|
+
try {
|
|
149
|
+
return await lock(path, WRITE_LOCK_OPTIONS);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
if (errorCode(error) !== "ELOCKED" || attempt === WRITE_LOCK_RETRIES) {
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const delayMs = Math.min(WRITE_LOCK_MAX_DELAY_MS, WRITE_LOCK_MIN_DELAY_MS * (WRITE_LOCK_BACKOFF ** attempt));
|
|
157
|
+
await waitForLockRetry(delayMs, signal);
|
|
158
|
+
}
|
|
159
|
+
throw new Error("Unreachable write-lock retry state.");
|
|
160
|
+
}
|
|
161
|
+
async function writeAtomic(target, source, signal) {
|
|
162
|
+
assertNotCancelled(signal);
|
|
163
|
+
const expected = Buffer.from(source, "utf8");
|
|
164
|
+
if (expected.length > MAX_EVIDENCE_BYTES) {
|
|
165
|
+
inputError("BUF_QUALIFICATION_EVIDENCE_TOO_LARGE", "Canonical Buf qualification evidence exceeds the supported size limit.");
|
|
166
|
+
}
|
|
167
|
+
const temporaryRoot = await mkdtemp(join(target.parent, ".buf-evidence-"));
|
|
168
|
+
const temporaryPath = join(temporaryRoot, "evidence.json");
|
|
169
|
+
let replaced = false;
|
|
170
|
+
let durable = false;
|
|
171
|
+
let failure;
|
|
172
|
+
try {
|
|
173
|
+
const handle = await open(temporaryPath, "wx", 0o600);
|
|
174
|
+
try {
|
|
175
|
+
await handle.writeFile(source, "utf8");
|
|
176
|
+
await handle.sync();
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
await handle.close();
|
|
180
|
+
}
|
|
181
|
+
assertNotCancelled(signal);
|
|
182
|
+
await assertSafeCandidate(target);
|
|
183
|
+
assertNotCancelled(signal);
|
|
184
|
+
await rename(temporaryPath, target.candidate);
|
|
185
|
+
replaced = true;
|
|
186
|
+
await assertSafeCandidate(target);
|
|
187
|
+
const persisted = await readContainedRegularFile({
|
|
188
|
+
candidate: target.candidate,
|
|
189
|
+
maxBytes: MAX_EVIDENCE_BYTES,
|
|
190
|
+
root: target.root
|
|
191
|
+
});
|
|
192
|
+
if (!persisted.equals(expected)) {
|
|
193
|
+
inputError("BUF_QUALIFICATION_WRITE_OUTCOME_UNCERTAIN", "Evidence bytes changed during atomic publication.");
|
|
194
|
+
}
|
|
195
|
+
await assertSafeCandidate(target);
|
|
196
|
+
await flushParentDirectory(target.parent);
|
|
197
|
+
durable = true;
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (replaced &&
|
|
201
|
+
(!(error instanceof CapabilityInputError) ||
|
|
202
|
+
error.problem.code !== "BUF_QUALIFICATION_WRITE_OUTCOME_UNCERTAIN")) {
|
|
203
|
+
failure = qualificationError("BUF_QUALIFICATION_WRITE_OUTCOME_UNCERTAIN", "Evidence was replaced but final durability or containment could not be proven.");
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
failure = errorObject(error, "Evidence publication failed.");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
let cleanupFailure;
|
|
210
|
+
try {
|
|
211
|
+
await rm(temporaryRoot, { force: true, recursive: true });
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
cleanupFailure = errorObject(error, "Temporary evidence cleanup failed.");
|
|
215
|
+
}
|
|
216
|
+
if (failure !== undefined) {
|
|
217
|
+
throw failure;
|
|
218
|
+
}
|
|
219
|
+
if (cleanupFailure !== undefined) {
|
|
220
|
+
if (durable) {
|
|
221
|
+
inputError("BUF_QUALIFICATION_POST_COMMIT_CLEANUP_FAILED", "Evidence was durably published, but temporary artifact cleanup failed.");
|
|
222
|
+
}
|
|
223
|
+
if (replaced) {
|
|
224
|
+
inputError("BUF_QUALIFICATION_WRITE_OUTCOME_UNCERTAIN", "Evidence was replaced, but publication completion could not be proven.");
|
|
225
|
+
}
|
|
226
|
+
throw cleanupFailure;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async function readExistingForWrite(consumerRoot, path, target) {
|
|
230
|
+
let metadata;
|
|
231
|
+
try {
|
|
232
|
+
metadata = await stat(target.candidate);
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
if (errorCode(error) === "ENOENT") {
|
|
236
|
+
return { exists: false };
|
|
237
|
+
}
|
|
238
|
+
throw error;
|
|
239
|
+
}
|
|
240
|
+
if (!metadata.isFile()) {
|
|
241
|
+
inputError("BUF_QUALIFICATION_PATH_UNSAFE", "Evidence target must be a regular file.");
|
|
242
|
+
}
|
|
243
|
+
if (metadata.size > MAX_EVIDENCE_BYTES) {
|
|
244
|
+
return { exists: true };
|
|
245
|
+
}
|
|
246
|
+
const bytes = await readContained({
|
|
247
|
+
consumerRoot,
|
|
248
|
+
path,
|
|
249
|
+
maxBytes: MAX_EVIDENCE_BYTES,
|
|
250
|
+
optional: false
|
|
251
|
+
});
|
|
252
|
+
return { exists: true, ...(bytes === undefined ? {} : { source: bytes.toString("utf8") }) };
|
|
253
|
+
}
|
|
254
|
+
export class FilesystemBufQualificationArtifacts {
|
|
255
|
+
async readInput(input) {
|
|
256
|
+
const bytes = await readContained({ ...input, optional: false });
|
|
257
|
+
if (bytes === undefined) {
|
|
258
|
+
inputError("BUF_QUALIFICATION_INPUT_UNAVAILABLE", `${input.label} is unavailable.`);
|
|
259
|
+
}
|
|
260
|
+
return bytes;
|
|
261
|
+
}
|
|
262
|
+
async readExistingEvidence(input) {
|
|
263
|
+
const bytes = await readContained({ ...input, optional: true });
|
|
264
|
+
return bytes?.toString("utf8");
|
|
265
|
+
}
|
|
266
|
+
async writeEvidence(input) {
|
|
267
|
+
assertNotCancelled(input.signal);
|
|
268
|
+
const target = await canonicalWriteTarget(input.consumerRoot, input.path);
|
|
269
|
+
let failed = false;
|
|
270
|
+
let release;
|
|
271
|
+
try {
|
|
272
|
+
release = await acquireWriteLock(target.candidate, input.signal);
|
|
273
|
+
assertNotCancelled(input.signal);
|
|
274
|
+
await assertSafeCandidate(target);
|
|
275
|
+
const existing = await readExistingForWrite(input.consumerRoot, input.path, target);
|
|
276
|
+
if (existing.source === input.source) {
|
|
277
|
+
return "unchanged";
|
|
278
|
+
}
|
|
279
|
+
await writeAtomic(target, input.source, input.signal);
|
|
280
|
+
return existing.exists ? "updated" : "created";
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
failed = true;
|
|
284
|
+
if (error instanceof CapabilityInputError) {
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
return inputError("BUF_QUALIFICATION_WRITE_UNAVAILABLE", "Buf qualification evidence could not be locked or replaced safely.");
|
|
288
|
+
}
|
|
289
|
+
finally {
|
|
290
|
+
try {
|
|
291
|
+
await release?.();
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
if (!failed) {
|
|
295
|
+
inputError("BUF_QUALIFICATION_LOCK_RELEASE_FAILED", "Evidence was published but its cooperative write lock could not be released.");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=filesystem-buf-qualification-artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem-buf-qualification-artifacts.js","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE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AAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACtD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,IAAI,CAAC;YACd,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBAC1C,MAAM,KAAK,CAAC;YACd,CAAC;YACD,OAAO,UAAU,CACf,qCAAqC,EACrC,oEAAoE,CACrE,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC;gBACH,MAAM,OAAO,EAAE,EAAE,CAAC;YACpB,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,UAAU,CACR,uCAAuC,EACvC,8EAA8E,CAC/E,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BufExecutable, BufExecutionResult, BufInvocation } from "../../../ports/buf-executable.js";
|
|
2
2
|
export declare class ProcessBufExecutable implements BufExecutable {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(timeoutMs?: number);
|
|
3
5
|
run(invocation: BufInvocation, signal?: AbortSignal): Promise<BufExecutionResult>;
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=process-buf-executable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-buf-executable.d.ts","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"process-buf-executable.d.ts","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,kCAAkC,CAAC;AA+F1C,qBAAa,oBAAqB,YAAW,aAAa;;IAGxD,YAAY,SAAS,SAAiC,EAErD;IAEK,GAAG,CACP,UAAU,EAAE,aAAa,EACzB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAY7B;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
1
|
import { realpath, stat } from "node:fs/promises";
|
|
3
2
|
import { isAbsolute } from "node:path";
|
|
4
3
|
import { CapabilityInputError } from "../../../../../../capability-runtime.js";
|
|
4
|
+
import { executeManagedProcess } from "../../../../../../process-execution/node-process-runner.js";
|
|
5
5
|
import { assertNotCancelled } from "../../../../../../strict-yaml.js";
|
|
6
6
|
const MAX_ARGUMENTS = 128;
|
|
7
7
|
const MAX_ARGUMENT_LENGTH = 16 * 1024;
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_BUF_PROCESS_TIMEOUT_MS = 300_000;
|
|
9
9
|
function hasControlCharacter(value) {
|
|
10
10
|
for (const character of value) {
|
|
11
11
|
const code = character.codePointAt(0);
|
|
@@ -15,13 +15,13 @@ function hasControlCharacter(value) {
|
|
|
15
15
|
}
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
function inputError(code, message) {
|
|
18
|
+
function inputError(code, message, cause) {
|
|
19
19
|
throw new CapabilityInputError({
|
|
20
20
|
code,
|
|
21
21
|
message,
|
|
22
22
|
phase: "protobuf-buf-process",
|
|
23
23
|
retryable: false
|
|
24
|
-
});
|
|
24
|
+
}, cause === undefined ? undefined : { cause });
|
|
25
25
|
}
|
|
26
26
|
function assertArgument(value, index) {
|
|
27
27
|
if (typeof value !== "string" ||
|
|
@@ -52,46 +52,33 @@ async function workingDirectory(path) {
|
|
|
52
52
|
}
|
|
53
53
|
return canonical;
|
|
54
54
|
}
|
|
55
|
-
function execute(command, arguments_, cwd, signal) {
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
async function execute(command, arguments_, cwd, timeoutMs, signal) {
|
|
56
|
+
try {
|
|
57
|
+
const result = await executeManagedProcess({
|
|
58
|
+
command,
|
|
59
|
+
args: arguments_,
|
|
58
60
|
cwd,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
shell: false,
|
|
62
|
-
signal,
|
|
63
|
-
windowsHide: true
|
|
64
|
-
}, (error, stdout, stderr) => {
|
|
65
|
-
if (error === null) {
|
|
66
|
-
resolve({ exitCode: 0, stdout, stderr });
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (signal?.aborted === true) {
|
|
70
|
-
reject(new CapabilityInputError({
|
|
71
|
-
code: "EXECUTION_CANCELLED",
|
|
72
|
-
message: "Foundation check was cancelled.",
|
|
73
|
-
phase: "protobuf-buf-process",
|
|
74
|
-
retryable: false
|
|
75
|
-
}));
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const exitCode = typeof error.code === "number"
|
|
79
|
-
? error.code
|
|
80
|
-
: undefined;
|
|
81
|
-
if (exitCode !== undefined) {
|
|
82
|
-
resolve({ exitCode, stdout, stderr });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
reject(new CapabilityInputError({
|
|
86
|
-
code: "BUF_EXECUTION_UNAVAILABLE",
|
|
87
|
-
message: "Pinned Buf executable could not be started.",
|
|
88
|
-
phase: "protobuf-buf-process",
|
|
89
|
-
retryable: false
|
|
90
|
-
}, { cause: error }));
|
|
61
|
+
timeoutMs,
|
|
62
|
+
...(signal === undefined ? {} : { signal })
|
|
91
63
|
});
|
|
92
|
-
|
|
64
|
+
return {
|
|
65
|
+
exitCode: result.exitCode,
|
|
66
|
+
stdout: result.stdout,
|
|
67
|
+
stderr: result.stderr
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (signal?.aborted === true) {
|
|
72
|
+
inputError("EXECUTION_CANCELLED", "Buf qualification was cancelled.", error);
|
|
73
|
+
}
|
|
74
|
+
inputError("BUF_EXECUTION_UNAVAILABLE", `Pinned Buf execution failed or exceeded its ${String(timeoutMs)}ms deadline.`, error);
|
|
75
|
+
}
|
|
93
76
|
}
|
|
94
77
|
export class ProcessBufExecutable {
|
|
78
|
+
#timeoutMs;
|
|
79
|
+
constructor(timeoutMs = DEFAULT_BUF_PROCESS_TIMEOUT_MS) {
|
|
80
|
+
this.#timeoutMs = timeoutMs;
|
|
81
|
+
}
|
|
95
82
|
async run(invocation, signal) {
|
|
96
83
|
assertNotCancelled(signal);
|
|
97
84
|
if (!Array.isArray(invocation.arguments) || invocation.arguments.length > MAX_ARGUMENTS) {
|
|
@@ -103,7 +90,7 @@ export class ProcessBufExecutable {
|
|
|
103
90
|
workingDirectory(invocation.workingDirectory)
|
|
104
91
|
]);
|
|
105
92
|
assertNotCancelled(signal);
|
|
106
|
-
return execute(command, invocation.arguments, cwd, signal);
|
|
93
|
+
return execute(command, invocation.arguments, cwd, this.#timeoutMs, signal);
|
|
107
94
|
}
|
|
108
95
|
}
|
|
109
96
|
//# sourceMappingURL=process-buf-executable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-buf-executable.js","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"process-buf-executable.js","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-executable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAA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EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BufQualificationRunner, BufQualificationRunInput, BufQualificationRunResult } from "../../../ports/buf-qualification-runner.js";
|
|
2
|
+
import type { BufExecutable } from "../../../ports/buf-executable.js";
|
|
3
|
+
export declare class ProcessBufQualificationRunner implements BufQualificationRunner {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(executable?: BufExecutable);
|
|
6
|
+
run(input: BufQualificationRunInput): Promise<BufQualificationRunResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=process-buf-qualification-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-buf-qualification-runner.d.ts","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AA6CtE,qBAAa,6BAA8B,YAAW,sBAAsB;;IAG1E,YAAY,UAAU,GAAE,aAA0C,EAEjE;IAEK,GAAG,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CA+D7E;CACF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { open, mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { CapabilityInputError } from "../../../../../../capability-runtime.js";
|
|
5
|
+
import { readContainedRegularFile } from "../../../../../../filesystem-path-safety.js";
|
|
6
|
+
import { assertNotCancelled } from "../../../../../../strict-yaml.js";
|
|
7
|
+
import { bufQualificationInvocationPlan } from "../../../../application/model/buf-breaking-qualification.js";
|
|
8
|
+
import { verifyPinnedBufVersion } from "../../../use-cases/verify-pinned-buf-version.js";
|
|
9
|
+
import { ProcessBufExecutable } from "./process-buf-executable.js";
|
|
10
|
+
const MAX_DESCRIPTOR_BYTES = 64 * 1024 * 1024;
|
|
11
|
+
function inputError(code, message) {
|
|
12
|
+
throw new CapabilityInputError({
|
|
13
|
+
code,
|
|
14
|
+
message,
|
|
15
|
+
phase: "protobuf-buf-qualification-process",
|
|
16
|
+
retryable: false
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async function writePrivateFile(path, bytes) {
|
|
20
|
+
const handle = await open(path, "wx", 0o600);
|
|
21
|
+
try {
|
|
22
|
+
await handle.writeFile(bytes);
|
|
23
|
+
await handle.sync();
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await handle.close();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function readBoundedDescriptor(root, path) {
|
|
30
|
+
let descriptor;
|
|
31
|
+
try {
|
|
32
|
+
descriptor = await readContainedRegularFile({
|
|
33
|
+
candidate: path,
|
|
34
|
+
maxBytes: MAX_DESCRIPTOR_BYTES,
|
|
35
|
+
root
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
inputError("BUF_CANDIDATE_DESCRIPTOR_INVALID", "Buf candidate descriptor is unavailable, unsafe, or exceeds the supported size limit.");
|
|
40
|
+
}
|
|
41
|
+
if (descriptor.length === 0) {
|
|
42
|
+
inputError("BUF_CANDIDATE_DESCRIPTOR_INVALID", "Buf candidate descriptor is empty.");
|
|
43
|
+
}
|
|
44
|
+
return descriptor;
|
|
45
|
+
}
|
|
46
|
+
export class ProcessBufQualificationRunner {
|
|
47
|
+
#executable;
|
|
48
|
+
constructor(executable = new ProcessBufExecutable()) {
|
|
49
|
+
this.#executable = executable;
|
|
50
|
+
}
|
|
51
|
+
async run(input) {
|
|
52
|
+
assertNotCancelled(input.signal);
|
|
53
|
+
await verifyPinnedBufVersion({
|
|
54
|
+
invocation: {
|
|
55
|
+
executablePath: input.executablePath,
|
|
56
|
+
workingDirectory: input.workingDirectory
|
|
57
|
+
},
|
|
58
|
+
expectedVersion: input.expectedVersion,
|
|
59
|
+
...(input.signal === undefined ? {} : { signal: input.signal })
|
|
60
|
+
}, this.#executable);
|
|
61
|
+
const temporaryRoot = await mkdtemp(join(tmpdir(), "agent-teams-buf-qualification-"));
|
|
62
|
+
const baselinePath = join(temporaryRoot, "baseline.binpb");
|
|
63
|
+
const candidatePath = join(temporaryRoot, "candidate.binpb");
|
|
64
|
+
const invocation = bufQualificationInvocationPlan({
|
|
65
|
+
baselineDescriptorPath: baselinePath,
|
|
66
|
+
bufConfigPath: input.bufConfigPath,
|
|
67
|
+
candidateDescriptorPath: candidatePath,
|
|
68
|
+
modulePath: input.modulePath
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
await writePrivateFile(baselinePath, input.baselineDescriptorImage);
|
|
72
|
+
const build = await this.#executable.run({
|
|
73
|
+
executablePath: input.executablePath,
|
|
74
|
+
workingDirectory: input.workingDirectory,
|
|
75
|
+
arguments: invocation.buildArguments
|
|
76
|
+
}, input.signal);
|
|
77
|
+
assertNotCancelled(input.signal);
|
|
78
|
+
if (build.exitCode !== 0 || build.stdout.length !== 0 || build.stderr.length !== 0) {
|
|
79
|
+
inputError("BUF_BUILD_FAILED", `Buf candidate descriptor build failed or emitted unexpected output: ${build.stderr.trim() || build.stdout.trim() || `exit ${build.exitCode}`}.`);
|
|
80
|
+
}
|
|
81
|
+
const candidateDescriptorImage = await readBoundedDescriptor(temporaryRoot, candidatePath);
|
|
82
|
+
const breaking = await this.#executable.run({
|
|
83
|
+
executablePath: input.executablePath,
|
|
84
|
+
workingDirectory: input.workingDirectory,
|
|
85
|
+
arguments: invocation.breakingArguments
|
|
86
|
+
}, input.signal);
|
|
87
|
+
assertNotCancelled(input.signal);
|
|
88
|
+
if ((breaking.exitCode !== 0 && breaking.exitCode !== 100) || breaking.stderr.length !== 0) {
|
|
89
|
+
inputError("BUF_BREAKING_EXECUTION_FAILED", `Buf breaking qualification failed: ${breaking.stderr.trim() || `exit ${breaking.exitCode}`}.`);
|
|
90
|
+
}
|
|
91
|
+
return Object.freeze({
|
|
92
|
+
status: breaking.exitCode === 0 ? "compatible" : "breaking",
|
|
93
|
+
candidateDescriptorImage,
|
|
94
|
+
rawOutput: breaking.stdout
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
await rm(temporaryRoot, { force: true, recursive: true });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=process-buf-qualification-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-buf-qualification-runner.js","sourceRoot":"","sources":["../../../../../../../src/capabilities/contract-protobuf-evolution/qualification/adapters/outbound/process/process-buf-qualification-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6DAA6D,CAAC;AAO7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,SAAS,UAAU,CAAC,IAAY,EAAE,OAAe;IAC/C,MAAM,IAAI,oBAAoB,CAAC;QAC7B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f-breaking-evidence.js";
|
|
2
|
+
export declare function qualifyProtobufBreakingEvidence(input: {
|
|
3
|
+
readonly consumerRoot: string;
|
|
4
|
+
readonly configPath: string;
|
|
5
|
+
readonly executablePath: string;
|
|
6
|
+
readonly write: boolean;
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}): Promise<QualifyBufBreakingEvidenceResult>;
|
|
9
|
+
export { FilesystemBufQualificationArtifacts } from "./adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.js";
|
|
1
10
|
export { ProcessBufExecutable } from "./adapters/outbound/process/process-buf-executable.js";
|
|
11
|
+
export { ProcessBufQualificationRunner } from "./adapters/outbound/process/process-buf-qualification-runner.js";
|
|
2
12
|
export type { BufExecutable, BufExecutionResult, BufInvocation } from "./ports/buf-executable.js";
|
|
13
|
+
export type { BufQualificationArtifacts, BufQualificationEvidenceWriteResult } from "./ports/buf-qualification-artifacts.js";
|
|
14
|
+
export type { BufQualificationRunner, BufQualificationRunInput, BufQualificationRunResult } from "./ports/buf-qualification-runner.js";
|
|
15
|
+
export { qualifyBufBreakingEvidence } from "./use-cases/qualify-buf-breaking-evidence.js";
|
|
16
|
+
export type { QualifyBufBreakingEvidenceResult } from "./use-cases/qualify-buf-breaking-evidence.js";
|
|
3
17
|
export { verifyPinnedBufVersion } from "./use-cases/verify-pinned-buf-version.js";
|
|
4
18
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/contract-protobuf-evolution/qualification/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/contract-protobuf-evolution/qualification/module.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,8CAA8C,CAAC;AAEtD,wBAAsB,+BAA+B,CAAC,KAAK,EAAE;IAC3D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAoB5C;AAED,OAAO,EAAE,mCAAmC,EAAE,MAAM,0EAA0E,CAAC;AAC/H,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAChH,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,YAAY,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
import { NodeSha256Digest } from "../adapters/outbound/crypto/node-sha256-digest.js";
|
|
2
|
+
import { loadCapabilityConfig } from "../contract/config.js";
|
|
3
|
+
import { FilesystemBufQualificationArtifacts } from "./adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.js";
|
|
4
|
+
import { ProcessBufQualificationRunner } from "./adapters/outbound/process/process-buf-qualification-runner.js";
|
|
5
|
+
import { qualifyBufBreakingEvidence } from "./use-cases/qualify-buf-breaking-evidence.js";
|
|
6
|
+
export async function qualifyProtobufBreakingEvidence(input) {
|
|
7
|
+
const configuration = await loadCapabilityConfig(input.consumerRoot, input.configPath, input.signal);
|
|
8
|
+
return qualifyBufBreakingEvidence({
|
|
9
|
+
consumerRoot: input.consumerRoot,
|
|
10
|
+
executablePath: input.executablePath,
|
|
11
|
+
configuration,
|
|
12
|
+
write: input.write,
|
|
13
|
+
...(input.signal === undefined ? {} : { signal: input.signal })
|
|
14
|
+
}, {
|
|
15
|
+
artifacts: new FilesystemBufQualificationArtifacts(),
|
|
16
|
+
digest: new NodeSha256Digest(),
|
|
17
|
+
runner: new ProcessBufQualificationRunner()
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { FilesystemBufQualificationArtifacts } from "./adapters/outbound/filesystem/filesystem-buf-qualification-artifacts.js";
|
|
1
21
|
export { ProcessBufExecutable } from "./adapters/outbound/process/process-buf-executable.js";
|
|
22
|
+
export { ProcessBufQualificationRunner } from "./adapters/outbound/process/process-buf-qualification-runner.js";
|
|
23
|
+
export { qualifyBufBreakingEvidence } from "./use-cases/qualify-buf-breaking-evidence.js";
|
|
2
24
|
export { verifyPinnedBufVersion } from "./use-cases/verify-pinned-buf-version.js";
|
|
3
25
|
//# sourceMappingURL=module.js.map
|