refactor: tidy three post-extraction seams - #1551
Merged
Merged
Conversation
…ectly
vars.ts re-exported the constant for a single consumer, recorded-input.ts.
Point that consumer at @agent-device/ad-script and drop the shim, which also
makes script.ts's doc comment ("recorded-input.ts imports it from this
package") true.
…s directly The annotation shape types (TargetAncestryEntry, TargetAnnotationV1, TargetScrollRegion, TargetVerification) live in @agent-device/contracts/replay; the codec package re-exported them, and 21 files reached the shape through that detour. Point every consumer — root src, root tests, and the package's own tests — at contracts, then drop the re-export from the serde module and the façade. Type-only, so nothing changes at runtime. The package.json exports map is unchanged, so the R11 boundary assertion in scripts/layering/package-boundaries.test.ts still holds as written.
`kind === 'authoring' && status === 'armed'` was spelled out at three handler sites that all ask the same question. Give it a name next to isSessionScriptPublished, mirroring how isRepairArmedSession is housed in the repair projection, and route the three sites through it. abortAuthoring's own guard keeps its inline check: that one is the transition's legality test, not a session-level read.
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Member
Author
|
Reviewed exact head |
|
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.
Three small mechanical cleanups from a 2026-08-01 audit of the #1478 extraction seams. Behavior-preserving throughout: two are pure import re-pointing, the third names an existing predicate.
1.
REPLAY_VAR_KEY_REshim (5f1be5c0e)src/replay/vars.tsre-exported the constant from@agent-device/ad-scriptfor exactly one consumer,src/replay/recorded-input.ts. That consumer now imports from the package directly and the re-export line is gone (vars.tskeeps its own import; it uses the constant internally). This also makespackages/ad-script/src/internal/script.ts's doc comment true — it already claimedrecorded-input.tsimports from the package.2. Target-annotation shape imports (
4e3e75c4b)The annotation shape types live in
@agent-device/contracts/replay;target-annotation-serde.tsre-exported them and the façade re-exported that, so 21 files reached the shape through the detour. Every consumer now imports from contracts directly — the 10 type-only production files from the audit, the two mixed value+type files (type half split out), root tests, and the package's own tests — and both re-exports are dropped.Type-only, so nothing changes at runtime. The package.json
exportsmap is untouched, so the R11 assertion inscripts/layering/package-boundaries.test.ts(which pins the subpath list, not the named-export list) still holds as written;pnpm check:layeringconfirms.3.
isAuthoringArmedSession(42b3cefd3)kind === 'authoring' && status === 'armed'was spelled out at three handler sites asking the same question (session-close.ts,session-open.ts,session-script-publication.ts). It now has a name insession-script-publication-capability.tsnext toisSessionScriptPublished, mirroring howisRepairArmedSessionis housed in the repair projection, and the three sites route through it.abortAuthoring's own guard keeps its inline check — that one is the transition's legality test, not a session-level read. The helper is read-only, soscripts/layering/session-state.ts's writer-ownership registry is unaffected (R7 still reports 22 writer-owned fields / 28 owner claims).Verification
All green — 215 files / 1883 tests passed; layering guard OK.