Skip to content

docs(spec): restructure v6 draft with LifecycleHook, Evaluator, and Daemon=CPU#726

Merged
kys0213 merged 2 commits intomainfrom
spec/lifecycle-hook
Apr 6, 2026
Merged

docs(spec): restructure v6 draft with LifecycleHook, Evaluator, and Daemon=CPU#726
kys0213 merged 2 commits intomainfrom
spec/lifecycle-hook

Conversation

@kys0213
Copy link
Copy Markdown
Owner

@kys0213 kys0213 commented Apr 5, 2026

Summary

v6 spec draft 리뷰에서 도출된 구조적 설계 변경을 반영합니다.

신규 concern 문서

  • lifecycle-hook.mdLifecycleHook trait 정의. handler(작업)와 hook(반응) 분리. DataSource별 impl, workspace별 바인딩, lazy 로딩
  • evaluator.md — Progressive Evaluation Pipeline (EvaluationStage trait). Evaluate before Execute. Mechanical → Semantic → Consensus 단계적 판정

주요 설계 변경

  • Daemon = CPU: Orchestrator → CPU 리네이밍. hook 트리거만, 실행 책임은 Hook impl
  • tick 순서 변경: evaluate → advance → execute → cron
  • PatternDetector trait: ExecutionHistory 중간 구조체 제거, 각 detector가 DB 직접 조회
  • Stagnation v6/Phase 2 경계: SPINNING + OSCILLATION (v6), NO_DRIFT + DIMINISHING (Phase 2)
  • 제거: escalation 가속 개념, classify-policy.yaml, batch_size

변경된 파일 (11 modified + 2 new)

  • DESIGN-v6.md — 설계 철학, 상태 흐름, 내부 구조, OCP 확장점
  • daemon.md — CPU 리네이밍, 실행 루프, handle_failure 의사코드
  • datasource.md — 역할 재정의, hook 분리, 가속 문구 제거
  • stagnation.md — PatternDetector trait, DB 직접 조회
  • agent-workspace.md — classify-policy.yaml 제거, Evaluator 연동
  • cron-engine.md — evaluate를 Daemon tick으로 이동
  • data-model.md — event_type 통합, hook 반영
  • queue-state-machine.md, flows/03, flows/04, README.md — 일관성 정리

Test plan

  • 스펙 문서 간 교차 참조 일관성 확인
  • 기존 concerns 문서에서 stale 참조 없는지 확인
  • 신규 concern 문서의 수용 기준 검토

🤖 Generated with Claude Code

kys0213 and others added 2 commits April 5, 2026 17:59
…aemon=CPU

Major design changes to spec/draft based on review:

- LifecycleHook trait: separate handler (work) from hook (reaction).
  Daemon triggers hooks on state transitions, Hook impl owns execution.
  Per-workspace binding, lazy loading for memory optimization.

- Evaluator Pipeline: progressive evaluation (Mechanical → Semantic →
  Consensus). Evaluate before Execute in daemon tick. History-aware
  pre-check skips unnecessary handler execution.

- Daemon = CPU: rename from Orchestrator. Daemon only triggers hooks,
  doesn't know what they do. Tick order: evaluate → advance → execute → cron.

- PatternDetector trait: each detector queries DB directly instead of
  ExecutionHistory intermediate struct. v6 scope: Spinning + Oscillation.
  Phase 2: Drift + Diminishing (trait boundary defined, no impl).

- Remove stale concepts: escalation acceleration, classify-policy.yaml,
  batch_size. Escalation and stagnation are orthogonal concerns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, L2/L3 boundary

Resolves High 6, Medium 8-10 from spec review:

- High 6: Add QueuePhase ↔ history.status mapping table to data-model.md

- Medium 8 (L2/L3 boundary): Remove algorithm details from flow docs
  (CompositeSimilarity, ExecutionHistory, SQL DDL). Keep user-facing
  descriptions, delegate internals to concern docs.

- Medium 9 (HITL UX): Replace fixed 4-choice enum with LLM-driven
  contextual questions. LLM analyzes situation (lateral report, history,
  HITL trigger) and generates recommended actions. User responds in
  natural language, LLM translates to system action.

- Medium 10 (Error scenarios):
  - flow-01: CLI immediate validation with specific error messages
  - flow-02: New Analyzing state — LLM analyzes spec quality before
    Active transition. Configurable via ~/.belt/config.yaml
  - flow-03: Circuit breaker for infra errors (GitHub API, worktree).
    Distinct from stagnation (handler logic failure). Source-level
    isolation with backoff retry and dashboard visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kys0213 kys0213 merged commit 460e7bf into main Apr 6, 2026
4 checks passed
@kys0213 kys0213 deleted the spec/lifecycle-hook branch April 6, 2026 23:36
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