Skip to content

land: bash-watch-each-line - #911

Merged
ualtinok merged 15 commits into
mainfrom
land/bash-watch-each-line
Oct 28, 2026
Merged

ualtinok merged 15 commits into
mainfrom
land/bash-watch-each-line

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; all four previous findings are addressed and no new actionable issue was established.

Summary

Adds deliver: "each_line" for background bash_watch notifications.

  • Background watches can deliver matching output lines in batches.
  • OpenCode and Pi deliver batched watch matches and track their progress.
  • bash_status can read masked output a byte page at a time.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Task output] --> B[Scan complete lines]
  B --> C[Build bounded batch]
  C --> D[Mask retained rows]
  D --> E[Save pending batch]
  E --> F[Show unseen rows and counts]
  F --> G[Acknowledge exact version]
  E --> H[Replay after reconnect]
  H --> F
Loading

Reviews (2) · Last reviewed commit: "mason: fix bash_watch each_line review f..." · Reviewed by Greptile

Comment thread crates/aft/src/bash_background/watches.rs Outdated
Comment thread packages/pi-plugin/src/bg-notifications.ts
Comment thread crates/aft/src/bash_background/registry.rs Outdated
Comment thread crates/aft/src/bash_background/registry.rs
@ualtinok
ualtinok force-pushed the land/bash-watch-each-line branch from 8c58df5 to 4505694 Compare October 27, 2026 06:07
@ualtinok
ualtinok added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
@ualtinok
ualtinok force-pushed the land/bash-watch-each-line branch from 4505694 to 0d0e881 Compare October 27, 2026 11:38
@ualtinok
ualtinok added this pull request to the merge queue Oct 27, 2026
@ualtinok
ualtinok removed this pull request from the merge queue due to a manual request Oct 27, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 27, 2026
@ualtinok
ualtinok removed this pull request from the merge queue due to a manual request Oct 27, 2026
ualtinok and others added 15 commits October 28, 2026 00:28
Keep default first-match frames byte-identical. Add opt-in line batches, source cursors, duplicate counts, bounded pending snapshots, rate limits, and immediate one-line terminal drop summaries. Expose the existing byte cursors through both hosts with masked page rendering so drop recovery calls are actionable. Argument names are pending Ufuk's pre-merge approval.

Persist the new mode and pending batches in schema 19. The v18 additive-index test now exercises ensure_additive_indexes directly: ordinary open intentionally advances to schema 19. A separate v18-to-v19 test verifies column defaults and the reader floor, preserving rather than reversing the old additive-index claim.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…751)

Keep approved wording and default push bytes unchanged. Preserve real terminal identities, persist transport-only generation/version metadata, and serialize/coalesce standalone V2 watches using bounded durable snapshots. SubC V2 uses the same admitted-row/counter watermarks and retires them on exact ack or durable absence.

V1 and Pi acknowledge exact watch versions. V1's existing uncertain prompt-admission recovery remains unchanged because its host API can leave admission unproven; V2 has confirmed synthetic admission and can watermark precisely. Add failing-first consumer regressions and collision, partial-flush, lost-ack, restart and SubC stale-ack coverage.

The watch migration follows main's stored tool-result reply migration 19 as migration 20; upstream migrations are unchanged. Schemas are regenerated byte-identically, and the release fragment uses bash-watch-each-line.md. Final landing gates and deliberate-break proofs are recorded separately.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
A once watch now stays armed through an incomplete-scan warning and only a
proven match consumes it. A matching line too long to check for secrets is
withheld and counted unavailable instead of shown as a secret placeholder.
Masking chunks align to UTF-8 boundaries so a character split across chunks
renders once, and an unavailable line counts once per source line. Plugins no
longer repeat admitted rows or counters after a failed acknowledgement. The
tool-provider catalog goldens are regenerated for the deliver argument.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Main owns migration 20 (rich_ui::SCHEMA_VERSION); the rebased
bash-watch each_line/match_batch step becomes 21 with CURRENT_SCHEMA_VERSION 21.
The v21 test builds a v20 database so only the new step runs.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Pi bash_status paging params use the canonical camelCase names
(outputOffset/stderrOffset); deliver description no longer names the
disableable bash_status companion; v1/pi captures regenerated; v2
deleted-session drain test asserts the matches-shape ack contract.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…in host test

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok force-pushed the land/bash-watch-each-line branch from f2f5e0b to d81aa7f Compare October 27, 2026 23:51
@ualtinok
ualtinok added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 6fe3219 Oct 28, 2026
91 checks passed
@ualtinok
ualtinok deleted the land/bash-watch-each-line branch October 28, 2026 01:04
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 28, 2026
Each-line batches (cortexkit#911) render every matching line on their own path, so
they get the same rules as single watch matches:

- A substring watch's pattern stays visible in its rows. When masking
  hid it as part of a credential, the row shows the pattern once in place
  and keeps the rest of the credential behind placeholders. The row is
  built only from the masked text, its placeholders and the pattern, so
  no other raw byte can reach it.
- A row withheld after a daemon restart because the task's secret values
  are gone names the output file the line is in, like a single watch
  preview, instead of pointing at bash_status.

UnavailablePreview now marks the restart case so watch renderers can
show that notice; bash_status pages keep their existing text.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit d8ff8664c6092374a8b4283b4b68206bae16dd1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant