Skip to content

refactor(move): split script publication into record and publisher modules - #4746

Merged
thymikee merged 2 commits into
fix/script-repeat-from-recordfrom
refactor/remote-script-publication-modules
Nov 19, 2026
Merged

thymikee merged 2 commits into
fix/script-repeat-from-recordfrom
refactor/remote-script-publication-modules

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Move-only refactor, stacked on #4744 (base: fix/script-repeat-from-record). After #4744 merges, retarget this PR to main.

session-script-destination.ts mixed three concerns. Two of them move out by owner, with no behavior change:

  • script-publication-record.ts: the record type, its path, parse, read, write, create, and remove, plus the record lock.
  • script-version-publisher.ts: publishScriptVersion, staging allocation and release, commit, interrupted-commit settlement, and the staged-file check.

session-script-destination.ts keeps the remote open, receipt settlement, and delivery-failure disclosure.

Declarations move unchanged. The only edits are the new import blocks and export on the symbols that now cross files. The wire-compat surface, closure waiver, and ledger follow publishScriptVersion and PublishOutcome to their new file. Their digests change only because of the move and the export keyword, and the acks record that as a move.

How the move was verified: a split from one file into three cannot show as renames with git diff -M90%. I verified it by comparing the moved blocks instead. The old file's lines, sorted with imports and export keywords removed, equal the same lines from the three new files. The only difference is blank lines.

The tests drive the public delivery route, so they stay where they are. 7 files, +640/−606 (incl. the ADR 0016 owner line).

Validation

