fix: correct 3 test bugs from workflow migration to build_workflow - #1376
fix: correct 3 test bugs from workflow migration to build_workflow#1376osilkin98 wants to merge 7 commits into
Conversation
…1346) Delete 17 workflow functions (~3,300 lines) from definitions.py, their registry entries, WORKFLOW_META entries in skill_export.py, MODE_PHASES/ MODE_AGENT_TO_PHASE/MODE_EVENT_TO_PHASE entries in visualizer/state.py, and all associated artifacts. Deleted workflow functions: improve, research, meta, discover, review, refine, skill_refine, doc_generate, doc_update, spec_update, frontend_design, frontend_design_scan, frontend_design_discover, evolve, parallel_improve, founder, study_standalone. Surviving modes: design, create, spec-generate (plus all contributed benchmark workflows untouched). Kept as library functions (not registered): build_workflow (called by design_workflow), _study_subgraph, _deep_qa_subgraph, _research_subgraph (imported by deep_qa.py and research.py). Synced all 6 locations: registry, WORKFLOW_META, MODE_*_TO_PHASE, _auto_detect_mode, --mode help text, CEO routing tables. Deleted artifacts: factory/agents/prompts/frontend_design/ (13 files), factory/templates/design_checks/ (6 scripts), 6 test files for deleted modes, 18 skill directories (generated, not tracked). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test_workflow_integration.py: use 'archivist_build' node (build_workflow has archivist_build/archivist_plan, not 'archivist') - test_workflow_qa.py: remove test_registered checking deep-qa in registry (deep-qa was intentionally removed from register_all) - test_cycle_analyzer.py: use 'researcher_similar' node (build_workflow uses forked researcher nodes, not a single 'researcher') Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…moval Update test assertions across 5 files to match the reduced workflow registry after removing 17 dead modes in the prior commit: - test_prompts.py: Replace build/improve workflow refs with design workflow (16 tests fixed) - test_visualizer.py: Replace improve/research/build/meta mode-specific phase tests with design mode tests (16 tests fixed) - test_lazy_loading.py: Update expected workflow set, replace deep-qa with swebench for lazy import test (3 tests fixed) - test_workflow_research.py: Replace registration assertions with not-registered check (2 tests fixed) - test_dashboard.py: Replace improve mode phase-detail test with design mode (1 test fixed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c6f9f6e to
5ed3499
Compare
Sentrux Quality ReportAbsoluteDiff (vs base branch) |
Clean up 16 lint errors across 11 files introduced during rebase: - Remove unused imports (build_workflow, FnNode, register_all) - Remove stale noqa: F401 directives on symbols that are now used - Remove noqa directives for non-enabled rules (ANN001, ANN202, BLE001, PLW0603, F841) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test_cli.py: remove templates/ dir assertion since factory/templates/ is now empty after design_checks/ deletion - test_plan_workflow.py: remove test_plan_workflow_validates which calls `factory workflow validate plan` — plan is no longer a separate registry entry (produced via design_workflow(just_plan=True) instead) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1376 +/- ##
==========================================
- Coverage 84.89% 83.29% -1.61%
==========================================
Files 205 205
Lines 23227 23003 -224
Branches 3688 3695 +7
==========================================
- Hits 19719 19160 -559
- Misses 2679 2988 +309
- Partials 829 855 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ceo-review |
There was a problem hiding this comment.
✅ Factory Review: KEEP
Verdict: KEEP
Reason: QA: CLEAN — 4957 tests pass, composite score 0.9633, all 7 code review categories PASS, adversarial QA verified all 3 fixes correct with 298 tests and 0 failures
QA Analysis
Adversarial QA Report — PR #1376 Test Fixes
Project type: Library (Python CLI + workflow engine)
Date: 2026-08-22
Scope: 3 test bug fixes from workflow migration to build_workflow, plus 2 follow-up stale assertion removals
Smoke Test
Status: VERIFIED
$ uv run python -c "from factory.workflow.definitions import build_workflow, register_all; build_workflow(); register_all()"
No errors. Core workflow imports and construction succeed.
Test Plan
Derived from PR #1376 commit 0c176b80 which fixes 3 test bugs:
- Fix 1:
test_workflow_integration.py:143— changedwf.nodes.get('archivist')towf.nodes.get('archivist_build') - Fix 2:
test_workflow_qa.py:155-157— removedtest_registeredcheckingdeep-qainregister_all() - Fix 3:
test_cycle_analyzer.py:397-400— changed'researcher' in r.node_traceto'researcher_similar' in r.node_trace
Plus follow-up commit ec5d1b4f removing 2 additional stale assertions in test_cli.py and test_plan_workflow.py.
Acceptance Criteria Verification
Criterion 1: archivist → archivist_build node name fix
Status: VERIFIED
Evidence — node existence check:
$ uv run python -c "from factory.workflow.definitions import build_workflow; wf = build_workflow(); print('archivist_build:', 'archivist_build' in wf.nodes); print('archivist:', 'archivist' in wf.nodes)"
archivist_build: True
archivist: False
The old node name archivist does not exist in build_workflow(). The fix to archivist_build is correct.
Evidence — test execution:
$ uv run pytest tests/test_workflow_integration.py::TestImproveWorkflowMock::test_improve_archivist_nonblocking -v
PASSED
Criterion 2: Removal of test_registered checking deep-qa in register_all()
Status: VERIFIED
Evidence — registry check:
$ uv run python -c "from factory.workflow.definitions import register_all; all_wf = register_all(); print('deep-qa in register_all:', 'deep-qa' in all_wf); print('registered:', sorted(all_wf.keys()))"
deep-qa in register_all: False
registered: ['create', 'design', 'devopsgym', 'featurebench', 'legacybench', 'mini-swebench', 'outer-loop', 'programbench', 'salitrap', 'spec-generate', 'swebench', 'swebenchifyhard', 'terminalbench', 'tomswe']
deep-qa was intentionally removed from register_all() as part of the workflow mode removal. The removed assertion was stale. The deep-qa workflow still exists as a subgraph (via deep_qa_workflow()) and is tested separately — only the standalone registration was removed.
Evidence — test execution:
$ uv run pytest tests/test_workflow_qa.py -v
22 passed in 0.90s
Criterion 3: researcher → researcher_similar node trace fix
Status: VERIFIED
Evidence — node existence check:
$ uv run python -c "from factory.workflow.definitions import build_workflow; wf = build_workflow(); print('researcher_similar:', 'researcher_similar' in wf.nodes); print('researcher:', 'researcher' in wf.nodes)"
researcher_similar: True
researcher: False
build_workflow() uses forked researcher nodes (researcher_similar, researcher_techstack, researcher_pitfalls), not a single researcher. The fix is correct.
Evidence — test execution:
$ uv run pytest tests/test_cycle_analyzer.py::TestCycleAnalyzerDagMapping::test_node_trace_with_workflow -v
PASSED
Criterion 4: Follow-up stale assertion removals (commit ec5d1b4)
Status: VERIFIED
Evidence — test execution:
$ uv run pytest tests/test_cli.py::TestCmdHomeReturnsFactoryDir -v
1 passed in 0.08s
$ uv run pytest tests/test_plan_workflow.py -v
19 passed (test_plan_workflow_validates removed)
Regression Tests
Workflow definitions (62 tests)
Status: VERIFIED
$ uv run pytest tests/test_workflow_definitions.py -v
62 passed in 0.27s
Workflow registry (6 tests)
Status: VERIFIED
$ uv run pytest tests/test_workflow_registry.py -v
6 passed in 0.04s
Workflow research (19 tests)
Status: VERIFIED
$ uv run pytest tests/test_workflow_research.py -v
19 passed in 0.08s
Plan workflow (19 tests)
Status: VERIFIED
$ uv run pytest tests/test_plan_workflow.py -v
19 passed in 0.15s
Skill export (46 tests)
Status: VERIFIED
$ uv run pytest tests/test_skill_export.py -v
46 passed in 0.31s
Full cycle analyzer (43 tests)
Status: VERIFIED
$ uv run pytest tests/test_cycle_analyzer.py -v
43 passed in 0.24s
Full workflow integration (9 tests)
Status: VERIFIED
$ uv run pytest tests/test_workflow_integration.py -v
9 passed in 0.13s
Edge Case Tests
Edge Case 1: archivist_build blocking property
Status: VERIFIED
$ uv run python -c "from factory.workflow.definitions import build_workflow; wf = build_workflow(); print('blocking:', wf.nodes['archivist_build'].blocking)"
blocking: False
The archivist_build node retains the blocking=False property the test asserts.
Edge Case 2: researcher_similar role mapping
Status: VERIFIED
$ uv run python -c "from factory.workflow.definitions import build_workflow; wf = build_workflow(); n = wf.nodes['researcher_similar']; print('role:', n.role)"
role: researcher
The researcher_similar node correctly maps to role researcher, matching the test assertion r.node_trace["researcher_similar"].role == "researcher".
Edge Case 3: deep-qa workflow still functions as subgraph
Status: VERIFIED
$ uv run python -c "from factory.workflow.definitions import deep_qa_workflow; wf = deep_qa_workflow(); print('name:', wf.name); print('nodes:', len(wf.nodes))"
name: deep-qa
nodes: 7
The deep-qa workflow still exists and functions — it was only removed from the standalone registry, not deleted.
Process Cleanup
No servers, tmux sessions, or background processes were started. No cleanup needed.
Summary
| # | Criterion | Status |
|---|---|---|
| 1 | archivist → archivist_build fix |
VERIFIED |
| 2 | Remove stale deep-qa registry assertion |
VERIFIED |
| 3 | researcher → researcher_similar fix |
VERIFIED |
| 4 | Follow-up stale assertion removals | VERIFIED |
| 5 | No regressions in related test suites (224 tests) | VERIFIED |
Total tests executed: 298 (74 directly affected + 224 regression)
Total tests passed: 298
Total tests failed: 0
Adversarial Verdict: PASS
All 3 test fixes are correct and match the actual workflow state after the migration to build_workflow. The node names, registry contents, and role mappings all align. No regressions detected across 7 related test files.
Posted by Factory CEO
Changes
wf.nodes.get("archivist")towf.nodes.get("archivist_build"). The test was migrated from improve_workflow to build_workflow, but build_workflow hasarchivist_buildandarchivist_plannodes, notarchivist.test_registeredmethod that checked'deep-qa' in register_all(). deep-qa was intentionally removed from the registry; the remaining TestDeepQaWorkflow tests that verify the deep_qa.py module itself are kept."researcher" in r.node_traceto"researcher_similar" in r.node_trace. The test was migrated from evolve_workflow to build_workflow, which uses forked researcher nodes (researcher_similar, researcher_techstack, researcher_pitfalls) instead of a singleresearchernode.Test results