feat(v3r2): Wave 1+2 Bundle — Constitution + Runtime Foundation#739
feat(v3r2): Wave 1+2 Bundle — Constitution + Runtime Foundation#739
Conversation
Wave 1 — Constitution Foundation (CON-002, CON-003, SPC-001): - CON-002: 5-layer amendment safety gate (frozen guard, canary check, contradiction detector, rate limiter, human oversight) - CON-003: Rule tree consolidation (merge 4 deleted files, relocate content, frontmatter migration) - SPC-001: EARS hierarchical acceptance criteria parser with spec linter subcommand Wave 2 — Runtime Core (RT-005, RT-001, RT-004): - RT-005: Multi-layer settings resolution with provenance tags (8-source priority stack: policy > user > project > local > plugin > skill > session > builtin) - RT-001: Hook JSON-OR-ExitCode dual protocol (HookResponse schema, structured output for all 27 hook events) - RT-004: Typed session state with phase checkpoints and resumable permission context Supporting changes: - Template mirrors for all rules/skills changes - LSP client decision document - Master wave plan document - CLI subcommands: constitution, spec lint/view, state, doctor config 🤖 MoAI <email@mo.ai.kr>
|
@claude CI 빌드가 실패했습니다. 오류를 분석하고 수정해주세요. 실패한 워크플로우: Release Drafter 실패 로그를 확인하고 근본 원인을 파악한 뒤 수정해주세요. Latte AI CI Monitor • latte@mo.ai.kr |
|
@claude CI 빌드가 실패했습니다. 오류를 분석하고 수정해주세요. 실패한 워크플로우: Claude Code Review 실패 로그를 확인하고 근본 원인을 파악한 뒤 수정해주세요. Latte AI CI Monitor • latte@mo.ai.kr |
|
Caution Review failedFailed to post review comments WalkthroughThis PR introduces comprehensive infrastructure for constitutional amendments, configuration resolution tiers, session state persistence, EARS-based acceptance criteria parsing, updated hook response typing, and new CLI commands (spec view, state management, doctor config, constitution amend). It also refactors documentation by consolidating development methodology details into spec-workflow.md and consolidating team protocol into worktree-integration.md. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as moai<br/>constitution amend
participant FrozenGuard
participant Canary as Canary<br/>Evaluator
participant ContradictionDetector
participant RateLimiter
participant HumanOversight
participant EvolutionLog
participant RuleFile
User->>CLI: moai constitution amend --rule ... --before ... --after ...
CLI->>CLI: Load zone registry & validate inputs
CLI->>FrozenGuard: Check(proposal)
FrozenGuard-->>CLI: allowed or ErrFrozenAmendment
CLI->>Canary: Evaluate(proposal, projectDir)
Canary->>Canary: Scan completed SPECs, compute score impact
Canary-->>CLI: CanaryResult or ErrCanaryUnavailable
CLI->>ContradictionDetector: Scan(proposal, registry)
ContradictionDetector->>ContradictionDetector: Check zone & clause conflicts
ContradictionDetector-->>CLI: conflicts or empty result
CLI->>RateLimiter: Admit(proposal, evolutionLogPath)
RateLimiter->>EvolutionLog: Load prior amendments
EvolutionLog-->>RateLimiter: amendment history
RateLimiter->>RateLimiter: Check rollback cooldown, weekly cap, 24h cooldown
RateLimiter-->>CLI: allowed or ErrRateLimitExceeded
CLI->>HumanOversight: Approve(proposal)
HumanOversight->>User: Display proposal + metrics, prompt Y/N
User-->>HumanOversight: Y/N response
HumanOversight-->>CLI: approval boolean
alt not dry-run
CLI->>RuleFile: Update rule clause
CLI->>CLI: Update zone registry
CLI->>EvolutionLog: Append AmendmentLog
end
CLI-->>User: Success with log ID or dry-run diagnostics
sequenceDiagram
participant CLI as moai spec view
participant Filesystem
participant Parser as EARS Parser
participant Validator
CLI->>Filesystem: Read /.moai/specs/{SPEC-ID}/spec.md
alt spec.md missing
CLI-->>CLI: Error & exit
end
CLI->>Parser: ParseAcceptanceCriteria(markdown)
Parser->>Parser: Locate AC section, extract lines by depth
Parser->>Parser: Build hierarchical tree, inherit Given
Parser->>Validator: ValidateDepth() per node
Parser->>Validator: ValidateRequirementMappings()
Validator-->>Parser: errors (DuplicateID, MaxDepthExceeded, Missing mappings)
alt parse errors present
CLI->>CLI: Print warnings (DanglingRef, MissingMapping)
alt hard errors
CLI-->>CLI: Error & exit
end
end
CLI->>CLI: Render tree hierarchically (with --shape-trace metadata)
CLI-->>Filesystem: Print formatted AC tree
Estimated code review effort🎯 5 (Critical) | ⏱️ ~105 minutes Reasoning: This PR spans 5+ heterogeneous subsystems (config resolution, constitution amendments, session state, spec parsing, hook typing, CLI) with ~5000+ lines of new logic and tests. Each domain requires independent reasoning: config merging/provenance logic, multi-gate amendment pipeline with canary scoring and contradiction scanning, polymorphic JSON marshaling for checkpoint types, complex EARS parser with hierarchical tree building and validation, dual-parse hook protocol, and multiple CLI integrations. The test coverage is comprehensive but dense logic (especially parser, pipeline, and resolver) demands careful validation of edge cases, error handling, and correctness. Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@claude CI 빌드가 실패했습니다. 오류를 분석하고 수정해주세요. 실패한 워크플로우: CI 실패 로그를 확인하고 근본 원인을 파악한 뒤 수정해주세요. Latte AI CI Monitor • latte@mo.ai.kr |
Summary
SPEC Coverage
moai spec lintsubcommandTest plan
go build ./...— clean buildgo vet ./...— no warningsgo test ./internal/constitution/... ./internal/spec/... ./internal/config/... ./internal/hook/... ./internal/session/... ./internal/cli/...— all passNext Steps (Wave 3)
🤖 MoAI email@mo.ai.kr
Summary by CodeRabbit
New Features
moai constitution amendCLI command to propose rule amendments with dry-run support and multi-layer safety gates.moai doctor configcommands to inspect, dump, and compare configuration values across tiers.moai statecommands to view workflow phase checkpoints and blocker reports.moai spec viewcommand to display spec acceptance criteria in hierarchical format.Documentation