Skip to content

feat: consume canonical Device Support driver packages - #595

Merged
frahlg merged 4 commits into
masterfrom
agent/device-support-packages
Jul 20, 2026
Merged

frahlg merged 4 commits into
masterfrom
agent/device-support-packages

Conversation

@frahlg

@frahlg frahlg commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds sourceful.driver-index/v1 as an explicit FTW repository format while preserving the transitional ftw.manifest/v1 reader.
  • Verifies the signed Device Support index, exact package-envelope bytes, package signature, provenance, permissions, host/runtime/ABI/profile compatibility, artifact size/hash and matching Lua metadata.
  • Adapts verified ftw-core packages into the existing Update Center, content-addressed install, explicit activation, identity check, automatic rollback and bundled offline recovery flow.
  • Keeps Phase 1 fail-closed to read-only packages. Commands, control capabilities, write permissions, leases or control_enabled targets are rejected until the control safety/HIL gate is closed.
  • Synchronizes the bundled SDM630 recovery driver byte-for-byte with Device Support 1.1.1, based on David's Blixt L1 implementation and its single batched FC04 measurement read.
  • Adds an always-on pinned Python-signed package/index fixture test and, when SOURCEFUL_CI_REPO_TOKEN is provisioned, uses uv to rebuild/sign the real private Device Support source before verifying the FTW target in Go.

Architecture decision

Device Support is the canonical owner of Sourceful driver source, SemVer, package metadata and signed target artifacts. FTW is a target adapter and safety host; it does not fork canonical versions.

David's Blixt implementation remains the hardware-near reference. This PR does not try to replace Blixt's LuaJIT/mlua runtime or its arbitration/queue design with FTW. FTW selects the separate GopherLua 1.1.2 / Lua 5.1 / gopher-lua-source-v1 / sourceful.host/ftw-core/v1 target and retains Core-owned safety.

Hugin is not a registry, package authority or runtime dependency. Its possible future role is a workbench only.

Safety and trust boundary

  • Refresh/discovery never installs, activates, restarts or commands a driver.
  • Sourceful envelopes can never be unsigned; duplicate JSON keys and unsupported canonical contracts fail closed.
  • The index binds the exact package-envelope SHA-256; the package independently binds source commit, build materials and immutable target artifacts.
  • Unknown product/version/runtime/semantics/ABI/host profile/API values are incompatible.
  • Install rechecks exact artifact size/hash, compiles Lua and requires id/version/host API/read_only metadata to match the signed package.
  • Cached indexes and packages are reverified offline. Network or cache failure leaves the last-good active driver or bundled recovery path unchanged.
  • Control packages remain blocked even though FTW already has default-mode/restart/telemetry/identity rollback safety. Enabling them is a separate reviewed change after lease expiry, structured command results and physical HIL acceptance.

Validation

  • make verify PYTHON=uv: all Go and optimizer tests, optimizer contract tests, Compose migration tests, container-boundary tests, go vet ./... and go build ./... pass.
  • go test -count=1 ./internal/driverrepo ./internal/config ./internal/drivers passes.
  • Device Support Python producer → Go verifier cross-language test passes against pinned commit 8eecfd6efef0932a28fc35301d4354cc15245a54.
  • FTW driver publication validation passes for 37 drivers; version-change validation accepts SDM630 1.0.0 → 1.1.1.
  • FTW, Blixt target and Device Support SDM630 Lua bytes have identical SHA-256 27d5612b891b01c98b054304a16295bd3e78982d166f731fd99372e3871eea54.
  • All 11 remote checks pass, including the Device Support contract, full Go suite, driver publication/version gate, optimizer contract and full-stack tests.

Dependencies and deployment blockers

  • Depends on Device Support draft PR Docs: per-package CLAUDE.md for IO + plumbing layers #11 for the canonical package/index contract and pinned SDM630 source.
  • Related Blixt consumer: draft PR fix(easee): always start sessions at 6 A to avoid 16 A inrush #210.
  • Provision SOURCEFUL_CI_REPO_TOKEN as an organization GitHub App/read token for live cross-private-repo regeneration; the reviewed signed fixture is still verified on every CI run without it.
  • Do not switch FTW's default repository yet. Device Support must first publish a stable signed index at a production URL and provision the production Ed25519 trust root to fleets.
  • Keep the legacy FTW publisher and default repository during migration; remove them only after beta/stable publication, offline recovery and rollback have been exercised on real FTW hardware.
  • SDM630 remains telemetry-only and requires physical FTW/Blixt HIL before stable promotion.

This remains a draft for cross-repository and safety review.

@frahlg

frahlg commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Deployment status (2026-07-20): the production host and trust root now exist. This PR documents an explicit one-site beta source at https://drivers.sourceful.energy/v1/channels/beta/index.envelope.json and the future stable source at https://drivers.sourceful.energy/v1/channels/stable/index.envelope.json, pinned to sourceful-drivers-2026-01. The legacy FTW source remains the default until SDM630 beta, offline recovery and stable promotion pass. No fleet activation is enabled.

@frahlg

frahlg commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Live beta check passed (2026-07-20): the FTW Go repository consumer refreshed https://drivers.sourceful.energy/v1/channels/beta/index.envelope.json, verified sourceful-drivers-2026-01, selected the signed ftw-core / GopherLua profile for [email protected], and kept it read-only. This was discovery-only in a temporary state store; nothing was installed or activated. Physical FTW HIL remains the next gate before stable promotion.

@frahlg
frahlg marked this pull request as ready for review July 20, 2026 08:51
@frahlg
frahlg force-pushed the agent/device-support-packages branch from 3cf658a to 9cdf181 Compare July 20, 2026 08:53
@frahlg
frahlg merged commit adb70f2 into master Jul 20, 2026
11 checks passed
@frahlg
frahlg deleted the agent/device-support-packages branch August 7, 2026 08:14
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