Skip to content

fix(sync): stop editor-theme scaffold-once outputs from flapping as stale files #563

Description

@JustAGhosT

Problem

Local retort:sync can alternate editor-theme scaffold-once outputs between regenerated and deleted-as-stale on consecutive runs. The observed files include .cursor/settings.json and .windsurf/settings.json.

This is related to, but distinct from, #246. #246 covers path normalization for scaffold-once checks; this issue covers manifest/stale-clean behavior when scaffold-once outputs are skipped and therefore never registered in the new manifest.

Root cause sketch

  • When all editor-theme outputs already exist, sync skips writing them to the temp output tree.
  • Per-output scaffold-once skips can also continue without copying existing content into the temp tree.
  • Manifest carry-forward only sees files that pass through the temp tree or skipped-file list.
  • cleanStaleFiles can delete previously managed editor-theme files because they are absent from the new manifest.

Acceptance criteria

  • Running sync twice does not delete existing editor-theme scaffold-once outputs.
  • Existing project-root files are carried into the manifest when scaffold-once skips generation.
  • Regression test covers clean sync, second sync with previous manifest, and stale-file list behavior.
  • Behavior remains safe for genuinely stale managed outputs.

Source

Created during Baton/GitHub consolidation on 2026-07-07 from Baton task 376cacd9-c92d-4aa3-8b44-7ce041e201cb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingqualityCode quality and static analysis

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions