Repository navigation
feat(ci): link ADRs and collapse long lists in the PR comment - #257
Merged
Merged
Conversation
The governing-decisions comment named records as bare bold ids, and every list rendered in full. A change that touched a busy part of the tree produced a wall of bullets with nothing to click. Every record id now links to the record at the pull request's head commit, including a superseded record's successor, and each @adr declaration links to its line. Links are absolute and built from the workflow's server URL, since comment bodies never resolve relative links and GHES must link to itself. Record and declaration paths are untrusted, so each segment is percent-encoded (including the parentheses encodeURIComponent leaves alone), and an absolute, tree-escaping, or control-character path renders unlinked. A one-line tally under the heading gives the accepted count. Up to ten governing decisions stay expanded; more collapse behind a summary that carries the count. Proposals and history are always collapsed, since neither binds the change. Truncation now closes every <details> block still open at the cut and budgets for the closers. Without that, GitHub folds the truncation notice into the collapsed block where no reviewer sees it. The marker still leads the body (ADR-0026), every display cap still applies, and @adrkit/core is untouched. packages/ci/dist/index.js is rebuilt under linux/amd64 Bun 1.4.2; queue-action.js is unchanged. Signed-off-by: Mark Beacom <m@beacom.dev>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Links can target incorrect files or revisions, and rename tallies overcount changed files.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Adds navigable, collapsible governing-decision comments with tallies and safe truncation.
Changes:
- Links ADRs and marker declarations.
- Collapses long or non-governing sections.
- Regenerates the Action bundle and expands tests.
The adrkit MCP server was unavailable, so marker-only governance was not independently verified.
| File | Description |
|---|---|
packages/ci/src/comment.ts |
Adds links, tallies, collapsing, and truncation handling. |
packages/ci/src/action.ts |
Supplies record paths to the renderer. |
packages/ci/src/index.ts |
Configures repository and commit links. |
packages/ci/test/comment-render.test.ts |
Tests rendering behavior. |
packages/ci/test/action.test.ts |
Tests Action link integration. |
packages/ci/dist/index.js |
Regenerates the shipped Action bundle. |
CHANGELOG.md |
Documents the feature. |
Decisions governing this change7 accepted decisions govern this change
Links point at |
Three corrections from review of #257: - Links pointed at the PR head, but record paths and marker lines are read from the merge checkout. A record the base added after the PR branched linked to a 404, and a base change above a marker shifted its #L anchor. Links now use GITHUB_SHA, the commit the default checkout lints; the footer names it as such rather than asserting more. - A backslash was rewritten into a path separator, so a declaration in `src/we\ird.ts` linked to the different file `src/we/ird.ts`. It is a filename character in a Git path; it is now kept and encoded as %5C. - The tally counted `changedFiles`, which carries both sides of a rename, so renaming one file read as "2 changed files". The tally now says "govern this change" and makes no file count. Signed-off-by: Mark Beacom <m@beacom.dev>
6 tasks done
mbeacom
added a commit
that referenced
this pull request
Oct 3, 2026
* chore(release): prepare v0.17.0 Moves the lockstep surface to 0.17.0: the four public packages, CLI_VERSION, SERVER_INFO and server.json, bun.lock's workspace entries, and every documented pin (README, ci.mdx, badges.mdx, quickstart, the site hero, RELEASING.md, AGENTS.md, the bug-report template). The historical Spec Kit range `<0.16.0` in RELEASING.md and the Spec Kit reference verification is a different version line and stays. The CHANGELOG's Unreleased section becomes 0.17.0. The only change is the governing-decisions comment from #257, so the section says the npm packages carry no behavior change, and calls out that the proposals and history headings moved into collapsed <summary> lines for anyone who scrapes posted comments. The Action bundles are unchanged from main, and release:pack prepares all five packages for v0.17.0 with no lockfile drift. Signed-off-by: Mark Beacom <m@beacom.dev> * docs(changelog): date 0.17.0 for the day it is cut Signed-off-by: Mark Beacom <m@beacom.dev> --------- Signed-off-by: Mark Beacom <m@beacom.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What and why
The governing-decisions comment named records as bare bold ids and rendered every list in full. On a change touching a busy part of the tree, that was a wall of bullets with nothing to click. This makes the comment navigable and keeps it readable when many records apply.
GITHUB_SHA), including the successor in "superseded by". Each@adrdeclaration links to its line. A backslash in a path is kept as a filename character (%5C), never treated as a separator. URLs are absolute and built fromcontext.serverUrl, because comment bodies never resolve relative links and GHES has to link to itself.()'!*~thatencodeURIComponentleaves alone. A path that is absolute, contains./../empty segments, or holds a control character gets no link.**10** accepted decisions govern this change · 1 historical record. It's omitted at zero, where it would only repeat the "no accepted decisions" sentence.<details>closed at the cut, with the closers budgeted up front. Without that, GitHub folds the "output truncated" notice into the collapsed block.Unchanged: the marker still leads the body (ADR-0026), every display cap still applies, markers still have no exit-code authority (ADR-0022), and
@adrkit/coreis untouched. No newaction.ymlinputs.Checklist
git commit -s).docs/adr/, an ADR is added or supersedes the affected record. (No recorded decision changes; this is presentation inside ADR-0022/0026.)packages/ci/distunder linux/amd64 bun 1.4.2 and committed it. Onlyindex.jschanged;queue-action.jsis byte-identical.<details>closers and the path guard in turn and watched their tests fail.bun run typecheck && bun run build && bun test && bun run lintpass (3214 tests).Notes for reviewers
Three defaults worth pushing back on:
GITHUB_SHA, the merge commit the default checkout lints, because that's the tree record paths and marker lines are read from. A head-SHA link would 404 for a record the base added after branching, and a base change above a marker would shift its#Lanchor (caught in review). The merge commit is regenerated when the base moves, but the comment is rewritten on every run.I haven't seen the result rendered on a live PR yet. This PR's own
action-dogfoodrun is the first look at how GitHub displays the<details>blocks and links. Both dogfood workflows assert only on the marker, so moving the old####headings into<summary>doesn't affect them.