Skip to content

test(agent-status): inventory legacy pane identity surfaces - #16575

Merged
brennanb2025 merged 12 commits into
mainfrom
brennanb2025/identity-census-pr1
Aug 26, 2026
Merged

brennanb2025 merged 12 commits into
mainfrom
brennanb2025/identity-census-pr1

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​371 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​371
Prod 1 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5

ELI5

Orca currently has many places that decide which agent owns a terminal pane. Before migrating those decisions, this PR records every production occurrence of nine named legacy identity helpers plus a curated set of known direct branches. The test ratchet prevents those named-helper occurrences from changing unnoticed and keeps the recorded direct sites visible for review.

This PR does not change any identity decision and does not collect real-use measurements.

What changed

  • Adds a mechanically closed inventory test for nine named legacy identity-helper identifiers across desktop and mobile source roots, including exact per-file occurrence counts.
  • Classifies the inventoried sites as parser implementations, activity-only logic, formatters, evidence producers, identity consumers, or action consumers.
  • Records a curated list of known direct single-source identity and action branches that do not use the named legacy helpers, with a marker pinned at each recorded path.
  • Adds mixed-version resolver coverage proving that a completed hook without a run key cannot override a newer launch record.
  • Removes a stale comment that claimed the already-existing pane owner resolver was absent.

Scope and non-goals

  • No production behavior changes.
  • No UI, mobile behavior, IPC/RPC, wire, persistence, telemetry, polling, or diagnostics changes.
  • No live census or host-cohort data is collected.
  • Real-use measurement remains deferred until authoritative native, WSL, SSH, and relay evidence can reach an appropriate existing reporting boundary without inventing a parallel snapshot path.

Linked issue

Inventory foundation for #9236. This PR does not resolve that issue or migrate any consumer.

Testing

  • Focused pane-agent-identity suite: 32 tests passed across 2 files.
  • Full TypeScript typecheck passed.
  • Direct oxlint, oxfmt check, and git diff check passed.

Visual proof

N/A — test-only inventory and regression coverage; no rendered behavior changes.

Notes

  • The named-helper scan spans both src and mobile/src, so new occurrences of those nine identifiers cannot drift outside that ratchet.
  • The direct-surface marker list is curated rather than an exhaustive semantic scan: it anchors known paths but does not discover new inline identity branches.
  • The final product diff is limited to the inventory test, one resolver regression test, and stale-comment cleanup.

…nsumer

PR 1 of the identity migration. It changes no displayed or routed identity — it only measures.

Why measure first: the hierarchy shipped in #16148/#16157 has zero consumers, while ~31 sites still
derive identity independently. Every migration decision after this is currently a guess, including
the one that matters most — how often a real pane has no evidence at all. A live P0 reports "No
Claude status shown", and this design trades toward showing nothing when uncertain, so the blank
rate has to be a number before any surface moves.

- `pane-agent-identity-evidence.ts` — one assembler that gathers a pane's evidence, so consumers
  stop each inventing their own ladder.
- `pane-agent-identity-census.ts` — shadow-only counters keyed by host kind (native / wsl-host /
  wsl-distro / ssh / relay) and launch mode (typed / orca-launch / resume). Records a bitmask of
  which sources were present and whether the resolver returned null or ambiguous. No titles,
  prompts, paths, handles, or agent text.
- `pane-agent-identity-inventory.test.ts` — a ratchet that fails when a legacy identity helper
  gains a new production caller, so the surface cannot grow while the migration runs.

Three review findings are encoded rather than deferred: launch stays above run-key-less completed
hooks (promoting the hook lets a stale record hijack a pane); OMP/Pi evidence is owner-normalized
before assembly, since OMP emits Pi-compatible frames and a wrapper's hook would otherwise be read
as the agent it wraps; and Windows-side `wsl.exe` is rejected as process evidence, because the host
observes the distro wrapper rather than the agent inside it.

The census cannot be completed from a worktree. It needs representative native, SSH, WSL and relay
cohorts collected from real use, and that review is the gate on PR 3 — not this PR.
@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added a Vitest inventory ratchet that scans pane-agent identity helpers and direct identity/action surfaces across src and mobile/src. The test strips comments and verifies expected references, markers, and classifications. Added resolver coverage for run-key-less completed-hook evidence versus launch evidence. Removed an obsolete comment about the deferred pane-agent owner resolver.

Merge Risk: 🔵 Low · up to e6d26

