fix(api): separate entity and link resolution - #1192
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e92fca690
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16aa361afe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94079b0d97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review Latest head: The qualified-reference guard now runs before non-strict fuzzy fallback, while exact local identifiers still take precedence. Fresh verification: 117 LinkResolver/API tests, 3 targeted Postgres contract tests, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d91ed0f003
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review Latest head: Qualified-reference detection now uses the same alias/bracket/whitespace normalization as LinkResolver before exact-local-first resolution. UUID wikilinks remain outside the supported product contract and are intentionally not expanded by this PR. Fresh verification: 117 LinkResolver/API tests, 3 targeted Postgres contract tests, |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Final gate update for |
Summary
Separate two resolution contracts that were previously implemented behind one route:
POST /v2/projects/{project_id}/knowledge/resolvestrict to the project named onthe route
POST /v2/projects/{source_project_id}/knowledge/links/resolvefor source-awarewikilinks, including qualified cross-project targets
Addresses #1170.
Problem
The existing entity-resolution route delegated to the full cross-project
LinkResolver.That made a route whose path says “resolve inside this project” capable of escaping to
another project, and it mixed two different cache and authorization boundaries:
different target project
The conflation was especially sharp for hosted callers. A qualified wikilink could resolve
into another project through a route authorized and cached as the source project.
Contract
Target-scoped entity resolution
POST /v2/projects/{project_id}/knowledge/resolvenow:project_idsource_pathbehaviorproject_external_idproject::noteand legacyproject/noteforms with HTTP 400when the prefix names another project
::and paths beginning with another project's nameThe explicit 400 is a migration guard. Returning a plain miss would let edit-style callers
interpret a cross-project lookup as “not found” and create the note in the active project.
Source-aware link resolution
POST /v2/projects/{source_project_id}/knowledge/links/resolve:source_pathLinkResolvertarget_project_external_idgenerations
Core does not own hosted authorization. The schema and domain documentation require hosted
callers to authorize the returned target project separately before exposing the resolved entity.
Hosted integration
The coordinated Basic Memory Cloud PR #1664
migrates web-v2 wikilinks to the new route, consumes
target_project_external_id, preservessource-project viewer access, and performs the existing second authorization against
cross-project targets. Public-share permalink resolution remains on the strict entity route.
The Cloud PR will remain draft until this Core contract lands and Cloud advances its pinned
Core revision.
Implementation
LinkResolveRequestandLinkResolveResponseschemasLinkResolver.resolve_entity()from fullresolve_link()docs/DOMAIN_MODEL.mdtarget identity, source-path misses, and same-project behavior
Verification
just fast-check: passedgit diff --check: passedRollout