@lazyingart/agintiflow 0.20.272 → 0.20.273

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.272",
3
+ "version": "0.20.273",
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",
@@ -5306,8 +5306,19 @@ try {
5306
5306
  postMutationVerificationRuntime.testVerificationCommand === postMutationVerifier,
5307
5307
  "a material failed-test repair did not advance directly to its exact retained verifier"
5308
5308
  );
5309
+ const generatedDeckValidatorPath = path.join(
5310
+ tempRoot,
5311
+ "acceptance",
5312
+ "presentation_deck_contract.py"
5313
+ );
5314
+ await fs.mkdir(path.dirname(generatedDeckValidatorPath), { recursive: true });
5315
+ await fs.writeFile(
5316
+ generatedDeckValidatorPath,
5317
+ "raise SystemExit('acceptance fixture')\n",
5318
+ "utf8"
5319
+ );
5309
5320
  const generatedDeckValidator =
5310
- "python3 /tmp/presentation_deck_contract.py --root .";
5321
+ `python3 ${generatedDeckValidatorPath} --root .`;
5311
5322
  await fs.writeFile(
5312
5323
  path.join(workspace, "build_deck.py"),
5313
5324
  "print('build canonical deck')\n",
@@ -5544,6 +5555,41 @@ try {
5544
5555
  JSON.stringify(["build_deck.py"]),
5545
5556
  "failed-test recovery forced immutable evidence reads instead of grounding the canonical producer"
5546
5557
  );
5558
+ assert(
5559
+ JSON.stringify(failedAfterProducerRuntime.testFailureDiagnosticReadPaths) ===
5560
+ JSON.stringify([generatedDeckValidatorPath]) &&
5561
+ failedAfterProducerRuntime.readOnlyRoots.includes(
5562
+ path.dirname(generatedDeckValidatorPath)
5563
+ ),
5564
+ "an exact external validator from the retained failed command was not exposed through a narrow read-only root"
5565
+ );
5566
+ const consumedExternalValidatorState = structuredClone(failedAfterProducerState);
5567
+ consumedExternalValidatorState.meta.toolLoop =
5568
+ consumedExternalValidatorState.meta.toolLoop || { recent: [] };
5569
+ consumedExternalValidatorState.meta.toolLoop.recent = [
5570
+ ...(consumedExternalValidatorState.meta.toolLoop.recent || []),
5571
+ {
5572
+ toolName: "read_file",
5573
+ path: generatedDeckValidatorPath,
5574
+ ok: true,
5575
+ blocked: false,
5576
+ goalRevision: 13,
5577
+ at: "2026-08-27T19:05:02.000Z",
5578
+ },
5579
+ ];
5580
+ const consumedExternalValidatorRuntime = nextStepRuntimeConfig(
5581
+ {
5582
+ provider: "deepseek",
5583
+ taskProfile: "slides",
5584
+ commandCwd: workspace,
5585
+ goal: consumedExternalValidatorState.goal,
5586
+ },
5587
+ consumedExternalValidatorState
5588
+ );
5589
+ assert(
5590
+ consumedExternalValidatorRuntime.testFailureDiagnosticReadPaths.length === 0,
5591
+ "an exact external validator remained exposed after its bounded read completed"
5592
+ );
5547
5593
  const immutableOnlyRepairState = {
5548
5594
  goal: "Treat service_ctl.py as immutable read-only source evidence and finish from existing results.",
5549
5595
  meta: {
@@ -1804,6 +1804,28 @@ sameNames(
1804
1804
  "an unchanged failed-test rerun did not close discovery until a real mutation"
1805
1805
  );
1806
1806
 
1807
+ const externalValidatorPath = "/tmp/aginti-acceptance/deck_contract.py";
1808
+ const externalDiagnosticFailedTestRepairTools = selectProgressiveTools(allTools, {
1809
+ config: {
1810
+ provider: "deepseek",
1811
+ testFailureRepairActive: true,
1812
+ testFailureRepairMutationRequired: true,
1813
+ testFailureDiagnosticReadPaths: [externalValidatorPath],
1814
+ },
1815
+ goal: "Repair the canonical producer from the exact external acceptance contract.",
1816
+ profile: "slides",
1817
+ });
1818
+ sameNames(
1819
+ externalDiagnosticFailedTestRepairTools,
1820
+ ["read_file", "apply_patch", "finish"],
1821
+ "a retained external validator was not exposed as one bounded read during mutation-only recovery"
1822
+ );
1823
+ assertStrict.deepEqual(
1824
+ externalDiagnosticFailedTestRepairTools[0].function.parameters.properties.path.enum,
1825
+ [externalValidatorPath],
1826
+ "the external validator read was not schema-constrained to its exact path"
1827
+ );
1828
+
1807
1829
  const failedTestPatchContextTools = selectProgressiveTools(allTools, {
1808
1830
  config: {
1809
1831
  provider: "localllm",
@@ -6683,6 +6683,51 @@ function failedTestCanonicalRepairPaths(state = {}) {
6683
6683
  .filter((item, index, items) => items.indexOf(item) === index);
6684
6684
  }
6685
6685
 
6686
+ export function failedTestExternalDiagnosticReadPaths(
6687
+ config = {},
6688
+ state = {},
6689
+ testRun = null
6690
+ ) {
6691
+ const failure = testRun || currentFailedProjectTest(state)?.test;
6692
+ const command = String(failure?.command || "").trim();
6693
+ if (!command) return [];
6694
+ const commandCwd = path.resolve(
6695
+ config.commandCwd || state.commandCwd || process.cwd()
6696
+ );
6697
+ const candidates = [];
6698
+ for (const token of tokenizeShellWords(command)) {
6699
+ const rawPath = String(token || "").replace(/[;,]+$/g, "").trim();
6700
+ if (!rawPath || !path.isAbsolute(rawPath)) continue;
6701
+ let realPath = "";
6702
+ try {
6703
+ realPath = fsSync.realpathSync(rawPath);
6704
+ const stat = fsSync.statSync(realPath);
6705
+ if (!stat.isFile() || stat.size > 1_000_000) continue;
6706
+ } catch {
6707
+ continue;
6708
+ }
6709
+ const relative = path.relative(commandCwd, realPath);
6710
+ if (!relative.startsWith("..") && !path.isAbsolute(relative)) continue;
6711
+ const normalized = realPath.replace(/\\/g, "/");
6712
+ if (
6713
+ !PLAIN_TEXT_FILE_EXTENSIONS.has(path.extname(normalized).toLowerCase()) ||
6714
+ /(?:secret|credential|password|private[-_]?key|access[-_]?token)/i.test(normalized) ||
6715
+ !(
6716
+ pathLooksLikeTestSource(normalized) ||
6717
+ /(?:^|\/)(?:acceptance|verification)(?:\/|$)|(?:contract|validator)/i.test(
6718
+ normalized
6719
+ )
6720
+ ) ||
6721
+ candidates.includes(realPath)
6722
+ ) {
6723
+ continue;
6724
+ }
6725
+ candidates.push(realPath);
6726
+ if (candidates.length >= 3) break;
6727
+ }
6728
+ return candidates;
6729
+ }
6730
+
6686
6731
  function recoveryEvidenceDependencies(sourcePath = "", content = "") {
6687
6732
  const dependencies = [];
6688
6733
  const append = (candidate) => {
@@ -11452,6 +11497,39 @@ export function nextStepRuntimeConfig(config = {}, state = {}) {
11452
11497
  .slice(0, 8);
11453
11498
  const toolLoop = state.meta?.toolLoop || {};
11454
11499
  const stagnationEpoch = Math.max(0, Number(toolLoop.stagnationEpoch || 0));
11500
+ const externalDiagnosticPaths = failedTestExternalDiagnosticReadPaths(
11501
+ runtimeConfig,
11502
+ state,
11503
+ retainedFailedTest
11504
+ );
11505
+ const consumedExternalDiagnosticPaths = new Set(
11506
+ (Array.isArray(toolLoop.recent) ? toolLoop.recent : [])
11507
+ .filter(
11508
+ (entry) =>
11509
+ entry?.ok === true &&
11510
+ entry?.blocked !== true &&
11511
+ String(entry?.toolName || "") === "read_file" &&
11512
+ Number(entry?.goalRevision || 0) === groundingGoalRevision
11513
+ )
11514
+ .map((entry) => {
11515
+ const rawPath = String(entry?.path || "").trim();
11516
+ return rawPath ? path.resolve(commandCwd, rawPath) : "";
11517
+ })
11518
+ .filter(Boolean)
11519
+ );
11520
+ runtimeConfig.testFailureDiagnosticReadPaths = externalDiagnosticPaths.filter(
11521
+ (candidate) => !consumedExternalDiagnosticPaths.has(candidate)
11522
+ );
11523
+ if (runtimeConfig.testFailureDiagnosticReadPaths.length) {
11524
+ runtimeConfig.readOnlyRoots = [
11525
+ ...(Array.isArray(runtimeConfig.readOnlyRoots)
11526
+ ? runtimeConfig.readOnlyRoots
11527
+ : []),
11528
+ ...runtimeConfig.testFailureDiagnosticReadPaths.map((candidate) =>
11529
+ path.dirname(candidate)
11530
+ ),
11531
+ ].filter((item, index, items) => items.indexOf(item) === index);
11532
+ }
11455
11533
  const currentRecoveryPacket = Boolean(
11456
11534
  state.meta?.failedTestRecoveryPacket &&
11457
11535
  Number(state.meta.failedTestRecoveryPacket.packetVersion || 0) ===
@@ -733,6 +733,8 @@ function constrainReadFilePaths(tool, paths, phase) {
733
733
  ? "Exact canonical project file selected from current task evidence for the required fresh correction."
734
734
  : phase === "failed-test-evidence-refresh"
735
735
  ? "Exact unread workspace-relative path retained by the current failed-test evidence packet."
736
+ : phase === "failed-test-diagnostic-read"
737
+ ? "Exact read-only acceptance or validator source named by the retained failed verification command."
736
738
  : "Exact workspace-relative path discovered by inspect_project.",
737
739
  };
738
740
  return {
@@ -746,6 +748,8 @@ function constrainReadFilePaths(tool, paths, phase) {
746
748
  ? "Read one exact canonical project file before the required fresh source correction. Tests, Git actions, and finish remain unavailable until a material patch advances the project mutation revision."
747
749
  : phase === "failed-test-evidence-refresh"
748
750
  ? "Read one exact unread source or acceptance-test file from the current failed-test evidence packet. Each packet path is exposed at most once before mutation-only recovery resumes."
751
+ : phase === "failed-test-diagnostic-read"
752
+ ? "Read one exact existing external acceptance or validator file from the retained failed command. This path is read-only and no neighboring external files are exposed."
749
753
  : phase === "read-instructions"
750
754
  ? "Read one exact project instruction file discovered by inspect_project before repository mutation or validation commands are enabled."
751
755
  : phase === "read-tests"
@@ -2017,24 +2021,36 @@ export function selectProgressiveTools(
2017
2021
  .filter((item, index, items) => items.indexOf(item) === index)
2018
2022
  .slice(0, 1)
2019
2023
  : [];
2020
- const boundedRepairReadPaths = repairContextPaths.length
2021
- ? repairContextPaths
2022
- : optionalRepairRereadPaths;
2024
+ const diagnosticReadPaths = Array.isArray(config.testFailureDiagnosticReadPaths)
2025
+ ? config.testFailureDiagnosticReadPaths
2026
+ .map((item) => String(item || "").replace(/\\/g, "/").trim())
2027
+ .filter(Boolean)
2028
+ .filter((item, index, items) => items.indexOf(item) === index)
2029
+ .slice(0, 3)
2030
+ : [];
2031
+ const boundedRepairReadPaths = [
2032
+ ...diagnosticReadPaths,
2033
+ ...(repairContextPaths.length ? repairContextPaths : optionalRepairRereadPaths),
2034
+ ]
2035
+ .filter((item, index, items) => items.indexOf(item) === index)
2036
+ .slice(0, 8);
2023
2037
  const constrainedRepairRead = boundedRepairReadPaths.length
2024
2038
  ? constrainReadFilePaths(
2025
2039
  available.get("read_file"),
2026
2040
  boundedRepairReadPaths,
2027
- repairContextPaths.length
2028
- ? "failed-test-evidence-refresh"
2029
- : "deepseek-failed-test-source-reread"
2041
+ diagnosticReadPaths.length
2042
+ ? "failed-test-diagnostic-read"
2043
+ : repairContextPaths.length
2044
+ ? "failed-test-evidence-refresh"
2045
+ : "deepseek-failed-test-source-reread"
2030
2046
  )
2031
2047
  : available.get("read_file");
2032
2048
  const toolNames = config.testFailureRepairMutationRequired === true
2033
2049
  ? [
2034
- ...(config.testFailureRepairNeedsPatchContext === true
2035
- ? ["read_file", ...(repairContextPaths.length ? [] : ["search_files"])]
2036
- : optionalRepairRereadPaths.length
2037
- ? ["read_file"]
2050
+ ...(boundedRepairReadPaths.length
2051
+ ? ["read_file"]
2052
+ : config.testFailureRepairNeedsPatchContext === true
2053
+ ? ["read_file", "search_files"]
2038
2054
  : []),
2039
2055
  "apply_patch",
2040
2056
  ...(constrainedInstructionCreate ? ["write_file"] : []),