Skip to content

test(settings): pin parse/check/emit agreement on members and blocks - #466

Merged
Teakowa merged 3 commits into
mainfrom
test/issue-459
Oct 15, 2026
Merged

Teakowa merged 3 commits into
mainfrom
test/issue-459

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone check_emit_agreement test target (new [[test]] in crates/workshop-rs/Cargo.toml + tests/check_emit_agreement.rs, 10 tests) that runs parsed sources and producer-built Settings trees through parse → check → emit and asserts the accept/reject verdict is identical at every reachable stage, per #459.

Covered areas:

  • Hero settings members (fix(settings): reject hero settings members for slots the hero lacks #438 shape): slot-less members under a row-less hero (doctrine + enableAbility3/ability3Cooldown%/enablePassive) are rejected by check with the missing-slot diagnostic and fail emission with the missing-mapping error; the accepted counterparts (gameplay-name resolution, reviewed label rows, shared labels, carried raw members) pass both stages.
  • Catalogued vs uncatalogued keyed blocks (feat(settings): carry blocks under catalogued keys as written #413/feat(settings): emit pass-through member blocks verbatim at resolved positions #424 shapes): 9 position pairs (lobby, main, extensions, catalogued/uncatalogued modes, hero, team, top level, workshop) asserting identical verdicts for key { ... } blocks whether or not the key is declared; both stages reject the team-position cases (unknown hero).
  • Producer-only shapes: RawGroup pass-through at team/mode/top-level/hero positions vs resolved Group at the same positions, typed leaves inside carried blocks, misplaced Workshop/leaf nodes, kind mismatches — all asserted to agree.
  • Carried near-miss members warn (severity=Warning) while both stages accept; accepted sources emit text that reparses and re-passes check.

Disagreements found: none — the covered surface is currently consistent, so no source fix was needed.

Sensitivity proof (both directions, run before commit):

  • Dropping the unemittable_hero_member guard (src/settings/check.rs walk_heroes) → check accepts doctrine/enableAbility3 while emit still fails with missing setting mapping → 2 tests fail.
  • Reverting the carried-block arm to (Group\|RawGroup, None) in check_member → check rejects lobby/Map Rotation { } (does not match its table kind) while emit accepts → 4 tests fail.
  • Guard restored; suite green again.

Test plan

  • cargo test -p workshop-rs --test check_emit_agreement → 10 passed
  • cargo test -p workshop-rs --lib → 314 passed (settings_pipeline, audit_regressions, emitter, parser all green)
  • cargo test -p workshop-rs --test integration → 199 passed
  • cargo fmt --all -- --check → clean; cargo clippy --workspace --all-targets -- -D warnings → clean; git diff --check → clean

Fixes #459

Adds a standalone check_emit_agreement target that runs parsed sources and producer-built settings trees through parse -> check -> emit and asserts the accept/reject verdict is identical at every reachable stage.

Covered areas per #459: hero settings members (the #438 slot-guard shape and its accepted counterparts) and catalogued versus uncatalogued keyed blocks (the #413/#424 carried-block shapes), including the producer-only RawGroup pass-through marker and unwritable leaf shapes.

Sensitivity was verified in both directions before commit: dropping the hero-slot check guard makes check accept members emit still rejects, and reverting the catalogued carried-block arm makes check reject blocks emit still accepts; in both cases the new tests fail as designed.

No source changes were needed: the covered surface is currently consistent.

Fixes #459

@Teakowa Teakowa 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.

Reviewed line by line and verified locally: the new tests run green against the PR code, coverage matches the issue's acceptance criteria, and the documented sensitivity proofs hold.

# Conflicts:
#	crates/workshop-rs/Cargo.toml
# Conflicts:
#	crates/workshop-rs/Cargo.toml
@Teakowa
Teakowa merged commit 43b87aa into main Oct 15, 2026
5 checks passed
@Teakowa
Teakowa deleted the test/issue-459 branch October 15, 2026 10:31
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.

test: check and emit agree on accepted members and blocks

2 participants