fix(workflow): fail when run outputs are missing#187
Open
liamnwhite1 wants to merge 7 commits into
Open
Conversation
Remove the workflow-step communication that previously relied on mutable MYNA_* environment variables between Myna workflow stages. Changes: - add explicit `WorkflowContext` support for input file, current step, previous step, step class, and step index - update `MynaApp` to consume explicit workflow context first while preserving legacy environment-variable fallback for direct script invocation - run component configure/execute/postprocess stages in-process instead of launching Python wrapper subprocesses - preserve stage CLI argument behavior by temporarily patching `sys.argv` during in-process stage calls - update `myna run` and `myna sync` to pass workflow state directly to components instead of mutating `MYNA_*` variables - replace affected app/database direct env reads with context-backed accessors or app instance attributes - add regression tests for context propagation, stage argument forwarding, and absence of workflow env mutation Closes #125 Verification: - `uv run pytest` - 55 passed, 1 skipped, 11 deselected
Add guardrails so future workflow, component, app, and database architecture changes are less likely to land without corresponding documentation updates. Changes: - add an architecture-impact item to the agent handoff checklist - add a PR template checkbox requiring architecture/docs impact consideration - extend `scripts/check_docs_harness.py` to detect architecture-sensitive changed files and require updates to architecture/developer/decision docs - update architecture and documentation guidance to describe the expanded harness check Validation: - `python3 scripts/check_docs_harness.py` - `uv run python scripts/check_docs_harness.py` - `python3 -m py_compile scripts/check_docs_harness.py` - `git diff --check`
Update agent PR guidance to require inspecting and completing the repository pull request template when drafting or opening PRs. Changes: - clarify AGENTS.md PR guidance to preserve template headings and checklist - add docs harness checks for required PR template headings and agent guidance - document the expanded harness validation in docs/documentation.md Validation: - python3 scripts/check_docs_harness.py - python3 -m py_compile scripts/check_docs_harness.py - git diff --check
46e8c4b to
2696c7f
Compare
46c7077 to
a17d3be
Compare
2696c7f to
e163152
Compare
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
Make workflow runs fail when an executed step does not produce all expected valid outputs.
Related issues
Details
This fixes a bug where example tests could pass even when a workflow case failed to complete.
Component.run_component()previously printed a warning if an execute stage finished but the expected output files were missing or invalid. Because no exception was raised, pytest and CI could still report success.The fix changes that post-run validation path to raise a
RuntimeErrorafter listing the expected output files. A regression test covers an execute stage that returns successfully but leaves its declared output missing.Impact
Risk level: Low.
This changes failure behavior for workflows with declared output requirements: missing or invalid outputs after execution now fail loudly instead of logging a warning. That should make example tests and CI catch incomplete runs reliably.
Testing strategy
Environment:
.venvCommands run:
.venv/bin/python -m pytest tests/test_workflow_context.py.venv/bin/python -m pytest tests/test_workflow_context.py tests/test_component_output_paths.py.venv/bin/python -m pytestgit diff --checkNote:
uvwas not available in this shell, so testing used the repo.venv. External example CI jobs were not run locally because they require the external application/container environment.Checklist
ARCHITECTURE.md, developer docs,and/or ADRs where needed.