Skip to content

verifier-ts: streaming E2EE decryption + full field coverage#78

Merged
h4x3rotab merged 1 commit into
mainfrom
aci-e2ee-streaming
Jul 8, 2026
Merged

verifier-ts: streaming E2EE decryption + full field coverage#78
h4x3rotab merged 1 commit into
mainfrom
aci-e2ee-streaming

Conversation

@h4x3rotab

Copy link
Copy Markdown
Contributor

Follow-up to the E2EE channel (PR #75). Completes the client-side field coverage from the tracking list.

Streaming

  • openChunk(chunk) decrypts one streamed SSE chunk: chat choices.{i}.delta.content / delta.reasoning_content, and completion choices.{i}.text. The caller parses SSE data events (a generic concern) and calls openChunk per event.

Full field coverage

Every field the gateway encrypts (spec §7.2) is now handled:

  • Request (seal) — chat messages.{m}.content (whole, universal for any modality); /v1/completions prompt/prompt.{i}; /v1/embeddings input/input.{i}.
  • Response (open, buffered) — chat message.{content,reasoning_content,audio.data}; completion text; embedding vectors (compact-JSON, restored via JSON.parse).

Indexes follow the entry's index member with array-position fallback (§7.2). All Web Crypto, no new dependencies.

Not included (still whole-content covers it, per §7.2): per-part multimodal request encryption (image_url.url / input_audio.data) — whole-content encryption already protects those end to end, so it stays an optional optimization.

Verification

verifier-ts 50/50 (7 channel tests incl. streaming, audio, completions, embeddings, prompt/input round-trips), tsc clean. Diff is 3 files, verifier-ts only.

🤖 Generated with Claude Code

Add `openChunk` to decrypt streamed SSE chunks (chat `delta.content` /
`delta.reasoning_content`, completion `text`), and extend `seal`/`open` to every
field the gateway encrypts: request `prompt`/`input` for the completions and
embeddings endpoints, and response `message.audio.data`, completion `text`, and
embedding vectors — alongside the existing chat content. Indexes follow the
entry's `index` member (§7.2). All Web Crypto, no new dependencies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@h4x3rotab h4x3rotab merged commit 5a90bff into main Jul 8, 2026
2 checks passed
@h4x3rotab h4x3rotab deleted the aci-e2ee-streaming branch July 8, 2026 10:18
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