Skip to content

Document x/ experimental packages and components.JoinAttrs in AGENTS.md - #338

Open
maragubot wants to merge 3 commits into
maragudk:mainfrom
maragubot:garden/document-x-packages-and-joinattrs
Open

Document x/ experimental packages and components.JoinAttrs in AGENTS.md#338
maragubot wants to merge 3 commits into
maragudk:mainfrom
maragubot:garden/document-x-packages-and-joinattrs

Conversation

@maragubot

Copy link
Copy Markdown
Contributor

What was found

AGENTS.md is the guide loaded into every AI assistant that works on this repo, since CLAUDE.md symlinks to it. Its Project Structure section had drifted from the packages that actually exist:

  • The x/ experimental packages were missing entirely. x/slices landed in Add x/slices package with Map, Filter, and Reduce #284 on 2026-01-08, after AGENTS.md was written on 2025-09-24, and the section was never updated. This also put AGENTS.md at odds with the readme, which already documents gomponents/x/... as experimental.
  • The components/ entry named only HTML5 and Classes, never components.JoinAttrs (added in Add components.JoinAttrs #262).

What was fixed

Added an x/ bullet and listed components.JoinAttrs, so the section matches what's on disk.

Also scoped one Code Style bullet from "Maintain backwards compatibility" to "Maintain backwards compatibility in the core library". Without that, the new x/ bullet's "may get breaking changes" would contradict it, and an assistant would read a blanket prohibition the project doesn't intend. The file already scopes this way two lines up ("No external dependencies in core library") and under Contributing Guidelines.

Review notes

Two rounds of self-review caught real errors, both now fixed: the first draft described components.JoinAttrs as joining attributes "across nodes", which implies a tree traversal it doesn't do (it only merges attributes among the child nodes passed to it); and a later draft labelled the x/slices helpers "index-aware", which is false for slices.Reduce, whose callback is func(T2, T1) T2 with no index.

Deliberately left for a later gardening pass:

  • LLMs.md has the same two gaps in its own Package Structure section. Another change is in flight against that file, so this one stays out of it.
  • internal/assert and internal/import are still absent from the list. They're test-only scaffolding, and that omission predates this change.

…NTS.md

The project structure section listed neither the `x/` packages nor
`components.JoinAttrs`, so the guide read as if they didn't exist and
contradicted the readme, which already documents `x/...` as experimental.
Say that `components.JoinAttrs` merges attributes among a node's direct
children, since "across nodes" suggested a traversal it doesn't do. Scope the
backwards-compatibility rule to the core library, so it no longer reads as a
blanket prohibition on the experimental `x/` packages.
`slices.Reduce` takes a `func(T2, T1) T2` callback with no index, unlike
`slices.Map` and `slices.Filter`, so the label was wrong for one of the three.
Describe the package as generic slice helpers instead, matching its own package
comment.
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (76f04c0) to head (8625c28).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #338   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          639       639           
=========================================
  Hits           639       639           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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