The PR adds inventory and regression coverage without changing runtime behavior. It is mergeable with owner awareness that the inventory could undercount legacy identity surfaces when markers appear in string literals or when resolver results are unavailable.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding a test inventory for legacy pane-agent identity surfaces.
Description check ✅ Passed The description explains the purpose, scope, linked issue (#9236), testing results, and absence of visual changes. It is mostly complete despite omitted optional checklist details.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 375b80b4-4de4-4f4e-96a1-af695951e681

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5f5ce and a6c5be7.

📒 Files selected for processing (7)
  • src/renderer/src/lib/pane-agent-evidence.ts
  • src/shared/pane-agent-identity-census.test.ts
  • src/shared/pane-agent-identity-census.ts
  • src/shared/pane-agent-identity-evidence.test.ts
  • src/shared/pane-agent-identity-evidence.ts
  • src/shared/pane-agent-identity-inventory.test.ts
  • src/shared/pane-agent-identity-resolver.test.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/lib/pane-agent-evidence.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

row.noEvidence += sources.length === 0 ? 1 : 0
row.titleOnly += sources.length > 0 && sources.every((source) => source === 'title') ? 1 : 0
row.noNonTitleEvidence += sources.every((source) => source === 'title') ? 1 : 0
row.ambiguousTopRank += resolution.ambiguousAt === undefined ? 0 : 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Count non-ambiguous null resolutions. Line 90 records only ambiguity. With sibling-only evidence, the resolver returns agent: null, but this row records neither noEvidence nor ambiguity. Add a null-resolution counter based on resolution.agent === null.

@brennanb2025 brennanb2025 changed the title feat(agent-status): measure identity evidence before migrating any consumer test(agent-status): inventory legacy pane identity surfaces Aug 26, 2026
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 15d451e0-32ca-4df3-985c-c77194db9907

📥 Commits

Reviewing files that changed from the base of the PR and between 256f23c and e6d26d4.

📒 Files selected for processing (3)
  • src/renderer/src/lib/pane-agent-evidence.ts
  • src/shared/pane-agent-identity-inventory.test.ts
  • src/shared/pane-agent-identity-resolver.test.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/lib/pane-agent-evidence.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/pane-agent-identity-resolver.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


it('pins direct single-source identity and action branches outside named helpers', () => {
for (const site of DIRECT_SINGLE_SOURCE_SURFACES) {
const source = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Blank string literals before checking direct markers.

stripComments retains strings. A marker in a message or template literal can keep this ratchet passing after the direct branch is removed. Apply blankStringContents after comment removal, with the same desynchronization check used above.

Proposed fix
-      const source = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8'))
+      const decommentedSource = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8'))
+      if (blankStringContentsDesynced(decommentedSource)) {
+        throw new Error(`String scanner desynchronized while inventorying ${site.path}`)
+      }
+      const source = blankStringContents(decommentedSource)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const source = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8'))
const decommentedSource = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8'))
if (blankStringContentsDesynced(decommentedSource)) {
throw new Error(`String scanner desynchronized while inventorying ${site.path}`)
}
const source = blankStringContents(decommentedSource)

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: LAND

Reviewed exact head e6d26d42e6b153a490e74c91d904efd3252d63de.

  • The original runtime-census direction was superseded with a focused inventory-only foundation; this PR does not claim live measurement or change runtime behavior.
  • Same-model review/fix loops reached explicit CLEAN. The final readiness checklist is PASS / CLEAN with 0 P0, 0 P1, and 0 P2.
  • The inventory ratchet now pins exact helper occurrences and fails closed if the shared source scanner desynchronizes. PR wording accurately distinguishes the closed nine-helper inventory from the curated, non-exhaustive direct-site list.
  • Local validation passed: 32/32 focused tests, full typecheck, direct oxlint, formatting, and diff checks.
  • All required PR checks are green on Node 24 and 26, Linux, and Windows packaging. One unrelated Node 24 Electron cookie test initially lost its CI X server; the unchanged-sha retry passed.
  • Electron UI validation and screenshots: N/A because no rendered behavior changed. Mobile emulator, SSH, and Windows runtime QA: N/A because no mobile, remote, or platform runtime behavior changed.
  • Separate inherited main repairs landed as d9c77c5830 and 256f23c7a0, restoring the automation checks and destination-project validation failures encountered during review.

Residual follow-up: real host-authoritative usage measurement across native, WSL, SSH, and relay remains separate instrumentation work and is intentionally outside this PR.

@brennanb2025
brennanb2025 merged commit a624e7c into main Aug 26, 2026
93 of 95 checks passed
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…#16575)

* feat(agent-status): measure identity evidence before migrating any consumer

PR 1 of the identity migration. It changes no displayed or routed identity — it only measures.

Why measure first: the hierarchy shipped in stablyai#16148/stablyai#16157 has zero consumers, while ~31 sites still
derive identity independently. Every migration decision after this is currently a guess, including
the one that matters most — how often a real pane has no evidence at all. A live P0 reports "No
Claude status shown", and this design trades toward showing nothing when uncertain, so the blank
rate has to be a number before any surface moves.

- `pane-agent-identity-evidence.ts` — one assembler that gathers a pane's evidence, so consumers
  stop each inventing their own ladder.
- `pane-agent-identity-census.ts` — shadow-only counters keyed by host kind (native / wsl-host /
  wsl-distro / ssh / relay) and launch mode (typed / orca-launch / resume). Records a bitmask of
  which sources were present and whether the resolver returned null or ambiguous. No titles,
  prompts, paths, handles, or agent text.
- `pane-agent-identity-inventory.test.ts` — a ratchet that fails when a legacy identity helper
  gains a new production caller, so the surface cannot grow while the migration runs.

Three review findings are encoded rather than deferred: launch stays above run-key-less completed
hooks (promoting the hook lets a stale record hijack a pane); OMP/Pi evidence is owner-normalized
before assembly, since OMP emits Pi-compatible frames and a wrapper's hook would otherwise be read
as the agent it wraps; and Windows-side `wsl.exe` is rejected as process evidence, because the host
observes the distro wrapper rather than the agent inside it.

The census cannot be completed from a worktree. It needs representative native, SSH, WSL and relay
cohorts collected from real use, and that review is the gate on PR 3 — not this PR.

* test(agent-status): keep identity migration inventory-only

* test(agent-status): reuse reliable source scanner

* test(agent-status): bound inventory scan work

* test(agent-status): avoid inventory path false negatives

* test(agent-status): refresh identity inventory after base repair

* test(agent-status): correct inventory classifications

* test(agent-status): correct action boundary inventory

* test(agent-status): pin inventory occurrence counts

* test(agent-status): fail closed on scanner desync
rahuljangirworks pushed a commit to rahuljangirworks/veer that referenced this pull request Aug 27, 2026
…#16575)

* feat(agent-status): measure identity evidence before migrating any consumer

PR 1 of the identity migration. It changes no displayed or routed identity — it only measures.

Why measure first: the hierarchy shipped in stablyai#16148/stablyai#16157 has zero consumers, while ~31 sites still
derive identity independently. Every migration decision after this is currently a guess, including
the one that matters most — how often a real pane has no evidence at all. A live P0 reports "No
Claude status shown", and this design trades toward showing nothing when uncertain, so the blank
rate has to be a number before any surface moves.

- `pane-agent-identity-evidence.ts` — one assembler that gathers a pane's evidence, so consumers
  stop each inventing their own ladder.
- `pane-agent-identity-census.ts` — shadow-only counters keyed by host kind (native / wsl-host /
  wsl-distro / ssh / relay) and launch mode (typed / orca-launch / resume). Records a bitmask of
  which sources were present and whether the resolver returned null or ambiguous. No titles,
  prompts, paths, handles, or agent text.
- `pane-agent-identity-inventory.test.ts` — a ratchet that fails when a legacy identity helper
  gains a new production caller, so the surface cannot grow while the migration runs.

Three review findings are encoded rather than deferred: launch stays above run-key-less completed
hooks (promoting the hook lets a stale record hijack a pane); OMP/Pi evidence is owner-normalized
before assembly, since OMP emits Pi-compatible frames and a wrapper's hook would otherwise be read
as the agent it wraps; and Windows-side `wsl.exe` is rejected as process evidence, because the host
observes the distro wrapper rather than the agent inside it.

The census cannot be completed from a worktree. It needs representative native, SSH, WSL and relay
cohorts collected from real use, and that review is the gate on PR 3 — not this PR.

* test(agent-status): keep identity migration inventory-only

* test(agent-status): reuse reliable source scanner

* test(agent-status): bound inventory scan work

* test(agent-status): avoid inventory path false negatives

* test(agent-status): refresh identity inventory after base repair

* test(agent-status): correct inventory classifications

* test(agent-status): correct action boundary inventory

* test(agent-status): pin inventory occurrence counts

* test(agent-status): fail closed on scanner desync
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 28, 2026
…#16575)

* feat(agent-status): measure identity evidence before migrating any consumer

PR 1 of the identity migration. It changes no displayed or routed identity — it only measures.

Why measure first: the hierarchy shipped in stablyai#16148/stablyai#16157 has zero consumers, while ~31 sites still
derive identity independently. Every migration decision after this is currently a guess, including
the one that matters most — how often a real pane has no evidence at all. A live P0 reports "No
Claude status shown", and this design trades toward showing nothing when uncertain, so the blank
rate has to be a number before any surface moves.

- `pane-agent-identity-evidence.ts` — one assembler that gathers a pane's evidence, so consumers
  stop each inventing their own ladder.
- `pane-agent-identity-census.ts` — shadow-only counters keyed by host kind (native / wsl-host /
  wsl-distro / ssh / relay) and launch mode (typed / orca-launch / resume). Records a bitmask of
  which sources were present and whether the resolver returned null or ambiguous. No titles,
  prompts, paths, handles, or agent text.
- `pane-agent-identity-inventory.test.ts` — a ratchet that fails when a legacy identity helper
  gains a new production caller, so the surface cannot grow while the migration runs.

Three review findings are encoded rather than deferred: launch stays above run-key-less completed
hooks (promoting the hook lets a stale record hijack a pane); OMP/Pi evidence is owner-normalized
before assembly, since OMP emits Pi-compatible frames and a wrapper's hook would otherwise be read
as the agent it wraps; and Windows-side `wsl.exe` is rejected as process evidence, because the host
observes the distro wrapper rather than the agent inside it.

The census cannot be completed from a worktree. It needs representative native, SSH, WSL and relay
cohorts collected from real use, and that review is the gate on PR 3 — not this PR.

* test(agent-status): keep identity migration inventory-only

* test(agent-status): reuse reliable source scanner

* test(agent-status): bound inventory scan work

* test(agent-status): avoid inventory path false negatives

* test(agent-status): refresh identity inventory after base repair

* test(agent-status): correct inventory classifications

* test(agent-status): correct action boundary inventory

* test(agent-status): pin inventory occurrence counts

* test(agent-status): fail closed on scanner desync

(cherry picked from commit a624e7c)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…#16575)

* feat(agent-status): measure identity evidence before migrating any consumer

PR 1 of the identity migration. It changes no displayed or routed identity — it only measures.

Why measure first: the hierarchy shipped in stablyai#16148/stablyai#16157 has zero consumers, while ~31 sites still
derive identity independently. Every migration decision after this is currently a guess, including
the one that matters most — how often a real pane has no evidence at all. A live P0 reports "No
Claude status shown", and this design trades toward showing nothing when uncertain, so the blank
rate has to be a number before any surface moves.

- `pane-agent-identity-evidence.ts` — one assembler that gathers a pane's evidence, so consumers
  stop each inventing their own ladder.
- `pane-agent-identity-census.ts` — shadow-only counters keyed by host kind (native / wsl-host /
  wsl-distro / ssh / relay) and launch mode (typed / orca-launch / resume). Records a bitmask of
  which sources were present and whether the resolver returned null or ambiguous. No titles,
  prompts, paths, handles, or agent text.
- `pane-agent-identity-inventory.test.ts` — a ratchet that fails when a legacy identity helper
  gains a new production caller, so the surface cannot grow while the migration runs.

Three review findings are encoded rather than deferred: launch stays above run-key-less completed
hooks (promoting the hook lets a stale record hijack a pane); OMP/Pi evidence is owner-normalized
before assembly, since OMP emits Pi-compatible frames and a wrapper's hook would otherwise be read
as the agent it wraps; and Windows-side `wsl.exe` is rejected as process evidence, because the host
observes the distro wrapper rather than the agent inside it.

The census cannot be completed from a worktree. It needs representative native, SSH, WSL and relay
cohorts collected from real use, and that review is the gate on PR 3 — not this PR.

* test(agent-status): keep identity migration inventory-only

* test(agent-status): reuse reliable source scanner

* test(agent-status): bound inventory scan work

* test(agent-status): avoid inventory path false negatives

* test(agent-status): refresh identity inventory after base repair

* test(agent-status): correct inventory classifications

* test(agent-status): correct action boundary inventory

* test(agent-status): pin inventory occurrence counts

* test(agent-status): fail closed on scanner desync
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