Text chat 69: fluxer-proto update manifest, channels and release versions (#431) #452

Manually merged
charles merged 4 commits from textchat-69-proto-update-manifest into textchat 2026-11-13 13:10:46 +00:00
Owner

What

fluxer_proto::update (Text chat 69, auto-update spec §3.2, §3.5, §4.3):

  • ReleaseVersion { year, mmdd, n }: strict YYYY.MMDD.N FromStr, zero-padded Display, serde as that string, Ord by field order; velopack_version() (2026.105.412) and from_velopack_version().
  • Channel { Nightly, Stable } (lowercase, ALL), PlatformKey { LinuxX86_64, WindowsX86_64, Other } with current() from cfg!, AssetKind { AppImage, Exe, Zip, Velopack, Unknown }, Asset, Manifest::asset_for.
  • parse_manifest(bytes, &feed_url, expected): schema check first (UnsupportedSchema), then channel, version, minimum_version, commit (7-40 hex), RFC 3339 published_at, and per asset name / url (resolved against the feed, no credentials, https or loopback http, same origin) / sha256 / size (1 B..1 GiB). SCHEMA_VERSION, MAX_ASSET_SIZE, ASSET_NAME_PATTERN.
  • 13 fixtures in fixtures/update/, README section.

Tests

crates/fluxer-proto/tests/update.rs: every test named in the plan plus malformed_documents_are_json_errors, velopack_version_examples, channels_serialise_lowercase, errors_never_carry_urls, and a second never-panics proptest that swaps each field for odd JSON values. Seen failing (no module), then passing. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally (Linux).

Choices the plan leaves open (reviewer please check)

  • fluxer-proto/Cargo.toml gains url (already a workspace dependency, no new crate in the lock) because the interface types Asset::url / notes_url as Url.
  • ReleaseVersion::from_str also requires MMDD to be a month-day (01-12 / 01-31), matching from_velopack_version.
  • An unknown platform key keeps a valid asset as PlatformKey::Other and silently drops an invalid one; a known platform's bad asset fails the manifest.
  • A notes_url that breaks the URL rules is dropped (warned), not an error. Bad published_at is Json(..) (no dedicated variant in the interface).
  • Commit hex is accepted in either case and stored lowercased; ManifestError::Json keeps only serde's category and position, never document values (so no URL in logs).
  • ORDER_TABLE in the test is the table Text chat 70's version_key_orders_like_release_version should share.

Closes #431

🤖 Generated with Claude Code

## What `fluxer_proto::update` (Text chat 69, auto-update spec §3.2, §3.5, §4.3): - `ReleaseVersion { year, mmdd, n }`: strict `YYYY.MMDD.N` `FromStr`, zero-padded `Display`, serde as that string, `Ord` by field order; `velopack_version()` (`2026.105.412`) and `from_velopack_version()`. - `Channel { Nightly, Stable }` (lowercase, `ALL`), `PlatformKey { LinuxX86_64, WindowsX86_64, Other }` with `current()` from `cfg!`, `AssetKind { AppImage, Exe, Zip, Velopack, Unknown }`, `Asset`, `Manifest::asset_for`. - `parse_manifest(bytes, &feed_url, expected)`: schema check first (`UnsupportedSchema`), then channel, version, minimum_version, commit (7-40 hex), RFC 3339 `published_at`, and per asset name / url (resolved against the feed, no credentials, https or loopback http, same origin) / sha256 / size (1 B..1 GiB). `SCHEMA_VERSION`, `MAX_ASSET_SIZE`, `ASSET_NAME_PATTERN`. - 13 fixtures in `fixtures/update/`, README section. ## Tests `crates/fluxer-proto/tests/update.rs`: every test named in the plan plus `malformed_documents_are_json_errors`, `velopack_version_examples`, `channels_serialise_lowercase`, `errors_never_carry_urls`, and a second never-panics proptest that swaps each field for odd JSON values. Seen failing (no module), then passing. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally (Linux). ## Choices the plan leaves open (reviewer please check) - `fluxer-proto/Cargo.toml` gains `url` (already a workspace dependency, no new crate in the lock) because the interface types `Asset::url` / `notes_url` as `Url`. - `ReleaseVersion::from_str` also requires `MMDD` to be a month-day (01-12 / 01-31), matching `from_velopack_version`. - An unknown platform key keeps a valid asset as `PlatformKey::Other` and silently drops an invalid one; a known platform's bad asset fails the manifest. - A `notes_url` that breaks the URL rules is dropped (warned), not an error. Bad `published_at` is `Json(..)` (no dedicated variant in the interface). - Commit hex is accepted in either case and stored lowercased; `ManifestError::Json` keeps only serde's category and position, never document values (so no URL in logs). - `ORDER_TABLE` in the test is the table Text chat 70's `version_key_orders_like_release_version` should share. Closes #431 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Shaped like the schema-1 manifest of
docs/superpowers/specs/2026-11-13-fluxer-native-autoupdate-design.md §3.2
(lines 122-200: the example document and its rules); the manifest is
written by our own release workflow (tools/release/manifest.jq, Text chat
70), not by the Fluxer server. Same-origin rule as the fork's
fluxer_desktop/src/common/UpdateFeed.ts:44 (resolveUpdateFeedFileUrl).

Refs #431

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #431

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fluxer_proto::update: ReleaseVersion (YYYY.MMDD.N, Velopack mapping),
Channel, PlatformKey, AssetKind, Asset, Manifest and parse_manifest
applying every rule of auto-update spec §3.2. fluxer-proto gains the
workspace url dependency for the asset URLs.

Refs #431

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Text chat 69 (proto-update-manifest)

Reviewed 9cf9a68..b566fef (3 commits) cold, against plan Task 69 and auto-update spec §3.2, §3.5, §4.3, §7.

Tests (1): all 22 tests the plan names exist in crates/fluxer-proto/tests/update.rs and assert the spec's values (version 2026.1113.412, MAX_ASSET_SIZE = 1 << 30, oversize fixture 1073741825, 2026.105.412 Velopack mapping, the name pattern, loopback http for 127.0.0.1, localhost and [::1], relative ../native-… resolved against the update-feed URL, protocol-relative and other-port URLs rejected as Origin). There are 27 tests in total, including two never-panic proptests and errors_never_carry_urls.

Interfaces (2): ReleaseVersion {year,mmdd,n} with FromStr, Display, Ord, serde, velopack_version and from_velopack_version; Channel (lowercase, ALL, Display); PlatformKey (with current() from cfg! only); AssetKind including Velopack; Asset; Manifest and asset_for; parse_manifest(&[u8], &Url, Channel); ManifestError and AssetProblem with every variant named; SCHEMA_VERSION, MAX_ASSET_SIZE and ASSET_NAME_PATTERN. All of these match the Interfaces block exactly.

Invariants (3): the only new dependency is url.workspace in fluxer-proto. It was already a workspace dependency, does no I/O, and the interface requires the Url type. cargo deny and core isolation pass. fluxer-core, fluxer-ui and fluxer-emoji are untouched. The fixtures are shaped like the spec's §3.2 document; this is our own release workflow's format, not server data, and the commit message cites the spec lines and UpdateFeed.ts:44. Error messages and logs carry no URLs or document values: Json(..) keeps only the serde category and position, and the unknown-platform debug log names only the key. Hostile input cannot panic the parser (no indexing or unwrap on document data, and proptests cover it). No secrets or paths appear in fixtures.

Review Focus (4): no Review Focus item belongs to this task. Item 7 (server data never panics) is covered anyway.

CI (5): FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree: all steps passed (27/27 in tests/update.rs).

Findings

  • minor: FromStr accepts leading zeros in N (2026.1113.0412 parses to the same value as 2026.1113.412), so Display does not round-trip that input. This matches the spec's \d+ regex, and jq's tonumber orders it the same way, so nothing breaks. A test pinning either behaviour would help.
  • minor: ORDER_TABLE is a pub const inside an integration-test file, so Text chat 70's xtask tests cannot import it. Text chat 70 will have to copy it or include! it. Moving it to a pub item in fluxer_proto::update (or a fixture file) would let Text chat 70 share it as the plan intends. This does not block this task.
  • minor: schema: 0 is reported as UnsupportedSchema(0). The spec only names higher schemas; this is harmless.
  • minor (open choices, accepted): valid unknown-platform assets are kept as Other rather than ignored; this is harmless because consumers look up current(). A bad notes_url is dropped with a warning, and a bad published_at is reported as Json. All of these fit the interface.

Verdict: approve. No blocking findings; local CI is green.

## Independent review: Text chat 69 (proto-update-manifest) Reviewed `9cf9a68..b566fef` (3 commits) cold, against plan Task 69 and auto-update spec §3.2, §3.5, §4.3, §7. **Tests (1):** all 22 tests the plan names exist in `crates/fluxer-proto/tests/update.rs` and assert the spec's values (version `2026.1113.412`, `MAX_ASSET_SIZE = 1 << 30`, oversize fixture `1073741825`, `2026.105.412` Velopack mapping, the name pattern, loopback http for 127.0.0.1, localhost and [::1], relative `../native-…` resolved against the `update-feed` URL, protocol-relative and other-port URLs rejected as Origin). There are 27 tests in total, including two never-panic proptests and `errors_never_carry_urls`. **Interfaces (2):** `ReleaseVersion {year,mmdd,n}` with FromStr, Display, Ord, serde, `velopack_version` and `from_velopack_version`; `Channel` (lowercase, `ALL`, Display); `PlatformKey` (with `current()` from `cfg!` only); `AssetKind` including `Velopack`; `Asset`; `Manifest` and `asset_for`; `parse_manifest(&[u8], &Url, Channel)`; `ManifestError` and `AssetProblem` with every variant named; `SCHEMA_VERSION`, `MAX_ASSET_SIZE` and `ASSET_NAME_PATTERN`. All of these match the Interfaces block exactly. **Invariants (3):** the only new dependency is `url.workspace` in fluxer-proto. It was already a workspace dependency, does no I/O, and the interface requires the `Url` type. cargo deny and core isolation pass. fluxer-core, fluxer-ui and fluxer-emoji are untouched. The fixtures are shaped like the spec's §3.2 document; this is our own release workflow's format, not server data, and the commit message cites the spec lines and `UpdateFeed.ts:44`. Error messages and logs carry no URLs or document values: `Json(..)` keeps only the serde category and position, and the unknown-platform debug log names only the key. Hostile input cannot panic the parser (no indexing or unwrap on document data, and proptests cover it). No secrets or paths appear in fixtures. **Review Focus (4):** no Review Focus item belongs to this task. Item 7 (server data never panics) is covered anyway. **CI (5):** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree: **all steps passed** (27/27 in `tests/update.rs`). ### Findings - **minor**: `FromStr` accepts leading zeros in `N` (`2026.1113.0412` parses to the same value as `2026.1113.412`), so `Display` does not round-trip that input. This matches the spec's `\d+` regex, and jq's `tonumber` orders it the same way, so nothing breaks. A test pinning either behaviour would help. - **minor**: `ORDER_TABLE` is a `pub const` inside an integration-test file, so Text chat 70's xtask tests cannot import it. Text chat 70 will have to copy it or `include!` it. Moving it to a `pub` item in `fluxer_proto::update` (or a fixture file) would let Text chat 70 share it as the plan intends. This does not block this task. - **minor**: `schema: 0` is reported as `UnsupportedSchema(0)`. The spec only names higher schemas; this is harmless. - **minor** (open choices, accepted): valid unknown-platform assets are kept as `Other` rather than ignored; this is harmless because consumers look up `current()`. A bad `notes_url` is dropped with a warning, and a bad `published_at` is reported as `Json`. All of these fit the interface. **Verdict: approve.** No blocking findings; local CI is green.
charles manually merged commit 851af027ea into textchat 2026-11-13 13:10:43 +00:00
Sign in to join this conversation.
No description provided.