Files
company-haness/org-os/00-role-registry/state-transition-rules.yaml
T

200 lines
19 KiB
YAML

state-transition-rules:
version: 1
runtime-source-of-truth: org-os/06-agent-work/workflow-contracts.yaml
note: 이 파일의 workflow-stage-transitions는 문서/하위호환 mirror이며 state_engine은 contract를 직접 읽는다.
transitions:
- from: Draft
to: Review
allowed-by: [owner-role-agent]
required-conditions:
- ai-report-meta-present
- input-documents-present
- handoff-or-closure-reason-present
- from: Review
to: Approved
allowed-by: [decider-role-agent]
required-conditions:
- quality_gate_status: Passed
- evidence_grade_min_at_least: E3
- blocker_open: false
forbidden-if:
- confidence: Low
- human-review-needed: true
- from: Submitted-for-Review
to: Accepted
allowed-by: [parent-role-agent]
required-conditions:
- acceptance-decision-present
- quality_gate_status: Passed
- handoff_to_not_empty_or_closure_reason_present
- from: Submitted-for-Review
to: Changes-Requested
allowed-by: [parent-role-agent, auditor-role-agent]
required-conditions:
- required-changes-present
- from: Review
to: Blocked
allowed-by: [owner-role-agent, parent-role-agent, auditor-role-agent]
required-conditions:
- blocked-report-present
- resume-condition-present
- from: Approved
to: Closed
allowed-by: [decider-role-agent, OPS-ORCH]
required-conditions:
- release_acceptance_status: Approved
- unresolved_critical_risks: false
- from: Blocked
to: Review
allowed-by: [OPS-ORCH, parent-role-agent]
required-conditions:
- resume-condition-satisfied
- human-instruction-applied-if-needed
state-vocabulary-map:
source-of-truth: workflow-stage
# 통합 어휘(#7+#13): wave/cascade 이중 어휘를 하나의 stage 그래프로 대체한다.
workflow-stage: [intake, discovery, decide, design, spec, build, verification, acceptance, released, blocked, closed]
document-state: [Draft, Review, Approved, Closed]
review-state: [Submitted-for-Review, Accepted, Changes-Requested, Blocked]
back-compat-stage-map:
# 구(舊) 어휘 -> 통합 어휘(하위호환: 기존 원장/문서가 옛 이름을 써도 매핑된다).
review: acceptance # 구 review(부모 수용) = acceptance stage
implementation: build # 구 implementation = build
release: released # 구 release = released
# discovery/decide/spec 는 신규(GROUND/converge/DETAIL 분리). design/verification/blocked/closed 는 그대로.
wave-internal-stages: [plan, run] # wave-execution 전용(Magentic 루프). cascade 내용 stage 와 구분.
mapping:
- workflow-stage가 워크플로우의 단일 원천이다.
- 각 stage 내부에서 개별 산출물은 document-state를, 부모-자식 수용 1건은 review-state를 가진다.
- hook은 document-state와 review-state를 전이시킨다.
- 해당 stage의 게이팅 문서가 Approved 또는 Accepted에 도달하면 workflow-stage가 전진한다.
- workflow-stage 사이의 전이·선행조건은 아래 workflow-stage-transitions 가 SSOT이며 state_engine.py 가 강제한다.
tier-modifiers:
source-of-truth: org-os/06-agent-work/governance-tiers.yaml
light: { evidence-grade-min: E2, auditor-required: only-when-security-legal-privacy, human: not-required }
standard: { evidence-grade-min: E3, auditor-required: true, human: informed-non-blocking }
heavy: { evidence-grade-min: E3, auditor-required: parallel-fanout, human: gate-per-governance-tiers }
note: 실제 값의 단일 원천은 governance-tiers.yaml이며 여기는 상태전이 관점의 참조다. HEAVY는 기존 Approved 조건과 동일.
# ── 통합 워크플로 stage 전이(#7 + #13, E1) ─────────────────────────────
# 하나의 stage 그래프로 wave/cascade 를 통합한다. state_engine.py 가 이 규칙을 로드·강제한다.
# 각 전이 조건은 워크플로 원장(<state_dir>/<wf>/workflow.yaml)의 사실 + acceptance_log(수락 이벤트)
# + collaboration-map(design-to-build-contract 의 must-read-designs) 에서 파생·평가된다.
# tier-modifiers(evidence-grade-min, human-gate)의 단일 원천은 governance-tiers.yaml.
workflow-stage-transitions:
unified-stage-graph: [intake, discovery, decide, design, spec, build, verification, acceptance, released, closed]
# venture-bootstrap: founder-setup, opportunity-discovery, venture-validation, venture-decision, company-context-commit, bootstrap-complete
# experience-foundation: experience-foundation-intake, experience-benchmark, experience-strategy, information-architecture, wireframes, foundation-approved
# design-direction: design-direction-intake, design-direction-discovery, design-direction-divergence, design-direction-decision, design-direction-prototype, design-direction-critique, design-direction-finalize, design-direction-approved
side-state: blocked # 어느 stage 에서든 진입 가능. resume 시 원장 blocked-from 으로 복귀.
condition-catalog:
# 조건 = state_engine 이 원장 사실로 평가하는 술어(predicate). '어디서 파생되나' 명시.
decision-brief-present: "intake 산출물(decision-brief) 존재 — ledger.facts/artifacts"
workload-profile-present: "intake 산출물(workload-profile) 존재 — UI/API/persistence/risk 판정의 단일 정본"
grounding-evidence-present: "discovery 근거(시장/사용자/경쟁/재무) 접지 산출물 존재"
option-set-present: "option-set(선택지) ≥ 2 — ledger.option-set 길이(결정이 아니라 발산)"
grounding-lens-coverage-satisfied: "tier 렌즈 최소치와 contrarian, source report/context package exact 결속, 필요 시 GTM-CI 경쟁시장 근거를 모두 충족"
decision-packet-accepted: "ExecutiveDecisionPacket review-state=Accepted — ledger.artifacts 또는 acceptance_log accepted 이벤트"
evidence-grade-min: "tier 최소 증거등급 충족 — governance-tiers.yaml 대비 ledger.evidence-grade"
design-accepted: "설계 산출물 review-state=Accepted"
spec-accepted: "기능명세(PRD/api-contract/수용기준) review-state=Accepted"
must-read-designs-accepted: "collaboration-map design-to-build-contract 의 must-read-designs 전부 Accepted (핵심 게이트)"
completion-record-present: "build family completion-record 산출물 존재"
quality-gate-passed: "quality_gate_status=Passed"
blocker-open-false: "열린 blocker 없음 — ledger.blocker-open=false & blockers 비어있음"
release-approved: "release_acceptance_status=Approved"
no-unresolved-critical-risks: "unresolved_critical_risks=false"
human-gate: "tier=heavy 면 사람 승인(human_gate_approved) 필요; light/standard 는 non-blocking 통과"
wave-plan-present: "wave plan(계획) 산출물 존재(plan-wave)"
progress-being-made: "Magentic run 루프: is_progress_being_made & governance-limits(max-rounds/stalls) 미초과"
blocked-report-present: "BlockedReport(report-type=blocked) 존재"
resume-condition-present: "재개 조건이 명시됨"
resume-condition-satisfied: "재개 조건이 충족됨"
human-instruction-applied-if-needed: "사람 지시가 필요하면 적용됨(불필요하면 자동 통과)"
founder-context-present: "org-os/01-company/founder-context.yaml status=filled"
opportunity-clusters-present: "opportunity-cluster 산출 ≥ 2(ledger.artifacts design-type=opportunity-cluster 또는 ledger.opportunity-clusters 길이)"
venture-options-validated: "venture-validation accepted 산출물 존재(각 옵션 required 필드+kill-criteria)"
venture-decision-accepted: "venture-decision accepted 산출물 존재(acceptance_log accepted)"
human-acceptance-receipt-present: "HUMAN-001 accepted 이벤트가 그 venture-decision report-id/report-sha256/workflow-id 에 바인딩"
company-context-provisional-committed: "공식 company-context.yaml status ∈ {provisional, operating}(commit_company_context 원자 교체)"
company-context-lint-passed: "lint_company_context 공식 파일 Hard Fail 0(live 평가)"
company-context-artifact-recorded: "ledger artifacts 에 design-type=company-context 등록(commit receipt)"
parent-binding-present: "child 원장 parent-workflow-id+product-decision-id+direction-input-brief-ref 존재(실존 부모·accepted product-decision 대조)"
experience-parent-binding-present: "experience-foundation child가 실존 부모+accepted product decision에 정확히 바인딩"
competitive-benchmark-accepted: "현재 competitive-experience-benchmark exact revision Accepted"
experience-strategy-accepted: "현재 experience-strategy exact revision Accepted"
experience-technical-feasibility-accepted: "현재 CPO strategy에 exact-bound EXEC-CTO|EXEC-CPTO technical feasibility verdict=feasible revision Accepted"
experience-operational-feasibility-accepted: "현재 CPO strategy에 exact-bound EXEC-COO operational feasibility verdict=feasible revision Accepted"
experience-blueprint-accepted: "현재 experience-blueprint exact revision Accepted"
wireframe-set-accepted: "현재 wireframe-set exact revision Accepted"
experience-foundation-link-recorded: "부모 원장에 child+4개 exact revision 링크가 등록됨"
experience-foundation-gate-satisfied: "공개 웹/신규 제품/대규모 리디자인이면 foundation-approved child 링크 필수; 나머지는 자동 통과"
design-system-release-attached: "해당 UI면 ui-design에 candidate|stable 조직 release exact ref/SHA+component subset+delta 결속"
none-of-the-above-recorded: "HUMAN-001이 3안 모두 거절한 selected-direction exact revision을 Accepted — 평균 없이 discovery로 복귀"
direction-input-brief-valid: "direction-input-brief lint Hard Fail 0(필수9+금지6)"
direction-discovery-present: "direction-discovery 아티팩트 존재(불변 brief 분석)"
divergence-charter-present: "active cycle divergence-charter: 3개 방향의 질문·조형축·exclusive/forbidden primitive 직교 분할"
directions-diverged: "active cycle direction-set: >=3안·producer-run/pkg 상이·동일 대표화면·각 coded-slice/보드/full-size-preview 실존+hash·comparison-preview receipt"
divergence-audit-passed: "선택 전 comparative-divergence-audit pass: 모든 쌍 4축 이상 차이·primitive collision/blocker 없음·full-size preview 검증"
selected-direction-accepted: "active cycle selected-direction bundle lint 통과 + selection acceptance 이벤트"
winner-prototype-present: "active cycle winner-prototype 존재 + preview receipt"
critique-revision-requested: "active cycle design-review-panel synthesis.verdict=minor-revision"
concept-rejection-recorded: "active cycle design-review-panel synthesis.verdict=concept-flaw"
direction-critique-passed: "7-lens 패널 pass(visual-craft 포함·개별 verdict 전부 pass·blocking finding/dissent 없음·producer≠reviewer) + winner preview receipt"
approved-direction-valid: "approved-direction 불변 report 생성·schema/lint 통과·전 참조 hash 일치"
approval-receipt-bound: "approved-direction acceptance 이벤트가 child workflow+report-id+report-sha256 에 정확 바인딩"
parent-approval-link-recorded: "부모 원장 design-direction-approval(report-ref/sha256/child-workflow-id) 기록됨(register CLI)"
design-direction-gate-satisfied: "non-UI 이거나 tier=light 면 자동 통과; UI-bearing standard/heavy 는 design_direction_approved(부모 관점 _has_direction_approval) 필요 — /design-system 등 우회 차단"
transitions:
# ── cascade 본선: 결정 → 설계 → 세부 → 구현 → 검증 → 수용 → 릴리스 ──
- { from: intake, to: discovery, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [decision-approver] }, required-conditions: [decision-brief-present, workload-profile-present, company-context-ready] }
- { from: discovery, to: decide, allowed-by: { executor: [OPS-ORCH] }, required-conditions: [grounding-evidence-present, option-set-present, grounding-lens-coverage-satisfied] }
- { from: decide, to: design, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [decision-approver] }, required-conditions: [decision-packet-accepted, evidence-grade-min] }
- { from: design, to: spec, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [design-approver] }, required-conditions: [design-accepted, experience-foundation-gate-satisfied, design-system-release-attached, design-direction-gate-satisfied] }
# 핵심 게이트: 설계 미승인 시 구현 시작 금지(collaboration-map must-read-designs 참조).
- { from: spec, to: build, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [spec-approver] }, required-conditions: [spec-accepted, must-read-designs-accepted] }
- { from: build, to: verification, allowed-by: { executor: [OPS-ORCH] }, required-conditions: [completion-record-present] }
- { from: verification, to: acceptance, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [quality-auditor] }, required-conditions: [quality-gate-passed, blocker-open-false] }
- { from: acceptance, to: released, allowed-by: { executor: [OPS-ORCH], decision-author-capability: [release-decider] }, required-conditions: [release-approved, no-unresolved-critical-risks, human-gate] }
- { from: released, to: closed, allowed-by: [OPS-ORCH], required-conditions: [] }
# ── wave plan(Magentic 루프): intake → plan → run(반복) → verification ──
- { from: intake, to: plan, allowed-by: [OPS-ORCH], required-conditions: [decision-brief-present, workload-profile-present, company-context-ready] }
- { from: plan, to: run, allowed-by: [OPS-ORCH], required-conditions: [wave-plan-present] }
- { from: run, to: run, allowed-by: [OPS-ORCH], required-conditions: [progress-being-made] } # 라운드 반복(정체/상한 시 차단→escalate)
- { from: run, to: verification, allowed-by: [OPS-ORCH], required-conditions: [completion-record-present] }
# ── light: intake → run(계획 생략, 저위험) ──
- { from: intake, to: run, allowed-by: [OPS-ORCH], required-conditions: [decision-brief-present, workload-profile-present, company-context-ready] }
# ── blocked side-state: 어느 stage 에서든 진입, blocked-from 으로 재개 ──
- { from: "*", to: blocked, allowed-by: [owner-role-agent, parent-role-agent, auditor-role-agent, OPS-ORCH], required-conditions: [blocked-report-present, resume-condition-present] }
- { from: blocked, to: "<resume>", allowed-by: [OPS-ORCH, parent-role-agent], required-conditions: [resume-condition-satisfied, human-instruction-applied-if-needed] }
# ── venture-bootstrap(회사 수립, 별도 lifecycle) — 전이 집행은 OPS-ORCH 단독 ──
- { from: intake, to: founder-setup, allowed-by: [OPS-ORCH], required-conditions: [decision-brief-present] }
- { from: founder-setup, to: opportunity-discovery, allowed-by: [OPS-ORCH], required-conditions: [founder-context-present] }
- { from: opportunity-discovery, to: venture-validation, allowed-by: [OPS-ORCH], required-conditions: [opportunity-clusters-present] }
- { from: venture-validation, to: venture-decision, allowed-by: [OPS-ORCH], required-conditions: [venture-options-validated] }
- { from: venture-decision, to: company-context-commit, allowed-by: [OPS-ORCH], required-conditions: [venture-decision-accepted, human-acceptance-receipt-present] }
- { from: company-context-commit, to: bootstrap-complete, allowed-by: [OPS-ORCH], required-conditions: [company-context-provisional-committed, company-context-lint-passed, company-context-artifact-recorded] }
# ── experience-foundation(제품 cascade 종속 child) ──
- { from: experience-foundation-intake, to: experience-benchmark, allowed-by: [OPS-ORCH], required-conditions: [experience-parent-binding-present] }
- { from: experience-benchmark, to: experience-strategy, allowed-by: [OPS-ORCH], required-conditions: [competitive-benchmark-accepted] }
- { from: experience-strategy, to: information-architecture, allowed-by: [OPS-ORCH], required-conditions: [experience-strategy-accepted, experience-technical-feasibility-accepted, experience-operational-feasibility-accepted] }
- { from: information-architecture, to: wireframes, allowed-by: [OPS-ORCH], required-conditions: [experience-blueprint-accepted] }
- { from: wireframes, to: foundation-approved, allowed-by: [OPS-ORCH], required-conditions: [wireframe-set-accepted, experience-foundation-link-recorded] }
# ── design-direction(제품 cascade 종속 child) — 전이 OPS-ORCH 단독 ──
- { from: design-direction-intake, to: design-direction-discovery, allowed-by: [OPS-ORCH], required-conditions: [parent-binding-present, direction-input-brief-valid, experience-foundation-gate-satisfied] }
- { from: design-direction-discovery, to: design-direction-divergence, allowed-by: [OPS-ORCH], required-conditions: [direction-discovery-present, divergence-charter-present] }
- { from: design-direction-divergence, to: design-direction-decision, allowed-by: [OPS-ORCH], required-conditions: [directions-diverged, divergence-audit-passed] }
- { from: design-direction-decision, to: design-direction-prototype, allowed-by: [OPS-ORCH], required-conditions: [selected-direction-accepted] }
- { from: design-direction-decision, to: design-direction-discovery, allowed-by: [OPS-ORCH], required-conditions: [none-of-the-above-recorded] }
- { from: design-direction-prototype, to: design-direction-critique, allowed-by: [OPS-ORCH], required-conditions: [winner-prototype-present] }
- { from: design-direction-critique, to: design-direction-prototype, allowed-by: [OPS-ORCH], required-conditions: [critique-revision-requested] }
- { from: design-direction-critique, to: design-direction-divergence, allowed-by: [OPS-ORCH], required-conditions: [concept-rejection-recorded] }
- { from: design-direction-critique, to: design-direction-finalize, allowed-by: [OPS-ORCH], required-conditions: [direction-critique-passed] }
- { from: design-direction-finalize, to: design-direction-approved, allowed-by: [OPS-ORCH], required-conditions: [approved-direction-valid, approval-receipt-bound, parent-approval-link-recorded] }
plan-note: >
plan/run 은 wave-execution 전용 내부 stage(Magentic 루프)이며 cascade 본선의 내용 stage
(discovery..released)와 구분된다. execution-plans.yaml 이 각 plan 의 stage 순서를 정의하고,
모든 인접 stage 쌍은 위 transitions 로 뒷받침된다. mid-start = 선행 stage 의 gating 산출물이
존재하면 그 stage 로 진입(state_engine 이 선행조건 검증). '*'->blocked 의 '*' 는 임의 stage,
blocked->'<resume>' 의 '<resume>' 는 원장 blocked-from 이 가리키는 stage 로 해석된다.