repomatic.init.removed_assets module¶

Find the orphans of assets repomatic no longer ships.

REMOVED_ASSETS lists one tombstone per dropped asset. repomatic init walks them against the target tree, and sorts each orphan it finds into the ones safe to prune and the ones a person must review.

class repomatic.init.removed_assets.OrphanVerdict(*values)[source]¶

Bases: Enum

What init does with a file found at a tombstoned path.

PRUNE = 'prune'¶

An untouched copy of a shipped asset: safe to delete.

REVIEW = 'review'¶

A shipped asset edited since: reported, never deleted.

SKIP = 'skip'¶

Not an asset repomatic shipped, only a file sharing its path.

repomatic.init.removed_assets.detect_removed_assets(output_dir, config)[source]¶

Find on-disk orphans of assets repomatic has dropped.

Walks REMOVED_ASSETS, resolves each tombstone’s target through the same path overrides as live files, and classifies any that still exist on disk:

  • prunable: an untouched copy, safe to delete. For a content-gated asset the content matches one of the recorded shipped digests; for a workflow the file is a repomatic-lineage thin-caller for the removed workflow with no extra downstream jobs.

  • review: present but customized locally (content differs, or a thin-caller carries extra jobs). Reported, never deleted.

A file that is not recognizable as a repomatic-shipped orphan (a user’s own workflow that merely shares a name) is left untouched.

A tombstoned file that is already gone is not the end of it: an asset that shipped as a folder leaves that folder standing, and an empty one is prunable on its own. See _empty_owned_dir.

Parameters:
  • output_dir (Path) – Root directory of the target repository.

  • config (Config | None) – Repomatic config for skills.location / subagents.location path overrides.

Return type:

tuple[list[tuple[str, str]], list[tuple[str, str]]]

Returns:

(prunable, review), each a list of (relative_path, successor) tuples sorted by path.