Skip to content

chore: remove the Device Support package pilot and its format - #133

Merged
frahlg merged 1 commit into
mainfrom
chore/remove-package-pilot
Sep 25, 2026
Merged

frahlg merged 1 commit into
mainfrom
chore/remove-package-pilot

Conversation

@frahlg

@frahlg frahlg commented Sep 25, 2026

Copy link
Copy Markdown
Member

Owner decision

Fredrik (repository owner), 2026-09-25: device-drivers is FTW's driver repository. It must not carry schemas, specs, tooling or automation for Device Support, Zap firmware or Blixt. Knowledge can be carried over by hand, with no direct coupling. As the first step, this PR removes the Device Support package pilot and the package format.

Why the pilot goes:

  • Nothing published or used it. The release workflow never called tools/driver_package.py. CI built only unsigned candidates (the packages job in validate.yml). No release has a package or index asset.
  • It gave each packaged driver a third version line, beside the catalog DRIVER version and the manifest version.
  • Package ids cannot contain _, but catalog ids do. The wider aim is one id and one version per driver.

If Device Support needs a package later, it can be rebuilt from the catalog driver. Git history keeps the pilot at 489c937.

Removed

  • packages/v1/: recipes for esphome-dsmr, foxess_h3_smart, pixii, sdm630 and sungrow, the separate target files pixii/targets/ftw.lua, sungrow/targets/ftw.lua and sungrow/targets/ftw-observe.lua, and sungrow/PILOT.md.
  • Tooling:
    • tools/driver_package.py, tools/build_candidate.py and tools/derive_sungrow_ftw_observe.py. Only the pilot, its tests and test_esphome_dsmr_aliases.py imported them.
    • make package-driver, with its TARGET and ARTIFACT_DIR variables.
    • The packages CI job.
    • The package-recipe branches in tools/bump_driver.py, tools/new_driver.py and tools/check_public_boundary.py.
    • The now unused jsonschema dependency (uv.lock only drops it and its transitive packages).
  • Specs and schemas:
    • spec/driver-package-v1.md and spec/driver-package-v1-migration.md.
    • spec/driver-inventory-v1.md and spec/blixt-lua-reference-architecture.md, which describe the inventory format and Blixt's use of packages.
    • All eight spec/schemas/sourceful.driver-*.json schemas.
  • Tests:
    • tests/test_driver_package.py.
    • tests/test_driver_runtime_contracts.py, which only validated the removed schemas.
    • The package-target cases in test_ftw_legacy_parity.py, test_host_api_profile.py, test_no_undefined_locals.py, test_absent_optional_registers.py, test_sungrow_model_family.py and the Lua harness test_all_drivers.lua.
  • Support status:
    • package_id, candidate_package_version, stable_package_version and control_enabled are removed from the generator and the generated files. All four came from the recipes.
    • The four support-status-overrides.json entries are removed (pixii, goodwe, sdm630, sungrow). They described only the pilot's own package targets and candidate versions, such as "Version 1.3.2 … must not run on the pilot site". Those packages no longer exist.
    • The catalog page loses its always-empty "Stable package" column and those notes.
  • Docs: package, Device Support and Zap-consumption text is removed from AGENTS.md, README.md, CONTRIBUTING.md, SECURITY.md, SOURCE_IMPORT.md, drivers/lua/README.md, drivers/lua/GUIDELINES.md, drivers/INTEGRATION_OVERVIEW.md, CODEOWNERS and the PR template. AGENTS.md "Where a driver change has to land" now lists two places, not three.

Kept, and why

  • spec/control-runtime-v2.md: trimmed to FTW Core's v2 command interface. That covers driver_command_v2 and driver_default_mode_v2, write scope, leases and the HIL gate. FTW Core implements this interface in go/internal/drivers/control_v2.go, and the catalog driver foxess_h3_smart implements it too. The package envelope, control_enabled and Blixt profile text is gone.
  • spec/signing.md: trimmed to the FTW channel. The canonical-bytes section now describes the FTW manifest, which uses the same canonical JSON.
  • Tests that ran one rule on both a catalog driver and its package target: they now run it on the catalog driver only, with the same assertions.
    • The ESPHome DSMR read-only check no longer calls the packager's source validator. It asserts the same things on the catalog source directly: entrypoints, host_api_min/max, read_only = true, and no write-capable host call.
  • No shared code needed a new module. The only non-package code that imported driver_package.py was the esphome test above and the runtime-contract tests. Those tests validated only the removed schemas.
  • Provenance records: SOURCE_IMPORT.md and source-import-delta.json still record where the initial import came from. The delta file still lists the three recipe paths as part of that record. Only the present-tense sentence about the private service consuming this repository is removed.
  • check_public_boundary.py: still forbids the private repository name and signing-role strings. Those guards prevent coupling.
  • No driver Lua or manifest changes, and no version changes. Two driver comments still mention removed files: foxess_h3_smart.lua:168-170 and sungrow.lua:793. They are left for the id/version branch, because editing them needs a version bump.

