Skip to content

knowledge: E0 offline pre-evaluation — today's windows against the segmenter service on the 132-question set, keyword-only and hybrid at several keyword weights (script here, run by the data holder) #38843

Description

@objectstack-fleet

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

Carries row E0 of topic #38711 (中文关键词检索质量). The topic keeps every other row.

维护者速读

Ruling and inputs

What

  1. An offline recompute script, by default under packages/services/service-segmenter/bench/ (the dev picks by precedent: knowledge-pgvector:检索分段计时与 PostgreSQL 基线(专题 #38703 B1) #38719 claims packages/plugins/knowledge-pgvector/bench/**, and names the place in the PR). It is not shipped and not run in CI.
    • Input: files the holder exports from the local store:
      • the questions with their gold clause ids, and the unit scope where the original run used one;
      • the passages: id, text, unit;
      • for each question, the vector leg's ranked ids, so no embedding call is needed.
        The script documents the exact shape.
    • Keyword leg: the adapters' rule, reproduced offline as 知识库混合检索在中文口语问题上比只用向量更差:关键词一路的滑动窗口切词 + 等权 RRF #38671 did: BM25-IDF weighting, 40 candidates (topK 8 × 5). It runs twice: with today's windows (core keywordTerms()) and with the segmenter service (platform defaults, no administrator entries).
    • Fusion: RRF k = 60 at equal weight (today's fuse(), the 0.5 case), plus a few keyword weights below it (for example 0.33 and 0.25), named as parameters.
    • Output: hit@1, hit@3 and hit@8 for vector-only, keyword-only (both cuts) and hybrid (both cuts × each weight), with and without unit scope.
  2. A self-test on a small synthetic fixture checked into the bench folder. It shows the pipeline end to end and pins one number per row, so the holder's run starts from a script known to work.

Not in scope

Acceptance

Activity

  1. added
    priority:p1
    pm:queue
    area:ai
    on Dec 1, 2026
  2. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    Triage: first-touch audit · lane grade kept: Task · p1 · area:ai · pm:queue · domain:server added.

  3. added
    domain:server
    on Dec 1, 2026
  4. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

    2026-12-01T08:49Z · Claim · #38843 (topic #38711 row E0): the offline recompute script and its synthetic self-test. The data holder runs it locally, per the maintainer's 「数据持有人本地跑」 recorded in this card's body. It builds on @objectstack/service-segmenter (#38744, merged at d7d46059).

    Claim: PM loop round 1
    Session: session_01RKKVngFfp7HBk6JUUr5vfN
    Account: baozhoutao
    Branch: claude/issue-38843-e0-offline-recompute
    Worktree: objectstack-issue-38843
    Domain: domain:server
    Seat: repo:objectstack@baozhoutao
    File surface: packages/services/service-segmenter/bench/** (reason: the new bench folder: script, README, synthetic fixture, self-test); ⛔ packages/services/service-segmenter/package.json and src/** (held by #38710 PR 2, claim amendment on #38710), every product file, both knowledge adapters (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier: "Model tier — no path-derived mandate"), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 7301075391
    Premise: holds
    Serial constraints cleared: check-handover.mjs --inflight on packages/services/service-segmenter/bench reads no overlap. The one unread surface (#38415) is unrelated. #38710 PR 2 holds the rest of the package; its surface was narrowed to exclude bench/** (claim amendment on #38710).

    Dispatch order: an in-seat os-dev subagent.

    • No product code.
    • The script runs offline under node on the holder's export: no network, no database.
    • Keyword leg: BM25-IDF, 40 candidates, run twice, with core keywordTerms() and with the segmenter service.
    • Fusion: RRF k=60 at equal weight plus named lower keyword weights.
    • Output: hit@1, hit@3 and hit@8, with and without unit scope.
    • A synthetic self-test pins one number per row.
  5. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 1, 2026
  6. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN
    os-dev-report

    {
      "issue": 38843,
      "status": "done",
      "branch": "claude/issue-38843-e0-offline-recompute",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38886",
      "session": "session_01RKKVngFfp7HBk6JUUr5vfN",
      "premise_still_valid": true,
      "summary": "Added the E0 offline recompute under packages/services/service-segmenter/bench/ (placed by the knowledge-pgvector/bench precedent): run.mjs (the node command, loading keywordTerms() from built @objectstack/core and createSegmenterService() from built @objectstack/service-segmenter, refusing on the sliding-window fallback), recompute.mjs (export checks, BM25-IDF keyword leg over the passages in scope with 40 candidates = topK 8 x SEARCH_FIRST_ROUND_FACTOR 5, weighted RRF (1-w)/(60+v) + w/(60+k) whose w=0.5 orders exactly as today fuse(), hit@1/3/8 table with and without unit scope), README (export shape, command, matched and unmatched), a synthetic fixture and a vitest self-test the package test run picks up. Mechanism assumptions verified on main 19bccf68: createSegmenterService() is exported and loads @node-rs/jieba 2.0.4 offline (engine dictionary, cut mode cut); keywordTerms() is exported from @objectstack/core and its body is byte-identical to both adapters sql.ts copies. Note for the holder report: the platform words include 年假 and 脱密, the words the two questions quoted on the first measurement lacked, so not tuned on these questions holds for the set, not for those two words; the README says so.",
      "tests": "At afcef411: pnpm --filter @objectstack/service-segmenter exec vitest run --maxWorkers=2 bench/recompute.test.mjs -> Tests 11 passed (11); pnpm --filter @objectstack/service-segmenter test -> Test Files 4 passed (4), Tests 40 passed (40), exit 0 (bench/recompute.test.mjs listed); typecheck exit 0 (unaffected: tsconfig includes src only). node run.mjs --dir bench/fixture on built dist: exit 0, header segmenter = @objectstack/service-segmenter, jieba (cut), no entries. Scale: synthetic 60,000 passages x 132 questions x 1,000-id vector lists, 20 s wall on a shared container, exit 0. Ablations via scripts/ablation-replace.mjs (source-imported .mjs, no build leg), each restored to HEAD blob with git diff HEAD empty: fusion weight forced to 0.5 -> 3 failed / 8 passed; IDF forced to 1 -> 2 failed / 9 passed (first round reddened only the fixture pins, so 49d120bc added a hand-computed rare-term case).",
      "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack over 7 paths derived 47 commands; 44 exit 0; 3 NOT MEASURED on their own prerequisite: pnpm check:dual-build-cjs-loads :: exit 3 (whole tree not built), pnpm check:lean-entry-closure :: exit 3 (objectql dist absent), node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3 (shallow clone; checker-health only). --ran reconciliation: 47 derived, 44 run, 3 NOT-MEASURED, 0 UNRUN, all with exit codes recorded. eslint --no-inline-config on bench/: exit 0. CI at report time (head afcef411): Check Changeset success; Lint, Type Check, Governed Surface Queue Guard, PR-body guards in_progress; not awaited per os-dev.",
      "line_budget": "+955 / -0 over 7 new files, every one under 1,000 lines: recompute.mjs 382, recompute.test.mjs 232, run.mjs 128, README.md 165, fixture JSON 48; under the 3,000 human-merge threshold.",
      "files_changed": [
        "packages/services/service-segmenter/bench/README.md",
        "packages/services/service-segmenter/bench/run.mjs",
        "packages/services/service-segmenter/bench/recompute.mjs",
        "packages/services/service-segmenter/bench/recompute.test.mjs",
        "packages/services/service-segmenter/bench/fixture/passages.json",
        "packages/services/service-segmenter/bench/fixture/questions.json",
        "packages/services/service-segmenter/bench/fixture/vectors.json"
      ],
      "deviations": [
        "Three vitest runs of bench/recompute.test.mjs (the two ablation legs and one green re-run, about 8 s each) ran outside os-verify-lock.sh; every other build and test went through it.",
        "The PR body carries no attribution footer: pr_create read back byte-identical (8067 sent, 8067 stored, nothing appended), and a dev does not PATCH a PR body; the seat may add it.",
        "origin/main was not merged before opening: the branch is 5 commits behind, none touching service-segmenter, core keyword-terms or either knowledge adapter, and the diff is add-only under bench/.",
        "Commits carry the model-free trailer pair AGENTS.md requires, not the harness Co-Authored-By line naming a model."
      ],
      "mcp_calls": "0",
      "api_writes": "2 strokes: (1) relay pr_create = POST /repos/objectstack-ai/objectstack/dispatches, executed as POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /repos/objectstack-ai/objectstack/issues/38886/assignees [baozhoutao] + POST /repos/objectstack-ai/objectstack/issues/38886/labels [skip-changeset]; (2) this report comment on #38843 via post-stamped.mjs. git push (3 pushes plus the probe) is not a REST write.",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: the segmenter platform words include 年假 and 脱密, drawn from the first measurement quoted questions; a provenance note for the holder report, recorded in bench/README.md and the PR acceptance notes"
      ]
    }
  7. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN
    os-dev-report

    {
      "issue": 38843,
      "status": "done",
      "branch": "claude/issue-38843-e0-offline-recompute",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38886",
      "session": "session_01RKKVngFfp7HBk6JUUr5vfN",
      "premise_still_valid": true,
      "summary": "REWORK round 1 (L1 comment 7306759677) is addressed at new head 9e5a234f (was afcef411), changing only bench/**. E1: recompute.mjs header and README Candidates now state the real condition. The service asks topK x 5 = 40 in the first round when the search is grouped or permission-filtered (widened = byRecord || filtered, knowledge-service-search.ts:228), whatever its scope. An ungrouped system search asks 8. The run models the grouped groupBy clause_hash search the first measurement ran, and --first-round-factor 1 models the ask of 8. E2: Reading the numbers now says the first measurement counted its first column at the policy level over 118 questions and its hit@3/8 at the clause level over 70, so it is not comparable with this clause-level hit@1. It gives the second-run recipe: same vectors.json, policy ids as clause, gold policies as gold, read the scoped vector-only hit@1, which is the 79.7% cell (94/118); read only hit@1 of that run. E3: new test: x holds one rare term; y and z hold two terms that are common in scope. Scoped (n = 3), x leads: 0.981 vs 0.940. Over all 100 passages, y leads: 4.210 vs 7.398. The test pins scoped hit@1 1 and unscoped 0. The old single-term case keeps only its out-of-scope pin, and its comment now says so. Nits, both done: affinity re-ordering (ADR-0161, K1 note) added to the README rest-of-a-search list; the parity test comment now says it compares against a hand copy of the stores fuse(), not an import, and that a change to the stores fuse() does not red it. PR body and the Fixes #38843 line untouched; PR stays draft.",
      "tests": "At 9e5a234f, all under os-verify-lock.sh. bench/recompute.test.mjs: Tests 12 passed (12). pnpm --filter @objectstack/service-segmenter test: Test Files 4 passed (4), Tests 41 passed (41). typecheck exit 0 (joined with &&, VERDICT command-exit 0). eslint --no-inline-config bench/: exit 0. E3 ablation via scripts/ablation-replace.mjs: inScopeCount = inScope.filter(Boolean).length changed to inScopeCount = passages.length (n counted over all passages). Result: 1 failed / 11 passed; only the new scoped-IDF test went red, and the fixture pins held, matching the seat probe. Restored: blob == HEAD 84baca4f6a6c, git diff HEAD empty.",
      "gates": "At 9e5a234f: dispatch-gates --commands re-derived the same 47 commands over the same 7 paths. 44 exit 0. Three are NOT MEASURED, each refused on its own prerequisite, as at afcef411: pnpm check:dual-build-cjs-loads :: exit 3 and pnpm check:lean-entry-closure :: exit 3 (whole tree not built); node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3 (shallow clone; checker-health only). --ran: 47 derived, 44 run, 3 NOT-MEASURED, 0 UNRUN. CI on 9e5a234f at report time: 26 success, 19 skipped, 1 in_progress, 0 failed; not awaited.",
      "line_budget": "Round 1: +57 / -9 over 3 files (README.md, recompute.mjs, recompute.test.mjs). PR total +1003 / -9 over 7 files, each under 1,000 lines, below the 3,000-line threshold.",
      "files_changed": [
        "packages/services/service-segmenter/bench/README.md",
        "packages/services/service-segmenter/bench/recompute.mjs",
        "packages/services/service-segmenter/bench/recompute.test.mjs"
      ],
      "deviations": [
        "The worktree was rebuilt on the existing local branch with git worktree add, after checking that the local branch and origin are both at afcef411. dev-worktree.sh --resume-from refused because the local branch already existed from the removed round-0 worktree.",
        "The re-run of the 47 derived gate commands outlived the 600 s foreground cap, and the harness moved it to the background. Its result was awaited in-turn with a bounded until-loop and read before this report.",
        "Carried from round 0: the PR body has no attribution footer; the seat refreshes the body."
      ],
      "mcp_calls": "0",
      "api_writes": "1 this round: this report comment on #38843 via post-stamped.mjs (relay). git push is not a REST write. No PR body, label or assignee write.",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  8. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

    2026-12-01T10:39Z · Landed: PR #38886 merged as b26bb22aa6 and closed this card through Fixes. The pm:dispatched state label comes off now, as the closing rule requires. The data holder's run of the script is filed as its own pm:awaiting-maintainer card under topic #38711 (named in the next seat comment there).

  9. removed
    pm:dispatched
    on Dec 1, 2026
  10. added a commit that references this issue on Dec 1, 2026
    b26bb22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions