Skip to content

write: create parent directories; minimal_tools: add lex_test; run.lex: stop discarding the final message - #100

Merged
alpibrupa merged 1 commit into
mainfrom
fix-pipeline-run-findings
Sep 3, 2026
Merged

write: create parent directories; minimal_tools: add lex_test; run.lex: stop discarding the final message#100
alpibrupa merged 1 commit into
mainfrom
fix-pipeline-run-findings

Conversation

@alpibrupa

Copy link
Copy Markdown
Contributor

Three real bugs found by auditing a full 4-agent pipeline run
(LEX_PERSIST_TRACE=1, thanks to #99) end to end via lex-trail.

  1. write failed on any nonexistent parent directory with a bare OS
    error, no recovery hint — despite spec_agent/test_agent's own
    prompts telling them to write into .lex/specs/... / tests/....
    Fixed by mkdir -p'ing first, via std.process (already in the
    tool's effect row — no Tool type change). Also drops the now-stale
    "use plain filenames" pitfall from lex_lang.lex, which documented
    the workaround instead of the tool being fixed.
  2. dynamic_tools() never included lex_test — local-model agents
    had no way to call the tool their own prompt names. Today's test run
    improvised with lex_run(fn_name: "run_all"), which genuinely passed
    but isn't recognised by lex-llm#51's is_verification_tool, so the
    run never got credit for finishing. Added test_tool.tool() to
    minimal_tools().
  3. print_step discarded StepDone's message (io.print(""))
    instead of printing it — invisible on a normal completion (its text
    already streamed via TextChunks) but a max_steps turn skips
    straight to StepDone, so a run that hit the budget printed nothing
    explaining why. Exactly what happened to today's test node.

lex check --strict, lex fmt --check, lex test, and the bar-mode
gate are all green. ensure_parent_dir verified directly.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

…x: stop discarding the final message

Three real bugs found by auditing a full 4-agent pipeline run
(LEX_PERSIST_TRACE=1) end to end:

1. write failed outright on any path whose parent directory didn't
   exist yet — a bare "No such file or directory (os error 2)", no
   hint to mkdir first. Every agent that hit this recovered by falling
   back to a flat filename, but two prompts actively tell agents to
   write into subdirectories that don't exist yet
   (spec_agent: ".lex/specs/<module>_specs.lex",
   test_agent: "tests/<module>_test.lex") — both ran into exactly this
   during today's pipeline run, wasting real turns each time. Fixed by
   mkdir -p'ing the parent directory (via std.process, already in the
   tool's effect row — no Tool type change needed) before writing.
   Also drops the now-stale "use plain filenames, not subdirectory
   paths" pitfall from lex_lang.lex's own reference, which was
   documenting the workaround rather than fixing the tool.

2. dynamic_tools() (what every local-model agent actually calls) never
   included test_tool (lex_test) — it's cloud-only, in lex_tools(),
   never in minimal_tools(). test_agent.lex's own prompt names
   lex_test as how to verify a suite, but a local-model test run had
   no way to call it. Today's run improvised with
   lex_run(fn_name: "run_all") instead — which worked, genuinely
   passed, but isn't recognised as a verification call by
   lex-llm#51's is_verification_tool, so the run never got credit for
   finishing and burned its full step budget anyway. Added
   test_tool.tool() to minimal_tools().

3. bootstrap/run.lex's print_step discarded StepDone's actual message
   (`io.print("")`) instead of printing it. A normal completion's text
   already streamed via TextChunk deltas before StepDone, which is why
   this went unnoticed — but a max_steps turn skips straight to
   StepDone with no preceding deltas, so a run that hit the budget
   printed nothing explaining why. Today's pipeline run's test node hit
   this exactly: the log just stopped after the last tool call, no
   [max_steps reached] anywhere, until the underlying trail (lex-trail,
   LEX_PERSIST_TRACE) was inspected directly.

lex check --strict, lex fmt --check, lex test, and the bar-mode gate
are all green. ensure_parent_dir verified directly: creates a fresh
nested directory tree from nothing before write proceeds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alpibrupa
alpibrupa merged commit 38ab703 into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant