feat(monitoring): add production health checks with auto-issue filing - #191
Merged
Conversation
Adds a new internal/healthcheck package and run_health_checks MCP tool (Issue #190): a project can declare [[health_checks]] command entries in harness.toml, and the tool runs each one (30s timeout), returning {name, ok, output} per check. Failing checks with no existing open issue open a new "production-incident"-labeled issue (deduped by an "[health-check: <name>]" title prefix); checks that recover get a one-time "recovered at <time>" comment on the matching issue (never auto-closed). Unconfigured projects see no change in behavior. Wires health_checks_since into .hermit/superintendent-state.json (get_loop_state/update_loop_state) and adds a new Superintendent-cycle step (both HERMIT's own CLAUDE.md and the scaffolding template) that calls run_health_checks on a 5-minute cadence, mirroring how run_requirements_sweep is tracked hourly. Assumption: the issue body referenced ".hermit/config.yaml" as the existing test_command config file, but the actual config file in this codebase is harness.toml ([requirements].test_command) — health_checks follows the same harness.toml convention as [[repos]] etc. Closes #190
Owner
Author
Superintendent review (HIGH risk — manual review before merge)
変更内容の要約:
懸念点・特記事項:
結論: 内容を確認した限り、安全にマージできる状態に見えます(looks safe to merge pending approval)。ただしHIGH risk判定のため、このパスではマージを見送り、人間の承認を待ちます。 |
Owner
Author
|
|
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.
Summary
internal/healthcheckand a newrun_health_checksMCP tool (Issue feat(monitoring): add production health checks with auto-issue filing #190): runs each[[health_checks]]command (harness.toml) with a 30s timeout and returns{name, ok, output}[].production-incident, deduped by an"[health-check: <name>]"title prefix. Checks that recover get a one-time"recovered at <time>"comment on the matching issue (never auto-closed).health_checksomitted/empty) see run_health_checks as a true no-op — existing behavior is unchanged.health_checks_sinceto.hermit/superintendent-state.json(get_loop_state/update_loop_state), and a new Superintendent-cycle step (both this repo'sCLAUDE.mdand thehermit initscaffolding template) that callsrun_health_checkson a 5-minute cadence, mirroring howrun_requirements_sweepis tracked hourly.mcp__hermit__run_health_checksto.claude/settings.json's permissions allowlist and updates thetools/listcount assertions incmd/hermit/serve_test.go(20 → 21 registered tools).Assumption / deviation from the Issue text
The Issue body describes the config file as
.hermit/config.yaml, but this codebase's actual (and only) MCP-server config file isharness.toml(e.g.[requirements].test_command,[[repos]], etc. — there is no.hermit/config.yamlanywhere in the repo). I implemented[[health_checks]]as a new array-of-tables section inharness.toml, following the exact same config-loading path as[requirements], rather than introducing a second, unprecedented config file. This matches the Issue's own instruction to "踏襲する" the existingtest_commandconfig pattern.Test plan
go build ./...go vet ./...gofmt -l .(clean)golangci-lint run ./...(0 issues)go test ./...(all packages pass)RunChecks(pass/fail/timeout/type-skip),Reconcile(new-issue-on-failure, dedup-on-still-failing, recovered-comment-once, no-op-on-passing-with-no-issue), the GitHub adapter (title-prefix matching, issue body contents, label, one-time recovered comment), therun_health_checksMCP tool end-to-end (no-op when unconfigured, per-check result shape, issue-opening, dedup, recovery comment, once-only), andharness.tomlparsing of[[health_checks]](including the omitted-section no-op case).Closes #190
🤖 Generated with Claude Code