@agent-teams/engineering-foundation 0.8.0 → 0.10.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 +5 -0
- package/dist/capabilities/contract-json-schema-releases/adapters/outbound/filesystem/ajv-json-schema-release-inspector.d.ts +5 -0
- package/dist/capabilities/contract-json-schema-releases/adapters/outbound/filesystem/ajv-json-schema-release-inspector.d.ts.map +1 -1
- package/dist/capabilities/contract-json-schema-releases/adapters/outbound/filesystem/ajv-json-schema-release-inspector.js +48 -27
- package/dist/capabilities/contract-json-schema-releases/adapters/outbound/filesystem/ajv-json-schema-release-inspector.js.map +1 -1
- package/dist/capabilities/contract-json-schema-releases/application/ports/json-schema-release-inspector.d.ts +1 -0
- package/dist/capabilities/contract-json-schema-releases/application/ports/json-schema-release-inspector.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/adapters/outbound/qualification/filesystem-buf-breaking-qualification-evidence.js +1 -1
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.d.ts +2 -2
- package/dist/capabilities/contract-protobuf-evolution/application/model/buf-breaking-qualification.js +2 -2
- package/dist/capabilities/contract-protobuf-evolution/application/model/protobuf-release-evidence.d.ts +4 -4
- package/dist/capabilities/contract-protobuf-evolution/application/model/protobuf-release-evidence.d.ts.map +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.d.ts +1 -1
- package/dist/capabilities/contract-protobuf-evolution/contract/config.js +4 -4
- package/dist/capabilities/contract-protobuf-evolution/contract/config.js.map +1 -1
- package/dist/capabilities/executable-specifications/adapters/outbound/filesystem/filesystem-executable-specification-inspector.d.ts +24 -0
- package/dist/capabilities/executable-specifications/adapters/outbound/filesystem/filesystem-executable-specification-inspector.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/adapters/outbound/filesystem/filesystem-executable-specification-inspector.js +244 -0
- package/dist/capabilities/executable-specifications/adapters/outbound/filesystem/filesystem-executable-specification-inspector.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/model/executable-specification.d.ts +58 -0
- package/dist/capabilities/executable-specifications/application/model/executable-specification.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/model/executable-specification.js +2 -0
- package/dist/capabilities/executable-specifications/application/model/executable-specification.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/policies/evaluate-executable-specifications.d.ts +6 -0
- package/dist/capabilities/executable-specifications/application/policies/evaluate-executable-specifications.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/policies/evaluate-executable-specifications.js +277 -0
- package/dist/capabilities/executable-specifications/application/policies/evaluate-executable-specifications.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/policies/portable-executable-specification-path.d.ts +10 -0
- package/dist/capabilities/executable-specifications/application/policies/portable-executable-specification-path.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/policies/portable-executable-specification-path.js +76 -0
- package/dist/capabilities/executable-specifications/application/policies/portable-executable-specification-path.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/ports/executable-specification-inspector.d.ts +9 -0
- package/dist/capabilities/executable-specifications/application/ports/executable-specification-inspector.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/ports/executable-specification-inspector.js +2 -0
- package/dist/capabilities/executable-specifications/application/ports/executable-specification-inspector.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/rules.d.ts +22 -0
- package/dist/capabilities/executable-specifications/application/rules.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/rules.js +23 -0
- package/dist/capabilities/executable-specifications/application/rules.js.map +1 -0
- package/dist/capabilities/executable-specifications/application/use-cases/analyze-executable-specifications.d.ts +8 -0
- package/dist/capabilities/executable-specifications/application/use-cases/analyze-executable-specifications.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/application/use-cases/analyze-executable-specifications.js +36 -0
- package/dist/capabilities/executable-specifications/application/use-cases/analyze-executable-specifications.js.map +1 -0
- package/dist/capabilities/executable-specifications/contract/config.d.ts +5 -0
- package/dist/capabilities/executable-specifications/contract/config.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/contract/config.js +155 -0
- package/dist/capabilities/executable-specifications/contract/config.js.map +1 -0
- package/dist/capabilities/executable-specifications/module.d.ts +10 -0
- package/dist/capabilities/executable-specifications/module.d.ts.map +1 -0
- package/dist/capabilities/executable-specifications/module.js +52 -0
- package/dist/capabilities/executable-specifications/module.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/capabilities/source-dependencies/application/model/source-workspace.d.ts +2 -0
- package/dist/capabilities/source-dependencies/application/model/source-workspace.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-resolved-source-dependency.d.ts +1 -0
- 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 +47 -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 +14 -1
- package/dist/capabilities/source-dependencies/application/policies/evaluate-source-dependencies.js.map +1 -1
- package/dist/capabilities/source-dependencies/application/rules.d.ts +2 -0
- package/dist/capabilities/source-dependencies/application/rules.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/application/rules.js +2 -0
- package/dist/capabilities/source-dependencies/application/rules.js.map +1 -1
- package/dist/capabilities/source-dependencies/contract/config.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/contract/config.js +5 -0
- package/dist/capabilities/source-dependencies/contract/config.js.map +1 -1
- package/dist/composition/capability-registry.d.ts.map +1 -1
- package/dist/composition/capability-registry.js +2 -0
- package/dist/composition/capability-registry.js.map +1 -1
- package/dist/composition/rule-registry.d.ts.map +1 -1
- package/dist/composition/rule-registry.js +2 -0
- package/dist/composition/rule-registry.js.map +1 -1
- package/dist/foundation-config.d.ts +1 -1
- package/dist/foundation-config.d.ts.map +1 -1
- package/dist/foundation-config.js +2 -0
- package/dist/foundation-config.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.js +3 -3
- package/dist/scaffolding/adapters/node/filesystem-journal.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts +4 -11
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +0 -24
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-path-guard.d.ts +1 -1
- package/dist/scaffolding/adapters/node/filesystem-path-guard.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/node-authority-input-loader.js +7 -7
- package/dist/scaffolding/adapters/node/node-authority-input-loader.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.js +1 -1
- package/dist/scaffolding/adapters/node/node-authority-receipt-validator.js.map +1 -1
- package/dist/scaffolding/contract/receipt-authority-types.d.ts +2 -2
- package/dist/scaffolding/contract/scaffold-contract.d.ts +8 -8
- package/dist/scaffolding/contract/types.d.ts +9 -214
- package/dist/scaffolding/contract/types.d.ts.map +1 -1
- package/dist/scaffolding/definitions/registry.d.ts +0 -1
- package/dist/scaffolding/definitions/registry.d.ts.map +1 -1
- package/dist/scaffolding/definitions/registry.js +0 -3
- package/dist/scaffolding/definitions/registry.js.map +1 -1
- package/dist/scaffolding/kernel/authority-compiler.js +2 -2
- package/dist/scaffolding/kernel/authority-receipt.js +3 -3
- package/dist/scaffolding/kernel/plan-validation.js +1 -1
- package/dist/schema-catalog.js +3 -3
- package/dist/schema-catalog.js.map +1 -1
- package/dist/schema-ids.d.ts +2 -5
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +6 -15
- package/dist/schema-ids.js.map +1 -1
- package/dist/strict-json.d.ts +7 -0
- package/dist/strict-json.d.ts.map +1 -0
- package/dist/strict-json.js +41 -0
- package/dist/strict-json.js.map +1 -0
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.d.ts +1 -0
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.d.ts.map +1 -1
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js +7 -0
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js.map +1 -1
- package/package.json +11 -13
- package/schemas/architecture-source-dependencies/v1.schema.json +1 -0
- package/schemas/contract-protobuf-breaking-qualification/v1.schema.json +5 -1
- package/schemas/contract-protobuf-evolution/v1.schema.json +47 -15
- package/schemas/foundation-config/v1.schema.json +10 -0
- package/schemas/package-public-api-baseline/v1.schema.json +49 -12
- package/schemas/package-public-api-compatibility/v1.schema.json +46 -5
- package/schemas/quality-executable-specification-catalog/v1.schema.json +201 -0
- package/schemas/quality-executable-specifications/v1.schema.json +20 -0
- package/schemas/{scaffold-authority-evidence.schema.json → scaffold-authority-evidence/v1.schema.json} +1 -1
- package/schemas/{scaffold-intent.schema.json → scaffold-intent/v1.schema.json} +1 -1
- package/schemas/{scaffold-plan.schema.json → scaffold-plan/v1.schema.json} +3 -3
- package/schemas/{scaffold-receipt.schema.json → scaffold-receipt/v1.schema.json} +3 -3
- package/schemas/{scaffold-recovery-journal.schema.json → scaffold-recovery-journal/v1.schema.json} +3 -3
- package/schemas/{scaffold-target-catalog.schema.json → scaffold-target-catalog/v1.schema.json} +2 -2
- package/schemas/{scaffolding-config.schema.json → scaffolding-config/v1.schema.json} +2 -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-rendering-journal.d.ts +0 -6
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.js +0 -80
- package/dist/scaffolding/adapters/node/filesystem-rendering-journal.js.map +0 -1
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts +0 -14
- package/dist/scaffolding/adapters/node/filesystem-workspace.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/filesystem-workspace.js +0 -207
- 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 -107
- 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/adapters/node/node-rendering-plan-authority.d.ts +0 -3
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.d.ts.map +0 -1
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.js +0 -18
- package/dist/scaffolding/adapters/node/node-rendering-plan-authority.js.map +0 -1
- package/dist/scaffolding/internal-rendering-regression-api.d.ts +0 -8
- package/dist/scaffolding/internal-rendering-regression-api.d.ts.map +0 -1
- package/dist/scaffolding/internal-rendering-regression-api.js +0 -8
- package/dist/scaffolding/internal-rendering-regression-api.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/kernel/rendering-plan-compiler.d.ts +0 -4
- package/dist/scaffolding/kernel/rendering-plan-compiler.d.ts.map +0 -1
- package/dist/scaffolding/kernel/rendering-plan-compiler.js +0 -43
- package/dist/scaffolding/kernel/rendering-plan-compiler.js.map +0 -1
- package/dist/scaffolding/kernel/rendering-plan-validation.d.ts +0 -3
- package/dist/scaffolding/kernel/rendering-plan-validation.d.ts.map +0 -1
- package/dist/scaffolding/kernel/rendering-plan-validation.js +0 -10
- package/dist/scaffolding/kernel/rendering-plan-validation.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 -16
- package/dist/scaffolding/service.js.map +0 -1
- package/schemas/contract-protobuf-breaking-qualification/v2.schema.json +0 -93
- package/schemas/contract-protobuf-evolution/v2.schema.json +0 -147
- package/schemas/package-public-api-baseline/v2.schema.json +0 -62
- package/schemas/package-public-api-compatibility/v2.schema.json +0 -113
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { realpath } from "node:fs/promises";
|
|
2
|
-
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { assertScaffoldPlanDigest } from "../../kernel/rendering-plan-validation.js";
|
|
4
|
-
import { createScaffoldReceipt } from "../../kernel/receipt.js";
|
|
5
|
-
import { ScaffoldError } from "../../scaffold-error.js";
|
|
6
|
-
import { assertSchema } from "../../../schema-catalog.js";
|
|
7
|
-
import { acquireFoundationOperationLock } from "../../../local-mode/service.js";
|
|
8
|
-
import { LOCAL_STATE_DIRECTORY } from "../../../local-mode/types.js";
|
|
9
|
-
import { inspectAuthorityReadSet } from "./node-input-loader.js";
|
|
10
|
-
import { assertRenderingPlanMatchesConsumerAuthority } from "./node-rendering-plan-authority.js";
|
|
11
|
-
import { assertSafeExistingAncestors, assertSafeOperationPaths, syncDirectory } from "./filesystem-path-guard.js";
|
|
12
|
-
import { assertTransactionTemporariesAbsent, classifyFilesystemPlan, publishFilesystemOperation, removeTransactionTemporary } from "./filesystem-operation-state.js";
|
|
13
|
-
import { readScaffoldJournal, removeScaffoldJournal, SCAFFOLD_JOURNAL_FILE, writeScaffoldJournal } from "./filesystem-rendering-journal.js";
|
|
14
|
-
function diagnostic(ruleId, phase, subject, message, remediation) {
|
|
15
|
-
return Object.freeze({
|
|
16
|
-
ruleId,
|
|
17
|
-
severity: "error",
|
|
18
|
-
phase,
|
|
19
|
-
subject,
|
|
20
|
-
message,
|
|
21
|
-
remediation
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function conflictReceipt(plan, classifications, phase) {
|
|
25
|
-
const conflicting = classifications.filter(({ state }) => state === "conflict");
|
|
26
|
-
return createScaffoldReceipt({
|
|
27
|
-
plan,
|
|
28
|
-
adapterId: "foundation.filesystem/v1",
|
|
29
|
-
outcome: phase === "recovery" ? "recovery-required" : "rejected",
|
|
30
|
-
commitState: phase === "recovery" ? "recovery-required" : "rejected",
|
|
31
|
-
atomicity: "journaled-recoverable",
|
|
32
|
-
operations: classifications.map(({ operation, state }) => ({
|
|
33
|
-
operationId: operation.id,
|
|
34
|
-
path: operation.path,
|
|
35
|
-
outcome: state === "conflict"
|
|
36
|
-
? "conflict"
|
|
37
|
-
: state === "after"
|
|
38
|
-
? "already-satisfied"
|
|
39
|
-
: "not-applied",
|
|
40
|
-
...(state === "after" ? { resultDigest: operation.after.digest } : {})
|
|
41
|
-
})),
|
|
42
|
-
diagnostics: conflicting.map(({ operation }) => diagnostic(phase === "recovery"
|
|
43
|
-
? "scaffolding.recovery.third-state"
|
|
44
|
-
: "scaffolding.apply.precondition-conflict", phase, operation.path, "File matches neither the Plan precondition nor its desired result.", phase === "recovery"
|
|
45
|
-
? "Resolve the file manually, then retry recovery."
|
|
46
|
-
: "Create a new Intent and Plan from the current workspace state."))
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
async function finishPlan(root, plan, recovered, faultInjector) {
|
|
50
|
-
await assertRenderingPlanMatchesConsumerAuthority(root, plan);
|
|
51
|
-
for (const operation of plan.operations) {
|
|
52
|
-
await removeTransactionTemporary(root, plan.planDigest, operation);
|
|
53
|
-
}
|
|
54
|
-
const initial = await classifyFilesystemPlan(root, plan);
|
|
55
|
-
if (initial.some(({ state }) => state === "conflict")) {
|
|
56
|
-
return conflictReceipt(plan, initial, recovered ? "recovery" : "apply");
|
|
57
|
-
}
|
|
58
|
-
const operationReceipts = [];
|
|
59
|
-
for (const [operationIndex, { operation, state }] of initial.entries()) {
|
|
60
|
-
if (recovered && state === "after") {
|
|
61
|
-
await syncDirectory(dirname(resolve(root, operation.path)));
|
|
62
|
-
}
|
|
63
|
-
const outcome = state === "after"
|
|
64
|
-
? "already-satisfied"
|
|
65
|
-
: await publishFilesystemOperation(root, operation, plan.planDigest, operationIndex, faultInjector);
|
|
66
|
-
operationReceipts.push({
|
|
67
|
-
operationId: operation.id,
|
|
68
|
-
path: operation.path,
|
|
69
|
-
outcome: recovered && outcome === "applied" ? "recovered" : outcome,
|
|
70
|
-
resultDigest: operation.after.digest
|
|
71
|
-
});
|
|
72
|
-
await faultInjector?.({
|
|
73
|
-
phase: "after-operation-published",
|
|
74
|
-
operationIndex,
|
|
75
|
-
operationPath: operation.path
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const finalState = await classifyFilesystemPlan(root, plan);
|
|
79
|
-
if (finalState.some(({ state }) => state !== "after")) {
|
|
80
|
-
return conflictReceipt(plan, finalState, "recovery");
|
|
81
|
-
}
|
|
82
|
-
return createScaffoldReceipt({
|
|
83
|
-
plan,
|
|
84
|
-
adapterId: "foundation.filesystem/v1",
|
|
85
|
-
outcome: recovered ? "failed-recovered" : "applied",
|
|
86
|
-
commitState: recovered ? "recovered" : "committed",
|
|
87
|
-
atomicity: "journaled-recoverable",
|
|
88
|
-
operations: operationReceipts
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
async function recoverFilesystemScaffoldV1(consumerRoot) {
|
|
92
|
-
const canonicalRoot = await realpath(resolve(consumerRoot));
|
|
93
|
-
const release = await acquireFoundationOperationLock(canonicalRoot);
|
|
94
|
-
try {
|
|
95
|
-
const journalPath = join(canonicalRoot, LOCAL_STATE_DIRECTORY, SCAFFOLD_JOURNAL_FILE);
|
|
96
|
-
const journalPlan = await readScaffoldJournal(journalPath);
|
|
97
|
-
if (journalPlan === undefined) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
assertSafeOperationPaths(journalPlan);
|
|
101
|
-
for (const operation of journalPlan.operations) {
|
|
102
|
-
await assertSafeExistingAncestors(canonicalRoot, operation.path);
|
|
103
|
-
}
|
|
104
|
-
const receipt = await finishPlan(canonicalRoot, journalPlan, true);
|
|
105
|
-
if (receipt.outcome !== "recovery-required") {
|
|
106
|
-
await removeScaffoldJournal(journalPath);
|
|
107
|
-
}
|
|
108
|
-
return receipt;
|
|
109
|
-
}
|
|
110
|
-
finally {
|
|
111
|
-
await release();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function applyFilesystemScaffoldV1(consumerRoot, plan) {
|
|
115
|
-
return applyFilesystemScaffoldWithFaultInjection(consumerRoot, plan);
|
|
116
|
-
}
|
|
117
|
-
/** Retains the released 0.5 recovery contract for regression evidence only. */
|
|
118
|
-
export async function recoverFilesystemScaffold(consumerRoot) {
|
|
119
|
-
return recoverFilesystemScaffoldV1(consumerRoot);
|
|
120
|
-
}
|
|
121
|
-
export async function applyFilesystemScaffold(consumerRoot, plan) {
|
|
122
|
-
return applyFilesystemScaffoldV1(consumerRoot, plan);
|
|
123
|
-
}
|
|
124
|
-
/** Internal conformance seam. It is intentionally absent from package exports. */
|
|
125
|
-
export async function applyFilesystemScaffoldWithFaultInjection(consumerRoot, plan, faultInjector) {
|
|
126
|
-
await assertSchema("scaffold-plan/v1", plan, "scaffold-apply-plan");
|
|
127
|
-
assertScaffoldPlanDigest(plan);
|
|
128
|
-
assertSafeOperationPaths(plan);
|
|
129
|
-
const canonicalRoot = await realpath(resolve(consumerRoot));
|
|
130
|
-
const release = await acquireFoundationOperationLock(canonicalRoot);
|
|
131
|
-
try {
|
|
132
|
-
const journalPath = join(canonicalRoot, LOCAL_STATE_DIRECTORY, SCAFFOLD_JOURNAL_FILE);
|
|
133
|
-
const existingPlan = await readScaffoldJournal(journalPath);
|
|
134
|
-
if (existingPlan !== undefined &&
|
|
135
|
-
existingPlan.planDigest !== plan.planDigest) {
|
|
136
|
-
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", "A different scaffolding Plan requires recovery before this Plan can apply.");
|
|
137
|
-
}
|
|
138
|
-
if (existingPlan !== undefined) {
|
|
139
|
-
for (const operation of existingPlan.operations) {
|
|
140
|
-
await assertSafeExistingAncestors(canonicalRoot, operation.path);
|
|
141
|
-
}
|
|
142
|
-
const recovered = await finishPlan(canonicalRoot, existingPlan, true);
|
|
143
|
-
if (recovered.outcome !== "recovery-required") {
|
|
144
|
-
await removeScaffoldJournal(journalPath);
|
|
145
|
-
}
|
|
146
|
-
return recovered;
|
|
147
|
-
}
|
|
148
|
-
if (!(await inspectAuthorityReadSet(canonicalRoot, plan.readSet))) {
|
|
149
|
-
return createScaffoldReceipt({
|
|
150
|
-
plan,
|
|
151
|
-
adapterId: "foundation.filesystem/v1",
|
|
152
|
-
outcome: "rejected",
|
|
153
|
-
commitState: "rejected",
|
|
154
|
-
atomicity: "journaled-recoverable",
|
|
155
|
-
operations: [],
|
|
156
|
-
diagnostics: [
|
|
157
|
-
diagnostic("scaffolding.apply.stale-authority-snapshot", "apply", plan.projectId, "Consumer configuration or target authority changed after planning.", "Compile a new Plan from the current consumer state.")
|
|
158
|
-
]
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
await assertRenderingPlanMatchesConsumerAuthority(canonicalRoot, plan);
|
|
162
|
-
const classifications = await classifyFilesystemPlan(canonicalRoot, plan);
|
|
163
|
-
if (classifications.some(({ state }) => state === "conflict")) {
|
|
164
|
-
return conflictReceipt(plan, classifications, "apply");
|
|
165
|
-
}
|
|
166
|
-
if (classifications.every(({ state }) => state === "after")) {
|
|
167
|
-
return createScaffoldReceipt({
|
|
168
|
-
plan,
|
|
169
|
-
adapterId: "foundation.filesystem/v1",
|
|
170
|
-
outcome: "already-applied",
|
|
171
|
-
commitState: "committed",
|
|
172
|
-
atomicity: "journaled-recoverable",
|
|
173
|
-
operations: classifications.map(({ operation }) => ({
|
|
174
|
-
operationId: operation.id,
|
|
175
|
-
path: operation.path,
|
|
176
|
-
outcome: "already-satisfied",
|
|
177
|
-
resultDigest: operation.after.digest
|
|
178
|
-
}))
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
for (const operation of plan.operations) {
|
|
182
|
-
await assertSafeExistingAncestors(canonicalRoot, operation.path);
|
|
183
|
-
}
|
|
184
|
-
await assertTransactionTemporariesAbsent(canonicalRoot, plan);
|
|
185
|
-
await writeScaffoldJournal(journalPath, plan);
|
|
186
|
-
await faultInjector?.({ phase: "after-journal-prepared" });
|
|
187
|
-
try {
|
|
188
|
-
const receipt = await finishPlan(canonicalRoot, plan, false, faultInjector);
|
|
189
|
-
if (receipt.outcome !== "recovery-required") {
|
|
190
|
-
await faultInjector?.({ phase: "before-journal-removed" });
|
|
191
|
-
await removeScaffoldJournal(journalPath);
|
|
192
|
-
}
|
|
193
|
-
return receipt;
|
|
194
|
-
}
|
|
195
|
-
catch {
|
|
196
|
-
const recovered = await finishPlan(canonicalRoot, plan, true);
|
|
197
|
-
if (recovered.outcome !== "recovery-required") {
|
|
198
|
-
await removeScaffoldJournal(journalPath);
|
|
199
|
-
}
|
|
200
|
-
return recovered;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
finally {
|
|
204
|
-
await release();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
//# sourceMappingURL=filesystem-workspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-workspace.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,8BAA8B,EAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,2CAA2C,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kCAAkC,EAClC,sBAAsB,EAEtB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,m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,CAAC;YACxC,MAAM,2BAA2B,CAAC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,kCAAkC,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAE9D,MAAM,oBAAoB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;YAC5E,IAAI,OAAO,CAAC,OAAO,KAAK,mBAAmB,EAAE,CAAC;gBAC5C,MAAM,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;gBAC3D,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAC9D,IAAI,SAAS,CAAC,OAAO,KAAK,mBAAmB,EAAE,CAAC;gBAC9C,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ScaffoldCompilationInput, ScaffoldPlanV1, ScaffoldReadAssertionV1 } from "../../contract/types.js";
|
|
2
|
-
export declare function loadScaffoldCompilationInput(options: {
|
|
3
|
-
readonly consumerRoot: string;
|
|
4
|
-
readonly configPath: string;
|
|
5
|
-
readonly intentPath: string;
|
|
6
|
-
readonly foundationVersion: string;
|
|
7
|
-
}): Promise<ScaffoldCompilationInput>;
|
|
8
|
-
export declare function loadScaffoldCompilationInputFromIntent(options: {
|
|
9
|
-
readonly consumerRoot: string;
|
|
10
|
-
readonly configPath: string;
|
|
11
|
-
readonly foundationVersion: string;
|
|
12
|
-
readonly intent: unknown;
|
|
13
|
-
}): Promise<ScaffoldCompilationInput>;
|
|
14
|
-
/** Reads a released 0.5 Plan for regression evidence only. */
|
|
15
|
-
export declare function readScaffoldPlanFile(consumerRoot: string, planPath: string): Promise<ScaffoldPlanV1>;
|
|
16
|
-
export declare function inspectAuthorityReadSet(consumerRoot: string, readSet: readonly ScaffoldReadAssertionV1[]): Promise<boolean>;
|
|
17
|
-
//# sourceMappingURL=node-input-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-input-loader.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-input-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAExB,cAAc,EACd,uBAAuB,EAGxB,MAAM,yBAAyB,CAAC;AA2DjC,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA0BpC;AAoDD,wBAAsB,sCAAsC,CAAC,OAAO,EAAE;IACpE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAEpC;AAED,8DAA8D;AAC9D,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC,CAYzB;AAED,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,SAAS,uBAAuB,EAAE,GAC1C,OAAO,CAAC,OAAO,CAAC,CAwBlB"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { assertScaffoldPlanDigest } from "../../kernel/rendering-plan-validation.js";
|
|
2
|
-
import { assertSchema } from "../../../schema-catalog.js";
|
|
3
|
-
import { parseStrictYamlSource } from "../../../strict-yaml.js";
|
|
4
|
-
import { assertion, readContainedRepositoryFile } from "./node-repository-file.js";
|
|
5
|
-
import { MAX_SCAFFOLD_PLAN_BYTES } from "./node-scaffold-limits.js";
|
|
6
|
-
function hasErrorCode(error, code) {
|
|
7
|
-
const visited = new Set();
|
|
8
|
-
let candidate = error;
|
|
9
|
-
while (candidate instanceof Error && !visited.has(candidate)) {
|
|
10
|
-
visited.add(candidate);
|
|
11
|
-
if ("code" in candidate &&
|
|
12
|
-
candidate.code === code) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
candidate = candidate.cause;
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
function mapCatalog(value) {
|
|
20
|
-
const raw = value;
|
|
21
|
-
return Object.freeze({
|
|
22
|
-
version: 1,
|
|
23
|
-
packages: Object.freeze(raw.packages.map((entry) => Object.freeze({
|
|
24
|
-
id: entry.id,
|
|
25
|
-
role: entry.role,
|
|
26
|
-
path: entry.path,
|
|
27
|
-
packageName: entry.package_name,
|
|
28
|
-
...(entry.owner_document === undefined
|
|
29
|
-
? {}
|
|
30
|
-
: { ownerDocument: entry.owner_document })
|
|
31
|
-
})))
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export async function loadScaffoldCompilationInput(options) {
|
|
35
|
-
const [configFile, intentFile] = await Promise.all([
|
|
36
|
-
readContainedRepositoryFile(options.consumerRoot, options.configPath, "scaffolding-config"),
|
|
37
|
-
readContainedRepositoryFile(options.consumerRoot, options.intentPath, "scaffold-intent")
|
|
38
|
-
]);
|
|
39
|
-
const configValue = parseStrictYamlSource(configFile.source, "scaffolding-config");
|
|
40
|
-
const intentValue = parseStrictYamlSource(intentFile.source, "scaffold-intent");
|
|
41
|
-
return loadScaffoldCompilationInputFromIntentInternal({
|
|
42
|
-
consumerRoot: options.consumerRoot,
|
|
43
|
-
configPath: options.configPath,
|
|
44
|
-
foundationVersion: options.foundationVersion,
|
|
45
|
-
intent: intentValue,
|
|
46
|
-
configFile,
|
|
47
|
-
configValue
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async function loadScaffoldCompilationInputFromIntentInternal(options) {
|
|
51
|
-
const configFile = options.configFile ??
|
|
52
|
-
(await readContainedRepositoryFile(options.consumerRoot, options.configPath, "scaffolding-config"));
|
|
53
|
-
const configValue = options.configValue ??
|
|
54
|
-
parseStrictYamlSource(configFile.source, "scaffolding-config");
|
|
55
|
-
await Promise.all([
|
|
56
|
-
assertSchema("scaffolding-config/v1", configValue, "scaffolding-config"),
|
|
57
|
-
assertSchema("scaffold-intent/v1", options.intent, "scaffold-intent")
|
|
58
|
-
]);
|
|
59
|
-
const config = configValue;
|
|
60
|
-
const catalogFile = await readContainedRepositoryFile(options.consumerRoot, config.targetCatalogPath, "scaffold-target-catalog");
|
|
61
|
-
const catalogValue = parseStrictYamlSource(catalogFile.source, "scaffold-target-catalog");
|
|
62
|
-
await assertSchema("scaffold-target-catalog/v1", catalogValue, "scaffold-target-catalog");
|
|
63
|
-
return Object.freeze({
|
|
64
|
-
foundationVersion: options.foundationVersion,
|
|
65
|
-
configPath: options.configPath,
|
|
66
|
-
config,
|
|
67
|
-
intent: options.intent,
|
|
68
|
-
catalog: mapCatalog(catalogValue),
|
|
69
|
-
authorityReadSet: Object.freeze([
|
|
70
|
-
assertion(configFile),
|
|
71
|
-
assertion(catalogFile)
|
|
72
|
-
])
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
export async function loadScaffoldCompilationInputFromIntent(options) {
|
|
76
|
-
return loadScaffoldCompilationInputFromIntentInternal(options);
|
|
77
|
-
}
|
|
78
|
-
/** Reads a released 0.5 Plan for regression evidence only. */
|
|
79
|
-
export async function readScaffoldPlanFile(consumerRoot, planPath) {
|
|
80
|
-
const planFile = await readContainedRepositoryFile(consumerRoot, planPath, "scaffold-plan", MAX_SCAFFOLD_PLAN_BYTES);
|
|
81
|
-
const value = parseStrictYamlSource(planFile.source, "scaffold-plan");
|
|
82
|
-
await assertSchema("scaffold-plan/v1", value, "rendering-regression-plan");
|
|
83
|
-
const plan = value;
|
|
84
|
-
assertScaffoldPlanDigest(plan);
|
|
85
|
-
return plan;
|
|
86
|
-
}
|
|
87
|
-
export async function inspectAuthorityReadSet(consumerRoot, readSet) {
|
|
88
|
-
for (const expected of readSet) {
|
|
89
|
-
let current;
|
|
90
|
-
try {
|
|
91
|
-
current = await readContainedRepositoryFile(consumerRoot, expected.path, "scaffold-apply-read-set");
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
if (hasErrorCode(error, "ENOENT")) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
throw error;
|
|
98
|
-
}
|
|
99
|
-
const observed = assertion(current);
|
|
100
|
-
if (observed.size !== expected.size ||
|
|
101
|
-
observed.digest !== expected.digest) {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=node-input-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-input-loader.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-input-loader.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL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AE,CAAC;QAC/B,IAAI,OAA6B,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,2BAA2B,CACzC,YAAY,EACZ,QAAQ,CAAC,IAAI,EACb,yBAAyB,CAC1B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;gBAClC,OAAO,KAAK,CAAC;YACf,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACpC,IACE,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;YAC/B,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,EACnC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ScaffoldPlanV1, ScaffoldReceiptV1 } from "../../contract/types.js";
|
|
2
|
-
/** Validates an untrusted released 0.5 Receipt for regression evidence. */
|
|
3
|
-
export declare function validateScaffoldReceipt(receipt: unknown, plan?: ScaffoldPlanV1): Promise<ScaffoldReceiptV1>;
|
|
4
|
-
//# sourceMappingURL=node-receipt-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-receipt-validator.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-receipt-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAIjC,2EAA2E;AAC3E,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAS5B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { assertScaffoldReceiptDigest } from "../../kernel/receipt.js";
|
|
2
|
-
import { assertSchema } from "../../../schema-catalog.js";
|
|
3
|
-
/** Validates an untrusted released 0.5 Receipt for regression evidence. */
|
|
4
|
-
export async function validateScaffoldReceipt(receipt, plan) {
|
|
5
|
-
await assertSchema("scaffold-receipt/v1", receipt, "rendering-regression-receipt");
|
|
6
|
-
const validated = receipt;
|
|
7
|
-
assertScaffoldReceiptDigest(validated, plan);
|
|
8
|
-
return validated;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=node-receipt-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-receipt-validator.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-receipt-validator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAgB,EAChB,IAAqB;IAErB,MAAM,YAAY,CAChB,qBAAqB,EACrB,OAAO,EACP,8BAA8B,CAC/B,CAAC;IACF,MAAM,SAAS,GAAG,OAA4B,CAAC;IAC/C,2BAA2B,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7C,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-rendering-plan-authority.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-rendering-plan-authority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAO9D,wBAAsB,2CAA2C,CAC/D,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createRenderingRegressionRegistry } from "../../definitions/registry.js";
|
|
2
|
-
import { compileScaffoldPlan } from "../../kernel/rendering-plan-compiler.js";
|
|
3
|
-
import { ScaffoldError } from "../../scaffold-error.js";
|
|
4
|
-
import { installedFoundationVersion } from "./installed-foundation-version.js";
|
|
5
|
-
import { loadScaffoldCompilationInputFromIntent } from "./node-input-loader.js";
|
|
6
|
-
export async function assertRenderingPlanMatchesConsumerAuthority(consumerRoot, plan) {
|
|
7
|
-
const input = await loadScaffoldCompilationInputFromIntent({
|
|
8
|
-
consumerRoot,
|
|
9
|
-
configPath: plan.authority.configPath,
|
|
10
|
-
foundationVersion: await installedFoundationVersion(),
|
|
11
|
-
intent: plan.intent
|
|
12
|
-
});
|
|
13
|
-
const expected = compileScaffoldPlan(input, createRenderingRegressionRegistry());
|
|
14
|
-
if (expected.planDigest !== plan.planDigest) {
|
|
15
|
-
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", "Scaffolding Plan was not produced by the closed compiler from current consumer authority.");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=node-rendering-plan-authority.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-rendering-plan-authority.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/node-rendering-plan-authority.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,sCAAsC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,CAAC,KAAK,UAAU,2CAA2C,CAC/D,YAAoB,EACpB,IAAoB;IAEpB,MAAM,KAAK,GAAG,MAAM,sCAAsC,CAAC;QACzD,YAAY;QACZ,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU;QACrC,iBAAiB,EAAE,MAAM,0BAA0B,EAAE;QACrD,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,mBAAmB,CAClC,KAAK,EACL,iCAAiC,EAAE,CACpC,CAAC;IACF,IAAI,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,IAAI,aAAa,CACrB,uBAAuB,EACvB,2FAA2F,CAC5F,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { applyFilesystemScaffold, recoverFilesystemScaffold } from "./adapters/node/filesystem-workspace.js";
|
|
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/rendering-plan-validation.js";
|
|
6
|
-
export { assertScaffoldReceiptDigest } from "./kernel/receipt.js";
|
|
7
|
-
export { planScaffoldFromFile } from "./service.js";
|
|
8
|
-
//# sourceMappingURL=internal-rendering-regression-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-rendering-regression-api.d.ts","sourceRoot":"","sources":["../../src/scaffolding/internal-rendering-regression-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { applyFilesystemScaffold, recoverFilesystemScaffold } from "./adapters/node/filesystem-workspace.js";
|
|
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/rendering-plan-validation.js";
|
|
6
|
-
export { assertScaffoldReceiptDigest } from "./kernel/receipt.js";
|
|
7
|
-
export { planScaffoldFromFile } from "./service.js";
|
|
8
|
-
//# sourceMappingURL=internal-rendering-regression-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-rendering-regression-api.js","sourceRoot":"","sources":["../../src/scaffolding/internal-rendering-regression-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ScaffoldDiagnosticV1, ScaffoldOperationReceiptV1, ScaffoldPlanV1, ScaffoldReceiptOutcome, ScaffoldReceiptV1 } from "../contract/types.js";
|
|
2
|
-
interface ScaffoldReceiptCandidateV1 {
|
|
3
|
-
readonly schemaVersion: number;
|
|
4
|
-
readonly protocolVersion: number;
|
|
5
|
-
readonly planDigest: string;
|
|
6
|
-
readonly adapter: {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly contractVersion: number;
|
|
9
|
-
};
|
|
10
|
-
readonly outcome: string;
|
|
11
|
-
readonly commit: {
|
|
12
|
-
readonly state: "committed" | "recovered" | "recovery-required" | "rejected";
|
|
13
|
-
readonly atomicity: "journaled-recoverable" | "memory-atomic";
|
|
14
|
-
};
|
|
15
|
-
readonly operations: readonly ScaffoldOperationReceiptV1[];
|
|
16
|
-
readonly diagnostics: readonly ScaffoldDiagnosticV1[];
|
|
17
|
-
readonly receiptDigest: string;
|
|
18
|
-
}
|
|
19
|
-
interface CreateScaffoldReceiptOptions {
|
|
20
|
-
readonly plan: ScaffoldPlanV1;
|
|
21
|
-
readonly adapterId: "foundation.filesystem/v1" | "foundation.memory/v1";
|
|
22
|
-
readonly outcome: ScaffoldReceiptOutcome;
|
|
23
|
-
readonly commitState: ScaffoldReceiptCandidateV1["commit"]["state"];
|
|
24
|
-
readonly atomicity: ScaffoldReceiptCandidateV1["commit"]["atomicity"];
|
|
25
|
-
readonly operations: readonly ScaffoldOperationReceiptV1[];
|
|
26
|
-
readonly diagnostics?: readonly ScaffoldDiagnosticV1[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Verifies digest and semantic evidence for a schema-validated Receipt.
|
|
30
|
-
* Use `validateScaffoldReceipt` when the value comes from an untrusted source.
|
|
31
|
-
*/
|
|
32
|
-
export declare function assertScaffoldReceiptDigest(receipt: ScaffoldReceiptV1, plan?: ScaffoldPlanV1): void;
|
|
33
|
-
export declare function createScaffoldReceipt(options: CreateScaffoldReceiptOptions): ScaffoldReceiptV1;
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=receipt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../../src/scaffolding/kernel/receipt.ts"],"names":[],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