Skip to content

Coordinator: heartbeat + lifecycle log lines, request timeouts and log contract - #25

Merged
LukeHackett12 merged 4 commits into
3FLabs:mainfrom
aragon:main
Aug 25, 2026
Merged

LukeHackett12 merged 4 commits into
3FLabs:mainfrom
aragon:main

Conversation

@jjavieralv

Copy link
Copy Markdown
Contributor

Monitoring for this service is regex-over-logs, so this adds the lines it needs and locks their shape. Everything is confined to packages/guardian-coordinator; no existing log lines were changed.

  • Heartbeat: every poll cycle logs {"level":"info","event":"guardian.heartbeat","ok":…,"fetched":…,"signed":…,"skipped":…,"failed":…,"durationMs":…} — also on failed polls (ok:false), so absence always means dead/wedged.
  • Lifecycle lines: guardian.startup (build + chains) on boot, guardian.fatal (err + stack) before exit 1, replacing the bare error.message print.
  • Request timeouts: REQUEST_TIMEOUT_MS (default 10s) via AbortSignal.timeout on all grunt-api calls — a hung fetch no longer freezes the loop silently.
  • Log contract: log-contract.json lists every guaranteed line; tests/log-contract.test.ts checks both directions (every pattern emitted, every emission matched), so changing any monitored line fails CI. These will be used on monitorization patterns to be able to grab the proper logs.
  • API (additive, non-breaking): runGuardianCoordinatorOnce now returns the
    cycle's counters (PollCycleStats) instead of void so the heartbeat can report
    them — existing callers are unaffected. New exports: runGuardianCoordinatorCycle
    (one poll + heartbeat, used by the loop and by tests) and startupLine/fatalLine
    (exported only so the contract tests can pin their exact output). New optional
    requestTimeoutMs config field (REQUEST_TIMEOUT_MS). The logger interface is
    untouched.

Coordinator: heartbeat + lifecycle log lines, request timeouts and log contract
@changeset-bot

changeset-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0861cfb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@3flabs/guardian-coordinator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LukeHackett12

Copy link
Copy Markdown
Contributor

once changeset is present happy to merge!

@LukeHackett12
LukeHackett12 merged commit 51a06da into 3FLabs:main Aug 25, 2026
1 check passed
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.

3 participants