Skip to content

fix(service-datasource): a datasource created in Setup is saved through the kernel save, into a named package - #39676

Merged
os-zhuang merged 22 commits into
mainfrom
claude/issue-39398-wip
Dec 4, 2026
Merged

os-zhuang merged 22 commits into
mainfrom
claude/issue-39398-wip

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

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/kernel exports getMetadataTypeCarryForwardRetirement and MetadataCarryForwardRetirement
Metadata-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, its PATCH and POST /api/v1/datasources/{name}/migrate-credential now store through saveMetaItem (new module datasource-record-save.ts). The direct sys_metadata insert 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. updateDatasource and migrateCredential hand the save the served form (the datasource read redactor, servedForm on 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. A label or active: false edit 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 in planCarryForward (metadata-redaction.ts): a datasource body that binds external.credentialsRef does not get the driver's inline credential slot (config.password; turso's config.authToken) carried forward. The row is written without it. The save names each dropped position on its advisories (rule withheld-key-dropped). The admin door's update answer names it as droppedWithheldKeys, 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 as remaining. protocol-save.ts is not touched beyond the carve-out.

  • F2 A: the narrowing's second arm (text only). An edit of a datasource whose stored config or pool the schema refuses for anything but an inline credential is refused 400 DATASOURCE_ADMIN_ERROR, carrying the kernel's sentence, which names the key. This includes a label or active: false edit 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 package in the request body. With no package, the kernel's own 422 WRITABLE_PACKAGE_REQUIRED is relayed in this door's words. details.writablePackages comes with it. Nothing is stored, and the secret minted for the request is removed. An empty or non-string package answers 400 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 in protocol-door-requests.ts; no HTTP or MCP door forwards it) only when two things hold:

    • the body's external.credentialsRef equals it;
    • no other stored datasource row, in any state, holds it.

    Every other judge still runs. source stays 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 datasourceCredentialsRefSaveRefusal now hands the request's mintedCredentialsRef and 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):

  1. packages/metadata-protocol/src/metadata-redaction.ts (planCarryForward) with packages/spec/src/kernel/metadata-type-redaction.ts (datasourceInlineCredentialsRetiredByBinding): the F1 rule. It deletes stored cleartext on every door.
  2. 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.
  3. packages/metadata-protocol/src/protocol-datasource-credentials-ref.ts: the A2 pass, and heldByAnotherDatasourceRow.

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)
  • service-datasource test: Test Files 77 passed (77), Tests 1335 passed (1335). Typecheck exit 0.
  • metadata-protocol test: Test Files 391 passed, 9 skipped; Tests 24045 passed, 45 skipped. Typecheck exit 0.
  • spec (src/kernel, src/migrations, the datasource redaction file): Test Files 72 passed; Tests 2208 passed, 4 todo. Typecheck exit 0.
  • objectql package-scoped-exact-qualifier.test.ts (a carry-forward consumer): 472 passed.
  • Dogfood, the four datasource suites plus connector-meta-door-url-and-nested-keys: 5 files, 64 passed.
  • app-shell datasource views: 9 files, 71 passed (the new landing cases are k to n). type-check exit 0 (before the main merge).
  • The card pins (datasource-create-packageless-39398.test.ts, 14) cover:
    • a refused create, update and migration leave no secret behind;
    • the 422 relay with details.writablePackages;
    • an empty package is a 400;
    • no save on the host is a 503 with no row written;
    • one connect per create, and one rebuild per connection change;
    • an edit of a legacy row sends the served form (label, active: false);
    • a refused update after a rebuild puts the pool back on the stored record.
  • Real-save pins, protocol.datasource-credentials-ref-own-reference.test.ts (29):
    • [Setup POST /api/v1/datasources creates a package-less datasource row outside the kernel save, past the #38174 close #39398 M1]: the stored body is refused 422; a served-form label or active: false edit saves, with every credential carried forward.
    • [7416154891 F1 A]: a /meta GET → edit → PUT of a row holding a reference and an inline copy drops the copy, names datasources[0].config.password, and carries the alias and the URL password.
    • The migration's body leaves the reference and no password at rest, and a fresh save door serves it clean.
    • Control: no reference bound, nothing dropped.
    • [F2 A]: active: false alone is 422 naming legacyOption; with the config corrected it saves.
  • The door over the real kernel save, reading the STORED ROW (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):
    • a migration leaves the reference and no password at rest; after a restart the door serves redactedConfigKeys: [] and the registry holds no password; a second run answers already-bound and the row is unchanged;
    • a row that also holds passwd: migrated, remaining: ['passwd'], with the alias carried at rest;
    • a label edit of a row holding a reference and an inline copy: the copy is dropped at rest and in the registry, and the answer carries droppedWithheldKeys: ['config.password'];
    • control: no reference, the inline credential is kept and no drop is named;
    • F2: active: false alone is refused naming legacyOption; with the config corrected it saves.
  • Q2 pins are in external-namespace-reads-engine-registry.test.ts. The published-request pin is in protocol.minted-credentials-ref-wire-39398.test.ts.
Ablations (edit on disk, run, restore)
Removed or changed Result
A2 held-by-another clause removed 2 A2 pins red
minted pass removed 4 red
secret cleanup on a refused create removed 2 card pins red
Q2 stored-row read removed 2 Q2 pins red
mintedCredentialsRef added to the published SaveMetaItemRequestSchema, spec rebuilt wire pin red twice: the runtime parse, and an unused ts-expect-error
servedForm: true set to false on the edit 2 door pins red
pool convergence on a refused save removed the S1 pin red
the F1 retirement emptied in planCarryForward 2 real-save pins and 3 stored-row door pins red
servedForm dropped from the migration's two writes the alias-migration stored-row pin red (the raw body is refused 422 on passwd)
the slot registered with the dropped position kept the edit stored-row pin red (the registry holds the password)
droppedWithheldKeys not relayed on the update answer the edit stored-row pin red

Acceptance notes

  • Premise 2 (no wire can state the field) is pinned on the published request type and schema, which the REST /meta route builds against. Amendment 7411737976 Q3 ruled this enough, and turbo.json is untouched.
  • While the door's own write is in flight, the save's projector registers the slot and leaves the pool to the door, so the door's connect verdict reads 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.
  • The narrowing needs the opt-in dogfood battery. The four dogfood suites whose setup creates a datasource now name a package.
  • Correction to the record: the cleartext left at rest after a migrated answer was this PR's own regression, measured at its heads b5ea483e6 and d0dfe00bd. Main bf95e789f migrates through its direct write and leaves no cleartext (analysis 7416035148, premise 1). This head closes it through the F1 rule; nothing released was affected.
  • F1 premises, verified before building:
    • With a reference bound, connect never reads the inline slot. The connect path resolves the reference fail-closed and refuses an empty secret (datasource-connection-service.ts). Every driver arm prefers the injected secret (default-datasource-driver-factory.ts 569, 577, 796, 805, 836, 965; the per-arm table in datasource-credential-migration.ts). This is read, not run per driver.
    • The other premises (the stored row after a migration and a restart, already-bound on a second run, the no-reference control, the alias carried and reported remaining, the drop named on /meta and on the admin door) are the pins above.
  • A second migration run on a row that still holds an alias answers refused naming the alias, as on main. The planner refuses an unbindable credential-shaped key. The already-bound pin therefore uses a password-only row.
  • The save's drop notice (droppedWithheldKeyNotices, protocol-credential-carry-forward.ts) keeps its hint, which gives a connector's auth.credentialRef as 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 in protocol-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.json and packages/spec/export-origins/kernel.json are regenerated (check:generated --fix) for the one new export; scripts/engine-double-contract.pinned.json records the new stub engine in the dogfood file.
  • Out-of-scope filed: datasource edit that changes the driver: the kernel carry-forward stores the old driver's credential on the new config while the pool is built without it #39737. A door edit that changes the driver gets the stored credential grafted onto the new driver's config by the kernel carry-forward, which does not compare drivers, while the pool is built without it. Read, not run.

Verification

Local gates
  • At bcda593, the families reading this round's files were re-run. 39 of 40 commands exit 0: test-source-alias, cross-package-test-inputs, engine-double-contract (after --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 spec check:generated (14 artifacts, after --fix of 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-only check-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.
  • Earlier heads: dispatch-gates --ran at 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).
  • The full farm is left to CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6

