Skip to content

feat(scheduler): periodic action-SHA verification (24h cadence)#400

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/hypatia-scheduler-verify-action-shas
May 30, 2026
Merged

feat(scheduler): periodic action-SHA verification (24h cadence)#400
hyperpolymath merged 1 commit into
mainfrom
claude/hypatia-scheduler-verify-action-shas

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Wires mix hypatia.verify_action_shas (#399) into LearningScheduler so it runs as a daily auto-audit, not just on manual invocation. Completes the auto-defense story alongside :known_fake_action_sha static rule (#397).

How fake SHAs get caught now

Mechanism Latency Surface
:known_fake_action_sha rule (#397) instant static scan; catches the 25 known fakes immediately
mix hypatia.verify_action_shas (#399) manual one-off audit; catches ANY 422-returning SHA
This PR — LearningScheduler integration daily automatic estate-wide audit, no manual run needed

Design

Cadence

24h via mtime check on the verifier's cache file (data/verified-action-shas.json). Subsequent runs are ~5 sec (only checks new pins) — cheap enough that daily costs nothing meaningful.

Isolation

Spawned as System.cmd subprocess via Task.start, NOT inline in the GenServer:

  • The mix task's exit({:shutdown, 2}) on fakes-found would crash LearningScheduler if run in-process. Subprocess isolates that.
  • Task.start (not Task.async) — fire-and-forget; the learning cycle never waits on the gh-api walk.
  • Exceptions in the verification path are logged but never bubble up.

Logging

  • Clean (zero fakes): info-level confirmation
  • Fakes found (exit 2): warning with clipped sample of output
  • Other exit codes: warning with stderr clip

What's complete now

The auto-defense story is closed:

  • New fake committed → static rule catches it at next scan
  • New fake somehow bypasses static scan → daily audit catches it within 24h
  • Cache keeps the daily audit cheap (~5 sec warm)
  • Zero manual intervention required for ongoing protection

Provenance

Closes the "hypatia is a waste of time" concern raised during the 2026-05-30 snifs#30 / fake-SHA arc.

Test plan

  • Module compiles + LearningScheduler still starts cleanly
  • First cycle after startup runs the verification (cache absent → action_sha_verify_stale? returns true)
  • Subsequent cycles within 24h skip the verification (cache fresh)
  • After 24h, next cycle runs verification again
  • Verification exit 2 (fakes found) logs warning but doesn't crash scheduler
  • Verification crash logs warning but doesn't crash scheduler

Wires `mix hypatia.verify_action_shas` (#399) into LearningScheduler so
it runs as a daily auto-audit, not just when someone manually invokes it.
Completes the auto-defense story alongside the static `:known_fake_action_sha`
rule (#397) — fake-SHA hallucinations get caught either at scan time (rule)
or at the next periodic audit (this).

## Cadence

24h via mtime check on the verifier's cache file
(`data/verified-action-shas.json`). The mix task maintains the cache itself,
so subsequent runs are seconds (only checks new pins) — cheap enough that
running daily costs almost nothing.

## Isolation

Spawned as a `System.cmd` subprocess from `Task.start`, NOT inline in the
GenServer:

- The mix task `exit({:shutdown, 2})` on fakes-found would crash the
  LearningScheduler if run in-process; subprocess isolates that.
- `Task.start` (not `Task.async`) — fire-and-forget, no result waited on,
  the learning cycle doesn't block on a 5-minute gh-api walk.
- Exception in the verification path is logged but never bubbles up.

## Logging

- Clean (zero fakes): info-level confirmation
- Fakes found (exit 2): warning with clipped output sample
- Other exit codes: warning with stderr clip

## What's complete now

Together with #397 (static rule) + #399 (mix task), this closes the auto-
defense story:

- New fake at scan time → static rule catches it instantly
- New fake out-of-scan → daily LearningScheduler audit catches it within 24h
- Cache makes the daily audit cheap (~5 sec warm)
- No manual intervention required for ongoing protection

Provenance: closes the "hypatia is a waste of time" concern raised during
the 2026-05-30 snifs#30 / fake-SHA arc.
@hyperpolymath hyperpolymath merged commit 822740d into main May 30, 2026
23 of 31 checks passed
@hyperpolymath hyperpolymath deleted the claude/hypatia-scheduler-verify-action-shas branch May 30, 2026 17:14
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 103 issues detected

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 103
View findings
[
  {
    "reason": "Action urin 21 JRE\n        uses: actions/setup-java@be666c2fcd27 needs attention",
    "type": "unpinned_action",
    "file": "verify-proofs.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in clusterfuzzlite.yml",
    "type": "missing_timeout_minutes",
    "file": "clusterfuzzlite.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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