Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Oct 29, 2025

Summary

  • shrink the default JSON emitted by the docstring reporter to top-level totals and a sample of undocumented exports, keeping the full breakdown behind an optional --details flag
  • regenerate the app, SDK, and aggregate coverage snapshots with the compact structure so they remain easy to version
  • document the new --details option in the docstring coverage workflow guidance

Testing

  • yarn docstrings:app
  • yarn docstrings:sdk
  • yarn docstrings:report

https://chatgpt.com/codex/tasks/task_b_69019175faf8832d817c019a7ef13c6a

Summary by CodeRabbit

  • Documentation

    • Added comprehensive docstring style guides (TSDoc conventions) for React Native and Mobile SDK exports
    • Updated development patterns documentation with docstring coverage workflow commands
  • Chores

    • Added npm scripts to check documentation coverage for the app and SDK
    • Pinned React Native SVG library versions for consistency
    • Updated package manager version

✏️ Tip: You can customize this high-level summary in your review settings.


Note

Introduces a TSDoc coverage workflow and supporting tooling, with compact, versionable coverage snapshots.

  • Adds scripts/docstring-report.ts CLI and root scripts docstrings, docstrings:app, docstrings:sdk; adds tsx dev dep and updates workspace packageManager
  • Tracks coverage snapshots in docs/coverage/*.json and permits them via .cursorignore; adds docstring style guides in app/docs and packages/mobile-sdk-alpha/docs, plus workflow docs in docs/development-patterns.md
  • Pins react-native-svg/react-native-svg-web in app/package.json and aligns iOS Podfile.lock to RNSVG 15.14.0; minor gem updates in app/Gemfile.lock
  • Small code/formatting updates in ModalScreen.tsx, points utils/store, SDK View.tsx, and metro.config.cjs

Written by Cursor Bugbot for commit 6e4ce9c. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR introduces a comprehensive docstring coverage reporting system featuring a new TypeScript analysis script, coverage documentation guides for both the app and mobile SDK, JSON coverage artifacts, and supporting npm scripts. Additionally, it includes minor formatting refactors across multiple files, updates the Yarn package manager version, pins specific dependency versions in app/package.json, and modifies git ignore rules to permit coverage artifacts.

Changes

Cohort / File(s) Summary
Docstring Style Guides
app/docs/DOCSTRING_STYLE_GUIDE.md, packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
Added TSDoc-compliant style guides covering authoring conventions for exported entities, parameter documentation, platform-specific notes, and coverage expectations using new yarn scripts.
Coverage Reporting Tooling
scripts/docstring-report.ts
New TypeScript script that performs AST-based analysis of exported declarations across glob-matched files, detects documentation presence, computes coverage metrics, and outputs JSON reports with per-file breakdowns and undocumented symbol lists.
Generated Coverage Artifacts
docs/coverage/app.json, docs/coverage/sdk.json
JSON snapshots capturing docstring coverage metrics (total exports, documented count, coverage %) and lists of undocumented symbols across app and Mobile SDK Alpha source trees.
Package Configuration & Scripts
package.json
Added docstrings, docstrings:app, docstrings:sdk, and docstrings:report npm scripts; added tsx devDependency (^4.20.3); updated packageManager from [email protected] to [email protected].
Development Workflow Documentation
docs/development-patterns.md
Added new "Docstring coverage workflow" subsection documenting commands for generating coverage reports with optional --details flag and clarifying that reports are advisory.
Dependency Version Pinning
app/package.json
Pinned react-native-svg and react-native-svg-web to exact versions (removing caret ranges: "15.14.0" and "1.0.9" respectively).
Minor Formatting Refactors
app/metro.config.cjs, app/src/screens/app/ModalScreen.tsx, app/src/services/points/utils.ts, app/src/stores/pointEventStore.ts, packages/mobile-sdk-alpha/src/components/layout/View.tsx
Reformatted multi-line declarations and dynamic import statements to single-line form; no functional or semantic changes.
Git Ignore Configuration
.cursorignore
Updated rules to explicitly permit documentation coverage artifacts at docs/coverage/*.json instead of treating them as generic test coverage exclusions.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as npm script<br/>(yarn docstrings:app)
    participant Glob as Glob Resolver
    participant Parser as TypeScript<br/>AST Parser
    participant Detector as Documentation<br/>Detector
    participant Analyzer as Coverage<br/>Analyzer
    participant Reporter as Report<br/>Generator
    participant FS as File System

    CLI->>Glob: Discover files matching<br/>app/src/**/*.{ts,tsx}
    Glob-->>CLI: Return file paths
    CLI->>Parser: Parse each file's AST
    loop For each exported declaration
        Parser->>Detector: Check if documented<br/>(JSDoc or comment)
        Detector-->>Parser: Boolean + metadata
        Parser->>Analyzer: Track export status<br/>(direct/re-export)
        Analyzer-->>Parser: Categorized symbol
    end
    Parser-->>CLI: Per-file coverage data
    CLI->>Analyzer: Compute global metrics<br/>(total, documented, %)
    Analyzer-->>CLI: Coverage summary +<br/>undocumented list
    CLI->>Reporter: Build JSON snapshot<br/>(with --write-report flag)
    Reporter->>FS: Write docs/coverage/app.json
    FS-->>Reporter: Success
    CLI-->>CLI: Display table summary<br/>& undocumented highlights
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • aaronmgdr
  • shazarre

Poem

📚 Coverage now shines with docstrings bright,
A script that parses TSDoc with might,
Exported APIs come into sight—
No more hidden symbols lost in night! 🔍

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description covers the key changes (compact JSON structure, coverage snapshots, new workflow docs) and testing instructions, but does not follow the template structure with explicit Description/Tested/How to QA sections. Reorganize the description to match the template: add a Description section summarizing what changed, a Tested section detailing test execution, and a How to QA section with repeatable steps.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: introducing a docstring reporting script and the corresponding workflows to track TSDoc coverage.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-docstring-reporting-script-and-workflows

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.

@transphorm transphorm changed the title Reduce docstring coverage snapshot size Add docstring reporting script and workflows Oct 29, 2025
@transphorm transphorm marked this pull request as ready for review December 3, 2025 05:52
Copy link
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: 0

🧹 Nitpick comments (2)
scripts/docstring-report.ts (1)

203-213: Edge case: paths containing = will be truncated.

Using arg.split('=')[1] only captures content up to a second =. For paths like --write-report=/path/with=equals.json, the value becomes /path/with.

      if (arg.includes('=')) {
-       writeReport = arg.split('=')[1] ?? '';
+       writeReport = arg.slice(arg.indexOf('=') + 1);
        if (!writeReport) {
          throw new Error('Missing value for --write-report');
        }
.github/workflows/docstring-coverage.yml (1)

37-47: Consider capturing exit codes to detect script failures.

Currently, if yarn docstrings:app or yarn docstrings:sdk fails, the workflow continues because output is redirected. The || true on tail commands is fine, but the main commands should propagate failures.

      - name: Generate docstring coverage reports
        run: |
-         yarn docstrings:app > /tmp/docstrings-app.log
-         yarn docstrings:sdk > /tmp/docstrings-sdk.log
+         yarn docstrings:app > /tmp/docstrings-app.log 2>&1
+         yarn docstrings:sdk > /tmp/docstrings-sdk.log 2>&1
          yarn docstrings:report
          echo "::group::Mobile app coverage (tail)"
          tail -n 25 /tmp/docstrings-app.log || true
          echo "::endgroup::"
          echo "::group::Mobile SDK coverage (tail)"
          tail -n 25 /tmp/docstrings-sdk.log || true
          echo "::endgroup::"

Adding 2>&1 captures stderr in the log files. The exit codes should still propagate correctly since shell pipefail isn't disabled, but verify this in your CI environment.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 569c606 and 3993c7c.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • .github/workflows/docstring-coverage.yml (1 hunks)
  • app/docs/DOCSTRING_STYLE_GUIDE.md (1 hunks)
  • app/metro.config.cjs (1 hunks)
  • app/src/screens/app/ModalScreen.tsx (1 hunks)
  • app/src/services/points/utils.ts (1 hunks)
  • app/src/stores/pointEventStore.ts (1 hunks)
  • docs/coverage/app.json (1 hunks)
  • docs/coverage/report.json (1 hunks)
  • docs/coverage/sdk.json (1 hunks)
  • docs/development-patterns.md (1 hunks)
  • package.json (2 hunks)
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md (1 hunks)
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx (1 hunks)
  • scripts/docstring-report.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (18)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • scripts/docstring-report.ts
  • app/src/screens/app/ModalScreen.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • scripts/docstring-report.ts
  • app/src/screens/app/ModalScreen.tsx
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • scripts/docstring-report.ts
  • app/src/screens/app/ModalScreen.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
app/src/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Use module mapping @/src/ and @tests/tests/src/ in app Jest configuration

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

**/*.{ts,tsx,js}: Never log PII, credentials, or private keys in production code; use DEBUG_SECRETS_TOKEN flag for debug-level secrets
Use consistent redaction patterns for sensitive fields in logs and test data

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • scripts/docstring-report.ts
  • app/src/screens/app/ModalScreen.tsx
app/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
app/**/*.{ts,tsx,js,jsx,json,yml,yaml}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn nice passes (fixes linting and formatting) before creating a PR

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
app/**/*.{ts,tsx,js,jsx,swift,kt,java}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx,swift,kt,java}: Flag security-sensitive operations and note performance implications in code comments
Ensure no sensitive data (PII, credentials, tokens) is present in logs

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • app/src/screens/app/ModalScreen.tsx
packages/mobile-sdk-alpha/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

packages/mobile-sdk-alpha/src/**/*.{ts,tsx}: Test platform-specific code paths for React Native (iOS and Android) and web implementations
Ensure all exports in migrated modules support tree shaking for optimal bundle size
Use TypeScript adapter pattern for cross-platform implementations with consistent interfaces
Implement consistent SDKError class for error handling with error codes and details
Use lazy loading for modules to optimize runtime performance and memory usage
Use async/await patterns for non-blocking operations throughout SDK modules
Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Create clear and actionable error messages with descriptive error codes for SDK consumers
Support flexible configuration options and partner branding customization in SDK integrations

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Use TypeScript with strict type checking for this package

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Configure ESLint with TypeScript-specific rules

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Use Prettier for code formatting with root Prettier and EditorConfig settings

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
🧠 Learnings (60)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export all new migrated modules via packages/mobile-sdk-alpha/src/index.ts and document them in packages/mobile-sdk-alpha/README.md
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/**/*.{ts,tsx} : Migrate document validation logic from app/src/utils/ to packages/mobile-sdk-alpha/src/validation/ with unit tests for each validation rule and edge cases
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Test platform-specific code paths for React Native (iOS and Android) and web implementations
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.{test.ts,test.tsx,spec.ts,spec.tsx} : Create comprehensive test fixtures and mock data for each migrated module without exposing sensitive information
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/protocol/**/*.{ts,tsx} : Migrate protocol synchronization from app/src/utils/ to packages/mobile-sdk-alpha/src/protocol/ with tests for tree fetching, TTL caching, rate limiting, and memory bounds
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/processing/**/*.{ts,tsx} : Migrate MRZ processing helpers from app/src/utils/ to packages/mobile-sdk-alpha/src/processing/ with comprehensive tests for MRZ parsing and cross-platform compatibility
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to app/src/**/*.{ts,tsx} : Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Support flexible configuration options and partner branding customization in SDK integrations
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/processing/**/*.{ts,tsx} : Migrate MRZ processing helpers from app/src/utils/ to packages/mobile-sdk-alpha/src/processing/ with comprehensive tests for MRZ parsing and cross-platform compatibility

Applied to files:

  • app/src/services/points/utils.ts
  • package.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement certificate validation for passport data verification.

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data and never use real user PII

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/**/*.{ts,tsx} : Migrate document validation logic from app/src/utils/ to packages/mobile-sdk-alpha/src/validation/ with unit tests for each validation rule and edge cases

Applied to files:

  • app/src/services/points/utils.ts
  • docs/coverage/report.json
  • package.json
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export all new migrated modules via packages/mobile-sdk-alpha/src/index.ts and document them in packages/mobile-sdk-alpha/README.md

