Repository navigation
feat(spec): IReranker contract and RERANKER_SERVICE token - #38778
Conversation
Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 66ce546b1f1361c8941f331482953bff14005073 && git checkout 66ce546b1f1361c8941f331482953bff14005073
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 b11e9178e6193ac90308dffe48ed9ae8ce90229f && git checkout -B drift-repro 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 && git merge --no-ff b11e9178e6193ac90308dffe48ed9ae8ce90229f
node scripts/docs-audit/affected-docs.mjs --json 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 |
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Final head for review — zone o3-K · 2026-11-30T15:15Z |
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ 7d0eea7 (card #38772; #38750 row 2, the contract half). The PR adds 6 files, +133/−0, all add-only. What it adds
Measured in a scratchpad worktree at this head
Nit (N1). The changeset and the Checks: |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: PR #38778, card #38772 (the contract front of row 2 of epic #38750). Six files, +133 / -0, no existing line edited. Read: the card and its three comments (claim 7280261872, triage 7280869179, dev report 7281861708), the epic body (Design "Contract" line, Rulings 1 to 3, D1 to D6, "Not in v1") and its ruling records 7276086125 and 7276135635, the PR body, the net diff, the three source files at the head, ① Derived judgments
② Semver levelThe changeset names ③ Boundary flags
Deviations and notes in the report, each answered:
SQL push-down: not applicable. The diff holds no query, no id materialisation and no join. Security: neither hits path is under ④ Design judgment
(1) Shape against the ruling: holds, as ① shows. (2) The docblock against the ruled contract, sentence by sentence:
The docblock states nothing beyond the ruling. It states one thing too few, which is S1. (3) Trying to break it. A reader of this file who writes the first implementation (row 3) and a reader who writes the first consumer (row 2) must reach the same ranking from the text alone. They cannot. The type gives
One line,
It agrees with the contract, and it pins the shape:
The pins are compiled by Findings.
Implemented-by: VERDICT: PASS |
…ent limit, and that no reader exists yet Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v
…nk lands Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Final head for review — zone o3-K · 2026-11-30T16:09Z |
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ b11e917 (card #38772). This is the delta from my ACCEPT 7282806115 @7d0eea72. It has three commits: a merge of main The merge is clean. Against each side's merge base, the PR touches the same 6 files. The patch is identical in every one except the two this round edits on purpose, The wording, read against the code. These are docblock and changeset sentences only; the interface shape does not move.
Not re-run: the type pins and Checks at this head (filter=all): 60 success, 13 skipped, 0 failure. |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: Delta review of PR #38778 (card #38772), from record 7282903130 on ① Derived judgments
② Semver levelHolds. The changeset still names ③ Boundary flags
SQL push-down: not applicable. Security: no hits path is under ④ Design judgment
Findings. S1: closed No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Landing — zone o3-K · 2026-11-30T16:16Z
L1 ACCEPT 7282806115 and delta ACCEPT 7284299955 (L1-b); contract review PASS 7282903130 and delta PASS 7284376959 (seat, |
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v
Fixes #38772
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
packages/spec/src/contracts/reranker.ts, mirroringembedder.ts:IReranker { readonly id: string; rerank(query: string, documents: string[], opts?: { signal?: AbortSignal }): Promise<Array<{ index: number; score: number }>> }andRERANKER_SERVICE = 'reranker' as const.AbortSignalfor its time limit; each entry names a document by its position indocumentsplus the reranker's score. No order or completeness guarantee is stated (not ruled).packages/spec/src/contracts/index.ts: oneexport * from './reranker.js';line, placed right afterknowledge-service.js(not afterembedder.js, where feat(service-segmenter): a segmenter service that cuts a Chinese question into real words for the keyword leg #38744 inserts its own line;overlap-check.mjsreads both merges clean).packages/spec/api-surface/contracts.jsonandpackages/spec/export-origins/contracts.json(+2 names each).gen:declaration-mapwrote nothing..changeset/38772-reranker-contract.md:@objectstack/specpatch (Metadata-protocol: nonesets patch).IReranker.model, no vendor list, no reader, nocore-service-contracts.tsentry (the embedder has none either), no runtime change.Tests
packages/spec/src/contracts/reranker.test.ts: type-level pins (exportedAssert<Eq<…>>aliases compiled bycheck:test-typecheck) for the member set (id|rerankonly), readonlyid, the exact parameter tuple, the options bag, optionalopts, thePromise<Array<{ index; score }>>answer, the barrel re-export and the'reranker'literal; plus two runtime cases.model?: stringand atopKoption to the interface turnedcheck:test-typecheckred with 3 type errors inreranker.test.ts; restored from HEAD, clean.Acceptance notes
opts.signalis typed optional ({ signal?: AbortSignal }), asfetch'sRequestInitspells it; the epic's line writesopts?: { signal }. The docblock says the caller passes one.Verification
Local gates
At head
7d0eea72.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 90 commands;--ranreconciliation: 90 derived, 86 run (exit 0), 4 NOT MEASURED, 0 unrun.pnpm --filter @objectstack/spec typecheck(tsc, check:scripts-typecheck, check:test-typecheck) exit 0;vitest run --project local src/contracts/reranker.test.ts src/contracts/core-service-contracts.test.ts2 files, 13 tests passed.check:api-surface,check:export-origins,check:generated,check:authorable-surface,check:dual-source-exports,check:entry-nameability,check:exported-any,check:spec-docblock-symbol-anchors,check:changeset-no-major,check:empty-changeset,check:nul-bytes: exit 0 (all within the 86).check:doc-formula-expressions,check:dual-build-cjs-loads,check:lean-entry-closure(exit 3, prerequisite: other packages' dist not built here);check:type-check-debt(whole-workspace ratchet, not reached within the local time cap).node scripts/pm/overlap-check.mjs: clean against origin/main and feat(service-segmenter): a segmenter service that cuts a Chinese question into real words for the keyword leg #38744.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run --project local src/contracts/reranker.test.tsprints2 passed.Read first:
packages/spec/src/contracts/reranker.ts(the docblock is the contract text), thenreranker.test.ts.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v