diff --git a/scripts/sf-autonomous-watchdog.sh b/scripts/sf-autonomous-watchdog.sh index 44fdd1ef1..50396f779 100755 --- a/scripts/sf-autonomous-watchdog.sh +++ b/scripts/sf-autonomous-watchdog.sh @@ -36,6 +36,13 @@ while true; do rm -f .sf/runtime/autonomous-solver/active.json 2>/dev/null echo '{"ids":[],"dispatchedAt":null}' > .sf/runtime/self-feedback-inline-fix.json + # Log rotation: delete watchdog-run-*.log files older than 60 minutes. + # Without this, .sf/ grew to 1.9 GB in 24h (observed 2026-05-17 — each + # cycle's stderr is 100-300 MB and is rarely useful after the cycle + # completes). Keep the last hour for post-incident triage; older + # cycles' state is already reflected in DB + iterations.jsonl. + find .sf -maxdepth 1 -name "watchdog-run-*.log" -mmin +60 -delete 2>/dev/null || true + # #wiggums: pre-flight smoke test — `sf --version` must succeed before # starting an autonomous cycle. If it fails, dist is broken (e.g. # missing export, syntax error) and there's no point looping. Pause diff --git a/src/resources/extensions/sf/self-feedback.js b/src/resources/extensions/sf/self-feedback.js index e828d147b..dac6b314a 100644 --- a/src/resources/extensions/sf/self-feedback.js +++ b/src/resources/extensions/sf/self-feedback.js @@ -485,6 +485,10 @@ const ALLOWED_KIND_DOMAINS = new Set([ "brittle-predicate", "git-empty-pathspec", "advisory-downgrade", + // adversarial-finding: R075 autonomous-adversarial-review domain. Without + // this, R075 challenge units have no kind to file their findings under + // (gap reported by sf-mp9u4i25-fczmcj on 2026-05-17). + "adversarial-finding", ]); const KIND_SEGMENT_RE = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/; diff --git a/src/resources/extensions/sf/uok/gate-registry-bootstrap.js b/src/resources/extensions/sf/uok/gate-registry-bootstrap.js index 9e58ef75d..8502567da 100644 --- a/src/resources/extensions/sf/uok/gate-registry-bootstrap.js +++ b/src/resources/extensions/sf/uok/gate-registry-bootstrap.js @@ -1,6 +1,16 @@ import { driftDetectionGate } from "./drift-detection-gate.js"; import { iterCompletionReconcilerGate } from "../sf-db/iteration-completion-reconciler.js"; import { getGateRegistry } from "./gate-registry.js"; +// R081 detector gates — all 6 retrofitted from the detector function exports. +// Wired here so they are routed through UokGateRegistry rather than imported +// as bare functions by auto/loop.js + uok/auto-runaway-guard.js (the latter +// still uses bare-function imports during the R081→R119 wiring transition). +import { sameUnitLoopGate } from "../detectors/same-unit-loop.js"; +import { zeroProgressGate } from "../detectors/zero-progress.js"; +import { repeatedFeedbackKindGate } from "../detectors/repeated-feedback-kind.js"; +import { artifactFlapGate } from "../detectors/artifact-flap.js"; +import { staleLockGate } from "../detectors/stale-lock.js"; +import { periodicDetectorSweepGate } from "../detectors/periodic-runner.js"; /** * gate-registry-bootstrap.js — register ADR-0075 UOK gates that are liftable. @@ -22,5 +32,14 @@ const registry = getGateRegistry(); // SKIP planning-flow-gate: execute() closes over persistGate arguments from guided-flow.js. registry.register(driftDetectionGate); registry.register(iterCompletionReconcilerGate); +// R081 detector gates — 6 total. All ctx-driven (no host-file closure), so +// they register cleanly. Closes the gap reported by sf-mp9udspu-fsf7si +// ("UOK gate bootstrap registers only 2 of 6+ detector gates"). +registry.register(sameUnitLoopGate); +registry.register(zeroProgressGate); +registry.register(repeatedFeedbackKindGate); +registry.register(artifactFlapGate); +registry.register(staleLockGate); +registry.register(periodicDetectorSweepGate); export { registry as gateRegistry };