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 fbcae70
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/owning-generators.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,19 @@ mechanical: if changing a generator — or a file eject copied beside it — fix
41
41
yours.
42
42
43
43
**The converse, so ownership does not become sprawl:** wire a generator only for output
44
-
you will actually consume. Decide per generator, narrow one with its own `filter`, and
44
+
you will actually consume. Decide per generator, narrow one to the objects you consume, and
45
45
own the ones you keep — an emitted file nobody imports still reads as an invitation to
46
46
adopt the surface you decided against.
47
47
48
+
**How you narrow one is each language's own idiom, not one shared flag:**
49
+
50
+
| Port | Narrow a generator to some objects |
51
+
|---|---|
52
+
|**TypeScript**| the generator's `filter: (obj) => boolean`|
53
+
|**C#**|`new EntityGenerator { Include = o => ... }` on the entry in `codegen/Generators.cs` (also on `db-context`, `routes`, `filter-allowlist`, `names`, `callable`); for any other generator, wrap it and hand it a narrowed `GenContext` (`ctx.Narrow(...)`), or eject and edit. `references/csharp.md`, "Scoping a generator to some objects". Never emit everything and delete files by name afterwards |
54
+
|**Python**| the `filter=` argument on the generator factory (a callable of the object), e.g. `trace_helper_generator(filter=...)`|
55
+
|**Java / Kotlin**| the entry's `<args>` in the pom where the generator offers one; otherwise `mvn metaobjects:eject` the generator and edit its object selection |
56
+
48
57
Every port gets a reference generator's source the same way — its `eject` command — and
49
58
writes a new one against the same small interface (the top of the skill). Your language
0 commit comments