Applied to files:

  • app/src/services/points/utils.ts
  • docs/coverage/report.json
  • docs/development-patterns.md
  • package.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/**/*.{ts,tsx} : Migrate proof input generation from app/src/utils/proving/ to packages/mobile-sdk-alpha/src/proving/ with tests for register, disclose, and TEE input generation

Applied to files:

  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/attestation/**/*.{ts,tsx} : Migrate attestation verification from app/src/utils/ to packages/mobile-sdk-alpha/src/attestation/ with tests for PCR0 validation and certificate chain validation

Applied to files:

  • app/src/services/points/utils.ts
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.{test.ts,test.tsx,spec.ts,spec.tsx} : Create comprehensive test fixtures and mock data for each migrated module without exposing sensitive information

Applied to files:

  • docs/coverage/report.json
  • docs/coverage/sdk.json
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage

Applied to files:

  • docs/coverage/report.json
  • package.json
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/{ios,android}/** : Document complex native module changes and explain platform-specific code paths

Applied to files:

  • docs/coverage/report.json
  • docs/development-patterns.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports

Applied to files:

  • docs/coverage/report.json
  • package.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/samples/**/*.{ts,tsx,js,jsx} : Create sample React Native and web applications in packages/mobile-sdk-alpha/samples/ demonstrating MRZ parsing, proof flow, and iOS URL scheme integration

Applied to files:

  • docs/coverage/report.json
  • docs/development-patterns.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Ensure all exports in migrated modules support tree shaking for optimal bundle size

Applied to files:

  • docs/coverage/report.json
  • package.json
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples) rather than fake data

Applied to files:

  • docs/coverage/report.json
  • docs/coverage/sdk.json
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.integration.{test.ts,test.tsx,spec.ts,spec.tsx} : Test end-to-end flows covering complete user journeys through the identity verification process

Applied to files:

  • docs/coverage/report.json
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Include context for AI reviewers in PR descriptions; add inline comments for complex changes explaining intent.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Document API changes with examples in PRs

Applied to files:

  • docs/development-patterns.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/demo/**/*.{ts,tsx,js,jsx} : Create an in-SDK lightweight demo in packages/mobile-sdk-alpha/demo/ using embedded React Native with MRZ flow and theming hooks integration

Applied to files:

  • docs/development-patterns.md
  • package.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Test platform-specific code paths for React Native (iOS and Android) and web implementations

Applied to files:

  • docs/development-patterns.md
  • package.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-09-11T19:41:16.601Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1055
File: app/src/components/homeScreen/idCard.tsx:6-6
Timestamp: 2025-09-11T19:41:16.601Z
Learning: The React Native app in selfxyz/self does not implement responsive layouts for orientation changes. The codebase consistently uses Dimensions.get('window') rather than useWindowDimensions(), indicating that orientation handling is not a priority or architectural pattern in this project.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/aesop/PassportOnboardingScreen.tsx:0-0
Timestamp: 2025-08-26T14:41:41.821Z
Learning: When verifying provider hierarchies in React Native apps, always check the main App.tsx file at the app root, not just navigation/index.tsx and layout files, as providers are often configured at the top-level App component.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to app/src/**/*.{ts,tsx} : Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass

Applied to files:

  • package.json
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/protocol/**/*.{ts,tsx} : Migrate protocol synchronization from app/src/utils/ to packages/mobile-sdk-alpha/src/protocol/ with tests for tree fetching, TTL caching, rate limiting, and memory bounds

Applied to files:

  • package.json
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/package.json : Ensure exports are properly configured before publishing the package

Applied to files:

  • package.json
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Support flexible configuration options and partner branding customization in SDK integrations

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Run `yarn test:build` command to validate tests, build dependencies, types, and bundle analysis in both app and mobile-sdk-alpha directories

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx,json,md,yml,yaml} : Use Prettier for code formatting with root Prettier and EditorConfig settings

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, build all workspaces except `contracts` using `yarn build`, and compile Solidity contracts with `yarn workspace selfxyz/contracts build`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx} : Configure ESLint with TypeScript-specific rules

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.{test.ts,test.tsx,spec.ts,spec.tsx} : Use Vitest for testing in the mobile-sdk-alpha package with Node environment configured in vitest.config.ts

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase

Applied to files:

  • package.json
  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Use Yarn v4 for package management; execute commands using `yarn install`, `yarn add`, and `yarn remove`. Do not use npm or pnpm.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, run type-checking across the repo with `yarn types`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, run linting and formatting fixes with `yarn workspaces foreach -A -p -v --topological-dev --since=HEAD run nice --if-present`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Use Yarn workspaces for monorepo management in this project.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use TypeScript with strict type checking for this package

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Ensure Node.js 22.x is installed as specified in `.nvmrc`, then run `nvm use`, `corepack enable && corepack prepare yarnstable --activate`, and verify with `node -v && yarn -v`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • app/metro.config.cjs
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement platform-specific handling with `Platform.OS === 'ios' ? 'iOS' : 'Android'` checks before platform-specific code in React Native.

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Create clear and actionable error messages with descriptive error codes for SDK consumers

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement graceful degradation when native modules fail in React Native.

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • app/metro.config.cjs
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Implement bundle size optimization with tree shaking in React Native applications.

Applied to files:

  • app/metro.config.cjs
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Lazy load screens and components to optimize bundle size in React Native.

Applied to files:

  • app/metro.config.cjs
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Ensure `parseNFCResponse()` is tested with representative, synthetic NFC data rather than mocks

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Use TypeScript adapter pattern for cross-platform implementations with consistent interfaces

Applied to files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Use lazy loading for modules to optimize runtime performance and memory usage

Applied to files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Implement consistent SDKError class for error handling with error codes and details

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use custom hooks for complex state (`useModal`, `useHapticNavigation`) instead of inline logic.

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
🧬 Code graph analysis (1)
app/metro.config.cjs (1)
packages/mobile-sdk-demo/metro.config.cjs (1)
  • require (5-5)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: type-check
  • GitHub Check: build-deps
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: analyze-android
  • GitHub Check: iOS E2E Tests Demo App
  • GitHub Check: analyze-ios
  • GitHub Check: Android E2E Tests Demo App
🔇 Additional comments (18)
app/src/screens/app/ModalScreen.tsx (1)

38-41: Type interface reformat is safe

