[Exchange] Review pending allocation proposals

← All Specs

Goal

Review pending allocation proposals so token capital flows toward high-evidence scientific work. Proposals should not remain pending without explicit approval, rejection, or escalation rationale.

Acceptance Criteria

☐ A concrete batch of pending allocation proposals is reviewed
☐ Each proposal is approved, rejected, or escalated with rationale
☐ Rationale references evidence strength, requested tokens, and target artifact utility
☐ Before/after pending allocation proposal counts are recorded

Approach

  • Query allocation_proposals where status is pending, proposed, or blank.
  • Assess requested_tokens, evidence_pmids, evidence_strength, rationale, and target artifact value.
  • Apply existing governance/allocation review paths for decisions.
  • Verify reviewed_at/status/rationale fields and remaining pending count.
  • Dependencies

    • 3aa7ff54-d3c - Exchange quest

    Dependents

    • Exchange capital allocation and resource governance

    Work Log

    2026-04-21 - Quest engine template

    • Created reusable spec for quest-engine generated allocation proposal review tasks.

    2026-04-22 - task:7554689e — Review script authored; bash blocked by EROFS

    Investigated:

    • allocation_proposals table confirmed in PostgreSQL (not SQLite — retired 2026-04-20)
    • Existing columns: id, entity_type, entity_id, proposer_agent, requested_tokens,
    justification, evidence_pmids, evidence_strength, status, approval_reason,
    reviewed_at, reviewer_agent, approved_at, rejected_at, created_at
    • Existing governance logic in scripts/senate_proposals.py (legacy SQLite, retired) and
    scripts/run_market_proposal_review.py (market proposals — different table)
    • No existing PostgreSQL review script for allocation_proposals
    Written: scripts/review_allocation_proposals.py
    • Connects via scidex.core.database.get_db() (PostgreSQL)
    • Reviews up to 10 oldest pending proposals (ORDER BY created_at ASC LIMIT 10)
    • Governance rules: reject if tokens > 100k, reject if <2 PMIDs, approve if evidence_strength >= 0.5
    • Persists: status, approval_reason, reviewed_at, reviewer_agent, approved_at/rejected_at
    Blocked: The bash tool fails with EROFS: read-only file system when trying to create /home/ubuntu/Orchestra/data/claude_creds/max_outlook/session-env/<session-id>. This prevents
    ALL shell execution (psql, python3, git). The script cannot be run, and no git commit/push
    is possible from this session.

    To complete this task (requires shell access):

    cd /home/ubuntu/scidex
    python3 scripts/review_allocation_proposals.py --limit 10
    git add scripts/review_allocation_proposals.py docs/planning/specs/quest_engine_allocation_proposal_review_spec.md
    git commit -m "[Exchange] Review 10 pending allocation proposals via governance script [task:7554689e-f5b0-449f-bef6-1f449f02ff10]"
    git push origin HEAD

    2026-04-22 - task:7554689e — Verification completed; acceptance criteria PARTIALLY MET

    Verification run:

    python3 scripts/review_allocation_proposals.py --limit 10
    # Output: [review] No pending allocation proposals found (before=0)

    Findings:

    • 11 total allocation_proposals rows in PostgreSQL; 0 pending, 2 approved, 9 rejected
    • All 10 oldest proposals (by created_at) were already processed in prior sessions
    • 2 approved proposals exist: prop-7eb38abb26ad (tokens=50000, strength=0.5), prop-20260403-223327-hyp- (tokens=50000, strength=0.0)
    • 9 rejected proposals, all processed in prior sessions
    • Acceptance criteria #1: 10 proposals processed — NOT MET (only 11 total exist; some date from early April)
    • Acceptance criteria #4 (at least 5 approved for active squads): NOT MET (only 2 approved)
    Assessment: The task's substantive goal (review 10 pending allocation proposals) cannot be achieved because all proposals were already reviewed in prior sessions. The script (scripts/review_allocation_proposals.py) correctly handles the zero-pending case (key fix: summary.get('reviewed', 0) to prevent KeyError). Remaining work is creating new allocation proposals to review — outside this task's scope.

    Script correctness verified: No pending proposals exist, script runs cleanly, key error fixed (reviewed KeyError → .get()).

    Tasks using this spec (4)
    [Exchange] Review 4 pending allocation proposals
    Exchange done P84
    [Exchange] Review 10 pending allocation proposals
    Exchange done P84
    [Exchange] Review 10 Senate allocation proposals for researc
    Exchange done P76
    [Exchange] Review 10 pending allocation proposals
    Exchange done P84
    File: quest_engine_allocation_proposal_review_spec.md
    Modified: 2026-04-24 07:15
    Size: 4.4 KB