Skip to content

Factory가 pane을 닫으며 잠드는 Pi와 omp 작업자를 재우고 새 pane에 다시 묶지 못한다 - #873

Merged
yansfil merged 8 commits into
mainfrom
factory/857-factory-pane-pi-omp-pane
Oct 15, 2026
Merged

yansfil merged 8 commits into
mainfrom
factory/857-factory-pane-pi-omp-pane

Conversation

@yansfil

@yansfil yansfil commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

목표

The task you are doing when you want this

Software Factory에서 Pi나 omp를 작업자로 쓰고, Task를 일시정지했다가 다시 이어 갑니다.

What hide does today

Pi와 omp는 잠들 때 원래 pane을 닫고 core에 dormant 기록을 남긴 뒤, 깨어날 때 새 pane에서 같은 대화를 이어 갑니다.
Factory의 작업자 정체, probe, wake, watch, 편지는 원래 pane과 예전 sleep 기록만 봅니다.
그래서 Factory가 Pi나 omp 작업자를 재우면, 깨운 뒤 편지가 이미 닫힌 pane 앞으로 쌓이고, 내부에서 닫은 pane이 운영자가 닫은 것(PaneClosed)으로 읽힐 수 있습니다.
#826(Pi 세션 리더)과 OMP 세션 리더 PR의 리뷰에서 찾았고, Factory runtime에서 재현하지는 않았습니다.

OMP 세션 리더 PR은 이 문제를 막기 위해, pane을 닫으며 잠드는 dialect의 Factory sleep, stop, wake와 새 대화 fallback을 effect 전에 거부합니다.
그래서 지금은 Factory 일시정지 중에도 Pi와 omp 작업자의 pane이 그대로 떠 있습니다.
수동 Sleep과 Wake는 그대로 동작합니다.

What it should do instead

Factory가 Pi와 omp 작업자도 재우고 깨울 수 있습니다.
깨어난 새 pane에 작업자 정체, watch, 편지, coordination 기록이 다시 묶이고, 닫힌 pane 앞으로 편지가 쌓이지 않습니다.
Hide가 잠들면서 닫은 pane은 운영자가 닫은 것으로 읽히지 않습니다.
새 pane은 core의 dormant 기록으로 찾고, label, cwd, 이름, native session id로 추측하지 않습니다.
이 동작이 들어오면 OMP 세션 리더 PR이 넣은 거부 guard는 지워집니다.

Where the authority for it lives

Factory 정책(hide-factory)과 core의 agent sleep 기록, coordination, 편지 경로입니다.
pane을 닫고 새로 여는 것은 Herdr가 하지만, Herdr는 바뀌지 않습니다.

완료 조건

결정 기록

