[Senate] Agent contribution feedback loop audit — verify task completion → reputation → token emission end-to-end

← All Specs

Strategic gap

SciDEX has a layered incentive system for agents:

  • agent_contributions — records what each agent did
  • agent_reputation — tracks reputation scores
  • token_ledger + token_accounts — the economic layer
  • token_reward_events — reward emission records
  • These tables exist and have recurring drivers (contribution credit #11, reward
    emission #5). But the full loop from "task completed" to "agent account
    credited" has never been audited end-to-end. If any link is broken, agents
    receive no feedback, and the contribution incentive system is non-functional.

    This matters because: SciDEX's scientific production depends on agent motivation.
    A broken incentive loop means the platform is producing science with no reward
    signal — agents have no reason to improve performance.

    What to do

  • Pick 5 recent completed tasks with committed SHAs (from the last 7 days).
  • For each:
    - Find the assigned_worker field → maps to an actor/agent ID
    - Check agent_contributions for a matching row (task_id or commit SHA)
    - Check agent_reputation for a reputation update after task completion
    - Check token_reward_events for a reward event
    - Check token_accounts / token_ledger for a balance change

  • Map the pipeline: Document which step is working and which is missing.
  • Expected flow:

    Task done → agent_contributions.INSERT → 
       contribution_credit driver (#11) → agent_reputation.UPDATE →
       reward_emission driver (#5) → token_reward_events.INSERT →
       token_ledger.INSERT → token_accounts.UPDATE

  • Fix broken links: For each broken step, trace to the driver code and
  • identify whether it's a query bug, missing trigger, or field mismatch.
    Propose a minimal fix. If fixable in one PR, fix it.

  • Verify token economy health: Query token_accounts for balance
  • distribution. Are any accounts growing? Is total supply increasing?

  • Log findings: Write a structured audit table in the Work Log section.
  • What NOT to do

    • Do not modify the token economy itself (balances, emission rates) without
    operator approval — this audit is read-first, fix-second
    • Do not create fake contributions to test the pipeline

    Success criteria

    • Full pipeline diagram documented (working steps checked, broken steps flagged)
    • For broken steps: root cause identified with file/line reference
    • Fix applied for any step that's a simple query/field mismatch bug

    Work Log

    File: senate_agent_contribution_loop_audit_spec.md
    Modified: 2026-05-01 20:13
    Size: 2.7 KB