| name | code-review |
| description | Review Numan pull requests against REVIEW.md severity labels, architecture invariants, CI gates, and phase-specific notes. Use for Copilot code review, PR review requests, and any pull-request or diff review in this repository. |
Numan code review
When reviewing a pull request or diff in this repository, follow the canonical
guide at REVIEW.md. Prefer that file over paraphrased
memory. AGENTS.md remains the source for project
structure and build commands.
Path-specific Copilot apply-to instructions live at
.github/instructions/review.instructions.md
and must stay aligned with REVIEW.md.
How to review
- Read the PR description and changed files; stay within the stated scope.
- Apply severity labels from
REVIEW.md (P0–P3). Lead with P0/P1 findings.
- Flag any violation of the architecture invariants listed below.
- Check the review checklist and phase-specific notes when relevant paths
change (lockfile, journals, nupm compat, activation lifecycle).
- Leave actionable comments with concrete fixes. Do not approve or request
changes as a human gate; report findings only.
CI gates (must pass)
PR CI (.github/workflows/ci.yml):
- Test —
cargo test
- Clippy —
cargo clippy -- -D warnings
- Format —
cargo fmt --check
- MSRV (1.88) —
cargo +1.88 check --locked --all-targets
- Package —
cargo package --locked
- Deny —
cargo deny (CI: EmbarkStudios/cargo-deny-action@v2)
- Real-Nu acceptance —
cargo test -- --ignored with Nu 0.113 on PATH (PR job skips Stage 1 / active-plugin update suites)
Severity labels
| Label | Meaning |
|---|
| P0 | Data loss, security boundary break, silent corruption, or trust bypass |
| P1 | Incorrect behavior on happy path, missing error handling for common failures |
| P2 | Test/fixture mismatch with documented contract, misleading docs, maintainability |
| P3 | Style, naming, non-blocking suggestions |
Architecture invariants (flag violations)
- Install is inert —
numan install must not invoke Nu or touch autoload/plugin registration.
- Nu integration is activate/deactivate-owned — only the activate/deactivate lifecycle boundary invokes plugin register/unregister; an explicitly opted-in
update may coordinate that boundary (exact NUMAN_ENABLE_ACTIVE_PLUGIN_MUTATION=1) but must not own or invoke Nu callbacks directly.
- Mutation lock — all mutating commands (
install, remove, update, gc, nupm import) must call acquire_mutation_lock(root).
- Atomic JSON writes — lockfile, journals, and state files use
write_json_atomic; no partial writes.
- Journals under
state/ — pending activation, autoload, lifecycle journals live under $NUMAN_ROOT/state/.
- Module autoload identity — four-part match (Nu exe hash, Nu version, vendor autoload dir, managed file path); lockfile
module_activation is ground truth.
- Managed file ownership — never overwrite foreign autoload files; respect
OWNERSHIP_MARKER.
- Nu invocation safety — paths via env vars only; no runtime interpolation in Nu program strings.
- Test seams — unit tests use
FakeCandidateRunner / injectable registrars; do not spawn real nu in unit tests.
- Phase 6 nupm boundary — read-only toward
NUPM_HOME; no build.nu execution; no bidirectional sync.
Review checklist
Phase-specific notes
- Lockfile v2 — preserve
origin, revision_id, payload_sha256, and journal recovery semantics on lifecycle changes.
- nupm compat (Phase 6+) — follow
docs/nupm-compatibility.md supported/rejected profiles; fixtures under tests/fixtures/nupm/ are the contract for parser/classifier tests.
- Active-plugin update — deactivate→upgrade→activate only with exact
NUMAN_ENABLE_ACTIVE_PLUGIN_MUTATION=1; fail closed otherwise. See docs/active-plugin-gate.md.