Repository navigation
Commit 53cd936
refactor: the simplifier pass, and two things it caught that the review did not
Four cleanup agents over this session's twelve commits. Two of their findings were
correctness, not tidiness, and both were mine:
**The ejectable copy of the names generator still hardcoded `fragment: true`.**
`src/reference/names.ts` is what `meta init` copies into an adopter's repo, and it is
otherwise character-for-character the generator I had just fixed. Its byte-identical gate
could not see the divergence — that gate runs `runGen` unscoped, so pass 1 always emits
the TPH base and pass 2 breaks on `emitted.has(key)` before the flag is read. The bug is
reachable only under `meta gen --entities <Subtype>`, which the gate never exercises.
Fixed at the depth that makes it unreachable rather than by mirroring one line:
`renderNamesDecl` now DERIVES the shape from the object, so `fragment` says only "this is
an ancestor render". Every `fragment: true` already on disk in an adopter's ejected copy
becomes correct with no edit, and no caller can get it wrong again. Mirroring the line
would also have forced a VALUE import from `@metaobjectsdev/metadata` into an ejected
file, which is the dual-physical-copy hazard CLAUDE.md warns about.
**I shipped a false claim while fixing a false claim.** The JSDoc I corrected two commits
ago says "htmlType, placeholder and helpText are NOT emitted". `htmlType` IS emitted —
derived from the view subtype; only the `@htmlType` attribute OVERRIDE was removed. The
golden snapshots updated in that same commit carry `htmlType: "number"` fifteen lines
below the claim. Corrected, and it says which of the two mechanisms went away.
The rest is tidying, each agreed by at least two agents:
- `servedPath(entity, apiPrefix)` in `api-surface.ts` replaces three open-coded copies of
`${apiPrefix}${restPath(obj)}`. Three doors composing one address is the defect class
these commits keep fixing; leaving a third copy behind while fixing the second was not
defensible.
- The new C# `Escape` was a verbatim copy of `Fr010FieldMapping.CSharpStringLiteral`, the
sixth escaper in that assembly. Deleted; the allocation-free fast path moved INTO the
shared helper, so its three existing callers get it too.
- `declaresNamesContent` dropped a dead `typeof obj.ownFields !== "function"` duck-type
check; `namesArtifactSuperOf` narrows with the exported `isMetaObject` guard instead of
`as MetaObject`, which is what CLAUDE.md requires.
- The effective-children `claimed` set became a flag array in TS and Python, mirroring the
C# port: the length is known, this is the memoized path walked for every node, and it
drops a hash lookup per element plus a closure/generator frame per own child.
- A dead `resourcePath` import, a recomputed `memberDepth`, and a `"source"` literal with
a double cast where `isMetaSource` narrows.
Skipped, deliberately: de-duplicating the test harnesses in four files (three agents
flagged it; it is churn across passing tests), and folding `ApiModelContext`'s positional
threading into a resolved struct (a wider refactor than this pass warrants). Both are
recorded here rather than argued with.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UcDcQmAVYzYjkVGVj23mt41 parent 663924c commit 53cd936
41 files changed
Lines changed: 335 additions & 269 deletions
File tree
- examples/showcase
- .metaobjects/.gen-state
- generated/ts
- server
- csharp
- MetaObjects.Codegen/Generators
- MetaObjects/Meta
- python/src/metaobjects
- codegen/generators
- meta
- typescript/packages
- codegen-ts
- src
- generators
- reference
- templates
- test/golden/__snapshots__
- package
- shop
- commerce
- users
- postgres
- sqlite
- metadata
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 105 | + | |
125 | 106 | | |
126 | 107 | | |
127 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
515 | 518 | | |
516 | 519 | | |
517 | 520 | | |
| |||
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
523 | | - | |
| 526 | + | |
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
| |||
531 | 534 | | |
532 | 535 | | |
533 | 536 | | |
534 | | - | |
| 537 | + | |
535 | 538 | | |
536 | 539 | | |
537 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
| |||
254 | 260 | | |
255 | 261 | | |
256 | 262 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
246 | 249 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
255 | 258 | | |
256 | | - | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments