Skip to content

fix(docs): name the in-repo resume helper and gate it, since a reachable path is not a current one - #370

Merged
jaylfc merged 1 commit into
masterfrom
fix/tsk-cdqsgy-in-repo-helper-path
Aug 18, 2026
Merged

fix(docs): name the in-repo resume helper and gate it, since a reachable path is not a current one#370
jaylfc merged 1 commit into
masterfrom
fix/tsk-cdqsgy-in-repo-helper-path

Conversation

@jaylfc

@jaylfc jaylfc commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Closes tsk-cdqsgy. Supersedes the blocked PR #363, which carried a changelog fragment describing a symlink performed on one filesystem and no repository change at all.

What was wrong

.claude/audit-cron-prompt.md spelled out its resume-arming command twice, both times naming an out-of-repo copy at ~/.taos-team/resume_arm_time.py. Since #354 the script derives its own location from __file__, which makes scripts/resume_arm_time.py the only copy that can be correct. Any other copy is a second document, and this one drifted.

Resolving a path proves a file is reachable, never that its contents are current. That is the whole defect. Every path involved resolved successfully the entire time, which is exactly why nothing caught it.

The measurement, corrected

The card recorded the live box as 15 commits behind with the helper resolving to a pre-#354 script. Re-measured at the start of this work, that specific claim no longer holds, and the reason matters:

git show origin/master:scripts/resume_arm_time.py | md5sum  ->  6d94c5ef6f7dbe44cdeb7fbb0b3f6d69
md5sum scripts/resume_arm_time.py                           ->  6d94c5ef6f7dbe44cdeb7fbb0b3f6d69
git show HEAD:scripts/resume_arm_time.py       | md5sum      ->  b972d21fff77c283093ec0ceabf19228
git rev-list --count HEAD..origin/master                     ->  7

The live working copy is byte-identical to origin/master and does carry both _HELPER_PATH = os.path.realpath(__file__) and #369's worktree guard. It is current only because the main worktree holds uncommitted modifications to that file which happen to match master, over a HEAD that is 7 commits behind. Any git checkout or git stash there silently re-arms a pre-#354 script. So the operational exposure is real but is not what the card described, and it is not fixable from inside the repository, which is precisely why the durable fix is that no document names a path that can drift.

The change

Both invocations now name scripts/resume_arm_time.py, repo-relative, with a note stating that it is the only copy and why an out-of-repo one is not a convenience.

tests/test_docs_name_in_repo_helper_path.py fails if any file under .claude/ or docs/ names resume_arm_time.py at any path other than scripts/. It reads files out of the repository and never inspects the filesystem it describes, so it holds in CI on a machine with no /home/jay at all.

Reconciling the count in both directions

The card said there were two references. Confirmed, and the discrepancy is worth recording because the obvious command disagrees:

  • git grep -c reports 1. It counts matching lines, and that document is a single 15KB line.
  • The actual occurrence count is 2. Both were the identical string, so one replace_all covered exactly two, now 0, with scripts/resume_arm_time.py appearing 2 times.
  • Found-not-claimed: 3 further bare resume_arm_time.py mentions carrying no path at all. Those correctly stay as they are, and the detector deliberately permits a bare mention, since it names the script without claiming a location.

Proof it engages, rather than a suite count

A passing suite only ever shows a gate can detect the defect. Both properties are checked here.

It detects. The tree assertion was run against the real pre-fix document, not only a synthetic fixture, and it fails naming both occurrences:

AssertionError: docs naming an out-of-repo helper copy:
  .claude/audit-cron-prompt.md -> ~/.taos-team/resume_arm_time.py,
  .claude/audit-cron-prompt.md -> ~/.taos-team/resume_arm_time.py
1 failed

It is invoked. CI's literal test step is uv run pytest tests/ -q. That exact command collects all 7 cases. This is the property #368's gate lacked: it passed every test it shipped while nothing ever asked it to run.

It is not vacuous. Four of the seven cases exist to stop the fifth from being empty. A detector that flagged everything would satisfy the positive fixture alone, so there are negative controls for the in-repo path, for bare mentions, and for tests/test_resume_arm_time.py, whose own filename ends in the string being searched for. A tree scan that reached no files would report zero violations and read as a pass, so the scan asserts it found files and that it reaches the document that regressed.

Verification

full suite (trial base = origin/master a252ecdc, 0 behind):  1646 passed, 12 skipped
baseline:                                                    1639 passed, 12 skipped   (+7, exactly the new cases)
git diff origin/master --stat:  3 files, 126 insertions, 1 deletion   (the doc line rewritten, nothing else)
git grep conflict markers:      none
check_deleted_symbols.py:       deleted-symbols-guard: clean
normalise_handle_gate.py:       normalise-handle-gate: clean
check_witness_token.py:         witness-gate: clean
out-of-repo paths under .claude/ and docs/:  none
tail -c 1 changelog.d/tsk-cdqsgy-in-repo-helper-path.md | xxd -p  ->  0a
all changelog.d fragments terminating with 0a:  36/36
em dashes in the three changed files:  0

Left deliberately undone

The main worktree at /home/jay/Development/taosmd is still 7 commits behind master with uncommitted work in it, including staged #315 work. Bringing it current is an operational action on someone else's checkout and is out of scope here, as the card states. It is worth doing, because the file that is currently correct is correct by accident.

…ble path is not a current one

The audit cron prompt spelled out its resume-arming command twice, both times
naming an out-of-repo copy at ~/.taos-team/resume_arm_time.py. Since #354 the
script derives its own location from __file__, so the in-repo file is the only
copy that can be correct and any other is a second document that drifts. One
did: those paths resolved for weeks to a checkout fifteen commits behind master,
so the armed resume pair ran a pre-#354 script while every path involved still
resolved successfully. Resolving a path proves a file is reachable, never that
its contents are current.

Both invocations now name scripts/resume_arm_time.py, and a test fails if any
file under .claude/ or docs/ names the script at any other path. The scan reads
files out of the repository rather than inspecting the filesystem it describes,
so it holds in CI on a machine with no /home/jay at all.

The test is verified against the pre-fix document, not only a synthetic fixture,
and it asserts the scan reaches that document: a scan that read no files would
report zero violations and read as a pass. Four of its seven cases exist to keep
the fifth from being vacuous.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 28 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

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: 70996eee-3579-43c8-b741-984a89a32228

📥 Commits

Reviewing files that changed from the base of the PR and between a252ecd and a1563b2.

📒 Files selected for processing (3)
  • .claude/audit-cron-prompt.md
  • changelog.d/tsk-cdqsgy-in-repo-helper-path.md
  • tests/test_docs_name_in_repo_helper_path.py

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.

@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .claude/audit-cron-prompt.md
  • changelog.d/tsk-cdqsgy-in-repo-helper-path.md
  • tests/test_docs_name_in_repo_helper_path.py

Reviewed by step-3.7-flash · Input: 109.5K · Output: 21.9K · Cached: 1.9M

@jaylfc
jaylfc merged commit b41f2dd into master Aug 18, 2026
7 checks passed
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