claude added 17 commits December 4, 2026 09:27
…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>
…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>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/service-datasource, @objectstack/spec, touching 63 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/spec/api-surface/kernel.json, packages/spec/export-origins/kernel.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

49 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json bb3348440860074b6ba302601b76663fff0147e1.

⛔ 19 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/kernel.json, packages/spec/export-origins/kernel.json) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: VALIDATION_ERROR (literal, 40 pages)
  • 6 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bb3348440860074b6ba302601b76663fff0147e1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 153f540504093a12d36fff7a521a0d47c848cf10 — the merge of head 9f9887c339c1fa3c0208cf73988c97656cfa4de8 into base bb3348440860074b6ba302601b76663fff0147e1, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs bb3348440860074b6ba302601b76663fff0147e1 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

Seat attaches needs:dogfood-battery: declared narrowing (Clause-②: no (narrowing), Metadata-protocol: narrowed); landing owes a Dogfood battery (opt-in) success on the landing head.

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

2026-12-04T14:28Z · L1-a verdict: ACCEPT at head b5ea483e61 (zone em-upgrade, Fixes #39398, ruling record 7408558495 = Q1 A + A2, Q2 = ruling 6660988968 item 1). A CONTRACT_REVIEW_TIER L2 is owed (narrowing arm, packages/spec/src/**, and the #27762 own-reference rule text). Narrowing lands through the seat.

席位核对

The ruled route, item by item, read at this head.

  • The door writes through the kernel save; the direct row write is gone. datasource-record-save.ts saveDatasourceRecord is the door's only write. Create is create-only (parentVersion: null) into the named package. Update and credential migration are saved in the package their row is stored in. A host with no save answers 503 and writes nothing any other way.
  • The package judgment is the kernel's, not the door's (D was not chosen). A create with no package reaches the kernel's WRITABLE_PACKAGE_REQUIRED, which is relayed unchanged in code and status. Only the sentence is reworded for the body's package, and the writable packages ride on details. An empty or non-string package is the door's own 400 request-shape check, not a package judgment.
  • A2 in the own-reference judge (protocol-datasource-credentials-ref.ts):
    • A stated mintedCredentialsRef passes only when the body names exactly it and heldByAnotherDatasourceRow finds no other stored datasource row holding it.
    • That check reads every state, drafts included.
    • "No store", a non-array answer or an unparsable row all count as held; a failed read throws.
    • A stated ref the body does not name changes nothing.
    • Every other judge still runs, and source stays unset (C is excluded).
  • The wire cannot state it. Only server code sets the member (datasource-admin-service.ts → putDatasourceRecord → saveMetaItem). Pins (a) and (b) show the published request type refuses it and the published schema drops it. A test shows a ref written into the body without being stated passes nothing.
  • No secret is left behind after a refusal. Create (422), update and migration refused by the kernel each remove the secret minted for them and keep the stored one or the inline one.
  • Q2. An import from a datasource stored in a writable package is saved into it. A package-less datasource still lands loose. Active rows in two packages are refused, with nothing saved.
  • REGISTRY_QUESTION_PRODUCERS gains the body-only row for the new call site.
  • The protocol-save.ts change is the single call-site line covered by the carve-out (7411818882, citing 7411804939).
  • 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. While the door's own write is in flight, the projector registers the slot and leaves the pool to the door. A pin covers it: a create connects once and records connected, an update reconnects once, and a /meta save still gets its pool from the projector. Per the zone, an ablation reproduces both CI failures.
  • Console. The refusal is shown in the server's words with one button per writable package. Picking one re-sends the create. Another refusal stays a toast.
  • Out of scope. The door's direct delete is named in the body as untouched, which is the seat's call under the ruling.

Changeset and docs, sentence by sentence.

  • minor on service-datasource, metadata-protocol, spec and app-shell meets the floor for Metadata-protocol: narrowed.
  • The headline comes first. Clause-②: no (narrowing), the Skills-docs: line, <!-- adr-0087: registered setup-datasource-create-names-package -->, the BREAKING banner and the FROM → TO row are all present.
  • I read every sentence against the code. "In this door's words" matches inThisDoorsWords. "No new exemption" holds: the own-reference pass is A2's, and the package-less judgment is untouched.
  • The new semantic entry 19.setup-datasource-create-names-package agrees with the changeset. Its acceptanceCriteria lists the unaffected package-less paths.
  • external-datasources.mdx: the new sentence is true.
  • Skills-docs: … skills/** teach no Setup datasource create is true: git grep finds no /api/v1/datasources under skills/.

Gates.

  • 70 success, 11 expected skip, 0 failed on b5ea483e61.
  • Dogfood battery (opt-in) concluded success (all 3 shards).
  • mergeable_state is clean.
  • l1-face is clean.

Next. I'm running the CONTRACT_REVIEW_TIER L2 on this head now. After it passes, both ids go to the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

Contract-review-claim: session_016WV4czfEjskBjZM6jhKWFR · b5ea483 · 2026-12-04T14:29Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b5ea483e611bb8dbba7eb0e2d936f9b91933d97c
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.setup-datasource-create-names-package.ts + packages/metadata-protocol/src/protocol-datasource-credentials-ref.ts, packages/metadata-protocol/src/protocol-door-requests.ts, packages/metadata-protocol/src/protocol-save.ts (the one call site), packages/metadata-protocol/src/registry-question.ts, packages/services/service-datasource/src/datasource-record-save.ts, packages/services/service-datasource/src/datasource-admin-service.ts, packages/services/service-datasource/src/datasource-admin-plugin.ts, packages/services/service-datasource/src/admin-routes.ts, packages/services/service-datasource/src/contracts/datasource-admin-service.ts, packages/services/service-datasource/src/plugin.ts

Three faces are judged here, as the card's ruling record 7408558495 and claim amendments 7408609939 and 7411737976 require: the hits path, the declared narrowing (Clause-②: no (narrowing), Metadata-protocol: narrowed), and the rule-text change of the #27762 own-reference rule. Inputs: card #39398 body and all 17 comments (ruling record 7408558495 and its analysis 7407901133 included), PR #39676 body and file list, the net diff origin/main...b5ea483e6 (33 files), and the check-runs on the head. Tests, the Console files, the changeset, the docs sentence and scripts/engine-double-contract.pinned.json were read to judge the files above and are otherwise the lane seat's ACCEPT. Code outside the diff was read, never reviewed: protocol-save.ts (the schema gate and the judge order), protocol-packageless-create.ts, the three wire doors (packages/rest/src/meta-item-write-routes.ts, packages/runtime/src/domains/meta.ts, packages/runtime/src/domains/mcp-authoring.ts), packages/spec/src/data/datasource.zod.ts and packages/spec/src/data/driver/common.zod.ts. Everything below is read from code; nothing was run.

Check-runs on the head: 71 success, 11 skipped, none failed or pending. Test Core (12 shards), Test UI (16 shards), Dogfood battery (opt-in) with its 3 shards, Dogfood Regression Gate, Check Changeset, Lint · PM dispatch-gates, Governed Surface Queue Guard, Spec property liveness, Type Check · workspace and v18 → v19 source upgrade are all success.

① Derived judgments

  1. POST /api/v1/datasources with no package: 201 and a package-less row becomes 422 WRITABLE_PACKAGE_REQUIRED, nothing stored, the minted secret removed. Right. It is the card's ask and ADR-0070 D1; the kernel's own refusal is relayed (datasource-record-save.ts), and the door holds no second package judgment (option D stays refused).
  2. POST /api/v1/datasources accepts a new body key package, read at the route and never part of the record; empty or non-string answers 400. Right. It is the carrier the narrowing prescribes, the same role ?package= has on the /meta door.
  3. The own-reference rule gains one pass: a server-stated mintedCredentialsRef that equals the body's reference and that no other stored datasource row holds, in any state. Right against ruling 7408558495 (Q1 A with A2). The judge runs before the package-less create judgment (protocol-save.ts 1953 against 2174) and only this judge reads the member, so a create with a minted reference and no package is still 422; a body reference other than the stated one is still 400; source stays unset. The held-by-another read fails closed (no engine, a non-array answer or an unparsable body all read as held; a failed read throws).
  4. No wire door can state the member. Right, read at the head: the REST route builds a typed literal against the published request, and the dispatcher's /meta branch and the MCP draft door each build their request field by field with no body spread. The published SaveMetaItemRequestSchema does not declare it (pinned). The datasource schema is strict, so the body is no channel either (pinned on the real save).
  5. PATCH /api/v1/datasources/{name} and POST .../migrate-credential are saved through the kernel save in the package the row is stored in, with no parentVersion. The route is right (ruling: all three writes go through the save). The accept-set change it implies is NOT fully named, and that part is wrong: see M1. The door hands the kernel the raw at-rest body, and the kernel's schema gate judges that whole body, so an edit or migration of a row whose at-rest body is not schema-valid moves from 200 to a refusal. The changeset, the PR body and the hits entry all say existing package-less datasources are unaffected.
  6. A host that registers no protocol service: the door's writes answer 503 SERVICE_UNAVAILABLE where they used to write the row directly. Right, and named in the changeset.
  7. Import landing: an object imported from a datasource stored in package P lands in P; a package-less or unreadable row lands loose; a datasource stored in two packages is refused. Right against ruling 6660988968 item 1 as executed by 7408558495 Q2. The stamp _packageId stays the first source and the stored package_id column answers only when the stamp names none.
  8. IDatasourceAdminService.createDatasource gains an optional third parameter and putDatasourceRecord an optional second. Additive on a TypeScript contract; right.
  9. The kernel's other refusals on a door write (409 METADATA_CONFLICT, 422 INVALID_METADATA, the read-only-base refusal) are answered by the route's catch-all as 400 with the door's own code and the kernel's sentence. Not wrong against any text in the diff, which promises a status only for the package refusal; see N3.

② Semver level

  • Metadata-protocol: narrowed is right. A create on this authoring door now owes a writable package, a requirement tightened, and App Studio 改版(4-3):服务端拒绝没有软件包的新建(只留四类豁免,原地保存照旧);先实测元数据接口存流程能当场注册,再下线自动化接口的新建 #38174 declared the same requirement the same way; amendment 7411737976 left the level to this review, and this settles it as narrowed. The rule-text change adds nothing a metadata author can write on any door, so it does not move the kind to added.
  • Clause-②: no (narrowing) is right for what is declared. No published accept set widens: the minted member is absent from the published request schema and from every wire door; the body key package is the narrowing's own carrier. The line is present, line-initial, in both the PR body and the changeset body.
  • Level: narrowed takes at least minor on each package the diff moves. The changeset carries minor on @objectstack/service-datasource, @objectstack/metadata-protocol, @objectstack/spec and @object-ui/app-shell; all four are moved by the diff. Right. It carries the BREAKING banner, a FROM → TO table with the one-line fix, and exactly one ADR-0087 marker (registered setup-datasource-create-names-package), which the new entry matches. Check Changeset and the registration gate are green on the head.
  • Wrong as written, by M1: the changeset's "Existing package-less datasources keep saving in place" and its FROM → TO table name one arm of the narrowing and miss the second.

③ Boundary flags

  • Dev open question Q1 (how the minted reference passes the own-reference rule): answered by the maintainer's ruling 7408558495, A with A2. The diff implements A2 and none of B, C or D.
  • Dev open question Q2 (import landing): answered as execution of ruling 6660988968 item 1; it rides this PR and is in the diff.
  • Dev open question on Metadata-protocol (none or narrowed): amendment 7411737976 set narrowed and deferred to this review; settled in ② as narrowed.
  • Dev open question on the docs sentence: in the diff (content/docs/data-modeling/external-datasources.mdx), and the sentence agrees with the route.
  • Dev open question on the premise-2 pin: amendment 7411737976 ruled the published type and schema pin enough. Accepted on the reading in ① item 4; the dispatcher and MCP doors carry no pin of their own (N2).
  • The four premises the ruling record requires: (1) other judges still run, pinned on the real save; (2) the wire cannot state the field, pinned on the published shape; (3) the fix(service-datasource)!: a datasource update whose new configuration fails to connect stores none of it #29981 pins are green, but on the package's kernel-save fixture, which judges only the package and the create-only conflict; (4) a refused save leaves no secret behind, pinned for create, update and migration. Premises 3 and 4 were therefore never measured against the real save's schema gate, which is where M1 and S1 sit.
  • The prohibition (no fallback to source, a direct write or a door-side package judgment): held. The direct insert and update are deleted; the direct delete stays, which the ruling record leaves to the seat and amendment 7408609939 keeps out of this PR; the PR body and the changeset both name it.
  • The PR-body correction the last dev report asked for (the in-flight tracking) is in the PR body.
  • Analysis confidence gap, a datasource row in a read-only package: under this diff the kernel's read-only-base judgment answers the door's edit. Not asked on the card; no finding. It is one more refusal that reaches S1's path.
  • The ADR-0070 line "One open door outside the kernel save" is the maintainer's Tier H edit; the diff does not touch docs/adr. Right.
  • Final dev report 7413538376: open_questions empty, security_findings none.
  • SQL push-down. Two new reads. storedDatasourcePackageId (plugin.ts) pushes type, name and state into the query and reads one column: no finding. heldByAnotherDatasourceRow pushes type = 'datasource' and compares external.credentialsRef in application code over every datasource row, with no reason written beside it. A reason exists and is read from the tree: the reference lives inside the serialized metadata body, which has no column and no predicate portable across the drivers; the set is the environment's datasource rows; and the read runs only on the server-stated path when the body names the stated reference. It is neither an id materialisation nor an in-app join. Graded N1, for the missing sentence only.

④ Design judgment

The hits file, 19.setup-datasource-create-names-package.ts. Against ruling 7408558495 and its first consumer (the door): surface, replacement and reason agree with the route sentence by sentence. The 422 carries details.writablePackages (inThisDoorsWords, relayed by badRequest); the 400 on an empty or non-string package is at the route; the edit and the migration save in the row's stored package (storedPackageOf); the import landing follows the stored row. No D2 conversion is right: no authored source spells anything that moves. Its acceptanceCriteria does not hold: see M1.

The rule text, protocol-datasource-credentials-ref.ts header and judge. The A2 paragraph agrees with the ruling and with the code: equality with the stated reference AND no other stored datasource row holding it; the row excluded as "the one this save writes" is the name in the resolved package layer, drafts included, so the same name in another package is another row and is held; a stated reference the body does not name changes nothing; only this judge reads the member. The restore and publish doors pass no stated reference, so a draft or a history body naming a minted reference is still refused there, as the #27818 paragraph says. The rewritten sentence "A save through this door seals nothing of its own" keeps the parent rule's two arms. The header is sound as governing text, with one bullet left behind (N4).

protocol-door-requests.ts, protocol-save.ts, registry-question.ts. The member's jsdoc agrees with the judge. The call site hands the member and host.engine to the judge and changes nothing else. The producer row is body-only with one call, which is what datasource-record-save.ts does.

datasource-record-save.ts, datasource-admin-plugin.ts, admin-routes.ts, plugin.ts, the contract file. They agree with the ruling, apart from the findings below. A create sends parentVersion: null and the request's package; an update states the stored row's package so the save never moves it; the door stamps no code of its own. The in-flight guard is keyed by name, lives for the duration of the door's own save, and a /meta save of another name still converges through the projector (pinned).

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. updateDatasource rebuilds the pool from merged before it stores (#29879), then calls the save; the catch removes the minted secret and rethrows, and nothing returns the pool to existing. On main that catch was reachable only on a store failure. Now every kernel judge reaches it (422 INVALID_METADATA including M1's rows, the read-only-base refusal, a conflict). The admin is told the edit was refused while queries run against the new host with a credential whose secret has just been removed, until the next restart or edit. The #29879 text in the same function says "the stored record has to be the one still serving". The pin "an update the kernel refuses keeps the stored secret and removes the one minted for it" asserts the secret and the stored row and says nothing about the pool. Read, not run. To close: on a refused save after a rebuild, converge the pool back to existing, with a pin on the pool verdict.

N1 (nit) — heldByAnotherDatasourceRow carries no sentence on why the comparison is not pushed down (③). A comment; no effect on what is judged.

N2 (nit) — The dispatcher's /meta door and the MCP draft door have no pin that they never name mintedCredentialsRef; they hold today by construction (read). The dev's option C, behavioural pins in rest and runtime, is a follow-up card.

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 ?package= and the CLI flag where this door reads the body's package, and carries no details.writablePackages for the Console's pick. Every other kernel refusal is answered 400 with the door's code. inThisDoorsWords also drops the kernel's "packages could not be listed" tail when the registry cannot list them. No text in the diff promises otherwise.

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 /meta save of the same datasource whose projector runs while the door's own save of that name is still in flight skips its pool convergence. The window is one save long and the door settles the pool from its own record afterwards. Named, not asked to change.

Implemented-by: claude/issue-39398-wip
Reviewed-by: session_016WV4czfEjskBjZM6jhKWFR

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

2026-12-04T17:04Z · L1-a delta verdict: REWORK at head bcda593188 (zone em-upgrade, Fixes #39398), after ACCEPT 7414416756 and L2 FAIL 7414632005. The code delta reads right. One declaration is wrong, and the fix is prose-only.

席位核对

Must-fix: the change now widens a published surface, but it still declares Clause-②: no (narrowing).

  • This head adds two exports to @objectstack/spec/kernel: getMetadataTypeCarryForwardRetirement (function) and MetadataCarryForwardRetirement (type). Both are recorded in packages/spec/api-surface/kernel.json and export-origins/kernel.json.
  • A new published export is a widening. The tree's convention is Clause-②: yes (widening) — new optional members and exports only (ui/packages/i18n/CHANGELOG.md:189).
  • A change that both widens and narrows declares Clause-②: yes (narrowing) and names what it widens in the same line. The precedent is ui/packages/i18n/CHANGELOG.md:354: "Widened in the same change: … the new @object-ui/types export actionFoldedIntoMenu".

Please change both carriers, the changeset and the PR body, to Clause-②: yes (narrowing) — …. Name the narrowing's two arms and add "widened in the same change: the @objectstack/spec/kernel exports getMetadataTypeCarryForwardRetirement and MetadataCarryForwardRetirement". Metadata-protocol: narrowed, the minor levels, the banner and the ADR-0087 marker stay as they are.

What holds in the delta (read at this head).

  • M1, route (a). The edit and the credential migration now send the served (redacted) form. The kernel's carry-forward restores what a read withholds, so a legacy row with cleartext config.password keeps its label and active: false edits.
  • S1. A refused update converges the pool back to the stored record.
  • F1 A (ruling 7416154891).
    • The retirement is a declared, pure spec hook, applied in planCarryForward beside notCarriedForwardKeys. It is not named in the protocol.
    • A body that binds a non-empty external.credentialsRef drops only the driver's refusedCredentialKeys slot (config.password, turso's config.authToken).
    • Alias spellings and URL passwords stay carried and are reported as remaining.
    • Every drop is named: withheld-key-dropped advisories on every door, and droppedWithheldKeys on the admin door.
    • Stored-row pins cover a restart and a second already-bound run.
  • F2 A. Text only. The second FROM → TO row is at the measured 400 DATASOURCE_ADMIN_ERROR, with one pin each on the real save and at the door.
  • N1 and N4 are fixed.
  • protocol-save.ts is untouched beyond carve-out 7411804939. Amendments 7416186562 and 7417657917 cover the new surface.

Gates.

  • 70 success, 0 failed, 0 pending on bcda593188.
  • The dogfood battery passed on all 3 shards.
  • l1-face's one unexpected skip is the /3→/4 Dogfood Regression Gate matrix rename on main. The aggregate is success, so it is cleared.

Next. The delta CONTRACT_REVIEW_TIER L2 runs on this head now. The declaration fix is on the prose faces (the changeset and the PR body) and does not change what it judges. Send me the head that carries it, and I'll confirm the delta L1 and send both ids to the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bcda593188837eec083bf9ac9c3ee5d26ee666a2
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.setup-datasource-create-names-package.ts, packages/spec/src/kernel/metadata-type-redaction.ts + packages/metadata-protocol/src/metadata-redaction.ts, packages/metadata-protocol/src/protocol-datasource-credentials-ref.ts, packages/services/service-datasource/src/datasource-record-save.ts, packages/services/service-datasource/src/datasource-admin-service.ts, packages/services/service-datasource/src/datasource-admin-plugin.ts, packages/services/service-datasource/src/contracts/datasource-admin-service.ts

Delta record after contract review 7414632005 (FAIL at b5ea483e6). Read: git diff b5ea483e61..bcda59318 (15 files, two commits), the card's comments since that record (dev reports 7415555005 and 7417607627, analysis 7416035148, ruling record 7416154891, claim amendments 7416186562 and 7417657917), the PR body, and the check-runs on this head. Four faces are judged: the two spec paths, the declared narrowing, the #27762 rule text, and the carry-forward retirement rule. Tests, the changeset, packages/spec/api-surface/kernel.json, packages/spec/export-origins/kernel.json and scripts/engine-double-contract.pinned.json were read to judge the files above and are otherwise the lane seat's. Code outside the diff was read, never reviewed: planCarryForward's callers, default-datasource-driver-factory.ts, datasource-connection-service.ts, scripts/pm/clause2-line.mjs and the Clause-② criterion in .claude/skills/pm-dispatch/references/execution-duties.md. Nothing was run here.

Check-runs on this head: 70 success, 11 skipped, none failed, none pending.

The PR head moved while this record was written. 9f9887c33 adds one commit on top of this head: one line of the changeset, the Clause-②: line. This record is on bcda59318 as asked; what that commit does to D1 is said under D1, and its check-runs were still in progress when read.

M1: closed
S1: closed
N1: closed
N4: closed

① Derived judgments

  1. An edit and both writes of the credential migration now send the kernel save the body a read serves (servedFormOf, the type's own read redactor, the one planCarryForward compares against). Right. It is route (a) of M1. A row holding cleartext stored before feat(spec)!: refuse inline credentials at publish — driver config + connector authoring door (#7990, spec half) #8078 keeps its label and active: false edits and its credential: the dev measured the 422 this replaces on the real save (report 7415555005), and the head pins the fix on the real save and through the door over the real save, reading the row at rest.
  2. A refused save after a pool rebuild converges the pool back to the stored record. Right; it is S1's ask, pinned on the pool verdict with an ablation.
  3. New kernel rule, on every door: a datasource body that binds external.credentialsRef does not get the driver's inline credential slot (config.password; turso's config.authToken) carried forward; the row is written without it and the save names each position on advisories. Right against ruling 7416154891 (F1 A), which is the maintainer's word for deleting the stored cleartext copy. This changes what a /meta save stores for a row holding both, as the ruling says it does.
  4. New published surface: getMetadataTypeCarryForwardRetirement and the type MetadataCarryForwardRetirement are exported from @objectstack/spec/kernel (api-surface/kernel.json gains both). Right as a design, and the amendment allowed the hook. Its declaration is wrong at this head: D1.
  5. DatasourceSummary.droppedWithheldKeys, optional, on the update answer, and putDatasourceRecord now answers what the save dropped. Additive; right, and it is how the ruled "named on the admin door" is met (amendment 7417657917).
  6. Second narrowing arm, declared: an edit that leaves a stored config or pool the schema refuses for a reason other than an inline credential moves from 200 to 400 DATASOURCE_ADMIN_ERROR with the kernel's sentence naming the key. Right against ruling 7416154891 (F2 A): text only, no kernel exemption.
  7. Carried from the first record, unchanged and still right: the create's 422, the body key package, the A2 pass, the 503 on a host with no save, the import landing.

② Semver level

  • Metadata-protocol: narrowed still fits. F1 changes what a save of a body binding a reference stores, which is semantic at most; F2 is a second narrowed arm; narrowed outranks semantic. The changeset keeps minor on the four packages the diff moves, the BREAKING banner, one ADR-0087 marker, and now two FROM → TO rows with a one-line fix for each. Check Changeset is green on this head.
  • Clause-②: no (narrowing) no longer fits: D1.
  • Correction to my first record. It judged no (narrowing) right by reading the wire accept set only. The criterion (execution-duties.md: does the card relax an accept set or enlarge the public surface, the surface being what a package's built entry declarations reach, through re-exported names and their parameter and return types) also reaches three members already present at b5ea483e6: mintedCredentialsRef on the request type of the exported ObjectStackProtocolImplementation.saveMetaItem, the optional landing parameter of IDatasourceAdminService.createDatasource, and now droppedWithheldKeys on DatasourceSummary. Read, not measured on a built declaration closure. They point the same way as D1 and change neither the level nor the fix.

③ Boundary flags

  • F1 premises listed by ruling record 7416154891:
    • With a reference bound, no driver arm reads the inline slot at connect. Holds, read here: datasource-connection-service.ts resolves a declared reference fail-closed and refuses an empty secret before any build, and every arm of default-datasource-driver-factory.ts takes spec.secret ahead of cfg.password or cfg.authToken, the URL branches included. Read, not run per driver, as the dev states.
    • After a migration on the real save the stored row holds no inline slot, a restart restores the clean record, and a second run answers already-bound. Pinned in the dogfood file over the real kernel save, reading the row text; green on this head.
    • A row with no reference keeps its inline credential through a label edit. Pinned as the control on the real save and through the door.
    • Alias spellings and a URL password are still carried forward and reported as remaining. Pinned, and by construction: the retirement names refusedCredentialKeys of the body's driver only.
    • Every dropped position is named on /meta and on the admin door. Pinned on both: advisories with rule withheld-key-dropped, and droppedWithheldKeys.
  • F1 prohibition (no direct write, no source, no second server-stated member): held. protocol-save.ts is untouched in the delta.
  • F2 as ruled: the changeset's second FROM → TO row and sentence, the entry's surface, replacement and acceptanceCriteria, and the door's comment on RECORD_JUDGE_EXEMPT_PATCH_KEYS are all in line; the pin "corrected config with active: false saves" exists on the real save and through the door. The ruling left one choice to this review: whether the door should relay the kernel's 422. Not asked. The door answers every service refusal but its named relays as 400 with its own code, the declared text now says 400, and a second status convention on one route family is not worth a head move.
  • Dev out-of-scope finding, the driver change (carrier: none). A door edit that changes the driver of a row holding an inline credential and no reference stores the old driver's credential on the new driver's config: planCarryForward does not compare drivers, while the door's own restoreRedactedConfig skips a driver change, so the pool is built without the credential and the stored row holds it. On main the door stored what the pool was built from. Read, not run. The rule is the kernel's and predates this PR, and /meta has the same behaviour today; it is new for the door because edits now save through the kernel. It owes a Bug card before ACCEPT, citing the dev's dedupe words; "carrier: none" does not answer it. Not graded on this head: no line of this delta decides it, and the door's added sentence ("This restore is what the POOL is built from; the kernel's is what is stored") says the split truthfully.
  • Dev out-of-scope finding, two stale texts in held files: the hint in droppedWithheldKeyNotices gives a connector example on a datasource drop, and the [security] GET /api/v1/meta/datasources still serves stored cleartext credentials — the metadata read path has no per-type redaction hook #8154 comment in protocol-save.ts still says cleartext removal is "deliberately not attempted". Both files are outside the claim; the PR body names both. Follow-up, N6.
  • Files outside the listed surface are recorded by amendment 7417657917. Final dev report 7417607627: open_questions empty, security_findings none.
  • SQL push-down: the delta adds no read. The reason asked for in N1 is now written at heldByAnotherDatasourceRow.

④ Design judgment

packages/spec/src/kernel/metadata-type-redaction.ts (new hits file), against ruling 7416154891 and its first consumer planCarryForward. The rule is declared in the spec and applied generically; metadata-redaction.ts names no type and no key. That is the ruling's "declarative kernel rule in the carry-forward". The hook reads the INCOMING body, which analysis premise 3 showed is required: on a first bind the stored row holds no reference. The function is pure, answers nothing for a body with no non-empty string reference, and names exactly config. plus each refusedCredentialKeys entry of the body's driver, in the redactor's own dotted spelling, so the positions meet served.redactedKeys (pinned by the answer naming datasources[0].config.password). Its docblock holds sentence by sentence against the connect path read in ③. The registry is a closed built-in map with a getter and no register function: the smallest surface that serves the one consumer. In planCarryForward the retired positions join the existing not-carried-forward set, so they take the path ruling 6566912252 already set: never grafted, dropped only where the incoming body leaves the position empty, each drop reported. A body the own-reference judge refuses is refused before the carry-forward, so a refused bind drops nothing.

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.

19.setup-datasource-create-names-package.ts. surface now names the second arm with the status the door answers; replacement gives the remedy the ruling chose and states the retirement; acceptanceCriteria drops the false "UNAFFECTED: editing ... migrating" and states what is pinned: the 400 naming the key, the corrected edit saving, the migration leaving no inline slot after a restart, a second run answering already-bound, and the label or active: false edit of a credential-only legacy row unaffected. Each sentence has a pin on this head. The entry holds.

The rule text, protocol-datasource-credentials-ref.ts. The edit bullet now carries the same exception as the create bullet. The header reads true sentence by sentence.

datasource-record-save.ts, datasource-admin-service.ts, datasource-admin-plugin.ts, the contract file. The served form is sent only where a stored row exists (the edit and both migration writes); a create sends the authored record, which the door has judged. The pool is still built from merged with the door's own restore, and the kernel stores its own carry-forward; the two agree except on a driver change (③). convergePoolToStored runs after the in-flight guard is released, reads the stored row through the host's convergePool, degrades without throwing, and the refusal is what is rethrown. The registry slot is registered without the dropped positions, so the Setup read agrees with the row at rest without a restart, which was the silent half of F1 at the previous head.

D1 (must-fix) — The Clause-② declaration is false at this head. The PR body and the changeset both read Clause-②: no (narrowing). This delta exports two new names from @objectstack/spec/kernel, getMetadataTypeCarryForwardRetirement and MetadataCarryForwardRetirement, and the committed api-surface/kernel.json records both. The criterion is "does this card relax an accept set or enlarge the public surface", and it does enlarge one; a wrong no is an auditable false declaration. The grammar has the true spelling, yes (narrowing): a diff that widens one surface and narrows another. Shipped bytes and the level do not change (minor already). The fix is prose in both carriers, the PR body line and the changeset line, and it moves the head. Commit 9f9887c33, pushed after this head, changes the changeset line to Clause-②: yes (narrowing) and names both exports; the PR body still read no (narrowing) at 2026-12-04T17:07Z, and that head's check-runs were in progress. D1 closes on a head where both carriers read yes (narrowing) and the checks are green.

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 droppedWithheldKeyNotices hint's connector example, and the #8154 comment in protocol-save.ts. A follow-up card once #39668 releases the file.

No should-fix.

Implemented-by: claude/issue-39398-wip
Reviewed-by: session_016WV4czfEjskBjZM6jhKWFR

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

2026-12-04T17:35Z · L1-a delta verdict: ACCEPT at head 9f9887c339 (zone em-upgrade, Fixes #39398), after delta REWORK 7418421998 at bcda593188 and delta L2 7418558640 (D1 open)

席位核对

The must-fix is closed. The one commit since bcda593188 changes only the changeset's declaration line. It now reads Clause-②: yes (narrowing) — narrowed: …; widened in the same change: the @objectstack/spec/kernel exports getMetadataTypeCarryForwardRetirement and MetadataCarryForwardRetirement, following the ui/packages/i18n/CHANGELOG.md:354 precedent. The PR body carries the same line. Metadata-protocol: narrowed, the minor levels, the BREAKING banner, both FROM → TO rows and the ADR-0087 marker are unchanged. No code moved, so my read of the code delta at bcda593188 stands: M1 by route (a), S1, F1 A and F2 A under ruling 7416154891.

Owed line delivered. The door's driver-change follow-up the L2 raised is filed as #39737, and the PR body names it (Out-of-scope filed: #39737).

Gates. 72 success, 13 expected skip, 0 failed, 0 pending on 9f9887c339. The Dogfood battery (opt-in) passed, with all 3 shards.

Next. A delta L2 on this head closes D1. After that, both ids go to the seat, since a narrowing lands through the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

Contract-review-claim: session_016WV4czfEjskBjZM6jhKWFR · 9f9887c · 2026-12-04T17:36Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9f9887c339c1fa3c0208cf73988c97656cfa4de8
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.setup-datasource-create-names-package.ts, packages/spec/src/kernel/metadata-type-redaction.ts + none

Second delta record, after 7414632005 (FAIL at b5ea483e6) and 7418558640 (FAIL at bcda59318, on D1 alone). Read: git diff bcda593188..9f9887c33, the PR body, the check-runs on this head, and card #39737. Nothing was run here.

The delta is one file and one line: the Clause-②: line of .changeset/39398-setup-datasource-create-names-package.md. No source file, no test, no generated output and neither hits file moved, so every judgment of record 7418558640 on the code, the two spec paths, the rule text and the carry-forward retirement rule carries to this head unchanged. + none: the delta holds no implementing file.

Check-runs on this head: 72 success, 13 skipped, none failed, none pending. Check Changeset, Lint · PM dispatch-gates, Governed Surface Queue Guard, Test Core, Test UI and Dogfood battery (opt-in) are among the successes.

D1: closed

① Derived judgments

Nothing 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

  • Clause-②: yes (narrowing) is true, and both carriers now say it. The changeset line and the PR body line are identical, line-initial, and in the one spelling scripts/pm/clause2-line.mjs reads for a diff that widens one surface and narrows another. The widening is the two exports the diff adds to @objectstack/spec/kernel, getMetadataTypeCarryForwardRetirement and MetadataCarryForwardRetirement, both recorded in the committed api-surface/kernel.json. The narrowing is the two declared arms: the create naming no package, and the edit of a row whose stored config or pool the schema refuses.
  • Metadata-protocol: narrowed is unchanged and still fits. The level is unchanged: minor on the four packages the diff moves, which both yes and narrowed require. The BREAKING banner, the two FROM → TO rows and the one ADR-0087 marker are untouched.
  • The prose after the dash names the two spec exports as the widening. The correction in record 7418558640 also read three optional members as reachable public surface (mintedCredentialsRef on the exported save's request type, the landing parameter of createDatasource, droppedWithheldKeys on DatasourceSummary); they are not named there. The value and the arm are the declaration and are true with or without them, and that reading was not measured on a built declaration closure. N7.

③ Boundary flags

④ Design judgment

Neither hits file and no implementing file changed since bcda59318; the design judgment of record 7418558640 on each of them holds at this head as written. The one changed line was judged in ② against the tree, not against the PR body's account: the two exports it names are in packages/spec/src/kernel/metadata-type-redaction.ts and in the committed API surface ledger, and the two narrowing arms it names are the ones the entry and the FROM → TO table declare.

N7 (nit) — The declaration's trailing prose lists the two spec exports and not the three optional members on the metadata-protocol and service-datasource entry types. Prose on a prose face; the declared value and arm are right either way.

No must-fix, no should-fix.

Implemented-by: claude/issue-39398-wip
Reviewed-by: session_016WV4czfEjskBjZM6jhKWFR

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

速读 · PR #39676 (Fixes #39398) · head 9f9887c339c1fa3c0208cf73988c97656cfa4de8

  • 改了什么:在 Setup 里新建外部数据源,现在必须指定它属于哪个包,并走统一的保存通道。以前新建出来的数据源不属于任何包,升级或迁移时可能被漏掉。旧数据源改个名称或停用这类编辑照常保存,凭据也一起带过去。凭据迁移以后,明文密码不会再留在库里。
  • 收窄(请批的原因):两处。一是新建时不指定包会被拒绝;二是如果数据源库里存的配置本身不合规(比如有未声明的配置项),编辑时会被拒,要把配置改正后一起提交。同时放宽:新增两个对外导出。已声明 Clause-②: yes (narrowing) · Metadata-protocol: narrowed。
  • 依据:Elon 的三次裁决 7408558495(Q1 A2)和 7416154891(F1 A、F2 A)。
  • 要你做什么:批准本 PR。契约审核增量 PASS 7419267830(CONTRACT_REVIEW_TIER,无 must-fix/should-fix),批准后由座位落地。
  • 席位意见:接受。

席位核对 — ACCEPT · repo:objectstack@os-elon-musk · head 9f9887c339c1

  1. 形态:draft,base main,37 files +2064 −157;Fixes #39398;Clause-②: yes (narrowing) · Metadata-protocol: narrowed · Skills-docs: updated here — content/docs/data-modeling/external-datasources.mdx。
  2. 前提实测:按维护者三次裁决实现,不走例外豁免。L1 7414416756 → 增量 REWORK 7418421998 → 增量 ACCEPT 7419194432;L2 FAIL 7414632005 → 增量 7418558640 → 增量 PASS 7419267830 于本 head(M1/S1/D1 已关)。只改 protocol-save.ts 里的一处调用,按 os-tesla 的 carve-out 7411804939。
  3. 门禁 check-runs(本 head,席位自读):72 success · 13 expected skip · 0 failed;Dogfood battery (opt-in) success(三个分片);mergeable_state clean;check-governed-merges:NOT governed。
  4. 接受的偏差:L2 nit N7(措辞)。
  5. 范围外去向:datasource edit that changes the driver: the kernel carry-forward stores the old driver's credential on the new config while the pool is built without it #39737(驱动侧改动)、meta list: GET /meta/form?object= with an empty value answers every form instead of 400 like view #39612、boot census: a sealed-type leftover row with no override channel (hook) is told to delete the row, which the door refuses 403 #39652。
  6. 落地条款:声明收窄 ⇒ 维护者授权批准后由座位落地(审批后的 Tier H PR 由座位自己合并,Elon 2026-12-03T23:43Z)。在手任务,符合「当前任务处理完,合并后待命」(2026-12-04T15:09Z)。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

维护者速读

  • 改了什么:在 Setup 里新建外部数据源,必须指定它属于哪个包,并走统一的保存通道;以前新建出来的不属于任何包。旧数据源改名、停用照常保存,凭据也一起带过去;凭据迁移后明文密码不再留在库里。
  • 收窄(请批的原因):新建时不指定包会被拒绝;库里存的配置本身不合规的数据源,编辑时要把配置改正后一起提交。同时放宽:新增两个导出。已声明 Clause-②: yes (narrowing) · Metadata-protocol: narrowed,依据 Elon 裁决 7408558495、7416154891。
  • 要你做什么:批准本 PR。契约审核增量 PASS 7419267830,Head-sha 9f9887c339c1fa3c0208cf73988c97656cfa4de8,无 must-fix/should-fix;Dogfood battery (opt-in) 已 success。批准后由座位落地。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 4, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 4, 2026 17:42
@os-zhuang
os-zhuang marked this pull request as ready for review December 4, 2026 22:59
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 79d7153 Dec 4, 2026
93 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-39398-wip branch December 4, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs:dogfood-battery pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup POST /api/v1/datasources creates a package-less datasource row outside the kernel save, past the #38174 close

3 participants