Skip to content

Commit 8b84cef

Browse files
committed
wip: codemod header for the second pass, changeset (#30052)
Claude-Session: https://claude.ai/code/session_01Utp6Cbo4rDxRL3yugqM5c7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2a76758 commit 8b84cef

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
refactor(objectql): `ObjectRepository` and `ScopedContext` in `engine.ts` are facades over their own facet modules, moved by the `engine.ts` codemod's second pass; no behaviour or published declaration changes
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- 20 of the 24 methods of the two classes keep their signatures and public docblocks on the class and forward, in one call, to an unedited copy of their body in `engine-object-repository.ts` or `engine-scoped-context.ts`. Each instance gets one host, built on first use (`engine-scoped-hosts.ts`), so a spy or a subclass override on an instance is still the method a body reaches.
11+
- Four `ScopedContext` methods keep their bodies on the class, each named in the facade gate's registry with the card that will move it: `transaction` and the symbol-keyed `SEED_USER_GRANTS` method hand the instance itself on; `derive` and the symbol-keyed `APP_AUTHORED_HOOK_API` method set a private flag on another instance.
12+
- Nothing to do on upgrade: the exported names, the published `.d.ts` surface and what every method does are the same.

‎scripts/codemod-split-engine.mjs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
* node scripts/codemod-split-engine.mjs --write # apply the split, then verify it
1212
* node scripts/codemod-split-engine.mjs --verify --base <ref>
1313
* # re-prove a split on disk against engine.ts at <ref>
14+
* node scripts/codemod-split-engine.mjs --scoped [--write]
15+
* # the second pass (#30052): plan (or apply) ObjectRepository and ScopedContext
16+
* node scripts/codemod-split-engine.mjs --scoped --verify --base <ref>
17+
* # re-prove the second pass on disk against engine.ts at <ref>
1418
* node scripts/codemod-split-engine.mjs --self-test
1519
* node scripts/codemod-split-engine.mjs --help # this usage, on any tree (split or not)
1620
*
@@ -117,6 +121,21 @@
117121
* two runs on one input write byte-identical trees (the plan prints the output
118122
* tree's sha256). Only the proof's leaf-reach walk reads sibling files.
119123
*
124+
* ## The second pass: `ObjectRepository` and `ScopedContext` (#30052)
125+
*
126+
* `engine.ts` declares two more classes after `ObjectQL`, the repository a
127+
* hook reaches as `ctx.api.object(name)` and the context it reaches as
128+
* `ctx.api`. `--scoped` facades them with this pass's cut pattern, stay rules
129+
* and byte-identity proof, one facet module per class (`SCOPED_CLASSES`) and
130+
* one host per INSTANCE (`SCOPED_HOSTS_MODULE`, #30051's shape keyed by the
131+
* instance), and it touches no other byte: its input is the `engine.ts` the
132+
* first pass left, and it is proved against that file, so it is re-run on the
133+
* latest `main` at landing like the first. Its marker is `SCOPED_MARK`, so the
134+
* two passes' stubs and files are told apart. Two stay reasons are its own:
135+
* a body that reads a private member off another instance (`foreign-private`:
136+
* the class body may, a module function may not) and one that reads a
137+
* non-public static (`private-static`: the statics route is `ObjectQL`'s).
138+
*
120139
* ts-morph is a root devDependency, resolved from the root manifest, as the
121140
* pilot takes it.
122141
*

0 commit comments

Comments
 (0)