Skip to content

feat!: targets are names; drop the CLI's Platform and AssetCompression mirrors (cli#471 P3) - #519

Merged
apotema merged 7 commits into
mainfrom
feat/drop-platform-enum
Sep 29, 2026
Merged

apotema merged 7 commits into
mainfrom
feat/drop-platform-enum

Conversation

@apotema

@apotema apotema commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of #471, item P3. Breaking: for CLI 4.0. Stacked on #518 (S4), which sits on #517 (D4). It also merges #515 (I5), so the 4.0 stack carries every removal. This PR is the tip of the 4.0 train.

P3

  • Deleted: project_config.Platform, AssetCompression/formatFor, and provider_targets target.legacy.
  • .platform in project.labelle still picks the default target, now read as a plain name (declared_target).
  • .asset_compression still parses. The assembler keys it by target, and the CLI skips it.
  • ASTC pre-pass: whether to run it now comes from describe's asset_format for the resolved target name. It is asked on every generation, so watched rebuilds pick up edits. This also closes D3's asset-format follow-up.
  • No enum checks left: there are no parsed.platform checks in build/run/docker. The pipeline, the session key, provider commands and labelle astc use the target name.
  • Unknown targets are judged by the assembler. describe answers supported: false with a reason, and the CLI stops with, for example: labelle: backend 'bgfx' cannot build target 'probe-target': backend 'bgfx' has no target 'probe-target': this assembler generates for desktop ios android wasm. For a provider target it adds that the package declares the target but has no replace hook on generate.

Merge of I5

  • The target dir is describe-only, and the forced-sokol lines are gone.
  • The guard's "platform in the path" unit sub-case lost its subject, since cli/ios.zig and cli/sdl_provision.zig are both deleted. The code path stays, and a comment says so.

Agnostic guard: 2 entries left, the guard file itself and cli/doctor.zig (its SDL2 advice line).

Tests

  • zig build test passes 13/13 steps (1154 tests).
  • All ten e2e suites pass locally. provider_hooks/provider_targets skip their macOS --docker block, which X3 refuses on a Mac host; CI runs them on Linux.

Open points

  • docs/migrating-to-4.0.md, which goes with the release.
  • A .platform given as a string rather than an enum literal is now a CLI parse error.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…s (cli#471 I5)

The ios target is owned by labelle-toolkit/labelle-ios (v0.1.0, in the
provider registry): app bundling after build, simulator launch as the run
replacement, and the bundle replacement. The core keeps nothing
iOS-specific:

- src/cli/ios.zig is deleted, along with the `labelle ios` command, its
  parsing and help, and Command.ios_cmd.
- Deleted: the legacy own-build branch, the forced sokol backend (no
  silent substitution, D5), the ios Bypass arms, legacyRunBranch, and the
  simulator launch branch.
- `ios` is no longer a reserved provider namespace.
- IosConfig/Orientation are gone. project.labelle is read with
  ignore_unknown_fields, so an old `.ios` block still parses and is ignored.

`labelle ios ...` now gives the unknown-command diagnostic with nothing
generated. `run --platform=ios` without an owning provider gives the
no-provider diagnostic, or NoRunReplacement when the provider has no
`replace run`. The e2e scripts and docs are updated. The agnostic guard
drops five entries.

BREAKING CHANGE: `labelle ios` is removed; use labelle-ios with
`labelle build|run|bundle --platform=ios`. Targets for ios generate
into <project backend>_ios, since the backend is no longer forced.
…n mirrors (cli#471 P3)

The CLI no longer mirrors the project schema's platform enum or its
asset-compression table. A target is a name end to end: `desktop` is core,
every other name is declared by a pinned provider, and the assembler says
what it can do with it.

- project_config: `Platform`, `AssetCompression` (+ `formatFor`) and the
  `platform`/`asset_compression` fields are gone. `.platform` is read as a
  name (`declaredTarget`, any enum literal) into `declared_target`, which
  `config.readProjectConfig` fills after the tolerant parse; it is still
  the default target when no `--platform` is given. `.asset_compression`
  is skipped by `ignore_unknown_fields`; the assembler reads both.
- provider_targets: `Provisional.legacy` / `Resolved.legacy` are gone.
- The labelle-assembler#378 schema-target gate is replaced by the
  assembler's own verdict: unless a provider replaces `generate`, the
  pipeline (and a watched rebuild) asks `describe --target <t>` after the
  install and refuses `supported: false` with describe's reason. An
  unknown target reads "backend 'X' cannot build target 'T': backend 'X'
  has no target 'T': this assembler generates for ...", plus a line
  telling a provider target's owner it declares no `replace generate`.
- The ASTC prepass keys on `describe`'s `asset_format` for the resolved
  target name (passed to `labelle astc --platform <t>`), asked on every
  generation so a watched rebuild follows an edited `.asset_compression`.
- `parsed.platform` is gone from the pipeline; args_resolve no longer
  derives it, and the session key, provider command context and
  `labelle astc` default read `declared_target`.
- Agnosticism guard: cli.zig, cli/pipeline.zig, cli/pipeline/build.zig and
  cli/project_config.zig came clean; 2 entries left.
- docs/provider-targets.md: "What the assembler generates" replaces the
  #378 boundary section; the targets e2e fake assembler answers like the
  real `describe` (unsupported with a reason for unknown names,
  `asset_format` from `.asset_compression`).

BREAKING CHANGE: the CLI no longer knows the schema platforms. A provider
target whose provider does not replace `generate` is refused with the
assembler's `describe` reason instead of the #378 message, and whether the
ASTC prepass runs comes from the assembler's `asset_format` for the target
(so it needs an assembler that answers `describe`, protocol >= 7, which
CLI 4.0 already requires). `.platform` accepts any target name as an enum
literal; a non-enum value is a parse error.
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 104 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 3a32faad-2f15-4a33-a489-ad62a9041358

📥 Commits

Reviewing files that changed from the base of the PR and between 95606c1 and e3db5b4.

📒 Files selected for processing (32)
  • docs/migrating-to-4.0.md
  • docs/provider-contract-v1.md
  • docs/provider-hooks.md
  • docs/provider-local-dispatch.md
  • docs/provider-targets.md
  • docs/rfc-ios-platform.md
  • src/agnostic_guard_test.zig
  • src/astc/cmd.zig
  • src/cli.zig
  • src/cli/args.zig
  • src/cli/config.zig
  • src/cli/help.zig
  • src/cli/ios.zig
  • src/cli/pipeline.zig
  • src/cli/pipeline/args_resolve.zig
  • src/cli/pipeline/build.zig
  • src/cli/pipeline/generate.zig
  • src/cli/pipeline/install.zig
  • src/cli/pipeline/rebuild_commit_tests.zig
  • src/cli/pipeline/rebuild_lock_tests.zig
  • src/cli/pipeline/rebuild_replan.zig
  • src/cli/pipeline/rebuild_replan_tests.zig
  • src/cli/pipeline/rebuild_transaction_tests.zig
  • src/cli/pipeline/run.zig
  • src/cli/pipeline/session_key.zig
  • src/cli/pipeline/watch_session.zig
  • src/cli/project_config.zig
  • src/cli/provider_dispatch.zig
  • src/cli/provider_hooks.zig
  • src/cli/provider_targets.zig
  • test/provider_hooks_e2e.py
  • test/provider_targets_e2e.py

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-29T16:35:34.305322Z e3db5b4 New commits
ℹ️ 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: 55c9d228d4

ℹ️ 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 thread src/cli/pipeline/generate.zig Outdated
Comment on lines +172 to +173
const described = opts.describer.query(scratch.allocator(), opts.target);
if (described != null and std.mem.eql(u8, described.?.asset_format, "astc")) {

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 Fail when the ASTC describe query fails

If this additional describe call fails during a watched rebuild or a concurrent project-file update, query returns null and the code silently skips cmdAstc while continuing to generate. For a target configured for ASTC, an existing stale .astc sibling can then be selected by the assembler without being refreshed or removed, producing a successful build with outdated assets. Treat a missing description as a rebuild/build failure rather than as PNG.

Useful? React with 👍 / 👎.

docs/migrating-to-4.0.md covers what a project needs for CLI 4.0:
- assembler 0.118.0+ (protocol 7);
- labelle-ios for the ios target;
- the sdl2 provider (or LABELLE_SDL2_LIB, or .gamepad = .none) for SDL2
  on Windows;
- smaller changes: the describe-named target dir, unknown targets, astc
  --backend, the .platform enum literal, doctor --fix, labelle test, and
  --docker on a Mac.

`labelle help` points at it.
…kipping it

A null describe answer used to read as PNG, so a target configured for
ASTC could generate against a stale .astc sibling without refreshing it.
The prepass now requires the answer: the cold pipeline stops with a clear
message, and a watched rebuild fails only itself (the session lives on).
@apotema
apotema changed the base branch from feat/sdl-out-of-core to main September 29, 2026 17:42
@apotema
apotema merged commit ce7eee7 into main Sep 29, 2026
4 of 5 checks passed
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.

2 participants