Skip to content

feat!: P0 iron-out — generic deletes, de-fashioned core, honest ESCI judge, one env contract - #87

Merged
octalpixel merged 5 commits into
mainfrom
feat/p0-iron-out
Jul 2, 2026
Merged

feat!: P0 iron-out — generic deletes, de-fashioned core, honest ESCI judge, one env contract#87
octalpixel merged 5 commits into
mainfrom
feat/p0-iron-out

Conversation

@octalpixel

Copy link
Copy Markdown
Contributor

What

The four P0 correctness-and-honesty items from docs/stage-fit-audit-and-iron-out-plan.md §3, shipped as one breaking change (folded into the pending tier-zero-defaults major — merging this and the follow-up version PR releases it):

  • P0-1 — removeDocuments on every surface. HTTP DELETE /v1/projects/:p/collections/:c/documents, CLI samesake remove --ids=…, and catalog-sync deletes rerouted through the same path. Proof: push → delete → search returns nothing (HTTP + in-process test), plus a live CLI run against a real server.
  • P0-3 — de-fashioned core. core/fashion-search.ts → vertical-neutral core/shop-search.ts (shopSearch, /shop-search) + core/catalog-sync.ts (syncCatalogEvent, /catalog-sync). Zero-result relaxation is opt-in via CollectionSearchDef.relaxableFilters (core relaxes nothing by default; the fashion template ships fashion.searchDefaults()). Eval constraints use the search filter vocabulary ({price: {$lte: N}}). defashion-gate.test.ts greps core for fashion symbols and fails on any.
  • P0-4 — judge honesty. Shared 4-class ESCI rubric (E=3 / S=2 soft positive / C=1 / I=0, floor 2); judge version content-hashed (<tag>@<sha256(rubric)[:8]>) so prompt edits auto-invalidate caches; same-family enrich+judge throws (runEval, evaluateSearch, calibrateSearch, HTTP judgeModel).
  • P0-5 — one env contract. SAMESAKE_DATABASE_URL / SAMESAKE_API_KEY canonical everywhere; matcher env shim deleted; provider keys provider-named; GOOGLE_GENERATIVE_AI_API_KEY eliminated. No fallback aliases.

Golden eval — new honest baseline

Cross-family judge (gpt-4.1-mini over the Gemini-enriched corpus), all 62 queries:
evals/runs/2026-07-02T16-01-22-852Z-search-p0honesty.jsonmean grade@5 1.881 · nDCG@5 0.901 · no-results 0% (tier0post: 1.878 / 0.902). Retrieval flatness: 61/62 identical per-query topIds; the one delta is embedding float jitter on a pure-semantic query (query embeddings recompute live per run), not a retrieval change.

Verification

  • tsc --noEmit clean across workspaces
  • packages/server suite: 265 pass / 0 fail (baseline 258)
  • Release-gate examples green post-rebuild: hello-search, hello-spaces, quickstart
  • Docs site builds (30 pages); docs updated for ESCI judge, relaxableFilters, env contract
  • Design log: docs/notes/p0-iron-out-implementation-notes.md

🤖 Generated with Claude Code

octalpixel and others added 5 commits July 2, 2026 13:41
35+ session scratchpads / implementation notes / audit artifacts moved out
of the repo root so it presents as a product repo, not a build log.
Includes the iron-out session's own notes (assumptions, root causes,
verification record).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- system-behavior-spec.md: evidence-grounded spec of the 2.6.0 system
  (indexing spine, enrichment, hybrid retrieval, eval, tenancy truth).
- stage-fit-audit-and-iron-out-plan.md: keep/kill verdicts on every
  abstraction + prioritized P0-P2 backlog toward the marketplace-first,
  replaceable-search direction; executed-work record.
- docs/research/mices/: 11 MICES talks (idealo, Zalando, dm, Digitec,
  Delivery Hero, Shopify, OTTO, MediaMarkt, Coveo, Qdrant, Turnbull)
  synthesized with bet-by-bet verdicts for samesake.
- Commits the previously untracked research corpus (doordash, mastra,
  qmd, conversational-commerce-search, postgres-high-scale-search, ...),
  product audits, and RFC drafts the plan references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… indexing path

Breaking (see .changeset/tier-zero-defaults.md; recreate + reindex collections;
requires pgvector >= 0.7, 0.8 recommended):
- Collection embedding/space_vec columns and HNSW indexes are halfvec (fp16):
  measured 2.25x smaller index, 3.6x faster build, zero relevance delta on the
  62-query golden eval (grade@5 1.878 == baseline, nDCG@5 0.902 vs 0.901).
  Dim ceiling 4000 for collections; entity tables stay vector (2000).
- Weighted lexical leg: fts = setweight(fts_src_a,'A') || setweight(fts_src,'B');
  opt-in via f.text({ searchable: true, ftsWeight: "A" }) or an fts indexing
  surface with weight "A". Dead CollectionTextFieldDef.weight removed.
- Deprecated DEFAULT_PRODUCT_PARSE_INSTRUCTIONS removed (use _BODY).
- Legacy fashion preset layer deleted (fashionSearchPreset & co — zero callers).

Fixed:
- Since the S1c indexing migration, collections without an enrich pipeline
  indexed nothing (surfaces only built during enrich) — hello-search, quickstart,
  and the README example were silently broken. `indexing` is optional again,
  CollectionEmbeddingDef.source is restored, and embed-index builds surfaces
  inline (declared surfaces win; enrich-owning collections unchanged).
- README version claim (1.0.0 -> 2.6.0) and pgvector requirement noted.

Added:
- Iterative index scans (hnsw.iterative_scan = relaxed_order) auto-enabled on
  vector legs when pgvector >= 0.8 — filtered recall went 2/100 -> 37/100 rows
  on a 0.5%-selective filter in the Neon benchmark.
- efSearch (10-1000) search option, in-process + HTTP, in the result-cache key.
- StorageAdapter.pgvectorVersion() + unsafeWithSettings() (SET LOCAL-scoped
  queries); apply fails fast when pgvector < 0.7.

Verified: tsc clean; server suite 261/261; sdk 4/4; hello-search, hello-spaces,
quickstart release gates pass; golden eval flat-or-better vs July 1 baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the June/July eval artifacts (fashion judge v1, enrichment fixture/live,
search p2post baseline) and the 2026-07-02 tier0post run proving the halfvec +
iterative-scans change is relevance-neutral: mean grade@5 1.878 (== p2post
baseline), nDCG@5 0.902 (+0.001), no-results 0%, typo nDCG +0.005.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… judge, one env contract

P0-1  removeDocuments on every surface: HTTP DELETE
      /v1/projects/:p/collections/:c/documents, CLI `samesake remove`, and
      catalog-sync deletes rerouted through it. Proof test: push -> delete ->
      search returns nothing (HTTP + in-process); CLI proven against a live server.

P0-3  De-fashioned the generic core: core/fashion-search.ts replaced by
      vertical-neutral core/shop-search.ts (shopSearch, /shop-search) and
      core/catalog-sync.ts (syncCatalogEvent, /catalog-sync). Zero-result filter
      relaxation is now opt-in via CollectionSearchDef.relaxableFilters (core
      relaxes nothing by default; fashion template ships fashion.searchDefaults()).
      SDK renames: ShopSearchRequest/Response, ShopperContext, CatalogSyncEvent;
      FashionRankingPolicy deleted; fashionRerank -> llmRerank. Eval constraints
      now use the search filter vocabulary ({price: {$lte: N}}) resolved against
      the schema. Grep gate: defashion-gate.test.ts forbids fashion symbols in core.

P0-4  Judge honesty: shared 4-class ESCI rubric (E=3/S=2 soft positive/C=1/I=0,
      floor 2) across makeLlmJudge and evaluateSearch; judge version content-hashed
      (<tag>@<sha256(rubric)[:8]>) so prompt edits invalidate caches; same-family
      enrich+judge rejected (runEval, evaluateSearch, calibrateSearch, HTTP
      judgeModel). New honest baseline minted with a cross-family gpt-4.1-mini
      judge: evals/runs/2026-07-02T16-01-22-852Z-search-p0honesty.json — mean
      grade@5 1.881 / nDCG@5 0.901 vs tier0post 1.878/0.902, topIds 61/62
      identical (one embedding-jitter reorder).

P0-5  One env contract: SAMESAKE_DATABASE_URL / SAMESAKE_API_KEY canonical across
      .env.example, README, docs, examples, apps, tests, CLI; apps/matcher env
      shim deleted; provider keys provider-named (GEMINI_API_KEY, OPENAI_API_KEY);
      GOOGLE_GENERATIVE_AI_API_KEY eliminated. No fallback aliases.

Verified: tsc --noEmit clean; server suite 265 pass / 0 fail (baseline 258);
hello-search, hello-spaces, quickstart green post-rebuild; docs site builds.
Breaking changes folded into the pending tier-zero-defaults major changeset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@octalpixel
octalpixel merged commit 8759e9f into main Jul 2, 2026
1 check passed
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.

1 participant