Test evidence

  • make check: green. 4365 passed, 1068 skipped. On untouched main it was 4406 passed, 1069 skipped.
    • I compared collected test IDs. The difference is exactly 42 tests, all removed with the package code:
      • 17 package tests;
      • 7 schema-contract tests;
      • 2 observe-target tests;
      • 6 host-API cases on package targets;
      • 3 undefined-locals cases on package targets;
      • 1 pixii package-target case;
      • 6 Sungrow ftw-v2 cases.
    • Every catalog-driver case is still there. Some now have simpler IDs because the catalog-versus-target parameter is gone.
  • The signed-channel preflight (tools/ftw_repository.py check-versions against the published drivers-beta manifest) reports {"added": [], "changed": [], "drivers": 88}. No published artifact changes.
  • make site builds. drivers.json target records no longer carry stable or control_enabled.
  • The Lua harness test_all_drivers.lua does not run in CI:
    • Before: 98 total, 5 failed.
    • After: 93 total, 4 failed.
    • The 5 removed cases were package targets, including the already failing sungrow-ftw-v2.
    • The 4 remaining failures (ferroamp, fronius, sonnen, pixii-catalog-missing-40288) happen on main too and are unchanged.
  • Needs a human check in a browser: the catalog page's "Per-target status" table, which lost the "Stable package" column and the pilot notes.

Overlaps

Remaining couplings, not removed here

  • Support-status matrix:
    • This includes tools/generate_support_status.py, support-status.json, SUPPORT_STATUS.md, support-status-overrides.json (now {}), spec/support-status.md and the site's per-target table.
    • It was added with the package candidates (b058e0b). Its targets are ftw-core and blixt-l1, and every value is now a default. Candidate for full removal, which changes the catalog page.
  • Blixt L1 as a target:
    • Host API profile and dialect: spec/host-api-profile.json (the blixt-l1 profile, the ftw_to_blixt dialect and Blixt emit-key rules), spec/host-api.md and tools/host_api_check.py.
    • Tests that use the dialect: tests/test_host_api_profile.py, tests/test_blueprint.py and drivers/tests/test_modbus_drivers.py.
    • Docs and site text: the blueprint/BLUEPRINT.lua comments, the README Scope and "One driver per device" paragraphs, the GUIDELINES.md intro, docs/WRITING-A-DRIVER.md:275, and the site text "publishes for FTW and Blixt".
    • tools/bump_driver.py rewriting DRIVER_MANIFEST versions.
  • Driver Lua (not edited here):
    • DRIVER_MANIFEST tables in acuvim, deye-svk, 50-125k-svk, 50-125k-svk-slew, 50-125k-svk-ac-slew, konja-261-svk, sdm630 and foxess_h3_smart.
    • The foxess blixt-l1 / driver_package.py comment and the sungrow package-target comment.
    • sdm630's "canonical package pilot" notes and Blixt mixed-case aliases.
    • Blixt compatibility code in the SVK and konja drivers.
    • "Ported from …/device-support/…" provenance comments in 11 drivers.
  • Control v2:
    • FTW Core turns on v2 only for drivers installed from a signed Device Support package (go/internal/driverrepo/sourceful.go). FTW's own channel publishes v1 control.
    • So spec/control-runtime-v2.md, foxess_h3_smart's v2 entrypoints and drivers/tests/test_foxess_h3_smart_control.py are reachable in FTW only through Device Support.
  • Zap firmware:
    • tools/build_luac.sh builds 32-bit Lua 5.5 "compatible with ESP32-C3 (Zap gateway)". make check and the harness use that build.
    • The manifest fields bytecode_sha256, bytecode_signature, bytecode_size and signature are empty in all 88 manifests. They are still read by tools/generate_index.py and described in spec/manifest-v2.md.
    • tools/import_ftw_baseline.py reports against a Zap bytecode limit.
    • drivers/INTEGRATION_OVERVIEW.md is a stale overview of gateway firmware and the cloud.
  • Device Support, Hugin and Nova:
    • The manifest field dkb_id (Hugin DKB profile id) is set in 47 manifests. It is also written by new_driver.py and migrate_manifests.py and described in spec/manifest-v2.md.
    • baselines/ftw/source-map.json has package_eligibility on all 37 entries, written by tools/import_ftw_baseline.py.
    • drivers/type_mapping.yaml maps names to Nova Core, but nothing reads it.
  • Not a coupling: drivers/lua/zap.lua is an FTW driver for a Zap P1/HAN meter and stays.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7

