Skip to content

feat(process): report bounded live capture progress - #1483

Merged
N0zoM1z0 merged 8 commits into
morluto:mainfrom
sathariels:feat/process-capture-progress
Oct 10, 2026
Merged

N0zoM1z0 merged 8 commits into
morluto:mainfrom
sathariels:feat/process-capture-progress

Conversation

@sathariels

@sathariels sathariels commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Quiet process captures previously looked idle until their final result. This adds lifecycle status to CLI stderr and MCP progress notifications when a token is supplied. Fixes #1252.

Progress reports observed phases, elapsed time and collected-unit counts; unknown totals remain unknown. The existing 100 ms intermediate send policy and final cleanup notification are retained. A slow observer keeps one pending intermediate status instead of queuing every old observation; cleanup discards stale live status while preserving monotonic counts and terminal delivery. Child output remains in complete Evidence. Clients without a progress token remain silent.

Validation

  • On 97639b5, fresh compile and the actual 84-byte public CLI/production SDK stdio MCP workflow pass again, as do all 13 directly affected tests, including live timeout/cancellation cleanup and the current public returned-reference regression. The earlier 135-test/static/document results remain attributed to their recorded review heads; fresh current-head CI supplies the complete gate.
  • Integrated main 3059d8a4 with the contributor history preserved; current maintenance head 97639b5f502646ad3fa31870df224d74e9969642. Maintenance commit identities use verified GitHub no-reply email. The latest cancellation-test follow-up prepares the SDK output-schema cache before timing capture control and always settles the owned pending call and deadline timer.
  • 135 relevant tests pass across capture, normalization, lifecycle, cancellation, cleanup, CLI/MCP adapters, blocked observers and the shared reporter. The initial client-arrival-gap failure is retained; exact 100 ms send spacing is now tested with the reporter clock, while public boundaries test notification density over observed lifecycle time. The cancellation helper also clears its owned deadline timer.
  • Full serial compile/typecheck, lint/module boundaries, unchanged duplication gate, generated-document checks, architecture guards, test discovery and changed-file formatting pass with the pinned toolchain and two-CPU/process-family guard.
  • Actual compiled public CLI plus production SDK stdio MCP on a source-owned 84-byte sparse child: notifications arrive during the run, no-token requests emit none, complete Evidence/text-structured parity/raw child output/unchanged input digest/owned cleanup and subsequent ping pass. Main reproduced zero CLI progress and only two MCP 0/1 bookends.
  • Actual production-boundary PTY capture of a 900 ms child with a deliberately lagging 200 ms observer: queued updates fell from 53 to eight and return time from 11.9 s to 2.2 s in this control. Two blocked-observer regressions fail on the original implementation and pass after the follow-up. This is an observer-delay control, not a general throughput or model-token claim.

Compatibility and scope

CLI progress is on stderr; stdout and tool-result Evidence contracts are unchanged. MCP progress now counts collected units and omits unknown total; consumers must not assume the earlier 0/1 pair or invent a percentage. Launch, signals, process ownership and cleanup authority remain unchanged. Independent runtime proof is Linux x64 PTY; macOS was not run locally, and Windows PTY capture remains unavailable. No binary-analysis engine verification or large Notion/Obsidian matrix is claimed. The first maintenance CI failed only at the newly merged main #1517 fixed 2,000 ms assertion. Main #1526 has since repaired that test and added actual CLI/MCP regressions; the refreshed branch includes it, preserves its public workflow, and passes the 13 directly affected tests plus fresh small-process CLI/MCP and full serial static/document gates. Fresh current-head CI must pass before merge.

Long captures emitted only a final result, so a quiet child looked idle.
Pass the shared rate-limited progress reporter through the capture lifecycle
and report the observed phase, elapsed time, and collected-unit counts.
CLI writes those lines to stderr; MCP forwards them only when the client
supplied a progress token. Final Evidence on stdout keeps its shape.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

I reviewed the lifecycle wiring at 3006514c and found a producer-side boundedness gap in createProcessCaptureProgressTracker. Each live tick creates a new promise chain and captures a status payload before the shared 100 ms limiter runs. If the async progress sink is held up, all intermediate updates accumulate; closeLive() suppresses new updates but does not remove that backlog, and the terminal report waits behind it.

I reproduced this narrowly with this exact production tracker and the existing createProgressReporter: hold the first sink promise, submit 1,000 intermediate reports, then submit cleanup. After releasing the sink, the tracker invokes progress.report 1,002 times although the shared limiter delivers only three sink updates. This is a controlled progress-port diagnostic, not a claim that a real CLI/MCP pipe saturation test has been performed.

Please coalesce pending intermediate status before scheduling delivery, keeping at most one in-flight report and the latest pending status, with the terminal status ordered after the in-flight report. A slow-sink regression should show that pending work stays bounded and stale updates do not delay the terminal status. The existing CLI/MCP normal, no-token, timeout and cancellation workflows should continue to preserve Evidence and cleanup.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Review reproduced #1252 on current main 7a56fe62 with an actual source-owned 84-byte sparse child through the public compiled CLI and production SDK stdio MCP: CLI has no intermediate status; MCP only has two 0/1 bookends.

The existing implementation also revealed a progress backpressure problem. With a real 900 ms PTY child and a deliberately lagging production-boundary observer (200 ms per update), the original integrated implementation queued 53 updates and capture return took 11.9 s. I am preparing a narrow follow-up on this PR that coalesces pending intermediate observations and discards stale live updates before final cleanup, preserving monotonic counts and terminal delivery. The same small-child observer probe then returns in 2.2 s with eight updates; this is an observer-delay control, not a general throughput claim. Two blocked-observer controls fail on the original implementation and pass on the follow-up.

