docs(spec): KnowledgeSource docblock says runtime registration, not governed metadata - #17649
docs(spec): KnowledgeSource docblock says runtime registration, not governed metadata#17649os-bill wants to merge 1 commit into
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: [<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.
Part of #17464
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
📓 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): |
|
Superseded by #17653 — same content, byte-identical on both paths, on a fresh branch off current The reason is this PR's commit message: it carries the card relation, which the contract puts in the PR body only ( Generated by Claude Code |
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.
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.Part-of PR must not also close its card(check:partof-closing-keyword, RULE 2) is red, and it is my error: the single commit on this branch carriesPart of #17464in its message, while the contract puts the card relation in the PR body only. Reproduced locally, verbatim:The branch was already pushed when this surfaced, and the gate's own header is explicit that the repair is not a history rewrite: "Amend, rebase and force-push are forbidden in this repository and this gate never asks for one." On a pushed branch a new commit on top only joins the commit list. So ⛔ I did not amend, rebase or force-push, and ⛔ I did not push a cosmetic commit to paper over it.
Three facts from the gate's own output, so this can be read rather than acted on:
merge_groupevent.Part of #17464is what acts, andPart oflands as a reference that moves no card — the lowest-cost of the three spellings the rule refuses.What discharges it is the merge, and only a merge whose squash message is the PR body. That is the lander's call under the rules that bind them, ⛔ not mine and ⛔ not this gate's.
Generated by Claude Code