Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ go/ Go module `github.com/4matic/trackparse/go`, package `
AllArtists, Parser/NewParser, ParseTracklist(With), ApplyEdits(With);
invalid UTF-8 is sanitized here (WHATWG maximal subparts to U+FFFD)
doc.go package overview shown on pkg.go.dev
LICENSE a copy of the root MIT license: the module zip holds only go/, and
pkg.go.dev hides the docs of a module without a license it can detect
types.go public structs and typed-string enums (mirror the schemas); nullable
fields are pointers
options.go ParseOptions, FormatOptions, Keywords, TracklistOptions (zero value = the
Expand Down Expand Up @@ -189,7 +191,7 @@ scripts/dump_py.py Python side of compare-ports (JSONL in, to_dict() JSON
.github/release-notes/ optional hand-written highlights prepended to a GitHub Release
release-please-config.json, .release-please-manifest.json release automation (never hand-edit the manifest)
js/CHANGELOG.md, spec/CHANGELOG.md, python/CHANGELOG.md, rust/CHANGELOG.md, go/CHANGELOG.md
generated by release-please (go/CHANGELOG.md from the first Go release on)
generated by release-please
```

## Golden rule
Expand Down Expand Up @@ -478,6 +480,27 @@ matching site pages (`README.md`, `js/README.md`, `python/README.md`, `rust/READ
when a page or heading moves. Use full `https://4matic.github.io/trackparse/...` URLs: npm, PyPI,
crates.io and pkg.go.dev render the package READMEs where relative links break.

**Link the first mention.** In each section of a README or a site page, link the first mention of
a rule, option, field, warning or function to the place that explains it, and only the first:

- a site page and heading anchor (`reference/functions/#formattrack-options`,
`guides/artists/#knownartists`); warnings use the text fragments described under
[Site internals](#site-internals-worth-knowing);
- a spec rule on the generated spec page, `reference/spec/#r6-artisttitle-separator`. Only the
rule groups (`## R6 …`) and the R13 subsections (`#r132-times`, `#r1310-options`) have anchors;
a rule such as R6.10 links its group;
- the API docs of that language: docs.rs item pages
(`https://docs.rs/trackparse/latest/trackparse/fn.parse_with.html`,
`…/tracklist/enum.Edit.html`, `…/struct.ParsedTrack.html#method.to_json`) and pkg.go.dev
anchors (`https://pkg.go.dev/github.com/4matic/trackparse/go#ParseWith`, `#Track.MarshalJSON`).
Check the anchor on the live page; pkg.go.dev ids are the identifier, `Type.Method` for methods.

Give an example a prefilled playground link when seeing the whole output helps ("try it", "open
this list in the playground"). The hash is `#track=<input>` with optional `mode`, `splitAnd`,
`known` and `uploader`, or `#list=<text>` with optional `audioSeconds` and `known`; each value is
`encodeURIComponent`-encoded, and in Markdown also encode `(`, `)` and `'` (`%28`, `%29`, `%27`)
so the link target stays intact. Open the link once to check it shows what the text claims.

**Moving or removing a page.** npm (`homepage`), PyPI (`[project.urls]`) and published READMEs point
at site URLs that can't be changed after a release. When a page moves or disappears, add a
`redirects` entry in `site/astro.config.mjs` so the old URL keeps working, then update the
Expand Down Expand Up @@ -798,7 +821,7 @@ Version rules:
retries (`GOPROXY=https://proxy.golang.org go list -m github.com/4matic/trackparse/go@vX.Y.Z`),
runs `go get` and a small program from a clean module, requests the version's `.info` from the
proxy (pkg.go.dev adds versions it sees there; the page can take a few minutes), and appends
install notes to the GitHub Release. **A published Go version is permanent**: the proxy and the
install notes to the GitHub Release. The 0.6.0 release was the first to run it, and it passed. **A published Go version is permanent**: the proxy and the
checksum database keep the tag's content forever, even if the tag is deleted or moved. Never
move or re-create a `go/v…` tag. A bad version can only be marked with a `retract` directive in
`go/go.mod`, released in a new version.
Expand All @@ -808,7 +831,7 @@ Version rules:
`-f rust_tag=rust-vX.Y.Z` (crates.io) or `-f go_tag=go/vX.Y.Z` (the Go checks, proxy request
and release notes; the module itself was published by the tag). The npm job always republishes from a fresh release; a
failed npm publish needs the same treatment by hand.
- **Things the 0.5.0 release taught:**
- **Things the 0.5.0 and 0.6.0 releases taught:**
- The release PR is opened with `GITHUB_TOKEN`, so no CI runs on it and GitHub shows it as
`UNSTABLE`. That is expected; `main` was green when it was generated.
- A `docs:` commit under `js/`, `python/`, `rust/` or `go/` (a package README) opens a release PR. A
Expand All @@ -819,8 +842,15 @@ Version rules:
- After a release, check every registry by API, not by badge: `registry.npmjs.org`,
`pypi.org/pypi/trackparse/json`, `crates.io/api/v1/crates/trackparse`, and the Go proxy:
`proxy.golang.org/github.com/4matic/trackparse/go/@v/list`.
- The Go component's first changelog links `go/v0.5.1...go/vX.Y.Z`, a tag that never existed
(the manifest starts Go at the linked 0.5.1), as rust's first entry linked `rust-v0.4.0`.
- The Go component's first changelog (0.6.0) links `go/v0.5.1...go/v0.6.0`, a tag that never
existed (the manifest started Go at the linked 0.5.1), as rust's first entry linked
`rust-v0.4.0`. Leave it: changelogs are not edited by hand, and the next entry links real tags.
- pkg.go.dev shows a module's documentation only when it detects a license file in the module
zip, and the zip of a module in `go/` holds only that folder: the root `LICENSE` is not in it.
`go/LICENSE` is a copy of it; keep the two the same. Since the zip of a published version
never changes, a missing license can only be fixed by a new version.
- Go has no registry badge with a version. The root README's "go module" badge reads the GitHub
tags (`github/v/tag/4matic/trackparse?filter=go%2Fv*`) and shows the whole tag, `go/v0.6.0`.
- Don't force-push a PR branch to pick up `main`: GitHub's rebase-merge rebases it when there
are no conflicts.
- **Agents never merge release PRs, publish, push tags or bump versions on their own initiative.**
Expand Down
Loading
Loading