Skip to content

Share submission availability field copying#878

Open
yyswhsccc wants to merge 3 commits into
ramimbo:mainfrom
yyswhsccc:druid/probe-846-submission-availability-fields
Open

Share submission availability field copying#878
yyswhsccc wants to merge 3 commits into
ramimbo:mainfrom
yyswhsccc:druid/probe-846-submission-availability-fields

Conversation

@yyswhsccc
Copy link
Copy Markdown

@yyswhsccc yyswhsccc commented Jun 4, 2026

Refs #846

What changed

  • Added a small helper for copying effective bounty availability fields in submission_quality_gate.py.
  • Reused it when normalizing API bounty rows and when assembling live submission-gate context.
  • Extended the live-context regression test to assert that availability_note is preserved with the other effective availability fields.

Validation

  • uv run --extra dev python -m pytest tests/test_submission_quality_gate.py -q -> 45 passed
  • uv run --extra dev python -m ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed
  • uv run --extra dev python -m ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed
  • git diff --check -> passed

Scope

This is a focused maintainability cleanup for the submission quality gate. It does not change ledger, wallet, treasury, payout, deployment, bridge, exchange, or off-ramp behavior.

Summary by CodeRabbit

  • Refactor

    • Internal handling of availability-related fields was consolidated for clearer, more maintainable code; no user-facing behavior changes.
  • Tests

    • Test assertions reformatted and tightened to improve validation and guard against regressions; no change to test expectations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd577183-95b2-435e-8455-41788c420b6e

📥 Commits

Reviewing files that changed from the base of the PR and between b7b452d and 6d743ca.

📒 Files selected for processing (2)
  • scripts/submission_quality_gate.py
  • tests/test_submission_quality_gate.py

📝 Walkthrough

Walkthrough

Adds an internal helper _copy_effective_availability_fields(source, target) and replaces two inline per-field copy loops with calls to that helper; reformats one test assertion for readability.

Changes

Availability field copying refactor

Layer / File(s) Summary
Helper definition and application
scripts/submission_quality_gate.py
Adds _copy_effective_availability_fields(source, target) (lines 177–186) and replaces inline loops with calls in _load_api_bounties (line 589) and _load_live_context (line 698).
Test assertion formatting
tests/test_submission_quality_gate.py
Reformats the assertion at lines 981–984 in test_submission_quality_gate_live_context_preserves_effective_availability across multiple lines without changing behavior.

Possibly related issues

Possibly related PRs

  • ramimbo/mergework#700: Both PRs refactor how EFFECTIVE_AVAILABILITY_FIELDS are copied in _load_api_bounties and _load_live_context, supporting the same effective availability preservation logic.
  • ramimbo/mergework#325: Both PRs modify the bounty loading paths (_load_api_bounties, _load_live_context) within the submission quality gate introduced by that PR.
  • ramimbo/mergework#913: Related refactor that centralizes and uses _copy_effective_availability_fields across loader functions.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Share submission availability field copying' clearly and concretely names the changed surface—a refactored helper for copying effective availability fields.
Description check ✅ Passed The description covers key sections: what changed, validation steps (tests, linting, formatting), and scope. It references issue #846 and provides concrete evidence of validation.
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 Code and public artifacts contain no investment, price, cash-out, fabricated payout, or security claims. MRWK correctly described as native coin supporting future snapshots and bridges.
Bounty Pr Focus ✅ Passed PR references bounty #846; diff matches stated files; includes passing test evidence (45 tests); no scope creep (no ledger/wallet/treasury/bridge/exchange/deployment changes).

✏️ 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

@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: c262c90c-feda-49ba-a619-2679e649e1b9

📥 Commits

Reviewing files that changed from the base of the PR and between 40c95af and b7b452d.

📒 Files selected for processing (1)
  • scripts/submission_quality_gate.py

return raw.get("payability_verified", True) is not False


def _copy_effective_availability_fields(source: dict[str, Any], target: dict[str, Any]) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Run the full required Python validation suite before merge.

The PR evidence shows targeted checks, but repo rules for Python changes require pytest, ruff format --check ., ruff check ., and mypy app across the repo before opening/merging.

As per coding guidelines, **/*.py: Run pytest, ruff format --check ., ruff check ., and mypy app before opening a PR.

Copy link
Copy Markdown

@mauricemohr88-debug mauricemohr88-debug left a comment

Choose a reason for hiding this comment

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

Approved current head b7b452d1f35018b91a1f8eaa53cb8b693dbe8400.

Evidence checked:

  • inspected scripts/submission_quality_gate.py and tests/test_submission_quality_gate.py;
  • confirmed _copy_effective_availability_fields() preserves the previous per-field copy behavior for both _load_api_bounties() and _load_live_context() while centralizing the shared EFFECTIVE_AVAILABILITY_FIELDS loop;
  • confirmed the live-context regression now asserts availability_note is preserved along with the other effective availability fields;
  • rechecked GitHub state before review: mergeStateStatus=CLEAN and hosted Quality, readiness, docs, and image checks is successful on this head.

Validation on this exact head:

  • uv run --python 3.12 --extra dev python -m pytest tests/test_submission_quality_gate.py -q -> 45 passed.
  • uv run --python 3.12 --extra dev ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed.
  • uv run --python 3.12 --extra dev ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> 2 files already formatted.
  • uv run --python 3.12 --extra dev mypy scripts/submission_quality_gate.py -> success.
  • uv run --python 3.12 --extra dev 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 74971b6f7fe39b42e83ee8bac88fca6dd68818ed.

No blockers found. Scope stays inside submission quality-gate maintainability and tests; no ledger, wallet, treasury, payout, proposal execution, bridge, exchange, cash-out, MRWK price, private data, or secret handling behavior is changed.

@yyswhsccc
Copy link
Copy Markdown
Author

Maintenance update:

CodeRabbit requested the full required Python validation suite before merge. I ran that validation on the PR branch without changing code.

Validation run locally:

  • uv run --python 3.12 --extra dev python -m pytest -> 790 passed, 1 existing StarletteDeprecationWarning
  • uv run --python 3.12 --extra dev ruff format --check . -> 111 files already formatted
  • uv run --python 3.12 --extra dev ruff check . -> passed
  • uv run --python 3.12 --extra dev mypy app -> success

Scope remains validation-only; no code, ledger, wallet, treasury, payout, proposal execution, bridge, exchange, cash-out, MRWK price, private data, or secret handling behavior changed.

@stmr
Copy link
Copy Markdown

stmr commented Jun 4, 2026

Bounty #838 current-head review for PR #878.

Reviewed head b7b452d1f35018b91a1f8eaa53cb8b693dbe8400. Files inspected: scripts/submission_quality_gate.py, tests/test_submission_quality_gate.py.

Verdict: no blocker found. _copy_effective_availability_fields() centralizes copying of the existing effective availability payload fields for both API bounty rows and live submission-gate context. The added assertion keeps availability_note preserved alongside effective awards, available MRWK, availability state, and pending payout counts.

GitHub state checked: mergeStateStatus=CLEAN; hosted Quality, readiness, docs, and image checks passed; CodeRabbit passed. Scope is submission quality gate maintainability and focused test coverage only. No ledger, wallet, treasury, payout, deployment, bridge, exchange, off-ramp, private data, or MRWK price behavior changed.

Copy link
Copy Markdown
Contributor

@alan747271363-art alan747271363-art 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 b7b452d1f35018b91a1f8eaa53cb8b693dbe8400 against current origin/main d7e9b530fffec7bd774da7708597648096a37393.

Scope inspected:

  • scripts/submission_quality_gate.py
  • tests/test_submission_quality_gate.py

The branch-local maintainability change remains focused: _copy_effective_availability_fields() centralizes the shared effective-availability field copy path used when loading API bounty rows and live submission-gate context, and the regression confirms availability_note is preserved with the other effective availability fields. This stays inside submission quality-gate logic and tests; it does not alter ledger, wallet, treasury, payout, proposal execution, bridge, exchange, cash-out, private data, or secret-handling behavior.

Validation on this exact head:

  • .\.venv\Scripts\python.exe -m pytest tests\test_submission_quality_gate.py -q -> 45 passed.
  • .\.venv\Scripts\python.exe -m ruff check scripts\submission_quality_gate.py tests\test_submission_quality_gate.py -> passed.
  • .\.venv\Scripts\python.exe -m ruff format --check scripts\submission_quality_gate.py tests\test_submission_quality_gate.py -> 2 files already formatted.
  • .\.venv\Scripts\python.exe -m mypy scripts\submission_quality_gate.py -> success.
  • .\.venv\Scripts\python.exe scripts\docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.

Current blocker: GitHub now reports mergeStateStatus=DIRTY / conflicting. git merge-tree --write-tree origin/main HEAD exits non-zero with a current-main conflict in docs/agent-guide.md while also auto-merging docs/api-examples.md and tests/test_docs_public_urls.py. The visible PR diff is script/test focused, so this appears to be a branch-base rebase conflict from newer documentation changes, but it blocks merging and needs to be resolved.

No private data, credentials, wallet material, production mutation, payout execution, treasury execution, ledger mutation, exchange, bridge, cash-out, price behavior, or fabricated payout claims were used.

…ssion-availability-fields

# Conflicts:
#	scripts/submission_quality_gate.py
Copy link
Copy Markdown

@mauricemohr88-debug mauricemohr88-debug left a comment

Choose a reason for hiding this comment

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

Approved current head 6d743ca74c2ca7a2b045b8b2ff560d5cb3e597a0.

I reviewed the refreshed PR after it was rebased from the previously reviewed head b7b452d1f35018b91a1f8eaa53cb8b693dbe8400. The current diff is now very small: scripts/submission_quality_gate.py keeps the shared effective-availability copy helper in the submission quality gate, and tests/test_submission_quality_gate.py adds coverage that availability_note is preserved in live bounty context alongside the other effective availability fields.

Validation I ran locally on this exact head:

  • uv run --python 3.12 --extra dev python -m pytest tests/test_submission_quality_gate.py -q -> 47 passed.
  • uv run --python 3.12 --extra dev ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed.
  • uv run --python 3.12 --extra dev ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> 2 files already formatted.
  • uv run --python 3.12 --extra dev mypy scripts/submission_quality_gate.py -> success.
  • uv run --python 3.12 --extra dev 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 366f68450efcfa9129efa1cf3f82ea3fbbf6f597.

GitHub state checked before approval: current head 6d743ca74c2ca7a2b045b8b2ff560d5cb3e597a0, mergeStateStatus=CLEAN, hosted Quality/readiness/docs/image check successful, CodeRabbit successful, and no human review was present on this current head.

No blocker found. Scope stays inside submission quality-gate maintainability and regression coverage; no ledger, wallet, treasury, payout, proposal execution, bridge, exchange, cash-out, MRWK price, private data, credentials, or secret-handling behavior is changed.

Copy link
Copy Markdown

@Errordog2 Errordog2 left a comment

Choose a reason for hiding this comment

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

Reviewed the submission availability field copying cleanup.

Validation performed locally after applying the PR diff cleanly to current origin/main:

  • git apply --3way --index -> applied scripts/submission_quality_gate.py and tests/test_submission_quality_gate.py cleanly
  • .venv\Scripts\python.exe -m pytest tests/test_submission_quality_gate.py -> 47 passed
  • .venv\Scripts\python.exe -m ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed
  • .venv\Scripts\python.exe -m ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py -> passed
  • .venv\Scripts\python.exe -m mypy scripts/submission_quality_gate.py -> passed
  • git diff --check -> passed
  • git merge-tree --write-tree origin/main HEAD -> produced merge tree 46508e23e7730ca1c5c9586ceb25a19aaca94b12

The refactor keeps the effective availability field copying centralized and the added assertion confirms availability_note is preserved alongside the other effective-capacity fields. Looks good to me.

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.

5 participants