← Back to Pull requests

dKMS/dDRM foundation on the ESP substrate (inspired from flint-5.0) #15

Open
unknown opened this pull request with 413 lines diff across 5 files
View on GitHub
unknown unknown commented on Aug 10, 2026 14:18 UTC
Author

Lands the decentralized key custody (dKMS), content protection (dDRM), and content-commerce rails — originally built on the pre-ESP runtime (review/dkms-foundation) — rebased and re-seated onto the ESP architecture, hardened, test-anchored, and consolidated into 7 commits.

What this delivers

  • Protected content, end to end: creators seal assets (CENC + PQ-hybrid threshold envelopes, CEK escrowed to a custody quorum); buyers acquire on-chain rights; viewers (elacity-player, ddrm-viewer) decrypt through capability-scoped provider chains with per-open sessions (open → session-bound streaming → close → sweeper reap), fail-closed at every unauthorized step.

  • Commerce rail: publish → index → buy → acquire with Wallet and Chain integration, content-market capsule, and Marketplace/Creator surfaces.

  • Key custody: dkms-authority/dkms-keygen with a CI-enforced release invariant (release build fails to compile with legacy-receipt-authz/dev-modes).
  • How it was adapted to ESP (main's architecture wins everywhere)

  • WASI-era execution dropped; providers run on the component model / microVMs; manifest-capability ceilings enforced fail-closed in the bus hostcall.

  • Manifests migrated to the ESP projection schema; catalog uses typed affordance dispatch; op→action capability enforcement converged into provider_operation_action (preview==enforce conformance down to 1 tracked divergence).

  • Money verbs (/api/market/buy, /api/create/mint) require passkey step-up — intent-, launch-, and time-bound, single-use — brokered under Home's cookie authority with a new Home-chrome spend-confirmation dialog (what's displayed is what's signed). Launch tokens moved to URL fragments (never query strings).

  • Security hardening found and fixed along the way: localhost scheme + boot sub-route seizure (first-writer-wins pinning, identity-keyed teardown), authority refusals reaching guests as Denied (was Internal), release-gating of ELASTOS_DDRM_SUBJECT.
  • Testing

    ~1,700 tests green across both CI lanes (default + dev-modes): workspace suites, 10 capsule crates, capability conformance + token fuzz, egress spine, and a new dkms_rail e2e anchor proving the full commerce/viewer contract. verify-ci, verify-capsules, bus-conformance (made non-vacuous), lint/fmt, entropy/WCI checkers all pass. Known pre-existing flakes: browser_reconciliation timing family (passes in isolation, predates this branch).

    Docs

    All dKMS/dDRM/commerce docs consolidated into one onboarding hub at docs/dkms/ (README entry → architecture, security model, media pipeline, viewer sessions, commerce, dev setup; historical notes under history/). Roadmap coverage baseline + gap plan in docs/superpowers/specs/.

    Known follow-ups (documented, non-blocking)

  • Subject-resolution rewire (RequiredHomeLaunchToken threading): chain-gated open/buy is dev-lane-only until it lands — deliberately fail-closed; prerequisites in the viewer_open.rs PARKED block.

  • ESP facts/verbs migration for the commerce/viewer conversation plane (shared with main's own surfaces; tracked in the gap plan).

  • Real decrypt-binary chain needs a CI lane; two Linux-only smokes need a Linux runner; manual browser smoke checklist owed before release.
  • Diff: 413 lines (+309 / -104) across 5 files Reviewer: SashaMIT Review duration: 85273m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.57) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 413 lines diff across 5 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.361
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #15"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 56.9% (MEDIUM) · Higher = larger blast radius
    56.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.5% · Safe to merge
    31.5%