Repository navigation
ci(fees): add monthly fee schedule check workflow - #502
Merged
Merged
Conversation
Move the monthly Firstrade fee-rate review (issue #497) into a scheduled GitHub Actions workflow instead of a standing chat reminder. - scripts/check_fee_schedule.py compares the SEC Section 31 advisory and the FINRA TAF sources with the repo schedule. A fetch or parse failure is an error. - When everything matches, the workflow pushes a branch that moves verified_through to the end of next month and opens a pull request. It never merges. - When a rate changed or the check failed, it opens or updates one issue. Rates are never edited automatically. - The test review pin is now one VERIFIED_THROUGH constant that the bump rewrites. - GITHUB_TOKEN only, top-level permissions empty, per-job permissions, pinned checkout.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Pigbibi
marked this pull request as ready for review
November 1, 2026 14:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI assistance
Prepared with Grok Bot (an AI assistant). It wrote the script, tests, workflow and docs and ran the
local checks listed below; a human must review before merge.
What changed
Moves the monthly Firstrade fee-rate review (tracking issue #497, earlier bump in #498) into a
scheduled workflow,
.github/workflows/fee-schedule-check.yml, so it does not depend on a chatreminder. Triggers: cron
17 2 22 * *(22nd, 02:17 UTC) andworkflow_dispatch. It also runs theread-only
checkjob on pull requests that touch the workflow or the script.scripts/check_fee_schedule.py check(stdlib only, pluspdftotext) compares the repo schedule with:SR-FINRA-2026-021 (a mention of a suspension is a difference);
filing not in
REVIEWED_FINRA_FILINGSis a difference), and the SR-FINRA-2026-020 / -021 PDFs(2026-2031 rates and the pause window).
error, never a pass. Only hosts sec.gov and finra.org over httpsare fetched, including after redirects.
bumpmovesverified_throughto the end of next month, the "checked" date in themodule docstring, the test review pin and the doc mentions (same pattern as chore(fees): extend fee schedule verified_through to 2026-12-01 #498), runs the tests and
opens a pull request. It fails closed if a pin is not found exactly as expected. Never merges.
notifyopens or comments on oneissue ("Firstrade fee schedule check needs attention") with the report and source URLs. Rates are
never edited and no bump PR is opened.
permissions: {};checkhascontents: read;bumphascontents: writeandpull-requests: write;notifyhasissues: write. OnlyGITHUB_TOKEN, nonew secrets. Checkout is pinned to the SHA used by
ci.yml, concurrency group, 10 minute timeouts.tests/test_check_fee_schedule.pywith trimmed saved pages intests/fixtures/fee_schedule_check/(no network).
tests/test_statement_reconciliation.pynow has oneVERIFIED_THROUGHconstant insteadof four hard-coded dates, so the bump rewrites a single line.
docs/statement-reconciliation.mdand the zh-CN sibling describe the workflow.Refs #497 (recurring review; intentionally not closed).
How verified
python scripts/check_fee_schedule.py checkagainst the live sites on 2026-11-01: statusunchangedfor all 7 comparisons. sec.gov answers 403 unless the User-Agent carries a contact address and no URL
or
github.com, so the script sendsQuantStrategyLab-fee-check/1.0 <contact>.pytest tests/test_check_fee_schedule.py tests/test_statement_reconciliation.py: 62 passed. Repeatedafter dry-running
bumpon a throwaway copy for 2026-11-22 and 2027-01-22: still 62 passed.ruff@0.15.20 check --exclude external .(the locked version): passed.actionlint: passed.python scripts/test_style.py: 36 passed.scripts/check_style.py --phase 2: 0 blocking (oneexisting README advisory).
the scheduled jobs themselves. The
checkjob runs on this pull request, which shows that the GitHubrunners can reach sec.gov and finra.org.
Why
Issue #497 asks for a monthly review. A scheduled workflow is a durable, auditable place for a fixed
job and gives a PR or an issue each month.
Risk
Tier: high (
.github/workflows/*, so the risk gate needsowner-approved). No runtime or tradingpath changes;
verified_throughis unchanged in this PR. Operational notes:(
can_approve_pull_request_reviews: false). I did not change it. Until it is enabled by amaintainer,
bumppushes the branch and thenotifyissue carries a compare link instead.GITHUB_TOKENdo not start CI: close and reopen to run it.FEE_CHECK_CONTACT(monitored address for the sec.gov User-Agent); a placeholderis used when unset and worked in testing.
pdftotext -layoutoutput of the named FINRAfilings. The rule filing listing check sees the latest 25 filings.