Skip to content

Audit tools/lib/xmls/ comments (#225 Phase 2) - #235

Merged
kui merged 3 commits into
masterfrom
claude/issue-225-audit-tools-lib-xmls
Jul 10, 2026
Merged

Audit tools/lib/xmls/ comments (#225 Phase 2)#235
kui merged 3 commits into
masterfrom
claude/issue-225-audit-tools-lib-xmls

Conversation

@kui

@kui kui commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 2 for #225: audit tools/lib/xmls/ (5 files, 29 flagged comments). Drop all five from EXCLUDED_PATHS.

Per-comment disposition

Section dividers deleted (9 comments)

/* Raw XML types (encapsulated) */, /* Public types */, /* Public API */ markers in loot-xml.ts, materials-xml.ts, blocks-xml.ts — organizational cruft that modern editors (fold, outline view) already provide.

Converted to JSDoc (declaration-level)

Location Reason
rwgmixer-xml.ts District.previewColor field Documents the [0, 1] float range; en-dash range notation replaced with [0, 1] interval to satisfy the no-dash rule
rwgmixer-xml.ts parseRwgmixerXml function Describes XML shape and null-color behavior
prefab-xml.ts RawPrefabXml.property field Documents the @libs/xml single-child collapse quirk
prefab-xml.ts RawPrefabPropertyClass interface Nested-class recursion rationale
prefab-xml.ts ParsedPrefabProperty type Union variants
prefab-xml.ts isPrefabPropertyValue function Narrowing-helper purpose
blocks-xml.ts RawNestedProperty interface Why the recursive shape rather than a flat array
blocks-xml.ts Blocks.#downgradeRelations field Inverse-index semantics with a concrete example

Kept as marker

Location Marker
prefab-xml.ts fail-fast throw (in toEntry) WHY: — silent drops would hide schema drift; AGENTS.md requires tools/ to throw

Test plan

  • deno task ci:lint passes
  • deno task ci:fmt-check passes
  • deno task ci:type-check passes
  • deno task test — 41 tests / 241 steps pass

Progress

EXCLUDED_PATHS: 76 → 71.

kui added 3 commits July 10, 2026 22:57
Phase 2 for #225. Five XML-parser modules, 29 flagged comments.

Section-divider block comments deleted (/* Raw XML types */, /* Public
types */, /* Public API */) across loot-xml.ts, materials-xml.ts, and
blocks-xml.ts — organizational cruft that editor outlines already
provide.

Declaration-level rationale converted to JSDoc:
- rwgmixer-xml.ts: District.previewColor range and parseRwgmixerXml
  input shape / null-color behavior. En-dash range 0-1 replaced with
  [0, 1] to satisfy the no-dash rule.
- prefab-xml.ts: @libs/xml single-child collapse quirk on the raw
  property field; RawPrefabPropertyClass recursion; ParsedPrefabProperty
  union; isPrefabPropertyValue narrowing purpose.
- blocks-xml.ts: RawNestedProperty recursion; Blocks.#downgradeRelations
  inverse-index semantics with a concrete example.

Fail-fast throw in toEntry kept as WHY: linking to the AGENTS.md
tools/ fail-fast rule.

EXCLUDED_PATHS shrinks from 76 to 71.
WHY: markers should not repeat the project-level rules that live in
AGENTS.md; the reader can consult the rule directly. The single-clause
"silently dropping unknown shapes would hide schema drift in the source
XML" already carries the load-bearing rationale. Also removes the
semicolon-elaboration pattern flagged as an anti-pattern.
The throw is the standard exhaustiveness default for a variant sum,
and the AGENTS.md fail-fast rule applies to every throw in tools/ the
same way. The WHY: was restating a project-level convention at one
particular site, which invites the same restatement everywhere else
without adding local information.
@kui
kui merged commit 8da24d3 into master Jul 10, 2026
2 checks passed
@kui
kui deleted the claude/issue-225-audit-tools-lib-xmls branch July 10, 2026 15:12
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