Skip to content

feat(mesh): MeshTransfer schema + fail-closed admit (E3 first code) - #36

Merged
mdheller merged 2 commits into
mainfrom
feat/mesh-transfer-e3
Aug 3, 2026
Merged

feat(mesh): MeshTransfer schema + fail-closed admit (E3 first code)#36
mdheller merged 2 commits into
mainfrom
feat/mesh-transfer-e3

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

First code for E3 personal mesh transport (campaign gap #3, sourceos-spec#267), spec: e3-mesh-transport.md.

  • schemas/mesh-transfer.schema.json — the MeshTransfer contract (2020-12): kind ∈ {handoff,drop,cast,message,sync}, purpose fixed to egress, required consent.policyDecisionRef + hash-sealed receipt.
  • tools/mesh_transfer.pyadmit(), pure/stdlib, fail-closed: grants only on an explicit policy decision + valid receipt; denies missing consent, missing/garbage receipt, non-egress purpose, unknown kind, same-device, non-device endpoints, and data-namespace egress without a region toleration (GDPR Ch. V). Mirrors the shell's Require a policy decision to grant, and give callers a gate that fails closed #31 'gate that bites' convention.
  • tests/test_mesh_transfer.py — 9 tests (allow + every deny path), green.

Moves the census Continuity/Handoff/AirDrop + AirPlay rows spec→partial. Next: a meshd service that forms the WireGuard fabric and moves a real file drop E2E.

mdheller and others added 2 commits July 29, 2026 17:14
…ow bites

Closes a register item: capability-ledger.deny() writes a blocked_by_policy
receipt into the ledger, but the sole production caller (the pdf-viewer
demo) used isEnabled() at the use-gate. isEnabled reports 'blocked_by_policy'
as false and drops silently — a policy refusal indistinguishable from a
not-yet-declared capability, which is the entire failure mode the register
item names.

  - Inline CapabilityLedger drifted from the packaged version: it lacked
    assertEnabled and let enable() take a null policyDecisionRef. Both fixed;
    the packaged behaviour (enable requires a non-empty pdr, assertEnabled
    throws on any non-enabled state naming the reason) is now mirrored.
  - Click handlers use assertEnabled via a gatedClick wrapper; the diagnostic
    surfaces in feature-output so the refusal is visible instead of dropped.
  - Buttons stay clickable even when not enabled: the enforcement is at the
    click site, and letting the click fire is what surfaces the diagnostic.
  - Added pdf-export capability that is denied by policy, so the deny path
    is now demonstrated end-to-end alongside pdf-sign (missing_plugin) and
    pdf-viewer (enabled).

Package tests unchanged, 38/38 pass on origin/main head. This PR only
touches the demo — the surface most likely to drift because it's a manual
copy of the module.
Every cross-device transfer (Handoff/drop/cast/message/sync) is an egress act;
admit() grants only on an explicit policy decision + hash-sealed receipt, else
refuses fail-closed (data-namespace egress additionally needs a region toleration).
Spec: sourceos-spec e3-mesh-transport.md. 9 tests.
@mdheller
mdheller merged commit 9512f06 into main Aug 3, 2026
2 checks passed
@mdheller
mdheller deleted the feat/mesh-transfer-e3 branch August 3, 2026 08:21
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