Only the extends Omit<ModalParams, ...> clause formatting changed; the effective type shape for navigation params is unchanged, so no behavioral or type-safety impact.

app/metro.config.cjs (1)

37-38: Metro transformer path change is purely cosmetic

babelTransformerPath still resolves react-native-svg-transformer/react-native; Metro behavior and SVG bundling are unaffected.

app/src/services/points/utils.ts (1)

132-147: Dynamic import reformat keeps behavior identical

The import('@/providers/passportDataProvider') call and destructured symbol are unchanged; only whitespace changed. Error handling and return semantics for hasUserAnIdentityDocumentRegistered remain as before.

app/src/stores/pointEventStore.ts (1)

130-143: Disclosure loader imports unchanged in behavior

The dynamic imports for getDisclosurePointEvents and useProofHistoryStore now use single-line syntax but still resolve the same modules and are awaited the same way, so event loading and DB initialization behavior are unaffected.

packages/mobile-sdk-alpha/src/components/layout/View.tsx (1)

49-51: ViewProps type composition preserved

Collapsing the ViewProps extends list into a single line does not alter the intersection of RNViewProps, SpacingProps, ViewStyle (with spacing keys omitted), and PressableViewProps. Public API and type safety are unchanged.

docs/development-patterns.md (1)

3-11: Docstring coverage workflow doc looks consistent

The added section clearly explains the yarn docstrings:* commands, JSON snapshot locations, and advisory CI behavior, matching the described tooling in this PR.

packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md (1)

1-14: SDK TSDoc style guide is well-aligned with coverage tooling

The guide sets clear expectations for summaries, params, platform notes, and examples, and ties them to yarn docstrings:sdk / yarn docstrings:report coverage artifacts, which should help keep exported SDK APIs consistently documented.

app/docs/DOCSTRING_STYLE_GUIDE.md (1)

1-14: App docstring style guide cleanly documents expectations

The guidance on TSDoc usage for app exports and the explanation of how yarn docstrings:app / yarn docstrings:report feed into advisory JSON coverage snapshots are clear and consistent with the new workflow.

scripts/docstring-report.ts (5)

171-179: Error handling approach looks solid.

The try-catch properly distinguishes Error instances from other thrown values and sets process.exitCode rather than calling process.exit() directly, which allows for proper cleanup. Good pattern for CLI scripts.


444-454: DefaultKeyword check may cause false detection.

Checking for DefaultKeyword alone (line 451) could theoretically match non-export contexts. However, reviewing the call sites, this function is only invoked on top-level statements where default would accompany export. The logic is acceptable for this use case.


512-534: Thorough JSDoc detection implementation.

The three-tier approach (checking jsDoc property, getJSDocCommentRanges, and leading comment ranges) provides robust detection across different TypeScript AST representations.


65-84: Good defensive handling for empty file matches.

The early return when no files match, combined with writing an empty report with 100% coverage, prevents misleading output and maintains report consistency.


4-4: The glob import from node:fs/promises is valid for this codebase. Node.js 22.x is the specified development version (per .nvmrc), and glob was added in Node.js v22.0.0, so this import is available and will work without issues.

Likely an incorrect or invalid review comment.

docs/coverage/sdk.json (1)

1-213: Generated coverage snapshot for SDK looks correct.

The structure aligns with the JsonReport interface from the script. The 50-entry sample limit keeps the file size manageable for version control while still providing useful visibility into undocumented exports.

docs/coverage/report.json (1)

1-214: Combined coverage report structure is consistent.

The aggregated totals (618 = 389 app + 229 SDK) are mathematically correct, confirming the script properly combines the coverage data.

.github/workflows/docstring-coverage.yml (1)

18-20: Permissions follow least-privilege principle.

contents: read for checkout and actions: write for artifact upload are the minimum required. Good security posture.

docs/coverage/app.json (1)

1-214: Generated app coverage snapshot is well-structured.

The report correctly captures the current documentation state. The 9.77% coverage establishes a baseline for tracking improvement over time. No sensitive information is exposed in the symbol listings.

package.json (1)

20-22: Clean implementation of docstring reporting scripts.

The three new npm scripts follow consistent patterns with properly escaped quotes for JSON and are well-organized with clear labels. The glob patterns are correctly passed as quoted strings to allow the script to handle matching. The tsx@^4.20.3 devDependency is appropriately versioned and follows project conventions for dev tools.

Also applies to: 72-72

@transphorm transphorm marked this pull request as draft December 4, 2025 16:06
@transphorm transphorm marked this pull request as ready for review December 18, 2025 18:55
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9ac7fb and 361348a.

⛔ Files ignored due to path filters (2)
  • app/Gemfile.lock is excluded by !**/*.lock
  • app/ios/Podfile.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • scripts/docstring-report.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • scripts/docstring-report.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • scripts/docstring-report.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • scripts/docstring-report.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

**/*.{ts,tsx,js}: Never log PII, credentials, or private keys in production code; use DEBUG_SECRETS_TOKEN flag for debug-level secrets
Use consistent redaction patterns for sensitive fields in logs and test data

Files:

  • scripts/docstring-report.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase

Applied to files:

  • scripts/docstring-report.ts
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: test
  • GitHub Check: build-android
  • GitHub Check: build-ios
  • GitHub Check: type-check
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: iOS E2E Tests Demo App
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
🔇 Additional comments (1)
scripts/docstring-report.ts (1)

347-354: Past review issues resolved.

The code now correctly:

  1. Inherits documentation status from referenced declarations in export default Foo statements (lines 348-354)
  2. Tracks inline default exports (e.g., export default function foo()) as "default" rather than by their local name (lines 402-405)

Both issues flagged in previous reviews are addressed.

Also applies to: 399-406

@transphorm
Copy link
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

✅ Actions performed

Full review triggered.

Copy link
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: 1

♻️ Duplicate comments (2)
scripts/docstring-report.ts (2)

399-402: Anonymous default exports are silently skipped.

Anonymous default exports like export default function() {} or export default class {} have no name property, so getDeclarationName returns undefined and they're skipped at line 401. This undercounts total exports and inflates coverage percentages.


373-377: Destructured exports not properly tracked.

When processing const { a, b } = obj, getDeclarationName returns the entire pattern text "{ a, b }" instead of extracting individual bindings. This causes incorrect counting for both inline destructured exports (export const { a, b } = obj) and separate destructuring with later export.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 508c183 and b3a5ed8.

⛔ Files ignored due to path filters (3)
  • app/Gemfile.lock is excluded by !**/*.lock
  • app/ios/Podfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • .github/workflows/docstring-coverage.yml
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • app/metro.config.cjs
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
  • app/src/stores/pointEventStore.ts
  • docs/coverage/app.json
  • docs/coverage/report.json
  • docs/coverage/sdk.json
  • docs/development-patterns.md
  • package.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • scripts/docstring-report.ts
🧰 Additional context used
📓 Path-based instructions (18)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • app/src/services/points/utils.ts
  • scripts/docstring-report.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • app/src/services/points/utils.ts
  • scripts/docstring-report.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • app/src/services/points/utils.ts
  • scripts/docstring-report.ts
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
app/src/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Use module mapping @/src/ and @tests/tests/src/ in app Jest configuration

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

**/*.{ts,tsx,js}: Never log PII, credentials, or private keys in production code; use DEBUG_SECRETS_TOKEN flag for debug-level secrets
Use consistent redaction patterns for sensitive fields in logs and test data

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • app/src/services/points/utils.ts
  • scripts/docstring-report.ts
app/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
app/**/*.{ts,tsx,js,jsx,json,yml,yaml}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn nice passes (fixes linting and formatting) before creating a PR

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
app/**/*.{ts,tsx,js,jsx,swift,kt,java}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx,swift,kt,java}: Flag security-sensitive operations and note performance implications in code comments
Ensure no sensitive data (PII, credentials, tokens) is present in logs

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/stores/pointEventStore.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/src/services/points/utils.ts
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Use Prettier for code formatting with root Prettier and EditorConfig settings

Files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

packages/mobile-sdk-alpha/src/**/*.{ts,tsx}: Test platform-specific code paths for React Native (iOS and Android) and web implementations
Ensure all exports in migrated modules support tree shaking for optimal bundle size
Use TypeScript adapter pattern for cross-platform implementations with consistent interfaces
Implement consistent SDKError class for error handling with error codes and details
Use lazy loading for modules to optimize runtime performance and memory usage
Use async/await patterns for non-blocking operations throughout SDK modules
Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Create clear and actionable error messages with descriptive error codes for SDK consumers
Support flexible configuration options and partner branding customization in SDK integrations

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Use TypeScript with strict type checking for this package

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Configure ESLint with TypeScript-specific rules

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
🧠 Learnings (65)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx} : Configure ESLint with TypeScript-specific rules
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, run type-checking across the repo with `yarn types`.
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Use lazy loading for modules to optimize runtime performance and memory usage

Applied to files:

  • app/src/stores/pointEventStore.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • package.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export all new migrated modules via packages/mobile-sdk-alpha/src/index.ts and document them in packages/mobile-sdk-alpha/README.md

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • docs/development-patterns.md
  • docs/coverage/sdk.json
  • app/src/services/points/utils.ts
  • package.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/{ios,android}/** : Document complex native module changes and explain platform-specific code paths

Applied to files:

  • docs/coverage/app.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/development-patterns.md
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.{test.ts,test.tsx,spec.ts,spec.tsx} : Create comprehensive test fixtures and mock data for each migrated module without exposing sensitive information

Applied to files:

  • docs/coverage/app.json
  • docs/coverage/sdk.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to app/src/**/*.{ts,tsx} : Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • docs/coverage/sdk.json
  • package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/attestation/**/*.{ts,tsx} : Migrate attestation verification from app/src/utils/ to packages/mobile-sdk-alpha/src/attestation/ with tests for PCR0 validation and certificate chain validation

Applied to files:

  • docs/coverage/app.json
  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/**/*.{ts,tsx} : Migrate document validation logic from app/src/utils/ to packages/mobile-sdk-alpha/src/validation/ with unit tests for each validation rule and edge cases

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • app/src/services/points/utils.ts
  • package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/**/*.{ts,tsx} : Migrate proof input generation from app/src/utils/proving/ to packages/mobile-sdk-alpha/src/proving/ with tests for register, disclose, and TEE input generation

Applied to files:

  • docs/coverage/app.json
  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/package.json : Ensure exports are properly configured before publishing the package

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
  • package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/samples/**/*.{ts,tsx,js,jsx} : Create sample React Native and web applications in packages/mobile-sdk-alpha/samples/ demonstrating MRZ parsing, proof flow, and iOS URL scheme integration

Applied to files:

  • docs/coverage/app.json
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/development-patterns.md
  • docs/coverage/sdk.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Ensure all exports in migrated modules support tree shaking for optimal bundle size

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • docs/coverage/sdk.json
  • package.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • app/src/screens/app/ModalScreen.tsx
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • docs/coverage/sdk.json
  • package.json
  • docs/coverage/report.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Test platform-specific code paths for React Native (iOS and Android) and web implementations

Applied to files:

  • docs/coverage/app.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • docs/development-patterns.md
  • docs/coverage/sdk.json
  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples) rather than fake data

Applied to files:

  • docs/coverage/app.json
  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Implement bundle size optimization with tree shaking in React Native applications.

Applied to files:

  • app/metro.config.cjs
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement graceful degradation when native modules fail in React Native.

Applied to files:

  • app/metro.config.cjs
  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Lazy load screens and components to optimize bundle size in React Native.

Applied to files:

  • app/metro.config.cjs
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/metro.config.cjs
  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Create clear and actionable error messages with descriptive error codes for SDK consumers

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Support flexible configuration options and partner branding customization in SDK integrations

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
  • package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Implement consistent SDKError class for error handling with error codes and details

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Use TypeScript adapter pattern for cross-platform implementations with consistent interfaces

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • packages/mobile-sdk-alpha/src/components/layout/View.tsx
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use TypeScript with strict type checking for this package

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx} : Configure ESLint with TypeScript-specific rules

Applied to files:

  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Document API changes with examples in PRs

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/demo/**/*.{ts,tsx,js,jsx} : Create an in-SDK lightweight demo in packages/mobile-sdk-alpha/demo/ using embedded React Native with MRZ flow and theming hooks integration

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/development-patterns.md
  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement platform-specific handling with `Platform.OS === 'ios' ? 'iOS' : 'Android'` checks before platform-specific code in React Native.

Applied to files:

  • app/docs/DOCSTRING_STYLE_GUIDE.md
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use custom hooks for complex state (`useModal`, `useHapticNavigation`) instead of inline logic.

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Include context for AI reviewers in PR descriptions; add inline comments for complex changes explaining intent.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-09-11T19:41:16.601Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1055
File: app/src/components/homeScreen/idCard.tsx:6-6
Timestamp: 2025-09-11T19:41:16.601Z
Learning: The React Native app in selfxyz/self does not implement responsive layouts for orientation changes. The codebase consistently uses Dimensions.get('window') rather than useWindowDimensions(), indicating that orientation handling is not a priority or architectural pattern in this project.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/aesop/PassportOnboardingScreen.tsx:0-0
Timestamp: 2025-08-26T14:41:41.821Z
Learning: When verifying provider hierarchies in React Native apps, always check the main App.tsx file at the app root, not just navigation/index.tsx and layout files, as providers are often configured at the top-level App component.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/protocol/**/*.{ts,tsx} : Migrate protocol synchronization from app/src/utils/ to packages/mobile-sdk-alpha/src/protocol/ with tests for tree fetching, TTL caching, rate limiting, and memory bounds

Applied to files:

  • docs/coverage/sdk.json
  • package.json
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Ensure `parseNFCResponse()` is tested with representative, synthetic NFC data rather than mocks

Applied to files:

  • docs/coverage/sdk.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/processing/**/*.{ts,tsx} : Migrate MRZ processing helpers from app/src/utils/ to packages/mobile-sdk-alpha/src/processing/ with comprehensive tests for MRZ parsing and cross-platform compatibility

Applied to files:

  • app/src/services/points/utils.ts
  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement certificate validation for passport data verification.

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data and never use real user PII

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)

Applied to files:

  • app/src/services/points/utils.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Run `yarn test:build` command to validate tests, build dependencies, types, and bundle analysis in both app and mobile-sdk-alpha directories

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx,json,md,yml,yaml} : Use Prettier for code formatting with root Prettier and EditorConfig settings

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, build all workspaces except `contracts` using `yarn build`, and compile Solidity contracts with `yarn workspace selfxyz/contracts build`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, run linting and formatting fixes with `yarn workspaces foreach -A -p -v --topological-dev --since=HEAD run nice --if-present`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase

Applied to files:

  • package.json
  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Use Yarn v4 for package management; execute commands using `yarn install`, `yarn add`, and `yarn remove`. Do not use npm or pnpm.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Before committing, run type-checking across the repo with `yarn types`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Use Yarn workspaces for monorepo management in this project.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:08:11.887Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Ensure Node.js 22.x is installed as specified in `.nvmrc`, then run `nvm use`, `corepack enable && corepack prepare yarnstable --activate`, and verify with `node -v && yarn -v`.

Applied to files:

  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use try-catch for async operations in React Native and TypeScript code.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Provide user-friendly error messages in UI and error handlers.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,swift,kt,java} : Flag security-sensitive operations and note performance implications in code comments

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-10-07T14:25:57.507Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1230
File: packages/mobile-sdk-alpha/package.json:66-75
Timestamp: 2025-10-07T14:25:57.507Z
Learning: Always verify directory existence from the correct package root before flagging missing directories as critical issues, especially when the package.json "files" array includes them.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{tsx,jsx} : Implement comprehensive error boundaries in React components.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-08-01T17:11:39.232Z
Learnt from: transphorm
Repo: selfxyz/self PR: 823
File: common/package.json:21-60
Timestamp: 2025-08-01T17:11:39.232Z
Learning: Explicit export mappings in package.json exports field provide better tree shaking than wildcard patterns because they enable easier static analysis by bundlers, allowing for more precise dependency graph understanding and better dead code elimination.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Prevent memory leaks in native modules in React Native.

Applied to files:

  • scripts/docstring-report.ts
🔇 Additional comments (7)
app/docs/DOCSTRING_STYLE_GUIDE.md (1)

1-14: Well-structured docstring guide.

The TSDoc conventions and imperative mood guidance align with best practices. The advisory approach to coverage tracking (non-blocking builds) is pragmatic for initial rollout.

packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md (1)

1-14: SDK documentation guide is comprehensive.

Appropriately emphasizes platform nuances and integrator experience. The advisory coverage tracking approach gives teams flexibility during initial adoption.

package.json (1)

20-22: Docstring scripts are well-structured.

The scripts correctly target app and SDK TypeScript files with appropriate labels and output paths to docs/coverage/*.json.

scripts/docstring-report.ts (2)

89-104: Error handling implemented correctly.

The per-file error handling has been properly implemented with try-catch, error logging, and graceful continuation.


222-243: Argument parsing is correct.

The implementation uses exact match checks (===) before startsWith, which properly validates arguments. The pattern arg === '--label' || arg.startsWith('--label=') correctly handles both --label value and --label=value forms while rejecting typos like --labels.

docs/development-patterns.md (1)

3-11: Clear and accurate documentation.

The docstring coverage workflow documentation correctly describes the commands, output files, --details flag, and advisory nature of the GitHub Actions workflow.

.github/workflows/docstring-coverage.yml (1)

1-55: Well-designed workflow with good error handling.

The workflow properly uses log redirection, GitHub Actions grouping for readable output, and graceful error handling with || true and if-no-files-found: warn. The advisory nature (always succeeds) aligns with the documented behavior.

Copy link
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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3a5ed8 and 7a1bf99.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • app/package.json
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
📓 Path-based instructions (1)
app/**/*.{ts,tsx,js,jsx,json,yml,yaml}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn nice passes (fixes linting and formatting) before creating a PR

Files:

  • app/package.json
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx} : Configure ESLint with TypeScript-specific rules
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage

Applied to files:

  • app/package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Test platform-specific code paths for React Native (iOS and Android) and web implementations

