mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
Records feat-014 (GitHub GraphQL batch push/delete, commit114a575) and feat-015 (avoid stale remote-tree read after push, commit7676325) as done. Also archived feat-011/012/013 and other completed narratives out of progress.md (had grown past its own 80-line cleanup threshold) into archive/2026-07.md, and trimmed feature_list.json evidence strings under 300 chars — harness self-audit was 96/100, now 100/100.
5 KiB
5 KiB
Session Handoff
Current Objective
- Two fixes this session, both committed onto
claude/fix-directory-symlink-pull-260713(PR #51), not yet pushed to remote:- feat-014 (commit
114a575): GitHub'spushBatch/deleteBatchswitched from the REST Git Data API's per-file blob-creation loop to a single GraphQLcreateCommitOnBranchmutation. - feat-015 (commit
7676325): fixed a false "modified" status shown right after a batch push, caused by re-fetching the remote tree too soon after a write (GitHub's tree-by-branch-name read can lag a moment behind a just-completed commit).
- feat-014 (commit
Completed This Session
githubGraphQL()helper ingithub-service.ts; explicit handling for GraphQL's 200-status-with-errors-array failure mode.BaseGitService.getLatestCommitSha()extracted fromresolveGitHubStyleBaseTree().SyncManager.pushAllFiles()now returnssyncedPaths: Array<{path, sha?}>, populated at all three push-success sites (batch chunk, sequential fallback, immediate symlink/rename push).SyncStatusView.executeBatchOperation()marks just-pushed paths'synced'directly via a newapplyOptimisticSyncedStatus()instead of callingrefreshAllStatuses()after a push. Pull is unchanged (still does a full refresh).- Live-verified both fixes against a real GitHub repo (
firstsun-dev/obsidian-sync-test) using a scratchpad script that bundles the actualgithub-service.tswith a thinobsidianstub (requestUrlbacked by realfetch) — not just mocks. - Filed issue #57 on
firstsun-dev/git-files-sync(Project #6, P2, 4h): build a repeatable live-credential smoke test process across GitHub/GitLab/Gitea (this session only covered GitHub). - Cleaned up harness state: archived feat-011/012/013 + issue #78 fix + status-badge UI work into
archive/2026-07.md(progress.md had grown past its own 80-line cleanup threshold); trimmedfeature_list.jsonevidence strings under 300 chars. Harness self-audit went from 96/100 to 100/100.
Verification Evidence
| Check | Command | Result | Notes |
|---|---|---|---|
| Lint | npx eslint . |
0 errors | |
| Type check + compat | npm run build |
Pass | Includes Obsidian 1.11.0 compat typecheck |
| Tests | npx vitest run |
344/344 passed | +3 new: 2 for syncedPaths, 1 more for the post-push status behavior (total 5 new across both fixes) |
| Live smoke test | ad-hoc scratchpad scripts | Pass | feat-014: pushBatch/deleteBatch each produced one commit with correct content. feat-015: single empty file and two-identical-empty-file batches both wrote correct 0-byte blobs with matching git shas — confirmed the bug was read-side (tree fetch timing), not write-side |
| Manual (in Obsidian) | — | Not done | No Obsidian instance available in this environment |
Files Changed (this session)
- feat-014:
src/services/github-service.ts,src/services/git-service-base.ts,tests/services/github-service.test.ts - feat-015:
src/logic/sync-manager.ts,src/ui/SyncStatusView.ts,tests/logic/sync-manager-batch.test.ts,tests/ui/SyncStatusView.test.ts - Harness state:
progress.md,session-handoff.md,feature_list.json,archive/2026-07.md
Decisions Made
- GraphQL only for GitHub: GitLab's Commits API already sends a whole batch in one call; Gitea has no GraphQL API.
GitServiceInterfacestays REST-based elsewhere. - Optimistic local status update over re-fetching (feat-015): use data already known from the push itself rather than trusting an immediate remote read, which sidesteps GitHub's eventual-consistency window rather than just narrowing it with a delay/retry.
- Credential handling: PATs must go into a scratchpad file the agent reads directly (
fs.readFileSync), never typed as a!-prefixed command (still lands in the transcript) or passed as a Bash command-line argument (blocked by the permission classifier as credential materialization). Filed issue #57 to formalize this as the only documented path for future provider testing.
Blockers / Risks
- Commits
114a575and7676325are local only — not pushed toorigin/claude/fix-directory-symlink-pull-260713yet. Confirm with the user before pushing. - PR #51 keeps growing (10+ issues' worth now) — still worth flagging before adding more.
Next Session Startup
- Read
CLAUDE.md,feature_list.json,progress.md, then this file. - Run
./init.shbefore editing. - Check whether
114a575/7676325have been pushed yet (git log origin/claude/fix-directory-symlink-pull-260713..HEAD); push first if not, after confirming with the user.
Recommended Next Step
- Push this session's two commits, then either re-sync
gh issue listor move to issue #37 (Bitbucket provider support) per the previously agreed order.