gateway: follow compression resume continuation - #11
Merged
XelHaku merged 1 commit intoApr 25, 2026
Conversation
XelHaku
deleted the
autoloop/20260425T024216Z/w4/3-3.e.8-gateway-resume-follows-compression-continuation
branch
April 25, 2026 07:48
XelHaku
added a commit
that referenced
this pull request
Apr 25, 2026
Implements items #6 and #10 from docs/cmd-loops-improvements.md. #6 — Doctor actually diagnoses drift: * planner-loop doctor now also: parses+validates progress.json, verifies PLANNER_TRIGGERS_PATH is writable, and emits an advisory warning when the latest health_updated event is older than 2× PLANNER_INTERVAL (planner ledger) or 1h (builder ledger). * builder-loop doctor introduced (was absent) with the same progress.json + triggers writability + builder-loop drift checks. * Drift warnings are advisory (exit 0) so doctor remains automation-safe; only hard preconditions (missing progress, parse failure, unwritable triggers path) fail the check. #10 — Table-driven progress write: * Replaced the nine near-identical rewriteProgressMarker blocks with a []progressMarker table driven by one loop. Adding a new marker is now appending one struct entry instead of editing four boilerplate lines. Helper extraction: * latestLedgerEventTime + driftWarning + triggerPathWritable are duplicated in both binaries for now (no internal/cmdcommon yet). Item #11 will collapse them once the cliDeps refactor lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
XelHaku
added a commit
that referenced
this pull request
Apr 25, 2026
Implements item #11 from docs/cmd-loops-improvements.md. Both binaries now define a cliDeps struct (stdout, stderr, runner) and a defaultDeps() constructor. main() builds the production deps and passes them through run(); helper functions (printRunSummary, printStatus, doctor, runTrigger, runService, installService, etc.) take cliDeps explicitly. The package-level commandStdout / serviceRunner / commandRunner globals are gone. Tests construct their own deps and pass them to run() — removing the t.Cleanup(func() { commandStdout = oldStdout }) dance and the implicit shared mutable state that prevented t.Parallel(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
XelHaku
added a commit
that referenced
this pull request
Apr 25, 2026
Implements item #13 from docs/cmd-loops-improvements.md, partially. Both `doctor` subcommands and `progress validate` now accept --format text|json. JSON shapes: doctor: {"ok":true,"warnings":[...]} progress validate: {"ok":true,"phases":N} This is enough to gate CI on doctor-clean / progress-clean without parsing human prose. Deferred (documented inline in the improvements doc): digest, audit, and status. Their underlying internal helpers (DigestLedger, WriteAuditReport, RenderStatus) return strings rather than structured data, so a JSON variant requires refactoring the internal API. Worth doing when an external consumer actually needs it; not worth doing speculatively. A new shared parseFormat helper is duplicated in both binaries; item #11 already established the pattern of duplicating small CLI helpers until an internal/cmdcommon package is justified. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.