The refreshed public CLI/stdio MCP small-target workflow now passes, including live notifications before completion, no notifications without a token, complete Evidence, text/structured parity, owned cleanup, unchanged source digest and subsequent ping. Finishing the relevant lifecycle/cancellation checks and serial static gates before publishing the integrated follow-up here; contributor history will be preserved. No reviewers requested.

Retain one pending intermediate observation and drop stale live status before terminal cleanup. Preserve monotonic counts and final delivery while an observer is slow or rejects an update.

Verify the send rate at its controlled-clock owner and lifecycle notification density at the CLI/MCP boundary, where receive timestamps include buffering and scheduling.
@N0zoM1z0 N0zoM1z0 changed the title feat(process): report live capture progress through CLI and MCP feat(process): report bounded live capture progress Oct 10, 2026
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

The integrated follow-up is now on this existing PR at 9a4fdbeb52df0eb5d16dd5dda6465fbf9a5c7049, preserving the contributor commit and history. The pending-progress coalescing, final cleanup ordering, rejected-observer control, correct send-clock/rate-density assertions and owned cancellation-helper timer cleanup are included.

135 relevant tests pass after correcting the recorded 99 ms client-arrival assertion; the initial failure and the two original blocked-observer failures are retained as diagnosis. Full serial compile/typecheck, lint/module boundaries, unchanged duplication gate, generated docs, architecture guards, test discovery and formatting pass. The committed head was freshly compiled and the actual public CLI plus production SDK stdio MCP 84-byte sparse-target workflow passes again, including live notifications, no-token silence, raw output, complete Evidence/text-structured parity, owned cleanup, unchanged input digest and ping. Independent runtime scope is Linux PTY; no local macOS/Windows capture or binary engine claim.

The PR description now describes the final behavior, compatibility and measured observer-delay control. Waiting for fresh CI and final review on this exact head before merge; earlier 3006514c checks are not reused.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Current-head CI has one failed test: shard 3/4 checks out synthetic merge 88aaad2d and the newly merged main #1517 regression takes 2,616.9 ms against its fixed 2,000 ms assertion. The shard reports 1,715 other tests passed, including the process-progress controls. The initial failure log is retained; I am not rerunning it to hide the failure.

Existing contributor follow-up #1529 addresses the same main-CI failure by checking growth and retaining the semantic result. I am reviewing that guard and its pre-fix rejection control before integration here. #1526 also supplies additional actual CLI/MCP regression coverage; that coverage should be kept while avoiding a competing removal of the growth guard. Current-head CI/review still needs to be green before this PR merges.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

The refreshed integration is now 05c72e93059b0f7d1daea74dde5a2aa464cbea37, a normal merge of current main 72b3209f preserving the contributor history. Fresh CI is 38044686481; all five applicable current-head workflows were reviewed and approved.

Main #1526 has already repaired the #1517 hard wall-time test and retained additional actual CLI/MCP returned-reference regressions. The author withdrew #1529 as superseded; it remains closed. Its independently verified covered growth/negative-control results are retained as diagnosis, not a merged-main performance guarantee. No failed old check is being reused or rerun to hide its failure.

On this refreshed source, fresh compile, the actual 84-byte sparse-child public CLI/production SDK stdio MCP workflow, 13 directly affected tests including the additional public returned-reference workflow, and full serial typecheck/lint/module-boundary/unchanged duplication/generated-document gates pass. Live status, no-token silence, complete Evidence/text-structured parity, raw child output, owned cleanup, unchanged input digest and subsequent ping remain verified. Waiting for this exact head’s complete CI and final review before merge; no reviewers requested.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

The revised tracker resolves the unbounded progress backlog: it keeps one in-flight notification and only the latest pending update. Its three controlled slow/rejecting observer tests pass locally, alongside seven reporter and real Linux CLI/MCP boundary cases (10 tests total across three files). The CLI checks use real child processes; MCP uses the pinned SDK over InMemoryTransport. macOS capture and Windows PTY were not independently exercised here.

I also reproduced a cancellation-test timing failure on the constrained host: a fresh SDK client prepared all output validators while the test was waiting for capture progress, and the default polling timeout expired before capture began. Commit 97639b5f warms that cache before starting the capture-control clock, sets the intended polling timeout explicitly, and observes/drains call settlement even when an assertion fails. Production capture behavior is unchanged by this test follow-up.

The contributor history is preserved, and current main 3059d8a4 was merged before the repeat verification. All 10 focused tests, strict static checks, and discovery of all 728 test files passed. The updated branch was pushed with the reviewed SHA lease; final-head CI must pass before merging.

@N0zoM1z0
N0zoM1z0 merged commit 3cd80cb into morluto:main Oct 10, 2026
23 checks passed
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Merged as 3cd80cbb88708229ad39105522ad2814e1c09c4b after all 23 checks succeeded on final reviewed head 97639b5f502646ad3fa31870df224d74e9969642, with no outstanding change requests or unresolved review threads. The contributor author/history is preserved and maintenance identities use verified GitHub no-reply email.

All ten merged changed-file blobs match the reviewed head. The actual 84-byte sparse-child public CLI and production SDK stdio MCP workflow passed again on merged main: live progress, no-token silence, complete Evidence/text-structured parity, unchanged input digest, raw output, owned process/temporary-root cleanup and subsequent ping. Runtime scope remains Linux PTY.

The completed owned worktree and its generated outputs were removed normally after verification. Branches, reproduction inputs/results and failed diagnosis receipts remain available; shared dependencies and other workspaces were preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(process): expose bounded live capture progress through CLI and MCP

4 participants