Skip to content

fix(console): ask the deployment notice, install-local and lookup targets only where the host serves them - #34240

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-5try4s
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-5try4s

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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;无包应用的页面先用一次批量读探明查找目标是否存在,宿主未注册的对象不再按名读。
  • 为什么改:cloud#4300 实测托管控制台每次加载都在网络日志里留下 503/404(部署提示、install-local、sys_business_unit)。修在框架里,托管方只需升级框架版本,cloud 侧不用改。
  • 风险与回滚:运行时配置多了一个键(只增不减);老服务端不带该键时控制台照旧读取部署提示。无包应用页面的查找目标多一次批量读(每组名字每会话一次)。回滚即整 PR revert,无数据迁移。
  • 先看: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.

  • SettingsServicePlugin registers the notice's door as the kernel service settings.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 answers 503.
  • RuntimeConfigPlugin serves features.deploymentNotice, read per request from that registration (hasDeploymentNoticeDoor). The key is written after ...features, so a host's resolveFeatures policy can neither claim nor withhold it: it is an observation of the composition, like installLocal and marketplace, never a host option.
  • The CLI's serve path boots the same RuntimeConfigPlugin (Serve.RUNTIME_CONFIG_OPTIONS), so it serves the key with no change of its own. It is the only producer in this repository.
  • Console: RuntimeFeatures gains deploymentNotice, parsed as !== false, so an ABSENT key (a runtime older than this change) reads as true and only an explicit false stops the read. isDeploymentNoticeServed() joins the other predicates, and DeploymentNotice asks the notice only when it is true, after its isAdmin gate.
  • packages/spec/** is untouched: the runtime-config features shape is not declared in a spec schema (searched packages/spec/src, zero hits).

#34187 — install-local on the catalog. The catalog's side load reads listLocalInstalls() only when getRuntimeConfig().features.installLocal is true, the gate MarketplacePackagePage already reads. The other two reads in that Promise.all are unchanged, and the list draws as before.

#34188 — a lookup target the host does not register is never asked by name.

  • New servedLookupTargets in appObjectScope.ts, used by readPageObjectScope and readObjectRouteNames. In the names-only arm (an app with no package), the lookup targets the route has not already asked are first asked in ONE GET /api/v1/meta/object?names=… read: the existing batch: true hand-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.
  • A target the route already asks (one of its own bound objects) skips the presence read. The package arm is left as it is, as ordered.
  • MetadataProvider is 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 REAL SettingsServicePlugin and RuntimeConfigPlugin on one kernel-shaped context:
    • with the plugin's door the flag is true;
    • for a host that mounts the settings routes without a door, the notice route answers 503 to an administrator and the flag is false;
    • resolveFeatures can neither claim nor withhold the key.
  • ui/.../deployment-notice/__tests__/DeploymentNotice.test.tsx, new describe "asked only of a host that serves it":
    • true means the notice is asked once and drawn;
    • false means 0 notice requests and nothing drawn;
    • CONTROL: an absent key still asks it.
  • ui/.../marketplace/__tests__/MarketplacePage.installLocalGate-34187.test.tsx (new). Fetch is stubbed by path, marketplaceApi is not mocked:
    • with installLocal: false there is no install-local request and the catalog card is drawn;
    • CONTROL: with true it 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:
    • a page bound to sys_invitation, and the object's own route, make no object/sys_business_unit request; the only request naming it is the batch object?names=sys_business_unit,sys_user;
    • CONTROL: the registered target sys_user still resolves (object/sys_user asked, scope sys_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 getItems mock read the batch request as a whole-list read, so each now answers options.names the way the metadata door does: logging object?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 expects object?names=sys_user.
  • ui/packages/app-shell/src/console/__tests__/AppContent.objectScope-12811.test.tsx: mock edit. "No object? read" became "the only object? read is object?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 gain object?names=sys_user before object/sys_user.
  • ui/packages/app-shell/src/views/__tests__/pageObjectReads-12980.test.tsx: mock edit. "No object? read" became "the only object? read is object?names=crm_account".

No assertion about a by-name read was dropped.

check:test-source-alias judges the test files a change edits. It asked AppContent.objectScope-12811 and AppContent.packagelessReads-29416 for a module-top import '@objectstack/lint', because AppContent reaches a dynamic import('@objectstack/lint') through ConsoleLayout → DraftPreviewBar. That reach predates this PR. Both files now carry the import, following the precedent in ReportView.drillCallerPackage-32760.test.tsx.

Acceptance notes

  • The package arm, and HotCRM's 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" in appObjectScope-12811.test.tsx asserts 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_request 404) 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's open_questions.
  • Cost of the presence read. A served lookup target outside the route's own objects now costs a batch read, then its by-name read. That is one more sequential request, once per name set per session; the batch scope's entry is shared. In an app whose bundle holds the target, the by-name read is still answered from the bundle, but the batch read goes to the network, because getItems({ names }) is not bundle-answered.
  • Out of scope: an object an app's page names in requiresObject that the host does not register is still read by name (gone_obj in 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 through scripts/ablation-replace.mjs, and git diff HEAD empty after every leg.

Ablations, before/after per card
Card Ablation (main's code) Before (main) After (this head)
#34186 server drop deploymentNotice: hasDeploymentNoticeDoor(ctx), key absent; 3/3 pins red true with the door, false (and route 503) without
#34186 console drop if (!isDeploymentNoticeServed()) return; 1 notice request with deploymentNotice: false; 1 pin red (17 green) 0 requests
#34187 side load back to listLocalInstalls() 1 GET /api/v1/marketplace/install-local with installLocal: false; 1 pin red, CONTROL green 0 requests
#34188 servedLookupTargets returns every target object/sys_business_unit asked on the page and on the object route; 3 red (2 new pins + the amended CONTROL), 9 green 0 by-name requests; 1 batch object?names=sys_business_unit,sys_user
Test runs (os-verify-lock VERDICT lines)
  • ui consumers of the touched modules, 195 files: 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 suite Test Files 75 passed (75) · Tests 1477 passed (1477).
  • Typecheck, both server packages: tsc --noEmit (and the cloud-connection test tsconfig) exit 0.
  • @object-ui/app-shell type-check was 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/objectstack derived 78 commands. Each was run on f1521e97 and recorded as CMD :: 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-alias exit 1: fixed in f1521e97 (the two harness imports above).
  • node scripts/check-plugin-teardown-shape.mjs --self-test exit 3: shallow clone; the pinned fixture commit was fetched.
  • pnpm check:dual-build-cjs-loads exit 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

…gets only where the host serves them

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>
@github-actions github-actions Bot added size/l 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 Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cloud-connection, @objectstack/service-settings, touching 4 documentable anchor(s).

3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/environment-variables.mdx (via /api/v1/runtime/config (route, a path literal in a comment on a changed line))
  • content/docs/deployment/self-hosting.mdx (via /api/settings/deployment/notice (route, a path literal in a comment on a changed line))
  • content/docs/frontend/plugins/plugin-map.mdx (via /api/v1/runtime/config (route, a path literal in a comment on a changed line))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-2.mdx (via /api/v1/runtime/config (route, a path literal in a comment on a changed line))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 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 — 16 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 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 6a34e84aec0a88ac3ea558f4541e07848680e566 — the merge of head f1521e974a71b3b0cd45fdc05c19d99c85d7adea into base 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3, 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 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

⚠️ 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 7be32d39fa62bd6e0f7c0a0054569b22bfb3dfd3 → 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

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f1521e974a71b3b0cd45fdc05c19d99c85d7adea
Local-runs: none

Face: declaration. Clause-②: yes (widening) is on the changeset and the PR body. There is no published schema in the diff and no governed path (check-governed-merges --pr 34240: NOT governed). Inputs read: cards #34186, #34187 and #34188, triage's first-touch comments, and the claims of 00:22Z; the os-dev-reports 6905347991, 6905359085 and 6905365224; the PR #34240 body; the net diff against main at the merge base (16 files); and the check-runs on this head (2026-11-16T02:35Z: 49 success, 10 skipped, 0 failed).

① Derived judgments

② Semver level

patch on @objectstack/service-settings, @objectstack/cloud-connection and @object-ui/app-shell. Under AGENTS.md's changeset rule a non-protocol widening ships patch. Check Changeset concluded success on this head. Correct.

③ Boundary flags

Implemented-by: claude/project-thread-5try4s
Reviewed-by: session_01ADHkmT2NE3iyG1o6TDg3sf

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

席位核对

Verdict: ACCEPT · head f1521e97 · 2026-11-16T02:36Z

  1. Shape. Draft → main; Fixes #34186, Fixes #34187, Fixes #34188. 16 files, all on the claimed surface. One changeset (patch on service-settings, cloud-connection and app-shell).
  2. Premise. Each symptom was measured first on main by the dev (os-dev-reports 6905347991, 6905359085, 6905365224). Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188's premise about the package arm was corrected by measurement, and the remainder is filed as Console: a packaged app's off-package lookup target, and a page's requiresObject, are still read by name and answer 404 when the host does not register them #34244.
  3. Contract. Declaration face, the seat's TIER_DEFAULT record on this head: PASS. features.deploymentNotice is observed from the composition, never declared; an absent key reads as served.
  4. Pins and ablations. Three ablation legs (the server and console legs of Console: the home page asks the deployment notice on a host that does not compose it, and is answered 503 #34186, Marketplace catalog asks install-local where runtime-config says it is not mounted, and is answered 404 #34187, Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188) all went red, and every CONTROL stayed green. Locally: 78 derived gates exit 0, --ran 0 NOT-MEASURED; 195 ui consumer files / 1,653 tests green.
  5. Gates on f1521e97. 59 check runs: 49 success, 10 skipped, none failed.
  6. K. K = 14; < 15, no sync owed.
  7. Governed. check-governed-merges --pr 34240: NOT governed.
  8. Landing. This stroke: pr_ready + automerge_enable, under the maintainer's landing approval in the seat thread (2026-11-15T16:10Z, 「批准席位 本班复核通过的 PR 执行 --land」). On MERGED the seat closes out Console: the home page asks the deployment notice on a host that does not compose it, and is answered 503 #34186–Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188, and cloud#4300 can bump its pin and re-measure.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 02:36
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 43dd565 Nov 16, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-5try4s branch November 16, 2026 03:35
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 size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants