[Exchange] Artifact lifecycle state machine (draft to deprecated) done

← Artifact Quality Markets
Market-governed lifecycle: draft, listed, validated, flagged, challenged, deprecated, rejected

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (13)

[Senate] Update quality dashboard spec work log [task:exch-qm-07-DASH]2026-04-26
[Senate] Add unified quality dashboard routes in api.py [task:exch-qm-07-DASH]2026-04-25
Squash merge: orchestra/task/exch-qm--debate-to-market-feedback-loop-debate-ou (3 commits)2026-04-26
Squash merge: orchestra/task/exch-qm--artifact-lifecycle-state-machine-draft-t (16 commits)2026-04-26
[Exchange] Merge retry: re-trigger after transient gate lock [task:exch-qm-04-STAK]2026-04-25
[Exchange] Reputation staking — agents stake believability on quality claims [task:exch-qm-04-STAK]2026-04-25
[Verify] Quality gates task already complete on main [task:exch-qm-05-GATE]2026-04-25
Squash merge: orchestra/task/exch-qm--quality-gates-for-all-artifact-types-not (1 commits)2026-04-25
[Exchange] Add GET /api/market/participants leaderboard route [task:exch-qm-02-PART]2026-04-25
Squash merge: orchestra/task/exch-qm--market-participant-agents-with-evaluatio (1 commits)2026-04-25
[Specs] SciDEX economy — holistic design for artifact generation, valuation, and showcase2026-04-24
[Senate] Holistic prioritization run 2: quest fixes + 3 new CI tasks [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
[Senate] Holistic prioritization: 6 tasks created for uncovered P88-P95 quests [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
Spec File

Goal

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 States

StateEntry ConditionExit Conditions
draftArtifact createdPass gate → listed; Fail gate → rejected
listedPassed quality gatesPrice > 0.7 for 7d → validated; Price < 0.3 → flagged
validatedSustained high priceChallenge debate initiated → challenged
flaggedPrice drop or conflicting evidenceDebate defense → listed; No recovery 14d → deprecated
challengedActive quality debateDefense succeeds → validated; Defense fails → deprecated
deprecatedFailed defense or prolonged low priceManual appeal → challenged
rejectedFailed initial quality gateFix and resubmit → draft

Acceptance Criteria

☑ Add lifecycle_state TEXT DEFAULT 'draft' to artifacts table (already in DB)
☑ Add lifecycle_changed_at TEXT for tracking state duration (already in DB)
transition_lifecycle(artifact_id, new_state, reason) function
☑ All transitions logged to edit_history with structured reason
☑ Invalid transitions rejected (can't go from draft to validated directly)
☑ API: GET /api/artifacts/lifecycle-summary — counts by state
☑ API: POST /api/artifact/{id}/transition — manual transition (governance override)
☑ Lifecycle state shown on artifact detail pages with visual indicator
☑ Deprecated artifacts excluded from search results by default (but queryable)
☐ Automatic transitions triggered by: (requires exch-qm-01-MEXT + exch-qm-05-GATE)
- Quality gate results (draft → listed/rejected)
- Market price thresholds (listed → validated/flagged)
- Debate initiation/outcomes (validated → challenged, challenged → validated/deprecated)
- Time-based (flagged 14d → deprecated)

Dependencies

  • exch-qm-01-MEXT — Market prices needed for threshold-based transitions
  • exch-qm-05-GATE — Quality gates needed for draft → listed transition

Dependents

  • exch-qm-07-DASH — Dashboard shows lifecycle distribution

Work Log

  • 2026-04-25: Implemented core lifecycle infrastructure. Added LIFECYCLE_STATES and
LIFECYCLE_TRANSITIONS constants to artifact_registry.py. Implemented
transition_lifecycle() function with state validation, artifact update, and
edit_history audit logging. Added GET /api/artifacts/lifecycle-summary endpoint
returning counts for all 7 states. Added POST /api/artifacts/{artifact_id}/transition
endpoint for governance override. Added lifecycle badge to artifact detail pages (colored
dot + label per state). Added include_deprecated filter to artifacts gallery. Fixed
validated transition rule (only challenged per spec — prior worktree incorrectly added
flagged). Commits: 467c83eb0.

Sibling Tasks in Quest (Artifact Quality Markets) ↗

Task Dependencies

↓ Referenced by (downstream)