Skip to content

service-datasource: a runtime-origin or reconnected plugin-driver datasource loses the #27277 external-driver floor, because the connection service registers the datasource def without its driver id and unregisterDriver drops the stored one (epic #27261) #27666

Closed

Description

@objectstack-fleet

epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV
Filing gate: ① fail-open of a refusal boundary owed by landed work (#27277, PR #27403 86edcaf8), escalated as must-fix class by the post-landing contract review 6502877381 (③). It sharpens the epic body's "P2 prerequisite" line, which this card now carries.
Reader: the epic PM (#27261) dispatches it in the epic subtree; the fix is in packages/spec/src/contracts/data-engine.ts (EngineDatasourceDef), packages/services/service-datasource/src/datasource-connection-service.ts (connect, reconnect's restoreOldPool) and an engine test.
Dedupe (open AND closed): "datasource reconnect unregisterDriver registerDatasourceDef driver id lost external driver floor" → 15 hits, none this defect (#12758 widened the def for credentialsRef, the same shape of fix).
reach: read on main, not measured live. needsExternalDriverFloor reads def.driver ?? stored.driver. DatasourceConnectionService.connect (:669) calls registerDatasourceDef({ name, schemaMode, external }) with no driver (EngineDatasourceDef has no such key), and reconnect (:829–870, reached from the admin plugin's update door ~:552) first calls engine.unregisterDriver(name), which deletes the stored def (engine.ts ~:9216). So a datasource built through the connection service, whose host-provided datasource-driver-factory supports a plugin driver id, is never floored, and nothing says so: a driver that ignores where would serve rows outside the caller's sharing/RLS scope, and remote write refusals would not map. Manifest datasources (registerApp → registerDatasourceDef(ds) with driver) keep the floor.
type: Bug

维护者速读

Task

  • EngineDatasourceDef (spec contracts) gains an optional driver id; DatasourceConnectionService.connect and reconnect's restore path pass record.driver / the previous driver id.
  • Pin: a plugin-driver datasource connected through the connection service is floored; after reconnect (unregister, then connect) it is still floored; a built-in driver stays unfloored.
  • Riders from the same review (6502877381 ④, comment-only): the EXTERNAL_ROW_CAP_EXCEEDED ledger row notes that it deliberately differs from the standard MAX_RECORDS_EXCEEDED (400, a caller-side limit) because the cap is a 422 on a valid query the remote's size makes unservable (ruling 6487532394); the "ADR-0015 Tier A" citations in the ledger row, external-driver-floor.ts and external-driver-errors.ts cite the epic ruling instead.
  • The epic body's "P2 prerequisite" line points here.

Clause-②: yes (an optional key on a published spec contract) · Metadata-protocol: none. Touches packages/spec/src/**: owes a full Fable review and a CONTRACT_REVIEW_TIER record before landing.

Activity

  1. added
    bugSomething isn't working
    area:accessPermissions that actually hold — RLS/FLS, sharing model, write-path guards
    domain:serverDomain lane — seat card indexed by label:pm:seat
    and removed on Oct 29, 2026
  2. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV
    Claim: PM loop round 6 2026-10-29T16:53Z
    Session: session_017ihL2c5z3q4h8inrn5kwqV (epic PM); implementing card thread session_017ihL2g7k5VYcPSfjeD6S2W
    Account: marchtian
    Branch: claude/project-thread-7zzy6q (the card thread's platform-assigned branch — measured platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-27666
    Domain: domain:server
    Seat: epic:#27261#1 (epic PM; no domain:* seat). Maintainer order, 田騏 2026-10-29T04:21Z: 「影响你的任务进度的,你都统一接管」
    File surface: packages/spec/src/contracts/data-engine.ts (EngineDatasourceDef.driver?), packages/spec/src/api/error-code-ledger.zod.ts (the EXTERNAL_ROW_CAP_EXCEEDED row comment only), packages/services/service-datasource/src/** (connection service and tests), packages/objectql/src/** (engine test; citation lines only in external-driver-floor.ts / external-driver-errors.ts), generated references the spec change re-records, .changeset/** (stop on breach; explain in the report)
    Container & model: S, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: #27277 (PR #27403) keyed the floor on the datasource def's driver id but only the manifest path registers it; the post-landing record 6502877381 (③) found the runtime and reconnect paths
    Thread-read: none
    Premise: holds — on origin/main DatasourceConnectionService.connect registers the def with no driver, and ObjectQL.unregisterDriver deletes the stored def before reconnect connects again.
    Serial constraints: PR #27648 (#27471) edits external-driver-floor.ts / external-driver-errors.ts; this card touches only citation lines there. Contract face (published spec contract + Clause-②: yes): a full Fable review and a CONTRACT_REVIEW_TIER record before landing.

  3. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV
    Claim amendment · 2026-10-29T20:23Z

    The card thread (session_017ihL2g7k5VYcPSfjeD6S2W) stalled on the model quota after pushing its commit 25b652f0 to claude/project-thread-7zzy6q. Per the maintainer's order (田騏 2026-10-29T19:39Z: 「你没有fable了,使用 opus开发完之后等契约复审」), the epic PM takes the card over in its own session.

    • Branch: claude/project-thread-6ml89f (the epic PM's platform-assigned branch). 25b652f0 was picked onto it with one comment-line conflict resolved; the two other "ADR-0015 Tier A" citations in objectql were fixed in the same pick.
    • Implementing session: session_017ihL2c5z3q4h8inrn5kwqV.
    • Clause-②: yes (narrowing), with a BREAKING banner and an ADR-0087 marker on the changeset: the floor now engages on datasources a host's plugin-driver factory builds, which narrows their accepted reads and writes.
    • PR: fix(service-datasource): a plugin-driver datasource connected or reconnected through the connection service keeps the engine's floor #27715 (draft, "Fable review owed"). It does not land until an independent full Fable review and a CONTRACT_REVIEW_TIER record PASS on its current head.

    The file surface is unchanged.

  4. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV
    Landed · 2026-10-29T21:20Z

    PR #27715 merged through the queue as 869fa76723ae8c9f15458d8ca7d431df9b2bff3b (head df7e3c66; contract review PASS 6508089206 at CONTRACT_REVIEW_TIER, which also served as the full review of the spec change; seat ACCEPT 6508112693). EngineDatasourceDef carries an optional driver, and the datasource-connection service names it on connect and on the keep-old-pool restore, so a plugin-driver datasource built or reconnected at runtime is floored like a manifest one. The review's should-fixes are #27727 (p3, by pull).

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

Metadata

Metadata

Assignees

Labels

area:accessPermissions that actually hold — RLS/FLS, sharing model, write-path guardsbugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpm:epicpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions