start-command 0.42.0 → 0.43.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/CHANGELOG.md +13 -0
- package/package.json +2 -2
- package/src/lib/formal-ai-client.js +8 -5
- package/src/lib/formal-ai-files.js +474 -61
- package/src/lib/formal-ai.js +170 -7
- package/src/lib/log-sanitizer.js +4 -0
- package/test/fixtures/formal-ai/receipts-258.json +27 -9
- package/test/fixtures/formal-ai/receipts-261.json +589 -0
- package/test/fixtures/formal-ai/replay.cjs +4 -1
- package/test/regression-258-files.js +27 -5
- package/test/regression-258.js +22 -9
- package/test/regression-261.js +856 -0
package/test/regression-258.js
CHANGED
|
@@ -30,6 +30,7 @@ const {
|
|
|
30
30
|
recognizeCapabilityGap,
|
|
31
31
|
} = require('../src/lib/formal-ai-client');
|
|
32
32
|
const { runFormalAiTask } = require('../src/lib/formal-ai');
|
|
33
|
+
const { readFrame } = require('../src/lib/formal-ai-files');
|
|
33
34
|
const { createFakeServer, edits } = require('./fixtures/formal-ai/replay.cjs');
|
|
34
35
|
const {
|
|
35
36
|
CLI,
|
|
@@ -273,11 +274,22 @@ describe('structured file tools against captured receipts (#258)', () => {
|
|
|
273
274
|
'reads, edits and reads back, preserving all other bytes',
|
|
274
275
|
async () => {
|
|
275
276
|
const result = await run(LITERAL_EDIT, { effects: 'workspace-write' });
|
|
277
|
+
// start verified the edit byte for byte, but Formal AI's final answer
|
|
278
|
+
// is a gap for the clause "Preserve all other content.": that is never
|
|
279
|
+
// reported as done (#261).
|
|
276
280
|
expect(result.outcome).toMatchObject({
|
|
277
|
-
status: '
|
|
278
|
-
exitCode:
|
|
279
|
-
message:
|
|
280
|
-
|
|
281
|
+
status: 'incomplete',
|
|
282
|
+
exitCode: EXIT.UNSUPPORTED,
|
|
283
|
+
message:
|
|
284
|
+
'Formal AI reported obligation_gap (no_artifact_in_clause) for the clause "Preserve all other content."; nothing was verified as done by Formal AI; changed snippet.mjs',
|
|
285
|
+
remainingObligations: [
|
|
286
|
+
'Formal AI did not confirm the requested change',
|
|
287
|
+
],
|
|
288
|
+
gapRecord: {
|
|
289
|
+
schema: 'obligation_gap',
|
|
290
|
+
reason: 'no_artifact_in_clause',
|
|
291
|
+
clause: 'Preserve all other content.',
|
|
292
|
+
},
|
|
281
293
|
});
|
|
282
294
|
expect(result.text).toBe(EDITED);
|
|
283
295
|
const [read, edit, check] = result.tools;
|
|
@@ -304,9 +316,9 @@ describe('structured file tools against captured receipts (#258)', () => {
|
|
|
304
316
|
command: 'sha256sum -- snippet.mjs',
|
|
305
317
|
exitCode: 0,
|
|
306
318
|
});
|
|
307
|
-
// Formal AI received the exact file text and the readback hash.
|
|
319
|
+
// Formal AI received the exact file text (framed) and the readback hash.
|
|
308
320
|
const toolMessages = result.sent[3].filter((m) => m.role === 'tool');
|
|
309
|
-
expect(toolMessages[0].content).toBe(ORIGINAL);
|
|
321
|
+
expect(toolMessages[0].content).toBe(readFrame(ORIGINAL));
|
|
310
322
|
expect(toolMessages[2].content).toContain(edit.sha256);
|
|
311
323
|
expect(result.evidence.effects).toMatchObject({
|
|
312
324
|
changed: ['snippet.mjs'],
|
|
@@ -398,7 +410,7 @@ describe('edit requests through the CLI (#258)', () => {
|
|
|
398
410
|
const result = cli(LITERAL_EDIT, {
|
|
399
411
|
START_FORMAL_AI_EFFECTS: 'workspace-write',
|
|
400
412
|
});
|
|
401
|
-
expect(result.status).toBe(
|
|
413
|
+
expect(result.status).toBe(EXIT.UNSUPPORTED);
|
|
402
414
|
expect(result.text).toBe(EDITED);
|
|
403
415
|
expect(result.stderr).toContain('[formal-ai] edit snippet.mjs');
|
|
404
416
|
expect(result.stderr).toContain(
|
|
@@ -411,8 +423,9 @@ describe('edit requests through the CLI (#258)', () => {
|
|
|
411
423
|
'write',
|
|
412
424
|
]);
|
|
413
425
|
expect(result.evidence.outcome).toMatchObject({
|
|
414
|
-
status: '
|
|
415
|
-
exitCode:
|
|
426
|
+
status: 'incomplete',
|
|
427
|
+
exitCode: EXIT.UNSUPPORTED,
|
|
428
|
+
gapRecord: { schema: 'obligation_gap' },
|
|
416
429
|
});
|
|
417
430
|
});
|
|
418
431
|
|