[Senate] Build provenance tracking — link every DB change to agent + task + commit

← All Specs

[Senate] Build provenance tracking — link every DB change to agent + task + commit

Quest: Work Governance Priority: P3 Status: open

Goal

Build provenance tracking — link every DB change to agent + task + commit

Context

This task is part of the Work Governance quest (Senate layer). It contributes to the broader goal of building out SciDEX's senate capabilities.

Acceptance Criteria

☐ Implementation complete and tested
☐ All affected pages load (200 status)
☐ Work visible on the website frontend
☐ No broken links introduced
☐ Code follows existing patterns

Approach

  • Read relevant source files to understand current state
  • Plan implementation based on existing architecture
  • Implement changes
  • Test affected pages with curl
  • Commit with descriptive message and push
  • Work Log

    • 2026-04-20T15:19:00Z — Implemented fix: modified get_db_write() in scidex/core/database.py to auto-populate journal_context from environment variables (SCIDEX_TASK_ID, SCIDEX_COMMIT_HASH, SCIDEX_AGENT_ID, ORCHESTRA_SLOT, SCIDEX_MODEL). This ensures all DB writes via journaled_update_by_keys() and journaled_delete_by_keys() carry provenance context. Verified with test upsert — db_write_journal now shows populated task_id, commit_hash, agent_id, slot_id fields. Commit 88e755b64.

    Tasks using this spec (1)
    [Senate] Build provenance tracking — link every DB change to
    File: eb668f0b51b6_senate_build_provenance_tracking_link_e_spec.md
    Modified: 2026-04-25 23:40
    Size: 1.7 KB