Skip to content

feat(cli): MVP-4 — commands ask instead of failing, one interrupt keymap, remembered permissions and their sheet (ADR-0115, 0118, 0136, 0137) - #101

Merged
cemililik merged 106 commits into
mainfrom
development
Nov 21, 2026

Conversation

@cemililik

@cemililik cemililik commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What

MVP-4 of the CLI MVP (Phase 2.6): a command outside the allowlist asks instead of failing, one interrupt keymap, a continue checkpoint, remembered command permissions with a sheet to manage them. Seven steps, each with two review rounds (step 5 had three) and, on every approval, consent or filesystem-adjacent path, a separate security sitting.

  1. Engine floor (ADR-0136). The allowlist is compared element by element (PolicyTarget.argv, one shared tokenizer and quoter, an open quote is refused); a lexical protected-path refusal returns to the model; the four chat limits are data ([preferences] base, lower-only [chat]) with a checkpoint hook and an absolute backstop.
  2. One interrupt keymap (ADR-0115). Esc is one level, Ctrl+C stops from anywhere except while the OS keychain is being read (a synchronous read), reject-first at a card; the continue checkpoint card; the legacy approval prompt and the reason-draft path are deleted behind characterization tests.
  3. Remembered command grants (ADR-0118 §2). An append-only operator file of keyed digests (HMAC under a keychain key, authenticated records, tombstones, fail-closed fold, bounded), the exact-argv session cache, and relavium permissions list|revoke <number>|--all.
  4. The command card. run_command shows the whole command as one quoted line plus one row per argument, its standing, directory and warnings, and offers Once, This session and Remember (Ctrl+O, Enter). The default agent can run commands; the ! escape reaches the same card.
  5. The /permissions sheet (ADR-0137 §2). A docked sheet; a permission is withdrawn by identity, two-step (d/Delete/Backspace, then Enter) with a clock and a typed-keys rule; the typed --revoke forms are removed. The action is shown on the row, with what it does and its answer (✓/✗).
  6. Esc out of the full view (ADR-0137 §4). Steps back to the card without answering; legends changed together.
  7. Home entry points (ADR-0137 §3). /permissions on the bare Home, and a bare relavium permissions on a terminal opens the Home with the sheet open and ends with exit 0 when it closes. Routed in run.ts, not by a descriptor: discovery, list, revoke, --json and the non-terminal behaviour are unchanged.

What each mode does with a command (canonical home: chat-session.md): ask and accept-edits show a card for every command (a Session answer removes it for that exact argv); plan refuses and the refusal returns to the model; auto runs only a command the person remembered or approved this session. The repository's own allowlist does not skip the card in auto (maintainer ruling, step 4 round 2: a cloned repo could otherwise let a prompt-injected agent run anything unasked), and a remembered command asks once after the session approved a file write.

What the review of this PR changed (2026-11-21)

