[v5.5] Guardrails: clean-base verification + stdlib smoke harness#402
[v5.5] Guardrails: clean-base verification + stdlib smoke harness#402lil-aditya wants to merge 2 commits intoEAPD-DRB:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a small “guardrails” layer to make upcoming upstream MUIO v5.5 syncs safer and more repeatable by providing a single clean-base verification command, a minimal stdlib smoke harness, and documentation/CI wiring.
Changes:
- Added
scripts/verify_clean_base.pyto detect unresolved git operations, conflict markers,py_compilefailures, and run stdlib smoke tests. - Added
tests_smoke/unittest harness to validate API app import and a few fixed routes. - Added maintainer playbook + CONTRIBUTING update, and a GitHub Actions smoke workflow on Python 3.11.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests_smoke/test_smoke_app.py |
Adds stdlib unittest smoke tests for app import and a small set of routes. |
scripts/verify_clean_base.py |
Implements the clean-base verification script (git state, conflict scan, compile, smoke tests). |
docs/dev/upstream_sync_playbook.md |
Documents the upstream sync order, overlap surface, rejected patterns, and verification command. |
CONTRIBUTING.md |
Adds contributor-facing instructions for running clean-base verification. |
.github/workflows/smoke.yml |
Adds CI job to run the verification script on PRs using Python 3.11. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git_dir = first_line[len(prefix) :].strip() | ||
| candidate = Path(git_dir) | ||
| if not candidate.is_absolute(): | ||
| candidate = (root / candidate).resolve() |
There was a problem hiding this comment.
resolve_git_dir() returns a candidate path for worktrees/submodules but never verifies it exists. If .git points at a missing/nonexistent gitdir, check_unresolved_git_state() will silently treat the repo as clean. Consider checking candidate.exists()/candidate.is_dir() and returning None (or an explicit failure message) when the resolved git dir is invalid.
| candidate = (root / candidate).resolve() | |
| candidate = (root / candidate).resolve() | |
| # Only return a git dir that actually exists and is a directory. | |
| if not candidate.exists() or not candidate.is_dir(): | |
| return None |
| path = root / raw_path.decode("utf-8", "surrogateescape") | ||
| if path.suffix.lower() not in suffixes: | ||
| continue | ||
| if any(part in SKIP_DIR_NAMES for part in path.parts): | ||
| continue | ||
| yield path |
There was a problem hiding this comment.
iter_repo_files() checks SKIP_DIR_NAMES against path.parts, but path is absolute, so any ancestor directory named e.g. venv/node_modules will cause all repo files to be skipped (false negatives for conflict/compile scanning). Use path.relative_to(root).parts (or equivalent) for the skip check so only paths within the repo influence filtering.
|
396 opened by @sanvishukla pls check out |
|
I've taken a look at the guardrails here, and while the structure aligns with the #389 requirements, there are a few architectural risks that might impact the Stability Track for v5.5:
Happy to help refine these so we have a bulletproof landing gate for the v5.5 upstream pull. |
|
Hello @brightyorcerf thanks for the suggestions and I’ve gone through them:
Good catch. Since the goal of the guardrail is to work even in read-only environments, it makes sense to avoid any bytecode writes.
Agreed — using absolute
I took a look at this, but I don’t think it’s necessary for this PR. |
|
Appreciate the quick turnaround on the bytecode suppression and the path-filtering fix, @lil-aditya. Those were the primary risks for the v5.5 Stability Track. |
|
@lil-aditya Thanks for the work here. We have now landed the v5.5 guardrail/smoke work through #422 in a different form via the upstream sync notes, landed smoke scripts, and landed smoke tests, so I’m closing this v5.5-specific PR. The remaining CI workflow piece belongs under the broader CI track with #375 / #204 rather than keeping this open as sync work. |
Closes #389
Part of #388 (v5.5 upstream sync)
Reviewed issues: #375 (Foundational CI/CD Infrastructure): Helps as it adds a lightweight CI check (Python 3.11 smoke/verify). It’s not a full CI/CD framework, but it’s an early building block.
#388 (Absorb selected MUIO v5.5 changes on origin/main): Here #402 directly helps as it(#402) is a prerequisite for the v5.5 absorption work by providing a repeatable “landing gate” so upstream pulls are safer and more predictable.
#402 doesn’t define contribution intake rules/process i.e for #255 ; that goes into #393 separate.
Summary
This PR introduces the guardrails required before pulling upstream MUIO v5.5:
How to run
python scripts/verify_clean_base.py
What this checks
Constraints respected
Known caveats
Out of scope
Checklist