Skip to content

Claude mutation-scope integration - #263

Open
davidabram wants to merge 11 commits into
mutation-scope-ingressfrom
claude-mutation-scope-integration
Open

Claude mutation-scope integration#263
davidabram wants to merge 11 commits into
mutation-scope-ingressfrom
claude-mutation-scope-integration

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

@davidabram
davidabram force-pushed the claude-mutation-scope-integration branch 12 times, most recently from 48d7b91 to fb56916 Compare September 7, 2026 12:07
@davidabram
davidabram force-pushed the claude-mutation-scope-integration branch from 9ea5e75 to 34a15e6 Compare September 8, 2026 17:04
@davidabram
davidabram force-pushed the claude-mutation-scope-integration branch from 34a15e6 to 16ae33c Compare September 8, 2026 18:24
davidabram and others added 11 commits September 9, 2026 06:48
Define the first concrete Claude Code mutation-scope adapter, its generic-ingress boundary, lifecycle and identity semantics, durable state, generated settings integration, and validation strategy.

- Sequence the work across Claude lifecycle discovery, adapter implementation, setup integration, production regressions, and durable context.
- Capture fail-closed PreToolUse behavior, write-ahead Start ordering, stale-attempt cleanup, worktree ownership, and background-shell limitations.
- Record acceptance criteria and full verification commands for the stacked integration.

Plan: claude-mutation-scope-integration
Tasks: T01-T08

Co-authored-by: SCE <sce@crocoder.dev>
Capture Claude Code 2.1.258 lifecycle payloads for mutation-scope design decisions, including successful and failed tools, parallel calls, denials, subagents, worktree cwd, and background execution.

Document uncaptured or analog-only probes and confirm the foreground/background and failure-signal assumptions used by the follow-up implementation.

Co-authored-by: SCE <sce@crocoder.dev>
Capture and validate Claude hook lifecycle and tool events before wiring the
adapter, so mutation-scope integration can use stable execution identities and
conservative tool classification.

Implement strict event parsing, identity/scope ID formatters, lifecycle models,
and read-only/delegation/mutation-capable classification. Keep the module
unwired and dead-code allowed until the planned ingress work lands.

Plan: claude-mutation-scope-integration (T02)

Co-authored-by: SCE <sce@crocoder.dev>
Persist versioned adapter attempts under the checkout's Git state directory, using bounded OS locking and durable atomic replacement to prevent lost updates and partial writes. Reuse live deliveries by tool identity while allocating monotonic ScopeIds for later executions, and reject malformed or unsupported state rather than fabricating bookkeeping.

Plan: claude-mutation-scope-integration (T03)

Co-authored-by: SCE <sce@crocoder.dev>
Ensure Nix package builds include the Claude mutation-scope hook fixtures so the hook's test and runtime assets are available in the packaged CLI source tree.

Co-authored-by: SCE <sce@crocoder.dev>
Document the observed Claude Code lifecycle boundary for a foreground Bash call
that launches a self-detaching descendant whose repository mutation occurs after
PostToolUse. Add the captured hook payloads, update fixture notes, and reconcile
D20/T04 in the integration plan without changing production behavior or adding
process supervision.

Plan: claude-mutation-scope-integration (T04)

Co-authored-by: SCE <sce@crocoder.dev>
Make the existing normalized JSON ingress crate-visible so sibling hook modules can reuse it without an `sce` subprocess or a duplicate `RuntimeBoundary` construction path. Preserve the CLI command path and behavior unchanged.

Plan: claude-mutation-scope-integration.md (T05)

Co-authored-by: SCE <sce@crocoder.dev>
Add the hidden `sce hooks claude-mutation-scope` route and in-process driver that maps Claude lifecycle events to mutation-scope start, close, abandon, and flush operations with worktree-derived resolution and fail-closed PreToolUse behavior.

Persist pending attempts before Start, retire failed or stale attempts behind a recovery barrier, and cover duplicate delivery, cleanup, background-shell, and barrier behavior with focused tests. Update the mutation-scope runtime and hook-routing contracts, and record completion of `claude-mutation-scope-integration` T06; setup registration remains pending.

Co-authored-by: SCE <sce@crocoder.dev>
Make the first concrete Claude mutation-scope adapter reachable from real Claude Code sessions by adding unmatched registrations for all ten lifecycle events to generated settings. Update canonical context and mark plan task T07 complete to record setup/doctor reachability while leaving Codex, OpenCode, and Pi unwired.

Plan: claude-mutation-scope-integration (T07)

Co-authored-by: SCE <sce@crocoder.dev>
Record the shipped Claude mutation-scope adapter as durable repository context.
Add its scope model, identity derivation, fail-closed write-ahead behavior, cleanup and recovery rules, and unsupported background-shell boundary, then update the related runtime, routing, overview, architecture, map, raw-hook, and plan references.
Plan: claude-mutation-scope-integration, T09

Co-authored-by: SCE <sce@crocoder.dev>
Ensure Claude lifecycle events invoke the shared mutation-scope hook so SCE
policy handling covers permission, tool-failure, session, stop, and prompt
boundaries consistently.
@davidabram
davidabram force-pushed the claude-mutation-scope-integration branch from 16ae33c to e647c85 Compare September 9, 2026 04:48
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