mattrguerra/cortexmainPrivate on GitHub, published here in full

verify-on-mac.md

Language Markdown4.2 KB77 lines

docs/verify-on-mac.md

  1. # Checking Cortex on a Mac with a real key
  2. Everything in this repository runs against a local stand-in server in CI.
  3. A few things can only be checked on a Mac with a real DeepInfra key, because
  4. they depend on the provider's live behavior or on macOS itself. This takes
  5. about five minutes. Each step says what you should see.
  6. ## 1. Build and open it
  7. ```bash
  8. npm ci
  9. npm run tauri build -- --bundles app
  10. open target/release/bundle/macos/Cortex.app
  11. ```
  12. Or install the `.dmg` from the `macos` workflow's artifact. It is ad-hoc
  13. signed, so macOS asks once: System Settings, Privacy & Security, "Open Anyway".
  14. - [ ] The window opens with frosted, translucent panels over the desktop (vibrancy).
  15. - [ ] Settings, Appearance: switching "Window material" changes the frost at once,
  16. and lowering "Panel tint" lets more of the desktop color through. macOS
  17. fixes the blur strength per material, so these are the two dials there are.
  18. - [ ] The sidebar sits clear of the red/yellow/green window buttons.
  19. ## 2. The key goes to the Keychain
  20. Settings, DeepInfra, paste the key, Save. Cortex checks the key with
  21. DeepInfra before storing it.
  22. - [ ] A good key: one message, "Key saved. DeepInfra accepted it."
  23. - [ ] A wrong key (change one character): "DeepInfra rejected this key, so it was not saved", and nothing is stored.
  24. - [ ] macOS may ask Cortex to use the Keychain: choose Always Allow.
  25. - [ ] Keychain Access shows an item named `com.mattrguerra.cortex`, account `provider:deepinfra`.
  26. - [ ] Quit and reopen: the key field says "Saved in your keychain", and the app asks the Keychain at most once per launch.
  27. ## 3. Live prices
  28. Open the model picker.
  29. - [ ] The footer says "Prices from DeepInfra, updated ..." (not "offline copy").
  30. - [ ] A model you know shows its current price per million tokens.
  31. ## 4. A real reply is billed correctly
  32. Send a short message to a cheap model (say `google/gemma-3-12b-it`).
  33. - [ ] The reply streams in word by word.
  34. - [ ] The line under it reads like `NN in, NN out, $0.0000x` with **no** "est." badge. That confirms DeepInfra sent its usage block, and that Cortex found it.
  35. - [ ] The number matches the arithmetic: in x input price + out x output price, per million.
  36. - [ ] DeepInfra's dashboard shows the same request (its total may differ slightly if it bills cached tokens).
  37. ## 5. Stop, reasoning and images
  38. - [ ] Ask something long, press Stop (or Esc): the partial reply stays, marked "Stopped", with an "est." cost.
  39. - [ ] Pick a reasoning model (tagged `reasoning`) and ask a puzzle: a collapsed "Reasoning" section appears above the answer.
  40. - [ ] Pick a vision model, paste a screenshot into the composer: it attaches as a chip, and the answer describes the image.
  41. ## 6. The quick prompt
  42. - [ ] Press Cmd+Shift+Space anywhere: the small frosted prompt appears, centered on the screen under the pointer.
  43. - [ ] Ask something: the window grows to fit the answer, with its cost.
  44. - [ ] Cmd+Enter opens the same chat in the main window. Esc hides the prompt.
  45. - [ ] Clicking elsewhere hides it.
  46. - [ ] Settings, Quick prompt, record another shortcut: the new one works and the old one no longer does.
  47. ## 7. Tray, closing and export
  48. - [ ] The menu bar icon's menu shows "This month: $X.XX of $10.00".
  49. - [ ] Closing the main window hides it; Cortex keeps running in the menu bar. Cmd+Q quits.
  50. - [ ] Settings, Export, choose your vault folder. Then, in a chat, ... menu, "Export to vault": a note appears with frontmatter (tokens, cost, models) and any images in `attachments/`.
  51. ## If something is off
  52. - **Costs marked "est." on DeepInfra.** The final usage block did not arrive or was not recognized. Run cortex-core's parser tests (`cargo test -p cortex-core openai`) against a captured chunk, and add that chunk as a fixture.
  53. - **"Rejected this key" for a key that works elsewhere.** Paste it into a terminal: `curl -H "Authorization: Bearer $KEY" https://api.deepinfra.com/v1/openai/models -o /dev/null -w "%{http_code}"`. A 401 there means DeepInfra refuses it too; make a new key.
  54. - **No vibrancy.** Check that `macOSPrivateApi` is still true in `src-tauri/tauri.conf.json`.
  55. - **The shortcut does nothing.** Another app may own it; macOS does not always report the conflict. Record a different one.