Skip to content

docs(models): namespace registration API + document routing & fallback#558

Merged
heskew merged 5 commits into
mainfrom
docs/models-namespacing-routing
Jul 1, 2026
Merged

docs(models): namespace registration API + document routing & fallback#558
heskew merged 5 commits into
mainfrom
docs/models-namespacing-routing

Conversation

@heskew

@heskew heskew commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Corrects the model-extension docs to match what shipped in v5.1.15, and documents routing.

  1. Namespacing — the merged docs (docs(models): document registerBackend / defineBackend custom backends #554) describe registerBackend / defineBackend as standalone harper exports/globals, but v5.1.15 ships them as methods on models (the free-global form was added and removed within the same release and was never in a tagged version). Corrected in reference/models/backends.md + api.md (signatures, example, and the "exported from harper" claim → models.registerBackend(...) / models.defineBackend(...)).
  2. Routing & fallback (new reference/models/routing.md, v5.1.15) — fallback: config groups, capability routing (opts.requires + tools auto-require), fallback-on-error (primary error surfaced, abort short-circuits, no mid-stream fallback), and custom routers (models.registerRouter). Adds a requires option row to the embed/generate tables, overview + sidebar cross-links.

Notes

  • No breaking-change / release note. All of this shipped in v5.1.15, and the free-global registration form was never in a released version (globals.js has no registerBackend in any v5.1.x tag) — so there is nothing to break for users.
  • Only the live (unversioned) reference/ docs are touched; nothing versioned/released.
  • The preview deploy validates the cross-links.

Refs harper #1326, #1534, #1537. Companion to #554 (registration) / #556 (config backends).


🤖 Generated with Claude Code

The merged registration docs describe the free-global `registerBackend` /
`defineBackend` form that 5.2 removed; correct them to the `models.`-namespaced
methods, and add a Routing & Fallback page for the pluggable routing shipped in
harper #1326 / #1537.

- reference/models/backends.md, api.md: registerBackend/defineBackend are methods
  on `models` (not standalone `harper` exports/globals) — fix signatures + example.
- reference/models/routing.md (new): fallback groups (`fallback:` config),
  capability routing (`opts.requires`, tools auto-require), fallback-on-error
  (primary error surfaced, abort short-circuits), custom routers
  (`models.registerRouter`).
- api.md: `requires` option on embed/generate; overview + sidebar cross-links.
- release-notes/v5-lincoln/5.2.md (new): breaking namespacing note + routing.

Refs harper #1326, #1534, #1537.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@heskew heskew requested review from dawsontoth and kriszyp July 1, 2026 14:16

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation and release notes for Harper v5.2.0, focusing on the new pluggable routing and fallback capabilities for AI models, as well as the breaking change that namespaces backend registration under the models object. The feedback suggests clarifying some potentially confusing phrasing in the routing documentation regarding error fallbacks and custom router candidate resolution. Additionally, it recommends replacing absolute URL paths with relative markdown file paths in the release notes to ensure proper link validation and resolution by Docusaurus.

Comment thread reference/models/routing.md Outdated
Comment thread reference/models/routing.md Outdated
Comment thread release-notes/v5-lincoln/5.2.md Outdated
Comment thread release-notes/v5-lincoln/5.2.md Outdated
…ment)

The absolute links to the reference docs were missing the version segment
(/reference/models/... → /reference/v5/models/...), which failed the
Docusaurus broken-links build check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pr-558 July 1, 2026 14:24 Inactive
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-558

This preview will update automatically when you push new commits.

…e note

Our model changes (routing #1326, namespaced registration #1534, fallback #1537)
all landed in v5.1.15 — not a future 5.2 — and the free-global registration form
was never in a released version (added by #1405 and removed by #1534 within the
same release), so there is no user-facing breaking change to note.

- routing.md: version badge v5.2.0 -> v5.1.15 (+ source comment)
- remove release-notes/v5-lincoln/5.2.md (wrong version + moot breaking framing)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pr-558 July 1, 2026 14:44 Inactive
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-558

This preview will update automatically when you push new commits.

@heskew heskew marked this pull request as ready for review July 1, 2026 14:45
@heskew heskew requested a review from a team as a code owner July 1, 2026 14:45

@dawsontoth dawsontoth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the namespacing, makes it a lot easier to understand, nice!

Address gemini-code-assist clarity notes on routing.md: the facade default IS
to fall back on any error (filtering which errors skip the fallback is the
custom policy), and the no-candidates case reads more clearly as a backend that
satisfies the requirement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pr-558 July 1, 2026 14:54 Inactive
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-558

This preview will update automatically when you push new commits.

Fold the config-selectable backend docs from #556 into this PR (superseding it):
a `backend` value that is not a built-in is resolved as a module specifier
(bare package / instance-root-relative / absolute) and imported at startup.
Shipped in v5.1.15 (registerFromModule), so it sits under the existing v5.1.15
Custom backends heading; corrected #556 stray v5.1.16 badge and namespaced the
registerBackend reference.

Refs harper #1471. Supersedes documentation #556.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@heskew heskew requested a review from dawsontoth July 1, 2026 15:10
@github-actions github-actions Bot temporarily deployed to pr-558 July 1, 2026 15:13 Inactive
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-558

This preview will update automatically when you push new commits.

@heskew heskew merged commit 9e6c8a3 into main Jul 1, 2026
7 checks passed
@heskew heskew deleted the docs/models-namespacing-routing branch July 1, 2026 15:22
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🧹 Preview Cleanup

The preview deployment for this PR has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants