Skip to content

feat: list the projects worth adding from agents, Paseo and Herdr in Add a project - #2204

Merged
yansfil merged 15 commits into
mainfrom
device-add-project-import
Nov 7, 2026
Merged

yansfil merged 15 commits into
mainfrom
device-add-project-import

Conversation

@yansfil

@yansfil yansfil commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #2196 (stacked on it; this is the second layer of "기기에서 프로젝트 추가")

Summary

Adding a project you already work on meant finding its folder by hand, on this Mac and even more on a device.
Now Add a project lists 가져올 수 있는 프로젝트 under the other ways: the folders your agents worked in on the chosen machine, and the projects Paseo and Herdr keep there.
Each row carries a chip per source, and 추가 or 모두 추가 (N) adds them while the dialog stays open; a refused row stays with its reason.
Hide only reads those files, so Paseo and Herdr keep working beside it, and a file it cannot read just drops out and goes to the log.

import list (ko, dark)
Start view on a Linux device: one repository found by two agents, one kept by Paseo and Herdr, a long path cut with an ellipsis.

Review

  • 판단해 주세요:
    • 모두 추가 sends one create_workspace per row, one after another, not one event. Each add carries a request_id and gets its own receipt in the core, beside hide <path>'s and under the same bound of 32, published as status.project_adds (pending, added, or refused with kind and message) and cleared by no later event; every receipt waiting on a machine and path is settled with that registration's outcome, so another window's add answers no row (B25).
    • Paseo's updatedAt is its record's time, not its last use, so a Paseo-only project untouched for 30 days drops out unless an agent worked there too.
    • Herdr keeps no time per workspace; every Herdr row is as recent as session.json.
    • Antigravity was not in the session catalog's walk; worked_folders reads agy's index for it. The session archive itself is unchanged.
  • 조심해서 볼 파일:
    • hide-host/src/importable.rs - access boundary: every folder goes through register::judge (unconfirmed), so only roots under home come back; reads are capped (Paseo 4 MiB, Herdr 4 MiB, 400 folders judged, 20 answered), opened only as regular files without waiting (hide_platform::fs::open_regular, also now in herdr_save::fetch), and the search ends by a 20 s deadline below hided's 30 s bound.
    • hide-core/src/runtime/project_open.rs await_add/settle_project_open and the status.project_adds wire field - snapshot wire and result ownership: add receipts share the hide <path> receipt queue (bound 32) but bring nothing forward; every create_workspace outcome passes settle_project_open.
    • hide-session/src/catalog.rs - project_sessions and worked_folders share one walk per agent (agent_files); worked_folders reads each agent under its own budget of SESSION_DISCOVERY_LIMIT entries, refuses a store it cannot list, past its budget, or a session file it cannot read for that agent only, and prunes the header cache per store that listed whole. A header that could not be read is told apart from one refused by rule (HeaderError), and only the latter is cached.
    • hided/src/server.rs node_ask - failure path: runs off Mutex<Runtime> on a blocking task, 30 s bound, each dropped source logged as add_project.import_source_dropped.
    • web/src/ImportableProjects.tsx - the one-at-a-time queue and how an answer is matched to its row.
    • hide-host/src/herdr_save.rs says Bundle 4 PR B deletes it with Herdr; this PR reads Herdr saves through it, as the existing Herdr import does.
  • 비용 검토: no resident work. One node call per dialog opening and per machine chosen: a walk of at most 10,000 session entries (the archive's cap, header cache reused, only files changed in 30 days opened), two capped file reads, at most 400 folder judgements.

Evidence

  • 확인한 것:
    • hide-host importable tests (4) on a real temporary home: a repository worked from a linked worktree and a subfolder is one row with both agents; a folder Paseo and Herdr both keep is one row with both; home, outside home, gone, archived, older than 30 days and registered are left out; every file read is byte-equal afterwards (B26); an unreadable Paseo registry and a newer Herdr format drop out alone (B27); 25 projects answer the newest 20 (B22); a FIFO at Paseo's registry and at Herdr's session drops each at once while the agents' project still answers, three times over on a thread with a 10 s bound, and a passed deadline drops every source as late.
    • hide-session tests: each agent folder once, an old session left out, an unreadable OpenCode database refused alone; a Claude store that cannot be listed and a Codex FIFO refused beside Codex's folder; a Claude store past its 10,000-entry budget beside a small Codex store still finds Codex's folder; a second search after a Codex file is replaced keeps no header of it while Claude's store never lists.
    • Core: two adds of one folder both get its refusal; a refused and an added receipt stay on the wire after an unrelated event clears last_error. hided: a path_refused carries the add's request id.
    • Web dialog tests (4 new, 14 in the file): the ask on opening, nothing until the answer (B29), chips and registered rows left out (B20, B21), nothing for an empty or failed answer, one add then add all one at a time, a refused row keeping its reason and sent once more on a second press, the dialog open throughout (B24, B25); with app pending, another window's registration and another add's refusal answer nothing, app's own refusal stays on app and site is sent next with nothing on it.
    • B28 is the catalog's existing rule, tested by workspace::tests::a_space_occupying_a_registered_directory_does_not_duplicate_it: a later Herdr workspace in a registered folder joins that project.
    • Web typecheck, lint, the 4 related vitest files (83 tests), check-design-contract; Gallery scene=add-project captured in ko/dark, en/light, ja/dark, zh-CN/dark.
  • 확인하지 못한 것:
    • Not run against a live device (Linux, Windows, WSL) or a candidate app; Windows and Linux rest on CI's Rust lanes.
    • Not run against a real Paseo install; its file shape is read from getpaseo/paseo docs/data-model.md and workspace-registry.ts.
추가 증거

import list (en, light)
English, light.

Breaking change

The node protocol goes from 80 (#2196) to 82; 81 is held by an open change (fix/new-build-reaches-panes). A device helper before 82 is refused at Hello and reinstalled, as on every protocol step.

Verification record

@yansfil yansfil left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL: a6738dc23d2e3bdb86fd8f41b63da5b35f7b13e9, base 80fa605d8708325509bf2e8165f046291c016f6b와의 차분만 검토했습니다.
docs/CODE_REVIEW.md 기준 serious 3건과 ordinary 1건이며, 아래는 소스로 확인한 실패 경로입니다.
이번 라운드에서 빌드나 제품 테스트를 실행하지 않았습니다.

  1. serious / Correctness, ownership: 특수 파일 하나가 후보 조회 전체와 node worker를 멈춥니다.
    hide-host/src/importable.rs:103,
    hide-host/src/importable.rs:178
    ~/.paseo/projects/projects.json이 writer 없는 FIFO이면 File::open에서 멈춥니다.
    Herdr도 새 호출 경로가 기존 herdr_save::fetch의 같은 blocking open(hide-host/src/herdr_save.rs:46)을 사용합니다.
    4 MiB take는 open/read 대기시간을 제한하지 않습니다.
    순차 실행하는 find는 다른 출처의 정상 후보도 반환하지 못하고, hided의 30초 호출 timeout 뒤에도 이 함수에는 deadline/취소 입력이 없어 node worker가 남습니다.
    수정: 기존 regular-file reader 정책처럼 open 자체가 특수 파일에서 막히지 않게 열고, 열린 핸들의 종류를 검사한 뒤 capped read를 하십시오.
    읽기 예산·취소를 실제 node 작업까지 전달하고 실패 출처만 dropped로 돌려야 합니다.
    Paseo/Herdr FIFO 각각에서 정상 출처가 반환되고 반복 요청 뒤 worker가 남지 않는 회귀 사례가 필요합니다.

  2. serious / Correctness, failure isolation: 한 에이전트의 목록 오류가 모든 에이전트 후보를 지웁니다.
    hide-session/src/catalog.rs:333,
    hide-session/src/catalog.rs:272
    읽기 권한이 없는 .claude/projects 또는 그 아래 디렉터리 하나가 있으면 collect_jsonl의 오류가 session_files(...)?로 전파됩니다.
    정상 Codex/Pi/OpenCode/Antigravity 후보도 모으지 못하고 importable.rs:86에서 출처 전체를 agents로 버립니다.
    앞에서 모은 후보도 뒤쪽 walk 오류에 함께 유실됩니다.
    B27의 출처별 실패 격리를 만족하지 않습니다.
    수정: agent별 walk 결과와 refusal을 나누고, 한 출처의 IO/용량 오류가 이미 모은 다른 출처와 이후 출처를 지우지 않게 하십시오.
    동일하게 헤더 reader에서 .ok()로 삼키는 unreadable/malformed도 해당 출처의 진단으로 연결해야 합니다.
    권한 없는 Claude 저장소와 정상 Codex 저장소를 함께 둔 테스트가 필요합니다.
    현재 테스트는 Paseo/Herdr 형식 오류 및 OpenCode DB 오류만 검증합니다.

  3. serious / Correctness, result ownership: 다른 프로젝트의 결과를 현재 추가 행의 결과로 처리합니다.
    web/src/ImportableProjects.tsx:72-85
    A를 추가하는 동안 다른 창/CLI가 같은 기기의 C를 등록하면, landed는 경로를 비교하지 않고 새로운 registration id 하나만 보고 A가 성공했다고 판단합니다.
    A를 added에 넣어 숨기고 B를 시작하므로, 나중의 A 실패는 A 행에 남지 않습니다.
    useErrorSince로 읽는 core의 전역 last_error도 요청·기기·경로와 연결되지 않아 다른 생성의 오류를 현재 행에 붙일 수 있습니다.
    한 컴포넌트의 queue만 직렬화해도 다른 클라이언트의 생성과 격리되지 않습니다.
    수정: 성공은 해당 기기+정규화된 등록 루트로 확인하고 실패도 요청별 receipt로 연결하십시오.
    임의의 새로운 등록이나 전역 시간 기준 오류로 queue를 전진시키지 않아야 합니다.
    A pending → 다른 C 등록 → A 실패의 순서에서 A 실패 행이 남고 B에 잘못된 결과가 붙지 않는 테스트가 필요합니다.

  4. ordinary / Ownership and limits: 새 전체 조회가 공유 header cache의 퇴출 경로를 빠뜨립니다.
    hide-session/src/catalog.rs:358
    worked_folders는 file_cwd를 통해 Claude/Codex 경로를 전역 HEADERS map에 넣지만, 기존 project_sessions의 file_cache::retain(&self.home, &listed)(catalog.rs:239)에 대응하는 정리가 없습니다.
    프로젝트 세션 조회가 없는 기기에서 세션 파일을 교체·삭제하며 Add a project를 다시 열면, 매번 10,000개 미만이어도 지난 경로가 계속 쌓입니다.
    호출당 discovery cap은 프로세스 수명 동안의 cache cap이 아닙니다.
    수정: 성공한 전체 discovery의 listed set으로 동일한 per-home 퇴출을 수행하거나 cache 자체에 명시적 상한을 두십시오.
    세션 집합을 교체한 뒤 두 번째 worked_folders가 삭제된 파일의 cache를 남기지 않는 테스트가 필요합니다.

verify run 42386235802은 위 head SHA에서 success임을 확인했습니다.
CI 성공은 위 실패 경로의 검증을 대신하지 않습니다.

@yansfil

yansfil commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Review 5813750407: all four findings are fixed in 5ec0aa2 and b9909cc. The head is 3c43c6a, which merges #2196's branch at 18ce7a0.

  1. A pipe or device file stalls the search (serious).
    • Fix: Paseo's registry and Herdr's session.json now open through the shared non-blocking, regular-file-only hide_platform::fs::open_regular, after canonicalize, so a symlinked config still works. This includes herdr_save::fetch, which the existing Herdr import uses too. No second helper was written.
    • Deadline: find takes a deadline. The node sets it from IMPORTABLE_SEARCH_BUDGET (20 s, below hided's 30 s bound). The session walk checks it per agent and per file, the app reads per source, and the folder judging per folder. A source not reached by then is dropped as "the search ran out of time", so the node's work ends before its caller gives up.
    • Test: a_pipe_in_place_of_an_app_file_drops_that_app_without_holding_the_search puts a FIFO at both files. Three runs on a thread, each bounded to 10 s, still return the Claude project with paseo and herdr dropped. A deadline that has already passed drops every source as late.
  2. One agent's error wipes every agent (serious).
    • Fix: worked_folders now walks each agent on its own (agent_files, shared with project_sessions). A store that cannot be listed, a capacity error or a late deadline refuses only that agent, and what the other agents found is kept. It no longer returns Result.
    • Header errors: the header reader now returns HeaderError::{Refused, Unreadable} for every agent (Claude, Codex, Pi/omp/Grok/agy and Cursor) instead of .ok(). worked_folders logs both as that agent's dropped line. project_sessions keeps its old behaviour, and only Refused stays cached.
    • Test: a_store_that_cannot_be_listed_is_refused_beside_the_folders_other_agents_found puts a file where .claude/projects should be, which fails the listing even when the tests run as root, next to a readable Codex store with a FIFO session. Codex's folder is still answered, and the refusals are claude and codex.
  3. A row takes another add's result (serious).
    • Fix: each add sends a request_id. The core keeps it by machine and path (Runtime::await_add, at most 32 waiting) until settle_project_open, which every create_workspace outcome already goes through. A refusal's last_error then names that request id. hided's path_refused carries the request id back as well.
    • Web: a row is refused only by the refusal naming its own request id, and it lands only when its root is registered on that machine (alreadyRegistered), not when any new registration appears.
    • Tests:
      • Web: reads a row's answer only from its own add, .... While A is pending, a registration from another window and a refusal of another add do nothing. A's own refusal stays on A, and B is then sent and gets no result that is not its own.
      • Core: a_refused_add_names_the_request_that_sent_it.
      • hided: a_refused_add_carries_the_request_id_it_was_sent_with.
  4. The header cache grows without eviction (ordinary).
    • Fix: after a complete listing (every agent listed), worked_folders now runs file_cache::retain(home, listed), the same eviction project_sessions runs.
    • Test: a_second_folder_search_keeps_no_header_of_a_session_file_that_left checks that the cache still holds 2 entries after one file is replaced.

Node protocol: main took 79 for the clipboard, and #2196 is now at 80. The open PR fix/new-build-reaches-panes holds 81, so this PR now uses 82.

Local checks (filtered, through cargo-slot): all 436 hide-session tests, the hide-host importable tests (4), the core add tests, and the hided boundary tests pass. clippy -D warnings is clean on the five crates, and cargo fmt --check is clean. Web: typecheck, lint, the dialog, FirstRunWizard and store tests (65), and check-design-contract all pass.

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL at 3c43c6ae10adb57dc3c661503a7e31a5aa2dc2ce: I1 is closed; I2, I3 and I4 are partly fixed but remain blocking under docs/CODE_REVIEW.md.

  1. I3 remaining, serious | correctness / result ownership | hide-core/src/runtime/project_open.rs:214-228.
    answer_adds removes every pending add matching device+path, but emits a refusal only for answered.back(). If two windows add the same project while its creation is pending, events.rs:2571-2580 joins the second request to the in-flight work. When that work fails, only the second request receives an error; the first window's row stays Adding and its Add all queue never advances. Even for one request, the only result is the global last_error, which the next event clears (runtime.rs:2919); an event before the next snapshot can erase the refusal before the row sees it. Request identity fixes attribution but does not make delivery durable.
    Fix: retain a bounded per-request result for every waiter, using/extending the existing project-open receipt mechanism, and have the row consume its receipt. Test two request IDs for one failing path, plus a failure followed by an unrelated event before reading the snapshot. Success matching by device+path and hided's echoed refusal ID are fixed.

  2. I2 remaining, serious | correctness / failure isolation | hide-session/src/catalog.rs:349,368 and 511-513.
    Agent walks still share visited. When Claude's tree crosses 10,000 entries, its walk returns Capacity but leaves that counter above the limit. Codex's first entry immediately fails the same check, and so do later file-based stores; OpenCode receives the exhausted counter too (416-420). A large Claude store therefore still suppresses a valid small Codex store, despite the promised per-source capacity-error isolation. The new regression tests a listing error before any entries are consumed, so it misses this case.
    Fix: give each source an isolated bounded allocation while retaining an explicit total work bound, so a refused source cannot consume later sources' entire allowance. Test an over-cap Claude tree beside a valid Codex session. Ordinary listing/header errors now have per-agent diagnostics and preserve other agents' rows.

  3. I4 remaining, ordinary | ownership and limits | hide-session/src/catalog.rs:368-371,408-412.
    Cache eviction is conditional on every agent listing succeeding. Keep .claude/projects as an unreadable directory (or the regular-file fixture already used by the new test), and repeatedly replace readable Codex session files. Each call inserts Codex headers, but whole is always false, so none of the deleted files' entries is evicted. A device doing only import discovery still accumulates headers without a lifetime cap. The new cache regression covers only a wholly successful listing.
    Fix: prune each successfully enumerated source independently, or give the cache an explicit bounded admission/eviction policy that also applies during partial failures. Add a rotation regression with a permanently refused sibling source. This is the resource cap required by principle 15; successful-run cleanup alone does not supply it.

I1 closed: Paseo (hide-host/src/importable.rs:119-133) and Herdr, including the shared fetch path (hide-host/src/herdr_save.rs:48-57), now use hide_platform::fs::open_regular (fs/mod.rs:118-139), with nonblocking open and validation of the opened file. FIFO regression: hide-host/tests/it/importable.rs:282.
The added 20-second deadline is cooperative: it is checked between sources/files, not inside directory walks or blocking filesystem calls. This review does not treat it as proof of a hard 20-second runtime bound.

Protocol 82 is declared at hide-node-link/src/protocol.rs:344. Older non-24 protocols are rejected by hide-node/src/ssh/host.rs:1128; installation/digest replacement precedes Hello (ssh/device.rs:435-466, ssh/bootstrap.rs:441). The frozen protocol-24 exception remains; this is not a claim that protocol24 supports import discovery. No live helper upgrade was exercised.

CI run 42395570476 is successful at this exact SHA. Evidence here is source review and inspection of regression tests; no local Cargo/build/test execution, source changes or commits. The terminal-links failure was not investigated. Unrelated changes inherited from main and #2196 were not re-reviewed in this four-finding pass.

@yansfil

yansfil commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Recheck 5814169553: the three findings left open are fixed in 12b3a05.

I3: result ownership.

  • Receipts: every add now has a receipt of its own. The core keeps it beside hide <path>'s receipts, in the same ProjectOpens queue and under the same bound of 32, marked so that it brings nothing forward.
  • Settling: settle_project_open settles every receipt waiting on that machine and path with the one outcome. Two ids joined on one failing path therefore both get the refusal, with the error's kind and message.
  • Snapshot: the adds' receipts are published as status.project_adds (pending, added, or refused with kind and message), and nothing but the bound removes them. The next event clears last_error, but not a receipt.
  • Over the cap: a settled receipt makes room. When all 32 are still waiting, the add is refused as workspace.create_busy, named by its id. That is the one answer that cannot be a receipt, because there is no room to keep one.
  • Web: the row now reads its own receipt and no longer reads last_error. A refusal from hided before the core sees the add still arrives as path_refused carrying the id.
  • Tests:
    • two_adds_of_one_folder_each_receive_its_refusal.
    • an_add_keeps_its_own_receipt_past_the_next_event: a refused add, then a successful one, then an unrelated add_project_folder_set. last_error is cleared, but both receipts are still in the wire snapshot (rest.status.project_adds).
    • The web race test now drives receipts: another window's receipt and registration change nothing, A's own refused receipt stays on A, and B is sent next.

I2: one budget per source.

  • Fix: each agent's walk in worked_folders, and OpenCode's read, starts its own counter at 0 with SESSION_DISCOVERY_LIMIT. One search therefore looks at no more than that many entries per store, a finite total. A store past its budget is refused for that agent alone.
  • Test: a_claude_store_past_its_budget_leaves_codex_its_own, a Claude store with 10,001 entries beside one Codex session. Codex's folder is still found, and only Claude is refused.

I4: pruning with a failing source beside it.

  • Fix: the kept headers of each store that listed completely are now pruned to that store's own listing, through file_cache::retain(store, listed) with a per-folder prefix, whatever another store did. The all-or-nothing whole flag is gone.
  • Test: a_second_folder_search_keeps_no_header_of_a_session_file_that_left now runs with a .claude/projects that can never be listed. A Codex file is replaced, and the cache still holds 2.

Local checks (filtered, through cargo-slot): all 437 hide-session tests, the core receipt and add tests, and the hide-host importable tests pass. clippy -D warnings and fmt --check are clean. Web: typecheck, lint and 89 related tests pass.

Base automatically changed from device-add-project-browse to main November 7, 2026 19:36

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL at b6e855d1829e6c1d018ff850dd3ffe383cb62940: I2 and I4 are closed; I3's admitted-request cases are fixed, but admission refusal still strands an import row.

Serious | correctness / failure delivery | hide-core/src/runtime/project_open.rs:218-227, web/src/ImportableProjects.tsx:72-91.
When all 32 shared project-open receipts are pending, await_add emits only last_error = workspace.create_busy with the request ID and returns false. No receipt is created and no work is started (events.rs:2492). The import row now reads only status.project_adds and hided's path_refused; it no longer observes last_error. Therefore an import submitted while 32 CLI/window opens are pending has no terminal outcome the row consumes. It stays Adding and blocks Add all even after those other requests finish. This occurs even if the snapshot containing the busy error reaches the UI; it is not merely a timing race. Reused-ID admission refusal takes the same undelivered path.

Fix: deliver admission refusal through a request-correlated response that this row actually consumes, while keeping the 32-entry bound. For example, return a structured refusal to the submitting connection before treating the request as admitted. Do not rely solely on the transient global last_error or merely raise the cap. Add a regression with all 32 shared slots pending, then one import add: its row must show the busy refusal, leave Adding, and permit retry/queue progress; include an unrelated event before the client reads its result.

The admitted-request fix is otherwise sound: every matching waiter gets its own retained receipt (project_open.rs:280-290,359-365), so two IDs on one failing path and a later unrelated event no longer lose the result. Queue and snapshot row counts are bounded: MAX_OPENS=32; make_open_room evicts the oldest settled receipt when full (170-184); pending entries are not evicted; publish_project_adds replaces the snapshot vector from the queue (242-265) rather than accumulating historical rows. No explicit acknowledgement/TTL removes settled receipts; they remain within the bound until capacity pressure or runtime teardown.

I2 is closed by fresh per-store counters (hide-session/src/catalog.rs:362,409) and the over-cap Claude plus valid Codex regression (1128). I4 is closed by pruning every completely listed store independently (366-368, file_cache.rs:83-90); its rotation regression now keeps Claude permanently unlistable (1155).

The #2196 merge retains the reviewed clone fix; protocol is 82. Verify 42405165904 succeeded at this exact SHA. This pass inspected source and regression tests; no local Cargo/build/test run, tracked edits, commits, or installed-app interaction. The terminal-links failure was not investigated.

@yansfil

yansfil commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Review 5814606099: an add the core does not admit now gets a receipt like any other, fixed in 78b415d.

Fix:

  • Separate bounds: waiting and settled receipts are now bounded apart, still in one queue (project_open.rs).

    • Waiting: at most 32. Admission (admits_open) checks only this.
    • Settled: at most 32, with the oldest settled receipt dropped first (keep_open and trim_settled_opens, which also run after every settle). A waiting receipt is never dropped, and there is always room to keep a refusal.
  • Admission refusal: an add that is not admitted is kept as a receipt refused at once:

    • workspace.create_busy when 32 requests are waiting;
    • workspace.create_refused when its id was already used.

    It is published in status.project_adds like any other receipt and starts no work. last_error is still set, for the log only. hide <path> keeps its project_open_busy answer.

  • Web: the row reads the newest receipt carrying its id (findLast), so a reused id reads its own refusal.

Tests:

  • Core, an_add_not_admitted_is_answered_by_a_refused_receipt:
    • With 32 adds waiting, an import add gets a refused workspace.create_busy receipt and registers nothing.
    • An unrelated event clears last_error, and the refused receipt is still there.
    • Once one request settles, the next add is admitted again.
    • 40 reused ids each get a refused receipt, and settled receipts stay within the bound.
  • Web: a refused workspace.create_busy receipt leaves the row's failure showing after last_error is cleared. The row's button can be pressed again, and Add all sends the next row.

Local checks: the core add, receipt and project-open tests pass (39). clippy -D warnings and fmt --check are clean. Web: the dialog tests (17), typecheck and lint pass.

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL at 78b415d587030a1b1e063f8500c429f25cee7996: the round-3 overflow-delivery finding is closed, but storing a reused-ID refusal exposes one new result-ownership bug.

Serious | correctness | hide-core/src/runtime/project_open.rs:388-391.
await_add now appends a refused receipt with the reused ID, potentially for a different device/path (225-266). settle_project_open initially selects pending receipts for the correct device/path (313-318), but its write-back matches only the request ID and updates every entry carrying it, including already-refused entries for other paths.

Concrete sequence: admit ID r for /A; refuse another add with ID r for /B; complete /A successfully. The final loop changes both receipts to Added, including /B, even though /B was refused and no work was started for it. The web's new findLast reads that later /B receipt (ImportableProjects.tsx:72) and marks its row added (78-80). An original failure similarly overwrites the independent admission-refusal reason. The new reused-ID test stops before settling waiting-1, so it misses this transition.

Fix: mutate only the actual pending entries whose device and path match this completion, preserving all terminal receipts. Do not reselect by ID alone now that the queue deliberately permits duplicate IDs for refusal records. Extend the regression with reused ID + different path, then complete the original request and assert that the later receipt remains workspace.create_refused, the original gets its own result, and no unadmitted row becomes Added.

The requested overflow fix itself is correct: a busy add now gets a published refused receipt and starts no work; the UI consumes it and moves on. Waiting receipts are bounded at 32 (admits_open:172-179), settled at 32 (trim_settled_opens:189-205), and trimming runs after insertion and settlement. Only settled entries are evicted, oldest in queue order; the queue and published vector are at most 64 at observable points. hide <path> still returns project_open_busy with 32 pending (113-114), and its existing regression remains.

Verify 42407729062 passed at this exact SHA. Evidence here is source and regression-test inspection. No tracked edits, commits, Cargo/build/test execution, or installed-app interaction; terminal-links was not investigated.

@yansfil

yansfil commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Review 5814708939: fixed in c661d05.

Fix:

  • Core: settle_project_open now updates only the receipts its selection chose, by the same test: still pending, same device and same path. It never matches by request id alone, so an id reused for another folder keeps its own refused receipt.
  • Web: the row also matches its receipt by its own folder (request_id and path), so a receipt for another folder under the same id never answers it.

Tests:

  • Core, a_reused_id_keeps_its_refusal_when_the_first_folder_settles: r is admitted for /A and refused as reused for /B, then /A settles once as success and once as failure. /A reads added or refused with its own kind, and /B keeps workspace.create_refused both times.
  • Web: in the race test, an added receipt for another folder under app's own id leaves app waiting.

Local checks: the core add, receipt and project-open tests pass (40). clippy and fmt --check are clean. Web: the dialog tests (17), typecheck and lint pass.

@yansfil
yansfil added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit d6be5a7 Nov 7, 2026
63 checks passed
@yansfil
yansfil deleted the device-add-project-import branch November 7, 2026 20:43
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