@lamentis/naome 1.0.2 → 1.1.0

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.
Files changed (34) hide show
  1. package/Cargo.lock +2 -2
  2. package/README.md +8 -1
  3. package/bin/naome-node.js +3 -1
  4. package/bin/naome.js +198 -3
  5. package/crates/naome-cli/Cargo.toml +1 -1
  6. package/crates/naome-cli/src/main.rs +110 -13
  7. package/crates/naome-core/Cargo.toml +1 -1
  8. package/crates/naome-core/src/decision.rs +82 -11
  9. package/crates/naome-core/src/git.rs +12 -1
  10. package/crates/naome-core/src/harness_health.rs +3 -1
  11. package/crates/naome-core/src/install_plan.rs +4 -2
  12. package/crates/naome-core/src/intent.rs +914 -0
  13. package/crates/naome-core/src/journal.rs +169 -0
  14. package/crates/naome-core/src/lib.rs +10 -1
  15. package/crates/naome-core/src/models.rs +63 -4
  16. package/crates/naome-core/src/route.rs +1000 -0
  17. package/crates/naome-core/src/task_state.rs +326 -21
  18. package/crates/naome-core/tests/decision.rs +8 -6
  19. package/crates/naome-core/tests/install_plan.rs +9 -1
  20. package/crates/naome-core/tests/intent.rs +826 -0
  21. package/crates/naome-core/tests/route.rs +1108 -0
  22. package/crates/naome-core/tests/task_state.rs +63 -4
  23. package/native/darwin-arm64/naome +0 -0
  24. package/native/linux-x64/naome +0 -0
  25. package/package.json +1 -1
  26. package/templates/naome-root/.naome/bin/check-harness-health.js +7 -6
  27. package/templates/naome-root/.naome/bin/check-task-state.js +7 -6
  28. package/templates/naome-root/.naome/bin/naome.js +143 -13
  29. package/templates/naome-root/.naome/manifest.json +8 -7
  30. package/templates/naome-root/.naome/upgrade-state.json +1 -1
  31. package/templates/naome-root/AGENTS.md +30 -5
  32. package/templates/naome-root/docs/naome/agent-workflow.md +45 -24
  33. package/templates/naome-root/docs/naome/execution.md +55 -51
  34. package/templates/naome-root/docs/naome/index.md +10 -3
@@ -106,10 +106,10 @@ fn accepts_complete_task_with_scoped_diff_and_notice() {
106
106
  let report = validate_task_state(repo.path(), TaskStateOptions::default()).unwrap();
107
107
 
108
108
  assert!(report.errors.is_empty(), "{:#?}", report.errors);
109
- assert!(report
110
- .notices
111
- .join("\n")
112
- .contains("Next task admission is blocked"));
109
+ let notices = report.notices.join("\n");
110
+ assert!(notices.contains("Task is complete and verified"));
111
+ assert!(notices.contains("NAOME intent can baseline it automatically"));
112
+ assert!(!notices.contains("commit_task_baseline"));
113
113
  }
114
114
 
115
115
  #[test]
@@ -187,6 +187,65 @@ fn commit_gate_allows_install_baseline_with_gitignore_and_project_owned_paths()
187
187
  assert!(report.errors.is_empty(), "{:#?}", report.errors);
188
188
  }
189
189
 
190
+ #[test]
191
+ fn commit_gate_allows_staged_harness_refresh_split_from_completed_task() {
192
+ let repo = TaskFixture::new(complete_task_state(json!({
193
+ "allowedPaths": ["README.md"],
194
+ "proofResults": [successful_proof(json!({ "evidence": ["README.md"] }))]
195
+ })));
196
+ repo.install_healthy_harness();
197
+ repo.init_git();
198
+ repo.write("README.md", "# Task result\n");
199
+ repo.write("AGENTS.md", "# Agent Instructions\n\nUpdated by sync.\n");
200
+ repo.write_json(
201
+ ".naome/manifest.json",
202
+ json!({
203
+ "name": "naome",
204
+ "harnessVersion": "1.1.0",
205
+ "profile": "standard",
206
+ "machineOwned": MACHINE_OWNED_PATHS,
207
+ "projectOwned": PROJECT_OWNED_PATHS,
208
+ "integrity": {}
209
+ }),
210
+ );
211
+ repo.git(["add", "AGENTS.md", ".naome/manifest.json"]);
212
+
213
+ let report = validate_task_state(
214
+ repo.path(),
215
+ TaskStateOptions {
216
+ mode: TaskStateMode::CommitGate,
217
+ ..TaskStateOptions::default()
218
+ },
219
+ )
220
+ .unwrap();
221
+
222
+ assert!(report.errors.is_empty(), "{:#?}", report.errors);
223
+ }
224
+
225
+ #[test]
226
+ fn commit_gate_ignores_unstaged_user_edits_outside_completed_task_scope() {
227
+ let repo = TaskFixture::new(complete_task_state(json!({
228
+ "allowedPaths": ["README.md"],
229
+ "proofResults": [successful_proof(json!({ "evidence": ["README.md"] }))]
230
+ })));
231
+ repo.write("USER.md", "user baseline\n");
232
+ repo.init_git();
233
+ repo.write("README.md", "# Task result\n");
234
+ repo.write("USER.md", "user local edit\n");
235
+ repo.git(["add", "README.md", ".naome/task-state.json"]);
236
+
237
+ let report = validate_task_state(
238
+ repo.path(),
239
+ TaskStateOptions {
240
+ mode: TaskStateMode::CommitGate,
241
+ ..TaskStateOptions::default()
242
+ },
243
+ )
244
+ .unwrap();
245
+
246
+ assert!(report.errors.is_empty(), "{:#?}", report.errors);
247
+ }
248
+
190
249
  #[test]
191
250
  fn progress_accepts_implementing_task_with_scoped_diff_without_proof() {
192
251
  let repo = TaskFixture::new(json!({
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamentis/naome",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Native-first CLI for the NAOME agent harness.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,17 +9,18 @@ const nativeBinaryRelativePath = process.platform === "win32" ? ".naome/bin/naom
9
9
  const nativeBinaryName = process.platform === "win32" ? "naome.exe" : "naome";
10
10
 
11
11
  const expectedMachineOwnedIntegrity = Object.freeze({
12
- "AGENTS.md": "sha256:ebe589ce85b43d4aa23014d8a26a49bd33dc52ef1bba68e4f63a7e86640be06a",
12
+ "AGENTS.md": "sha256:84ce882fa6798a144c8c74673d4304fc6bf235b1cc417f7649eea9f7461775de",
13
13
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
14
- ".naome/bin/naome.js": "sha256:1b63729dc55730a826193d35cf78e755a991b356ac81b45f4aa3fcf24c8152fa",
14
+ ".naome/bin/naome.js": "sha256:7894690ad47700a9a5e7ecb5a94ba42c1a12e2637d2c9f41f0023b1bd8bd22b6",
15
15
  ".naome/bin/check-task-state.js": "sha256:43c02868072d0d13499aefba2e9a5ec9517d59539fd19ff0f11e3e4623a51b44",
16
16
  ".naome/bin/check-harness-health.js": "sha256:dce2a380022dd63d86bd762869debafbc635ab3d7e8fae985e2d429d8ee437ad",
17
17
  ".naome/task-contract.schema.json": "sha256:c806416d4944eaed6dc48b3760fd0dd5b9b5a7c9ab895697fe36b54c41c1332f",
18
- "docs/naome/index.md": "sha256:75c4cdf9edcd46c83a619cbfc551e96cae35bcff694d955ebab4624125ae7f12",
18
+ "docs/naome/index.md": "sha256:d04691b25ed377c2a3aa2c56965d0db276539aeadcfdd2a2ec1be7ff7706dd6f",
19
19
  "docs/naome/first-run.md": "sha256:a1dd0bd17ec9d71955a473cd2c4a615538e89a7d81e8f4e1015a50ab9efe3558",
20
- "docs/naome/agent-workflow.md": "sha256:5e5b26e7896f95a9154abcd133f08b33f84fddc679757ed15c043a91e319fb4e",
21
- "docs/naome/execution.md": "sha256:3d67fd9922a66a66f79f920adbb24dcd47eefdfde835a5351a27ffed932dcfea",
22
- "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
20
+ "docs/naome/agent-workflow.md": "sha256:43ba8a6814068e1b932b12a392de70b39841dc82df0acdaac459d6714c501b9d",
21
+ "docs/naome/execution.md": "sha256:ad66611b2878d1ba8fe05ddc4cfe9de7fd41de172a0de8295c36227a2700631a",
22
+ "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1",
23
+ ".naome/bin/naome-rust": "sha256:cc754ae59477577dfc0130cc21c286beaf3f19e2852278bb8f1e8724277eb44b"
23
24
  });
24
25
 
25
26
  function main() {
@@ -9,17 +9,18 @@ const nativeBinaryRelativePath = process.platform === "win32" ? ".naome/bin/naom
9
9
  const nativeBinaryName = process.platform === "win32" ? "naome.exe" : "naome";
10
10
 
11
11
  const expectedMachineOwnedIntegrity = Object.freeze({
12
- "AGENTS.md": "sha256:ebe589ce85b43d4aa23014d8a26a49bd33dc52ef1bba68e4f63a7e86640be06a",
12
+ "AGENTS.md": "sha256:84ce882fa6798a144c8c74673d4304fc6bf235b1cc417f7649eea9f7461775de",
13
13
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
14
- ".naome/bin/naome.js": "sha256:1b63729dc55730a826193d35cf78e755a991b356ac81b45f4aa3fcf24c8152fa",
14
+ ".naome/bin/naome.js": "sha256:7894690ad47700a9a5e7ecb5a94ba42c1a12e2637d2c9f41f0023b1bd8bd22b6",
15
15
  ".naome/bin/check-task-state.js": "sha256:43c02868072d0d13499aefba2e9a5ec9517d59539fd19ff0f11e3e4623a51b44",
16
16
  ".naome/bin/check-harness-health.js": "sha256:dce2a380022dd63d86bd762869debafbc635ab3d7e8fae985e2d429d8ee437ad",
17
17
  ".naome/task-contract.schema.json": "sha256:c806416d4944eaed6dc48b3760fd0dd5b9b5a7c9ab895697fe36b54c41c1332f",
18
- "docs/naome/index.md": "sha256:75c4cdf9edcd46c83a619cbfc551e96cae35bcff694d955ebab4624125ae7f12",
18
+ "docs/naome/index.md": "sha256:d04691b25ed377c2a3aa2c56965d0db276539aeadcfdd2a2ec1be7ff7706dd6f",
19
19
  "docs/naome/first-run.md": "sha256:a1dd0bd17ec9d71955a473cd2c4a615538e89a7d81e8f4e1015a50ab9efe3558",
20
- "docs/naome/agent-workflow.md": "sha256:5e5b26e7896f95a9154abcd133f08b33f84fddc679757ed15c043a91e319fb4e",
21
- "docs/naome/execution.md": "sha256:3d67fd9922a66a66f79f920adbb24dcd47eefdfde835a5351a27ffed932dcfea",
22
- "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
20
+ "docs/naome/agent-workflow.md": "sha256:43ba8a6814068e1b932b12a392de70b39841dc82df0acdaac459d6714c501b9d",
21
+ "docs/naome/execution.md": "sha256:ad66611b2878d1ba8fe05ddc4cfe9de7fd41de172a0de8295c36227a2700631a",
22
+ "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1",
23
+ ".naome/bin/naome-rust": "sha256:cc754ae59477577dfc0130cc21c286beaf3f19e2852278bb8f1e8724277eb44b"
23
24
  });
24
25
 
25
26
  function main(argv) {
@@ -27,7 +27,7 @@ function main(argv) {
27
27
  return;
28
28
  }
29
29
 
30
- if (command === "status" || command === "next") {
30
+ if (command === "status" || command === "next" || command === "intent" || command === "route" || command === "explain") {
31
31
  runNativeDecisionCommand(command, args);
32
32
  return;
33
33
  }
@@ -145,25 +145,92 @@ function commit(args) {
145
145
  fail("NAOME harness root not found. Run this inside a repository with .naome/task-state.json.");
146
146
  }
147
147
 
148
- const message = parseCommitMessage(args) || defaultCommitMessage(root);
148
+ const message = parseCommitMessage(args);
149
149
  const taskState = readTaskState(root);
150
150
 
151
151
  if (taskState.status !== "complete") {
152
- fail(`naome commit requires task-state status complete. Current status: ${taskState.status}.`);
152
+ const decision = readDecision(root);
153
+ if (isSetupBaselineDecision(decision)) {
154
+ commitBaseline(root, message || defaultSetupCommitMessage(decision), { taskScoped: false });
155
+ console.log(`NAOME committed ${decision.state} baseline.`);
156
+ return;
157
+ }
158
+
159
+ fail(`naome commit requires task-state status complete or a setup baseline diff. Current status: ${taskState.status}.`);
153
160
  }
154
161
 
155
- runOrExit(root, [process.execPath, [join(root, ".naome", "bin", "check-task-state.js")]]);
162
+ const commitInfo = commitBaseline(root, message || defaultTaskCommitMessage(root), { taskScoped: true });
163
+ writeTaskJournal(root, "naome_commit_baseline", commitInfo);
164
+
165
+ console.log(`NAOME committed task ${taskState.activeTask?.id || "unknown"}.`);
166
+ }
156
167
 
157
- const changedPaths = readChangedPaths(root);
168
+ function commitBaseline(root, message, options = {}) {
169
+ const changedPaths = options.taskScoped ? readTaskCommitPaths(root) : readChangedPaths(root);
158
170
  if (changedPaths.length === 0) {
159
171
  fail("Nothing to commit.");
160
172
  }
161
173
 
162
- runGitOrExit(root, ["add", "-A", "--", "."]);
174
+ const before = gitHead(root);
175
+ runGitOrExit(root, ["add", "-A", "--", ...changedPaths]);
163
176
  runOrExit(root, [process.execPath, [join(root, ".naome", "bin", "check-task-state.js"), "--commit-gate"]]);
164
177
  runGitOrExit(root, ["commit", "-m", message]);
178
+ return { before, after: gitHead(root) };
179
+ }
165
180
 
166
- console.log(`NAOME committed task ${taskState.activeTask?.id || "unknown"}.`);
181
+ function readTaskCommitPaths(root) {
182
+ const nativeBinary = resolveNativeDecisionBinary(root);
183
+ verifyNativeBinary(nativeBinary);
184
+ const result = spawnSync(nativeBinary, ["commit-paths", "--json"], {
185
+ cwd: root,
186
+ encoding: "utf8",
187
+ env: {
188
+ ...process.env,
189
+ NAOME_NODE_BIN: process.execPath
190
+ }
191
+ });
192
+ if (result.status !== 0) {
193
+ fail(`Cannot determine NAOME task commit paths: ${result.stderr.trim() || result.stdout.trim()}`);
194
+ }
195
+
196
+ try {
197
+ const paths = JSON.parse(result.stdout);
198
+ if (Array.isArray(paths) && paths.every((path) => typeof path === "string" && path.trim())) {
199
+ return paths;
200
+ }
201
+ } catch {
202
+ // Fall through to a deterministic failure.
203
+ }
204
+ fail("Cannot determine NAOME task commit paths: native output was not a path array.");
205
+ }
206
+
207
+ function writeTaskJournal(root, outcome, commitInfo) {
208
+ const nativeBinary = resolveNativeDecisionBinary(root);
209
+ verifyNativeBinary(nativeBinary);
210
+ const args = [
211
+ "journal-task",
212
+ "--outcome",
213
+ outcome,
214
+ "--json"
215
+ ];
216
+ if (commitInfo.before) {
217
+ args.push("--commit-before", commitInfo.before);
218
+ }
219
+ if (commitInfo.after) {
220
+ args.push("--commit-after", commitInfo.after);
221
+ }
222
+
223
+ const result = spawnSync(nativeBinary, args, {
224
+ cwd: root,
225
+ encoding: "utf8",
226
+ env: {
227
+ ...process.env,
228
+ NAOME_NODE_BIN: process.execPath
229
+ }
230
+ });
231
+ if (result.status !== 0) {
232
+ fail(`Cannot write NAOME task journal: ${result.stderr.trim() || result.stdout.trim()}`);
233
+ }
167
234
  }
168
235
 
169
236
  function parseCommitMessage(args) {
@@ -181,12 +248,48 @@ function parseCommitMessage(args) {
181
248
  return null;
182
249
  }
183
250
 
184
- function defaultCommitMessage(root) {
251
+ function defaultTaskCommitMessage(root) {
185
252
  const taskState = readTaskState(root);
186
253
  const taskId = taskState.activeTask?.id || "task";
187
254
  return `chore(naome): baseline ${taskId}`;
188
255
  }
189
256
 
257
+ function defaultSetupCommitMessage(decision) {
258
+ return decision.state === "harness_repair_unbaselined"
259
+ ? "chore(naome): baseline harness repair"
260
+ : "chore(naome): baseline setup";
261
+ }
262
+
263
+ function readDecision(root) {
264
+ const nativeBinary = resolveNativeDecisionBinary(root);
265
+ verifyNativeBinary(nativeBinary);
266
+ const result = spawnSync(nativeBinary, ["status", "--json"], {
267
+ cwd: root,
268
+ encoding: "utf8",
269
+ env: {
270
+ ...process.env,
271
+ NAOME_NODE_BIN: process.execPath
272
+ }
273
+ });
274
+
275
+ if (result.status !== 0) {
276
+ fail(`Cannot read NAOME status: ${result.stderr.trim() || result.stdout.trim()}`);
277
+ }
278
+
279
+ try {
280
+ return JSON.parse(result.stdout);
281
+ } catch (error) {
282
+ fail(`Cannot parse NAOME status: ${error.message}`);
283
+ }
284
+ }
285
+
286
+ function isSetupBaselineDecision(decision) {
287
+ return decision && (
288
+ decision.state === "install_or_upgrade_unbaselined" ||
289
+ decision.state === "harness_repair_unbaselined"
290
+ );
291
+ }
292
+
190
293
  function readTaskState(root) {
191
294
  const taskStatePath = join(root, ".naome", "task-state.json");
192
295
  try {
@@ -197,12 +300,25 @@ function readTaskState(root) {
197
300
  }
198
301
 
199
302
  function readChangedPaths(root) {
200
- const result = runGit(root, ["status", "--porcelain"]);
201
- if (result.status !== 0) {
202
- fail(`git status failed: ${result.stderr.trim() || result.stdout.trim()}`);
303
+ const paths = new Set();
304
+ for (const args of [
305
+ ["diff", "--name-only", "-z"],
306
+ ["diff", "--name-only", "--cached", "-z"],
307
+ ["ls-files", "--others", "--exclude-standard", "-z"]
308
+ ]) {
309
+ const result = runGit(root, args);
310
+ if (result.status !== 0) {
311
+ fail(`git ${args.join(" ")} failed: ${result.stderr.trim() || result.stdout.trim()}`);
312
+ }
313
+ for (const path of result.stdout.split("\0")) {
314
+ const normalized = path.trim();
315
+ if (normalized) {
316
+ paths.add(normalized);
317
+ }
318
+ }
203
319
  }
204
320
 
205
- return result.stdout.split(/\r?\n/).filter((line) => line.trim().length > 0);
321
+ return Array.from(paths).sort();
206
322
  }
207
323
 
208
324
  function runOrExit(root, command) {
@@ -233,6 +349,14 @@ function runGit(root, args, options = {}) {
233
349
  });
234
350
  }
235
351
 
352
+ function gitHead(root) {
353
+ const result = runGit(root, ["rev-parse", "HEAD"]);
354
+ if (result.status !== 0) {
355
+ return null;
356
+ }
357
+ return result.stdout.trim();
358
+ }
359
+
236
360
  function findHarnessRoot(startPath) {
237
361
  let current = resolve(startPath);
238
362
 
@@ -254,6 +378,12 @@ function printHelp() {
254
378
  console.log("Usage:");
255
379
  console.log(" naome status [--json]");
256
380
  console.log(" naome next [--json]");
381
+ console.log(" naome intent --prompt-file <path> [--json]");
382
+ console.log(" naome intent --prompt <text> [--json]");
383
+ console.log(" naome route --prompt-file <path> [--execute] [--json]");
384
+ console.log(" naome route --prompt <text> [--execute] [--json]");
385
+ console.log(" naome explain --prompt-file <path> [--json]");
386
+ console.log(" naome explain --prompt <text> [--json]");
257
387
  console.log(" naome install");
258
388
  console.log(" naome sync");
259
389
  console.log(" naome commit -m \"type(scope): message\"");
@@ -290,7 +420,7 @@ function installOrSync(command, args) {
290
420
  process.exit(result.status === null ? 1 : result.status);
291
421
  }
292
422
 
293
- const result = spawnSync("npm", ["create", "naome"], {
423
+ const result = spawnSync("npm", ["exec", "--yes", "@lamentis/naome", "--", command, ...args], {
294
424
  cwd: root,
295
425
  encoding: "utf8",
296
426
  stdio: "inherit"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naome",
3
- "harnessVersion": "1.0.2",
3
+ "harnessVersion": "1.1.0",
4
4
  "profile": "standard",
5
5
  "installedAt": null,
6
6
  "machineOwned": [
@@ -30,16 +30,17 @@
30
30
  "docs/naome/testing.md"
31
31
  ],
32
32
  "integrity": {
33
- "AGENTS.md": "sha256:ebe589ce85b43d4aa23014d8a26a49bd33dc52ef1bba68e4f63a7e86640be06a",
33
+ "AGENTS.md": "sha256:84ce882fa6798a144c8c74673d4304fc6bf235b1cc417f7649eea9f7461775de",
34
34
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
35
- ".naome/bin/naome.js": "sha256:1b63729dc55730a826193d35cf78e755a991b356ac81b45f4aa3fcf24c8152fa",
35
+ ".naome/bin/naome.js": "sha256:7894690ad47700a9a5e7ecb5a94ba42c1a12e2637d2c9f41f0023b1bd8bd22b6",
36
36
  ".naome/bin/check-task-state.js": "sha256:43c02868072d0d13499aefba2e9a5ec9517d59539fd19ff0f11e3e4623a51b44",
37
37
  ".naome/bin/check-harness-health.js": "sha256:dce2a380022dd63d86bd762869debafbc635ab3d7e8fae985e2d429d8ee437ad",
38
38
  ".naome/task-contract.schema.json": "sha256:c806416d4944eaed6dc48b3760fd0dd5b9b5a7c9ab895697fe36b54c41c1332f",
39
- "docs/naome/index.md": "sha256:75c4cdf9edcd46c83a619cbfc551e96cae35bcff694d955ebab4624125ae7f12",
39
+ "docs/naome/index.md": "sha256:d04691b25ed377c2a3aa2c56965d0db276539aeadcfdd2a2ec1be7ff7706dd6f",
40
40
  "docs/naome/first-run.md": "sha256:a1dd0bd17ec9d71955a473cd2c4a615538e89a7d81e8f4e1015a50ab9efe3558",
41
- "docs/naome/agent-workflow.md": "sha256:5e5b26e7896f95a9154abcd133f08b33f84fddc679757ed15c043a91e319fb4e",
42
- "docs/naome/execution.md": "sha256:3d67fd9922a66a66f79f920adbb24dcd47eefdfde835a5351a27ffed932dcfea",
43
- "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
41
+ "docs/naome/agent-workflow.md": "sha256:43ba8a6814068e1b932b12a392de70b39841dc82df0acdaac459d6714c501b9d",
42
+ "docs/naome/execution.md": "sha256:ad66611b2878d1ba8fe05ddc4cfe9de7fd41de172a0de8295c36227a2700631a",
43
+ "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1",
44
+ ".naome/bin/naome-rust": "sha256:cc754ae59477577dfc0130cc21c286beaf3f19e2852278bb8f1e8724277eb44b"
44
45
  }
45
46
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "status": "complete",
3
3
  "fromVersion": null,
4
- "toVersion": "1.0.2",
4
+ "toVersion": "1.1.0",
5
5
  "pending": [],
6
6
  "completed": []
7
7
  }
@@ -8,16 +8,16 @@ This repository uses NAOME as its coding-agent harness.
8
8
  2. Do not read any file or directory matched by `.naomeignore`.
9
9
  3. If `docs/naome/index.md` or `.naome/bin/check-harness-health.js` is missing,
10
10
  do not begin feature work. Install the NAOME CLI with
11
- `npm install -g @lamentis/naome`, then run `naome sync` from the repository root. Then
12
- restart this list.
11
+ `npm install -g @lamentis/naome`, then run `naome sync --check-update`
12
+ from the repository root. Then restart this list.
13
13
  4. Read `docs/naome/index.md`.
14
14
  5. Read `.naome/init-state.json`.
15
15
  6. Read `.naome/task-state.json`.
16
16
  7. Read `.naome/upgrade-state.json`.
17
17
  8. Run `node .naome/bin/check-harness-health.js`.
18
18
  9. If harness health fails, do not begin feature work. Repair the machine-owned
19
- harness files with `naome sync`, or ask the user for one of the listed
20
- repair decisions.
19
+ harness files with `naome update` followed by `naome sync`, or ask the user
20
+ for one of the listed repair decisions.
21
21
  10. If upgrade status is `needs_agent_upgrade`, do not begin feature work. Run
22
22
  or continue `docs/naome/upgrade.md`.
23
23
  11. If `initialized` is `false`, do not begin feature work. Run or continue the
@@ -30,15 +30,40 @@ This repository uses NAOME as its coding-agent harness.
30
30
  ## Core Rules
31
31
 
32
32
  - Prefer discovered repository facts over assumptions.
33
+ - Do not look for generic root steering files such as `ARCHITECTURE.md` or
34
+ `docs/index.md` unless this repository's NAOME docs explicitly name them.
35
+ NAOME's default architecture and index files are
36
+ `docs/naome/architecture.md` and `docs/naome/index.md`.
33
37
  - Record only facts from this target repository or from the user. Do not import
34
38
  parent-workspace, outer-agent, chat, or unrelated repository instructions into
35
39
  this repository's NAOME docs.
36
40
  - Keep changes small and task-focused.
37
41
  - Read only the NAOME docs relevant to the current task.
38
42
  - Run Harness Health before Task Admission.
43
+ - For natural-language work requests, prefer
44
+ `naome route --prompt-file <path> --execute --json` and follow its
45
+ `userMessage`, `humanOptions`, `requiredContext`, `taskRoot`, `worktree`, and
46
+ `canCreateTask` fields. If `taskRoot` differs from the current directory,
47
+ continue the task in `taskRoot`; the original worktree contains unrelated user
48
+ edits that must remain untouched. Pure deterministic harness refresh diffs
49
+ are baselined in the current worktree before task creation; they must not
50
+ create repair-loop task worktrees. Use `naome explain --prompt-file <path>
51
+ --json` only for debugging policy.
52
+ - If route blocks or performs no mutation, do not fall back to raw `git commit`,
53
+ IDE commit, `git add`, or hook bypass commands. Only execute a commit when
54
+ NAOME route/commit performs it successfully or the user takes manual Git
55
+ ownership outside the agent task.
56
+ - If the user explicitly asks to commit their own unowned changes, use NAOME
57
+ route so the configured quality gate runs first. NAOME commits only the exact
58
+ paths it evaluated, requires committed verification coverage for every path,
59
+ and rechecks the final stabilized diff before creating the commit.
60
+ - Repair requests may baseline deterministic harness refresh files, but they
61
+ must leave unrelated user edits untouched unless the user explicitly takes
62
+ manual Git ownership.
39
63
  - Machine-owned NAOME command shims, schemas, workflow docs, archives, and
40
64
  native binaries may be local-only ignored files. Missing local-only files are
41
- repaired with `naome sync`; they are not project context.
65
+ repaired with `naome update` followed by `naome sync`; they are not project
66
+ context.
42
67
  - Enforce Task Admission before accepting new feature work.
43
68
  - Do not start feature work while the git diff contains setup, upgrade,
44
69
  previous-task, or other unowned changes.
@@ -5,29 +5,44 @@ Use this workflow after first-run intake is complete.
5
5
  ## Before Editing
6
6
 
7
7
  1. Read `.naome/task-state.json` and `execution.md`.
8
- 2. Run `node .naome/bin/naome.js status` and use its allowed actions as the
9
- current machine-generated decision.
10
- 3. Run `node .naome/bin/check-harness-health.js`.
11
- 4. If harness health fails, do not start new feature work. Ask the user to
8
+ 2. For a natural-language user request, prefer
9
+ `node .naome/bin/naome.js route --prompt-file <path> --execute --json`.
10
+ Use its `userMessage`, `humanOptions`, `requiredContext`, and
11
+ `canCreateTask` fields instead of inventing routing or final-response text.
12
+ If route returns a `taskRoot` different from the current directory, continue
13
+ the task from that path and leave the original worktree untouched.
14
+ 3. Use `node .naome/bin/naome.js explain --prompt-file <path> --json` only when
15
+ debugging why a policy won.
16
+ 4. Run `node .naome/bin/naome.js status --json` when reporting state without
17
+ routing a new request.
18
+ 5. Run `node .naome/bin/check-harness-health.js`.
19
+ 6. If harness health fails, do not start new feature work. Ask the user to
12
20
  choose `repair_harness`, `review_harness_diff`, or
13
21
  `cancel_repair_baseline`.
14
- 5. Run `node .naome/bin/check-task-state.js --admission`.
15
- 6. If task admission fails, do not start new feature work.
16
- When the block is completed NAOME install or upgrade changes, ask the user
17
- to choose `commit_upgrade_baseline`, `review_diff_first`, or
18
- `cancel_upgrade_baseline`.
19
- When the block is a completed task diff, ask the user to choose
20
- `commit_task_baseline`, `review_task_diff`, `request_task_changes`, or
21
- `cancel_task_changes`.
22
- 7. Record the passed admission check in `.naome/task-state.json` when starting
22
+ 7. Run `node .naome/bin/check-task-state.js --admission`.
23
+ 8. If task admission fails for a natural-language work request, use
24
+ `naome route --execute --json`. Route may baseline valid completed setup or
25
+ task diffs, create an isolated task worktree around unrelated user edits,
26
+ baseline pure harness refreshes in the current worktree, and rerun
27
+ admission. Ask the user only when `humanOptions` is non-empty,
28
+ route blocks as unsafe/ambiguous, or automatic baselining fails.
29
+ 9. If route blocks or returns no mutation, do not use raw `git commit`, IDE
30
+ commit, `git add`, or hook bypass commands as a fallback. Unowned changes
31
+ are user-owned unless NAOME route explicitly isolates around them or
32
+ baselines a deterministic harness/task diff. If the user explicitly asks to
33
+ commit their own unowned changes, route must run the configured quality gate
34
+ first, require committed verification coverage for every path, and commit
35
+ only the final stabilized paths it evaluated.
36
+ 10. Record the passed admission check in `.naome/task-state.json` when starting
23
37
  the task.
24
- 8. Restate the task in concrete terms.
25
- 9. Read `.naomeignore`.
26
- 10. Exclude every path matched by `.naomeignore` from context gathering.
27
- 11. Read the task-relevant NAOME docs.
28
- 12. Inspect the existing code or docs before proposing changes.
29
- 13. Read `testing.md` and `.naome/verification.json`.
30
- 14. Identify the required proof before claiming success.
38
+ 11. Restate the task in concrete terms.
39
+ 12. Read `.naomeignore`.
40
+ 13. Exclude every path matched by `.naomeignore` from context gathering.
41
+ 14. Read only the `requiredContext` returned by route/status plus the smallest
42
+ task-relevant NAOME docs.
43
+ 15. Inspect the existing code or docs before proposing changes.
44
+ 16. Read `testing.md` and `.naome/verification.json`.
45
+ 17. Identify the required proof before claiming success.
31
46
 
32
47
  ## Instruction Boundaries
33
48
 
@@ -62,19 +77,25 @@ Use this workflow after first-run intake is complete.
62
77
  5. Do not list `.naome/task-state.json` as task scope or proof evidence.
63
78
  6. Set task state to `complete`.
64
79
  7. Run `node .naome/bin/check-task-state.js`.
65
- 8. If the task-state check prints a next-task admission notice, report it to
66
- the user with the exact listed options.
80
+ 8. If the task-state check prints a next-task admission notice, do not repeat
81
+ internal baseline options in the final response. Use the machine-generated
82
+ `userMessage` from route/status and mention `humanOptions` only when that
83
+ array is non-empty.
67
84
  9. If no rule matches or the task check fails, report the gap and ask for human
68
85
  review before claiming completion.
69
86
  10. Report changed files, exact commands, results, and remaining risk.
70
- 11. Do not say there are no open gaps while the completed task diff still needs
71
- a user baseline decision.
87
+ 11. Only ask the user for options when intent blocks, the user explicitly asks
88
+ to review/revise/cancel, or automatic baselining fails.
72
89
 
73
90
  ## Commit And Push
74
91
 
75
92
  - Prefer `naome commit -m "type(scope): summary"` for task baselines.
76
93
  - If `naome` is not on `PATH`, run
77
94
  `node .naome/bin/naome.js commit -m "type(scope): summary"`.
95
+ - Never treat a blocked NAOME route as permission to run plain `git commit`.
96
+ A commit fallback is valid only when NAOME itself executed it successfully or
97
+ when the user explicitly leaves NAOME automation and owns the manual Git
98
+ action.
78
99
  - Manual `git commit` and IDE commits are guarded by local `.git/hooks` shims,
79
100
  but agents must still reconcile Git state because hooks can be bypassed.
80
101
  - If a user already committed the diff, compare current `HEAD`, task proof, and