Skip to content

refactor(move): complete replay port package extraction - #3041

Merged
thymikee merged 4 commits into
codex/2663-replay-final-testsfrom
codex/2663-replay-port-final
Sep 28, 2026
Merged

thymikee merged 4 commits into
codex/2663-replay-final-testsfrom
codex/2663-replay-port-final

Conversation

@thymikee

@thymikee thymikee commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Move the final 15 connected replay production modules unchanged into @agent-device/replay-port, route daemon callers through package exports, and remove src/daemon/replay/**.
  • Update package ownership and source references. The original replay subtree held 108 files / 24,089 LOC and now has no tracked files. This layer touches 52 files; all 15 source moves are exact renames (git diff -M90%).
  • Daemon coordinator, repair transaction, device selection, and handler adapters remain as specified by the issue’s retention scope.
  • Closes refactor(replay): move the daemon-side replay port into packages/replay-port #2663 after the preceding stack layers merge.

Validation

  • Head a4badbb72: fresh pnpm install --frozen-lockfile && pnpm build && pnpm format && pnpm check:affected --run passed, including related tests, package checks, Maestro conformance, and wire compatibility.
  • Layering and depgraph: R4 0 value cycles, R5 0 back-edges, R6 3 type inversions, R11 zero root back-imports. Fallow and 753 eager-closure budget tests passed.
  • Live iPhone 18 Pro simulator on a4badbb72: recorded .ad replay passed 2/2 steps, 0 heals; Maestro checkout form passed 17/17 steps, 0 heals. Baseline 3c1f51382 had the same 2/2 and 17/17 results. Both final sessions closed; session list and device claims are empty.
  • Review fixes cover package-relative dynamic imports in the ownership test and move the native-command complexity baseline to its package path. GitHub CI is pending on this PR head.

@thymikee
thymikee added this pull request to stack #3020 September 28, 2026 13:27
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-3041/

Built to branch gh-pages at 2026-09-28 17:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee thymikee changed the title codex/2663 replay port final refactor(move): complete replay port package extraction Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.87 MB 4.87 MB 0 B
Package (unpacked) 4.87 MB 4.87 MB 0 B
Package (download) 1.46 MB 1.46 MB -3 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.9 ms 27.0 ms -1.8 ms
CLI --help 85.8 ms 79.5 ms -6.3 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 52 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/daemon/__tests__/replay-coordinator-ownership.test.ts Outdated
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at fec8036. The move looks correct, but one fallow baseline entry did not move with its file. This PR renames src/daemon/replay/internal/native-command.ts to packages/replay-port/src/daemon-port/native-command.ts, but fallow-baselines/health.json#L566 still keys src/daemon/replay/internal/native-command.ts:complexity. Baselines are path-keyed, so the old entry no longer matches a file and the new path has no entry. Please move the entry to packages/replay-port/src/daemon-port/native-command.ts:complexity. The other moved files have no baseline entries.

Checks were still running at review time. If Repo Guards fails, check this entry first. The typecheck break from #3037 must also be fixed before this stack can go green.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at f77f9ee, following up on the earlier review at fec8036 (#3041 (comment)). The change at f77f9ee only touches src/daemon/tests/replay-coordinator-ownership.test.ts, so the baseline problem from the last round is still open.

fallow-baselines/health.json:566 still keys the complexity baseline as src/daemon/replay/internal/native-command.ts:complexity, and that path no longer exists after the move to packages/replay-port/src/daemon-port/native-command.ts (https://github.com/callstack/agent-device/blob/f77f9ee/fallow-baselines/health.json#L566). Baselines are path-keyed, so a stale key means the moved file has no complexity baseline of its own; whichever gate run reads this file next either skips enforcing that metric for the new path or fails on first exercise. Can you rename the key to packages/replay-port/src/daemon-port/native-command.ts:complexity so the baseline tracks the file it was measured against?

Smoke Tests is still queued, so there's no result to attribute to this delta; the only changed file is a self-contained ownership test, not part of the device-facing smoke route it covers. Once the health.json key is moved, this is ready for human review.

@thymikee

Copy link
Copy Markdown
Member Author

CI follow-up: the iOS fixture-backed Smoke Tests job 108970206222 failed at step 11 (wait text Automation lab) with typed APP_NOT_RUNNING after the deep-link launch. The same step and error recurred on #3032's independent replay-test branch. Both artifacts showed the unanswered iOS “Open in Agent Device Tester?” confirmation. The shared harness correction is isolated in #3044, which handles the typed readiness-exhausted first wait and has a regression that fails with the old early return. All #3041 non-smoke checks passed; exact-head live .ad and Maestro replay passed before publication. This PR's iOS smoke should be rerun after #3044 is in its CI base.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="fallow-baselines/health.json">

<violation number="1" location="fallow-baselines/health.json:566">
P2: This line fixes the `native-command.ts` baseline but two sibling entries in the same `target_keys` list were not moved with their renames: `src/daemon/replay/internal/session-replay-heal.ts` (line 539) and `src/daemon/replay/internal/session-test-infrastructure.ts` (line 579) still key paths that no longer exist, while the files now live at `packages/replay-port/src/daemon-port/`. Since fallow baselines are path-keyed and must move on rename, update both entries to the new package paths as well.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

"packages/capture-kit/src/snapshot/snapshot-presentation/text-surface.ts:high impact",
"src/daemon/handlers/session-test-sharding.ts:high impact",
"src/daemon/replay/internal/native-command.ts:complexity",
"packages/replay-port/src/daemon-port/native-command.ts:complexity",

@cubic-dev-ai cubic-dev-ai Bot Sep 28, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This line fixes the native-command.ts baseline but two sibling entries in the same target_keys list were not moved with their renames: src/daemon/replay/internal/session-replay-heal.ts (line 539) and src/daemon/replay/internal/session-test-infrastructure.ts (line 579) still key paths that no longer exist, while the files now live at packages/replay-port/src/daemon-port/. Since fallow baselines are path-keyed and must move on rename, update both entries to the new package paths as well.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fallow-baselines/health.json, line 566:

<comment>This line fixes the `native-command.ts` baseline but two sibling entries in the same `target_keys` list were not moved with their renames: `src/daemon/replay/internal/session-replay-heal.ts` (line 539) and `src/daemon/replay/internal/session-test-infrastructure.ts` (line 579) still key paths that no longer exist, while the files now live at `packages/replay-port/src/daemon-port/`. Since fallow baselines are path-keyed and must move on rename, update both entries to the new package paths as well.</comment>

<file context>
@@ -563,7 +563,7 @@
     "packages/capture-kit/src/snapshot/snapshot-presentation/text-surface.ts:high impact",
     "src/daemon/handlers/session-test-sharding.ts:high impact",
-    "src/daemon/replay/internal/native-command.ts:complexity",
+    "packages/replay-port/src/daemon-port/native-command.ts:complexity",
     "packages/platform-apple/src/core/debug-symbols/utils.ts:high impact",
     "packages/platform-linux/src/snapshot.ts:high impact",
</file context>
Fix with cubic

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at a4badbb. The new commit moves the complexity baseline key in fallow-baselines/health.json to packages/replay-port/src/daemon-port/native-command.ts, which resolves the stale-key finding from the last round. The rest of the branch is unchanged. Smoke Tests is still running, and this delta does not touch the route it covers. Ready for human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 28, 2026
@thymikee
thymikee force-pushed the codex/2663-replay-port-final branch from a4badbb to 199f35f Compare September 28, 2026 16:35
@thymikee
thymikee merged commit 798f839 into main Sep 28, 2026
27 of 39 checks passed
@thymikee
thymikee deleted the codex/2663-replay-port-final branch September 28, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(replay): move the daemon-side replay port into packages/replay-port

1 participant