Three external reviews of this PR (A, B, C) were answered the same day: every claim was probed before it was fixed, and the ones that were wrong are recorded as refuted (the phase record's PR #101 review corrections lists each finding with its commit; the register holds what stays open).

  • Consent. Remember is offered for a listed command and for an outdated grant; the person's grant outranks the allowlist on the card's row. A file write a chat applies is now remembered per project and outdates the grants made before it (ADR-0138, the maintainer's ruling): the old flag ended with the chat, so /clear or a restart let a remembered command run unasked after an unseen package.json edit. A write made while the keychain is unavailable is recorded too (found by the security sitting). A grant no longer runs an argument that reaches a protected path from the chat's working directory.
  • Secrets. The command card, its masked copy (c) and /details hide what the event preview hides (secretShapedRanges), the event preview masks a secret split over two arguments, a ! command's frame and its stored note carry the scrubbed line.
  • Floors. ~/.config/git/ is write-protected (older than this PR; it is on main); a command card over an empty preview is refused; a Remember reads the keychain afresh; list says when records were ignored.
  • Tests and UX. The Remember cancellation guards, the keychain fake's delete, the split-secret and grapheme tests now assert what they claim (each proved by a mutation); the backstop test runs in 0.9 s; the ask_user Review tab shows each answer whole; an arrow key while a withdrawal is armed is not typing.
  • Documents. ADR-0138 (new) and dated amendments to ADR-0084, 0115, 0117, 0118, 0130, 0131, 0132, 0136, 0137 (with an amendment ledger); the reference, the binding security standard, the runbooks and the status documents say what the code does (notably: the repository's allowlist pre-approves nothing in auto).
  • Housekeeping. The 31 stale review worktrees and 43 agent branches were removed (none carried a unique commit).

Scope

Packages: @relavium/cli, @relavium/core (the argv on the policy target, the command preview, secretShapedRanges, scrubbedCommandDisplay; no platform import), @relavium/shared, tools/* (control pins), docs. Phase 2.6 / MVP-4. ADRs: new ADR-0136, ADR-0137 and ADR-0138; revised and accepted ADR-0115 and ADR-0118. 105 commits, 221 files, +26,356 / −1,690. Security-sensitive: approval and consent paths, the grant store, the write marks and their keychain key, protected paths, the ! escape, secret masking.

Evidence

  • Reviews. Two rounds per step by independent agents (security sittings on Opus; correctness, tests and documentation-truth on Sonnet; step 5 had three), every claim probed before it was fixed. No blocker in any round. Two highs, both fixed: step 2 round 1 (reject-first did not reach the record) and step 4 round 2 (the repository's allowlist pre-approved commands for auto); every medium was fixed. Then this PR's own external review (above) and a new independent round on the fixes: a security sitting (Opus) found one medium, fixed (a write made while the keychain was unavailable was never recorded), and lows (fixed or registered); a correctness review (Sonnet) found no blocker, high or medium and seven lows (fixed or registered). Mutation sweeps on the new logic: 34 mutants on the ADR-0138 and masking work (one survivor, killed by a tightened test) and 7 on the security-sitting fixes (one survivor, killed by a corrected test); the masking agent's own sweep leaves one equivalent mutant.
  • Local gate. pnpm gate --keep-going on the head 60b65954, on a still tree: all 24 steps green, including the packages/ coverage run (282 s), exit 0. An earlier run on the previous head caught one stale test expectation (grantOutdated in a card-facts assertion), fixed in 60b65954.
  • CI. CI runs once per commit on push to development (no pull_request trigger, ci.yml); the required checks attach to the head SHA.

What this PR does not claim

  • npm. relavium is still 0.1.1; the interim release guard refuses any publication until the pre-1.0 release ADR (D59) is Accepted. Nothing here publishes.
  • Recorded, not fixed (all in deferred-tasks.md; the PR feat(cli): MVP-4 — commands ask instead of failing, one interrupt keymap, remembered permissions and their sheet (ADR-0115, 0118, 0136, 0137) #101 section lists each with its owner). Notably: the card does not mirror the engine's mask-every-argument fallback for quote-heavy split-argument secrets (fuzz: 532 of 19,220 leak; realistic splits are masked), a clock set ahead keeps a grant fresh past a later write, a write by a chat rooted at a parent or by an MCP tool is not marked, the Home's /permissions store says nothing about ignored records, and: the chat's own sheet reads its session store's cached key while the Home reads afresh; the relavium permissions command inherits the Home's start-up requirements; keychain reads are synchronous per action; a split escape sequence can end a relavium permissions run; the populated Home with the sheet is taller than 24 rows; the "any other key cancels" wording is slightly imprecise.
  • Two commits lack the Co-Authored-By trailer (d5693343, the turbo bump, and 44829f7b, a test-only commit); history is not rewritten.
  • Not in this PR: the Home tab bar / MVP-8's composed /permissions tab, add or edit of grants (never offered), a withdraw-all key, and the rest of the MVP (MVP-5 onwards).
  • Windows terminal evidence, all of it. Rows 1 to 16 of the runbook (the first twelve were owed since step 2, rows 13 to 16 were added by steps 4 to 7) have never been run on a real console; CI runs the tests, not a person at a terminal. MVP-4's final-round acceptance is conditional on them.
  • Pre-existing and out of this diff: the macOS dlsym of getumask and the Windows is_unlinked are PR fix(cli): wait for the native allocation claim (ADR-0135) and run CI once per commit #100 (main) code, registered with their owners.
  • Core coverage is measured, not enforced (a maintainer decision is parked in the register).
  • turbo 2.11.13 was published ~17 h 48 min before it was committed here, inside the 72-hour window of architectural-principles §9a; the maintainer kept it on 2026-11-21 and pnpm-workspace.yaml records that.

Checklist

  • Conventional Commits, scoped, step named in each subject; Refs to the ADRs in the bodies where one applies
  • Strict TypeScript, no any; packages/core has no platform-specific import; no vendor type across the @relavium/llm seam
  • No new runtime dependency (only the turbo dev tool, 2.11.11 → 2.11.13)
  • Secrets: grants are keyed digests, the key lives in the OS keychain, no command text is stored or listed
  • Specs cited from docs/reference/, not restated; ADRs amended by dated notes, not rewritten
  • Security-sensitive paths flagged and reviewed in separate sittings
  • Required checks (ci, coverage) green on the head commit 60b65954: pending this push's CI
  • Windows evidence rows 1–16 run on a real terminal

Refs: ADR-0115, ADR-0118, ADR-0136, ADR-0137, ADR-0138

🤖 Generated with Claude Code


Read this PR faster    Follow each request

cemililik and others added 30 commits November 19, 2026 03:00
… nightly live-test timeout

PR #100 is on main as 1e71f65 and development is fast-forwarded to it. Add the PR #100 merge
checkpoint to the Phase 2.6 register (what it carried, the final-head evidence, what no completed run
shows, what is still owed), update the status text in current.md, CLAUDE.md, AGENTS.md and README.md,
and bring the register up to date: the native adapter entry (all eight native legs green on 2ce6a25),
C4's evidence, the coverage entry closed by its first CI runs (10 to 12 minutes), the secrets-shard
bound raised to 30 s, and a new low entry for the scheduled model-catalog live DeepSeek effort test that
hit its five-second default on 2026-11-18.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…propose ADR-0136

ADR-0115 and ADR-0118 were written against the retired bare-letter approval
prompt. Rebase them on what the code does today: every card answer is a Ctrl
chord, Ctrl-C at a card already stops the turn, and the session approval cache
is per tool id. ADR-0115 now rejects first at a card on both Esc and Ctrl-C,
arms the exit window on Ctrl-C, and makes Esc step back one level inside the
card's text boxes. ADR-0118 follows ADR-0130's mode table, keys the session
grant by exact argv, moves remembered grants to an ADR-0084-style append-only
file with a keyed digest, adds the element-wise allowlist grammar, the shell
warning and the permissions commands. ADR-0136 replaces the planned fixed
configurable tool-round ceiling with a continue checkpoint on surfaces with a
person, an absolute backstop and three bounded chat limits.

Also correct three stale statements found in the document review: the tool
registry and security review still called a user rejection fatal, and ADR-0131
and the denial runbook said the third consecutive failing round ends a turn
where the code ends it on the fourth.

All three ADRs stay Proposed until the maintainer accepts them.

Refs: ADR-0115, ADR-0118, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…reviews

Fold the review findings into the three ADRs and accept them.

ADR-0115 supersedes one sentence of ADR-0132 (Esc stops the turn
everywhere) for the card's text boxes only, states the per-screen rule of an
approval review once, drops the unsupported ADR-0134 attribution and no longer
claims to restate nothing.

ADR-0118 widens the code-carrier rule from shells to wrappers and inline-code
interpreters, adds a protected-path warning that limits a command to Once,
answers ADR-0061's security reasoning openly, records PolicyTarget.argv and the
open-quote rule, numbers the grant store's bounds, states the keychain race and
the root-scope honestly and completes the Amends list.

ADR-0136 splits the interval and the hard stop into two keys so the headless
default stays 16, makes a repository layer able only to lower the limits (the
rule already applied to the starting mode), places the checkpoint before the held
round is dispatched so the arithmetic is exact and the last round's effects no
longer land in a failed turn, and defines a surface with a person.

Also: amendment notes on the ADRs they change, the phase document's 2.6.G
bullet, MVP-A11 and MVP-A15 rows, D63 and D67 refinements, rulings D77 and D78,
the MVP-4 entry and a four-step implementation record.

Refs: ADR-0115, ADR-0118, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ected-path refusal and bound the chat limits (MVP-4 step 1)

Step 1 of MVP-4 (ADR-0118 §3, ADR-0117, ADR-0136 §1-§3).

B1 — the allowlist compares commands, not strings. `PolicyTarget` carries the
argv; an exact `allowedCommands` entry is a command line split by one shared
quote-aware tokenizer (`@relavium/shared` `command-line.ts`, with its inverse
quoter) and compared element by element, so `cat a b` no longer admits
`["cat","a b"]`. Globs stay string-level. An entry with an open quote or no
token is a strict-config error in `[chat]` and in a workflow; the `!` escape
refuses an open quote instead of running it to the end of the line.

B2 — the lexical protected-path refusal (a protected directory or shell startup
file, decided from the path text alone) returns to the model with one fixed
text; the credential-store arm and anything only resolution reveals stay fatal.

B3 — the four chat limits (checkpoint_tool_turns, max_tool_turns,
max_tool_corrections, max_turns) are published as data with bounds, set by the
operator in [preferences] and lowered-only by a repository layer, rejected and
never clamped. The engine's round guard moves before dispatch: a round the model
asks for past the limit is held, not run (a limit no longer lets the last round's
effects land in a turn reported as failed), an optional `onToolRoundLimit` hook
lets a host ask a person to continue, and an absolute backstop of 256 rounds
bounds every turn. The session admits host limits against the bounds. The CLI
host wires max_tool_turns and max_tool_corrections; the card that answers the
checkpoint is step 2.

Docs: config-spec (limits, element-wise entries), agent-session-spec (the
within-turn limits and the checkpoint), agent-runner, tool-registry,
workflow-yaml-spec, security-review, built-in-tools and the denial runbook.

Refs: ADR-0118, ADR-0117, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and decide the returned refusal from the path text alone (MVP-4 step 1 review round 1)

Findings of the five-reviewer round on c059a16, each verified before it was fixed.

Engine: the checkpoint hook is raced against the turn's abort (a host that never
settles it cannot hang the turn, an abort wins over any answer), a rejection or
throw is a classified turn_limit stop, and only the literal 'continue'
continues, so undefined from a buggy host fails closed. A NaN, negative or zero
interval fails closed and the backstop holds for a direct caller; the info the
hook gets is what a continue will grant; a held response the dispatch would
refuse anyway is not asked about.

Config and CLI: one-shot agent run keeps the engine bounds (16 and 3) instead of
reading the chat limits; the allowlist-entry error reaches the user through the
loader without echoing the value; an entry with an empty program token is
refused; the interim deny hint is a TOML basic string that parses back to the
typed argv; the open-quote refusal no longer bumps the mention generation; the
stale max_turns hint names the operator's [preferences].

Security: the lexical protected-path refusal that returns to the model now uses
a pure view of the host scratch subtree, so no lstat can make its outcome depend
on filesystem state; the returned refusal's fixed text is carried on the live
tool row so /details says why it was denied.

Tests: the hook failure modes, non-literal answers, abort-versus-answer, the
clamp, interval larger than the hard stop, the no-argv fail-closed target, the
direct lexical predicate with its spellings, the scratch-state case, session
admission for every limit and on resume, operator-below-default, the loader
message and the TOML hint; hidden Unicode removed from a test source.

Docs: the recoverable-denial enumerations now say three; chat-session, config-spec
and the status lines are current; older ADR amendment notes say which parts are
implemented and which are owed; implementation notes on ADR-0117, 0118 and 0136.

Refs: ADR-0117, ADR-0118, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd simplify the guard comparison (MVP-4 step 1)

Mutation round on the round 1 fixes: ten of eleven new mutants were caught, and
two survivors were an equivalent form (the clamp already turns a NaN into zero,
so the guard needs no negated comparison) and a test whose message made a
mutated summary invisible. The first is simplified, the second now asserts no
summary key at all.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…k only with a live signal and pin the boundaries (MVP-4 step 1 review round 2)

Findings of the second review round (security and engine on Opus, a repository
regression sweep, documentation and test adequacy), each verified.

Engine: initialRoundAllowance returned NaN for undefined, a string or an object,
which turned the round guard, the hard stop and the 256-round backstop off; it now
treats anything that is not a number as zero and the guard keeps the negated
comparison as belt and braces. Session admission refuses an absent required limit
and keeps a frozen copy of what it admitted. The hook is not called when the abort
already fired. Compaction, which offers no tools, no longer carries the hook.

CLI: the interim deny hint escapes DEL so it parses as TOML.

CI: the registry test file grew, so the pinned workload of the secrets mutation
control and its provenance test is 127 (it would have gone red in the shard that
runs it).

Tests: exactly the per-response ceiling of calls is a held round; non-number limits;
the abort race; a session-level hook (continue then stop) and exact retained
history; the recoverable non-denial row; zero values in the limit resolution;
one-shot corrections; the refused-line epoch ordering; empty program lines; and
polling replaced by a deferred promise.

Docs: wiring status of the checkpoint (not yet wired until step 2), the lower-only
check being applied at config resolution for every command, a broken ADR link,
stale status lines, ADR-0136 notes, and items carried to steps 2 and 4.

Refs: ADR-0136, ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…4 step 1)

The mutation round on the review round 2 fixes found one survivor: handing the
checkpoint hook to the compaction turn changed nothing any test observed. A
summary pass that answers with a tool call it was never offered now proves the
hook is not asked. The other survivor is an equivalent form (the clamp already
makes the guard's comparison total).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…vider

The previous commit's test read the fixture's counters, which its overriding
stream bypasses, so it failed on correct code. It now counts its own passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…op reaches its limit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s back out of a text box (MVP-4 step 2)

The pure `interrupt-keymap.ts` decides what the first Ctrl+C does per context and that a second one inside
a 2 s monotonic window ends the session; the surfaces are wired to it in the next commits.

- A Ctrl+C at an approval card, on any screen and inside its reason or search box, rejects the call and
  stops the turn. The store settles the approval as a user rejection BEFORE the abort is signalled, so the
  call is recorded rejected, not cancelled with an unknown execution state (ADR-0115 §2).
- Esc closes the reason box, the full view's search box and the ask_user own-answer field first (text
  discarded, call still pending); a second Esc stops the turn (ADR-0115 §3).
- Hints and legends are rewritten in the `Ctrl+C` spelling and say what Esc does in a box.

Refs: ADR-0115

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d, delete the legacy approval prompt (MVP-4 step 2)

- The standalone chat and the Home controller ask the one keymap for every Ctrl+C: the first press interrupts or
  clears or arms by context, a second inside the 2 s window ends the session, any other key disarms, and the idle
  hint says so (ADR-0115 §1). Esc never arms. The store returns `abort`, `stop-answered` or `handled`, so a
  checkpoint's Ctrl+C is an answer and not an abort.
- The continue checkpoint (ADR-0136 §4): a docked card in the chat store and both hosts, `Ctrl+Y` through the
  approval guards, `Ctrl+N`/`Esc`/`Ctrl+C` as never-delayed answers. `AskUserPort` carries the hook with the same
  boolean as `ask_user`, and the session host wires `onToolRoundLimit` and `checkpoint_tool_turns` for the
  interactive surfaces only; the plain and `--json` drivers, `agent run` and workflows keep the hard stop.
- The legacy approval-prompt reducer, its `approve`/`reject`/`reject-with-reason`/`cancel` key actions, the
  reason-draft path in both surfaces and the dead approval block in `ChatView` are deleted after a
  characterization test.
- Esc closes the question card's own-answer field first; `ask_user` refuses any `[Ctrl+<letter>]` and `[Esc]`
  token in model text.
- The plain and `--json` drivers' first SIGINT reaching the in-flight turn is pinned by a test in each.

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the three "not yet wired" statements (MVP-4 step 2)

The chat reference gains the per-context interrupt table and the checkpoint card; the Home, commands, config,
agent-session and built-in-tools references follow. ADR-0115 and ADR-0136 get implementation notes. The Windows
console evidence of ADR-0115 §5 is a manual recipe in the runbooks.

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ng tests (MVP-4 step 2)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (MVP-4 step 2)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tray abort shows (MVP-4 step 2)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rt follows it in the same tick (ADR-0115 §2)

The CLI settles an approval as a user rejection and signals the abort in one synchronous stack, so the registry's
outer catch saw an aborted signal and recorded the call as cancelled, execution state unknown, although the
decision was made before any effect was admitted. A user_rejected denial with no effect and no replay now keeps
its classification; an approve that lands after an abort still cancels. Found by the security review of MVP-4 step 2.

Refs: ADR-0115

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, both-direction overlay guard, Home disarm, search legend and tests

- The live view says `stopped at a checkpoint after N tool rounds` and hints that the person stopped it, from a
  display-only mark the store keeps for a "stop" answer (ADR-0136 §2).
- A checkpoint refuses to open under an approval or question and the reverse; the card owns the wheel like the others.
- The Home host disarms the interrupt window for any key and for a paste in one exported routing function the
  controller tests now share; a paste disarms the standalone chat too.
- The full view's search state names its own keys (Esc closes the box, Ctrl+C stops the turn).
- One shared Ctrl+C matcher, the dead `formatApprovalTarget` and stale comments removed, the loading text says exit.
- Tests: the dwell re-acknowledgement guard, the quiet gap, exact elapsed time with the wait excluded, no timeout,
  `!` commands and every overlay row, the Home host's card routing, the cancel latch, a paste, `interruptAnswered`,
  and waits that fail instead of returning silently.

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e runbook, the register

Corrects the chat reference's "Ctrl-C is /cancel" sentence, the refused-token list, the security checklist and the
runbook rows; appends dated notes to ADR-0057, 0061, 0115, 0122, 0129, 0132 and 0136 (including the registry change
reject-first needed and the answers to the two carried items); records the step in the phase register and the two new
open entries in the deferred-tasks register.

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pproval, a narrower registry exception, and the remaining lows

- A store sealed under an open approval cancels it (an AbortError) instead of rejecting it, so a teardown that seals and
  aborts in one stack is recorded cancelled, not "the user declined".
- The registry exception gains a `dispatchStarted` guard; boundary tests pin the journaled-tool, wiring-fault, from-inside
  and rejected-saved-delivery cases.
- A Ctrl+C that clears a draft drops a pending `@` mention read; a running turn acknowledges the first Ctrl+C on screen.
- `ask_user` also refuses short bracketed tokens written like a chord (`+`, `+`, `^`) and tokens that begin with a key name.
- The checkpoint hook is pinned on every command-level build path (fresh, /clear, reseat, resume, Home fresh and reseat).
- Tests: the characterization test records mode changes and submitted lines, final legend waits look only at frames after the
  key, flaky margins widened, a single Ctrl+C in the passive-failure test doubled, and stale comments corrected.

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…DR notes and the phase record

Refs: ADR-0115, ADR-0136

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…st as a request carrying the argv (MVP-4 step 3)

`ToolApprovalRequest` gains `argv` and `commandAdmitted` (in-process only, never on `agent:approval_requested`). Under a regime
the registry no longer throws `command_not_allowed` on a miss: the confirm hook decides, a regime with no hook still fails
closed, and a workflow (no regime) still throws. The one registry test that pinned "a denied run_command never reaches the
prompt" is amended to the new contract with its count unchanged.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ppend-only operator file (MVP-4 step 3)

ADR-0118 §2: an HMAC root digest and grant digest under a keychain key, one bounded record per append, tombstones, the fail-closed
fold, the 64/1,024/8,192/2 MiB bounds, labels that name a program only when it is a bare name that resolves on the PATH.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the grants store (MVP-4 step 3)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… cache and remembered grants in the hook (MVP-4 step 3)

auto runs a command without a card only when it is pre-approved (allowlisted, remembered, or approved earlier this session by
exact argv); ask and accept-edits keep asking; plan refuses; a headless surface refuses as unavailable. The session cache for a
command is keyed by the exact argv and never by tool id, and a session answer is offered only once the command card words it.
The chat line handler opens the grants store for the project root, lazily, so building a session never touches the keychain.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ommand grants (MVP-4 step 3)

The grants store a person's Remember answers as keyed digests, so the way to look
at and take them back has to speak in labels: the command lists this project's
grants by number, program name (only when it could be named without risking a
credential), argument count and date, never the command. revoke takes a number
or --all; --all removes the whole file and works without the keychain, so it is
the recovery from a locked keychain or an unreadable file.

The store itself gains two honest answers: list with no key yet is an empty list
rather than a keychain fault, and revokeAll distinguishes nothing-to-remove from
could-not-remove. The chat and the command share one project-root function so a
grant made in one is the grant the other lists.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ommand and the step 3 record (MVP-4 step 3)

command-permissions.md is the canonical home for the grant store (file, digests,
key, bounds, failure table) and relavium permissions list|revoke. commands.md,
the CLI README, config-spec, security-review and chat-session carry only what
they own and link to it; ADR-0118 gets its step 3 implementation note and the
phase record its Progress bullet. Everything the card and /permissions will do
is marked as step 4, and the interim behaviour of the ! escape is stated as it
is.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ON listing (MVP-4 step 3)

A mutation sweep over the step 3 logic left three survivors: the chat's choice of
which surfaces open the grant store and which root keys it had no test at all, the
JSON listing was only checked on raw bytes (which JSON already escapes), and the
session clause of isPreApproved was redundant with askAboutCommand's own check.
openCommandGrants is now a tested function, the JSON test reads what a consumer
parses, and the redundant clause is gone.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rrors from step 3 (MVP-4)

A mutation sweep over the core seam left one survivor, the frozen argv handed to
the host's approval hook; a test now mutates it and expects a TypeError. The
unguarded 'approved && onDispatchSucceeded()' statements and one unnecessary
assertion in earlier step 3 tests are rewritten so lint is clean over every file
the step touched.

Refs: ADR-0118

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cemililik and others added 24 commits November 21, 2026 17:15
…s its card (mutation: blank rows)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…(secretShapedRanges)

A surface that shows a command's text itself (the command card) has to hide the same
spans the engine's event preview hides, and cannot read them back from the replacement
text. secretShapedRanges(text) returns the projection's first-pass masks as sorted,
non-overlapping ranges of the original text, and falls back to one range over the whole
text when the first pass is not the projection (a split header label the pass joins
first, or a text that needs a second pass), so it over-masks and never under-masks.

Also makes run-command-preview's split-secret assertion unconditional: it was skipped by
an `if (!joined.includes(SECRET))` guard exactly when the oracle leaked, so it pinned
nothing; the bare value after a flag, which no projection can recognize, is now its own
named test instead of a skipped branch.

Refs: ADR-0118 section 1 (PR #101 review finding B4)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the event preview hides

The card located its masks with @relavium/llm's scrubber, which does not recognize
password=..., --api_key=... or secret=..., all of which the engine's event preview masks.
Those arguments were shown in clear on the card, copied in clear by the masked copy (c)
and shown in clear by /details, so the promise that every masked span is revealed and
displayed before an approving answer counts did not hold for them.

A command document (requireAllMasks, and /details for run_command) now unions the
engine's ranges (secretShapedRanges) into every field, maps the joined-line oracle back
onto the arguments (a secret split from its key across two arguments), and masks the
quoted title whole when quoting (' becomes '"'"') could hide a secret from a scan of the
title alone. File-diff documents are unchanged.

Tests drive the store: the card, the full view, the masked copy, the lock until the mask
is revealed, and /details (retained and rebuilt with a result summary), plus a property
over a corpus that anything the engine hides is hidden on the card.

Refs: ADR-0118 section 1 (PR #101 review finding B4)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
formatCommandInjection wrote the raw typed line into the frame's cmd attribute, so
`!curl -H "Authorization: Bearer ..."` sent the credential to the provider and wrote it
to history.db inside the untrusted frame, while the approval card and the
agent:approval_requested event masked it. The attribute is now the engine's
scrubbedCommandDisplay of the argv; the process is still spawned with the typed argv, and
the local hint, busy label and chip keep showing what was typed. A command with nothing
to hide is framed byte for byte as before.

Refs: ADR-0118 section 1 (PR #101 review finding B5)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d, and a `!` frame carries the scrubbed line

command-permissions.md (the command card) said masks came from "the existing masking";
they now also include every span the engine's event preview masks (whole argument where
it cannot be located, the title masked whole when quoting can hide a secret). The
tool-registry reference, the one home of the preview scrub, names the new
secretShapedRanges export and the scrubbed `cmd` of a `!` frame.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
askAboutCommand protects two windows around grants.remember: an answer given after the call was cancelled
must not write a grant and ends as an AbortError, and a write that finishes as the call is cancelled keeps
the grant and says so once instead of the success notice. No test named either guard (the PR #101 review's
finding); deleting either line left the suite green. Four tests now drive the real hook with a fake grants
store: pre-write abort, post-write abort, a cancelled FAILED write (no remembered claim), and the normal path
as a guard against over-fixing.

Mutation proof: deleting the pre-write throwIfAborted fails only the pre-write test; deleting the post-write
throw or the post-write notice fails only the post-write test; dropping written.ok from the post-write
condition fails only the failed-write test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both FakeKeychain classes deleted the entry even in their locked/throws mode, so the 'works with a locked
keychain (the key stays)' tests could not assert what their name said and the production catch around
keychain.delete in removeCommandGrantsFile never ran (PR #101 review). A locked keychain now throws
KeychainUnavailableError from delete as it does from get/set, and the tests assert the documented result
(command-permissions.md, When the store cannot answer): the file is removed, the key stays exactly as it
was, the command exits 0 and prints no keychain failure. Two siblings cover the no-file path and the store's
own revokeAll.

Mutation proof: turning the production catch into a finally fails 5 tests across both files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…itional

The test's assertion sat inside 'if (!joined.includes(SECRET))', so it was skipped exactly when the joined-line
oracle leaks: its third case (tool --password <value>) never asserted anything, and the file never exercised
the joined-oracle fallback in scrubbedCommandLine (replacing it with 'candidate' left all 11 tests green).

The two real split cases now assert the exact preview, plus a third case whose label and value are two
arguments (curl -H 'Authorization:' 'Bearer <v>' -> 'curl [redacted]'), which only the fallback masks. The
bare '--flag value' pair moves to its own test that says what it is: read by neither scrubber today, so the
preview equals the oracle (recorded, not promised).

Mutation proof: forcing the fallback off fails exactly the split-secret test; dropping all scrubbing fails
three tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pture

The test took 5.4 s unloaded here (3 runs: 5.47, 5.35, 5.40 s at load 12-13) and a timeout under load in the
PR #101 review (50.6 s alone). Profiling it showed 87% of the CPU in one function, the seam's inert-data guard
(packages/llm/src/inert-data.ts): every provider call deep-copies the WHOLE request and probes each object
with intrinsic brand checks that throw a TypeError per object per call, so the work is quadratic in the
transcript and each throw pays V8's stack-trace capture. The per-round payload is already minimal, so the
transcript is not the lever. Running only the turn with Error.stackTraceLimit = 0 (restored in a finally,
assertions run with traces back) cuts it to 0.8-0.9 s at load 21; the whole file runs in 2.5 s.

What the test proves is untouched: 256 dispatches, the asked intervals [100,100] then [200,56], 257 calls,
turn_limit. Mutation proof: dropping the min() against the remaining backstop, and moving the backstop
check by 10, each fail this test (and only it). The production constant and llm code are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both claims of the PR #101 review held. (1) 'never splits a grapheme' only checked that the rows re-join to the
input, which any splitter passes. (2) The 300-call generator drew from two alphabets the validator REFUSES
(decomposed e + U+0301 is not NFC; a ZWJ sequence is a format character), so longest() silently fell back to
'xxxxxxxx' for them and no cluster ever reached the card. With the old tests a hardWrap that splits per code
point passed all 28.

Now: an Intl.Segmenter oracle (cutsInsideClusters) names any row boundary inside a cluster, and is itself
tested to be able to fail; hardWrap is checked over eight cluster-bearing texts at widths 1-9 with a
precondition that each really holds a multi-code-point cluster. The generator uses clusters the validator
accepts (a mark with no precomposed form, a skin-tone emoji, a flag, a keycap, an Indic conjunct) and THROWS on
a refusal instead of substituting; a test asserts every alphabet is accepted and 174 of 300 calls carry a
cluster. A byte ceiling of 150 never reaches the 76-cell row with wide clusters alone, so an exhaustive
boundary test (six clusters at every offset around the edge, exact rows for the wide ones) and 200 generated
ASCII-dominant questions that wrap put clusters on the edge.

Mutation proof: hardWrap splitting per code point and per UTF-16 unit each fail four of the new tests (the old
ones passed both).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…at it hides

ADR-0132 §3 promises a Review tab that lists every answer as it will be sent, and Enter sends the full text,
but the tab clipped each answer to one row with a bare ellipsis, so a person could confirm an answer they could
not read (review finding V6a-04, confirmed: the new tests fail 4 of 4 against the old projection).

The tab now wraps an answer under its own row (indented, so column 0 stays the host's and answer text cannot
pose as a row), shares the rows left in the nine-row body after the title and the note (a short answer takes
one, a long one takes what is left), and where even that cannot hold an answer, ends its last row with the exact
number of characters it leaves out ('... 123 more characters not shown'). No second mechanism: the same
hardWrap and segmenter the question tab uses, within the same body bound. The reference doc's sentence 'it is
shorter than a question tab, so it always fits' was false for this and is replaced.

Mutation proof: one clipped row per answer fails 4 tests; dropping the notice, an off-by-one count, no indent
and no row sharing each fail the tests that pin them (the forged-row test needed its offsets slid across the
row edge before the no-indent mutant could fail it).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ADR-0137 §2: only a key that is not navigation is typing, and an arrow, page key, Home or End says the person
is choosing a row. The armed branch of foldPermissionsSheetKey marked every key but Esc as typing, so
d (arm), Down, d refused the second d with 'Typed keys are ignored here. Select a row with Up/Down, then press
d.' to a person who had just pressed Down (review V6a-08, confirmed by a failing test first).

A navigation key still drops the question and moves nothing (the pinned behaviour: it keeps the row), but it no
longer sets 'typed', so the next d arms again. Armed implies nothing was typed before the arming d, so this
cannot let typed-ahead text arm; any other key, a paste and a refused d still count as typing, and every
refusal path is unchanged. The reference page now says which keys are typing.

Tests: the sequence from the review for each navigation key and for the whole d, Down, d, Enter flow; the
'only exception' test (a letter, d, Tab, Backspace still make the next d refused); and a 3,000-stream
reference-model test over letters, navigation keys, d and Enter at six paces, which compares every step's
withdraw/armed/typed with an independent statement of the rule (the existing 4,000-stream property test is
untouched and passes). Mutation proof: counting navigation as typing again fails 2 tests; counting nothing as
typing while armed fails 3.

V6a-11 (a d refused because the frame is too small marks the sheet typed) is REFUTED as a defect: it is the
ADR's rule (any key that is not navigation), and a refused d not counting as typing was a surviving mutant that
the step 5 round 3 (F3) pinned on purpose; it is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the event preview even when the mask count matches (PR #101 review)

A secret split over two arguments (`api_key:` then `'S3cr3t'`) gave the joined line one mask and the quoted candidate one, on a different argument, so the count comparison kept the candidate and the secret stayed readable in the agent:approval_requested preview. The joined line's masks are now located (secretShapedRanges), and an argument one touches that scrubbing it alone leaves unchanged falls back to the existing mask-every-argument output. It only adds masks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es older grants, a rewrite keeps entries it cannot verify, revoke --all removes the marks last, Remember is not offered over unreadable marks, the stored chip is scrubbed (ADR-0138 security sitting)

Security sitting on the review-fix increment (Opus): the medium was real. noteFileWrite treated an unavailable keychain as 'nothing to protect', but grants made earlier verify again when it answers, so a chat over SSH with a locked keychain could edit package.json and a later local chat would run the remembered command unasked. A keyless write is now recorded as one unauthenticated time that outdates every older grant (it can only make a grant stricter). Also: noteFileWrite reads the key afresh and a rewrite keeps entries it cannot verify (a chat with a replaced key erased a newer key's marks); revoke --all removes the marks only after the grants file is gone; canRemember refuses while the marks cannot be read (a renewal could not make anything fresh); the transcript's note for a carried ! command, which is stored as user_display_text, is the scrubbed line.

Refs: ADR-0138

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…later rulings made false (PR #101 review)

CLAUDE.md rule 9 keeps ADRs append-only, so no sentence was deleted: each false one
stays and a dated blockquote beneath it says what is true now, with the pointer.

- ADR-0118: the allowlist does not pre-approve a command in `auto` (the step 4 round 2
  ruling was recorded as a note but never carried into the section 1 definition and
  table); Remember is offered for a listed command and an outdated grant; the write
  protocol is O_CREAT|O_APPEND|O_NOFOLLOW|O_NONBLOCK + writeSync + fchmod, not wx +
  appendFileSync, and a revocation holds by id wherever it sits; the "asks once after a
  session write" rule is ADR-0138's per-project rule; the sheet shows a session
  approval's scrubbed command; the typed --revoke/--session forms are gone; the
  tokenizer lives in packages/shared. Closing amendment note lists them.
- ADR-0137: an amendment ledger of every Decision paragraph changed after the acceptance
  commit 4250a21 (date, review round, commit, where the original is); the note-row,
  message-row and legend sentences and the clock figures that duplicated the reference
  are replaced by a link (recorded in the ledger); the never-built usage line and "date
  only" get dated notes.
- ADR-0115: a Home draft is lost on the second Ctrl+C (the reasoning "nothing to lose"
  was false there; the decision stands); the first-SIGINT test it called unpinned exists;
  the Home's SIGINT exit is 130 and a chat's is 4.
- ADR-0131: max_tool_corrections is 0 to 10. ADR-0136: the strict-limit error names the
  layer, not a file, and the landing obligations are met. ADR-0130: the write is per
  project (ADR-0138). ADR-0117: the protected-path/credential split is implemented.
  ADR-0084 and ADR-0061: the grant store reuses the pattern, not the bytes; the `!` frame
  names the scrubbed line. ADR-0132: the partial supersession is dated, in the header and
  in the index.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rotected-path references say what the code does (PR #101 review)

Each statement was checked against the code before it was changed.

- `auto` and the allowlist (config-spec, chat-session, home): a command the repository's
  allowlist admits asks in `auto`; only a fresh remembered grant or an exact command approved
  for the session runs unasked; `ask` and `accept-edits` ask for every command and only a
  Session answer given in the current chat removes their card. "Every call is the person's
  decision on a card" is no longer written for `auto`.
- The write marks (chat-session, command-permissions): the old "asks once after this session
  approved a write" is ADR-0138's per-project rule; a grant is not bound to the working
  directory; a Remember also approves the command for the chat it is made in. `list` says on
  stderr that it ignored records; `revoke --all` is one key per account and one file per home;
  an empty-preview command card is refused in fixed words before it opens; the not-shown
  sentence is described as the code builds it.
- Interrupts (home, chat-session, commands, windows runbook): a chat draft takes three
  presses to leave, a Home draft is lost on the second press, a chat's SIGINT exit is 4 and
  the Home's is 130.
- Config (config-spec): `agent run` and workflow nodes read none of the chat keys; a
  repository limit above the base is a hard `invalid_invocation` naming the layer.
- Protected paths (built-in-tools, the denials runbook, security-review): git's XDG
  `~/.config/git/` is write-protected; `.ssh`, `.relavium` and `.gitconfig` are in both
  predicates and the lexical check runs first.
- tool-registry: the argv's display lines differ (that is the point of quoting), and the
  allowlist miss is a request under an approval regime and a fatal error in a workflow.
- extension-api records *Allow Always* writing into a committed workflow as an open decision
  (ADR-0118 rejected that exposure for the chat). Also: the Ctrl+O question text, accessibility
  (Esc keeps the row while a question is up), the tutorial's default scope, apps/cli/README,
  commands.md (`revoke --all` is every project) and four glossary entries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mendment (PR #101 review)

The bullet that says /permissions answers a typo or a second number with its usage line
describes the typed --revoke/--session forms ADR-0137 removed. A note beneath it says the
dispatch's own rejection plus a per-command hint replaced it. No original sentence changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hat the grant store and the floors do (PR #101 review)

security-review.md: "nothing runs in auto without being pre-approved" now names the Once
answer; the MAC covers every record field (the label and the id included) and what it does
not give is proof that a label describes the hidden argv; tombstones are unauthenticated and a
revocation is by id wherever it sits; Remember is offered for a listed command and for an
outdated grant, withheld for a code carrier and for a grant that stands; `auto` asks again
after a file write a chat applied in the project (ADR-0138) and the write-mark file is a
review point; the lexical protected-path arm names `.config/git/`.

troubleshoot-tool-denials.md: the same arm, and the exception that `.ssh`, `.relavium` and
`.gitconfig` sit in both predicates, so the lexical check runs first and a write returns to
the model. windows-interrupt-evidence.md: every row 1 to 16 is owed on real terminals, CI
runs the tests but not a person at a console, MVP-4's final-round acceptance is conditional
on them; the Home's SIGINT exit is 130, a chat's is 4.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d say what happened to PR #101 (review corrections, 2026-11-21)

- Status (README, AGENTS, CLAUDE, current.md): MVP-4 has seven steps, all implemented on
  `development` (three review rounds for step 5); PR #101 (development to main) was opened
  2026-11-21 and its review was answered the same day; "last updated" dates are 2026-11-21.
  The "no completed CI run" claims are replaced: 44424575691 (639134b), 44424607930 (the merge
  commit 1e71f65) and 44895457644 (9c5985a) exist and passed (checked with gh run view); the
  PR #99 coverage-limit observation and what followed are kept.
- Phase record: a new section "PR #101 review corrections" lists, per finding, what was fixed
  (with commits), refuted (with the evidence) and deferred, with a "needs a human" list on top
  (Windows rows 1 to 16, the core-coverage ruling, the turbo pin the maintainer kept on
  2026-11-21, the VS Code Allow Always decision, the PR description). Step 6's heading no
  longer says "no medium in either" (round 1 had a documentation medium); the "four steps" and
  "after step 4 then the PR" wording, the dead-legacy-prompt line and the step 4 "asks once"
  ruling carry dated updates.
- Register: a section for the open findings (Report A, B and C; owners are "not assigned" or
  "maintainer decision", none invented), the entries the code already closed (the ADR-0117
  split, the allowlist widening in `auto`, reduceApprovalKey) marked closed with date and
  commit, and the findings being fixed by other agents kept `[ ]` until their commits land.
- pnpm-workspace.yaml: the turbo comment no longer says "cooled"; it records the publish and
  commit times (17 h 48 min apart), the 72-hour rule and the maintainer's decision to keep the
  pin on 2026-11-21. No reason for the original bump is invented.
- tools/secrets-controls/README.md: 28 to 34 top-level parser cases and 165 to 171 chat cases,
  read from `mutations` in tools/secrets-controls/mutations.mjs (the pins the coordinator
  enforces).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd the Home's sheet store still tells nothing about ignored records (PR #101 review)

Checking the register's "pending" list against `git log 9c5985a..2bc7322`: H11 (the
conditional split-secret assertion) was fixed by b092ec1 together with B4, so it moves from
pending to fixed; H14's CLI half is in (`permissions list` says on stderr that it ignored
records) but the Home's per-read store passes no `notify`, so that half becomes its own open
register entry instead of being counted fixed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the bound can be renewed, a refused renewal is not reported as remembered, a reset keychain is told on list; hook plus real store tested together (review round)

Correctness review of the increment (Sonnet), findings F3-F7: the outdated row was shown in ask and accept-edits although only auto consults a grant (autoAsks); canRemember called room() without the renewal flag, so the card could not renew a grant at the 64-per-root bound (canRemember now takes the argv); Remember over unreadable marks returned ok while renewing nothing; list said nothing when the key was gone but grant lines were not (they are counted as ignored); wording of the withdraw note, the isPreApproved doc and the success notice. chat-mode-write-marks.test.ts drives the real store and the real hook through six chats (fresh, write, stale, renew), which would have caught F3-F5 before.

Refs: ADR-0138

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…what the increment's own review round left open is registered (PR #101 review)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…found by the gate)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…quadratic regexes, assertion-less tests and small smells (review)

SonarCloud's pull-request gate was red on new_reliability_rating (C), from a
single bug: answerRows in question-card.ts passed a two-parameter function
straight to .map (S7727). Fixed, with the findings among the other 62 that
were real and cheap:

- programName/codeCarrier: three suffix rules were regexes that backtrack
  quadratically on a long near-miss name from a model-written argv (S8786;
  100,000 characters took about 54 s); now a linear loop, pinned by a bound
  test that fails on the regex form.
- four tests ended on a polling wait with no expect of their own (S2699);
  each now ends on a plain expect. Three generic matchers (S5906), [0-9] to
  \d (S6353), three duplicate imports (S3863), one ?? (S6606).

Left on purpose and recorded in deferred-tasks.md: four S1940 that fail
closed on NaN, and 43 smells (nested ternaries, cognitive complexity, one
eight-parameter function) owned by the Sonar cleanup behind golden and
differential tests. Full local gate green (24 steps, coverage included).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@cemililik
cemililik merged commit 0a599a3 into main Nov 21, 2026
32 checks passed
cemililik added a commit that referenced this pull request Nov 21, 2026
…e merge checkpoint, the status documents and the register brought up to date

PR #101 was merged on 2026-11-21 as 0a599a3 (parents 1e71f65 and 9e77ff0;
the tree is identical to the final head's, so development was fast-forwarded).
The new "PR #101 merge checkpoint" in the Phase 2.6 record states what the PR
carried, the final-head evidence (all 29 CI jobs green before the merge; the
SonarCloud gate red on 60b6595 and OK on 9e77ff0) and what it does not show
(the Windows runbook rows 1-16 on real terminals, the Sonar analysis and the
merge commit's CI run on main, the registered lows). current.md, CLAUDE.md,
AGENTS.md, README.md and the register's header say MVP-4 is complete and MVP-8
is next; the Sonar fix is a row in the review-corrections table.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cemililik added a commit that referenced this pull request Nov 22, 2026
…d become named helpers, with no change of behaviour (cleanup)

Twenty-eight nested ternaries (S3358), seven cognitive-complexity findings
(S3776), two index keys (S6479) and one optional-chain suggestion (S6582) in
the approval card, the permissions sheet, the grant store, the chat store, the
Home and chat hints, the revoke command and the secret-range reader are
extracted into small named functions. The one rule is that nothing observable
changes: every user-visible string literal is identical (checked per file
against 0a599a3), and the extractions keep the order of every check.

Evidence before review: the 325 test files around the touched code pass; a
differential harness (not committed) compared the baseline and the new code
over about 300,000 seeded inputs (the card's key rows over the whole grid, the
card's warnings, the facts and program names, the permissions sheet's key fold
and lines, the grant store over random histories of writes, revocations, damaged
lines, renewals, marks, bounds and a lost key, and secretShapedRanges over random
credential-shaped text); a mutation sweep of 16 mutants of the new code was
killed after the harness was widened where four survived; the full local gate
passed (24 steps, 30 minutes).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cemililik added a commit that referenced this pull request Nov 22, 2026
…lse positives marked, 38 smells refactored, the review and its tests recorded

Records main's merge-commit CI (29 of 29) and Sonar gate (OK, 886 open), the 149 false positives marked, the 38 smells PR #101's lines introduced and how they were verified (differential harness, mutation sweep, four reviews including a security sitting, the adequacy review's tests, the full local gate), and what stays open on purpose.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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