Skip to content

fix: tell a blocked child's parent at once and raise its root after a grace - #2443

Merged
yansfil merged 3 commits into
mainfrom
fix/blocked-parent-first
Nov 11, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/blocked-parent-first

Conversation

@yansfil

@yansfil yansfil commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Related: with-hide/hide-private#860 (Delegated escalation in docs/task-identity.md)

Summary

When a delegated child stopped at a blocked prompt, its root went straight to the operator's Needs You, and its parent only heard on a later watch tick.
Now the parent is told at once: one hide:blocked note (a progress letter sent --now) per block, naming the pane to read and how to answer.
The root enters Needs You for that child only once the same block has lasted 60 seconds, timed from the block's start; a person's turn still rises at once and every other cause keeps its clock.
The watch's own early warning for a blocked child is removed, since the note replaces it; the warning for a child stopped on its own question stays.

No screenshot: the only site/ change is two sentences of user-doc text; no screen's layout or controls change.

Review

  • Decide: the lead accepted these limits as known, not blockers: an asleep parent is not woken (the note waits in its mailbox, progress wakes no one).
  • Decide: a note to a parent Hide cannot address, or one that fails to send, is logged and not retried; the grace still runs and the operator gets the child at its end.
  • Decide: a daemon restart forgets the block's start, so the grace starts again and the parent can get one repeated note; a device reconnect is not this case and keeps both (tested).
  • Risky files: hide-core/src/runtime/session_state.rs - runs under Mutex<Runtime>: lays each blocked row's start before escalation and adds the grace end to the one projection deadline.
  • Risky files: hide-core/src/runtime/blocked_children.rs - new owner of the block's start and the owed note; restore (seq 0, unknown) must not end a block.
  • Risky files: hide-core/src/delivery/watch.rs, delivery/worker.rs - the blocked early warning is deleted, the question warning must still fire.
  • Cost: per projection pass, one map lookup per agent row (no allocation for unblocked rows); the maps are bounded by the current rows and pruned each pass.
  • Cost: per coordinator tick (250 ms) one empty-map check; a note is decided under the lock and sent on its own thread, at most one in flight; no new timer, the grace end joins the existing projection deadline.

Tests

  • Layer: unit (agent_state::escalation, runtime::blocked_children) and runtime (runtime::tests::blocked_children, runtime::tests::lineage), driving the real projection and tick.
  • Layer: a_blocked_childs_note_lands_in_its_parents_mailbox_once_per_block runs the real delivery store and reads the saved letter: from hide:blocked, --now, one per block, a new one for the next block.
  • Catches: planted "grace 0" failed both new escalation tests, all three runtime tests and a_blocked_grandchild_raises_its_lineage_root_once_and_never_itself.
  • Catches: planted "hide:blocked missing from the code-owned authority" failed the mailbox test (caller_identity_changed); the first head had that bug.
  • Catches: planted "a restore ends the block" failed a_restore_keeps_the_block_and_only_another_known_session_replaces_it and a_device_childs_block_keeps_its_start_and_its_note_through_a_reconnect.
  • Repeat: repeat.yml takes only tests/it modules; locally nextest -p hide-core --retries 0 -E 'test(blocked_children) | test(escalation) | test(lineage)' 20 runs x 108 tests, all green.
  • Waits: the mailbox test waits (existing wait_for, 10 s cap) for the note thread to end and for the clock to pass the first block's start, so the second block has its own key.

Evidence

  • Verified: verify-cargo.sh nextest -p hide-core filtered 997/997 and 272/272, hided filtered 196/196, clippy hide-core all targets, cargo fmt --all --check.
  • Verified: a real note saved in the parent's mailbox through the delivery store, from hide:blocked with immediate set.
  • Verified: the grace boundary to the millisecond (no raise at end - 1, raise at end), the ask's time equal to the block's start, one note per block.
  • Not verified: a live check in a candidate app with a real agent held at a permission prompt; covered by the runtime tests only.
  • Not verified: the user-docs gate (node scripts/docs/check-all.mjs) and the full workspace suite ran only in CI, not locally.
Verification record

Base 6a63ca5edb, head 57b08aa20e. Approach review: PASS after a revised proposal (block start owned in memory by the core, not the row's last change time).
PR review round 1 on 2e3221170a: BLOCK, F1 the note's sender was not an admitted code-owned identity, so every note was refused (caller_identity_changed); F2 no repeat evidence. Both addressed in 57b08aa20e.

… grace

A delegated child held at a blocked prompt raised its lineage root the
moment it stopped, while its parent heard a watch tick later and behind
the mid-turn wait. The core now records when it first reads the block,
tells the parent at once with a --now note from hide:blocked, and
raises the root only once the same block has lasted 60 seconds. The
watch's blocked early warning is removed so blocked has one path.
delivery.md gains A blocked child (the note, who gets it, the grace,
when a block ends, the restart limit) and the watch's early warning
keeps questions only; status-model.md, ARCHITECTURE.md, the
performance ledger, the docs map and the user pages follow.
@yansfil
yansfil added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit a5e5b0a Nov 11, 2026
40 checks passed
@yansfil
yansfil deleted the fix/blocked-parent-first branch November 11, 2026 09:06
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 12, 2026
…ith-hide#2462)

Closes with-hide/hide-private#826
Related: with-hide#2443 and with-hide#2456; unblocks verification of with-hide#2460 and with-hide#2454.

## Summary

Native checks still assume an immediate blocked-child raise and the old
phone pause explanation.
Wait for the real raised request after the approved grace, and expect
the approved computer-use description.
Close Settings and wait for the presented frame before capturing the
raised pane in either theme.

## Review

- **Decide**: budgets account for with-hide#2443's approved grace; the grace
boundary remains covered by core tests.
- **Risky files**: `session-workflow.spec.ts` retains the real
blocked-child path and exact raised-label predicate.
- **Risky files**: `phone-push-settings.spec.ts` keeps the full copy
assertion against with-hide#2456 and `UI_BEHAVIOR.md`.

## Tests

- **Layer**: native e2e checks Korean task rows, pane bands, terminal
geometry and persisted phone pause settings.
- **Catches**: old main runs fail before the 60-second grace; the first
candidate reaches the unchanged UI assertions.
- **Catches**: the same CI exposed the obsolete pause explanation on
both attempts; its assertion remains exact.
- **Repeat**: grace candidate passes once without retry; final candidate
macOS validation is pending.
- **Waits**: snapshot guard allows the 60-second grace plus its existing
30-second label budget.
- **Waits**: test guard adds that grace to its existing 90-second
budget; Settings absence is asserted before capture.
- **Waits**: existing animation/compositor helpers wait for the
presented native frame; no custom delay is added.

## Evidence

- **Verified**: first candidate PR verify passes typecheck, lint, size
budgets and timed-wait policy.
- **Verified**: its macOS session workflow passes in 94.492 seconds on
the first attempt, with every assertion intact.
- **Verified**: its native artifacts expose a stale Settings frame in
the light capture, corrected by the new gate.
- **Not verified**: final candidate CI and fixed captures are pending;
local builds exceed the 2.4 GiB disk margin.
- **Not verified**: original pre-with-hide#2443 intermittency is not
independently diagnosed; direct delegation, no PRD run.

<details><summary>Verification record</summary>

Base `8ee63b8e5138fd6aae02d987fd4563458f842d1a`; final candidate
`b897729e73`.
Before: main run 43031426412 and with-hide#2460 run 43060583267 fail the
30-second raised-label wait on both attempts.
Grace candidate `0c50b38168`:
https://github.com/with-hide/hide/actions/runs/43065626764
Mac desktop:
https://github.com/with-hide/hide/actions/runs/43065619655/job/130679676966
Shard 1 passes 64 tests, skips one; shard 2 passes 65, skips ten and
fails only the old phone-pause copy.
The original reports, native windows and failure logs are preserved
locally.
Remaining unrelated jobs in that superseded nightly were cancelled
before final-candidate validation.
Self-review: product, snapshot, lifecycle and cleanup are unchanged;
state predicates remain exact and guards finite.

</details>
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