@lazyingart/agintiflow 0.20.248 → 0.20.249

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.
@@ -330,3 +330,52 @@ event sequence, a project handoff with exact status and verification commands,
330
330
  and no lingering job tmux session. No source patch or npm release was needed;
331
331
  this run validates the published package's general long-job, resume, context,
332
332
  deduplication, and cleanup contracts without task-specific routing.
333
+
334
+ ### Host-managed response roles and permission integrity
335
+
336
+ `permission-resilient-synthesis-030` traced a real LabCanvas career-report
337
+ failure to the integration boundary rather than weakening AgInTiFlow's
338
+ permission guard. LabCanvas invoked the host-managed report under the role
339
+ `career_research`, while its response-only classifier recognized only the older
340
+ `career_daily` alias. The model was consequently offered file tools in a safe,
341
+ read-only run; when it tried to save its already synthesized report,
342
+ AgInTiFlow correctly persisted a `permission_required` pause.
343
+
344
+ LabCanvas now classifies the full `career-research-*` and
345
+ `daily-organizer-*` role families as host-managed response turns. Those turns
346
+ use AgInTi's `chatops` profile with shell, file, and auxiliary tools disabled;
347
+ the host owns persistence, compilation, quality validation, and delivery.
348
+ General worker roles retain their existing writable Docker contract, and safe
349
+ mode still blocks genuine unapproved writes.
350
+
351
+ A fresh installed `0.20.248` DeepSeek run completed the imperfect synthesis
352
+ prompt in one model turn. Independent event inspection found zero tool calls,
353
+ zero permission events, one normal `session.finished`, a complete 1,893-byte
354
+ answer, and no task artifact mutation. This was an AgenticApp integration fix;
355
+ no AgInTiFlow runtime or npm release change was required.
356
+
357
+ ### Reader-facing report quality and local editorial routing
358
+
359
+ `research-pdf-quality-034` exercised a normal scheduled-research packet through
360
+ the AgInTi-backed LabCanvas worker. DeepSeek revised an existing local report
361
+ into a 17,557-byte Chinese scientific review with nine traceable sources,
362
+ source-level methods/results/limitations, cross-source synthesis and tensions,
363
+ explicit evidence boundaries, actionable experiments, and references. The
364
+ first host compile exposed a nearly empty final page, and the prior agent repair
365
+ claimed success without changing the source.
366
+
367
+ LabCanvas now treats the PDF as a different deliverable from the concise chat
368
+ brief. It audits every configured content dimension, keeps orchestration
369
+ provenance out of the reader document, extracts text per page, renders private
370
+ page previews, rejects orphan pages, retries one conservative compact layout,
371
+ rebuilds stale sibling PDFs, and can deterministically adopt a corrected
372
+ host-built PDF during stored-result repair. The accepted four-page PDF has
373
+ embedded CJK fonts, page body counts `1584, 1988, 1416, 2058`, and no visual or
374
+ layout issues. Stored replay covered every task item with no model rerun or
375
+ external write.
376
+
377
+ The scenario also exposed two general AgInTi routing false positives. Explicit
378
+ local report paths and existing-document revision language now count as local
379
+ workspace intent, so surrounding research policy does not force a new deep
380
+ research route. The phrase `page-safe` no longer creates a browser-evidence
381
+ requirement. Focused routing/evidence smokes and the full npm suite pass.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.248",
3
+ "version": "0.20.249",
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",
@@ -1647,6 +1647,22 @@ assert(
1647
1647
  "surrounding policy prose incorrectly forced a scoped artifact task into deep research"
1648
1648
  );
1649
1649
 
1650
+ const scopedExistingReportEditPrompt = `Generic research worker policy.
1651
+ AGINTI_EVIDENCE_SCOPE_JSON: {"mode":"task","request":"Revise the exact existing research report at output/wechat_worker/task/report.md. Preserve the evidence, write the revised Markdown under this task's artifact directory, and use page-safe tables. The host owns PDF compilation."}
1652
+ Surrounding routine text mentions literature review, evidence review, research report, and web sources.`;
1653
+ const scopedExistingReportEditTools = selectProgressiveTools(allTools, {
1654
+ config: { provider: "deepseek", progressiveTools: true },
1655
+ goal: scopedExistingReportEditPrompt,
1656
+ profile: "auto",
1657
+ messages: [{ role: "user", content: scopedExistingReportEditPrompt }],
1658
+ });
1659
+ assert(names(scopedExistingReportEditTools).includes("read_file"), "scoped existing-report edit omitted read_file");
1660
+ assert(names(scopedExistingReportEditTools).includes("write_file"), "scoped existing-report edit omitted write_file");
1661
+ assert(
1662
+ !(names(scopedExistingReportEditTools).length === 2 && names(scopedExistingReportEditTools)[0] === "deep_research"),
1663
+ "scoped existing-report edit was incorrectly forced into deep_research"
1664
+ );
1665
+
1650
1666
  const scopedDeepResearchPrompt = `Generic workspace policy.
1651
1667
  AGINTI_EVIDENCE_SCOPE_JSON: {"mode":"task","request":"Write a deep research evidence review comparing three primary papers."}`;
1652
1668
  const scopedDeepResearchTools = selectProgressiveTools(allTools, {
@@ -36,6 +36,26 @@ function fakeStudentClient(json) {
36
36
  };
37
37
  }
38
38
 
39
+ const pageSafeReportContract = deriveScsTaskContract({
40
+ goal: [
41
+ "AGINTI_EVIDENCE_SCOPE_JSON: {\"mode\":\"task\",\"request\":\"Revise the exact existing research report at output/wechat_worker/task/report.md, write a complete Markdown report, and use page-safe tables. The host owns PDF compilation.\"}",
42
+ "Surrounding browser and research policy text is not part of the exact request.",
43
+ ].join("\n"),
44
+ taskProfile: "auto",
45
+ });
46
+ assert(
47
+ pageSafeReportContract.requiredEvidence.some((item) => item.category === "file"),
48
+ "a scoped existing-report edit did not require file evidence"
49
+ );
50
+ assert(
51
+ pageSafeReportContract.requiredEvidence.some((item) => item.category === "artifact"),
52
+ "a scoped existing-report edit did not require artifact evidence"
53
+ );
54
+ assert(
55
+ !pageSafeReportContract.requiredEvidence.some((item) => item.category === "browser"),
56
+ "the editorial phrase page-safe incorrectly required browser evidence"
57
+ );
58
+
39
59
  const noEvidenceProgress = {
40
60
  role: "student",
41
61
  decision: "reject_phase",
@@ -89,6 +89,8 @@ export function hasLocalResearchWorkspaceIntent(goal = "", messages = []) {
89
89
  const text = `${scopedChatopsEvidenceGoal(goal)}\n${recent}`;
90
90
  return (
91
91
  /\b(?:this|current|existing|project|workspace|local)\s+(?:folder|directory|repo(?:sitory)?|files?|notes?|sources?|artifacts?)\b/i.test(text) ||
92
+ /(?:^|[\s`'"(])(?:~\/|\.{1,2}\/|\/)?(?:[^\s`'"()\/]+\/)+[^\s`'"()\/]+\.(?:bib|csv|docx?|json|md|pdf|tex|txt|ya?ml)\b/i.test(text) ||
93
+ /\b(?:edit|revise|rewrite|proofread|correct|polish|read|inspect|update)\b[^.\n;]{0,160}\b(?:exact|existing|current|saved|local)\b[^.\n;]{0,80}\b(?:document|file|manuscript|markdown|notes?|report|source)\b/i.test(text) ||
92
94
  /\b(?:task|project|source|research|evidence|notes?|manifest|readme)[-_A-Za-z0-9]*\.(?:md|json|ya?ml|txt|csv|bib|tex)\b/i.test(text) ||
93
95
  /\b(?:inspect|read|reconcile|correct|rewrite|update)\b.{0,120}\b(?:workspace|folder|directory|repo(?:sitory)?|local files?|project notes?|existing notes?)\b/i.test(text) ||
94
96
  /\b(?:git\s+)?commit\b/i.test(text)
@@ -793,7 +793,17 @@ function inferRequirementCategories(goal = "", taskProfile = "", acceptanceCrite
793
793
  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)) {
794
794
  categories.add("artifact");
795
795
  }
796
- if (textHas(mandatoryEvidenceText, /\b(browser|chrome|chromium|cdp|devtools|playwright|selenium|web[- ]?ui|website|page|tab|composer|click|type|upload|attach|submit|form)\b/) || /浏览器|网页|页面|上传|提交|附件|资产库/.test(mandatoryEvidenceText)) {
796
+ if (
797
+ textHas(
798
+ mandatoryEvidenceText,
799
+ /\b(browser|chrome|chromium|cdp|devtools|playwright|selenium|web[- ]?(?:ui|page)|website|tab|composer|click|type|upload|attach|submit|form)\b/
800
+ ) ||
801
+ textHas(
802
+ mandatoryEvidenceText,
803
+ /\b(?:browse|navigate|open|refresh|visit)\b[^.\n;]{0,60}\b(?:page|site)\b|\b(?:page|site)\b[^.\n;]{0,60}\b(?:click|open|submit|upload)\b/
804
+ ) ||
805
+ /浏览器|网页|页面|上传|提交|附件|资产库/.test(mandatoryEvidenceText)
806
+ ) {
797
807
  categories.add("browser");
798
808
  }
799
809
  if (textHas(mandatoryEvidenceText, /\b(screenshot|visible|visual|see|inspect image|open image|read_image|thumbnail)\b/) || /截图|可见|缩略图/.test(mandatoryEvidenceText)) {