{"quest":{"id":"q-b3fd5789b1fe","name":"Work Governance","description":"Comprehensive governance framework for tracking all work added to SciDEX — who did what, when, why, and at what cost. Includes commit-level provenance, agent accountability scores, automated quality checks, approval workflows, contradiction detection before KG modifications, rollback capability via kg_modifications log, artifact transform audit trail (merge/split/deprecate/supersede operations), supersession tracking, and dashboards showing contribution patterns.","layer":"Senate","priority":90,"status":"active","created_at":"2026-04-03T20:28:32.766222","updated_at":"2026-04-10T14:44:10.355870+00:00"},"tasks":[{"id":"1a3464d6-edac-4bce-a66f-b0ebd8618e12","title":"[Senate] Agent contribution credit pipeline (driver #11)","description":"Recurring driver. Every cycle, scan recent commits + debate_rounds + senate_votes + market_trades since last run, identify the contributing agent (worker_id, persona, account_id), and write a row to `agent_contributions` linking the action to the agent. Idempotent: skip rows already credited (use a max(created_at) high-water mark per source). On no candidates, release as no-op via `orchestra complete --notes`. See economics_participation_drivers_spec.md driver #11.","status":"open","priority":96,"frequency":"every-6h","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-29T01:55:11.140606+00:00","updated_at":"2026-04-29T01:55:11.140606+00:00","summary":"","completion_summary":"Recurring cycle — no repo commits this iteration","completion_notes":"Auto-release: recurring task had no work this cycle","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/economics_participation_drivers_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 7, \"analysis\": 6}, \"completion_shas\": [\"05276ae84ca02f3ef0f7f11ceddf453f8fd4d237\", \"31b1d3196b1d96604009960f1d0d64b1a3a75789\", \"3c28383558e7ef0fc02e3c20ca4b565e19d94929\", \"039554238692ad2484250ab4f038e2eb62b8e1eb\", \"2fe3a243c3dcc4cdbaf652551545fdced9b62348\", \"4993241f9100115ae44ba5b1eccd781c376da5e2\", \"9778aaa10ce1926a0e528d90e86432bbfb0eeddc\", \"a4bab09ec8447fd06a794b2766e71c0bc0b44e66\", \"ddba32a1976d50a5c63b08b6d7d8d35881ea2b03\", \"d7794d05db1fcf1704fc22c70cd5d91f981574f6\", \"77de98b80cbf7c5549ebb7c64298e8f64b01638f\", \"e162c21ff93a947cf6eee5c885d0c7d53c85ab55\"], \"completion_shas_checked_at\": \"2026-04-12T23:56:55.527048+00:00\", \"completion_shas_missing\": [\"405caec628ccb56bed7d21f7399687fb5f80d7e3\", \"602411c207e59a9bfd52fa84f735fb8501b2d6e5\", \"94454d722ae6f8425eca24f5c306f196f7954f77\", \"882fcd8af49c3669d1baaea5a35b81fab17a24cd\", \"b1385dbc6f57eeb3b3ec3f6bb3b263f4e68d3900\", \"0257b0526de6893d2d4202c7e16188ef4c64dc5a\", \"137a279aceb5043251019ef94e16f877d648e596\", \"68ace6335607bb31f530bc093d373adcb04bb916\", \"53b91c48414e701d2bdc6c9ebb2214044f78613a\", \"94b0359fb22d282d7144ca6e0def2a4e54907eec\", \"15493f2895df3bc518f405b7b4740d7f0a5d1ca1\", \"e5af8677edac487b296f626fb3ae19a45362be41\", \"9e13a177afb4b5daf3103949e2569e3d34e8eddb\", \"b0c840560672ad27c80d14976afd40818ba302fb\", \"ae576fcd541da5e7bd1610b17294f5b20c45dcc6\", \"abf5335022ba4a8e74e33e8f6c0d7afb94f9699c\", \"2fa56b6558ed003541b24923e7d31ae12be0db09\", \"fe18401d364d1b699023f84a0d8121f806d579b5\", \"4ae32657a2f659a4956aa27e8cff821ff3971eb8\", \"4dce54afe0771ccbcaff34dfef45dc529720517f\", \"5261f9530688ea155bc2dea3f6528f8900da3a6c\", \"d39ede208d3c4c063cd3268af0096936f66f1b8f\", \"50ea5b6a97d182a238e82a73dfb0af2b39910ce9\", \"24d09c154de42408244dbac5e8df008f91a1572c\", \"b6235be1534257a3c94af2b6414090986125c917\", \"ddf92e1f608bd32605cd5dd8ae44f692833efccb\", \"72667fbc394bb90d28d037c5878e3b63cc2a494b\", \"ff71807dfe4544b31658448a020bf73c81f3a617\", \"0d02aa54076fbc5f933cbaf6d4202440cc9e7ce0\", \"58d9932352db2564f010e1309e40bdb3cc4df400\", \"237a192115016b98692dc75edae8df903f02b47a\", \"f9bd5492110e112d26b452edff5552c7d7470e5b\", \"a91f82871ac5e27b39f66a3e8c4dc741e832b541\", \"42cbd47d032341ba1bce96ae813c227868c8b244\", \"b91a01426550015f8df94b5980af7c28eb04efdc\", \"2a44126632f44fda0d224e09c8e9fa64d77fbf84\", \"4a29b0123b4874b276ac40997aa93fdacc8548b0\", \"06991f55b808c6d8db630056833132fe326a461d\", \"2689bcc7a641cfa0959481017dd9bdec788930d8\", \"6acb8430154639d48ee8d12bdb0df8000d3640f1\", \"64cd782be2a19f9cccad129c5ac30a3bd2f410c8\", \"2a6772910327c44679d09829ff48b1e7a3d12f2e\", \"e7962e838a2bac6ba25f0eea37a551713f920451\", \"ffbe330baa40e6696d03780c1e46af00999b20cc\", \"8399e0b72f542175d7121d6f4aedd4b917de810b\", \"6c233f3c3041168d1647c11dd1a47a5851fb13f3\", \"0616fc82f90c18cdc4a9d9dd454d9f86c15ea0ea\", \"549808da29fe4d41600186ca21042ffbfa3d6ae1\", \"9a9ac40793768e28f34f80f9118da797f6cdf7a1\", \"c1611828d574847118389f2598ec92a220ef9b4f\", \"95fe0ad8e2a9affe442cdda4491699718ec6dc05\", \"5901d08739fbe8b4f442adbe7cc29d70a810427b\"]}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"recurring","pr_links":[],"commit_links":[]},{"id":"428c719e-a95a-40ca-8d8c-cba13e2f60cf","title":"[Senate] World-model improvement detector (driver #13)","description":"Recurring driver. Every cycle, scan knowledge_gaps for new 'resolved' rows, scan artifact_links for analyses crossing citation thresholds (>=3 medium, >=10 high), scan hypotheses for new high-confidence (>=0.7) entries. Each detection writes a row to world_model_improvements with magnitude → payout_pool (low=50, med=200, high=500, very_high=1500). Idempotent. See economics_v2_credit_backprop_spec.md driver #13.","status":"open","priority":96,"frequency":"every-6h","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-29T01:38:30.601547+00:00","updated_at":"2026-04-29T01:38:30.601547+00:00","summary":"","completion_summary":"Driver #13 cycle completed. This run detected and wrote 24 new `hypothesis_matured` improvement events (hypotheses with `confidence_score ≥ 0.7` that had no prior improvement row). The `world_model_improvements` pending pool grew from 368 to 392 rows. The driver's three detectors — resolved gaps, citation thresholds, and high-confidence hypotheses — all ran cleanly. No code changes were required; the existing implementation with DB-level idempotency checks is working correctly.","completion_notes":"Auto-release: recurring task had no work this cycle","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/economics_v2_credit_backprop_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 6, \"analysis\": 6, \"safety\": 9}, \"completion_shas\": [\"6f37492e489d95f8e1d2da76793dd60d1826289e\", \"ba9153a09d61ebb35bea2bb459e82d2e1cbec7ae\"], \"completion_shas_checked_at\": \"2026-04-12T22:25:51.344678+00:00\", \"completion_shas_missing\": [\"890749f3bf91486a7c5261a0c49f42c8776f40f4\", \"e0fd764e4b3f7d0112bc1b480e7af4d979b74574\", \"0d00883c440be4f588262af1853887f3bdeb9379\", \"644787d2fb8276578ca7e5100afa0927e38b21d8\", \"0567540c4e34cea4b61280bfc9c4ae3284b6d349\", \"0064c58de883a2285ceab2332cbaef59580dc9aa\", \"2f5cb207381c77885536e22305d483b0d3dca548\", \"391a979da2400978dc0694910e1a07043c82db7c\", \"cd0e791606c9563c3e9e604c11b649d64af1e838\", \"6bef402d79275752bdf8a9af1801f51378fc5530\", \"f3c45d0fce2ff9dd1c895901ecb5c7e958d3adc2\", \"b64ade1e7f56a48b6512658bc8187776260425d7\", \"8ef41fe5d5541a0caf7bedd0075ecb761d6d3c48\", \"b348e7e7670bb4064b818238fadd5199094f78bc\", \"51b6e43ee010c8906f50459121decb289e011e22\", \"5613f5ae366acb95501ffb0e0f0866a48839bec6\", \"6e53463223c035576b94be1009de5e5db0139701\", \"f8dc60539570e545d99af7ea5788fc8d60561261\", \"5487226585db91c9b2f67437cf64035e154e86aa\", \"53e2d56ad87f7f1100862464c07bc98b4a4fe740\", \"0c1c848d122a1cc8902c9145fd63d1542cefc903\", \"c87512a0c360a994a37aac798ef571315c316097\", \"28aa7a12945ff666ca33f59450719935ebf88f09\", \"794c42592973b10e6b780b886e8313f52a2af686\", \"0dc727390a92f49960a3754c82edefaf3f7ec1ea\", \"424c9bc5dfbe813f34fa6834757d4bb595743e1c\", \"e68a3d884680887898f111390aa7ae11ed8d2df4\", \"b3d4ea7ccf8005e8599d75d087188c1ea53a803a\", \"e4d9d6a8d834378730568d381434b059d63eb3a4\", \"a52118a6fe14a2b2510a3a0377665572574a6ce2\", \"f3ee47aa662da01e067dd8d15facfedfeea66529\", \"5128f4675777ed06857c48dfb8203e5aa8b2626a\", \"e62ea65d164048f7688a27426252a302e0a6c240\", \"b99b99fa1df07860ce22e1fb81faf9007803e9da\", \"82affb5f9447717e9194eb8c56e4f9ed060a2930\", \"1956ee4102fe0c7d63dd393f058af084a65faed2\", \"16179f3cf88044334e15cdcf3750c45802d68bc2\", \"c198cb98666218dd7d87a82ad9b81a28cbaf24e6\", \"afa60621eb64d72bd8cb6ab11f7b70cd52076d4d\", \"3e25b1edb3ea58644ce9f3012bab1d09f6f649ad\", \"c96186a173962a46f7e21825330127bc4d392cb5\", \"571b655d8f7529cf2c2326ed6c379d71cd0e4120\", \"1710c404a0677214375261da21dcfa7912ddea07\", \"fb7172ee86403bd331a0554b98fa59e6f360b2f4\", \"b3249e57c706119a24c9621f9710328d0beb856d\", \"043b1617d1c884e0c16d7593d90aca5cfc5df2a6\", \"87d0eada70235d4db745b1bc043274ca708082bd\", \"c8bbc1102fb1a4f7447729b8cecf05ec14cf40b1\", \"e3bf8ce91a7344f2cf12fd3a7b50a3eed1085c9f\", \"74b1b757b44e0ea0334eeb0d2c4240012b3c49e3\", \"264058f24d4ee15a51fc0e5bdb2fe2402ba2f112\", \"94185256a9e1c81eb215ba70a65809daa33a5bef\", \"92d3e0ffe3bd13abafb33aace2343c0258ab971e\", \"9e143a3431e59c1b37c4daf49efc5509198f6ca4\", \"fbb4d913df13e4642e8d838e59e28423a2802ac6\", \"ef65786c3ae44aa1412ead12075475646e23dd9b\", \"73fbb026a92f2f7a87782b9521e8b4a90336e1b7\", \"1f0f0fe5da57fdea2484698c1dd55abb697f2673\", \"7d827cc655319ec65f95e14e290f330c4fb1b50f\", \"063d3f66a1e393081c8f28bbadb52d40cd165778\", \"cf4418b577d69319254f63315ed963a920bdb0c5\", \"e5e3481cc73bda14563842906e21da3f83911f1c\", \"437d484d0659d04859c0515dfdf58706b80b7849\", \"29966f5f7d6ce53bf75bd1fac1fddce1a84c0fc9\"]}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"recurring","pr_links":[],"commit_links":[]},{"id":"eb53fe78-6928-4735-a6bf-633f01b8dff9","title":"[Senate] Capture belief snapshots for 50 hypotheses missing recent state","description":"235 hypotheses lack a belief snapshot in the last seven days. Belief snapshots are required to measure convergence and evidence-driven confidence changes.\n\n## Acceptance criteria (recommended — see 'Broader latitude' below)\n\n- 50 hypotheses gain current belief_snapshots rows\n- Snapshots capture score, evidence count, citation count, and reviewer count from live state\n- Remaining hypotheses missing recent snapshots is <= 185\n\n## Before starting\n\n1. Read this task's spec file and check for duplicate recent work.\n2. Evaluate whether the gap and acceptance criteria target the right problem. If you see a better framing, document it before executing.\n3. Check adjacent SciDEX layers for cross-links or structural follow-up opportunities.\n\n## Broader latitude\n\nYou are invited to question the framing, propose structural or algorithmic improvements, and strengthen artifacts beyond the minimum where the evidence supports it. Document any such contribution in the work log and commit messages.\n\n## Suggested approach\n\n1. Select active hypotheses without a belief snapshot in the past seven days.\n2. Compute current score, evidence_count, citations, and reviewer_count from existing fields and links.\n3. Insert idempotent belief_snapshots rows and verify no duplicate same-day snapshots.\n","status":"done","priority":81,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-27T00:10:18.474512+00:00","updated_at":"2026-04-27T00:10:18.474512+00:00","summary":"","completion_summary":"[Senate] Work log: backfill 50 belief snapshots, 11 missing remain [task:eb53fe78-6928-4735-a6bf-633f01b8dff9]","completion_notes":"Auto-completed by supervisor after successful deploy to main","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/quest_engine_belief_snapshot_backfill_spec.md","provider":"any","payload_json":"{\"requirements\": {\"analysis\": 6, \"reasoning\": 6}}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"t-proof-gated-updates","title":"Proof-gated KG updates","description":"Before automated KG modification: contradiction check against T0/T1 edges, consistency score on local subgraph, rollback link. API: /api/contradiction-check.\n\n\n## REOPENED TASK — CRITICAL CONTEXT\n\nThis task was previously marked 'done' but the audit could not verify\nthe work actually landed on main. The original work may have been:\n- Lost to an orphan branch / failed push\n- Only a spec-file edit (no code changes)\n- Already addressed by other agents in the meantime\n- Made obsolete by subsequent work\n\n**Before doing anything else:**\n\n1. **Re-evaluate the task in light of CURRENT main state.** Read the\n   spec and the relevant files on origin/main NOW. The original task\n   may have been written against a state of the code that no longer\n   exists.\n\n2. **Verify the task still advances SciDEX's aims.** If the system\n   has evolved past the need for this work (different architecture,\n   different priorities), close the task with reason \"obsolete: <why>\"\n   instead of doing it.\n\n3. **Check if it's already done.** Run `git log --grep='<task-id>'`\n   and read the related commits. If real work landed, complete the\n   task with `--no-sha-check --summary 'Already done in <commit>'`.\n\n4. **Make sure your changes don't regress recent functionality.** Many\n   agents have been working on this codebase. Before committing, run\n   `git log --since='24 hours ago' -- <files-you-touch>` to see what\n   changed in your area, and verify you don't undo any of it.\n\n5. **Stay scoped.** Only do what this specific task asks for. Do not\n   refactor, do not \"fix\" unrelated issues, do not add features that\n   weren't requested. Scope creep at this point is regression risk.\n\nIf you cannot do this task safely (because it would regress, conflict\nwith current direction, or the requirements no longer apply), escalate\nvia `orchestra escalate` with a clear explanation instead of committing.\n","status":"done","priority":70,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-20T16:58:23.753010+00:00","updated_at":"2026-04-20T16:58:23.753010+00:00","summary":"","completion_summary":"Already resolved: f869b667d landed on main. /api/contradiction-check with contradiction_check against T0/T1, consistency_score, rollback_info confirmed in main.","completion_notes":"Verification confirmed: commit f869b667d is in origin/main, functions present in epistemic_tiers.py at lines 271-432, API route at api_routes/epistemic.py:161-179. Task requirements already satisfied.","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"","provider":"any","payload_json":"{\"_reset_note\": \"This task was reset after a database incident on 2026-04-17.\\n\\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\\ncorruption. Some work done during Apr 16-17 may have been lost.\\n\\n**Before starting work:**\\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\\n\\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\\nSCIDEX_DB_BACKEND=postgres env var.\", \"_reset_at\": \"2026-04-18T06:29:22.046013+00:00\", \"_reset_from_status\": \"done\", \"completion_shas\": [\"dd65b71e7\"], \"completion_shas_checked_at\": \"2026-04-20T16:58:23.713316+00:00\"}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":"pass","verification_notes":"Already resolved: f869b667d landed on main. /api/contradiction-check with contradiction_check against T0/T1, consistency_score, rollback_info confirmed in main.","task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"b340fd5d9dd9","title":"[Senate] Create automated quality checks for new hypotheses, wiki pages, KG edges","description":"\n\n\n## REOPENED TASK — CRITICAL CONTEXT\n\nThis task was previously marked 'done' but the audit could not verify\nthe work actually landed on main. The original work may have been:\n- Lost to an orphan branch / failed push\n- Only a spec-file edit (no code changes)\n- Already addressed by other agents in the meantime\n- Made obsolete by subsequent work\n\n**Before doing anything else:**\n\n1. **Re-evaluate the task in light of CURRENT main state.** Read the\n   spec and the relevant files on origin/main NOW. The original task\n   may have been written against a state of the code that no longer\n   exists.\n\n2. **Verify the task still advances SciDEX's aims.** If the system\n   has evolved past the need for this work (different architecture,\n   different priorities), close the task with reason \"obsolete: <why>\"\n   instead of doing it.\n\n3. **Check if it's already done.** Run `git log --grep='<task-id>'`\n   and read the related commits. If real work landed, complete the\n   task with `--no-sha-check --summary 'Already done in <commit>'`.\n\n4. **Make sure your changes don't regress recent functionality.** Many\n   agents have been working on this codebase. Before committing, run\n   `git log --since='24 hours ago' -- <files-you-touch>` to see what\n   changed in your area, and verify you don't undo any of it.\n\n5. **Stay scoped.** Only do what this specific task asks for. Do not\n   refactor, do not \"fix\" unrelated issues, do not add features that\n   weren't requested. Scope creep at this point is regression risk.\n\nIf you cannot do this task safely (because it would regress, conflict\nwith current direction, or the requirements no longer apply), escalate\nvia `orchestra escalate` with a clear explanation instead of committing.\n","status":"done","priority":3,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-20T22:22:28.525512+00:00","updated_at":"2026-04-20T22:22:28.525512+00:00","summary":"","completion_summary":"[Senate] Update spec work log: quality checks implemented [task:b340fd5d9dd9]; [Senate] Wire quality checks into db_writes and add /api/quality/validate endpoint; update api.py [task:b340fd5d9dd9]; [Senate] Add quality_checks module with validators for hypotheses, wiki pages, KG edges [task:b340fd5d9dd9]","completion_notes":"Auto-completed by supervisor after successful deploy to main","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/b340fd5d9dd9_senate_create_automated_quality_checks_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 8, \"safety\": 9}, \"auto_tagged_at\": \"2026-04-03T22:29:52.519439\"}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"eb668f0b51b6","title":"[Senate] Build provenance tracking — link every DB change to agent + task + commit","description":"\n\n\n## REOPENED TASK — CRITICAL CONTEXT\n\nThis task was previously marked 'done' but the audit could not verify\nthe work actually landed on main. The original work may have been:\n- Lost to an orphan branch / failed push\n- Only a spec-file edit (no code changes)\n- Already addressed by other agents in the meantime\n- Made obsolete by subsequent work\n\n**Before doing anything else:**\n\n1. **Re-evaluate the task in light of CURRENT main state.** Read the\n   spec and the relevant files on origin/main NOW. The original task\n   may have been written against a state of the code that no longer\n   exists.\n\n2. **Verify the task still advances SciDEX's aims.** If the system\n   has evolved past the need for this work (different architecture,\n   different priorities), close the task with reason \"obsolete: <why>\"\n   instead of doing it.\n\n3. **Check if it's already done.** Run `git log --grep='<task-id>'`\n   and read the related commits. If real work landed, complete the\n   task with `--no-sha-check --summary 'Already done in <commit>'`.\n\n4. **Make sure your changes don't regress recent functionality.** Many\n   agents have been working on this codebase. Before committing, run\n   `git log --since='24 hours ago' -- <files-you-touch>` to see what\n   changed in your area, and verify you don't undo any of it.\n\n5. **Stay scoped.** Only do what this specific task asks for. Do not\n   refactor, do not \"fix\" unrelated issues, do not add features that\n   weren't requested. Scope creep at this point is regression risk.\n\nIf you cannot do this task safely (because it would regress, conflict\nwith current direction, or the requirements no longer apply), escalate\nvia `orchestra escalate` with a clear explanation instead of committing.\n","status":"done","priority":3,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-20T22:20:42.147783+00:00","updated_at":"2026-04-20T22:20:42.147783+00:00","summary":"","completion_summary":"[Senate] Update spec work log: provenance tracking via get_db_write fix [task:eb668f0b51b6]; [Senate] Auto-populate journal_context from env in get_db_write — link every DB change to agent+task+commit [task:eb668f0b51b6]","completion_notes":"Auto-completed by supervisor after successful deploy to main","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/eb668f0b51b6_senate_build_provenance_tracking_link_e_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 7, \"reasoning\": 6}}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"2be7a18f2a5a","title":"[Senate] Build governance dashboard showing contribution patterns across agents","description":"\n\n\n## REOPENED TASK — CRITICAL CONTEXT\n\nThis task was previously marked 'done' but the audit could not verify\nthe work actually landed on main. The original work may have been:\n- Lost to an orphan branch / failed push\n- Only a spec-file edit (no code changes)\n- Already addressed by other agents in the meantime\n- Made obsolete by subsequent work\n\n**Before doing anything else:**\n\n1. **Re-evaluate the task in light of CURRENT main state.** Read the\n   spec and the relevant files on origin/main NOW. The original task\n   may have been written against a state of the code that no longer\n   exists.\n\n2. **Verify the task still advances SciDEX's aims.** If the system\n   has evolved past the need for this work (different architecture,\n   different priorities), close the task with reason \"obsolete: <why>\"\n   instead of doing it.\n\n3. **Check if it's already done.** Run `git log --grep='<task-id>'`\n   and read the related commits. If real work landed, complete the\n   task with `--no-sha-check --summary 'Already done in <commit>'`.\n\n4. **Make sure your changes don't regress recent functionality.** Many\n   agents have been working on this codebase. Before committing, run\n   `git log --since='24 hours ago' -- <files-you-touch>` to see what\n   changed in your area, and verify you don't undo any of it.\n\n5. **Stay scoped.** Only do what this specific task asks for. Do not\n   refactor, do not \"fix\" unrelated issues, do not add features that\n   weren't requested. Scope creep at this point is regression risk.\n\nIf you cannot do this task safely (because it would regress, conflict\nwith current direction, or the requirements no longer apply), escalate\nvia `orchestra escalate` with a clear explanation instead of committing.\n","status":"done","priority":2,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-20T22:38:18.669829+00:00","updated_at":"2026-04-20T22:38:18.669829+00:00","summary":"","completion_summary":"Governance dashboard: /api/governance/contribution-patterns endpoint + Senate HTML section. Diff is add-only (+262 -1). daily_budget.py unchanged from origin/main (confirmed via git ls-files), addressing ImportError concern. Pushed 3 commits (8ed639936, 4b1e8291b, 1cf784e9f). [task:2be7a18f2a5a]","completion_notes":"","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/2be7a18f2a5a_senate_build_governance_dashboard_showi_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 8, \"safety\": 9}}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":"pass","verification_notes":"Governance dashboard: /api/governance/contribution-patterns endpoint + Senate HTML section. Diff is add-only (+262 -1). daily_budget.py unchanged from origin/main (confirmed via git ls-files), addressing ImportError concern. Pushed 3 commits (8ed639936, 4b1e8291b, 1cf784e9f). [task:2be7a18f2a5a]","task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"66bc2a3b0583","title":"[Senate] Add approval workflows for high-impact changes (>N edges, hypothesis deletion)","description":"\n\n\n## REOPENED TASK — CRITICAL CONTEXT\n\nThis task was previously marked 'done' but the audit could not verify\nthe work actually landed on main. The original work may have been:\n- Lost to an orphan branch / failed push\n- Only a spec-file edit (no code changes)\n- Already addressed by other agents in the meantime\n- Made obsolete by subsequent work\n\n**Before doing anything else:**\n\n1. **Re-evaluate the task in light of CURRENT main state.** Read the\n   spec and the relevant files on origin/main NOW. The original task\n   may have been written against a state of the code that no longer\n   exists.\n\n2. **Verify the task still advances SciDEX's aims.** If the system\n   has evolved past the need for this work (different architecture,\n   different priorities), close the task with reason \"obsolete: <why>\"\n   instead of doing it.\n\n3. **Check if it's already done.** Run `git log --grep='<task-id>'`\n   and read the related commits. If real work landed, complete the\n   task with `--no-sha-check --summary 'Already done in <commit>'`.\n\n4. **Make sure your changes don't regress recent functionality.** Many\n   agents have been working on this codebase. Before committing, run\n   `git log --since='24 hours ago' -- <files-you-touch>` to see what\n   changed in your area, and verify you don't undo any of it.\n\n5. **Stay scoped.** Only do what this specific task asks for. Do not\n   refactor, do not \"fix\" unrelated issues, do not add features that\n   weren't requested. Scope creep at this point is regression risk.\n\nIf you cannot do this task safely (because it would regress, conflict\nwith current direction, or the requirements no longer apply), escalate\nvia `orchestra escalate` with a clear explanation instead of committing.\n","status":"done","priority":2,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"2026-04-20T22:30:12.682719+00:00","updated_at":"2026-04-20T22:30:12.682719+00:00","summary":"","completion_summary":"[Senate] Update spec work log: high-impact approval workflows [task:66bc2a3b0583]; [Senate] Add approval workflows for high-impact changes (>N edges)","completion_notes":"Auto-completed by supervisor after successful deploy to main","last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/66bc2a3b0583_senate_add_approval_workflows_for_high_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 8, \"safety\": 9}, \"auto_tagged_at\": \"2026-04-03T22:29:52.524876\"}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"one_shot","pr_links":[],"commit_links":[]},{"id":"2a4e671e2f1e","title":"[Senate] Implement agent accountability scores based on output quality and cost","description":"","status":"closed","priority":2,"frequency":"","max_iterations":null,"assigned_slot":"","started_at":null,"completed_at":"","updated_at":"2026-04-04T05:26:51.432210+00:00","summary":"","completion_summary":"","completion_notes":null,"last_error":"","time_estimate_hours":0.0,"completion_count":0,"spec_path":"docs/planning/specs/2a4e671e2f1e_senate_implement_agent_accountability_s_spec.md","provider":"any","payload_json":"{\"requirements\": {\"coding\": 7, \"reasoning\": 6}}","pr_links_json":"[]","commit_links_json":"[]","merge_commit_sha":null,"merge_verified_at":null,"verification_result":null,"verification_notes":null,"task_type":"one_shot","pr_links":[],"commit_links":[]}],"reviews":[],"effectiveness":{},"related_quests":[{"name":"Percolation Engine","layer":"Senate","priority":93,"status":"active","description":"Closes the loop: discussion comments and proposals percolate into concrete actions, edits, cross-links, and new artifacts — everything tracked end-to-end. Components: (1) comment classifier (LLM tags posts as proposal/action/evidence/dispute/question/ack); (2) action emitter — when N agents reach consensus on action-tagged thread, spawn Orchestra task with comment_id provenance; (3) edit emitter — when consensus on edit-proposal, bump artifact version applying the diff and credit contributors; (4) cross-link emitter — when comments link ≥3 artifacts, propose typed artifact_link; (5) proposal emitter — when discussion converges on a proposal shape, spawn the right artifact (analysis_proposal etc.); (6) percolation dashboard — daily flow rates of post→task→artifact-version. Audit + provenance preserved: every action references the originating comment_id and contributors, restoring full reproducibility from the discussion all the way to the merged change.","task_count":18,"done_count":18},{"name":"Artifact Governance & Lifecycle Management","layer":"Senate","priority":93,"status":"active","description":"Establish a unified artifact governance system across SciDEX. Every first-class entity (gap, hypothesis, analysis, paper, dataset, wiki page, debate, squad finding) gets a universal artifact identity, full history tracking, merge/split/archive operations with decision audit trails, and content ownership by agents or squads.\n\nEXISTING INFRASTRUCTURE (to build on, not replace):\n- dedup_recommendations table: 297 pending merge candidates, zero executed\n- artifact_transforms table: 15 records tracking versions/lifecycle/deprecation\n- API endpoints: /api/dedup/{recommendations,approve,reject,scan}, /api/artifact-transforms\n- Lifecycle states: hypotheses (7 states), gaps (6 states), datasets (versioned via git)\n- governance_config table: 3 entries (ALLOCATION_THRESHOLD, REQUIRED_SIGNATURES, AUTHORIZED_SIGNERS)\n- edit_history table: schema exists, zero rows (never wired up)\n- quality_gate_results table: schema exists, zero rows\n\nGAP ANALYSIS (what's missing):\n1. No universal artifact registry — each type has its own ID scheme\n2. edit_history never wired up — no who-changed-what audit trail\n3. 297 dedup recommendations pending forever — no execution pipeline\n4. Lifecycle enforcement is manual/absent — only 1 of 337 hypotheses archived\n5. No content ownership model — artifacts are unowned\n6. No governance decision tracking — decisions happen but aren't recorded\n7. No automated garden maintenance — stale gaps, redundant hypotheses accumulate\n\nDESIGN PRINCIPLES:\n- Clean system APIs: every operation available via /api/ endpoints\n- Documented governance processes adopted by ALL subsystems\n- Agent-compatible: agents and squads can propose, vote, and execute decisions\n- Incremental: builds on existing tables, doesn't require big-bang migration\n- Auditable: every state change has a who/when/why trail","task_count":28,"done_count":28},{"name":"Autonomous Engines","layer":"Senate","priority":93,"status":"active","description":"Orchestra-managed recurring scripts: debate engine, link checker, orphan checker, convergence monitor, visual regression, pubmed pipeline, metrics, health checks","task_count":18,"done_count":14},{"name":"Resource Intelligence","layer":"Senate","priority":92,"status":"active","description":"Value-based resource allocation — continually evaluate the relative value of quests, tasks, \nhypotheses, gaps, and artifacts, then allocate LLM tokens, CPU, and disk proportionally.\n\nThis quest is the DECISION layer between:\n  - Economics (pricing signals, token economy) → tells us what things are WORTH\n  - Resource Governance (caps, quotas, enforcement) → tells us what we CAN spend\n  - Resource Intelligence (THIS) → decides what we SHOULD spend on\n\nCore loop:\n  1. Score every open task/quest by expected-value-per-token:\n     EV = (importance × tractability × downstream_impact) / estimated_cost\n  2. Rank by EV descending → priority queue\n  3. Allocate budget: top-k items get resources proportional to EV rank\n  4. After completion, measure actual impact → update EV model (feedback loop)\n\nSignals feeding the scorer:\n  - Elo tournament ratings (hypothesis quality signal)\n  - LMSR market prices (belief-weighted value)\n  - Gap value_if_resolved scores\n  - Quest priority × task count\n  - Historical cost-per-completion from resource_usage + cost_ledger\n  - Freshness: penalize stale items, boost newly-identified opportunities\n\nResources tracked:\n  - LLM tokens (by provider: max, codex, bedrock)\n  - CPU seconds (cgroup tracking via cgroup_isolation.py)\n  - Disk (artifact storage)\n  - Agent slots (concurrent execution capacity)\n\nConnects to:\n  - resource_allocations table (currently empty → needs populating)\n  - quest_resource_analyzer.py (correlates completion with consumption)\n  - monthly_resource_adjustment.py (periodic rebalancing)\n  - token_ledger.py (virtual economy)\n  - cost_ledger in orchestra.db (real spend)\n\nSpec: docs/planning/specs/q-resource-intelligence_spec.md","task_count":9,"done_count":8},{"name":"Code Health","layer":"Senate","priority":88,"status":"active","description":"Continuous code quality review without removing functionality. Archive dead code to cold storage (never delete), organize file sprawl into packages, consolidate duplicate functions, break apart api.py. Connected to artifact lifecycle governance — archival uses cold_store mechanism.","task_count":16,"done_count":14},{"name":"Resource Governance","layer":"Senate","priority":88,"status":"active","description":"Enforce hard resource limits on the VM — memory caps per analysis, CPU quotas, concurrent analysis limits, cumulative daily cost budgets, and auto-kill for runaway processes. Track and display resource usage in real-time. Prevent the VM from becoming unresponsive due to analysis load. Architecture should support future offloading to external compute (AWS Batch, Lambda, K8s) via a pluggable executor interface.\n\n[2026-04-09] See also q-resource-intelligence for the allocation DECISION layer (this quest handles enforcement/limits, that one handles value-based allocation).","task_count":9,"done_count":9}],"prs":[],"commits":[],"spec_content":"---\ntitle: \"Quest: Work Governance\"\ndescription: \"Comprehensive governance framework for tracking all work added to SciDEX — who did what, when, why, and at what cost. Includes commit-level provenance, agent accountability scores, automated quality c\"\ntype: quest\nlayer: Senate\npriority: 78\nstatus: active\nquest_id: q-b3fd5789b1fe\nspec_path: docs/planning/specs/quest_work_governance_spec.md\n---\n\n# Quest: Work Governance\n\n**Layer:** Senate  \n**Priority:** P78  \n**Status:** active  \n**Tasks:** 5 total (0 done, 5 open)\n\n## Vision\n\nComprehensive governance framework for tracking all work added to SciDEX — who did what, when, why, and at what cost. Includes commit-level provenance, agent accountability scores, automated quality checks on new content, approval workflows for high-impact changes, and dashboards showing contribution patterns across the agent ecosystem.\n\n## Open Tasks\n\n- [ ] [Senate] Build provenance tracking — link every DB change to agent + task + commit (P3)\n- [ ] [Senate] Create automated quality checks for new hypotheses, wiki pages, KG edges (P3)\n- [ ] [Senate] Implement agent accountability scores based on output quality and cost (P2)\n- [ ] [Senate] Add approval workflows for high-impact changes (>N edges, hypothesis deletion) (P2)\n- [ ] [Senate] Build governance dashboard showing contribution patterns across agents (P2)\n\n\n## Success Criteria\n\n- [ ] All open tasks completed and verified\n- [ ] Integration tested end-to-end with dependent quests\n- [ ] UI pages rendering correctly for this quest's features\n- [ ] Documentation updated for new capabilities\n- [ ] Governance audit tables tested for data integrity\n- [ ] Approval workflow edge cases tested (concurrent approvals, timeouts, revocation)\n- [ ] No new get_db() definitions — use shared database.py module\n- [ ] Schema migrations tested with --dry-run before apply\n\n## Quality Requirements\n\n> Automated quality checks must flag hypotheses with <2 evidence citations, KG edges with zero provenance, and wiki pages with <35% prose ratio. High-impact changes require approval from agents with >0.8 accuracy score on prior contributions. Busywork tasks (empty tool registrations, empty notebooks, stub debates) are escalated for review before acceptance.\n\n## Work Log\n\n_No entries yet._\n","spec_html":"<div style=\"font-size:0.85rem\"><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h2 style=\"color:#4fc3f7;margin:1.5rem 0 0.6rem;font-size:1.2rem;font-weight:700\">Quest: Work Governance</h2></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><strong style=\"color:#e0e0e0\">Layer:</strong> Senate  \n<strong style=\"color:#e0e0e0\">Priority:</strong> P78  \n<strong style=\"color:#e0e0e0\">Status:</strong> active  \n<strong style=\"color:#e0e0e0\">Tasks:</strong> 5 total (0 done, 5 open)</p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h3 style=\"color:#4fc3f7;margin:1.4rem 0 0.5rem;font-size:1.1rem;font-weight:700;border-bottom:2px solid rgba(79,195,247,0.3);padding-bottom:0.2rem\">Vision</h3></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\">Comprehensive governance framework for tracking all work added to SciDEX — who did what, when, why, and at what cost. Includes commit-level provenance, agent accountability scores, automated quality checks on new content, approval workflows for high-impact changes, and dashboards showing contribution patterns across the agent ecosystem.</p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h3 style=\"color:#4fc3f7;margin:1.4rem 0 0.5rem;font-size:1.1rem;font-weight:700;border-bottom:2px solid rgba(79,195,247,0.3);padding-bottom:0.2rem\">Open Tasks</h3></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><div style=\"margin:0.2rem 0;color:#bbb\">&#9744; [Senate] Build provenance tracking — link every DB change to agent + task + commit (P3)</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; [Senate] Create automated quality checks for new hypotheses, wiki pages, KG edges (P3)</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; [Senate] Implement agent accountability scores based on output quality and cost (P2)</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; [Senate] Add approval workflows for high-impact changes (&gt;N edges, hypothesis deletion) (P2)</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; [Senate] Build governance dashboard showing contribution patterns across agents (P2)</div></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h3 style=\"color:#4fc3f7;margin:1.4rem 0 0.5rem;font-size:1.1rem;font-weight:700;border-bottom:2px solid rgba(79,195,247,0.3);padding-bottom:0.2rem\">Success Criteria</h3></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><div style=\"margin:0.2rem 0;color:#bbb\">&#9744; All open tasks completed and verified</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; Integration tested end-to-end with dependent quests</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; UI pages rendering correctly for this quest&#x27;s features</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; Documentation updated for new capabilities</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; Governance audit tables tested for data integrity</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; Approval workflow edge cases tested (concurrent approvals, timeouts, revocation)</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; No new get_db() definitions — use shared database.py module</div>\n<div style=\"margin:0.2rem 0;color:#bbb\">&#9744; Schema migrations tested with --dry-run before apply</div></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h3 style=\"color:#4fc3f7;margin:1.4rem 0 0.5rem;font-size:1.1rem;font-weight:700;border-bottom:2px solid rgba(79,195,247,0.3);padding-bottom:0.2rem\">Quality Requirements</h3></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\">&gt; Automated quality checks must flag hypotheses with &lt;2 evidence citations, KG edges with zero provenance, and wiki pages with &lt;35% prose ratio. High-impact changes require approval from agents with &gt;0.8 accuracy score on prior contributions. Busywork tasks (empty tool registrations, empty notebooks, stub debates) are escalated for review before acceptance.</p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\"><h3 style=\"color:#4fc3f7;margin:1.4rem 0 0.5rem;font-size:1.1rem;font-weight:700;border-bottom:2px solid rgba(79,195,247,0.3);padding-bottom:0.2rem\">Work Log</h3></p><p style=\"color:#bbb;line-height:1.6;margin:0.4rem 0\">_No entries yet._<br></p></div>","spec_file":"quest_work_governance_spec.md"}