Skip to content

gateway: follow compression resume continuation - #11

Merged
XelHaku merged 1 commit into
mainfrom
autoloop/20260425T024216Z/w4/3-3.e.8-gateway-resume-follows-compression-continuation
Apr 25, 2026
Merged

gateway: follow compression resume continuation#11
XelHaku merged 1 commit into
mainfrom
autoloop/20260425T024216Z/w4/3-3.e.8-gateway-resume-follows-compression-continuation

Conversation

@XelHaku

@XelHaku XelHaku commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@XelHaku
XelHaku merged commit db96d99 into main Apr 25, 2026
@XelHaku
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>
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.

1 participant