Repository navigation
fix(jsonapi)!: server error codes never collide with store variants - #208
Merged
Merged
Conversation
…ktick The cliff.toml preprocessor joined any backtick-led line onto the line before it, including the blank line after the subject, so such a commit no longer parsed and git-cliff dropped it. It now joins only a line that continues a non-empty one. RELEASE.md names git-cliff's footer parser as the source of the trailer hazard.
Each acceptance criterion names the PRs that met it. The Transport criterion records its deviations: a paginated module's xCount() is gone, junction add and remove resolve Promise<null>, and a lone list_X takes no page. The roadmap's M4 note states the deviation, ADR 0004 points at the epic for decisions 10-12 and at ADR 0006 for the schema argument, and ADR 0006 no longer credits #197.
An entity named Relationship or RelatedResource could not build: its required NotFound variant had the code of one the server raises itself. The codes are now no_such_relationship and no_such_related_resource, a test pins that no ontogen code ends in a store suffix, and the code clash check runs only when the build generates the HTTP server. ErrorCode::ALL is a slice. The wire contract's §16 EventSource reason and id-rule row are corrected. BREAKING CHANGE: ontogen-jsonapi renames ErrorCode::RelatedResourceNotFound and ErrorCode::RelationshipNotFound to NoSuchRelatedResource and NoSuchRelationship (codes no_such_related_resource and no_such_relationship), and ErrorCode::ALL is a &'static [ErrorCode].
…order An OKF vaults section lists every 0.8.0 break from the OKF epic. A where-to-start list orders the sections, the ontogen-jsonapi 0.1 changes get their own subsection, and the page's statements on list order, the Transport changes, link query order, odd ids, IdRequired and the u32 migration match the code.
Deploying ontogen with
|
| Latest commit: |
d27db20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9cf608c8.ontogen.pages.dev |
| Branch Preview URL: | https://fix-pre090-release-prep.ontogen.pages.dev |
The epic and roadmap list all five Transport deviations, IdRequired is scoped the same way in every guide and the contract, the upgrading page lists its sections in page order and splits the TypeScript section by surface, and src/lib.rs no longer says open_vault or MarkdownIoOutput carry the id strategy. The cliff.toml preprocessor also joins CRLF continuation lines.
Open
This was referenced Oct 5, 2026
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.
Release prep for 0.9.0, from the post-merge audit of the M4 PRs: a changelog bug, an error-code collision, and the gaps in the 0.9 migration docs.
What changed
Changelog keeps every commit (
cliff.toml,RELEASE.md)The commit preprocessor
\n()also matched the blank line after the subject when a body paragraph opened with a backtick. The joined message no longer parsed as a conventional commit, and git-cliff dropped it. It is now([^\r\n])\r?\n()->$1 $2, which joins only a backtick-led line that continues a non-empty line, with LF or CRLF endings.Measured on the full history at the first push (543 commits,
git cliff --context):71d76ce(fix(servers)!).BREAKING CHANGE:footer of feat(servers)!: custom ops, junction ops, entity-less CRUD and event frames speak JSON:API #201 renders whole: one entry, and its text matches the commit message.\r, and no preprocessor split the footer.RELEASE.mdnow says the trailer hazard is git-cliff's footer parser, not git. That parser treats any continuation line starting withtoken:ortoken #as a new trailer. A backtick-led continuation line is joined automatically, and a blank line before a backtick-led paragraph is safe.JSON:API error codes never collide with store variants
An entity named
RelationshiporRelatedResourcecould not build. Its requiredAppError::{Entity}NotFoundhas the coderelationship_not_foundorrelated_resource_not_found, and those are codes the server raises itself.check_codesrefused the clash even in builds with no HTTP server.relationship_not_found->no_such_relationshipandrelated_resource_not_found->no_such_related_resource. TheErrorCodevariants are renamed to match, and the helperrelationship_not_found()is nowno_such_relationship()._not_found,_id_required,_already_exists,_parent_required). A unit test pins this overErrorCode::ALL, using the suffix tablestatus_foralready uses (nowSTORE_SUFFIXES).ErrorCode::ALLis a&'static [ErrorCode], so adding a code no longer changes its type.check_codesruns only when anHttpAxumgenerator is configured. IPC-only and MCP-only builds are not refused.*-wire.mdxpage shows either code, so none needed re-capturing.Upgrading page
ontogen-v0.8.0:type_namedefault flip;typestamped on create and on every real update, and theFlatfiltering bytype(untyped records are listed by every entity until stamped);typekey is a build error, and other OKF keys warn;gen_markdown_io(&SchemaOutput, …);okf: OkfOptionsonMarkdownIoConfig/MarkdownIoOptions(neither implementsDefault);MarkdownIoOutputfield removals;gen_frontmatter::generateremoved;index.md/log.mdnot listed;generatedstamps;open_vault/with_okfversus a hand-builtVaultHandle::new;FieldDef.frontmatter_name.ontogen-jsonapichanges moved. The paragraph listing them sat inside a build-configuration subsection.ontogen-jsonapi0.1.0 was published (tagontogen-jsonapi-v0.1.0, 2026-10-03), so it is not deleted. It moves into its own subsection, "Code that callsontogen-jsonapi0.1 directly", which also records this PR'sErrorCodechanges.sort".Transportexceptions. The page said "three exceptions". Diffinggenerate_transport_interfaceagainstontogen-v0.8.0gives six, and the page now lists them at the top of the TypeScript section, which is split into HTTP, IPC and bindings paragraphs:xCount();Promise<null>;list_Xtakes no page;querywhen the*Querystruct has a required field;Query/Inputkeeps its own name;options, which points to Sorting..,..and"". The page said such rows "must be renamed before you upgrade", which was unsupported. They stay reachable through the store, API, IPC and MCP. Over HTTP,""has no route, and./..are reachable only from a client that does not normalise the path. Both were probed and are the same as in 0.8. A vault never could hold them.{Entity}IdRequiredis needed for markdown entities and for SeaORM entities underProvided/SlugFromField, not for every entity. The same qualifier is applied in the server-transports and store-layer guides, the adding-a-new-entity cookbook and contract §13.4.<table>/<column>placeholders. The old example column (workout_set.reps) is ani32, and no example has au32field.EntityRecords::create, which did not exist in 0.8.0, as changed.Planning docs and contract drift
Transportcriterion records five deviations besides the listoptions, verified in the generator againstontogen-v0.8.0:xCount()(feat(servers)!: custom ops, junction ops, entity-less CRUD and event frames speak JSON:API #201);Promise<null>(feat(servers)!: custom ops, junction ops, entity-less CRUD and event frames speak JSON:API #201);list_Xtakes no page (feat(servers)!: relationships are served at their JSON:API endpoints #203);*Querystruct has a required field takes a requiredquery(feat(servers)!: list filters are the JSON:API filter family #202);QueryorInputwithout ending inQuerykeeps its own name (feat(servers)!: list filters are the JSON:API filter family #202).EventSourcereason is corrected:EventSourcesendstext/event-stream, and the event routes skip negotiation..".&SchemaOutput.Breaking changes
ontogen-jsonapi0.1.0 callers. For anyone using the crate directly, theErrorCodevariant renames and the type ofALLare breaks. The crate goes to 0.2.0 in the release PR. Hence the!and one footer below; the upgrading page's "Code that callsontogen-jsonapi0.1 directly" has the migration.Snapshots and examples
servers_jsonapi_ops_http,servers_jsonapi_ops_scoped_httpandservers_jsonapi_resources_httpchange only in the error import line and the fiveno_such_relationship(...)calls.markdown-pilot's two HTTPgenerated.rsfiles, and the HTTPgenerated.rsof iron-log, iron-log-md, notes-kb and tasks-tracker.Also:
src/lib.rsrustdoc no longer saysopen_vaultorMarkdownIoOutputcarry the id strategy. Contract §13.4 states the suffix rule as one every new code must keep, enforced byno_ontogen_code_ends_in_a_store_suffix, and notes a new code can still clash with a consumer's own non-store variant. The OKF section says what a null or emptytypedoes: null is untyped,""is a string other than the entity's.Tests added
Each was checked to fail before the fix.
servers::error_map::tests::no_ontogen_code_ends_in_a_store_suffixservers::error_map::tests::store_variants_of_relationship_named_entities_pass_the_code_checkbuilder_checks_app_error_codes_only_for_an_http_server(tests/builder.rs)builder_http_code_check_accepts_store_variants_of_relationship_named_entities(tests/builder.rs; it generates no routes, so it proves the code check only)Not in this PR
Verification
just full-checkpasses.just regen-examplesleaves no drift.upgrading.mdxand the two guides compile with@mdx-js/mdx, and every in-page anchor resolves.Squash commit message