Skip to content

Add persisted mobile draft queue, telemetry export, and release enforcement#7

Merged
aytzey merged 1 commit into
mainfrom
codex/improve-mobile-app-design-and-functionality
Apr 23, 2026
Merged

Add persisted mobile draft queue, telemetry export, and release enforcement#7
aytzey merged 1 commit into
mainfrom
codex/improve-mobile-app-design-and-functionality

Conversation

@aytzey

@aytzey aytzey commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the remaining robustness items end-to-end:

  • offline-safe pending draft queue persistence
  • runtime telemetry export from the app UI
  • automatic strict HTTPS enforcement for release profiles

What changed

Pending draft queue persistence (SecureStore)

  • new mobile/src/draft-queue.ts to load/save/clear pending score drafts
  • app now restores pending draft queue on launch and persists queued scoring attempts while an in-flight request is running

Telemetry export panel capability

  • app now exposes Export Runtime Logs action (copies structured telemetry JSON to clipboard)
  • uses existing telemetry event buffer from runtime stack

Release profile security enforcement

  • mobile/app.config.ts now computes build profile and strictTransportRequired
  • app enforces strict transport in release profile by forcing strict HTTPS policy on runtime settings
  • iOS ATS remains explicit (NSAllowsArbitraryLoads: false)

Docs/config updates

  • mobile/README.md updated for:
    • persisted pending queue behavior
    • runtime telemetry export
    • production strict-policy auto-enforcement
  • .env.example includes release channel key
  • added expo-constants dependency for reading Expo config extras at runtime

Validation

  • npm run lint
  • npm test ✅ (9 files, 38 tests)

Codex Task

Summary by CodeRabbit

  • New Features

    • Added a new Expo mobile app for pitch scoring with runtime configuration (PitchServer/Vast AI selection, transport mode options, and health probing).
    • Integrated secure credential storage and HTTPS enforcement capabilities.
    • Added support for queued scoring requests, draft persistence, and JSON telemetry export.
    • Included iOS build and submission workflows via EAS.
  • Tests

    • Added unit test coverage for network utilities, report normalization, and telemetry functionality.

@aytzey aytzey merged commit 5d126a6 into main Apr 23, 2026
1 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 396af13e-a814-49c3-8400-e410896aa1ea

📥 Commits

Reviewing files that changed from the base of the PR and between 924fddc and 6208e77.

📒 Files selected for processing (20)
  • README.md
  • mobile/.env.example
  • mobile/App.tsx
  • mobile/README.md
  • mobile/app.config.ts
  • mobile/babel.config.js
  • mobile/eas.json
  • mobile/package.json
  • mobile/src/draft-queue.ts
  • mobile/src/network.ts
  • mobile/src/report.ts
  • mobile/src/runtime.ts
  • mobile/src/telemetry.ts
  • mobile/src/theme.ts
  • mobile/src/types.ts
  • mobile/tsconfig.json
  • package.json
  • tests/mobile/network.test.ts
  • tests/mobile/report.test.ts
  • tests/mobile/telemetry.test.ts

📝 Walkthrough

Walkthrough

This pull request adds a comprehensive production-oriented Expo mobile client application called "PitchCheck," featuring a React Native UI for configuring runtime settings, scoring pitches, health probing, secure credential storage, request queuing with persistence, and runtime telemetry visualization. The implementation includes supporting utilities for network operations, report normalization, and event logging, alongside configuration files, documentation, and tests.

Changes

Cohort / File(s) Summary
Mobile App Entry Point
mobile/App.tsx
Main component implementing "Neural Persuasion Studio" with runtime configuration controls, pitch scoring with queued concurrency handling, result display with recent scores, and telemetry export via clipboard.
Mobile Configuration
mobile/app.config.ts, mobile/babel.config.js, mobile/eas.json, mobile/tsconfig.json, mobile/package.json
Expo/TypeScript/Babel configuration, EAS build profiles (development/preview/production), and npm scripts for start/iOS workflows.
Mobile Runtime & Network Utilities
mobile/src/runtime.ts, mobile/src/network.ts, mobile/src/draft-queue.ts, mobile/src/report.ts, mobile/src/telemetry.ts, mobile/src/types.ts, mobile/src/theme.ts
Runtime orchestration with endpoint validation and health probing; network utilities for URL normalization and timeout-based fetch; secure draft persistence via Expo SecureStore; report normalization with payload coercion and bounds checking; event logging with in-memory queue and console emission; type definitions for platform, runtime kind, transport mode, and score reports; and color theme tokens.
Mobile Documentation & Environment
mobile/README.md, mobile/.env.example
Documentation of capabilities (runtime switching, secure storage, transport modes, health checks, telemetry export, EAS profiles); setup/build/submit commands; runtime contract; environment variable placeholders for project ID, bundle identifiers, and build metadata.
Root Package Configuration
package.json
Addition of mobile:* npm scripts (install, start, typecheck, iOS build/submit) delegating to mobile subproject.
Root Documentation
README.md
Documentation of mobile client capabilities, controls, and iOS/environment variable setup guidance.
Mobile Tests
tests/mobile/network.test.ts, tests/mobile/report.test.ts, tests/mobile/telemetry.test.ts
Vitest suites validating URL normalization, endpoint generation, timeout-wrapped fetch, report payload normalization with bounds clamping and type coercion, and runtime event logging/retrieval.

Sequence Diagram(s)

sequenceDiagram
    participant User as Mobile App UI
    participant Runtime as Runtime Layer
    participant Network as Network Utils
    participant Remote as Runtime Service<br/>(PitchServer/Vast AI)
    participant Store as SecureStore

    User->>Runtime: loadSettings()
    Runtime->>Store: Read persisted RuntimeSettings
    Store-->>Runtime: Settings (or defaults)
    Runtime-->>User: Settings loaded

    User->>Runtime: scorePitch(message, persona, platform)
    Runtime->>Network: normalizeBaseUrl()
    Network-->>Runtime: Valid URL
    Runtime->>Network: scoreEndpoints(baseUrl, mode)
    Network-->>Runtime: Endpoint list [url1, url2, ...]
    
    loop Retry endpoints until success
        Runtime->>Network: fetchWithTimeout(endpoint, {headers, body}, 18s)
        Network->>Remote: POST /score
        alt Success (200)
            Remote-->>Network: {persuasion_score, verdict, ...}
            Network-->>Runtime: Response
            Runtime->>Runtime: normalizePitchScoreReport(payload)
            Runtime-->>User: PitchScoreReport
        else Failure
            Remote-->>Network: Error / Timeout
            Network-->>Runtime: Error
        end
    end
    
    Runtime->>Store: savePendingDraft() if queued
    Runtime->>Runtime: logRuntimeEvent(score_complete)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A mobile client hops into view,
With scoring, probing, queues anew!
Secure credentials tucked away,
Runtime dialogs save the day—
Telemetry logs and themes so bright,
PitchCheck bounds toward iOS flight! 🚀

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/improve-mobile-app-design-and-functionality

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant