diff --git a/ingestion/internal/mcp/edit_pathio_test.go b/ingestion/internal/mcp/edit_pathio_test.go index 1fb2f45..ab6d35b 100644 --- a/ingestion/internal/mcp/edit_pathio_test.go +++ b/ingestion/internal/mcp/edit_pathio_test.go @@ -111,6 +111,12 @@ func TestBrainEditRollbackDoesNotWriteThroughASymlinkSwappedInForTheNote(t *test })() resp := authCall(t, srv, jwtAuthz, "brain_edit", map[string]any{"path": path, "old_str": "static body", "new_str": "injected"}) require.NotNil(t, resp["error"]) + // The swap happened and the rollback refused it: the error says so, + // and the note path is still the planted symlink. + assert.Contains(t, resp["error"].(map[string]any)["message"], "could NOT be rolled back") + fi, err := os.Lstat(note) + require.NoError(t, err) + assert.NotZero(t, fi.Mode()&os.ModeSymlink, "the note path is still the swapped-in symlink") got, _ := os.ReadFile(victim) assert.Equal(t, "untouched", string(got), "the rollback wrote through the swapped-in symlink") })