Skip to content

feat(api): search every project a session can act on, each type from an index - #2972

Merged
fforootd merged 27 commits into
mainfrom
claude/youthful-jones-4b9f54
Nov 11, 2026
Merged

fforootd merged 27 commits into
mainfrom
claude/youthful-jones-4b9f54

Conversation

@fforootd

@fforootd fforootd commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Builds on #2968 (merged): the console half extends its one ranked palette and D37.

What

The console's ⌘K palette at All projects now finds users, teams and configuration in the projects the person can act on, and every type POST /search reads is served by an index on Postgres, Spanner and SQLite.

  • Search across projects. search (POST /search) on a console session without project_id searches the projects listMyProjects (GET /users/me/projects) lists: the person's project-scoped grants, every project for a platform operator. It reads the newest 10, by creation time as the console's Projects list does (D28), from a new projects (created_at, id) index on all three dialects (Postgres 000047, SQLite 000034, Spanner 000051, descending there); more_projects (new, required in the response) says there are more, and then every requested type is in incomplete_types. The projects are checked in one statement, and its decision gates every type read in each as that type's own list would. Projects whose gate allows every row are read together: one statement for the search entries of every kind, and for users one each for the projects' user schemas, the search index (index only) and the users found. A project behind a narrower grant, and text shaped like an id, is read project by project. Reads run one after another, so a search holds one database connection at a time. A project secret, and any request naming project_id, searches one project as before.
  • Every match from an index. Teams, user schemas, flow definitions and identity provider connections get one search_entries table (Postgres 000046, SQLite 000033, Spanner 000050, each with a backfill). The statements that write those resources write their entry in the same transaction, as they write the resource scope index: each name folded as uniqueness folds (domain.SearchText), and its tail from each of its next eight words. A search is one range of the table's primary key (project_id, resource_kind, search_text, resource_key), read in key order to a fixed limit, the same rows whatever the caller's grant: whether the caller may see a row is a column of the read, not a condition of it, and a full range leaves the type incomplete. Texts are upserted, so two revisions of one key written at once both commit. A row carries the id, title and subtitle, so the search reads nothing else; resource_key is what a newer revision replaces an entry by, so an entry always names the newest revision.
  • Matching changes for those four types: from the start of a name or of a word in it, no longer inside a word. staff finds "Partner Staff", sso finds partner-sso, pay no longer finds "Prepay", % starts no word. Users are unchanged.
  • Console (D39): at All projects, and on Projects and Settings even while a project stays selected, the palette asks without a project; inside a project it searches that project. It ranks the hits with the rest, the selected project's first among equal matches, names each hit's project beneath it (its ID when the palette has not listed it), and opens a hit with ?project= set. Once the server has answered it says what it searched (users only from three characters; every project, or the newest ten), beneath the matches too when there are more projects. Across projects it asks once per pause in typing, for every type, so the projects are listed and checked once; inside a project it still asks for users apart, so the other kinds do not wait for the slowest read (a second request there costs one access check). When a kind has more matches than the server read, or a narrow grant saw none of the rows read, a line under the list says more may match and to type more.
  • Preview database: this branch's persistent preview database applied these migrations as 45 and 46, before main's signup protection took 45. The preview's @zitadel/cloud#migrate will fail with relation "search_entries" already exists, and the database would skip signup protection. It needs dropping and redeploying again; nothing here touches it or works around it in the migration.
  • Product call to confirm: searching every project from Projects and Settings while one is selected (D39's last line). Inside a project nothing changes; reversing it is one condition in app-shell.tsx.
  • ADR 087 amended with §6 (across projects), §7 (indexed matching) and the read plan; D37's follow-up closed by D39.

Read plan: a session's search without project_id

All requested types, default limit_per_type 5, over up to 10 projects whose gate allows every row:

Read Statements Rows read
Session token, session user, projects and their origins, the operator question 5 the person's grants; for an operator the newest 11 from idx_projects_created_at
Access check 2: the active catalog, one check of every project the person's grants on each project
team, schema, flow_definition, idp 1 for all of them (one UNION ALL arm per project and kind) per arm at most 24 rows of search_entries, with any grant
user 3: the projects' user schemas, the search index (one arm per project and designated property, index only), the users found; then their attributes, 1 per project holding one of them per arm at most 6 × the properties one schema designates (18 for three) index entries; at most 5 users
An id, per type 1 by primary key per project; only for text shaped like an id 1

Nothing grows with the number of users, teams or configuration rows a project holds, or for those four types with how narrow the caller's grant is; with the number of projects only the users' attributes grow, up to limit_per_type. What stays: the user read lists every user schema revision of the projects, and in a project behind a narrower grant the users' index ranges keep that grant's filter in their condition (from #2944), worst case every user whose identifier or name starts with the text. Across projects that is rare, since a grant narrower than a project lists no project; it is mostly a project secret, or a session naming a project, with a grant on one team.

Measured on a local Postgres 18:

  • One pause in typing, 10 projects, every type (the person holds a viewer grant on each; each has 3 teams and a user): before 134 statements in two requests, each reading 4 projects at a time, so up to 8 connections at once (the cloud's pool is 4); now 17 statements in one request, one connection at a time. With a delay added before every statement (a stand-in for the network to a hosted database), the median pause took 3.3 ms → 2.7 ms with none, 33 ms → 27 ms with 1 ms, and is 46 ms with 2 ms. The old two-request console against the new server is 25 statements.
  • Entries, every caller: one project holding 300,000 team entries that all start with the text, plus another with 300,000 more: Index Scan using search_entries_pkey, Index Searches: 1, 24 rows read, no sort, 0.03 ms; a text no entry starts reads 0 rows. In the batch, each arm is Limit → Index Scan using search_entries_pkey, 24 rows per arm with 200,000 matches per project.
  • Users, in the batch: each arm Limit → Index Only Scan using idx_user_attributes_search.
  • Entries, a narrow grant (a viewer grant on one team, whose entry sorts after 300,000 it may not see), replaying the statement the server sent: now Index Scan using search_entries_pkey … rows=24, 0.08 ms, no match and the type incomplete; with the grant in the WHERE, as before, the same scan read on (Rows Removed by Filter: 300000, 38 ms) to return the one row.
  • Projects, with 100,000 projects and the person's 3 grants on the oldest: the person's read is their 3 grants and 3 primary-key lookups, sorted (0.15 ms); the operator's is Index Scan Backward using idx_projects_created_at, 11 rows (0.013 ms).

SQLite reads each arm as SEARCH search_entries USING INDEX sqlite_autoindex_search_entries_1 (…) and SEARCH user_attributes USING COVERING INDEX idx_user_attributes_search (…), and projects newest first as SCAN projects USING INDEX idx_projects_created_at, none with a temporary B-tree. Spanner reads the entries by the table's own key and projects by a descending index (not measured locally: no emulator here).

Validation

On the head after merging main (e40ac5a) and renumbering the migrations:

  • SQLite lane: go -C apps/api test -count=1 -tags sqlite_integration ./... (the server:test-sqlite command), all ok.
  • Postgres lane against a throwaway Homebrew Postgres 18 (not server:test-postgres, which needs Docker): its own go -C apps/api test -count=1 -tags postgres_integration ./..., all ok.
  • Go unit tests: go test ./... in apps/api, all ok. server:generate leaves no drift.
  • Tests: stmttest parity suites TestSearchAcrossProjectsStatements (one check answers every project as its own check does; the batched entries and user-index reads hold each project's ranges to their limit; both refuse a list filter), TestSearchEntryStatements, …_NarrowGrantReadsNoFurther (a narrow grant reads to the limit and reports it full) and …_ConcurrentRevisionsOfOneKey (two creates of one flow name at once both commit; on Postgres it fails with duplicate key … search_entries_pkey without the upsert), migration backfill tests for Postgres and SQLite (up to 45 and 32, then the new migration), TestSearchAcrossProjects (grants per project, the shared limit, a named project, a foreign one, no grants, the newest 10 of 11, a platform operator), TestIsSearchSchemaID, TestCheckProjects (resolver), and the console's palette specs (above every project with a selection, inside a project, one request across projects, short text, the newest-ten line and the more-may-match line).
  • console:typecheck, console:lint, console:test (947): pass.
  • pnpm install --frozen-lockfile and node scripts/check-changesets-status.mjs: ok.
  • Before the merge: moon ci :lint :typecheck :build passed, server:check-generate-pruned, server:openapi and server:format on their own, and the search integration tests under -race.
  • Not run locally: the Spanner lane.

Release notes / changeset

.changeset/search-across-projects.md (@zitadel/server, @zitadel/api, minor), written as the change on top of the released POST /search: a session's search without project_id reads the newest 10 of the person's projects, the console searches them from All projects, Projects and Settings, and teams and configuration match from the start of a name or of a word in it. node scripts/check-changesets-status.mjs: ok, no warnings.

🤖 Generated with Claude Code

fforootd and others added 6 commits November 10, 2026 21:07
Once something is typed, the palette lists the best matches of every kind
in one list of at most eight rows instead of a group per kind: ranked by how
the name matches (whole, start, a word's start, inside), the selected
project's rows first among equals. Beneath each row is where it is: the
project (after a hit's own second line), a project's host or else its ID,
Settings for its pages, or "Choose a project" for a project's page while
none is selected. When nothing matches it names the project it searched, or
says one is needed. Before anything is typed its Projects open on the
selected and recent ones, as the switcher does.

- `closeness` and `ranked` in features/search/model.ts
- `CommandItemText`, the two-line row text, shared with the combobox
- `openingList` moved to features/projects/recent-projects.ts
- Decision D36; the unreleased search changeset extended

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row that opens Users took a ninth place past the cap; it now takes the
list's last place. The palette's field, debounce and searches lived on the
always-mounted dialog, so closing it let a reset timer and in-flight answers
update state after a test's last assertion, which CI's slower runner hit as
an act() warning. They now live in a body the dialog mounts only while open:
each opening starts empty, and closing drops pending work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an index

POST /search without project_id on a console session now searches the
projects the person can act on, as GET /users/me/projects lists them, at
most the first 10 in that order; more_projects says there are more. Each
project costs one access check, whose decision gates every type read in
it.

Widening the reads across projects meant none of them may scan, so teams,
user schemas, flow definitions and identity provider connections get one
search_entries table on Postgres, Spanner and SQLite. The statements that
write those resources write their entry in the same transaction: each
name folded as uniqueness folds, and its tail from each later word. A
search is one range of its primary key read to a fixed limit, so they now
match from the start of a name or of a word, not inside one.

ADR 087 is amended with the decision and the read plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Search now gates once per project instead of once per type, so the
per-type not_found and permission_denied codes leave its error set, and
the session codes of the project-less path join it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no project selected the palette asks POST /search without a
project, which reads the projects the person can act on. Each hit names
its project beneath it and opens with ?project= set; the empty state
says whether every project was searched or the first ten of them (D37).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 05:59
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Nov 11, 2026 7:42pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-11T06:12:21.403531Z cb8e331 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: a3e3608

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@zitadel/server Minor
@zitadel/api Minor
@zitadel/cli Minor
@zitadel/components Minor
@zitadel/config Minor
@zitadel/sdk-angular Minor
@zitadel/sdk-core Minor
@zitadel/sdk-next Minor
@zitadel/sdk-nuxt Minor
@zitadel/sdk-qwik Minor
@zitadel/sdk-qwik-router Minor
@zitadel/sdk-react Minor
@zitadel/sdk-solid Minor
@zitadel/sdk-solid-start Minor
@zitadel/sdk-svelte Minor
@zitadel/sdk-sveltekit Minor
@zitadel/sdk-tanstack-start Minor
@zitadel/sdk-vue Minor
@zitadel/testing Minor
@zitadel/cloud Patch
@zitadel/server-linux-x64 Minor
@zitadel/server-linux-arm64 Minor
@zitadel/server-darwin-x64 Minor
@zitadel/server-darwin-arm64 Minor
@zitadel/server-win32-x64 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

A critical SQL generation defect remains in resolver_sql.go where the emitted predicate has unbalanced parentheses, and there are also minor doc/comment inconsistencies around the “first 10 projects” search behavior that should be corrected.

3 open issues
What changed in this PR

Adds cross-project search for console sessions and serves additional resource types from an index-backed search_entries table across Postgres/Spanner/SQLite.

Changes:

  • Extend POST /search (no project_id) to search up to the first 10 accessible projects and return more_projects/incomplete_types.
  • Introduce and backfill search_entries with transactional writers for teams, schemas, flow definitions, and IdP connections.
  • Update console ⌘K palette to search at “All projects”, display project context, and navigate with ?project=.
  • Tighten authz/session semantics around deactivated users and project-secret session creation scope.
File Description
packages/​go/​api/​oas_parameters_gen.go Regenerates Go API parameter bindings/docs to reflect updated search and session parameters.
packages/​go/​api/​oas_client_gen.go Regenerates the Go API client with updated endpoint documentation and response shapes.
docs/​design/​decisions.md Adds/updates design decision notes describing the console “All projects” search palette behavior.
docs/​adrs/​README.md Updates the ADR index to reference the amended search ADR.
docs/​adrs/​087-search.md Amends ADR 087 with cross-project search behavior and indexed matching details.
apps/​console/​src/​features/​search/​recents.spec.ts Updates recents tests/fixtures to account for project-scoped search hits.
apps/​console/​src/​features/​search/​model.ts Extends the console search model to include projectId on hits and moreProjects on responses.
apps/​console/​src/​features/​search/​model.spec.ts Updates console search model tests for the new hit/response fields and ranking behavior.
apps/​console/​src/​features/​search/​api.ts Adjusts the console search API adapter to send optional project_id and map more_projects/project_id from responses.
apps/​console/​src/​app-shell/​search.tsx Implements “All projects” palette search, displays project context per hit, and navigates into the correct project scope.
apps/​console/​src/​app-shell/​app-shell.spec.tsx Adds/updates app-shell specs validating cross-project palette behavior and navigation.
apps/​api/​internal/​storage/​stmttest/​search_entry_test.go Adds stmt-test coverage for search_entries write/read behavior, revision handling, filtering, and limits.
apps/​api/​internal/​storage/​stmttest/​project_admins_test.go Updates stmt-test coverage for project admin listings and deactivated-user behavior.
apps/​api/​internal/​storage/​stmttest/​open_sqlite_test.go Extends the SQLite stmt-test opener with helper hooks needed by new status-related tests.
apps/​api/​internal/​storage/​stmttest/​open_spanner_test.go Extends the Spanner stmt-test opener with helper hooks needed by new status-related tests.
apps/​api/​internal/​storage/​stmttest/​open_postgres_test.go Extends the Postgres stmt-test opener with helper hooks needed by new status-related tests.
apps/​api/​internal/​storage/​stmttest/​main_test.go Wires new stmt-test harness hooks across dialect openers for the updated test suite.
apps/​api/​internal/​storage/​stmttest/​authz_test.go Updates stmt-test authz fixtures/helpers to align with user status gating.
apps/​api/​internal/​storage/​stmttest/​authz_resolver_user_status_test.go Adds stmt-test coverage asserting authz behavior depends on user active status in the home project.
apps/​api/​internal/​storage/​stmttest/​authz_resolver_oracle_test.go Aligns oracle agreement tests with the updated authz resolution and user-status semantics.
apps/​api/​internal/​storage/​stmttest/​authz_resolver_home_test.go Updates home-project authz resolver tests to use the revised principal/user setup.
apps/​api/​internal/​storage/​stmttest/​authz_resolver_foothold_principal_test.go Updates foothold principal tests to reflect the revised principal/user-status behavior.
apps/​api/​internal/​storage/​dialect/​sqlite/​team.go Updates SQLite team statements to maintain search_entries alongside team writes.
apps/​api/​internal/​storage/​dialect/​sqlite/​statement.go Registers searchEntryStatements within the SQLite statement bundle.
apps/​api/​internal/​storage/​dialect/​sqlite/​seed_projects_integration.go Adjusts SQLite integration seeding/helpers used by the expanded stmt-test and integration suite.
apps/​api/​internal/​storage/​dialect/​sqlite/​search_entry.go Implements SQLite search_entries read/write logic and list-filter integration.
apps/​api/​internal/​storage/​dialect/​sqlite/​migration/​sql/​000030_search_entries.sql Adds the SQLite migration creating/backfilling the search_entries table.
apps/​api/​internal/​storage/​dialect/​sqlite/​migration/​search_entries_test.go Adds SQLite migration tests validating the search_entries backfill.
apps/​api/​internal/​storage/​dialect/​sqlite/​json_schema.go Updates SQLite JSON schema statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​sqlite/​idp_connection.go Updates SQLite IdP connection statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​sqlite/​flow_definition.go Updates SQLite flow definition statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​spanner/​team.go Updates Spanner team statements to maintain search_entries alongside team writes.
apps/​api/​internal/​storage/​dialect/​spanner/​statement.go Registers searchEntryStatements within the Spanner statement bundle.
apps/​api/​internal/​storage/​dialect/​spanner/​seed_projects_integration.go Adjusts Spanner integration seeding/helpers used by the expanded stmt-test and integration suite.
apps/​api/​internal/​storage/​dialect/​spanner/​search_entry.go Implements Spanner search_entries read/write logic for indexed search.
apps/​api/​internal/​storage/​dialect/​spanner/​migration/​sql/​000047_search_entries.sql Adds the Spanner migration creating/backfilling the search_entries table.
apps/​api/​internal/​storage/​dialect/​spanner/​json_schema.go Updates Spanner JSON schema statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​spanner/​idp_connection.go Updates Spanner IdP connection statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​spanner/​flow_definition.go Updates Spanner flow definition statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​postgres/​team.go Updates Postgres team statements to maintain search_entries alongside team writes.
apps/​api/​internal/​storage/​dialect/​postgres/​statement.go Registers searchEntryStatements within the Postgres statement bundle.
apps/​api/​internal/​storage/​dialect/​postgres/​seed_projects_integration.go Adjusts Postgres integration seeding/helpers used by the expanded stmt-test and integration suite.
apps/​api/​internal/​storage/​dialect/​postgres/​search_entry.go Implements Postgres search_entries read/write logic for indexed search.
apps/​api/​internal/​storage/​dialect/​postgres/​migration/​sql/​000043_search_entries.sql Adds the Postgres migration creating/backfilling the search_entries table.
apps/​api/​internal/​storage/​dialect/​postgres/​migration/​search_entries_test.go Adds Postgres migration tests validating the search_entries backfill.
apps/​api/​internal/​storage/​dialect/​postgres/​json_schema.go Updates Postgres JSON schema statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​postgres/​idp_connection.go Updates Postgres IdP connection statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​postgres/​flow_definition.go Updates Postgres flow definition statements to write/maintain corresponding search_entries rows.
apps/​api/​internal/​storage/​dialect/​authz/​resolver_sql.go Refactors/extends SQL authz resolver logic to incorporate updated user-status gating semantics.
apps/​api/​internal/​storage/​dialect/​authz/​resolver_sql_test.go Updates authz resolver SQL tests to assert the revised predicate generation and status checks.
apps/​api/​internal/​storage/​dialect/​authz/​project_admins.go Updates project admin resolution to reflect revised user-status handling in authz paths.
apps/​api/​internal/​storage/​dialect/​authz/​platform_operator.go Updates platform operator authz logic to reuse shared status-aware predicates.
apps/​api/​internal/​storage/​dialect/​authz/​platform_operator_test.go Updates platform operator authz tests to match the revised predicate structure.
apps/​api/​internal/​service/​statement.go Extends the service statement interface to include SearchEntryStatements.
apps/​api/​internal/​service/​search.go Implements service-level cross-project search orchestration and indexed reads via search_entries.
apps/​api/​internal/​service/​schema_service.go Adds optional schema ID filtering support used by search result resolution paths.
apps/​api/​internal/​service/​mocks/​service.mock.go Regenerates service mocks to include the new search entry statement surface.
apps/​api/​internal/​service/​idp_connection.go Adds optional IdP connection ID filtering support used by search result resolution paths.
apps/​api/​internal/​service/​flow_definition.go Adds optional flow definition ID filtering support used by search result resolution paths.
apps/​api/​internal/​domain/​search_entry.go Introduces domain types and helpers for generating and ranking search_entries.
apps/​api/​internal/​domain/​search_entry_test.go Adds unit tests for search entry tokenization, folding, and ranking behavior.
apps/​api/​internal/​authz/​resolver/​oracle.go Updates the oracle resolver to model the revised authz/user-status semantics for parity testing.
apps/​api/​internal/​authz/​resolver/​oracle_test.go Updates oracle resolver tests to cover the revised status-aware authorization rules.
apps/​api/​internal/​api/​session.go Updates session API behavior to enforce project scoping rules when creating sessions.
apps/​api/​internal/​api/​session_test.go Adds/updates session API tests covering the revised project scoping and error behavior.
apps/​api/​internal/​api/​release_internal_test.go Updates internal API tests to match revised authz stubs and access behavior.
apps/​api/​internal/​api/​origin_internal_test.go Updates internal API tests to match revised authz stubs and access behavior.
apps/​api/​internal/​api/​integration_test/​search_test.go Adds integration coverage for cross-project search semantics and updated matching behavior.
apps/​api/​internal/​api/​integration_test/​console_session_test.go Adds integration coverage for console session behavior under revised authz/user status semantics.
apps/​api/​internal/​api/​generated/​oas_unimplemented_gen.go Regenerates OpenAPI-derived server scaffolding for updated endpoints and models.
apps/​api/​internal/​api/​generated/​oas_server_gen.go Regenerates OpenAPI-derived server interfaces/types reflecting updated contracts.
apps/​api/​internal/​api/​generated/​oas_router_gen.go Regenerates OpenAPI-derived routing with updated endpoint wiring/metadata.
apps/​api/​internal/​api/​generated/​oas_parameters_gen.go Regenerates OpenAPI-derived parameter types for updated session/search APIs.
apps/​api/​internal/​api/​generated/​oas_handlers_gen.go Regenerates OpenAPI-derived handlers glue code to match updated API contracts.
apps/​api/​internal/​api/​event_internal_test.go Updates internal API tests to match revised authz stubs and access behavior.
apps/​api/​internal/​api/​deployment_internal_test.go Updates internal API tests to match revised authz stubs and access behavior.
apps/​api/​internal/​api/​branding_internal_test.go Updates internal API tests to match revised authz stubs and access behavior.
apps/​api/​internal/​api/​authz.go Refactors API-layer authz gating to support search fan-out across projects with shared decisions.
apps/​api/​internal/​api/​authz_internal_test.go Updates API-layer authz unit tests for the refactored gating behavior.
apps/​api/​api/​openapi/​endpoints/​sessions/​methods.yaml Updates OpenAPI documentation for session creation behavior and constraints.
apps/​api/​api/​openapi/​endpoints/​sessions/​createSession-error-response.yaml Updates documented error responses for session creation to reflect new cases.
apps/​api/​api/​openapi/​endpoints/​search/​search-response.yaml Updates the documented search response schema to include more_projects and related semantics.
apps/​api/​api/​openapi/​endpoints/​search/​search-error-response.yaml Updates documented search error responses to match the revised behavior.
apps/​api/​api/​openapi/​endpoints/​search/​methods.yaml Updates OpenAPI search endpoint docs to describe cross-project session search and parameters.
.changeset/​search-across-projects.md Adds a changeset describing cross-project search and index-backed matching behavior.
.changeset/​deactivated-user-direct-grants.md Adds a changeset describing authorization behavior changes for deactivated users with direct grants.
.changeset/​create-session-own-project.md Adds a changeset describing project scoping enforcement for session creation with project secrets.

Review effort: Balanced

Comment thread apps/console/src/app-shell/search.tsx Resolved
Resolve two conflicts with #2977: the combobox keeps main's chip rows and
ruled groups and draws a plain row with the shared `CommandItemText`; the
palette keeps its restructure and copies the project id through main's
`copyText`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fforootd
fforootd added this pull request to stack #2996 November 11, 2026 16:06
fforootd and others added 2 commits November 11, 2026 08:06
main took 000043 (Postgres), 000030 (SQLite) and 000047 (Spanner) for
the events request indexes, so search_entries moves to 000044, 000031
and 000048.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd and others added 2 commits November 11, 2026 08:15
…ew found

- An empty list reads "Searching…" until every search has answered the text
  in the field, not "Nothing matches".
- Before typing, Projects falls back to the first page when the person has
  more than one page and none selected or recent, instead of vanishing.
- A row also ranks on its second line, so a user found by the start of
  their identifier no longer sorts last.
- Each opening mounts a fresh palette, also when reopened while the dialog
  animates out.
- The account's rows say "Account" beneath them once typed; with no project
  selected, a project's pages rank after projects.
- `useProjectSearch` reads nothing until something is typed: both fields
  open on `useMyProjects`.
- The decision is D37: main already cites D36 for keeping the selected
  project on Projects and Settings.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…b7d37f' into claude/youthful-jones-4b9f54

# Conflicts:
#	apps/console/src/app-shell/search.tsx
#	docs/design/decisions.md
fforootd and others added 5 commits November 11, 2026 08:54
…ert them

A caller whose grant covers part of a project had the grant's filter in
the condition of the entries' range read, so the read walked the whole
range for the rows it could see: 300,000 rows read to return one on
Postgres. Whether the caller may see a row is now a column of the read,
which stops at its limit, and a full range leaves the type incomplete.

Two revisions of one key written at once (a schema's object type, a
flow's name) could both insert the same texts, and the second create
failed on the primary key. The texts are upserted on all three dialects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A session's search without project_id read the 10 oldest projects by
id, so an administrator with many projects never searched the newer
ones. It now reads the newest 10 by creation time, as the console's
Projects list does, from a new projects (created_at, id) index on all
three dialects. Projects are checked and read at most 4 at a time, each
read with its own context, through one helper so the API's error
analysis still sees the reads' errors. A schema is read by id only for
text shaped like one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Projects and Settings a project can stay selected (D36), which kept
the palette's search in that project. Those screens are above every
project, so the palette now searches all of the person's projects there,
the selected one's matches first; inside a project it searches that
project. It says what it searched, users only from three characters,
and keeps the newest-ten line beneath the matches too (D38).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No conflicts. Picked up for the stack: main's invitations migration takes
the numbers #2972's search_entries migration used.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main took 000044 (Postgres), 000031 (SQLite) and 000048 (Spanner) for
invitations, so search_entries moves to 000045, 000032 and 000049, and
the projects created_at index to 000046, 000033 and 000050.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd and others added 3 commits November 11, 2026 09:28
main released (#2887), which consumed `.changeset/search.md`, the pending
changeset this branch had extended. Take the deletion and give this change
its own changeset, `console-search-ranked-list.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The release shipped POST /search itself, so the changeset now reads as
the change on top of it, inside the release-note length, with a link to
the Search reference. The tag's description names the person's
projects beside one project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd and others added 2 commits November 11, 2026 10:09
…tatements

A project-less search decided each project's gate with its own catalog
read and check, and read every type project by project, four projects
at a time: 134 statements per pause in typing over two requests,
holding up to 8 connections where the cloud's pool has 4.

The projects are now checked in one statement (CheckAuthzProjects, and
at most one platform operator question), and those whose gate allows
every row are read together: one UNION ALL of the search entries' ranges
for every project and kind, and for users one read each of the
projects' user schemas, the search index (index only) and the users
found. Every arm is still one bounded index range. A project behind a
narrower grant, and text shaped like an id, is read project by project.
The reads run one after another. Measured over 10 projects: 17
statements, a median of 27 ms with 1 ms per statement (was 33 ms).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…may match

Across projects the palette now sends one request for every type, so
the server lists and checks the projects once per pause; inside a
project it still asks for users apart. When a kind has more matches than
the server read, or a narrow grant saw none of the rows read, a line
under the list says more may match. The comments on the newest ten say
so (D38).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from claude/global-search-ux-console-b7d37f to main November 11, 2026 19:14
fforootd and others added 2 commits November 11, 2026 11:17
Main took #2968 as the squash e40ac5a. The branch already held its
commits, so the conflicted console files and decisions.md keep this
side; the ADR index keeps this side's 087 row and adds main's 088.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's signup protection took Postgres 000045, SQLite 000032 and
Spanner 000049. search_entries moves to 000046 / 000033 / 000050 and
the projects created_at index to 000047 / 000034 / 000051; the backfill
tests migrate up to the new versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's D38 names the events screen Events, so this branch's decision on
searching above every project becomes D39, above it, and the console
comments and D37's follow-up point at D39.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fforootd
fforootd enabled stacked auto-merge November 11, 2026 19:42
@fforootd
fforootd added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 8bac5fd Nov 11, 2026
25 of 26 checks passed
@fforootd
fforootd deleted the claude/youthful-jones-4b9f54 branch November 11, 2026 19:56
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Nov 11, 2026
fforootd added a commit that referenced this pull request Nov 11, 2026
main took D39 for searching every project (#2972), so this PR's decision
is D40. The no-project search test keeps typing "ada", since "admin" now
finds the project's Admins page; its comment follows #2972's server search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — a3e36084 Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants