fix(git): the catch-up commit of a sync or publish is not a page step #277
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!277
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/270"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #270
What
Sync and a branch-mode publish commit any uncommitted working-tree changes before they start, with the subjects
deckle: save before syncanddeckle: save before publish.parseSnapshotSubjectread those as an opsaveon a page namedbefore sync(orbefore publish). As a result,GET /api/git/statereportedundoPage: "before sync", and the editor disabled Undo on every page.internal/gitreponow exportsSyncCatchUpMessage,PublishCatchUpMessageandIsCatchUpMessage, andsync.goandpublish.gouse them.internal/servercontains no literal of either subject.parseSnapshotSubjectreturns okfalsefor a catch-up subject. The undo state therefore treats that tip as a commit deckle did not write:undoAvailableandundoTimeare present, andundoOp,undoPage,undoPagesandundoLangare absent. Undo restores the open page from the tip's parent. No client, catalog orundo_ops.jsonchange.docs/api.md, theundo*bullet ofGET /api/git/statenow names the exclusion, andPOST /api/git/synclinks to it.Tests
TestSnapshotSubjectCatchUpIsNoStep: both subjects parse as okfalse.TestBranchModeSyncCatchUpIsUnnamedUndo: hand-edit a page, sync, check that git/state carries no op or page, then undo the page and check the pre-edit content is back.TestBranchModePublishCatchUpIsUnnamedUndo: the publish catch-up commit as the draft tip.undoPage = before sync/before publish.Note on the publish scenario. The server has no path-scoped publish:
POST /api/publish-all→PublishAll, andPublishPathshas no non-test caller. A hand edit inside the publish roots is therefore always published, and the catch-up commit collapses. The commit stays as the draft tip only when the pending change includes a file outside those roots. The test uses a hand-edited layout for that. Undo on the published page answers with the page state and leaves the published content in place, because the commit's parent is the new main.Verification
go vet ./...,go test ./...,gofmt -l, andcd web && npm test(3210 passed) are all green.🤖 Generated with Claude Code
[autoland] verdict: pass
PASS — signal: ci / build-and-test (pull_request) green (aggregate success, run 279). Conventions: Conventional Commits title, Closes #270 present. Scope matches the #270 Agent Brief: the catch-up subjects are exported once in internal/gitrepo/snapshot.go:57-66 (SyncCatchUpMessage, PublishCatchUpMessage, IsCatchUpMessage) and used by sync.go:55 and publish.go:253. parseSnapshotSubject (internal/server/git.go:471) calls that predicate, so undoState, undoPageSet and stepTranslationFiles all treat the commit as undescribed. internal/server holds no literal of either subject. The docs/api.md undo* bullet and POST /api/git/sync are updated. No skill or AGENTS.md surface is affected. Locally verified that the three new tests fail with the guard disabled (undoPage = before sync / before publish) and pass with it.