Applied to files:

  • app/package.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/crypto/**/*.{ts,tsx} : Migrate crypto adapters from app/src/utils/ to packages/mobile-sdk-alpha/src/crypto/ with tests for WebCrypto vs noble/* fallback and timing-safe comparisons

Applied to files:

  • app/package.json
📚 Learning: 2025-06-30T15:51:11.193Z
Learnt from: transphorm
Repo: selfxyz/self PR: 636
File: app/android/app/build.gradle:76-76
Timestamp: 2025-06-30T15:51:11.193Z
Learning: For React Native 0.80, the correct JSC version is `io.github.react-native-community:jsc-android:2026004.+`. This version was specifically built with Android NDK r23 to align with React Native 0.80's NDK requirements and prevent compatibility issues. The `2026004` version pattern is the official version for RN 0.80, not an outdated pin.

Applied to files:

  • app/package.json
📚 Learning: 2025-12-01T14:30:34.749Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1448
File: packages/mobile-sdk-demo/package.json:45-45
Timestamp: 2025-12-01T14:30:34.749Z
Learning: In selfxyz/self, react-native-blur-effect1.1.3 is acceptable to use with React Native 0.76.9 despite its declared peer dependency of react-native@^0.66.4, as the package functionality works correctly across versions.

Applied to files:

  • app/package.json
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.

Applied to files:

  • app/package.json
📚 Learning: 2025-06-30T15:27:13.795Z
Learnt from: transphorm
Repo: selfxyz/self PR: 636
File: app/ios/Podfile:14-14
Timestamp: 2025-06-30T15:27:13.795Z
Learning: React Native 0.80 supports iOS 15.1 as the minimum deployment target, not iOS 16.0. This allows for broader device compatibility while still being compatible with the React Native 0.80 upgrade.

Applied to files:

  • app/package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.

Applied to files:

  • app/package.json
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test
  • GitHub Check: test-common
  • GitHub Check: type-check
  • GitHub Check: Cursor Bugbot
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: analyze-android

Copy link
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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a1bf99 and 6e4ce9c.

⛔ Files ignored due to path filters (2)
  • app/Gemfile.lock is excluded by !**/*.lock
  • app/ios/Podfile.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .cursorignore
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/app.json
  • docs/coverage/sdk.json
  • docs/development-patterns.md
  • package.json
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • scripts/docstring-report.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/mobile-sdk-alpha/docs/DOCSTRING_STYLE_GUIDE.md
  • docs/coverage/sdk.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/docs/DOCSTRING_STYLE_GUIDE.md
  • package.json
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • scripts/docstring-report.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • scripts/docstring-report.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • scripts/docstring-report.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

**/*.{ts,tsx,js}: Never log PII, credentials, or private keys in production code; use DEBUG_SECRETS_TOKEN flag for debug-level secrets
Use consistent redaction patterns for sensitive fields in logs and test data

Files:

  • scripts/docstring-report.ts
🧠 Learnings (38)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:11.887Z
Learning: Include context for AI reviewers in PR descriptions; add inline comments for complex changes explaining intent.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/**/*.{ts,tsx} : Migrate document validation logic from app/src/utils/ to packages/mobile-sdk-alpha/src/validation/ with unit tests for each validation rule and edge cases
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/processing/**/*.{ts,tsx} : Migrate MRZ processing helpers from app/src/utils/ to packages/mobile-sdk-alpha/src/processing/ with comprehensive tests for MRZ parsing and cross-platform compatibility
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export all new migrated modules via packages/mobile-sdk-alpha/src/index.ts and document them in packages/mobile-sdk-alpha/README.md
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{test,spec}.{ts,tsx,js,jsx} : Ensure `yarn test` passes (unit tests) before creating a PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/protocol/**/*.{ts,tsx} : Migrate protocol synchronization from app/src/utils/ to packages/mobile-sdk-alpha/src/protocol/ with tests for tree fetching, TTL caching, rate limiting, and memory bounds
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx} : Ensure `yarn types` passes (TypeScript validation) before creating a PR

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{test,spec}.{ts,tsx,js,jsx} : Ensure `yarn test` passes (unit tests) before creating a PR

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `@/` alias for src imports and `tests/` alias for test imports in TypeScript/JavaScript files.

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,json,yml,yaml} : Ensure `yarn nice` passes (fixes linting and formatting) before creating a PR

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Test platform-specific code paths for React Native (iOS and Android) and web implementations

Applied to files:

  • .cursorignore
  • docs/development-patterns.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx} : Configure ESLint with TypeScript-specific rules

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to **/*.{ts,tsx,js} : Use consistent redaction patterns for sensitive fields in logs and test data

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Prevent memory leaks in native modules in React Native.

Applied to files:

  • .cursorignore
  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to app/src/**/*.{ts,tsx,js} : Use module mapping `@/` → `src/` and `tests/` → `tests/src/` in app Jest configuration

Applied to files:

  • .cursorignore
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Document API changes with examples in PRs

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export all new migrated modules via packages/mobile-sdk-alpha/src/index.ts and document them in packages/mobile-sdk-alpha/README.md

Applied to files:

  • docs/development-patterns.md
  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/{ios,android}/** : Document complex native module changes and explain platform-specific code paths

Applied to files:

  • docs/development-patterns.md
  • docs/coverage/app.json
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/demo/**/*.{ts,tsx,js,jsx} : Create an in-SDK lightweight demo in packages/mobile-sdk-alpha/demo/ using embedded React Native with MRZ flow and theming hooks integration

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/samples/**/*.{ts,tsx,js,jsx} : Create sample React Native and web applications in packages/mobile-sdk-alpha/samples/ demonstrating MRZ parsing, proof flow, and iOS URL scheme integration

Applied to files:

  • docs/development-patterns.md
  • docs/coverage/app.json
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-09-11T19:41:16.601Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1055
File: app/src/components/homeScreen/idCard.tsx:6-6
Timestamp: 2025-09-11T19:41:16.601Z
Learning: The React Native app in selfxyz/self does not implement responsive layouts for orientation changes. The codebase consistently uses Dimensions.get('window') rather than useWindowDimensions(), indicating that orientation handling is not a priority or architectural pattern in this project.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/aesop/PassportOnboardingScreen.tsx:0-0
Timestamp: 2025-08-26T14:41:41.821Z
Learning: When verifying provider hierarchies in React Native apps, always check the main App.tsx file at the app root, not just navigation/index.tsx and layout files, as providers are often configured at the top-level App component.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • docs/development-patterns.md
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/**/*.{ts,tsx} : Migrate artifact management from app/src/utils/ to packages/mobile-sdk-alpha/src/artifacts/ with tests for manifest validation, CDN downloads, signature verification, and storage

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/tests/**/*.{test.ts,test.tsx,spec.ts,spec.tsx} : Create comprehensive test fixtures and mock data for each migrated module without exposing sensitive information

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to app/src/**/*.{ts,tsx} : Update app to consume mobile-sdk-alpha modules after migration and validate all existing app tests pass

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/attestation/**/*.{ts,tsx} : Migrate attestation verification from app/src/utils/ to packages/mobile-sdk-alpha/src/attestation/ with tests for PCR0 validation and certificate chain validation

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/**/*.{ts,tsx} : Migrate document validation logic from app/src/utils/ to packages/mobile-sdk-alpha/src/validation/ with unit tests for each validation rule and edge cases

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/**/*.{ts,tsx} : Migrate proof input generation from app/src/utils/proving/ to packages/mobile-sdk-alpha/src/proving/ with tests for register, disclose, and TEE input generation

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/package.json : Ensure exports are properly configured before publishing the package

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Ensure all exports in migrated modules support tree shaking for optimal bundle size

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:07:55.507Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-11-25T14:07:55.507Z
Learning: Applies to packages/mobile-sdk-alpha/src/**/*.{ts,tsx} : Provide comprehensive TypeScript type definitions and maintain type safety across SDK exports

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples) rather than fake data

Applied to files:

  • docs/coverage/app.json
📚 Learning: 2025-11-25T14:08:51.177Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:51.177Z
Learning: Before committing changes, run `yarn types` to check TypeScript types across the codebase

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use try-catch for async operations in React Native and TypeScript code.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Provide user-friendly error messages in UI and error handlers.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:08:23.106Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-11-25T14:08:23.106Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx,swift,kt,java} : Flag security-sensitive operations and note performance implications in code comments

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-10-07T14:25:57.507Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1230
File: packages/mobile-sdk-alpha/package.json:66-75
Timestamp: 2025-10-07T14:25:57.507Z
Learning: Always verify directory existence from the correct package root before flagging missing directories as critical issues, especially when the package.json "files" array includes them.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{tsx,jsx} : Implement comprehensive error boundaries in React components.

Applied to files:

  • scripts/docstring-report.ts
📚 Learning: 2025-08-01T17:11:39.232Z
Learnt from: transphorm
Repo: selfxyz/self PR: 823
File: common/package.json:21-60
Timestamp: 2025-08-01T17:11:39.232Z
Learning: Explicit export mappings in package.json exports field provide better tree shaking than wildcard patterns because they enable easier static analysis by bundlers, allowing for more precise dependency graph understanding and better dead code elimination.

Applied to files:

  • scripts/docstring-report.ts
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test
  • GitHub Check: type-check
  • GitHub Check: test-common
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: analyze-android
🔇 Additional comments (3)
.cursorignore (1)

139-141: LGTM: Coverage artifacts correctly allowed.

The explicit exceptions for docs/coverage/ ensure the new docstring coverage JSON snapshots are tracked in version control and visible to Cursor AI, which aligns with the PR's workflow requirements.

Also applies to: 265-266

docs/development-patterns.md (1)

3-11: LGTM: Clear workflow documentation.

The docstring coverage workflow section provides concise guidance on running coverage checks and understanding the output artifacts. The advisory nature is appropriately communicated.

docs/coverage/app.json (1)

1-214: Generated artifact: Initial coverage baseline.

This JSON snapshot represents the initial docstring coverage baseline for the mobile app (15.09%). As documented in the workflow, these reports are advisory and serve to track coverage improvements over time.

Comment on lines +788 to +802
async function writeJsonReport(
targetPath: string,
report: JsonReport,
): Promise<void> {
const resolvedPath = path.resolve(process.cwd(), targetPath);
await fs.mkdir(path.dirname(resolvedPath), { recursive: true });
await fs.writeFile(
resolvedPath,
`${JSON.stringify(report, null, 2)}\n`,
'utf8',
);
console.log(
`\nSaved coverage snapshot to ${path.relative(process.cwd(), resolvedPath)}`,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Validate output path to prevent unintended file writes.

The writeJsonReport function accepts an arbitrary targetPath without validation. This could allow writing JSON reports to unexpected filesystem locations if a user provides a malicious or erroneous path (e.g., ../../../../tmp/malicious.json).

🔎 Suggested validation
 async function writeJsonReport(
   targetPath: string,
   report: JsonReport,
 ): Promise<void> {
   const resolvedPath = path.resolve(process.cwd(), targetPath);
+  
+  // Validate that resolved path is within project directory
+  const projectRoot = process.cwd();
+  if (!resolvedPath.startsWith(projectRoot)) {
+    throw new Error(
+      `Invalid report path: ${targetPath} resolves outside project directory`
+    );
+  }
+  
   await fs.mkdir(path.dirname(resolvedPath), { recursive: true });
   await fs.writeFile(
     resolvedPath,
     `${JSON.stringify(report, null, 2)}\n`,
     'utf8',
   );
   console.log(
     `\nSaved coverage snapshot to ${path.relative(process.cwd(), resolvedPath)}`,
   );
 }
🤖 Prompt for AI Agents
In scripts/docstring-report.ts around lines 788 to 802, the function currently
writes any resolved targetPath directly which allows path traversal or writing
outside the repo; before creating directories or writing the file, validate the
resolvedPath: compute repository root (e.g., process.cwd()), normalize and
resolve the targetPath, then ensure the resolvedPath is inside the repo root
(use path.relative and confirm it does not start with '..' and is not absolute
outside the root); reject or throw an error for absolute paths that point
outside the repo or for paths containing traversal, and only proceed to
mkdir/write when the path validation passes (also prefer requiring relative
target paths or constrain allowed subdirectory such as a dedicated reports
directory).

@transphorm transphorm merged commit 7dbd46f into dev Dec 25, 2025
33 checks passed
@transphorm transphorm deleted the codex/add-docstring-reporting-script-and-workflows branch December 25, 2025 19:17
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.

2 participants