You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
knowledge-source save door words permanent reference mistakes as temporary or as permission refusals #38419
Found by the release-candidate priority:P0 round #38417 at main ff69bcab; the full per-clause evidence is on that record.
With the knowledge service mounted, saving a knowledge source that points at an absent object answers 503 SERVICE_UNAVAILABLE "... could not be judged ... try again"; an absent sys_ object answers 403 "is a system object that does not opt into AI reads"; an absent field answers 403 "you may not query field ... hidden from you". The save-time permission check runs before the reference rules and has no "does not exist" arm. os validate / os lint name knowledge-source-object-unknown / -field-unknown correctly. Reproduced on two boots at ff69bca; wording dates from #37676 (2026-11-27). Done when the save door names the absent object or field as such, with the same rule names the CLI uses.
QA-source: #38417 · off-checklist knowledge-retrieval · leg B4 (invalid source refused with a named rule)
Triage: lands in packages/services/service-knowledge/src/knowledge-service.ts (the save-time admission ~L3733-3860: the 503 arm and the field and system-object 403 arms run before any "does not exist" arm), with pins reusing the rule names in packages/lint/src/validate-knowledge-source.ts · area:ai → area:build · domain:server · Bug · p2 · pm:queue · size S. Rationale: a knowledge_source save names a permanent reference mistake as temporary, or as a permission refusal. Writing metadata, and refusing it loudly with the right prescription, is area:build core ② (North Star boundary: writing metadata ⇒ area:build). os validate names the right rule (the workaround), so Impeded × builders ⇒ p2. Reproduced twice in QA round #38417. ⛔ The new "does not exist" arm must be decided only from metadata the saving author may already read, so no permission answer changes for anything that exists.
Claim: PM loop round 1
Session: session_016WV4d13AraSmVmgVtCvkWk
Account: os-elon-musk
Branch: claude/issue-38419-knowledge-source-absent-ref
Worktree: objectstack-issue-38419
Domain: domain:server
Seat: repo:objectstack#1
File surface: packages/services/service-knowledge/src/knowledge-service.ts (save-time admission), a new test file in packages/services/service-knowledge/src/, .changeset/*.md
Container & model: S, mode:subagent, model: default (dispatch-gates --tier: no MANDATORY line), effort: high (reason: S but not mechanical — a new does-not-exist arm beside permission arms, M treatment)
Clause-②: no
Metadata-protocol: none
Responsibility: @objectstack/service-knowledge (objectstack) — the save-time permission check runs before any "does not exist" arm | os validate / os lint (knowledge-source-object-unknown / -field-unknown) | builders saving a knowledge source through Studio or MCP
Thread-read: 7248406300
Premise: holds — reproduced on two boots in #38417 at ff69bca; no commit touches the package on ff69bca..0c1b2ff
Serial constraints cleared: none — clear on the surface; #38418 (same package, knowledge-sync-state.ts, this seat) is a different file. If the fix adds a NEW error code (ERROR_CODE_LEDGER / StandardErrorCode) the dev reports it and this claim becomes Clause-②: yes
Maintainer's word for this wave, verbatim: 「有问题都修,暂时也只是发 next 版」 (2026-11-29T00:44Z, os-elon-musk fleet project). Card from QA round #38417.
{
"issue": 38419,
"status": "done",
"branch": "claude/issue-38419-knowledge-source-absent-ref",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38465",
"session": "session_016WV4d13AraSmVmgVtCvkWk",
"premise_still_valid": true,
"summary": "KnowledgeService.admitAuthoredSource (the save-time admission every knowledge_source save door asks: REST and runtime /meta PUT, the MCP draft save, the package duplicate) gains a does-not-exist arm ahead of every permission arm. An absent source.object, or a content/contentFields/metadataFields member that is neither declared nor id or an injected system column (resolveInjectedSystemColumns), is refused 400 VALIDATION_ERROR naming the object (and field) and the os validate rule knowledge-source-object-unknown / knowledge-source-field-unknown. Existence is decided from the registered object definition only: every door admits only a manage_metadata holder, who ADR-0106 D4 serves every definition whole, so no permission answer about anything that exists changes (pinned byte for byte). No new error code; reproduced on base first: absent object 503, absent sys_ object 403, absent field 403.",
"tests": "New src/__tests__/knowledge-source-save-absent-reference.test.ts (15 cases). RED with knowledge-service.ts restored from base 0c1b2ffe: 'Tests 7 failed | 8 passed (15)' (absent object 'status: 503', absent sys_ object 'status: 403', absent field 'status: 403'; the 8 exists-unchanged pins pass on base, their sentences taken from it). GREEN at head cf125c96 after pnpm turbo run build --filter='@objectstack/service-knowledge...' --concurrency=2 (Tasks 20 successful, 20 total): pnpm --filter @objectstack/service-knowledge test 'Test Files 22 passed (22) / Tests 741 passed (741)'; pnpm --filter @objectstack/service-knowledge typecheck: tsc --noEmit clean, 'check:test-typecheck: OK, 0 file(s) / 0 error(s)'; lock 'VERDICT command-exit 0'. No ablation beyond the base-restore red run (it is the reverse verification: the test file changed nothing else).",
"gates": "Local: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at cf125c96 derived 71 commands; each run with exit captured before any pipe; --ran: '71 derived famil(ies) accounted for, 70 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)'. NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, reason: PREREQUISITE NOT MET (positive control pinned to commit 621a4876 unreachable in this shallow clone; checker health only). check:dual-build-cjs-loads exit 0 at cf125c96 ('126 published require entry point(s) across 74 package(s) load'). An earlier run at 6113ebff (before the origin/main merge) also reconciled: 69 run, 2 NOT-MEASURED. CI check-runs on PR head cf125c96, read once at report time: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, docs & code guards, repo & tooling gates, CI release & engine gates, PM dispatch-gates, scoped x3), PR-body guards, Type Check (workspace, source gates, consumer gates, debt ledger): all in_progress; Test Core / Build Core not yet listed. NOT MEASURED: every CI family, reason: not concluded when the report was written (convergence is the PM's).",
"dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "2 relay strokes (POST /repos/objectstack-ai/objectstack/dispatches, run as objectstack-fleet[bot]): (1) pr_create, run 46220981199 success: POST /repos/objectstack-ai/objectstack/pulls (draft, #38465) + POST /repos/objectstack-ai/objectstack/issues/38465/assignees [os-elon-musk], body read back 7981/7981 bytes identical; (2) this report: POST /repos/objectstack-ai/objectstack/issues/38419/comments via post-stamped.mjs. git push (4 pushes of the branch, not REST) excluded.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"class: a · reach: public save door, PUT /meta/knowledge_source/:name answers through admitAuthoredSource; measured by calling KnowledgeService.admitAuthoredSource at cf125c96 with source.where { stauts: 'open' } over object ticket (no field stauts): with a security service it answers 403 PERMISSION_DENIED \"its `where` reads field 'stauts' of object 'ticket', which you may not query (it is hidden from you, or served to you masked)\"; with none it is admitted. Same family as this card (a permanent reference mistake worded as a permission refusal), not fixed here: os validate does not judge where fields either (validate-knowledge-source.ts checks content/metadataFields only), so no rule name exists to reuse, and the existing pin holding an unknown where operator ($nor) at 403 field '$nor' would move; a fix needs a rule in packages/lint plus the save-door arm. · Seam: spec:ObjectKnowledgeSource.where -> runtime:KnowledgeService.admitAuthoredSource (selectingFieldsOf) · dedupe words: knowledge source where absent field, where field does not exist, knowledge-source-where-field-unknown, selectingFieldsOf save door"
],
"line_budget": "size S; diff vs origin/main (three-dot): 3 files, +371 / -1 (372 changed lines, under the 3000 human-merge threshold); knowledge-service.ts +91/-1, new test +258, new changeset +22",
"files_changed": [
".changeset/38419-knowledge-source-save-absent-reference.md",
"packages/services/service-knowledge/src/__tests__/knowledge-source-save-absent-reference.test.ts",
"packages/services/service-knowledge/src/knowledge-service.ts"
],
"deviations": [
"Commit trailers: the harness attribution reminder asked for a model-named Co-Authored-By trailer; AGENTS.md (attribution footer rule, and the pre-push hook) requires the model-free pair, so every commit carries Claude-Session + 'Co-authored-by: Claude'. PR body footer uses the AGENTS.md session-URL form, not the harness's.",
"The new test file sits in src/__tests__/ (where every test of this package lives) under the claimed 'new test file in src/'; it carries its own small harness because the sibling admission test's helpers are file-local, not a shared harness file.",
"Merged origin/main (0c1b2ffe..1afd9c13, 5 commits; none touches packages/services/service-knowledge, packages/core or packages/spec/src/data beyond a field.zod.ts describe) into the branch before opening the PR, per AGENTS.md multi-agent section 10; merge commit cf125c96, after which the closure was rebuilt and the package suite and the gate union were rerun.",
"The red run restored the base knowledge-service.ts into the working tree unstaged, then git restore --source=HEAD --staged --worktree; git status was clean after. A one-off tsx probe for the where finding was copied into the package directory, run, and removed; nothing of it was committed.",
"No skip-changeset label (the diff publishes); no labels sent."
]
}
Delivered by PR #38465, merged as 24d808d. Saving a knowledge_source whose source.object, content, contentFields or metadataFields names something that does not exist is now refused 400 VALIDATION_ERROR with the os validate rule name, instead of a permission or try-again answer. The source.where sibling is card #38471. Nothing left on this card; pm:dispatched removed.
Activity
objectstack-fleet commentedon Nov 29, 2026
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Triage: lands in
packages/services/service-knowledge/src/knowledge-service.ts(the save-time admission ~L3733-3860: the 503 arm and the field and system-object 403 arms run before any "does not exist" arm), with pins reusing the rule names inpackages/lint/src/validate-knowledge-source.ts· area:ai → area:build · domain:server · Bug · p2 · pm:queue · size S. Rationale: aknowledge_sourcesave names a permanent reference mistake as temporary, or as a permission refusal. Writing metadata, and refusing it loudly with the right prescription, is area:build core ② (North Star boundary: writing metadata ⇒ area:build).os validatenames the right rule (the workaround), so Impeded × builders ⇒ p2. Reproduced twice in QA round #38417. ⛔ The new "does not exist" arm must be decided only from metadata the saving author may already read, so no permission answer changes for anything that exists.Recorded 2026-11-29T00:51Z.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk
Claim: PM loop round 1
Session:
session_016WV4d13AraSmVmgVtCvkWkAccount:
os-elon-muskBranch:
claude/issue-38419-knowledge-source-absent-refWorktree:
objectstack-issue-38419Domain:
domain:serverSeat:
repo:objectstack#1File surface:
packages/services/service-knowledge/src/knowledge-service.ts(save-time admission), a new test file inpackages/services/service-knowledge/src/,.changeset/*.mdContainer & model: S, mode:subagent, model: default (dispatch-gates --tier: no MANDATORY line), effort: high (reason: S but not mechanical — a new does-not-exist arm beside permission arms, M treatment)
Clause-②: no
Metadata-protocol: none
Responsibility:
@objectstack/service-knowledge(objectstack) — the save-time permission check runs before any "does not exist" arm |os validate/os lint(knowledge-source-object-unknown/-field-unknown) | builders saving a knowledge source through Studio or MCPThread-read: 7248406300
Premise: holds — reproduced on two boots in #38417 at ff69bca; no commit touches the package on ff69bca..0c1b2ff
Serial constraints cleared: none — clear on the surface; #38418 (same package,
knowledge-sync-state.ts, this seat) is a different file. If the fix adds a NEW error code (ERROR_CODE_LEDGER / StandardErrorCode) the dev reports it and this claim becomesClause-②: yesMaintainer's word for this wave, verbatim: 「有问题都修,暂时也只是发 next 版」 (2026-11-29T00:44Z, os-elon-musk fleet project). Card from QA round #38417.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk
os-dev-report
{ "issue": 38419, "status": "done", "branch": "claude/issue-38419-knowledge-source-absent-ref", "pr": "https://github.com/objectstack-ai/objectstack/pull/38465", "session": "session_016WV4d13AraSmVmgVtCvkWk", "premise_still_valid": true, "summary": "KnowledgeService.admitAuthoredSource (the save-time admission every knowledge_source save door asks: REST and runtime /meta PUT, the MCP draft save, the package duplicate) gains a does-not-exist arm ahead of every permission arm. An absent source.object, or a content/contentFields/metadataFields member that is neither declared nor id or an injected system column (resolveInjectedSystemColumns), is refused 400 VALIDATION_ERROR naming the object (and field) and the os validate rule knowledge-source-object-unknown / knowledge-source-field-unknown. Existence is decided from the registered object definition only: every door admits only a manage_metadata holder, who ADR-0106 D4 serves every definition whole, so no permission answer about anything that exists changes (pinned byte for byte). No new error code; reproduced on base first: absent object 503, absent sys_ object 403, absent field 403.", "tests": "New src/__tests__/knowledge-source-save-absent-reference.test.ts (15 cases). RED with knowledge-service.ts restored from base 0c1b2ffe: 'Tests 7 failed | 8 passed (15)' (absent object 'status: 503', absent sys_ object 'status: 403', absent field 'status: 403'; the 8 exists-unchanged pins pass on base, their sentences taken from it). GREEN at head cf125c96 after pnpm turbo run build --filter='@objectstack/service-knowledge...' --concurrency=2 (Tasks 20 successful, 20 total): pnpm --filter @objectstack/service-knowledge test 'Test Files 22 passed (22) / Tests 741 passed (741)'; pnpm --filter @objectstack/service-knowledge typecheck: tsc --noEmit clean, 'check:test-typecheck: OK, 0 file(s) / 0 error(s)'; lock 'VERDICT command-exit 0'. No ablation beyond the base-restore red run (it is the reverse verification: the test file changed nothing else).", "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at cf125c96 derived 71 commands; each run with exit captured before any pipe; --ran: '71 derived famil(ies) accounted for, 70 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)'. NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, reason: PREREQUISITE NOT MET (positive control pinned to commit 621a4876 unreachable in this shallow clone; checker health only). check:dual-build-cjs-loads exit 0 at cf125c96 ('126 published require entry point(s) across 74 package(s) load'). An earlier run at 6113ebff (before the origin/main merge) also reconciled: 69 run, 2 NOT-MEASURED. CI check-runs on PR head cf125c96, read once at report time: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, docs & code guards, repo & tooling gates, CI release & engine gates, PM dispatch-gates, scoped x3), PR-body guards, Type Check (workspace, source gates, consumer gates, debt ledger): all in_progress; Test Core / Build Core not yet listed. NOT MEASURED: every CI family, reason: not concluded when the report was written (convergence is the PM's).", "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "2 relay strokes (POST /repos/objectstack-ai/objectstack/dispatches, run as objectstack-fleet[bot]): (1) pr_create, run 46220981199 success: POST /repos/objectstack-ai/objectstack/pulls (draft, #38465) + POST /repos/objectstack-ai/objectstack/issues/38465/assignees [os-elon-musk], body read back 7981/7981 bytes identical; (2) this report: POST /repos/objectstack-ai/objectstack/issues/38419/comments via post-stamped.mjs. git push (4 pushes of the branch, not REST) excluded.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "class: a · reach: public save door, PUT /meta/knowledge_source/:name answers through admitAuthoredSource; measured by calling KnowledgeService.admitAuthoredSource at cf125c96 with source.where { stauts: 'open' } over object ticket (no field stauts): with a security service it answers 403 PERMISSION_DENIED \"its `where` reads field 'stauts' of object 'ticket', which you may not query (it is hidden from you, or served to you masked)\"; with none it is admitted. Same family as this card (a permanent reference mistake worded as a permission refusal), not fixed here: os validate does not judge where fields either (validate-knowledge-source.ts checks content/metadataFields only), so no rule name exists to reuse, and the existing pin holding an unknown where operator ($nor) at 403 field '$nor' would move; a fix needs a rule in packages/lint plus the save-door arm. · Seam: spec:ObjectKnowledgeSource.where -> runtime:KnowledgeService.admitAuthoredSource (selectingFieldsOf) · dedupe words: knowledge source where absent field, where field does not exist, knowledge-source-where-field-unknown, selectingFieldsOf save door" ], "line_budget": "size S; diff vs origin/main (three-dot): 3 files, +371 / -1 (372 changed lines, under the 3000 human-merge threshold); knowledge-service.ts +91/-1, new test +258, new changeset +22", "files_changed": [ ".changeset/38419-knowledge-source-save-absent-reference.md", "packages/services/service-knowledge/src/__tests__/knowledge-source-save-absent-reference.test.ts", "packages/services/service-knowledge/src/knowledge-service.ts" ], "deviations": [ "Commit trailers: the harness attribution reminder asked for a model-named Co-Authored-By trailer; AGENTS.md (attribution footer rule, and the pre-push hook) requires the model-free pair, so every commit carries Claude-Session + 'Co-authored-by: Claude'. PR body footer uses the AGENTS.md session-URL form, not the harness's.", "The new test file sits in src/__tests__/ (where every test of this package lives) under the claimed 'new test file in src/'; it carries its own small harness because the sibling admission test's helpers are file-local, not a shared harness file.", "Merged origin/main (0c1b2ffe..1afd9c13, 5 commits; none touches packages/services/service-knowledge, packages/core or packages/spec/src/data beyond a field.zod.ts describe) into the branch before opening the PR, per AGENTS.md multi-agent section 10; merge commit cf125c96, after which the closure was rebuilt and the package suite and the gate union were rerun.", "The red run restored the base knowledge-service.ts into the working tree unstaged, then git restore --source=HEAD --staged --worktree; git status was clean after. A one-off tsx probe for the where finding was copied into the package directory, run, and removed; nothing of it was committed.", "No skip-changeset label (the diff publishes); no labels sent." ] }objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk
ACCEPT → PR #38465 comment 7250429083 · armed for the queue (landing comment 7250439866). The
source.wheresibling is filed as #38471.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk
Delivered by PR #38465, merged as 24d808d. Saving a
knowledge_sourcewhosesource.object,content,contentFieldsormetadataFieldsnames something that does not exist is now refused400 VALIDATION_ERRORwith theos validaterule name, instead of a permission or try-again answer. Thesource.wheresibling is card #38471. Nothing left on this card;pm:dispatchedremoved.