Repository navigation
Route background AI requests through an owned provider boundary - #42
Merged
Merged
Conversation
hide-ai owns provider lifecycle, availability, timeouts, cancellation, structured errors and duplicate suppression for Hide's background AI features; a feature owns its prompt, output schema and parser and gets a schema-validated JSON value back. CodexAppServerBackend drives one codex app-server child over stdio with ephemeral read-only threads, the feature prompt as baseInstructions, the feature schema as outputSchema and the request id as clientUserMessageId. Tool-loading features are disabled at spawn, which is the only lever the CLI offers; the remainder of its harness cannot be removed. Cancellation and deadline expiry interrupt the turn and keep the child. The Claude Code interactive path has a stable submit and completion contract through Herdr but no structured-result or isolation contract, so ClaudeInteractiveBackend reports Unsupported with the gap and the router never selects it. The router uses the only connected provider or the configured priority, falls back only on ProviderUnavailable, NotAuthenticated, UsageLimited and Unsupported, never after a timeout, and logs every fallback.
The plugin lives at plugins/agent-context-labels as a workspace member under the id hide.agent-context-labels. The feature now owns its prompt, output schema and parser in context_label.rs and submits requests to the hide-ai router; the watcher keeps only its in-flight set and decides per outcome whether a turn is parked or abandoned. Retries, backoff, cooldown and the daily request counter are gone from the plugin because the router owns them. OpenRouter is removed in the same change: the client, the env key, the model constant, the transport error mapping, the ureq dependency, the start-watcher key scraping and every documentation mention. Summaries come from the user's logged-in Codex CLI through codex app-server; Claude Code is registered and reported as unsupported. A state or config directory left under the previous id is moved to the new id once on the next start and reported in the log. Scripts resolve the binary from the workspace target directory, and verify-provider replaces verify-live-provider with an explicit provider argument.
The rust lane runs fmt, clippy and tests across the workspace instead of the core manifest alone, so the hide-ai crate and the context-label plugin are gated the same way. CONTRIBUTING lists the widened commands. docs/AI_PROVIDERS.md becomes the owning guide for background AI requests: the ownership split between a feature and the provider layer, the provider rules, selection and fallback, the retry policy, what a log line may carry, how to verify a provider, and the gap that keeps the Claude backend unsupported. AGENTS.md and docs/README.md route to it and to the plugin.
The startup log line and verify-provider showed only the class, which hid why codex was unavailable behind a one-word state. The reason is the provider layer's diagnostic string and carries no content.
… migration to watch Review fixes on the provider boundary and its first consumer. Migration of state left under the previous plugin id now runs only when the watcher starts, after argument parsing: verify-provider, analyze-stdin, hook, request-refresh, the settings actions, --help and an invalid invocation leave the old directory where it is. A binary test drives each command against a temporary home to prove it. The router hands back an AiResult that names the provider which answered, so a fallback is visible to the caller and in the plugin's analysis_updated line, not only in the router's own log. The in-flight duplicate entry is owned by a guard: a leader that panics still wakes every joiner with an explicit internal error and frees the key. The plugin's analysis thread catches its own panic and reports it as an abandoned turn, so a pane is never left in flight. A request whose completion is unknown is spent. The codex backend types the boundary at the turn/start write: a child lost before it is a refusal (provider unavailable), a lost or unanswered turn/start and anything after it is completion-unknown. The router retries neither a timeout nor a completion-unknown outcome on any provider; only refusals are retried or moved. Control-request failures are typed as rejected, unanswered or gone instead of being read back out of a string. max_output_tokens is gone from the request: no provider contract honours it, and the prompt and schema are what bound the answer.
The diagnostic command builds the full router and runs one request, so it is the one non-watch path that touches the most state; it now sits in the same temporary-home case list as the others and must leave the previous id's directory untouched and log no migration.
1 task
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…estart flow (#489) Related: #417 ## Summary `sidebar-pr-start` 가 Linux CI에서 같은 SHA의 통과와 실패를 오갔고, 실패 자리는 매번 병합된 PR(#43)의 glyph였다. spec이 Inactive 접힘 행을 클릭해 연 뒤 glyph를 찾았는데, 실패 시점의 화면은 접힘 행이 닫힌 채였다. 이 spec이 증명하는 것은 "화면이 묻지 않아도 사이드바가 PR을 그린다"이지 접힘 토글이 아니므로, 클릭을 없애고 첫 재시작이 읽는 core-state에 펼침 상태를 미리 넣는다. `@flaky` 태그와 issue annotation을 지운다. 클릭 연결은 `web/src/inactiveFold.test.tsx`(클릭이 프로젝트 경로를 담은 `inactive_checkouts_toggle` 한 건을 보내고, 접힘 행이 core가 돌려준 `expanded`를 그린다)가 지킨다. #417은 main 연속 2회 녹색 뒤에 닫는다(원인 미확인). ## Review - **판단해 주세요**: 원인을 찾지 못한 채 상호작용을 설정으로 바꿨다. TESTING.md는 "클릭 수를 바꿔서 통과시키지 않는다"고 하므로, 이것을 "준비 단계의 클릭을 상태 준비로 옮긴 것"으로 볼지 판단이 필요하다. - **조심해서 볼 파일**: `web/e2e/sidebar-pr-start.spec.ts` - 시드 키는 core가 `workspace.path`와 정확히 비교하므로 `toPage`를 거친다. ## Evidence - **확인한 것**: 같은 spec을 retry 0으로 로컬 macOS에서 반복 실행했다. 이 PR의 변경: 30/30 통과(CPU `yes` 4개 + workers 4, 머신 load average 10-13). 비교로 현재 main spec 54/54, 실패 당시 SHA(33b7342)의 옛 spec 30/30, 느린 git 래퍼(0.7초) 8/8. - **확인한 것**: 접힘 행 생성 시점을 page에서 10ms 간격으로 관찰했다. 재시작 직후 charlie 행은 먼저 일반 행으로 보이고, worktree reader의 git 답이 온 시점(git 지연에 비례해 1초-6초 뒤)에 Inactive 접힘으로 옮겨진다. 접힘 행이 나타난 같은 프레임에 클릭해도 12/12 즉시 펼쳐졌다. - **확인하지 못한 것**: CI 실패의 원인. 로컬에서 실패가 재현되지 않았고, CI artifact에는 wire trace가 없어서 토글이 core에서 거부됐는지(`inactive_checkouts.unavailable`) 확인하지 못했다. 이 수정이 Linux CI에서 실제로 막는지는 CI 반복 실행으로만 알 수 있다. - **확인한 것**: 새 단위 테스트는 `actions.ts`의 payload 키를 바꾸면 실패한다(변이 확인). web lint와 typecheck 통과. - **확인하지 못한 것**: Linux와 Windows에서는 실행하지 않았다. <details><summary>추가 증거</summary> 실패 시점 aria snapshot: `charlie` 프로젝트 안에 `main, now`와 `Inactive 1`(접힘)만 있고 alpha/bravo는 `Open pull request #41/#42`가 그려져 있다. hided 로그에는 세 저장소의 `pull_requests.ok`가 모두 있다. </details>
yansfil
added a commit
that referenced
this pull request
Oct 22, 2026
…ull request wakes (#1524) ## Summary 여러 이슈를 한 에이전트(Conductor)에게 맡기면, 그 에이전트가 계획을 세우고 작업자 에이전트를 나눠 띄우고 PR까지 끌고 가는 기능입니다. Hide는 그 진행을 "미션"으로 기록하고, 오른쪽 보기 칸에 미션 지도를 그리며, 동시에 도는 작업자 수를 상한으로 막고, PR이 바뀌면 Conductor를 깨웁니다. - Conductor는 `hide-conductor` 스킬과 `hide mission help` 안내를 따르고, `hide mission` 명령으로 계획, 노드 상태, 결정할 일, 보고를 기록합니다. - 첫 계획이 들어오면 지도가 한 번 열리고, 사이드바의 Conductor 줄과 Overview 기록에 `미션 0/4` 칩이 붙어 다시 열 수 있습니다. - Settings › Conductor에서 동시 작업자 상한, 기본 범위, 작업자 후보(에이전트, 모델, effort, 용도)를 정합니다. - 상한을 넘는 작업자, 계획 승인 전의 작업자, 다른 기계를 겨냥한 작업자는 이유를 붙여 거절합니다.  ## Review - **판단해 주세요**: 작업자 수 상한은 Conductor가 띄우는 작업자에만 걸립니다. 작업자가 다시 띄우는 에이전트는 안내문으로만 막습니다(운영자의 "하네스는 가볍게" 결정을 따름). - **판단해 주세요**: 닫히거나 취소된 미션의 Conductor는 이후 일반 에이전트처럼 상한 없이 띄울 수 있습니다. 한 Conductor가 여는 미션은 한 번에 하나뿐이라, 다른 미션을 하는 중에 끝난 미션의 PR이 바뀌면 소식만 받고 그 미션은 끝난 채로 둡니다. 끝난 미션의 PR이 머지되면 아무도 깨우지 않습니다. - **판단해 주세요**: 미션 기록 파일을 읽지 못하면 아무것도 작업자를 세지 못합니다. 모든 띄우기를 막는 대신, 안내문이 Conductor에게 멈추고 운영자에게 알리라고 합니다. - **조심해서 볼 파일**: `herdr-core/src/runtime/missions.rs` - 모든 명령이 runtime mutex 안에서 한 번에 적용되고, PR 깨우기는 잠금 밖 스레드에서 보냅니다. 작업자 후보 밖의 띄우기(`mission_candidate_refused`)와 스택이 모두 머지된 `merge_wait` 미션의 자동 종료도 여기서 정합니다. - **조심해서 볼 파일**: `herdr-core/src/coordination/mod.rs` - 상한 검사가 ledger 예약과 같은 잠금 안에 있습니다. 10분 동안 진행이 없고 작업자도 없는 예약은 세지 않고, 그 예약을 다시 부르면 상한 안에서 자리를 다시 잡거나 거절합니다. 이어받기(`take`)는 미션의 작업자, 그 시작 기록, 감시를 새 Conductor에게 옮기며(`AdoptMissionWorkers`), take가 답하기 전에 delivery 큐에 넣어 새 Conductor의 다음 명령보다 먼저 들어갑니다. - **조심해서 볼 파일**: `herdr-core/src/node_migration.rs`, `reown.rs` - core를 다른 기계로 옮길 때 `missions.json`도 함께 옮기고 기계, 프로젝트, pane id를 바꿉니다. - **조심해서 볼 파일**: `herdr-core/src/persistence.rs` - Settings › Conductor를 값으로 저장해서, 이 빌드가 못 읽는 값이 나머지 UI 상태를 지우지 않습니다. - **비용 검토**: 새 상시 작업은 없습니다. 깨우기는 이미 있는 GitHub 읽기 결과를 비교할 뿐이고, 보내지 못한 깨우기는 미션당 32개까지 기록에 남습니다. 저장 크기는 시작 때 다시 읽을 수 있는 7 MiB 안으로 제한합니다. - **비용 검토**: snapshot을 읽을 때마다 lock 안에서 도는 미션 갱신은, 미션이 없으면 아무것도 하지 않고, 있으면 숫자 두 개, ledger 포인터 하나, 미션당 두 비트만 비교합니다. 미션 기록, PR 답, ledger, Conductor 유무, 기기 연결 중 하나가 바뀌었거나 만드는 중인 작업자가 상한에서 빠질 때만 지도를 다시 만들고, 닫힌 미션은 기록이나 PR이 바뀔 때만 다시 만듭니다. ## Evidence - **확인한 것**: 격리된 desktop 후보(dev 빌드, 고정 Herdr 0.9.5, 운영자 앱과 서버는 건드리지 않음)를 띄우고, 실제 `yansfil/gittest`에 쌓인 PR 두 개로 미션 하나를 끝까지 돌렸습니다(마지막 코드 d5b2140b4에서 #40, #41). 끝난 뒤 PR은 닫고 브랜치는 지웠습니다. - **확인한 것**: 그 실행에서 첫 계획이 지도를 열었고, 시작 전 작업자는 `mission_not_started`, 상한 2에서 세 번째는 `mission_cap_reached`, 다른 기계는 `mission_machine_refused`로 거절됐습니다. - **확인한 것**: 아래 PR에 push하자 `hide:conductor`가 보낸 깨우기 편지 한 통(`mission:mission-1:api:40:new_head:<head 12자>:1:<Conductor>`)이 Conductor 받은편지함에 들어왔습니다. - **확인한 것**: 같은 실행에서 결정 배너, Settings › Conductor, Conductor가 끝난 뒤의 이어받기 배너, 노드 상세, 사이드바 칩을 화면으로 봤습니다. - **확인한 것**: 마지막 코드 e99c204a2로 다시 돌린 격리 실행(gittest #42, #43)에서 실제로 이어받기를 했습니다. 첫 Conductor 프로세스를 끝내자 `Conductor 없음` 배너가 떴고, 새 pane이 `hide mission take`로 이어받자 배너가 사라졌습니다. 새 Conductor가 같은 노드 intent(`mission-1:api`)로 다시 띄우자 새 작업자가 아니라 기존 작업자(agent-3)가 돌아왔고, 그 작업자는 새 Conductor의 자식이 됐습니다. 작업자가 보낸 report 편지는 새 Conductor 받은편지함에 들어왔습니다. - **확인한 것**: 같은 실행에서 이어받은 뒤 쌓인 PR #43에 push하고 draft로 바꾸자, 지도의 PR 표시가 mergeable에서 draft로 바뀌었고 새 Conductor가 `PR #43 has a new commit` 깨우기를 받았습니다(지도 갱신 조건이 GitHub 답을 놓치지 않음). 끝난 뒤 PR은 닫고 브랜치는 지웠습니다. - **확인한 것**: web e2e `mission-map.spec.ts`가 실제 `hide mission` 명령으로 지도 열림, 다시 안 열림, 칩으로 다시 열기, 노드 상세, Settings 상한 저장을 확인합니다. - **확인한 것**: 코드 리뷰가 찾은 13건과 후속 리뷰의 1건(core 이동 뒤 기록을 못 읽는 문제)을 고쳤고, 그중 깨우기 유실, 설정 손상, 세션 누락은 고치기 전에 실패하는 테스트로 확인했습니다. - **확인하지 못한 것**: 후보 창이 비활성이라 macOS 창 캡처가 "could not create image from window"로 실패해, 화면은 renderer 캡처로 남겼습니다. - **확인하지 못한 것**: 기기 연결이 끊긴 지도(B20 흐림)는 gallery 장면으로만 봤고, 실제 기기 연결을 끊어 보지는 않았습니다. - **확인하지 못한 것**: Windows는 실행해 보지 않았습니다(`docs/INSTALL.md` 표에 이유와 닫을 방법을 적었습니다). Linux는 CI로만 확인합니다. - **확인하지 못한 것**: 저장 크기 초과로 되돌린 명령은 책만 되돌리고, 그 명령이 먼저 연 보기 칸과 보낸 깨우기는 되돌리지 않습니다(7 MiB 근처에서만 생김). - **확인하지 못한 것**: 작업자 후보 두 개를 아주 빠르게 연달아 고치면 뒤의 편집이 앞의 것을 덮을 수 있습니다(후보 목록은 통째로 보냄). - **확인하지 못한 것**: 미션 단위의 "뒤에서 열기" 확인(B7)은 없습니다. 후보 거절(B8), 스택 머지 후 자동 종료(B41), 원격 카탈로그의 이유 표시(B10), 늦게 돌아온 예약의 상한, 한 Conductor당 열린 미션 하나는 core 테스트로만 확인했고 live 실행에는 없습니다. <details><summary>추가 증거</summary>       </details> <details><summary>Verification record</summary> - PRD: software-factory-conductor (local contract; D-01..D-56, B1..B55) - Base `242aed346ac9`, head `e99c204a2` (verify report head) - `sasu implement verify`: PASS on e99c204: `scripts/verify-cargo.sh test` and `lint` green - Also run on the final code: `verify-web.sh web typecheck/lint/test` (1944 passed, 1 skipped), `web e2e mission-map.spec.ts` (1 passed), `web e2e settings-general.spec.ts` (3 passed), `verify-cargo.sh cli`, hide CLI contract tests, hakari, live isolated desktop spec on yansfil/gittest, rerun on d5b2140 (1 passed, 2.9 min), rerun with a real takeover on e99c204 (1 passed, 3.7 min) - Reviews: Fidelity and Code on f7981c2 (13 code findings, all fixed); follow-up Fidelity and Code on fb3785a (Fix now: null `workspace_id` after a core move, fixed in cc05c9a); short Code re-review of cc05c9a: nothing to fix; Observer-requested contract gaps (B8 candidates, B10 test, B41 self-close, resumed reservation cap, wake recipient) in 1d846b9, review found 2 Fix now (candidates per mission, already-merged stack) fixed in d5b2140, re-review: nothing to fix; independent review of a7fba00 (6 items: one open mission per Conductor, takeover handover, snapshot hot path, merge_wait settle, replan guard, wake kind) fixed in d33972c; follow-up review found 3 Fix now in the handover (unregistered heir, worker without parent, swallowed enqueue failure) fixed in e99c204; re-review: nothing to fix - Follow-up (not fixed): revert after `mission_full` keeps the opened slot and sent wakes; candidate edits send the whole list; a re-ask of a stuck start every <10 min keeps its slot; a self-closing mission still gets its last merged wake; no per-mission worker override (B3); an unknown kind is refused as a candidate before `agent_unknown`; the 200-newest PR window; skill re-write after one skill is deleted; reown key skip narrowing; mission chip found by pane id; a former Conductor's in-flight spawn racing a take can move workers back; a closed mission's node pane follows only on the next book or PR change; no runtime test of a take whose handover enqueue fails - Registered evidence (12): live run logs (fb3785a, d5b2140, e99c204 with takeover), 6 live renderer captures (node detail, decision, settings, takeover banner, taken over, after push and draft), mission-map e2e log, gallery stale capture, web lanes log </details>
yansfil
added a commit
that referenced
this pull request
Oct 30, 2026
## Summary 같은 세션이 태스크 줄, pane 머리, 세션 기록에서 서로 다른 PR 수를 보였습니다(한 Conductor가 기록 15개, 태스크 줄 3개). 화면마다 PR을 따로 모았고, 끝난 자식의 PR은 줄에서 빠졌으며, 닫힌 PR은 버려졌기 때문입니다. 이제 core가 세션마다 PR 목록 하나를 만들고(자기 것 + 살아 있거나 끝난 모든 자손의 것), 모든 화면이 그 목록만 읽습니다. merge된 PR은 모두, 닫힌 PR은 흐리게 남습니다. GitHub 목록(최근 200개) 밖의 PR은 기록의 마지막 상태로 stale 표시하며 남깁니다. 기록에서 merge된 PR 4개가 빠지던 원인도 고쳤습니다: 각 세션의 `gh pr create`가 주소를 GitHub 생성 시각보다 2.6~3.2초 먼저 찍었는데(두 시계 차이), 판정 창이 앞쪽 2초뿐이었습니다. 이제 PR을 만드는 호출(`gh pr create`, `gh api` POST `repos/o/n/pulls`, `create_pull_request` 도구)이 성공해 돌려준 주소는 GitHub 생성 시각 -10초~+30초 안이면 그 세션이 만든 PR입니다. 그 밖의 출력은 예전 창(-2초/+30초) 그대로입니다.  사이드바 줄: 리드의 목록에 끝난 자식(P4)의 PR 두 개가 남고, 닫힌 #819는 흐리게 그려집니다(gallery). ## Review - **판단해 주세요**: 닫힌 PR을 목록 끝에 흐리게 남기고 개수에도 셉니다(예전에는 빠짐). 부모 줄 개수가 늘어납니다. - **판단해 주세요**: 기록이 이제 pane이 체크아웃 브랜치로 맡은 PR도 보입니다(줄 표시와 같게). 예전 기록은 세션이 만든 PR만 보였습니다. e2e 두 개의 기대 수를 2에서 3으로 바꿨습니다. - **판단해 주세요**: 만든 세션 판정은 생성 행위입니다. 호출과 출력을 형식별 id로 짝짓고(Claude `tool_use_id`, Codex `call_id`, Pi·Grok `toolCallId`, OpenCode는 한 part), 출력에서 줄 하나가 주소뿐인 것 또는 응답 JSON의 `html_url`만 만든 PR로 봅니다(본문에 든 다른 PR 주소는 아님). agy는 결과가 호출을 가리키지 않아 시간 창만 씁니다. - **판단해 주세요**: link 기록 v12가 `session_prs.made` 열을 더하고 최근 90일 파일을 다시 읽습니다(v10 때와 같은 방식). 그래야 업그레이드 전에 만든 PR도 잡힙니다. 업그레이드 직후 한 번 읽기 부하가 있습니다. - **판단해 주세요**: 생성 호출로 인정하는 조건. 호출에 `||`가 없고(앞 명령이 실패해야 도는 명령이 없음), 기록이 실패로 표시하지 않은 호출(Claude `is_error`, Codex 종료 코드, Pi `isError`·`exitCode`, Grok `failed`, OpenCode 상태·종료 코드)만입니다. 실패한 `gh pr create`는 브랜치에 이미 있는 PR 주소를 찍기 때문입니다. `&&`, `;`, 파이프로 이어진 호출은 인정합니다: #1810~#1813을 만든 호출이 모두 `cd … && B=…; cat > $B <<EOF … EOF` 다음 `gh pr create … | tail -1` 모양이었습니다. - **판단해 주세요**: 생성 호출 출력의 앞쪽 창은 -10초입니다. 이 Mac 기록에서 생성 출력 234개 중 가장 이른 것이 GitHub 시각보다 3.4초 앞이었습니다(#1810~#1813은 2.6~3.2초). 10초 창이 같은 호출에서 조회만 한 오래된 PR(`gh pr create && gh pr view 42`)을 걸러냅니다. - **남는 위험**: 생성 호출이 같은 호출 안에서, 다른 세션이 10초 안에 만든 PR을 조회해 주소만 한 줄로 찍으면 그 PR도 이 세션이 만든 것으로 잡힙니다. - **알려진 위험(이번 범위 밖, 기존과 같음)**: 뒤쪽 +30초 안에 다른 세션이 같은 주소를 찍으면(예: 리드가 막 생긴 PR을 `gh pr view`) 그 세션도 만든 세션으로 잡힙니다. - **조심해서 볼 파일**: `hide-session/src/links.rs`, `named_prs.rs`, `opencode.rs`, `conversation_cursor.rs`, `hide-shell/src/lib.rs` - 생성 호출 판별(`ShellLine::fallback`), 형식별 실패 표시, 호출-출력 짝짓기, 아직 출력이 없는 호출 id를 체크포인트에 실어 다음 poll로 넘김(최대 16개). - **조심해서 볼 파일**: `herdr-core/src/runtime/session_state.rs` - high-frequency path, 모든 줄을 다루는 교차 패스에 목록 계산을 얹었습니다. - **조심해서 볼 파일**: `herdr-core/src/agent_state/work/family.rs` - 새 단일 출처. 줄, 기록 그룹, 200개 창 밖 처리가 모두 여기서 나옵니다. 기록 그룹은 잘린 목록만 나눠 담고 같은 `omitted`(`pr_omitted`)를 싣습니다. 여러 장비가 같은 PR을 읽으면 fresh > 최근 read > 나쁜 상태 순으로 고르고, 살아 있는 줄의 PR도 고른 read의 상태와 제목을 씁니다(read가 없을 때만 줄이 든 값). - **조심해서 볼 파일**: `herdr-core/src/links/ledger_store.rs`, `links/store.rs`, `links/mod.rs` - 판정 창 SQL(made면 -10초, 아니면 -2초)과 요약에 부모 간선, 만든 PR의 상태를 싣는 부분. - **조심해서 볼 파일**: `web/src/prMark.ts`, `components/pr-mark.tsx` - snapshot wire: `AgentRow.pulls` 신설, `state.pr` 삭제, `pr_groups[].pulls`. - **비용 검토**: 목록은 기존 교차 패스 안에서 메모리로만 계산합니다. lock 밑 I/O나 subprocess는 없습니다. - **비용 검토**: 기록 쪽 색인은 link worker 요약이 바뀔 때만 다시 만듭니다. 줄은 목록이 바뀐 때만 publish되고, 기록 그룹은 비교 후 바뀐 때만 복사합니다. fresh PR은 읽은 시각을 싣지 않아 GitHub가 같은 답을 다시 줘도 목록이 바뀌지 않습니다. - **비용 검토**: `sync_session_state`는 자동 해결을 저장했을 때만 두 번째 projection을 돌립니다. - **비용 검토**: 줄당 PR 200개 상한, 넘으면 `omitted` 개수와 넘는 순간 진단 한 번. 기록 세션 탐색은 줄당 2000개 상한이고 넘으면 같은 진단에 `lineage_capped`로 남깁니다. 상한 안에서 PR을 하나도 못 찾아도 이 사실은 남습니다. - **비용 검토(측정 안 함)**: lock 보유 시간과 snapshot 크기는 재지 않았습니다. 계산이 메모리 안이고 상한으로 묶인다는 것까지만 말할 수 있습니다. - **비용 검토**: 조상이 자손 PR을 반복해 실으므로 snapshot이 트리 깊이만큼 커지지만, 줄당 상한으로 묶입니다. ## Evidence - **확인한 것**: 운영자 `links.sqlite3` 읽기 전용 사본과 원래 transcript 복사본에 새 reader를 돌림(이번 규칙으로 다시). #1810(-2744ms) #1811(-2968ms) #1812(-2586ms) #1813(-3182ms) 모두 자기 세션의 복합 `gh pr create` 호출 출력으로 made. 같은 주소를 나중에 찍은 다른 세션 출력은 made 아님. - **확인한 것**: 검토 반례 테스트. `gh pr create --fill || gh pr view 42` 호출은 Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마 모두 made 아님. 실패한 Claude 생성 호출이 찍은 기존 #42도 made 아님. 하루 전에 만든 #42를 `||`와 `&&` 호출이 찍은 세션은 store에서 둘 다 Worked뿐(Created 아님). #1810~#1813의 실제 복합 호출 모양은 -3.2초에 Created, -12초 made 출력은 빠짐. - **확인한 것**: 생성 행위 테스트. Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마에서 `gh pr create` 출력은 made, agy와 `bash scripts/ship.sh` 출력은 아님. 호출과 출력이 다른 poll에 읽혀도 made. 목록에 혼자 있는 주소는 made 아님. - **확인한 것**: 저장 경로 테스트. 생성 호출이 3.2초 먼저 찍은 PR은 Created, `gh pr list`가 3초 먼저 찍은 PR은 아님. v11 기록이 열과 재읽기로 업그레이드됨. 기록 출력에서 made 3.4초 전은 남고 made 12초 전과 목록 3초 전은 빠짐. label 판정도 같음. - **확인한 것**: core 목록 테스트. 줄이 옛 open #42를 들고 reads가 최신 merged를 줄 때 줄 목록이 merged(read 순서 3가지 모두), fresh 재읽기는 목록 같음, 상한 뒤 세션에만 PR이 있는 2001개 lineage는 빈 목록이지만 `lineage_capped`이고 `pulls.capacity` 진단 한 번, 끝난 자식 100+101개에서 줄 200개 omitted 1과 기록 200개 pr_omitted 1이 같은 URL 집합, 세션 2001개 lineage는 `lineage_capped`, A→B→C에서 B의 줄·기록이 C 진행 중과 끝난 뒤 모두 같음. - **확인한 것**: web 태스크 자식 줄 테스트(A→B→C의 B가 #41·#42 둘 다). web vitest 전체 262개 파일 2283개 통과, `tsc`, eslint 통과. - **확인한 것**: hide-shell·hide-session nextest 전체 365개 통과, herdr-core 바뀐 모듈 nextest 254개 통과, hide-agent-hooks nextest 395개 통과, `clippy`(herdr-core, hide-session, hide-shell, hide-agent-hooks, all-targets) 경고 없음, `cargo fmt --check` 통과. - **확인하지 못한 것**: 전체 Rust suite, Playwright e2e, Windows·Linux lane은 CI에 맡깁니다. - **확인하지 못한 것**: 실제 Conductor 세션 native 확인, 업그레이드 후 재읽기를 실제 기록에서 돌려본 것. 운영자 앱·서버는 건드리지 않았습니다. <details><summary>추가 증거</summary>  세션 기록 PR 영역을 펼친 상태: 같은 목록에서 그룹을 나누고, 끝난 자식의 닫힌 #1538은 흐리게(gallery). </details> <details><summary>Verification record</summary> - base `origin/main`, head `0ca41fd92` - `scripts/verify-cargo.sh nextest -p hide-shell -p hide-session`: 365 passed - `scripts/verify-cargo.sh nextest -p hide-agent-hooks`: 395 passed - `scripts/verify-cargo.sh nextest -p herdr-core -E 'test(/links::|labels::facts|work::family|session_state|request_view|session_record|node_migration|pulls/)'`: 254 passed - `scripts/verify-cargo.sh clippy -p herdr-core -p hide-session -p hide-shell -p hide-agent-hooks --all-targets -- -D warnings`: clean; `check --workspace --all-targets`: clean; `cargo fmt --check`: clean - `scripts/verify-web.sh web test` (head `7d46918d7`, no web change since): 262 files, 2283 passed; `typecheck`, `lint`: clean </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed, in one paragraph a new contributor can follow
Background AI requests now go through one owned boundary instead of each feature carrying its own client. The new
hide-aicrate owns provider lifecycle, availability, timeouts, cancellation, structured errors and duplicate suppression; a feature brings only its prompt, its output schema and its parser, and gets a schema-validated JSON value back naming the provider that answered. The first consumer is the agent context-label plugin, which moves into the workspace atplugins/agent-context-labelsunder the idhide.agent-context-labelsand loses its own retry, backoff, cooldown and daily counter because the router owns them. OpenRouter is removed entirely - client, env key, model constant,ureqdependency, key scraping and every mention - so summaries come from the user's already logged-in Codex CLI throughcodex app-server. The Claude Code interactive path is registered and reported asUnsupportedwith its gap named, and the router never selects it. The CI rust lane widens from the core manifest to the whole workspace so all three crates are gated the same way.Review boundary
herdr-core/is touched;git diff --name-only origin/main..HEADmatches nothing underherdr-core/,macos/orcontracts/. This is a separate workspace crate plus a Herdr plugin process.herdr agent listCLI and writes pane metadata; it takes no pane, split, zoom, cwd or PTY decision, and no core-owned value.herdr agent list) and the plugin manifest's action/startup commands, which is the documented boundary for a portable plugin command.contracts/herdr-api.schema.jsonis unchanged and the schema gate passes against the pinned binary.ProviderUnavailable,NotAuthenticated,UsageLimitedandUnsupportedare the only refusals the router falls back on, and every fallback is logged with the provider that answered. A timeout or a completion-unknown outcome is never retried on any provider - a request whose completion is unknown is spent, so a turn is never double-charged. Control-request failures are typed (rejected,unanswered,gone) rather than parsed back out of a string. The startup log line andverify-providernow print the availability reason, not just the class. A leader that panics while holding an in-flight entry wakes every joiner with an explicit internal error and frees the key; the plugin's analysis thread catches its own panic and reports an abandoned turn, so a pane is never left in flight. Log lines carry ids and states only, never prompt or answer content.Evidence
cargo fmt --all --check,cargo clippy --locked --workspace --all-targets -- -D warnings, andcargo test --locked --workspaceall pass on this branch rebased ontomain(6d2a2c2). Theswift testlane and the repository-invariant lane pass unchanged - the twelve structural scripts, the script suite,check-herdr-pin-single-source.sh, andcheck-herdr-contract.sh --schema-only(pass, protocol 21, digestb6bdf239).hide-aidrives its codex backend against a Python fake app server (hide-ai/tests/fixtures/fake-app-server.py), so the turn/start boundary, cancellation, deadline expiry and completion-unknown classification are covered without a live provider. The plugin's binary tests drive every non-watch command -verify-provider,analyze-stdin,hook,request-refresh, the settings actions,--helpand an invalid invocation - against a temporaryHOMEand assert the previous id's directory is left in place and no migration is logged; migration runs only when the watcher starts.codex app-server, so real-provider latency, authentication and usage-limit paths are exercised only through the fake server and the typed outcomes. The Claude backend isUnsupportedby construction and has no live path to verify. No native app run - this change adds no visual surface.max_output_tokenswas dropped from the request because no provider contract honours it. In-flight work is bounded by the router's duplicate-suppression map, whose entries are owned by a guard that frees the key on panic.Screenshots
N/A - no visual surface changed. The plugin's output is a pane metadata token rendered by surfaces this branch does not touch.
AI tooling
Written with AI tooling and reviewed by an independent read-only pass over the whole diff, which returned no must-fix. The one gap that review named - the
analyze-stdindiagnostic path missing from the non-watch binary test cases - is closed by the final commit. Checked by hand: that no file underherdr-core/,macos/orcontracts/is touched; that the retry policy indocs/AI_PROVIDERS.mdmatches whatrouter.rsactually does; and that the removed OpenRouter surface leaves no key, constant or documentation reference behind.Note on the local
check-no-attribution.pygate (not a CI gate): it reportscodexin the commit messages. Every hit is the subject of the work - thecodex app-serverbackend andClaudeInteractiveBackendare the components being integrated - not an attribution line.