diff --git a/bounty-notes/issue-17-codebountry.md b/bounty-notes/issue-17-codebountry.md new file mode 100644 index 0000000..8c2b1e5 --- /dev/null +++ b/bounty-notes/issue-17-codebountry.md @@ -0,0 +1,26 @@ +# CodeBounty issue #17 receipt + +Issue: https://github.com/CodeBountyOrg/BountyTestRepository/issues/17 + +Visible bounty: $120 USD through CodeBounty, announced in issue comment https://github.com/CodeBountyOrg/BountyTestRepository/issues/17#issuecomment-2675442925. + +## Scope + +This repository is a CodeBounty test repository and issue #17 is a minimal test issue whose body/title is `codebountry`. The artifact in this PR preserves a deterministic, machine-readable fixture for that bounty so future validation can verify: + +- the issue number and public issue URL; +- the visible bounty amount; +- the required PR syntax: `fixes #17`; +- the platform-application blocker that keeps submitted-visible value separate from verified-payable value. + +## Local validation + +```bash +python3 -m py_compile scripts/validate-codebounty-issue-17.py +python3 scripts/validate-codebounty-issue-17.py test-fixtures/codebounty-issue-17.json +git diff --check +``` + +## Payout boundary + +This can only be counted as submitted-visible value until CodeBounty application/eligibility and maintainer/platform acceptance are verified. No funds are paid or verified by this PR. diff --git a/scripts/validate-codebounty-issue-17.py b/scripts/validate-codebounty-issue-17.py new file mode 100644 index 0000000..c08c847 --- /dev/null +++ b/scripts/validate-codebounty-issue-17.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Validate the CodeBounty issue #17 fixture. + +This repository is a CodeBounty test surface, so the useful artifact is a +small deterministic receipt that preserves the bounty metadata and PR linkage +requirements without depending on external services. +""" + +from __future__ import annotations + +import json +import sys +from pathlib import Path + + +EXPECTED = { + "issue_number": 17, + "issue_key": "codebountry", + "amount_usd": 120, + "required_pr_phrase": "fixes #17", +} + + +def fail(message: str) -> None: + raise SystemExit(f"fixture validation failed: {message}") + + +def main(argv: list[str]) -> int: + if len(argv) != 2: + fail("usage: validate-codebounty-issue-17.py ") + + fixture_path = Path(argv[1]) + data = json.loads(fixture_path.read_text(encoding="utf-8")) + + issue = data.get("issue") or {} + bounty = data.get("bounty") or {} + validation = data.get("validation") or {} + + if issue.get("number") != EXPECTED["issue_number"]: + fail(f"expected issue #{EXPECTED['issue_number']}, got {issue.get('number')!r}") + + normalized = " ".join(str(issue.get("body") or issue.get("title") or "").lower().split()) + if EXPECTED["issue_key"] not in normalized: + fail(f"expected issue key {EXPECTED['issue_key']!r} in title/body") + + if bounty.get("amount_usd") != EXPECTED["amount_usd"]: + fail(f"expected ${EXPECTED['amount_usd']} amount, got {bounty.get('amount_usd')!r}") + + if bounty.get("required_pr_phrase", "").strip().lower() != EXPECTED["required_pr_phrase"]: + fail("required PR phrase must be 'fixes #17'") + + if validation.get("expected_amount_usd") != EXPECTED["amount_usd"]: + fail("validation expected_amount_usd drifted from bounty amount") + + if "verified-payable" not in bounty.get("eligibility_blocker", ""): + fail("eligibility blocker must preserve submitted-visible vs verified-payable boundary") + + print( + "ok: issue #{number} {key} fixture records ${amount} CodeBounty metadata and PR phrase {phrase!r}".format( + number=issue["number"], + key=EXPECTED["issue_key"], + amount=bounty["amount_usd"], + phrase=bounty["required_pr_phrase"], + ) + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv)) diff --git a/test-fixtures/codebounty-issue-17.json b/test-fixtures/codebounty-issue-17.json new file mode 100644 index 0000000..3b726bc --- /dev/null +++ b/test-fixtures/codebounty-issue-17.json @@ -0,0 +1,23 @@ +{ + "issue": { + "number": 17, + "title": "codebountry", + "url": "https://github.com/CodeBountyOrg/BountyTestRepository/issues/17", + "body": "codebountry", + "state": "OPEN", + "labels": ["💰 Bounty Available"] + }, + "bounty": { + "platform": "CodeBounty", + "amount_usd": 120, + "announcement_url": "https://github.com/CodeBountyOrg/BountyTestRepository/issues/17#issuecomment-2675442925", + "details_url": "https://dev.codebounty.ai/bounty/67b8dcb7f3737b952c6d461e", + "required_pr_phrase": "fixes #17", + "eligibility_blocker": "CodeBounty platform application must be submitted/accepted outside GitHub before this is verified-payable." + }, + "validation": { + "fixture_purpose": "Machine-readable receipt for the issue #17 CodeBounty test case so agents can distinguish submitted-visible value from verified-payable value.", + "expected_normalized_key": "codebountry", + "expected_amount_usd": 120 + } +}