Skip to content

Make proposed-work payment source selectable#806

Merged
ramimbo merged 4 commits into
mainfrom
maintainer/proposed-work-payment-source
Jun 2, 2026
Merged

Make proposed-work payment source selectable#806
ramimbo merged 4 commits into
mainfrom
maintainer/proposed-work-payment-source

Conversation

@ramimbo
Copy link
Copy Markdown
Owner

@ramimbo ramimbo commented Jun 2, 2026

Summary

Evidence

  • Confusion, missing step, stale example, or bug this addresses: live proposed-work triage was still tied to the old MRWK bounty: 50 MRWK - accepted proposed-work requests, round 1 #649 intake payment source, so current MRWK bounty: 50 MRWK - accepted proposed-work requests, round 2 #722 accepted proposals could appear as unpaid or unaccepted.
  • Bounty capacity and active attempts/open PRs checked: maintainer infrastructure PR; no bounty requested.
  • Intended files or surfaces: scripts/proposed_work_triage.py, tests/test_proposed_work_triage.py, docs/admin-runbook.md.
  • Expected PR size: small, focused CLI/report fix.
  • Out of scope: no labels, comments, issue edits, bounty creation, claim acceptance, payout proposals, proposal execution, wallet behavior, ledger writes, or MRWK price/exchange/bridge/cash-out claims.

Live read-only smoke:

./.venv/bin/python scripts/proposed_work_triage.py --repo ramimbo/mergework --payment-bounty-issue 722 --format json --limit 20 | jq ...
# payment_counts: {"none": 16, "pending": 4}
# #772, #774, #786, and #791 classify as pending from current #722 public bounty data.

Test Evidence

  • ./.venv/bin/python scripts/check_agents.py
  • ./.venv/bin/python -m pytest
  • ./.venv/bin/python -m ruff format --check .
  • ./.venv/bin/python -m ruff check .
  • ./.venv/bin/python -m mypy app
  • ./.venv/bin/python scripts/docs_smoke.py
  • git diff --check

MRWK

Maintainer infrastructure PR; no bounty requested. Related issue: #802.

Summary by CodeRabbit

  • New Features

    • The triage script now accepts repeated flags to specify multiple payment-bounty issues instead of a single hard-coded issue.
  • Documentation

    • Admin runbook updated with multi-issue usage examples and clearer explanations of report scope and payment-status behavior.
  • Tests

    • Added CLI validation and live-mode tests covering single-issue selection, multi-issue aggregation, and rejection of the flag in offline mode.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The PR extends the proposed work triage script to load payment bounty data from multiple configurable GitHub issue numbers instead of a single hard-coded issue. A new repeatable --payment-bounty-issue CLI flag replaces the constant, multi-issue aggregation logic is added, and two live-mode tests validate single and multiple bounty intake scenarios.

Changes

Configurable payment bounty intake

Layer / File(s) Summary
Payment bounty constant configuration
scripts/proposed_work_triage.py
DEFAULT_PAYMENT_BOUNTY_ISSUE_NUMBERS tuple replaces INTAKE_BOUNTY_ISSUE_NUMBER.
Multi-issue bounty loading
scripts/proposed_work_triage.py
_load_public_bounty_issues() aggregates bounty details and warnings across specified issue numbers. load_live_issues() signature gains payment_bounty_issue_numbers parameter and calls the new aggregator.
CLI argument parsing and integration
scripts/proposed_work_triage.py
Repeatable --payment-bounty-issue flag (positive-int validated) is added to main(). The flag is rejected with --input; in live --repo mode the selected list (or default tuple) is passed into load_live_issues().
Live-mode tests and documentation
tests/test_proposed_work_triage.py, docs/admin-runbook.md
Added an offline-mode validation test and two live-mode tests (single and aggregated issue selections) that stub GitHub/HTTP calls and assert payment_counts, per-proposal payment_status, and warnings. Runbook example updated to show multi-line --payment-bounty-issue usage and clarify report coverage and --api-host scope.

Possibly related issues

Possibly related PRs

  • ramimbo/mergework#763: Related work updating proposed_work_triage live-mode bounty loading and CLI parsing to fetch and aggregate public bounty data by issue number.
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Bounty Pr Focus ⚠️ Warning PR matches stated payment-bounty-issue scope and files, but omits boundary tests for _positive_issue_number validator (0, -1, "abc") required by review comment. Add parametrized test covering invalid values (0, -1, "abc") as specified in review comment to lock in positive-int contract.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title describes the main change (making payment source selectable) and is concrete, directly naming the changed surface.
Description check ✅ Passed Description covers all required template sections with concrete details: summary of changes, evidence explaining the bug and scope, test evidence with checks marked complete, and MRWK context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Mergework Public Artifact Hygiene ✅ Passed PR #806 documents --payment-bounty-issue flag with read-only tool disclaimer; makes no investment, price, cash-out, or fabricated payout claims; and avoids MRWK coin/token descriptions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Copy Markdown
Contributor

@keilogic keilogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head e57160e against base 6d324f0.

I checked the CLI argument flow, payment-bounty issue loading, report payment indexing, the new #722 pending-payout fixture, and the admin-runbook guidance. The change keeps the historical #649 default via the fallback path and only switches payment sources when --payment-bounty-issue is provided, including repeatable values during round transitions.

Validation I ran:

  • python -m pytest tests/test_proposed_work_triage.py -> 14 passed
  • python -m ruff format --check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py
  • python -m ruff check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py
  • python scripts/docs_smoke.py
  • git diff --check origin/main...HEAD
  • git merge-tree against current origin/main produced no conflicts

Hosted Quality, readiness, docs, and image checks is also passing. No blockers from this review.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 422ad93d-2449-49d9-ada3-1b87bd908f8a

📥 Commits

Reviewing files that changed from the base of the PR and between 6d324f0 and e57160e.

📒 Files selected for processing (3)
  • docs/admin-runbook.md
  • scripts/proposed_work_triage.py
  • tests/test_proposed_work_triage.py

Comment thread tests/test_proposed_work_triage.py
@ramimbo ramimbo marked this pull request as ready for review June 2, 2026 13:27
Copy link
Copy Markdown
Contributor

@keilogic keilogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review on current head 20434485fb195480e954d2bebeb408e8354b1219 after the 6c3702c aggregation-test commit and the rebase onto current origin/main 424c014ce0e4c80cdb9965e392012f89d25cca58.

I checked the delta from the earlier reviewed e57160e head. The new test covers repeated --payment-bounty-issue 649 / --payment-bounty-issue 722 inputs and asserts both paid and pending submissions contribute to payment_counts, while the base update brings in the merged bounty-issue filter from #808. I did not find a blocker in the current head.

Validation:

  • python -m pytest tests/test_proposed_work_triage.py -q -> 16 passed
  • python -m ruff check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py
  • python -m ruff format --check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py
  • python scripts/docs_smoke.py
  • git diff --check origin/main...HEAD
  • git merge-tree --write-tree origin/main HEAD -> clean tree f4b6c483c875ef7de6cc8aa80874a570171101c1
  • Direct public API reads for bounty issues #649 and #722 returned current rows; #722 still shows pending payout proposals including #791.

Hosted Quality, readiness, docs, and image checks is successful on this head. GitHub currently reports mergeStateStatus=UNSTABLE with the secondary status context unresolved/empty, but I did not see a code blocker in the changed files.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/proposed_work_triage.py (1)

505-528: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

--payment-bounty-issue is silently ignored in offline (--input) mode.

When --input is supplied, payment state comes from the fixture and args.payment_bounty_issue is never read. An operator running --input fixture.json --payment-bounty-issue 722 during a transition gets no signal that the flag had no effect. Consider erroring (or warning) when both are passed.

Proposed guard in main()
     args = parser.parse_args(argv)
+
+    if args.input and args.payment_bounty_issue:
+        parser.error("--payment-bounty-issue is only valid in live (--repo) mode")

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 98f869e5-2a2e-4cde-a266-48f7886b8f65

📥 Commits

Reviewing files that changed from the base of the PR and between e57160e and 2043448.

📒 Files selected for processing (2)
  • scripts/proposed_work_triage.py
  • tests/test_proposed_work_triage.py

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a994df51-4f9b-48a6-a38b-c52669ec71ac

📥 Commits

Reviewing files that changed from the base of the PR and between 2043448 and 42ae352.

📒 Files selected for processing (2)
  • scripts/proposed_work_triage.py
  • tests/test_proposed_work_triage.py

Comment on lines +393 to +404
def test_proposed_work_triage_rejects_payment_bounty_issue_in_offline_mode(
tmp_path, capsys
) -> None:
fixture = tmp_path / "fixture.json"
fixture.write_text(json.dumps({"issues": []}), encoding="utf-8")

with pytest.raises(SystemExit) as excinfo:
main(["--input", str(fixture), "--payment-bounty-issue", "722"])

assert excinfo.value.code == 2
assert "--payment-bounty-issue is only valid in live --repo mode" in capsys.readouterr().err

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add a boundary test for --payment-bounty-issue validation.

The new offline-mode rejection is covered, but _positive_issue_number's reject paths (non-integer and <= 0) are untested. A small case asserting SystemExit(2) for --payment-bounty-issue 0 and a non-numeric value would lock in the positive-int contract from the PR objective. As per coding guidelines, tests should "include negative, replay, boundary, or regression cases where relevant."

Proposed test
`@pytest.mark.parametrize`("value", ["0", "-1", "abc"])
def test_proposed_work_triage_rejects_invalid_payment_bounty_issue(value, capsys) -> None:
    with pytest.raises(SystemExit) as excinfo:
        main(["--repo", "ramimbo/mergework", "--payment-bounty-issue", value])
    assert excinfo.value.code == 2
    assert "payment bounty issue must be" in capsys.readouterr().err

Copy link
Copy Markdown
Contributor

@keilogic keilogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review on current head 42ae352d1797ca5a15149f0fff8214659bff79f2 after the offline-mode guard commit.

I checked the delta from the previously reviewed 20434485fb195480e954d2bebeb408e8354b1219 head. The new code rejects --input ... --payment-bounty-issue ... instead of silently ignoring the payment-source flag in offline fixture mode, and the new regression test covers that path. This addresses the prior CodeRabbit issue about offline-mode behavior.

CodeRabbit's current boundary-test note for _positive_issue_number is useful polish, but I do not see it as a blocker: direct probes for --payment-bounty-issue 0 and --payment-bounty-issue abc already fail through argparse with the expected positive/integer validation errors.

Validation:

  • python -m pytest tests/test_proposed_work_triage.py -q -> 17 passed
  • python -m ruff check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py -> passed
  • python -m ruff format --check scripts/proposed_work_triage.py tests/test_proposed_work_triage.py -> passed
  • python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean tree bc5a52d44390e8eff4b2a01c772a125557637f90
  • Hosted Quality, readiness, docs, and image checks and CodeRabbit are successful on this head; GitHub reports mergeStateStatus=CLEAN.

No blockers found in the current head.

@ramimbo ramimbo merged commit ef704c8 into main Jun 2, 2026
2 checks passed
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.

2 participants