Skip to content

fix(handshake): close three auth gaps (+ graphify code/ graph) - #7

Draft
focusedbrain wants to merge 2 commits into
mainfrom
cursor/graphify-knowledge-graph-c56a
Draft

fix(handshake): close three auth gaps (+ graphify code/ graph)#7
focusedbrain wants to merge 2 commits into
mainfrom
cursor/graphify-knowledge-graph-c56a

Conversation

@focusedbrain

@focusedbrain focusedbrain commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes three confirmed handshake / Host-AI authorization inconsistencies, with regression tests for each. Also includes the earlier code/ graphify knowledge graph on this branch.

Authorization fixes

  1. IPC row-level session authhandshake.get, handshake.queryStatus, and handshake.delete now apply handshakeRowVisibilityForSession (fail-closed as HANDSHAKE_NOT_FOUND) so single-row reads/deletes match list filtering.
  2. Sandbox DC capabilitieshandleP2pDcInferenceCapabilitiesAsSandbox now requires full assertRecordForServiceRpc eligibility (not role-derive alone), matching the Host handler.
  3. internalSandboxesApi Host/Sandbox decisions — replace weaker local_role checks with deriveInternalHostAiPeerRoles + assertRecordForServiceRpc for eligibility.

Protocol behavior for authorized callers is preserved (including existing delete state policy).

Regression tests

  • ipc.rowSessionAuth.regression.test.ts
  • p2pDcCapabilities.sandboxServiceRpc.regression.test.ts
  • internalSandboxesApi.canonicalRoles.regression.test.ts
  • Updated regressionMatrix.relayHandshakeSandbox.test.ts for coordination-id eligibility

Graphify (prior on branch)

AST-only knowledge graph for code/ under graphify-out/ (PDFs/docs excluded via .graphifyignore).

Test plan

  • vitest run on the three new regression suites + relay handshake matrix (23 passed)
  • Manual: logged-out / wrong-account handshake.get does not leak row data
  • Manual: sandbox caps response rejected when handshake is not service-RPC eligible
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 8, 2026 16:35
Build an initial graphify map of code/ using tree-sitter AST extraction only.
PDFs and documentation are excluded via .graphifyignore so the graph reflects
the current codebase; docs can be added selectively later.

Co-authored-by: focusedbrain <focusedbrain@users.noreply.github.com>
Apply row-level session visibility to handshake.get/queryStatus/delete,
require assertRecordForServiceRpc for sandbox DC capability responses,
and use canonical role/eligibility policy in internalSandboxesApi instead
of local_role. Add regression coverage for each fix.

Co-authored-by: focusedbrain <focusedbrain@users.noreply.github.com>
@cursor cursor Bot changed the title chore(graphify): initial code/ knowledge graph (AST-only) fix(handshake): close three auth gaps (+ graphify code/ graph) Aug 8, 2026
cursor Bot pushed a commit that referenced this pull request Aug 8, 2026
Bounded pass ordered after phase-2-complete and before Phase 3, because
p2p/coordination-client overlaps Phase-3 territory.

Of the 35 failing identities in the five suites, only 29 are consolidation-
inherited: they step in at exactly one commit, the #7 merge dffec03, whose
canonical coordination-device-id role derivation the four clone-prepare
fixtures do not satisfy — they still encode the retired local_role model and
set no coordination ids. The product fails closed as that merge intended.

The other 6 predate the consolidation and split three ways: harness schema
lag, one unresolved seal-verification case where a product defect is not
excluded, and two coordination-client tests that assert a deliberately
retired relay path and an enqueue shape that no longer validates.

CC_05b also fails alone at every commit probed yet passed in one full-workspace
run, so the suite can report a broken test as green. Counting failures would
not have caught that; the identity-set comparison did.

No fixes applied; fix-vs-defer is the author's per class.

Co-authored-by: focusedbrain <focusedbrain@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 8, 2026
…erivation

B. PR #7 replaced the local_role role derivation with the canonical
coordination-device-id derive, on the grounds that local_role is a per-device
view that can disagree with the ledger. These fixtures still set only
local_role and no coordination ids, so the derive returned
device_id_not_in_handshake and the product refused every prepare.

The fail-closed refusal is the enforcement #7 added and is left untouched;
the fixtures now name the local instance, following the 2a24cdb precedent.

Co-authored-by: focusedbrain <focusedbrain@users.noreply.github.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.

2 participants