Skip to content

refactor(web): Supervisor 스크립트를 1500 code LOC 아래로 분할 (AGT-4868) - #906

Open
unohee wants to merge 1 commit into
mainfrom
heewonoh/agt-4868-dashboard-split
Open

unohee wants to merge 1 commit into
mainfrom
heewonoh/agt-4868-dashboard-split

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

무엇

  • src/support/dashboardHtml.ts는 refactor(web): serve the Supervisor as a static page instead of a server-rendered string #830(2026-10-19)에서 이미 삭제됐고 내용이 web/static/js/supervisor.js로 옮겨졌다. 그 후계 파일이 약 1720 code LOC로 여전히 상한(book.md Art. III, 1500)을 넘어서 이 파일을 분할했다.
  • 보조 패널(repo picker, scan paths, folder browser, monitors, processes, coordination) 393줄을 그대로 web/static/js/supervisorPanels.js로 옮김. 같은 전역 스코프의 classic script로 supervisor.js보다 먼저 로드한다(supervisor.js 끝의 init 코드가 fetchMonitors 등을 동기 호출하기 때문).
  • 결과: supervisor.js 1597줄(code LOC 1500 미만), supervisorPanels.js 406줄.

왜

AGT-4513 하위 작업. 상한 초과 파일을 줄여 loc-gate(AGT-4865) 도입 시 allowlist에 남을 파일을 없앤다.

검증

  • 바이트 동일: 분할 직후 supervisor.js[1..1229] + supervisorPanels.js 본문 + supervisor.js 나머지를 원본과 diff → 동일(헤더 주석만 추가).
  • tests/web/supervisorActions.test.ts가 두 스크립트를 로드 순서대로 인라인해 jsdom에서 실제 페이지를 돌린다. 로드 순서를 뒤집으면 ReferenceError: fetchMonitors is not defined로 3건 실패하는 것을 확인.
  • 신규 tests/web/supervisorSize.test.ts: 두 파일 모두 1500 code LOC 미만, panels 파일은 최상위에 선언만 있음.
  • vitest run src/support/web tests/web src/support/staticAssets 46 files / 570 passed. typecheck rc=0. oxlint 경고 12건은 main과 동일(신규 0).

…p (AGT-4868)

dashboardHtml.ts itself was removed in #830, but its successor
web/static/js/supervisor.js carried ~1720 code LOC. The secondary panels
(repo picker, scan paths, folder browser, monitors, processes, coordination)
move verbatim to supervisorPanels.js, loaded before supervisor.js in the same
global scope. Concatenating the two reproduces the original byte for byte.
The jsdom page tests now inline both scripts in load order and fail with a
ReferenceError when the order is reversed; a size test pins both files under
the cap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant