feat(maintain): add promote_check task to ontos maintain#78
Conversation
Add promote_check (order 45) to the maintain pipeline. Runs ontos promote --check non-interactively to report documents ready for promotion from L0/L1 to L2. - New registered task _task_promote_check in maintain.py - Updated docs: Manual and Agent Instructions (8 → 9 tasks) - Annotated migrate_untagged as covering scaffold - Added 2 new tests for promote_check (normal + dry-run) - All 22 maintain tests pass
Review: 3-agent team (Alignment, Code Quality, Adversarial)Verdict: REQUEST CHANGES (test fixes only — production code is sound)Alignment Review — APPROVEPR is well-aligned with project goals. All conventions followed (commit style, branch naming, task registration pattern, test naming). Docs are consistent across Manual, Agent Instructions, and registry test. Design decisions verified in code:
Code Quality Review — COMMENT (2 Major in test quality)Production code is correct and follows established patterns perfectly. Issues are confined to test quality. Adversarial Review — REQUEST CHANGES (1 High, 2 Medium)Core safety claim verified: Consolidated Findings
Implementation PromptThree fixes needed, all in Fix 1:
|
- Fix test_promote_check_task_reports_promotable_docs: monkeypatch cwd to tmp_path so promote scans the fixture, not the real project - Fix test_promote_check_dry_run_skips_scan: patch _run_promote_command directly instead of nonexistent __wrapped__ attribute - Add test_promote_check_reports_failure for the exit_code != 0 branch - Fix pre-existing typo 'documents find' → 'documents found' in promote.py - Add trailing newline to session log
Round 2 Review: All 3 Agents APPROVE
All Round 1 findings resolved
Residual (non-blocking, cosmetic)
Test suite23/23 maintain tests pass. No new issues introduced by the fix commit. Consensus: APPROVE for merge. 🤖 3-agent review by Claude Code |
… consistency
1. Root correctness:
- Add optional repo_root to PromoteOptions
- _run_promote_command uses repo_root when provided, falls back
to find_project_root() for CLI compatibility
- _task_promote_check passes ctx.repo_root, decoupling from CWD
2. Ready semantics:
- --check now reports 'N ready for promotion (M candidates)'
- Ready count = docs with info.promotable == True
- Total candidates = all L0/L1 docs
- Docs updated to reflect 'ready count' semantics
3. Artifact consistency:
- Regenerated Ontos_Context_Map.md and AGENTS.md from commands
4. Tests (29/29 pass):
- test_promote_check_uses_repo_root_not_cwd: regression for root
- test_promote_check_excludes_non_ready_from_ready_count: ready semantics
- Updated assertions in test_promote_parity.py and
test_b2_promote_absolute_path.py for new message format
Summary
Adds
promote_check(order 45) to theontos maintainpipeline. Runsontos promote --checknon-interactively to report documents ready for promotion from L0/L1 to L2.Changes
maintain.py: New registered task_task_promote_checkat order 45Ontos_Agent_Instructions.md: "Maintain Ontos" section updated (8 → 9 tasks)Ontos_Manual.md: Numbered task list updated (8 → 9 tasks)test_maintain.py: Updated registry order assertion + 2 new testsDesign Notes
ontos scaffoldwas not added separately becausemigrate_untagged(order 10) already callsfind_untagged_files+_run_scaffold_command(apply=True)promote_checkuses the existing--checkmode which is non-interactive and read-onlyTests
All 22 maintain tests pass.
Antigravity, powered by Claude