Skip to content

Define run tracking modes (strict-run and follow-descendants) #2

@melonattacker

Description

@melonattacker

Motivation

logira run should have clear semantics around when a run starts and ends.

This matters for AI coding agents because they may:

  • spawn child processes
  • start background tasks
  • leave long-lived descendants running
  • daemonize helper processes
  • exit while children continue to run

Users need to understand whether logira stopped tracking when the parent command exited, waited for descendants, or observed remaining background processes.

Goal

Define explicit run tracking semantics.

Implementation can be included in v0.3.0 if small enough, but this issue should not block v0.3.0 if the design or implementation becomes larger than expected.

Proposed modes

strict-run

Default mode.

Intended for auditing a single command invocation.

Behavior:

  • track the parent command and descendants
  • stop the run when the parent command exits
  • wait for descendants for a short grace period
  • report any remaining descendant processes
  • preserve the audited command's exit code

Example:

logira run --mode strict-run -- claude

follow-descendants

Intended for agents or commands that intentionally spawn background work.

Behavior:

  • track the parent command and descendants
  • when the parent exits, continue tracking descendants
  • stop when descendants exit
  • or stop after a configured linger timeout
  • report descendants that still remain

Example:

logira run --mode follow-descendants --linger 60s -- claude

CLI design

logira run --mode strict-run -- claude
logira run --mode follow-descendants --linger 60s -- claude

Config integration can be added later.

Output

If descendants remain after the run ends, the end-of-run summary should surface them.

Example:

background processes:
  pid=12345 cmd="node /tmp/helper.js" status=still-running

Non-goals

This issue should not implement:

  • full always-on watch mode
  • transparent process discovery
  • monitoring already-running processes
  • system-wide session tracking

Acceptance criteria

Design acceptance:

  • document strict-run behavior
  • document follow-descendants behavior
  • document default behavior
  • document interaction with exit code handling
  • document how remaining descendants are surfaced

Implementation acceptance, if included:

  • logira run --mode strict-run works

  • logira run --mode follow-descendants works

  • remaining descendants are surfaced in summary output

  • tests cover:

    • command with no children
    • command with short-lived child
    • command with long-lived child
    • timeout/linger behavior
    • non-zero parent exit code

Notes

This is a should-have for v0.3.0.

If it grows too large, move it to a later milestone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runRun lifecycle, tracking, cgroups, and process behaviorpriority:shouldValuable for the milestone, but can move if neededtype:featureNew functionality or user-visible behavior change

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions