ChatCards turns user-confirmed sentences from the current ChatGPT conversation into typed fill-in-the-blank cards, publishes immutable JSON batches to Google Drive application data, and imports them into a local-first SwiftUI reviewer.
This repository currently implements the M0 contract and cross-client storage spike. It does not yet contain a production OAuth broker, production MCP deployment, or finished iOS application.
- ChatGPT side: one Skill plus one authenticated MCP write tool; no widget.
- Card type:
type_answer, exactly one blank, 1–10 cards per batch. - Privacy: the MCP receives confirmed card fields, never a complete transcript.
- Transport: one immutable JSON file per batch in Drive
appDataFolder. - iOS: SwiftUI and SwiftData, with review state kept locally.
- Sync: first sync after login and user-triggered sync only.
- Scheduling: the typed answer provides feedback; the user chooses Again, Hard, Good, or Easy.
contracts/ Shared v1 JSON Schema, fixtures, and hash vectors
packages/contract-ts/ TypeScript validation and canonical hashing
ios/Packages/ChatCardsCore/ Swift contract, validation, comparison, and tests
spikes/drive-cross-client/ Web/iOS Drive appDataFolder interoperability spike
docs/ Architecture decisions and M0 runbook
npm install
npm run check
cd ios/Packages/ChatCardsCore
swift testThe Swift command requires an installed Swift 6 toolchain. The Drive spike additionally requires a Google Cloud project and OAuth client configuration; no credentials belong in this repository.
- TypeScript and Swift accept and reject the same contract fixtures.
- Both implementations produce the same SHA-256 digest for the canonical payload vector.
- A Web OAuth client can create a marker in
appDataFolder. - An iOS OAuth client in the same Google Cloud project and using the same Google account can read it.
- The reverse write/read direction works, while another Google account remains isolated.
See docs/m0-runbook.md for the execution order.
- TypeScript contract: 30 tests passing.
- Drive CLI: typecheck and 4 tests passing.
- Dependency gate: no high or critical npm audit finding; the remaining Ajv
$dataadvisory is documented indocs/security-notes.mdand the feature is disabled. - Swift Core: source and XCTest are present with the same golden hashes; this Linux workspace has no Swift toolchain, so GitHub Actions runs
swift teston macOS.