@lamentis/naome 1.1.2 → 1.2.1

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 (204) hide show
  1. package/Cargo.lock +2 -2
  2. package/Cargo.toml +1 -1
  3. package/LICENSE +180 -21
  4. package/README.md +49 -6
  5. package/bin/naome-node.js +2 -1579
  6. package/bin/naome.js +68 -16
  7. package/crates/naome-cli/Cargo.toml +1 -1
  8. package/crates/naome-cli/src/check_commands.rs +135 -0
  9. package/crates/naome-cli/src/cli_args.rs +5 -0
  10. package/crates/naome-cli/src/dispatcher.rs +37 -0
  11. package/crates/naome-cli/src/install_bridge.rs +83 -0
  12. package/crates/naome-cli/src/main.rs +60 -341
  13. package/crates/naome-cli/src/prompt_commands.rs +68 -0
  14. package/crates/naome-cli/src/quality_commands.rs +229 -0
  15. package/crates/naome-cli/src/simple_commands.rs +53 -0
  16. package/crates/naome-cli/src/workflow_commands.rs +153 -0
  17. package/crates/naome-core/Cargo.toml +1 -1
  18. package/crates/naome-core/src/decision/checks.rs +64 -0
  19. package/crates/naome-core/src/decision/idle.rs +67 -0
  20. package/crates/naome-core/src/decision/json.rs +36 -0
  21. package/crates/naome-core/src/decision/states.rs +165 -0
  22. package/crates/naome-core/src/decision.rs +131 -353
  23. package/crates/naome-core/src/harness_health/integrity.rs +96 -0
  24. package/crates/naome-core/src/harness_health.rs +14 -126
  25. package/crates/naome-core/src/install_plan.rs +5 -0
  26. package/crates/naome-core/src/intent/classifier.rs +171 -0
  27. package/crates/naome-core/src/intent/envelope.rs +108 -0
  28. package/crates/naome-core/src/intent/legacy.rs +138 -0
  29. package/crates/naome-core/src/intent/legacy_response.rs +76 -0
  30. package/crates/naome-core/src/intent/model.rs +71 -0
  31. package/crates/naome-core/src/intent/patterns.rs +170 -0
  32. package/crates/naome-core/src/intent/resolver.rs +162 -0
  33. package/crates/naome-core/src/intent/resolver_active.rs +17 -0
  34. package/crates/naome-core/src/intent/resolver_baseline.rs +55 -0
  35. package/crates/naome-core/src/intent/resolver_catalog.rs +167 -0
  36. package/crates/naome-core/src/intent/resolver_policy.rs +72 -0
  37. package/crates/naome-core/src/intent/resolver_shared.rs +55 -0
  38. package/crates/naome-core/src/intent/risk.rs +40 -0
  39. package/crates/naome-core/src/intent/segment.rs +170 -0
  40. package/crates/naome-core/src/intent.rs +64 -879
  41. package/crates/naome-core/src/journal.rs +9 -20
  42. package/crates/naome-core/src/lib.rs +15 -0
  43. package/crates/naome-core/src/paths.rs +3 -1
  44. package/crates/naome-core/src/quality/adapter_support.rs +89 -0
  45. package/crates/naome-core/src/quality/adapters.rs +131 -0
  46. package/crates/naome-core/src/quality/baseline.rs +75 -0
  47. package/crates/naome-core/src/quality/checks/duplicate_blocks.rs +175 -0
  48. package/crates/naome-core/src/quality/checks/near_duplicates.rs +130 -0
  49. package/crates/naome-core/src/quality/checks.rs +228 -0
  50. package/crates/naome-core/src/quality/cleanup.rs +84 -0
  51. package/crates/naome-core/src/quality/config.rs +102 -0
  52. package/crates/naome-core/src/quality/config_support.rs +24 -0
  53. package/crates/naome-core/src/quality/mod.rs +108 -0
  54. package/crates/naome-core/src/quality/scanner/repo_paths.rs +103 -0
  55. package/crates/naome-core/src/quality/scanner.rs +379 -0
  56. package/crates/naome-core/src/quality/structure/adapters.rs +84 -0
  57. package/crates/naome-core/src/quality/structure/checks/basic.rs +153 -0
  58. package/crates/naome-core/src/quality/structure/checks/directory.rs +144 -0
  59. package/crates/naome-core/src/quality/structure/checks/pairing.rs +63 -0
  60. package/crates/naome-core/src/quality/structure/checks.rs +124 -0
  61. package/crates/naome-core/src/quality/structure/classify/roles.rs +188 -0
  62. package/crates/naome-core/src/quality/structure/classify.rs +94 -0
  63. package/crates/naome-core/src/quality/structure/config.rs +89 -0
  64. package/crates/naome-core/src/quality/structure/defaults.rs +107 -0
  65. package/crates/naome-core/src/quality/structure/mod.rs +77 -0
  66. package/crates/naome-core/src/quality/structure/model.rs +124 -0
  67. package/crates/naome-core/src/quality/types.rs +292 -0
  68. package/crates/naome-core/src/route/builtin_checks.rs +155 -0
  69. package/crates/naome-core/src/route/builtin_context.rs +73 -0
  70. package/crates/naome-core/src/route/builtin_integrity.rs +49 -0
  71. package/crates/naome-core/src/route/builtin_require.rs +40 -0
  72. package/crates/naome-core/src/route/context.rs +180 -0
  73. package/crates/naome-core/src/route/execution.rs +96 -0
  74. package/crates/naome-core/src/route/execution_baselines.rs +146 -0
  75. package/crates/naome-core/src/route/execution_support.rs +57 -0
  76. package/crates/naome-core/src/route/execution_tasks.rs +71 -0
  77. package/crates/naome-core/src/route/git_ops.rs +72 -0
  78. package/crates/naome-core/src/route/quality_gate.rs +73 -0
  79. package/crates/naome-core/src/route/quality_gate_config.rs +126 -0
  80. package/crates/naome-core/src/route/quality_gate_snapshot.rs +69 -0
  81. package/crates/naome-core/src/route/worktree.rs +75 -0
  82. package/crates/naome-core/src/route/worktree_files.rs +32 -0
  83. package/crates/naome-core/src/route/worktree_plan.rs +131 -0
  84. package/crates/naome-core/src/route.rs +44 -1155
  85. package/crates/naome-core/src/task_state/admission.rs +63 -0
  86. package/crates/naome-core/src/task_state/admission_proof.rs +72 -0
  87. package/crates/naome-core/src/task_state/api.rs +130 -0
  88. package/crates/naome-core/src/task_state/commit_gate.rs +138 -0
  89. package/crates/naome-core/src/task_state/compact_proof.rs +160 -0
  90. package/crates/naome-core/src/task_state/completed_refresh.rs +89 -0
  91. package/crates/naome-core/src/task_state/completion.rs +72 -0
  92. package/crates/naome-core/src/task_state/deleted_paths.rs +47 -0
  93. package/crates/naome-core/src/task_state/diff.rs +95 -0
  94. package/crates/naome-core/src/task_state/evidence.rs +154 -0
  95. package/crates/naome-core/src/task_state/git_io.rs +86 -0
  96. package/crates/naome-core/src/task_state/git_parse.rs +86 -0
  97. package/crates/naome-core/src/task_state/git_refs.rs +37 -0
  98. package/crates/naome-core/src/task_state/human_review_state.rs +31 -0
  99. package/crates/naome-core/src/task_state/mod.rs +38 -0
  100. package/crates/naome-core/src/task_state/process_guard.rs +40 -0
  101. package/crates/naome-core/src/task_state/progress.rs +123 -0
  102. package/crates/naome-core/src/task_state/proof.rs +139 -0
  103. package/crates/naome-core/src/task_state/proof_entry.rs +66 -0
  104. package/crates/naome-core/src/task_state/proof_model.rs +70 -0
  105. package/crates/naome-core/src/task_state/proof_sources.rs +76 -0
  106. package/crates/naome-core/src/task_state/push_gate.rs +49 -0
  107. package/crates/naome-core/src/task_state/reconcile.rs +7 -0
  108. package/crates/naome-core/src/task_state/repair.rs +168 -0
  109. package/crates/naome-core/src/task_state/shape.rs +117 -0
  110. package/crates/naome-core/src/task_state/task_diff_api.rs +170 -0
  111. package/crates/naome-core/src/task_state/task_records.rs +131 -0
  112. package/crates/naome-core/src/task_state/task_references.rs +126 -0
  113. package/crates/naome-core/src/task_state/types.rs +87 -0
  114. package/crates/naome-core/src/task_state/util.rs +137 -0
  115. package/crates/naome-core/src/verification/render.rs +122 -0
  116. package/crates/naome-core/src/verification.rs +177 -58
  117. package/crates/naome-core/src/verification_contract.rs +49 -21
  118. package/crates/naome-core/src/workflow/integrity.rs +123 -0
  119. package/crates/naome-core/src/workflow/integrity_normalize.rs +7 -0
  120. package/crates/naome-core/src/workflow/integrity_support.rs +110 -0
  121. package/crates/naome-core/src/workflow/mod.rs +18 -0
  122. package/crates/naome-core/src/workflow/mutation.rs +68 -0
  123. package/crates/naome-core/src/workflow/output.rs +111 -0
  124. package/crates/naome-core/src/workflow/phase_inference.rs +73 -0
  125. package/crates/naome-core/src/workflow/phases.rs +169 -0
  126. package/crates/naome-core/src/workflow/policy.rs +156 -0
  127. package/crates/naome-core/src/workflow/processes.rs +91 -0
  128. package/crates/naome-core/src/workflow/types.rs +42 -0
  129. package/crates/naome-core/tests/decision.rs +24 -118
  130. package/crates/naome-core/tests/harness_health.rs +5 -0
  131. package/crates/naome-core/tests/intent.rs +97 -792
  132. package/crates/naome-core/tests/intent_support/mod.rs +133 -0
  133. package/crates/naome-core/tests/intent_v2.rs +90 -0
  134. package/crates/naome-core/tests/quality.rs +319 -0
  135. package/crates/naome-core/tests/quality_structure.rs +116 -0
  136. package/crates/naome-core/tests/quality_structure_adapters.rs +98 -0
  137. package/crates/naome-core/tests/quality_structure_policy.rs +125 -0
  138. package/crates/naome-core/tests/quality_structure_support/mod.rs +249 -0
  139. package/crates/naome-core/tests/repo_support/mod.rs +16 -0
  140. package/crates/naome-core/tests/repo_support/repo.rs +113 -0
  141. package/crates/naome-core/tests/repo_support/repo_factories.rs +99 -0
  142. package/crates/naome-core/tests/repo_support/repo_helpers.rs +123 -0
  143. package/crates/naome-core/tests/repo_support/routes.rs +81 -0
  144. package/crates/naome-core/tests/repo_support/verification.rs +168 -0
  145. package/crates/naome-core/tests/repo_support/verification_values.rs +135 -0
  146. package/crates/naome-core/tests/route.rs +1 -1476
  147. package/crates/naome-core/tests/route_baseline.rs +86 -0
  148. package/crates/naome-core/tests/route_completion.rs +141 -0
  149. package/crates/naome-core/tests/route_harness_refresh.rs +135 -0
  150. package/crates/naome-core/tests/route_user_diff.rs +198 -0
  151. package/crates/naome-core/tests/route_worktree.rs +54 -0
  152. package/crates/naome-core/tests/task_state.rs +60 -429
  153. package/crates/naome-core/tests/task_state_compact.rs +110 -0
  154. package/crates/naome-core/tests/task_state_compact_support/mod.rs +5 -0
  155. package/crates/naome-core/tests/task_state_compact_support/repo.rs +130 -0
  156. package/crates/naome-core/tests/task_state_compact_support/states.rs +151 -0
  157. package/crates/naome-core/tests/task_state_support/mod.rs +163 -0
  158. package/crates/naome-core/tests/task_state_support/states.rs +84 -0
  159. package/crates/naome-core/tests/verification.rs +4 -45
  160. package/crates/naome-core/tests/verification_contract.rs +22 -78
  161. package/crates/naome-core/tests/workflow_integrity.rs +85 -0
  162. package/crates/naome-core/tests/workflow_policy.rs +139 -0
  163. package/crates/naome-core/tests/workflow_support/mod.rs +194 -0
  164. package/installer/agents.js +90 -0
  165. package/installer/context.js +67 -0
  166. package/installer/filesystem.js +166 -0
  167. package/installer/flows.js +84 -0
  168. package/installer/git-boundary.js +170 -0
  169. package/installer/git-hook-content.js +36 -0
  170. package/installer/git-hooks.js +134 -0
  171. package/installer/git-local.js +2 -0
  172. package/installer/git-shared.js +35 -0
  173. package/installer/harness-file-ops.js +140 -0
  174. package/installer/harness-files.js +56 -0
  175. package/installer/harness-verification.js +123 -0
  176. package/installer/install-plan.js +66 -0
  177. package/installer/main.js +25 -0
  178. package/installer/manifest-state.js +167 -0
  179. package/installer/native-build.js +24 -0
  180. package/installer/native-format.js +6 -0
  181. package/installer/native.js +162 -0
  182. package/installer/output.js +131 -0
  183. package/installer/version.js +32 -0
  184. package/native/darwin-arm64/naome +0 -0
  185. package/native/linux-x64/naome +0 -0
  186. package/package.json +3 -2
  187. package/templates/naome-root/.naome/bin/check-harness-health.js +66 -85
  188. package/templates/naome-root/.naome/bin/check-task-state.js +9 -10
  189. package/templates/naome-root/.naome/bin/naome.js +51 -76
  190. package/templates/naome-root/.naome/manifest.json +22 -18
  191. package/templates/naome-root/.naome/repository-quality-baseline.json +5 -0
  192. package/templates/naome-root/.naome/repository-quality.json +24 -0
  193. package/templates/naome-root/.naome/repository-structure.json +90 -0
  194. package/templates/naome-root/.naome/task-contract.schema.json +93 -11
  195. package/templates/naome-root/.naome/upgrade-state.json +1 -1
  196. package/templates/naome-root/.naome/verification.json +38 -0
  197. package/templates/naome-root/AGENTS.md +3 -0
  198. package/templates/naome-root/docs/naome/agent-workflow.md +25 -12
  199. package/templates/naome-root/docs/naome/execution.md +25 -21
  200. package/templates/naome-root/docs/naome/index.md +5 -3
  201. package/templates/naome-root/docs/naome/repository-quality.md +46 -0
  202. package/templates/naome-root/docs/naome/repository-structure.md +51 -0
  203. package/templates/naome-root/docs/naome/testing.md +13 -0
  204. package/crates/naome-core/src/task_state.rs +0 -2210
@@ -27,7 +27,7 @@ function main(argv) {
27
27
  return;
28
28
  }
29
29
 
30
- if (command === "status" || command === "next" || command === "intent" || command === "route" || command === "explain") {
30
+ if (["status", "next", "intent", "route", "explain", "quality", "structure", "cleanup", "refresh-integrity", "workflow"].includes(command)) {
31
31
  runNativeDecisionCommand(command, args);
32
32
  return;
33
33
  }
@@ -46,20 +46,25 @@ function runNativeDecisionCommand(command, args) {
46
46
  fail("NAOME harness root not found. Run this inside a repository with .naome/task-state.json.");
47
47
  }
48
48
 
49
- const nativeBinary = resolveNativeDecisionBinary(root);
50
- verifyNativeBinary(nativeBinary);
49
+ const result = spawnNative(root, [command, ...args], { stdio: "inherit" });
50
+
51
+ process.exit(result.status === null ? 1 : result.status);
52
+ }
51
53
 
52
- const result = spawnSync(nativeBinary, [command, ...args], {
54
+ function spawnNative(root, args, options = {}) {
55
+ const nativeBinary = resolveNativeDecisionBinary(root);
56
+ if (!isUsableNativeBinary(nativeBinary, root)) {
57
+ fail("NAOME native decision binary failed integrity or compatibility checks.");
58
+ }
59
+ return spawnSync(nativeBinary, args, {
53
60
  cwd: root,
54
61
  encoding: "utf8",
55
62
  env: {
56
63
  ...process.env,
57
64
  NAOME_NODE_BIN: process.execPath
58
65
  },
59
- stdio: "inherit"
66
+ ...options
60
67
  });
61
-
62
- process.exit(result.status === null ? 1 : result.status);
63
68
  }
64
69
 
65
70
  function resolveNativeDecisionBinary(root) {
@@ -115,30 +120,22 @@ function buildSourceNativeBinary(root) {
115
120
  return null;
116
121
  }
117
122
 
118
- const manifestPath = join(root, "packages", "naome", "Cargo.toml");
123
+ const sourcePath = (...parts) => join(root, "packages", "naome", ...parts);
124
+ const manifestPath = sourcePath("Cargo.toml");
119
125
  if (!existsSync(manifestPath)) {
120
126
  return null;
121
127
  }
122
128
 
123
- const result = spawnSync("cargo", ["build", "--release", "--manifest-path", manifestPath, "-p", "naome-cli"], {
124
- cwd: root,
125
- encoding: "utf8",
126
- stdio: "ignore"
127
- });
129
+ const buildArgs = ["build", "--release", "--manifest-path", manifestPath, "-p", "naome-cli"];
130
+ const result = spawnSync("cargo", buildArgs, { cwd: root, encoding: "utf8", stdio: "ignore" });
128
131
  if (result.status !== 0) {
129
132
  return null;
130
133
  }
131
134
 
132
- const builtPath = join(root, "packages", "naome", "target", "release", nativeBinaryName);
135
+ const builtPath = sourcePath("target", "release", nativeBinaryName);
133
136
  return existsSync(builtPath) ? builtPath : null;
134
137
  }
135
138
 
136
- function verifyNativeBinary(nativeBinary) {
137
- if (!isUsableNativeBinary(nativeBinary, findHarnessRoot(process.cwd()) || process.cwd())) {
138
- fail("NAOME native decision binary failed integrity or compatibility checks.");
139
- }
140
- }
141
-
142
139
  function commit(args) {
143
140
  const root = findHarnessRoot(process.cwd());
144
141
  if (!root) {
@@ -179,16 +176,7 @@ function commitBaseline(root, message, options = {}) {
179
176
  }
180
177
 
181
178
  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
- });
179
+ const result = spawnNative(root, ["commit-paths", "--json"]);
192
180
  if (result.status !== 0) {
193
181
  fail(`Cannot determine NAOME task commit paths: ${result.stderr.trim() || result.stdout.trim()}`);
194
182
  }
@@ -205,8 +193,6 @@ function readTaskCommitPaths(root) {
205
193
  }
206
194
 
207
195
  function writeTaskJournal(root, outcome, commitInfo) {
208
- const nativeBinary = resolveNativeDecisionBinary(root);
209
- verifyNativeBinary(nativeBinary);
210
196
  const args = [
211
197
  "journal-task",
212
198
  "--outcome",
@@ -220,14 +206,7 @@ function writeTaskJournal(root, outcome, commitInfo) {
220
206
  args.push("--commit-after", commitInfo.after);
221
207
  }
222
208
 
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
- });
209
+ const result = spawnNative(root, args);
231
210
  if (result.status !== 0) {
232
211
  fail(`Cannot write NAOME task journal: ${result.stderr.trim() || result.stdout.trim()}`);
233
212
  }
@@ -261,16 +240,7 @@ function defaultSetupCommitMessage(decision) {
261
240
  }
262
241
 
263
242
  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
- });
243
+ const result = spawnNative(root, ["status", "--json"]);
274
244
 
275
245
  if (result.status !== 0) {
276
246
  fail(`Cannot read NAOME status: ${result.stderr.trim() || result.stdout.trim()}`);
@@ -358,10 +328,14 @@ function gitHead(root) {
358
328
  }
359
329
 
360
330
  function findHarnessRoot(startPath) {
331
+ return findAncestorWithMarker(startPath, [".naome", "task-state.json"]);
332
+ }
333
+
334
+ function findAncestorWithMarker(startPath, markerParts) {
361
335
  let current = resolve(startPath);
362
336
 
363
337
  while (true) {
364
- if (existsSync(join(current, ".naome", "task-state.json"))) {
338
+ if (existsSync(join(current, ...markerParts))) {
365
339
  return current;
366
340
  }
367
341
 
@@ -375,19 +349,30 @@ function findHarnessRoot(startPath) {
375
349
  }
376
350
 
377
351
  function printHelp() {
378
- console.log("Usage:");
379
- console.log(" naome status [--json]");
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]");
387
- console.log(" naome install");
388
- console.log(" naome sync");
389
- console.log(" naome commit -m \"type(scope): message\"");
390
- console.log(" node .naome/bin/naome.js commit -m \"type(scope): message\"");
352
+ const commands = [
353
+ "naome status [--json]",
354
+ "naome next [--json]",
355
+ "naome intent --prompt-file <path> [--json]",
356
+ "naome intent --prompt <text> [--json]",
357
+ "naome route --prompt-file <path> [--execute] [--json]",
358
+ "naome route --prompt <text> [--execute] [--json]",
359
+ "naome explain --prompt-file <path> [--json]",
360
+ "naome explain --prompt <text> [--json]",
361
+ "naome quality init [--json]",
362
+ "naome quality check --changed [--json]",
363
+ "naome quality report [--json]",
364
+ "naome structure report [--json]",
365
+ "naome structure explain --path <path> [--json]",
366
+ "naome cleanup plan [--json]",
367
+ "naome cleanup route --path <path> [--json]",
368
+ "naome refresh-integrity [--json]",
369
+ "naome workflow search-profile|check-search|phases|processes|mutations [--json]",
370
+ "naome install",
371
+ "naome sync",
372
+ "naome commit -m \"type(scope): message\"",
373
+ "node .naome/bin/naome.js commit -m \"type(scope): message\""
374
+ ];
375
+ console.log(["Usage:", ...commands.map((command) => ` ${command}`)].join("\n"));
391
376
  }
392
377
 
393
378
  function fail(message) {
@@ -399,24 +384,14 @@ function installOrSync(command, args) {
399
384
  const root = findHarnessRoot(process.cwd()) || process.cwd();
400
385
  const packageRoot = sourcePackageRoot(root);
401
386
  if (packageRoot) {
402
- const nativeBinary = resolveNativeDecisionBinary(root);
403
- verifyNativeBinary(nativeBinary);
404
- const result = spawnSync(nativeBinary, [
387
+ const result = spawnNative(root, [
405
388
  command,
406
389
  "--package-root",
407
390
  packageRoot,
408
391
  "--installer-js",
409
392
  join(packageRoot, "bin", "naome-node.js"),
410
393
  ...args
411
- ], {
412
- cwd: root,
413
- encoding: "utf8",
414
- env: {
415
- ...process.env,
416
- NAOME_NODE_BIN: process.execPath
417
- },
418
- stdio: "inherit"
419
- });
394
+ ], { stdio: "inherit" });
420
395
  process.exit(result.status === null ? 1 : result.status);
421
396
  }
422
397
 
@@ -1,8 +1,19 @@
1
1
  {
2
- "name": "naome",
3
- "harnessVersion": "1.1.1",
4
- "profile": "standard",
2
+ "harnessVersion": "1.2.0",
5
3
  "installedAt": null,
4
+ "integrity": {
5
+ ".naome/bin/check-harness-health.js": "sha256:dc4de52b79c69600b9ba47b924e2c2b8de61a2cbfab6d1ccc0f1924d963db657",
6
+ ".naome/bin/check-task-state.js": "sha256:43c02868072d0d13499aefba2e9a5ec9517d59539fd19ff0f11e3e4623a51b44",
7
+ ".naome/bin/naome.js": "sha256:87eabd690bf55f0b0195446db46fa7c19bfa17395d31c2f34a9ef9339d2229e2",
8
+ ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
9
+ ".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
10
+ "AGENTS.md": "sha256:9192ea81f90bb19f8043513c49b5da9e9598ee694da8356f345e7ccbca0e28df",
11
+ "docs/naome/agent-workflow.md": "sha256:802eb34cf268fc9c5e7aefc28192efef4bf60302d30b3f78e5a61b876ce8a098",
12
+ "docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
13
+ "docs/naome/first-run.md": "sha256:a1dd0bd17ec9d71955a473cd2c4a615538e89a7d81e8f4e1015a50ab9efe3558",
14
+ "docs/naome/index.md": "sha256:a674102cc801702dc77102afb59be0f5ab189dc638caf0bef358b9d6087d0742",
15
+ "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
16
+ },
6
17
  "machineOwned": [
7
18
  "AGENTS.md",
8
19
  ".naome/package.json",
@@ -16,6 +27,8 @@
16
27
  "docs/naome/execution.md",
17
28
  "docs/naome/upgrade.md"
18
29
  ],
30
+ "name": "naome",
31
+ "profile": "standard",
19
32
  "projectOwned": [
20
33
  ".naomeignore",
21
34
  ".naome/init-state.json",
@@ -23,24 +36,15 @@
23
36
  ".naome/task-state.json",
24
37
  ".naome/upgrade-state.json",
25
38
  ".naome/verification.json",
39
+ ".naome/repository-quality.json",
40
+ ".naome/repository-structure.json",
41
+ ".naome/repository-quality-baseline.json",
26
42
  "docs/naome/architecture.md",
27
43
  "docs/naome/decisions.md",
28
44
  "docs/naome/repo-profile.md",
45
+ "docs/naome/repository-quality.md",
46
+ "docs/naome/repository-structure.md",
29
47
  "docs/naome/security.md",
30
48
  "docs/naome/testing.md"
31
- ],
32
- "integrity": {
33
- "AGENTS.md": "sha256:84ce882fa6798a144c8c74673d4304fc6bf235b1cc417f7649eea9f7461775de",
34
- ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
35
- ".naome/bin/naome.js": "sha256:7894690ad47700a9a5e7ecb5a94ba42c1a12e2637d2c9f41f0023b1bd8bd22b6",
36
- ".naome/bin/check-task-state.js": "sha256:43c02868072d0d13499aefba2e9a5ec9517d59539fd19ff0f11e3e4623a51b44",
37
- ".naome/bin/check-harness-health.js": "sha256:dce2a380022dd63d86bd762869debafbc635ab3d7e8fae985e2d429d8ee437ad",
38
- ".naome/task-contract.schema.json": "sha256:c806416d4944eaed6dc48b3760fd0dd5b9b5a7c9ab895697fe36b54c41c1332f",
39
- "docs/naome/index.md": "sha256:d04691b25ed377c2a3aa2c56965d0db276539aeadcfdd2a2ec1be7ff7706dd6f",
40
- "docs/naome/first-run.md": "sha256:a1dd0bd17ec9d71955a473cd2c4a615538e89a7d81e8f4e1015a50ab9efe3558",
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"
45
- }
49
+ ]
46
50
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "schema": "naome.repository-quality-baseline.v1",
3
+ "version": 1,
4
+ "violations": []
5
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "schema": "naome.repository-quality.v1",
3
+ "version": 1,
4
+ "status": "ready",
5
+ "limits": {
6
+ "maxFileLines": 450,
7
+ "maxNewFileLines": 300,
8
+ "maxDiffAddedLines": 180,
9
+ "maxFunctionLines": 100,
10
+ "maxTopLevelSymbols": 30,
11
+ "duplicateBlockLines": 10,
12
+ "nearDuplicateSimilarity": 0.9
13
+ },
14
+ "enabledAdapters": [],
15
+ "disabledChecks": [],
16
+ "ignoredPaths": [],
17
+ "generatedPaths": [
18
+ "**/*.min.js",
19
+ "**/*.map",
20
+ "**/dist/**",
21
+ "**/build/**"
22
+ ],
23
+ "pathRules": []
24
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "schema": "naome.repository-structure.v1",
3
+ "version": 1,
4
+ "status": "ready",
5
+ "enabledAdapters": [],
6
+ "sourceRoots": [
7
+ "src/**",
8
+ "app/**",
9
+ "apps/*/src/**",
10
+ "packages/*/src/**",
11
+ "crates/*/src/**",
12
+ "**/src/**",
13
+ "lib/**"
14
+ ],
15
+ "testRoots": [
16
+ "test/**",
17
+ "tests/**",
18
+ "__tests__/**",
19
+ "packages/*/test/**",
20
+ "packages/*/tests/**",
21
+ "crates/*/tests/**",
22
+ "**/tests/**",
23
+ "scripts/*.test.js"
24
+ ],
25
+ "docsRoots": [
26
+ "docs/**",
27
+ "doc/**"
28
+ ],
29
+ "generatedRoots": [
30
+ "**/generated/**",
31
+ "**/__generated__/**",
32
+ "**/codegen/**",
33
+ "**/*.generated.*"
34
+ ],
35
+ "artifactRoots": [
36
+ "dist/**",
37
+ "build/**",
38
+ "coverage/**",
39
+ ".next/**",
40
+ "target/**",
41
+ "**/dist/**",
42
+ "**/build/**"
43
+ ],
44
+ "moduleRoots": [
45
+ "src/**",
46
+ "app/**",
47
+ "packages/*/src/**",
48
+ "crates/*/src/**",
49
+ "**/src/**"
50
+ ],
51
+ "allowedRootFiles": [
52
+ "README.md",
53
+ "LICENSE",
54
+ "NOTICE",
55
+ "CHANGELOG.md",
56
+ "CONTRIBUTING.md",
57
+ "SECURITY.md",
58
+ "AGENTS.md",
59
+ "package.json",
60
+ "Cargo.toml",
61
+ "pyproject.toml",
62
+ "go.mod",
63
+ "go.sum",
64
+ "Makefile",
65
+ ".gitignore",
66
+ ".naomeignore"
67
+ ],
68
+ "directoryRoleRules": [],
69
+ "layerRules": [],
70
+ "ignoredPaths": [
71
+ ".git/**",
72
+ "node_modules/**",
73
+ "vendor/**",
74
+ "target/**",
75
+ "**/target/**",
76
+ "dist/**",
77
+ "build/**",
78
+ "coverage/**",
79
+ ".next/**"
80
+ ],
81
+ "disabledChecks": [],
82
+ "changedCodePolicy": "block",
83
+ "debtPolicy": "report",
84
+ "limits": {
85
+ "maxDirectoryFiles": 40,
86
+ "maxPathDepth": 10,
87
+ "maxDirectoryRoles": 2,
88
+ "maxDumpingGroundFiles": 12
89
+ }
90
+ }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "naome.task-state.v1",
3
+ "$id": "naome.task-state.v2",
4
4
  "title": "NAOME Task State",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["schema", "version", "status", "activeTask", "blocker", "updatedAt"],
8
8
  "properties": {
9
- "schema": { "const": "naome.task-state.v1" },
10
- "version": { "const": 1 },
9
+ "schema": { "enum": ["naome.task-state.v1", "naome.task-state.v2"] },
10
+ "version": { "enum": [1, 2] },
11
11
  "status": {
12
12
  "enum": ["idle", "planning", "implementing", "revising", "verifying", "needs_human_review", "blocked", "complete"]
13
13
  },
@@ -30,11 +30,29 @@
30
30
  ]
31
31
  }
32
32
  },
33
+ "oneOf": [
34
+ {
35
+ "properties": {
36
+ "schema": { "const": "naome.task-state.v1" },
37
+ "version": { "const": 1 }
38
+ }
39
+ },
40
+ {
41
+ "properties": {
42
+ "schema": { "const": "naome.task-state.v2" },
43
+ "version": { "const": 2 }
44
+ }
45
+ }
46
+ ],
33
47
  "$defs": {
34
48
  "activeTask": {
35
49
  "type": "object",
36
50
  "additionalProperties": false,
37
- "required": ["id", "request", "userPrompt", "admission", "allowedPaths", "declaredChangeTypes", "requiredCheckIds", "proofResults", "humanReview"],
51
+ "required": ["id", "request", "userPrompt", "admission", "allowedPaths", "declaredChangeTypes", "requiredCheckIds", "humanReview"],
52
+ "anyOf": [
53
+ { "required": ["proofResults"] },
54
+ { "required": ["proofBatches"] }
55
+ ],
38
56
  "properties": {
39
57
  "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
40
58
  "request": { "type": "string", "minLength": 1 },
@@ -58,6 +76,14 @@
58
76
  "type": "array",
59
77
  "items": { "$ref": "#/$defs/proofResult" }
60
78
  },
79
+ "proofPathSets": {
80
+ "type": "object",
81
+ "additionalProperties": { "$ref": "#/$defs/evidenceArray" }
82
+ },
83
+ "proofBatches": {
84
+ "type": "array",
85
+ "items": { "$ref": "#/$defs/proofBatch" }
86
+ },
61
87
  "revisions": {
62
88
  "type": "array",
63
89
  "items": { "$ref": "#/$defs/revision" }
@@ -109,17 +135,73 @@
109
135
  "cwd": { "type": "string", "minLength": 1 },
110
136
  "exitCode": { "type": "integer" },
111
137
  "checkedAt": { "type": "string", "format": "date-time" },
112
- "evidence": {
138
+ "evidence": { "$ref": "#/$defs/evidenceArray" },
139
+ "outputSummary": { "$ref": "#/$defs/outputSummary" }
140
+ }
141
+ },
142
+ "proofBatch": {
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": ["checkedAt", "proofs"],
146
+ "properties": {
147
+ "checkedAt": { "type": "string", "format": "date-time" },
148
+ "command": { "type": "string", "minLength": 1 },
149
+ "cwd": { "type": "string", "minLength": 1 },
150
+ "evidencePathSet": { "type": "string", "minLength": 1 },
151
+ "proofs": {
152
+ "type": "array",
153
+ "items": { "$ref": "#/$defs/compactProofResult" }
154
+ }
155
+ }
156
+ },
157
+ "compactProofResult": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": ["checkId", "exitCode"],
161
+ "properties": {
162
+ "checkId": { "type": "string", "minLength": 1 },
163
+ "command": { "type": "string", "minLength": 1 },
164
+ "cwd": { "type": "string", "minLength": 1 },
165
+ "exitCode": { "type": "integer" },
166
+ "checkedAt": { "type": "string", "format": "date-time" },
167
+ "evidence": { "$ref": "#/$defs/evidenceArray" },
168
+ "evidencePathSet": { "type": "string", "minLength": 1 },
169
+ "outputSummary": { "$ref": "#/$defs/outputSummary" }
170
+ }
171
+ },
172
+ "outputSummary": {
173
+ "type": "object",
174
+ "additionalProperties": false,
175
+ "required": ["command", "cwd", "exitCode", "truncated", "relevantLines", "affectedPaths"],
176
+ "properties": {
177
+ "command": { "type": "string", "minLength": 1 },
178
+ "cwd": { "type": "string", "minLength": 1 },
179
+ "exitCode": { "type": "integer" },
180
+ "truncated": { "type": "boolean" },
181
+ "omittedLineCount": { "type": "integer", "minimum": 0 },
182
+ "relevantLines": {
113
183
  "type": "array",
114
- "items": {
115
- "anyOf": [
116
- { "type": "string", "minLength": 1 },
117
- { "$ref": "#/$defs/evidenceEntry" }
118
- ]
119
- }
184
+ "items": { "type": "string" }
185
+ },
186
+ "affectedPaths": {
187
+ "type": "array",
188
+ "items": { "type": "string", "minLength": 1 }
189
+ },
190
+ "artifacts": {
191
+ "type": "array",
192
+ "items": { "type": "string", "minLength": 1 }
120
193
  }
121
194
  }
122
195
  },
196
+ "evidenceArray": {
197
+ "type": "array",
198
+ "items": {
199
+ "anyOf": [
200
+ { "type": "string", "minLength": 1 },
201
+ { "$ref": "#/$defs/evidenceEntry" }
202
+ ]
203
+ }
204
+ },
123
205
  "evidenceEntry": {
124
206
  "type": "object",
125
207
  "additionalProperties": false,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "status": "complete",
3
3
  "fromVersion": null,
4
- "toVersion": "1.1.1",
4
+ "toVersion": "1.2.0",
5
5
  "pending": [],
6
6
  "completed": []
7
7
  }
@@ -38,6 +38,44 @@
38
38
  ".naome/task-contract.schema.json"
39
39
  ],
40
40
  "lastVerified": null
41
+ },
42
+ {
43
+ "id": "repository-quality-check",
44
+ "command": "node .naome/bin/naome.js quality check --changed",
45
+ "cwd": ".",
46
+ "purpose": "Validate changed files against deterministic NAOME repository quality rules.",
47
+ "cost": "fast",
48
+ "source": "NAOME built-in",
49
+ "evidence": [
50
+ ".naome/repository-quality.json",
51
+ ".naome/repository-structure.json",
52
+ ".naome/repository-quality-baseline.json"
53
+ ],
54
+ "lastVerified": null
55
+ }
56
+ ],
57
+ "phases": [
58
+ {
59
+ "id": "shape-health",
60
+ "order": 10,
61
+ "checkIds": [
62
+ "naome-harness-health",
63
+ "naome-task-state"
64
+ ]
65
+ },
66
+ {
67
+ "id": "quality",
68
+ "order": 20,
69
+ "checkIds": [
70
+ "repository-quality-check"
71
+ ]
72
+ },
73
+ {
74
+ "id": "diff-check",
75
+ "order": 60,
76
+ "checkIds": [
77
+ "diff-check"
78
+ ]
41
79
  }
42
80
  ],
43
81
  "changeTypes": [],
@@ -69,6 +69,9 @@ This repository uses NAOME as its coding-agent harness.
69
69
  previous-task, or other unowned changes.
70
70
  - Treat `.naomeignore` as a hard read boundary. Do not inspect ignored paths
71
71
  unless the user first removes the path from `.naomeignore`.
72
+ - Use `naome workflow search-profile` or equivalent excludes for broad searches;
73
+ hidden searches must exclude `.git`, `.naome/archive`, dependencies, build
74
+ outputs, caches, and `.naomeignore` paths.
72
75
  - Use `docs/naome/testing.md` and `.naome/verification.json` before claiming
73
76
  completion.
74
77
  - Before claiming completion, run the narrowest meaningful verification that can