Skip to content

review: 9 findings on diff/stdin/agents surface; bump to 0.6.0#8

Merged
akesling merged 3 commits into
mainfrom
akesling/rev
May 8, 2026
Merged

review: 9 findings on diff/stdin/agents surface; bump to 0.6.0#8
akesling merged 3 commits into
mainfrom
akesling/rev

Conversation

@akesling
Copy link
Copy Markdown
Contributor

@akesling akesling commented May 7, 2026

Summary

  • 9 review annotations recorded against the new qualifier diff, record/emit --stdin, and agents surfaces added in 0.5.0–0.5.1 (5 concerns, 3 suggestions, 1 praise). Run qualifier diff main after checkout to see them under "Added on this branch".
  • Bump 0.5.1 → 0.6.0. The diff/stdin/agents work was a minor's worth of new surface but landed as a patch; correcting forward.
  • Tighten AGENTS.md "Keeping Things in Sync" so the next time this happens the rule is unambiguous: minor for new features, patch only for fixes, Cargo.lock in the same commit.

Highlights from the review

Concerns

  • diff.rs:671term_width() reads only $COLUMNS, which most shells don't export. Wrap-to-terminal effectively always falls back to 80 cols.
  • record.rs:308--file override silently dropped under --stdin.
  • record.rs:478detect_issuer() re-spawns git/hg per stdin line; ~2N forks for invariant data.
  • diff.rs:155 — ref-side enumeration ignores .qualignore, producing phantom "Resolved/removed" entries for paths excluded only on HEAD.
  • agents/mod.rs:40process::exit(2) for unknown topics; inconsistent exit code, bypasses the top-level error path.

Suggestions

  • diff.rs:369enumerate_qual_blobs walks the whole tree to find a few .qual files.
  • diff.rs:430supersedes_index collapses duplicates: only one closer shown when multiple HEAD records supersede the same id.
  • record.rs:296 — stdin batch under --format json process::exit(1)s to suppress the error prefix; should be a first-class Error::AlreadyReported.

Praise

  • diff.rs:132 — merge-base default with --from-tip escape hatch is the right model for PR-style diffing.

Test plan

  • cargo test --all-features passes (14/14).
  • cargo clippy --all-targets --all-features -- -D warnings clean.
  • qualifier ls shows the 9 new annotations on the touched files.
  • Reviewer: spot-check qualifier diff main output renders the new findings.

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

akesling added 2 commits May 7, 2026 17:01
Recorded via `qualifier record` during a focused pass over the new
`qualifier diff`, `record/emit --stdin`, and `agents` surfaces added
in 0.5.0–0.5.1.

Concerns:

- `term_width()` reads only `$COLUMNS` (not exported by most shells),
  so the wrap-to-terminal feature almost always falls back to 80 cols
  (src/cli/commands/diff.rs)
- `--file` override silently dropped under `record --stdin`; the
  documented "write everything to one file" use case writes wherever
  layout resolution lands (src/cli/commands/record.rs)
- `detect_issuer()` re-spawns git/hg per stdin line, ~2N forks for
  invariant data on a batch of N (src/cli/commands/record.rs)
- ref-side enumeration in `qualifier diff` ignores `.qualignore`, so
  paths excluded only on HEAD surface asymmetrically as
  "Resolved/removed" even though the file is untouched
  (src/cli/commands/diff.rs)
- `agents` subcommand uses `process::exit(2)` for unknown topics
  instead of returning `Err`; inconsistent exit code and bypasses the
  top-level error path (src/cli/commands/agents/mod.rs)

Suggestions:

- `enumerate_qual_blobs` walks the entire tree at <ref> to find a few
  `.qual` files — O(repo-size) on monorepos
- `supersedes_index` HashMap silently keeps only one closer when
  multiple HEAD records supersede the same id
- stdin batch under `--format json` calls `process::exit(1)` to
  suppress the top-level error prefix; should be a first-class
  `Error::AlreadyReported` variant

Plus one praise: the merge-base default with `--from-tip` escape
hatch is exactly the right model for PR-style diffing.
The 0.5.0 → 0.5.1 jump that landed the new `qualifier diff`
top-level command and `record/emit --stdin` batch mode (~1000 LOC of
new user-visible surface) was a patch bump, but by semver that's a
minor. Correct it forward to 0.6.0 rather than retroactively
rewriting 0.5.1.

Also expand the AGENTS.md "Keeping Things in Sync" entry for
Cargo.toml so future agents/contributors get the gradient
explicitly:

- minor for new features / new commands / behavior changes
- patch only for bug fixes or behavior-preserving refactors
- update Cargo.lock in the same commit
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🔍 Preview deployed: https://c43b25f1.qualifier-dev.pages.dev

…etical

The previous help template put `agents` in the "For AI agents:" group
with a description ending "(start here)". An agent scanning the verb
table — looking for `record`/`show`/`ls` — easily reads `(start here)`
as flavor text and proceeds without ever opening the agents page,
missing pitfalls like "don't volunteer praise annotations". This is
exactly what happened during the review pass for PR #8.

Two changes:

- Add an imperative one-liner ABOVE the subcommand list so the
  directive isn't competing with 12 other entries:

      If you are an AI coding agent, run `qualifier agents` first — it
      covers the conventions and pitfalls you need before recording
      any annotation.

- Rephrase the agents row description from a passive label
  ("Self-contained guide for AI coding agents (start here)") to an
  imperative ("Read this before recording annotations. Self-contained
  agent guide.").

Updates the help-template integration test to assert both the
directive and the new description.

Patch bump 0.6.0 → 0.6.1: text-only UX change, no surface added.
@akesling akesling merged commit 988c84d into main May 8, 2026
2 checks passed
@akesling akesling deleted the akesling/rev branch May 8, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant