Skip to content

fix(objectql): a package registered again lists its navigation contributions once, not once more per registration - #30656

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

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
domain:server#2 · os-bill · session_01Utp6Cbvcmv8YWFhFJwzjKL

维护者速读

Fixes #30581

Clause-②: no — the served app navigation returns to what a fresh boot serves; nothing a caller sends is refused
Metadata-protocol: none

What changes

The card's mechanism, measured and corrected. On the real kernel (MetadataPlugin + ObjectQLPlugin + AppPlugin, PATCH /packages/:id/disable|enable through HttpDispatcher, origin/main 6701c08; the 18.3.0 enable door is the same code), an app plus two modules (orders into g_sales, service into g_service):

step served GET /meta/app navigation registered contributions
boot g_sales[accounts,orders] g_service[cases] 2
disable/enable orders, twice unchanged after each enable 2
one metadata:reloaded with the artifact g_sales[accounts,orders,orders] g_service[cases,cases] 4
the suite registered again through the manifest door three copies of each 6

So disable and enable do not re-fold anything. What doubles every module's entries is a re-registration of the package bodies: ObjectQLPlugin.refreshReloadedPackages re-registers every package of the artifact on metadata:reloaded (fired by the os dev artifact watcher and the HMR reload POST), and the manifest step of ObjectQL.registerApp called registerAppNavContribution, which only appends. A restart starts from one copy again. HotCRM's measurement most likely saw a reload land between the disable and the enable.

The fix: derive, don't append.

  • SchemaRegistry.setPackageNavContributions(packageId, contributions) (new) makes the given list the package's whole set of contributions, in every app. It replaces in place: an app's list keeps the package's entries where the first registration put them, so ties in the fold (equal priority, the common case at the default 200) resolve in fresh-boot order. An app the package newly targets gets them at the end; an app it no longer names loses them.
  • ObjectQL.registerApp calls it for every body with an id, with an empty list when the body declares none, so a body that dropped its contributions clears them. A body with no id keeps the old additive call.
  • uninstallPackage clears the package's contributions. Before, an uninstalled package's entries stayed in the app: with no package row left, the fold's disabled check could not withhold them.
  • registerAppNavContribution is unchanged (additive, one contribution at a time).
  • The registry test double (registry-module-mock.ts) answers the new member.

