@lamentis/naome 1.3.14 → 1.3.16
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 +5 -4
- 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 +166 -22
- package/crates/naome-core/src/architecture/rules/budgets.rs +2 -1
- package/crates/naome-core/src/architecture/rules.rs +5 -2
- package/crates/naome-core/src/architecture.rs +4 -4
- 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/lib.rs +7 -7
- 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_config.rs +67 -0
- package/native/darwin-arm64/naome +0 -0
- package/native/linux-x64/naome +0 -0
- package/package.json +1 -1
- package/crates/naome-core/src/task_state/reconcile.rs +0 -7
|
@@ -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
|
+
}
|
|
@@ -8,13 +8,7 @@ use serde_json::Value;
|
|
|
8
8
|
use crate::models::NaomeError;
|
|
9
9
|
|
|
10
10
|
use super::phase_inference::infer_phases;
|
|
11
|
-
|
|
12
|
-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
13
|
-
#[serde(rename_all = "camelCase")]
|
|
14
|
-
pub struct CommandCheckResult {
|
|
15
|
-
pub check_id: String,
|
|
16
|
-
pub exit_code: i32,
|
|
17
|
-
}
|
|
11
|
+
use super::phase_model::{CheckDefinition, CommandCheckResult, PhaseDefinition};
|
|
18
12
|
|
|
19
13
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
20
14
|
#[serde(rename_all = "camelCase")]
|
|
@@ -35,20 +29,6 @@ pub struct VerificationPhaseStatus {
|
|
|
35
29
|
pub blocked_by: Vec<String>,
|
|
36
30
|
}
|
|
37
31
|
|
|
38
|
-
#[derive(Debug, Clone)]
|
|
39
|
-
pub(super) struct CheckDefinition {
|
|
40
|
-
pub(super) id: String,
|
|
41
|
-
pub(super) command: String,
|
|
42
|
-
pub(super) cost: String,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#[derive(Debug, Clone)]
|
|
46
|
-
pub(super) struct PhaseDefinition {
|
|
47
|
-
pub(super) id: String,
|
|
48
|
-
pub(super) order: u32,
|
|
49
|
-
pub(super) check_ids: Vec<String>,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
32
|
pub fn verification_phase_plan(
|
|
53
33
|
root: &Path,
|
|
54
34
|
completed: &[CommandCheckResult],
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
use naome_core::{format_architecture_validation, validate_architecture, ArchitectureScanOptions};
|
|
2
|
+
|
|
3
|
+
mod architecture_support;
|
|
4
|
+
|
|
5
|
+
use architecture_support::FixtureRepo;
|
|
6
|
+
|
|
7
|
+
#[test]
|
|
8
|
+
fn validation_reports_risky_broad_architecture_config_without_failing() {
|
|
9
|
+
let repo = FixtureRepo::new();
|
|
10
|
+
repo.write(
|
|
11
|
+
"naome.arch.yaml",
|
|
12
|
+
r#"
|
|
13
|
+
layers:
|
|
14
|
+
application:
|
|
15
|
+
paths:
|
|
16
|
+
- "src/**"
|
|
17
|
+
domain:
|
|
18
|
+
paths:
|
|
19
|
+
- "src/domain/**"
|
|
20
|
+
infrastructure:
|
|
21
|
+
paths:
|
|
22
|
+
- "src/infrastructure/**"
|
|
23
|
+
allowed_dependencies:
|
|
24
|
+
application:
|
|
25
|
+
- domain
|
|
26
|
+
- infrastructure
|
|
27
|
+
domain:
|
|
28
|
+
infrastructure:
|
|
29
|
+
- domain
|
|
30
|
+
contexts:
|
|
31
|
+
default:
|
|
32
|
+
paths:
|
|
33
|
+
- "src/**"
|
|
34
|
+
public_api:
|
|
35
|
+
- "src/index.ts"
|
|
36
|
+
billing:
|
|
37
|
+
paths:
|
|
38
|
+
- "src/billing/**"
|
|
39
|
+
public_api:
|
|
40
|
+
- "src/billing/index.ts"
|
|
41
|
+
rules:
|
|
42
|
+
no_forbidden_layer_dependencies:
|
|
43
|
+
enabled: true
|
|
44
|
+
severity: error
|
|
45
|
+
"#,
|
|
46
|
+
);
|
|
47
|
+
repo.write("src/domain/event.ts", "export const event = 1;\n");
|
|
48
|
+
repo.write("src/infrastructure/db.ts", "export const db = 1;\n");
|
|
49
|
+
repo.write("src/billing/index.ts", "export const billing = 1;\n");
|
|
50
|
+
|
|
51
|
+
let report = validate_architecture(repo.path(), ArchitectureScanOptions::default()).unwrap();
|
|
52
|
+
let output = format_architecture_validation(&report);
|
|
53
|
+
|
|
54
|
+
assert_eq!(report.status, "pass");
|
|
55
|
+
assert_eq!(report.summary.warnings, 0);
|
|
56
|
+
assert!(report.config_findings.iter().any(|finding| {
|
|
57
|
+
finding.id == "arch.config.broad_layer_overlap"
|
|
58
|
+
&& finding.subject == "layer:application"
|
|
59
|
+
&& finding.severity == "warning"
|
|
60
|
+
}));
|
|
61
|
+
assert!(report.config_findings.iter().any(|finding| {
|
|
62
|
+
finding.id == "arch.config.catch_all_context_with_specific_contexts"
|
|
63
|
+
&& finding.subject == "context:default"
|
|
64
|
+
&& finding.severity == "warning"
|
|
65
|
+
}));
|
|
66
|
+
assert!(output.contains("configuration findings: 2"));
|
|
67
|
+
}
|
|
Binary file
|
package/native/linux-x64/naome
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pub(super) use super::completed_refresh::add_completed_task_diff_notice;
|
|
2
|
-
pub(super) use super::push_gate::{format_dirty_diff_admission_blocker, validate_push_gate};
|
|
3
|
-
pub(super) use super::repair::{
|
|
4
|
-
is_deterministic_harness_refresh_diff, is_harness_repair_diff,
|
|
5
|
-
is_install_or_upgrade_baseline_diff, is_packaged_machine_owned_path, is_repair_archive_path,
|
|
6
|
-
is_safe_harness_refresh_path,
|
|
7
|
-
};
|