Skip to content

docs(adr): ADR-0061 record search architecture + liveness audit#2131

Merged
xuyushun441-sys merged 1 commit into
mainfrom
docs/adr-record-search
Jun 21, 2026
Merged

docs(adr): ADR-0061 record search architecture + liveness audit#2131
xuyushun441-sys merged 1 commit into
mainfrom
docs/adr-record-search

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Records the architecture decision for record search, which a grounded liveness sweep showed is a declared-but-unenforced capability (cf. ADR-0049): $search / FullTextSearchSchema is defined and sent by every client surface (lookup picker, list quick-search, ⌘K), but no engine or driver executes it — a silent no-op. Only the public-form picker filters; $searchFields is already sent by the client (undocumented, unhonored → drift); three object/view search-metadata shapes have zero data-layer consumers.

This came out of the lookup-picker UX work (#2125 / #2128 and objectui #1860 / #1863): "multi-field lookup search" turned out to be one symptom of a platform-wide gap, which warranted an ADR rather than a renderer patch.

Contents

  • docs/audits/2026-06-record-search-liveness.md — evidence base: every search surface with file:line and LIVE/DEAD/PARTIAL, across spec / objectql / rest / drivers / services and objectui.
  • docs/adr/0061-record-search-architecture.md — the decision: enforce search as one metadata-driven, server-resolved capability. Client sends the query text; the server resolves fields from object metadata; a single resolver feeds all surfaces behind a two-tier executor (driver contains now; native FTS / external engine / relevance later); additive migration.

Decisions (D1–D7)

  1. Contract — client sends $search; server resolves fields; $searchFields becomes a server-validated override.
  2. Single source — object.searchableFields canonical; searchable boolean gate; view override; auto-default; collapse duplicate metadata.
  3. Two-tier executor — Tier 1 driver contains + engine in-memory fallback; Tier 2 trigram/tsvector/external + relevance.
  4. label↔value + ranking — server-side (select label→value Tier 1; lookup display Tier 2; per-object rank server, cross-object merge client).
  5. Security — over RLS + ADR-0045 visibility; secret/PII never searchable; override subset-validated; public projection+cap.
  6. Global searchAll — client fan-out now; unified server endpoint is Tier 2; knowledge/vector stays separate.
  7. Migration — one resolver; additive (no-op → filter); strip client field-guessing; phased P1–P4.

Plus a normative default-behaviour table, a conformance proof aligned with ADR-0060 ($search is "landed" iff a driver executes it and a dogfood proof asserts a multi-field match), and rejected alternatives (incl. the renderer $or hack — kept only as a throwaway P0 stopgap).

Status: Proposed — recommended for acceptance; no code changes in this PR. Docs only.

Record search is a declared-but-unenforced surface: `$search` /
FullTextSearchSchema is defined and sent by every client (lookup picker, list,
command palette) but no engine/driver executes it — a silent no-op (only the
public-form picker filters). `$searchFields` is already sent by the client,
undocumented and unhonored (drift); three object/view search-metadata shapes
have zero data-layer consumers.

- docs/audits/2026-06-record-search-liveness.md — evidence base (file:line,
  LIVE/DEAD/PARTIAL) across spec/objectql/rest/drivers/services + objectui.
- docs/adr/0061-record-search-architecture.md — decision: enforce search as one
  metadata-driven, server-resolved capability; client sends the query, server
  resolves fields from object metadata; single resolver for all surfaces behind
  a two-tier executor (driver contains now; FTS/relevance/external later);
  additive migration. D1–D7 + normative defaults + phasing + conformance proof
  (ADR-0060) + rejected alternatives (incl. the renderer $or hack).

Builds on ADR-0045 (visibility gate), ADR-0049 (enforce-or-remove),
ADR-0054 (runtime proof), ADR-0060 (conformance ledger).

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

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 21, 2026 2:41pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m and removed documentation Improvements or additions to documentation labels Jun 21, 2026
@xuyushun441-sys
xuyushun441-sys merged commit 4a6d789 into main Jun 21, 2026
15 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the docs/adr-record-search branch June 21, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants