Public declaration syntax from forge-rs/crates/forge-coder/src/cycle.rs Original source SHA-256: 7ace6849536e03e3ee7c5880c59fac32ae1717c35d765b80739296efc4bde58e Function bodies and constant values are omitted. This is not the complete implementation. Source line 52 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CodingTask { /// Unique identifier for the task. pub id: String, /// Short title of the task. pub title: String, /// Detailed description of what needs to be done. pub description: String, /// Files that are expected to be modified. pub target_files: Vec, /// Acceptance criteria that must be met. pub acceptance_criteria: Vec } Source line 67 #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum CyclePhase { /// Planning phase: understanding the task and creating an implementation plan. Planning, /// Implementation phase: writing the code. Implementing, /// Review phase: reviewing the changes for correctness and quality. Reviewing, /// Testing phase: running tests to verify the changes. Testing, /// The cycle completed successfully. Completed, /// The cycle failed and cannot proceed. Failed, } Source line 97 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ReviewResult { /// Whether the review approved the changes. pub approved: bool, /// The reviewer's DID. pub reviewer_did: String, /// Comments from the reviewer. pub comments: Vec, /// Specific files flagged for revision. pub flagged_files: Vec } Source line 110 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TestRunResult { /// Whether all tests passed. pub all_passed: bool, /// Total number of tests run. pub total_tests: usize, /// Number of tests that passed. pub passed: usize, /// Number of tests that failed. pub failed: usize, /// Number of tests that were skipped. pub skipped: usize, /// Failure messages for failed tests. pub failure_messages: Vec, /// The test command that was run. pub command: String, /// The exit code of the test command. pub exit_code: i32 } Source line 131 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PhaseArtifact { /// The phase that produced this artifact. pub phase: CyclePhase, /// Description of the artifact. pub description: String, /// The content of the artifact. pub content: String, /// When the artifact was produced. pub produced_at: DateTime } Source line 147 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CodingCycle { } Source line 185 pub fn new(agent_did: impl Into, task: CodingTask) -> Self; Source line 205 pub fn with_max_revisions(mut self, max: u32) -> Self; Source line 211 pub fn with_max_fixes(mut self, max: u32) -> Self; Source line 217 pub fn id(&self) -> &str; Source line 222 pub fn agent_did(&self) -> &str; Source line 227 pub fn task(&self) -> &CodingTask; Source line 232 pub fn phase(&self) -> CyclePhase; Source line 237 pub fn artifacts(&self) -> &[PhaseArtifact]; Source line 242 pub fn revision_count(&self) -> u32; Source line 247 pub fn fix_count(&self) -> u32; Source line 252 pub fn review_result(&self) -> Option<&ReviewResult>; Source line 257 pub fn test_result(&self) -> Option<&TestRunResult>; Source line 270 pub fn advance_to_implementing(&mut self, plan: String) -> Result<(), String>; Source line 295 pub fn advance_to_reviewing(&mut self, change_summary: String) -> Result<(), String>; Source line 320 pub fn record_review(&mut self, result: ReviewResult) -> Result<(), String>; Source line 348 pub fn record_test_result(&mut self, result: TestRunResult) -> Result<(), String>; Source line 375 pub fn mark_failed(&mut self, reason: &str); Source line 387 pub fn is_terminal(&self) -> bool;