trace-decision collector reports an issue or a pull request as read but leaves out its comments and reviews

Open
#39 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

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

Since Nov 30, 2026.

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

Assessment

This issue has not been assessed yet.

Description

type/feature
Problem to solve

The trace-decision skill uses tools/trace-decision/collect.mjs to collect the sources of a decision. For a pull request and for each referenced issue or pull request, the collector reads the title and the body. It does not read the comments, the reviews or the review comments. It reads a comment only when a text links to that comment (#issuecomment- or #discussion_r).

The output does not show this. The collector prints --- issue: read or --- pull request: read, and exits with 0. The --help text says that exit code 0 means "The script read all sources." Step 5.2 of the skill says: "Only these status lines give the status." An agent then reports the issue or the pull request as read, and it does not look at the comments.

A comment or a review can give the reason for a decision. 14e97f4 says: "A review comment on #17 named this limit." That review comment, https://github.com/c-w-z/commit-decision-record/pull/17#discussion_r4726053205, is not in the collector output for a line of pull request #17 (see More information).

A change must reach these goals:

  1. An agent knows which comments, reviews and review comments it did not read. It then does not report an issue or a pull request as read in full.
  2. A run stays short and its output stays limited. 10eeb54 rejects following the references inside issues and comments, because "the number of sources then has no limit".
Proposal

The means is not decided. Options:

Option Goal 1 Cost for goal 2
Print the number of comments, reviews and review comments of each issue and pull request in a status line, for example --- comments of pull request #17: not read, 1 review comment. The agent reads them with gh when they can explain the decision Reached. The agent decides what to read The responses that the collector already reads give the numbers of comments and review comments. The number of reviews needs one more query for each pull request
Read the comments, reviews and review comments with a limit, as --max-references does, and mark the rest as not read Reached More queries and a longer output in each run
Read them only for the pull request of the commit and the issues that it closes. Print only the numbers for the other references Reached Fewer queries than reading all of them

Also decide:

  • Does exit code 2 apply when the collector does not read comments? Then most runs exit with 2, and the exit code no longer tells a failed query from a normal run.
  • Step 5.2 and Report of the trace-decision skill and the --help text change together with the collector.
Version

17e73ed

More information

Reproduction, with Node.js 24.22.2, gh 2.105.0 and Git 2.47.1 on Windows:

node tools/trace-decision/collect.mjs tools/trace-decision/collect.mjs 3 3 | grep -E '^(===|---)'
=== commit 48d854beb64f81f69af8d77cee39eb41f193d860
--- message: read
--- design doc diff: read, no change in docs/design/
=== pull request of commit 48d854beb64f81f69af8d77cee39eb41f193d860
--- pull request: read, #17
=== pull request #17
--- pull request body: read, without the Checks section
--- commits of pull request #17: read, 2
--- design doc diff of pull request #17: read, no change in docs/design/
--- closing issues of pull request #17: read
=== reference c-w-z/commit-decision-record#15
--- issue: read
=== reference c-w-z/commit-decision-record#7
--- pull request: read
=== reference c-w-z/commit-decision-record#12
--- issue: read

The exit code is 0. The sources that the output does not contain:

Source Comments Reviews with a body Review comments
Pull request #17 0 0 1
Pull request #7 1 2 0
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.