Skip to content

Clear pre-A6 vendor import leaks from asg-core classes#3338

Draft
nic-olo wants to merge 1 commit into
devfrom
cursor/pre-a6-vendor-leak-cleanup-96a4
Draft

Clear pre-A6 vendor import leaks from asg-core classes#3338
nic-olo wants to merge 1 commit into
devfrom
cursor/pre-a6-vendor-leak-cleanup-96a4

Conversation

@nic-olo

@nic-olo nic-olo commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Clears the last pre-A6 vendor import leaks from core-bound ASG classes ahead of the :asg-core / :vendor-mentra-live module split (Phase A6).

  • Fix 1 — MCU command surface: Introduces IMcuCommander and IBesTracePoller in io/peripheral/. K900CommandHandler and BesTracePoller implement them. CommandProcessor and UploadIncidentLogsCommandHandler hold interface types and receive implementations via constructor injection from ServiceInitializer.
  • Fix 2 — Camera FOV: Adds boolean setCameraFov(int, int) to IHardwareManager (with no-op in BaseHardwareManager, DevApi call in K900HardwareManager). AsgClientService and SettingsCommandHandler route through hardwareManager instead of calling DevApi directly. Return value preserves existing behavior: HAL restart and hardware_applied: true only when FOV is actually applied.
  • Wiring: ServiceInitializer constructs K900CommandHandler + BesTracePoller and passes them to CommandProcessor. AsgClientServiceManager gains setBesOtaCommandHandler() called before no-arg initialize(). ServiceLifecycleManager no longer calls getK900CommandHandler().

Blocker files cleared

File Before After
CommandProcessor K900CommandHandler, BesTracePoller IMcuCommander, IBesTracePoller
UploadIncidentLogsCommandHandler K900CommandHandler IMcuCommander
SettingsCommandHandler DevApi.setCameraFov IHardwareManager.setCameraFov
AsgClientService DevApi.setCameraFov IHardwareManager.setCameraFov

Test evidence

cd asg_client
./gradlew :app:assembleDebug :app:testDebugUnitTest
# BUILD SUCCESSFUL

Acceptance grep over core directories: the four blocker files are clean. Remaining hits are expected (IBesOtaRegistry regex false positives; K900CommandHandler import in ServiceInitializer as the designated composition root).

Out of scope

No file moves, no OtaHelper split, no protocol logic changes.

Open in Web Open in Cursor 

Clear the last pre-A6 vendor import leaks from core-bound classes by
introducing IMcuCommander and IBesTracePoller interfaces, injecting
vendor implementations from ServiceInitializer, and routing DevApi
setCameraFov through IHardwareManager with boolean success semantics.

- CommandProcessor, UploadIncidentLogsCommandHandler hold IMcuCommander
- BesTracePoller implements IBesTracePoller with IMcuCommander param
- SettingsCommandHandler and AsgClientService use hardwareManager.setCameraFov
- AsgClientServiceManager uses setBesOtaCommandHandler before initialize()
- ServiceLifecycleManager no longer depends on getK900CommandHandler()

Co-authored-by: Nicolo Micheletti <michelettinik@gmail.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

📋 PR Review Helper

📱 Mobile App Build

Waiting for build...

🕶️ ASG Client Build

Ready to test! (commit 21f42aa)

📥 Download ASG APK


🔀 Test Locally

gh pr checkout 3338

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR Agent Orchestrator State

{
  "cycle": 1,
  "fixRound": 0,
  "totalReviewerRuns": 1,
  "consecutiveNoNewReviews": 0,
  "openFindings": [],
  "resolvedFindings": [],
  "nitFindings": [
    {
      "id": "fb4a93",
      "fingerprint": "asg_client/app/src/main/java/com/mentra/asg_client/io/bes/log/bestracepoller.java:88c885b772f5",
      "source": "standards",
      "severity": "nit",
      "file": "asg_client/app/src/main/java/com/mentra/asg_client/io/bes/log/BesTracePoller.java",
      "line": 30,
      "message": "Field mK900CommandHandler is now typed IMcuCommander but keeps the concrete-class name; rename to mMcuCommander to match the abstraction (as CommandProcessor did).",
      "status": "open",
      "introducedCycle": 0,
      "lastSeenCycle": 0
    },
    {
      "id": "0cafc5",
      "fingerprint": "asg_client/app/src/main/java/com/mentra/asg_client/service/core/handlers/settingscommandhandler.java:4d1b0f947069",
      "source": "standards",
      "severity": "nit",
      "file": "asg_client/app/src/main/java/com/mentra/asg_client/service/core/handlers/SettingsCommandHandler.java",
      "line": 473,
      "message": "Log.w line exceeds the file's wrap width used elsewhere; minor formatting inconsistency.",
      "status": "open",
      "introducedCycle": 0,
      "lastSeenCycle": 0
    }
  ],
  "phase": "discovery",
  "status": "in_progress",
  "lastPair": [
    "bugbot",
    "standards"
  ],
  "stagnationFixRounds": 0,
  "lastOpenCount": 0,
  "fingerprintReopenCounts": {},
  "mutedFingerprints": []
}

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

bugbot run

@nic-olo

nic-olo commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 21f42aa813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Agent Review — cycle 1

✅ No blocking findings · 0 blocking · 2 nits
Reviewers this cycle: bugbot, standards

Claude — standards — ✅ approve

Commander, recon complete. Full assessment of PR #3338 follows.

Review — PR #3338 (Extract IMcuCommander / route camera FOV through IHardwareManager)

Mission summary: This PR strips the last vendor-import leaks (DevApi, K900CommandHandler) out of core-bound classes by introducing two interfaces and injecting vendor implementations from ServiceInitializer. Standards posture is strong.

Cleared checks:

  • Vendor decoupling is complete. DevApi now only appears in the vendor path (K900HardwareManager, K900LedController, DevApi itself); core classes (AsgClientService, CommandProcessor, SettingsCommandHandler, UploadIncidentLogsCommandHandler, BesTracePoller) hold interfaces only. Confirmed no stray imports remain.
  • Wiring order is correct. serviceManager.setBesOtaCommandHandler(k900CommandHandler) fires in the ServiceInitializer constructor (line 122), well before lifecycleManager.initialize()serviceManager.initialize(). The single K900CommandHandler instance is shared between CommandProcessor and BesOtaManager — no double-construction. No lingering callers of the old initialize(K900CommandHandler) or getK900CommandHandler() signatures anywhere in the tree.
  • Naming conventions hold. Interfaces IMcuCommander/IBesTracePoller (I-prefix + PascalCase), methods camelCase, new no-op returns false on base hardware. New files use 4-space indent per asg_client/AGENTS.md.
  • Tests updated. CommandProcessorRoutingIntegrationTest constructor call matches the new 15-arg signature; refactor is behavior-preserving so existing routing coverage still applies.
  • Commit hygiene passes. Co-authored-by: Nicolo Micheletti <…> names a human — no AI-assistant trailer, no "Generated with" line.
  • Security: No committed secrets; no cloud/Docker/Mongo surface touched (asg_client only).

Nits (non-blocking):

  • BesTracePoller.mK900CommandHandler (BesTracePoller.java:30) is now typed IMcuCommander but retains the concrete-class name. Rename to mMcuCommander to match the abstraction (as CommandProcessor already did).
  • Commit author is Cursor Agent <cursoragent@cursor.com>; root AGENTS.md prefers commits reflect the responsible human author. The human co-author trailer mitigates this, so cosmetic only.
  • SettingsCommandHandler.java:473 — that Log.w line runs ~92 chars; other multi-line logs in this file are wrapped. Minor formatting inconsistency.

No blocking issues, no regressions against the (empty) prior findings. Recommend approve.

Updated automatically by the PR Agent Orchestrator each review cycle. Nits do not block merge.

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.

2 participants