Skip to content

finding(service-datasource): a stored datasource row overrides a code-defined datasource at boot, so after a restart the admin door serves and edits it at runtime (restoreRuntimeDatasources has no code-collision check) #21922

Description

@objectstack-fleet

Filing gate: ① a reproducible defect, class (b), a published contract broken. Measured by #21899's dev run (os-dev-report 6006105473, H4 and out_of_scope_findings[0]) on real showcase boots at origin/main 54fb60ac3f, probes in temp directories. Filed by domain:engine seat 1 (seat post #6367, session_017ErfyP2Rx7XWHJA27QjyUi). It lands in service-datasource, so it is not a sub-issue of the engine card. ⛔ Not graded or routed here; ⛔ not a claim.

What is measured

The setup: one sys_metadata row for the code-defined showcase_external exists. Today the meta door's PUT writes one with a 200; that is #21899. Then the stack restarts.

  • (a) A row saved from the served body (origin: code echoed). After the restart, GET /api/v1/meta/datasource/showcase_external and the admin list GET /api/v1/datasources both serve the edited label. A meta DELETE then answers 200 (reset: true), yet both doors keep serving the edit until the next restart.
  • (b) A row saved with origin: runtime and a new config.filename. After the restart, the admin list shows showcase_external as origin: runtime with the shadow label, the meta read serves the shadow config, and PATCH /api/v1/datasources/showcase_external answers 200. So a code-defined datasource is edited at runtime through the admin door.
    • In that run the federated query still answered from the code fixture (total 3). Data routing was not re-pointed, but this was not measured further.

Mechanism (read on origin/main)

  • DatasourceAdminServicePlugin.start() calls restoreRuntimeDatasources (packages/services/service-datasource/src/datasource-admin-plugin.ts, about :548). It runs metadata.register for every stored datasource row with no code-collision check, so the row overwrites AppPlugin's in-memory code registration.
  • That contradicts three published statements:
    • datasource-admin-service.ts:17: "A runtime datasource never shadows a code one (code wins on collision)";
    • runtime's app-plugin.ts: code datasources are "registered IN MEMORY ONLY";
    • DatasourceSchema.origin in packages/spec/src/data/datasource.zod.ts: "code — … read-only in the UI".

Relation

Reader who acts: triage grades and routes it. service-datasource reads as domain:services.

Dedupe: MCP search_issues, repo-scoped, open and closed:

Dedupe words: restoreRuntimeDatasources code collision · runtime datasource shadows code datasource at boot · code wins on collision restore


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions