docs(swang): spec §3 — the grammar the demo earned, with an explicit strategy policy - #117
Conversation
…emanded The Phase 2 closure verdict, made normative before any parser exists: spec §3 records the surface grammar with the reference program, the earned parameter sets (density/seed a visible pair, both map_rhythm boundaries always written), the explicit strategy policy — the dense demo proved the audible result is decided between the expansion and the ear, and a language that hides that choice under-tells — the not-earned list (gesture, thin, pitch/fretboard), and the seven acceptance laws under which Phase 3 adds no musical semantics. The stage doc's Phase 3 aligns; the decisions log records the strategy amendment and thin's burial. The reference program opens with the frozen integer header (swang 1) — the verdict's illustrative `swang 0.1` predates §1.1 and loses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR documents the Swang Phase 3 surface grammar, exposes strategy policy in the AST, clarifies operator parameters and CLI behavior, and defines stronger expansion, formatting, diagnostics, and build equivalence acceptance laws. ChangesSwang Phase 3 grammar
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31145d22f1
ℹ️ 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".
Арбитраж Phase 3 grammar docs — changes requiredОбщее направление принято: P1 — в программе отсутствует source scoreСуществующий Добавить source dependency в AST, например Заодно нормативно определить resolution относительных P1 — скрыты два значения, влияющие на обещанный parity
P1 — два владельца output pathПрограмма содержит
Молчаливое наличие двух output edges несовместимо с law 7. P2 — acceptance law 4 смешивает location layersСуществующий открытый thread прав: сохраняется SWG-code parity, но CLI flag/ P2 — build parity применим только к
|
…didates The #117 review (comment 4976245608) caught the grammar hiding three semantic dependencies the language was built to expose: - `source` joins the generate block as a required word: the seed score supplies pitch material, range, PPQN, meter, and tempo, and a corpus supplements but never replaces it — without it, build parity was unimplementable even in theory; - `max_cells` joins fractalize and `candidates` joins generate, both required: the artifact serializes the budget and the candidate count shapes the set a named strategy selects from, so neither may hide behind a frontend courtesy default; - the program is the output's single owner — `griff swang build` takes no output flag, so a path can never have two masters. The seven laws sharpen accordingly: parity law 1 is scoped to the canonical subset (the transport's inert seed-without-density is deliberately unexpressible and claims no parity); law 4 keeps SWG-code parity but assigns locations by §1.5 layer — source spans for syntax/transport, NodePath for structural, the flag class retiring with the transport; law 5 splits by policy — auto matches griff generate, a named strategy selects the first ranked candidate of that strategy from the unchanged, already-ranked set. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
|
Review fixes landed — point by point against comment 4976245608: Blockers:
Clarifications: 🤖 Generated with Claude Code |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/stages/S16-swang-language-and-verified-lifting.md`:
- Around line 383-384: The acceptance bullet in the Swang expansion parity
section is too broad; revise it to limit byte-identical expansion JSON parity to
Phase-2 CLI commands within the canonical transport subset, explicitly excluding
seed-without-density transport. Preserve the existing expand/map_rhythm
qualification.
- Around line 387-388: Update the diagnostic-location statement in the
build/check compatibility bullet to explicitly distinguish source spans for
syntax and transport errors from NodePath for structural errors, reflecting the
§3.5 rule rather than implying all transport location classes remain unchanged.
- Around line 361-366: Update the Phase 3 grammar summary near the listed
constructs to include the required fractalize max_cells parameter and generate
source and candidates parameters, matching the required signatures in
docs/swang/spec.md. Make clear these parameters are mandatory and must not be
replaced with implicit defaults.
- Around line 388-389: Update the build parity statement in the specification to
distinguish strategy policies: require auto to match griff generate, while named
strategies select the first candidate from the unchanged ranked set without
regeneration. Replace the existing broad parity wording near the transport
boundary/build description, preserving the stated ranked-candidate behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: caf9e4f1-439b-45d5-b41f-e2bb4b647b60
📒 Files selected for processing (3)
docs/decisions.log.mddocs/stages/S16-swang-language-and-verified-lifting.mddocs/swang/spec.md
|
Повторная сверка головы Шесть исходных пунктов в Остаётся один блокер перед merge: |
The stage summary still described the pre-verdict contract: fractalize without its required max_cells, generate without source and candidates, an unconditional expansion parity, the retired flag location class, and one undivided build parity. spec.md §3 had already moved on; the stage doc now mirrors it — canonical-subset parity, layered locations, auto/named parity split, and the three required words named as such. The L1 sketch also stops pairing density with no seed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
|
Re-review addressed at head 7e051c4 (docs-only). The one remaining blocker — the stage doc contradicting its own spec — is closed.
All six open threads (2 Codex on the spec — already fixed by 79d0c23, now answered; 4 CodeRabbit on the stage doc — fixed by 7e051c4) are replied to and resolved. CI should stay green: prose only, no code paths touched. |
Summary
The Phase 2 closure verdict, made normative before any parser exists — so Phase 3 starts from written law, not oral tradition.
What changed
fractalize depth <n> density <bps>bps seed <u64>with density/seed a visible pair (no implicit seeds — determinism was paid for in several PRs and a fair number of human nerve cells),linearizealways naming its traversal,map_rhythmalways writing bothunitandtail.strategy auto | rhythm_copy | motif_transpose | constrained_walk | shuffle_motifs | repeat_variation). The dense demo proved the audible result is decided between the expansion and the ear —repeat_variationheld one template of a six-template palette — and a language that hides that choice under-tells. Named strategies are selection-only semantics: top-ranked candidate of that strategy from the unchanged set. Group policies (the verdict's "rotate" reading) deferred until a real program asks.gesture(generation parameter + artifact metadata; its dense-demo cut was excellent but unisolated),thin(the proven operation is seeded density pruning, already named byfractalize density/seed— no vaguer abstraction gets pre-created), pitch/fretboard transforms, morph, DGD macros.fmtidempotence,parse(format(ast)) == ast, same SWG codes and location classes,buildparity withgriff generate, strategy explicit in the AST, no invented defaults.One deliberate deviation from the verdict text
The reference program opens with
swang 1, not the verdict's illustrativeswang 0.1: §1.1 froze a monotonic integer level with a byte-exact first-line grammar, and a dotted version literal would contradict it. Flagged here rather than silently normalized.Docs only; no runtime changes. After merge: Phase 3 red — lexer/parser skeleton with failing tests for the reference program, the seven laws, and the SWG parity.
Refs #108, ADR-0029, S16 Phase 3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NkqJUU6d1sW1RAfvyHrqVM
Summary by CodeRabbit
gestureand favoring seeded density pruning overthin.