S3 — The two documents stop being able to disagree about the types they both describe - #28
Merged
Conversation
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.
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the mirror check: when
03-game-design.mdchooses to describe a closeddeclaration from
04-engine-specification.mdin prose, amirror-<QualifiedName>declared region ties the two together, and
Test-SpecSet.ps1now catches driftbetween them instead of relying on someone reading both at once.
Read-SpecSet.ps1gains general declared-region extraction (<!-- id:declared:start -->…<!-- id:declared:end -->), reportingMalformedRegionfor unclosed,mismatched, or nested markers and
DuplicateRegionIdfor a repeated id within onedocument. Regions whose id starts
mirror-becomeMirrorObligationrecords, eachcarrying the set of member names its body mentions (text after the first colon,
identifier tokens only).
Test-SpecSet.ps1gainsGet-MirrorFindings: for each obligation, a missingdeclaration 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.
SpecFindingcarriesno field for which side is stale (SS11) — Detail only states disagreement.
03-game-design.md§3.1 now carriesmirror-NeedStateandmirror-AttributeStateregions around the needs and attributes sentences, held against
04as it stands.§3.5's twelve skills are untouched — skills are an open declaration, so nothing
obligates them and no finding fires there.
Write-SpecSetReportstates the mirror-obligation count checked and never claimsthe two documents are consistent (SS16).
Decisions made that the contract didn't determine
Get-MirrorFindingsreturnszero findings against the real corpus), not
tools/Test-SpecSet.ps1's own exitcode. The script's exit code is still 2 (
NotEvaluated/RegisterAbsent) against thereal corpus — a pre-existing, unrelated gap (no
provisional-registerregion 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 scopeforbids.
DuplicateRegionIdis scoped per-document, matching the contract's literal"within one document, an id occurs at most once" — not a global cross-document
uniqueness rule.
design/20-contract.md'stools/Test-SpecSet.ps1section was already a pointer with no scaffold block: nocommit touches that file.
Acceptance criteria
mirror-NeedState/mirror-AttributeStateregions in §3.1, held against04as it stands, zero mirror findingswisdomfrom §3.1 (04 unchanged) produces exactly one findingnaming
AttributeState.wisdom; restoring returns clean. Both directions testedagainst a copy of the real corpus.
Detailnames the member and both document paths;SpecFindinghas nostale-side field (reflection-tested)
raises a finding
MalformedRegion/exit 2; duplicate id →DuplicateRegionId/exit 2; no regions → valid, zero obligationsfunction
./docs.ps1 -BuildOnlysucceeds (verified). Could not additionallyconfirm the rendered §3.1 list at runtime —
docker run's TTY attach fails in thissandbox, unrelated to the change; markers are plain HTML comments carrying nothing
outside the delimiters.
Verified
Not yet run — this section will be replaced by
/pr's gate phase.