Skip to content

perf(explorer): serve the name filter from a worker-owned path index - #34

Merged
nplez1 merged 6 commits into
nplez1/mainfrom
nplez1/explorer-name-filter-perf
Sep 27, 2026
Merged

nplez1 merged 6 commits into
nplez1/mainfrom
nplez1/explorer-name-filter-perf

Conversation

@nplez1

@nplez1 nplez1 commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 92 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14511 $\color{#cf222e}{\Huge{\mathbf{−}}}$​560 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13951
Prod 216 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20784 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1731 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19053

ELI5

The Explore pane's file-name filter used to re-walk the entire workspace from disk on every keystroke, so results could take seconds and might never get faster. This gives Explorer a prebuilt index of the workspace's file paths, kept warm by a background worker, so typing a filter becomes a memory lookup that returns an exact match count and a bounded page.

What Changed

Before. Typing in the Explore name filter called the recursive path search. The only code path that warmed a path inventory was the local fs:listFiles handler, which Explorer never calls, so repeated filtering stayed on a live filesystem walk indefinitely. Even when the inventory was warm it kept two whole path arrays, discarded the entry on any path change (watcher invalidation), awaited a two-pass rebuild on the next query, and then matched every candidate synchronously on the Electron main thread with a per-path toLocaleLowerCase(). On a 1M-path workspace a warm query measured 0.5 s and every keystroke paid a 120 ms debounce on top of it; when the inventory was rejected for memory, filtering fell back to a live scan on every keystroke and never recovered.

After. Explorer acquires a reference-counted lease on an execution-host-owned path index when the Files view becomes active, and every search ensures it. A long-lived worker owns one canonical catalog per workspace — pre-folded search text, one record per path, scope and classification bits, a natural-order permutation, and budgeted trigram postings — so a warm query is an in-memory scan with an exact count and a bounded page: on a real 397,097-path workspace, p95 is 0.2 ms for no-match, 0.56 ms for multi-token, 1.3 ms for extension, 1.9 ms for a selective three-character query, and 74 ms for a broad one-character query.

Mechanism, end to end:

  • Index lifecycle — WorkspacePathIndexService owns leases, authorization, byte reservations, and a bounded latest-query scheduler. quick-open-path-inventory.ts is now a thin compatibility adapter; there is exactly one cache, owned by the service. Recently active roots stay in an LRU under a byte budget.
  • Build lane — discovery streams bounded acknowledged batches (256 paths / 512 KiB) into the worker, which folds, sorts, packs, and compacts off the main thread. The requested scope publishes first; a second scope only adds membership bits, so an over-budget scope cannot destroy a ready one.
  • Query path — the exact substring-AND predicate is unchanged; queries run in precomputed natural order over pre-folded text, count every match exactly, and retain a page bounded by rows and serialized bytes. Trigram postings accelerate selective and no-match queries, verify every surviving candidate with the exact predicate, and are discarded before the catalog under memory pressure.
  • Freshness — watcher events publish bounded base/delta generations with tombstones behind a sequence fence, with reconciliation when coverage was lost. Coverage ("every path in the snapshot was searched") and freshness ("the snapshot may be behind the filesystem") are tracked separately, so a stale-but-complete page is never reported as an exact current count.
  • Over-budget roots — instead of refusing to index, an oversized root spills to a versioned, checksummed on-disk block format and is scanned in bounded blocks. Admitted capacity at the default budgets went from 436k paths (realistic) / 145k (long, unshared paths) to 1M for both profiles, with exact counts and ordering preserved, and a measured 3.5× faster spilled scan after replacing a bit-at-a-time CRC with a table CRC.
  • Restart — a bounded host-local checkpoint makes a clearly labelled provisional page available ~17 ms after load and ≤69 ms p95 for the page itself (target 200 ms), against a 9–13 s rebuild. Writes are ~12 ms and add no bytes for spilled roots; resident roots only checkpoint on explicit opt-in.
  • Renderer — dispatch moved from a fixed 120 ms debounce to the next animation frame with one request in flight and a replaceable pending one. Replies are fenced by query, owner, generation, mode, visibility scope, and page budget; a previous page stays visible only while labelled as updating, and Enter/Space cannot act on a stale result. Projection is memoized and built in frame-budgeted chunks (deep ancestor-heavy p95 per task: 47 ms → 0.82 ms).
  • Remote hosts — a negotiated filePathSearch.nameFilter.v1 capability carries exact substring-AND semantics, scoped limits, and structured freshness metadata to runtime, relay, and SSH peers, with one-pass byte trimming; peers that do not advertise it keep the legacy fuzzy/32-row contract byte for byte, and a disconnected host never triggers a client-local search.
  • Rollout — internal kill switch ORCA_DISABLE_WORKSPACE_PATH_INDEX=1 uses only the complete bounded live scan, with a dev-only diagnostics summary (strategy counts, fallback reasons, admission refusals) so "the fast path was never used" cannot hide, plus a sampled dev/test shadow comparison against a brute-force oracle.

Two budget-safety defects fixed on top of the reviewed work (both found after the completeness review, the second by a focused adversarial review of the first):

  1. Builds were bounded by the wrong budget. The service reserved the 480 MiB host build-peak allowance but bound the builder to the 256 MiB root retained budget, so any root whose build accounting exceeded 256 MiB was refused and spilled even when its retained catalog fitted comfortably. On the reporting machine that meant three 331k/397k-path workspaces spilling (measured build accounting 320 MiB and 384 MiB; retained 88.8 MiB and 111.0 MiB). Builds now use the build-peak allowance (WORKSPACE_PATH_INDEX_BUILD_BOUND_BYTES), retained bytes are still capped at the root budget on publication, and the host budget still accounts the full 480 MiB peak.
  2. A refused publication could still be served. Raising the build bound made a previously unreachable path reachable: a worker could build a catalog retaining more than the 256 MiB root cap, record that generation in the service entry before admission decided, and — when publication rejected it — leave the generation in place, so a later ensure could return the unadmitted (over-budget) generation as ready. Rejection now drops the worker generation and invalidates the entry before any query can see it, with the search degrading to spill/live-scan and a visible reason. Behavioural tests cover both a >256 MiB build-accounting/under-256 MiB-retained root staying resident and an over-256 MiB retained result never being served.

Why

The workspace's file paths are bounded and change slowly, while the filesystem walk is the entire cost of a filter keystroke — so the work belongs in an index that is warmed before the user types, updated incrementally, and queried off the UI thread, not in a faster matcher (the previous matcher was never the bottleneck) and not in a larger browse listing (which is an OOM bound, not a filter). The plan's alternatives table records the rejected options: raising the 20,001 listing cap (recreates the memory and render costs, still answers no arbitrary-prefix query), reducing only the debounce (removes 120 ms but not the walk), ripgrep per keystroke (kept as the correctness fallback, not the interactive path), sending every path to the renderer (duplicates memory, expands remote transfers, complicates authority), Quick Open's fuzzy matcher (changes the pane's meaning), a basename trie or prefix search (cannot express substring-AND over full relative paths), tracked-Git-files-only (misses untracked files and non-Git folder workspaces), SQLite/FTS/native immediately (packaging and semantics unproven; not needed to fix the lifecycle), and approximate counts (violates the search contract).

This supersedes an existing upstream mechanism. Upstream stablyai#22369 solved the same user-visible problem differently — a capped browse listing plus a host re-list for local typed queries. That mechanism and the path index cannot both serve the same query, so our index replaces it (the plan explicitly rejects capped listing as the answer: it is an OOM bound, not a filter). Upstream's specs were adapted to the index (quick-open-file-list-host-name-filter.react.test.tsx, use-file-explorer-name-filter.runtime-listing.test.tsx) and its two now-orphaned helpers (quick-open-capped-local-listing.ts, runtime-file-request-debounce.ts) are deleted. The PR is one commit, so reverting it restores upstream's mechanism wholesale if that is ever preferred.

Two deliberate trade-offs are recorded rather than hidden: the resident warm-query acceptance targets are re-baselined to a measured per-class × per-size matrix (the original ≤25 ms / ≤60 ms bands could not be met for broad one-character scans by any exact scan at 1M paths; the revision, its derivation, and the named follow-up work — typed-array/SIMD broad scanning, worker-parallel scans — are recorded in docs/reference/file-path-filtering-at-scale.md), and spilled mode is explicitly lower-performance at 1M (0.5–2.4 s p95) while remaining exactly correct.

Linked Issue

No linked issue. This is a fork-side performance change: the fork (nplez1/orca) has issues disabled and no upstream issue describes the Explorer name-filter latency. Happy to open one upstream and link it if that is preferred.

Visual Proof

N/A — this change is latency, memory, and result-state fidelity; it does not redesign the pane, and no before/after screenshot or video would show a difference in layout or content beyond timing. The evidence that matters is numeric and is linked: docs/perf/workspace-path-index-matrix-phase6a.md, …-phase6b.md, …-checkpoint-phase7.md, …-catalog-blocks-phase6b.md, plus the real-workspace numbers in "Testing" below. A rendered end-to-end paint capture could not be produced in this environment (no Electron/Playwright capture path available); the decomposition (host compute, projection, commit) was measured instead and the paint row is explicitly marked unmeasured in the matrix summary rather than estimated.

Testing

Automated:

  • pnpm tc — passes.
  • The commit is cut from the current origin/nplez1/main (ec49c02a72), not from the stale branch, so the PR contains only this feature (302 files: 212 added, 88 modified, 2 deleted) — verified with git merge-base --is-ancestor.
  • pnpm test on the touched suites, on the rebased commit: src/shared/ + src/main/workspace-path-index/ + src/main/ipc/ (13,794 tests), src/relay/ + src/main/runtime/ (10,536), renderer groups (4,255), browser-pane/tab-group/opencode (1,210) — all green. One worker-cancellation test in the shared suite is timing-flaky under heavy parallel load; it passes in isolation and on re-run and is untouched by this change.
  • pnpm run test:perf:contracts — 91 structural contracts, including zero subprocess launches on a warm query, bounded scheduler queues, and the build-bound invariant.
  • pnpm exec oxlint on this change's files — exit 0; check:max-lines-ratchet clean; changed-code quality gate 0 findings across 289 files. Repo-wide pnpm exec oxlint --deny-warnings exits 1 on three pre-existing max-lines errors byte-identical at the base (listener-state.ts:369, service-full-cycle-preparation.ts:330, remove-worktree.ts:336), not part of this diff.
  • Correctness: every optimized query is checked against a brute-force complete-snapshot oracle (exact count and full retained page and ordering) across query classes, scope descriptors, both fixture profiles, overlay/delta/compaction, and spilled mode — at 100k/300k by default and 500k/1M behind ORCA_RUN_PATH_SEARCH_SCALE=1.
  • Real workspaces (path lists taken from a MacBook with the user's photoshop repos, measured through the shipped builder and query engine): 186,582 paths → resident, 70.4 MiB retained; 331,432 → resident, 88.8 MiB; 397,097 → resident, 111.0 MiB; warm p95 0.2–74 ms by class.

Manual: macOS (darwin/arm64, Apple M4 Pro) only. Linux, Windows, WSL, and real SSH-host runs were not performed by me; the negotiated remote paths are covered by unit/integration tests (old/new and new/old skew in both directions, runtime→SSH forwarding), and WSL deep-path freshness is documented as a declared limitation.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented by an orchestrated multi-agent workflow directed by me, with the plan (docs/explorer-name-filter-performance-plan.md, local-only by repo policy) written and reviewed interactively first. Models used: GPT-6 Luna (primary implementation and orchestration of each phase), DeepSeek v4.1 Flash (continuation, lint/consolidation, and the budget fix), GPT-6 Sol (focused review of the build-bound fix), Mimo v2.6 Pro (adversarial completeness review of the whole change against the plan's invariants and definition of done). Every phase was verified independently by re-running its suites and inspecting the diff; measurement artifacts were regenerated rather than reused where a change moved them.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Known limits, all documented: this change intentionally replaces upstream stablyai#22369's capped-listing mechanism (see "Why"); three pre-existing repo-wide max-lines lint errors are unrelated to this diff (see "Testing"); resident warm targets are the re-baselined matrix above; spilled mode is slower by design; the 480 MiB build-peak reservation was validated on one machine and deserves re-probing under multi-root pressure; renderer projection cumulative chunk CPU on deep trees is 20–31 ms (per-task stays under 16 ms with no >50 ms long task, and a bounded partial page keeps restart pages fast); input-to-first-paint end-to-end remains unmeasured here; discovery runs through the app's bundled ripgrep (src/main/ripgrep/bundled-ripgrep-path.ts ships one per platform and the SSH deploy pushes one to remote hosts), so a packaged install does not depend on rg being on PATH; only unpackaged dev/test hosts fall back to a PATH rg.

Checklist:

  • This PR is small and focused — it is one topic but deliberately large: a seven-phase architecture with each phase's exit criterion verified separately. Left unticked rather than claimed.
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — pnpm tc ✓; tests ✓ as listed above; pnpm run build:electron-vite ✓ and pnpm run build:relay ✓ (the built worker entry out/main/workspace-path-index-worker-entry.js exists, so the new worker packaging is validated in a real bundle). Lint is green on this change's files; repo-wide oxlint carries the three pre-existing max-lines errors noted above.

The Explore name filter re-walked the workspace on every keystroke. Only the local
fs:listFiles handler warmed the path inventory, which Explorer never calls, so repeated
filtering stayed on a live scan; even when the cache was warm it held two whole path
arrays, dropped them on any change, and matched synchronously on the main thread.

Explorer now leases an execution-host-owned path index and every search ensures it. A
long-lived worker owns one canonical catalog per workspace: pre-folded search text, one
record per path, scope and classification bits, a natural-order permutation, and
budgeted trigram postings that are discarded before the catalog under pressure. Builds
stream acknowledged batches into the worker, publish the requested scope first, and
spill to a versioned block format instead of refusing to index an oversized root.
Watch events publish bounded base/delta generations behind a sequence fence, with
freshness tracked separately from coverage. Remote searches negotiate
filePathSearch.nameFilter.v1 and otherwise stay on the complete bounded live scan.

The renderer dispatches on the next frame with one request in flight, fences every
reply by query/owner/generation/scope, and keeps a previous page visible only when it
is labelled as updating. Filenames and query text never enter diagnostics.

Before: repeated Explorer filtering paid a filesystem walk per keystroke (or stayed
permanently on that path), one to several seconds on a 1M-path workspace.
After: a warm exact substring-AND query with an exact count and a bounded page, in
milliseconds for selective queries and a labelled provisional page within 69 ms of a
restart; admitted capacity reaches 1M paths per root at the default memory budgets.
@nplez1
nplez1 force-pushed the nplez1/explorer-name-filter-perf branch from 7540d91 to ff80598 Compare September 27, 2026 07:39
…r-name-filter-perf

# Conflicts:
#	src/main/ipc/filesystem/filesystem-search-handlers.ts
#	src/main/ipc/filesystem/filesystem-text-search-handler.ts
#	src/renderer/src/store/slices/worktrees/teardown/remove-worktree.ts
#	src/shared/agent-hook-listener/listener-state.ts
#	src/shared/child-process/__fixtures__/child-process-import-allowlist.txt
The anti-slop static-analysis job failed on 180 no-shape-in-symbol-names
findings in the new path-index benchmark/fixture/matrix code. The flagged
axis is the fixture profile (realistic shared-prefix vs adversarial
unshared), not a structural "shape":

  WorkspacePathCatalogShape   -> WorkspacePathCatalogProfile
  ..._BENCHMARK_SHAPES        -> ..._BENCHMARK_PROFILES
  SPILLED_SCALE_SHAPES        -> SPILLED_SCALE_PROFILES
  CATALOG_SHAPES              -> CATALOG_PROFILES
  shape / shapes / SHAPES     -> profile / profiles / PROFILES
  rowShape                    -> visibleRowFields

The same PR introduced seven other anti-slop findings in files the job
scans; fix them too so the gate is green: read checkpoint-manifest fields
through a typed unknown-record guard instead of Reflect.get(object), and
give the projection-identity WeakMap a named owner type.

The docs/perf matrix JSON is a gitignored local artifact, so its `shape`
key follows the rename to `profile`; config/scripts/workspace-path-index-report.mjs
reads the new key. The user-facing ORCA_PATH_INDEX_CHECKPOINT_SHAPE env var
and the persisted/wire string values are unchanged.
… of render

React Doctor's changed-lines gate flagged three render-phase effects in this change:
the name-filter query ref was written during render, the Explorer key handler's
canActivateRows ref likewise, and the query-lifecycle test's probe called its
onState prop during render (React may replay or discard render work, so the
callback could fire for UI that never commits).

The refs now sync in effects (the imperative setter still writes ahead of state so
back-to-back updates keep their equality short-circuit), and the probe reports from
an effect. Behaviour is unchanged; the flagged assertions still hold.
…h catalog

The new honest-state copy (updating, indexing, searching, partial-coverage,
projection budget/failure, live-scan-complete, list-unavailable) needs its
generated keys, which verify:localization-catalog requires.
@nplez1
nplez1 merged this pull request into nplez1/main Sep 27, 2026
45 checks passed
nplez1 added a commit that referenced this pull request Sep 27, 2026
…34)

* perf(explorer): serve the name filter from a worker-owned path index

The Explore name filter re-walked the workspace on every keystroke. Only the local
fs:listFiles handler warmed the path inventory, which Explorer never calls, so repeated
filtering stayed on a live scan; even when the cache was warm it held two whole path
arrays, dropped them on any change, and matched synchronously on the main thread.

Explorer now leases an execution-host-owned path index and every search ensures it. A
long-lived worker owns one canonical catalog per workspace: pre-folded search text, one
record per path, scope and classification bits, a natural-order permutation, and
budgeted trigram postings that are discarded before the catalog under pressure. Builds
stream acknowledged batches into the worker, publish the requested scope first, and
spill to a versioned block format instead of refusing to index an oversized root.
Watch events publish bounded base/delta generations behind a sequence fence, with
freshness tracked separately from coverage. Remote searches negotiate
filePathSearch.nameFilter.v1 and otherwise stay on the complete bounded live scan.

The renderer dispatches on the next frame with one request in flight, fences every
reply by query/owner/generation/scope, and keeps a previous page visible only when it
is labelled as updating. Filenames and query text never enter diagnostics.

Before: repeated Explorer filtering paid a filesystem walk per keystroke (or stayed
permanently on that path), one to several seconds on a 1M-path workspace.
After: a warm exact substring-AND query with an exact count and a bounded page, in
milliseconds for selective queries and a labelled provisional page within 69 ms of a
restart; admitted capacity reaches 1M paths per root at the default memory budgets.

* fix(lint): name the path-index fixture and benchmark axes by domain role

The anti-slop static-analysis job failed on 180 no-shape-in-symbol-names
findings in the new path-index benchmark/fixture/matrix code. The flagged
axis is the fixture profile (realistic shared-prefix vs adversarial
unshared), not a structural "shape":

  WorkspacePathCatalogShape   -> WorkspacePathCatalogProfile
  ..._BENCHMARK_SHAPES        -> ..._BENCHMARK_PROFILES
  SPILLED_SCALE_SHAPES        -> SPILLED_SCALE_PROFILES
  CATALOG_SHAPES              -> CATALOG_PROFILES
  shape / shapes / SHAPES     -> profile / profiles / PROFILES
  rowShape                    -> visibleRowFields

The same PR introduced seven other anti-slop findings in files the job
scans; fix them too so the gate is green: read checkpoint-manifest fields
through a typed unknown-record guard instead of Reflect.get(object), and
give the projection-identity WeakMap a named owner type.

The docs/perf matrix JSON is a gitignored local artifact, so its `shape`
key follows the rename to `profile`; config/scripts/workspace-path-index-report.mjs
reads the new key. The user-facing ORCA_PATH_INDEX_CHECKPOINT_SHAPE env var
and the persisted/wire string values are unchanged.

* fix(renderer): keep the name-filter ref sync and list-state probe out of render

React Doctor's changed-lines gate flagged three render-phase effects in this change:
the name-filter query ref was written during render, the Explorer key handler's
canActivateRows ref likewise, and the query-lifecycle test's probe called its
onState prop during render (React may replay or discard render work, so the
callback could fire for UI that never commits).

The refs now sync in effects (the imperative setter still writes ahead of state so
back-to-back updates keep their equality short-circuit), and the probe reports from
an effect. Behaviour is unchanged; the flagged assertions still hold.

* chore(i18n): add the Explorer name-filter state strings to the English catalog

The new honest-state copy (updating, indexing, searching, partial-coverage,
projection budget/failure, live-scan-complete, list-unavailable) needs its
generated keys, which verify:localization-catalog requires.
nplez1 added a commit that referenced this pull request Sep 29, 2026
Five files exceed the oxlint max-lines budget on nplez1/main and have no suppression, so the
whole-repo `pnpm exec oxlint` in the static-analysis job fails for every PR cut from it. They
were pushed over by fork-only commits (`#34`, and three direct commits) that never ran PR CI.
The repo's rule is to split rather than suppress, so this extracts cohesive pieces:

- filesystem-watcher.test.ts: the local/WSL lifecycle tests move to
  filesystem-watcher-local-lifecycle.test.ts.
- filesystem-watcher-local-subscription.ts: scheduleLocalWatcherTeardown moves to
  filesystem-watcher-local-teardown.ts.
- ssh-target-cleanup.ts: the per-tab session helpers move to ssh-target-tab-sessions.ts.
- ai-vault-session-refresh.ts: the session-ids key moves to ai-vault-session-ids.ts.
- accounts-search.ts: the Grok and Cursor search entries move to
  accounts-search-extra-providers.ts and are re-exported.

No behavior change; the affected suites pass.
nplez1 added a commit that referenced this pull request Sep 29, 2026
* feat(checks): make the Jenkins build tree readable at scale

The Jenkins details from #39 read the build's stage list but listed every stage in the Checks
pane, buried failures under it, kept an Output box that only repeated the build name, and
stopped at a bare error when the account could not read the job.

- Pane: list only the stages still running and the ones that failed, running first, capped at
  eight, with a "+N more stages" line — a pipeline can have hundreds.
- Detail page: render the stages as a nested tree (stage -> its wfapi flow nodes) like Blue
  Ocean, with failed and running stages open by default.
- Detail page: a Failures block under the run header names each failed stage and its error
  text, so "what broke" needs no scrolling.
- Detail page: drop the Output box for a stage list; the build metadata is the run summary.
- Settings: a Jenkins read failure the user can fix (no server, rejected token, no permission)
  now shows an "Open Jenkins settings" button that deep-links to the Jenkins card.

Main reads each stage's own wfapi/describe (its _links.self.href, bounded to 40 requests at
six concurrent, failed/running first under a four-second budget) for the steps and failure
text, and carries the flow nodes on an optional PRCheckStep.children. The Jenkins node id is
kept so repeated stage names (loops, parallel branches) cannot collide as React keys.

* fix(lint): split files over the max-lines budget

Five files exceed the oxlint max-lines budget on nplez1/main and have no suppression, so the
whole-repo `pnpm exec oxlint` in the static-analysis job fails for every PR cut from it. They
were pushed over by fork-only commits (`#34`, and three direct commits) that never ran PR CI.
The repo's rule is to split rather than suppress, so this extracts cohesive pieces:

- filesystem-watcher.test.ts: the local/WSL lifecycle tests move to
  filesystem-watcher-local-lifecycle.test.ts.
- filesystem-watcher-local-subscription.ts: scheduleLocalWatcherTeardown moves to
  filesystem-watcher-local-teardown.ts.
- ssh-target-cleanup.ts: the per-tab session helpers move to ssh-target-tab-sessions.ts.
- ai-vault-session-refresh.ts: the session-ids key moves to ai-vault-session-ids.ts.
- accounts-search.ts: the Grok and Cursor search entries move to
  accounts-search-extra-providers.ts and are re-exported.

No behavior change; the affected suites pass.
nplez1 added a commit that referenced this pull request Sep 29, 2026
…34)

* perf(explorer): serve the name filter from a worker-owned path index

The Explore name filter re-walked the workspace on every keystroke. Only the local
fs:listFiles handler warmed the path inventory, which Explorer never calls, so repeated
filtering stayed on a live scan; even when the cache was warm it held two whole path
arrays, dropped them on any change, and matched synchronously on the main thread.

