Skip to content

Commit e81a44f

Browse files
fix(objectql): the unserved single knowledge_source warning says the item is not loaded (#38167)
Fixes #38063 ## 维护者速读 - 用户能看到什么变化:只有一个知识源条目、又没挂知识服务的部署,启动警告原先说"它已加载、已索引、可搜索",现在如实说"未加载"。 - 为什么做:该句与事实相反,会让人误以为知识源在工作。 - 出错会怎样:只是一行日志文字,可直接撤回。 - 要你做什么:无。 ## What changes `describeUnservedKnowledgeSources` rendered `it is loaded, indexed or searched` for exactly one item; it now renders `it is not loaded, indexed or searched`. The plural `none is` arm is unchanged. A patch changeset for `@objectstack/objectql` is included. Clause-②: no Metadata-protocol: none ## Tests - `packages/objectql/src/knowledge-source-unserved.test.ts`: the singular pin is the negated text, plus `not.toContain('it is loaded')`. - Red on the old source: 1 failed | 6 passed (expected the line to contain 'it is not loaded, indexed or searched'). - Green on the fix: 7 passed (7); `pnpm --filter @objectstack/objectql typecheck` exit 0, both under `os-verify-lock.sh` (VERDICT command-exit 0). ## Acceptance notes No other test, doc or fixture quotes the old singular sentence (`git grep "it is loaded, indexed"` hit only the test pin). ## Verification `pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/knowledge-source-unserved.test.ts` expects 7 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5253e16 commit e81a44f

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
fix(objectql): the boot warning for one knowledge_source item with no knowledge service says the item is not loaded
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
With exactly one `knowledge_source` item and no `knowledge` service registered, the warning read "it is loaded, indexed or searched", the opposite of the fact. It now reads "it is not loaded, indexed or searched". The plural wording ("none is loaded") is unchanged. Nothing to migrate.

‎packages/objectql/src/knowledge-source-unserved.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ describe('describeUnservedKnowledgeSources — items with no knowledge service (
1717
const line = describeUnservedKnowledgeSources(['faq'], false)!;
1818
expect(line).toContain("1 knowledge_source item ('faq')");
1919
expect(line).toContain("no 'knowledge' service is registered");
20-
expect(line).toContain('it is loaded, indexed or searched');
20+
expect(line).toContain('it is not loaded, indexed or searched');
21+
expect(line).not.toContain('it is loaded');
2122
expect(line).toContain('@objectstack/service-knowledge');
2223
expect(line).toContain('or remove the item.');
2324
// The remedy an author's save on such a deployment is refused with: the token, then a restart.

‎packages/objectql/src/knowledge-source-unserved.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function describeUnservedKnowledgeSources(names: readonly string[], servi
5050
return (
5151
`[ObjectQLPlugin] this deployment holds ${count} knowledge_source ${count === 1 ? 'item' : 'items'} ` +
5252
`(${shown}${rest > 0 ? `, and ${rest} more` : ''}), but no '${KNOWLEDGE_SERVICE}' service is registered, so ` +
53-
`${count === 1 ? 'it is' : 'none is'} loaded, indexed or searched. ${UNSERVED_REMEDY} or remove the ` +
53+
`${count === 1 ? 'it is not' : 'none is'} loaded, indexed or searched. ${UNSERVED_REMEDY} or remove the ` +
5454
`${count === 1 ? 'item' : 'items'}.`
5555
);
5656
}

0 commit comments

Comments
 (0)