Skip to content

chore: upgrade @objectstack 9.4β†’9.5.1; fix all-aggregator + body-only hook crashes - #43

Merged
xuyushun441-sys merged 1 commit into
mainfrom
chore/upgrade-objectstack-9.5
Jun 15, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
chore/upgrade-objectstack-9.5

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

Upgraded to the latest platform (@objectstack 9.5.1) and runtime-tested the all environment in a browser β€” which surfaced two real bugs that objectstack build + tsc never caught (build doesn't execute hooks; the stricter 9.5.1 runtime exposed both).

Fixes

1. all aggregator served stale artifacts β†’ failed to boot on 9.5.1.
compile-marketplace.mjs's install step skipped any cache entry that already existed, so after pnpm -r build it kept old per-template artifacts β€” including dashboard widgets in the pre-ADR-0021 object/aggregate shape that the 9.5.1 runtime metadata plugin rejects. The workspace template is the source of truth for its own id, so it now always refreshes its cache entry (real marketplace-UI installs use different ids and are untouched).

2. Body-only hooks referenced module-scope helpers β†’ ReferenceError on insert.
Hooks run body-only in the QuickJS sandbox, so module-scope helpers aren't in scope at runtime. pm_project (deriveHealth) threw on every insert β†’ 0 project rows β†’ child objects then failed their required project lookup. pm_risk (SCALE) and helpdesk_ticket (SLA maps) had the same latent bug (helpdesk escaped only because seed rows pre-fill the guarded fields). Helpers moved inside each handler body.

Runtime verification (browser + DB)

Ran objectstack dev all on 9.5.1, registered/logged into the console β€” all 9 apps load, and seed data inserts for every template. Direct DB check after the fix:

pm_project=3  pm_milestone=5  pm_risk=3  pm_issue=3  pm_resource=10
PRJ-001 active β†’ health=on_track   PRJ-002 at_risk β†’ health=off_track (hook-computed)
RISK-001 pri=16   RISK-002 pri=9   RISK-003 pri=15 (hook-computed)

Also spot-checked live fields across templates: helpdesk ticket_number/SLA/ai_*, procurement match_status, compliance is_remediation_overdue, contracts currency/approver, expense reimbursable, hr expiry_status, content SEO fields.

Repo typecheck + build (9/9) + format:check clean.

πŸ€– Generated with Claude Code

… hook crashes

Upgrades all packages to @objectstack ^9.5.1 and fixes two runtime bugs that
9.5.1's stricter runtime surfaced during browser/runtime testing of the `all`
environment (build + typecheck never caught either):

1. `all` aggregator served STALE artifacts. `compile-marketplace.mjs`'s
   install step skipped any cache entry that already existed, so after
   `pnpm -r build` the composed env kept old per-template artifacts β€” including
   dashboard widgets in the pre-ADR-0021 `object`/`aggregate` shape, which the
   9.5.1 runtime metadata plugin rejects β†’ `all` failed to boot. The workspace
   template is the source of truth for its own id, so we now always refresh its
   cache entry (genuine marketplace-UI installs live under different ids and are
   untouched).

2. Body-only hooks referenced module-scope helpers β†’ ReferenceError on insert.
   Hooks run body-only in the QuickJS sandbox, so module-scope helpers/consts
   are not in scope at runtime. `pm_project` (`deriveHealth`) threw on EVERY
   insert β†’ 0 project rows seeded β†’ child objects then failed their required
   `project` lookup. `pm_risk` (`SCALE`) and `helpdesk_ticket` (SLA-minute maps)
   had the same latent bug (helpdesk only escaped because seed rows pre-fill the
   guarded fields). Helpers are now defined inside each handler body.

Verified at runtime: `objectstack dev all` boots on 9.5.1, all 9 apps load, and
seed data inserts for every template β€” `pm_project` now seeds 3 rows with
hook-computed `health` (on_track/off_track) and `pm_risk` with computed
`priority` (16/9/15). Repo typecheck + build (9/9) + format:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys merged commit 34b3c89 into main Jun 15, 2026
3 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the chore/upgrade-objectstack-9.5 branch June 15, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants