Skip to content

[PILOT-14] Show locked compensation before task claim - #510

Open
Abiorh001 wants to merge 10 commits into
mainfrom
codex/pilot14-locked-compensation
Open

Abiorh001 wants to merge 10 commits into
mainfrom
codex/pilot14-locked-compensation

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #506.

Released tasks expose the exact compensation terms from their locked ContributionPolicyVersion in contributor ready rows and task detail. Active exact-project Submitters and Reviewers see both accepted_submission and completed_review as either unpaid or award rows containing only the policy UUID, instrument, unit, and exact decimal-string quantity. Claim/start remain Submitter-only. Responses exclude Finance bindings, route keys, payment state, and fulfillment state.

CONTRIBUTIONS supplies one bounded public locked-version port. TASK owns its response DTO and resolves only WorkstreamTask.locked_contribution_policy_version_id; it never falls back to the project's current policy. The CLI validates and displays the same block for task ready and task show. No migration, policy locking/publication, payment, award creation, or fulfillment behavior changes.

Current review target:

  • base: 36e8a615f01801cecd6ccf83d7411235ab1cfa8f
  • head: ff62b273bccbe670071f2876bc64b30694518637
  • tree: 6cd83dc9e66b32bfe87f72bbccebe23a9dbb9c8b

Validation and provenance:

  • Post-PR feat(tasks): deliver exact initial checker requests through shared outbox #509 reconciliation at ec4c8505: 2 real-PostgreSQL paid/unpaid locked-term cases passed with exact decimals, successor-policy immutability, Submitter/Reviewer/outsider authority, and complete database cleanup.
  • The PILOT-14 implementation blobs retained from the hosted-green 677101a8 source passed 60 TASK owner projections, 7 changed AUTH matrix cases, 39 architecture/module-boundary cases, and 12 built-CLI HTTP process cases. That hosted run used an older base and is historical evidence, not current-main CI proof.
  • Independent final review of the current source passed 6 focused backend cases and 3 focused CLI cases; root and runtime reviews found no product or source defects.
  • Current-head help and documentation checks passed: gofmt, task ready --help, Commitrail validation, Markdown links, and diff hygiene.
  • Fresh hosted CI for this current-main head is pending and remains required.

The branch has been reconciled with current main, preserving PR #504 dispatch, PR #505 guide reads, PR #509 request delivery, and PR #507's qualified gVisor experiment limits. Human review and merge remain required.

Summary by CodeRabbit

  • New Features
    • Ready-work listings and contributor task details now show compensation from the task’s locked policy, including unpaid status or exact award terms for submissions and reviews.
    • Active project Submitters and Reviewers can view ready work and contributor details. Claiming and starting work remain Submitter-only.
    • The CLI displays compensation details in task listings and task views.
  • Documentation
    • Updated role and permissions guidance to clarify task visibility and claim access.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96ec73e1-362b-41b7-8254-3a187990f668
📥 Commits

Reviewing files that changed from the base of the PR and between 36e8a61 and ff62b27.

📒 Files selected for processing (43)
  • .commitrail/changes/pilot14-locked-task-compensation.md
  • README.md
  • backend/app/adapters/contributions/__init__.py
  • backend/app/adapters/tasks/__init__.py
  • backend/app/modules/authorization/artifact_project_authority.py
  • backend/app/modules/authorization/domain/task_authority.py
  • backend/app/modules/authorization/domain/task_queues.py
  • backend/app/modules/contributions/api/__init__.py
  • backend/app/modules/contributions/api/published_selection.py
  • backend/app/modules/contributions/repository.py
  • backend/app/modules/tasks/api/__init__.py
  • backend/app/modules/tasks/api/ready_queue.py
  • backend/app/modules/tasks/api/task_detail.py
  • backend/app/modules/tasks/authorized_commands.py
  • backend/app/modules/tasks/queue_router.py
  • backend/app/modules/tasks/repository.py
  • backend/app/modules/tasks/service.py
  • backend/scripts/test_lane_catalogue.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/authorization/task_queues/test_authority.py
  • backend/tests/authorization/task_queues/test_transactions.py
  • backend/tests/authorization/task_reads/test_authority.py
  • backend/tests/authorization/task_reads/test_concurrency.py
  • backend/tests/projects/guide_activation/pg_support.py
  • backend/tests/tasks/test_locked_compensation.py
  • backend/tests/tasks/test_project_display.py
  • backend/tests/tasks/test_public_queues.py
  • backend/tests/tasks/test_ready_queue.py
  • backend/tests/tasks/test_submission_requirements.py
  • backend/tests/tasks/test_task_detail.py
  • backend/tests/tasks/test_work_context.py
  • backend/tests/test_ci_lane_catalogue.py
  • backend/tests/test_pre_submit_related_lock_order.py
  • cli/README.md
  • cli/internal/api/contributor_tasks.go
  • cli/internal/api/task_context.go
  • cli/internal/command/contributor_tasks.go
  • cli/tests/integration/contributor_task_journey.py
  • cli/tests/integration/test_contributor_task_http.py
  • docs/operations_roles_permissions.md
  • docs/roadmap_status.md
  • docs/spec_chunk_4_task_queue_assignment.md
  • docs/spec_contribution_compensation.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Ready-task summaries and contributor task details now show compensation from each task’s locked contribution policy version. Active exact-project Submitters and Reviewers can read these terms. The change also adds CLI validation and display; task claim and start remain Submitter-only.

Changes

Locked compensation visibility

Layer / File(s) Summary
Compensation contracts and policy reader
backend/app/modules/contributions/api/*, backend/app/modules/contributions/repository.py, backend/app/modules/tasks/api/*, backend/tests/architecture/test_module_boundaries.py
New types represent the locked policy version and its accepted-submission and completed-review rules. The contribution repository reads valid terms for requested policy versions in the specified project.
Project-role read authority
backend/app/modules/authorization/*, backend/app/modules/tasks/service.py, backend/tests/authorization/*, backend/tests/tasks/test_submission_requirements.py, docs/operations_roles_permissions.md, docs/spec_chunk_4_task_queue_assignment.md
Ready queue and contributor-detail reads allow active project roles. Submission-requirements and work-context reads remain Submitter-only. The service checks task visibility before loading project context.
Task response projection and verification
backend/app/adapters/{contributions,tasks}/__init__.py, backend/app/modules/tasks/{authorized_commands.py,queue_router.py,repository.py}, backend/tests/tasks/*, backend/scripts/test_lane_catalogue.py, backend/tests/test_ci_lane_catalogue.py, backend/tests/test_pre_submit_related_lock_order.py, README.md, docs/roadmap_status.md, docs/spec_contribution_compensation.md, docs/spec_chunk_4_task_queue_assignment.md, .commitrail/changes/*
Task repositories attach locked terms to ready summaries and contributor details. Backend tests cover exact terms, Submitter and Reviewer access, policy-version stability, and omission of Finance fields. Supporting documentation records the response scope and exclusions.
CLI decoding and display
cli/internal/api/{contributor_tasks.go,task_context.go}, cli/internal/command/contributor_tasks.go, cli/tests/integration/*, cli/README.md
The CLI validates compensation response data and prints the policy version and contribution terms for ready and show commands. Integration tests cover output and malformed responses.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant TaskQueueRouter
  participant TaskRepository
  participant ContributionPolicyRepository
  TaskQueueRouter->>TaskRepository: read ready tasks
  TaskRepository->>ContributionPolicyRepository: read terms for locked policy version IDs
  ContributionPolicyRepository-->>TaskRepository: return locked compensation terms
  TaskRepository-->>TaskQueueRouter: return ready summaries with compensation
Loading

Merge Risk: ⚪ Minimal · up to ff62b

No identified defect prevents merging. The reported current-head hosted CI run and required human approval remain outstanding.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 36 files. (7 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: showing task-locked compensation before claim. It is concise and specific.
Description check ✅ Passed The description is mostly complete and clearly explains the goal, behavior, design, scope exclusions, validation evidence, pending CI status, and required human review. It does not follow the template…
Linked Issues check ✅ Passed Issue #506 requirements are implemented. TASK resolves compensation from each task's locked_contribution_policy_version_id through the bounded CON port. The response contains both contribution types…
Out of Scope Changes check ✅ Passed The changes stay within issue #506. Authorization updates enable the required Submitter and Reviewer reads. Repository ports, response types, service visibility, CLI validation, documentation, fixture…
Full details: Docstring Coverage

Explanation

Docstring coverage is 34.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 36 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Abiorh001
Abiorh001 force-pushed the codex/pilot14-locked-compensation branch from e3b8120 to 677101a Compare October 8, 2026 14:29
@Abiorh001
Abiorh001 marked this pull request as ready for review October 8, 2026 16:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PILOT-14] Show a task's locked compensation terms before claiming

1 participant