Posture: experimental (pre-1.0 zero-dependency CLI wrapper that detects the current directory's git, svn, or hg checkout and proxies arguments directly; fix leaky or asymmetric behavior at the owning function and update tests, docs, and CHANGES in the same diff).
Posture defines experimental, stable and private.
Review the complete change against <base>, including untracked files. Report all findings in one pass without editing files. Writing conventions · Contributing gates · AI policy.
| Layer | Functions / Files | Owns | Must not own |
|---|---|---|---|
| VCS path detection | find_repo_type(), vcspath_registry (src/g/__init__.py) |
Walking directory ancestors for .git (directory or worktree/submodule file), .svn, and .hg markers |
Subprocess spawning, sys.argv reading, or logging configuration |
| CLI parser | create_parser() (src/g/__init__.py) |
--version / -V flag definition and argparse.REMAINDER pass-through help metadata (docs/cli/index.md) |
Intercepting or rewriting downstream VCS flags (-h, -v, subcommands) |
| Process runner | run() (src/g/__init__.py) |
Entry-point dispatch, --version short-circuit, missing-VCS reporting, and subprocess.Popen execution (wait vs communicate) |
Re-implementing find_repo_type() marker rules or adding runtime dependencies |
| Metadata and tests | src/g/__about__.py, conftest.py, tests/test_cli.py |
Package version metadata (exec'd by docs/conf.py) and real-VCS CLI integration tests |
Mocking subprocess.Popen when a real tmp_path repository exercises the path |
Do not BLOCK against <base>:REVIEW.md's prior owner row when a pull request migrates an invariant cleanly to a single owner, updates callers, tests, and REVIEW.md in the same diff, and states the old and new owner in the pull request description.
- Adapter versus duplicated rule:
run()adaptssys.argvandfind_repo_type()into a transparentsubprocess.Popencall, whilecreate_parser()documents the CLI contract for Sphinx. Block whenrun()andcreate_parser()diverge on--version/-Vvs forwarded VCS flags, or whenrun()duplicates marker checks owned byfind_repo_type(). - Zero-import format leaks: Keep
find_repo_type()andcreate_parser()free of test-runner or environment inspection.G_IS_TESTinrun()exists solely sotests/test_cli.pycan inspect the spawnedPopenhandle instead of printing a REPL return value; do not add newPYTEST_CURRENT_TESTorG_IS_TESTbranches to detection or parsing logic.
- Swallowing VCS arguments:
gmust forward arbitrary VCS flags (such asg status -sorg log -n 1) untouched acrossgit,svn, andhgcheckouts. - Asymmetric marker detection across
.git,.svn, and.hg: Check standard checkouts, nested subdirectories, git worktrees/submodules (.gitfile), and non-repository directories (tmp_path) together. - Import-time side effects or runtime dependencies: Keep
src/g/__init__.pyimport-pure (logging.basicConfigstays insiderun(), never at module import) and keep runtime dependencies empty. - Partial process or stream state: When
run()spawns a child VCS process (wait=Truevscommunicate()), ensure stdout/stderr pipes and non-zero return codes remain observable to callers without deadlocking or leaving zombie children. - Unpinned upstream workarounds: Record temporary VCS or tooling workarounds in
.github/workarounds.tomlverified by the sharedcheck-workaroundsaction in CI.
- For bug fixes and behavioral changes, reproduce the failure on
<base>(or on<pre_fix_head>when fixing a defect introduced earlier in the same open pull request) throughrun()orfind_repo_type()against a realtmp_pathdirectory layout. - Verify the production-only revert check fails the new test inside the real owner call (for behavioral changes), then run
uv run ruff check .,uv run ruff format . --check,uv run ty check .,uv run py.test, and the sharedlibtmux/.github/actions/check-workaroundsaction, which CI runs. - Emit
BLOCKorNO FINDINGS(plus optional non-blockingNOTEitems). Before emittingBLOCKon placement, weigh any boundary-adapter or ownership-transfer counter-case and state a concrete test, command, or code observation that would prove the finding wrong.
These rules decide which findings block.
- Base run: A finding that code misbehaves shows its check run on
<base>and on the change, with one line of output from each. - Existing and separate: Behavior
<base>already has does not block. Report it as aNOTE, unless the change adds a promise the behavior breaks; then the broken promise is the finding. - Unverified: A gate nobody ran is unverified. Name the command that would run it. It holds the merge until someone runs it, and it does not make the verdict
BLOCK. - Behavior defects: A behavior defect blocks when a caller can reach it in a supported environment, or when it breaks a promise in the pull request description, a docstring, help text or the changelog. Otherwise it is a
NOTE. - Checks and claims: A weakened check, a rule written in a second place and a behavior claimed as tested with no test that bites block whether or not a caller reaches them.