Repository navigation
fix(service-datasource): a datasource created in Setup is saved through the kernel save, into a named package - #39676
Conversation
…reate (red at origin/main) Red by design: the admin create resolves and inserts a package-less sys_metadata row without asking the kernel save. The card stopped before the fix; see the report on the card. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…e admin door's minted reference A server-stated mintedCredentialsRef on the save request: a datasource body naming exactly that reference passes the #27762 own-reference judge when no other stored datasource row holds it (ruling record 7408558495, A2). Every other judge still runs. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…e kernel save, into a named package POST /api/v1/datasources reads the body's package and saves through saveMetaItem; a create naming none is refused 422 WRITABLE_PACKAGE_REQUIRED. Update and credential migration save through it too, stating the reference they minted. The direct sys_metadata insert is gone. An import from a Setup datasource lands in its stored row's package. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…e fixture; pins for the refused create, update and migration Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…ody carrying it passes nothing Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…t (ADR-0087 D3) Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
… saved in Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…ages when a create names none Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…tor never needed; pin one rebuild per connection change Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…r's direct insert and update are gone) Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…al in the door's words, stamping no code of its own Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…ard test's engine double Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…e doubles refuse a where combinator Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…reate's package in the external-datasources page (amendment 7411737976) Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…ence to the own-reference judge Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 49 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 19 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 153f540504093a12d36fff7a521a0d47c848cf10 && git checkout 153f540504093a12d36fff7a521a0d47c848cf10
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bb3348440860074b6ba302601b76663fff0147e1 9f9887c339c1fa3c0208cf73988c97656cfa4de8 && git checkout -B drift-repro bb3348440860074b6ba302601b76663fff0147e1 && git merge --no-ff 9f9887c339c1fa3c0208cf73988c97656cfa4de8
node scripts/docs-audit/affected-docs.mjs --json bb3348440860074b6ba302601b76663fff0147e1
|
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7 Seat attaches |
…a body-only registry-question producer Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…rite's pool to the door, so its verdict reads connected Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR 2026-12-04T14:28Z · L1-a verdict: ACCEPT at head 席位核对The ruled route, item by item, read at this head.
Changeset and docs, sentence by sentence.
Gates.
Next. I'm running the |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract-review-claim: session_016WV4czfEjskBjZM6jhKWFR · b5ea483 · 2026-12-04T14:29Z |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract reviewServed-tier: Three faces are judged here, as the card's ruling record 7408558495 and claim amendments 7408609939 and 7411737976 require: the Check-runs on the head: 71 success, 11 skipped, none failed or pending. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe The rule text,
M1 (must-fix) — The door's edit and credential migration now refuse every existing datasource whose at-rest body is not schema-valid, and the PR declares the opposite. Read, not run.
S1 (should-fix) — An update the kernel refuses after a successful rebuild leaves the live pool on the configuration that was refused. N1 (nit) — N2 (nit) — The dispatcher's N3 (nit) — Two door answers speak the kernel's words. A create naming a package that is not writable relays the kernel's sentence, which prescribes N4 (nit) — The header's second bullet still reads "an edit naming a reference other than its row's, or naming one where its row holds none, is refused" with no exception, while the first bullet gained "unless it is the server-stated minted reference". The lead sentence and the A2 paragraph state the pass for every write, the code agrees, and both edit cases are pinned as accepted, so the rule is not misjudged; the bullet is the one sentence of the governing text that is false read alone. N5 (nit) — The in-flight guard is a per-process set keyed by name: a Implemented-by: VERDICT: FAIL |
…sed save puts the pool back The admin door's edit handed the kernel save the record at rest, so the schema judged stored cleartext (#8078) and a label or `active: false` edit of a legacy row answered 422 INVALID_METADATA. The edit now sends the served form (the type's read redactor) and the kernel's carry-forward (#8154) restores the withheld credentials after its gates, as on the /meta door. Pinned on the real saveMetaItem (raw body 422, served form saved with every credential kept) and at the door (the body sent is the served form). A refused update after the door rebuilt the pool converges the pool back to the stored record through the host's convergePool. Header bullet and the no-pushdown sentence in the own-reference judge; changeset sentence corrected. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
…s the inline credential slot Ruling record 7416154891, F1 A: a declared rule in @objectstack/spec/kernel (getMetadataTypeCarryForwardRetirement) that planCarryForward applies on every door. A datasource body that binds external.credentialsRef does not get the driver's inline credential slot carried forward; each drop is named on the save's advisories, and the admin door's update answer names it too. The credential migration sends the served form, so it leaves the reference and no inline password at rest (this branch's own regression, main is clean). F2 A: the narrowing's second arm declared in the changeset FROM -> TO, the migration entry and the door comment (400 DATASOURCE_ADMIN_ERROR naming the key; the edit sent with the corrected config saves). Pins: real-save pins in metadata-protocol, and door pins over the real kernel save that read the stored row, across a restart, with a second run answering already-bound. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR 2026-12-04T17:04Z · L1-a delta verdict: REWORK at head 席位核对Must-fix: the change now widens a published surface, but it still declares
Please change both carriers, the changeset and the PR body, to What holds in the delta (read at this head).
Gates.
Next. The delta |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract-review-claim: session_016WV4czfEjskBjZM6jhKWFR · bcda593 · 2026-12-04T17:05Z |
…wo new spec/kernel exports Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract reviewServed-tier: Delta record after contract review 7414632005 (FAIL at Check-runs on this head: 70 success, 11 skipped, none failed, none pending. The PR head moved while this record was written. M1: closed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Tried against it. A body binding a broken reference still drops the working inline copy: the analysis put this gap to the maintainer and the ruling took it; with a reference bound the connection was already failing closed. A draft save drops the slot from the draft row only. A driver change is retired by the incoming driver's slot; the stored slot of the old driver is the driver-change item in ③. None is a finding on this rule.
The rule text,
D1 (must-fix) — The N2, N3 and N5 of the first record stand as written: follow-up or accepted, none fixed here. N3's status point is now declared text for the second arm. N6 (nit) — Two texts in files this claim does not hold are stale after F1: the No should-fix. Implemented-by: VERDICT: FAIL |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR 2026-12-04T17:35Z · L1-a delta verdict: ACCEPT at head 席位核对The must-fix is closed. The one commit since Owed line delivered. The door's driver-change follow-up the L2 raised is filed as #39737, and the PR body names it ( Gates. 72 success, 13 expected skip, 0 failed, 0 pending on Next. A delta L2 on this head closes D1. After that, both ids go to the seat, since a narrowing lands through the seat. |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract-review-claim: session_016WV4czfEjskBjZM6jhKWFR · 9f9887c · 2026-12-04T17:36Z |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR Contract reviewServed-tier: Second delta record, after 7414632005 (FAIL at The delta is one file and one line: the Check-runs on this head: 72 success, 13 skipped, none failed, none pending. D1: closed ① Derived judgmentsNothing new. The delta changes no accept set and no public surface; it changes what the PR says about them. The seven judgments of record 7418558640 stand. ② Semver level
③ Boundary flags
④ Design judgmentNeither N7 (nit) — The declaration's trailing prose lists the two spec exports and not the three optional members on the No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7 速读 · PR #39676 (Fixes #39398) · head
席位核对 — ACCEPT · repo:objectstack@os-elon-musk · head
|
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7 维护者速读
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxRh6Sbfo2Xm49JPx6
Requested by Elon · project thread
Fixes #39398
Clause-②: yes (narrowing) — narrowed: a Setup datasource create naming no package is refused, and an edit of a datasource whose stored config or pool the schema refuses is refused until it sends the block corrected; widened in the same change: the
@objectstack/spec/kernelexportsgetMetadataTypeCarryForwardRetirementandMetadataCarryForwardRetirementMetadata-protocol: narrowed
Skills-docs: updated here — content/docs/data-modeling/external-datasources.mdx (a datasource created in Setup is saved into the writable package the request names; skills/** teach no Setup datasource create)
维护者速读
What changes
Ruling record 7408558495 (Q1 A + A2, Q2 rides) and ruling record 7416154891 (F1 A, F2 A; analysis 7416035148). Claim amendments 7407420662, 7408609939, 7409019128, 7411737976, 7413016250, 7416186562, and the carve-out amendment 7411818882.
The Setup door writes through the kernel save.
POST /api/v1/datasources, itsPATCHandPOST /api/v1/datasources/{name}/migrate-credentialnow store throughsaveMetaItem(new moduledatasource-record-save.ts). The directsys_metadatainsert and update are gone, so every judge of that save also answers this door.An edit and a migration send the body a read serves.
updateDatasourceandmigrateCredentialhand the save the served form (the datasource read redactor,servedFormon the write). The schema judges what the author wrote, and the kernel's carry-forward ([security] GET /api/v1/meta/datasources still serves stored cleartext credentials — the metadata read path has no per-type redaction hook #8154) restores the withheld credentials after its gates. Alabeloractive: falseedit of a row holding cleartext stored before feat(spec)!: refuse inline credentials at publish — driver config + connector authoring door (#7990, spec half) #8078 keeps saving and keeps the credential. When a save after a pool rebuild is refused, the door converges the pool back to the stored record (convergePool).F1 A: a bound reference retires the inline credential, on every door. A rule declared in
@objectstack/spec/kernel(getMetadataTypeCarryForwardRetirement) and applied inplanCarryForward(metadata-redaction.ts): a datasource body that bindsexternal.credentialsRefdoes not get the driver's inline credential slot (config.password; turso'sconfig.authToken) carried forward. The row is written without it. The save names each dropped position on itsadvisories(rulewithheld-key-dropped). The admin door's update answer names it asdroppedWithheldKeys, and the registry slot is registered without it. With a reference bound, the connect path never reads that slot. Former alias spellings and a URL-embedded password are still carried forward, and the migration still reports them asremaining.protocol-save.tsis not touched beyond the carve-out.F2 A: the narrowing's second arm (text only). An edit of a datasource whose stored
configorpoolthe schema refuses for anything but an inline credential is refused400 DATASOURCE_ADMIN_ERROR, carrying the kernel's sentence, which names the key. This includes alabeloractive: falseedit alone. The same edit sent with the corrected block saves. This arm is declared in the changeset's FROM → TO table, the migration entry and the door's comment.A create names its package. It is named with
packagein the request body. With no package, the kernel's own422 WRITABLE_PACKAGE_REQUIREDis relayed in this door's words.details.writablePackagescomes with it. Nothing is stored, and the secret minted for the request is removed. An empty or non-stringpackageanswers400 VALIDATION_ERROR. The door stamps no error code of its own: it relays the kernel's error.A2: the minted reference. The own-reference judge accepts a server-stated
mintedCredentialsRef(a request-type member inprotocol-door-requests.ts; no HTTP or MCP door forwards it) only when two things hold:external.credentialsRefequals it;Every other judge still runs.
sourcestays unset.Q2: imports land with their datasource. An object imported from a datasource added in Setup lands in the package that datasource's stored row is in. An unreadable row lands package-less. A datasource stored in two packages is refused.
Console. The Setup datasource editor shows the refusal in the server's words, with one button per writable package. A pick sends the same create into that package (
DatasourceLandingPick.tsx).ADR-0087. One new semantic entry:
19.setup-datasource-create-names-package.Not touched: the door's delete (
DELETE /api/v1/datasources/{name},deleteDatasourceRow) still removes the row directly. Amendment 7408609939 keeps it out of this PR.protocol-save.ts. The change is one line: the call to
datasourceCredentialsRefSaveRefusalnow hands the request'smintedCredentialsRefand the engine to the judge. That call site is the carve-out Studio: a customer cannot add a value to an installed package's picklist: no door stores a picklistExtensions entry in the .custom pair (item 1 of #39471) #39536's holder granted for this card (claim amendment 7411818882, citing 7411804939). Nothing else in that file is changed. Whichever of this PR and feat(metadata): stored picklist_extension item (#39536 step 2); PATCH /packages/:id refuses unread body keys (#39576) #39668 lands second merges main.Read first (by risk):
packages/metadata-protocol/src/metadata-redaction.ts(planCarryForward) withpackages/spec/src/kernel/metadata-type-redaction.ts(datasourceInlineCredentialsRetiredByBinding): the F1 rule. It deletes stored cleartext on every door.packages/services/service-datasource/src/datasource-admin-service.ts: the served-form save of an update and a migration, the pool convergence on a refused save, and the minted secret's cleanup when a create is refused.packages/metadata-protocol/src/protocol-datasource-credentials-ref.ts: the A2 pass, andheldByAnotherDatasourceRow.Two-minute check: run
pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=1 test/datasource-meta-door-reaches-admin-door.dogfood.test.ts -t 'row at rest'. Expected: 5 passed. These include "a credential migration leaves the reference and no inline password at rest; a restart serves the clean row; a second run answers already-bound".Tests
Suites at bcda593 (the head 9f9887c changes only the changeset)
test: Test Files 77 passed (77), Tests 1335 passed (1335). Typecheck exit 0.test: Test Files 391 passed, 9 skipped; Tests 24045 passed, 45 skipped. Typecheck exit 0.src/kernel,src/migrations, the datasource redaction file): Test Files 72 passed; Tests 2208 passed, 4 todo. Typecheck exit 0.package-scoped-exact-qualifier.test.ts(a carry-forward consumer): 472 passed.connector-meta-door-url-and-nested-keys: 5 files, 64 passed.type-checkexit 0 (before the main merge).datasource-create-packageless-39398.test.ts, 14) cover:details.writablePackages;packageis a 400;label,active: false);protocol.datasource-credentials-ref-own-reference.test.ts(29):active: falseedit saves, with every credential carried forward./metaGET → edit → PUT of a row holding a reference and an inline copy drops the copy, namesdatasources[0].config.password, and carries the alias and the URL password.active: falsealone is 422 naminglegacyOption; with the config corrected it saves.datasource-meta-door-reaches-admin-door.dogfood.test.ts, describe "the row at rest", 5 cases; in-process, because the showcase composition wires no secret binder):redactedConfigKeys: []and the registry holds no password; a second run answersalready-boundand the row is unchanged;passwd: migrated,remaining: ['passwd'], with the alias carried at rest;droppedWithheldKeys: ['config.password'];active: falsealone is refused naminglegacyOption; with the config corrected it saves.external-namespace-reads-engine-registry.test.ts. The published-request pin is inprotocol.minted-credentials-ref-wire-39398.test.ts.Ablations (edit on disk, run, restore)
mintedCredentialsRefadded to the publishedSaveMetaItemRequestSchema, spec rebuiltts-expect-errorservedForm: trueset to false on the editplanCarryForwardservedFormdropped from the migration's two writespasswd)droppedWithheldKeysnot relayed on the update answerAcceptance notes
/metaroute builds against. Amendment 7411737976 Q3 ruled this enough, and turbo.json is untouched.connected. This is pinned in the card test and by dogfood finding(service-datasource): a datasource created through the metadata door is missing from the admin door until restart, then reads as code-defined because the admin read defaults a missing origin to code #21923. The measurement that first called this tracking unneeded had a fixture blind spot: it could not see the connect verdict.migratedanswer was this PR's own regression, measured at its headsb5ea483e6andd0dfe00bd. Mainbf95e789fmigrates through its direct write and leaves no cleartext (analysis 7416035148, premise 1). This head closes it through the F1 rule; nothing released was affected.datasource-connection-service.ts). Every driver arm prefers the injected secret (default-datasource-driver-factory.ts569, 577, 796, 805, 836, 965; the per-arm table indatasource-credential-migration.ts). This is read, not run per driver.already-boundon a second run, the no-reference control, the alias carried and reportedremaining, the drop named on/metaand on the admin door) are the pins above.refusednaming the alias, as on main. The planner refuses an unbindable credential-shaped key. Thealready-boundpin therefore uses a password-only row.droppedWithheldKeyNotices,protocol-credential-carry-forward.ts) keeps its hint, which gives a connector'sauth.credentialRefas the example of the declared reference. That file is outside this claim. The same goes for the [security] GET /api/v1/meta/datasources still serves stored cleartext credentials — the metadata read path has no per-type redaction hook #8154 comment inprotocol-save.ts("deliberately not attempted on a write door"), which is now incomplete; that file is held beyond the carve-out. Both are named here rather than edited.packages/spec/api-surface/kernel.jsonandpackages/spec/export-origins/kernel.jsonare regenerated (check:generated --fix) for the one new export;scripts/engine-double-contract.pinned.jsonrecords the new stub engine in the dogfood file.Verification
Local gates
--write), objectql-double-limit, where-matcher, nul-bytes, undeclared-dep-imports, adr-0087-registration, changeset-no-major, empty-changeset, issue-citations, tenant-audit-census, the three symbol-anchor gates, optional-error-sink, durability-log-level, agent-test-spelling, corpus-claim-drift, role-word, logger-receiver-detach, system-context-census, keyed-text-bounds, dispatcher-error-vocabulary, and spec api-surface, export-origins, dual-source-exports, entry-nameability, exported-any, spec-changes, upgrade-guide and error-code-provenance. Also speccheck:generated(14 artifacts, after--fixof the two the new export moved), plus published-files, dts-closure, type-check-debt, rest-log-spy-declared, registry-log-declared, error-status-conformance and route-envelope. The 40th, the local-onlycheck-dev-prereqs, exits 1 on machine state, not on the diff: the ui packages'dist/is not built in this worktree. The spec dist is freshly built.dispatch-gates --ranat 890ef9e35 had 117 derived, 115 run with exit 0, and 2 NOT MEASURED (prerequisite not met:check:dual-build-cjs-loads,check:published-readme-exports). The rest of the derived list is CI's on the new head (a declared narrowing).🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6