@lazyingart/agintiflow 0.20.244 → 0.20.246

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.244",
3
+ "version": "0.20.246",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
6
6
  "license": "Apache-2.0",
@@ -67,6 +67,7 @@
67
67
  "scripts/smoke-supervision-ledger.js",
68
68
  "scripts/smoke-integration-production-mount.js",
69
69
  "scripts/smoke-integration-production-runtime-bundle.js",
70
+ "scripts/smoke-integration-retained-idempotency-store.js",
70
71
  "scripts/smoke-integration-storage-authority.js",
71
72
  "scripts/smoke-integration-retained-durable-common.js",
72
73
  "scripts/smoke-integration-retained-file-lock.js",
@@ -205,6 +206,7 @@
205
206
  "smoke:supervision-ledger": "node scripts/smoke-supervision-ledger.js",
206
207
  "smoke:integration-production-mount": "node scripts/smoke-integration-production-mount.js",
207
208
  "smoke:integration-production-runtime-bundle": "node scripts/smoke-integration-production-runtime-bundle.js",
209
+ "smoke:integration-retained-idempotency-store": "node scripts/smoke-integration-retained-idempotency-store.js",
208
210
  "smoke:integration-storage-authority": "node scripts/smoke-integration-storage-authority.js",
209
211
  "smoke:integration-retained-durable-common": "node scripts/smoke-integration-retained-durable-common.js",
210
212
  "smoke:integration-retained-file-lock": "node scripts/smoke-integration-retained-file-lock.js",
@@ -221,7 +223,7 @@
221
223
  "storage:migrate": "node bin/aginti-cli.js storage migrate",
222
224
  "publish:env": "node scripts/npm-publish-from-env.js publish --access public",
223
225
  "publish:env:whoami": "node scripts/npm-publish-from-env.js whoami",
224
- "test": "npm run check && npm run smoke:integration-production-mount && npm run smoke:integration-production-runtime-bundle && npm run smoke:integration-storage-authority && npm run smoke:integration-retained-durable-common && npm run smoke:integration-retained-file-lock && npm run smoke:integration-retained-event-ledger && npm run smoke:integration-retained-event-ledger-bundle && npm run smoke:integration-retained-repository-kernel && npm run smoke:integration-retained-session-state-store && npm run smoke:integration-retained-native-session-repository-state && npm run smoke:integration-retained-native-execution-evidence && npm run smoke:integration-retained-runtime-repository-surface && npm run smoke:integration-retained-runtime-repository-phase-b && npm run smoke:integration-runtime-repository-contract && npm run smoke:integration-runtime-authority && npm run smoke:localllm-provider && npm run smoke:localllm-model-tiers && npm run smoke:localllm-code-routing && npm run smoke:local-failure-recovery && npm run smoke:localllm-auto-max && npm run smoke:local-resource-policy && npm run smoke:context-budget-recovery && npm run smoke:session-runtime && npm run smoke:runtime-core && npm run smoke:progressive-tools && npm run smoke:truthful-completion && npm run smoke:document-artifact-quality && npm run smoke:writing-specialist-routing && npm run eval:local-first-agent && npm run eval:provider-attribution && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:math-rendering && npm run smoke:web-ui && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:execution-policy && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:deep-research && npm run smoke:public-research && npm run smoke:safe-chat && npm run smoke:auth && npm run smoke:agentlink && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:mcp && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:supervision-ledger && npm run smoke:tmux-tools && npm run smoke:long-jobs && npm run smoke:run-stdin && npm run smoke:cli-chat && npm run smoke:inbox",
226
+ "test": "npm run check && npm run smoke:integration-production-mount && npm run smoke:integration-production-runtime-bundle && npm run smoke:integration-retained-idempotency-store && npm run smoke:integration-storage-authority && npm run smoke:integration-retained-durable-common && npm run smoke:integration-retained-file-lock && npm run smoke:integration-retained-event-ledger && npm run smoke:integration-retained-event-ledger-bundle && npm run smoke:integration-retained-repository-kernel && npm run smoke:integration-retained-session-state-store && npm run smoke:integration-retained-native-session-repository-state && npm run smoke:integration-retained-native-execution-evidence && npm run smoke:integration-retained-runtime-repository-surface && npm run smoke:integration-retained-runtime-repository-phase-b && npm run smoke:integration-runtime-repository-contract && npm run smoke:integration-runtime-authority && npm run smoke:localllm-provider && npm run smoke:localllm-model-tiers && npm run smoke:localllm-code-routing && npm run smoke:local-failure-recovery && npm run smoke:localllm-auto-max && npm run smoke:local-resource-policy && npm run smoke:context-budget-recovery && npm run smoke:session-runtime && npm run smoke:runtime-core && npm run smoke:progressive-tools && npm run smoke:truthful-completion && npm run smoke:document-artifact-quality && npm run smoke:writing-specialist-routing && npm run eval:local-first-agent && npm run eval:provider-attribution && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:math-rendering && npm run smoke:web-ui && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:execution-policy && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:deep-research && npm run smoke:public-research && npm run smoke:safe-chat && npm run smoke:auth && npm run smoke:agentlink && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:mcp && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:supervision-ledger && npm run smoke:tmux-tools && npm run smoke:long-jobs && npm run smoke:run-stdin && npm run smoke:cli-chat && npm run smoke:inbox",
225
227
  "pack:dry-run": "npm pack --dry-run",
226
228
  "smoke:capabilities": "node scripts/smoke-capabilities.js"
227
229
  },
@@ -164,10 +164,71 @@ const compactionState = {
164
164
  artifactPath: ".aginti/deep-research-reliability.json",
165
165
  queryCount: 10,
166
166
  sourceCount: 16,
167
+ answer: "RESEARCH-COMPACTION-SUMMARY",
167
168
  coverage: { requiredFirstPartyVerified: true },
168
169
  audit: { citationCoverage: 1 },
169
170
  }),
170
171
  },
172
+ {
173
+ role: "assistant",
174
+ content: "",
175
+ tool_calls: [
176
+ {
177
+ id: "evidence-chunk-one",
178
+ type: "function",
179
+ function: {
180
+ name: "read_file",
181
+ arguments: '{"path":"reports/reliability.md","startLine":1,"lineLimit":50}',
182
+ },
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ role: "tool",
188
+ tool_call_id: "evidence-chunk-one",
189
+ content: JSON.stringify({
190
+ ok: true,
191
+ toolName: "read_file",
192
+ path: "reports/reliability.md",
193
+ startLine: 1,
194
+ lineLimit: 50,
195
+ lineCount: 100,
196
+ bytes: 8000,
197
+ sha256: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
198
+ contentTruncated: false,
199
+ content: `EVIDENCE-CHUNK-ONE measured retry findings\n${"retry evidence ".repeat(220)}`,
200
+ }),
201
+ },
202
+ {
203
+ role: "assistant",
204
+ content: "",
205
+ tool_calls: [
206
+ {
207
+ id: "evidence-chunk-two",
208
+ type: "function",
209
+ function: {
210
+ name: "read_file",
211
+ arguments: '{"path":"reports/reliability.md","startLine":51,"lineLimit":50}',
212
+ },
213
+ },
214
+ ],
215
+ },
216
+ {
217
+ role: "tool",
218
+ tool_call_id: "evidence-chunk-two",
219
+ content: JSON.stringify({
220
+ ok: true,
221
+ toolName: "read_file",
222
+ path: "reports/reliability.md",
223
+ startLine: 51,
224
+ lineLimit: 50,
225
+ lineCount: 100,
226
+ bytes: 8000,
227
+ sha256: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
228
+ contentTruncated: false,
229
+ content: `EVIDENCE-CHUNK-TWO limitations and recommendations\n${"limitation evidence ".repeat(180)}`,
230
+ }),
231
+ },
171
232
  {
172
233
  role: "tool",
173
234
  content: JSON.stringify({
@@ -233,6 +294,11 @@ assert.ok(runtimeText.includes("scripts/xyq_cdp_browser.py"));
233
294
  assert.ok(retainedNativeDeepResearch, "native compaction lost the completed deep_research call");
234
295
  assert.ok(runtimeText.includes("reliability-evidence-v14"));
235
296
  assert.ok(runtimeText.includes('"version":14'));
297
+ assert.ok(runtimeText.includes("RESEARCH-COMPACTION-SUMMARY"));
298
+ assert.ok(runtimeText.includes("EVIDENCE-CHUNK-ONE"));
299
+ assert.ok(runtimeText.includes("EVIDENCE-CHUNK-TWO"));
300
+ assert.ok(runtimeText.includes("range=lines 1-50"));
301
+ assert.ok(runtimeText.includes("range=lines 51-100"));
236
302
  assert.ok(!runtimeText.includes("OLD-COMPACTION-MUST-NOT-RECUR"));
237
303
  assert.match(runtimeText, /Do not reread a listed source solely because compaction occurred/);
238
304
  assert.match(runtimeText, /never restart a full-file read loop after compaction/);
@@ -248,9 +314,92 @@ const deepSeekRuntimeText = deepSeekRuntimeMessages.map((message) => message.con
248
314
  assert.ok(deepSeekRuntimeText.includes("Tool: deep_research"));
249
315
  assert.ok(deepSeekRuntimeText.includes("reliability-evidence-v14"));
250
316
  assert.ok(deepSeekRuntimeText.includes('"version":14'));
317
+ assert.ok(deepSeekRuntimeText.includes("RESEARCH-COMPACTION-SUMMARY"));
318
+ assert.ok(deepSeekRuntimeText.includes("EVIDENCE-CHUNK-ONE"));
319
+ assert.ok(deepSeekRuntimeText.includes("EVIDENCE-CHUNK-TWO"));
251
320
  assert.ok(
252
321
  estimateMessageTokens(deepSeekRuntimeMessages) <= 12288,
253
322
  "DeepSeek runtime compaction exceeded the bounded retry target"
254
323
  );
255
324
 
325
+ function noisyFullReadPair(index, generation) {
326
+ const id = `validator-${generation}-${index}`;
327
+ const file = `tmp/validator-${generation}-${index}.py`;
328
+ return [
329
+ {
330
+ role: "assistant",
331
+ content: "",
332
+ reasoning_content: "Inspect the latest validator.",
333
+ tool_calls: [
334
+ {
335
+ id,
336
+ type: "function",
337
+ function: { name: "read_file", arguments: JSON.stringify({ path: file }) },
338
+ },
339
+ ],
340
+ },
341
+ {
342
+ role: "tool",
343
+ tool_call_id: id,
344
+ content: JSON.stringify({
345
+ ok: true,
346
+ toolName: "read_file",
347
+ path: file,
348
+ bytes: 4096,
349
+ lineCount: 120,
350
+ sha256: `${generation}${String(index).padStart(2, "0")}`.repeat(24).slice(0, 64),
351
+ contentTruncated: false,
352
+ content: `VALIDATOR-${generation}-${index}\n${"broad validator content ".repeat(150)}`,
353
+ }),
354
+ },
355
+ ];
356
+ }
357
+
358
+ const twiceCompactedState = {
359
+ ...compactionState,
360
+ messages: [
361
+ ...deepSeekRuntimeMessages,
362
+ ...Array.from({ length: 14 }, (_, index) => noisyFullReadPair(index + 1, 2)).flat(),
363
+ ],
364
+ };
365
+ const twiceCompacted = buildContextBudgetCompactionMessages(
366
+ twiceCompactedState,
367
+ { ...config, provider: "deepseek", model: "deepseek-chat" },
368
+ { title: "", url: "" },
369
+ 8,
370
+ { reason: "second DeepSeek compaction" }
371
+ );
372
+ const twiceCompactedText = twiceCompacted.map((message) => message.content || "").join("\n");
373
+ assert.ok(twiceCompactedText.includes("reliability-evidence-v14"));
374
+ assert.ok(twiceCompactedText.includes("EVIDENCE-CHUNK-ONE"));
375
+ assert.ok(twiceCompactedText.includes("EVIDENCE-CHUNK-TWO"));
376
+ assert.equal(
377
+ (twiceCompactedText.match(/Tool: deep_research/g) || []).length,
378
+ 1,
379
+ "second DeepSeek compaction duplicated the completed research record"
380
+ );
381
+
382
+ const thriceCompactedState = {
383
+ ...compactionState,
384
+ messages: [
385
+ ...twiceCompacted,
386
+ ...Array.from({ length: 14 }, (_, index) => noisyFullReadPair(index + 1, 3)).flat(),
387
+ ],
388
+ };
389
+ const thriceCompacted = buildContextBudgetCompactionMessages(
390
+ thriceCompactedState,
391
+ { ...config, provider: "deepseek", model: "deepseek-chat" },
392
+ { title: "", url: "" },
393
+ 12,
394
+ { reason: "third DeepSeek compaction" }
395
+ );
396
+ const thriceCompactedText = thriceCompacted.map((message) => message.content || "").join("\n");
397
+ assert.ok(thriceCompactedText.includes("reliability-evidence-v14"));
398
+ assert.ok(thriceCompactedText.includes("EVIDENCE-CHUNK-ONE"));
399
+ assert.ok(thriceCompactedText.includes("EVIDENCE-CHUNK-TWO"));
400
+ assert.ok(
401
+ estimateMessageTokens(thriceCompacted) <= 12288,
402
+ "cumulative DeepSeek compaction exceeded the bounded retry target"
403
+ );
404
+
256
405
  console.log("context budget recovery smoke passed");
@@ -1105,7 +1105,7 @@ async function main() {
1105
1105
  assert.equal(summary.runtimeBundle.firstBlocker?.component, "idempotencyStore");
1106
1106
  assert.equal(
1107
1107
  summary.runtimeBundle.firstBlocker?.code,
1108
- "INTEGRATION_DESCRIPTOR_BOUND_IDEMPOTENCY_UNAVAILABLE"
1108
+ "INTEGRATION_IDEMPOTENCY_TRUSTED_RECOVERY_RECEIPT_AUTHORITY_UNAVAILABLE"
1109
1109
  );
1110
1110
  } else {
1111
1111
  assert.equal(summary.runtimeBundle.firstBlocker?.component, "storageAuthority");
@@ -12,6 +12,9 @@ import {
12
12
  openIntegrationProductionRuntimeBundle,
13
13
  preflightIntegrationProductionRuntimeBundle,
14
14
  } from "../src/integration-production-runtime-bundle.js";
15
+ import {
16
+ INTEGRATION_RETAINED_IDEMPOTENCY_SNAPSHOT_FILE,
17
+ } from "../src/integration-retained-idempotency-store.js";
15
18
  import { contractDigest } from "../src/integration-policy.js";
16
19
 
17
20
  const UID = process.getuid();
@@ -73,6 +76,7 @@ async function provisionRuntimeRoot(stateRoot, { omitEventLock = false } = {}) {
73
76
  await ensureLockFile(paths.repositoryLock);
74
77
  await ensureLockFile(paths.sessionLock);
75
78
  if (!omitEventLock) await ensureLockFile(paths.eventLedgerLock);
79
+ await ensureLockFile(paths.idempotencyLock);
76
80
  return paths;
77
81
  }
78
82
 
@@ -215,6 +219,9 @@ async function run() {
215
219
  path.join(os.tmpdir(), "aginti-production-runtime-lock-replacement-")
216
220
  );
217
221
  const failedRoot = await fs.mkdtemp(path.join(os.tmpdir(), "aginti-production-runtime-failed-"));
222
+ const idempotencyCorruptionRoot = await fs.mkdtemp(
223
+ path.join(os.tmpdir(), "aginti-production-runtime-idempotency-corrupt-")
224
+ );
218
225
  try {
219
226
  const paths = await provisionRuntimeRoot(stateRoot);
220
227
  assert.equal(paths.repository, path.join(stateRoot, "runtime-authority", "repository"));
@@ -230,7 +237,7 @@ async function run() {
230
237
  assert.equal(check.firstBlocker.component, "idempotencyStore");
231
238
  assert.equal(
232
239
  check.firstBlocker.code,
233
- "INTEGRATION_DESCRIPTOR_BOUND_IDEMPOTENCY_UNAVAILABLE"
240
+ "INTEGRATION_IDEMPOTENCY_TRUSTED_RECOVERY_RECEIPT_AUTHORITY_UNAVAILABLE"
234
241
  );
235
242
  assert.equal(check.components.storageAuthority.descriptorBound, true);
236
243
  assert.equal(check.components.repository.descriptorBound, true);
@@ -240,7 +247,14 @@ async function run() {
240
247
  assert.equal(check.components.eventLedger.runtimeAppendView, true);
241
248
  assert.equal(check.components.eventLedger.sessionReadView, true);
242
249
  assert.equal(check.components.idempotencyStore.namespaceDescriptorBound, true);
250
+ assert.equal(check.components.idempotencyStore.descriptorBound, true);
243
251
  assert.equal(check.components.idempotencyStore.transactionalStore, false);
252
+ assert.equal(check.components.idempotencyStore.recoveryAuthorityBound, false);
253
+ assert.equal(check.components.idempotencyStore.trustedRecoveryReceiptAuthorityBound, false);
254
+ assert.equal(check.components.idempotencyStore.publicMutationResponseByteEnvelopeCovered, true);
255
+ assert.equal(check.components.idempotencyStore.boundedTransactionalSubstrate, true);
256
+ assert.equal(check.components.idempotencyStore.integrationApiCompatibleWhenRecoveryBound, false);
257
+ assert.notEqual(check.components.idempotencyStore.proofDigest, "0".repeat(64));
244
258
  assert.equal(check.components.nativeExecutor.lexicalProofPresent, true);
245
259
  assert.equal(check.components.nativeExecutor.retainedSessionStateBound, false);
246
260
  assert.equal(check.components.nativeExecutor.artifactEvents, false);
@@ -266,7 +280,7 @@ async function run() {
266
280
  assert.equal(bundle.attestation.capabilityEnabled, false);
267
281
  assert.equal(bundle.attestation.httpServingEnabled, false);
268
282
  assert.equal(bundle.attestation.runtimeActivated, false);
269
- assert.equal(bundle.attestation.idempotencyProofDigest, "0".repeat(64));
283
+ assert.notEqual(bundle.attestation.idempotencyProofDigest, "0".repeat(64));
270
284
  assert.equal(bundle.attestation.blockers[0].component, "idempotencyStore");
271
285
  assert.equal(bundle.attestation.limitations, INTEGRATION_PRODUCTION_RUNTIME_BUNDLE_LIMITATIONS);
272
286
  assert.equal("start" in bundle, false);
@@ -366,6 +380,28 @@ async function run() {
366
380
  assert.equal((await recoveredFromFactoryFailure.health()).healthy, true);
367
381
  await recoveredFromFactoryFailure.close();
368
382
 
383
+ const corruptIdempotencyPaths = await provisionRuntimeRoot(idempotencyCorruptionRoot);
384
+ await fs.writeFile(
385
+ path.join(
386
+ corruptIdempotencyPaths.idempotency,
387
+ INTEGRATION_RETAINED_IDEMPOTENCY_SNAPSHOT_FILE
388
+ ),
389
+ "{}\n",
390
+ { mode: 0o600 }
391
+ );
392
+ await expectCode(
393
+ () => openIntegrationProductionRuntimeBundle({
394
+ stateRoot: idempotencyCorruptionRoot,
395
+ }),
396
+ "IDEMPOTENCY_STORE_CORRUPT"
397
+ );
398
+ const corruptIdempotencyCheck = await checkIntegrationProductionRuntimeBundle({
399
+ stateRoot: idempotencyCorruptionRoot,
400
+ });
401
+ assert.equal(corruptIdempotencyCheck.healthy, false);
402
+ assert.equal(corruptIdempotencyCheck.firstBlocker.component, "idempotencyStore");
403
+ assert.equal(corruptIdempotencyCheck.firstBlocker.code, "IDEMPOTENCY_STORE_CORRUPT");
404
+
369
405
  const [cliSource, serverSource, bundleSource] = await Promise.all([
370
406
  fs.readFile(new URL("../src/integration-cli.js", import.meta.url), "utf8"),
371
407
  fs.readFile(new URL("../src/integration-server.js", import.meta.url), "utf8"),
@@ -384,6 +420,7 @@ async function run() {
384
420
  await fs.rm(lockModeRoot, { recursive: true, force: true });
385
421
  await fs.rm(lockReplacementRoot, { recursive: true, force: true });
386
422
  await fs.rm(failedRoot, { recursive: true, force: true });
423
+ await fs.rm(idempotencyCorruptionRoot, { recursive: true, force: true });
387
424
  }
388
425
 
389
426
  process.stdout.write("integration production runtime bundle smoke: ok\n");