Interface TierHandler
- All Known Implementing Classes:
ToolOwnedTierHandler, TrackedBlockTierHandler, TrackedTierHandler
public interface TierHandler
A tier-specific planner that converts a manifest entry + current
disk state + template bytes + prior lockfile state into a single
TierAction.
One implementation per file-based ScaffoldTier
(ScaffoldTier.TOOL_OWNED, ScaffoldTier.TRACKED,
ScaffoldTier.TRACKED_BLOCK). Model-managed entries have their
own adapter machinery and do not go through TierHandler.
Handlers are pure — they must not touch disk, and they must be safe to call in any order. The caller (scaffold planner) is responsible for locating the file, reading its bytes, and passing them in.
-
Method Summary
Modifier and TypeMethodDescriptionplan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry) Plan a single entry.tier()Which tier this handler is responsible for.
-
Method Details
-
tier
-
plan
TierAction plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry) Plan a single entry.- Parameters:
entry- the manifest entry being plannedresolvedDest- absolute destination path (placeholders already expanded)currentContent- bytes currently on disk atresolvedDest, ornullif no file existstemplateContent- bytes loaded from the scaffold zip atentry.source(); nevernullfor file-based tierscreateContent- bytes loaded from the scaffold zip at the entry'screate-sourceextra, ornullwhen the entry declares none. Only consulted whencurrentContentisnull— tiers that support create-case seeding (currentlyScaffoldTier.TRACKED_BLOCK) seed this content into the newly created file ahead of their managed region; other tiers ignore itpriorEntry- lockfile entry from the last publish, ornullif this entry has never been applied- Returns:
- a
TierActiondescribing what publish should do - Throws:
ScaffoldException- if the handler cannot decide (e.g. malformed block markers)
-