fix: post-merge review sweep — lint blind spots, bagel prefill guard, label workflows, refl nits - #290
Merged
Merged
Conversation
… review - cross-package rule now catches 'from experimental import <sibling>', bare 'import experimental', relative imports climbing past the package root, and imports from top-level experimental/*.py (no shared space) - core-dependency set now unions [project.dependencies], every [project.optional-dependencies] extra, and [tool.uv] override-dependencies — extras pins (torch & co) no longer sail through - requirements scan covers requirements*.txt, rejects pip option/include lines and unparseable URL/VCS requirements (fail closed) - check_recipe_targets gains the tier-direction rule: recipes outside experimental/ may not target experimental.*, and a package's recipes may not target a sibling package - reward extras requirements: drop the (now-flagged) bare torchvision re-pin in videoalign, document that face/videoalign get torch(vision) from the core stack; README states which rules are script-enforced
…lay path BagelPipeline._build_contexts runs the same vendored inference-signature prefills the #277 fix guarded in BagelDiffusionStage, but relied on callers already being in eval(). SFT/trainside can reach it mid-training; guard-and-restore instead of assuming the mode.
DiffusionSamplingParams.seed is Optional and generate_latents supports None (unseeded path), but the call sites int()'d unconditionally.
The dict-index comprehension raises KeyError before the length check can ever fire, and resolve() consumes the same keys earlier still.
…h comments datasets/* ignored the two converters #284 moved in (tracked but hidden from ruff/rg/editors; new siblings needed add -f) — whitelist the dirs, keep their jsonl outputs local-only. experimental/private_* now also covers stray private files. Two recipe comments pointed at scripts/*.sh paths that no longer exist (runner lives at examples/).
…urrency - closed/merged PRs shed their status label (they used to keep 'need review' forever) - synchronize now applies 'need review' when a PR carries no status label at all, so one missed event no longer sticks forever - drop the shared concurrency group on the review-labels consumer: GitHub keeps one pending run per group, silently dropping the earlier PR's sync when reviews land on two PRs within seconds
haonan3
requested review from
CjhHa1,
Ideny42,
celve,
heguangxin and
leviking98z-rgb
as code owners
July 31, 2026 11:35
2 tasks
…recipes, no-space direct refs - pr-review-status-labels: per-PR concurrency group (run-id fallback for fork PRs whose workflow_run.pull_requests is empty) restores the same-PR serialize-latest semantics the removed global group provided, without the cross-PR pending-slot drops; DELETE tolerates the 404 a parallel fork-PR run can leave behind - check_recipe_targets: a recipe at the experimental/ root can no longer wire experimental.* — a recipe belongs inside one package - check_experimental_boundaries: PEP 508 direct references without spaces (name@git+https://...) parse instead of erroring; bare URL/VCS lines still fail closed
Collaborator
Author
|
All three reproduced as lab cases in the negative battery before fixing (39 checks, all pass); full |
- refl seed: replace the null-tolerance with a loud ValueError — roles.py documents fixed-noise as the verified DRaFT regime and no live config produces seed:null; silently unseeding violated the package's own contract and diverged from the mainline base classes - closed-PR label cleanup: delete all four labels unconditionally (the payload snapshot misses a label written by a review-sync racing the close instant, and nothing ever repairs a closed PR); tolerate only HTTP 404 on deletes here and in the review consumer — blanket || true would turn permission regressions (the one failure class observed in production) into green runs - review-labels concurrency: fork PRs fall back to a head-repo+branch group (actual serialization) instead of per-run; honest comments - boundaries checker: relative-import level bound now matches Python (level <= len(pkg)); SKIP_PARTS intersects repo-relative parts so a checkout living under a directory named vendor can't blank the rules; follower set gains tab (valid PEP 508 whitespace) - bagel guard comment documents why bundle.transformer suffices (vae/vit stay in load-time eval and are never mode-flipped) - gitignore: converter-output jsonl patterns cover nested dirs (**/)
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.
Summary
Fix batch from an adversarial post-merge review of the five recently merged PRs (#210, #277, #279, #284, #286). Every item below was reproduced/verified before fixing; the review evidence lives in the per-item notes.
Boundary lint had systematic blind spots (#279), and they already mattered on the tree:
from experimental import <sibling>, bareimport experimental, relative imports climbing past the package root, and treated top-levelexperimental/*.py(incl.__init__.py) as a lint-free shared space — the most natural spellings of exactly the sideways borrowing the README forbids. All caught now, in any spelling.[project.dependencies]only, so every extras pin — torch, torchvision, sglang, vllm — was re-declarable undetected; the in-treevideoalign/requirements.txtwas already re-declaringtorchvisionwith no signal. The set now unions base deps, every[project.optional-dependencies]extra, and[tool.uv] override-dependencies; the scan coversrequirements*.txtand fails closed on pip option/include lines and URL/VCS lines it cannot vet. The videoalign re-pin is dropped (comment documents that the engine extra provides it) and the face extras file documents the same for its top-leveltorchvisionimport.check_recipe_targets.py: recipes outsideexperimental/may not_target_intoexperimental.*, and a package's recipes may not target a sibling package —_target_is this repo's primary wiring mechanism and previously carried zero directional signal.experimental/README.mdnow states which rules are script-enforced (1, 2, 4) vs review-enforced (3, 5, 6), and that private packages are lint-gated locally only.Bagel (#277 follow-up):
BagelPipeline._build_contextsruns the same vendored inference-signature prefills the #277 fix declared eval()-load-bearing, but with no guard — SFT/trainside callers reaching it in train() get the exactpacked_query_sequenceTypeError back. Same guard-and-restore applied.#284 follow-ups: the two moved converters landed inside gitignored
datasets/*(tracked but invisible to ruff/rg/editors; new sibling files neededadd -f) — the dirs are whitelisted with their jsonl outputs kept local-only. Two recipe comments pointing at nonexistentscripts/*.shlaunchers now point atexamples/run_experiment_single_node.sh.experimental/private_*also covers stray private files now (was dir-only).Label workflows (#286 follow-ups): merged/closed PRs shed their status label (they kept
need reviewforever — see #210/#279 right now);synchronizeself-heals a PR that lost its label to a missed event/transient failure; the review-labels consumer drops its shared concurrency group (GitHub keeps one pending run per group, so reviews landing on two PRs within seconds silently dropped the earlier sync).refl nits (#210 follow-ups):
seed: nullno longer TypeErrors at the worker (int(params.seed)had no None branch;generate_latentsalready supports unseeded); the unreachable grad-input mismatch guard inworker.pyis dropped (its dict-index comprehension KeyErrors first, andresolve()consumes the same keys earlier still).Related Issue
N/A
Test Plan
__init__-hub sideways imports flagged; extras pin, uv-override pin, case-variant name,-rinclude, VCS line, andrequirements-gpu.txtcoverage flagged; self-imports (absolute/relative/from-bare), core imports, additive names, andname @ urldirect refs stay clean; core→experimental and sibling_target_s flagged while own-package recipes pass with no unresolved noise.python lint/check_experimental_boundaries.py→ ok;python lint/check_recipe_targets.py→2310 recipe _target_ paths resolve.(unchanged count).git check-ignorebattery: both converters no longer ignored; their*.jsonloutputs, otherdatasets/*dirs,experimental/private_notes.py, andexperimental/private_a/f.pyall ignored.python -m py_compileon all six edited.pyfiles;bash -non both edited workflow scripts (extracted from YAML).SKIP=no-commit-to-branch pre-commit run --all-files→ all 16 hooks pass (both hardened guards included).no_gradblock, same pattern as the merged fix(bagel): rebuild replay KV contexts in eval() so navit keeps inference dispatch #277 fix); and themaster_dtype: fp32verification gap flagged for feat(experimental): add WAN ReFL as a self-contained training package #210 is deliberately NOT addressed here (owner action on the pinned-torch env, see Reviewer Notes).Compatibility / Risk
closedcleanup, self-heal onsynchronize, no shared concurrency). Thepull_request_targetconsumers still check out nothing and interpolate no PR-controlled strings; the PR-number regex guard in the review consumer is untouched.freeze/rollout paths unaffected (colocate short-circuits before this call).seed: nullnow takes the supported unseeded path instead of crashing.Reviewer Notes
master_dtype: fp32default was never GPU-verified at the merged head (the recorded smoke ran torch 2.7.1 with fp32 dropped; the restore commit postdates it and the yaml itself says it needs the pinned torch ≥2.11) — needs an owner smoke on the pinned env + README table update; (2) narrowing the label workflows'issues: write— likely redundant per the 403 evidence, but should be verified on a real labeled run after this merges rather than narrowed blind; (3) a backfill dispatch (gh workflow run pr-review-status-labels.yml) to reconcile the stale labels fix(ci): restore pull-requests write for PR label workflows #286's test plan promised — one manual command, listed for the maintainer.Checklist