Repository navigation
feat(harness): pi wake binding for the neutral watchers; add the R10 bed watcher - #398
Conversation
…bed watcher Pi has no background-completion notification and no subagent, so a long wait — a validator verdict, a reviewer's BLOCK comment, a 40-minute R10 bed — was hand-polled or dropped. This adds the missing mechanism, neutral-first: - scripts/check-bed-watch.sh — a HARNESS-NEUTRAL R10 bed runner/reporter. It runs `charly check run` per bed, keeps the full log, and emits one `BED <bed> <class> rc=... ok=... log=... summary=...` line per bed; the process EXIT CODE is the honest signal (3 = prereq SKIP), never summary.yml alone. - .pi/extensions/watch.ts — the one pi-specific piece: it spawns the neutral marketplace/scripts/gh_watch.sh (GitHub) and scripts/check-bed-watch.sh (beds) and turns each event line into a user turn (`pi.sendUserMessage`). GitHub scopes come from .pi/watch.items (inert by default); beds are armed with the watch_arm tool. - scripts/lib/ts-syntax.mjs + a PARSE assertion in both pi gates — closes the class the live load caught: an unescaped backtick in charly-gates.ts's injected rules block left every regex gate green until pi failed to load the extension. - Gates wired: check-pi-watch.mjs (+ mutation self-test), check-harness-config.mjs, hooks/pre-commit, charly.yml. Closes #397. Assisted-by: Pi DeepSeek V4.1 Flash (analysed on a live system)
|
T4 sign-off requested. This change adds a guardrail gate ( Agent: |
Review — BLOCKHead SHA: Change class: harness config / tooling — a T3–T4 self-modifying-security change. It edits the pre-commit gate ( Blocks
Comment intake:
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
T4 sign-off GRANTED — @aitrawog (maintainer) approves landing PR #398 Agent: |
Review — PASSHead SHA: Security screen: PASS — the change STRENGTHENS the gates (adds Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
A pi session has no background-completion notification and no subagent, so a long
wait — a
charly/pr-validatorverdict, a reviewer's BLOCK comment, a 40-minute R10 bed —was either hand-polled (the R4 band-aid) or silently dropped. The sibling harnesses bind a
watcher (opencode's
pr-watch.ts+ctx.session.synthetic, reasonix'swatch-arm.shSessionStart hook); pi had nothing, and
.pi/APPEND_SYSTEM.md's "rungh_pr_status watchin a background subagent" was stale (there is no subagent).
This adds the missing mechanism, neutral-first:
scripts/check-bed-watch.sh(new, HARNESS-NEUTRAL) — the R10 bed runner/reporter. Itruns
charly check runper bed, keeps the full output in a log, and emits oneBED <bed> <class> rc=<n> ok=<..> total_seconds=<..> log=<path> summary=<path>line perbed. The process EXIT CODE is the honest signal (3 = prereq SKIP, per
/charly-check:check);summary.ymlalone cannot distinguish a pass from a skip. Anyharness (bash, Claude Code, Codex, CI) can call it; it contains no pi logic.
.pi/extensions/watch.ts(new) — the ONE pi-specific piece: it spawns the neutralmarketplace/scripts/gh_watch.sh(GitHub PRs/issues) andscripts/check-bed-watch.sh(beds) and turns each emitted line into a user turn via
pi.sendUserMessage(..., {deliverAs:"followUp"}). It contains no watching logic of itsown (no poll loop) — it delegates, wakes, re-arms the one-shot watcher on exit, treats a
rate limit (exit 7) as terminal, and kills its children in
session_shutdown. GitHubscopes come from
.pi/watch.items(comment-only, so INERT by default); a bed is armedwith the
watch_armtool (never auto-launched — running adisposable: truebed is adeliberate act).
scripts/lib/ts-syntax.mjs(new) + a PARSE assertion in both pi gates — closes anR1 class found live: an unescaped backtick in
charly-gates.ts's injected rules blockleft every regex gate green while pi failed to load the extension.
No marketplace PR, no layer PR, no gitlink bump: the bed watcher lives in this repo's
scripts/because its subject is this repo's.check/runs. If a non-umbrella consumerneeds it, it promotes to
marketplace/scripts/(R3, second occurrence).How tested
The change-class gate for a no-submodule-movement change is the committed umbrella hook
plus the changed paths executed live. Run on this head:
The new gate and its mutation self-test (every assertion proven to go RED):
The neutral bed watcher executed LIVE against the real
charlybinary:The neutral GitHub watcher the binding spawns emits its event and exits (real
ghAPI):The
watch_armtool runs live in a real pi session (all three project extensions load):R1 — the load failure the parse assertion closes, and its fix. BEFORE, a real pi load
rejected the extension; AFTER, it loads:
Not exercised end-to-end: an asynchronous wake actually arriving as a fresh turn (it needs
a live background event and a long-lived session). The tool, the neutral scripts, and the
delivery call were each run live; the timing is asserted statically.
Rulebook compliance
Applicable rules are answered;
N/Aalways carries a reason.git-workflow,agents, andcheckbefore the first tool call; the change follows their watcher/watch-and-wake discipline.charly-gates.ts); RCA'd to an unescaped backtick insidebuildRulesBlock()'s template literal, fixed, and the class closed by a new PARSE assertion (scripts/lib/ts-syntax.mjs) in both pi gates. Also fixed the stalegh_pr_status watch"background subagent" claim in.pi/APPEND_SYSTEM.md(no subagent exists) and the stale ledger status (.pi/landed as #390).marketplace/scripts/is named, not required (R3 first-occurrence rule).gh_watch.sh. The bed watcher is the FIRST implementation of its contract (no shell canonical exists to fork). The TS parse helper is extracted once intoscripts/lib/ts-syntax.mjsand imported by BOTH pi gates rather than copied.wait/timeout, not a poll loop..pi/APPEND_SYSTEM.mdno longer claims a background subagent; the ledger's stale status is corrected in the same commit.git statusclean before and after; PR-only; no force-push; committed in the session worktree onfeat/pi-auto-watchers; the commit hook ran (no--no-verify).charly, the GitHub watcher against the realghAPI, thewatch_armtool in a real pi session) with pasted output, and both new gates carry a mutation self-test.charly/gh/pi; nothing is mocked.summary.ymlis parsed as emitted, never re-generated.<root>/charly/bin/charlyand fails closed when it is absent.disposable: truetarget is touched by this change; the R10 bed path is exercised by running the neutral runner against the real binary (pasted above)..pi/at the umbrella root; the neutral bed watcher sits in the repo's ownscripts/.Change classification
Harness config / tooling (T3-T4: it adds a binding and a guardrail gate, and reverses
the earlier "no bespoke pi extension" decision recorded in
.pi/ledger/pi-config-catchup.md).No runtime product code and no disposable target changed, so the R10 gate is the umbrella
pre-commit (the committed change-class gate) plus the changed paths executed live, all
pasted above.
charly task verify(the pinning gate) is N/A — no submodule, gitlink, or pinis touched. Confidence tier: analysed on a live system — the changed paths ran live with
retained output, but the asynchronous wake delivery was not exercised end-to-end with a real
background event, so full validation is not claimed.
Closes #397.
Agent:
pi-auto-watchers· session01a1116b-e2ad-716f-99fc-926136bde99eAssisted-by: pi DeepSeek V4.1 Flash (analysed on a live system)