Skip to content

Phase 3: JSON config import/export (profiles, vocab, prompts) - #52

Merged
initcore0 merged 1 commit into
mainfrom
feat/phase3-import-export
Jun 24, 2026
Merged

Phase 3: JSON config import/export (profiles, vocab, prompts)#52
initcore0 merged 1 commit into
mainfrom
feat/phase3-import-export

Conversation

@initcore0

Copy link
Copy Markdown
Owner

First Phase 3 (hackability) item. Lets users back up, hand-edit, and share their setup — and lays the foundation that config packs will reuse.

Changes

  • ConfigBundle (OpenWhispCore, Foundation-only, Codable): a versioned (schemaVersion) snapshot of profiles + vocabulary + named-command prompts.
    • Tolerant decode — every section optional, unknown keys ignored — so partial bundles / vocab-only packs round-trip and forward-compatible fields don't break an older importer.
    • Rejects a schemaVersion newer than the app understands; reports malformed input distinctly.
    • Pretty/sorted/stable JSON; a human-readable summary for import confirmation + pack listings.
  • AppState: exportConfig() / applyConfig() / exportConfig(to:) / importConfig(from:). Import applies only the sections present (each @Published setter persists via its didSet), so a vocab-only file only changes vocabulary. History and secrets are excluded from export.
  • SettingsView: a Backup & Sharing section (Advanced) with Export…/Import… (NSSavePanel/NSOpenPanel) and friendly status/error messages, including the file-needs-a-newer-app and malformed-file cases.
  • Tests: +13 ConfigBundleTests (full/empty/partial round-trip, tolerant decode, unknown-key tolerance, version accept/reject, malformed, summary grammar). One caught a test bug (random Substitution ids per call) — fixed the test, not the product. 134 → 147.
  • README + ROADMAP updated.

swift test 147/147 · ./build.sh clean.

🤖 Generated with Claude Code

First Phase 3 (hackability) item. Lets users back up, hand-edit, and share their
OpenWhisp setup, and lays the foundation that config packs will reuse.

- ConfigBundle (OpenWhispCore, Foundation-only, Codable): a versioned
  (schemaVersion) snapshot of profiles + vocabulary + named-command prompts.
  Tolerant decode (every section optional, unknown keys ignored) so partial
  bundles / vocab-only packs round-trip and forward-compatible fields don't break
  an older importer. Rejects a schemaVersion newer than the app understands;
  reports malformed input. Pretty/sorted/stable JSON output. Has a human-readable
  `summary` for confirmation + pack listings.
- AppState: exportConfig()/applyConfig()/exportConfig(to:)/importConfig(from:).
  Import applies only the sections present (each @published setter's didSet
  persists), so a vocab-only file only changes vocabulary. History and secrets are
  intentionally excluded from export.
- SettingsView: "Backup & Sharing" section (Advanced) with Export…/Import… via
  NSSavePanel/NSOpenPanel and friendly status/error messages (incl. version-too-new
  and malformed-file cases).
- Tests: +13 ConfigBundleTests (full/empty/partial round-trip, tolerant decode,
  unknown-key tolerance, version accept/reject, malformed, summary grammar). One
  caught a test bug (Substitution ids are random per call) — fixed the test, not
  the product. 134 -> 147.
- README + ROADMAP updated.

swift test 147/147; ./build.sh clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@initcore0
initcore0 merged commit e4b0469 into main Jun 24, 2026
3 checks passed
@initcore0
initcore0 deleted the feat/phase3-import-export branch June 24, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant