Skip to content

Commit 24d8734

Browse files
committed
feat(harness): port brownfield import to Rust CLI
1 parent 4dea320 commit 24d8734

7 files changed

Lines changed: 657 additions & 21 deletions

File tree

crates/harness-cli/src/application.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::infrastructure::{HarnessRepository, SqliteHarnessRepository};
88

99
#[derive(Debug)]
1010
pub struct HarnessContext {
11+
pub repo_root: PathBuf,
1112
pub db_path: PathBuf,
1213
pub schema_dir: PathBuf,
1314
}
@@ -97,7 +98,11 @@ pub struct HarnessService {
9798
impl HarnessService {
9899
pub fn new(context: HarnessContext) -> Self {
99100
Self {
100-
repository: SqliteHarnessRepository::new(context.db_path, context.schema_dir),
101+
repository: SqliteHarnessRepository::new(
102+
context.repo_root,
103+
context.db_path,
104+
context.schema_dir,
105+
),
101106
}
102107
}
103108

@@ -109,6 +114,10 @@ impl HarnessService {
109114
self.repository.migrate()
110115
}
111116

117+
pub fn import_brownfield(&self) -> crate::infrastructure::Result<BrownfieldImportResult> {
118+
self.repository.import_brownfield()
119+
}
120+
112121
pub fn record_intake(&self, input: IntakeInput) -> crate::infrastructure::Result<i64> {
113122
self.repository.record_intake(input)
114123
}
@@ -187,6 +196,13 @@ pub struct MigrateResult {
187196
pub applied: Vec<i64>,
188197
}
189198

199+
#[derive(Debug, PartialEq, Eq)]
200+
pub struct BrownfieldImportResult {
201+
pub stories: usize,
202+
pub decisions: usize,
203+
pub backlog_items: usize,
204+
}
205+
190206
#[derive(Debug, PartialEq, Eq)]
191207
pub struct DecisionVerifyResult {
192208
pub command: String,

0 commit comments

Comments
 (0)