Repository navigation
Commit a705be0
refactor(service-knowledge)!: retire SPLIT_ALGORITHM_VERSION (#38452)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XPpqjfjwZCAyAm71ZUE2yhz)_
Fixes #38377
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no published skill, doc page or example names the
retired constant (git grep over `skills`, `content/docs`, `docs`,
`examples`, `apps`, `ui`, `.claude` at 4fa2f8e: 0 hits); the ADR text
is item 2, carried by the lander
## 维护者速读
- 用户能看到什么变化:用户无感;只有直接引用知识服务包里那个旧常量的宿主代码,升级后编译会提示删掉这行引用。
- 为什么做:知识平台「切分版本按策略计」之后的收尾,撤掉一个已经没有任何运行代码读取的公开常量,免得作者和 AI 以为改它有效。
- 出错会怎样:最坏是某个宿主仍引用它而编译失败,删掉那行引用即可;可直接撤回本改动,不会触发任何索引重建。
- 要你做的:无。
## What changes
`SPLIT_ALGORITHM_VERSION` leaves `@objectstack/service-knowledge` at
once, with no alias (the card's stage posture). Since the per-strategy
split version landed, the index fingerprint (ADR-0161 K7) reads
`SPLIT_ALGORITHM_VERSION_BY_STRATEGY` for the source's resolved
strategy, and the global constant was read by no runtime code.
- `src/split/splitter.ts`: the constant and its docblock are deleted.
The per-strategy table's docblock linked to it ("Every entry started at"
the constant); it now says every entry started at 1, the one split
version the fingerprint read before the table, which names no retired
symbol and stays true.
- `src/split/index.ts`, `src/index.ts`: both re-exports are deleted.
- `src/__tests__/index-fingerprint.test.ts`: the version pin keeps the
two remaining constants (`INDEX_FINGERPRINT_VERSION`,
`ASSEMBLY_RULE_VERSION`), and a new case pins the retirement: neither
the split barrel nor the package entry has the property, with a positive
control on the entry.
- Area-ordered additions (the sibling split card's L2 nit, comment text
only, no assertion, value or snapshot changed): two comments now name
both changes `markdown` version 2 carries, the body-less heading as its
own passage and a fitting section as one passage whatever `minChars` is.
One is the `markdown: 2` entry comment in
`SPLIT_ALGORITHM_VERSION_BY_STRATEGY` (`splitter.ts`); the other is the
`PINNED` docblock in `index-fingerprint.test.ts`. The second clause is
true only once PR #38439 merges; the seat lands this PR after it. The
table's docblock does not tie version 2 to one change, so it needed no
edit.
- `.changeset/38377-retire-split-algorithm-version.md`: `patch` (kind
`none`), BREAKING banner, FROM/TO table, a sentence saying this
retirement replaces the still-pending 38349 changeset's note that the
constant keeps its name and value (that changeset is not edited),
ADR-0087 disposition `not-required (runtime-export-retired
@objectstack/service-knowledge#SPLIT_ALGORITHM_VERSION)`.
Item 2 of the card (the ADR-0161 K7 revisions row) is not in this PR: no
`docs/adr/**` edit. The landing seat appends it to the weekly ADR
revisions card (`carrier:` PR #38375). `Fixes` stays because that row is
landing bookkeeping.
Landing: a narrowing of a published surface. It owes one
contract-review-tier L2 on its final head before the queue.
Read first: (1) `src/split/splitter.ts` — the reworded docblock is the
only prose a reader of the table keeps; (2) the changeset — it ships as
the CHANGELOG line an upgrader greps; (3) the new test case.
Two-minute check: `pnpm --filter @objectstack/service-knowledge exec
vitest run src/__tests__/index-fingerprint.test.ts` — expect 9 tests
passing, including "publishes no global split version beside the
per-strategy table".
## Tests
Package suite at `f76ba9c9`. At `987b09ca`, the last commit that touched
code or tests, `index-fingerprint.test.ts` alone under the verify lock:
Test Files 1 passed (1), Tests 9 passed (9), VERDICT command-exit 0.
<details><summary>service-knowledge test + typecheck (lock VERDICT
command-exit 0)</summary>
```
pnpm --filter @objectstack/service-knowledge test
Test Files 21 passed (21)
Tests 727 passed (727)
pnpm --filter @objectstack/service-knowledge typecheck
check:test-typecheck: OK, the test layer compiles under tsconfig.test.json; 0 file(s) / 0 error(s) held in test-typecheck-debt.json
```
</details>
<details><summary>Ablation of the new retirement pin</summary>
With `export const SPLIT_ALGORITHM_VERSION = 1;` appended to
`src/index.ts` on disk, `index-fingerprint.test.ts` went red: `publishes
no global split version beside the per-strategy table` failed with
`expected ... to not have property "SPLIT_ALGORITHM_VERSION"` (1 failed,
8 passed). Restored with `git checkout HEAD`, tree clean.
</details>
<details><summary>Full dogfood (the narrowing arm), at
`4fa2f8ee`</summary>
`pnpm turbo run build --filter='@objectstack/dogfood^...'` then `pnpm
--filter @objectstack/dogfood test` under the verify lock: VERDICT
command-exit 0, Test Files 495 passed, 3 skipped (498), Tests 4183
passed, 68 skipped (4251). `987b09ca` differs from `4fa2f8ee` by
comments only (`git diff --stat 4fa2f8e..HEAD`: 2 files changed, 4
insertions, 1 deletion; one hunk in `splitter.ts`, one in
`index-fingerprint.test.ts`, both comment lines). The final head
`42214359` adds one changeset sentence. So the battery was not re-run.
</details>
## Acceptance notes
- Whole-tree search before deleting, at `d751790c`: `git grep -n
'SPLIT_ALGORITHM_VERSION\b'` gave 13 lines. 5 were the declaration, the
two re-exports and the pin's import and assertion (all removed here); 1
was the per-strategy docblock link (reworded); the other 7 are history:
`.changeset/38349-split-version-per-strategy.md`,
`.changeset/pre/37100-knowledge-pgvector.md` and five generated
`CHANGELOG.md` files. They are left alone: existing changesets are never
edited, and CHANGELOGs are release-owned. No `skills`, `content/docs`,
`docs`, `examples`, `apps`, `ui` or `.claude` hit.
- The package has no API-surface baseline, so no generator was owed.
## Verification
<details><summary>Local gates (derived with dispatch-gates --commands,
reconciled with --ran: 63 derived, 63 run)</summary>
- 60 of 63 exited 0 on the first pass.
- `node scripts/check-adr-0087-registration.mjs --base origin/main` exit
1 on `0c4609e7` (the FROM column spelled an import statement, not the
operand); after the fix, exit 0 on `4fa2f8ee`: `not-required
(runtime-export-retired) -- verified:
@objectstack/service-knowledge#SPLIT_ALGORITHM_VERSION`.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` exit 3
(shallow clone could not reach its pinned fixture commit); after
fetching that commit, exit 0, 48 cases pass.
- `pnpm check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (needs
every package built). NOT MEASURED locally, CI runs it.
- Re-run at `4fa2f8ee` after the changeset fix:
check-changeset-no-major, check-empty-changeset,
check:changeset-gate-self-tests, check:nul-bytes, check:doc-authoring,
check:issue-citations: all exit 0. check:nul-bytes exit 0 again at
`f76ba9c9` and at `987b09ca`. At `42214359` (changeset sentence only),
check-adr-0087-registration, check-changeset-no-major,
check-empty-changeset and check:nul-bytes: all exit 0.
- `node scripts/check-platform-checklist.mjs --changed-from origin/main`
exit 0: 0 anchored files in the change set.
- `node scripts/pm/overlap-check.mjs` before each push: clean; at
`f76ba9c9`, `987b09ca` and `42214359` it also merges cleanly with PR
#38439.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FEkQ5omA3kZCsWzBMMqF11
<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5omA3kZCsWzBMMqF11 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 16f132f commit a705be0
5 files changed
Lines changed: 44 additions & 18 deletions
File tree
- .changeset
- packages/services/service-knowledge/src
- __tests__
- split
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 64 | | |
75 | 65 | | |
76 | 66 | | |
| |||
84 | 74 | | |
85 | 75 | | |
86 | 76 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
90 | 80 | | |
91 | 81 | | |
92 | 82 | | |
93 | 83 | | |
94 | 84 | | |
95 | 85 | | |
| 86 | + | |
| 87 | + | |
96 | 88 | | |
97 | 89 | | |
98 | 90 | | |
| |||
0 commit comments