Skip to content

docs(swang): pin the byte layout of the loss block before 4A-05 writes it - #189

Merged
PhysShell merged 1 commit into
mainfrom
claude/swang-exact-text-loss-layout
Aug 20, 2026
Merged

PhysShell merged 1 commit into
mainfrom
claude/swang-exact-text-loss-layout

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

A preflight for SWG-4A-05. Docs-only, one commit, one file, one section of
exact-score-text.md. No grammar vocabulary, no writer domain, no
diagnostics, no code.

The gap

§6.1's reference document shows exactly one warning — tempo_approximated,
inline. The other three variants are named by §2.8 and listed by §6.4, but
their outer layout appears nowhere, so the slice that has to emit them would
have had to guess.

That is the same gap that let SWG-4A-03 write a repeat across four lines
where §6.1 spells it on one. It cost a review round and a second RED→GREEN
pair to find from a byte-golden. Closing it before the code exists is
cheaper, and keeps the golden evidence of a rule rather than the rule itself.

What is settled

loss
  outer layout    multiline when the report is non-clean
                  omitted entirely when it is clean

warning element   one warning, one physical line

  track_name_invalid_utf8   inline payload block
  smpte_timing_unsupported  bare word, no block
  tempo_approximated        inline payload block
  other                     inline payload block

With an illustration exhaustive over all four variants, at §6.1's nesting.
Its track_index 4294967296 is deliberate: the normative example now shows
a u64 payload doing something a u32 could not, which is what SWG-CORE-01
closed H3 for.

Two things stated because they are the ones a writer gets wrong:

  • warning order is vector order, preserved exactly (§2.7). LossReport
    appends and concatenates, the exact walker compares positionally, and
    duplicates are duplicates. Nothing sorts, groups by variant, or dedupes.
  • other stays one physical line whatever its message holds. A U+000A in
    the value is \n under §6.5's frozen escape policy, never a real line
    break — so "one warning, one line" is a property of the grammar rather than
    a hope about the data.

What is not changed

The illustration is not folded into §6.1. That reference stays a single
coherent score: its one tempo_approximated belongs to the tempo 100/7
bar above it, and three unrelated warnings bolted on would make it less
readable while adding nothing this block does not already say.

Verified: 16 census witnesses green.

🤖 Generated with Claude Code

https://claude.ai/code/session_018vdRzztKXy8bA16tEzwgLE


Generated by Claude Code

…s it

Docs-only, one commit, one file, one section. No grammar vocabulary, no
writer domain, no diagnostics, no code.

§6.1's reference document shows exactly one warning — `tempo_approximated`,
inline. The other three variants are named by §2.8 and listed by §6.4, but
their outer layout was never shown anywhere, so the slice that has to emit
them would have had to guess. That is the same gap that let SWG-4A-03 write
a `repeat` across four lines where §6.1 spells it on one, and it is cheaper
to close now than to discover from a byte-golden afterwards.

Settled in §6.2, beside the empty-body rule it belongs with:

- `loss` is multiline when the report is non-clean, omitted entirely when it
  is clean;
- one warning is one physical line;
- `track_name_invalid_utf8`, `tempo_approximated`, and `other` are inline
  payload blocks; `smpte_timing_unsupported` is a bare word with no block.

With an illustration exhaustive over all four variants, at §6.1's nesting.

Two things stated because they are the ones a writer gets wrong:

- warning order is vector order, preserved exactly (§2.7). `LossReport`
  appends and concatenates, the exact walker compares positionally, and
  duplicates are duplicates. Nothing sorts, groups by variant, or dedupes;
- `other` stays one physical line whatever its message holds. A U+000A in
  the value is `\n` under §6.5's frozen escape policy, never a real line
  break — so "one warning, one line" is a property of the grammar rather
  than a hope about the data.

The illustration is deliberately not folded into §6.1. That reference stays
a single coherent score: its one `tempo_approximated` belongs to the
`tempo 100/7` bar above it, and three unrelated warnings bolted on would
make it less readable while adding nothing this block does not already say.

Refs SWG-4A-05

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

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e85da7ce-f3ba-4af8-98c7-7387ded084e8


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.

@PhysShell
PhysShell merged commit 0a6066f into main Aug 20, 2026
15 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