From 29618f431959ad614c966314a9e5879af649a1fc Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Sun, 2 Aug 2026 23:38:29 +1200 Subject: [PATCH] idle-draft: stop committing state file with machine commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit idle-draft.state.json is now gitignored in the target repo; explicitly git add-ing an ignored path errors, which broke every success commit. The state file is still written atomically — just no longer tracked. Claude-Session: https://claude.ai/code/session_01Lgv4Qn82boNFC1jn8QXSNw --- scripts/idle-draft | 2 +- specs/idle-draft.spec.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/idle-draft b/scripts/idle-draft index 7b94723..b030cb7 100755 --- a/scripts/idle-draft +++ b/scripts/idle-draft @@ -1420,7 +1420,7 @@ def run_dispatch(args, config: dict, repo: Path, state_path: Path) -> int: f"(7d {before_pct}%→{after_pct}%)" ) rel_canonical = str(Path(canonical).relative_to(repo)) - ok, reason = git_commit(repo, [rel_canonical, "idle-draft.state.json"], msg) + ok, reason = git_commit(repo, [rel_canonical], msg) log_event(repo, f"success: {cand['item_key']} -> {rel_canonical}; commit={ok} ({reason})") elif outcome == "content_failure": blocked_reason = apply_failure_state(state, cand, defaults["max_attempts"]) diff --git a/specs/idle-draft.spec.md b/specs/idle-draft.spec.md index 3717088..aa5c45b 100644 --- a/specs/idle-draft.spec.md +++ b/specs/idle-draft.spec.md @@ -305,10 +305,13 @@ For the selected `(item_or_dossier, work_type, provider)`: 11. On success: write `idle-draft.state.json` atomically (temp file + `os.replace()` in the same directory), then: ``` - git -C add -- idle-draft.state.json - git -C commit -m "" -- idle-draft.state.json + git -C add -- + git -C commit -m "" -- ``` - Never `git add -A`, never `git commit -a`. Commit message: + Never `git add -A`, never `git commit -a`. `idle-draft.state.json` is + machine-managed churn and is gitignored in the target repo — it is written + atomically but never staged or committed (explicitly `git add`-ing an ignored + path fails, which would break every machine commit). Commit message: `idle-draft: via (7d %→%)`, where before/after are that provider's `seven_day.utilization_pct` immediately before dispatch and immediately after re-probe on completion. No push.