fix(runner): validate step templates before provider calls - #40
Merged
Conversation
Preflight every prompt dependency before execution so a malformed later step cannot trigger an unrecorded earlier provider call.
sturlese
force-pushed
the
fix/bughunt-preflight-step-templates
branch
from
August 29, 2026 22:21
4010602 to
60aaee3
Compare
Owner
Author
Adversarial gate: PASSThe first review found that caller-controlled Final evidence for commit
UX review was skipped because the change preserves the existing error text and command flow; it only moves rejection ahead of provider resolution and calls. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This bughunt fix validates every workflow step dependency before execution, so a malformed later prompt cannot cause an earlier provider call that leaves no evidence.
Bug
A workflow whose second or later step referenced an unavailable placeholder was accepted until that step rendered. Earlier steps had already called the provider by then, but the resulting
VariableErrorremained intentionally unrecorded as a configuration error.Root cause
Prompt templates were rendered lazily inside the provider-call loop. Only declared external variables were checked before execution; dependencies on prior step outputs were not preflighted.
Fix
steps.*for runner-generated outputs so callers cannot spoof future dependencies.VariableErrorbehavior while guaranteeing it occurs before provider resolution or calls.Testing
.venv/bin/python -m pytest tests/test_runner.py -q— 17 passed..venv/bin/python -m pytest --cov=flightdeck --cov-fail-under=85— 248 passed, 94.23% coverage..venv/bin/ruff check src tests— passed.