Repository navigation
v1.91.333.0 fix(scorecard): --now bounds every windowed line; recommended-harness week is 83 PRs (GST-135) - #3635
Merged
Merged
Conversation
… week is 83 PRs (GST-135) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…o the window, one instant comparison for runs Pre-landing review fixes for GST-135: readMergedPrs, readGateRuns and readReleases throw past MAX_PAGES instead of returning a partial count; readReleases pages until it reaches the window start; listWorkflowRuns compares both bounds with Date.parse and skips unparsable timestamps; tests for a sub-second window, releases behind a full page and the PR page cap; doc wording on the red-train row and the unverified 142-PR baseline removed. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…sed date, not a bare epoch literal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ross cases GitHub lists releases by creation, so stopping on a page's oldest publication could miss a draft published inside the window. Read every page (the page cap still marks the line unavailable). Pin the gate-run and release page caps with a test. The harness doc's flaky row now says 17 paid flake records across 11 cases instead of 17 cases. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-windowed Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
--now 2026-10-15 --since-days 14used to count 290 merged PRs because every read ran to the real present; it now counts 65, the same number GitHub search gives for that window.Before/after as text: --now 2026-10-15 with a 14-day window: before, every line counted through the day of the run (290 merged PRs); after, only the window counts (65, matching GitHub search)
--now 2026-10-15T00:00:00Z --since-days 14merged:2026-10-01..2026-10-14= 65--now 2026-10-29T00:00:00Z --since-days 14merged:2026-10-15..2026-10-28= 197--now 2026-10-26T00:00:00Z --since-days 7merged:2026-10-19..2026-10-25= 83Why
GST-135 found that
--nowchanged only the scorecard heading, so a past week measured later counted everything up to the day of the run. The scorecard now has one window, fromnow - since-daysup to (not including)now, and every line counts only what falls inside it. The "Where gstack's own numbers stand" section indocs/recommended-harness.mdsaid 103 merged PRs for the week of 2026-10-19; the real week has 83, and every number in that table now comes from the fixed run for that exact week.Blast radius
The change touches
lib/factory-scorecard.tsandlistWorkflowRunsinscripts/lib/ci-history.ts, whichgstack-test-healthalso calls. That caller passes nountil, so its runs read keeps the same query and results;test/test-health-report.test.tspassed unchanged against the recorded fixture (script ran). The /retro skill runs the scorecard without--now, so its window still ends at the current time.Approvals
No approvals recorded for branch capy/now-bounds-every-windowed. Garry approved the GST-135 work on 2026-10-29 ("do it"), relayed by GStack Minder.
Summary
The scorecard's
--nowflag was meant to let you measure a past week after the fact, but each read filtered only on the window start. Merged PRs, gate runs and their cost, free-suite runs, issue searches and releases all ran to the real present. They now all filter through one window helper, so a week measured later reports only that week.Review turned up a quieter version of the same problem. With
--nowin the past, the merged-PR and gate-run reads could hit their page cap and return a short count with no warning. Those reads now mark the line unavailable instead. Releases are read to the last page, because GitHub sorts them by creation date and a draft can be published long after it was created. Free-suite runs compare both window ends as times rather than strings. The harness guide documents--nowand its window, and its flaky row now counts flake records and cases separately.Test Coverage
Tests: 20 → 24 (+4 new) in
test/factory-scorecard.test.tsCoverage: 88% value-weighted (14 of 16 paths at audit time; the sub-second gap was closed by a test in c7f30e5)
Test value: 4 tests written, 0 rejected by the authoring gate, 1 existing test extended, 0 paths weakly covered.
Regression proof: the
--now closes the windowtest was written first and failed against the unfixed code (it was the one failing test of 21, recorded when 40fe5c0 was built); it passes after the fix. The new page-cap and late-release test also fails against the old release paging and passes at b8ed924.Tests ran: scorecard 52
Pre-Landing Review
No blocking findings in any review. The first review, at 40fe5c0, found eight informational items, and c7f30e5 fixed them all. A rerun at 7b0551d found five more, and b8ed924 fixed them. Those were release paging that read every page, page-cap tests for gate runs and releases, a narrower header comment, and the flaky row's wording.
On 2026-10-30 the review step ran a final time at b8ed924 with the 1.91.331.0 reviewers, which restore the pre-#3621 briefs. That run used the core checklist, six specialists (testing, maintainability, security, performance, simplification and state-machines), the native adversarial pass and the cross-family outside voice. Nothing reached the blocking floor (a failing test, a production break, or lost data or secrets). It found seven informational items after merging duplicates. All seven are listed under Review notes and left as they are, so the head did not change.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=7 fixed=0 scope=frozen dispatches=6
Gate edits: none detected (listed=6 eligible=4 inspected=4 unread=0, no tagged hunks)
Outside review (openai/gpt-6.1-sol, reading the diff and the published numbers against the evidence runs): at b8ed924, 1 Medium finding, GitHub's 1,000-result limit (the first note below). Every published number matched the evidence, including "17 paid flake records across 11 cases" and "4 cases that flaked more than once".
Review notes
The b8ed924 review noted 7 informational findings, and all of them stay as they are.
lib/factory-scorecard.ts:274. GitHub returns at most 1,000 runs for a filtered workflow-runs list. So the 20-page cap on gate runs can't fire, and a window with more than 1,000 gate or free-suite runs would print a short count instead of "unavailable". gstack had 54 gate runs and 83 free runs in the doc's week. Worth a follow-up that checkstotal_count.lib/factory-scorecard.ts:334. Reading every release page costs one API call per 100 releases, and a repo with more than 2,000 releases always gets "unavailable" on the releases line. That was the intended trade when b8ed924 made the release count correct. gstack has 2 releases.scripts/lib/ci-history.ts:120.listWorkflowRunshas no direct test for a run created exactly atuntil, or for one whosecreated_atdoes not parse. Both are covered only indirectly through the scorecard tests.scripts/lib/ci-history.ts:115.listWorkflowRunsstill stops quietly at its page cap, so the free-retry line can't show "unavailable" for more than 2,000 runs. Its docstring's "a partial history is never reported" overstates this.lib/factory-scorecard.ts:172. Page-by-page reads can count a row twice or skip one if a PR, run or release changes while the pages are being read. That was true before this PR too.lib/factory-scorecard.ts:173. A read that ends exactly on a full 20th page is reported as unavailable, even though it was complete.docs/recommended-harness.md:291. The remeasured week reads run conclusions, artifacts and issue close times as they are on the day of the run, so a later rerun can drift as artifacts expire. The evidence names the run, but the doc doesn't give the measurement date.Exploratory QA
Ran the fixed scorecard live against garrytan/gstack for three windows (table above) and compared each merged-PR count with an uncapped GitHub search for the same dates. All three match. At b8ed924 the doc's week (
--now 2026-10-26T00:00:00Z --since-days 7) was rerun and gave the same scorecard JSON as the run behind the doc. Logs:runs/r330-1026-7,runs/fixed-1015-14,runs/fixed-1029-14,runs/fixed-1026-7,runs/base-1015-14andruns/base-1026-7in the lane's evidence folder.Design Review
No frontend files changed, so design review was skipped.
Eval Results
No prompt-related files changed, so evals were skipped.
Greptile Review
No Greptile comments.
Plan Completion
6 of 6 plan items done: the failing-first test, the one window helper, the harness section numbers from the 2026-10-26 seven-day rerun, the recorded evidence, everyday wording in the doc, and the CHANGELOG
[Unreleased]entry with no VERSION bump.Verification Results
All five obligations passed and none were blocked or skipped: the two live
--nowruns (65 and 197 merged PRs), the seven-day rerun for 2026-10-26 (83, rerun again at b8ed924 with the same result), the GitHub search formerged:2026-10-19..2026-10-25(83), and typecheck plus the scorecard tests and module-size ratchet.TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual edit: the factory scorecard guide now documents the
--nowwindow end.Scope: base 959c8a6..c7f30e5 (2 commits, 7 files); the staged, unstaged and new-file sets were empty. Searched every tracked doc and authored template for scorecard and windowing references.
Documentation health:
docs/recommended-harness.md: Updated. Added[--now <iso>]to the scorecard usage block and a note that the window is[now - since-days, now), with--now(default: the current time) setting its end so a past week measured later counts only that week. The remeasured numbers were not changed.retro/SKILL.md.tmpl(Step 7.5): Current. It runs without--now, so the window ends at the current time.retro/sections/report-format.md.tmpl: Current.docs/standalone-binaries.md: Current.capy/README.md: Current.README.md: Current.CONTRIBUTING.md: Current.docs/TESTING_INTERNALS.md: Current.docs/test-audit-2026-10.md: Current (dated history, left as written).CHANGELOG.md: Current (not edited; the[Unreleased]entry matches the diff).Coverage:
--nowwindow semantics have reference coverage (the harness guide and the bin help) and a worked example in "Where gstack's own numbers stand". The newlistWorkflowRunsuntiloption andcreatedFilterare internal helpers, so there is no documentation debt.Diagram drift: none.
Test plan
gstack-evidencescorecard lane (test/factory-scorecard.test.ts,test/test-health-report.test.ts,test/docs-config-keys.test.tsandtest/module-size-ratchet.test.ts) at b8ed924: 52 pass, 0 failbun run typecheckat b8ed924: 0 errorsgstack-pregate verify: ok