The fold itself (applyNavContributions) is untouched, and so are enablePackage / disablePackage and the onPackageEnabled announcement (#30377): no dedupe by label or path after the fact.

Tests

New top-level describes in the existing harness files.

packages/objectql/src/registry-nav-contributions.test.ts, through ObjectQL.registerApp (app + two contributing modules + one module with none, equal priorities), each compared with a fresh registration's snapshot taken in the same test:

  • every body registered twice more (two reloads): fresh order, 4 contributions;
  • one module registered twice more: its entries stay in place;
  • two disable/enable cycles of a module, each with a reload: disabled hides only that module's entries, enabled again equals fresh; the onPackageEnabled listener hears the module exactly once per enable;
  • a module with no contributions disabled, re-registered and enabled: navigation unchanged;
  • a re-registered body that changed its contributions: the dropped entry leaves, the new one appears once; a body with none clears them;
  • uninstalling a module (not disabling it) drops its contributions.

packages/runtime/src/domains/packages-disable-app-module.test.ts, through the real doors: two cycles of PATCH …/disable, metadata:reloaded with the artifact, PATCH …/enable, then the suite registered again through the manifest service; the served GET /meta/app/qs_app group equals the fresh boot's after each step.

Ablations (one per negative pin, objectql rebuilt each leg, marker proved in dist/)

Each through scripts/ablation-replace.mjs, node scripts/ablation-dist-preflight.mjs objectql ABLATION_30581 green before the run, restored to the HEAD blob afterwards.

  1. engine.ts: the body path back to the additive call. objectql: 4 failed (two reloads, one module re-registered, disable/enable with reload, changed body); runtime: the package enable: after a module package is disabled and enabled again, every module's navigationContributions entries appear twice in the console sidebar until the server restarts #30581 case failed, enabled again #1: expected [ 'nav_accounts', 'nav_orders', …(1) ] to deeply equal [ 'nav_accounts', 'nav_orders' ].
  2. registry.ts: replace at the end instead of in place. objectql: 2 failed (one module re-registered, changed body); runtime stays green (one contributor there).
  3. registry.ts: the uninstall clear removed. objectql: 1 failed (uninstall).

Restore leg: objectql rebuilt, ablation-dist-preflight.mjs objectql ABLATION_30581 --absent green, working tree clean against HEAD.

Verification

All on the final head 0be4e9a0b (branch merged with origin/main 14c67d4), dogfood closure rebuilt first.

  • pnpm --filter @objectstack/objectql test: Test Files 555 passed (555), Tests 11057 passed (11057); typecheck exit 0.
  • pnpm --filter @objectstack/runtime test: Test Files 544 passed (544), Tests 8702 passed, 19 skipped (8721); typecheck exit 0.
  • Full dogfood under the verify lock (pnpm --filter @objectstack/dogfood test): VERDICT command-exit 0, Test Files 420 passed, 3 skipped (423), Tests 3504 passed, 36 skipped (3540).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 63 families, each run with its exit code recorded before any pipe, all 63 exit 0; --ran reconciliation: 63 derived, 63 run, 0 NOT-MEASURED, 0 UNRUN.
  • eslint --no-inline-config on the five changed source and test files: exit 0 (the repo-wide pnpm lint is left to CI's Lint & Repo Gates). check-nul-bytes: exit 0.

Acceptance notes

…n contributions instead of appending them

An artifact reload re-registers every package of the artifact through
registerApp, whose manifest step pushed each navigationContributions entry
once more per registration, so every module's entries were listed twice in
the app until a restart. The step now replaces the package's whole set in
place (fresh-boot order kept), and an uninstall drops it.

Claude-Session: https://claude.ai/code/session_01Utp6CZUUc37kySmxP9uGue
Co-authored-by: Claude <noreply@anthropic.com>
… for the nav contribution replace

Claude-Session: https://claude.ai/code/session_01Utp6CZUUc37kySmxP9uGue
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql, touching 6 documentable anchor(s).

18 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 b8929f486de2aaa535dbb9db6f510e944f77be15.

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

What this run could not see
  • the SDK route bridge reached 63 of 221 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 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 — 21 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 b8929f486de2aaa535dbb9db6f510e944f77be15 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 82a2684f1590da420c39d34fc667b32c21bb3a02 — the merge of head 0be4e9a0b7f79b7fbedf84b70bc8cf22a01755a3 into base b8929f486de2aaa535dbb9db6f510e944f77be15, 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 82a2684f1590da420c39d34fc667b32c21bb3a02 && git checkout 82a2684f1590da420c39d34fc667b32c21bb3a02
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b8929f486de2aaa535dbb9db6f510e944f77be15 0be4e9a0b7f79b7fbedf84b70bc8cf22a01755a3 && git checkout -B drift-repro b8929f486de2aaa535dbb9db6f510e944f77be15 && git merge --no-ff 0be4e9a0b7f79b7fbedf84b70bc8cf22a01755a3

node scripts/docs-audit/affected-docs.mjs --json b8929f486de2aaa535dbb9db6f510e944f77be15

⚠️ 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 b8929f486de2aaa535dbb9db6f510e944f77be15 → 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:server#2 · os-bill · session_01Utp6Cbvcmv8YWFhFJwzjKL

维护者速读

席位核对 — ACCEPT · domain:server#2 · head 0be4e9a0b7f79b7fbedf84b70bc8cf22a01755a3

  • 形态: draft, author objectstack-fleet[bot] (relay pr_create), no assignee, no review request; 6 files, +260 −3; check-governed-merges --pr 30656: NOT governed, 263 lines ≤ 3000. Title has no !. Fixes #30581.
  • Review face: TIER_DEFAULT (Clause-②: no: the served navigation returns to what a fresh boot serves), written here by the seat.
  • Seat rulings held: ruling 2 "derive, don't append", reached by the measured route: a body's contributions replace its package's set (keyed by package id), in place; ⛔ no after-the-fact dedupe by label. The seat accepted the route change (18:51Z) and asked for the uninstall clear; fix(objectql): recompute a disabled package's extension roll-ups when it is enabled again #30587's enablePackage / wasDisabled / announcePackageEnabled untouched.
  • Seat read: setPackageNavContributions splices the new set at the package's first index (every earlier entry belongs to another package, so the index holds after the filter), drops apps the body no longer names, appends apps it newly names; an id-less body keeps the additive path. uninstallPackage clears with []. registry-module-mock.ts gains the member (engine.test's double needed it).
  • Deviations (declared): card mechanism measured false (accepted); uninstall clear and the mock added to the surface (accepted); the body's signature line carries the seat session as the order spelled it (accepted, no edit); MCP assign step skipped per the order.
  • Dev readings (0be4e9a0b, merged main 14c67d446): objectql 11057 and runtime 8702 green, typecheck 0; derived gates 63/63 exit 0, 0 NOT MEASURED; full dogfood under the verify lock 3504 passed; ablations 3, each red, restored. os-dev-report 6669593639.
  • Noted, not filed: registerAppNavContribution stays additive with no production caller; no card until a caller exists.
  • 门禁 check-runs: in progress at ACCEPT; the seat queues once every check is green or an expected skip.
  • 落地条款: Fixes #30581. Ordinary queue landing by this seat: pr_ready + automerge_enable on this head.

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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant