@lazyingart/agintiflow 0.20.310 → 0.20.311
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.
|
|
3
|
+
"version": "0.20.311",
|
|
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",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
completionRequirementCoverageInstruction,
|
|
9
9
|
continuationExecutionContractDirective,
|
|
10
10
|
removeSupersededCompletionRepairInstructions,
|
|
11
|
+
repositorySourcePrecedenceInstruction,
|
|
11
12
|
runAgent,
|
|
12
13
|
} from "../src/agent-runner.js";
|
|
13
14
|
import { resolveRuntimeConfig } from "../src/config.js";
|
|
@@ -25,6 +26,36 @@ assert.match(completionCoverageInstruction, /authoritative structured routine/i)
|
|
|
25
26
|
assert.match(completionCoverageInstruction, /every relevant section/i);
|
|
26
27
|
assert.match(completionCoverageInstruction, /instead of summarizing only failures or only successes/i);
|
|
27
28
|
|
|
29
|
+
const sourcePrecedenceInstruction = repositorySourcePrecedenceInstruction();
|
|
30
|
+
assert.match(sourcePrecedenceInstruction, /current direct user request/i);
|
|
31
|
+
assert.match(sourcePrecedenceInstruction, /closest project instructions/i);
|
|
32
|
+
assert.match(sourcePrecedenceInstruction, /most specific current implementation and tests/i);
|
|
33
|
+
assert.match(sourcePrecedenceInstruction, /stale guides/i);
|
|
34
|
+
assert.match(sourcePrecedenceInstruction, /AGENTS\.md/i);
|
|
35
|
+
|
|
36
|
+
const readOnlyContractAuditGoal = `
|
|
37
|
+
Audit the current source-intake contract and cover an ordinary video, a hypothetical
|
|
38
|
+
same-chat publish request, a Finder card, and a document attachment. Do not send any
|
|
39
|
+
message, publish anything, alter a queue, open a browser, or modify configuration.
|
|
40
|
+
`;
|
|
41
|
+
const readOnlyContractAudit = deriveScsTaskContract({
|
|
42
|
+
goal: readOnlyContractAuditGoal,
|
|
43
|
+
taskProfile: "auto",
|
|
44
|
+
});
|
|
45
|
+
assert.equal(readOnlyContractAudit.readOnlyReadiness, true);
|
|
46
|
+
assert(
|
|
47
|
+
!readOnlyContractAudit.requiredEvidence.some((item) => item.category === "publish"),
|
|
48
|
+
"a hypothetical publish case inside a forbidden read-only contract audit required live publish evidence"
|
|
49
|
+
);
|
|
50
|
+
assert(
|
|
51
|
+
!readOnlyContractAudit.requiredEvidence.some((item) => item.category === "browser"),
|
|
52
|
+
"a forbidden browser action inside a read-only contract audit required browser evidence"
|
|
53
|
+
);
|
|
54
|
+
assert(
|
|
55
|
+
readOnlyContractAudit.forbiddenActions.some((item) => /publish anything/i.test(item)),
|
|
56
|
+
"the read-only audit lost its explicit publish prohibition"
|
|
57
|
+
);
|
|
58
|
+
|
|
28
59
|
assert.equal(
|
|
29
60
|
finishResultClaimsIncompleteWork(
|
|
30
61
|
"The report is complete and the verification that was previously paused now passes. No work remains."
|
package/src/agent-runner.js
CHANGED
|
@@ -2973,6 +2973,10 @@ export function completionRequirementCoverageInstruction() {
|
|
|
2973
2973
|
return "Before finishing, check the current user request requirement by requirement. Every distinct subject, requested action, and deliverable must be completed, answered, deliberately grouped under one verified shared state, or named with a concrete blocker. When an authoritative structured routine returns named sections relevant to the request, report every relevant section instead of summarizing only failures or only successes.";
|
|
2974
2974
|
}
|
|
2975
2975
|
|
|
2976
|
+
export function repositorySourcePrecedenceInstruction() {
|
|
2977
|
+
return "Treat the current direct user request and the closest project instructions as authoritative. When describing an existing contract, inspect the most specific current implementation and tests, reconcile conflicting documentation, and never let examples, stale guides, or historical notes override AGENTS.md or current code. State any unresolved conflict instead of choosing silently.";
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2976
2980
|
function focusedCapabilityContext(config = {}) {
|
|
2977
2981
|
return [
|
|
2978
2982
|
config.allowFileTools
|
|
@@ -3017,6 +3021,7 @@ function buildFocusedRuntimeMessages({
|
|
|
3017
3021
|
"Answer ordinary conversation directly. For executable work, act through the smallest relevant routine or tool, verify in proportion to risk, then stop.",
|
|
3018
3022
|
"Treat queued user input as a safe-boundary interruption: preserve every material requirement, merge related consecutive messages, revise the durable goal, and never repeat a completed external side effect.",
|
|
3019
3023
|
completionRequirementCoverageInstruction(),
|
|
3024
|
+
repositorySourcePrecedenceInstruction(),
|
|
3020
3025
|
"Established project routines are capabilities to invoke, not workflows to reimplement. Discover more context only when the current task needs it.",
|
|
3021
3026
|
formatBehaviorContractForPrompt({ mode: "focused" }),
|
|
3022
3027
|
languageInstruction(config.language || "en"),
|
|
@@ -3236,6 +3241,7 @@ async function createInitialState(config, sessionId) {
|
|
|
3236
3241
|
"For LaTeX/PDF tasks, check existing latexmk/pdflatex first and compile with the available host or Docker TeX toolchain before installing packages or rebuilding the sandbox.",
|
|
3237
3242
|
"For research or web-search tasks, use browser tools or safe shell network tools when the current policy allows; cite or save useful sources in workspace notes when the task needs traceability.",
|
|
3238
3243
|
completionRequirementCoverageInstruction(),
|
|
3244
|
+
repositorySourcePrecedenceInstruction(),
|
|
3239
3245
|
browserStateReconciliationGuidance(),
|
|
3240
3246
|
isRetainedWorkspaceProfile(config)
|
|
3241
3247
|
? "Choose descriptive non-conflicting workspace paths for durable outputs."
|
package/src/scs-evidence.js
CHANGED
|
@@ -454,6 +454,13 @@ function normalizeWrappedNegativePrefixes(goal = "") {
|
|
|
454
454
|
);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
+
function normalizeSoftLineWraps(goal = "") {
|
|
458
|
+
return normalizeWrappedNegativePrefixes(goal).replace(
|
|
459
|
+
/([A-Za-z0-9,])[ \t]*\r?\n[ \t]*(?=[a-z])/g,
|
|
460
|
+
"$1 "
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
457
464
|
function inferExactOutputPaths(goal = "") {
|
|
458
465
|
const paths = [];
|
|
459
466
|
const lines = String(goal || "").split(/\n/);
|
|
@@ -1406,10 +1413,17 @@ function isReadOnlyReadinessTask(goal = "") {
|
|
|
1406
1413
|
/\b(?:readiness|capability)\s+(?:audit|check|report|assessment)\b/i.test(text) ||
|
|
1407
1414
|
/\bwhether\s+(?:i|we|the\s+(?:agent|system))\s+can\b/i.test(text) ||
|
|
1408
1415
|
/只读检查|只讀檢查|就绪检查|就緒檢查|能力检查|能力檢查|检查是否|檢查是否/.test(text);
|
|
1416
|
+
const contractAuditSignal =
|
|
1417
|
+
/\b(?:audit|inspect|review|assess|document|report\s+on)\s+(?:the\s+)?(?:current\s+)?[^.\n;]{0,140}\b(?:contract|policy|behavio(?:u)?r|workflow|implementation|routine|routing|readiness|capabilit(?:y|ies))\b/i.test(
|
|
1418
|
+
text
|
|
1419
|
+
) ||
|
|
1420
|
+
/(?:审计|審計|检查|檢查|审查|審查|评估|評估|记录|記錄)[^。;\n]{0,120}(?:契约|契約|策略|行为|行為|流程|实现|實現|例程|路由|就绪|就緒|能力)/.test(
|
|
1421
|
+
text
|
|
1422
|
+
);
|
|
1409
1423
|
const noActionSignal =
|
|
1410
|
-
/\b(?:do not|don't|dont|never|without)\b[^.\n;]{0,260}\b(?:generate|submit|upload|publish|deploy|
|
|
1424
|
+
/\b(?:do not|don't|dont|never|without)\b[^.\n;]{0,260}\b(?:send|generate|submit|upload|publish|deploy|open|browse|focus|restart|alter|change|edit|modify|write|mutate|delete|purchase|pay|log in|login)\b/i.test(text) ||
|
|
1411
1425
|
/(?:不要|禁止)[^。\n;]{0,260}(?:生成|提交|上传|上傳|发布|發布|部署|登录|登入|重启|重啟|编辑|編輯|修改|删除|刪除|购买|購買|支付)/.test(text);
|
|
1412
|
-
return readinessSignal && noActionSignal;
|
|
1426
|
+
return (readinessSignal || contractAuditSignal) && noActionSignal;
|
|
1413
1427
|
}
|
|
1414
1428
|
|
|
1415
1429
|
function requiresSourceGrounding(goal = "") {
|
|
@@ -1550,7 +1564,7 @@ function inferRequirementCategories(goal = "", taskProfile = "", acceptanceCrite
|
|
|
1550
1564
|
}
|
|
1551
1565
|
|
|
1552
1566
|
function inferForbiddenActions(goal = "") {
|
|
1553
|
-
const text =
|
|
1567
|
+
const text = normalizeSoftLineWraps(goal);
|
|
1554
1568
|
const forbidden = [];
|
|
1555
1569
|
const isAction = (value = "") =>
|
|
1556
1570
|
/\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(
|
|
@@ -1601,7 +1615,7 @@ function inferRequiredToolCalls(goal = "") {
|
|
|
1601
1615
|
}
|
|
1602
1616
|
|
|
1603
1617
|
function stripForbiddenLanguage(goal = "") {
|
|
1604
|
-
return
|
|
1618
|
+
return normalizeSoftLineWraps(goal)
|
|
1605
1619
|
.replace(/\b(do not|don't|dont|must not|should not|never|no need to)\s+([^.\n;]+)/gi, "")
|
|
1606
1620
|
.replace(/\bwithout\s+([^.,:\uFF1A\n;]+)/gi, "")
|
|
1607
1621
|
.replace(/不要([^。\n;]+)/g, "")
|