Repository navigation
Accept spaces in ?terms= and match space/_/- insensitively - #50
Merged
Merged
Conversation
A caller relaying a person's own words asks for `white paper`, not `white_paper`; rewriting the request client-side would search for a token the person never said. The /context door previously 400'd any `terms` token with a space (ADR 0017 §3 grammar). - serve: `terms` tokens may contain interior spaces and are trimmed; other out-of-grammar characters still 400. - context::term_key: the lookup key — lowercased, runs of whitespace/ `_`/`-` folded to one `_` — used by resolve_terms, narrow_terms and resolve_semantic_matches, so `white paper`, `White-Paper` and `white_paper` all hit a `white_paper` term, alias or Ossie synonym. - is_addressable_token admits interior spaces, so spaced Ossie names and synonyms join the index; `datamk sync`'s warning reuses it. - is_model_token keeps `?model=`'s stricter no-space grammar for the OpenAPI enum, so the enum never offers a value that 400s. - definitions uniqueness is checked on term_key, so two names that would be unreachable from each other can't both be declared. - ADR 0017 §3 / ADR 0018 §7 amended. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
GET /context?terms=white%20paperwas a 400 (ADR 0017 §3 grammar). A caller relaying a person's own words asks forwhite paper, notwhite_paper; rewriting the request client-side would search for a token the person never said.termstokens may contain interior spaces and are trimmed; other out-of-grammar characters still 400.context::term_key: lookup key (lowercased, runs of whitespace/_/-folded to_) used byresolve_terms,narrow_terms,resolve_semantic_matches.white paper,White-Paper,white_paperall hit awhite_paperterm/alias/Ossie synonym.is_addressable_tokenadmits interior spaces so spaced Ossie synonyms join the index;datamk syncwarning reuses it.is_model_tokenkeeps?model='s stricter grammar for the OpenAPI enum.term_key.Tests: 917 + 33 pass, clippy and fmt clean.
🤖 Generated with Claude Code