Skip to content

Commit bab92c1

Browse files
illeatmyhatclaude
andcommitted
fix(evolve-lite): roll back subscribe clone when audit append fails
Subscribe now treats audit_append failure as fatal: pop the repos entry, re-save the config, remove the cloned directory, and exit non-zero — matching the existing save_config rollback path. This restores the contract asserted by test_rolls_back_clone_if_audit_write_fails for both the claude and codex subscribe variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d135745 commit bab92c1

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

  • platform-integrations
    • bob/evolve-lite/skills/evolve-lite:subscribe/scripts
    • claude/plugins/evolve-lite/skills/subscribe/scripts
    • codex/plugins/evolve-lite/skills/subscribe/scripts

platform-integrations/bob/evolve-lite/skills/evolve-lite:subscribe/scripts/subscribe.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ def main():
9595
remote=args.remote,
9696
)
9797
except Exception as exc:
98-
print(f"Warning: failed to append audit entry for subscribe: {exc}", file=sys.stderr)
98+
repos.pop()
99+
set_repos(cfg, repos)
100+
try:
101+
save_config(cfg, project_root)
102+
except Exception:
103+
pass
104+
if dest.exists():
105+
shutil.rmtree(dest)
106+
print(f"Error: failed to record subscription — clone removed: {exc}", file=sys.stderr)
107+
sys.exit(1)
99108

100109
print(f"Subscribed to '{args.name}' (scope={args.scope}) from {args.remote}")
101110

platform-integrations/claude/plugins/evolve-lite/skills/subscribe/scripts/subscribe.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@ def main():
127127
remote=args.remote,
128128
)
129129
except Exception as exc:
130-
print(f"Warning: audit log could not be updated: {exc}", file=sys.stderr)
130+
repos.pop()
131+
set_repos(cfg, repos)
132+
try:
133+
save_config(cfg, project_root)
134+
except Exception:
135+
pass
136+
shutil.rmtree(dest, ignore_errors=True)
137+
print(f"Error: failed to record subscription — clone removed: {exc}", file=sys.stderr)
138+
sys.exit(1)
131139

132140
print(f"Subscribed to '{args.name}' (scope={args.scope}) from {args.remote}")
133141

platform-integrations/codex/plugins/evolve-lite/skills/subscribe/scripts/subscribe.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,16 @@ def main():
103103
remote=args.remote,
104104
)
105105
except Exception as exc:
106-
print(f"Warning: failed to append audit entry for subscribe: {exc}", file=sys.stderr)
106+
repos.pop()
107+
set_repos(cfg, repos)
108+
try:
109+
save_config(cfg, project_root)
110+
except Exception:
111+
pass
112+
if dest.exists():
113+
shutil.rmtree(dest)
114+
print(f"Error: failed to record subscription — clone removed: {exc}", file=sys.stderr)
115+
sys.exit(1)
107116

108117
print(f"Subscribed to '{args.name}' (scope={args.scope}) from {args.remote}")
109118

0 commit comments

Comments
 (0)