@agent-teams/engineering-foundation 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canonical-json.d.ts +12 -0
- package/dist/canonical-json.d.ts.map +1 -0
- package/dist/canonical-json.js +151 -0
- package/dist/canonical-json.js.map +1 -0
- package/dist/document-authoring/adapters/canonical-markdown.d.ts +14 -0
- package/dist/document-authoring/adapters/canonical-markdown.d.ts.map +1 -0
- package/dist/document-authoring/adapters/canonical-markdown.js +354 -0
- package/dist/document-authoring/adapters/canonical-markdown.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js +4 -1
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/read-document-authority-file.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/read-document-authority-file.js +3 -13
- package/dist/document-authoring/adapters/node/read-document-authority-file.js.map +1 -1
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts +38 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js +122 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js.map +1 -0
- package/dist/document-authoring/application/policies/document-contract-digests.d.ts +20 -0
- package/dist/document-authoring/application/policies/document-contract-digests.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-contract-digests.js +275 -0
- package/dist/document-authoring/application/policies/document-contract-digests.js.map +1 -0
- package/dist/document-authoring/application/policies/document-repository-path.d.ts +1 -0
- package/dist/document-authoring/application/policies/document-repository-path.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-repository-path.js +21 -2
- package/dist/document-authoring/application/policies/document-repository-path.js.map +1 -1
- package/dist/document-authoring/application/policies/document-temporary-path.d.ts +7 -0
- package/dist/document-authoring/application/policies/document-temporary-path.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-temporary-path.js +34 -0
- package/dist/document-authoring/application/policies/document-temporary-path.js.map +1 -0
- package/dist/document-authoring/application/ports/canonical-document-renderer.d.ts +29 -0
- package/dist/document-authoring/application/ports/canonical-document-renderer.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/canonical-document-renderer.js +2 -0
- package/dist/document-authoring/application/ports/canonical-document-renderer.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts +31 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js +272 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-bounded-regular-file.d.ts +20 -0
- package/dist/repository-mutation/adapters/node/node-bounded-regular-file.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-bounded-regular-file.js +123 -0
- package/dist/repository-mutation/adapters/node/node-bounded-regular-file.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts +12 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.js +32 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-existing-repository-ancestors.d.ts +13 -0
- package/dist/repository-mutation/adapters/node/node-existing-repository-ancestors.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-existing-repository-ancestors.js +67 -0
- package/dist/repository-mutation/adapters/node/node-existing-repository-ancestors.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-repository-path.d.ts +2 -0
- package/dist/repository-mutation/adapters/node/node-repository-path.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-repository-path.js +7 -0
- package/dist/repository-mutation/adapters/node/node-repository-path.js.map +1 -0
- package/dist/repository-mutation/application/model/exact-postimage.d.ts +17 -0
- package/dist/repository-mutation/application/model/exact-postimage.d.ts.map +1 -0
- package/dist/repository-mutation/application/model/exact-postimage.js +11 -0
- package/dist/repository-mutation/application/model/exact-postimage.js.map +1 -0
- package/dist/repository-mutation/application/model/path-identity.d.ts +7 -0
- package/dist/repository-mutation/application/model/path-identity.d.ts.map +1 -0
- package/dist/repository-mutation/application/model/path-identity.js +2 -0
- package/dist/repository-mutation/application/model/path-identity.js.map +1 -0
- package/dist/repository-mutation/application/model/repository-path.d.ts +8 -0
- package/dist/repository-mutation/application/model/repository-path.d.ts.map +1 -0
- package/dist/repository-mutation/application/model/repository-path.js +74 -0
- package/dist/repository-mutation/application/model/repository-path.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-file-identity.d.ts +3 -23
- package/dist/scaffolding/adapters/node/filesystem-file-identity.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-file-identity.js +1 -122
- package/dist/scaffolding/adapters/node/filesystem-file-identity.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts +2 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +73 -122
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-path-guard.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-path-guard.js +27 -68
- package/dist/scaffolding/adapters/node/filesystem-path-guard.js.map +1 -1
- package/dist/scaffolding/application/policies/legacy-scaffolding-repository-path.d.ts +4 -0
- package/dist/scaffolding/application/policies/legacy-scaffolding-repository-path.d.ts.map +1 -0
- package/dist/scaffolding/application/policies/legacy-scaffolding-repository-path.js +48 -0
- package/dist/scaffolding/application/policies/legacy-scaffolding-repository-path.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts +4 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js +30 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/installed-foundation-build-identity.js +1 -1
- package/dist/transaction-coordination/adapters/node/installed-foundation-build-identity.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/legacy-document-envelope-v2.d.ts +5 -0
- package/dist/transaction-coordination/adapters/node/legacy-document-envelope-v2.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/legacy-document-envelope-v2.js +212 -0
- package/dist/transaction-coordination/adapters/node/legacy-document-envelope-v2.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js +48 -26
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js.map +1 -1
- package/package.json +1 -1
- package/schemas/document-authoring-profile/v1.schema.json +64 -15
- package/schemas/document-command-envelope/v1.schema.json +1 -1
- package/schemas/document-intent/v1.schema.json +48 -6
- package/schemas/document-plan/v1.schema.json +20 -4
- package/schemas/document-receipt/v1.schema.json +1 -1
- package/schemas/foundation-transaction-envelope/v2.schema.json +21 -3
|
@@ -1,58 +1,74 @@
|
|
|
1
|
-
import { link, lstat, open, rm } from "node:fs/promises";
|
|
2
1
|
import { basename, dirname, join, resolve } from "node:path";
|
|
3
|
-
import {
|
|
2
|
+
import { assertTemporaryPathsAbsent, classifyExactFilePostimage, publishAbsentFile } from "../../../repository-mutation/adapters/node/node-absent-file-publication.js";
|
|
3
|
+
import { AbsentFilePublicationError } from "../../../repository-mutation/application/model/exact-postimage.js";
|
|
4
|
+
import { sha256Text } from "../../kernel/canonical-json.js";
|
|
4
5
|
import { ScaffoldError } from "../../scaffold-error.js";
|
|
5
|
-
import { assertSafeExistingAncestors, ensureSafeParent, isContainedPath
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (error instanceof Error &&
|
|
14
|
-
"code" in error &&
|
|
15
|
-
error.code === code);
|
|
6
|
+
import { assertSafeExistingAncestors, ensureSafeParent, isContainedPath } from "./filesystem-path-guard.js";
|
|
7
|
+
function postimage(operation) {
|
|
8
|
+
return {
|
|
9
|
+
bytes: Buffer.from(operation.after.contentBase64, "base64"),
|
|
10
|
+
digest: operation.after.digest,
|
|
11
|
+
mode: 0o644,
|
|
12
|
+
size: operation.after.size
|
|
13
|
+
};
|
|
16
14
|
}
|
|
17
15
|
export async function classifyFilesystemOperation(root, operation) {
|
|
18
16
|
const destination = resolve(root, operation.path);
|
|
19
17
|
if (!isContainedPath(root, destination)) {
|
|
20
18
|
return "conflict";
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (result.outcome !== "read") {
|
|
25
|
-
return "conflict";
|
|
26
|
-
}
|
|
27
|
-
const modeMatches = process.platform === "win32" || (result.mode & 0o777) === 0o644;
|
|
28
|
-
return sha256Bytes(result.bytes) === operation.after.digest && modeMatches
|
|
29
|
-
? "after"
|
|
30
|
-
: "conflict";
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
if (isMissing(error)) {
|
|
34
|
-
return "absent";
|
|
35
|
-
}
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
20
|
+
const state = await classifyExactFilePostimage(destination, postimage(operation));
|
|
21
|
+
return state === "exact" ? "after" : state;
|
|
38
22
|
}
|
|
39
23
|
function transactionTemporaryName(planDigest, operation) {
|
|
40
24
|
const identity = sha256Text(`${planDigest}:${operation.id}`).slice("sha256:".length);
|
|
41
25
|
return `.foundation-${identity}.tmp`;
|
|
42
26
|
}
|
|
43
27
|
export async function assertTransactionTemporariesAbsent(root, plan) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
28
|
+
try {
|
|
29
|
+
await assertTemporaryPathsAbsent(plan.operations.map((operation) => {
|
|
30
|
+
const parent = dirname(resolve(root, operation.path));
|
|
31
|
+
return {
|
|
32
|
+
displayPath: operation.path,
|
|
33
|
+
temporaryPath: join(parent, transactionTemporaryName(plan.planDigest, operation))
|
|
34
|
+
};
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error instanceof AbsentFilePublicationError &&
|
|
39
|
+
error.code === "TEMPORARY_EXISTS") {
|
|
40
|
+
const operationPath = error.message.slice("Temporary path already exists: ".length, -1);
|
|
41
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding transaction temporary path already exists: ${operationPath}.`);
|
|
55
42
|
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function translatePublicationError(error, operation) {
|
|
47
|
+
if (!(error instanceof AbsentFilePublicationError)) {
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
const causeOptions = error.cause === undefined ? undefined : { cause: error.cause };
|
|
51
|
+
switch (error.code) {
|
|
52
|
+
case "CONFLICT":
|
|
53
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding output changed concurrently: ${operation.path}.`, [], causeOptions);
|
|
54
|
+
case "TEMPORARY_EXISTS":
|
|
55
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding transaction temporary path already exists: ${operation.path}.`, [], causeOptions);
|
|
56
|
+
case "TEMPORARY_REPLACED":
|
|
57
|
+
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding temporary path was replaced concurrently: ${operation.path}.`);
|
|
58
|
+
case "CLEANUP_FAILED":
|
|
59
|
+
// Preserve the frozen scaffolding contract: cleanup failures were exposed
|
|
60
|
+
// directly before publication mechanics moved into the neutral kernel.
|
|
61
|
+
throw error.cleanupError;
|
|
62
|
+
case "INVALID_ERROR":
|
|
63
|
+
case "INVALID_POSTIMAGE":
|
|
64
|
+
case "PUBLICATION_INVALID":
|
|
65
|
+
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding publication failed with an invalid error value: ${operation.path}.`);
|
|
66
|
+
case "PUBLICATION_INCOMPLETE":
|
|
67
|
+
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding publication did not reach a terminal state: ${operation.path}.`);
|
|
68
|
+
case "VERIFICATION_FAILED":
|
|
69
|
+
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Published scaffolding output failed digest verification: ${operation.path}.`);
|
|
70
|
+
case "PUBLICATION_UNSUPPORTED":
|
|
71
|
+
throw error.cause instanceof Error ? error.cause : error;
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
export async function publishFilesystemOperation(root, operation, planDigest, operationIndex, faultInjector) {
|
|
@@ -67,92 +83,27 @@ export async function publishFilesystemOperation(root, operation, planDigest, op
|
|
|
67
83
|
const parent = await ensureSafeParent(root, operation.path);
|
|
68
84
|
const destination = join(parent, basename(operation.path));
|
|
69
85
|
const temporary = join(parent, transactionTemporaryName(planDigest, operation));
|
|
70
|
-
const bytes = Buffer.from(operation.after.contentBase64, "base64");
|
|
71
|
-
let temporaryIdentity;
|
|
72
|
-
let concurrentSatisfied = false;
|
|
73
|
-
let published = false;
|
|
74
|
-
let publicationError;
|
|
75
86
|
try {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
temporaryIdentity = await captureFileHandleIdentity(handle);
|
|
92
|
-
}
|
|
93
|
-
finally {
|
|
94
|
-
await handle.close();
|
|
95
|
-
}
|
|
96
|
-
await faultInjector?.({
|
|
97
|
-
phase: "after-temporary-synced",
|
|
98
|
-
operationIndex,
|
|
99
|
-
operationPath: operation.path
|
|
87
|
+
const outcome = await publishAbsentFile({
|
|
88
|
+
allowUnsupportedDirectoryDurability: true,
|
|
89
|
+
destinationPath: destination,
|
|
90
|
+
displayPath: operation.path,
|
|
91
|
+
...(faultInjector === undefined
|
|
92
|
+
? {}
|
|
93
|
+
: {
|
|
94
|
+
faultInjector: async (point) => faultInjector({
|
|
95
|
+
...point,
|
|
96
|
+
operationIndex,
|
|
97
|
+
operationPath: operation.path
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
postimage: postimage(operation),
|
|
101
|
+
temporaryPath: temporary
|
|
100
102
|
});
|
|
101
|
-
|
|
102
|
-
await link(temporary, destination);
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
if (hasErrorCode(error, "EEXIST")) {
|
|
106
|
-
const concurrentState = await classifyFilesystemOperation(root, operation);
|
|
107
|
-
if (concurrentState === "after") {
|
|
108
|
-
concurrentSatisfied = true;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding output changed concurrently: ${operation.path}.`, [], { cause: error });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
throw error;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (!concurrentSatisfied) {
|
|
119
|
-
published = true;
|
|
120
|
-
await faultInjector?.({
|
|
121
|
-
phase: "after-hard-link",
|
|
122
|
-
operationIndex,
|
|
123
|
-
operationPath: operation.path
|
|
124
|
-
});
|
|
125
|
-
await syncDirectory(parent);
|
|
126
|
-
}
|
|
103
|
+
return outcome === "published" ? "applied" : "already-satisfied";
|
|
127
104
|
}
|
|
128
105
|
catch (error) {
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
const temporaryOwnership = temporaryIdentity === undefined
|
|
132
|
-
? "missing"
|
|
133
|
-
: await pathMatchesFileIdentity(temporary, temporaryIdentity);
|
|
134
|
-
if (temporaryOwnership === "match") {
|
|
135
|
-
await rm(temporary);
|
|
136
|
-
await syncDirectory(parent);
|
|
137
|
-
}
|
|
138
|
-
else if (temporaryOwnership === "different") {
|
|
139
|
-
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding temporary path was replaced concurrently: ${operation.path}.`);
|
|
140
|
-
}
|
|
141
|
-
if (publicationError !== undefined) {
|
|
142
|
-
if (!(publicationError instanceof Error)) {
|
|
143
|
-
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding publication failed with an invalid error value: ${operation.path}.`);
|
|
144
|
-
}
|
|
145
|
-
throw publicationError;
|
|
146
|
-
}
|
|
147
|
-
if (concurrentSatisfied) {
|
|
148
|
-
return "already-satisfied";
|
|
149
|
-
}
|
|
150
|
-
if (!published) {
|
|
151
|
-
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Scaffolding publication did not reach a terminal state: ${operation.path}.`);
|
|
152
|
-
}
|
|
153
|
-
if ((await classifyFilesystemOperation(root, operation)) !== "after") {
|
|
154
|
-
throw new ScaffoldError("SCAFFOLD_RECOVERY_REQUIRED", `Published scaffolding output failed digest verification: ${operation.path}.`);
|
|
106
|
+
translatePublicationError(error, operation);
|
|
155
107
|
}
|
|
156
|
-
return "applied";
|
|
157
108
|
}
|
|
158
109
|
//# sourceMappingURL=filesystem-operation-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-operation-state.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-operation-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"filesystem-operation-state.js","sourceRo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AAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-path-guard.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-path-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filesystem-path-guard.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-path-guard.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAaxE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAmCjE;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;AA4BD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAgCjB;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { lstat, mkdir,
|
|
2
|
-
import {
|
|
1
|
+
import { lstat, mkdir, realpath } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { assertNoPortableNameCollision, assertSafeExistingRepositoryAncestors, ExistingRepositoryAncestorError } from "../../../repository-mutation/adapters/node/node-existing-repository-ancestors.js";
|
|
4
|
+
import { syncDirectoryDurably } from "../../../repository-mutation/adapters/node/node-directory-durability.js";
|
|
5
|
+
import { isLexicallyContainedPath } from "../../../repository-mutation/adapters/node/node-repository-path.js";
|
|
6
|
+
import { legacyScaffoldingRepositoryPathProblem } from "../../application/policies/legacy-scaffolding-repository-path.js";
|
|
3
7
|
import { ScaffoldError } from "../../scaffold-error.js";
|
|
4
8
|
const PROTECTED_ROOTS = new Set([".agent-teams-local", ".git", "node_modules"]);
|
|
5
|
-
const WINDOWS_RESERVED_NAMES = new Set([
|
|
6
|
-
"AUX",
|
|
7
|
-
"CON",
|
|
8
|
-
"NUL",
|
|
9
|
-
"PRN",
|
|
10
|
-
...Array.from({ length: 9 }, (_unused, index) => `COM${index + 1}`),
|
|
11
|
-
...Array.from({ length: 9 }, (_unused, index) => `LPT${index + 1}`)
|
|
12
|
-
]);
|
|
13
9
|
function isMissing(error) {
|
|
14
10
|
return (error instanceof Error &&
|
|
15
11
|
"code" in error &&
|
|
16
12
|
error.code === "ENOENT");
|
|
17
13
|
}
|
|
18
14
|
export function isContainedPath(root, candidate) {
|
|
19
|
-
|
|
20
|
-
return (relation === "" ||
|
|
21
|
-
(!relation.startsWith(`..${sep}`) && relation !== ".." && !isAbsolute(relation)));
|
|
15
|
+
return isLexicallyContainedPath(root, candidate);
|
|
22
16
|
}
|
|
23
17
|
export function assertSafeOperationPaths(plan) {
|
|
24
18
|
const folded = new Map();
|
|
@@ -27,17 +21,7 @@ export function assertSafeOperationPaths(plan) {
|
|
|
27
21
|
for (const operation of plan.operations) {
|
|
28
22
|
const segments = operation.path.split("/");
|
|
29
23
|
if (!operation.path.startsWith(targetPrefix) ||
|
|
30
|
-
operation.path
|
|
31
|
-
operation.path.length > 512 ||
|
|
32
|
-
operation.path.includes("\\") ||
|
|
33
|
-
isAbsolute(operation.path) ||
|
|
34
|
-
segments.some((segment) => segment.length === 0 ||
|
|
35
|
-
segment === "." ||
|
|
36
|
-
segment === ".." ||
|
|
37
|
-
segment.length > 255 ||
|
|
38
|
-
segment.endsWith(".") ||
|
|
39
|
-
Array.from(segment).some((character) => (character.codePointAt(0) ?? 0) < 32) ||
|
|
40
|
-
WINDOWS_RESERVED_NAMES.has((segment.split(".")[0] ?? "").toUpperCase())) ||
|
|
24
|
+
legacyScaffoldingRepositoryPathProblem(operation.path) !== undefined ||
|
|
41
25
|
segments.some((segment) => PROTECTED_ROOTS.has(segment.toLowerCase()))) {
|
|
42
26
|
throw new ScaffoldError("SCAFFOLD_PLAN_INVALID", `Scaffolding operation path is unsafe: ${operation.path}.`);
|
|
43
27
|
}
|
|
@@ -56,35 +40,19 @@ export function assertSafeOperationPaths(plan) {
|
|
|
56
40
|
}
|
|
57
41
|
}
|
|
58
42
|
export async function syncDirectory(path) {
|
|
43
|
+
await syncDirectoryDurably(path);
|
|
44
|
+
}
|
|
45
|
+
async function assertNoCaseCollision(parent, requestedName) {
|
|
59
46
|
try {
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
await handle.sync();
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
await handle.close();
|
|
66
|
-
}
|
|
47
|
+
await assertNoPortableNameCollision(parent, requestedName, (path) => path.toLowerCase(), "filesystem");
|
|
67
48
|
}
|
|
68
49
|
catch (error) {
|
|
69
|
-
if (
|
|
70
|
-
error
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async function assertNoCaseCollision(parent, requestedName) {
|
|
79
|
-
const entries = await readdir(parent).catch((error) => {
|
|
80
|
-
if (isMissing(error)) {
|
|
81
|
-
return [];
|
|
50
|
+
if (error instanceof ExistingRepositoryAncestorError &&
|
|
51
|
+
error.problem === "name-collision") {
|
|
52
|
+
const collision = error.existingName ?? "";
|
|
53
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Path collides under case folding: ${collision}, ${requestedName}.`);
|
|
82
54
|
}
|
|
83
55
|
throw error;
|
|
84
|
-
});
|
|
85
|
-
const collision = entries.find((entry) => entry !== requestedName && entry.toLowerCase() === requestedName.toLowerCase());
|
|
86
|
-
if (collision !== undefined) {
|
|
87
|
-
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Path collides under case folding: ${collision}, ${requestedName}.`);
|
|
88
56
|
}
|
|
89
57
|
}
|
|
90
58
|
export async function ensureSafeParent(root, repositoryPath) {
|
|
@@ -116,29 +84,20 @@ export async function ensureSafeParent(root, repositoryPath) {
|
|
|
116
84
|
return current;
|
|
117
85
|
}
|
|
118
86
|
export async function assertSafeExistingAncestors(root, repositoryPath) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
87
|
+
try {
|
|
88
|
+
await assertSafeExistingRepositoryAncestors(root, repositoryPath, (path) => path.toLowerCase(), "filesystem");
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (error instanceof ExistingRepositoryAncestorError) {
|
|
92
|
+
if (error.problem === "name-collision") {
|
|
93
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Path collides under case folding: ${error.existingName ?? ""}, ${error.requestedName ?? ""}.`);
|
|
94
|
+
}
|
|
95
|
+
if (error.problem === "not-directory") {
|
|
96
|
+
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding parent is not a real directory: ${repositoryPath}.`);
|
|
127
97
|
}
|
|
128
|
-
throw error;
|
|
129
|
-
});
|
|
130
|
-
if (metadata === null) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
|
|
134
|
-
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding parent is not a real directory: ${repositoryPath}.`);
|
|
135
|
-
}
|
|
136
|
-
const canonical = await realpath(next);
|
|
137
|
-
if (!isContainedPath(root, canonical)) {
|
|
138
98
|
throw new ScaffoldError("SCAFFOLD_APPLY_CONFLICT", `Scaffolding parent escapes the repository: ${repositoryPath}.`);
|
|
139
99
|
}
|
|
140
|
-
|
|
100
|
+
throw error;
|
|
141
101
|
}
|
|
142
|
-
await assertNoCaseCollision(current, segments.at(-1) ?? "");
|
|
143
102
|
}
|
|
144
103
|
//# sourceMappingURL=filesystem-path-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-path-guard.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-path-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"filesystem-path-guard.js","sourceRoot":"","sources":["../../../../src/scaffolding/adapters/node/filesystem-path-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,+BAA+B,EAChC,MAAM,kFAAkF,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,yEAAyE,CAAC;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,oEAAoE,CAAC;AAC9G,OAAO,EAAE,sCAAsC,EAAE,MAAM,kEAAkE,CAAC;AAE1H,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,oBAAoB,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAEhF,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,MAAM,IAAI,KAAK;QACd,KAA+B,CAAC,IAAI,KAAK,QAAQ,CACnD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,SAAiB;IAC7D,OAAO,wBAAwB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAkB;IACzD,MAAM,MAAM,GAAG,IAAI,GAAG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K,CAAC,aAAa,IAAI,EAAE,GAAG,CAC/F,CAAC;YACJ,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;gBACtC,MAAM,IAAI,aAAa,CACrB,yBAAyB,EACzB,+CAA+C,cAAc,GAAG,CACjE,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,aAAa,CACrB,yBAAyB,EACzB,8CAA8C,cAAc,GAAG,CAChE,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PortableRepositoryPathProblem } from "../../../repository-mutation/application/model/repository-path.js";
|
|
2
|
+
/** Preserves the published scaffolding v1 path contract exactly. */
|
|
3
|
+
export declare function legacyScaffoldingRepositoryPathProblem(repositoryPath: string): PortableRepositoryPathProblem | undefined;
|
|
4
|
+
//# sourceMappingURL=legacy-scaffolding-repository-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scaffolding-repository-path.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/application/policies/legacy-scaffolding-repository-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAmBvH,oEAAoE;AACpE,wBAAgB,sCAAsC,CACpD,cAAc,EAAE,MAAM,GACrB,6BAA6B,GAAG,SAAS,CAsC3C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const WINDOWS_RESERVED_NAMES = new Set([
|
|
2
|
+
"AUX",
|
|
3
|
+
"CON",
|
|
4
|
+
"NUL",
|
|
5
|
+
"PRN",
|
|
6
|
+
...Array.from({ length: 9 }, (_unused, index) => `COM${index + 1}`),
|
|
7
|
+
...Array.from({ length: 9 }, (_unused, index) => `LPT${index + 1}`)
|
|
8
|
+
]);
|
|
9
|
+
function isPortableAbsolutePath(repositoryPath) {
|
|
10
|
+
return (repositoryPath.startsWith("/") ||
|
|
11
|
+
repositoryPath.startsWith("\\\\") ||
|
|
12
|
+
/^[A-Za-z]:[\\/]/u.test(repositoryPath));
|
|
13
|
+
}
|
|
14
|
+
/** Preserves the published scaffolding v1 path contract exactly. */
|
|
15
|
+
export function legacyScaffoldingRepositoryPathProblem(repositoryPath) {
|
|
16
|
+
if (repositoryPath.length > 512) {
|
|
17
|
+
return "path-too-long";
|
|
18
|
+
}
|
|
19
|
+
if (isPortableAbsolutePath(repositoryPath)) {
|
|
20
|
+
return "absolute";
|
|
21
|
+
}
|
|
22
|
+
if (repositoryPath.includes("\\")) {
|
|
23
|
+
return "backslash";
|
|
24
|
+
}
|
|
25
|
+
const segments = repositoryPath.split("/");
|
|
26
|
+
for (const segment of segments) {
|
|
27
|
+
if (segment.length === 0) {
|
|
28
|
+
return "empty-segment";
|
|
29
|
+
}
|
|
30
|
+
if (segment === "." || segment === "..") {
|
|
31
|
+
return "invalid-segment";
|
|
32
|
+
}
|
|
33
|
+
if (segment.length > 255) {
|
|
34
|
+
return "segment-too-long";
|
|
35
|
+
}
|
|
36
|
+
if (segment.endsWith(".")) {
|
|
37
|
+
return "trailing-dot";
|
|
38
|
+
}
|
|
39
|
+
if (Array.from(segment).some((character) => (character.codePointAt(0) ?? 0) < 32)) {
|
|
40
|
+
return "control-character";
|
|
41
|
+
}
|
|
42
|
+
if (WINDOWS_RESERVED_NAMES.has((segment.split(".")[0] ?? "").toUpperCase())) {
|
|
43
|
+
return "reserved-name";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=legacy-scaffolding-repository-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scaffolding-repository-path.js","sourceRoot":"","sources":["../../../../src/scaffolding/application/policies/legacy-scaffolding-repository-path.ts"],"names":[],"mappings":"AAEA,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,KAAK;IACL,KAAK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YACzB,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,OAAO,cAAc,CAAC;QACxB,CAAC;QACD,IACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CACtB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CACpD,EACD,CAAC;YACD,OAAO,mBAAmB,CAAC;QAC7B,CAAC;QACD,IACE,sBAAsB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,EACvE,CAAC;YACD,OAAO,eAAe,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FoundationTransactionStatus } from "../../application/model/transaction-status.js";
|
|
2
|
+
export declare function classifyNodeTemporaryIdentity(value: unknown): "invalid" | "unverifiable" | "verifiable";
|
|
3
|
+
export declare function unverifiableDocumentTemporaryStatus(foundation: Record<string, unknown>): FoundationTransactionStatus;
|
|
4
|
+
//# sourceMappingURL=document-temporary-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-temporary-identity.d.ts","sourceRoot":"","sources":["../../../../src/transaction-coordination/adapters/node/document-temporary-identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAMjG,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,SAAS,GAAG,cAAc,GAAG,YAAY,CAa3C;AAED,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,2BAA2B,CAW7B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function isRecord(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function classifyNodeTemporaryIdentity(value) {
|
|
5
|
+
if (!isRecord(value)) {
|
|
6
|
+
return "invalid";
|
|
7
|
+
}
|
|
8
|
+
const decimal = /^(?:0|[1-9][0-9]{0,31})$/u;
|
|
9
|
+
if (value["adapter"] !== "node-filesystem" || value["version"] !== 1 ||
|
|
10
|
+
typeof value["dev"] !== "string" || !decimal.test(value["dev"]) ||
|
|
11
|
+
typeof value["ino"] !== "string" || !decimal.test(value["ino"]) ||
|
|
12
|
+
typeof value["birthtimeNs"] !== "string" || !decimal.test(value["birthtimeNs"])) {
|
|
13
|
+
return "invalid";
|
|
14
|
+
}
|
|
15
|
+
return value["dev"] === "0" || value["ino"] === "0" ||
|
|
16
|
+
value["birthtimeNs"] === "0" ? "unverifiable" : "verifiable";
|
|
17
|
+
}
|
|
18
|
+
export function unverifiableDocumentTemporaryStatus(foundation) {
|
|
19
|
+
return {
|
|
20
|
+
state: "manual-recovery-required", reason: "recovery-handler-unavailable",
|
|
21
|
+
operationKind: "document-authoring", format: "envelope-v2",
|
|
22
|
+
foundationVersion: String(foundation["version"]),
|
|
23
|
+
foundationBuildIdentity: String(foundation["buildIdentity"]),
|
|
24
|
+
diagnostics: [{
|
|
25
|
+
code: "FOUNDATION_TRANSACTION_MANUAL_RECOVERY_REQUIRED",
|
|
26
|
+
message: "The preserved Document transaction temporary has an adapter-reported zero physical identity and cannot authorize automatic recovery or publication."
|
|
27
|
+
}]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=document-temporary-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-temporary-identity.js","sourceRoot":"","sources":["../../../../src/transaction-coordination/adapters/node/document-temporary-identity.ts"],"names":[],"mappings":"AAEA,SAAS,QAAQ,CA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,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QAC5D,WAAW,EAAE,CAAC;gBACZ,IAAI,EAAE,iDAAiD;gBACvD,OAAO,EAAE,qJAAqJ;aAC/J,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { lstat, opendir } from "node:fs/promises";
|
|
3
3
|
import { dirname, join, relative, sep } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { readBoundedRegularFile } from "../../../
|
|
5
|
+
import { readBoundedRegularFile } from "../../../repository-mutation/adapters/node/node-bounded-regular-file.js";
|
|
6
6
|
const maximumBuildFileBytes = 8 * 1024 * 1024;
|
|
7
7
|
const maximumBuildFiles = 4096;
|
|
8
8
|
const maximumBuildBytes = 64 * 1024 * 1024;
|
package/dist/transaction-coordination/adapters/node/installed-foundation-build-identity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed-foundation-build-identity.js","sourceRoot":"","sources":["../../../../src/transaction-coordination/adapters/node/installed-foundation-build-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"installed-foundation-build-identity.js","sourceRoot":"","sources":["../../../../src/transaction-coordination/adapters/node/installed-foundation-build-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD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umentEnvelope(value: unknown): boolean;
|
|
3
|
+
/** Replays the exact document hash semantics shipped by 0.13.0 and 0.13.1. */
|
|
4
|
+
export declare function assertLegacyDocumentEnvelope(envelope: Record<string, unknown>): void;
|
|
5
|
+
//# sourceMappingURL=legacy-document-envelope-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-document-envelope-v2.d.ts","sourceRoot":"","sources":["../../../../src/transaction-coordination/adapters/node/legacy-document-envelope-v2.ts"],"names":[],"mappings":"AA2KA,gFAAgF;AAChF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErE;AAcD,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAiEN"}
|