[Atlas] Gap-driven analysis pipeline
Goal
Create a mechanism to automatically trigger new analyses from knowledge_gaps. Currently, the agent only picks up gaps with status='open', but 26 gaps are stuck in 'partially_filled' status after one analysis. This pipeline will identify gaps that need re-investigation and promote them back to 'open' status so the agent can run additional analyses.
The system should evaluate gaps based on:
- Time since last analysis (older gaps may benefit from fresh investigation)
- Priority score (high-priority gaps deserve multiple analyses)
- Current status (particularly 'partially_filled' gaps with only 1 analysis)
Acceptance Criteria
☐ CLI command to review and re-open gaps: scidex gaps review
☐ Logic to identify gaps needing re-investigation
☐ Promote high-priority 'partially_filled' gaps back to 'open' status
☐ Log decisions and reasons for re-opening gaps
☐ Test with the current 26 'partially_filled' gaps
☐ Document criteria for when gaps get re-opened
Approach
Read existing gap management code in post_process.py and agent.py
Create gap_pipeline.py with functions:
-
review_gaps() - evaluate which gaps need more investigation
-
reopen_gap(gap_id, reason) - promote gap back to 'open'
-
get_gap_analysis_history(gap_id) - check when last analyzed
Add CLI command in cli.py: scidex gaps review
Implement criteria:
- Partially_filled gaps with priority_score >= 0.9
- Partially_filled gaps analyzed > 7 days ago
- Open gaps remain open
Test on current dataset (3 open, 26 partially_filled, 1 resolved)
Verify agent picks up newly re-opened gapsCriteria for Re-opening
A gap is eligible for re-investigation if:
- Status is 'partially_filled' (exactly 1 analysis)
- AND (priority_score >= 0.9 OR last_analysis_date > 7 days ago)
- Status 'resolved' (2+ analyses) remains resolved
- Status 'open' remains open
Work Log
2026-04-01 16:00 PT — Slot 0
- Started task: Creating gap-driven analysis pipeline
- Read AGENTS.md, agent.py, post_process.py to understand gap lifecycle
- Current state: 3 open, 26 partially_filled, 1 resolved gaps
- Gap status flow: open → partially_filled (1 analysis) → resolved (2+ analyses)
- Agent only picks status='open' gaps via get_top_gap()
- Creating spec file first
2026-04-01 16:50 PT — Slot 0
- Implemented gap_pipeline.py with review_gaps(), reopen_gap(), should_reopen_gap()
- Added CLI commands:
scidex gaps review, scidex gaps reopen, scidex gaps reopen-one
- Criteria: Reopen partially_filled gaps with priority_score >= 0.9 OR last_analysis > 7 days ago
- Fixed database schema issue (no updated_at column)
- Fixed database locking issue (added timeout to connection)
- Tested successfully:
- Review identified 6 candidates (all priority >= 0.9)
- Reopen promoted 6 gaps from partially_filled to open
- Final state: 8 open, 19 partially_filled, 1 resolved, 2 investigating
- Verified syntax and site still functional
- Result: ✓ Complete — Gap pipeline operational, 6 high-priority gaps reopened for re-investigation