Skip to content

Lifecycle event seam + bounded post-mortem surface for supervised work (companion to #1/#2) #4

Description

@iceteaSA

Contract proposal, two halves of one seam: durable session-lifecycle events + a bounded post-mortem surface. Companion to #1 (watchers) and #2 (schedules) — this is about subc as the observability substrate for supervised work.

What we run today, harness-side

Eleven passive observer plugins ride inside our harness process and re-derive session state from its SQLite DB on every tool call. The two relevant here:

  • A runaway detector classifying live child sessions into: dead-dispatch (errored-only child), no-activity stall, truncation-wedge (finish=length with zero tool parts), and p90-relative runaway per agent class (tools/runaway-tap/index.ts:250-325 in our config repo).
  • A post-mortem tool reconstructing a finished session from durable rows — terminal state, bounded recent errors, final text, cost — with the heuristic that a missing result envelope is normal completion and finish=length is not (tools/autopsy.ts:44-67).

Both work, but the architecture is wrong: they die with the harness process, poll instead of subscribing, and force every consumer (dashboard, notifier, score logger) to re-implement the same state derivation.

Offer

  • The terminal-reason / liveness signal vocabulary above, field-tested for months (the truncation-wedge signature alone has caught a class of provider-clamp failures nothing else surfaced).
  • A consumer-side reference implementation once a seam exists — we would port our detectors to it immediately and delete the polling versions.

Asks

  1. Should subc core standardize a lifecycle event stream for supervised work (module/session started, heartbeat/progress, terminal with reason taxonomy), with policy (reminders, kills, scoring) left entirely to consumers?
  2. Same question for a bounded inspect-style post-mortem op: terminal reason, bounded error tail, bounded final output. Should subc own that contract, or only expose raw state for a higher layer to shape?
  3. If both are out of scope for core — is the blessed pattern a dedicated observer module, and if so does the module protocol already carry enough (event subscription across modules) to build it without core changes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions