Repository navigation
Description
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T01:19Z · Body amended: the split registers in the existing facade gate (see Amendment at the end).
Filing gate: ③ maintainer-directed. Source: maintainer, os-warren's fleet project thread, 2026-11-30T00:57:27Z, decision card 「立一张拆分 knowledge-service.ts 的卡,排在两个 PR 合并后第一个做吗?」 answered 「立卡并优先做」 (after the seat's advice: split along the concerns, move-only, one PR, land when no open PR touches the file).
Grading: area:ai · Task (engineering throughput, no product behaviour change) · Suggested-grade: p2 (the knowledge topic's next three cards queue on this file) · reach: every knowledge-topic card · evidence: measured on origin/main f5da514.
Blocked-by: #38599, #38606
维护者速读
- 问题:
knowledge-service.ts有 5,411 行、约 150 个方法,全在一个类里。保存校验、记录同步与对账、检索排序、索引构建都挤在这一个文件,所以知识专题的卡几乎都要改它,只能一张张排队。 - 做什么:按功能拆成几个模块文件,只搬代码、不改任何行为,单独一个 PR。
- 什么时候做:feat(service-knowledge)!: an author's knowledge source save is refused while the knowledge service is not enabled #38599 和 feat(knowledge): a knowledge source orders its hits for the person asking (
source.affinity) #38606 合并后第一个做,越快落地越好,避免和别人的改动冲突。 - 之后:service-knowledge: a backlog reconcile that starts during a bulk import re-embeds and re-writes every record the batch path is already syncing, doubling the embedding requests and writes #38591(对账)、knowledge-source save door words an absent
wherefield as a permission refusal #38471(保存校验)、knowledge_source: a hit brings its neighbouring content (expand, siblings slice of the #38412 ruling) #38504(检索相邻内容)各落不同文件,可以并行。 - 要你做什么:无。
What (measured at f5da514)
packages/services/service-knowledge/src/knowledge-service.ts holds class KnowledgeService (line 263) and about 150 members. Its concerns, by method:
- Build and index state:
planIndex,reindexSource,walkObjectSource,completeBuild,readIndexState*,rebuildSource,buildUnderLease,recordBuildStart,closeStaleBuild,closeInterruptedBuilds,buildSourcesAtBoot,buildIfDue,reconcilePass,reconcileOf(~L731–2236). - Search and answer:
search,searchWithRefusals,searchByKey,answerByRecord,checkFreshness,dropUnverifiedHits,planSearches,searchRound,sourcesNarrowedToVisible,readVisibleIds(~L2476–3272). - Record sync and backlog:
processRecordSync*,syncRecordGroup,recordSyncWaiting,considerBacklogReconcile,syncRows,handleRecordUpsert/Delete,syncRecord,syncRow,writeSynced, sync state and dead letters (~L1864–2074, L3431–4079). - Save admission and scoping:
admitSources,admitAuthoredSource,readTenancyPosture,scopeByOrganization,applyPermissionFilter(~L4079–4465+).
Ask
- Split the class's bodies into concern modules beside it (the dev proposes the cut and names, e.g.
knowledge-build.ts,knowledge-search.ts,knowledge-record-sync.ts,knowledge-admission.ts);KnowledgeServicekeeps its public surface and delegates. Move-only: no rename of a public member, no behaviour change, no new export from the package entry. - Tests move only when a test imports a moved private helper; the existing suites pass unchanged.
- One PR. Start from main after feat(service-knowledge)!: an author's knowledge source save is refused while the knowledge service is not enabled #38599 and feat(knowledge): a knowledge source orders its hits for the person asking (
source.affinity) #38606 merge, and land before any other card opens a PR on the file.
Acceptance
git diff --statshows the class body moved, not rewritten; the PR body maps each moved member to its new file.- Every
service-knowledgetest and the knowledge pins elsewhere pass unchanged; the package's public declaration (api-surface) is unchanged. knowledge-service.tsfalls well below 2,000 lines.- The PR registers the split in the existing facade gate: a
facadesrow forKnowledgeServiceand aceilingsrow forknowledge-service.tsinscripts/facade-delegation-registry.json(post-split line count asbaseLines, the existingCEILING_MARGINof 100), soscripts/check-facade-delegation-only.mjskeeps the file a facade. Every moved body lives in a concern module; a member that must stay in the facade (state-owning) gets anexceptionsrow with its reason.
Not here
- Any fix in service-knowledge: a backlog reconcile that starts during a bulk import re-embeds and re-writes every record the batch path is already syncing, doubling the embedding requests and writes #38591, knowledge-source save door words an absent
wherefield as a permission refusal #38471, knowledge_source: a hit brings its neighbouring content (expand, siblings slice of the #38412 ruling) #38504 (they follow on the new files). - A new gate on file length: none. Registering in the existing facade gate is not a new gate (amended 2026-11-30T01:19Z on the maintainer's word below).
Related: topic #37000, #38346, #38536.
Amendment 2026-11-30T01:19Z: maintainer (Warren, os-warren), os-warren's fleet project thread, 2026-11-30T01:18:13Z 「同意,立卡」 and 2026-11-30T01:18:26Z 「按照 fable的方案」, approving the large-file plan (isolated fable analysis; prior rulings 6624258595 on #29465 and 6897467376 on #33949: split files carry a ceiling, unsplit files none). Its step 1 is this card's registry rows above.
Activity
objectstack-fleet commentedon Nov 30, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
Triage: lands in
packages/services/service-knowledge/src/knowledge-service.tsand new concern modules beside it · area:ai · domain:server · Task · p2 · pm:blocked · size M.Rationale: a maintainer-directed, move-only split (decision answered 2026-11-30T00:57Z, quoted in the body). A refactor is a Task. It takes p2 under the blocker rule because the knowledge topic's next cards (#38591 and #38471 at p2) queue on this one file. It waits on the body's
Blocked-by:line, PRs #38599 and #38606. Grade and area are kept as filed. Answers knock 7265756280.objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T03:18Z · Claim · #38599 and #38606 merged (the body's
Blocked-by:line is clear); the maintainer's 「立卡并优先做」 puts this split first in the knowledge topic.Claim: PM loop round 1
Session:
session_01JQwxbXyLoBzNYY1U8SNPFuAccount:
os-warrenBranch: new, from
origin/mainatc35318c25d; the card thread's branch is named by a claim amendment on its first reportWorktree:
objectstack-issue-38660Domain:
domain:serverSeat:
repo:objectstack#2Area:
o2-A(area:ai)File surface:
packages/services/service-knowledge/src/knowledge-service.ts, new concern modules beside it underpackages/services/service-knowledge/src/, tests underpackages/services/service-knowledge/src/__tests__/only where a test imports a moved private helper,scripts/facade-delegation-registry.json(thefacades,ceilingsand anyexceptionsrows forKnowledgeService), one changeset if the dev finds a published byte moves (expected: none,skip-changesetotherwise) (stop on breach; explain in the report)Container & model: L, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card (maintainer-directed Task)
Thread-read: none
Premise: holds at
c35318c25d—knowledge-service.tsis 5,571 lines, one classKnowledgeService; #38599 and #38606 are on main; no open PR touches the file at this read except the knowledge cards queued behind this one (#38591, #38471, #38504, #38369 PR 3), none started.Serial constraints cleared: lands before any other card opens a PR on
knowledge-service.ts;overlap-check.mjsruns before every push.Pre-claim lane:
packages/services/service-knowledge/**⇒ domain:server (file ownership only); area:ai, zone o2-A.Pre-claim deps:
Blocked-by: #38599, #38606— both merged.Prior rulings read: the maintainer's 「立卡并优先做」 (2026-11-30T00:57:27Z) and 「同意,立卡」「按照 fable的方案」 (2026-11-30T01:18:26Z); facade rulings 6624258595 (#29465) and 6897467376 (#33949).
objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T03:22Z · Claim amendment to 7267792242: names the card thread's branch.
Claim: PM loop round 1 (amendment of 7267792242)
Session:
session_01JQwxbXyLoBzNYY1U8SNPFuThread session:
session_01JQwxbZLuMpo8YX4ACmyoNdAccount:
os-warrenBranch:
claude/project-thread-e6npb2(fromorigin/mainat39064f62)Worktree:
objectstack-issue-38660Domain:
domain:serverSeat:
repo:objectstack#2Area:
o2-A(area:ai)File surface: unchanged from 7267792242; concern-module names must not collide with the existing
knowledge-*modules (e.g.knowledge-build.tsalready exists)Container & model: L, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
Clause-②: no
Metadata-protocol: none
Thread-read: none
objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbZLuMpo8YX4ACmyoNd
os-dev-report
{ "issue": 38660, "status": "done", "branch": "claude/project-thread-e6npb2", "pr": "https://github.com/objectstack-ai/objectstack/pull/38700", "pr_number": 38700, "head_sha": "ad4f458a7cee52716072fa5581efa57f89d6d4e3", "session": "session_01JQwxbZLuMpo8YX4ACmyoNd", "premise_still_valid": true, "summary": "KnowledgeService (5,571 lines at 39064f62, confirmed) is now a 1,658-line facade: 114 members forward in one call to bodies in five concern modules (sources, indexing, record-sync, search, admission) plus knowledge-service-top-level.ts (every non-class top-level declaration, moved whole) and knowledge-service-host.ts (per-service host, SqlDriver/engine.ts precedent shape). Move-only: no member renamed, index.ts untouched, a throwaway token-identity verifier proved all 114 bodies and 68 top-level declarations identical (negative control reds), and the built index.d.ts is unchanged where public (KnowledgeService differs only by 70 private-member comments). Registered in the facade gate (facades row, ceilings row baseLines 1658 / maxLines 1758 at baseCommit 4c4a984345 ruling 6897467376, exceptions for constructor and knowledgeTools). PR body maps every moved member to its file and itemises net growth.", "tests": "At ad4f458a7c: os-verify-lock 'pnpm --filter @objectstack/service-knowledge test && ... typecheck' -> Test Files 25 passed (25), Tests 836 passed (836), typecheck clean, VERDICT command-exit 0. Knowledge pins elsewhere at 5fffac643b (package source differs from final head by 7 comment lines only): core 3/34, knowledge-memory 2/56, knowledge-turso 3/267, mcp 1/22, runtime 4/198, service-settings 4/192, objectql 1/7, rest 1/82, spec token-estimate 1/29, cli pin 1/2, all pass, VERDICT command-exit 0. NOT MEASURED: service-knowledge-pgvector live tests, reason: no Postgres in container. No ablation: no tested behaviour changed (move-only); move proven by token-identity verifier with negative control.", "gates": "Local, at ad4f458a7c: dispatch-gates --commands (repo objectstack-ai/objectstack, commit ad4f458a7c) derived 121; all run, exit codes captured before pipes; --ran: '121 derived famil(ies) accounted for - 118 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)'. Exit 0 includes check-facade-delegation-only (KnowledgeService 150 members, 123 delegations, 25 fields, 2 named exceptions; knowledge-service.ts 1658 lines, ceiling 1758) + self-test, tenant-audit-census + self-test, check:system-context-census, spec check:liveness, check:empty-state, changeset gates, check-plugin-teardown-shape --self-test, check:platform-checklist, check:pm-dispatch-gates. NOT MEASURED (exit 3, prerequisite: whole-workspace dist not built): spec check:skill-examples, check:dual-build-cjs-loads, check:published-readme-exports. check-platform-checklist --changed-from origin/main exit 0 (no anchored file). overlap-check before final push: VERDICT clean exit 0 (origin/main and #38497 merge cleanly). CI: PR check-runs on ad4f458a7c at report time 25 total: 1 success, 5 skipped, 19 in_progress -> NOT MEASURED: CI families, reason: not concluded when the report was written (convergence is the seat's).", "dogfood_battery": "n/a - no ! in the PR title and no (narrowing) arm (Clause-2: no)", "line_budget": "knowledge-service.ts 5,571 -> 1,658 (ceiling 1,758). New: knowledge-service-sources.ts 415, -indexing.ts 1,483, -record-sync.ts 944, -search.ts 1,147, -admission.ts 580, -top-level.ts 1,067, -host.ts 62. The eight knowledge-service*.ts class files together 5,571 -> 7,356 (+1,785: 114 stubs, 120-line static host block, 220 lines of host interfaces, 44 one-line facet docblocks, module headers/imports, re-export block, host module). Diff vs merge-base 25ac5dfa9: 14 files, +6,162 / -4,333 (10,495 changed lines, over 3,000: approval is the seat's/maintainer's).", "files_changed": [ ".changeset/38660-knowledge-service-split.md", "content/docs/permissions/system-context.mdx", "packages/services/service-knowledge/src/knowledge-service.ts", "packages/services/service-knowledge/src/knowledge-service-admission.ts", "packages/services/service-knowledge/src/knowledge-service-host.ts", "packages/services/service-knowledge/src/knowledge-service-indexing.ts", "packages/services/service-knowledge/src/knowledge-service-record-sync.ts", "packages/services/service-knowledge/src/knowledge-service-search.ts", "packages/services/service-knowledge/src/knowledge-service-sources.ts", "packages/services/service-knowledge/src/knowledge-service-top-level.ts", "packages/spec/liveness/knowledge_source.json", "scripts/check-facade-delegation-only.mjs", "scripts/facade-delegation-registry.json", "scripts/tenant-audit-census.mjs" ], "deviations": [ "Commit trailer: the dispatch's Co-Authored-By line names a model, which AGENTS.md and the pre-push hook refuse (and the dispatch itself says never put a model identifier in commits); commits carry the model-free pair Co-authored-by: Claude + Claude-Session instead.", "Changeset instead of skip-changeset: dist code moves between chunks (published bytes change), so one patch changeset; it names @objectstack/spec too because the liveness ledger ships there. No skip-changeset label sent.", "File-surface additions beyond the package, each forced by a gate reading moved code: check-facade-delegation-only.mjs (one DECLARED_WATCH_HINTS path, self-test N7), tenant-audit-census.mjs (one UNTYPED_RECEIVERS row for record-sync adapter receiver), system-context.mdx (generated register via --write, 4 anchors), packages/spec/liveness/knowledge_source.json (10 path#symbol citations repointed; check:liveness was red on documentKeyOf).", "One earlier push (1b7a98c75 or before) went out in the same command chain as an overlap-check that answered cannot-answer on a shallow clone; deepened, reran clean; the final push was preceded by a clean overlap-check.", "Pins in other packages were read at 5fffac643b, not the final head; the package source differs by comment lines only.", "PR body carries a plain 'Signed: repo:objectstack#2 · os-warren · session_...' line before the mandated tail (no HTML comment signature), so the body still ends with the required lines.", "Local-only reading: 3 gates and pgvector live tests NOT MEASURED (see gates/tests)." ], "mcp_calls": "0", "api_writes": "3 - fleet-write relay dispatch fw-20261130T053515Z-8e9c6d (run 46360583423) for pr_create: POST /repos/objectstack-ai/objectstack/pulls (#38700, draft, body read back byte-identical) + POST /repos/objectstack-ai/objectstack/issues/38700/assignees (os-warren); post-stamped.mjs: POST /repos/objectstack-ai/objectstack/issues/38660/comments (this os-dev-report). git push to claude/project-thread-e6npb2 is not a REST write.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T05:39Z · Claim amendment to 7267842463: names the PR and admits four gate-fed files and a patch changeset.
Claim: PM loop round 1 (amendment of 7267842463)
Session:
session_01JQwxbXyLoBzNYY1U8SNPFuThread session:
session_01JQwxbZLuMpo8YX4ACmyoNdAccount:
os-warrenBranch:
claude/project-thread-e6npb2, PR #38700Worktree:
objectstack-issue-38660Domain:
domain:serverSeat:
repo:objectstack#2Area:
o2-A(area:ai)File surface: 7267842463's, plus four files whose gates read the moved code, each admitted:
scripts/check-facade-delegation-only.mjs(watch hint),scripts/tenant-audit-census.mjs(one receiver row), the generatedsystem-context.mdx(--write), andpackages/spec/liveness/knowledge_source.json(10 citations repointed). Also one patch changeset for@objectstack/service-knowledgeand@objectstack/spec, because dist chunks move; it replaces the expectedskip-changeset.Container & model: L, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
Clause-②: no
Metadata-protocol: none
Thread-read: none
Size note: the diff is 14 files, +6,162/−4,333, over the 3,000-line human-merge threshold, so a person merges it after the seat's L1. The seat checks the move-only claim independently (token identity of the 114 delegated bodies and 68 moved declarations) before ACCEPT.
objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T08:04Z · Landed — card closed by the merge; seat label cleared.
PR #38700 (the move-only split of the knowledge service) merged at 2026-11-30T08:03Z as
e6b424b719. The cards that waited on the split (#38591, #38471, #38504) stay undispatched under the maintainer's hold on new objectstack-side knowledge cards.refactor(service-knowledge): split KnowledgeService into five concern…
perf(knowledge-turso): compute the keyword leg once a search; send a …