@lazyingart/agintiflow 0.20.303 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.303",
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",
@@ -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"
@@ -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(
@@ -1448,7 +1459,12 @@ function inferRequirementCategories(goal = "", taskProfile = "", acceptanceCrite
1448
1459
  if (goalRequestsTestExecution(positiveGoal)) {
1449
1460
  categories.add("test");
1450
1461
  }
1451
- 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
+ ) {
1452
1468
  categories.add("artifact");
1453
1469
  }
1454
1470
  if (
@@ -1513,14 +1529,14 @@ function inferForbiddenActions(goal = "") {
1513
1529
  const text = String(goal || "");
1514
1530
  const forbidden = [];
1515
1531
  const isAction = (value = "") =>
1516
- /\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(
1517
1533
  value
1518
1534
  ) || /浏览器|网页|打开|点击|上传|提交|发布|部署|运行|执行|安装|删除|复制|移动|修改|编辑|修复|改写|写入|提交代码|推送|调用|API/.test(value);
1519
1535
  const patterns = [
1520
1536
  { re: /\b(do not|don't|dont|never|no need to)\s+([^.\n;]+)/gi, prefix: "User forbids" },
1521
1537
  // A sentence such as "without changing X, run tests and commit" starts a
1522
1538
  // positive instruction after the comma. Keep only the local without-clause.
1523
- { re: /\bwithout\s+([^.,\n;]+)/gi, prefix: "User forbids" },
1539
+ { re: /\bwithout\s+([^.,:\uFF1A\n;]+)/gi, prefix: "User forbids" },
1524
1540
  { re: /不要([^。\n;]+)/g, prefix: "User forbids" },
1525
1541
  { re: /禁止([^。\n;]+)/g, prefix: "User forbids" },
1526
1542
  ];