Skip to content

Document OpenHuman portfolio readiness cleanup#1661

Merged
senamakel merged 6 commits into
tinyhumansai:mainfrom
jwalin-shah:codex/operator-mvp-plan
May 13, 2026
Merged

Document OpenHuman portfolio readiness cleanup#1661
senamakel merged 6 commits into
tinyhumansai:mainfrom
jwalin-shah:codex/operator-mvp-plan

Conversation

@jwalin-shah
Copy link
Copy Markdown
Contributor

@jwalin-shah jwalin-shah commented May 13, 2026

Summary

  • add a portfolio-readiness handoff for OpenHuman operator MVP review and cleanup
  • remove a few low-risk stale effect/typing issues in the app surface
  • ignore local CocoIndex artifacts and sync local Cargo.lock package versions to 0.53.26

Validation

  • pnpm run lint (passes with 33 existing React compiler warnings)
  • pnpm run typecheck
  • pnpm run test
  • pnpm run test:rust
  • git diff --check
  • CARGO_ENCODED_RUSTFLAGS='' RUSTC_WRAPPER= cargo check --manifest-path app/src-tauri/Cargo.toml
  • pre-push hook: format:check, lint, compile, rust:check, lint:commands-tokens

Review notes

  • Gemini secondary review attempted on 2026-05-13 and blocked by MODEL_CAPACITY_EXHAUSTED/429.
  • Existing warnings remain in React compiler lint, Vitest localStorage/jsdom output, and Rust unused/deprecated diagnostics; this PR documents them instead of widening scope.
  • Local machine Rust config needed linker flags disabled for cargo check because ld64.lld could not find -ld_new.

Summary by CodeRabbit

  • Refactor

    • Improved type safety for event handlers and mode-switching logic throughout the application.
    • Removed unnecessary generic type casting from handler implementations.
    • Consolidated state reset behavior into callback-based management.
  • Chores

    • Updated project configuration files.
    • Added development and portfolio readiness documentation.

Review Change Stack

@jwalin-shah jwalin-shah requested a review from a team May 13, 2026 16:00
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c11fbab0-cc39-48da-9c76-6406018c9f6a

📥 Commits

Reviewing files that changed from the base of the PR and between ef7144a and 0329656.

📒 Files selected for processing (4)
  • .gitignore
  • CODEX_WORKPAD.md
  • app/src/pages/Conversations.tsx
  • app/src/services/meetCallService.ts
💤 Files with no reviewable changes (2)
  • app/src/services/meetCallService.ts
  • app/src/pages/Conversations.tsx
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (1)
  • CODEX_WORKPAD.md

📝 Walkthrough

Walkthrough

This PR refactors app component state management by centralizing mode-switching callbacks, improves Socket.IO handler type safety, simplifies Conversations label tab derivation, removes lint suppressions, updates build ignore patterns, and documents portfolio readiness with validation evidence and cleanup timeline.

Changes

App State Management & Type Safety Refactoring

Layer / File(s) Summary
Mode switching centralization
app/src/components/settings/panels/RecoveryPhrasePanel.tsx, app/src/pages/Mnemonic.tsx
RecoveryPhrasePanel and Mnemonic now share a switchMode callback pattern that atomically updates mode and resets dependent UI state (confirmed, error, importValid, selectedWordCount, importWords) on transitions, replacing scattered effect-based reset logic. Mode toggle buttons now call switchMode('import') and switchMode('generate') instead of directly setting mode.
Socket.IO event handler type safety
app/src/lib/mcp/transport.ts
SocketIOMCPTransportImpl introduces MCPEventHandler type alias for event callbacks, updates the internal eventHandlers map to use correctly-typed handler references, and removes the prior as any cast when unregistering handlers from the socket. Public on and off method signatures now accept MCPEventHandler instead of (data: unknown) => void.
Conversations label tabs hardcoding
app/src/pages/Conversations.tsx
Conversations component replaces dynamic label derivation from thread data with a fixed hardcoded labelTabs array, and removes the effect that auto-cleared selectedLabel when the last thread with that label was deleted.
Error handling cleanup
app/src/services/meetCallService.ts
meetCallService removes the inline eslint-disable suppression from the meet_call_open_window failure path while preserving console.error logging and error wrapping behavior.

Infrastructure & Portfolio Readiness Documentation

Layer / File(s) Summary
Portfolio readiness documentation and build infrastructure
.gitignore, CODEX_WORKPAD.md, docs/PORTFOLIO_READINESS.md
Updates .gitignore to exclude CocoIndex Code directory; introduces CODEX_WORKPAD documenting validation command execution timeline (2026-05-12 through 2026-05-13), lint warning cleanup progress with counts, and detailed PR merge reconciliation; establishes PORTFOLIO_READINESS describing repo scope (local-first architecture), validation evidence with specific command results, cleanup performed, remaining lint and test presentation debt, public claim boundaries, and a phased plan for addressing React compiler warnings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • tinyhumansai/openhuman#279: Introduces RecoveryPhrasePanel component and its generate/import flow, which this PR refactors with centralized switchMode callback pattern.

Suggested reviewers

  • senamakel

Poem

🐰 Hops through the code with glee,
States unified, handlers typed so free,
Labels hardcoded, lint warnings gone,
Portfolio ready—the work lives on!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: documenting portfolio readiness cleanup, which aligns with the PR's primary objective of adding portfolio-readiness documentation and performing cleanup actions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

…plan

# Conflicts:
#	app/src-tauri/Cargo.lock
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
docs/superpowers/plans/2026-05-11-operator-mvp-plan.md (1)

324-401: ⚖️ Poor tradeoff

Consider goal pack coordination strategy.

The MVP goal packs (Daily Brief, Reply Drafts, Meeting Prep, Engineering Review) each have clear outcomes and approval requirements, but the document doesn't address how conflicts are resolved when multiple goal packs target the same work item (e.g., Daily Brief wants to summarize a thread while Reply Drafts wants to draft a reply for it).

This might not be critical for initial MVP if goal packs are triggered manually and run sequentially, but consider documenting:

  • Whether goal packs can run concurrently
  • How proposals from different goal packs are prioritized or merged
  • Whether work items are locked during proposal generation

This becomes relevant once scheduled triggers (line 157) are active and multiple goal packs observe the same sources.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md` around lines 324 -
401, Add a short "Goal Pack Coordination" section to the MVP Goal Packs that
specifies how conflicts are resolved when multiple packs target the same work
item: define whether goal packs (Daily Brief, Reply Drafts, Meeting Prep,
Engineering Review) may run concurrently or only sequentially, describe a
prioritization/merging rule for competing proposals (e.g., priority order or
merge strategy), and state whether and how work items are locked during proposal
generation and approval; ensure the section also notes behavior change when
scheduled triggers are enabled and provides concrete examples of conflict
resolution and required approvals.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md`:
- Around line 508-529: Gate 3 lacks failure/recovery behavior for approved
actions; update the approval state machine and related functions so approved
actions can transition to executed or failed and support retry/cancel flows:
extend the approval record schema to include states (pending, approved,
executed, failed) and failure metadata, modify
create_approval_request/approve_request to set and persist the new state field,
change execute_approved_action to detect transient vs permanent errors, record
partial-success semantics (e.g., if evidence recording fails) in record_evidence
by attaching failure reason and affected substeps, and add retry and cancel
handlers that validate state transitions; finally, add tests in ops_tests.rs to
cover approved->failed, retry paths, cancellation, and partial-success scenarios
referenced by preview_action, create_approval_request, approve_request,
execute_approved_action, and record_evidence.
- Around line 217-266: Add a concrete credential storage and security model to
the Connector Strategy: update the doc to state where connector credentials
referenced by operator_connector_accounts are stored (local keychain/agent vs
encrypted DB in control plane), encryption-at-rest and access controls, OAuth
token refresh flow and refresh-token handling, credential rotation/rotation
policy and revocation procedures, and whether control plane stores tokens or
only opaque references; explicitly reconcile this with the "raw private data
stays local" statement and the Composio execution wrapper/Gate 5 approval flow
so reviewers can verify how tokens are used, scoped, and audited during GoalPack
-> Proposal -> Preflight -> Approval -> Composio execute -> Verify -> Evidence.
- Around line 184-200: Add explicit fallback behavior for the inbox adapter:
define clear error states and retry/backoff semantics when the local inbox
server at 127.0.0.1:9849 is unreachable, specify which adapter functions
(list_actionable_threads, list_waiting_on_me, list_waiting_on_others,
list_calendar_context, draft_reply_for_thread, preflight_write,
explain_routing_decision) return empty results vs. errors, and document a
degraded mode that allows operator goal packs to function with reduced work
discovery (e.g., marking threads as unknown/missing and queuing background
retries). Also include user-visible messaging about the dependency (UI/CLI
warnings) and update the Gate 2 and Gate 6 acceptance criteria to require
handling/unambiguous signaling of this degraded state.

---

Nitpick comments:
In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md`:
- Around line 324-401: Add a short "Goal Pack Coordination" section to the MVP
Goal Packs that specifies how conflicts are resolved when multiple packs target
the same work item: define whether goal packs (Daily Brief, Reply Drafts,
Meeting Prep, Engineering Review) may run concurrently or only sequentially,
describe a prioritization/merging rule for competing proposals (e.g., priority
order or merge strategy), and state whether and how work items are locked during
proposal generation and approval; ensure the section also notes behavior change
when scheduled triggers are enabled and provides concrete examples of conflict
resolution and required approvals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4dc963a-b03d-47c4-919d-1876e1cfbb84

📥 Commits

Reviewing files that changed from the base of the PR and between 41813db and ef7144a.

⛔ Files ignored due to path filters (1)
  • app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .gitignore
  • CODEX_WORKPAD.md
  • app/src/components/settings/panels/RecoveryPhrasePanel.tsx
  • app/src/lib/mcp/transport.ts
  • app/src/pages/Conversations.tsx
  • app/src/pages/Mnemonic.tsx
  • app/src/services/meetCallService.ts
  • docs/PORTFOLIO_READINESS.md
  • docs/superpowers/plans/2026-05-11-operator-mvp-plan.md
💤 Files with no reviewable changes (2)
  • app/src/services/meetCallService.ts
  • app/src/pages/Conversations.tsx

Comment on lines +184 to +200
OpenHuman calls a local inbox server when present:

```text
OpenHuman operator domain -> inbox_adapter.rs -> http://127.0.0.1:9849
```

Adapter functions:

- `list_actionable_threads`
- `list_waiting_on_me`
- `list_waiting_on_others`
- `list_calendar_context`
- `draft_reply_for_thread`
- `preflight_write`
- `explain_routing_decision`

This gives immediate reuse while keeping OpenHuman stable.
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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Specify fallback behavior when inbox server is unavailable.

The Phase 1 adapter assumes the local inbox server is reachable at 127.0.0.1:9849, but the document doesn't define fallback behavior when the server is down or not installed. Gate 6 (line 621) mentions "degraded state" for the inbox adapter, but that pattern should be established here in Phase 1 design.

Consider adding:

  • Clear error states when adapter is unreachable
  • Whether operator goal packs can function with degraded work discovery
  • User-visible messaging about inbox server dependency
  • Whether Gate 2 completion requires handling this scenario
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md` around lines 184 -
200, Add explicit fallback behavior for the inbox adapter: define clear error
states and retry/backoff semantics when the local inbox server at 127.0.0.1:9849
is unreachable, specify which adapter functions (list_actionable_threads,
list_waiting_on_me, list_waiting_on_others, list_calendar_context,
draft_reply_for_thread, preflight_write, explain_routing_decision) return empty
results vs. errors, and document a degraded mode that allows operator goal packs
to function with reduced work discovery (e.g., marking threads as
unknown/missing and queuing background retries). Also include user-visible
messaging about the dependency (UI/CLI warnings) and update the Gate 2 and Gate
6 acceptance criteria to require handling/unambiguous signaling of this degraded
state.

Comment on lines +217 to +266

## Connector Strategy

### Bootstrap

Use Composio for breadth and speed:

- OAuth handoff
- long-tail connector discovery
- initial Gmail/GitHub/Linear/Slack/Notion-style coverage
- trigger discovery where useful

But do not expose generic Composio execution as the product API. Wrap it in operator policy:

```text
GoalPack -> Proposal -> Preflight -> Approval -> Composio execute -> Verify -> Evidence
```

### Core Connectors

Move high-value connectors to first-class/direct support when they become central to the product:

- Gmail
- Google Calendar
- GitHub
- Linear
- Google Drive/Docs
- Slack
- iMessage/local Messages bridge for power users

### Source-Of-Truth Rule

Routing belongs in code. The model should not guess which account to use.

Examples:

- Replies route through the owning account/thread unless explicitly overridden.
- New Google writes use the configured default account.
- GitHub PR comments route to the repo/owner from the original item.
- Linear updates route to the issue/team from the original work item.

Each write preview must show:

- connector
- account
- target object
- action type
- irreversible risk
- evidence expected after execution

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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Define connector credential storage and security model.

The connector strategy describes OAuth handoff and account usage but doesn't specify how connector credentials (OAuth tokens, API keys) are stored, encrypted, or rotated. The data model includes operator_connector_accounts (line 134), but security requirements aren't detailed.

Consider documenting:

  • Credential storage (local keychain, encrypted DB, control plane?)
  • OAuth token refresh strategy
  • Credential rotation policy
  • How this aligns with "raw private data stays local" (line 317)
  • Whether control plane stores connector tokens or just references

This is a security consideration that should be resolved before Gate 5 (Composio execution wrapper).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md` around lines 217 -
266, Add a concrete credential storage and security model to the Connector
Strategy: update the doc to state where connector credentials referenced by
operator_connector_accounts are stored (local keychain/agent vs encrypted DB in
control plane), encryption-at-rest and access controls, OAuth token refresh flow
and refresh-token handling, credential rotation/rotation policy and revocation
procedures, and whether control plane stores tokens or only opaque references;
explicitly reconcile this with the "raw private data stays local" statement and
the Composio execution wrapper/Gate 5 approval flow so reviewers can verify how
tokens are used, scoped, and audited during GoalPack -> Proposal -> Preflight ->
Approval -> Composio execute -> Verify -> Evidence.

Comment on lines +508 to +529
### Gate 3 - Approval And Evidence Loop

Files:

- `src/openhuman/operator/preflight.rs`
- `src/openhuman/operator/evidence.rs`
- `src/openhuman/operator/ops.rs`
- `src/openhuman/operator/ops_tests.rs`

Tasks:

- [ ] `preview_action` returns account, target, risk, and expected evidence.
- [ ] `create_approval_request` stores a pending approval.
- [ ] `approve_request` transitions pending -> approved.
- [ ] `execute_approved_action` refuses unapproved writes.
- [ ] `record_evidence` links evidence to run/proposal/work item.

Validation:

```bash
cargo test operator:: --manifest-path app/src-tauri/Cargo.toml
```
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.

🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Define error recovery strategy for failed approved actions.

Gate 3 describes the approval/execution loop but doesn't specify what happens when an approved action fails during execution:

  • Does the approval request stay "approved" or reset to a "failed" state?
  • How does the user retry or cancel a failed action?
  • What if execution partially succeeds (e.g., sends email but fails to record evidence)?
  • How are transient vs permanent failures distinguished?

The "Always Visible" policy (lines 430-438) mentions "how to undo or recover when possible," but Gate 3 tasks don't include failure handling in the state machine. Consider adding to the approval request state machine: pending → approved → executed/failed, and defining retry/cancellation UX before Gate 3 completion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-11-operator-mvp-plan.md` around lines 508 -
529, Gate 3 lacks failure/recovery behavior for approved actions; update the
approval state machine and related functions so approved actions can transition
to executed or failed and support retry/cancel flows: extend the approval record
schema to include states (pending, approved, executed, failed) and failure
metadata, modify create_approval_request/approve_request to set and persist the
new state field, change execute_approved_action to detect transient vs permanent
errors, record partial-success semantics (e.g., if evidence recording fails) in
record_evidence by attaching failure reason and affected substeps, and add retry
and cancel handlers that validate state transitions; finally, add tests in
ops_tests.rs to cover approved->failed, retry paths, cancellation, and
partial-success scenarios referenced by preview_action, create_approval_request,
approve_request, execute_approved_action, and record_evidence.

@jwalin-shah
Copy link
Copy Markdown
Contributor Author

Validation evidence for portfolio review gate:

  • Head: 0329656b83fdaca00ef82201a6c58b29a5e01fcd on codex/operator-mvp-plan
  • GitHub checks: reported green for Build Tauri App, E2E build jobs, frontend coverage/unit tests, TypeScript typecheck, Rust core/Tauri coverage and quality, smoke install jobs, Markdown link checks, coverage gate, and PR checklist.
  • Local validation previously recorded for this PR passed: pnpm run lint with existing React compiler warnings, pnpm run typecheck, pnpm run test (1977 tests, 3 skipped, 215 files), pnpm run test:rust, git diff --check, and CARGO_ENCODED_RUSTFLAGS='' RUSTC_WRAPPER= cargo check --manifest-path app/src-tauri/Cargo.toml. The post-merge pre-push hook also passed format:check, lint, compile, rust:check, and lint:commands-tokens.
  • Gemini secondary review was attempted with gemini-3-flash-preview, but returned repeated 429 model-capacity errors, so no Gemini approval is claimed.
  • GitHub currently reports state OPEN, mergeable MERGEABLE, and mergeStateStatus BLOCKED.

@senamakel senamakel merged commit 91eb90b into tinyhumansai:main May 13, 2026
23 checks passed
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.

3 participants