@lamentis/naome 1.3.1 → 1.3.3
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-core/Cargo.toml +1 -1
- package/crates/naome-core/src/intent/resolver_catalog/active.rs +38 -0
- package/crates/naome-core/src/intent/resolver_catalog/baseline.rs +44 -0
- package/crates/naome-core/src/intent/resolver_catalog/completed.rs +56 -0
- package/crates/naome-core/src/intent/resolver_catalog/dirty.rs +32 -0
- package/crates/naome-core/src/intent/resolver_catalog/ready.rs +32 -0
- package/crates/naome-core/src/intent/resolver_catalog/system.rs +20 -0
- package/crates/naome-core/src/intent/resolver_catalog.rs +12 -166
- package/crates/naome-core/src/lib.rs +1 -0
- package/crates/naome-core/src/route/quality_gate_config.rs +18 -0
- package/crates/naome-core/src/task_state/diff.rs +2 -2
- package/crates/naome-core/src/task_state/git_io.rs +5 -2
- package/crates/naome-core/src/task_state/types.rs +4 -0
- package/crates/naome-core/src/verification_contract.rs +3 -1
- package/crates/naome-core/src/verification_contract_policy.rs +52 -0
- package/crates/naome-core/tests/harness_health.rs +29 -40
- package/crates/naome-core/tests/repo_support/mod.rs +5 -2
- package/crates/naome-core/tests/repo_support/verification.rs +28 -42
- package/crates/naome-core/tests/repo_support/verification_values.rs +106 -1
- package/crates/naome-core/tests/route_user_diff.rs +52 -4
- package/crates/naome-core/tests/task_state.rs +12 -26
- package/crates/naome-core/tests/task_state_support/mod.rs +2 -1
- package/crates/naome-core/tests/task_state_support/states.rs +28 -11
- package/crates/naome-core/tests/verification.rs +2 -20
- package/crates/naome-core/tests/verification_contract.rs +42 -52
- package/crates/naome-core/tests/workflow_integrity.rs +2 -20
- package/crates/naome-core/tests/workflow_support/mod.rs +59 -20
- package/native/darwin-arm64/naome +0 -0
- package/native/linux-x64/naome +0 -0
- package/package.json +1 -1
- package/templates/naome-root/.naome/bin/check-harness-health.js +1 -1
- package/templates/naome-root/.naome/bin/check-task-state.js +1 -1
- package/templates/naome-root/.naome/manifest.json +1 -1
- package/templates/naome-root/docs/naome/first-run.md +1 -1
- package/templates/naome-root/docs/naome/testing.md +1 -1
|
@@ -3,7 +3,10 @@ use serde_json::json;
|
|
|
3
3
|
|
|
4
4
|
mod repo_support;
|
|
5
5
|
|
|
6
|
-
use repo_support::{
|
|
6
|
+
use repo_support::{
|
|
7
|
+
change_type, check_missing_last_verified_fixture, diff_check,
|
|
8
|
+
placeholder_verification_contract_fixture, quality_check, verification_value, TestRepo,
|
|
9
|
+
};
|
|
7
10
|
|
|
8
11
|
#[test]
|
|
9
12
|
fn accepts_valid_contract_and_testing_map() {
|
|
@@ -39,35 +42,7 @@ fn rejects_missing_check_references_and_ready_placeholders() {
|
|
|
39
42
|
repo.write_testing_markdown(default_testing_markdown());
|
|
40
43
|
repo.write_naome_json(
|
|
41
44
|
"verification.json",
|
|
42
|
-
|
|
43
|
-
"schema": "naome.verification.v1",
|
|
44
|
-
"version": 1,
|
|
45
|
-
"status": "ready",
|
|
46
|
-
"lastUpdated": "2026-05-05",
|
|
47
|
-
"checks": [
|
|
48
|
-
{
|
|
49
|
-
"id": "example-check",
|
|
50
|
-
"command": "replace with real command",
|
|
51
|
-
"cwd": ".",
|
|
52
|
-
"purpose": "Replace with what this proves.",
|
|
53
|
-
"cost": "fast",
|
|
54
|
-
"source": "replace with evidence source",
|
|
55
|
-
"evidence": [],
|
|
56
|
-
"lastVerified": null
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"changeTypes": [
|
|
60
|
-
{
|
|
61
|
-
"id": "docs",
|
|
62
|
-
"description": "Documentation changes.",
|
|
63
|
-
"paths": ["docs/**"],
|
|
64
|
-
"requiredChecks": ["missing-check"],
|
|
65
|
-
"recommendedChecks": [],
|
|
66
|
-
"humanReview": false
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"releaseGates": []
|
|
70
|
-
}),
|
|
45
|
+
placeholder_verification_contract_fixture(),
|
|
71
46
|
);
|
|
72
47
|
|
|
73
48
|
let errors = validate_verification_contract(repo.path()).unwrap();
|
|
@@ -77,32 +52,47 @@ fn rejects_missing_check_references_and_ready_placeholders() {
|
|
|
77
52
|
assert!(joined.contains("must not contain example placeholders"));
|
|
78
53
|
}
|
|
79
54
|
|
|
55
|
+
#[test]
|
|
56
|
+
fn rejects_repository_quality_without_semantic_required_check() {
|
|
57
|
+
let repo = TestRepo::new("verification-contract-semantic-required");
|
|
58
|
+
repo.write_testing_markdown(default_testing_markdown());
|
|
59
|
+
repo.write_naome_json("verification.json", {
|
|
60
|
+
let mut value = verification_value(
|
|
61
|
+
"ready",
|
|
62
|
+
vec![quality_check(
|
|
63
|
+
"repository-quality-check",
|
|
64
|
+
"node .naome/bin/naome.js quality check --changed",
|
|
65
|
+
"Validate changed files against repository quality rules.",
|
|
66
|
+
"fast",
|
|
67
|
+
vec![".naome/repository-quality.json"],
|
|
68
|
+
)],
|
|
69
|
+
vec![change_type(
|
|
70
|
+
"code",
|
|
71
|
+
"Code changes.",
|
|
72
|
+
vec!["src/**"],
|
|
73
|
+
vec!["repository-quality-check"],
|
|
74
|
+
)],
|
|
75
|
+
);
|
|
76
|
+
value["lastUpdated"] = json!("2026-05-11");
|
|
77
|
+
value["releaseGates"] = json!([{
|
|
78
|
+
"checkId": "repository-quality-check",
|
|
79
|
+
"requiredWhen": "Before release."
|
|
80
|
+
}]);
|
|
81
|
+
value
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
let errors = validate_verification_contract(repo.path()).unwrap();
|
|
85
|
+
let joined = errors.join("\n");
|
|
86
|
+
|
|
87
|
+
assert!(joined.contains("repository-semantic-check"));
|
|
88
|
+
assert!(joined.contains("changeTypes[0].requiredChecks"));
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
#[test]
|
|
81
92
|
fn rejects_checks_without_explicit_last_verified_value() {
|
|
82
93
|
let repo = TestRepo::new("verification-contract-last-verified");
|
|
83
94
|
repo.write_testing_markdown(default_testing_markdown());
|
|
84
|
-
repo.write_naome_json(
|
|
85
|
-
"verification.json",
|
|
86
|
-
json!({
|
|
87
|
-
"schema": "naome.verification.v1",
|
|
88
|
-
"version": 1,
|
|
89
|
-
"status": "uninitialized",
|
|
90
|
-
"lastUpdated": null,
|
|
91
|
-
"checks": [
|
|
92
|
-
{
|
|
93
|
-
"id": "diff-check",
|
|
94
|
-
"command": "git diff --check",
|
|
95
|
-
"cwd": ".",
|
|
96
|
-
"purpose": "Reject whitespace errors.",
|
|
97
|
-
"cost": "fast",
|
|
98
|
-
"source": "git",
|
|
99
|
-
"evidence": []
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"changeTypes": [],
|
|
103
|
-
"releaseGates": []
|
|
104
|
-
}),
|
|
105
|
-
);
|
|
95
|
+
repo.write_naome_json("verification.json", check_missing_last_verified_fixture());
|
|
106
96
|
|
|
107
97
|
let errors = validate_verification_contract(repo.path()).unwrap();
|
|
108
98
|
let joined = errors.join("\n");
|
|
@@ -5,8 +5,7 @@ use std::fs;
|
|
|
5
5
|
use naome_core::{
|
|
6
6
|
refresh_integrity, summarize_command_output, verification_phase_plan, CommandCheckResult,
|
|
7
7
|
};
|
|
8
|
-
use
|
|
9
|
-
use workflow_support::{check, phase, WorkflowFixture};
|
|
8
|
+
use workflow_support::{phased_verification_fixture, WorkflowFixture};
|
|
10
9
|
|
|
11
10
|
#[test]
|
|
12
11
|
fn refresh_integrity_is_idempotent_and_repairs_manifest_hash() {
|
|
@@ -29,24 +28,7 @@ fn refresh_integrity_is_idempotent_and_repairs_manifest_hash() {
|
|
|
29
28
|
#[test]
|
|
30
29
|
fn failed_early_phase_withholds_expensive_recommendations() {
|
|
31
30
|
let repo = WorkflowFixture::new("verification-phases");
|
|
32
|
-
repo.write_verification(
|
|
33
|
-
"schema": "naome.verification.v1",
|
|
34
|
-
"version": 1,
|
|
35
|
-
"status": "ready",
|
|
36
|
-
"lastUpdated": "2026-05-07",
|
|
37
|
-
"checks": [
|
|
38
|
-
check("naome-harness-health", "node .naome/bin/check-harness-health.js", "fast"),
|
|
39
|
-
check("repository-quality-check", "node .naome/bin/naome.js quality check --changed", "fast"),
|
|
40
|
-
check("package-dry-run", "npm run pack:dry-run", "medium")
|
|
41
|
-
],
|
|
42
|
-
"phases": [
|
|
43
|
-
phase("shape-health", 10, ["naome-harness-health"]),
|
|
44
|
-
phase("quality", 20, ["repository-quality-check"]),
|
|
45
|
-
phase("package-release", 50, ["package-dry-run"])
|
|
46
|
-
],
|
|
47
|
-
"changeTypes": [],
|
|
48
|
-
"releaseGates": []
|
|
49
|
-
}));
|
|
31
|
+
repo.write_verification(phased_verification_fixture());
|
|
50
32
|
|
|
51
33
|
let plan = verification_phase_plan(
|
|
52
34
|
repo.path(),
|
|
@@ -80,17 +80,10 @@ impl WorkflowFixture {
|
|
|
80
80
|
checks,
|
|
81
81
|
git_text(&self.root, &["rev-parse", "HEAD"]),
|
|
82
82
|
);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"version": 2,
|
|
88
|
-
"status": status,
|
|
89
|
-
"activeTask": active_task,
|
|
90
|
-
"blocker": null,
|
|
91
|
-
"updatedAt": "2026-05-07T12:00:00.000Z"
|
|
92
|
-
})),
|
|
93
|
-
);
|
|
83
|
+
let mut task_state = task_state_template_fixture();
|
|
84
|
+
task_state["status"] = json!(status);
|
|
85
|
+
task_state["activeTask"] = active_task;
|
|
86
|
+
self.write(".naome/task-state.json", &pretty(task_state));
|
|
94
87
|
}
|
|
95
88
|
|
|
96
89
|
pub fn write_verification(&self, value: serde_json::Value) {
|
|
@@ -113,15 +106,32 @@ impl Drop for WorkflowFixture {
|
|
|
113
106
|
}
|
|
114
107
|
|
|
115
108
|
pub fn default_verification() -> serde_json::Value {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
let mut value = verification_template_fixture();
|
|
110
|
+
value["checks"] = json!([check("diff-check", "git diff --check", "fast")]);
|
|
111
|
+
value
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
pub fn phased_verification_fixture() -> serde_json::Value {
|
|
115
|
+
let mut value = verification_template_fixture();
|
|
116
|
+
value["checks"] = json!([
|
|
117
|
+
check(
|
|
118
|
+
"naome-harness-health",
|
|
119
|
+
"node .naome/bin/check-harness-health.js",
|
|
120
|
+
"fast"
|
|
121
|
+
),
|
|
122
|
+
check(
|
|
123
|
+
"repository-quality-check",
|
|
124
|
+
"node .naome/bin/naome.js quality check --changed",
|
|
125
|
+
"fast"
|
|
126
|
+
),
|
|
127
|
+
check("package-dry-run", "npm run pack:dry-run", "medium")
|
|
128
|
+
]);
|
|
129
|
+
value["phases"] = json!([
|
|
130
|
+
phase("shape-health", 10, ["naome-harness-health"]),
|
|
131
|
+
phase("quality", 20, ["repository-quality-check"]),
|
|
132
|
+
phase("package-release", 50, ["package-dry-run"])
|
|
133
|
+
]);
|
|
134
|
+
value
|
|
125
135
|
}
|
|
126
136
|
|
|
127
137
|
pub fn check(id: &str, command: &str, cost: &str) -> serde_json::Value {
|
|
@@ -159,6 +169,35 @@ fn active_task_state(
|
|
|
159
169
|
})
|
|
160
170
|
}
|
|
161
171
|
|
|
172
|
+
fn task_state_template_fixture() -> serde_json::Value {
|
|
173
|
+
serde_json::from_str(
|
|
174
|
+
r#"{
|
|
175
|
+
"schema": "naome.task-state.v2",
|
|
176
|
+
"version": 2,
|
|
177
|
+
"status": null,
|
|
178
|
+
"activeTask": null,
|
|
179
|
+
"blocker": null,
|
|
180
|
+
"updatedAt": "2026-05-07T12:00:00.000Z"
|
|
181
|
+
}"#,
|
|
182
|
+
)
|
|
183
|
+
.unwrap()
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
fn verification_template_fixture() -> serde_json::Value {
|
|
187
|
+
serde_json::from_str(
|
|
188
|
+
r#"{
|
|
189
|
+
"schema": "naome.verification.v1",
|
|
190
|
+
"version": 1,
|
|
191
|
+
"status": "ready",
|
|
192
|
+
"lastUpdated": "2026-05-07",
|
|
193
|
+
"checks": [],
|
|
194
|
+
"changeTypes": [],
|
|
195
|
+
"releaseGates": []
|
|
196
|
+
}"#,
|
|
197
|
+
)
|
|
198
|
+
.unwrap()
|
|
199
|
+
}
|
|
200
|
+
|
|
162
201
|
fn admission_record(git_head: String) -> serde_json::Value {
|
|
163
202
|
json!({
|
|
164
203
|
"command": "node .naome/bin/check-task-state.js --admission",
|
|
Binary file
|
package/native/linux-x64/naome
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const expectedMachineOwnedIntegrity = Object.freeze({
|
|
|
18
18
|
"docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
|
|
19
19
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
20
20
|
"docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
|
|
21
|
-
"docs/naome/first-run.md": "sha256:
|
|
21
|
+
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
22
22
|
"docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
|
|
23
23
|
"docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
|
|
24
24
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
@@ -18,7 +18,7 @@ const expectedMachineOwnedIntegrity = Object.freeze({
|
|
|
18
18
|
"docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
|
|
19
19
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
20
20
|
"docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
|
|
21
|
-
"docs/naome/first-run.md": "sha256:
|
|
21
|
+
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
22
22
|
"docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
|
|
23
23
|
"docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
|
|
24
24
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
|
|
12
12
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
13
13
|
"docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
|
|
14
|
-
"docs/naome/first-run.md": "sha256:
|
|
14
|
+
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
15
15
|
"docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
|
|
16
16
|
"docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
|
|
17
17
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
@@ -102,7 +102,7 @@ Rules:
|
|
|
102
102
|
real check.
|
|
103
103
|
- This JSON is machine state, not prose context. It is exempt from the
|
|
104
104
|
200-line instruction-file budget, but must stay bounded: at most 20 checks, 12
|
|
105
|
-
change types, and
|
|
105
|
+
change types, and 12 release gates.
|
|
106
106
|
- Do not read `.naome/verification.json` as long-form context during normal
|
|
107
107
|
work. Select the relevant change type or check id, then read only the matching
|
|
108
108
|
entries needed for proof.
|
|
@@ -67,7 +67,7 @@ phase is failing or missing.
|
|
|
67
67
|
- Use dates as `YYYY-MM-DD` or `null`.
|
|
68
68
|
- Keep instruction files under 200 lines. `.naome/verification.json` is machine
|
|
69
69
|
state instead; keep it schema-valid and bounded to 20 checks, 12 change types,
|
|
70
|
-
and
|
|
70
|
+
and 12 release gates.
|
|
71
71
|
- Store long command output as a compact summary that preserves command, cwd,
|
|
72
72
|
exit code, relevant lines, affected paths, and artifacts.
|
|
73
73
|
- When intake defines change types, include `repository-quality-check` and
|