Skip to content

S16 Phase 3, slice 3: griff swang build — law 5, selection from the unchanged set - #120

Merged
PhysShell merged 3 commits into
mainfrom
claude/s16-phase3-build
Jul 15, 2026
Merged

S16 Phase 3, slice 3: griff swang build — law 5, selection from the unchanged set#120
PhysShell merged 3 commits into
mainfrom
claude/s16-phase3-build

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

What

The last behavioral slice of Phase 3: griff swang build runs a program end to end — expansion, generation, strategy selection, and the program's own export. Strictly law 5 (spec §3.5), red→green:

  • test: red — four failing core tests + two failing CLI tests (a third guard — no output flag — already held at clap's edge and is pinned).
  • feat: greenselect_ranked beside ranked_candidates, the seam every frontend generates through:
    • None (= strategy auto) returns the reranked winner — today's behavior, verified by pointer identity against ranked[0];
    • Some(strategy) returns the first ranked candidate of that strategy from the same borrowed set — the set's (strategy, seed) order is fingerprinted before and after: nothing regenerated, reordered, or reseeded. A named strategy is a reading of the ranking, not a different ranking;
    • an absent strategy selects nothing — never a fallback.

Law 5 at the CLI

  • Auto parity, byte for byte: the program's export equals griff generate's output MIDI for the equivalent command (same seeds, same rhythm pipeline) — proven end to end in swang_cmd.rs.
  • Named strategy: the run names the selected strategy (RepeatVariation) and builds identical bytes across runs.
  • Single owner: build takes no output flag; the MIDI lands at the program's export and nowhere else.
  • rhythm_args_from_program is the one program→compiler mapping expand and build share, so the two frontends cannot drift; pattern flaws render exactly as expand renders them (NodePath / quoted source value / owning value).

Phase 3 law scoreboard

§3.5 law Status
1 (expand byte-parity) #119
2, 3, 6, 7 #118
4 (code parity, layered locations) #118 + #119
5 (build parity split auto/named) covered here

Remaining for Phase 3 closure: fuzz targets for the parser and expansion limits (ADR-0010) — proposed as the next, final slice.

Known local-only failure: missing_file_golden on Russian-locale Windows (pre-existing).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM

PhysShell and others added 2 commits July 15, 2026 14:38
select_ranked arrives as an unimplemented skeleton beside
ranked_candidates — the same seam every frontend generates through —
with four failing core tests: None is the reranked winner (today's
behavior, by pointer identity); a named strategy is the FIRST ranked
candidate of that strategy from the set whose (strategy, seed) order
is fingerprinted before and after — selection only, never a
re-ranking; every strategy in a full set is selectable; an absent one
selects nothing, never a fallback.

Two failing CLI tests hold griff swang build to the law's halves:
under strategy auto the export's bytes equal griff generate's output
for the equivalent command; under repeat_variation the run names the
selected strategy and builds the same bytes twice. A third guard —
build takes no output flag (the program is the output's single owner)
— already holds at clap's edge and is pinned so it stays held.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
… ranking

select_ranked lives beside ranked_candidates — the seam every frontend
generates through: None returns the reranked winner (today's behavior,
verified by pointer identity), Some(strategy) the first ranked
candidate of that strategy from the same borrowed set. Nothing is
regenerated, reordered, or reseeded — the named choice is a reading of
the ranking.

cmd_swang_build runs the program end to end: parse with spans, the
program's own source score, the shared pattern compiler (flaws render
exactly as expand renders them), ranked_candidates under the same ask
the transport builds, selection per law 5, and the winner written to
the program's export — the only output path that exists.
rhythm_args_from_program is the one mapping expand and build share, so
the two frontends cannot drift.

Auto parity proven end to end: the export's bytes equal griff
generate's output for the equivalent command. 4/4 core, 15/15 CLI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@PhysShell, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

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).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bf99e3b6-3b3c-428d-9de0-40f4615c6424

📥 Commits

Reviewing files that changed from the base of the PR and between 3b9a70a and d7cd13d.

📒 Files selected for processing (4)
  • cli/src/main.rs
  • cli/tests/swang_cmd.rs
  • core/src/generation_input.rs
  • core/tests/strategy_selection.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/s16-phase3-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
@PhysShell
PhysShell merged commit f7a14c8 into main Jul 15, 2026
4 checks passed

@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

base,
source_rhythms,
rhythm_explicit: explicit.is_some(),
gesture,

P1 Badge Split the new public API from its tests

The repository's AGENTS.md TDD workflow says, “Never commit new pub fn / pub struct implementation in the same commit as the tests that cover it.” This commit adds the new public select_ranked API here and also adds core/tests/strategy_selection.rs covering it, so the commit sequence violates the required red-then-green workflow; please split the failing tests into an earlier commit and the implementation into a later commit.

ℹ️ 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".

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