review-design: move the fix history lookup with an error branch into a script with tests

Open
#69 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@c-w-z is already working on this.

Since Dec 2, 2026.

  • #83 by @c-w-z — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
git, github, shell
Domain
tooling

Research direction

Read .agents/skills/review-design/SKILL.md and docs/doc-rules.md, then inspect the open pull request #83 before starting; the work may already be underway. Add the history lookup script under tools/review-design/ with tests for wrong and deleted paths, unlimited history, merge commits, and the requested commit details. Update step 1 to run the script, and consider the issue done when its behavior matches the proposal and the tests pass.

Written by the indexing model from the issue text.

Description

type/documentation
Kind

Does not agree with another doc

Location
  • .agents/skills/review-design/SKILL.md line 25: the fix history command in step 1, Collect the symptoms.
  • docs/doc-rules.md: the bullet "Commands and scripts in skills" in Writing style, as PR #67 changes it.

The command in Report of .agents/skills/trace-decision/SKILL.md has the same problem. #38 handles it: https://github.com/c-w-z/commit-decision-record/issues/38#issuecomment-7336649249

Version

4804c6b

Problem

PR #67 adds this rule: "A command can give a wrong or incomplete result and not say so. Do not handle such a case in the skill text. Handle it in a script in tools/ with tests. Examples of such text are an error branch, a check after the command, and a second run with other options."

The step runs git log … | grep . || { echo …; false; }. git log exits with 0 and prints nothing for a wrong path. The grep . error branch handles that case in the skill text, and no test covers it. So the step does not follow the rule.

Also, -30 cuts the history, and nothing tells the AI assistant that more commits exist.

Evidence

The reviews of PR #67 found them:

Proposal

Add a script in tools/review-design/ with tests, and run it in step 1:

  • It prints %h %s and --numstat for each commit that changed <path>, from the repo root. <path> can be a deleted path.
  • If no commit changed <path>, it exits with 1, because the path is wrong.
  • It reads the whole history of <path>, with no limit.
  • It keeps merge commits in the list, as step 1 does now. --no-merges with the pull request of each commit is #82.

Rejected: One lookup module for this step, the Report step of trace-decision and the --log input of #66. After the lookup the three need different things: --numstat; the oldest commit; landing commits and pull requests. They share only "run git log and check that the result is not empty". A shared module would add modes, a ref parameter for each user and rules for an empty result for each user.

Rejected: Keep a limit, with a status line when the script cuts the history. The script reads only local Git, and each commit gives 2 to 4 lines, so the whole history is cheap. 752f048 added -30 with the first version of the skill and gives no reason for it.

Cost: A path with a long history gives a long output.

Dominant language
Shell
Stars
1
Forks
0
Avg merge
6h 59m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c-w-z/commit-decision-record

All issues in c-w-z/commit-decision-record

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.