Skip to content

feat(sce): replace file handoff with gRPC data access - #131

Draft
prdai wants to merge 2 commits into
mainfrom
docs/issue-21
Draft

prdai wants to merge 2 commits into
mainfrom
docs/issue-21

Conversation

@prdai

@prdai prdai commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

what changed

  • Add proto/sce/v1 with the DataAccess service (FetchRecords stream, SubmitResult) and the RecordEnvelope used at rest.
  • Store PDM records as a protobuf RecordEnvelope (google.protobuf.Struct payload, AES-256-GCM) in a DynamoDB Binary instead of base64 JSON.
  • Replace sce-unit's records.json / result.json handoff with a gRPC server on /data/sce.sock; the DC app now pulls records and submits one result Struct, which sce-unit converts back to JSON for the vsock host.
  • Relax nsjail's seccomp allowlist for AF_UNIX sockets and pass SCE_RPC_SOCKET / ALGORITHM_ID instead of the file paths.
  • Convert all five sample apps (Python x2, Go, Node, Rust) to gRPC clients with checked-in generated stubs.
  • Update Dockerfiles, lockfiles, READMEs, SECURITY, and the secure-rads flow doc.

why

Issue #21: the sce-unit to DC app contract was a file handoff. This makes it a real protobuf gRPC contract over the same unix socket, shrinks the encrypted record on disk, and makes record access pull-based.

Closes #21.

verification

  • go build ./... in secure/sce-unit, secure/samples/spend-analysis-go, and secure/csav/registry-service.
  • cargo build and cargo fmt --check in secure/samples/audience-segments-rust.
  • uv run python -c 'import main' in both Python samples; npx tsc --noEmit in seeding.
  • Cross-language check: TS seeding produced a RecordEnvelope; sce-unit decryptRecord decrypted it and the Struct round-tripped to the same JSON.
  • node --check main.js and a generated-stub import in product-trends-node.
  • Not verified: enclave end-to-end run and the size sweep. Both need the stack deployed and EIF rebuilds; running a small benchmark next.

notes

  • Requires reseeding (make seed) and rebuilding the sample EIFs: the stored record format and the app contract both changed.
  • secure/samples/audience-segments-rust/target/ is now gitignored.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.

Replace sce-unit<->DC app placeholder protocol with real gRPC

1 participant