@agent-teams/engineering-foundation 0.7.0 → 0.9.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.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.js +30 -15
- 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/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js +1 -14
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts +4 -4
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js +34 -46
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/model/public-api.d.ts +18 -75
- package/dist/capabilities/public-api-compatibility/application/model/public-api.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/model/public-api.js +7 -29
- package/dist/capabilities/public-api-compatibility/application/model/public-api.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/accepted-breaking-change.d.ts +1 -5
- package/dist/capabilities/public-api-compatibility/application/policies/accepted-breaking-change.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/accepted-breaking-change.js +1 -8
- package/dist/capabilities/public-api-compatibility/application/policies/accepted-breaking-change.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.js +5 -38
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/validate-package-export-coverage.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/validate-package-export-coverage.js +2 -2
- package/dist/capabilities/public-api-compatibility/application/policies/validate-package-export-coverage.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.js +0 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js +0 -38
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/contract/config.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/contract/config.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/contract/config.js +32 -106
- package/dist/capabilities/public-api-compatibility/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/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 +16 -0
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +158 -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/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-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-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 +130 -193
- 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 +1 -1
- package/dist/scaffolding/definitions/registry.d.ts.map +1 -1
- package/dist/scaffolding/definitions/registry.js +6 -2
- 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/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/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/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 +2 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +3 -2
- package/dist/schema-ids.js.map +1 -1
- package/package.json +25 -2
- package/schemas/contract-protobuf-breaking-qualification/v1.schema.json +93 -0
- package/schemas/contract-protobuf-evolution/v1.schema.json +47 -15
- package/schemas/package-public-api-baseline/v1.schema.json +49 -12
- package/schemas/package-public-api-compatibility/v1.schema.json +46 -5
- package/schemas/scaffold-authority-evidence/v1.schema.json +103 -0
- package/schemas/scaffold-intent/v1.schema.json +1 -1
- package/schemas/scaffold-plan/v1.schema.json +86 -8
- package/schemas/scaffold-receipt/v1.schema.json +102 -221
- package/schemas/scaffold-recovery-journal/v1.schema.json +31 -0
- package/schemas/scaffold-target-catalog/v1.schema.json +9 -8
- package/schemas/scaffolding-config/v1.schema.json +38 -2
- package/dist/scaffolding/adapters/memory/memory-workspace.d.ts +0 -9
- package/dist/scaffolding/adapters/memory/memory-workspace.d.ts.map +0 -1
- package/dist/scaffolding/adapters/memory/memory-workspace.js +0 -93
- package/dist/scaffolding/adapters/memory/memory-workspace.js.map +0 -1
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts +0 -13
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/filesystem-workspace.js +0 -336
- package/dist/scaffolding/adapters/node/filesystem-workspace.js.map +0 -1
- package/dist/scaffolding/adapters/node/node-input-loader.d.ts +0 -17
- package/dist/scaffolding/adapters/node/node-input-loader.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/node-input-loader.js +0 -157
- package/dist/scaffolding/adapters/node/node-input-loader.js.map +0 -1
- package/dist/scaffolding/adapters/node/node-receipt-validator.d.ts +0 -4
- package/dist/scaffolding/adapters/node/node-receipt-validator.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/node-receipt-validator.js +0 -10
- package/dist/scaffolding/adapters/node/node-receipt-validator.js.map +0 -1
- package/dist/scaffolding/kernel/receipt.d.ts +0 -35
- package/dist/scaffolding/kernel/receipt.d.ts.map +0 -1
- package/dist/scaffolding/kernel/receipt.js +0 -206
- package/dist/scaffolding/kernel/receipt.js.map +0 -1
- package/dist/scaffolding/service.d.ts +0 -8
- package/dist/scaffolding/service.d.ts.map +0 -1
- package/dist/scaffolding/service.js +0 -15
- package/dist/scaffolding/service.js.map +0 -1
- package/schemas/package-public-api-baseline/v2.schema.json +0 -62
- package/schemas/package-public-api-compatibility/v2.schema.json +0 -113
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffolding/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffolding/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,wBAAwB,EACxB,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,cAAc,EACd,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export { applyFilesystemScaffold, recoverFilesystemScaffold } from "./
|
|
2
|
-
export { readScaffoldPlanFile } from "./adapters/node/node-input-loader.js";
|
|
3
|
-
export { validateScaffoldReceipt } from "./adapters/node/node-receipt-validator.js";
|
|
4
|
-
export { MemoryScaffoldWorkspace } from "./adapters/memory/memory-workspace.js";
|
|
5
|
-
export { assertScaffoldPlanDigest } from "./kernel/plan-validation.js";
|
|
6
|
-
export { assertScaffoldReceiptDigest } from "./kernel/receipt.js";
|
|
1
|
+
export { applyFilesystemScaffold, assertScaffoldAuthorityEvidenceDigest, assertScaffoldPlanDigest, assertScaffoldReceiptDigest, planScaffoldFromFile, readScaffoldPlanFile, recoverFilesystemScaffold, validateScaffoldReceipt } from "./canonical-api.js";
|
|
7
2
|
export { ScaffoldError } from "./scaffold-error.js";
|
|
8
|
-
export { DEFAULT_SCAFFOLDING_CONFIG_PATH
|
|
3
|
+
export { DEFAULT_SCAFFOLDING_CONFIG_PATH } from "./scaffold-defaults.js";
|
|
9
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scaffolding/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scaffolding/index.ts"],"names":[],"mappings":"AAsCA,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuthorityScaffoldCompilationInput, AuthorityScaffoldPlan } from "../contract/types.js";
|
|
2
|
+
import type { ScaffoldDefinitionRegistry } from "./definition-registry.js";
|
|
3
|
+
export declare function compileAuthorityScaffoldPlan(input: AuthorityScaffoldCompilationInput, registry: ScaffoldDefinitionRegistry): AuthorityScaffoldPlan;
|
|
4
|
+
//# sourceMappingURL=authority-compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-compiler.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,iCAAiC,EAGjC,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAiF3E,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,iCAAiC,EACxC,QAAQ,EAAE,0BAA0B,GACnC,qBAAqB,CAwBvB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ScaffoldError } from "../scaffold-error.js";
|
|
2
|
+
import { sha256Json } from "./canonical-json.js";
|
|
3
|
+
import { assertAuthorityEvidenceSourceBindings } from "./authority-evidence.js";
|
|
4
|
+
import { compileScaffoldRendering, resolveScaffoldRenderingSelection } from "./compiler.js";
|
|
5
|
+
function assertVerifierAdmission(input, composition, target) {
|
|
6
|
+
const authorityVerifiers = composition.authorityVerifiers;
|
|
7
|
+
if (authorityVerifiers.length !== 1) {
|
|
8
|
+
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", "The selected Composition must contain exactly one supported authority verifier.");
|
|
9
|
+
}
|
|
10
|
+
const admittedVerifier = authorityVerifiers[0];
|
|
11
|
+
if (admittedVerifier === undefined) {
|
|
12
|
+
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", "The selected Composition must admit exactly one authority verifier.");
|
|
13
|
+
}
|
|
14
|
+
if (!admittedVerifier.parameters.allowedStatuses.includes(input.authorityEvidence.ownerDocument.status)) {
|
|
15
|
+
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", "Owner document status is not allowed by the selected Composition.");
|
|
16
|
+
}
|
|
17
|
+
assertAuthorityEvidenceSourceBindings({
|
|
18
|
+
evidence: input.authorityEvidence,
|
|
19
|
+
target,
|
|
20
|
+
projectId: input.config.projectId,
|
|
21
|
+
targetRef: input.intent.targetRef,
|
|
22
|
+
configPath: input.configPath,
|
|
23
|
+
targetCatalogPath: input.config.targetCatalogPath,
|
|
24
|
+
authorityReadSet: input.authorityReadSet
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function normalizeAuthorityPlan(input, rendering, composition, target) {
|
|
28
|
+
const authoritySnapshotDigest = sha256Json({
|
|
29
|
+
configPath: input.configPath,
|
|
30
|
+
projectId: input.config.projectId,
|
|
31
|
+
composition,
|
|
32
|
+
target,
|
|
33
|
+
authorityEvidence: input.authorityEvidence,
|
|
34
|
+
readSet: input.authorityReadSet
|
|
35
|
+
});
|
|
36
|
+
const planBody = {
|
|
37
|
+
schemaVersion: 1,
|
|
38
|
+
protocolVersion: 1,
|
|
39
|
+
...rendering,
|
|
40
|
+
projectId: input.config.projectId,
|
|
41
|
+
authority: Object.freeze({
|
|
42
|
+
configPath: input.configPath,
|
|
43
|
+
targetCatalogPath: input.config.targetCatalogPath
|
|
44
|
+
}),
|
|
45
|
+
authorityEvidence: input.authorityEvidence,
|
|
46
|
+
authoritySnapshotDigest,
|
|
47
|
+
target,
|
|
48
|
+
readSet: Object.freeze([...input.authorityReadSet].toSorted((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0)),
|
|
49
|
+
requiredAdapterCapabilities: ["materialize-file/v1"]
|
|
50
|
+
};
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
...planBody,
|
|
53
|
+
planDigest: sha256Json(planBody)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function compileAuthorityScaffoldPlan(input, registry) {
|
|
57
|
+
const { composition, target } = resolveScaffoldRenderingSelection({
|
|
58
|
+
compositions: input.config.compositions,
|
|
59
|
+
targets: input.catalog.packages,
|
|
60
|
+
authorityReadPaths: input.authorityReadSet.map(({ path }) => path),
|
|
61
|
+
intent: input.intent
|
|
62
|
+
});
|
|
63
|
+
assertVerifierAdmission(input, composition, target);
|
|
64
|
+
const rendering = compileScaffoldRendering({
|
|
65
|
+
foundationVersion: input.foundationVersion,
|
|
66
|
+
intent: input.intent,
|
|
67
|
+
composition,
|
|
68
|
+
target: {
|
|
69
|
+
id: target.id,
|
|
70
|
+
role: target.role,
|
|
71
|
+
path: target.path,
|
|
72
|
+
packageName: target.packageName
|
|
73
|
+
},
|
|
74
|
+
verifiedOwnerDocumentId: target.ownerDocument.id
|
|
75
|
+
}, registry);
|
|
76
|
+
return normalizeAuthorityPlan(input, rendering, composition, target);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=authority-compiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-compiler.js","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-compiler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAElC,MAAM,eAAe,CAAC;AAGvB,SAAS,uBAAuB,CAC9B,KAAwC,EACxC,WAAgF,EAChF,MAAwE;IAExE,MAAM,kBAAkB,GAAG,WAAW,CAAC,kBAA4D,CAAC;IACpG,IAAI,kBAAkB,CAAC,MAAM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AG,wBAAwB,CACxC;QACE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,WAAW;QACX,MAAM,EAAE;YACN,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;QACD,uBAAuB,EAAE,MAAM,CAAC,aAAa,CAAC,EAAE;KACjD,EACD,QAAQ,CACT,CAAC;IACF,OAAO,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ScaffoldAuthorityEvidenceV1, ScaffoldReadAssertionV1, AuthorityScaffoldTarget } from "../contract/types.js";
|
|
2
|
+
export declare function createScaffoldAuthorityEvidence(evidence: Omit<ScaffoldAuthorityEvidenceV1, "evidenceDigest">): ScaffoldAuthorityEvidenceV1;
|
|
3
|
+
export declare function assertScaffoldAuthorityEvidenceDigest(evidence: ScaffoldAuthorityEvidenceV1): void;
|
|
4
|
+
export declare function assertAuthorityEvidenceSourceBindings(options: {
|
|
5
|
+
readonly evidence: ScaffoldAuthorityEvidenceV1;
|
|
6
|
+
readonly target: AuthorityScaffoldTarget;
|
|
7
|
+
readonly projectId: string;
|
|
8
|
+
readonly targetRef: string;
|
|
9
|
+
readonly configPath: string;
|
|
10
|
+
readonly targetCatalogPath: string;
|
|
11
|
+
readonly authorityReadSet: readonly ScaffoldReadAssertionV1[];
|
|
12
|
+
}): void;
|
|
13
|
+
//# sourceMappingURL=authority-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-evidence.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,2BAA2B,EAE3B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAqC9B,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,IAAI,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,GAC5D,2BAA2B,CAM7B;AAED,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,2BAA2B,GACpC,IAAI,CAWN;AAED,wBAAgB,qCAAqC,CAAC,OAAO,EAAE;IAC7D,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC/D,GAAG,IAAI,CAgEP"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ScaffoldError } from "../scaffold-error.js";
|
|
2
|
+
import { canonicalJson, sha256Json } from "./canonical-json.js";
|
|
3
|
+
function canonicalSources(sources) {
|
|
4
|
+
const source = (role) => {
|
|
5
|
+
const matches = sources.filter((candidate) => candidate.role === role);
|
|
6
|
+
if (matches.length !== 1) {
|
|
7
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", `Scaffolding Authority Evidence must contain exactly one ${role} source.`);
|
|
8
|
+
}
|
|
9
|
+
return matches[0];
|
|
10
|
+
};
|
|
11
|
+
return Object.freeze([
|
|
12
|
+
source("config"),
|
|
13
|
+
source("owner-document"),
|
|
14
|
+
source("target-catalog")
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
function canonicalEvidenceBody(evidence) {
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
...evidence,
|
|
20
|
+
sources: canonicalSources(evidence.sources)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function createScaffoldAuthorityEvidence(evidence) {
|
|
24
|
+
const body = canonicalEvidenceBody(evidence);
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
...body,
|
|
27
|
+
evidenceDigest: sha256Json(body)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export function assertScaffoldAuthorityEvidenceDigest(evidence) {
|
|
31
|
+
const { evidenceDigest: _evidenceDigest, ...body } = evidence;
|
|
32
|
+
const expected = sha256Json(canonicalEvidenceBody(body));
|
|
33
|
+
if (evidence.evidenceDigest !== expected) {
|
|
34
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Authority Evidence digest does not match its canonical content.");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function assertAuthorityEvidenceSourceBindings(options) {
|
|
38
|
+
const { evidence, target } = options;
|
|
39
|
+
assertScaffoldAuthorityEvidenceDigest(evidence);
|
|
40
|
+
if (evidence.projectId !== options.projectId ||
|
|
41
|
+
evidence.targetRef !== options.targetRef ||
|
|
42
|
+
evidence.targetIdentityDigest !==
|
|
43
|
+
sha256Json(target) ||
|
|
44
|
+
evidence.ownerDocument.id !== target.ownerDocument.id ||
|
|
45
|
+
evidence.ownerDocument.path !== target.ownerDocument.path) {
|
|
46
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Authority Evidence is not bound to the selected target.");
|
|
47
|
+
}
|
|
48
|
+
const expectedRoles = new Set(["config", "target-catalog", "owner-document"]);
|
|
49
|
+
const expectedPaths = new Map([
|
|
50
|
+
["config", options.configPath],
|
|
51
|
+
["target-catalog", options.targetCatalogPath],
|
|
52
|
+
["owner-document", target.ownerDocument.path]
|
|
53
|
+
]);
|
|
54
|
+
const evidencePaths = new Set();
|
|
55
|
+
for (const source of evidence.sources) {
|
|
56
|
+
if (!expectedRoles.delete(source.role) ||
|
|
57
|
+
evidencePaths.has(source.assertion.path) ||
|
|
58
|
+
expectedPaths.get(source.role) !== source.assertion.path) {
|
|
59
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Authority Evidence source roles are not bound to canonical paths.");
|
|
60
|
+
}
|
|
61
|
+
evidencePaths.add(source.assertion.path);
|
|
62
|
+
}
|
|
63
|
+
if (expectedRoles.size !== 0) {
|
|
64
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Authority Evidence does not contain every required source.");
|
|
65
|
+
}
|
|
66
|
+
const readSet = new Map(options.authorityReadSet.map((assertion) => [assertion.path, assertion]));
|
|
67
|
+
if (readSet.size !== options.authorityReadSet.length || readSet.size !== 3) {
|
|
68
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding source-bound must bind exactly three authority read sources.");
|
|
69
|
+
}
|
|
70
|
+
for (const source of evidence.sources) {
|
|
71
|
+
const assertion = readSet.get(source.assertion.path);
|
|
72
|
+
if (assertion === undefined ||
|
|
73
|
+
canonicalJson(assertion) !==
|
|
74
|
+
canonicalJson(source.assertion)) {
|
|
75
|
+
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Authority Evidence and Plan read set disagree.");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=authority-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-evidence.js","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-evidence.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEhE,SAAS,gBAAgB,CACvB,OAAsD;IAEtD,MAAM,MAAM,GAAG,CACb,IAAW,EACoD,EAAE;QACjE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,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IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,aAAa,CACrB,uBAAuB,EACvB,wEAAwE,CACzE,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CACzE,CAAC;IACF,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,aAAa,CACrB,uBAAuB,EACvB,0EAA0E,CAC3E,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrD,IACE,SAAS,KAAK,SAAS;YACvB,aAAa,CAAC,SAAiC,CAAC;gBAC9C,aAAa,CAAC,MAAM,CAAC,SAAiC,CAAC,EACzD,CAAC;YACD,MAAM,IAAI,aAAa,CACrB,uBAAuB,EACvB,4DAA4D,CAC7D,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScaffoldDiagnosticV1, AuthorityScaffoldOperationReceipt, AuthorityScaffoldPlan, AuthorityScaffoldReceiptOutcome, AuthorityScaffoldReceipt } from "../contract/types.js";
|
|
2
|
+
export interface CreateAuthorityScaffoldReceiptOptions {
|
|
3
|
+
readonly plan: AuthorityScaffoldPlan;
|
|
4
|
+
readonly outcome: AuthorityScaffoldReceiptOutcome;
|
|
5
|
+
readonly commitState: "committed" | "recovered" | "recovery-required" | "rejected" | "rolled-back";
|
|
6
|
+
readonly operations: readonly AuthorityScaffoldOperationReceipt[];
|
|
7
|
+
readonly diagnostics?: readonly ScaffoldDiagnosticV1[];
|
|
8
|
+
}
|
|
9
|
+
export declare function assertAuthorityScaffoldReceiptDigest(receipt: AuthorityScaffoldReceipt, plan?: AuthorityScaffoldPlan): void;
|
|
10
|
+
export declare function createAuthorityScaffoldReceipt(options: CreateAuthorityScaffoldReceiptOptions): AuthorityScaffoldReceipt;
|
|
11
|
+
//# sourceMappingURL=authority-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-receipt.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAEpB,iCAAiC,EACjC,qBAAqB,EACrB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAuB9B,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAC;IAClD,QAAQ,CAAC,WAAW,EAChB,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,UAAU,GACV,aAAa,CAAC;IAClB,QAAQ,CAAC,UAAU,EAAE,SAAS,iCAAiC,EAAE,CAAC;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxD;AA+JD,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,wBAAwB,EACjC,IAAI,CAAC,EAAE,qBAAqB,GAC3B,IAAI,CAgBN;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,qCAAqC,GAC7C,wBAAwB,CAmC1B"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { ScaffoldError } from "../scaffold-error.js";
|
|
2
|
+
import { sha256Json } from "./canonical-json.js";
|
|
3
|
+
import { assertAuthorityScaffoldPlanDigest } from "./plan-validation.js";
|
|
4
|
+
const SHA_256_DIGEST_PATTERN = /^sha256:[0-9a-f]{64}$/u;
|
|
5
|
+
function invalidReceipt(message) {
|
|
6
|
+
throw new ScaffoldError("SCAFFOLD_RECEIPT_INVALID", message);
|
|
7
|
+
}
|
|
8
|
+
function hasObservedPostImage(outcome) {
|
|
9
|
+
return (outcome === "already-satisfied" ||
|
|
10
|
+
outcome === "applied" ||
|
|
11
|
+
outcome === "recovered");
|
|
12
|
+
}
|
|
13
|
+
function assertDigest(value, subject) {
|
|
14
|
+
if (value === undefined || !SHA_256_DIGEST_PATTERN.test(value)) {
|
|
15
|
+
invalidReceipt(`${subject} must be a SHA-256 digest.`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function assertAdapterAndCommit(receipt) {
|
|
19
|
+
if (receipt.adapter.id !== "foundation.filesystem/v1") {
|
|
20
|
+
invalidReceipt("Scaffolding Receipt adapter is not supported by current scaffolding protocol.");
|
|
21
|
+
}
|
|
22
|
+
if (receipt.adapter.contractVersion !== 1) {
|
|
23
|
+
invalidReceipt("Scaffolding Receipt adapter contract version is not supported.");
|
|
24
|
+
}
|
|
25
|
+
if (receipt.commit.atomicity !== "journaled-recoverable") {
|
|
26
|
+
invalidReceipt("Scaffolding Receipt adapter and commit atomicity are incompatible.");
|
|
27
|
+
}
|
|
28
|
+
const expectedState = (() => {
|
|
29
|
+
switch (receipt.outcome) {
|
|
30
|
+
case "applied":
|
|
31
|
+
case "already-applied":
|
|
32
|
+
return "committed";
|
|
33
|
+
case "failed-recovered":
|
|
34
|
+
return "recovered";
|
|
35
|
+
case "recovery-required":
|
|
36
|
+
return "recovery-required";
|
|
37
|
+
case "rejected":
|
|
38
|
+
return "rejected";
|
|
39
|
+
case "authority-stale":
|
|
40
|
+
return "rolled-back";
|
|
41
|
+
default:
|
|
42
|
+
return invalidReceipt("Scaffolding Receipt outcome is not supported by current scaffolding protocol.");
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
45
|
+
if (receipt.commit.state !== expectedState) {
|
|
46
|
+
invalidReceipt("Scaffolding Receipt outcome and commit state are incompatible.");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function assertOperations(receipt) {
|
|
50
|
+
const ids = new Set();
|
|
51
|
+
const paths = new Set();
|
|
52
|
+
for (const operation of receipt.operations) {
|
|
53
|
+
if (ids.has(operation.operationId) || paths.has(operation.path)) {
|
|
54
|
+
invalidReceipt(`Scaffolding Receipt operation evidence is duplicated: ${operation.operationId}.`);
|
|
55
|
+
}
|
|
56
|
+
ids.add(operation.operationId);
|
|
57
|
+
paths.add(operation.path);
|
|
58
|
+
if (hasObservedPostImage(operation.outcome)) {
|
|
59
|
+
assertDigest(operation.resultDigest, `Scaffolding Receipt operation ${operation.operationId} result`);
|
|
60
|
+
}
|
|
61
|
+
else if (operation.resultDigest !== undefined) {
|
|
62
|
+
invalidReceipt(`Scaffolding Receipt operation claims an unobserved result: ${operation.operationId}.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function assertOnly(operations, allowed, required) {
|
|
67
|
+
if (operations.some((operation) => !allowed.includes(operation.outcome))) {
|
|
68
|
+
invalidReceipt("Scaffolding Receipt operation outcome is incompatible with its Receipt outcome.");
|
|
69
|
+
}
|
|
70
|
+
if (required !== undefined &&
|
|
71
|
+
!operations.some((operation) => required.includes(operation.outcome))) {
|
|
72
|
+
invalidReceipt("Scaffolding Receipt does not contain the required operation evidence.");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function assertOutcome(receipt) {
|
|
76
|
+
switch (receipt.outcome) {
|
|
77
|
+
case "applied":
|
|
78
|
+
if (receipt.operations.length === 0) {
|
|
79
|
+
invalidReceipt("An applied Scaffolding Receipt requires operation evidence.");
|
|
80
|
+
}
|
|
81
|
+
if (receipt.operations[0]?.outcome !== "applied") {
|
|
82
|
+
invalidReceipt("An applied Scaffolding Receipt must place applied evidence first.");
|
|
83
|
+
}
|
|
84
|
+
assertOnly(receipt.operations, ["already-satisfied", "applied"], ["applied"]);
|
|
85
|
+
return;
|
|
86
|
+
case "already-applied":
|
|
87
|
+
if (receipt.operations.length === 0) {
|
|
88
|
+
invalidReceipt("An already-applied Scaffolding Receipt requires operation evidence.");
|
|
89
|
+
}
|
|
90
|
+
assertOnly(receipt.operations, ["already-satisfied"]);
|
|
91
|
+
return;
|
|
92
|
+
case "failed-recovered":
|
|
93
|
+
if (receipt.operations.length === 0) {
|
|
94
|
+
invalidReceipt("A failed-recovered Scaffolding Receipt requires operation evidence.");
|
|
95
|
+
}
|
|
96
|
+
assertOnly(receipt.operations, ["already-satisfied", "recovered"]);
|
|
97
|
+
return;
|
|
98
|
+
case "recovery-required":
|
|
99
|
+
if (receipt.operations.length === 0) {
|
|
100
|
+
invalidReceipt("A recovery-required Scaffolding Receipt requires operation evidence.");
|
|
101
|
+
}
|
|
102
|
+
assertOnly(receipt.operations, ["already-satisfied", "conflict", "not-applied", "unobserved"]);
|
|
103
|
+
return;
|
|
104
|
+
case "authority-stale":
|
|
105
|
+
if (receipt.operations.length === 0) {
|
|
106
|
+
invalidReceipt("An authority-stale Scaffolding Receipt requires operation evidence.");
|
|
107
|
+
}
|
|
108
|
+
assertOnly(receipt.operations, ["not-applied"]);
|
|
109
|
+
return;
|
|
110
|
+
case "rejected":
|
|
111
|
+
if (receipt.operations.length === 0) {
|
|
112
|
+
invalidReceipt("A rejected Scaffolding Receipt requires operation evidence.");
|
|
113
|
+
}
|
|
114
|
+
assertOnly(receipt.operations, ["already-satisfied", "conflict", "not-applied"]);
|
|
115
|
+
return;
|
|
116
|
+
default:
|
|
117
|
+
invalidReceipt("Scaffolding Receipt outcome is not supported by current scaffolding protocol.");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function assertPlanEvidence(receipt, plan) {
|
|
121
|
+
assertAuthorityScaffoldPlanDigest(plan);
|
|
122
|
+
if (receipt.planDigest !== plan.planDigest) {
|
|
123
|
+
invalidReceipt("Scaffolding Receipt references a different Plan digest.");
|
|
124
|
+
}
|
|
125
|
+
const operations = new Map(plan.operations.map((operation) => [operation.id, operation]));
|
|
126
|
+
for (const operation of receipt.operations) {
|
|
127
|
+
const planned = operations.get(operation.operationId);
|
|
128
|
+
if (planned === undefined || planned.path !== operation.path) {
|
|
129
|
+
invalidReceipt(`Scaffolding Receipt operation does not match its Plan evidence: ${operation.operationId}.`);
|
|
130
|
+
}
|
|
131
|
+
if (hasObservedPostImage(operation.outcome) && operation.resultDigest !== planned.after.digest) {
|
|
132
|
+
invalidReceipt(`Scaffolding Receipt result digest does not match its Plan evidence: ${operation.operationId}.`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (receipt.operations.length !== plan.operations.length) {
|
|
136
|
+
invalidReceipt("A plan-bound Scaffolding Receipt must provide evidence for every Plan operation.");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export function assertAuthorityScaffoldReceiptDigest(receipt, plan) {
|
|
140
|
+
const candidate = receipt;
|
|
141
|
+
if (candidate.schemaVersion !== 1 || candidate.protocolVersion !== 1) {
|
|
142
|
+
invalidReceipt("Scaffolding Receipt does not use current scaffolding protocol.");
|
|
143
|
+
}
|
|
144
|
+
assertDigest(candidate.planDigest, "Scaffolding Receipt Plan digest");
|
|
145
|
+
assertAdapterAndCommit(candidate);
|
|
146
|
+
assertOperations(candidate);
|
|
147
|
+
assertOutcome(candidate);
|
|
148
|
+
const { receiptDigest: _receiptDigest, ...body } = candidate;
|
|
149
|
+
if (candidate.receiptDigest !== sha256Json(body)) {
|
|
150
|
+
invalidReceipt("Scaffolding Receipt digest does not match its canonical content.");
|
|
151
|
+
}
|
|
152
|
+
if (plan !== undefined) {
|
|
153
|
+
assertPlanEvidence(candidate, plan);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export function createAuthorityScaffoldReceipt(options) {
|
|
157
|
+
const operations = options.outcome === "applied"
|
|
158
|
+
? [...options.operations].toSorted((left, right) => left.outcome === "applied"
|
|
159
|
+
? right.outcome === "applied"
|
|
160
|
+
? 0
|
|
161
|
+
: -1
|
|
162
|
+
: right.outcome === "applied"
|
|
163
|
+
? 1
|
|
164
|
+
: 0)
|
|
165
|
+
: [...options.operations];
|
|
166
|
+
const body = {
|
|
167
|
+
schemaVersion: 1,
|
|
168
|
+
protocolVersion: 1,
|
|
169
|
+
planDigest: options.plan.planDigest,
|
|
170
|
+
adapter: Object.freeze({
|
|
171
|
+
id: "foundation.filesystem/v1",
|
|
172
|
+
contractVersion: 1
|
|
173
|
+
}),
|
|
174
|
+
outcome: options.outcome,
|
|
175
|
+
commit: Object.freeze({
|
|
176
|
+
state: options.commitState,
|
|
177
|
+
atomicity: "journaled-recoverable"
|
|
178
|
+
}),
|
|
179
|
+
operations: Object.freeze(operations),
|
|
180
|
+
diagnostics: Object.freeze([...(options.diagnostics ?? [])])
|
|
181
|
+
};
|
|
182
|
+
const receipt = Object.freeze({
|
|
183
|
+
...body,
|
|
184
|
+
receiptDigest: sha256Json(body)
|
|
185
|
+
});
|
|
186
|
+
assertAuthorityScaffoldReceiptDigest(receipt, options.plan);
|
|
187
|
+
return receipt;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=authority-receipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-receipt.js","sourceRoot":"","sources":["../../../src/scaffolding/kernel/authority-receipt.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAiCzE,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAExD,SAAS,cAAc,CAAC,OAAe;IACrC,MAAM,IAAI,aAAa,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA0C;IACtE,OAAO,CACL,OAAO,KA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ldRenderingComposition, ScaffoldRenderingCompositionSelection, ScaffoldRenderingDefinitionEvidence, ScaffoldRenderingDiagnostic, ScaffoldRenderingIntent, ScaffoldRenderingOperation, ScaffoldRenderingResolution, ScaffoldRenderingTarget, Sha256Digest } from "../contract/types.js";
|
|
2
2
|
import { ScaffoldDefinitionRegistry } from "./definition-registry.js";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function resolveScaffoldRenderingSelection<TComposition extends ScaffoldRenderingComposition, TTarget extends ScaffoldRenderingTarget>(input: {
|
|
4
|
+
readonly compositions: readonly TComposition[];
|
|
5
|
+
readonly targets: readonly TTarget[];
|
|
6
|
+
readonly authorityReadPaths: readonly string[];
|
|
7
|
+
readonly intent: ScaffoldRenderingIntent;
|
|
8
|
+
}): {
|
|
9
|
+
readonly composition: TComposition;
|
|
10
|
+
readonly target: TTarget;
|
|
11
|
+
};
|
|
12
|
+
export interface ScaffoldRenderingInput {
|
|
13
|
+
readonly foundationVersion: string;
|
|
14
|
+
readonly intent: ScaffoldRenderingIntent;
|
|
15
|
+
readonly composition: ScaffoldRenderingComposition;
|
|
16
|
+
readonly target: ScaffoldRenderingTarget;
|
|
17
|
+
readonly verifiedOwnerDocumentId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ScaffoldRenderingResult {
|
|
20
|
+
readonly compiler: ScaffoldRenderingCompiler;
|
|
21
|
+
readonly intent: ScaffoldRenderingIntent;
|
|
22
|
+
readonly intentDigest: Sha256Digest;
|
|
23
|
+
readonly composition: ScaffoldRenderingCompositionSelection;
|
|
24
|
+
readonly definitions: readonly ScaffoldRenderingDefinitionEvidence[];
|
|
25
|
+
readonly resolved: ScaffoldRenderingResolution;
|
|
26
|
+
readonly operations: readonly ScaffoldRenderingOperation[];
|
|
27
|
+
readonly diagnostics: readonly ScaffoldRenderingDiagnostic[];
|
|
28
|
+
}
|
|
29
|
+
export declare function compileScaffoldRendering(input: ScaffoldRenderingInput, registry: ScaffoldDefinitionRegistry): ScaffoldRenderingResult;
|
|
4
30
|
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,yBAAyB,EACzB,4BAA4B,EAC5B,qCAAqC,EACrC,mCAAmC,EACnC,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EAEvB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EACL,0BAA0B,EAI3B,MAAM,0BAA0B,CAAC;AAsRlC,wBAAgB,iCAAiC,CAC/C,YAAY,SAAS,4BAA4B,EACjD,OAAO,SAAS,uBAAuB,EACvC,KAAK,EAAE;IACP,QAAQ,CAAC,YAAY,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;CAC1C,GAAG;IACF,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAiCA;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,4BAA4B,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,qCAAqC,CAAC;IAC5D,QAAQ,CAAC,WAAW,EAAE,SAAS,mCAAmC,EAAE,CAAC;IACrE,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC9D;AAgBD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,0BAA0B,GACnC,uBAAuB,CA+HzB"}
|
|
@@ -160,15 +160,15 @@ function definitionEvidence(registry, definitions) {
|
|
|
160
160
|
: kindOrder;
|
|
161
161
|
}));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
assertUnique(input.
|
|
165
|
-
assertUnique(input.
|
|
166
|
-
assertUnique(input.
|
|
167
|
-
assertUnique(input.
|
|
168
|
-
assertUnique(input.
|
|
169
|
-
assertUnique(input.
|
|
170
|
-
const composition = findExactlyOne(input.
|
|
171
|
-
const target = findExactlyOne(input.
|
|
163
|
+
export function resolveScaffoldRenderingSelection(input) {
|
|
164
|
+
assertUnique(input.compositions, ({ id }) => id, "Composition ID");
|
|
165
|
+
assertUnique(input.targets, ({ id }) => id, "target ID");
|
|
166
|
+
assertUnique(input.targets, ({ path }) => path, "target path");
|
|
167
|
+
assertUnique(input.targets, ({ path }) => path.toLowerCase(), "case-folded target path");
|
|
168
|
+
assertUnique(input.targets, ({ packageName }) => packageName, "target package name");
|
|
169
|
+
assertUnique(input.authorityReadPaths, (path) => path, "authority read path");
|
|
170
|
+
const composition = findExactlyOne(input.compositions, ({ id }) => id === input.intent.compositionId, `Composition must exist exactly once: ${input.intent.compositionId}.`);
|
|
171
|
+
const target = findExactlyOne(input.targets, ({ id }) => id === input.intent.targetRef, `Scaffold target must exist exactly once: ${input.intent.targetRef}.`);
|
|
172
172
|
assertUnique(composition.targetRoles, (role) => role, "target role");
|
|
173
173
|
if (!composition.targetRoles.includes(target.role)) {
|
|
174
174
|
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", `Target role ${target.role} is not admitted by composition ${composition.id}.`);
|
|
@@ -182,27 +182,33 @@ function assertFacetCompatibility(facets, recipeId) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
export function
|
|
186
|
-
const { composition, target } =
|
|
185
|
+
export function compileScaffoldRendering(input, registry) {
|
|
186
|
+
const { composition, target } = input;
|
|
187
|
+
assertUnique(composition.targetRoles, (role) => role, "target role");
|
|
188
|
+
if (!composition.targetRoles.includes(target.role)) {
|
|
189
|
+
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", `Target role ${target.role} is not admitted by composition ${composition.id}.`);
|
|
190
|
+
}
|
|
187
191
|
const profile = registry.resolve(composition.scaffoldProfile.ref, "scaffold-profile");
|
|
188
192
|
const recipe = registry.resolve(composition.recipe.ref, "recipe");
|
|
189
193
|
const profileParameters = composition.scaffoldProfile.parameters ?? {};
|
|
190
194
|
const recipeParameters = mergeRecipeParameters(composition, input.intent.recipeParameters ?? {});
|
|
191
195
|
registry.validateParameters(profile, profileParameters);
|
|
192
196
|
registry.validateParameters(recipe, recipeParameters);
|
|
193
|
-
if (!profile.allowedRecipeIds.includes(recipe.ref.id)
|
|
194
|
-
!recipe.allowedProfileIds.includes(profile.ref.id) ||
|
|
195
|
-
!recipe.allowedTargetRoles.includes(target.role)) {
|
|
197
|
+
if (!profile.allowedRecipeIds.includes(recipe.ref.id)) {
|
|
196
198
|
throw new ScaffoldError("SCAFFOLD_INPUT_INVALID", `Recipe ${refKey(recipe.ref)} is incompatible with the selected Profile or target role.`);
|
|
197
199
|
}
|
|
198
200
|
const facets = selectFacets(registry, composition, input.intent.facets);
|
|
199
201
|
assertFacetCompatibility(facets, recipe.ref.id);
|
|
200
202
|
const baseContext = Object.freeze({
|
|
201
203
|
target,
|
|
204
|
+
...(input.verifiedOwnerDocumentId === undefined
|
|
205
|
+
? {}
|
|
206
|
+
: { verifiedOwnerDocumentId: input.verifiedOwnerDocumentId }),
|
|
202
207
|
profileParameters,
|
|
203
208
|
recipeParameters,
|
|
204
209
|
facetParameters: Object.freeze({})
|
|
205
210
|
});
|
|
211
|
+
registry.assertRecipeRequirements(recipe, profile.ref.id, baseContext);
|
|
206
212
|
const policyConfigurations = collectPolicies([
|
|
207
213
|
profile.requiredPolicies,
|
|
208
214
|
recipe.requiredPolicies,
|
|
@@ -232,13 +238,6 @@ export function compileScaffoldPlan(input, registry) {
|
|
|
232
238
|
...facets.map(({ definition }) => definition),
|
|
233
239
|
...policies
|
|
234
240
|
]);
|
|
235
|
-
const authoritySnapshotDigest = sha256Json({
|
|
236
|
-
configPath: input.configPath,
|
|
237
|
-
projectId: input.config.projectId,
|
|
238
|
-
composition,
|
|
239
|
-
target,
|
|
240
|
-
readSet: input.authorityReadSet
|
|
241
|
-
});
|
|
242
241
|
const normalizedIntent = JSON.parse(canonicalJson({
|
|
243
242
|
schemaVersion: 1,
|
|
244
243
|
compositionId: input.intent.compositionId,
|
|
@@ -252,21 +251,13 @@ export function compileScaffoldPlan(input, registry) {
|
|
|
252
251
|
facets: [...input.intent.facets].toSorted((left, right) => compareStrings(refKey(left.ref), refKey(right.ref)))
|
|
253
252
|
})
|
|
254
253
|
}));
|
|
255
|
-
|
|
256
|
-
schemaVersion: 1,
|
|
257
|
-
protocolVersion: 1,
|
|
254
|
+
return Object.freeze({
|
|
258
255
|
compiler: Object.freeze({
|
|
259
256
|
id: "@agent-teams/engineering-foundation",
|
|
260
257
|
version: input.foundationVersion
|
|
261
258
|
}),
|
|
262
|
-
projectId: input.config.projectId,
|
|
263
|
-
authority: Object.freeze({
|
|
264
|
-
configPath: input.configPath,
|
|
265
|
-
targetCatalogPath: input.config.targetCatalogPath
|
|
266
|
-
}),
|
|
267
259
|
intent: normalizedIntent,
|
|
268
260
|
intentDigest: sha256Json(normalizedIntent),
|
|
269
|
-
authoritySnapshotDigest,
|
|
270
261
|
composition: Object.freeze({
|
|
271
262
|
id: composition.id,
|
|
272
263
|
scaffoldProfile: profile.ref,
|
|
@@ -285,13 +276,8 @@ export function compileScaffoldPlan(input, registry) {
|
|
|
285
276
|
outcome: "passed"
|
|
286
277
|
})))
|
|
287
278
|
}),
|
|
288
|
-
target,
|
|
289
|
-
readSet: Object.freeze([...input.authorityReadSet].toSorted((left, right) => compareStrings(left.path, right.path))),
|
|
290
|
-
requiredAdapterCapabilities: ["materialize-file/v1"],
|
|
291
279
|
operations,
|
|
292
280
|
diagnostics: Object.freeze([])
|
|
293
|
-
};
|
|
294
|
-
const planDigest = sha256Json(planBody);
|
|
295
|
-
return Object.freeze({ ...planBody, planDigest });
|
|
281
|
+
});
|
|
296
282
|
}
|
|
297
283
|
//# sourceMappingURL=compiler.js.map
|