Repository navigation
refactor(host-kit): split atomic-file by concern - #4745
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
atomic-file.ts mixed generic atomic publication, the caller-named script destination walk, and POSIX/Windows entry-name rules. Split it into: - atomic-publish.ts: publishFileSync, publishDurableFileSync, temp naming, directory sync. Generic internal callers import only this. - script-destination.ts: prepare/confirm/judge, the walk, exposure rules, level creation, publishScriptFileSync, the Windows creation branch. - script-destination-refusal.ts: exposure vocabulary, wording, hints and typed reasons, shared by the walk and the name rules without a cycle. - entry-name.ts: scriptEntryName and its refusals, Windows name rules, NAME_MAX, requireWindowsScriptVolume, and resolveScriptDestination (moved from path-resolution.ts). hostPathRules moves to path-resolution.ts, which now holds only general user-path helpers and imports nothing from the script modules. Function bodies are unchanged; tests move beside their owners. The public surface of @agent-device/host-kit/file is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stination Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
198d0e4 to
a7f803d
Compare
Apex Sentinel · ✅ Approve · review of
|
| 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.
|
This PR is ready at a7f803d: the split of atomic-file is moves and import repoints, and the import graph has no problems. CI is green, with 19 checks and none failing. Not blocking: The diff changes no test case or body. No conflicts are known, and nothing else needs to happen before merge. |
Summary
atomic-file.ts(950 lines) mixed three concerns. This splits it by concern, move-only, in 19 files:atomic-publish.ts: generic publication.process-lock.tsandowned-process-record.tsimport only this.script-destination.ts: the destination walk, exposure rules, level creation,publishScriptFileSync, Windows creation.script-destination-refusal.ts: exposure wording, hints, typed reasons. The walk and the name rules both use it, so it is its own module to avoid an import cycle.entry-name.ts: entry-name rules andresolveScriptDestination(moved frompath-resolution.ts).hostPathRulesmoves topath-resolution.ts, which now imports none of the script modules. The@agent-device/host-kit/filesurface is unchanged. Tests move beside their owners: 116 cases before and after.A parallel PR deletes
judgeScriptDestination. Whichever lands second rebases; here it moved unchanged intoscript-destination.ts.Validation
At
a7f803d73f(rebased onto83328f1d8a; only the two cross-package comment pointers #4742 moved conflicted):exportkeywords), so checks and their order are unchanged.eager-closure-budgets.test.tsgreen, no budget change.owned-process-record.ts5 files / 96 KB → 4 files / 32 KB,process-lock.ts220 KB → 188 KB.check:layering(staged),check:production-exports,fallow audit --base origin/main: pass.a7f803d73fonly repoints the ADR 0016 path reference toentry-name.ts.🤖 Generated with Claude Code