[PR #5677] [MERGED] test(cli): accept opaque Kuna doctor run tokens #7030

Closed
opened 2026-11-01 21:44:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5677
Author: @morluto
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @cursor[bot]

Base: main ← Head: cursor/fix-doctor-runid-uuid-229b


📝 Commits (2)

  • 3520a08 test(cli): accept opaque Kuna doctor run tokens
  • d472db4 test(cli): require the Kuna doctor run token

📊 Changes

1 file changed (+10 additions, -9 deletions)

View changed files

📝 tests/boundary/cli/doctorCancellation.test.ts (+10 -9)

📄 Description

Summary

doctorCancellation.test.ts fails CI with Zod Invalid UUID on runId before it checks doctor cancellation. Kuna version probes publish an opaque rea-kuna-version-<uuid> run token; the fixture was still requiring a UUID. Human owner: @morluto.

Problem and expected behavior

On current main (c4b6aa306), both Kuna signal cases in tests/boundary/cli/doctorCancellation.test.ts die at the ready-file parse:

ZodError: [{ "path": ["runId"], "message": "Invalid UUID" }]

The same assertion failed CI:

#5647 and #5655 did not change this parse. JADX cases already passed because inspectJadxJava publishes randomUUID().

inspectKunaInstallation owns the version probe with runId: \rea-kuna-version-${randomUUID()}`and exports that string asREA_PROCESS_RUN_ID. Process ownership treats the token as an opaque string. The sibling fixture kunaDoctorHeldOutput.test.tsalready acceptsz.string().min(1)`.

Expected: the cancellation test reads that token. Kuna requires a non-empty token, so a missing REA_PROCESS_RUN_ID (omitted by JSON.stringify) fails the parse. JADX still requires a UUID before observing its process group.

Change and scope

Test-only. The Kuna ready-file schema requires runId: z.string().min(1). The JADX schema requires runId: z.string().uuid() before observeOwnedProcessGroups. The Kuna branch still proves the probe PID is gone and does not invent a group owner from that PID.

Rebased onto 70835d3d5 (includes #5676). No conflicts. Head: d472db4ee.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Not applicable: this does not add a provider or any target-execution, injection, mutation, or protection-recovery capability. The prefixed Kuna token stays as written.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the CLI doctor cancellation fixture. The producing boundary is KunaInstallation's version-probe runId, which already matches the opaque ownership token. No production change.
  • Contribution scope fit and linked maintainer decision: ordinary test fix inside the existing doctor cancellation contract. Maintainer scope decision not applicable.
  • CLI and MCP/tool-catalog contract: none. Doctor JSON and exit status assertions are unchanged.
  • Provider, bridge, target-format, or platform compatibility: none. Kuna and JADX probe commands are unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none. The test still does not adopt the Kuna probe PID as an owned process group.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/cli/doctorCancellation.test.ts only. The existing Kuna signal cases are the regression: on the base revision they fail while parsing runId, before exit status or cleanup. A ready record that omits runId now fails the Kuna schema.
  • Base reproduction or other evidence: executed locally on c4b6aa306 before the edit. npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts (Node 24.18.0) — 2 failed, 4 passed, exit 1. Failures: doctor preserves SIGINT for kuna and doctor preserves SIGTERM for kuna, Zod Invalid UUID at runId. JADX signal cases and both ordinary-exit cases passed. CI shard 7/8 of run 39485164086 shows the same error.
  • User-visible CLI/MCP output (if applicable): none.
  • Remaining proof gaps: no real Kuna or JADX distribution was executed. The Kuna cases still use ESRCH on the probe PID rather than observeOwnedProcessGroups with the prefixed token; a descendant that outlived the leader is covered by kunaDoctorHeldOutput.test.ts, not by this signal fixture.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts on c4b6aa306 before the change — exit 1; Kuna SIGINT and SIGTERM failed with Invalid UUID on runId; the other four cases passed.
  • npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts tests/boundary/cli/kunaDoctorHeldOutput.test.ts tests/boundary/providers/kuna/kunaDoctor.test.ts after the first assertion change — exit 0; 3 files, 19 tests passed.
  • tsc -p tsconfig.json --noEmit — exit 0 on the earlier tree. Production sources are unchanged.
  • After requiring the Kuna token, on 70835d3d5: npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts — exit 0; 6 tests passed. Schema check: omitted runId and "" fail z.string().min(1); rea-kuna-version-<uuid> passes Kuna and fails the JADX UUID schema.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: unavailable. These cases use fake Java and Kuna executables. Platform skip remains non-Darwin/non-Linux.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the test still refuses to treat the Kuna probe PID as an ownership record. No new process authority.

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Open in Web Open in Cursor 

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5677 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@cursor[bot]](https://github.com/apps/cursor) **Base:** `main` ← **Head:** `cursor/fix-doctor-runid-uuid-229b` --- ### 📝 Commits (2) - [`3520a08`](https://github.com/morluto/rea/commit/3520a08b700f021fd6a1b27038ef39b8b286c95b) test(cli): accept opaque Kuna doctor run tokens - [`d472db4`](https://github.com/morluto/rea/commit/d472db4eecb8a42d9660981d0dd26ce9e0469828) test(cli): require the Kuna doctor run token ### 📊 Changes **1 file changed** (+10 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/cli/doctorCancellation.test.ts` (+10 -9) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary `doctorCancellation.test.ts` fails CI with Zod `Invalid UUID` on `runId` before it checks doctor cancellation. Kuna version probes publish an opaque `rea-kuna-version-<uuid>` run token; the fixture was still requiring a UUID. Human owner: @morluto. ## Problem and expected behavior On current main (`c4b6aa306`), both Kuna signal cases in `tests/boundary/cli/doctorCancellation.test.ts` die at the ready-file parse: ```text ZodError: [{ "path": ["runId"], "message": "Invalid UUID" }] ``` The same assertion failed CI: - Main shard 1/5 at `4bfdadb7` (fail-fast then cancelled the other shards). - PR #5652 run https://github.com/morluto/rea/actions/runs/39485164086, Test shard (7/8), both `doctor preserves SIGINT/SIGTERM for kuna` cases, at `doctorCancellation.test.ts:102`. #5647 and #5655 did not change this parse. JADX cases already passed because `inspectJadxJava` publishes `randomUUID()`. `inspectKunaInstallation` owns the version probe with `runId: \`rea-kuna-version-${randomUUID()}\`` and exports that string as `REA_PROCESS_RUN_ID`. Process ownership treats the token as an opaque string. The sibling fixture `kunaDoctorHeldOutput.test.ts` already accepts `z.string().min(1)`. Expected: the cancellation test reads that token. Kuna requires a non-empty token, so a missing `REA_PROCESS_RUN_ID` (omitted by `JSON.stringify`) fails the parse. JADX still requires a UUID before observing its process group. ## Change and scope Test-only. The Kuna ready-file schema requires `runId: z.string().min(1)`. The JADX schema requires `runId: z.string().uuid()` before `observeOwnedProcessGroups`. The Kuna branch still proves the probe PID is gone and does not invent a group owner from that PID. Rebased onto `70835d3d5` (includes #5676). No conflicts. Head: `d472db4ee`. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Not applicable: this does not add a provider or any target-execution, injection, mutation, or protection-recovery capability. The prefixed Kuna token stays as written. ## Contract and boundary impact - Semantic owner and earliest changed stage: the CLI doctor cancellation fixture. The producing boundary is `KunaInstallation`'s version-probe `runId`, which already matches the opaque ownership token. No production change. - Contribution scope fit and linked maintainer decision: ordinary test fix inside the existing doctor cancellation contract. Maintainer scope decision not applicable. - CLI and MCP/tool-catalog contract: none. Doctor JSON and exit status assertions are unchanged. - Provider, bridge, target-format, or platform compatibility: none. Kuna and JADX probe commands are unchanged. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. The test still does not adopt the Kuna probe PID as an owned process group. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/cli/doctorCancellation.test.ts` only. The existing Kuna signal cases are the regression: on the base revision they fail while parsing `runId`, before exit status or cleanup. A ready record that omits `runId` now fails the Kuna schema. - Base reproduction or other evidence: executed locally on `c4b6aa306` before the edit. `npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts` (Node 24.18.0) — 2 failed, 4 passed, exit 1. Failures: `doctor preserves SIGINT for kuna` and `doctor preserves SIGTERM for kuna`, Zod `Invalid UUID` at `runId`. JADX signal cases and both ordinary-exit cases passed. CI shard 7/8 of run 39485164086 shows the same error. - User-visible CLI/MCP output (if applicable): none. - Remaining proof gaps: no real Kuna or JADX distribution was executed. The Kuna cases still use `ESRCH` on the probe PID rather than `observeOwnedProcessGroups` with the prefixed token; a descendant that outlived the leader is covered by `kunaDoctorHeldOutput.test.ts`, not by this signal fixture. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts` on `c4b6aa306` before the change — exit 1; Kuna SIGINT and SIGTERM failed with `Invalid UUID` on `runId`; the other four cases passed. - `npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts tests/boundary/cli/kunaDoctorHeldOutput.test.ts tests/boundary/providers/kuna/kunaDoctor.test.ts` after the first assertion change — exit 0; 3 files, 19 tests passed. - `tsc -p tsconfig.json --noEmit` — exit 0 on the earlier tree. Production sources are unchanged. - After requiring the Kuna token, on `70835d3d5`: `npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts` — exit 0; 6 tests passed. Schema check: omitted `runId` and `""` fail `z.string().min(1)`; `rea-kuna-version-<uuid>` passes Kuna and fails the JADX UUID schema. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: unavailable. These cases use fake Java and Kuna executables. Platform skip remains non-Darwin/non-Linux. - Package or release metadata impact: none. - Security, privacy, process, or containment review: the test still refuses to treat the Kuna probe PID as an ownership record. No new process authority. ## Author readiness Human owner: @morluto - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-881d1e5c-1b5c-58d9-9eee-f3b8757d229b?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-881d1e5c-1b5c-58d9-9eee-f3b8757d229b&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7030
No description provided.