Skip to content

refactor(platforms): share direct lifecycle binding and the interactor operation set - #3304

Merged
thymikee merged 4 commits into
mainfrom
simplify/platform-lifecycle-dedupe
Oct 8, 2026
Merged

thymikee merged 4 commits into
mainfrom
simplify/platform-lifecycle-dedupe

Conversation

@thymikee

@thymikee thymikee commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Three platform-package de-duplications, no behavior change:

  • Web, Linux, Vega, and HarmonyOS each carried a 30-line lifecycle.ts that differed only in the owner label and open-target identity. @agent-device/contracts/application-lifecycle-interaction now exports bindLocalDirectApplicationLifecycle and the four files are gone.
  • HarmonyOS hand-inlined the screenshot/focus/type/gesture/scroll/touch/catalog bindings that bindLocalInteractorOperationSet already owns for Android and Linux. The shared set is a superset (it also binds readTextAtPoint, which HarmonyOS marks unavailable, so nothing new binds).
  • The Apple runner's isBenignSimulatorRunnerUninstallResult sniffed simctl output and both branches of its verdict returned without acting on it; the uninstall stays best-effort without the classifier.

10 files, net −159 lines.

Validation

Tested at 208cae0: pnpm check:affected --run passed (format, lint, typecheck, related tests including each platform's runtime.test.ts, the contracts package, and runner-session-stale-bundles.test.ts). No device run applies; the bound operations are the same functions reached through the shared binder.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.12 MB 5.12 MB -1.4 kB
Package (unpacked) 5.12 MB 5.12 MB -1.4 kB
Package (download) 1.54 MB 1.54 MB -213 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.2 ms 27.9 ms -0.3 ms
CLI --help 83.9 ms 82.1 ms -1.8 ms

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 10 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@thymikee

thymikee commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

The code in 208cae0 looks right to me. I did not run the tests or the typecheck, and I did not do a live device run. CI is green with 19 checks and none failing, and the PR body says the runtime tests for web, Linux, Vega and HarmonyOS and the contracts tests cover the changed binding route. I read the code and found the HarmonyOS bound set equivalent to the old one, but I did not diff the exact bound key set in the runtime.test.ts files. Live evidence is not needed here, since the bound operation functions are unchanged and only their wiring moved.

Not blocking, and you can take or leave these: the doc block in local-interactor-operation-set.ts says the set serves Android and Linux, but HarmonyOS now uses it too, so please name every pointer-driving local family or drop the list; and the Apple classifier removal in runner-session.ts is unrelated to this dedupe, and uninstallStaleSimulatorRunnerBundle still returns Promise<ExecResult | undefined> that no caller reads, so it could return void or move to its own PR.

Is there a smaller shape than one function call per owner? A registry row of owner and identity would work, but it is not simpler for four call sites, so I see no simpler option. Nothing else needs to change before merge.

@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Addressed at 785c049: the bindLocalInteractorOperationSet doc now names Android, Linux, and HarmonyOS, and uninstallStaleSimulatorRunnerBundle returns void since no caller read its result. The classifier removal stays here because it is the same cleanup step; the behavior change is none. pnpm check:affected --run passed at 785c049.

thymikee and others added 4 commits October 8, 2026 12:55
isBenignSimulatorRunnerUninstallResult sniffed simctl output, and both
branches of its verdict returned without acting on it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… platform

Web, Linux, Vega, and HarmonyOS each carried a 30-line lifecycle.ts that
differed only in the owner label and open-target identity.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…n void from the uninstall step

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the simplify/platform-lifecycle-dedupe branch from 785c049 to fe77520 Compare October 8, 2026 10:58
@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main at fe77520 after #3302 landed; the only conflict was the HarmonyOS import block (both sides edited the contracts imports) and it resolves to the union. pnpm check:affected --run passed at fe77520.

@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

The earlier concern on 208cae0 is resolved. At 785c049 the code looks good, and the new commit only changes one doc comment and one return type in runner-session.ts, so it has no runtime effect. All 19 of 19 checks passed at 785c049. I did not rerun pnpm check:affected or typecheck locally. I relied on green CI and your report.

You pushed fe77520 after this review. It is a rebase onto current main with the same patch (only import context moved in the HarmonyOS commit), and GitHub no longer reports conflicts. The next step is green CI on fe77520.

@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

All checks passed on fe77520, the rebase covered in my previous comment. The code verdict is unchanged, and GitHub reports no conflicts. This is ready for human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 8, 2026
@thymikee
thymikee merged commit bf22464 into main Oct 8, 2026
19 checks passed
@thymikee
thymikee deleted the simplify/platform-lifecycle-dedupe branch October 8, 2026 13:19
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-08 13:19 UTC

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.

1 participant