Skip to content

fix: resolve clippy warnings on Rust 1.95 - #6

Merged
cuttlefisch merged 3 commits into
mainfrom
fix/clippy-warnings
Apr 16, 2026
Merged

fix: resolve clippy warnings on Rust 1.95#6
cuttlefisch merged 3 commits into
mainfrom
fix/clippy-warnings

Conversation

@cuttlefisch

Copy link
Copy Markdown
Owner

Summary

  • Replace sort_by(|a, b| b.1.cmp(&a.1)) with sort_by_key(|b| Reverse(b.1)) in command palette, file browser, and file picker
  • Remove redundant .max(0) on saturating_sub(1) in visual mode delete
  • Fixes CI clippy failures introduced by newer lint rules in Rust 1.95

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings passes clean
  • cargo test --workspace passes (1148 tests)

🤖 Generated with Claude Code

cuttlefisch and others added 3 commits April 17, 2026 01:45
Replace sort_by with sort_by_key(Reverse) and remove redundant .max(0)
on saturating_sub result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds version-bump.yml workflow that runs when PRs merge to main:
- PR labels (release:major/minor/patch) override commit analysis
- Falls back to conventional commit scanning (feat! → major, feat → minor, else patch)
- Updates VERSION file and all crate Cargo.toml versions
- Generates CHANGELOG.md via git-cliff
- Tags and pushes, triggering the existing release workflow

Also adds initial CHANGELOG.md and VERSION file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collapse if-blocks into match guards for file picker tab completion
and command-line tab completion arms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cuttlefisch
cuttlefisch merged commit 61505a2 into main Apr 16, 2026
7 checks passed
@cuttlefisch
cuttlefisch deleted the fix/clippy-warnings branch April 16, 2026 23:58
cuttlefisch added a commit that referenced this pull request Jun 22, 2026
…t catch)

ADR-022: add an "Implementation (as built)" section — reconcile_remote_node
(order-independent pre-merge divergence via disjoint client sets; has_ops_beyond
gating, not is_empty), the wire/daemon node_svs↔diff protocol, the editor SV
gathering + local-ahead re-queue, and the B-17 discovery (53-bit yrs ClientID).

testing-lessons: add anti-pattern #6 (safe-range stand-ins) — every prior CRDT
test hand-picked tiny client_ids inside yrs's 53-bit range; the N-peer harness
deriving ids from the real derive_kb_client_id panicked on the first run and
surfaced B-17. Extend the razor to cover value range/generator, and mark the
"flagship e2e gap" closed (the N-peer harness + the real-daemon reconcile e2e).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cuttlefisch added a commit that referenced this pull request Aug 3, 2026
…ision #6)

Granting a third party access to a knowledge base is an authorization
change, not an edit. ADR-018 already treats membership as owner-only; the
MCP tool table did not agree, so a write-tier session — the tier an
operator picks precisely to allow buffer edits while withholding shell
access — could add a KB member or relax the ADR-048 residency policy.

Raised to Privileged: kb_share, kb_add_member, kb_remove_member,
kb_approve, kb_set_policy, kb_set_ai_residency (decision #6's six), plus
three siblings by the same criterion — kb_share_p2p (mints a bearer join
ticket), kb_unblock_member (removes an ADR-039 A2 self-protection entry),
kb_set_encryption (owner-only, irreversible, rewrites the signed
membership log's key wrapping).

Deliberately left at Write, recorded in
DELIBERATELY_NOT_AUTHORIZATION_CHANGES: kb_join/kb_join_p2p (acquire
access for the caller with a credential already held), kb_leave
(reversible, self-only), kb_block_member (tightens; ADR-039 A2 makes it
deliberately non-owner-gated self-protection), kb_set_role (molecular-note
node property — name collision only).

Raising the tool alone would have been theatre. The same effect is
reachable from three surfaces, so the classification lives once in
tools/authorization.rs and all three consult it:

  1. the hand-authored tool,
  2. command_kb_share — generated from the registry and landing on
     classify_command_permission's `_ => Write` default. It needs no
     arguments: it shares the *active* KB,
  3. execute_command {"command": "kb-share"} — a Write-tier passthrough
     to dispatch_builtin.

(2) is fixed by classifying in classify_command_permission; (3) by
effective_tier(), an argument-sensitive escalation applied at the single
permission check in execute_tool_dispatch_body. It only ever raises.

The same mechanism closes decision #6's related self-escalation path:
set_option stays Write for ordinary configuration (asserted over the whole
registry), but requires Privileged for ai_tier specifically — the option
ADR-084 D7 makes reach the enforced policy.

ADR-085 fallout, fixed per its own precedent: nine Privileged tools inside
the read-flavoured Knowledge category violated its invariant. Relocated to
Mcp, where collab_share — kb_share's buffer-level sibling — already lives.
kb_sharing_status stays in Knowledge; it is read-only introspection.

Scheme side: set-option!/set-option-save!/set-local-option! are already
tier::PRIVILEGED, so the escalation is closed there — but only by accident
of the D3 sweep until now. permission_option_tests.rs pins it with the
reason, asserts refusal survives capture/aliasing/apply with the pending
queue as the effect-level oracle, and ratchets coverage: a new primitive
that pushes to an option queue and is not on the list fails the build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
cuttlefisch added a commit that referenced this pull request Aug 3, 2026
They were never window operations — `agent_session()`, `set_agent_mode`,
`agent_mode`, and friends resolve *session* state; only the
`dispatch_session_id` save/restore genuinely belongs in
`with_ai_dispatch_scope_for_session`, and that stays. New
`editor/agent_session.rs`, 125 lines.

This also puts `window_ops.rs` back inside its AUDIT_BASELINE.json ratchet:
1114 baselined, 1228 after ADR-091 (+10.2%, over the 10% allowance), 1125
now (+1.0%). Extracting the misplaced module was the right fix rather than
blessing a larger ceiling for code that did not belong in the file.

Also records decisions #6 and #9 as implemented in
docs/DECISIONS_FOR_REVIEW.md — status lines and the decision table, with
the original analysis kept per that file's own convention.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
cuttlefisch added a commit that referenced this pull request Aug 3, 2026
Decision #6 — nine tools raised to Privileged, not six. The three extra found
by applying the same criterion: kb_share_p2p (mints a bearer join ticket, a
strictly stronger grant than kb_share), kb_unblock_member (removes an ADR-039
A2 self-protection entry), and kb_set_encryption (rewrites the signed
membership log's per-member key wrapping — an operation on the authorization
substrate itself).

Four deliberately left at Write, pinned with reasoning: kb_join/kb_join_p2p
acquire access *for the caller* with a credential already held; kb_leave is
self-only and reversible; kb_block_member *tightens*, and ADR-039 A2 makes it
deliberately non-owner-gated, so putting the safety valve above the attack
would be backwards; kb_set_role is a name collision — it stamps a molecular
note role on a KB node.

Raising the tool alone would have been theatre. Two live bypasses: the
generated command_kb_share, landing on classify_command_permission's  default and taking NO arguments (it shares the *active* KB), and
execute_command {command: kb-share} as a Write-tier passthrough. The
criterion now lives once and all three surfaces consult it.

Decision #9 — ADR-091. The defect was never nine forgotten tools: dispatch_tool
had no session handle at all, for anything. The enforced dispatch boundary now
records the session id for the extent of the call, stored alongside ADR-051's
window state as one record per session. All six non-interactive tools landed;
the three interactive ones are filtered from external discovery only, so the
embedded agent keeps them.

RESIDUAL GAP, reported rather than papered over: eval_scheme is Write tier and
the Scheme VM's ambient tier is never lowered (with_ambient_tier has no
non-test caller), so a Write session still reaches every Privileged primitive
through eval_scheme. pending_scheme_eval is shared by human and AI paths with
no provenance — ADR-088's deferred carried-authority problem. Cross-linked
rather than bolting on a third mechanism.
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