Skip to content

docs: refresh the demo recording, and fix a tape that recorded a false pass - #530

Merged
shenxianpeng merged 2 commits into
mainfrom
claude/refresh-sample-output-602anc
Aug 6, 2026
Merged

docs: refresh the demo recording, and fix a tape that recorded a false pass#530
shenxianpeng merged 2 commits into
mainfrom
claude/refresh-sample-output-602anc

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Aug 6, 2026

Copy link
Copy Markdown
Member

The GIF predates rule IDs, so it showed neither the CC001/CC201
identifiers nor the Docs: links that every failure now prints.

Re-recording it surfaced three faults in demo.tape — all found by watching
the output, not by reading the file.

The old recording showed a failing branch as clean

The hidden setup ran git commit --allow-empty with no git identity
configured
. That commit fails:

Author identity unknown
fatal: unable to auto-detect email address (got 'demo@vm.(none)')

So the repository was left with no commits, has_commits() returned false,
and the branch check skipped. In the first re-recording, commit-check -b on
branch user-login printed nothing at all — an invalid branch recorded as
passing, in the project's own demo. Fixed by configuring user.name and
user.email in the hidden block; CC201 now appears as it should.

It wrote to the repository you ran it from

The tape did git checkout -b user-login in the current directory, so running
it left user-login and feature/user-login behind in the maintainer's
working copy. It now cds into a mktemp -d repository first, so recording is
non-destructive.

The terminal was too narrow

At 1000px the See https://www.conventionalcommits.org line broke mid-URL
(...conventionalcommits.o / rg).

The width is now measured, not calculated. tput cols inside the recorder
reports 132 columns at 1400px; the longest line CC001 prints is 131.
The glyph advance turns out to be 10.26px — assuming the usual 0.6em gives
9.6px and lands you two widths too narrow, which is how I got it wrong twice
before measuring.

Smaller things

  • A passing check prints nothing and exits 0, so both valid scenes showed an
    empty screen for several seconds. They now && echo 'passed' so the pass is
    visible.
  • Output pointed at demo.gif while the header said to run the tape from the
    repository root — the file landed in the wrong directory. Now
    assets/demo.gif.
  • The header said vhs docs/demo.tape; the tape lives in assets/.
  • Scene comments were numbered 1, 2, 4, 5.

Result

before after
Size 1000×550 1400×600
File 611 KB 311 KB
Branch failure shown no yes

One thing left alone

CC201's suggestion is 161 columns. Fitting it needs a 1700px terminal,
which is not a demo — it is a sign the string itself is too long, since it
wraps on every real terminal including a maximised one. Out of scope here, but
worth a look.


Generated by Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated the terminal demo with a larger, clearer display and improved recording instructions.
    • Added setup steps so the demo runs consistently in an initialized repository.
    • Expanded validation examples to show both successful and unsuccessful commit and branch checks.
    • Added pauses, screen clearing, and prompt customization for easier viewing.
    • Updated branch creation examples to use the modern git switch command.

…e pass

The GIF predates rule IDs, so it showed neither the CC001/CC201 identifiers
nor the docs links that every failure now prints.

Three things were wrong with the tape itself, all found by watching the
re-recording rather than by reading it:

The hidden setup never configured a git identity, so the initial commit
failed, the repository was left with no commits at all, and every branch
check then passed silently. The old recording showed `commit-check -b` on
`user-login` producing no output whatsoever — a failing branch recorded as
clean.

It recorded in whatever directory it was invoked from, so running it left
`user-login` and `feature/user-login` behind in the maintainer's working
copy. It now records inside a throwaway repository.

The terminal was too narrow for the output, breaking the conventionalcommits
URL mid-token. The width is now measured rather than assumed: `tput cols` in
the recorder gives 132 columns at 1400px, and the longest line CC001 prints
is 131. The glyph advance is 10.26px, not the 9.6px that assuming 0.6em
gives you.

Two smaller changes: a passing check prints nothing and exits 0, so the two
valid scenes reported an empty screen for four seconds — they now echo the
result. And `Output` pointed at demo.gif while the header said to run the
tape from the repository root, which wrote the file to the wrong directory.

CC201's suggestion is 161 columns and still wraps; fitting it would need a
1700px terminal, which is not a demo, it is a tell that the string is too
long.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
@shenxianpeng
shenxianpeng requested a review from a team as a code owner August 6, 2026 11:04
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@shenxianpeng, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7904bf88-f363-429c-92c4-bda20c896859

📥 Commits

Reviewing files that changed from the base of the PR and between 2ee57ab and f8a5717.

⛔ Files ignored due to path filters (1)
  • assets/demo.gif is excluded by !**/*.gif
📒 Files selected for processing (1)
  • assets/demo.tape
📝 Walkthrough

Walkthrough

The VHS demo script now records a larger terminal session. It initializes a temporary Git repository, customizes the shell prompt, demonstrates commit and branch validation failures and successes, and uses git switch for branch creation.

Changes

Demo recording

Layer / File(s) Summary
Demo setup and validation scenarios
assets/demo.tape
The script records to assets/demo.gif with updated terminal dimensions and regeneration instructions. It initializes a temporary Git repository with configured identity and an initial commit. It demonstrates invalid and valid commit messages and branch names, adds pauses and screen clearing, customizes the prompt, and uses git switch for branch creation.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the demo recording refresh and the fix for the tape that showed a false pass.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/refresh-sample-output-602anc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/demo.tape`:
- Line 28: Update the demo setup command to assign the mktemp directory to
DEMO_REPO, exit if directory creation fails or cd cannot enter it, and use
DEMO_REPO for repository initialization. Add a hidden cleanup command that
removes DEMO_REPO after the demo completes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ad9f3aad-554c-4559-8a6f-21784f26f5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 7315edf and 2ee57ab.

⛔ Files ignored due to path filters (1)
  • assets/demo.gif is excluded by !**/*.gif
📒 Files selected for processing (1)
  • assets/demo.tape

Comment thread assets/demo.tape Outdated
…er it

When a command substitution produces nothing, zsh reads `cd $(...)` as a
bare `cd` and goes to $HOME. Confirmed rather than assumed:

    $ zsh -c 'cd $(true); echo $PWD'
    /root

So a failing mktemp would have left the tape running `git init` in a
maintainer's home directory. DEMO_REPO is now guarded with ${DEMO_REPO:?},
which aborts the chain instead:

    $ zsh -c 'DEMO_REPO=$(false) && cd ${DEMO_REPO:?} && echo REACHED'
    (chain stops, cwd unchanged)

The same guard covers the new hidden cleanup, so rm -rf can never be handed
a bare path. A full run now leaves zero directories behind under /tmp,
checked from a clean slate.

Re-recorded so the committed GIF is the one this tape produces. The visible
frames are unchanged — both new commands are inside Hide blocks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@shenxianpeng
shenxianpeng merged commit e2edc16 into main Aug 6, 2026
8 checks passed
@shenxianpeng
shenxianpeng deleted the claude/refresh-sample-output-602anc branch August 6, 2026 11:43
shenxianpeng added a commit that referenced this pull request Aug 6, 2026
Reworked after review. The previous approach predicted the " (#N)" suffix a
squash merge appends and measured the title against it — machinery to make
a check pass that should not have been running.

The simpler answer is not to run it. A push to main carries work that
already passed on the pull request, and re-checks it against a subject the
author never wrote and cannot shorten. Dropping the push trigger removes
the failure mode instead of predicting it, and the title is checked once,
where it can still be edited.

commit-check-action does that natively with pr-title, so the noxfile goes
back to what it was and this repository now checks itself with the thing
users actually run.

The workflow tests assert both properties that made #530 escape: the
trigger set is pull_request only, and it carries no paths filter — #530
touched only assets/ and matched nothing, so no check ran at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
shenxianpeng added a commit that referenced this pull request Aug 6, 2026
#530 passed review with a 75-character title and failed commit-check on
main at 82, against a limit of 80 — the squash merge appended " (#530)"
and pushed the subject over. Nothing had run on the pull request itself:
main.yml's paths filter skipped the check because #530 touched only
assets/, and the nox session checked HEAD, never the title a squash merge
would actually commit.

So: a dedicated workflow running commit-check-action on pull requests
only, and the push-to-main check removed instead of taught to cope.

Pull requests only, deliberately. A push to main carries work that
already passed on its pull request, re-checked against a subject the
author never wrote and cannot shorten. Dropping that removes the failure
mode instead of predicting it. No paths filter — a subject, a branch name
or an author address is wrong regardless of which files changed. The
`edited` trigger re-checks when a title changes, because the title is
what a squash merge commits; pr-title on the action checks it directly.

The action rather than the nox session is also this repository checking
itself with the thing users actually run.

Known: CC202 fails on pull-request checkouts until the merge-base fix in
commit-check ships and the action picks it up — the released engine
cannot resolve a target that exists only as origin/main. That fix is a
separate pull request; this one stays CI-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
shenxianpeng added a commit that referenced this pull request Aug 6, 2026
#530 passed review with a 75-character title and failed commit-check on
main at 82, against a limit of 80 — the squash merge appended " (#530)"
and pushed the subject over. Nothing had run on the pull request itself:
main.yml's paths filter skipped the check because #530 touched only
assets/, and the nox session checked HEAD, never the title a squash merge
would actually commit.

So: a dedicated workflow running commit-check-action on pull requests
only, and the push-to-main check removed instead of taught to cope.

Pull requests only, deliberately. A push to main carries work that
already passed on its pull request, re-checked against a subject the
author never wrote and cannot shorten. Dropping that removes the failure
mode instead of predicting it. No paths filter — a subject, a branch name
or an author address is wrong regardless of which files changed. The
`edited` trigger re-checks when a title changes, because the title is
what a squash merge commits; pr-title on the action checks it directly.

The action rather than the nox session is also this repository checking
itself with the thing users actually run.

Known: CC202 fails on pull-request checkouts until the merge-base fix in
commit-check ships and the action picks it up — the released engine
cannot resolve a target that exists only as origin/main. That fix is a
separate pull request; this one stays CI-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
shenxianpeng added a commit that referenced this pull request Aug 7, 2026
The README's output blocks predate rule IDs, so they showed neither the
CCxxx identifiers nor the Docs links that every failure now prints. Same
staleness #530 fixed in the demo GIF; the docs site is already current,
only the README had been left behind.

Measured by running each documented command against this checkout rather
than reading the code:

  Type message check failed ==> ...   ->  CC001 message check failed ==> ...
  Type branch check failed  ==> ...   ->  CC201 branch check failed  ==> ...

plus a trailing `Docs: https://commit-check.com/rules/#ccNNN` line on both,
and two commit types the list had never picked up (perf, build).

Four more blocks were stale in the same way, so they are refreshed too:

- --no-banner carried a line that no longer exists anywhere in the source:
  "It doesn't match regex: ^(build|chore|ci|...)". grep over *.py finds it
  only in a test comment.
- --compact prints the rule id: [FAIL] CC001 message: ...
- Both --format json examples were missing the rule_id and docs_url fields,
  showed value as "" where it is now populated on pass, and named a
  subject_imperative check that the default run does not emit — it reports
  subject_max_length (CC004) and subject_min_length (CC005), and lists
  passing checks alongside the failing one.
- The Python API return-value schema was missing rule_id and docs_url. The
  API code examples themselves were correct; each was re-run to confirm.

Every block was then re-captured and compared byte for byte against the
committed text (JSON via json.loads, text with ANSI colours and trailing
padding normalised), so these are transcripts, not transcriptions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
shenxianpeng added a commit that referenced this pull request Aug 7, 2026
…535)

The README's output blocks predate rule IDs, so they showed neither the
CCxxx identifiers nor the Docs links that every failure now prints. Same
staleness #530 fixed in the demo GIF; the docs site was already current,
only the README had been left behind.

Measured by running each documented command against the checkout:

  Type message check failed ==> ...  ->  CC001 message check failed ==> ...
  Type branch check failed  ==> ...  ->  CC201 branch check failed  ==> ...

plus a trailing Docs: https://commit-check.com/rules/#ccNNN line on both,
and two commit types the list had never picked up (perf, build).

Four more blocks were stale the same way: --no-banner carried an
"It doesn't match regex:" line that no longer exists in the source,
--compact now prints the rule id, both --format json examples were missing
rule_id and docs_url and named a subject_imperative check the default run
does not emit (it reports subject_max_length and subject_min_length), and
the Python API return-value schema was missing rule_id and docs_url.

Every block was re-captured and compared byte for byte against the
committed text, so these are transcripts rather than transcriptions.
shenxianpeng added a commit that referenced this pull request Aug 7, 2026
#530 passed review with a 75-character title and failed commit-check on
main at 82, against a limit of 80 — the squash merge appended " (#530)"
and pushed the subject over. Nothing had run on the pull request itself:
main.yml's paths filter skipped the check because #530 touched only
assets/, and the nox session checked HEAD, never the title a squash merge
would actually commit.

So: a dedicated workflow running commit-check-action on pull requests
only, and the push-to-main check removed instead of taught to cope.

Pull requests only, deliberately. A push to main carries work that
already passed on its pull request, re-checked against a subject the
author never wrote and cannot shorten. Dropping that removes the failure
mode instead of predicting it. No paths filter — a subject, a branch name
or an author address is wrong regardless of which files changed. The
`edited` trigger re-checks when a title changes, because the title is
what a squash merge commits; pr-title on the action checks it directly.

The action rather than the nox session is also this repository checking
itself with the thing users actually run.

Known: CC202 fails on pull-request checkouts until the merge-base fix in
commit-check ships and the action picks it up — the released engine
cannot resolve a target that exists only as origin/main. That fix is a
separate pull request; this one stays CI-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant