test(git-sync): fix #119 review F1-F4 (bind assert, cross-move + strip tests, comment)

F1: git-sync.orchestrator.spec bind assertion now includes spaceId ('space-1'),
matching driveCycle's dataSource.bind({workspaceId,userId,spaceId}).
F2: add 4 non-vacuous tests for the cross-space move data-loss guard in deletePage
(CTX_SPACE with spaceId): move-out skips removePage (returns skipped:'moved-to-other-space');
same-space / not-found / already-deleted all still call removePage.
F3: add 2 tests for the ~<slugId> title-strip guard in renamePage (own slugId stripped;
a foreign ~<slugId> tail left intact).
F4: reword the gitmost-datasource 'single choke point' comment — the strip covers the
rename/update path, not every git-sync title write (createPage's filename-derived title
does not funnel through here).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
agent_coder
2026-07-02 15:34:43 +03:00
parent e4ff146ab0
commit fcc9ae0c24
3 changed files with 114 additions and 5 deletions
@@ -294,10 +294,12 @@ describe('GitSyncOrchestrator', () => {
expect(deps.vault).toBe(built.vault);
expect(deps.client).toBe(built.client);
expect(deps.settings.vaultPath).toBe('/vaults/space-1');
// The bound datasource identity is the (workspace, service-user) pair.
// The bound datasource identity is the (workspace, service-user) pair,
// plus the reconciling spaceId used by deletePage's cross-move guard.
expect(built.dataSource.bind).toHaveBeenCalledWith({
workspaceId: 'ws-1',
userId: 'svc-user',
spaceId: 'space-1',
});
});