rdev/internal/sdlc/history.go
jordan 425ef0f806 feat: add SDLC orchestration - library, CLI, and API integration
Implements deterministic feature lifecycle management for agent-driven
development. Agents use the CLI in pods; operators control via REST API.

Library (internal/sdlc/):
- Feature lifecycle with 10 phases (draft → released)
- Classifier engine with priority-ordered rules
- Artifact tracking with approval workflow
- Task management within features
- YAML-based state persistence

CLI (cmd/sdlc/):
- init, state, next, feature, artifact, task, query commands
- --json flag for machine-readable output
- Runs inside project pods

API (21 endpoints under /projects/{id}/sdlc/):
- State: GET /state, GET /next
- Features: CRUD + transition/block/unblock
- Artifacts: approve/reject per type
- Tasks: add/start/complete/block
- Queries: blocked/ready/needs-approval

Architecture:
- Port: SDLCExecutor interface (internal/port/)
- Adapter: kubectl exec into pods (internal/adapter/kubernetes/)
- Service: pod resolution + logging (internal/service/)
- Handlers: 5 files under 500-line limit (internal/handlers/)

Also includes template upgrades (chassis framework, UI components,
OpenAPI helpers, backend/frontend guides) and component improvements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:57:05 -07:00

45 lines
1.7 KiB
Go

package sdlc
import "time"
// HistoryEntry records a single action taken in the SDLC lifecycle.
type HistoryEntry struct {
Timestamp time.Time `yaml:"timestamp" json:"timestamp"`
Action string `yaml:"action" json:"action"`
Feature string `yaml:"feature,omitempty" json:"feature,omitempty"`
Actor string `yaml:"actor" json:"actor"`
Result string `yaml:"result,omitempty" json:"result,omitempty"`
Output string `yaml:"output,omitempty" json:"output,omitempty"`
FromPhase string `yaml:"from_phase,omitempty" json:"from_phase,omitempty"`
ToPhase string `yaml:"to_phase,omitempty" json:"to_phase,omitempty"`
}
// BlockedItem represents something that is blocked in the SDLC.
type BlockedItem struct {
Type string `yaml:"type" json:"type"`
Slug string `yaml:"slug" json:"slug"`
Reason string `yaml:"reason" json:"reason"`
Since string `yaml:"since,omitempty" json:"since,omitempty"`
RuleID string `yaml:"rule_id,omitempty" json:"rule_id,omitempty"`
}
// ActiveFeature tracks a feature in active_work.
type ActiveFeature struct {
Slug string `yaml:"slug" json:"slug"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
Phase FeaturePhase `yaml:"phase" json:"phase"`
}
// ActiveWork tracks all active items.
type ActiveWork struct {
Features []ActiveFeature `yaml:"features" json:"features"`
Patterns []string `yaml:"patterns,omitempty" json:"patterns,omitempty"`
Audits []string `yaml:"audits,omitempty" json:"audits,omitempty"`
}
// ProjectState holds project-level metadata.
type ProjectState struct {
Name string `yaml:"name" json:"name"`
CurrentRoadmap string `yaml:"current_roadmap,omitempty" json:"current_roadmap,omitempty"`
}