Skip to content

fix(dashboard): fs.watch cache invalidation + agent status inference improvements#1

Merged
epicsagas merged 7 commits into
mainfrom
fix/dashboard-agent-status
Jun 8, 2026
Merged

fix(dashboard): fs.watch cache invalidation + agent status inference improvements#1
epicsagas merged 7 commits into
mainfrom
fix/dashboard-agent-status

Conversation

@epicsagas

Copy link
Copy Markdown
Owner

변경 내용

1. 대시보드 서버 캐시 무효화 (dashboard/server.mjs)

  • buildStatus() 결과를 인메모리 캐시에 저장하여 매 HTTP 요청마다 디스크를 읽지 않도록 최적화
  • 각 프로젝트의 .velith/status.jsonfs.watch를 설정하여 파일 변경 시 캐시 자동 무효화
  • scan-project.js 실행 후 서버 재시작 없이도 대시보드에 즉시 반영됨

2. 에이전트 상태 추론 로직 개선 (skills/book-status/scripts/scan-project.js)

에이전트 기존 개선
marketing-expert artifacts 없음 → 항상 idle publish/marketing-plan.md artifact 추가 → 파일 존재 시 complete
style-doctor editStage === proofreadcomplete line-edit 이상이면 complete
continuity-editor editStage === developmentalcomplete developmental 이상이면 complete
scene-generator non-fiction도 idle 표시 non-fiction 장르에서 disabled 표시

3. Fiction 전용 에이전트 구분

  • scene-generator를 fiction-only로 분류
  • fiction, romance, thriller, mystery, fantasy, sci-fi, literary-fiction 외 장르에서 disabled 상태로 표시

테스트

  • technical 장르 프로젝트에서 marketing-expert, style-doctor, continuity-editor가 complete로 표시되는지 확인
  • non-fiction에서 scene-generator가 disabled로 표시되는지 확인
  • 대시보드 서버 재시작 없이 status.json 변경 후 UI에 즉시 반영되는지 확인

epicsagas added 7 commits June 8, 2026 17:32
…s inference

- server.mjs: cache buildStatus() result in memory, invalidate via
  fs.watch on each project's .velith/status.json so dashboard reflects
  scan-project.js updates without server restart
- scan-project.js: add publish/marketing-plan.md as marketing-expert
  artifact so it reports 'complete' when marketing plan exists
- scan-project.js: relax style-doctor/continuity-editor status checks
  to recognize any edit stage >= line-edit as complete
- scan-project.js: mark fiction-only agents (scene-generator) as
  'disabled' for non-fiction genres instead of 'idle'
- server.mjs: attach agents array to each project record so frontend
  shows project-specific agent statuses
- server.mjs: global agents fallback now merges by picking the most-
  progressed status (complete > running > disabled > idle) across
  projects instead of last-project-wins
- App.svelte: derive agents from selected project's agents first,
  falling back to global agents list
- rebuild dist bundle with updated App.svelte
Genre-based disabled inference was overreach — scene-generator is
useful beyond strict fiction (game scenarios, screenplay, etc).
Let it report idle naturally instead of forcing disabled.
filter(Boolean) excludes 0 (falsy), causing ch00.md to be missing
from draftedNums and generating a spurious wait entry for Chapter 0.
…ion genre sync

- Add status.disabled key to all 10 locale files (en/ko/ja/zh/de/es/fr/it/pt/ru)
- Add disabled agent count tile and badge styling in StatusView.svelte
- Clean up stale fs.watch entries when projects removed from registry
- Export FICTION_GENRES constant in data.js, aligned with scan-project.js
- Align scene-generator role text in SAMPLE_DATA and examples/status.json
- server.mjs: spread cachedStatus instead of mutating generated_at directly
- scan-project.js: add FICTION_GENRES + EDIT_STAGE_ORDER constants;
  scene-generator now sets 'disabled' for non-fiction genres;
  style-doctor/continuity-editor use editStageGte() helper instead of
  hardcoded OR chains
- StatusView.svelte: dynamic grid columns (3 or 4) based on disabledCount
  so layout stays correct when disabled card is absent
- data.js: fix sync comment to match actual constant name FICTION_GENRES
@epicsagas epicsagas merged commit c7b02e6 into main Jun 8, 2026
@epicsagas epicsagas deleted the fix/dashboard-agent-status branch June 8, 2026 09:40
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