v1.7.1
Highlights
v1.7.1 closes every follow-up item the v1.7.0 release notes flagged for a patch release, plus six rounds of automated-review hardening. No new commands, no breaking changes — quality + concurrency-safety + scanner-precision pass.
Lock-scope reduction
- Writer decorators short-circuit
<cmd> -h/<cmd> --help(anywhere in argv) to print usage and return 0 without acquiring the activities / files lock. No more lockfile materialization on--helpagainst a fresh data home. cmd_createinline-refactored: stdin read, schema-block validation, fuzzy-similarity scan, indent detection, and YAML rendering all happen OUTSIDE the lock. The lock now wraps only the re-load + id-uniqueness recheck + write.cmd_file_rehashinline-refactored: SHA-256 hashing runs OUTSIDE the lock. The lock wraps only the apply-deltas + save phase. A multi-gigabyte--allrehash no longer blocks concurrentfile-*writers.
Atomic writes
- New shared
atomic_replacehelper: temp +os.replacewith mode-bit preservation (chmod 600survives round-trips), orphan-tmp cleanup on failure (includingKeyboardInterrupt), symlink target honoring (the link is preserved instead of destroyed), and symlink-target-parentmkdirfor not-yet-mounted destinations. write_lines,save_files, andcmd_create's bootstrap all route through it.write_locksidecar anchored to the resolved symlink target so two aliases to the same file share one mutex.
Merge polish
- Dry-run preview total now equals the post-confirm ledger
refs=count: preview counts steps 1, 1b, 2, and 5 instead of just step 1. - Description-shape gates (missing / empty / inline / folded
>) hoisted to run BEFORE the dry-run return so the preview accurately reflects whether--confirmwill commit. - Folded-scalar (
description: >) targets are rejected when--append-sourcesis on (YAML would fold the appended bodies into one paragraph). Provenance-only is still permitted. opt_out_advicejoiner isand(notor) when both flags trigger the shape check.
cmd_file_rehash correctness
- Phase 2 captures
(id, path_snapshot, sha256)so phase 3 can verify the record's path didn't change underneath us via a concurrentfile-move. - Empty / whitespace ids and empty / non-string paths are filtered with clear notices.
- TOCTOU mid-hash (
FileNotFoundError/OSError) is trapped; the rid lands inmissingand the rehash continues for everything else. --help(anywhere in argv) short-circuits to usage instead of falling through to id-lookup.- Concurrent
file-add/file-deletebetween phases produceadded_during_hash/removed_during_hash/scope_id_vanishednotices.
Dangling-ref scanner
_HISTORICAL_PHRASES_REregex tightened:consolidat(?:e|es|ed|ing)\s+fromandconsolidat...\s+(?:into|under)with list-continuation lookahead;merged\s+fromandmerged\s+intowith list-continuation lookahead;originally\s+(?:tracked|...stored as|...)with completers;named\s+as(not barenamed);was named/old id/former iddropped.- Backtick-pair scoping (vs raw
rfind) so an unmatched stray backtick doesn't misroute the clause boundary. - Multi-line continuation lists handled (
\r\nin the strip set). - Sentence-break lookback requires 3+ alphabetic chars before the period AND an uppercase letter starting the next word; decimals, abbreviations, and version numbers don't false-trigger.
- Semicolon recognized as a list-continuation separator.
--label UX
- Accepts the equals-form
--label=foo. - Rejects duplicate
--labelflags. - Rejects flag-shaped values (
--label --dry-runtypo no longer silently swallows the next flag). - Rejects trailing
--labelwith no value.
Test plan
- 30+ new tests cover the new behaviors
- Full pytest suite green on 3.10 / 3.11 / 3.12
- Six rounds of automated review on PR #20
Upgrade notes
No breaking changes. Existing entries, schemas, and ledger files are forward-compatible.
Known issues (v1.7.2 candidates)
--label=--dry-run(equals-form) bypasses the flag-shape value guard; the space-form is still guarded. Rare typo.description :(space before colon) raisesIndexErrorin the merge dry-run shape gate. Rare hand-edit pattern.- A 0-byte pre-existing
activities.yaml(e.g.touch'd but never written) produces an unparseable root-list file on firstcmd_create. Rare bootstrap pattern; pre-existing pre-PR.
Review trajectory
HIGHs found per review round on PR #20 = 2, 1, 2, 1, 2, 4. The round-6 cluster was mostly trivial edge cases plus one data-loss bug (write_lock symlink alias mutex). The data-loss bug is fixed; the rare-edge bugs are documented above. Review loop paused per ~/.claude/methodology/handling_claude_pr_reviews.md's symmetric-gap-chasing guidance.