11use std:: path:: PathBuf ;
22
33use crate :: domain:: {
4- BacklogFilter , BacklogRecord , BoolFlag , CsvList , DecisionRecord , FrictionRecord , HarnessStats ,
5- InputType , IntakeRecord , RiskLane , StoryMatrixRecord , StoryVerifyStatus , TraceRecord ,
6- TraceScoreResult ,
4+ AuditResult , BacklogFilter , BacklogRecord , BoolFlag , ContextScoreResult , CsvList ,
5+ DecisionRecord , FrictionRecord , HarnessStats , ImprovementProposal , InputType , IntakeRecord ,
6+ InterventionRecord , RiskLane , StoryMatrixRecord , StoryVerifyAllResult , StoryVerifyStatus ,
7+ ToolArgSpec , ToolEntry , TraceRecord , TraceScoreResult ,
78} ;
89use crate :: infrastructure:: { HarnessRepository , SqliteHarnessRepository } ;
910
@@ -69,6 +70,33 @@ pub struct BacklogAddInput {
6970 pub notes : Option < String > ,
7071}
7172
73+ #[ derive( Debug ) ]
74+ pub struct ToolRegisterInput {
75+ pub name : String ,
76+ pub command : String ,
77+ pub description : String ,
78+ pub responsibility : String ,
79+ pub args : Vec < ToolArgSpec > ,
80+ pub force : bool ,
81+ }
82+
83+ #[ derive( Debug ) ]
84+ pub struct InterventionAddInput {
85+ pub trace_id : Option < i64 > ,
86+ pub story_id : Option < String > ,
87+ pub intervention_type : String ,
88+ pub description : String ,
89+ pub source : String ,
90+ pub impact : Option < String > ,
91+ }
92+
93+ #[ derive( Debug , Default ) ]
94+ pub struct InterventionFilter {
95+ pub trace_id : Option < i64 > ,
96+ pub story_id : Option < String > ,
97+ pub intervention_type : Option < String > ,
98+ }
99+
72100#[ derive( Debug ) ]
73101pub struct BacklogCloseInput {
74102 pub id : i64 ,
@@ -137,6 +165,10 @@ impl HarnessService {
137165 self . repository . verify_story ( id)
138166 }
139167
168+ pub fn verify_all_stories ( & self ) -> crate :: infrastructure:: Result < StoryVerifyAllResult > {
169+ self . repository . verify_all_stories ( )
170+ }
171+
140172 pub fn add_decision ( & self , input : DecisionAddInput ) -> crate :: infrastructure:: Result < ( ) > {
141173 self . repository . add_decision ( input)
142174 }
@@ -153,6 +185,21 @@ impl HarnessService {
153185 self . repository . close_backlog ( input)
154186 }
155187
188+ pub fn register_tool ( & self , input : ToolRegisterInput ) -> crate :: infrastructure:: Result < ( ) > {
189+ self . repository . register_tool ( input)
190+ }
191+
192+ pub fn remove_tool ( & self , name : & str ) -> crate :: infrastructure:: Result < ( ) > {
193+ self . repository . remove_tool ( name)
194+ }
195+
196+ pub fn add_intervention (
197+ & self ,
198+ input : InterventionAddInput ,
199+ ) -> crate :: infrastructure:: Result < i64 > {
200+ self . repository . add_intervention ( input)
201+ }
202+
156203 pub fn record_trace ( & self , input : TraceInput ) -> crate :: infrastructure:: Result < i64 > {
157204 self . repository . record_trace ( input)
158205 }
@@ -161,6 +208,10 @@ impl HarnessService {
161208 self . repository . score_trace ( id)
162209 }
163210
211+ pub fn score_context ( & self , id : i64 ) -> crate :: infrastructure:: Result < ContextScoreResult > {
212+ self . repository . score_context ( id)
213+ }
214+
164215 pub fn story_verify_status (
165216 & self ,
166217 id : & str ,
@@ -195,10 +246,32 @@ impl HarnessService {
195246 self . repository . query_friction ( )
196247 }
197248
249+ pub fn query_tools (
250+ & self ,
251+ responsibility : Option < String > ,
252+ ) -> crate :: infrastructure:: Result < Vec < ToolEntry > > {
253+ self . repository . query_tools ( responsibility)
254+ }
255+
256+ pub fn query_interventions (
257+ & self ,
258+ filter : InterventionFilter ,
259+ ) -> crate :: infrastructure:: Result < Vec < InterventionRecord > > {
260+ self . repository . query_interventions ( filter)
261+ }
262+
198263 pub fn query_stats ( & self ) -> crate :: infrastructure:: Result < HarnessStats > {
199264 self . repository . query_stats ( )
200265 }
201266
267+ pub fn audit ( & self ) -> crate :: infrastructure:: Result < AuditResult > {
268+ self . repository . audit ( )
269+ }
270+
271+ pub fn propose ( & self , commit : bool ) -> crate :: infrastructure:: Result < Vec < ImprovementProposal > > {
272+ self . repository . propose ( commit)
273+ }
274+
202275 pub fn query_sql ( & self , sql : & str ) -> crate :: infrastructure:: Result < QueryTable > {
203276 self . repository . query_sql ( sql)
204277 }
0 commit comments