Skip to content

S3 — The two documents stop being able to disagree about the types they both describe - #28

Merged
The-Running-Dev merged 1 commit into
mainfrom
slice/S3
Aug 21, 2026
Merged

S3 — The two documents stop being able to disagree about the types they both describe#28
The-Running-Dev merged 1 commit into
mainfrom
slice/S3

Conversation

@The-Running-Dev

Copy link
Copy Markdown
Owner

Summary

Implements the mirror check: when 03-game-design.md chooses to describe a closed
declaration from 04-engine-specification.md in prose, a mirror-<QualifiedName>
declared region ties the two together, and Test-SpecSet.ps1 now catches drift
between them instead of relying on someone reading both at once.

  • Read-SpecSet.ps1 gains general declared-region extraction (<!-- id:declared:start --><!-- id:declared:end -->), reporting MalformedRegion for unclosed,
    mismatched, or nested markers and DuplicateRegionId for a repeated id within one
    document. Regions whose id starts mirror- become MirrorObligation records, each
    carrying the set of member names its body mentions (text after the first colon,
    identifier tokens only).
  • Test-SpecSet.ps1 gains Get-MirrorFindings: for each obligation, a missing
    declaration or an open one is a finding; for a closed one, a member the declaration
    has but the body doesn't mention (or vice versa) is a finding. SpecFinding carries
    no field for which side is stale (SS11) — Detail only states disagreement.
  • 03-game-design.md §3.1 now carries mirror-NeedState and mirror-AttributeState
    regions around the needs and attributes sentences, held against 04 as it stands.
    §3.5's twelve skills are untouched — skills are an open declaration, so nothing
    obligates them and no finding fires there.
  • Write-SpecSetReport states the mirror-obligation count checked and never claims
    the two documents are consistent (SS16).

Decisions made that the contract didn't determine

  • S3.1/S3.6's "exits 0" is read at the check level (Get-MirrorFindings returns
    zero findings against the real corpus), not tools/Test-SpecSet.ps1's own exit
    code. The script's exit code is still 2 (NotEvaluated/RegisterAbsent) against the
    real corpus — a pre-existing, unrelated gap (no provisional-register region yet;
    that's S5's scope) already flagged before this slice. Requiring literal exit 0 from
    the CLI would mean this slice silently absorbing S5's work, which Out of scope
    forbids.
  • DuplicateRegionId is scoped per-document, matching the contract's literal
    "within one document, an id occurs at most once" — not a global cross-document
    uniqueness rule.
  • S3.10 (contract scaffold → pointer) needed no change: design/20-contract.md's
    tools/Test-SpecSet.ps1 section was already a pointer with no scaffold block: no
    commit touches that file.

Acceptance criteria

  • S3.1 — mirror-NeedState/mirror-AttributeState regions in §3.1, held against
    04 as it stands, zero mirror findings
  • S3.2 — deleting wisdom from §3.1 (04 unchanged) produces exactly one finding
    naming AttributeState.wisdom; restoring returns clean. Both directions tested
    against a copy of the real corpus.
  • S3.3 — Detail names the member and both document paths; SpecFinding has no
    stale-side field (reflection-tested)
  • S3.4 — an obligation naming an open declaration, or one that doesn't exist,
    raises a finding
  • S3.5 — §3.5's twelve skills raise no finding of any kind
  • S3.6 — malformed markers → MalformedRegion/exit 2; duplicate id →
    DuplicateRegionId/exit 2; no regions → valid, zero obligations
  • S3.7 — AST test asserts no check function calls a file cmdlet or another check
    function
  • S3.8 — report states the obligation count checked, never claims consistency
  • S3.9 — ./docs.ps1 -BuildOnly succeeds (verified). Could not additionally
    confirm the rendered §3.1 list at runtime — docker run's TTY attach fails in this
    sandbox, unrelated to the change; markers are plain HTML comments carrying nothing
    outside the delimiters.
  • S3.10 — already a pointer; no scaffold remained to replace

Verified

Not yet run — this section will be replaced by /pr's gate phase.

Adds declared-marker region extraction to Read-SpecSet.ps1 (mirror-<QualifiedName>
obligations, MalformedRegion/DuplicateRegionId failures) and a mirror check to
Test-SpecSet.ps1 that reports a closed declaration's members missing from its
region body, or named in the body but not on the declaration. 03-game-design.md
§3.1 carries mirror-NeedState and mirror-AttributeState regions held against 04.
@The-Running-Dev
The-Running-Dev merged commit 4049e58 into main Aug 21, 2026
1 check failed
@The-Running-Dev
The-Running-Dev deleted the slice/S3 branch August 21, 2026 19:41
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