Repository navigation
chore: upgrade @objectstack 9.4β9.5.1; fix all-aggregator + body-only hook crashes - #43
Merged
Merged
Conversation
β¦ 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Upgraded to the latest platform (
@objectstack9.5.1) and runtime-tested theallenvironment in a browser β which surfaced two real bugs thatobjectstack build+tscnever caught (build doesn't execute hooks; the stricter 9.5.1 runtime exposed both).Fixes
1.
allaggregator served stale artifacts β failed to boot on 9.5.1.compile-marketplace.mjs's install step skipped any cache entry that already existed, so afterpnpm -r buildit kept old per-template artifacts β including dashboard widgets in the pre-ADR-0021object/aggregateshape 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 β
ReferenceErroron 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 requiredprojectlookup.pm_risk(SCALE) andhelpdesk_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 allon 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:Also spot-checked live fields across templates: helpdesk
ticket_number/SLA/ai_*, procurementmatch_status, complianceis_remediation_overdue, contracts currency/approver, expensereimbursable, hrexpiry_status, content SEO fields.Repo
typecheck+build(9/9) +format:checkclean.π€ Generated with Claude Code