Explorer now leases an execution-host-owned path index and every search ensures it. A
long-lived worker owns one canonical catalog per workspace: pre-folded search text, one
record per path, scope and classification bits, a natural-order permutation, and
budgeted trigram postings that are discarded before the catalog under pressure. Builds
stream acknowledged batches into the worker, publish the requested scope first, and
spill to a versioned block format instead of refusing to index an oversized root.
Watch events publish bounded base/delta generations behind a sequence fence, with
freshness tracked separately from coverage. Remote searches negotiate
filePathSearch.nameFilter.v1 and otherwise stay on the complete bounded live scan.

The renderer dispatches on the next frame with one request in flight, fences every
reply by query/owner/generation/scope, and keeps a previous page visible only when it
is labelled as updating. Filenames and query text never enter diagnostics.

Before: repeated Explorer filtering paid a filesystem walk per keystroke (or stayed
permanently on that path), one to several seconds on a 1M-path workspace.
After: a warm exact substring-AND query with an exact count and a bounded page, in
milliseconds for selective queries and a labelled provisional page within 69 ms of a
restart; admitted capacity reaches 1M paths per root at the default memory budgets.

* fix(lint): name the path-index fixture and benchmark axes by domain role

The anti-slop static-analysis job failed on 180 no-shape-in-symbol-names
findings in the new path-index benchmark/fixture/matrix code. The flagged
axis is the fixture profile (realistic shared-prefix vs adversarial
unshared), not a structural "shape":

  WorkspacePathCatalogShape   -> WorkspacePathCatalogProfile
  ..._BENCHMARK_SHAPES        -> ..._BENCHMARK_PROFILES
  SPILLED_SCALE_SHAPES        -> SPILLED_SCALE_PROFILES
  CATALOG_SHAPES              -> CATALOG_PROFILES
  shape / shapes / SHAPES     -> profile / profiles / PROFILES
  rowShape                    -> visibleRowFields

The same PR introduced seven other anti-slop findings in files the job
scans; fix them too so the gate is green: read checkpoint-manifest fields
through a typed unknown-record guard instead of Reflect.get(object), and
give the projection-identity WeakMap a named owner type.

The docs/perf matrix JSON is a gitignored local artifact, so its `shape`
key follows the rename to `profile`; config/scripts/workspace-path-index-report.mjs
reads the new key. The user-facing ORCA_PATH_INDEX_CHECKPOINT_SHAPE env var
and the persisted/wire string values are unchanged.

* fix(renderer): keep the name-filter ref sync and list-state probe out of render

React Doctor's changed-lines gate flagged three render-phase effects in this change:
the name-filter query ref was written during render, the Explorer key handler's
canActivateRows ref likewise, and the query-lifecycle test's probe called its
onState prop during render (React may replay or discard render work, so the
callback could fire for UI that never commits).

The refs now sync in effects (the imperative setter still writes ahead of state so
back-to-back updates keep their equality short-circuit), and the probe reports from
an effect. Behaviour is unchanged; the flagged assertions still hold.

* chore(i18n): add the Explorer name-filter state strings to the English catalog

The new honest-state copy (updating, indexing, searching, partial-coverage,
projection budget/failure, live-scan-complete, list-unavailable) needs its
generated keys, which verify:localization-catalog requires.
nplez1 added a commit that referenced this pull request Sep 29, 2026
* feat(checks): make the Jenkins build tree readable at scale

The Jenkins details from #39 read the build's stage list but listed every stage in the Checks
pane, buried failures under it, kept an Output box that only repeated the build name, and
stopped at a bare error when the account could not read the job.

- Pane: list only the stages still running and the ones that failed, running first, capped at
  eight, with a "+N more stages" line — a pipeline can have hundreds.
- Detail page: render the stages as a nested tree (stage -> its wfapi flow nodes) like Blue
  Ocean, with failed and running stages open by default.
- Detail page: a Failures block under the run header names each failed stage and its error
  text, so "what broke" needs no scrolling.
- Detail page: drop the Output box for a stage list; the build metadata is the run summary.
- Settings: a Jenkins read failure the user can fix (no server, rejected token, no permission)
  now shows an "Open Jenkins settings" button that deep-links to the Jenkins card.

Main reads each stage's own wfapi/describe (its _links.self.href, bounded to 40 requests at
six concurrent, failed/running first under a four-second budget) for the steps and failure
text, and carries the flow nodes on an optional PRCheckStep.children. The Jenkins node id is
kept so repeated stage names (loops, parallel branches) cannot collide as React keys.

* fix(lint): split files over the max-lines budget

Five files exceed the oxlint max-lines budget on nplez1/main and have no suppression, so the
whole-repo `pnpm exec oxlint` in the static-analysis job fails for every PR cut from it. They
were pushed over by fork-only commits (`#34`, and three direct commits) that never ran PR CI.
The repo's rule is to split rather than suppress, so this extracts cohesive pieces:

- filesystem-watcher.test.ts: the local/WSL lifecycle tests move to
  filesystem-watcher-local-lifecycle.test.ts.
- filesystem-watcher-local-subscription.ts: scheduleLocalWatcherTeardown moves to
  filesystem-watcher-local-teardown.ts.
- ssh-target-cleanup.ts: the per-tab session helpers move to ssh-target-tab-sessions.ts.
- ai-vault-session-refresh.ts: the session-ids key moves to ai-vault-session-ids.ts.
- accounts-search.ts: the Grok and Cursor search entries move to
  accounts-search-extra-providers.ts and are re-exported.

No behavior change; the affected suites pass.
nplez1 added a commit that referenced this pull request Oct 1, 2026
…34)

* perf(explorer): serve the name filter from a worker-owned path index

The Explore name filter re-walked the workspace on every keystroke. Only the local
fs:listFiles handler warmed the path inventory, which Explorer never calls, so repeated
filtering stayed on a live scan; even when the cache was warm it held two whole path
arrays, dropped them on any change, and matched synchronously on the main thread.

Explorer now leases an execution-host-owned path index and every search ensures it. A
long-lived worker owns one canonical catalog per workspace: pre-folded search text, one
record per path, scope and classification bits, a natural-order permutation, and
budgeted trigram postings that are discarded before the catalog under pressure. Builds
stream acknowledged batches into the worker, publish the requested scope first, and
spill to a versioned block format instead of refusing to index an oversized root.
Watch events publish bounded base/delta generations behind a sequence fence, with
freshness tracked separately from coverage. Remote searches negotiate
filePathSearch.nameFilter.v1 and otherwise stay on the complete bounded live scan.

The renderer dispatches on the next frame with one request in flight, fences every
reply by query/owner/generation/scope, and keeps a previous page visible only when it
is labelled as updating. Filenames and query text never enter diagnostics.

Before: repeated Explorer filtering paid a filesystem walk per keystroke (or stayed
permanently on that path), one to several seconds on a 1M-path workspace.
After: a warm exact substring-AND query with an exact count and a bounded page, in
milliseconds for selective queries and a labelled provisional page within 69 ms of a
restart; admitted capacity reaches 1M paths per root at the default memory budgets.

* fix(lint): name the path-index fixture and benchmark axes by domain role

The anti-slop static-analysis job failed on 180 no-shape-in-symbol-names
findings in the new path-index benchmark/fixture/matrix code. The flagged
axis is the fixture profile (realistic shared-prefix vs adversarial
unshared), not a structural "shape":

  WorkspacePathCatalogShape   -> WorkspacePathCatalogProfile
  ..._BENCHMARK_SHAPES        -> ..._BENCHMARK_PROFILES
  SPILLED_SCALE_SHAPES        -> SPILLED_SCALE_PROFILES
  CATALOG_SHAPES              -> CATALOG_PROFILES
  shape / shapes / SHAPES     -> profile / profiles / PROFILES
  rowShape                    -> visibleRowFields

The same PR introduced seven other anti-slop findings in files the job
scans; fix them too so the gate is green: read checkpoint-manifest fields
through a typed unknown-record guard instead of Reflect.get(object), and
give the projection-identity WeakMap a named owner type.

The docs/perf matrix JSON is a gitignored local artifact, so its `shape`
key follows the rename to `profile`; config/scripts/workspace-path-index-report.mjs
reads the new key. The user-facing ORCA_PATH_INDEX_CHECKPOINT_SHAPE env var
and the persisted/wire string values are unchanged.

* fix(renderer): keep the name-filter ref sync and list-state probe out of render

React Doctor's changed-lines gate flagged three render-phase effects in this change:
the name-filter query ref was written during render, the Explorer key handler's
canActivateRows ref likewise, and the query-lifecycle test's probe called its
onState prop during render (React may replay or discard render work, so the
callback could fire for UI that never commits).

The refs now sync in effects (the imperative setter still writes ahead of state so
back-to-back updates keep their equality short-circuit), and the probe reports from
an effect. Behaviour is unchanged; the flagged assertions still hold.

* chore(i18n): add the Explorer name-filter state strings to the English catalog

The new honest-state copy (updating, indexing, searching, partial-coverage,
projection budget/failure, live-scan-complete, list-unavailable) needs its
generated keys, which verify:localization-catalog requires.
nplez1 added a commit that referenced this pull request Oct 1, 2026
* feat(checks): make the Jenkins build tree readable at scale

The Jenkins details from #39 read the build's stage list but listed every stage in the Checks
pane, buried failures under it, kept an Output box that only repeated the build name, and
stopped at a bare error when the account could not read the job.

- Pane: list only the stages still running and the ones that failed, running first, capped at
  eight, with a "+N more stages" line — a pipeline can have hundreds.
- Detail page: render the stages as a nested tree (stage -> its wfapi flow nodes) like Blue
  Ocean, with failed and running stages open by default.
- Detail page: a Failures block under the run header names each failed stage and its error
  text, so "what broke" needs no scrolling.
- Detail page: drop the Output box for a stage list; the build metadata is the run summary.
- Settings: a Jenkins read failure the user can fix (no server, rejected token, no permission)
  now shows an "Open Jenkins settings" button that deep-links to the Jenkins card.

Main reads each stage's own wfapi/describe (its _links.self.href, bounded to 40 requests at
six concurrent, failed/running first under a four-second budget) for the steps and failure
text, and carries the flow nodes on an optional PRCheckStep.children. The Jenkins node id is
kept so repeated stage names (loops, parallel branches) cannot collide as React keys.

* fix(lint): split files over the max-lines budget

Five files exceed the oxlint max-lines budget on nplez1/main and have no suppression, so the
whole-repo `pnpm exec oxlint` in the static-analysis job fails for every PR cut from it. They
were pushed over by fork-only commits (`#34`, and three direct commits) that never ran PR CI.
The repo's rule is to split rather than suppress, so this extracts cohesive pieces:

- filesystem-watcher.test.ts: the local/WSL lifecycle tests move to
  filesystem-watcher-local-lifecycle.test.ts.
- filesystem-watcher-local-subscription.ts: scheduleLocalWatcherTeardown moves to
  filesystem-watcher-local-teardown.ts.
- ssh-target-cleanup.ts: the per-tab session helpers move to ssh-target-tab-sessions.ts.
- ai-vault-session-refresh.ts: the session-ids key moves to ai-vault-session-ids.ts.
- accounts-search.ts: the Grok and Cursor search entries move to
  accounts-search-extra-providers.ts and are re-exported.

No behavior change; the affected suites pass.
nplez1 added a commit that referenced this pull request Oct 1, 2026
Found by the full suite, all of them shapes where upstream's new test or new
field met a fork surface no conflict marker connected:

- **`tui-agent-config-table.ts` lost the fork's Claude trust presets.** `#34`
  extracted the table into a new module, so git saw a pure file add — but
  upstream's `21d4ae9448` added `preflightTrust` to `claude` and
  `claude-agent-teams` in the same range, and the extracted copy was taken from
  the fork's pre-sync table. The trust preflight was silently off for both
  launch modes; `agent-workspace-trust-spawn`'s preset census and four
  spawn/relay suites caught it.
- **Two upstream tests hardcoded `~/.orca`** (`windows-hook-files` — a new file
  this sync — and `hook-process-capture`), while the fork's managed hooks write
  `~/.orca-np`. Both now derive from `HOME_DIRECTORY_NAME`, so the next rename
  cannot leave them behind.
- **`FileExplorerFilesTreePane` read `nameFilterFiles` eagerly** where upstream
  short-circuits behind `hasNameFilter`, so the pane threw in upstream's
  partial fixture; and `hasError` used `!!treeError`, which reads an empty-string
  error as "no error" — upstream's own case says an empty message is a message.
- **One upstream test mock** (`structured-agent-session-accepted-send-capability`)
  predates the fork's path-search capability module, which subscribes on import.
- **`UNHIDDEN_SPAWNER_PIN` 60 → 59**, taken from the failing test's own message.
  Two upstream files moved off direct spawning in this range.
nplez1 added a commit that referenced this pull request Oct 6, 2026
…34)

* perf(explorer): serve the name filter from a worker-owned path index

The Explore name filter re-walked the workspace on every keystroke. Only the local
fs:listFiles handler warmed the path inventory, which Explorer never calls, so repeated
filtering stayed on a live scan; even when the cache was warm it held two whole path
arrays, dropped them on any change, and matched synchronously on the main thread.

Explorer now leases an execution-host-owned path index and every search ensures it. A
long-lived worker owns one canonical catalog per workspace: pre-folded search text, one
record per path, scope and classification bits, a natural-order permutation, and
budgeted trigram postings that are discarded before the catalog under pressure. Builds
stream acknowledged batches into the worker, publish the requested scope first, and
spill to a versioned block format instead of refusing to index an oversized root.
Watch events publish bounded base/delta generations behind a sequence fence, with
freshness tracked separately from coverage. Remote searches negotiate
filePathSearch.nameFilter.v1 and otherwise stay on the complete bounded live scan.

The renderer dispatches on the next frame with one request in flight, fences every
reply by query/owner/generation/scope, and keeps a previous page visible only when it
is labelled as updating. Filenames and query text never enter diagnostics.

Before: repeated Explorer filtering paid a filesystem walk per keystroke (or stayed
permanently on that path), one to several seconds on a 1M-path workspace.
After: a warm exact substring-AND query with an exact count and a bounded page, in
milliseconds for selective queries and a labelled provisional page within 69 ms of a
restart; admitted capacity reaches 1M paths per root at the default memory budgets.

* fix(lint): name the path-index fixture and benchmark axes by domain role

The anti-slop static-analysis job failed on 180 no-shape-in-symbol-names
findings in the new path-index benchmark/fixture/matrix code. The flagged
axis is the fixture profile (realistic shared-prefix vs adversarial
unshared), not a structural "shape":

  WorkspacePathCatalogShape   -> WorkspacePathCatalogProfile
  ..._BENCHMARK_SHAPES        -> ..._BENCHMARK_PROFILES
  SPILLED_SCALE_SHAPES        -> SPILLED_SCALE_PROFILES
  CATALOG_SHAPES              -> CATALOG_PROFILES
  shape / shapes / SHAPES     -> profile / profiles / PROFILES
  rowShape                    -> visibleRowFields

The same PR introduced seven other anti-slop findings in files the job
scans; fix them too so the gate is green: read checkpoint-manifest fields
through a typed unknown-record guard instead of Reflect.get(object), and
give the projection-identity WeakMap a named owner type.

The docs/perf matrix JSON is a gitignored local artifact, so its `shape`
key follows the rename to `profile`; config/scripts/workspace-path-index-report.mjs
reads the new key. The user-facing ORCA_PATH_INDEX_CHECKPOINT_SHAPE env var
and the persisted/wire string values are unchanged.

* fix(renderer): keep the name-filter ref sync and list-state probe out of render

React Doctor's changed-lines gate flagged three render-phase effects in this change:
the name-filter query ref was written during render, the Explorer key handler's
canActivateRows ref likewise, and the query-lifecycle test's probe called its
onState prop during render (React may replay or discard render work, so the
callback could fire for UI that never commits).

The refs now sync in effects (the imperative setter still writes ahead of state so
back-to-back updates keep their equality short-circuit), and the probe reports from
an effect. Behaviour is unchanged; the flagged assertions still hold.

* chore(i18n): add the Explorer name-filter state strings to the English catalog

The new honest-state copy (updating, indexing, searching, partial-coverage,
projection budget/failure, live-scan-complete, list-unavailable) needs its
generated keys, which verify:localization-catalog requires.
nplez1 added a commit that referenced this pull request Oct 6, 2026
* feat(checks): make the Jenkins build tree readable at scale

The Jenkins details from #39 read the build's stage list but listed every stage in the Checks
pane, buried failures under it, kept an Output box that only repeated the build name, and
stopped at a bare error when the account could not read the job.

- Pane: list only the stages still running and the ones that failed, running first, capped at
  eight, with a "+N more stages" line — a pipeline can have hundreds.
- Detail page: render the stages as a nested tree (stage -> its wfapi flow nodes) like Blue
  Ocean, with failed and running stages open by default.
- Detail page: a Failures block under the run header names each failed stage and its error
  text, so "what broke" needs no scrolling.
- Detail page: drop the Output box for a stage list; the build metadata is the run summary.
- Settings: a Jenkins read failure the user can fix (no server, rejected token, no permission)
  now shows an "Open Jenkins settings" button that deep-links to the Jenkins card.

Main reads each stage's own wfapi/describe (its _links.self.href, bounded to 40 requests at
six concurrent, failed/running first under a four-second budget) for the steps and failure
text, and carries the flow nodes on an optional PRCheckStep.children. The Jenkins node id is
kept so repeated stage names (loops, parallel branches) cannot collide as React keys.

* fix(lint): split files over the max-lines budget

Five files exceed the oxlint max-lines budget on nplez1/main and have no suppression, so the
whole-repo `pnpm exec oxlint` in the static-analysis job fails for every PR cut from it. They
were pushed over by fork-only commits (`#34`, and three direct commits) that never ran PR CI.
The repo's rule is to split rather than suppress, so this extracts cohesive pieces:

- filesystem-watcher.test.ts: the local/WSL lifecycle tests move to
  filesystem-watcher-local-lifecycle.test.ts.
- filesystem-watcher-local-subscription.ts: scheduleLocalWatcherTeardown moves to
  filesystem-watcher-local-teardown.ts.
- ssh-target-cleanup.ts: the per-tab session helpers move to ssh-target-tab-sessions.ts.
- ai-vault-session-refresh.ts: the session-ids key moves to ai-vault-session-ids.ts.
- accounts-search.ts: the Grok and Cursor search entries move to
  accounts-search-extra-providers.ts and are re-exported.

No behavior change; the affected suites pass.
nplez1 added a commit that referenced this pull request Oct 6, 2026
Found by the full suite, all of them shapes where upstream's new test or new
field met a fork surface no conflict marker connected:

- **`tui-agent-config-table.ts` lost the fork's Claude trust presets.** `#34`
  extracted the table into a new module, so git saw a pure file add — but
  upstream's `21d4ae9448` added `preflightTrust` to `claude` and
  `claude-agent-teams` in the same range, and the extracted copy was taken from
  the fork's pre-sync table. The trust preflight was silently off for both
  launch modes; `agent-workspace-trust-spawn`'s preset census and four
  spawn/relay suites caught it.
- **Two upstream tests hardcoded `~/.orca`** (`windows-hook-files` — a new file
  this sync — and `hook-process-capture`), while the fork's managed hooks write
  `~/.orca-np`. Both now derive from `HOME_DIRECTORY_NAME`, so the next rename
  cannot leave them behind.
- **`FileExplorerFilesTreePane` read `nameFilterFiles` eagerly** where upstream
  short-circuits behind `hasNameFilter`, so the pane threw in upstream's
  partial fixture; and `hasError` used `!!treeError`, which reads an empty-string
  error as "no error" — upstream's own case says an empty message is a message.
- **One upstream test mock** (`structured-agent-session-accepted-send-capability`)
  predates the fork's path-search capability module, which subscribes on import.
- **`UNHIDDEN_SPAWNER_PIN` 60 → 59**, taken from the failing test's own message.
  Two upstream files moved off direct spawning in this range.
@nplez1
nplez1 deleted the nplez1/explorer-name-filter-perf branch October 24, 2026 03:23
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