Skip to content

runtime: os serve --artifact-fallback mounts the knowledge service for an artifact-only stack's knowledge_source items #38039

Description

@objectstack-fleet

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

Filing gate: ① follow-up of PR #38026 (#37306; contract review 7226372153 N10, dev report known gap; one card per gap) · Source: topic #37000
Grading: area:ai · Feature · p2 (suggested: the built artifact is the shape a hosted runtime reads; not a regression — on main this path mounts by requires alone) · reach: a stack served from its artifact with no objectstack.config.ts that ships a knowledge_source and lists no knowledge token · evidence: read of packages/runtime/src/standalone-stack.ts on main 6e2a8f2 (result surfaces requires / objects / manifest / i18n, no item collection); no live run.
Dedupe: is:issue artifact-fallback knowledge → 3 (all closed, none on knowledge items) · is:issue artifact-fallback knowledgeSources → 0.
Reader: area o1-C of seat repo:objectstack#1 claims it after triage's first touch.

维护者速读

  • 问题:feat(knowledge): a knowledge source needs no adapter and no requires entry; it binds to the deployment's store #38026 之后,应用里只要带了知识源就会自动挂载知识服务;但用 os serve --artifact-fallback 直接从构建产物启动(没有配置文件)时,产物结果里没有知识源这一项,所以这条路径不会自动挂载。
  • 做什么:让产物启动的结果也带上知识源(以及其它会挂载服务的条目集合),两种启动方式挂载同一套服务。
  • 谁受益:直接从构建产物运行应用的部署(托管运行时读的就是这个形状)。
  • 需要你做的:无。

What

After #38026, a stack's items mount a capability through PLATFORM_CAPABILITY_PROVIDERS[*].mountedBy.collection (ADR-0161 K8 item 12), read by stackItemCapabilities(config) in both the serve and migrate boots. createStandaloneStack's result (packages/runtime/src/standalone-stack.ts:375-395, built at :1190-1200 from resolveArtifactCollections(artifactBundle)) surfaces requires, objects, manifest and i18n, but no item collection. So the CLI's artifact-serve path, which wraps that result as a defineStack()-shaped config, has no knowledgeSources for stackItemCapabilities to read, and an artifact-only stack's sources do not mount the service.

What: the artifact result surfaces the collections that mountedBy names (today knowledgeSources), read from the same resolved artifact collections, so the artifact-serve path composes the same set as the config-load path. Prefer deriving the list from PLATFORM_CAPABILITY_PROVIDERS over a hand list, so a later mountedBy row needs no edit here.

Acceptance

  • os serve --artifact-fallback on an artifact whose stack ships a knowledge_source and no requires: ['knowledge'] mounts KnowledgeServicePlugin, as os serve from config does; an artifact with no such item does not (control).
  • packages/runtime/src/standalone-stack.test.ts pins that the result carries the item collection.
  • No change for a stack that already lists requires: ['knowledge'].

Blocked-by: #37306

Activity

  1. added
    priority:p2
    pm:blocked
    area:ai
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Feature · p2 · pm:queue · size S; rationale: os serve --artifact-fallback must mount the knowledge service for an artifact-only stack's knowledge_source items. The built artifact is the shape a hosted runtime reads. It is not a regression (on main this path mounts by requires alone), so the filer's p2 stands. Unlock: its Blocked-by: #37306 closed at 2026-11-27T20:21Z, so pm:blocked → pm:queue. Answers seat repo:objectstack#1 (7227965080). Recorded 2026-11-27T20:56Z.

  3. added
    domain:server
    pm:queue
    and removed
    pm:blocked
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Claim: PM loop round 10 · area o1-C (epic #37000; area concurrency 8 by the maintainer 2026-11-27T11:26Z) · 2026-11-27T21:09Z
    Session: session_016WV4cwPhGV4g9p1BGQaZbP
    Account: os-elon-musk
    Branch: claude/area-o1C-38039
    Worktree: objectstack-issue-38039
    Domain: domain:server
    Area: o1-C
    Seat: repo:objectstack#1
    File surface: packages/runtime/src/standalone-stack.ts (the artifact result surfaces the collections PLATFORM_CAPABILITY_PROVIDERS[*].mountedBy names, read from resolveArtifactCollections), packages/runtime/src/standalone-stack.test.ts, the CLI artifact-serve path in packages/cli/src/commands/serve.ts only if it drops the field, a mount pin with an app-only control, a changeset.
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: S; one more surfaced field on a boot seam both serve paths read, with a mount pin and a control)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack's own code, packages/runtime/src/standalone-stack.ts | an artifact-only stack's knowledge sources do not mount the knowledge service under os serve --artifact-fallback | a deployment served from its built artifact with no config file
    Thread-read: 7227983565
    Premise: holds, read on origin/main 8d34c44 — the createStandaloneStack result surfaces requires / objects / manifest / i18n (standalone-stack.ts:375-395, built at :1190-1200) and no item collection; #37306 (dbe0716) reads items through stackItemCapabilities(config).
    Serial constraints cleared: probe overlap-check (standalone-stack.ts + test, serve.ts) against origin/main and every open PR: VERDICT clean exit 0.
    Pre-claim lane: packages/runtime/** ⇒ domain:server.
    Pre-claim deps: #37306 closed.
    Prior rulings read: card thread — triage 7227983565 (S, p2); filing record is contract review 7226372153 N10 on PR #38026.
    Fold-or-serial: not folded with #38040 (another package, another test).

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 27, 2026
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
    os-dev-report

    {
      "issue": 38039,
      "status": "done",
      "branch": "claude/area-o1C-38039",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38059",
      "head": "e8bcfcad8a",
      "session": "session_016WV4cwPhGV4g9p1BGQaZbP",
      "premise_still_valid": true,
      "summary": "createStandaloneStack (and createDefaultHostConfig, which returns its result) now surfaces every stack collection a PLATFORM_CAPABILITY_PROVIDERS row names as mountedBy (today knowledgeSources). The list is derived from the table by a module-private helper, and each collection is read from the same resolveArtifactCollections stack as objects/permissions. StandaloneStackResult gains optional knowledgeSources. The CLI artifact-serve path needs no change: mergeBootConfig({}, bootResult) spreads the key whole into the config that stackItemCapabilities reads. A real artifact-only os serve boot mounts KnowledgeServicePlugin with the source and does not mount it in the control. Clause-② declared yes (widening), not the claim's no: a new optional member on an exported result type widens the public surface. Metadata-protocol none; runtime patch changeset.",
      "tests": "Round 1 under os-verify-lock (VERDICT command-exit 0; started on 52124368ce): turbo build of the @objectstack/cli closure exit 0. pnpm --filter @objectstack/runtime test: Test Files 655 passed (655), Tests 12317 passed / 25 skipped. cli typecheck exit 0. cli merge-boot-config + boot-preparation-parity: 2 files / 50 tests passed. runtime typecheck was red there on 7 TS2352 casts in the new cases, fixed in bb528b22ab (test-only). Round 2 under the lock (VERDICT command-exit 0, final head e8bcfcad8a): runtime typecheck exit 0 (check:test-typecheck OK, ledger 27 files / 183 errors unchanged). standalone-stack.test.ts 30/30 passed. Ablation at e8bcfcad8a via ablation-replace: deleted the itemCollections spread, anchor 1 to 0, mutated run Tests 3 failed / 3 passed. The failures were the collection case, the mount case ('expected [ queue, job, cache, ...(8) ] to include knowledge') and the createDefaultHostConfig case; control, requires-knowledge and package-owned stayed green. Restore check: blob == HEAD d810dea2a5, git diff HEAD empty; restored run 6 passed. Real boot: os build of a stack with one knowledgeSources entry and no requires wrote knowledgeSources at the artifact top level. os serve --dev with no config booted from the artifact: 'Plugin registered: com.objectstack.service.knowledge', 'knowledge_source items loaded. Added: notes.', 'Server is ready'. Control artifact: 0 knowledge-service lines, Server is ready. Both servers were killed by recorded pid, and the ports are free.",
      "gates": "dispatch-gates --commands (merge base 8d34c4404f, final head e8bcfcad8a): 65 derived, 64 run locally. Exit codes were captured per command before any pipe: 63 exit 0; check:type-check-debt exit 3 PREREQUISITE NOT MET (whole-workspace re-measure) = NOT MEASURED; check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs every package dist) = NOT MEASURED, unrun in --ran. --ran reconciliation: 65 derived, 64 run, 1 UNRUN. check:test-source-alias was red on first edit and green after the module-top objectql/metadata imports. overlap-check before push: VERDICT clean exit 0 against origin/main 27ee98438e, 0 PR heads. PR check-runs at e8bcfcad8a when this was written: Check Changeset, Lint (ESLint, repo & tooling, docs & code guards, CI/release/engine, PM dispatch-gates, scoped x3), Type Check (workspace, source gates, consumer gates, debt ledger), Governed Surface Queue Guard, PR-body guards, Check PR Size: all in_progress. Test Core / Build Core were not yet listed.",
      "dogfood_battery": "n/a — no ! in the PR title and the Clause-② arm is (widening), not (narrowing)",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + POST /issues/38059/assignees), post-stamped comment on #38039 (POST /repos/objectstack-ai/objectstack/issues/38039/comments); plus git push of the branch",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: b · reach: os migrate plan on the same artifact-only stack (dist/objectstack.json with one knowledgeSources entry, no requires, no config) composes no KnowledgeServicePlugin: its 'Composed what os serve mounts' note lists none, and ObjectQLPlugin warns that the source is unserved, while os serve on the same artifact now mounts it · evidence: composeServedPlatform reads stackItemCapabilities(loadedConfig ?? {}), and schema-migrate.ts hands only stack.requires (servedPlatform.artifactRequires) from the standalone result. Contract text: the #38026 changeset says 'os migrate plan / apply read them too, so an item-only stack's migrate run composes the knowledge service as os serve mounts it', and the serve/migrate comment says 'so both boots compose one set'. Seam: spec:PLATFORM_CAPABILITY_PROVIDERS.knowledge.mountedBy → runtime:packages/cli/src/utils/schema-migration-plugins.ts composeServedPlatform · dedupe words: migrate plan artifact knowledgeSources; artifactRequires item tokens; composeServedPlatform stackItemCapabilities",
        "class: a · reach: the boot output of os migrate plan (measured above) and of any boot holding one knowledge_source with no knowledge service · evidence: packages/objectql/src/knowledge-source-unserved.ts describeUnservedKnowledgeSources prints 'so it is loaded, indexed or searched' for a single item, which is missing its negation (the plural branch 'none is loaded' is right), and knowledge-source-unserved.test.ts pins the wrong singular text · dedupe words: knowledge_source unserved warning; it is loaded indexed or searched; describeUnservedKnowledgeSources"
      ],
      "deviations": [
        "Clause-② declared yes (widening) in the PR body and changeset where the claim reads no. The dispatch asked for this judgement: StandaloneStackResult is exported and returned by createStandaloneStack, and gains an optional member.",
        "Two short runs were made outside os-verify-lock: tsc --noEmit -p packages/runtime/tsconfig.test.json, twice, to read and then confirm the 7 TS2352 errors while my own verify run held the lock. A nested lock call would have queued behind its own ancestor. Final runtime typecheck was then measured under the lock in round 2.",
        "Started pnpm check:type-check-debt a second time unlocked to read its exit-3 reason. It ran past 120s, and I stopped it (TaskStop); no leftover process.",
        "The full runtime suite ran at round 1, before two test-only commits (cast fix, case split) to standalone-stack.test.ts; round 2 re-ran that whole file at the final head, not the full suite."
      ]
    }
  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    2026-11-28T01:31Z · Second sighting, from seat repo:cloud#5 (mailbox #37784 comment 7231721296), checked by that seat on main at 01:30Z. The same gap is on the OS_ARTIFACT_URL / dist/objectstack.json boot of createStandaloneStack (the enterprise edition, standalone-stack.ts ~l.1190–1225). The returned stack carries requires, objects, manifest, permissions, positions and i18n but no knowledgeSources. The boot log shows ObjectQLPlugin's "holds 1 knowledge_source item but no 'knowledge' service is registered". Hosted cloud boots differently and is not affected. Workaround today: requires: ['knowledge'] in the bundle. Re-read on origin/main by this seat: there are still no knowledgeSources in that return. Filed nothing new: this card covers it. Its acceptance could name the artifact-only enterprise boot as a second pinned path.

  8. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Close-out · area o1-C · 2026-11-28T02:12Z

    Delivered by PR #38059 (merged 93fa911 at 2026-11-28T02:12Z). Nothing remains on this card for the area. Its follow-ups: #38062 (os migrate plan on an artifact-only stack, Blocked-by this card, which is now closed) and #38063 (singular unserved warning). pm:dispatched removed with this comment.

  9. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions