Repository navigation
Pause a Claude seat's Kindex status call until Dash approves it - #173
Open
shanebarakat wants to merge 2 commits into
Open
shanebarakat wants to merge 2 commits into
shanebarakat wants to merge 2 commits into
Conversation
When the host sets FACTORY_DASH_URL at lane launch, a Claude lane's settings get one PreToolUse hook for the read-only Kindex status tool. The hook asks Dash for an approval bound to the run, seat and exact call, waits for a passkey decision, redeems it for this seat's session, and only then allows the call. A repeat of the same call, a stale session, a denial, an expiry or Dash being unreachable all deny. Unset, lane settings are byte-for-byte unchanged.
There was a problem hiding this comment.
Confidence Score: 4/5
Summary
Opt-in PreToolUse hook that pauses a Claude seat's Kindex status call until Dash approves and redeems it once. Flag-off path is byte-identical, tests and all repo gates pass; remaining items are fail-closed hardening gaps.
Important Files Changed
| File | Overview |
|---|---|
| harness/dash_gate.py | New stdlib hook: request, poll, redeem against Dash; any exception denies |
| harness/native_session.py | Merges the gate hook into Claude lane settings when FACTORY_DASH_URL is set |
| tests/test_dash_gate.py | FakeDash server covers flag off/on, once-only redeem, deny, stale, unreachable |
Findings
- harness/dash_gate.py is absent from the Makefile lint and typecheck file lists, so CI never runs ruff or mypy on the hook; add it (both are clean today).
- wandercom/dash PR #1's worker returns 404 for /approvals*, so the paths, x-dash-actor header and 409 semantics the gate depends on exist only in an unversioned local demo; check that contract in somewhere testable.
Reviewed c5d2499...516aabe · ↻ Re-run review · View in Adapt
- PreToolUse entry sets onFailure: block, so a crashing or stalled gate blocks. - One deadline starts before the first request and bounds every request and poll, so the gate always answers before Claude Code's hook timeout. - Run and seat names are checked at launch; an invalid name refuses to enable gating with a clear message. - The call is allowed only when Dash confirms the approval was redeemed. - A refused redemption (stale lease or expiry) gets its own deny reason. - A call without a tool_use_id gets a nonce so identical calls stay distinct. - docs/HARNESS.md describes FACTORY_DASH_URL and its demo-only identity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First Dash-owned permission decision, as Jeremy asked: a Claude seat's read-only Kindex status call pauses, the exact request shows in Dash, and the call runs once after a passkey approval.
What changes
harness/dash_gate.py(new, stdlib only): a PreToolUse hook. It asks Dash for an approval bound to the run, seat and exact call (tool_use_idas intent, sha256 of tool name + input as the effect digest), waits for the decision, redeems it for this seat's session, then allows. A repeat of the same call, a stale session, a denial, an expiry, or Dash being unreachable all deny.harness/native_session.py: when the host setsFACTORY_DASH_URLat lane launch, the Claude lane's settings get that one hook, matched only tomcp__.*kindex__status. Unset (the default), settings are byte-for-byte unchanged.Checks
tests/test_dash_gate.py(7 tests): flag off gives exactly today's settings bytes; flag on gates only the Kindex status call; approve runs once and a repeat is denied; denied or undecided never runs; a stale session can't redeem; an unreachable Dash denies. Two negative controls (allow without Dash; gate always on) both fail the suite.origin/mainon this machine (direnv blocks the tests' bash subprocesses). Side by side in the same clean env: base 75 failing ids, this branch 74, none only on this branch.mcp__kindex__statuscall until approval, then got the result, and Dash recorded the approval redeemed once.Not covered
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.