@lamentis/naome 1.3.13 → 1.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +2 -2
- package/crates/naome-cli/Cargo.toml +1 -1
- package/crates/naome-cli/src/architecture_commands.rs +1 -1
- package/crates/naome-cli/src/quality_commands.rs +4 -4
- package/crates/naome-core/Cargo.toml +1 -1
- package/crates/naome-core/src/architecture/config/parser/sections.rs +1 -1
- package/crates/naome-core/src/architecture/config.rs +1 -1
- package/crates/naome-core/src/architecture/model.rs +19 -0
- package/crates/naome-core/src/architecture/output.rs +27 -24
- package/crates/naome-core/src/architecture/rules/budgets.rs +2 -1
- package/crates/naome-core/src/architecture/rules.rs +3 -1
- package/crates/naome-core/src/architecture/scan/cache.rs +145 -0
- package/crates/naome-core/src/architecture/scan/graph_builder.rs +31 -10
- package/crates/naome-core/src/architecture/scan.rs +232 -14
- package/crates/naome-core/src/architecture.rs +3 -3
- package/crates/naome-core/src/intent/legacy.rs +1 -1
- package/crates/naome-core/src/intent/model.rs +27 -0
- package/crates/naome-core/src/intent/resolver.rs +3 -28
- package/crates/naome-core/src/intent/resolver_baseline.rs +1 -2
- package/crates/naome-core/src/intent/resolver_policy.rs +1 -2
- package/crates/naome-core/src/intent.rs +2 -1
- package/crates/naome-core/src/quality/adapter_ios.rs +3 -1
- package/crates/naome-core/src/quality/adapter_support.rs +32 -0
- package/crates/naome-core/src/quality/adapters.rs +8 -25
- package/crates/naome-core/src/quality/analysis_model.rs +33 -0
- package/crates/naome-core/src/quality/cache.rs +1 -1
- package/crates/naome-core/src/quality/checks/duplicate_blocks.rs +2 -1
- package/crates/naome-core/src/quality/checks/near_duplicates.rs +2 -1
- package/crates/naome-core/src/quality/mod.rs +1 -0
- package/crates/naome-core/src/quality/scanner/analysis.rs +1 -1
- package/crates/naome-core/src/quality/scanner.rs +1 -32
- package/crates/naome-core/src/quality/semantic/extract.rs +2 -1
- package/crates/naome-core/src/quality/structure/adapter_ios.rs +1 -1
- package/crates/naome-core/src/quality/structure/adapter_model.rs +23 -0
- package/crates/naome-core/src/quality/structure/adapters.rs +2 -23
- package/crates/naome-core/src/quality/structure/config.rs +2 -1
- package/crates/naome-core/src/quality/structure/defaults.rs +2 -2
- package/crates/naome-core/src/quality/structure/mod.rs +1 -0
- package/crates/naome-core/src/quality/structure/model.rs +6 -6
- package/crates/naome-core/src/repository_model.rs +6 -1
- package/crates/naome-core/src/route/builtin_checks.rs +1 -1
- package/crates/naome-core/src/route/builtin_require.rs +1 -1
- package/crates/naome-core/src/route/execution.rs +2 -34
- package/crates/naome-core/src/route/execution_baselines.rs +1 -1
- package/crates/naome-core/src/route/execution_model.rs +37 -0
- package/crates/naome-core/src/route/execution_support.rs +1 -1
- package/crates/naome-core/src/route/execution_tasks.rs +1 -1
- package/crates/naome-core/src/route/quality_gate.rs +0 -1
- package/crates/naome-core/src/route.rs +3 -1
- package/crates/naome-core/src/task_state/api.rs +5 -4
- package/crates/naome-core/src/task_state/commit_gate.rs +1 -1
- package/crates/naome-core/src/task_state/compact_proof.rs +2 -2
- package/crates/naome-core/src/task_state/completed_refresh.rs +0 -13
- package/crates/naome-core/src/task_state/completion.rs +13 -4
- package/crates/naome-core/src/task_state/mod.rs +1 -1
- package/crates/naome-core/src/task_state/progress.rs +1 -1
- package/crates/naome-core/src/task_state/proof.rs +1 -4
- package/crates/naome-core/src/task_state/proof_entry.rs +1 -1
- package/crates/naome-core/src/task_state/proof_model.rs +2 -18
- package/crates/naome-core/src/task_state/proof_sources.rs +2 -2
- package/crates/naome-core/src/task_state/proof_types.rs +17 -0
- package/crates/naome-core/src/task_state/shape.rs +1 -1
- package/crates/naome-core/src/task_state/task_diff_api.rs +1 -1
- package/crates/naome-core/src/verification_contract_policy.rs +2 -6
- package/crates/naome-core/src/workflow/agent/proof.rs +1 -1
- package/crates/naome-core/src/workflow/agent.rs +1 -1
- package/crates/naome-core/src/workflow/mod.rs +3 -1
- package/crates/naome-core/src/workflow/phase_inference.rs +1 -1
- package/crates/naome-core/src/workflow/phase_model.rs +22 -0
- package/crates/naome-core/src/workflow/phases.rs +1 -21
- package/crates/naome-core/tests/architecture_cache.rs +212 -0
- package/native/darwin-arm64/naome +0 -0
- package/native/linux-x64/naome +0 -0
- package/package.json +1 -1
- package/templates/naome-root/.naome/manifest.json +1 -1
- package/templates/naome-root/docs/naome/architecture-fitness.md +29 -8
- package/crates/naome-core/src/task_state/reconcile.rs +0 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
use std::collections::BTreeSet;
|
|
2
2
|
|
|
3
3
|
use super::model::ObjectCandidate;
|
|
4
|
-
use crate::quality::
|
|
4
|
+
use crate::quality::analysis_model::{FileAnalysis, SymbolAnalysis};
|
|
5
|
+
use crate::quality::scanner::stable_fingerprint;
|
|
5
6
|
|
|
6
7
|
pub(super) fn extract_object_candidates(file: &FileAnalysis) -> Vec<ObjectCandidate> {
|
|
7
8
|
let mut candidates = Vec::new();
|
|
@@ -4,7 +4,7 @@ use crate::quality::adapter_support::{
|
|
|
4
4
|
detects_swiftui_project, detects_xcode_project, detects_xctest_project,
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
use super::
|
|
7
|
+
use super::adapter_model::StructureAdapter;
|
|
8
8
|
|
|
9
9
|
pub(super) fn adapters() -> Vec<StructureAdapter> {
|
|
10
10
|
let mut adapters = Vec::new();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
use crate::quality::adapter_support::{AdapterDescriptor, RepoSignals};
|
|
2
|
+
|
|
3
|
+
#[derive(Clone, Copy)]
|
|
4
|
+
pub(super) struct StructureAdapter {
|
|
5
|
+
pub(super) id: &'static str,
|
|
6
|
+
pub(super) detect: fn(&RepoSignals<'_>) -> bool,
|
|
7
|
+
pub(super) source_roots: &'static [&'static str],
|
|
8
|
+
pub(super) test_roots: &'static [&'static str],
|
|
9
|
+
pub(super) generated_roots: &'static [&'static str],
|
|
10
|
+
pub(super) artifact_roots: &'static [&'static str],
|
|
11
|
+
pub(super) module_roots: &'static [&'static str],
|
|
12
|
+
pub(super) allowed_root_files: &'static [&'static str],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl AdapterDescriptor for StructureAdapter {
|
|
16
|
+
fn id(&self) -> &'static str {
|
|
17
|
+
self.id
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fn detects(&self, signals: &RepoSignals<'_>) -> bool {
|
|
21
|
+
(self.detect)(signals)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -2,36 +2,15 @@ use crate::models::NaomeError;
|
|
|
2
2
|
|
|
3
3
|
use crate::quality::adapter_support::{
|
|
4
4
|
detected_ids, detects_javascript_typescript_project, detects_rust_project, extend_unique,
|
|
5
|
-
find_adapter_by_id, validate_ids,
|
|
5
|
+
find_adapter_by_id, validate_ids,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
use super::adapter_ios;
|
|
9
|
+
use super::adapter_model::StructureAdapter;
|
|
9
10
|
use super::model::RepositoryStructureConfig;
|
|
10
11
|
|
|
11
12
|
const CONFIG_PATH: &str = ".naome/repository-structure.json";
|
|
12
13
|
|
|
13
|
-
#[derive(Clone, Copy)]
|
|
14
|
-
pub(super) struct StructureAdapter {
|
|
15
|
-
pub(super) id: &'static str,
|
|
16
|
-
pub(super) detect: fn(&RepoSignals<'_>) -> bool,
|
|
17
|
-
pub(super) source_roots: &'static [&'static str],
|
|
18
|
-
pub(super) test_roots: &'static [&'static str],
|
|
19
|
-
pub(super) generated_roots: &'static [&'static str],
|
|
20
|
-
pub(super) artifact_roots: &'static [&'static str],
|
|
21
|
-
pub(super) module_roots: &'static [&'static str],
|
|
22
|
-
pub(super) allowed_root_files: &'static [&'static str],
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
impl AdapterDescriptor for StructureAdapter {
|
|
26
|
-
fn id(&self) -> &'static str {
|
|
27
|
-
self.id
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
fn detects(&self, signals: &RepoSignals<'_>) -> bool {
|
|
31
|
-
(self.detect)(signals)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
14
|
pub fn detected_structure_adapter_ids(paths: &[String]) -> Vec<String> {
|
|
36
15
|
let registry = registry();
|
|
37
16
|
detected_ids(paths, ®istry)
|
|
@@ -8,6 +8,7 @@ use super::adapters::{
|
|
|
8
8
|
};
|
|
9
9
|
use crate::quality::config_support::validate_ready_schema;
|
|
10
10
|
|
|
11
|
+
use super::defaults::default_structure_config;
|
|
11
12
|
use super::model::RepositoryStructureConfig;
|
|
12
13
|
|
|
13
14
|
const CONFIG_RELATIVE_PATH: &str = ".naome/repository-structure.json";
|
|
@@ -68,7 +69,7 @@ pub fn write_default_structure_config_if_missing(
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
fn generated_structure_config(paths: &[String]) -> RepositoryStructureConfig {
|
|
71
|
-
let mut config =
|
|
72
|
+
let mut config = default_structure_config();
|
|
72
73
|
config.enabled_adapters = detected_structure_adapter_ids(paths);
|
|
73
74
|
config
|
|
74
75
|
}
|
|
@@ -24,11 +24,11 @@ pub fn default_structure_config() -> RepositoryStructureConfig {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
pub fn default_changed_policy() -> String {
|
|
27
|
-
|
|
27
|
+
super::model::default_changed_policy()
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
pub fn default_debt_policy() -> String {
|
|
31
|
-
|
|
31
|
+
super::model::default_debt_policy()
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const DEFAULT_SOURCE_ROOTS: &[&str] = &[
|
|
@@ -2,8 +2,6 @@ use std::collections::{BTreeMap, BTreeSet};
|
|
|
2
2
|
|
|
3
3
|
use serde::{Deserialize, Serialize};
|
|
4
4
|
|
|
5
|
-
use super::defaults::{default_changed_policy, default_debt_policy, default_structure_config};
|
|
6
|
-
|
|
7
5
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
8
6
|
#[serde(rename_all = "camelCase")]
|
|
9
7
|
pub struct StructureLimits {
|
|
@@ -81,10 +79,12 @@ pub struct RepositoryStructureConfig {
|
|
|
81
79
|
pub limits: StructureLimits,
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
pub(super) fn default_changed_policy() -> String {
|
|
83
|
+
"block".to_string()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
pub(super) fn default_debt_policy() -> String {
|
|
87
|
+
"report".to_string()
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
#[derive(Debug, Clone, Serialize)]
|
|
@@ -125,7 +125,12 @@ fn model_evidence_paths(model: &RepositoryModel) -> Vec<String> {
|
|
|
125
125
|
.iter()
|
|
126
126
|
.flat_map(|fact| fact.evidence.iter())
|
|
127
127
|
.chain(model.roots.iter().flat_map(|root| root.evidence.iter()))
|
|
128
|
-
.chain(
|
|
128
|
+
.chain(
|
|
129
|
+
model
|
|
130
|
+
.entities
|
|
131
|
+
.iter()
|
|
132
|
+
.flat_map(|entity| entity.evidence.iter()),
|
|
133
|
+
)
|
|
129
134
|
.chain(model.path_facts.iter().map(|fact| &fact.path))
|
|
130
135
|
.chain(
|
|
131
136
|
model
|
|
@@ -4,7 +4,7 @@ use crate::harness_health::{validate_harness_health, HarnessHealthOptions};
|
|
|
4
4
|
use crate::models::NaomeError;
|
|
5
5
|
use crate::quality::{check_repository_quality, check_semantic_legacy, QualityMode};
|
|
6
6
|
use crate::route::git_ops::{command_output, git_output};
|
|
7
|
-
use crate::route::
|
|
7
|
+
use crate::route::quality_gate_config::QualityCheck;
|
|
8
8
|
use crate::task_state::{validate_task_state, TaskStateMode, TaskStateOptions};
|
|
9
9
|
use crate::verification_contract::validate_verification_contract;
|
|
10
10
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
use std::path::
|
|
1
|
+
use std::path::Path;
|
|
2
2
|
|
|
3
3
|
use crate::intent::IntentDecision;
|
|
4
|
-
use crate::journal::TaskJournalEntry;
|
|
5
4
|
use crate::models::{Decision, NaomeError};
|
|
6
5
|
|
|
7
6
|
use super::execution_baselines::{
|
|
@@ -9,41 +8,10 @@ use super::execution_baselines::{
|
|
|
9
8
|
baseline_harness_refresh_then_completed_task, baseline_harness_refresh_then_worktree,
|
|
10
9
|
baseline_pure_harness_refresh, baseline_setup, commit_upgrade_baseline,
|
|
11
10
|
};
|
|
11
|
+
use super::execution_model::RouteExecution;
|
|
12
12
|
use super::execution_tasks::{
|
|
13
13
|
commit_user_diff, create_task_worktree, journal_external_baseline_if_needed,
|
|
14
14
|
};
|
|
15
|
-
use super::RouteWorktree;
|
|
16
|
-
|
|
17
|
-
pub(super) struct RouteExecution {
|
|
18
|
-
pub(super) mutation_performed: bool,
|
|
19
|
-
pub(super) executed_actions: Vec<String>,
|
|
20
|
-
pub(super) journal_entry: Option<TaskJournalEntry>,
|
|
21
|
-
pub(super) user_message: String,
|
|
22
|
-
pub(super) task_root: PathBuf,
|
|
23
|
-
pub(super) worktree: Option<RouteWorktree>,
|
|
24
|
-
pub(super) route_allowed: bool,
|
|
25
|
-
pub(super) human_options: Vec<String>,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
impl RouteExecution {
|
|
29
|
-
pub(super) fn from_intent(root: &Path, intent: &IntentDecision) -> Self {
|
|
30
|
-
Self {
|
|
31
|
-
mutation_performed: false,
|
|
32
|
-
executed_actions: Vec::new(),
|
|
33
|
-
journal_entry: None,
|
|
34
|
-
user_message: intent.user_message.clone(),
|
|
35
|
-
task_root: root.to_path_buf(),
|
|
36
|
-
worktree: None,
|
|
37
|
-
route_allowed: intent.allowed,
|
|
38
|
-
human_options: intent.human_options.clone(),
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
pub(super) fn mark_action(&mut self, action: &str) {
|
|
43
|
-
self.mutation_performed = true;
|
|
44
|
-
self.executed_actions.push(action.to_string());
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
15
|
|
|
48
16
|
pub(super) fn execute_route_policy(
|
|
49
17
|
root: &Path,
|
|
@@ -5,7 +5,7 @@ use crate::task_state::{
|
|
|
5
5
|
completed_task_harness_refresh_diff, harness_refresh_diff, harness_refresh_with_unrelated_diff,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
use super::
|
|
8
|
+
use super::execution_model::RouteExecution;
|
|
9
9
|
use super::execution_support::{commit_completed_task, commit_harness_paths, set_created_worktree};
|
|
10
10
|
use super::git_ops::{git_add_all, git_commit, git_head};
|
|
11
11
|
use super::worktree::{
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
use std::path::{Path, PathBuf};
|
|
2
|
+
|
|
3
|
+
use crate::intent::IntentDecision;
|
|
4
|
+
use crate::journal::TaskJournalEntry;
|
|
5
|
+
|
|
6
|
+
use super::RouteWorktree;
|
|
7
|
+
|
|
8
|
+
pub(super) struct RouteExecution {
|
|
9
|
+
pub(super) mutation_performed: bool,
|
|
10
|
+
pub(super) executed_actions: Vec<String>,
|
|
11
|
+
pub(super) journal_entry: Option<TaskJournalEntry>,
|
|
12
|
+
pub(super) user_message: String,
|
|
13
|
+
pub(super) task_root: PathBuf,
|
|
14
|
+
pub(super) worktree: Option<RouteWorktree>,
|
|
15
|
+
pub(super) route_allowed: bool,
|
|
16
|
+
pub(super) human_options: Vec<String>,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
impl RouteExecution {
|
|
20
|
+
pub(super) fn from_intent(root: &Path, intent: &IntentDecision) -> Self {
|
|
21
|
+
Self {
|
|
22
|
+
mutation_performed: false,
|
|
23
|
+
executed_actions: Vec::new(),
|
|
24
|
+
journal_entry: None,
|
|
25
|
+
user_message: intent.user_message.clone(),
|
|
26
|
+
task_root: root.to_path_buf(),
|
|
27
|
+
worktree: None,
|
|
28
|
+
route_allowed: intent.allowed,
|
|
29
|
+
human_options: intent.human_options.clone(),
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pub(super) fn mark_action(&mut self, action: &str) {
|
|
34
|
+
self.mutation_performed = true;
|
|
35
|
+
self.executed_actions.push(action.to_string());
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
|
|
|
3
3
|
use crate::journal::append_task_journal;
|
|
4
4
|
use crate::models::{Decision, NaomeError};
|
|
5
5
|
|
|
6
|
-
use super::
|
|
6
|
+
use super::execution_model::RouteExecution;
|
|
7
7
|
use super::git_ops::{git_add_completed_task_paths, git_commit, git_head, git_stage_only_paths};
|
|
8
8
|
use super::RouteWorktree;
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ use crate::git;
|
|
|
4
4
|
use crate::journal::append_task_journal;
|
|
5
5
|
use crate::models::{Decision, NaomeError};
|
|
6
6
|
|
|
7
|
-
use super::
|
|
7
|
+
use super::execution_model::RouteExecution;
|
|
8
8
|
use super::execution_support::{initial_decision_completed, set_created_worktree};
|
|
9
9
|
use super::git_ops::{git_commit, git_head, git_stage_only_paths};
|
|
10
10
|
use super::quality_gate::run_user_diff_quality_gate;
|
|
@@ -4,7 +4,6 @@ use crate::git;
|
|
|
4
4
|
use crate::models::NaomeError;
|
|
5
5
|
|
|
6
6
|
use super::builtin_checks::run_quality_check;
|
|
7
|
-
pub(super) use super::quality_gate_config::QualityCheck;
|
|
8
7
|
use super::quality_gate_config::{user_diff_check_ids, verification_checks};
|
|
9
8
|
use super::quality_gate_snapshot::{
|
|
10
9
|
changed_path_snapshot, read_head_verification, sorted_path_set,
|
|
@@ -12,6 +12,7 @@ mod builtin_require;
|
|
|
12
12
|
mod context;
|
|
13
13
|
mod execution;
|
|
14
14
|
mod execution_baselines;
|
|
15
|
+
mod execution_model;
|
|
15
16
|
mod execution_support;
|
|
16
17
|
mod execution_tasks;
|
|
17
18
|
mod git_ops;
|
|
@@ -26,7 +27,8 @@ use self::context::{
|
|
|
26
27
|
can_create_task, discarded_actions, required_context_for_intent, required_context_for_route,
|
|
27
28
|
winning_rule, would_mutate,
|
|
28
29
|
};
|
|
29
|
-
use self::execution::
|
|
30
|
+
use self::execution::execute_route_policy;
|
|
31
|
+
use self::execution_model::RouteExecution;
|
|
30
32
|
|
|
31
33
|
const MAX_NAOME_TASK_WORKTREES: usize = 25;
|
|
32
34
|
|
|
@@ -5,12 +5,13 @@ use serde_json::Value;
|
|
|
5
5
|
use crate::models::NaomeError;
|
|
6
6
|
use crate::task_ledger::{read_task_state_projection, validate_task_state_projection_is_current};
|
|
7
7
|
|
|
8
|
-
use super::
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
use super::admission::validate_admission;
|
|
9
|
+
use super::commit_gate::validate_commit_gate;
|
|
10
|
+
use super::completion::validate_complete_task;
|
|
11
11
|
use super::diff::validate_human_review_blocker_paths;
|
|
12
|
+
use super::progress::validate_progress;
|
|
12
13
|
use super::proof::validate_proof_evidence_covers_changed_paths;
|
|
13
|
-
use super::
|
|
14
|
+
use super::push_gate::validate_push_gate;
|
|
14
15
|
use super::shape::{
|
|
15
16
|
format_blocker, validate_active_task, validate_active_task_references, validate_blocker,
|
|
16
17
|
validate_idle_state, validate_pending_upgrade, validate_task_state_shape,
|
|
@@ -7,7 +7,7 @@ use super::diff::task_diff_from_entries;
|
|
|
7
7
|
use super::git_io::read_git_staged_changed_entries;
|
|
8
8
|
use super::process_guard::{validate_no_active_processes, ProcessGate};
|
|
9
9
|
use super::progress::{validate_init_complete, validate_upgrade_complete};
|
|
10
|
-
use super::
|
|
10
|
+
use super::repair::{
|
|
11
11
|
is_deterministic_harness_refresh_diff, is_harness_repair_diff,
|
|
12
12
|
is_install_or_upgrade_baseline_diff,
|
|
13
13
|
};
|
|
@@ -5,11 +5,11 @@ use serde_json::Value;
|
|
|
5
5
|
|
|
6
6
|
use crate::models::NaomeError;
|
|
7
7
|
|
|
8
|
-
use super::
|
|
8
|
+
use super::evidence::{
|
|
9
9
|
validate_control_state_paths, validate_evidence_array, validate_evidence_paths,
|
|
10
10
|
};
|
|
11
|
-
use super::proof_model::{CanonicalProof, VerificationDefaults};
|
|
12
11
|
use super::proof_sources::read_path_sets;
|
|
12
|
+
use super::proof_types::{CanonicalProof, VerificationDefaults};
|
|
13
13
|
use super::util::{is_iso_datetime, require_string};
|
|
14
14
|
|
|
15
15
|
pub(super) fn compact_proofs(
|
|
@@ -10,19 +10,6 @@ use super::types::{
|
|
|
10
10
|
TaskStateMode, TaskStateOptions,
|
|
11
11
|
};
|
|
12
12
|
use super::util::{matches_any_pattern, string_array};
|
|
13
|
-
pub(super) fn add_completed_task_diff_notice(
|
|
14
|
-
root: &Path,
|
|
15
|
-
notices: &mut Vec<String>,
|
|
16
|
-
) -> Result<(), NaomeError> {
|
|
17
|
-
let changed_paths = read_git_changed_paths(root)?;
|
|
18
|
-
if changed_paths.is_empty() {
|
|
19
|
-
return Ok(());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
notices.push(format!("Task is complete and verified. Changed paths: {}. NAOME intent can baseline it automatically before the next distinct task; only surface human choices when intent blocks or the user explicitly asks to review, revise, cancel, or commit.", changed_paths.join(", ")));
|
|
23
|
-
Ok(())
|
|
24
|
-
}
|
|
25
|
-
|
|
26
13
|
pub fn completed_task_harness_refresh_diff(
|
|
27
14
|
root: &Path,
|
|
28
15
|
) -> Result<Option<CompletedTaskHarnessRefreshDiff>, NaomeError> {
|
|
@@ -3,14 +3,10 @@ use std::path::Path;
|
|
|
3
3
|
|
|
4
4
|
use serde_json::Value;
|
|
5
5
|
|
|
6
|
-
pub(super) use super::admission::validate_admission;
|
|
7
|
-
pub(super) use super::commit_gate::validate_commit_gate;
|
|
8
6
|
use super::diff::validate_changed_entries;
|
|
9
7
|
use super::git_io::read_git_changed_entries;
|
|
10
8
|
use super::process_guard::{validate_no_active_processes, ProcessGate};
|
|
11
|
-
pub(super) use super::progress::validate_progress;
|
|
12
9
|
use super::proof::{validate_proof_evidence_covers_changed_entries, validate_proof_results};
|
|
13
|
-
use super::reconcile::add_completed_task_diff_notice;
|
|
14
10
|
use super::shape::{read_verification_check_ids, validate_required_check_ids};
|
|
15
11
|
use super::types::ChangedEntry;
|
|
16
12
|
use crate::models::NaomeError;
|
|
@@ -58,6 +54,19 @@ pub(super) fn validate_complete_task(
|
|
|
58
54
|
Ok(())
|
|
59
55
|
}
|
|
60
56
|
|
|
57
|
+
fn add_completed_task_diff_notice(
|
|
58
|
+
root: &Path,
|
|
59
|
+
notices: &mut Vec<String>,
|
|
60
|
+
) -> Result<(), NaomeError> {
|
|
61
|
+
let changed_paths = super::git_io::read_git_changed_paths(root)?;
|
|
62
|
+
if changed_paths.is_empty() {
|
|
63
|
+
return Ok(());
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
notices.push(format!("Task is complete and verified. Changed paths: {}. NAOME intent can baseline it automatically before the next distinct task; only surface human choices when intent blocks or the user explicitly asks to review, revise, cancel, or commit.", changed_paths.join(", ")));
|
|
67
|
+
Ok(())
|
|
68
|
+
}
|
|
69
|
+
|
|
61
70
|
pub(super) fn validate_complete_task_against_entries(
|
|
62
71
|
active_task: &Value,
|
|
63
72
|
root: &Path,
|
|
@@ -8,7 +8,7 @@ use crate::repository_model_drift;
|
|
|
8
8
|
use super::diff::validate_changed_paths;
|
|
9
9
|
use super::git_io::read_git_changed_paths;
|
|
10
10
|
use super::human_review_state::validate_human_review_state;
|
|
11
|
-
use super::
|
|
11
|
+
use super::push_gate::format_dirty_diff_admission_blocker;
|
|
12
12
|
use super::shape::{
|
|
13
13
|
format_blocker, validate_active_task, validate_active_task_references, validate_blocker,
|
|
14
14
|
validate_pending_upgrade,
|
|
@@ -6,10 +6,7 @@ use serde_json::Value;
|
|
|
6
6
|
use crate::models::NaomeError;
|
|
7
7
|
|
|
8
8
|
use super::diff::task_diff_from_entries;
|
|
9
|
-
|
|
10
|
-
evidence_entry_path, validate_control_state_paths, validate_control_state_patterns,
|
|
11
|
-
validate_evidence_array, validate_evidence_paths,
|
|
12
|
-
};
|
|
9
|
+
use super::evidence::evidence_entry_path;
|
|
13
10
|
use super::git_io::read_git_changed_entries;
|
|
14
11
|
use super::proof_entry::validate_proof_result;
|
|
15
12
|
use super::proof_model::canonical_proofs;
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
use std::path::Path;
|
|
2
2
|
|
|
3
|
-
use serde_json::Value;
|
|
4
|
-
|
|
5
3
|
use crate::models::NaomeError;
|
|
6
4
|
|
|
7
5
|
use super::compact_proof::compact_proofs;
|
|
8
6
|
use super::proof_sources::{check_id_from_proof, read_verification_defaults};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
pub(crate) struct CanonicalProof {
|
|
12
|
-
pub(crate) check_id: String,
|
|
13
|
-
pub(crate) command: String,
|
|
14
|
-
pub(crate) cwd: String,
|
|
15
|
-
pub(crate) exit_code: i64,
|
|
16
|
-
pub(crate) checked_at: String,
|
|
17
|
-
pub(crate) evidence: Vec<Value>,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
#[derive(Debug, Clone)]
|
|
21
|
-
pub(super) struct VerificationDefaults {
|
|
22
|
-
pub(super) command: String,
|
|
23
|
-
pub(super) cwd: String,
|
|
24
|
-
}
|
|
7
|
+
use super::proof_types::CanonicalProof;
|
|
8
|
+
use serde_json::Value;
|
|
25
9
|
|
|
26
10
|
pub(crate) fn canonical_proofs(
|
|
27
11
|
active_task: &Value,
|
|
@@ -5,10 +5,10 @@ use serde_json::Value;
|
|
|
5
5
|
|
|
6
6
|
use crate::models::NaomeError;
|
|
7
7
|
|
|
8
|
-
use super::
|
|
8
|
+
use super::evidence::{
|
|
9
9
|
validate_control_state_paths, validate_evidence_array, validate_evidence_paths,
|
|
10
10
|
};
|
|
11
|
-
use super::
|
|
11
|
+
use super::proof_types::VerificationDefaults;
|
|
12
12
|
use super::util::read_json;
|
|
13
13
|
|
|
14
14
|
pub(super) fn read_path_sets(
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
use serde_json::Value;
|
|
2
|
+
|
|
3
|
+
#[derive(Debug, Clone)]
|
|
4
|
+
pub(crate) struct CanonicalProof {
|
|
5
|
+
pub(crate) check_id: String,
|
|
6
|
+
pub(crate) command: String,
|
|
7
|
+
pub(crate) cwd: String,
|
|
8
|
+
pub(crate) exit_code: i64,
|
|
9
|
+
pub(crate) checked_at: String,
|
|
10
|
+
pub(crate) evidence: Vec<Value>,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[derive(Debug, Clone)]
|
|
14
|
+
pub(super) struct VerificationDefaults {
|
|
15
|
+
pub(super) command: String,
|
|
16
|
+
pub(super) cwd: String,
|
|
17
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use serde_json::Value;
|
|
2
2
|
|
|
3
|
-
use super::
|
|
3
|
+
use super::evidence::validate_control_state_patterns;
|
|
4
4
|
pub(super) use super::task_records::{
|
|
5
5
|
format_blocker, validate_blocker, validate_human_review, validate_prompt_record,
|
|
6
6
|
validate_revisions,
|
|
@@ -8,7 +8,7 @@ use crate::models::NaomeError;
|
|
|
8
8
|
|
|
9
9
|
use super::completion::validate_complete_task_against_entries;
|
|
10
10
|
use super::git_io::{read_git_changed_entries, read_git_changed_paths};
|
|
11
|
-
use super::
|
|
11
|
+
use super::repair::{
|
|
12
12
|
is_packaged_machine_owned_path, is_repair_archive_path, is_safe_harness_refresh_path,
|
|
13
13
|
};
|
|
14
14
|
use super::shape::{
|
|
@@ -17,9 +17,7 @@ pub(crate) fn validate_semantic_quality_gate_policy(
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
for (index, change_type) in change_types.iter().enumerate() {
|
|
20
|
-
let Some(required_checks) = change_type
|
|
21
|
-
.get("requiredChecks")
|
|
22
|
-
.and_then(Value::as_array)
|
|
20
|
+
let Some(required_checks) = change_type.get("requiredChecks").and_then(Value::as_array)
|
|
23
21
|
else {
|
|
24
22
|
continue;
|
|
25
23
|
};
|
|
@@ -46,7 +44,5 @@ pub(crate) fn validate_semantic_quality_gate_policy(
|
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
fn contains_string(values: &[Value], expected: &str) -> bool {
|
|
49
|
-
values
|
|
50
|
-
.iter()
|
|
51
|
-
.any(|value| value.as_str() == Some(expected))
|
|
47
|
+
values.iter().any(|value| value.as_str() == Some(expected))
|
|
52
48
|
}
|
|
@@ -4,7 +4,7 @@ use crate::models::NaomeError;
|
|
|
4
4
|
|
|
5
5
|
use super::support::changed_paths;
|
|
6
6
|
use crate::workflow::agent_types::ProofPlan;
|
|
7
|
-
use crate::workflow::
|
|
7
|
+
use crate::workflow::{verification_phase_plan, CommandCheckResult};
|
|
8
8
|
|
|
9
9
|
pub fn proof_plan_for_task(
|
|
10
10
|
root: &Path,
|
|
@@ -11,7 +11,7 @@ use std::path::Path;
|
|
|
11
11
|
use crate::models::NaomeError;
|
|
12
12
|
|
|
13
13
|
use super::agent_types::AgentRunPlan;
|
|
14
|
-
use super::
|
|
14
|
+
use super::phase_model::CommandCheckResult;
|
|
15
15
|
|
|
16
16
|
pub use capability::repository_capability_graph;
|
|
17
17
|
pub use context_delta::context_delta_report;
|
|
@@ -7,6 +7,7 @@ mod integrity_support;
|
|
|
7
7
|
mod mutation;
|
|
8
8
|
mod output;
|
|
9
9
|
mod phase_inference;
|
|
10
|
+
mod phase_model;
|
|
10
11
|
mod phases;
|
|
11
12
|
mod policy;
|
|
12
13
|
mod processes;
|
|
@@ -25,7 +26,8 @@ pub use doctor::{doctor_report, DoctorReport, DoctorSection, RepositoryPolicySec
|
|
|
25
26
|
pub use integrity::{refresh_integrity, IntegrityRefreshReport};
|
|
26
27
|
pub use mutation::classify_mutations;
|
|
27
28
|
pub use output::{summarize_command_output, CommandOutputSummary};
|
|
28
|
-
pub use
|
|
29
|
+
pub use phase_model::CommandCheckResult;
|
|
30
|
+
pub use phases::{verification_phase_plan, VerificationPhasePlan};
|
|
29
31
|
pub use policy::{safe_rg_args, validate_read_boundaries, validate_search_command};
|
|
30
32
|
pub use processes::{tracked_process_report, ProcessReport};
|
|
31
33
|
pub use types::{MutationClassification, ReadActivity, WorkflowFinding};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
use serde::{Deserialize, Serialize};
|
|
2
|
+
|
|
3
|
+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
4
|
+
#[serde(rename_all = "camelCase")]
|
|
5
|
+
pub struct CommandCheckResult {
|
|
6
|
+
pub check_id: String,
|
|
7
|
+
pub exit_code: i32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#[derive(Debug, Clone)]
|
|
11
|
+
pub(super) struct CheckDefinition {
|
|
12
|
+
pub(super) id: String,
|
|
13
|
+
pub(super) command: String,
|
|
14
|
+
pub(super) cost: String,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#[derive(Debug, Clone)]
|
|
18
|
+
pub(super) struct PhaseDefinition {
|
|
19
|
+
pub(super) id: String,
|
|
20
|
+
pub(super) order: u32,
|
|
21
|
+
pub(super) check_ids: Vec<String>,
|
|
22
|
+
}
|