Repository navigation
Conversation
Preserve exact call/source identities, attach hook evidence only to unique retained root cards, and share canonical records across notices, approvals, and clone-safe delegation snapshots. Keep existing presentation and historical approval replay behavior while retaining conflicting evidence standalone. Relates to #2117. Co-authored-by: Mecatl <noreply@mecatl.dev>
Implementation plan archive: 2117-tool-hook-correlation
Amendment: engine-owned identity simplificationThe original client/scrollback data slice is on the observed PR head. The The amendment replaces provider-ID correlation with engine-assigned public Fresh general/security/architecture plan review found one important pre-record Current plan (verbatim)#2117: tool-hook correlation with engine-owned identitiesSlug: 2117-tool-hook-correlation Amendment and current stateThis identity amendment supersedes the original plan's no-wire-change scope and Checkout The original slice's gates/reviews are recorded in ignored run notes. Its CI Goal and settled decisionsMake the API identify the concrete invocation, logical hook/review record, Joe's decisions:
Retain the original root-visible data slice: standalone notices for correlated Grounded existing seams
Material identity contractsPublic ToolCallID and private provider identityMint a nonempty opaque globally unique public ToolCallID once for each newly Results (provisional and canonical), asks/authorization, hook/review records, Do not replace private provider pairing fields blindly. Prefer an additive Public IDs do not repair simultaneously open duplicate provider pairing IDs. Shared HookID and ReviewIDPut HookID on the existing Hook envelope. For an ordinary published outcome, For a contextual review:
Action, permission and inbound jobs remain distinct. Ordinary and review-backed One review record per invocation/job. Re-evaluation after authorization and Record revisionsNew-format hook updates include stable HookID and positive monotonic revision. Store high-water metadata additively in ordinary snapshots. Reconcile it with Future versions exceed restored snapshot and committed observed log high-water. For one HookID: higher revision advances machine state; lower revision cannot Explicit origin, asks and receiptsCarry originating SessionID on hooks/review references and surfaced asks/receipts. Asks/receipts carry public ToolCallID and optional exact review record ID. Only Preserve verified-owner RPC checks, active request tokens, session/review/returned Legacy and mixed-history loadingOld snapshots/events decode with absent additive fields; never reinterpret stored A bounded in-memory legacy-snapshot translation may assign deterministic Once assigned, preserve IDs through effective mutations, compaction archives, Old event projection can use its own deterministic occurrence anchors where the Keep conservative legacy hook reduction when HookID/revision is absent. A bounded Client ownership and simplificationConversation owns one hook record store whether attached or standalone. Use engine Unique public ToolCallIDs permit the existing narrow card index for new-format Replace original-event history/indexing with HookID/revision logic on the new Remaining dependency-ordered tasksOn a fresh implementation request use plan-implement and resume the recorded
Acceptance and planned verificationObservable checks must cover:
Workers run focused offline root/engine tests with reference adapters and test-owned Review, PR archive, and clear-session boundaryRun plan-review on this exact amendment with fresh general critique plus focused Maintain existing PR plan comment via plan-implement publication procedure: verify After review update ignored root HANDOFF.md with plan/branch/start/current OIDs, |
Normalize rendered whitespace in conflict-evidence assertions and cover four terminal widths without weakening canonical-state or deduplication checks. Co-authored-by: Mecatl <noreply@mecatl.dev>
Separate accepted invocation identity from private provider replay pairing. Carry hook record revisions and explicit origins through APIs, approval flows, recovery, and typed scrollback, preserving legacy continuation safely. Co-authored-by: Mecatl <noreply@mecatl.dev>
Summary
Relates to #2117.
Implement the reviewed root-visible tool-hook correlation data layer:
/toolcallspresentation.Attached-hook rendering, live-detail persistence, child-session correlation, and historical approval/review joins remain deferred. This PR does not complete #2117.
Verification
task testtask linttask test:racetask docsgo run ./cmd/mecademo(tool call, permission ask/approval, result)The first aggregate race attempt timed out under concurrent load; the retry passed.
Plan
The full approved implementation plan is preserved in a verified PR conversation comment.