Skip to content

doc: require an audience qualifier segment in REST v2 URLs#12990

Draft
jopemachine wants to merge 1 commit into
mainfrom
docs/rest-v2-domain-entity-url-convention
Draft

doc: require an audience qualifier segment in REST v2 URLs#12990
jopemachine wants to merge 1 commit into
mainfrom
docs/rest-v2-domain-entity-url-convention

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

The scoped-search shape sat as "under consideration" across four AGENTS.md files, so neither direction was safe to follow when adding a new endpoint. Settle it, and fill two gaps the wording left open.

  • Scoped search is settled. The scope travels as a request body field and the path is the fixed /v2/{entity}/scoped/search; methods take the scoped_ prefix. The nested {scope_type}/{scope_id} path and {scope}_-named methods are marked legacy — kept in the docs, since most existing code still looks like that, but flagged as "do not add new ones".
  • The audience is now a required path segment. admin / scoped / my are already method prefixes, and scoped / my already appeared in URLs, but the admin variant was written as a bare POST /v2/{entity}/search, leaving the audience unreadable from the path. It is now /v2/{entity}/admin/search.
  • Multi-entity domains have a defined shape. POST /v2/{entity}/search assumed one entity per sub-app and had no reading for scheduling-history, which holds session, kernel, deployment, and route histories. Pinned as /v2/{domain}/{entity}/{qualifier}/{operation}, with the qualifier attached to the entity.

Applied across manager/api/AGENTS.md, manager/api/rest/v2/AGENTS.md, client/v2/AGENTS.md, and client/cli/v2/AGENTS.md — the same decision was recorded as pending in each, and client/v2/AGENTS.md explicitly asked for the URL pattern and CLI surface to be decided together. The full URL grammar lives only in rest/v2/AGENTS.md; the parent references it.

Docs only. #12989 and #12866 follow the settled shape.

Test plan

  • URL grammar stated once, in api/rest/v2/AGENTS.md; the parent api/AGENTS.md links rather than repeats
  • Legacy shapes documented as legacy instead of deleted, so existing code stays readable
  • Existing bare-/search routes are left alone — migrating them is a breaking change and needs its own decision

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size:S 10~30 LoC label Jul 21, 2026
@jopemachine
jopemachine force-pushed the docs/rest-v2-domain-entity-url-convention branch from 5cc69fc to 97e4681 Compare July 21, 2026 06:39
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:S 10~30 LoC labels Jul 21, 2026
@jopemachine jopemachine changed the title doc: define the REST v2 URL shape for multi-entity domains doc: require an audience qualifier segment in REST v2 URLs Jul 21, 2026
@jopemachine
jopemachine force-pushed the docs/rest-v2-domain-entity-url-convention branch from 97e4681 to af6984b Compare July 21, 2026 06:42
@github-actions github-actions Bot added size:S 10~30 LoC and removed size:M 30~100 LoC labels Jul 21, 2026
@jopemachine
jopemachine force-pushed the docs/rest-v2-domain-entity-url-convention branch 2 times, most recently from 753da30 to 9215039 Compare July 21, 2026 06:46
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:S 10~30 LoC labels Jul 21, 2026
The scoped-search shape sat as "under consideration" across four AGENTS.md files, so
neither direction was safe to follow. Settle it: the scope is a request body field and
the path is the fixed `/v2/{entity}/scoped/search`; the nested `{scope_type}/{scope_id}`
path is legacy. Methods take the `scoped_` prefix; `{scope}_` is legacy.

Also make the audience a required path segment. `admin` / `scoped` / `my` are already
method prefixes and `scoped` / `my` already appeared in URLs, but the admin variant was
written as a bare `/v2/{entity}/search`, leaving the audience unreadable from the path.

Define the URL shape for sub-apps that group several entities, which the previous
`/v2/{entity}/...` wording had no reading for.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant