Skip to content

fix(scheduler): log WriteFile error + EM state run 10 — closes #65#95

Merged
jpleva91 merged 3 commits intomainfrom
fix/scheduler-writefile-65
Mar 31, 2026
Merged

fix(scheduler): log WriteFile error + EM state run 10 — closes #65#95
jpleva91 merged 3 commits intomainfrom
fix/scheduler-writefile-65

Conversation

@jpleva91
Copy link
Copy Markdown
Contributor

Summary

What changed

internal/scheduler/scheduler.go line 242 (one-line fix):

// Before (silent discard)
os.WriteFile(logPath, []byte(logContent), 0o644)

// After (logged error)
if err := os.WriteFile(logPath, []byte(logContent), 0o644); err != nil {
    fmt.Printf("[scheduler] ⚠ %s: failed to write log: %s\n", agent.Name, err)
}

Why this matters

ShellForge is a governance tool — silent audit log loss is a P2 reliability issue. If outputs/logs/ doesn't exist, disk is full, or permissions are wrong, run telemetry was silently discarded with no indication.

Test plan

  • go build ./cmd/shellforge/ passes
  • go test ./... — 25/25 pass (governance, intent, normalizer)
  • No call-site changes

EM run 10 actions (this run)

🤖 Generated with Claude Code

jpleva91 and others added 3 commits March 31, 2026 04:45
Recovered broken worktree (incomplete WIP #51 fix left build broken).
Stashed WIP, fixed #51 properly in PR #93 (log run() errors).
PR #89 merged — 25 tests, closes #68 + #66.
Issue #92 (Preflight/Goose) triaged P2.
PR budget 2/3. Sprint: P2 bug sweep (#52, #65) + dogfood readiness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g — closes #65

Silent discard meant failed log writes (full disk, missing dir, bad perms)
were invisible. Governance tools must not silently lose audit records.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closed stale PR #91 (DIRTY merge conflict, superseded by #94).
Fixed #65 (scheduler WriteFile error). PR budget 3/3 — queue at limit.
Human review of #93 and #94 (both CI green) needed to unblock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jpleva91 jpleva91 merged commit 30a75c2 into main Mar 31, 2026
5 checks passed
@jpleva91 jpleva91 deleted the fix/scheduler-writefile-65 branch March 31, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: scheduler.go silently ignores os.WriteFile error when writing agent run log

1 participant