Skip to content

sigker: fix both clippy findings and arm the lint in CI - #1172

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/pr-294-ragged-path-validation-170zcy
Sep 4, 2026
Merged

sigker: fix both clippy findings and arm the lint in CI#1172
AdaWorldAPI merged 1 commit into
mainfrom
claude/pr-294-ragged-path-validation-170zcy

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

Closes TD-SIGKER-CLIPPY-RED-ON-BASE-1. sigker now passes cargo clippy --manifest-path crates/sigker/Cargo.toml --all-targets -- -D warnings, and the lint is gated in CI so it stays that way.

Two findings, not the one the tech-debt entry claimed

# Site Lint
1 signature.rssegment_signature's level-fill loop needs_range_loop
2 examples/depth_scaling.rs — wrapped doc list continuation doc list item overindented

Finding 2 was invisible until finding 1 was fixed. -D warnings makes clippy abort at the first error, so the entry's "single site" was a lower bound read off a run that never got past the first failure — not a total. That's recorded in the entry rather than quietly corrected, because the general lesson is worth keeping: a findings count from an aborted run is a floor.

Finding 1's fix is behaviour-identical — level.iter_mut().enumerate(), same traversal, same arithmetic:

for (flat, slot) in level.iter_mut().enumerate() {
    let mut idx = flat;
    ...
    *slot = prod / factorial;
}

The lint is now gated, not just fixed

The sigker CI step added in #1166 was deliberately tests-only, because the crate was clippy-red on arrival and gating it would have failed that PR for a defect it didn't introduce. That reason is gone, so the clippy half is armed here.

This matters more than the fix itself: sigker was unlinted precisely because no CI step reached it — it's workspace-excluded, so root-level cargo clippy never sees it. A lint fix with no gate decays straight back to where it started.

The entry cited the line whose deletion is the fix

Worth flagging as a pattern. TD-SIGKER-CLIPPY-RED-ON-BASE-1 cited signature.rs:133 anchored on for flat in 0..len — and deleting that line is the fix, so applying it made the entry's own citation decay and citation_decay.py fired on it.

An entry that cites the code it wants removed is self-invalidating by construction. Re-anchored on the enclosing function name, segment_signature, which survives its own body being rewritten — the property a citation into mutable source actually needs. That's the second time this session the citation gate has corrected a citation of mine, both times correctly.

One incidental accuracy fix

While rewriting the overindented line, its "7-13× smaller" claim is now qualified as asymptotic (N≥8, ~2× at shallow depth) with a pointer to the crate's own falsifier test compression_at_shallow_depth_is_far_below_the_headline. Same misquote E-A-SKETCH-THAT-MISSED-TWICE-WILL-MISS-A-THIRD-TIME-1 flagged in the ndarray consumer contract — it had propagated here too. Called out because it's a content change on a line I was already editing for the lint, not a silent extra.

Test plan

  • cargo clippy --manifest-path crates/sigker/Cargo.toml --all-targets -- -D warnings0 errors
  • cargo test --manifest-path crates/sigker/Cargo.toml62 passed, 0 failed
  • cargo fmt --check — clean
  • citation_decay.py --since origin/main0 new decays (148 pre-existing backlog unchanged)
  • append_only_gate.py origin/main — no protected file shrank, 9 checked
  • supersession_index.py — current, byte-identical
  • plan_dids.py — no added plans
  • rust-test.yml parses as valid YAML

Still open

The other workspace-excluded crates (bgz17, lance-graph-codec-research) were never checked for the same blind spot. Noted in the entry; not swept here.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WkNBjHc2e3zuyz9i8qJEv


Generated by Claude Code

Closes TD-SIGKER-CLIPPY-RED-ON-BASE-1. sigker now passes
`cargo clippy --manifest-path crates/sigker/Cargo.toml --all-targets -D warnings`.

TWO findings, not the one the tech-debt entry claimed:

1. signature.rs — `segment_signature`'s level-fill loop used its loop variable
   only to index `level` (needs_range_loop). Rewritten as
   `level.iter_mut().enumerate()`; behaviour-identical, same traversal, same
   arithmetic.
2. examples/depth_scaling.rs — `doc list item overindented` on a wrapped list
   continuation. THIS WAS INVISIBLE until (1) was fixed: `-D warnings` makes
   clippy abort at the first error, so the entry's "single site" claim was a
   lower bound read off a run that never got past the first failure, not a
   total. Recorded in the entry rather than quietly corrected.

Also armed the lint in CI. The sigker step added earlier was deliberately
tests-only because the crate was red on arrival; with both findings fixed that
reason is gone, and a lint fix with no gate decays straight back — this crate
was unlinted precisely because no CI step reached it (workspace-excluded, so
root clippy never sees it). Tests + clippy now both run.

The tech-debt entry needed re-anchoring, for a reason worth stating: it cited
`signature.rs:133` anchored on `for flat in 0..len`, and DELETING that line is
the fix — so applying it made the entry's own citation decay, and
citation_decay.py fired on it. An entry that cites the code it wants removed is
self-invalidating by construction. Re-anchored on the enclosing function name,
`segment_signature`, which survives its own body being rewritten. That is the
property a citation into mutable source actually needs, and it is the second
time this session the gate has corrected a citation of mine.

While rewriting the overindented line, also qualified its "7-13x smaller"
claim as asymptotic (N>=8, ~2x at shallow depth) with a pointer to the crate's
own falsifier test — the same misquote E-A-SKETCH-THAT-MISSED-TWICE-WILL-MISS-
A-THIRD-TIME-1 flagged in the consumer contract, propagated here too.

Verified locally, all gates green against origin/main:
- cargo clippy --all-targets -D warnings: 0 errors
- cargo test: 62 passed, 0 failed
- cargo fmt --check: clean
- citation_decay.py --since origin/main: 0 new decays (148 backlog unchanged)
- append_only_gate.py origin/main: no protected file shrank, 9 checked
- supersession_index.py: current, byte-identical
- plan_dids.py: no added plans

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

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@cursor

cursor Bot commented Sep 4, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2ba1d64b-2728-4bc9-92b4-1575c50f5922)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 4, 2026 04:29
@AdaWorldAPI
AdaWorldAPI merged commit 6abbe8d into main Sep 4, 2026
11 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.

2 participants