Repository navigation
fix(console): ask the deployment notice, install-local and lookup targets only where the host serves them - #34240
Conversation
…gets only where the host serves them Claude-Session: https://claude.ai/code/session_01ADHkmQYCGiBcbEeLv3QcCs Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQYCGiBcbEeLv3QcCs Co-authored-by: Claude <noreply@anthropic.com>
The object-scope harnesses answer a names batch read the way the metadata door does, and the deployment-notice composition pin asks the notice as an administrator. Claude-Session: https://claude.ai/code/session_01ADHkmQYCGiBcbEeLv3QcCs Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQYCGiBcbEeLv3QcCs Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 16 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 6a34e84aec0a88ac3ea558f4541e07848680e566 && git checkout 6a34e84aec0a88ac3ea558f4541e07848680e566
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3 f1521e974a71b3b0cd45fdc05c19d99c85d7adea && git checkout -B drift-repro 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3 && git merge --no-ff f1521e974a71b3b0cd45fdc05c19d99c85d7adea
node scripts/docs-audit/affected-docs.mjs --json 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3
|
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf Contract reviewServed-tier: Face: declaration. ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf 席位核对Verdict: ACCEPT · head
|
Requested by Steve · project thread
Fixes #34186
Fixes #34187
Fixes #34188
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
features.deploymentNotice为 true 时读取;应用市场目录只在features.installLocal为 true 时读 install-local;无包应用的页面先用一次批量读探明查找目标是否存在,宿主未注册的对象不再按名读。sys_business_unit)。修在框架里,托管方只需升级框架版本,cloud 侧不用改。packages/cloud-connection/src/runtime-config-plugin.ts(hasDeploymentNoticeDoor与 features 块)、ui/packages/app-shell/src/console/appObjectScope.ts(servedLookupTargets)、packages/services/service-settings/src/settings-service-plugin.ts(登记部署提示服务那一行)。pnpm --filter @objectstack/cloud-connection exec vitest run src/runtime-config-deployment-notice.test.ts,预期 3 个用例全绿(挂载自家设置路由的宿主报 false,且提示路由答 503)。What changes
#34186 — the deployment notice is asked only of a host that composes it.
SettingsServicePluginregisters the notice's door as the kernel servicesettings.deployment-notice(DEPLOYMENT_NOTICE_SERVICE) right where it mounts the settings routes with that door. A host that mounts the settings family itself (registerRoutes: false, the hosted shape) registers nothing, and its notice route answers503.RuntimeConfigPluginservesfeatures.deploymentNotice, read per request from that registration (hasDeploymentNoticeDoor). The key is written after...features, so a host'sresolveFeaturespolicy can neither claim nor withhold it: it is an observation of the composition, likeinstallLocalandmarketplace, never a host option.RuntimeConfigPlugin(Serve.RUNTIME_CONFIG_OPTIONS), so it serves the key with no change of its own. It is the only producer in this repository.RuntimeFeaturesgainsdeploymentNotice, parsed as!== false, so an ABSENT key (a runtime older than this change) reads as true and only an explicitfalsestops the read.isDeploymentNoticeServed()joins the other predicates, andDeploymentNoticeasks the notice only when it is true, after itsisAdmingate.packages/spec/**is untouched: the runtime-configfeaturesshape is not declared in a spec schema (searchedpackages/spec/src, zero hits).#34187 — install-local on the catalog. The catalog's side load reads
listLocalInstalls()only whengetRuntimeConfig().features.installLocalis true, the gateMarketplacePackagePagealready reads. The other two reads in thatPromise.allare unchanged, and the list draws as before.#34188 — a lookup target the host does not register is never asked by name.
servedLookupTargetsinappObjectScope.ts, used byreadPageObjectScopeandreadObjectRouteNames. In the names-only arm (an app with no package), the lookup targets the route has not already asked are first asked in ONEGET /api/v1/meta/object?names=…read: the existingbatch: truehand-off (console(home): fold the roster gate's by-name object reads into one ?names= request (#29236 ruling A follow-up) #29444), which leaves an absent object out. Only the targets that answer holds are then read by name. No second read of the whole object list is added.MetadataProvideris not touched.Tests
New pins (each red under its ablation; see Verification):
packages/cloud-connection/src/runtime-config-deployment-notice.test.ts(new). It boots the REALSettingsServicePluginandRuntimeConfigPluginon one kernel-shaped context:503to an administrator and the flag is false;resolveFeaturescan neither claim nor withhold the key.ui/.../deployment-notice/__tests__/DeploymentNotice.test.tsx, new describe "asked only of a host that serves it":ui/.../marketplace/__tests__/MarketplacePage.installLocalGate-34187.test.tsx(new). Fetch is stubbed by path,marketplaceApiis not mocked:installLocal: falsethere is no install-local request and the catalog card is drawn;trueit is asked.ui/.../console/__tests__/appObjectScope-12811.test.tsx, new describe for Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188:sys_invitation, and the object's own route, make noobject/sys_business_unitrequest; the only request naming it is the batchobject?names=sys_business_unit,sys_user;sys_userstill resolves (object/sys_userasked, scopesys_invitation,sys_user).Forced test edits. The new presence read reaches every harness whose app has no package and whose objects carry lookups. Each harness's
getItemsmock read the batch request as a whole-list read, so each now answersoptions.namesthe way the metadata door does: loggingobject?names=…and returning only those objects. The five files:ui/packages/app-shell/src/console/__tests__/appObjectScope-12811.test.tsx: mock edit. The existing CONTROL "an app without a package id asks by name" now also expectsobject?names=sys_user.ui/packages/app-shell/src/console/__tests__/AppContent.objectScope-12811.test.tsx: mock edit. "Noobject?read" became "the onlyobject?read isobject?names=sys_user".ui/packages/app-shell/src/console/__tests__/AppContent.packagelessReads-29416.test.tsx: mock edit only, no assertion changed.ui/packages/app-shell/src/console/__tests__/AppContent.packagelessRecordRelated-29552.test.tsx: mock edit. Three read-order expectations gainobject?names=sys_userbeforeobject/sys_user.ui/packages/app-shell/src/views/__tests__/pageObjectReads-12980.test.tsx: mock edit. "Noobject?read" became "the onlyobject?read isobject?names=crm_account".No assertion about a by-name read was dropped.
check:test-source-aliasjudges the test files a change edits. It askedAppContent.objectScope-12811andAppContent.packagelessReads-29416for a module-topimport '@objectstack/lint', becauseAppContentreaches a dynamicimport('@objectstack/lint')throughConsoleLayout→DraftPreviewBar. That reach predates this PR. Both files now carry the import, following the precedent inReportView.drillCallerPackage-32760.test.tsx.Acceptance notes
sys_approval_request. The card says the package arm already batches. Measured, it does not: a target its package list does not hold is still read BY NAME. The existing pin "CONTROL: the same lookups drawn ask every target by name" inappObjectScope-12811.test.tsxasserts exactly that. Per the order, that arm is unchanged. A HotCRM page on a Free environment is a packaged app, so the cloud#4300 staging note (sys_approval_request404) is most likely NOT covered by this PR. Extending the presence read to the package arm is the follow-up; it is in the report'sopen_questions.getItems({ names })is not bundle-answered.requiresObjectthat the host does not register is still read by name (gone_objin the 29416 harness). It is the same class on a different path, and none of the three cards names it.Verification
Symptoms on main were reproduced by the ablation legs: each reverts one fix to main's code and turns its pin red. They were run under
os-verify-lock, with each mutation landed and restored throughscripts/ablation-replace.mjs, andgit diff HEADempty after every leg.Ablations, before/after per card
deploymentNotice: hasDeploymentNoticeDoor(ctx),503) withoutif (!isDeploymentNoticeServed()) return;deploymentNotice: false; 1 pin red (17 green)listLocalInstalls()GET /api/v1/marketplace/install-localwithinstallLocal: false; 1 pin red, CONTROL greenservedLookupTargetsreturns every targetobject/sys_business_unitasked on the page and on the object route; 3 red (2 new pins + the amended CONTROL), 9 greenobject?names=sys_business_unit,sys_userTest runs (os-verify-lock VERDICT lines)
Test Files 195 passed (195) · Tests 1653 passed (1653), VERDICT command-exit 0.@objectstack/cloud-connection: full suite 83 files; the new pin then 3/3 after the admin-context fix, VERDICT command-exit 0.@objectstack/service-settings: full suiteTest Files 75 passed (75) · Tests 1477 passed (1477).tsc --noEmit(and the cloud-connection test tsconfig) exit 0.@object-ui/app-shelltype-checkwas not clean locally, because the@object-ui/*dists are not built in this container (TS2307 throughout). No diagnostic falls on a changed line; CI's type-check lane is the verdict.Gates (dispatch-gates, final head f1521e9)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 78 commands. Each was run onf1521e97and recorded asCMD :: exit N. Reconciliation:✓ dispatch-gates --ran: 78 derived famil(ies) accounted for — 78 run, 0 NOT-MEASURED, all 78 exit 0.The first round, on the earlier head, had three non-zero exits:
pnpm check:test-source-aliasexit 1: fixed inf1521e97(the two harness imports above).node scripts/check-plugin-teardown-shape.mjs --self-testexit 3: shallow clone; the pinned fixture commit was fetched.pnpm check:dual-build-cjs-loadsexit 3: prerequisite.All three exit 0 in the final round. CI's own lanes (artifact roster, type-check, path-scheduled jobs) are read from this PR's check-runs.
Generated by Claude Code