Skip to content

docs(policy): Adopt review policy and retire legacy AI rules - #366

Merged
tony merged 8 commits into
masterfrom
review-rules-gemini
Dec 5, 2026
Merged

tony merged 8 commits into
masterfrom
review-rules-gemini

Conversation

@tony

@tony tony commented Dec 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove legacy .cursor/rules and .windsurfrules assistant instruction files.
  • Add root REVIEW.md defining the CLI adapter boundary over cihai.
  • Link REVIEW.md from AGENTS.md while keeping CLAUDE.md intact.
  • Add Python revert checks to .github/CONTRIBUTING.md and add .github/PULL_REQUEST_TEMPLATE.md.
  • Add scripts/check_workarounds.py to check .github/workarounds.toml predicates against uv.lock.

Changes by area

Legacy assistant rules

  • .cursor/rules/avoid-debug-loops.mdc, .cursor/rules/dev-loop.mdc, .cursor/rules/git-commits.mdc, .cursor/rules/notes-llms-txt.mdc, .windsurfrules: remove duplicated gate instructions and stale libtmux boilerplate superseded by AGENTS.md, REVIEW.md, .github/CONTRIBUTING.md, and .github/WRITING.md.

Review and contributor policy

  • REVIEW.md: define experimental repository posture, ownership across src/cihai_cli/{cli,_formatter,_colors}.py and upstream cihai/cihai, Changing the map single-PR ownership transfers, rejected patterns (duplicated cihai query/bootstrap internals, info/reverse subcommand asymmetry, import-time side effects, live network calls or mocked owners), and falsifiable BLOCK / NO FINDINGS criteria.
  • AGENTS.md: link REVIEW.md under Which policy applies while preserving CLAUDE.md and module tables.
  • .github/CONTRIBUTING.md: link REVIEW.md, add scripts/check_workarounds.py under the gates, and document the Python production-only revert check.
  • .github/PULL_REQUEST_TEMPLATE.md: prompt contributors for owning module, sibling entry points, pre-fix failure baseline, verification gates, workaround updates, and tool disclosure.
  • scripts/check_workarounds.py: validate .github/workarounds.toml entries against uv.lock, Cargo.lock, pnpm-lock.yaml, and package-lock.json.

Owner, baseline, and tool disclosure

  • Owner and boundary: repository root governance (REVIEW.md, AGENTS.md, .github/CONTRIBUTING.md, .github/PULL_REQUEST_TEMPLATE.md, scripts/check_workarounds.py); N/A for runtime sibling entry points.
  • Failure before the fix: N/A (governance and contributor documentation).
  • Tool use: drafted and verified with Gemini CLI against ruff, ty, pytest, and workaround doctest gates.

Verification

Confirm legacy assistant rule files are absent:

$ rg --files --hidden -g '!.git' -g '.cursor/**' -g '.windsurfrules' .

Test plan

  • Verify zero remaining .cursor/rules and .windsurfrules files
  • Validate lint and formatting across source, tests, docs, and scripts/check_workarounds.py (uv run ruff check ., uv run ruff format . --check)
  • Validate static type annotations (uv run ty check .)
  • Run CLI, formatter, color, and documentation doctest suites (uv run pytest)
  • Run scripts/check_workarounds.py and its doctests (PYTHONDONTWRITEBYTECODE=1 uv run python -B scripts/check_workarounds.py, PYTHONDONTWRITEBYTECODE=1 uv run python -B -m doctest scripts/check_workarounds.py)
  • Full Python matrix in CI

tony added 5 commits December 5, 2026 12:36
why: `AGENTS.md` (with `CLAUDE.md` symlinked to it), `REVIEW.md`,
`.github/CONTRIBUTING.md`, and `.github/WRITING.md` are the canonical
policy files; `.cursor/rules/*` duplicated gate and commit rules.

what:
- Delete `.cursor/rules/avoid-debug-loops.mdc`, `dev-loop.mdc`,
  `git-commits.mdc`, and `notes-llms-txt.mdc`
why: `.windsurfrules` carried a stale `libtmux` copy-paste header and
duplicated formatting and docstring rules governed by `.github/WRITING.md`
and `AGENTS.md`.

what:
- Delete `.windsurfrules`
why: Codify the thin-adapter boundary between `cihai-cli` (`cli`,
`_formatter`, `_colors`) and upstream `cihai` alongside subcommand
symmetry and offline-fixture test rules.

what:
- Add root `REVIEW.md` covering module ownership, `Changing the map`,
  rejected patterns, and falsifiable `BLOCK` / `NO FINDINGS` criteria
- Link `REVIEW.md` from `AGENTS.md` while keeping `CLAUDE.md` intact
why: Regression tests prove nothing if reverting production edits still
passes, and pull requests need explicit owner, baseline, and tool-use
disclosures.

what:
- Link `REVIEW.md` and add the Python production-only revert check and
  workaround check to `.github/CONTRIBUTING.md`
- Add `.github/PULL_REQUEST_TEMPLATE.md` covering owner boundary,
  pre-fix failure baseline, verification gates, and tool disclosure
why: Temporary upstream workarounds linger past the release that fixes
them unless lockfile bumps fail once the target version lands in
`uv.lock`.

what:
- Add `scripts/check_workarounds.py` to validate
  `.github/workarounds.toml` entries against repository lockfiles
@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.47%. Comparing base (a74b9ca) to head (87b74a0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #366   +/-   ##
=======================================
  Coverage   89.47%   89.47%           
=======================================
  Files          12       12           
  Lines         703      703           
=======================================
  Hits          629      629           
  Misses         74       74           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added 3 commits December 5, 2026 15:50
why: The decision section did not say what to do with behavior the base
already has or with a gate nobody ran, or which findings block.

what:
- Add verdict rules: base run, existing and separate, unverified gates,
  behavior defects, and checks and claims
- Link the organization's posture definitions
why: The earlier command restored files in the contributor's checkout. It
could erase an uncommitted edit, and it left the source reverted when a
test did not bite. It counted any nonzero exit as a bite and used
mapfile, which zsh lacks.

what:
- Run the check in a disposable git worktree at HEAD
- Name the regression test in BITE_TEST, and succeed only when the runner
  reports that test as failed
- Default the base to the remote trunk, with BITE_BASE for a pre-fix commit
why: The checker was copied into this repository, so a correction to it
had to land in every copy.

what:
- Delete scripts/check_workarounds.py
- Run libtmux/.github's check-workarounds action in CI, pinned to a commit
- Point the policy files at the action
@tony
tony merged commit 44744fe into master Dec 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant