Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Bump GOAL_FILE_SCHEMA_VERSION to 5 (tendcf schema v5, S3) - #5

Merged
djbclark merged 3 commits into
masterfrom
v5-s3
Nov 3, 2026
Merged

djbclark merged 3 commits into
masterfrom
v5-s3

Conversation

@djbclark

@djbclark djbclark commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

S3 of tendcf schema v5 (spec docs/architecture/schema-v5-dpkg-reconciliation-2026-11-02.md §4 item 11; tendcf PR frdminc/tendcf#37, master 03224e42). Same shape as the v4 bump (PR #2).

Change

  • GOAL_FILE_SCHEMA_VERSION 4 -> 5; scripts/check_schema_version.py against tendcf master: ok: both are 5.
  • SUPPORTED_SCHEMA_VERSIONS = (3, 4, GOAL_FILE_SCHEMA_VERSION): v4 added, 3 kept. For every host nix2cf renders, the v4 file is the v5 file bar schema_version (new test test_schema_v4_differs_from_current_only_in_the_version); the spec names no downgrade path and no device holds a baseline (spec §4 item 1), so keeping both is a conservative no-op, not a claim of a shape a v5 validator accepts (older files are never schema-validated). Dropping 3/4 is a one-line change if the lead prefers.
  • Three goldens regenerated; each is byte-identical to its v4 predecessor bar the version number (checked by parsing). nixos-get still equals tendcf's deploy/linux/passthrough/goal-file.json byte for byte.
  • Tests: == 4 asserts now 5; unsupported-version test uses current+1; new test_dpkg_writer_is_refused_at_v5.
  • README + docs/DESIGN.md: version text, older-version row, new rows for the v5 key grammar and tombstones.

v5 delta impact: no renderer change

  • writer enum: nix2cf emits cfengine/mise/nix-darwin/apple (from launchd-writers.yml); never dpkg, never tendcf-install. A dpkg writer in the Site Model is refused (writers schema and goal-file schema).
  • unit-writer keys: only launchd prefixes (com.djbclark.*, org.tendcf.*, dev.mise.*, org.nixos.*, com.apple.*), all matching both the new base regex and the launchd/runit v4 regex. Zero rejected.
  • systemd prefix-must-be-cfengine: nix2cf renders no systemd units; a systemd host gets no supervision domain.
  • tombstones / R5: the Site Model cannot say "absent", nothing is rendered absent.

Verification

  • uv run pytest with TENDCF_DIR=tendcf master: 49 passed, 1 skipped (nix-instantiate absent).
  • Independent probe of all three goldens: v5 schema errors none; tendcf check_goal_file_cross_file findings none; every unit-writer key matches the v5 regex; no tombstones.

Review

Standing rule: this PR needs one cross-model frontier review (astra/Fable/Argon) before merge; not yet done. Not merged.


Note

Low Risk
Version constant, docs, goldens, and tests only; compiler output shape is unchanged for current fixtures aside from schema_version, with v5 validation catching retired writers like dpkg.

Overview
Aligns nix2cf with tendcf goal-file schema v5 by bumping GOAL_FILE_SCHEMA_VERSION from 4 to 5 and extending SUPPORTED_SCHEMA_VERSIONS to (3, 4, 5) so the library can still emit older shapes. The CLI and default compile path now stamp schema_version 5; three golden fixtures are regenerated with only that field changed.

Documentation in README and docs/DESIGN.md is updated for v5: older-version rendering semantics (v4 vs v5 byte identity for current Site Model inputs, with an explicit caveat that historical v4 dpkg unit-writer claims are not v5-valid), v5 unit-writer key rules, and tombstone limitations.

Tests assert against GOAL_FILE_SCHEMA_VERSION, add parametrized coverage that v4 and v5 output differ only by version for launchd/nixos/systemd/runit host shapes, and add test_dpkg_writer_renders_at_v4_but_is_refused_at_v5 for the retired writer. No change to the launchd merge/render logic—v5 compliance for normal sites comes from existing output plus tendcf schema validation.

Reviewed by Cursor Bugbot for commit 6a10632. Bugbot is set up for automated code reviews on this repo. Configure here.

Review: astra (gpt-6-astra high, read-only): sound with changes. All applied.

  1. P2: the 'v4 equals v5 bar the number' claim was too broad. The renderer copies every declared writer, so a v4 Site Model with an unused dpkg writer renders at v4 and is rejected at v5. Comments and DESIGN.md are narrowed to inputs valid under the current contract. The dpkg test now asserts that the v4 render keeps the claim and that schema-validated v5 compilation refuses it.
  2. P3: the dpkg test selects the dev.mise.* writer by prefix, not by index.
  3. 6.1: the v4/v5 equality test now covers launchd, NixOS, and service-free systemd and runit, and schema-validates the v5 output. A mutant that diverges only the runit branch fails exactly the runit case.
    CI on 6a10632: test pass. Suite: 52 passed, 1 skipped (no nix-instantiate).

@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 6e567500-5ba5-4d02-858f-f538b29a3800)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T00:28:25.471494Z 3990fe1 PR opened
🔒 Security Review ✅ Completed 2026-11-03T00:29:36.139847Z 3990fe1 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.

…sed at v5); select dev.mise.* writer by prefix (P3)
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: fb140f51-d68d-439c-8554-df30db782090)

…it hosts, v5 output schema-validated (astra 6.1)
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: f4d0da46-0960-405d-9de0-9d5ce37443de)

@djbclark
djbclark merged commit 3debda7 into master Nov 3, 2026
2 checks passed
@djbclark
djbclark deleted the v5-s3 branch November 3, 2026 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant