Repository navigation
Conversation
A read that finds far fewer items than the read before, or none, or a living page without one of its source's anchors, fails with plugin.ErrShapeChanged: never stored, never read as removals. Shape.NothingToRead turns a run of releases with nothing to read into the same signal for whoever runs a versioned source. Anchors declared, checked on the live pages, for OpenAI, Anthropic, Gemini, Vertex AI, GitHub Actions, Cloudflare and Salesforce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
|
Claude finished @adssib's task in 1m 46s —— View job ✅ Ready to merge (after #255): the shape guard is sound, every kind implements it, the registry enforces it, all goldens are unchanged, and every check passes locally. Rules
BugsNone found. What I traced:
Verified
Non-blocking (optional)
Nice work. The tests for redesigned, shrunken and moved inputs in each kind make the guard easy to trust. |
Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
…gs; when a drop is real Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
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.
Stacked on #255 (the openai/models fix): review that one first; this PR's diff is against its branch.
Closes #252 · Closes #253 · Closes #254 · Part of #250
What this changes
A source that changes its layout now fails loudly with a typed error,
plugin.ErrShapeChanged, in every kind, instead of reading as "nothing changed" or, worse, as removals. Nothing from a refused read is stored or turned into events.The shape guard (
core/plugin/shape.go). A source'splugin.Sourcegets aShape(zero: the kind's defaults).RegisterProviderhands it to the plugin throughplugin.Guarded.WithShapeand refuses a plugin that doesn't implement it, so every kind runs the guard:notices.DefaultMinRatio, was the retirements-onlyShapeGuard)feed.Feed.MinRatio: a feed's window can shrink)A read with fewer than the ratio of the read before fails (compared when the read before had at least
plugin.MinItemsCompared= 10), and so does a read with none after one with any. A source can set its ownMinRatio, with a comment saying why.Nothing to read, release after release (#254).
Shape.NothingToRead(read []bool)is for whoever runs a versioned source: the newestNothingToReadAfter(default 3) releases in a row withErrNothingToRead, after one that had something, isErrShapeChanged(wrapping it, notErrNothingToRead). A source that has never had anything to read isn't flagged. The hosted ingestion service calls it per source; it's tested here with a moved changelog (release notes) and a migration guide that stops being found.Anchors (#253). A living source declares one or two entries in
provider.go, by hand, each with where it is and the date checked; a read without one fails. Declared and checked on the live pages today (2026-11-21):gpt-4-0613,gpt-3.5-turbo-0301claude-3-opus-20240229,claude-2.1gemini-2.0-flash,embedding-001gemini-1.5-pro-002,text-bisonUse Case: actions - GitHub ChangelogChangelog | API deprecations20.0,30.0(the live page answers 403, so checked on the Wayback Machine's capture of 2026-11-20, which is what the plugin reads when blocked)Feeds drop their oldest entries, so an entry can't be an anchor; the feed's own title says the URL still serves that feed.
kit.NoticesgainsHas(entry)(retire: a model id; eol: a version or a row label; feed: the feed's title or an entry's title);extract.FeedTitlereads a feed's title.A living page whose reader finds nothing to read is now
ErrShapeChangedtoo (it was a plain error).Tests
kinds/notices/shape_test.go(renamed column, no table, a feed's lower ratio, anchor gone, anchor checked on a first read),kinds/openapi/shape_test.go,kinds/changelog/shape_test.go(moved and reformatted changelog, JSON changelog, release notes run),kinds/catalog/shape_test.go,kinds/apisurface/shape_test.go,kinds/migrationguide/shape_test.go;core/plugin/shape_test.goand the registry's refusals (no guard, an undated anchor, three anchors, ratio above 1).noticestest.Goldenreads every saved page with the registeredShape, so each declared anchor must be on the saved copy too (it is, for all seven); Salesforce's golden test does the same.make checkpasses (go1.27.1).Checklist
Shapeon seven sources, and I read the words of each anchor's comment.git commit -s, DCO)testdata/README.md: Not applicable, no saved file addedprovider.go, next to the source, with where and when checkedproviders/<provider>/; a kind imports no providerenv.Get/core/kit/make checkpasses locally (make pluginsunchanged:Shapeisn't in the list)Notes for the reviewer (calls I made)
*Shapeis nil untilWithShape). Golden tests read trimmed copies, far smaller than real releases (several trimmed spec and wheel pairs read as "most operations gone"), so turning the guard on for them would have meant rewriting goldens. Registered plugins, which is what the hosted ingestion service runs, are always guarded; each kind has its own guard test.provider.go. Below 10 items, only "none after some" is checked: a few legitimate removals are a large share of a small list.RegisterProviderrefuses them on a versioned one.docs/writing-a-plugin.mdexplains the guard,NothingToReadand anchors;AGENTS.mdanddocs/how-it-works.mdname them.Related PRs
source-healthissue in this repo useErrShapeChangedandShape.NothingToReadonce a release carries them.🤖 Generated with Claude Code