assertledger 1.2.0 → 1.3.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.fr.md +23 -3
- package/README.md +22 -3
- package/dist/build-info.json +1 -1
- package/dist/cli.d.ts +8 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +224 -5
- package/dist/cli.js.map +1 -1
- package/dist/engine/connection.d.ts +25 -1
- package/dist/engine/connection.d.ts.map +1 -1
- package/dist/engine/connection.js +144 -31
- package/dist/engine/connection.js.map +1 -1
- package/dist/engine/demo.d.ts +16 -0
- package/dist/engine/demo.d.ts.map +1 -0
- package/dist/engine/demo.js +51 -0
- package/dist/engine/demo.js.map +1 -0
- package/dist/engine/index.d.ts +16 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +87 -11
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/setup.d.ts +39 -0
- package/dist/engine/setup.d.ts.map +1 -0
- package/dist/engine/setup.js +411 -0
- package/dist/engine/setup.js.map +1 -0
- package/docs/developer-experience.md +32 -0
- package/docs/reference.md +3 -0
- package/docs/repository-init.md +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type RepositoryInitResult, type RepositoryInitResultV2 } from "../contracts/index.js";
|
|
2
|
+
import { type ClientConnectionPlan, type ClientConnectionResult } from "./connection.js";
|
|
3
|
+
export type SetupClient = "codex" | "claude-code";
|
|
4
|
+
type AnyRepositoryInitResult = RepositoryInitResult | RepositoryInitResultV2;
|
|
5
|
+
export type RepositorySetupStatus = "WOULD_CREATE" | "CREATED" | "UNCHANGED" | "BLOCKED" | "CONFLICT" | "PARTIAL_FAILURE";
|
|
6
|
+
export type RepositorySetupArtifactState = "WOULD_CREATE" | "CREATED" | "UNCHANGED" | "CONFLICT" | "ROLLED_BACK" | "PARTIAL";
|
|
7
|
+
export interface RepositorySetupRollback {
|
|
8
|
+
status: "NOT_REQUIRED" | "COMPLETE" | "PARTIAL";
|
|
9
|
+
removed: string[];
|
|
10
|
+
unresolved: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface RepositorySetupArtifact {
|
|
13
|
+
owner: "init" | "connection";
|
|
14
|
+
path: string;
|
|
15
|
+
state: RepositorySetupArtifactState;
|
|
16
|
+
}
|
|
17
|
+
export interface RepositorySetupResult {
|
|
18
|
+
status: RepositorySetupStatus;
|
|
19
|
+
client: SetupClient;
|
|
20
|
+
mode: "dry-run" | "write";
|
|
21
|
+
init: AnyRepositoryInitResult;
|
|
22
|
+
connection: ClientConnectionResult;
|
|
23
|
+
artifacts: RepositorySetupArtifact[];
|
|
24
|
+
rollback: RepositorySetupRollback;
|
|
25
|
+
limitations: string[];
|
|
26
|
+
reasonCodes?: string[];
|
|
27
|
+
nextActions?: string[];
|
|
28
|
+
diagnosticPaths?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface SetupRepositoryDependencies {
|
|
31
|
+
planInit?(root: string): Promise<AnyRepositoryInitResult>;
|
|
32
|
+
afterInitApplied?(): Promise<void>;
|
|
33
|
+
applyInit?(root: string): Promise<AnyRepositoryInitResult>;
|
|
34
|
+
applyConnection?(): Promise<ClientConnectionResult>;
|
|
35
|
+
planConnection?(root: string, cliEntry: string, client: SetupClient): Promise<ClientConnectionPlan>;
|
|
36
|
+
}
|
|
37
|
+
export declare function setupRepository(root: string, cliEntry: string, client: SetupClient, write: boolean, dependencies?: SetupRepositoryDependencies): Promise<RepositorySetupResult>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/engine/setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAG5B,MAAM,iBA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AAS,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC3D,eAAe,CAAC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACpD,cAAc,CAAC,CACb,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC;AAiJD,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,2BAAgC,GAC7C,OAAO,CAAC,qBAAqB,CAAC,CAsThC"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { lstat, readFile, realpath, unlink } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { parseRepositoryInitResult, } from "../contracts/index.js";
|
|
4
|
+
import { ClientConnectionApplyError, connectClient, planClientConnection, } from "./connection.js";
|
|
5
|
+
import { initializeRepository, RepositoryInitWriteError } from "./index.js";
|
|
6
|
+
const SETUP_LIMITATIONS = [
|
|
7
|
+
"Setup configures static initialization and a read-only client connection only.",
|
|
8
|
+
"It does not authorize UNSANDBOXED execution, reload the client, or prove repository behavior.",
|
|
9
|
+
"Setup has no cross-process filesystem lock. Concurrent edits can be overwritten during lock regeneration or removed between a rollback byte check and unlink; run only while the trusted repository tree is stable.",
|
|
10
|
+
];
|
|
11
|
+
function failedInitPreflight() {
|
|
12
|
+
return parseRepositoryInitResult({
|
|
13
|
+
schemaVersion: "1.0.0",
|
|
14
|
+
status: "CONFLICT",
|
|
15
|
+
reasonCodes: ["INIT_PREFLIGHT_FAILED"],
|
|
16
|
+
detections: {
|
|
17
|
+
packageManager: null,
|
|
18
|
+
framework: null,
|
|
19
|
+
testCommand: null,
|
|
20
|
+
ciProviders: [],
|
|
21
|
+
adapterRecommendation: "unavailable",
|
|
22
|
+
reasonCodes: ["INIT_PREFLIGHT_FAILED"],
|
|
23
|
+
},
|
|
24
|
+
actions: [],
|
|
25
|
+
files: [],
|
|
26
|
+
requiredOperatorInputs: ["worlds", "candidates"],
|
|
27
|
+
nextCommands: [{ executable: "assertledger", arguments: ["audit", ".", "--json"] }],
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function connectionPreflightDiagnostic(error, cliEntry) {
|
|
31
|
+
const code = error instanceof Error ? error.message : "";
|
|
32
|
+
const skillPath = path.join(path.dirname(path.dirname(path.resolve(cliEntry))), "integrations", "skill", "SKILL.md");
|
|
33
|
+
if (code === "CONNECT_BUILD_REQUIRED") {
|
|
34
|
+
return {
|
|
35
|
+
reasonCode: "CONNECTION_BUILD_REQUIRED",
|
|
36
|
+
paths: [path.resolve(cliEntry)],
|
|
37
|
+
nextAction: "Run `pnpm build`, invoke the generated dist/cli.js, then rerun setup.",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (code === "CONNECT_SKILL_REQUIRED") {
|
|
41
|
+
return {
|
|
42
|
+
reasonCode: "CONNECTION_SKILL_REQUIRED",
|
|
43
|
+
paths: [skillPath],
|
|
44
|
+
nextAction: "Restore integrations/skill/SKILL.md from the installed package, then rerun setup.",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (code === "CONNECT_SKILL_PATH_UNSAFE") {
|
|
48
|
+
return {
|
|
49
|
+
reasonCode: "CONNECTION_SKILL_PATH_UNSAFE",
|
|
50
|
+
paths: [skillPath],
|
|
51
|
+
nextAction: "Replace the packaged skill path with a regular file, then rerun setup.",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
reasonCode: "CONNECTION_PREFLIGHT_FAILED",
|
|
56
|
+
paths: [],
|
|
57
|
+
nextAction: "Inspect the installed package and client configuration paths, then rerun setup.",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function initArtifactState(result, file) {
|
|
61
|
+
if (result.status === "CONFLICT")
|
|
62
|
+
return "CONFLICT";
|
|
63
|
+
return result.actions.some((action) => action.path === file) ? "WOULD_CREATE" : "UNCHANGED";
|
|
64
|
+
}
|
|
65
|
+
async function rollbackCreatedInitFiles(root, plan, ownedPaths, changedUnownedPaths = []) {
|
|
66
|
+
const removed = [];
|
|
67
|
+
const unresolved = changedUnownedPaths.map((changedPath) => path.relative(root, changedPath).split(path.sep).join("/"));
|
|
68
|
+
for (const ownedPath of ownedPaths) {
|
|
69
|
+
const relative = path.relative(root, ownedPath).split(path.sep).join("/");
|
|
70
|
+
const plannedFile = plan.files.find((file) => file.path === relative);
|
|
71
|
+
if (plannedFile === undefined) {
|
|
72
|
+
unresolved.push(relative);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const metadata = await lstat(ownedPath);
|
|
77
|
+
if (!metadata.isFile() ||
|
|
78
|
+
metadata.isSymbolicLink() ||
|
|
79
|
+
!(await readFile(ownedPath)).equals(Buffer.from(plannedFile.content, "utf8"))) {
|
|
80
|
+
unresolved.push(relative);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
await unlink(ownedPath);
|
|
84
|
+
removed.push(relative);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (error.code === "ENOENT")
|
|
88
|
+
removed.push(relative);
|
|
89
|
+
else
|
|
90
|
+
unresolved.push(relative);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
removed.sort((left, right) => left.localeCompare(right));
|
|
94
|
+
unresolved.sort((left, right) => left.localeCompare(right));
|
|
95
|
+
return {
|
|
96
|
+
status: unresolved.length === 0 ? "COMPLETE" : "PARTIAL",
|
|
97
|
+
removed,
|
|
98
|
+
unresolved,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function rollbackArtifactState(root, artifact, rollback) {
|
|
102
|
+
const relative = path.relative(root, artifact.path).split(path.sep).join("/");
|
|
103
|
+
if (rollback.removed.includes(relative))
|
|
104
|
+
return "ROLLED_BACK";
|
|
105
|
+
if (rollback.unresolved.includes(relative))
|
|
106
|
+
return "PARTIAL";
|
|
107
|
+
return artifact.state;
|
|
108
|
+
}
|
|
109
|
+
function mergeRollback(root, init, connection) {
|
|
110
|
+
const relative = (file) => path.relative(root, file).split(path.sep).join("/");
|
|
111
|
+
const removed = [...init.removed, ...connection.removed.map(relative)].sort((left, right) => left.localeCompare(right));
|
|
112
|
+
const unresolved = [...init.unresolved, ...connection.unresolved.map(relative)].sort((left, right) => left.localeCompare(right));
|
|
113
|
+
return { status: unresolved.length === 0 ? "COMPLETE" : "PARTIAL", removed, unresolved };
|
|
114
|
+
}
|
|
115
|
+
export async function setupRepository(root, cliEntry, client, write, dependencies = {}) {
|
|
116
|
+
const requestedRoot = path.resolve(root);
|
|
117
|
+
let initPlan;
|
|
118
|
+
try {
|
|
119
|
+
initPlan = await (dependencies.planInit?.(root) ??
|
|
120
|
+
initializeRepository(root, { dryRun: true }));
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return {
|
|
124
|
+
status: "CONFLICT",
|
|
125
|
+
client,
|
|
126
|
+
mode: write ? "write" : "dry-run",
|
|
127
|
+
init: failedInitPreflight(),
|
|
128
|
+
connection: { client, status: "CONFLICT", artifacts: [] },
|
|
129
|
+
artifacts: [],
|
|
130
|
+
rollback: { status: "NOT_REQUIRED", removed: [], unresolved: [] },
|
|
131
|
+
limitations: [...SETUP_LIMITATIONS],
|
|
132
|
+
reasonCodes: ["INIT_PREFLIGHT_FAILED"],
|
|
133
|
+
nextActions: ["Inspect repository readability and permissions, then rerun setup."],
|
|
134
|
+
diagnosticPaths: [requestedRoot],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (initPlan.status === "CONFLICT" && initPlan.reasonCodes.includes("REPOSITORY_ROOT_INVALID")) {
|
|
138
|
+
return {
|
|
139
|
+
status: "CONFLICT",
|
|
140
|
+
client,
|
|
141
|
+
mode: write ? "write" : "dry-run",
|
|
142
|
+
init: initPlan,
|
|
143
|
+
connection: { client, status: "CONFLICT", artifacts: [] },
|
|
144
|
+
artifacts: [],
|
|
145
|
+
rollback: { status: "NOT_REQUIRED", removed: [], unresolved: [] },
|
|
146
|
+
limitations: [...SETUP_LIMITATIONS],
|
|
147
|
+
reasonCodes: [...initPlan.reasonCodes],
|
|
148
|
+
nextActions: ["Provide an existing readable repository directory, then rerun setup."],
|
|
149
|
+
diagnosticPaths: [requestedRoot],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
root = await realpath(root);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return {
|
|
157
|
+
status: "CONFLICT",
|
|
158
|
+
client,
|
|
159
|
+
mode: write ? "write" : "dry-run",
|
|
160
|
+
init: initPlan,
|
|
161
|
+
connection: { client, status: "CONFLICT", artifacts: [] },
|
|
162
|
+
artifacts: [],
|
|
163
|
+
rollback: { status: "NOT_REQUIRED", removed: [], unresolved: [] },
|
|
164
|
+
limitations: [...SETUP_LIMITATIONS],
|
|
165
|
+
reasonCodes: ["SETUP_ROOT_RESOLUTION_FAILED"],
|
|
166
|
+
nextActions: ["Restore the repository directory, then rerun setup."],
|
|
167
|
+
diagnosticPaths: [requestedRoot],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const initArtifacts = initPlan.files.map((file) => ({
|
|
171
|
+
owner: "init",
|
|
172
|
+
path: path.join(root, file.path),
|
|
173
|
+
state: initArtifactState(initPlan, file.path),
|
|
174
|
+
}));
|
|
175
|
+
let connectionPlan;
|
|
176
|
+
try {
|
|
177
|
+
connectionPlan = await (dependencies.planConnection?.(root, cliEntry, client) ??
|
|
178
|
+
planClientConnection(root, cliEntry, client));
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
const diagnostic = connectionPreflightDiagnostic(error, cliEntry);
|
|
182
|
+
return {
|
|
183
|
+
status: "CONFLICT",
|
|
184
|
+
client,
|
|
185
|
+
mode: write ? "write" : "dry-run",
|
|
186
|
+
init: initPlan,
|
|
187
|
+
connection: { client, status: "CONFLICT", artifacts: [] },
|
|
188
|
+
artifacts: initArtifacts,
|
|
189
|
+
rollback: { status: "NOT_REQUIRED", removed: [], unresolved: [] },
|
|
190
|
+
limitations: [...SETUP_LIMITATIONS],
|
|
191
|
+
reasonCodes: [diagnostic.reasonCode],
|
|
192
|
+
nextActions: [diagnostic.nextAction],
|
|
193
|
+
diagnosticPaths: diagnostic.paths,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const connectionArtifacts = connectionPlan.result.artifacts.flatMap((artifact, index) => {
|
|
197
|
+
if (artifact.path === null)
|
|
198
|
+
return [];
|
|
199
|
+
const state = connectionPlan.states[index];
|
|
200
|
+
if (state === undefined)
|
|
201
|
+
throw new Error("CONNECT_PLAN_INCONSISTENT");
|
|
202
|
+
return [
|
|
203
|
+
{
|
|
204
|
+
owner: "connection",
|
|
205
|
+
path: artifact.path,
|
|
206
|
+
state: state === "ABSENT" ? "WOULD_CREATE" : state,
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
});
|
|
210
|
+
const artifacts = [...initArtifacts, ...connectionArtifacts];
|
|
211
|
+
const connectionPlanReasonCodes = connectionPlan.reasonCodes;
|
|
212
|
+
const initPlanReasonCodes = initPlan.status === "CONFLICT" || initPlan.status === "BLOCKED" ? initPlan.reasonCodes : [];
|
|
213
|
+
const reasonCodes = [...new Set([...initPlanReasonCodes, ...(connectionPlanReasonCodes ?? [])])];
|
|
214
|
+
const nextActions = [
|
|
215
|
+
...(initPlanReasonCodes.length === 0
|
|
216
|
+
? []
|
|
217
|
+
: ["Resolve the repository initialization reason codes, then rerun setup."]),
|
|
218
|
+
...(connectionPlanReasonCodes?.includes("CONNECTION_TARGET_PATH_UNSAFE")
|
|
219
|
+
? ["Replace unsafe client target paths with regular local paths, then rerun setup."]
|
|
220
|
+
: []),
|
|
221
|
+
...(connectionPlanReasonCodes?.includes("CONNECTION_CONTENT_CONFLICT")
|
|
222
|
+
? ["Inspect and resolve conflicting client artifact contents, then rerun setup."]
|
|
223
|
+
: []),
|
|
224
|
+
];
|
|
225
|
+
const diagnosticPaths = [
|
|
226
|
+
...(initPlanReasonCodes.length === 0 ? [] : [root]),
|
|
227
|
+
...(connectionPlan.diagnosticPaths ?? []),
|
|
228
|
+
];
|
|
229
|
+
const base = {
|
|
230
|
+
client,
|
|
231
|
+
mode: write ? "write" : "dry-run",
|
|
232
|
+
init: initPlan,
|
|
233
|
+
connection: connectionPlan.result,
|
|
234
|
+
artifacts,
|
|
235
|
+
rollback: { status: "NOT_REQUIRED", removed: [], unresolved: [] },
|
|
236
|
+
limitations: [...SETUP_LIMITATIONS],
|
|
237
|
+
...(reasonCodes.length === 0
|
|
238
|
+
? {}
|
|
239
|
+
: {
|
|
240
|
+
reasonCodes,
|
|
241
|
+
nextActions,
|
|
242
|
+
diagnosticPaths,
|
|
243
|
+
}),
|
|
244
|
+
};
|
|
245
|
+
if (initPlan.status === "CONFLICT" || connectionPlan.result.status === "CONFLICT") {
|
|
246
|
+
return { status: "CONFLICT", ...base };
|
|
247
|
+
}
|
|
248
|
+
if (initPlan.status === "BLOCKED")
|
|
249
|
+
return { status: "BLOCKED", ...base };
|
|
250
|
+
const unchanged = artifacts.every((artifact) => artifact.state === "UNCHANGED");
|
|
251
|
+
if (!write)
|
|
252
|
+
return { status: unchanged ? "UNCHANGED" : "WOULD_CREATE", ...base };
|
|
253
|
+
let appliedInit;
|
|
254
|
+
try {
|
|
255
|
+
appliedInit = await (dependencies.applyInit?.(root) ?? initializeRepository(root));
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
const ownedPaths = error instanceof RepositoryInitWriteError ? error.installedPaths : [];
|
|
259
|
+
const initRollback = await rollbackCreatedInitFiles(root, initPlan, ownedPaths);
|
|
260
|
+
const temporaryArtifact = error instanceof RepositoryInitWriteError && error.temporaryCleanup !== "NOT_OWNED"
|
|
261
|
+
? {
|
|
262
|
+
relative: path.relative(root, error.temporaryPath).split(path.sep).join("/"),
|
|
263
|
+
absolute: error.temporaryPath,
|
|
264
|
+
cleanup: error.temporaryCleanup,
|
|
265
|
+
}
|
|
266
|
+
: undefined;
|
|
267
|
+
const rollback = temporaryArtifact
|
|
268
|
+
? {
|
|
269
|
+
status: initRollback.status === "PARTIAL" || temporaryArtifact.cleanup === "UNRESOLVED"
|
|
270
|
+
? "PARTIAL"
|
|
271
|
+
: "COMPLETE",
|
|
272
|
+
removed: [
|
|
273
|
+
...initRollback.removed,
|
|
274
|
+
...(temporaryArtifact.cleanup === "REMOVED" ? [temporaryArtifact.relative] : []),
|
|
275
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
276
|
+
unresolved: [
|
|
277
|
+
...initRollback.unresolved,
|
|
278
|
+
...(temporaryArtifact.cleanup === "UNRESOLVED" ? [temporaryArtifact.relative] : []),
|
|
279
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
280
|
+
}
|
|
281
|
+
: initRollback;
|
|
282
|
+
const failedArtifacts = temporaryArtifact === undefined
|
|
283
|
+
? artifacts
|
|
284
|
+
: [
|
|
285
|
+
...artifacts,
|
|
286
|
+
{
|
|
287
|
+
owner: "init",
|
|
288
|
+
path: temporaryArtifact.absolute,
|
|
289
|
+
state: temporaryArtifact.cleanup === "UNRESOLVED"
|
|
290
|
+
? "PARTIAL"
|
|
291
|
+
: "ROLLED_BACK",
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
return {
|
|
295
|
+
status: "PARTIAL_FAILURE",
|
|
296
|
+
...base,
|
|
297
|
+
artifacts: failedArtifacts.map((artifact) => ({
|
|
298
|
+
...artifact,
|
|
299
|
+
state: artifact.path === temporaryArtifact?.absolute
|
|
300
|
+
? artifact.state
|
|
301
|
+
: rollbackArtifactState(root, artifact, rollback),
|
|
302
|
+
})),
|
|
303
|
+
rollback,
|
|
304
|
+
reasonCodes: [
|
|
305
|
+
error instanceof RepositoryInitWriteError ? "INIT_APPLY_WRITE_FAILED" : "INIT_APPLY_FAILED",
|
|
306
|
+
],
|
|
307
|
+
nextActions: ["Inspect rollback details, resolve unresolved paths, then rerun setup."],
|
|
308
|
+
diagnosticPaths: rollback.unresolved.map((relative) => path.join(root, relative)),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
if (appliedInit.status === "CONFLICT" || appliedInit.status === "BLOCKED") {
|
|
312
|
+
return {
|
|
313
|
+
status: appliedInit.status,
|
|
314
|
+
...base,
|
|
315
|
+
init: appliedInit,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
let appliedConnection;
|
|
319
|
+
try {
|
|
320
|
+
await dependencies.afterInitApplied?.();
|
|
321
|
+
appliedConnection = await (dependencies.applyConnection?.() ??
|
|
322
|
+
connectClient(root, cliEntry, client, true));
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
const initRollback = await rollbackCreatedInitFiles(root, appliedInit, appliedInit.actions
|
|
326
|
+
.filter((action) => action.kind === "CREATE")
|
|
327
|
+
.map((action) => path.join(root, action.path)), appliedInit.actions
|
|
328
|
+
.filter((action) => action.kind !== "CREATE")
|
|
329
|
+
.map((action) => path.join(root, action.path)));
|
|
330
|
+
if (!(error instanceof ClientConnectionApplyError)) {
|
|
331
|
+
return {
|
|
332
|
+
status: "PARTIAL_FAILURE",
|
|
333
|
+
...base,
|
|
334
|
+
init: appliedInit,
|
|
335
|
+
artifacts: artifacts.map((artifact) => ({
|
|
336
|
+
...artifact,
|
|
337
|
+
state: rollbackArtifactState(root, artifact, initRollback),
|
|
338
|
+
})),
|
|
339
|
+
rollback: initRollback,
|
|
340
|
+
reasonCodes: ["CONNECTION_APPLY_FAILED"],
|
|
341
|
+
nextActions: ["Inspect rollback details, resolve unresolved paths, then rerun setup."],
|
|
342
|
+
diagnosticPaths: initRollback.unresolved.map((relative) => path.join(root, relative)),
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
const rollback = mergeRollback(root, initRollback, error.rollback);
|
|
346
|
+
return {
|
|
347
|
+
status: "PARTIAL_FAILURE",
|
|
348
|
+
...base,
|
|
349
|
+
init: appliedInit,
|
|
350
|
+
artifacts: artifacts.map((artifact) => ({
|
|
351
|
+
...artifact,
|
|
352
|
+
state: rollbackArtifactState(root, artifact, rollback),
|
|
353
|
+
})),
|
|
354
|
+
rollback,
|
|
355
|
+
reasonCodes: ["CONNECTION_APPLY_FAILED"],
|
|
356
|
+
nextActions: ["Inspect rollback details, resolve unresolved paths, then rerun setup."],
|
|
357
|
+
diagnosticPaths: rollback.unresolved.map((relative) => path.join(root, relative)),
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
if (appliedConnection.status === "CONFLICT") {
|
|
361
|
+
const rollback = await rollbackCreatedInitFiles(root, appliedInit, appliedInit.actions
|
|
362
|
+
.filter((action) => action.kind === "CREATE")
|
|
363
|
+
.map((action) => path.join(root, action.path)), appliedInit.actions
|
|
364
|
+
.filter((action) => action.kind !== "CREATE")
|
|
365
|
+
.map((action) => path.join(root, action.path)));
|
|
366
|
+
const appliedReasonCodes = appliedConnection.reasonCodes ?? ["CONNECTION_APPLY_CONFLICT"];
|
|
367
|
+
const appliedDiagnosticPaths = appliedConnection.diagnosticPaths ??
|
|
368
|
+
appliedConnection.artifacts.flatMap((artifact) => artifact.path === null ? [] : [artifact.path]);
|
|
369
|
+
const appliedNextActions = [
|
|
370
|
+
...(appliedReasonCodes.includes("CONNECTION_TARGET_PATH_UNSAFE")
|
|
371
|
+
? ["Replace unsafe client target paths with regular local paths, then rerun setup."]
|
|
372
|
+
: []),
|
|
373
|
+
...(appliedReasonCodes.includes("CONNECTION_CONTENT_CONFLICT")
|
|
374
|
+
? ["Inspect and resolve conflicting client artifact contents, then rerun setup."]
|
|
375
|
+
: []),
|
|
376
|
+
...(appliedReasonCodes.includes("CONNECTION_APPLY_CONFLICT")
|
|
377
|
+
? ["Inspect conflicting client artifacts, then rerun setup."]
|
|
378
|
+
: []),
|
|
379
|
+
];
|
|
380
|
+
return {
|
|
381
|
+
status: rollback.status === "COMPLETE" ? "CONFLICT" : "PARTIAL_FAILURE",
|
|
382
|
+
...base,
|
|
383
|
+
init: appliedInit,
|
|
384
|
+
connection: appliedConnection,
|
|
385
|
+
artifacts: artifacts.map((artifact) => ({
|
|
386
|
+
...artifact,
|
|
387
|
+
state: artifact.owner === "connection"
|
|
388
|
+
? "CONFLICT"
|
|
389
|
+
: rollbackArtifactState(root, artifact, rollback),
|
|
390
|
+
})),
|
|
391
|
+
rollback,
|
|
392
|
+
reasonCodes: appliedReasonCodes,
|
|
393
|
+
nextActions: appliedNextActions,
|
|
394
|
+
diagnosticPaths: appliedDiagnosticPaths,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
const appliedArtifacts = artifacts.map((artifact) => ({
|
|
398
|
+
...artifact,
|
|
399
|
+
state: artifact.state === "WOULD_CREATE" ? "CREATED" : "UNCHANGED",
|
|
400
|
+
}));
|
|
401
|
+
return {
|
|
402
|
+
status: appliedInit.status === "UNCHANGED" && appliedConnection.status === "UNCHANGED"
|
|
403
|
+
? "UNCHANGED"
|
|
404
|
+
: "CREATED",
|
|
405
|
+
...base,
|
|
406
|
+
init: appliedInit,
|
|
407
|
+
connection: appliedConnection,
|
|
408
|
+
artifacts: appliedArtifacts,
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/engine/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,yBAAyB,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAG1B,aAAa,EACb,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EA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C7D,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QACF,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB;YACvE,GAAG,IAAI;YACP,IAAI,EAAE,WAAW;YACjB,UAAU,EAAE,iBAAiB;YAC7B,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBACtC,GAAG,QAAQ;gBACX,KAAK,EACH,QAAQ,CAAC,KAAK,KAAK,YAAY;oBAC7B,CAAC,CAAE,UAAoB;oBACvB,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC;aACtD,CAAC,CAAC;YACH,QAAQ;YACR,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,eAAe,EAAE,sBAAsB;SACxC,CAAC;IACJ,CAAC;IACD,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpD,GAAG,QAAQ;QACX,KAAK,EAAE,QAAQ,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAE,SAAmB,CAAC,CAAC,CAAE,WAAqB;KACzF,CAAC,CAAC,CAAC;IACJ,OAAO;QACL,MAAM,EACJ,WAAW,CAAC,MAAM,KAAK,WAAW,IAAI,iBAAiB,CAAC,MAAM,KAAK,WAAW;YAC5E,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,SAAS;QACf,GAAG,IAAI;QACP,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE,iBAAiB;QAC7B,SAAS,EAAE,gBAAgB;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -11,6 +11,38 @@ The JSON form is the existing repository initialization result. `WOULD_CREATE` m
|
|
|
11
11
|
configuration can be planned; it does not mean worlds, candidates, campaign evidence, or an MCP
|
|
12
12
|
client connection are ready. `BLOCKED` exits with code 3 and `CONFLICT` with code 4.
|
|
13
13
|
|
|
14
|
+
For a single onboarding preflight, compose static initialization and the client connection:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
assertledger setup . --client codex --dry-run --json
|
|
18
|
+
assertledger setup . --client codex --write --json
|
|
19
|
+
assertledger setup . --client claude-code --write --json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`setup` previews when neither `--dry-run` nor `--write` is supplied. It checks every managed init
|
|
23
|
+
and connection target before writing any of them. A blocked initialization or any conflict leaves
|
|
24
|
+
the full managed set unchanged during preflight. If a connection conflict appears after init,
|
|
25
|
+
rollback removes only files created by this invocation whose bytes still match the plan. A changed
|
|
26
|
+
or regenerated file is preserved and yields `PARTIAL_FAILURE`, with the unresolved paths in JSON.
|
|
27
|
+
Exit codes are 3 for blocked readiness, 4 for a fully rolled-back conflict, 5 for partial failure or
|
|
28
|
+
unexpected I/O, and 64 for invalid CLI usage.
|
|
29
|
+
|
|
30
|
+
`setup --write` has no cross-process filesystem lock and requires a stable trusted repository tree.
|
|
31
|
+
A concurrent edit can be overwritten while an existing lock file is regenerated, or removed if it
|
|
32
|
+
replaces a managed file after the rollback byte check but before unlink. Stop concurrent writers
|
|
33
|
+
before setup; this stability requirement is a reported limitation, not a concurrency guarantee.
|
|
34
|
+
|
|
35
|
+
To confirm the installed engine can run its packaged example, execute:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
assertledger demo --allow-unsafe-execution --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The authorization applies only to a copy of the shipped fixture in a disposable temporary
|
|
42
|
+
directory. The result is explicitly scoped to `SHIPPED_FIXTURE_ONLY`; it is not evidence about the
|
|
43
|
+
user repository and does not change that repository. Its `status` preserves the exact decision:
|
|
44
|
+
`VERIFIED`, `REJECTED`, `INCONCLUSIVE`, or `ENGINE_ERROR`. Exit codes match `verify`: 0, 2, 3, or 5.
|
|
45
|
+
|
|
14
46
|
After installing and building AssertLedger, generate a project-local Codex MCP descriptor:
|
|
15
47
|
|
|
16
48
|
```text
|
package/docs/reference.md
CHANGED
|
@@ -14,6 +14,9 @@ For a first run, use `assertledger doctor .` and the [Git qualification guide](g
|
|
|
14
14
|
```sh
|
|
15
15
|
assertledger init . --dry-run --json
|
|
16
16
|
assertledger init . --json
|
|
17
|
+
assertledger setup . --client codex --dry-run --json
|
|
18
|
+
assertledger setup . --client codex --write --json
|
|
19
|
+
assertledger demo --allow-unsafe-execution --json
|
|
17
20
|
assertledger audit . --json
|
|
18
21
|
assertledger analyze . --json
|
|
19
22
|
assertledger schema verification-request --json
|
package/docs/repository-init.md
CHANGED
|
@@ -11,6 +11,20 @@ assertledger init . --json
|
|
|
11
11
|
assertledger audit . --json
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
To initialize and install a project-local read-only agent connection through one preflight, use:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
assertledger setup . --client codex --dry-run --json
|
|
18
|
+
assertledger setup . --client codex --write --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`setup` previews by default. It composes the existing `init` and `connect` checks and refuses the
|
|
22
|
+
whole operation before its first managed-file write if either side is blocked or conflicting. Use
|
|
23
|
+
`--client claude-code` for Claude Code. It does not authorize execution, reload a client, or prove
|
|
24
|
+
repository behavior. If a new connection conflict appears after init, rollback removes only regular
|
|
25
|
+
init files created by this setup call whose bytes still equal the plan. A regenerated or changed
|
|
26
|
+
file is preserved and reported under `PARTIAL_FAILURE` with exit code 5.
|
|
27
|
+
|
|
14
28
|
The dry run emits the exact canonical bytes and SHA-256 digests that a subsequent write plans to
|
|
15
29
|
use. Writes use a same-directory temporary file followed by an atomic rename. A second run returns
|
|
16
30
|
`UNCHANGED` without rewriting matching files. A missing lock or a stale, structurally valid lock
|