You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 78c85e1
Browse filesBrowse the repository at this point in the historyBrowse files
fix: four defects a widened review found in unreviewed work
A code review of the @sortableDefaultOrder thread found six defects, two of them
gates left red. That hit rate argued for widening to the commits nobody had
looked at, scoped by blast radius rather than by date: the three marked breaking
plus two codegen-correctness ones. It found a REGRESSION, not just latent debt.
1. outputLayout "package" — the fix was HALF-APPLIED and shipped a regression.
The built-in barrel moved to effectivePackage(); the four reference/owned
copies — the ones `meta init` actually scaffolds — kept the bare `.package`
read and merely gained an unused import. Their emitted index.ts exported
"./Widget" for a file at acme/commerce/Widget.ts: TS2307 on a project with
nothing wrong with it. It is a regression rather than a leftover, because
before the change the entity files landed flat too and the barrel agreed with
them.
The gate could not see it. It asserts on EMITTED PATHS, and a barrel's path is
correct whatever it exports — a wrong import SPECIFIER is structurally out of
its reach, so the earlier claim that "a new generator reaching for .package
again fails without anyone maintaining a list" was not true of the barrel. It
now also runs the barrel and requires every export specifier to name a file
the same run actually wrote; proven by reverting, which names "Widget".
The comment that caused the defect was still in place stating the opposite of
the code — it told the reader to pass obj.package "for consistency with the
emitter", which is how the bare read propagated. Rewritten to say why
consistency with a wrong emitter is not a reason. Three leftover unused
effectivePackage imports removed; nothing flagged them, as the workspace sets
no noUnusedLocals.
2. attr("isArray") guarded ONE door of four. attr()/hasAttr() threw; ownAttr(),
ownHasAttr() and ownMetaAttr() asked the identical forbidden question and
answered it just as silently, and ownAttr is a documented public accessor an
owned generator can reach for. One rule with four doors, three still open, is
this repo's most-repeated defect shape. All four now guarded, `value` still
exempt (an attr node reads its own payload through ownAttr(RESERVED_KEY_VALUE),
so the exemption must be settled before the guard). The derived test covers
all four, and its header now says what the derivation does NOT reach:
STRUCTURAL_KEYWORD_ACCESSORS is hand-written, so a keyword added to
RESERVED_KEYS and not to that map gets no runtime guard — the loop goes red
and says so, which is the forcing function.
Five parser tests used ownHasAttr as the negative probe for "this reserved key
is not stored as an attr". They now read ownAttrs(), which is literally the
attr map each assertion's own description names.
3. The useEntityFetcher -> useEntityPathFetcher rename left four shipped surfaces
on the old name, including the metaobjects-runtime-ui agent-context skill
`meta init` installs into every project. It described the hook as "reads the
fetcher from context (generated hooks call this)" — both halves false, and the
omitted half is exactly the path rewrite the rename exists to warn about. That
is the third time a shipped skill has taught something the code had already
changed, so the two agent-context-conformance fixtures move with it.
4. Three tier-1 adopter docs still presented `bigserial(...)` in blocks headed as
generated output; `meta gen` has emitted bigint(...) +
.generatedByDefaultAsIdentity() since the identity fix. No gate covers these
blocks — the doc-examples gate loads fenced METADATA only.
Also adds CHANGELOG entries for all five reviewed commits. Three were marked
breaking and none had one: a throw added to a core public API, a public export
rename, and a gate whose verdict logic changed.
Verified: workspace typecheck clean; ci-local --quick green (incl. owned-template
-copies and site-reference freshness); sdk 304, codegen-ts 1575, metadata 2616,
cli 838, tanstack 49, runtime-web 55 — all passing.
Not fixed here, reported for judgment: docs-drift's `checked` count is machine-
dependent (it includes disk-derived orphans) and its own test cannot fail on the
denominator; the Angular fetcher seam has the same path rewrite with neither the
rename nor a warning; and an ignored orphan is dropped from the check but not
from the "git-ignored pages not checked" count.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-runtime-ui/references/tanstack.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ rejects and poisons every later install in the project with `ERESOLVE`.
34
34
| Export | Purpose |
35
35
|---|---|
36
36
|`<EntityFetcherProvider fetcher={fetcher} baseUrl="/api">`| supplies the single `EntityFetcher` every generated hook reads, plus the base URL it prepends. `baseUrl` is optional (default `""` = same origin at the root); generated hooks emit entity-relative paths. |
37
-
|`useEntityFetcher()`| reads the fetcher from context (generated hooks call this) |
37
+
|`useEntityPathFetcher()`| reads the fetcher from context and returns one that PREPENDS the provider's `baseUrl` — generated hooks call this, and the path they pass is entity-relative. |
38
+
|`useEntityFetcher()`| deprecated alias of the above. The name said "read the fetcher"; it also rewrites every path, so passing an application-absolute path yields `<baseUrl>` + that path and a silent 404. |
Copy file name to clipboardExpand all lines: docs/ports/typescript-client.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ a roadmap item: eject the generator and retarget its emit (FR-040).
56
56
|---|---|---|
57
57
|`@metaobjectsdev/runtime-web`| Pure framework-agnostic browser core. Zero React, zero TanStack, zero Node-only deps. |`formatCurrency`, `parseCurrency`, `minorUnitsFor`, `buildFilterQs`, type `EntityFetcher`, type `GridConfig`|
0 commit comments