@lazyingart/agintiflow 0.20.302 → 0.20.304

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.
@@ -650,3 +650,28 @@ append-only repairs when replacement is required, and caps repair schemas so a
650
650
  small local model receives only the actionable tool surface. Focused coding,
651
651
  truthful-completion, writing-routing, progressive-tool, document-quality, and
652
652
  dynamic-budget suites pass. These fixes are prepared for AgInTiFlow `0.20.302`.
653
+
654
+ ### Host-scoped deliverables without false source mutation
655
+
656
+ LabCanvas research run `browser-agent-stale-ui-research-085` showed that
657
+ DeepSeek had already completed current web research and written valid task
658
+ artifacts, but AgInTiFlow rejected `finish` because every file-producing task
659
+ inherited a fresh project-source mutation requirement. The artifact directory
660
+ was intentionally excluded from project mutation accounting, so the runtime
661
+ could never satisfy its own gate and eventually reached the step limit.
662
+
663
+ The runtime now distinguishes a requested deliverable inside the host-owned
664
+ artifact root from a requested source-code change. Reports, notes, PDFs,
665
+ figures, CAD, presentations, and similar scoped outputs may complete from their
666
+ verified artifact evidence without fabricating a repository edit. A request to
667
+ fix, implement, or modify project source still requires a fresh project
668
+ mutation, even when it also asks for a sidecar report.
669
+
670
+ Fresh LabCanvas retest `browser-agent-stale-ui-research-086` used the same
671
+ imperfect prompt and a new persistent AgInTi session. It recovered a malformed
672
+ DeepSeek tool call, ran web research, wrote and registered two substantial
673
+ Markdown artifacts with current primary-source citations, separated
674
+ demonstrated evidence from inferred recommendations, and finished normally.
675
+ The retained trace contains no completion-evidence rejection or forced
676
+ source-mutation loop. Focused completion, evidence, progressive-tool, runtime,
677
+ and dynamic-budget suites plus the full npm suite pass for `0.20.303`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.302",
3
+ "version": "0.20.304",
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",
@@ -230,7 +230,7 @@
230
230
  "publish:env": "node scripts/npm-publish-from-env.js publish --access public",
231
231
  "publish:env:whoami": "node scripts/npm-publish-from-env.js whoami",
232
232
  "pretest": "npm run smoke:planning-timeout-recovery",
233
- "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 smoke:workspace-secret-false-positive && npm run smoke:provider-handoff && 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",
233
+ "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:scoped-artifact-research && npm run smoke:truthful-completion && npm run smoke:document-artifact-quality && npm run smoke:writing-specialist-routing && npm run smoke:workspace-secret-false-positive && npm run smoke:provider-handoff && 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",
234
234
  "pack:dry-run": "npm pack --dry-run",
235
235
  "smoke:capabilities": "node scripts/smoke-capabilities.js"
236
236
  },
@@ -205,6 +205,20 @@ const readOnlyReviewContract = deriveScsTaskContract({
205
205
  taskProfile: "review",
206
206
  });
207
207
 
208
+ const readOnlyOperatorAuditRequest =
209
+ "This is a short imperfect operator audit. Check these three things without changing source files or sending messages: 1) run curl -fsS http://127.0.0.1:8008/readyz and state whether LocalLLM is ready; 2) read configs/model-policy.json and name the configured AgInTi provider order; 3) run git status --short and say only whether tracked source changes exist, without treating ignored runtime output as source. Cover all three numbered items in one concise answer and write the normal task result.";
210
+ const readOnlyOperatorAuditContract = deriveScsTaskContract({
211
+ goal: [
212
+ readOnlyOperatorAuditRequest,
213
+ `AGINTI_EVIDENCE_SCOPE_JSON: ${JSON.stringify({
214
+ mode: "task",
215
+ request: readOnlyOperatorAuditRequest,
216
+ artifact_root: "/tmp/aginti-read-only-audit",
217
+ })}`,
218
+ ].join("\n\n"),
219
+ taskProfile: "auto",
220
+ });
221
+
208
222
  const explicitReviewRepairContract = deriveScsTaskContract({
209
223
  goal: [
210
224
  "Review focus: inspect changed files and fix confirmed defects.",
@@ -374,6 +388,34 @@ assert.equal(
374
388
  true,
375
389
  "an explicit review-and-fix focus lost its positive mutation request"
376
390
  );
391
+ assert.equal(
392
+ readOnlyOperatorAuditContract.requiresWorkspaceMutation,
393
+ false,
394
+ "a host-managed task response was mistaken for a workspace mutation"
395
+ );
396
+ assert.equal(
397
+ readOnlyOperatorAuditContract.requiresFileMutation,
398
+ false,
399
+ "an observational source-status mention was mistaken for a source mutation"
400
+ );
401
+ assert(
402
+ readOnlyOperatorAuditContract.requiredEvidence.some(
403
+ (item) => item.category === "command"
404
+ ) &&
405
+ !readOnlyOperatorAuditContract.requiredEvidence.some(
406
+ (item) => ["artifact", "file"].includes(item.category)
407
+ ),
408
+ "the phrase 'cover all items' invented cover-art or file evidence"
409
+ );
410
+ assert(
411
+ readOnlyOperatorAuditContract.forbiddenActions.some((item) =>
412
+ /changing source files or sending messages/i.test(item)
413
+ ) &&
414
+ !readOnlyOperatorAuditContract.forbiddenActions.some((item) =>
415
+ /run curl/i.test(item)
416
+ ),
417
+ "a colon after a without-clause swallowed the following command"
418
+ );
377
419
  assert(
378
420
  pageSafeReportContract.requiredEvidence.some((item) => item.category === "file"),
379
421
  "a scoped existing-report edit did not require file evidence"
@@ -138,7 +138,9 @@ try {
138
138
  if ((await page.locator('[data-workspace-file="notes/workspace-ui.md"]').getAttribute("draggable")) !== "true") {
139
139
  throw new Error("workspace file rows are not draggable");
140
140
  }
141
- await page.locator("#workspace-automap").click();
141
+ const automapButton = page.locator("#workspace-automap");
142
+ await automapButton.scrollIntoViewIfNeeded();
143
+ await automapButton.click();
142
144
  await page.locator('[data-workspace-lane="docs"]').click();
143
145
  await page.waitForSelector('[data-workspace-file="notes/workspace-ui.md"]', { timeout: 10000 });
144
146
  await page.locator('[data-workspace-file="notes/workspace-ui.md"]').click();
@@ -4289,6 +4289,8 @@ export function resetSameTaskExecutionContract(state = {}, revision = 0) {
4289
4289
  startedMutationRevision,
4290
4290
  requiresWorkspaceMutation: currentTurnContract.requiresWorkspaceMutation === true,
4291
4291
  requiresFileMutation: currentTurnContract.requiresFileMutation === true,
4292
+ scopedArtifactDeliverable:
4293
+ currentTurnContract.scopedArtifactDeliverable === true,
4292
4294
  requiresSourceGrounding: Boolean(
4293
4295
  currentTurnContract.requiresSourceGrounding === true ||
4294
4296
  (
@@ -14666,8 +14668,12 @@ export function completionTaskContract(config = {}, state = {}) {
14666
14668
  0
14667
14669
  )
14668
14670
  );
14671
+ const scopedArtifactDeliverable = currentContract
14672
+ ? currentContract.scopedArtifactDeliverable === true
14673
+ : activeExecutionContract.scopedArtifactDeliverable === true;
14669
14674
  const requiresFreshMutation = Boolean(
14670
- currentContract?.requiresFileMutation || activeExecutionContract.requiresFileMutation
14675
+ (currentContract?.requiresFileMutation || activeExecutionContract.requiresFileMutation) &&
14676
+ !scopedArtifactDeliverable
14671
14677
  );
14672
14678
  const minimumMutationRevision = requiresFreshMutation
14673
14679
  ? startedMutationRevision + 1
@@ -14720,6 +14726,7 @@ export function completionTaskContract(config = {}, state = {}) {
14720
14726
  requiresFileMutation: authoritativeReadOnlyContinuation
14721
14727
  ? false
14722
14728
  : Boolean(contract.requiresFileMutation || currentContract?.requiresFileMutation),
14729
+ scopedArtifactDeliverable,
14723
14730
  requiresSourceGrounding: authoritativeReadOnlyContinuation
14724
14731
  ? false
14725
14732
  : Boolean(contract.requiresSourceGrounding || currentContract?.requiresSourceGrounding),
@@ -1275,8 +1275,19 @@ function goalRequestsExplicitTestMutation(text = "") {
1275
1275
  );
1276
1276
  }
1277
1277
 
1278
+ function stripHostManagedResponseNarration(goal = "") {
1279
+ return String(goal || "").replace(
1280
+ /\b(?:and\s+)?(?:write|return|provide)\s+(?:(?:a|the)\s+)?(?:(?:concise|final|normal|structured)\s+)?(?:(?:agent|task)\s+)?(?:answer|response|result)\b(?!\s+(?:as|at|file|in|into|json|markdown|pdf|text|to|under)\b)/gi,
1281
+ ""
1282
+ );
1283
+ }
1284
+
1278
1285
  function goalRequestsWorkspaceMutation(goal = "", taskProfile = "") {
1279
- const text = normalizedText(stripCompletedWorkNarration(stripForbiddenLanguage(goal)));
1286
+ const text = normalizedText(
1287
+ stripHostManagedResponseNarration(
1288
+ stripCompletedWorkNarration(stripForbiddenLanguage(goal))
1289
+ )
1290
+ );
1280
1291
  const explicitAddMutation =
1281
1292
  goalRequestsExplicitTestMutation(text) ||
1282
1293
  /\badd\b(?:\s+(?:a|an|the|new|additional|specific))*\s+(?:code|documents?|files?|notes?|readme|scripts?|source|workspace)\b/.test(
@@ -1316,6 +1327,20 @@ function goalRequestsFileMutation(goal = "", taskProfile = "") {
1316
1327
  );
1317
1328
  }
1318
1329
 
1330
+ function goalRequestsScopedArtifactDeliverable(goal = "") {
1331
+ const text = normalizedText(stripCompletedWorkNarration(stripForbiddenLanguage(goal)));
1332
+ const deliverable =
1333
+ /\b(?:build|compile|create|draft|export|generate|make|prepare|produce|render|save|write)\b[^.\n;]{0,180}\b(?:artifact|brief|cad|diagram|document|figure|image|markdown|memo|model|note|paper|pcb|pdf|presentation|prompt|report|research note|slide deck|slides?|spreadsheet|story|summary|transcript|video)\b/.test(text) ||
1334
+ /\b(?:artifact|brief|cad|diagram|document|figure|image|markdown|memo|model|note|paper|pcb|pdf|presentation|prompt|report|research note|slide deck|slides?|spreadsheet|story|summary|transcript|video)\b[^.\n;]{0,120}\b(?:build|compile|create|draft|export|generate|make|prepare|produce|render|save|write)\b/.test(text) ||
1335
+ /(?:创建|生成|保存|编写|撰写|制作|导出|准备)[^。;\n]{0,100}(?:报告|笔记|摘要|文档|论文|图表|图片|模型|演示文稿|幻灯片|表格|故事|提示词|转录|视频)/.test(text);
1336
+ if (!deliverable) return false;
1337
+ const projectSourceMutation =
1338
+ /\b(?:change|debug|edit|fix|implement|improve|modify|patch|refactor|repair|replace|rewrite|update)\b[^.\n;]{0,140}\b(?:app|application|code|codebase|implementation|library|package|repo|repository|runtime|source|src\/)\b/.test(text) ||
1339
+ /\b(?:app|application|code|codebase|implementation|library|package|repo|repository|runtime|source|src\/)\b[^.\n;]{0,140}\b(?:change|debug|edit|fix|implement|improve|modify|patch|refactor|repair|replace|rewrite|update)\b/.test(text) ||
1340
+ /(?:修改|修复|实现|改进|重构|调试|替换|更新)[^。;\n]{0,100}(?:代码|代码库|实现|运行时|应用|仓库|源码)/.test(text);
1341
+ return !projectSourceMutation;
1342
+ }
1343
+
1319
1344
  function goalRequestsTestExecution(goal = "") {
1320
1345
  const text = normalizedText(stripCompletedWorkNarration(stripForbiddenLanguage(goal)));
1321
1346
  return (
@@ -1434,7 +1459,12 @@ function inferRequirementCategories(goal = "", taskProfile = "", acceptanceCrite
1434
1459
  if (goalRequestsTestExecution(positiveGoal)) {
1435
1460
  categories.add("test");
1436
1461
  }
1437
- if (textHas(mandatoryEvidenceText, /\b(artifact|canvas|pdf|image|video|screenshot|cover|plot|chart|figure|docx|archive|copy to|export|generated|generate|draft)\b/) || /输出|产物|图片|视频|截图|封面|生成/.test(mandatoryEvidenceText)) {
1462
+ if (
1463
+ textHas(
1464
+ mandatoryEvidenceText,
1465
+ /\b(artifact|canvas|pdf|image|video|screenshot|plot|chart|figure|docx|archive|copy to|export|generated|generate|draft)\b|\b(?:album|book|paper|report|video)\s+cover\b|\bcover\s+(?:art|design|image)\b/
1466
+ ) || /输出|产物|图片|视频|截图|封面|生成/.test(mandatoryEvidenceText)
1467
+ ) {
1438
1468
  categories.add("artifact");
1439
1469
  }
1440
1470
  if (
@@ -1499,14 +1529,14 @@ function inferForbiddenActions(goal = "") {
1499
1529
  const text = String(goal || "");
1500
1530
  const forbidden = [];
1501
1531
  const isAction = (value = "") =>
1502
- /\b(use|open|click|browse|browser|upload|attach|submit|publish|deploy|run|execute|install|delete|remove|commit|push|call|api|alter|change|edit|fix|modify|patch|repair|rewrite|touch|write)\b/i.test(
1532
+ /\b(use|open|click|browse|browser|upload|attach|submit|publish|deploy|run|execute|install|delete|remove|commit|push|call|api|alter|chang(?:e|ing)|edit(?:ing)?|fix(?:ing)?|modif(?:y|ying)|patch(?:ing)?|repair(?:ing)?|rewrit(?:e|ing)|send(?:ing)?|touch(?:ing)?|writ(?:e|ing))\b/i.test(
1503
1533
  value
1504
1534
  ) || /浏览器|网页|打开|点击|上传|提交|发布|部署|运行|执行|安装|删除|复制|移动|修改|编辑|修复|改写|写入|提交代码|推送|调用|API/.test(value);
1505
1535
  const patterns = [
1506
1536
  { re: /\b(do not|don't|dont|never|no need to)\s+([^.\n;]+)/gi, prefix: "User forbids" },
1507
1537
  // A sentence such as "without changing X, run tests and commit" starts a
1508
1538
  // positive instruction after the comma. Keep only the local without-clause.
1509
- { re: /\bwithout\s+([^.,\n;]+)/gi, prefix: "User forbids" },
1539
+ { re: /\bwithout\s+([^.,:\uFF1A\n;]+)/gi, prefix: "User forbids" },
1510
1540
  { re: /不要([^。\n;]+)/g, prefix: "User forbids" },
1511
1541
  { re: /禁止([^。\n;]+)/g, prefix: "User forbids" },
1512
1542
  ];
@@ -2029,6 +2059,9 @@ export function deriveScsTaskContract({ goal = "", taskProfile = "", acceptanceC
2029
2059
  positiveEvidenceGoal,
2030
2060
  taskProfile
2031
2061
  );
2062
+ const scopedArtifactDeliverable = Boolean(
2063
+ artifactRoot && goalRequestsScopedArtifactDeliverable(evidenceGoal)
2064
+ );
2032
2065
  return {
2033
2066
  version: 1,
2034
2067
  outcome: compact(evidenceGoal || "Complete the requested task.", 500),
@@ -2038,6 +2071,7 @@ export function deriveScsTaskContract({ goal = "", taskProfile = "", acceptanceC
2038
2071
  forbiddenActions: inferForbiddenActions(evidenceGoal),
2039
2072
  exactOutputPaths,
2040
2073
  requiredArtifactKinds,
2074
+ scopedArtifactDeliverable,
2041
2075
  excludedOutputPaths,
2042
2076
  artifactRoot,
2043
2077
  exactInputPaths,