jbaruch / jbaruch/coding-policy

check-leftovers: residual edge cases Copilot raised on #463

Open
#466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
2
Avg merge
9h 22m
Merged PRs (30d)
81

Description

Loose ends from #463, filed rather than folded in — the PR's gate was green and each of these needs a state that does not occur in practice (rules/boy-scout.md: merge and file, rather than push another commit only to fold them in).

1. The age sentinel is below the accepted floor ceiling

dirt_age_hours starts newest at 999999999 seconds, about 31.7 years. FLOOR_CEILING accepts a floor up to 876,000 hours, about 100 years. A changed path older than the sentinel never updates newest, so the reported age caps at 277,777 hours and a floor above that would read in_progress instead of abandoned.

Fix: track "no age seen yet" as its own state instead of a magic maximum, so every readable mtime participates.

This is the only one of the three with an internal inconsistency rather than a hostile input — the ceiling was added in #463 and the sentinel predates it.

2. Trailing newlines lost in path captures

  • self_path="$(git -C "$repo" rev-parse --show-toplevel)"
  • the hook's here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

Command substitution strips trailing newlines, so a worktree root or plugin directory whose name ends in one is truncated. Everything downstream then reads a different path. The NUL-safe inventory parsing added in #463 does not cover these two captures.

Fix: a sentinel character around the capture, stripped after.

3. self: null accepted by the hook's envelope guard

A successful detector envelope always carries a self object; null appears only in the exit-2 error envelope, which the hook already rejects before parsing. Accepting null therefore admits a shape the detector never emits on a path that reaches the guard.

Fix: treat null as malformed, and drop the branch that tolerates it.

Not in scope

The bare invocation in skills/release/SKILL.md Step 1 is #465.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HK8Ca6dbz9zLgz4N5xgd6g

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with the detector's dirt_age_hours logic, then inspect the hook captures for self_path and here and its envelope guard. Check the related guidance in rules/boy-scout.md; done means readable mtimes beyond the old sentinel are handled, trailing-newline paths remain intact, and self: null is rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.