Conversation
| payload: Uint8Array; | ||
| } | ||
|
|
||
| export const GOSSIP_ENVELOPE_VERSION = '10.0.0'; |
There was a problem hiding this comment.
🔴 Bug: computeGossipSigningPayload() now signs a different byte stream, but the advertised envelope version stays 10.0.0. During a rolling upgrade, old and new nodes will both claim the same protocol version while rejecting each other’s signatures, which can split agent-gated SWM gossip. Bump the envelope version (or accept both signing formats during migration) when changing the signed payload layout.
| } | ||
| } | ||
|
|
||
| throw new Error(`Cannot gossip SWM write for agent-gated context graph "${contextGraphId}": no local allowed signing agent key`); |
There was a problem hiding this comment.
🔴 Bug: throwing here turns a missing local signer into a hard failure after the local SWM write has already been committed. publishAsync(), share(), and conditionalShare() all call writeToWorkspace() first, so callers can get an error even though local state and async-lift jobs were already created. Either decide this before mutating local state, or downgrade it to “skip broadcast and keep the local write” so the API result matches what actually happened.
| return false; | ||
| } | ||
|
|
||
| if (this.localAgentAddresses) { |
There was a problem hiding this comment.
🔴 Bug: inbound verification now depends on this node owning an allowed agent key, not just on the sender being authorized. That means a subscribed/read-only peer, or a node that temporarily lacks its local key material, will reject otherwise valid signed gossip and stop converging. The receiver should verify that the envelope signer is in the graph’s allowlist; whether the local node can publish is a separate concern that should stay on the sender side.
|
Thanks for the work here. One important gap to fix before we can call this complete: this appears to gate writes / receiver-side ingestion, but it does not fully gate reads / visibility of SWM data. The new The intended behavior is both:
So I do not think this PR fully satisfies the read/confidentiality side yet. To close the gap, we need one of these guarantees, with tests:
In short: current PR looks like write-gating plus authenticated ingest; the acceptance target should be write-gating and read/confidentiality gating. |
Summary
agent key is available.
graphs reject unsigned or unauthorized writes.
custodial agent key exists.
Testing
signer rejection, and raw open-graph fallback.
rejection.
Should fix #396