At d73edd9824 (rebased onto #4744 at 81fbe880c4):

  • The block comparison above.
  • The remote, host-kit, wire-compat, and eager-closure suites passed (1951 tests).
  • Typecheck, lint, check:layering, fallow audit --base origin/main, and check:production-exports are clean.

CI validates the head.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.41 MB 6.41 MB +18 B
Package (unpacked) 6.41 MB 6.41 MB +18 B
Package (download) 1.95 MB 1.95 MB -20 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.8 ms 28.4 ms +3.7 ms
CLI --help 61.2 ms 61.7 ms +0.4 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 97e7c98 to b71515f Compare November 19, 2026 13:29
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at b71515f. The moved code is unchanged. CI (Smoke Tests and Coverage) is still running, so please let it finish green. A wire-compat digest mismatch would show up there.

Not blocking, and you can take or leave both:

  • The diff is 1108 lines, above the 1,000-line threshold, and a split from one file into three can't be shown with git diff -M90%. You could note in the PR body that you verified the move by comparing the moved blocks.
  • The title lists a delivery module, but none is created because session-script-destination.ts keeps that role. You could retitle it to refactor(move): split script publication into record and publisher modules.

Merge order: #4744 first, then retarget this PR to main.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from b71515f to 1dd8cca Compare November 19, 2026 13:39
@apex-sentinel-staging

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from b3d9e32 to 77d7607 Compare November 19, 2026 14:08
@thymikee thymikee changed the title refactor(remote): split script publication into record, publisher and delivery modules refactor(move): split script publication into record and publisher modules Nov 19, 2026
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Re-checked at 77d7607 against #4744 at abfa16f. The three files hold the same code as session-script-destination.ts at abfa16f. Comparing sorted lines, the only differences are names moving between import lists, so the split is still move-only. The retitle and the verification note in the body look good. All 18 checks are green. The label stays. Merge order is unchanged: #4744 first, then retarget this PR to main. If #4744 changes again, this PR needs the same rebase.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 77d7607 to 947c0c6 Compare November 19, 2026 14:41
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from ed7f411 to 37d9099 Compare November 19, 2026 15:18
@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 37d9099 to bb699e0 Compare November 19, 2026 15:34
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at bb699e0: the rebase onto #4744's 586896a is still move-only. A sorted-line comparison shows no line added, dropped or edited, and the moved code includes the new staging-path validation, recovery hints and cleanup handling from 586896a. The wire-compat ledger entries follow the moved declarations, and ADR 0016 line 9 is accurate. No review threads are open.

The diff touches only the client-side script publication modules in packages/remote, one ADR line and the ledger. Lint, layering, wire-compat and the tests for the touched code pass, and the smoke jobs are green.

Before merge: merge #4744 first, then retarget this PR to main. If #4744 changes again, this PR needs the same rebase.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

This PR now conflicts with its base after #4744 moved to a6522d1. Please rebase it onto #4744's current head. I removed ready-for-human while it conflicts; it goes back on once the rebase is confirmed move-only.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch 2 times, most recently from 8c31fee to 8b154c4 Compare November 19, 2026 15:59
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 8b154c4: the rebase onto #4744's ae1127a is still move-only, the conflict is gone, and the moved code matches ae1127a (the staging check is absent here too). Wire-compat, coverage and integration jobs pass. The label is back on.

Not blocking: recordPath could take the endpoint, tenant ID, session and publication ID as its inputs, so script-publication-record.ts owns persistence and keying without reading DaemonWireRequest metadata.

Before merge: merge #4744 first, then retarget this PR to main. #4744 still has four docs and hint fixes to land, so expect one more rebase.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 8b154c4 to c0e6854 Compare November 19, 2026 16:23
@thymikee

Copy link
Copy Markdown
Member Author

This PR is still ready at c0e6854: the rebase onto #4744's 79a97c8 is move-only (the same function bodies, including the new hint placeholder logic), and wire-compat, layering, coverage and integration jobs pass. The label stays.

Not blocking: recordPath could take the endpoint URL, tenant ID, session and publication ID as explicit arguments, so script-publication-record.ts owns the record key without reading DaemonWireRequest fields.

Before merge: merge #4744 first, then retarget this PR to main. #4744 has one more small fix pending, so expect one more rebase.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from c0e6854 to a33de26 Compare November 19, 2026 16:40
@thymikee

Copy link
Copy Markdown
Member Author

This PR is still ready at a33de26: the rebase onto #4744's 1925845 is move-only. All 50 top-level declarations and their comments match 1925845 exactly once exports are unwrapped; only declaration order changes. CI is green, and the label stays.

Before merge: merge #4744 first, then retarget this PR to main. #4744 has one more small fix pending, so expect one more rebase.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from a33de26 to 76b8b43 Compare November 19, 2026 16:58
@thymikee

Copy link
Copy Markdown
Member Author

This PR is still ready at 76b8b43: the rebase onto #4744's da315b7 is move-only. All 52 top-level declarations match da315b7 exactly once export modifiers are stripped (17 destination, 17 record, 18 publisher), the external imports match, and isControlCharacter is exported only for the cross-module use. Wire-compat, layering and coverage pass; one smoke job was still running. The label stays.

Before merge: merge #4744 first, then retarget this PR to main.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 76b8b43 to c141bea Compare November 19, 2026 17:19
@thymikee

Copy link
Copy Markdown
Member Author

This PR is still ready at c141bea: the rebase onto #4744's 52bde73 is move-only. All 50 top-level declarations match 52bde73 verbatim once imports and export modifiers are excluded, and the runtime changes stay in the three remote modules. CI is green, and the label stays.

Before merge: merge #4744 first, then retarget this PR to main.

@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from c141bea to 21dd597 Compare November 19, 2026 17:37
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is still ready at 21dd597: the rebase onto #4744's b673232 is move-only. All 50 declarations, including bodies and comments, match b673232 once export modifiers are removed, and production changes stay in the three remote modules. All checks are green, and the label stays.

Before merge: merge #4744 first, then retarget this PR to main.

thymikee and others added 2 commits November 19, 2026 19:06
…dules

Move-only. session-script-destination.ts mixed three concerns, so two
move out by owner:

- script-publication-record.ts: the record type, its path, parse,
  read, write, create, remove and the record lock;
- script-version-publisher.ts: publishScriptVersion, staging,
  commit and interrupted-commit settlement.

session-script-destination.ts keeps the remote open, receipt settlement
and the delivery-failure disclosure. Declarations move unchanged; the
wire-compat ledger follows the two moved declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the refactor/remote-script-publication-modules branch from 21dd597 to d73edd9 Compare November 19, 2026 18:07
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of d73edd9

Since the review of 21dd597: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (0ba31d87a14d).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee
thymikee merged commit a620da0 into main Nov 19, 2026
20 of 21 checks passed
@thymikee
thymikee deleted the refactor/remote-script-publication-modules branch November 19, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant