Review gate REJECT attempt 2/10: The diff removes the `query_neighbors`/`shortest_path`/`subgraph` imports and the dashboard activity helper functions from `api.py` while live routes later in the same file still call them, which will turn `/api/graph/neighbors/{entity}`, `/api/graph/path/{source}/{target}`, `/api/graph/cluster/{entity}`, and `/api/dashboard/activity` into runtime 500s.
Implement a lifecycle state machine for artifacts governed by market signals, debate
outcomes, and quality gates. Artifacts progress through states based on quality evidence,
not arbitrary decisions.
lifecycle_state TEXT DEFAULT 'draft' to artifacts tablelifecycle_changed_at TEXT for tracking state durationtransition_lifecycle(artifact_id, new_state, reason) functionedit_history with structured reasonGET /api/artifacts/lifecycle-summary — counts by statePOST /api/artifact/{id}/transition — manual transition (governance override)exch-qm-01-MEXT — Market prices needed for threshold-based transitionsexch-qm-05-GATE — Quality gates needed for draft → listed transitionexch-qm-07-DASH — Dashboard shows lifecycle distribution{
"_gate_retry_count": 2,
"_gate_last_decision": "REJECT",
"_gate_last_reason": "The diff removes the `query_neighbors`/`shortest_path`/`subgraph` imports and the dashboard activity helper functions from `api.py` while live routes later in the same file still call them, which will turn `/api/graph/neighbors/{entity}`, `/api/graph/path/{source}/{target}`, `/api/graph/cluster/{entity}`, and `/api/dashboard/activity` into runtime 500s.",
"_gate_branch": "orchestra/task/exch-qm--artifact-lifecycle-state-machine-draft-t",
"_gate_changed_files": [
"api.py",
"docs/planning/specs/artifact_paper_debates_spec.md",
"post_process.py",
"scidex/atlas/artifact_registry.py",
"scripts/run_artifact_paper_debates.py"
],
"_gate_diff_stat": "api.py | 6330 ++------------------\n docs/planning/specs/artifact_paper_debates_spec.md | 55 -\n post_process.py | 203 +-\n scidex/atlas/artifact_registry.py | 1351 +----\n scripts/run_artifact_paper_debates.py | 515 --\n 5 files changed, 946 insertions(+), 7508 deletions(-)",
"_gate_history": [
{
"ts": "2026-04-25 23:59:39",
"decision": "REVISE",
"reason": "Auto-deploy blocked: Push failed: [pre-push] BLOCKED: commit range touches critical file 'api.py' but no commit\n[pre-push] message in the range mentions it. This pattern is how\n[pre-push] the 2026-04-11 stale-worktre",
"instructions": "",
"judge_used": "",
"actor": "minimax:76",
"retry_count": 1
},
{
"ts": "2026-04-26 06:20:41",
"decision": "REJECT",
"reason": "The diff removes the `query_neighbors`/`shortest_path`/`subgraph` imports and the dashboard activity helper functions from `api.py` while live routes later in the same file still call them, which will turn `/api/graph/neighbors/{entity}`, `/api/graph/path/{source}/{target}`, `/api/graph/cluster/{entity}`, and `/api/dashboard/activity` into runtime 500s.",
"instructions": "Restore those symbols in `api.py` before merge: either keep the existing imports/helper definitions or replace the call sites with new implementations that are actually imported/defined.\nSmoke-test the affected routes after the refactor so the module still serves graph and dashboard activity endpoints without `NameError` failures.",
"judge_used": "codex:codex",
"actor": "minimax:72",
"retry_count": 2
}
],
"_gate_judge_used": "codex:codex",
"_gate_last_instructions": "Restore those symbols in `api.py` before merge: either keep the existing imports/helper definitions or replace the call sites with new implementations that are actually imported/defined.\nSmoke-test the affected routes after the refactor so the module still serves graph and dashboard activity endpoints without `NameError` failures."
}