This is FTW's driver repository. The package pilot gave five drivers a
third version line beside the catalog DRIVER version and the manifest
version, under package ids that cannot contain "_" where catalog ids do.
Nothing published or consumed it: the release workflow never called the
packager, CI built unsigned candidates only, and no release carries a
package or index asset.

Removed:
- packages/v1 (recipes for esphome-dsmr, foxess_h3_smart, pixii, sdm630
  and sungrow, the separate pixii and sungrow target files, and the
  sungrow PILOT.md);
- tools/driver_package.py, tools/build_candidate.py,
  tools/derive_sungrow_ftw_observe.py, make package-driver and the
  packages CI job;
- the package-v1 and migration specs, the driver inventory and Blixt
  reference specs, and every sourceful.driver-* JSON schema, with the
  tests that validated them;
- package fields and the pilot's own override entries from the support
  status, the always-empty "Stable package" column from the catalog
  page, and the now unused jsonschema dependency;
- package and Device Support text from AGENTS.md, README.md,
  CONTRIBUTING.md, SECURITY.md, SOURCE_IMPORT.md and the specs.

spec/control-runtime-v2.md keeps only FTW Core's v2 command interface
and spec/signing.md only the FTW channel. Tests that held a rule against
both a catalog driver and its package target now hold it against the
catalog driver. No driver Lua, manifest or version changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T07:09:50.290297Z c0ebc7c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0ebc7cf2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +39
The driver returns only `status`, `code`, optional `message`, `device_state`,
applied values and evidence names. The host creates the
`sourceful.driver-command-result/v1` record, adds the command and lease IDs,
driver identity, completion time and the number of allowed host writes, and
records the result. A nil, boolean or string Lua result fails the v2 call.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore definitions for the retained v2 records

The retained FTW v2 contract still requires sourceful.driver-command/v1 and sourceful.driver-command-result/v1, but this commit deletes their only schemas and a repo-wide search finds no remaining authoritative definition. Anyone implementing or validating this interface can no longer determine required fields, status/device-state enums, identifier constraints, or bounds, allowing Core and drivers to drift on a safety-sensitive control boundary; define the package-independent record shapes here or link to the authoritative FTW contract.

AGENTS.md reference: AGENTS.md:L17-L23

Useful? React with 👍 / 👎.

}
}
}
{}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the historical signed-beta records

Replacing all overrides with {} also resets sdm630's recorded 1.1.1 betas and sungrow's 1.3.0 beta to null in the generated support status. Those are historical provenance rather than candidate-package metadata, and the retained support-status contract explicitly says this field records an older beta whose provenance must not be overwritten; consumers of support-status.json will now incorrectly report that these signed betas never existed. Keep minimal overrides for these historical versions even if the package recipes and candidate-specific gates are removed.

Useful? React with 👍 / 👎.

frahlg commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Automated maintenance pass (device-driver repo review): not merging.

Content looks sound on its own evidence: all 5 CI checks green, no driver Lua/manifest/version changes, the signed-channel preflight reports no published-artifact diff ({"added": [], "changed": [], "drivers": 88}), and the removed test count (42) matches exactly what the removed package-pilot code owned. Nothing in the diff touches a catalog driver.

Holding rather than merging for two reasons:

  1. GitHub itself is refusing this via the API right now — mergeable_state is blocked, and the only review so far is the Codex bot's automated pass (no human/maintainer approval). That's very likely a required-review branch-protection rule, which an autonomous pass shouldn't try to route around.
  2. Blast radius beyond this repo. The PR's own "Remaining couplings" section lists real dependents this doesn't touch yet (Device Support's dkb_id/package eligibility, Blixt L1 host-API profile, Zap bytecode fields) and Give every driver one id and one version #132 is explicitly written to land after this one, needing a rebase once it does. A same-day, same-account architecture deletion of this size (7k+ lines of specs/schemas/tooling) is exactly the kind of call this pass defers to a maintainer for, even with green CI.

Recommend: Fredrik reviews and merges this directly in the web UI, then #132 gets rebased on top (it currently fails drivers/packages CI purely because it still expects the package-pilot tests this PR deletes — expected per #132's own description, not a defect).


Generated by Claude Code

@frahlg
frahlg merged commit 4e6b5a8 into main Sep 25, 2026
5 checks passed
@frahlg
frahlg deleted the chore/remove-package-pilot branch September 25, 2026 07:27
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