- 라벨로 들어온 Task입니다. 카드 초안을 확인해 주세요. -> confirm
- 완료 기준(criteria)이 비어 있습니다. 어떤 관찰 결과로 이 Task가 끝났다고 판단합니까? -> 기준 추가: (1) Factory 일시정지 시 Pi/omp pane이 닫히고 dormant 기록이 남는다, (2) 깨우면 새 pane에 작업자 정체·watch·편지·coordination이 묶인다, (3) 닫힌 pane 앞으로 편지가 쌓이지 않는다, (4) 내부에서 닫은 pane이 PaneClosed로 읽히지 않는다, (5) 새 pane을 dormant 기록으로만 찾는다(label/cwd/이름/session id 추측 없음), (6) OMP PR의 거부 guard가 삭제되고 수동 Sleep/Wake는 그대로 동작한다.
- 이 Task는 OMP 세션 리더 PR의 거부 guard를 지우는데, 그 PR이 main에 머지되어 있습니까? 아직이면 guard가 없어 삭제할 대상이 없습니다. -> OMP 세션 리더 PR(과 #826)이 머지된 뒤 시작합니다.
- 재현하지 못한 문제입니다. 실제 Factory runtime에서 Pi/omp 재우기·깨우기를 어떻게 검증합니까? -> fake dialect로 core 단위/통합 테스트를 쓰고, 가능하면 실제 Pi나 omp로 Factory 일시정지→재개를 한 번 확인해 증거를 agents/runs/ 아래에 남깁니다.
- 환경 문제: 디스크 여유 공간이 약 4.7GB로 기준보다 작아 보류 상태이며, 최근 실패나 중단은 없음.. 복구 동작 remove_finished_worktrees을 실행할까요? -> approve
- done: Factory can now sleep and wake Pi, omp and Grok workers (the close-pane dialects). The core binds the Factory worker to the dormant sleep record, so Hide's own close of the pane is not read as an operator close (no PaneClosed pause, no gone-restart). On wake the pane is found only through that record (kept as a Woken phase until bound), the old registration ends, the Factory parent and the new pane are registered, the watch restarts, held letters follow to the new pane, and the engine rebinds the Task worker (worker.rebound); a wake the core cannot finish stops the Task once. Factory sleep now follows the sleep the adapter declares, and the #865 rejection guard (agent_cannot_sleep / worker_dormant refusals for Pi/omp/Grok) is deleted. Docs updated: factory.md, ARCHITECTURE.md, status-model.md. Verified: full workspace tests (1849 core lib, 172 factory it), clippy and fmt clean, attribution and workstation-identity gates. Not verified live against a real Pi/omp/Grok pane.

Closes #857

yansfil added a commit that referenced this pull request Oct 9, 2026
…output cap (#891)

## Summary

CI가 초록인데 Factory Task가 `검증 중`에서 끝나지 않던 원인을 고칩니다 (운영 Factory의 T-1 #872,
T-2 #873).
check-runs 읽기가 run 전체(하나에 약 3.5 KB)를 받았고, node는 명령 출력을 64 KiB까지만 남깁니다.
check run이 20개인 PR은 답이 약 71 KB라 잘렸고, 잘린 JSON은 파싱에 실패했습니다. CI poll은 신호 없는
오류를 `pending`으로 읽었고, 2초 tick마다 다시 물었습니다.

- 읽기는 `gh api --paginate ... --jq '.check_runs[] | {name, status,
conclusion, html_url}'`로 run마다 한 줄(약 180 B)만 받습니다.
- 결정을 못 낸 읽기는 오류를 포함해 30초 간격으로만 다시 묻습니다.
- 읽지 못한 답은 새 poll 결과 `Unread`입니다. 아무것도 결정하지 않고 실패로 세지 않으며, 한 run에서 세 번째면
Task에 notice를 남깁니다.
- restart가 검증을 다시 시작할 때 앞에 남은 미완료 attempt를 `cancelled`로 닫습니다 (T-2처럼
`running`이 둘 남은 기록).
- 작은 결함: `hide factory config`의 답에 `settable`(`disk_floor_gb` 같이
`--set`이 받는 키와 단위)을 더하고, 모르는 키는 그 키와 받는 키 전체를 말하며 거절합니다.

```
commit fc92b0a (#873)  전체 답 71100 B -> 투영 3507 B, 20줄, verify completed/success
commit dd0c5c5 (#872)  전체 답 70760 B -> 투영 3507 B, 20줄, verify completed/success
```

## Review

- **판단해 주세요**: 읽지 못한 답이 세 번이면 notice(확인만). Task를 멈추지 않는 것이 맞는지. 다시 읽히면
그대로 끝납니다.
- **판단해 주세요**: config 답은 저장 레코드(`config`, ms/bytes)를 그대로 두고 `settable`을
덧붙였습니다. web 설정 화면이 `config.disk_floor_bytes`를 읽어 이름을 바꾸지 않았습니다.
- **조심해서 볼 파일**: `hide-factory/src/project.rs` - failure path. 오류도
`ci_pending` 간격을 타므로 main check의 오류 다음 30초는 `Pending`으로 답합니다.
- **조심해서 볼 파일**: `hide-node-link/src/factory.rs` - node가 만드는 `gh` 명령 줄.
이전 node가 답한 전체 JSON 한 줄은 run이 아니어서 `Unread`로 읽힙니다 (잘못된 pass가 아님).
- **비용 검토**: tick당 일이 줄었습니다. 막힌 Task 하나가 2초마다 71 KB를 받던 것이 30초마다 3.5
KB입니다. run이 100개를 넘으면 한 읽기에 page가 늘어납니다.

## Evidence

- **확인한 것**: 운영 기록(읽기 전용)에서 두 Task가 `verify.started` 뒤 `verify.finished`
없이 7시간, 두 PR의 required `verify`는 success.
- **확인한 것**: 실제 `gh`로 위 두 commit의 전체 답이 64 KiB를 넘고, 새 명령의 답은 3507 B로
`verify` success를 담는 것.
- **확인한 것**:
`github::a_commit_with_many_check_runs_passes_on_its_named_check` -
node의 64 KiB 자르기를 흉내 낸 fake gh에서 3.5 KB run 20개가 `Passed`.
- **확인한 것**:
`engine::an_unread_verification_answer_is_asked_again_and_told_to_a_person`,
`engine::a_task_stuck_verifying_with_two_unfinished_attempts_concludes_after_a_restart`,
`github::an_unreadable_check_answer_is_unread_and_asked_again_at_its_pace`,
`engine::config_prints_each_setting_under_the_key_set_takes_and_names_a_refused_key`.
- **확인한 것**: `verify-cargo.sh lint`, `hakari`, workspace nextest,
`scripts/tests` 319개, `check-core-touches-no-machine`,
`check-no-attribution`, `check-no-workstation-identity` 통과.
- **확인하지 못한 것**: 격리 HOME과 Herdr, 연습 저장소로 Factory 전체를 돌린 live check는 하지
않았습니다. check run 20개 이상인 연습 GitHub 저장소가 없어서, 실제 `gh` 답과 fake 경로로 나눠
확인했습니다.
- **확인하지 못한 것**: 운영 T-1, T-2는 이 build가 설치되어 hided가 다시 시작해야 끝납니다
(restart가 검증을 다시 시작하고 새 읽기가 `Passed`). 설치는 하지 않았습니다.
- **확인하지 못한 것**: `contracts/hide-cli.json`에는 factory 명령이 없어 바꿀 것이 없었습니다.
- **후속**: 같은 64 KiB 자르기는 다른 읽기에도 걸립니다. JSON 읽기(`LabelledIssues` 200개 본문
등)는 `external.failed`로 드러나지만, `git diff --name-only`(risk path)는 잘려도
조용합니다. 이슈로 따로 남기는 게 좋겠습니다.
@yansfil
yansfil force-pushed the factory/857-factory-pane-pi-omp-pane branch from fc92b0a to 9919849 Compare October 9, 2026 18:15
…resh pane keeps its identity, watch and letters

The dormant record now carries the Factory's worker, Hide's own close of the pane is not read as an operator close, and the woken pane is found only through the record and registered under the Factory again. Factory sleep follows the sleep the adapter declares, so the rejection guard is removed.
…re it, and drop the tests that assumed a sleepless agent
…ne, leaving Grok, OpenCode and Cursor working through a pause
…s in a fresh pane, and gate Factory sleep by the agents it sleeps
@yansfil
yansfil force-pushed the factory/857-factory-pane-pi-omp-pane branch from 60e3dce to 4f61eb3 Compare October 12, 2026 10:26
@yansfil
yansfil merged commit ab756b1 into main Oct 15, 2026
21 checks passed
@yansfil
yansfil deleted the factory/857-factory-pane-pi-omp-pane branch October 15, 2026 18:01
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 12, 2026
…-hide#2456)

## Summary

Leaving Hide open all day no longer keeps the phone silent.
Phone pushes rest during computer use while a desktop Needs You
notification is available.
After ten idle minutes, lock, sleep or disconnect, still-waiting
questions reach each phone once.

Korean Notifications settings: review the switch and both explanation
lines across the full panel width.
![Korean Notifications settings,
Light](https://github.com/yansfil/pr-assets/blob/main/hide/feat-phone-push-while-in-use/206f0af/phone-rest-ko-light-panel.png?raw=true)

## Review

- **Decide**: The operator approved the copy; review the final
Light/Dark captures before merge.
- **Risky files**: `hided/src/mobile/`,
`hide-core/src/agent_state/turn.rs`: per-phone consumption and
withdrawal.
- **Risky files**: `desktop/src/main/computerUse.ts`,
`hided/src/server.rs`, wire schema: host observations and disconnect
cleanup.
- **Known limit**: On re-entry with only older read declarations
retained, a single push can name another current declaration instead of
the row lead; no missing/duplicate push was observed
([follow-up](with-hide/hide-private#873)).
- **Cost**: One host timer; transition-only messages; at most four phone
watermarks per current root. Details below.

## Tests

- **Layer**: Stood-in powerMonitor; shared follower judge/settle with
real encrypted loopback HTTP pushes.
- **Layer**: Candidate desktop settings/reload and paired browser flows
exercise host, served copy and phone together.
- **Catches**: Away releases nine waits once; answered/withdrawn roots
send none; all desktop notices off permits pushes.
- **Catches**: B/C cancellation preserves current unsent asks, per
phone, through settling and overlapping HTTP sends.
- **Catches**: Before-fix and planted-boundary failures reproduce lost
B, repeated B and premature C. Details below.
- **Repeat**: 156 focused Rust tests ×3; 3 host tests ×3; 7 web units
×3; 4 e2e flows ×3, all passed.
- **Waits**: Explicit clocks, worker fences, HTTP responses, UI
assertions and compositor frames; no fixed sleep.

## Evidence

- **Verified**: Loopback push counts/payloads, host/bridge units, scoped
static checks and fresh candidate builds.
- **Verified**: Isolated Korean Light/Dark native captures, persistent
switch and desktop attach bridge.
- **Not verified**: Physical idle/lock/suspend on macOS, Windows or
Linux; unsupported Wayland gap is in `INSTALL.md`.
- **Not verified**: Production relay/APNs or a physical phone; reconnect
test covers the app hold/flush boundary.
- **Not verified**: Native CPU/RSS and system-event-to-phone latency;
cost statements are source-derived bounds.
- **Not verified**: Direct delegation with no PRD run; captures uploaded
using `screenshots --no-run`.
- **Not verified**: Root cause of an earlier settings fixture startup
failure; final settings repeats passed 3/3 (details below).

<details><summary>Dark settings capture</summary>

![Korean Notifications settings,
Dark](https://github.com/yansfil/pr-assets/blob/main/hide/feat-phone-push-while-in-use/206f0af/phone-rest-ko-dark-panel.png?raw=true)

</details>

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

- Candidate: `206f0af8b84db464394fd9f02623bbe82d5aa0b8`; the private
candidate CLI reports that commit.
- CI: [required verify workflow
passed](https://github.com/with-hide/hide/actions/runs/43054543367),
including Rust workspace, Windows checks, Linux/Windows web e2e and
Windows desktop e2e.
- [Changed-web repeat job
passed](https://github.com/with-hide/hide/actions/runs/43054543367/job/130640926206);
[design contract
passed](https://github.com/with-hide/hide/actions/runs/43054543164).
- Independent review of `0f7a26c7d9..206f0af`: PASS; prior serious
B/C and ordinary wait annotation findings closed. A supplemental review
retained PASS with one minor subject-selection limit, recorded in Review
and follow-up with-hide#873. This was source/log review, without an independent
test run.
- Local Rust: 156 focused core/daemon tests passed three times; scoped
Clippy including tests and formatting passed.
- Host: 3 powerMonitor tests passed three times; web
reconnect/notification bridge: 7 tests passed three times.
- Both frontend typechecks/lints, design contract and timed-wait policy
passed.
- Candidate desktop settings/reload and attach/bridge flows each passed
three repeats (6 total); private candidate exited and its state folder
was removed.
- Final candidate mobile settings and paired
list/detail/reply/quick-key/push/revoke flows each passed three repeats
(6 total).
- An earlier settings run passed twice and failed once during fixture
agent startup, before opening settings.
The failure was `agent_start.not_saved` at the existing operation-save
deadline, outside the notification paths.
Its first-failure log and run details were preserved locally; the final
committed candidate passed all three settings repeats without a retry.
- Caller-observed HTTP cases cover all nine current waits, answered
roots, list disappearance grace and queued withdrawal.
The next delivered payload retains pending clears; activity/disconnect,
Needs You switches and Always mode gate delivery.
- After delivered A, separate and coalesced B/C settles cover B
retained/C cancelled, C retained/B cancelled, both cancelled and root
end.
  Two phones with different consumed boundaries remain independent.
Settled B is delivered before pending C, and a B HTTP completion after C
admission consumes only its captured boundary.
- Additional actual-projection/HTTP probe: Seen with retained A/B, then
Needs You with no new declaration, sends once with B while the row leads
A; adding C on entry sends C once. Repeated away passes send nothing
further. The temporary probe was removed without changing the candidate.
- Before-fix HTTP failures reproduce the lost-B matrix and
cancelled-newest coalescing case.
Removing old-job consumption repeats B after cancelled C; reading past
the settled boundary delivers pending C prematurely.
Both mutations failed their predicted HTTP assertions, then the restored
implementation passed the repeated scoped tests.
Earlier host/bridge/mode/withdrawal/reconnect mutations also failed
their predicted tests.
- Cost per host: one one-second timer, at most two OS reads per tick,
four event subscriptions, no per-input work.
Only a transition or connection replay sends one IPC and one typed
desktop frame per attached window.
There is no runtime dispatch, blocking I/O or added work under
`Mutex<Runtime>`.
- Activity and demand sets follow the existing eight-client admission
bound.
Existing current-root entries retain at most four phone consumed
watermarks/rested bits and one root-lifetime scalar.
Each changed ledger pass adds one counter increment and one previous-age
lookup per current declaration ID.
The ledger maps its existing current/grace declaration IDs to
observation order, with no additional set or history.
Existing projection/grace root state has no separate count cap; this
change adds fixed scalars to those existing entries.
Settling retains one covered boundary per standing root and keeps the
existing 64-root pending cap/three-second deadline.
- Ordinary follower passes test one debt bit; away scans existing roots
and current declarations, rebuilding at most four jobs per root.
Jobs use the existing blocking workers, capturing root lifetime and
settled boundary before transport.
No new root set, payload queue, worker or timer is introduced in hided.
- Close, follower reset/end, phone revocation/inactivity expiry and
scope change withdraw responsibility.
Host quit/disconnect releases timer/listeners/demand; relay-only holds
retain eight payloads per phone and sixty-second expiry.
- Unsupported idle sources remain in use while a desktop window is
attached; suspend still reports away.
The system support table records Linux lock polling, the Wayland
limitation and what closes it.
- Existing `app_closed`/legacy `off` spellings remain compatible; the
timeout is one named constant, without a new setting.
- Engineering principles 1, 7, 11, 12, 13, 14 and 15: remove the old
rule, reuse owners, model consumption, test outcomes and bound state.
Design principles 5 and 12: retain the settings pattern and capture
Korean wrapping/legibility in both themes.
- Full suites run in CI; local Rust/WASM checks use the shared cargo
slot and scoped verification entrypoints.

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

Factory가 pane을 닫으며 잠드는 Pi와 omp 작업자를 재우고 새 pane에 다시 묶지 못한다

1 participant