Skip to content

fix(python): mark the Monty fork edits that turned main red - #2865

Merged
chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-7qwnvu
Nov 6, 2026
Merged

chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-7qwnvu

Conversation

@chaliy

@chaliy chaliy commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What changed

main is green again. The Monty fork drift check passes, and the two causes behind the 12 reported regions are fixed:

  • Eleven real fork edits are now marked. All belong to the shared-graph fix (fix(python): stop shared-graph repr/compare outliving the time limit #2857): eight repr_check_time(..)? call sites (dict ×2, generic_alias, union, partial ×2, list ×2), the ResourceError import the error-returning check needs, the write_dataclass_repr doc sentence, and the tick field initializer. Each call site only gained a ?, so its marker points at the shared rationale on repr_check_time instead of repeating eleven lines of it eight times.
  • One was a checker blind spot. The marker window was a fixed three lines, so on a multi-line fork note it read the note's tail and missed the marker on its first line — which is exactly how these forks are written (repr_check_time's note runs eleven lines, check_time_every's five). The window now also covers the whole comment/attribute block attached to the changed item, and stops at the first line of code so one item's note cannot vouch for the next item's drift.

Rust source changes are comments only; no behavior change.

Why

The drift check landed in #2861 from a branch cut before #2857 merged. Each PR was green on its own branch, and main went red the moment both were in it — the check had never seen #2857's edits, and #2857 had never seen the check. Red since 05:29 UTC today.

Before / After

Before, on main @ 7789381:

$ python3 scripts/check_monty_fork.py
bashkit-monty/src/types/dict.rs:1170: differs from upstream without a `bashkit fork:` marker
bashkit-monty/src/types/dict.rs:1210: differs from upstream without a `bashkit fork:` marker
bashkit-monty/src/types/generic_alias.rs:185: ...
bashkit-monty/src/types/host_class.rs:317: ...
bashkit-monty/src/types/list.rs:3: ...
bashkit-monty/src/types/list.rs:1071: ...
bashkit-monty/src/types/list.rs:1099: ...
bashkit-monty/src/types/partial.rs:374: ...
bashkit-monty/src/types/partial.rs:386: ...
bashkit-monty/src/types/union.rs:362: ...
bashkit-monty-types/src/resource.rs:383: ...
bashkit-monty-types/src/resource.rs:585: ...
12 fork drift error(s); mark source edits with `// bashkit fork: <why>`
$ echo $?
1

After:

$ python3 scripts/check_monty_fork.py
Monty forks match upstream 1.4.0 outside `bashkit fork:` markers
$ echo $?
0

Also verified locally:

$ python3 -m unittest discover -s scripts/tests -p 'test_*.py'
Ran 233 tests in 8.155s
OK (skipped=2)                      # 230 before, +3 for the new window rule

$ cargo test -p bashkit --features python --test integration shared_graph_walks_respect_time_limit
test python_security_tests::whitebox_resource_limits::shared_graph_walks_respect_time_limit ... ok

$ cargo clippy -p bashkit --features python --lib --all-targets -- -D warnings   # clean
$ cargo fmt --check                                                              # clean
$ just check-doc-links    # docs OK: 221 relative links across 52 files
$ just check-okf          # okf-lint 0.1.1: knowledge conforms to OKF v0.2

The three new checker tests reproduce the real shape (a fork note inserted into an unchanged doc block, plus a signature change below it, as two separate diff hunks). Confirmed each fails against the old fixed-window rule before the fix, and that a note still cannot reach past a line of code into the next item.

Risk

  • Low
  • The window change makes the check accept slightly more: a marker anywhere in the comment block attached to a changed item. It cannot cross a line of code, so unmarked drift in a neighbouring item is still caught (pinned by test_comment_block_does_not_reach_past_code and test_marker_far_above_does_not_cover_change). Rust edits are comment-only, so no runtime behavior moves.

Checklist

  • Tests added or updated
  • Backward compatibility considered — internal tooling and comments only

https://claude.ai/code/session_01Wy7MBvvcpUtMeYF4j5LgpF

@bashkit-pr-reviewer

bashkit-pr-reviewer Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review verdict: approve — comment-only markers plus a correct checker fix, no behavior change

No findings. This PR does exactly what it says: marks the 11 unmarked #2857 fork edits so the #2861 drift check passes, and fixes the checker's blind spot for markers at the top of long attached comment blocks.

What I verified beyond the diff:

  • Each Rust hunk in the checkout (dict.rs ×2, generic_alias.rs, union.rs, partial.rs ×2, list.rs ×2 + ResourceError import, host_class.rs doc sentence, resource.rs tick initializer) is a ////// comment addition only — no behavior change, so no sandbox, metering, or repr semantics impact.
  • The checker fix (marker_window walking up over ///////#[...] attached lines, stopping at the first line of code) matches the documented rule now written in knowledge/operations/dependencies.md, and the three new tests in scripts/tests/test_check_monty_fork.py pin both directions: a marker on the first line of a long note covers the item, while a note on one item cannot mark drift in the next item and a far-above marker does not cover.
  • Knowledge updated in the same change (dependencies.md, log.md), per AGENTS.md. Full diff seen (truncated: false); checkout succeeded. I did not build or run tests per the sandbox limits — reasoned from the code and the checker's offline synthetic-tree tests.

Update on re-review (head b241d7f7): the new push only fixes the PR-body count typo noted above ("seven" → "eight"); the diff is unchanged (+93/−8, same 11 files) and the checked-out markers, checker, tests, and knowledge entries are identical to the previously reviewed state. Nothing further to review.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit b241d7f Commit Preview URL

Branch Preview URL
Nov 06 2026, 09:53 AM

The drift check (#2861) was cut from a branch that predated the
shared-graph fix (#2857), so each passed its own CI and main went red on
12 unmarked regions once both landed.

Eleven are real #2857 edits and are now marked: eight
`repr_check_time(..)?` call sites (dict x2, generic_alias, union,
partial x2, list x2), the `ResourceError` import the error-returning
check needs, the `write_dataclass_repr` doc sentence, and the `tick`
initializer. Each call site only gained `?`, so its marker points at the
shared rationale on `repr_check_time` rather than repeating it.

The twelfth was a checker blind spot: the fixed three-line window read
the tail of a multi-line fork note and missed the marker on the note's
first line, which is how these forks are written (`repr_check_time`'s
note runs eleven lines). The window now covers the whole
comment/attribute block attached to the changed item and stops at the
first line of code, so one item's note cannot mark the next item's
drift. Rust source is unchanged apart from comments.

Claude-Session: https://claude.ai/code/session_01Wy7MBvvcpUtMeYF4j5LgpF
@chaliy
chaliy force-pushed the eve/clever-mccarthy-7qwnvu branch from b7ed794 to b241d7f Compare November 6, 2026 09:53
@chaliy
chaliy merged commit 82818fb into main Nov 6, 2026
25 checks passed
@chaliy
chaliy deleted the eve/clever-mccarthy-7qwnvu branch November 6, 2026 10:23
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.

1 participant