Publish a component under the name the guard approved, not the padded one - #401
Open
kevin9327 wants to merge 1 commit into
Open
Publish a component under the name the guard approved, not the padded one#401kevin9327 wants to merge 1 commit into
kevin9327 wants to merge 1 commit into
Conversation
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 6, 2026 12:26
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What this changes
PUT /components/catalogueasks whether each announced component is more than whitespace, and thenpublishes the string it did not ask about:
For
title,kindanddescriptionthat is cosmetic. Fornameit is not, because a component'sname is its identity:
syncCataloguecompares it against aSetof names already published, so" weatherPanel "isnot
weatherPaneland a new row is addeddecide(name, agentId)andlistForAgentlook a component up by itSo a build that ships a name with a stray space publishes a second component beside the real one.
It is published and ungranted by anyone, it appears in the catalogue, and an administrator holding a
Bot back from
weatherPaneldoes not hold it back from the other one, because as far as every oneof those lookups is concerned they are different components. Nothing reports this; the announcement
returns
added: [" weatherPanel "]and the trail records that name as an arrival.The four fields are now stored as the strings the guard approved.
This is the same shape as #376 and #377 — validate the trimmed string, store the raw one — and the
fourth place it appears. #393 is the third and is still open; the two are independent files and
neither depends on the other.
Where it runs
which string is written into it.
replica, which is the point: today two replicas served by builds that differ by a space
publish two components.
syncCatalogueis additive and compares against what is in Postgres,so the row is shared and this makes the comparison agree across processes rather than depend
on which build's string arrived.
syncCatalogueis unchanged: it still readsthe published names and inserts only what is missing.
Boundary and audit
requireUserasbefore and its decision path is untouched.
component.publishedrow now carries the trimmed name, which is the name every other part ofthe system uses for it.
normalisation of what the build sent.
Changelog
CHANGELOG.mdunderUnreleased.Tests
server/tests/component-catalogue.test.ts, new, against a stub store that records what waspublished:
nameis published as the name, not as a second componenttitleanddescriptionare published as the reader will see themkindis published as the kindAgainst
main, three of the six fail:How I tested
Windows 11, Bun 1.3.14.
bun test server/tests/component-catalogue.test.ts server/tests/component-decision.test.tsis 11 passed, 0 failed.bun run --filter server typecheckandbunx biome checkare clean.