Skip to content

fix(architecture): empty-TOML-members → absent + gitattributes union negative-scope test#578

Merged
TheMostlyGreat merged 2 commits into
mainfrom
fix/post-merge-review-nits
Jun 30, 2026
Merged

fix(architecture): empty-TOML-members → absent + gitattributes union negative-scope test#578
TheMostlyGreat merged 2 commits into
mainfrom
fix/post-merge-review-nits

Conversation

@TheMostlyGreat

Copy link
Copy Markdown
Collaborator

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)

detectPackageJsonWorkspaces treats workspaces: [] as absent (an explicitly-empty member list declares no members — test U8), but the Cargo/uv detectors routed members = [] through readTomlTableArrayundefinedunreadable, a spurious "present-but-unparseable" advisory.

  • New isTomlTableEmptyArray in the shared TOML reader distinguishes a well-formed empty [] from a genuinely malformed value (a string, or an array left unclosed) — both of which readTomlTableArray also collapses to undefined. Zero ripple to the reader's three existing consumers (the array-entry contract is unchanged).
  • detectCargoWorkspace / detectUvWorkspace downgrade only a confirmed-empty array to absent; malformed/unclosed member lists stay unreadable (U2/U3 unchanged).
  • Scoped to the TOML detectors the review named; pnpm/go.work keep their existing semantics.
  • Tests: U12 (Cargo) + U13 (uv) integration cases, plus direct isTomlTableEmptyArray unit tests (empty / non-empty / malformed-string / unclosed / absent / table-scoped).

Nit 2 — gitattributes merge=union negative-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 *.md glob, and lockfiles are explicitly never union-merged — regression insurance against a future over-broad pattern.

Verification

  • tsc --noEmit clean (0 errors), eslint clean.
  • 99 tests green across toml / architecture-monorepo / cargo-manifest / pyproject-manifest / gitattributes-merge-union.

🤖 Generated with Claude Code

vsajan and others added 2 commits June 30, 2026 11:32
…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>
@TheMostlyGreat TheMostlyGreat merged commit 543b24c into main Jun 30, 2026
2 checks passed
@TheMostlyGreat TheMostlyGreat deleted the fix/post-merge-review-nits branch June 30, 2026 18:54
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.

2 participants