Skip to content

Zephyr modules deposit and export without Python or a west.yml edit (REQ-ZMODEXPORT-001) - #309

Merged
avrabe merged 6 commits into
mainfrom
feat/zephyr-v044
Nov 4, 2026
Merged

avrabe merged 6 commits into
mainfrom
feat/zephyr-v044

Conversation

@avrabe

@avrabe avrabe commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

REQ-ZMODEXPORT-001 for v0.44.0. In scope: clauses 1, 2 and 5, plus the build: depends closure. The workspace collision check and the offline gale build move to REQ-ZMODEXPORT-002 in v0.45.0.

What it does:

  • A zephyr-module payload must carry zephyr/module.yml, or the deposit refuses it.
  • varve export-zephyr-modules --out D writes each module and D/zephyr-extra-modules.cmake. Use it as west build ... -- -C D/zephyr-extra-modules.cmake, or in a plain cmake build. Your west.yml is never edited.
  • A module whose build: depends names a module the export does not carry is refused, and nothing is written.
  • package-managers: pip is refused unless the signed layer records an opt-in for that module. The opt-in is checked again at export.
  • No Python is needed to deposit or export.

Review: two fresh-context clean-room reviews, recorded as VER-REVIEW-ZMODEXPORT-001.

  • The first found a HIGH: a !!merge tag let PyYAML see a pip requirement that varve's parser missed. Fixed: every YAML tag is now refused.
  • It also found a MEDIUM: re-export deleted a directory varve had not written. Fixed: only directories with varve's marker are replaced.
  • The re-review ran about 70 probes against PyYAML's CSafeLoader and found nothing at medium or above. Four low findings are recorded.

Gates:

  • A new mutation shard, varve-core (zephyr-module): 92 tested, 86 caught, 6 unviable, 0 missed.
  • Negative control: removing that shard from ci.yml makes the mutation-scope test fail.
  • A new system test, tools/systest/zephyr-export.sh, run by the zephyr-export job. It checks that a one-byte change fails verify --export, and that pip is refused with no opt-in and with a wrong one but accepted with the exact one.

Dependencies: serde-saphyr is pinned =2.0.0 (2.1.0 was published the same day), and its young transitive crates are pinned too.

Local gates on this exact tree: fmt and clippy are clean, cargo test --workspace exits 0, the systest passes, and cargo deny reports ok. trace-gate, claim-check, review-check and tracepack-check pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

avrabe and others added 6 commits November 4, 2026 02:35
…REQ-ZMODEXPORT-001)

A zephyr-module payload is a gzip-tar of the module tree. The deposit refuses
a tree with no zephyr/module.yml or one that does not parse, and refuses a
module declaring package-managers: pip unless the layer records an allow-pip
opt-in naming exactly the declared requirement files (signed, shown by
varve inspect). module.yml is parsed in Rust (serde-saphyr, no unsafe).

varve export-zephyr-modules --out D [--select NAME] writes each module to
D/<name>/ and zephyr-extra-modules.cmake appending them to
ZEPHYR_EXTRA_MODULES (works under -C and include()), stamps D, and refuses an
incomplete build: depends closure before writing anything. ExportKind gains
ZephyrModule. The producer plans/stages layout = "zephyr-module" with the same
checks. Also fixes the producer's previous-spec reader rejecting allow-pip.

Out of scope, moved to REQ-ZMODEXPORT-002: west-workspace collision check
(--override) and the end-to-end offline Zephyr build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
… never delete what varve did not write

- serde-saphyr pinned =2.0.0 (and granit-parser 2.0.0 in the lockfile); the
  2.1.0 releases were hours old. An empty module.yml is now refused explicitly
  because 2.0.0 and 2.1.0 disagreed about it.
- Members are de-duplicated on a lowercased path, and nothing but the parsed
  zephyr/module.yml may fold onto zephyr/module.yml or module.yaml, so a
  case-insensitive file system cannot swap in an unchecked description.
  Files are written with create_new.
- A module directory is replaced only when <out> carries a zephyr-module stamp
  listing files under it; otherwise it is refused before anything is written
  or removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…REQ-ZMODEXPORT-002 for the rest; pin young transitive crates

Maintainer, 2026-11-03: the Zephyr module extract goes into v0.44.0. The
west-workspace collision check and the offline gale board build are
REQ-ZMODEXPORT-002 (v0.45.0).

encoding_rs 0.8.44 -> 0.8.42 and unicode-width 0.2.3 -> 0.2.2. Both arrive
only through serde-saphyr and were published days ago. cargo deny is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…e marked; re-check pip at export

- Any explicit YAML tag in module.yml is refused, found from the parser's own
  events. PyYAML honours `!!merge` on any key and serde-saphyr does not, so a
  tagged node hid pip, depends and name from varve while Zephyr still read them.
- Each module directory varve creates holds a .varve-zephyr-module marker. A
  directory is replaced only with that marker AND a zephyr-module stamp (the
  stamp lists everything under --out, the user's files included). Directories
  of a previous export that this one drops are removed; unmarked ones never.
- Everything (CMake quoting incl. '[', ']', '\', destinations, script, stamp)
  is validated before any tree is written; the script and stamp are never
  written through a symlink or over a file varve did not write.
- pip is re-checked at export against the layer's signed allow-pip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…ver one found by name

prepare resolved a module's allow-pip by payload name across a list, so in a
composition two payloads sharing a name (different versions both export) let a
pip module borrow the other's opt-in. The opt-in now travels inside
ExportModule. The same module name from two payloads is refused as
DuplicateModule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…and the requirement verified

- CHANGELOG: REQ-ZMODEXPORT-001 in scope (clauses 1, 2, 5 and the depends
  closure), its new command, and the review fixes under Security.
- VER-REVIEW-ZMODEXPORT-001: two fresh-context reviews. The first found a high
  and a medium defect, both fixed test-first. The re-review found nothing at
  medium or above. Four low residuals are recorded.
- rivet verify REQ-ZMODEXPORT-001.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
@avrabe
avrabe merged commit 709056b into main Nov 4, 2026
44 checks passed
@avrabe
avrabe deleted the feat/zephyr-v044 branch November 4, 2026 03:00
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