fix(architecture): empty-TOML-members → absent + gitattributes union negative-scope test#578
Merged
Merged
Conversation
…sent A Cargo `[workspace] members = []` or uv `[tool.uv.workspace] members = []` was surfaced as a present-but-unparseable workspace (UWP4XK), while the package.json analogue `workspaces: []` is correctly treated as absent (U8) — an explicitly-empty member list declares no members, it is not a parse failure. Add `isTomlTableEmptyArray` to the shared TOML reader (it distinguishes a well-formed empty `[]` from a malformed value — a string, or an array left unclosed — that `readTomlTableArray` also collapses to `undefined`) and use it in the Cargo + uv detectors to downgrade only a confirmed-empty array to absent. Malformed/unclosed member lists stay `unreadable` (U2/U3 unchanged). Scoped to the TOML detectors the review flagged; pnpm/go.work keep their existing YAML/directive semantics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…artifacts The #569 review noted the suite proved union applies to the generated docs but had no negative-scope assertion that it does NOT leak to a hand-authored file. Add one: every managed union line must target a generated/derived artifact, and ARCHITECTURE.md, a blanket `*.md` glob, and lockfiles are explicitly never union-merged — cheap regression insurance against a future over-broad pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 1, 2026
Merged
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.
Two small follow-ups from the post-merge eng-reviews of #561 and #569 (both non-blocking nits the reviewers flagged).
Nit 1 — empty TOML
members = []is absent, not unreadable (#561 review)detectPackageJsonWorkspacestreatsworkspaces: []as absent (an explicitly-empty member list declares no members — test U8), but the Cargo/uv detectors routedmembers = []throughreadTomlTableArray→undefined→ unreadable, a spurious "present-but-unparseable" advisory.isTomlTableEmptyArrayin the shared TOML reader distinguishes a well-formed empty[]from a genuinely malformed value (a string, or an array left unclosed) — both of whichreadTomlTableArrayalso collapses toundefined. Zero ripple to the reader's three existing consumers (the array-entry contract is unchanged).detectCargoWorkspace/detectUvWorkspacedowngrade only a confirmed-empty array to absent; malformed/unclosed member lists stayunreadable(U2/U3 unchanged).isTomlTableEmptyArrayunit tests (empty / non-empty / malformed-string / unclosed / absent / table-scoped).Nit 2 — gitattributes
merge=unionnegative-scope test (#569 review)The suite proved union applies to the generated docs but had no assertion it does not leak. Added one: every managed union line must target a generated/derived artifact, and
ARCHITECTURE.md, a blanket*.mdglob, and lockfiles are explicitly never union-merged — regression insurance against a future over-broad pattern.Verification
tsc --noEmitclean (0 errors), eslint clean.🤖 Generated with Claude Code