Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(gfs): cl-l1 remove unused declarations flagged in review
M52e0d121afec
diff --git a/control-ui/components/__tests__/GfsBrowser.test.tsx b/control-ui/components/__tests__/GfsBrowser.test.tsxindex 102d6442e..e3de82ffa 100644--- a/control-ui/components/__tests__/GfsBrowser.test.tsx+++ b/control-ui/components/__tests__/GfsBrowser.test.tsx@@ -3847,7 +3847,10 @@ describe('GfsBrowser — folder drag-and-drop', () => {const archive = child('archive', 'directory', 1)const projects = child('projects', 'directory', 2)mockApiGet.mockImplementation(async (path: string) => {- if (path === '/api/v1/gfs/tree' || path === '/api/v1/gfs/resources/11111111-1111-1111-1111-111111111111/children') {+ if (+ path === '/api/v1/gfs/tree' ||+ path === '/api/v1/gfs/resources/11111111-1111-1111-1111-111111111111/children'+ ) {return {rootResourceId: '11111111-1111-1111-1111-111111111111',items: [archive, projects],@@ -3876,13 +3879,11 @@ describe('GfsBrowser — folder drag-and-drop', () => {}it('stops a folder drop at the one confirmation and commits on Move', async () => {- const { archive, projects } = folderPage()+ const { projects } = folderPage()mockApiSend.mockResolvedValueOnce({ ok: true, data: { resourceId: 'id-2', version: 1 } })renderBrowser()- await waitFor(() =>- expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull()- )+ await waitFor(() => expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull())const projectsRow = within(screen.getByRole('list', { name: 'Current folder resources' })).getByText('projects').closest('li')!@@ -3896,7 +3897,9 @@ describe('GfsBrowser — folder drag-and-drop', () => {name: 'Move folder projects to archive',})expect(- within(dialog).getByText(/Inherited access to this folder and its contents follows the new location/)+ within(dialog).getByText(+ /Inherited access to this folder and its contents follows the new location/+ )).toBeTruthy()// The structure guard passed on fresh canonical paths (both rows carry// paths; sibling folders are structurally safe) — no request yet.@@ -3922,9 +3925,7 @@ describe('GfsBrowser — folder drag-and-drop', () => {folderPage()renderBrowser()- await waitFor(() =>- expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull()- )+ await waitFor(() => expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull())const list = screen.getByRole('list', { name: 'Current folder resources' })const projectsRow = within(list).getByText('projects').closest('li')!const archiveRow = within(list).getByText('archive').closest('li')!@@ -3947,7 +3948,10 @@ describe('GfsBrowser — folder drag-and-drop', () => {const nestedArchive = child('archive', 'directory', 1)nestedArchive.path = '/projects/archive'mockApiGet.mockImplementation(async (path: string) => {- if (path === '/api/v1/gfs/tree' || path === '/api/v1/gfs/resources/11111111-1111-1111-1111-111111111111/children') {+ if (+ path === '/api/v1/gfs/tree' ||+ path === '/api/v1/gfs/resources/11111111-1111-1111-1111-111111111111/children'+ ) {return {rootResourceId: '11111111-1111-1111-1111-111111111111',items: [projects, nestedArchive],@@ -3958,9 +3962,7 @@ describe('GfsBrowser — folder drag-and-drop', () => {})renderBrowser()- await waitFor(() =>- expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull()- )+ await waitFor(() => expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull())const list = screen.getByRole('list', { name: 'Current folder resources' })const projectsRow = within(list).getByText('projects').closest('li')!const archiveRow = within(list).getByText('archive').closest('li')!@@ -3981,14 +3983,15 @@ describe('GfsBrowser — folder drag-and-drop', () => {const text = JSON.stringify({error: { code: 'already_exists', message: 'a resource with this name already exists' },})- return actualApi.formatApiError(new Response(text, { status: 409, statusText: 'Conflict' }), text)+ return actualApi.formatApiError(+ new Response(text, { status: 409, statusText: 'Conflict' }),+ text+ )}mockApiSend.mockRejectedValueOnce(conflict())renderBrowser()- await waitFor(() =>- expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull()- )+ await waitFor(() => expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull())const list = screen.getByRole('list', { name: 'Current folder resources' })const projectsRow = within(list).getByText('projects').closest('li')!const archiveRow = within(list).getByText('archive').closest('li')!@@ -4000,9 +4003,7 @@ describe('GfsBrowser — folder drag-and-drop', () => {// The numbered-name policy is an explicit opt-in (unchecked by default).fireEvent.click(within(dialog).getByRole('button', { name: 'Move', exact: true }))- expect(- await screen.findByText(/An item with this name already exists/)- ).toBeTruthy()+ expect(await screen.findByText(/An item with this name already exists/)).toBeTruthy()expect(mockApiSend).toHaveBeenCalledTimes(1)})@@ -4013,7 +4014,10 @@ describe('GfsBrowser — folder drag-and-drop', () => {const text = JSON.stringify({error: { code: 'already_exists', message: 'a resource with this name already exists' },})- return actualApi.formatApiError(new Response(text, { status: 409, statusText: 'Conflict' }), text)+ return actualApi.formatApiError(+ new Response(text, { status: 409, statusText: 'Conflict' }),+ text+ )}mockApiSend.mockRejectedValueOnce(conflict())@@ -4021,9 +4025,7 @@ describe('GfsBrowser — folder drag-and-drop', () => {.mockResolvedValueOnce({ ok: true, data: { resourceId: 'id-2', version: 1 } })renderBrowser()- await waitFor(() =>- expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull()- )+ await waitFor(() => expect(screen.queryByRole('status', { name: 'Loading files' })).toBeNull())const list = screen.getByRole('list', { name: 'Current folder resources' })const projectsRow = within(list).getByText('projects').closest('li')!const archiveRow = within(list).getByText('archive').closest('li')!diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex c8e6c55d0..609d6da58 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.736",+ "version": "0.1.737","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.736",+ "version": "0.1.737","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex e0dec5632..d8f82cb5b 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.736",+ "version": "0.1.737","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/ui/src/pages/FilesPage.tsx b/desktop-app/ui/src/pages/FilesPage.tsxindex ed7324f5b..981a3e168 100644--- a/desktop-app/ui/src/pages/FilesPage.tsx+++ b/desktop-app/ui/src/pages/FilesPage.tsx@@ -33,11 +33,7 @@ import {IconShare,IconUpload,} from '@components/SidebarNav/icons'-import {- FOLDER_HOVER_EXPAND_DELAY_MS,- GFS_DRIVE_MAIN,- GFS_RESOURCE_DRAG_TYPE,-} from '@constants/gfsBrowser'+import { GFS_DRIVE_MAIN, GFS_RESOURCE_DRAG_TYPE } from '@constants/gfsBrowser'import { desktopQueryKeys } from '@hooks/domain/queryKeys'import {GFS_UNAVAILABLE_LOCATION_MESSAGE,diff --git a/packages/gfs-interaction-policy/dragPolicy.cjs b/packages/gfs-interaction-policy/dragPolicy.cjsindex 256236857..57858bbfe 100644--- a/packages/gfs-interaction-policy/dragPolicy.cjs+++ b/packages/gfs-interaction-policy/dragPolicy.cjs@@ -14,12 +14,6 @@* grants start below the drive root.*/-/** Structural deny reasons (shared across both apps). */-const DRAG_STRUCTURE_DENY_REASONS = ['self', 'descendant', 'same-parent', 'root-source', 'cross-drive']--/** Sufficient negative observations — "not in the subtree, as far as current facts prove". */-const DRAG_STRUCTURE_EVIDENCES = ['file', 'common-anchor', 'known-chain', 'fresh-path']-/*** Maximum move PATCH attempts per user gesture (numbered-name conflicts),* within the existing absolute GFS_UPLOAD_NAME_RETRY_LIMIT name ceiling.@@ -57,7 +51,8 @@ function isNonEmptyString(value) {function decideDragStructure(input) {const source = input?.sourceconst target = input?.target- if (!source || !target) throw new TypeError('decideDragStructure requires source and target facts')+ if (!source || !target)+ throw new TypeError('decideDragStructure requires source and target facts')if (!isNonEmptyString(source.resourceId) || !isNonEmptyString(target.resourceId)) {throw new TypeError('decideDragStructure requires non-empty resource ids')}@@ -66,10 +61,7 @@ function decideDragStructure(input) {if (source.parentKnown === true && source.parentResourceId == null) {return { kind: 'deny', reason: 'root-source' }}- if (- source.parentKnown === true &&- source.parentResourceId === target.resourceId- ) {+ if (source.parentKnown === true && source.parentResourceId === target.resourceId) {return { kind: 'deny', reason: 'same-parent' }}if (source.kind === 'file') return { kind: 'observed-safe', evidence: 'file' }@@ -79,7 +71,8 @@ function decideDragStructure(input) {input.knownSourceAncestorIds instanceof Set ? input.knownSourceAncestorIds : new Set()for (const ancestorId of chain) {if (ancestorId === source.resourceId) return { kind: 'deny', reason: 'descendant' }- if (knownSourceAncestors.has(ancestorId)) return { kind: 'observed-safe', evidence: 'common-anchor' }+ if (knownSourceAncestors.has(ancestorId))+ return { kind: 'observed-safe', evidence: 'common-anchor' }}if (chain.length > 0 && chain[chain.length - 1] === null) {// The observation walked to the physical root without meeting the source: