Skip to content

Slim the /sdlc skill to run+report+HITL; harden supervision + long-haul monitoring (PRs B/C/D of #3364) - #3524

Merged
jwbron merged 139 commits into
mainfrom
egg/issue-3364/work
Jul 10, 2026
Merged

jwbron merged 139 commits into
mainfrom
egg/issue-3364/work

Conversation

@james-in-a-box

@james-in-a-box james-in-a-box Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

The three remaining, mutually-independent PRs of #3364 (PR A landed via #3421 — not redone). Three independent slices, one PR each, disjoint file sets so there is no integration collision:

  • Slice 1 / PR B (additive, low risk): add client-side --exclude-types and --quiet filter flags to the pure-stdlib skills/sdlc/bin/wait-status, and add a new slice.closed EventType emitted at both SliceScheduler close sites (record_complete / record_failure) with an outcome field distinguishing success vs failure, allowlisted in _STATUS_WAIT_EVENT_TYPES so it reaches wait-status consumers.
  • Slice 2 / PR C (behavioral, medium-high risk — highest here): a NEW transient rate-limit classification distinct from abnormal that keys off the all-producers agent-invocation-failure streak carrying the bare throttling wording auth_errors.py deliberately excludes from EX_AUTH_FATAL (429 / rate limit / overloaded); a windowed paced retry across the rolling cap window (hours, not the 30s cap) using a restart_phase-equivalent that preserves landed slices; and a deterministic-loop guard that escalates instead of looping when a restart reproduces the identical failure fingerprint at the same point. Per resolved cq-1: NO hard wall-clock ceiling, but an OVERSEER_ALERT fires once the cumulative wait crosses a threshold. EX_AUTH_FATAL (incl. matched weekly caps) and ordinary abnormal halts behave unchanged.
  • Slice 3 / PR D (deletion, medium risk — GATED): task-3-1 coverage-maps each of the five host-detector blocks in SKILL.md to a concrete overseer emitter FIRST; any block with no confirmed emitter is raised as a HITL at point of discovery, not silently deleted. Only after the gate: delete the host-detector blocks + migration section + Overseer-Absent Fallback + Stuck-Rescue host trigger + short-flow Stall block (preserving the render-on-OVERSEER_ALERT AskUserQuestion flows and the user-initiated Rescue Steps 1-3), and remove overseer_owns_host_detection entirely.

Grounded live @ ca193b8 (2026-07-06). Critical grounded fact: there is NO deterministic overseer emitter for agent-stall / agent-silent / agent-nack-unresolved / phase-long-running — those ride the Haiku classifier action:{action} path only — which is exactly why the PR-D coverage-map is real verification work.

Test Plan

Per slice; make test narrows to reachable suites, make lint green throughout; run make test-all before phase exit.

  • Slice 1 (PR B): wait-status --exclude-types drops a targeted event type and --quiet behaves per spec while default (non-filtered) output is unchanged (regression guard); a slice completion emits exactly one allowlisted slice.closed(success) and a slice failure emits exactly one allowlisted slice.closed(failure), each distinguishable by outcome.
  • Slice 2 (PR C): throttling-streak classifies as transient rate-limit (NOT abnormal, does not trip the fail-streak halt); paced-retry pacing/window (reset-time-paced when present, else bounded backoff; threshold OVERSEER_ALERT fires per cq-1); landed slices preserved across a paced restart; loop-guard escalates on identical-fingerprint reproduction and continues when the restart advances state; regression: EX_AUTH_FATAL (incl. weekly cap) and ordinary abnormal halts fire unchanged.
  • Slice 3 (PR D): grep-clean for overseer_owns_host_detection and run_migrated_detectors; orchestrator tests referencing the removed field updated/removed; SKILL.md still renders and the preserved Long-Running Implement Phase + Unresolved NACK AskUserQuestion flows remain structurally intact.

Manual Steps

Pre-merge: none. The three PRs are independent and may merge in any order (B first is preferred for quick value). Post-merge: PR C changes live supervision behavior — watch the first real cap-wall recovery to confirm the threshold OVERSEER_ALERT fires and landed slices are preserved.

Pipeline context

Per-phase BRC transcripts: refine, plan.

egg-orchestrator and others added 21 commits July 6, 2026 22:09
…g, skill slim

Grounded @ f139716. PR A (#3421) out of scope. Per-PR ACs; PR D deletion
gated on a real coverage-map (host detectors agent-stall/silent/nack/long-running
have no production overseer emitter beyond the LLM-classifier path). cq-1 raised:
PR C paced-retry ceiling/escalation policy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…es 1/2/3)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…inds tasks

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… test paths

Fixes #3046 overlap (orchestrator/tests) and the missing slice-3 header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@james-in-a-box james-in-a-box Bot added the egg label Jul 6, 2026
egg and others added 8 commits July 6, 2026 23:00
…3364)

Document the two PR B additions in the canonical wait-status reference
(docs/reference/agent-wait-patterns.md §7):
- §7.1.1: --exclude-types / --quiet client-side filter flags on the
  skills/sdlc/bin/wait-status launcher (additive, default-off,
  pure-stdlib, cursor threading preserved).
- §7.2 allowlist table: SLICE_CLOSED / slice.closed row (emitted at
  record_complete + record_failure with slice_id + outcome field).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e-1)

task-1-1: add --exclude-types (comma-separated client-side event-type drop) and --quiet (keep only terminal / decision.created / slice.closed / message-trigger lines) to skills/sdlc/bin/wait-status. Pure-stdlib, no new deps. Filters gate only the printed JSON line; cursor threading and terminal exit codes are decided independently, so with no flags the default output stays byte-for-byte identical to egg_lib.orch_cli (standalone-parity contract test stays green).

task-1-2: add EventType.SLICE_CLOSED and emit once per slice at SliceScheduler.record_complete / record_failure via an injected slice_closed_emitter seam (mirrors hitl_escalator: default None, invoked OUTSIDE the lock to avoid re-entrancy/deadlock). Called (slice_id, outcome) with outcome complete|failed so the payload distinguishes success from failure; absent-slice early-returns never emit.

task-1-3: add "slice.closed" to _STATUS_WAIT_EVENT_TYPES so the /status/wait allowlist lets the event reach wait-status consumers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
egg-orchestrator and others added 9 commits July 10, 2026 02:51
Verification tests for AC-D2, closing task-3-5:

- test_config_overseer_flag_removed.py: the calibration flag is gone
  from PipelineConfig (field absent, no attr on a default instance),
  a stale persisted key is dropped not resurrected (extra='ignore'),
  and the retained overseer threshold knobs survive.
- test_routes_status.py: the GET /status config subset no longer
  advertises overseer_owns_host_detection but still surfaces the
  retained threshold knobs (drives the real route body, nothing
  mocks the subset itself).

Also verified out-of-band (grep-clean): overseer_owns_host_detection /
run_migrated_detectors clean across code + SKILL.md (remaining refs are
documenter-owned docs/); removed detector headings gone from SKILL.md;
preserved AskUserQuestion / Stuck-Pipeline-Rescue / OVERSEER_ALERT flows
and cq-4-retained Long-Running Phase Detection intact.

make lint + targeted suites green (180 tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The slice-3 code change removes overseer_owns_host_detection and the
host-side detector blocks from SKILL.md, concluding the #1962 calibration
window. Update the docs that still described the flag / migration as live
so AC-D2's repo-wide grep-clean of overseer_owns_host_detection and
run_migrated_detectors holds and no stale documentation ships:

- docs/architecture/orchestrator.md: reframe the migration paragraph as
  concluded; drop the calibration-flag / run_migrated_detectors narrative.
- docs/architecture/overseer.md: drop the flag reference from the
  legacy-LLM-monitor note.
- docs/guides/pipeline-health-monitoring.md: delete the config-table row
  for the removed flag; replace the calibration-window flag-semantics and
  overseer-unresponsive fallback prose with a 'migration concluded' note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
egg-orchestrator and others added 3 commits July 10, 2026 03:04
…mplement_support

The PR B emitter wiring pushed _run_implement.py to 1517 lines, over
the 1500-line hard cap that Custom Checks enforces (the allowlist is
deliberately empty since #3312). Move the emitter closure builder and
the slice-loop context-PR safety net into _run_implement_support.py,
the module that exists for exactly these lifted closures, following
its _pkg barrel-seam pattern. _run_implement.py is back to 1471
lines; behavior unchanged, bodies moved verbatim.
@james-in-a-box

Copy link
Copy Markdown
Contributor Author

egg is resolving merge conflicts for this PR...

…-062626-3080/work

# Conflicts:
#	orchestrator/routes/pipelines/__init__.py
#	orchestrator/routes/pipelines/_run_implement_support.py
@james-in-a-box

Copy link
Copy Markdown
Contributor Author

Conflict Resolution Summary

Resolved merge conflicts with main (merge commit 04a05d58e, not rebase — PR history preserved).

Both conflicts were in the routes/pipelines/ barrel + its implement-support submodule, where this PR and recently-landed base commits (#3572 evidence-gate/rescue, #3541 slice-base linearization) each added different, non-overlapping helper functions to the same regions.

File Category Resolution
orchestrator/routes/pipelines/_run_implement_support.py Additive Kept both sides' functions. PR-side: _open_context_pr_safety_net_impl, _build_slice_closed_emitter_impl (slice.closed emitter, #3364). Main-side: _slice_close_evidence_gate (#3572). Main's _parent_branch_probe_impl / _fresh_contract_for_base_impl / _admission_base_ancestry_gate_impl auto-merged cleanly above the conflict.
orchestrator/routes/pipelines/__init__.py Additive Barrel re-export block: took the union of both import lists (9 symbols), alphabetically sorted.

Why additive (not semantic): the merge-base defined only 3 functions in _run_implement_support.py; each side appended disjoint new helpers with no shared edits to existing bodies. Both features' call sites in _run_implement.py auto-merged and both remain wired.

Verification: ruff check orchestrator/routes/pipelines/ → clean; py_compile of the two resolved files + _run_implement.py → OK; EventType.SLICE_CLOSED (referenced by the new emitter) confirmed present in orchestrator/events.py. Full make lint / test suite deferred to CI (no venv in this sandbox; per-workflow policy skips the 10–15 min suite locally).

Please review: the barrel import ordering is the only hand-edited line beyond keeping both function bodies — worth a glance to confirm the union is complete and no symbol was dropped.

— Authored by egg

@james-in-a-box

Copy link
Copy Markdown
Contributor Author

egg conflict resolution completed. View run logs

jwbron added 3 commits July 9, 2026 23:30
Resolves conflicts against the #3520 waiting-probe work that landed on
the work branch after slice-2 branched: both JobSupervisor seams
(waiting_probe and rate_limited_notifier) are kept, the #3520 note and
the PR C rate-limit constants coexist in supervision_policy.py, and the
work branch's newer contract state is retained.
Only the pipeline contract statefile conflicted; the work branch's
version is a strict superset (it includes the later cq-3/cq-4
resolutions and slice-3 completion state) and is retained.
Conflicts were additive on both sides: the #3364 slice.closed emitter
and context-PR safety net helpers (work) now coexist with the #3572
evidence-gate HITL escalation and #3582 base-ancestry admission helpers
(main) in _run_implement_support.py, with the import list unioned in
routes/pipelines/__init__.py.
jwbron added 4 commits July 9, 2026 23:37
_slice_state.py crossed the 1500-line hard cap on main via #3582; the
routes/pipelines barrel crossed it when this branch's imports merged
with main's. Tracked for decomposition in #3587.
test_transient_failure_is_not_auth_fatal asserted the pre-PR-C
passthrough (returncode 1) for a bare throttle; PR C deliberately maps
that shape to EX_RATE_LIMITED so the orchestrator paces it. The test's
invariant (never auth-fatal) is kept and tightened to the new code.
# Conflicts:
#	scripts/file-size-allowlist.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant