Class ScaffoldReverter
java.lang.Object
network.ike.plugin.scaffold.ScaffoldReverter
Undo a previous scaffold publish.
Revert semantics by tier:
ScaffoldTier.TOOL_OWNED: delete the file if it still matches the applied hash, else warn and skip (unexpected divergence).ScaffoldTier.TRACKED: delete the file if it still matchesappliedSha, else skip (user-edited).ScaffoldTier.TRACKED_BLOCK: not yet implemented — the reverter reports a skip with a message. A proper impl would remove just the managed block and leave the rest of the file.ScaffoldTier.MODEL_MANAGED: not yet implemented — proper impl would remove exactly the managed elements.
This class is deliberately conservative: anything the user might have touched is left alone and reported, not destroyed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPer-entry result of a revert.static final recordAggregate revert result. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct withClock.systemUTC().ScaffoldReverter(Clock clock) Construct with an explicit clock. -
Method Summary
Modifier and TypeMethodDescriptionrevert(ScaffoldLockfile currentLockfile, ScaffoldManifest manifest, ScaffoldScope scope, PathResolver pathResolver) Revert every entry incurrentLockfilethat lives in the given scope.
-
Constructor Details
-
ScaffoldReverter
public ScaffoldReverter()Construct withClock.systemUTC(). -
ScaffoldReverter
Construct with an explicit clock. Tests supply a fixed clock so thegenerated-attimestamp recorded in the updated lockfile after revert is deterministic.- Parameters:
clock- clock for revert timestamps
-
-
Method Details
-
revert
public ScaffoldReverter.RevertResult revert(ScaffoldLockfile currentLockfile, ScaffoldManifest manifest, ScaffoldScope scope, PathResolver pathResolver) Revert every entry incurrentLockfilethat lives in the given scope.- Parameters:
currentLockfile- the current lockfilemanifest- the manifest (used to look up each entry's scope and tier)scope- the scope to revertpathResolver- path resolver- Returns:
- a
ScaffoldReverter.RevertResultwith the new lockfile (with reverted entries removed) and a per-entry report
-