docs(spec): KnowledgeSource docblock says runtime registration, not governed metadata - #17653
Merged
Merged
Conversation
…overned metadata
The docblock above `KnowledgeSourceSchema` claimed it is "Stored as
metadata, versioned, and environment-scoped exactly like a view or a
flow". Measured on this tree: `listMetadataTypeSchemaTypes()` returns 26
governed types with none knowledge-shaped (controls `view`, `flow`,
`skill`, `agent`, `tool` all present), `ObjectStackDefinitionSchema` has
44 top-level keys with none knowledge-shaped, and
`defineStack({ knowledgeSources: [...] })` is refused with the generic
unrecognized-key message — identical to a `zzz_nonsense` dark control —
while `defineStack({ skills: [a valid skill] })` is accepted as the lit
control.
No ADR says it ought to be a governed metadata type; the rest of the
contract already says the opposite (`IKnowledgeService.registerSource`,
`KnowledgeServicePlugin({ sources })`, the process-lifetime source Map,
and the `agent.knowledge` liveness row). The prose was the outlier, so
the prose is what moves: the replacement states the schema is the shape
of a runtime registration, names both routes a source arrives by, and
says retrieval is restricted per-source at the service level.
Prose only — no schema, no registry, no key. `gen:schema` and `gen:docs`
produced no artefact change. The card relation is declared in the pull
request body, which is its only carrier.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 135 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This was referenced Sep 11, 2026
os-bill
marked this pull request as ready for review
September 11, 2026 14:03
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #17464
The docblock above
KnowledgeSourceSchemaclaimed, verbatim:None of the three is true. This PR corrects the prose. No schema, no registry entry, no key — the diff is one docblock plus its changeset.
Supersedes #17649
#17649 carried the identical content, but its single commit message also carried the card relation, which the contract puts in the PR body only (
check:partof-closing-keyword, RULE 2). On an already-pushed branch nothing clears that red, and amend / rebase / force-push are forbidden here — so this is a fresh branch off currentmainwith a card-trailer-free commit message, ⛔ not a rewrite of anything published. #17649 is superseded and its branch is left in place.Content byte-identity was proven rather than assumed: both paths hash-match
7bd20c60eaexactly (git hash-objectcompared againstgit rev-parse 7bd20c60ea:PATH), so the reviewed text is unchanged.gen:schemaandgen:docswere re-run on the newer base and again produced no artefact change.Fork (a) vs (b) — the measurements support (a): the PROSE is wrong
The card allowed for the possibility that the registry, not the sentence, is the defect. It is not, on three independent grounds measured on this tree:
KnowledgeSourceought to be governed metadata.grep -rln "KnowledgeSource\|knowledge source" docs/adr/returns zero files — no ADR in this repo mentions it at all.IKnowledgeService(packages/spec/src/contracts/knowledge-service.ts) declaresregisterSource/unregisterSource/listSources/getSource;KnowledgeServicePlugintakes asourcesoption and callsregisterSourcefor each atinit();KnowledgeServiceholds them in a plain process-lifetimeMap.packages/spec/liveness/agent.json, rowprops/knowledge, statusdead: "restrict retrieval at the knowledge-service/source level; describe grounding ininstructions".So the sentence was the outlier, and the sentence is what moves. ⛔ Nothing here assumes (b) will happen later — the new text describes only what is true today.
The three prerequisite readings (re-taken on
origin/main, ⛔ not inherited from the card)The card's counts were taken on the installed
@objectstack/spec17.4.0. These were re-taken against the tree under test, with the import resolution proven to the worktree build (import.meta.resolvereportedfile:///home/user/objectstack-issue-17464/packages/spec/dist/kernel/index.mjs), basebc2bf01c8a.1 · The docblock still carried the sentence. Anchored by content, ⛔ not by line. The sentence wraps across a line break, so a contiguous
grepreads0— a mistyped anchor, not an absence. Whitespace-flattened first, then counted by occurrence:Census over tracked files only (
git ls-tree, so the builtdist/cannot pollute it): the phraseexactly like a view or a flowoccurs in exactly 1 tracked file — the target.2 · Registry read, with the card's own control reproduced.
3 · No stack-authoring route — with a LIT control.
REJECTED (3 issues). Reading the full message showed field-level errors insideskills.0(label/toolsrequired) — a recognized key failing its element schema, not an unrecognized-key refusal. The probe was re-run with a valid skill, which is theACCEPTEDline above.The correction
The replacement docblock states what the schema actually is — the shape of a runtime registration — names both routes a source arrives by, and records that retrieval is restricted per-source at the service level. It explicitly contrasts against
view/flow/skill/agent/toolso the next reader does not have to re-derive the measurement above.Changeset:
patchon@objectstack/spec, graded honestly⛔ Not
skip-changeset: this text is published twice over.files[]shipsdistandsrc/**/*.zod.ts.Measured over 126 built declaration files. The changeset is committed, not a working-tree edit, so the gate that reads it out of git can see it.
Generators
gen:schemaandgen:docswere run; both produced no artefact change.content/docs/references/ai/knowledge-source.mdxmirrors the file-level header docblock, not this per-schema one — consistent with the 1-file census above. ⛔ Nothing generated was hand-edited.Verification — all at
7bd20c60eaGate families derived mechanically with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(it takes its own change set from the merge base), then reconciled with--rancarrying a recorded exit code per family:check:docs,check:api-surface,check:authorable-surface,check:llms-txt,check:liveness,check:nul-bytes,check:published-files,check:changeset-no-major,check:empty-changeset,check:spec-docblock-symbol-anchors.check:dual-build-cjs-loadsandcheck:lean-entry-closureboth refuse their own prerequisite — they read built output and 83 workspace packages have nodist/in this worktree. Clearing them needs a repo-widepnpm build; that is CI'sBuild Core. ⛔ Recorded as NOT MEASURED, ⛔ not as green.check:doc-formula-expressions,check:api-surface,check:browser-reachable-entries,check:dual-source-exports,check:entry-nameability,check:exported-anyfirst returned a prerequisite refusal (diststale against the editedsrc; one at exit 3, five at exit 1 — a refusal does not always arrive as exit 3). After rebuilding@objectstack/spec,@objectstack/formulaand@objectstack/lint, all six are green. The whole@objectstack/speccheck family (17 gates) was additionally re-run on the rebuilt tree, since a green taken against a staledistis a false green.Tests / typecheck (affected package is
@objectstack/spec; the published surface is byte-unchanged apart from TSDoc, so no consumer owes a test):Both ran through
scripts/pm/os-verify-lock.sh; verdicts read from the printedVERDICT command-exitline, ⛔ never from a bare status after a pipe.Lint — a declared narrowing, with its three readings.
pnpm lintis a repo-wide scan CI owns; this PR ran the narrowed set and proves the narrowing excluded nothing:ESLint#isPathIgnoredovergit ls-files: 6615 files are under lint.--format json: 2 —packages/spec/src/ai/knowledge-source.zod.ts(0 errors, 0 warnings) and the changeset.md, whose only message isFile ignored because no matching configuration was supplied.eslint --no-inline-configexited 0.eslint.config.mjsand it never enables type-aware linting for any file — noparserOptions.project, no typed@typescript-eslintrules. The config states this in its own words ateslint.config.mjs:326-329, with a positive control recorded there. A TSDoc edit inside one file therefore cannot move any untouched file's verdict.Acceptance notes (out of scope, ⛔ not filed)
packages/spec/llms.txtlistsKnowledgeSourceSchemain theaifamily besideAgent/Skill/Toolas "Retrieval sources backing RAG grounding" (lines 38 and 126), with nothing marking it service-level rather than authorable. That is an incompleteness, not a false statement — the line says nothing about metadata storage — so it fails the (a) bar (a wrong statement) and is outside this PR's declared file face. Noted, not filed. Carrier: the card's own third option (spec:KnowledgeSourceSchema's own docblock says it is "stored as metadata … exactly like a view or a flow", but it is not a governed metadata type and no stack collection carries it #17464 explicitly offers "add aguidanceentry" as a sibling remedy), which is where this belongs if the seat wants it.ObjectStackDefinitionSchemahas noguidanceentry for a knowledge-shaped key, sodefineStack({ knowledgeSources: … })still fails with the generic message that points nowhere. This is the card's second listed option and a schema edit — ⛔ out of scope here by the claim's "prose only". Noted, not filed; carrier: spec:KnowledgeSourceSchema's own docblock says it is "stored as metadata … exactly like a view or a flow", but it is not a governed metadata type and no stack collection carries it #17464 itself, which already records it.Generated by Claude Code