Repository navigation
Description
Measured while establishing the seed-replay cost for objectstack-ai/cloud#1560 (fix: objectstack-ai/cloud#1561). The cloud side is closed; this is the framework half of the same cost, and it comes with an open question I could not settle from outside the container.
The measurement
Rig: scripts/dev-local/bootstrap-curve.mjs in the cloud repo — the real ArtifactKernelFactory.create() over the real TursoDriver in mode: 'remote', with an instrumented @libsql/client counting every round trip and attributing it to a build step.
Synthetic artifact: 10 objects, N seed records spread across them, each record carrying one cel time value so the loader's isNoOpReplay skip cannot fire (--seed-dynamic). Every point is a rebuild — tables present, rows already seeded.
| seed records | 0 | 100 | 200 | 400 | 800 |
|---|---|---|---|---|---|
bootstrap step round trips |
239 | 552 | 852 | 1452 | 2652 |
3.02 round trips per seed record, inside bootstrap. Same 3 legs the seed loader's update path always pays — a pre-read, the UPDATE, and a read-back — and they are sequential: charging a synthetic per-call RTT scales the step proportionally.
The source is AppPlugin's inline boot seed (packages/runtime/src/app-plugin.ts, the else branch after the multiTenant check), running SeedLoaderService.load() over normalizedDatasets at plugin start, on every boot.
Why this is a finding and not a bug report
The inline seed is already gated:
const multiTenant = this.organizationWallActive(ctx);
if (this.skipSeedData) { … } else if (multiTenant) {
seedSource.suppress('multi-tenant-replay');
// "per-org replay will run on sys_organization insert"
} else { /* inline seed — the 3 legs/record path */ }In the rig's kernel the gate reads false and the inline seed runs. I could not establish whether it also reads false in the production container — that needs a reading from a live tenant kernel, and cloud#1560's ruling forbids touching the reproduction environment. So the honest statement is:
- The cost is real and measured on a kernel built by the production factory with the production capability slate.
- Whether production reaches this branch is unverified. If it does, every hosted environment pays ~3 sequential legs per seed record inside
bootstrapon top of what cloud#1561 just removed fromseed-replay— andbootstrapis the step objectstack-ai/cloud#1555 measured at 134 s against a 20 s request waiter.
What would close it
Two separable questions, and the first is cheap:
- Does a hosted tenant kernel take this branch? One log line, or one assertion in an existing multi-tenant harness, settles it. If it does not, this reduces to a single-tenant
os devcost and can be closed as such. - If it does — the same shape as objectstack-ai/cloud#1561: a boot that re-applies a seed union it has already applied has nothing to gain from the round trips, and the fix is to know that rather than to make each leg cheaper. Batching the update path would also help every genuine first seed, which the ledger approach does not.
Related, same family: #10946 (4 sequential round trips per permission set / position at boot), #10945 (registry rescan, quadratic in stored metadata).
Activity
huangyiirene commentedon Aug 22, 2026
Concentration-round first-touch: promoted
finding→pm:queue, Task,domain:cli(lands inpackages/runtime'sAppPlugin).Scope in the card's own order — the cheap question gates the expensive work: step 1 only as dispatched scope: establish whether a hosted tenant kernel takes the inline-seed branch (one log line or one assertion in an existing multi-tenant harness; the cloud container itself is off-limits per the cloud#1560 ruling the card cites). Branch not taken in production ⇒ report and close as single-tenant
os devcost, no further work. Branch taken ⇒ report back with the reading; the ledger-shaped fix (know the seed union is applied rather than re-pay 3 legs/record) is then re-graded with the measured stakes — it is cloud#1561's shape and may want that PR's author-context. Related bare cards #10946/#10945 (same boot-cost family) are still awaiting sweep — the dev should not fold them in uninvited. Size S for step 1.Generated by Claude Code
os-zhuang commentedon Aug 23, 2026
The blocking fact, now measured — hosted-tenant kernel posture is WALLED, not single
Incoming
domain:cliseat, sessionsession_019siH5jDmk5hrayvfyojUqR. ⛔ Not a grading, ⛔ not a decision — supplying the fact the outgoing seat correctly refused to infer from circumstantial evidence.Why this seat could answer it when the last one could not
The outgoing shift recorded this as structurally unanswerable: 「本仓结构性答不了(ArtifactKernelFactory 在 cloud 发行版,@objectstack/organizations 本地没装),本 session 作用域不含 cloud 仓」. That was true of that session's authorization surface, not of the question. I attached
objectstack-ai/cloudto this session (it was needed anyway to judge #10938'sBlocked-by: cloud#944), so the reading is now takeable.⭐ Worth recording as a lane reading: "this repo cannot answer it" and "this session cannot answer it" are different claims, and the second one expires the moment scope changes. The predecessor was right not to guess; it just did not need to stay unanswered.
The reading — cloud @
b7d3dafeTaken from the live source, then corroborated by the changeset that put it there (⛔ not the other way round — a changeset describes a change, the source is the current state):
packages/objectos-runtime/src/artifact-kernel-factory.ts:And
.changeset/drop-dangling-plugin-org-scoping-link.md, on the same tree:What that establishes, and what it does not
Established: a hosted tenant kernel is walled. Row scoping is real (
organization_idauto-stamping viaOrganizationsPlugin), it is ordered beforeSecurityPluginby an explicit ordering requirement, and the kernel fails closed rather than degrading to unscoped if the plugin cannot load. So "hosted tenant = single-org, no wall" is ruled out.⛔ Not established, and I am not stretching the reading to cover it: how many organizations a typical hosted environment actually carries at boot, which is the number this card's seed-cost arithmetic (3 sequential round trips per seed record) is ultimately sensitive to. The wall existing tells you the seed path is per-org scoped; it does not tell you the multiplier. If the card's cost estimate turns on that count, that is a second fact and it is not this one.
Leaving the card in
needs-user-decision— the fact is supplied, the decision is not mine.Generated by Claude Code
claude commentedon Aug 23, 2026
Maintainer ruling recorded (atomic four-part write)
Ruled 2026-08-23, live PM chat, verbatim: 「10950 不考虑存量,其他接受你的建议」 — this card falls under the accepted recommendations. Ruled: settle on the reading, then act — posture is established WALLED (cli seat's source reading), but whether a hosted tenant kernel actually takes the AppPlugin inline-seed branch per boot is still one log line / one assertion away.
needs-user-decision→pm:queuein the same stroke (domain:cli). Dispatch shape: Step 1 take that single reading (coordinate with the repo:cloud seat if a hosted container is needed); if the branch IS taken ⇒ implement the seed-ledger short-circuit (cloud#1561 shape; batching helps genuine first seeds too); if NOT taken ⇒ close as single-tenantos devcost with the reading attached. Premise-first: stopping after Step 1 with a negative reading is a complete, valid delivery.Generated by Claude Code
os-zhuang commentedon Aug 24, 2026
Step 1 settled: a hosted tenant kernel does NOT take the inline-seed branch
domain:cliexecution seat, session019siH5jDmk5hrayvfyojUqR, round R33. Executing the branch themaintainer's ruling on this card already prescribes (comment
5386676209, 2026-08-23, verbatim):The assertion the ruling asks for already exists, and it is behavioural rather than a log-string
match. No new code was needed; what was missing was somebody joining the two halves.
The three links, each measured rather than inferred
1. Hosted tenant kernel is walled — established by the source reading in comment
5385089308andaccepted in the ruling above:
ArtifactKernelFactoryregistersOrganizationsPlugin(
@objectstack/organizations) beforeSecurityPlugin, and per ADR-0093 D5 fails closed ratherthan degrading when it cannot load it.
2.
AppPluginjudges on the live posture, per call —packages/runtime/src/app-plugin.ts:1345:Never cached, and never the demoted
resolveMultiOrgEnabled()— that was #5262's bug and it is fixed.plugin-authregisters thetenancyservice in kernel Phase 1, beforeAppPlugin's Phase 2start(), so the service is present on any real boot.3. A walled posture provably skips the inline seed —
packages/runtime/src/app-plugin.tenancy-posture.test.tspins the consequence, not just thepredicate, with
ql.insertas the witness (inlineSeeded: insert.mock.calls.length > 0) and thetenancyservice mocked in the exact{ posture }shapecreateTenancyServiceregisters:posture-only deployment with a wall in force skips the inline seedql.insert`group` is a walled posture too — not just `isolated`single-org deployments still seed inlineDEGRADED boot seeds INLINERecorded green 20/20 at
38cf397ea9. I did not re-run it, and I am not citing a stale number as afresh one: instead I measured that neither the subject nor the pin has moved since —
git log 38cf397ea9..origin/mainis empty for bothapp-plugin.tsandapp-plugin.tenancy-posture.test.ts, atorigin/main502ff8b5.Test Coreruns@objectstack/runtimeon every PR, so that green has been re-earned continuously on unchanged code.So the measured cost belongs to the population it was measured on
The rig that produced the 3.02 round trips per seed record is
scripts/dev-local/bootstrap-curve.mjs— dev-local. The card says so itself: "In the rig'skernel the gate reads false and the inline seed runs." That is now explained rather than left open:
the rig is unwalled, so it takes the inline branch; a hosted tenant kernel is walled, so it takes
seedSource.suppress('multi-tenant-replay')and pays the per-org replay path instead — which iswhere cloud#1561 already did its work.
The cost is real. It is a single-tenant /
os devcost, and no hosted environment pays it.DEGRADED boot seeds INLINEis pinned too, and it is pinned that way on purpose (reading theeffective posture is what keeps a degraded stack from booting with no seed data at all). So a
hosted environment launched with
OS_ALLOW_DEGRADED_TENANCY=1would pay this cost. Cloud'sfactory fails closed rather than degrading, which is why this is a residual and not a hole — but it
is the fact that would reopen this card, and it is a cloud-side reading, not an objectstack one.
Closing
not_plannedper the ruling, with the reading attached. Reopening is free: if a hostedenvironment is ever found booting degraded, this card is the record of what it then costs.
⛔ Step 2 (the seed-ledger short-circuit) is not implemented and is not owed — the ruling conditions
it on a positive reading, and the reading is negative.
Generated by Claude Code
hotlong commentedon Sep 28, 2026
Reading for the record (2026-09-28T13:23Z); this card stays closed. It was closed
not_plannedon the premise that a hosted tenant kernel is walled. Hosted logs falsify that premise: staging and production both logInline seed exceeded 8000ms budget … continuing in backgroundfor a marketplace app. The hosted kernel factory mountsOrganizationsPluginonly underOS_MULTI_ORG_ENABLED, which the hosted runtime never sets. Measured on objectstack-ai/cloud#2471. The hosted side no longer needs a framework change: cloud PR objectstack-ai/cloud#2473 turns the inline seed off for hosted kernels. Single-tenantos devboots, the population this was closed for, are unaffected.