feat: save and load mapping files to/from GitHub - #140
Draft
kyuchia wants to merge 8 commits into
Draft
Conversation
Backend-agnostic core shared by both storage options under discussion (Worker-proxy vs user-owned repo): - csv.ts: RFC 4180 CSV serialize/parse (base64 image fields, quotes, commas, newlines) - cressRows.ts: bridge between Cress's [headers, ...rowObjects] payload and string[][] - backend.ts: StorageBackend interface + Conflict/NotAuthenticated errors - MappingStorage.ts: orchestration (SHA conflict check, logged-out PouchDB fallback per #138) - GitHubUserRepoBackend.ts: contents-API backend (repo assumed to exist; POST /user/repos deferred to ensureRepo() stub) - PouchDbLocalStore.ts: adapter onto existing Storage.ts (skeleton)
…r repo) (#3) Both StorageBackend implementations behind the shared interface, so the meeting can choose between them with working code rather than on paper: - GitHubUserRepoBackend.ensureRepo(): real impl (GET /repos check + POST /user/repos with auto_init, idempotent). Option 2 is end-to-end capable against the user's own repo. - WorkerBackend (new): Option 1, routes /files/{read,write,list,delete} through a lab Worker that holds GitHub write creds; user token used for authz. Frontend complete and mock-tested; Worker endpoints not yet built (current Worker only does OAuth exchange). Mock-tested: ensureRepo create/no-op/idempotent, WorkerBackend CRUD + conflict, and an interchangeability check proving MappingStorage behaves identically with either backend injected.
Collaborator
Author
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Moves the
.csvsuffix to the GitHub backend boundary..csvon read/write/delete and strips it fromlistFilesoutput.Verified
<name>.csvwith clean CSV content.Still open (not in this PR)
deleteMappingis wired.