Skip to content

v2 CLI: --target as a closed choice over rostered TargetModels (Rust, C, Swift); usage refusals exit 2 - #12266

Merged
gunbai-bot[bot] merged 6 commits into
mainfrom
session/sleek-otter-453
Sep 25, 2026
Merged

gunbai-bot[bot] merged 6 commits into
mainfrom
session/sleek-otter-453

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Slice-1 prerequisite for generating the approve-ios Swift from .dag (dashboard node adhoc-1a935b07-173). The design is approved by the parent lane: emit goes through the v2 route, which is rows only, with no v1 growth.

What changes

  • v2.cli.compile_cli adds CliEmitTarget = CliTargetRust | CliTargetC | CliTargetSwift. Each arm names one rostered TargetModel through cli_emit_target_model, and v2_cli_run reads its target only from the plan. Previously rust_target_model() was hardwired.
  • The default is a declared plan row. cli_default_emit_target = CliTargetRust is the argv every existing caller (the instruments) already spawns.
  • An unknown or dangling --target refuses at the parse with cli_unknown_target or cli_target_missing_value, and the detail names the roster. The target is never a free string.
  • The exit status is split. Plan refusals are now CliUsageRefused and exit exit_code_misuse (2). Emit refusals stay exit_code_general_error (1). This is the split v2.compiler.compile native_driver_plan_exit already makes.
  • The seed harness is updated to match. native_lane_runner.rs gets the declared usage line, and its no-entry control now expects exit 2.
  • Claims: each spelling selects its own arm, a missing --target plans the default, unknown and dangling targets refuse, and there are exact exit codes for a usage refusal and for an emit refusal.
  • New recurring-failure-mode row v2_native_route_exceeds_the_default_remote_runner_memory. It records the measured OOM receipts.

History

Swift and C were first held back because their target modules did not emit to Rust. #12270 fixed that (merged), so all three are rostered. The RFM row moved to #12268.

Evidence, stated honestly

  • cargo check -p v1-compiler is green.
  • The claim file has not been executed yet. A gunbc run --claim-run of src/v2/test/claim/cli/v2_native_cli_test.dag was OOM-killed (137, oom_kill 4) on the 7 GB BuildBuddy runner, the same class the new RFM row records. So the required floor on this PR is the first execution of these claims.
  • Not evidenced end to end: --target c or --target swift on a real closure. The v2 closure-emit route still refuses member bodies for every target (CLI_DOOR_EMIT_BODY_REFUSAL). That capability is Gen-two #4: the door renders a module and its members' bodies through Rust's rows; a module reaching type projection refuses #12239, and the Swift protocol slice is stacked on it.

🤖 Generated with Claude Code

… refusals exit 2

v2.cli.compile_cli gains CliEmitTarget = Rust | C | Swift, each arm naming one
rostered TargetModel. The plan's declared default (cli_default_emit_target) is
Rust, the argv every existing caller spawns. An unknown or dangling --target
is a typed parse refusal (cli_unknown_target / cli_target_missing_value).
Plan refusals are now CliUsageRefused and exit exit_code_misuse (2); emit
refusals stay exit_code_general_error (1), the split native_driver_plan_exit
already makes. The seed's native-CLI harness follows the declared usage line
and the no-entry control's new status.

Also records the v2-native route's 7 GB remote-runner OOM as a recurring
failure mode, with its receipts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 2 commits September 25, 2026 01:07
…ain, also OOM on the 7 GB runner

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g seed-emittable

The first emit-build carrying v2.extdeps.languages.swift in the CLI closure
failed rustc (E0308 at swift_bool_grounding, plus two truncated errors; CI run
36078559948). A rostered target's model is in the door's closure, so Swift
joins the roster when that module emits cleanly, the trigger stated beside
CliEmitTarget. The unknown-target claim now uses 'swift' as its
discriminating input.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title v2 CLI: --target as a closed choice over rostered TargetModels; usage refusals exit 2 v2 CLI: --target as a closed choice over rostered TargetModels (Rust, C); usage refusals exit 2 Sep 25, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as draft September 25, 2026 01:45
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 2 commits September 25, 2026 07:59
…2270)

The trigger stated beside CliEmitTarget is met: #12270 made
v2.extdeps.languages.swift and .c emit to Rust cleanly, so the door's closure
builds with both rostered. The unknown-target claim's discriminating input
moves to 'kotlin', a real target with a model that is not rostered.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title v2 CLI: --target as a closed choice over rostered TargetModels (Rust, C); usage refusals exit 2 v2 CLI: --target as a closed choice over rostered TargetModels (Rust, C, Swift); usage refusals exit 2 Sep 25, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review September 25, 2026 07:59

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

APPROVE-MERGE at exact head 12c70113f3d39a6d7e438b876a57a2ad8b243409.

The target selection is correctly modeled as plan data rather than a free emitter string. CliEmitTarget is closed over Rust/C/Swift; each arm has an exhaustive spelling projection and TargetModel projection; cli_default_emit_target records the existing caller behavior as Rust; and v2_cli_run consumes only the target carried by the parsed plan. An unknown or dangling --target therefore refuses before source walking or emission.

The exit split is also correctly placed. Parse/plan failures become CliUsageRefused and map to GNU misuse status 2, while an admitted plan whose ingest or emission refuses remains CliRunRefused and maps to general error status 1. The seed door's no-entry control and usage string move with that contract; direct plan constructors are updated explicitly rather than relying on a hidden default.

The claims discriminate all three spellings, the no-option default, unknown and dangling target forms, and the exact 2-versus-1 statuses. Their execution on the required floor closes the PR body's earlier local OOM gap. emit-build additionally establishes that the native CLI door still emits and builds with the C and Swift target modules in its closure after #12270.

The scope boundary is honest: this lands target planning and routing, not successful member-body emission for a real C or Swift closure. That remains gated on #12239 and is not treated here as executing end-to-end evidence.

Run 36110505850 passes compiler, clippy, emit-build, floor and witnesses at this exact SHA. GitHub reports CLEAN and mergeable.

No source condition remains unless the head moves. The merge queue remains authoritative for the composed revision.

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit cb6194e Sep 25, 2026
5 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/sleek-otter-453 branch September 25, 2026 12:07
gunbai-bot Bot pushed a commit that referenced this pull request Sep 25, 2026
…door

Resolved: the door emits through cli_emit_target_model(t: target); the
imports are unioned; CliUsageRefused sits beside CliEmitted in the CLI
and its witness; the generated main keeps the single text write before
the status dispatch. native_lane_runner 36/36, v2_native_cli 26/26,
closure_emission 5/5.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Sep 25, 2026
…CensusRefused beside CliUsageRefused

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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