Repository navigation
fix(verify): os verify writes nothing to an object on an external datasource, even one whose write gate is open - #35509
Conversation
…te family Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
…nal datasource Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
…t not exercised Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
…te the skip reason names Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 8 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 5ef3eaacf2ec0711511aa34719936f359d40c7fd && git checkout 5ef3eaacf2ec0711511aa34719936f359d40c7fd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d76d57ab466a4aae62f80f135d4ccbd4b1a42a1f ff7922b62bfb4d287c3c8e0ff586d169f7014353 && git checkout -B drift-repro d76d57ab466a4aae62f80f135d4ccbd4b1a42a1f && git merge --no-ff ff7922b62bfb4d287c3c8e0ff586d169f7014353
node scripts/docs-audit/affected-docs.mjs --json d76d57ab466a4aae62f80f135d4ccbd4b1a42a1f |
… and pays its boot imports at collection Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt Final green head for L1:
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — REWORK (L1-a) · repo:objectstack#1 · head
|
…red managed datasource is still written Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt Final green head for L1 (delta after REWORK 7011371936):
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — ACCEPT (L1-a, delta) · repo:objectstack#1 · head
|
…rify-external-no-writes
|
repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt Landing · 2026-11-19T15:00Z · area b1-B, after L1-a ACCEPT 7012204755 (delta, head
State: ready + auto-merge now; #35255 closes on merge. Follow-up for the managed-datasource half plus the cascade wording: #35523 (it also carries the |
Fixes #35255
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/verify/src/derive.ts:deriveCrudCasesnow blocks every object on an external datasource, whatever its write gate says. Before, an object whose gate was open (the datasource'sexternal.allowWritesand the object'sexternal.writable) got a CRUD case with a synthesized body, and every write family that builds its records from that case (CRUD, RLS, reference shapes, delete behaviours, unique scopes, parent write reach, dashboard windows) wrote to it. The harness connects the app's declared datasources the wayos devdoes (ADR-0062 D1/D2,DatasourceAdminServicePlugininharness.ts), so those writes went to the real database behind it. The skip reason names the gate's state:external datasource "NAME" (writes allowed): not exercised — verify writes only to its ephemeral store, or(read-only). A datasource counts as external the way the engine's write gate counts it (a declaredschemaModeother thanmanaged, or an object with anexternalblock), so an object bound byschemaModealone is covered too.blocked/skippedreporting; no interface changes.harness.tsheader, the quotation of it at the sign-up site,packages/verify/README.mdand theos verifysection ofcontent/docs/deployment/cli.mdxno longer say the harness "never touches a real database". They say what happens: its own database is in-memory; declared datasources are connected as underos dev, so reads reach them; verify's own writes never reach an object on an external datasource; a write the app makes itself (its seed, or a hook or flow one of verify's writes fires) goes where the app sends it; only--flowrefuses every write routed away from the in-memory database.datasourcesresolves across packages (ADR-0130 D4):packages/verify/src/artifact-collections.test.tsand the option-B probe row inpackages/cli/test/fixtures/option-b-reader-probe.ts. Both now read the same map through the reason: it says(writes allowed)only when the datasource was found.Tests
packages/verify/src/verify.external-datasource-no-writes.test.tsboots one stack whose app declares an external datasource with an open write gate, backed by a driver the suite owns that records every write. It runs the CRUD round trip, reference shapes, delete behaviours and unique scopes over it. The recording driver receives no write, each family's report names the external object not exercised, and the CRUD report lists itskippedwith(writes allowed). A managed object that requires it is skipped; one that only references it is verified. CONTROL: a write sent through the REST door to the same object does reach the recording driver.derive.test.ts: the external block now pins read-only, half-open, fully open andschemaMode-only shapes, the cascade to a dependent, and a managed secondary datasource staying unaffected.Ablation (one run, then restored)
node scripts/ablation-replace.mjsonpackages/verify/src/derive.ts, restoring the old behaviour (let a fully write-opted-in external object through): anchor x1 to x0, blobd29f7503to0aa7a191. The suite resolvesderive.tsfrom source (relative import), so no rebuild was needed for this leg.Tests 2 failed | 1 passed (3). The recording driver received 10 writes (expected[]), every one acreateonvxn_remote, from the four families run. The CRUD row readvxn_remote read-failed (404)instead ofskipped.blob after restore d29f7503 == blob at HEAD,git diff HEAD empty.This also measures the card's premise: the harness does connect the declared external datasource, and the derived writes do reach its driver. Against a real database they would land.
Acceptance notes
os dev. Confining every write the way--flowdoes (a middleware refusing writes routed away from the ephemeral driver) is the other shape the card allowed; the seat ruled for this one. Read from the code (the seed loader and the engine's write gate do not gate on verify), not measured.required relational target "X" is not synthesizable), which does not say the target was withheld on purpose. Wording only.Verification
Two-minute check:
pnpm --filter @objectstack/verify exec vitest run src/verify.external-datasource-no-writes.test.ts. Expect 3 passed, with no write recorded by the external driver.Read first:
packages/verify/src/derive.ts, the external branch of pass 1: the only behaviour change.packages/verify/src/verify.external-datasource-no-writes.test.ts: the recording driver and the control.packages/cli/test/fixtures/option-b-reader-probe.ts: the witness row's newlostpredicate.Local readings are in the report comment on the card; CI runs the rest.
Generated by Claude Code