@intentius/chant 0.124.24 → 0.124.25
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/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +21 -7
- package/dist/cli/mcp/workspace-tools.d.ts +3 -3
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +27 -4
- package/dist/effect-receipt.d.ts +13 -0
- package/dist/effect-receipt.d.ts.map +1 -1
- package/dist/effect-receipt.js +19 -0
- package/dist/lexicon-module.d.ts +7 -1
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +7 -2
- package/dist/lifecycle/receipt-plan.d.ts.map +1 -1
- package/dist/lifecycle/receipt-plan.js +4 -2
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +64 -5
- package/dist/op/receipt-store.d.ts +5 -0
- package/dist/op/receipt-store.d.ts.map +1 -1
- package/dist/op/receipt-store.js +4 -3
- package/dist/op/step-output-ref.d.ts +26 -18
- package/dist/op/step-output-ref.d.ts.map +1 -1
- package/dist/op/step-output-ref.js +86 -63
- package/dist/wave-runtime.mjs +213 -213
- package/dist/workspace/agent-cli.d.ts.map +1 -1
- package/dist/workspace/agent-cli.js +3 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/dist/workspace/conformance/writer.js +1 -1
- package/dist/workspace/decide.d.ts +51 -9
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/decide.js +125 -14
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +20 -11
- package/dist/workspace/point-answer.schema.json +16 -1
- package/dist/workspace/points-cli.d.ts +5 -3
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/points-cli.js +16 -7
- package/dist/workspace/points-write.schema.json +39 -4
- package/dist/workspace/points.schema.json +42 -3
- package/dist/workspace/reason-codes.d.ts +2 -1
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +2 -1
- package/dist/workspace/records-cli.d.ts +12 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +27 -7
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records-write.js +2 -3
- package/dist/workspace/records.d.ts +10 -4
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +16 -3
- package/dist/workspace/records.schema.json +2 -1
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -1
- package/dist/workspace/trust/verify-cli.js +2 -1
- package/dist/workspace/trust/verify.d.ts +22 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/trust/verify.js +94 -14
- package/dist/workspace/write-scope.d.ts +3 -1
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/dist/workspace/write-scope.js +11 -4
- package/package.json +1 -1
- package/src/cli/compiled-cli.e2e.test.ts +45 -1
- package/src/cli/main.test.ts +10 -0
- package/src/cli/main.ts +21 -7
- package/src/cli/mcp/workspace-tools.e2e.test.ts +1 -1
- package/src/cli/mcp/workspace-tools.ts +27 -4
- package/src/effect-receipt.ts +22 -0
- package/src/lexicon-module.ts +9 -2
- package/src/lifecycle/receipt-plan.test.ts +9 -0
- package/src/lifecycle/receipt-plan.ts +4 -1
- package/src/op/effect-step.test.ts +95 -1
- package/src/op/local-executor.test.ts +65 -0
- package/src/op/local-executor.ts +68 -5
- package/src/op/receipt-store.ts +13 -3
- package/src/op/step-output-ref.test.ts +68 -24
- package/src/op/step-output-ref.ts +85 -65
- package/src/workspace/agent-cli.ts +2 -0
- package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/src/workspace/conformance/writer.ts +1 -1
- package/src/workspace/decide.test.ts +87 -3
- package/src/workspace/decide.ts +142 -17
- package/src/workspace/lineage-upgrade.test.ts +21 -0
- package/src/workspace/lineage-upgrade.ts +19 -11
- package/src/workspace/point-answer.schema.json +16 -1
- package/src/workspace/points-cli.ts +16 -8
- package/src/workspace/points-write.schema.json +39 -4
- package/src/workspace/points.schema.json +42 -3
- package/src/workspace/reason-codes.ts +2 -1
- package/src/workspace/record-assets.test.ts +14 -0
- package/src/workspace/records-cli.ts +28 -7
- package/src/workspace/records-write-commands.e2e.test.ts +32 -0
- package/src/workspace/records-write.ts +2 -3
- package/src/workspace/records.schema.json +2 -1
- package/src/workspace/records.ts +17 -4
- package/src/workspace/trust/trust.test.ts +105 -0
- package/src/workspace/trust/verify-cli.ts +2 -1
- package/src/workspace/trust/verify.ts +106 -13
- package/src/workspace/write-scope.test.ts +18 -0
- package/src/workspace/write-scope.ts +16 -5
|
@@ -371,6 +371,24 @@ describe("chant workspace agent: what a session reloads from (#2548)", () => {
|
|
|
371
371
|
agent.expectValid(doc);
|
|
372
372
|
expect(code(doc)).toBe("agent-unknown");
|
|
373
373
|
});
|
|
374
|
+
|
|
375
|
+
test("a declaration that fails validation is declaration-invalid, with the problem, not declaration-missing (#3433)", async () => {
|
|
376
|
+
const broken = JSON.stringify({ name: "studio", schema: 1, members: [{ name: "app", dir: "app" }], agents: AGENTS });
|
|
377
|
+
for (const committed of [false, true]) {
|
|
378
|
+
const dir = repo({ "chant.workspace.json": broken, "app/server.mjs": "export {};\n" }, committed);
|
|
379
|
+
if (committed) git(dir, "branch", "-M", "main");
|
|
380
|
+
const doc = await agentSession({ cwd: dir, name: "app-agent" });
|
|
381
|
+
agent.expectValid(doc);
|
|
382
|
+
expect(code(doc), committed ? "committed on main" : "uncommitted").toBe("declaration-invalid");
|
|
383
|
+
expect("error" in doc ? doc.error.message : "").toMatch(/kind/);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
test("no declaration at all is still declaration-missing", async () => {
|
|
388
|
+
const doc = await agentSession({ cwd: repo({ "app/server.mjs": "export {};\n" }), name: "app-agent" });
|
|
389
|
+
agent.expectValid(doc);
|
|
390
|
+
expect(code(doc)).toBe("declaration-missing");
|
|
391
|
+
});
|
|
374
392
|
});
|
|
375
393
|
|
|
376
394
|
describe("principal classes a plugin defines (#3080)", () => {
|
|
@@ -352,18 +352,28 @@ export interface ScopeSource {
|
|
|
352
352
|
policy: TrustPolicy;
|
|
353
353
|
/** The principal classes: the core four and those the declaration's pins supply, path pins read where the declaration was (#3080). */
|
|
354
354
|
classes: ClassRegistry;
|
|
355
|
+
/** Why the working tree's declaration couldn't be read when `declaration` is null: declaration-missing, or declaration-invalid with the problem (#3433). */
|
|
356
|
+
failure?: WorkspaceReadError;
|
|
355
357
|
}
|
|
356
358
|
|
|
357
|
-
|
|
359
|
+
type ReadAt = { declaration: Declaration; rootOnDisk: string; root: string; tree: WorkspaceTree };
|
|
360
|
+
|
|
361
|
+
/** The declaration at `at` (the working tree without it), or the read error that says why there is none. */
|
|
362
|
+
function readOrFailure(cwd: string, at?: string): ReadAt | WorkspaceReadError {
|
|
358
363
|
try {
|
|
359
364
|
const located = locateWorkspace(cwd, at);
|
|
360
365
|
return { declaration: readDeclaration(located.tree), rootOnDisk: located.rootOnDisk, root: located.root, tree: located.tree };
|
|
361
366
|
} catch (err) {
|
|
362
|
-
if (err instanceof WorkspaceReadError) return
|
|
367
|
+
if (err instanceof WorkspaceReadError) return err;
|
|
363
368
|
throw err;
|
|
364
369
|
}
|
|
365
370
|
}
|
|
366
371
|
|
|
372
|
+
function readAt(cwd: string, at?: string): ReadAt | null {
|
|
373
|
+
const read = readOrFailure(cwd, at);
|
|
374
|
+
return read instanceof WorkspaceReadError ? null : read;
|
|
375
|
+
}
|
|
376
|
+
|
|
367
377
|
/**
|
|
368
378
|
* The scope for a write from `cwd`: the declaration and the trust policy at
|
|
369
379
|
* the base revision (`origin/HEAD`, `main` or `master`), so a write can't
|
|
@@ -375,7 +385,7 @@ export function scopeSource(cwd: string, at?: string): ScopeSource {
|
|
|
375
385
|
const top = gitRoot(cwd);
|
|
376
386
|
const base = top ? resolveBase(top, at) : null;
|
|
377
387
|
const policy = top && base ? policyAtBase(top, base) : emptyPolicy(null);
|
|
378
|
-
const withClasses = (read:
|
|
388
|
+
const withClasses = (read: ReadAt) => {
|
|
379
389
|
const { tree, ...rest } = read;
|
|
380
390
|
return { ...rest, classes: loadClassRegistry(read.declaration.pins, read.rootOnDisk, { tree }).registry };
|
|
381
391
|
};
|
|
@@ -383,8 +393,9 @@ export function scopeSource(cwd: string, at?: string): ScopeSource {
|
|
|
383
393
|
const atBase = readAt(cwd, base.commit);
|
|
384
394
|
if (atBase) return { ...withClasses(atBase), from: "base", policy };
|
|
385
395
|
}
|
|
386
|
-
const here =
|
|
387
|
-
|
|
396
|
+
const here = readOrFailure(cwd);
|
|
397
|
+
if (here instanceof WorkspaceReadError) return { declaration: null, from: null, rootOnDisk: null, root: null, policy, classes: coreClassRegistry(), failure: here };
|
|
398
|
+
return { ...withClasses(here), from: "working-tree", policy };
|
|
388
399
|
}
|
|
389
400
|
|
|
390
401
|
const toPosix = (p: string) => (sep === "/" ? p : p.split(sep).join("/"));
|