@lazyingart/agintiflow 0.20.329 → 0.20.330
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.
|
@@ -700,3 +700,24 @@ status" prompt, triggers a DeepSeek quota handoff, and verifies that LocalLLM is
|
|
|
700
700
|
called only after compaction. The run completes without `session.failed`, keeps
|
|
701
701
|
the provider handoff active on the same session, and records the compaction
|
|
702
702
|
events as durable evidence.
|
|
703
|
+
|
|
704
|
+
### Harmless tool-call annotations during repository discovery
|
|
705
|
+
|
|
706
|
+
`inspect-project-annotation-093` covers a DeepSeek-first tool-loop boundary
|
|
707
|
+
that was still under-tested after the provider handoff work. Recent runtime
|
|
708
|
+
evidence showed ordinary project-inspection tasks stopping with
|
|
709
|
+
`tool_contract_violation` before dispatch because the model included a
|
|
710
|
+
non-executable `reason` field in an otherwise valid `inspect_project` call.
|
|
711
|
+
The strict per-turn schema correctly rejected unknown executable fields, but
|
|
712
|
+
the existing benign-annotation normalizer only recognized `description`.
|
|
713
|
+
|
|
714
|
+
AgInTiFlow now treats a bounded string `reason` exactly like `description`: it
|
|
715
|
+
is removed before schema validation only when the offered tool schema forbids
|
|
716
|
+
additional properties and the schema does not define that field. Structured,
|
|
717
|
+
non-string, oversized, or executable unknown fields still fail closed.
|
|
718
|
+
|
|
719
|
+
The regression uses a normal weak prompt asking the agent to look over a small
|
|
720
|
+
repository and report whether a README exists. The scripted DeepSeek-shaped
|
|
721
|
+
response calls `inspect_project` with `reason` plus a real `limit`; the persisted
|
|
722
|
+
runtime dispatches the inspection, records zero tool-contract failures, and
|
|
723
|
+
finishes with the verified README status without mutating the workspace.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.330",
|
|
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",
|
|
@@ -7238,6 +7238,54 @@ assert(
|
|
|
7238
7238
|
).ok,
|
|
7239
7239
|
"valid offered tool call did not satisfy its exact schema"
|
|
7240
7240
|
);
|
|
7241
|
+
const strictInspectDescriptor = {
|
|
7242
|
+
type: "function",
|
|
7243
|
+
function: {
|
|
7244
|
+
name: "inspect_project",
|
|
7245
|
+
description: "Inspect the project.",
|
|
7246
|
+
parameters: {
|
|
7247
|
+
type: "object",
|
|
7248
|
+
properties: {
|
|
7249
|
+
path: { type: "string" },
|
|
7250
|
+
maxDepth: { type: "integer" },
|
|
7251
|
+
limit: { type: "integer" },
|
|
7252
|
+
includeFiles: { type: "boolean" },
|
|
7253
|
+
},
|
|
7254
|
+
additionalProperties: false,
|
|
7255
|
+
},
|
|
7256
|
+
},
|
|
7257
|
+
};
|
|
7258
|
+
const recoveredInspectReason = resolveDispatchableToolCallBatch(
|
|
7259
|
+
[
|
|
7260
|
+
contractCall("inspect-with-reason", "inspect_project", {
|
|
7261
|
+
reason: "Orient before answering the user's project question.",
|
|
7262
|
+
limit: 120,
|
|
7263
|
+
}),
|
|
7264
|
+
],
|
|
7265
|
+
createToolContract([strictInspectDescriptor])
|
|
7266
|
+
);
|
|
7267
|
+
assert(
|
|
7268
|
+
recoveredInspectReason.ok && recoveredInspectReason.recoveredToolCallAnnotations,
|
|
7269
|
+
"a harmless inspect_project reason annotation was not stripped before schema validation"
|
|
7270
|
+
);
|
|
7271
|
+
assertStrict.deepEqual(
|
|
7272
|
+
JSON.parse(recoveredInspectReason.acceptedToolCalls[0].function.arguments),
|
|
7273
|
+
{ limit: 120 },
|
|
7274
|
+
"inspect_project reason annotation recovery changed executable arguments"
|
|
7275
|
+
);
|
|
7276
|
+
const rejectedStructuredInspectReason = resolveDispatchableToolCallBatch(
|
|
7277
|
+
[
|
|
7278
|
+
contractCall("inspect-structured-reason", "inspect_project", {
|
|
7279
|
+
reason: { intent: "orient" },
|
|
7280
|
+
limit: 120,
|
|
7281
|
+
}),
|
|
7282
|
+
],
|
|
7283
|
+
createToolContract([strictInspectDescriptor])
|
|
7284
|
+
);
|
|
7285
|
+
assert(
|
|
7286
|
+
!rejectedStructuredInspectReason.ok,
|
|
7287
|
+
"a structured inspect_project reason annotation was stripped even though it is not a bounded text note"
|
|
7288
|
+
);
|
|
7241
7289
|
|
|
7242
7290
|
const safeReadDescriptors = [
|
|
7243
7291
|
{
|
|
@@ -7877,6 +7925,73 @@ assert(
|
|
|
7877
7925
|
"authoritative routine flow still dispatched private/raw exploratory commands"
|
|
7878
7926
|
);
|
|
7879
7927
|
|
|
7928
|
+
let annotatedInspectStep = 0;
|
|
7929
|
+
const annotatedInspectRun = await runToolContractCase({
|
|
7930
|
+
id: "inspect-project-reason-annotation",
|
|
7931
|
+
provider: "deepseek",
|
|
7932
|
+
profile: "code",
|
|
7933
|
+
goal: "Please look over this little repo and tell me whether it has a README. Keep it short.",
|
|
7934
|
+
toolCalls: [
|
|
7935
|
+
contractCall("unused-annotated-inspect", "finish", { result: "unused" }),
|
|
7936
|
+
],
|
|
7937
|
+
expectSuccess: true,
|
|
7938
|
+
expectedContractFailures: 0,
|
|
7939
|
+
setupWorkspace: async (workspace) => {
|
|
7940
|
+
await fs.writeFile(
|
|
7941
|
+
path.join(workspace, "README.md"),
|
|
7942
|
+
"# Demo\nThis workspace has a README.\n",
|
|
7943
|
+
"utf8"
|
|
7944
|
+
);
|
|
7945
|
+
},
|
|
7946
|
+
responseFactory: ({ payload }) => {
|
|
7947
|
+
annotatedInspectStep += 1;
|
|
7948
|
+
const offered = Array.isArray(payload.tools) ? names(payload.tools) : [];
|
|
7949
|
+
if (annotatedInspectStep === 1) {
|
|
7950
|
+
assert(
|
|
7951
|
+
offered.includes("inspect_project"),
|
|
7952
|
+
"normal repository orientation did not offer inspect_project"
|
|
7953
|
+
);
|
|
7954
|
+
return assistantWithToolCalls([
|
|
7955
|
+
contractCall("inspect-with-natural-reason", "inspect_project", {
|
|
7956
|
+
reason: "Orient before answering the user's project question.",
|
|
7957
|
+
limit: 120,
|
|
7958
|
+
}),
|
|
7959
|
+
]);
|
|
7960
|
+
}
|
|
7961
|
+
return assistantWithToolCalls([
|
|
7962
|
+
contractCall("finish-after-annotated-inspect", "finish", {
|
|
7963
|
+
result: "README.md is present.",
|
|
7964
|
+
}),
|
|
7965
|
+
]);
|
|
7966
|
+
},
|
|
7967
|
+
});
|
|
7968
|
+
assertStrict.equal(
|
|
7969
|
+
annotatedInspectRun.requests.length,
|
|
7970
|
+
2,
|
|
7971
|
+
"annotated inspect_project recovery used extra model turns"
|
|
7972
|
+
);
|
|
7973
|
+
assert(
|
|
7974
|
+
annotatedInspectRun.events.some(
|
|
7975
|
+
(event) =>
|
|
7976
|
+
event.type === "tool.completed" &&
|
|
7977
|
+
event.data?.toolName === "inspect_project" &&
|
|
7978
|
+
event.data?.ok === true
|
|
7979
|
+
),
|
|
7980
|
+
"annotated inspect_project call was not dispatched through the real runtime"
|
|
7981
|
+
);
|
|
7982
|
+
assert(
|
|
7983
|
+
!annotatedInspectRun.events.some(
|
|
7984
|
+
(event) =>
|
|
7985
|
+
event.type === "tool.failed" &&
|
|
7986
|
+
event.data?.category === "tool-contract-violation"
|
|
7987
|
+
),
|
|
7988
|
+
"annotated inspect_project still produced a tool-contract violation"
|
|
7989
|
+
);
|
|
7990
|
+
assert(
|
|
7991
|
+
/README\.md is present/.test(String(annotatedInspectRun.result?.result || "")),
|
|
7992
|
+
"annotated inspect_project run did not finish with the promised repository status"
|
|
7993
|
+
);
|
|
7994
|
+
|
|
7880
7995
|
const hiddenDryRun = await runToolContractCase({
|
|
7881
7996
|
id: "native-hidden-dry-run",
|
|
7882
7997
|
goal: "Create hidden-dry-run.txt containing unsafe if this tool dispatches.",
|
package/src/tool-contract.js
CHANGED
|
@@ -30,7 +30,7 @@ const MAX_VALIDATION_ERRORS = 8;
|
|
|
30
30
|
const MAX_VALIDATION_NODES = 50_000;
|
|
31
31
|
const MAX_SAFE_SEQUENTIAL_READ_CALLS = 4;
|
|
32
32
|
const MAX_REPORTED_SEQUENTIAL_CALLS = 12;
|
|
33
|
-
const BENIGN_TOOL_CALL_ANNOTATION_KEYS = new Set(["description"]);
|
|
33
|
+
const BENIGN_TOOL_CALL_ANNOTATION_KEYS = new Set(["description", "reason"]);
|
|
34
34
|
|
|
35
35
|
function cloneValue(value) {
|
|
36
36
|
return structuredClone(value);
|