@lamentis/naome 1.3.3 → 1.3.5

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 (38) hide show
  1. package/Cargo.lock +2 -2
  2. package/README.md +0 -5
  3. package/crates/naome-cli/Cargo.toml +1 -1
  4. package/crates/naome-cli/src/main.rs +1 -0
  5. package/crates/naome-cli/src/workflow_commands.rs +30 -4
  6. package/crates/naome-core/Cargo.toml +1 -1
  7. package/crates/naome-core/src/information_architecture.rs +179 -0
  8. package/crates/naome-core/src/install_plan.rs +0 -12
  9. package/crates/naome-core/src/lib.rs +5 -0
  10. package/crates/naome-core/src/route/git_ops.rs +50 -5
  11. package/crates/naome-core/src/task_ledger/render.rs +50 -16
  12. package/crates/naome-core/tests/information_architecture.rs +58 -0
  13. package/crates/naome-core/tests/install_plan.rs +0 -11
  14. package/crates/naome-core/tests/task_ledger.rs +62 -0
  15. package/installer/context.js +0 -10
  16. package/installer/filesystem.js +0 -4
  17. package/installer/flows.js +18 -4
  18. package/installer/harness-file-ops.js +4 -0
  19. package/installer/install-plan.js +0 -4
  20. package/native/darwin-arm64/naome +0 -0
  21. package/native/linux-x64/naome +0 -0
  22. package/package.json +1 -1
  23. package/templates/naome-root/.naome/bin/check-harness-health.js +3 -3
  24. package/templates/naome-root/.naome/bin/check-task-state.js +3 -3
  25. package/templates/naome-root/.naome/bin/naome.js +18 -47
  26. package/templates/naome-root/.naome/manifest.json +3 -3
  27. package/templates/naome-root/docs/naome/agent-workflow.md +7 -4
  28. package/templates/naome-root/docs/naome/architecture.md +11 -2
  29. package/templates/naome-root/docs/naome/task-ledger.md +13 -1
  30. package/templates/naome-root/docs/naome/testing.md +0 -4
  31. package/installer/codex-hooks.js +0 -121
  32. package/templates/naome-root/.codex/config.toml +0 -2
  33. package/templates/naome-root/.codex/hooks.json +0 -70
  34. package/templates/naome-root/.naome/bin/codex-hook-io.js +0 -122
  35. package/templates/naome-root/.naome/bin/codex-hook-policy.js +0 -180
  36. package/templates/naome-root/.naome/bin/codex-hook-runtime.js +0 -174
  37. package/templates/naome-root/.naome/bin/codex-hook.js +0 -6
  38. package/templates/naome-root/docs/naome/codex-hooks.md +0 -82
@@ -34,16 +34,6 @@ export function createInstallerContext() {
34
34
  installPlan: null,
35
35
  machineOwnedPaths: [],
36
36
  projectOwnedPaths: [],
37
- optionalCodexHookPaths: [
38
- ".codex/config.toml",
39
- ".codex/hooks.json",
40
- ".naome/bin/codex-hook.js",
41
- ".naome/bin/codex-hook-io.js",
42
- ".naome/bin/codex-hook-policy.js",
43
- ".naome/bin/codex-hook-runtime.js",
44
- "docs/naome/codex-hooks.md",
45
- ],
46
- codexHooksEnabled: false,
47
37
  localOnlyMachineOwnedPaths: [],
48
38
  localOnlyGitIgnoreEntries: [],
49
39
  localOnlyGitExcludeEntries: [],
@@ -30,10 +30,6 @@ export function copyTemplateFile(ctx, sourcePath) {
30
30
  const relativePath = relative(ctx.templateRoot, sourcePath);
31
31
  const targetPath = join(ctx.targetRoot, relativePath);
32
32
 
33
- if (ctx.optionalCodexHookPaths.includes(relativePath) && !ctx.codexHooksEnabled) {
34
- return;
35
- }
36
-
37
33
  if (hasSymlinkInTargetPath(ctx, relativePath)) {
38
34
  ctx.skipped.push(relativePath);
39
35
  ctx.unsafeSkipped.push(relativePath);
@@ -14,14 +14,23 @@ import {
14
14
  refreshManifestHealthMetadata,
15
15
  } from "./manifest-state.js";
16
16
  import { installNativeDecisionBinary, patchInstalledMachineOwnedIntegrity } from "./native.js";
17
+ import { removeLegacyHarnessFile } from "./harness-file-ops.js";
17
18
  import { printError } from "./output.js";
18
19
  import { compareVersions } from "./version.js";
19
20
  import { confirmAgentsTakeover, takeoverExistingAgents } from "./agents.js";
20
- import { ensureCodexHooks, resolveCodexHooksPreference } from "./codex-hooks.js";
21
+
22
+ const legacyCodexHookPaths = [
23
+ ".codex/config.toml",
24
+ ".codex/hooks.json",
25
+ ".naome/bin/codex-hook-io.js",
26
+ ".naome/bin/codex-hook-policy.js",
27
+ ".naome/bin/codex-hook-runtime.js",
28
+ ".naome/bin/codex-hook.js",
29
+ "docs/naome/codex-hooks.md",
30
+ ];
21
31
 
22
32
  export async function runFreshInstall(ctx) {
23
33
  await confirmAgentsTakeover(ctx);
24
- await resolveCodexHooksPreference(ctx);
25
34
 
26
35
  for (const sourcePath of walk(ctx.templateRoot)) {
27
36
  copyTemplateFile(ctx, sourcePath);
@@ -72,17 +81,22 @@ function rejectUnsupportedHistoricalInstall(ctx, version) {
72
81
 
73
82
  async function runRepair(ctx, version, options = {}) {
74
83
  ctx.summaryTitle = "NAOME harness checked";
75
- await resolveCodexHooksPreference(ctx);
76
84
  ensureCoreHarnessFiles(ctx, `repair-${version}`);
77
85
  ensureTaskControlHarnessFiles(ctx, `repair-${version}`);
78
86
  ensureHarnessHealthFiles(ctx, `repair-${version}`);
79
- ensureCodexHooks(ctx, `repair-${version}`);
80
87
  installNativeDecisionBinary(ctx);
81
88
  patchInstalledMachineOwnedIntegrity(ctx);
82
89
  ensureBuiltInVerificationChecks(ctx);
83
90
  ensureTestingProofHarnessSections(ctx);
84
91
  ensureRepositoryStructurePolicyFiles(ctx);
92
+ removeLegacyCodexHookFiles(ctx, `repair-${version}`);
85
93
  refreshManifestHealthMetadata(ctx);
86
94
  ensureCompleteUpgradeState(ctx, options.fromVersion ?? null);
87
95
  ensureLocalOnlySourceControlBoundary(ctx);
88
96
  }
97
+
98
+ function removeLegacyCodexHookFiles(ctx, archiveDirName) {
99
+ for (const relativePath of legacyCodexHookPaths) {
100
+ removeLegacyHarnessFile(ctx, relativePath, archiveDirName);
101
+ }
102
+ }
@@ -39,6 +39,10 @@ export function ensureTemplateFile(ctx, relativePath) {
39
39
  }
40
40
 
41
41
  export function removeBranchControlledHookShim(ctx, relativePath, archiveDirName) {
42
+ removeLegacyHarnessFile(ctx, relativePath, archiveDirName);
43
+ }
44
+
45
+ export function removeLegacyHarnessFile(ctx, relativePath, archiveDirName) {
42
46
  const targetPath = join(ctx.targetRoot, relativePath);
43
47
  if (!existsSync(targetPath)) {
44
48
  ctx.skipped.push(relativePath);
@@ -34,9 +34,6 @@ function parseInstallPlan(ctx, output) {
34
34
  assertInstallPlanArray(ctx, installPlan, "machineOwned");
35
35
  assertInstallPlanArray(ctx, installPlan, "projectOwned");
36
36
  assertInstallPlanArray(ctx, installPlan, "localOnlyMachineOwned");
37
- if (installPlan.optionalCodexHookPaths !== undefined) {
38
- assertInstallPlanArray(ctx, installPlan, "optionalCodexHookPaths");
39
- }
40
37
  assertInstallPlanArray(ctx, installPlan, "gitignoreEntries");
41
38
  assertInstallPlanArray(ctx, installPlan, "gitExcludeEntries");
42
39
  assertInstallPlanArray(ctx, installPlan, "gitUntrackPaths");
@@ -63,7 +60,6 @@ function assignInstallPlan(ctx, installPlan) {
63
60
  ctx.machineOwnedPaths = installPlan.machineOwned;
64
61
  ctx.projectOwnedPaths = installPlan.projectOwned;
65
62
  ctx.localOnlyMachineOwnedPaths = installPlan.localOnlyMachineOwned;
66
- ctx.optionalCodexHookPaths = installPlan.optionalCodexHookPaths ?? ctx.optionalCodexHookPaths;
67
63
  ctx.localOnlyGitIgnoreEntries = installPlan.gitignoreEntries;
68
64
  ctx.localOnlyGitExcludeEntries = installPlan.gitExcludeEntries;
69
65
  ctx.localOnlyGitUntrackPaths = installPlan.gitUntrackPaths;
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamentis/naome",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Native-first CLI for the NAOME agent harness.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,16 +11,16 @@ const nativeBinaryName = process.platform === "win32" ? "naome.exe" : "naome";
11
11
  const expectedMachineOwnedIntegrity = Object.freeze({
12
12
  ".naome/bin/check-harness-health.js": "sha256:dc4de52b79c69600b9ba47b924e2c2b8de61a2cbfab6d1ccc0f1924d963db657",
13
13
  ".naome/bin/check-task-state.js": "sha256:df54489a22b426180266e5e0fb5f9ec381477419f688435248afbf2b9b38ea81",
14
- ".naome/bin/naome.js": "sha256:d343f367da21bf45272331eec2ea34862a0bf056978780c62d6cae02e0f7993a",
14
+ ".naome/bin/naome.js": "sha256:a34c2e50a68d15ff2722a57590ccddc504e025d3c98ea62fd700d7ec1a789b9a",
15
15
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
16
16
  ".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
17
17
  "AGENTS.md": "sha256:e8b2fc786c1c72b69ba8f2b2ffce4f459e799c7453ce9ff4a9f6448a8f9e6b4f",
18
- "docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
18
+ "docs/naome/agent-workflow.md": "sha256:2fd1fd02eb6849133b9e8227421914580b1c469a60388a063c1b6ed48016b48d",
19
19
  "docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
20
20
  "docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
21
21
  "docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
22
22
  "docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
23
- "docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
23
+ "docs/naome/task-ledger.md": "sha256:ac637a31abdd13eee15a49086594e63f5c88fe12a5cf621b227310788ae7e583",
24
24
  "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
25
25
  });
26
26
 
@@ -11,16 +11,16 @@ const nativeBinaryName = process.platform === "win32" ? "naome.exe" : "naome";
11
11
  const expectedMachineOwnedIntegrity = Object.freeze({
12
12
  ".naome/bin/check-harness-health.js": "sha256:dc4de52b79c69600b9ba47b924e2c2b8de61a2cbfab6d1ccc0f1924d963db657",
13
13
  ".naome/bin/check-task-state.js": "sha256:df54489a22b426180266e5e0fb5f9ec381477419f688435248afbf2b9b38ea81",
14
- ".naome/bin/naome.js": "sha256:d343f367da21bf45272331eec2ea34862a0bf056978780c62d6cae02e0f7993a",
14
+ ".naome/bin/naome.js": "sha256:a34c2e50a68d15ff2722a57590ccddc504e025d3c98ea62fd700d7ec1a789b9a",
15
15
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
16
16
  ".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
17
17
  "AGENTS.md": "sha256:e8b2fc786c1c72b69ba8f2b2ffce4f459e799c7453ce9ff4a9f6448a8f9e6b4f",
18
- "docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
18
+ "docs/naome/agent-workflow.md": "sha256:2fd1fd02eb6849133b9e8227421914580b1c469a60388a063c1b6ed48016b48d",
19
19
  "docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
20
20
  "docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
21
21
  "docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
22
22
  "docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
23
- "docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
23
+ "docs/naome/task-ledger.md": "sha256:ac637a31abdd13eee15a49086594e63f5c88fe12a5cf621b227310788ae7e583",
24
24
  "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
25
25
  });
26
26
 
@@ -12,7 +12,7 @@ const expectedNativeBinaryIntegrity = "sha256:generated";
12
12
  function main(argv) {
13
13
  const [command, ...args] = argv;
14
14
 
15
- if (isHelpRequest(argv)) {
15
+ if (["help", "--help", "-h"].includes(argv[0]) || ["help", "--help", "-h"].includes(argv[1])) {
16
16
  printHelp();
17
17
  process.exit(0);
18
18
  }
@@ -36,10 +36,6 @@ function main(argv) {
36
36
  process.exit(command ? 1 : 0);
37
37
  }
38
38
 
39
- function isHelpRequest(args) {
40
- return ["help", "--help", "-h"].includes(args[0]) || ["help", "--help", "-h"].includes(args[1]);
41
- }
42
-
43
39
  function runNativeDecisionCommand(command, args) {
44
40
  const root = findHarnessRoot(process.cwd());
45
41
  if (!root) {
@@ -173,7 +169,22 @@ function commitBaseline(root, message, options = {}) {
173
169
  }
174
170
 
175
171
  const before = gitHead(root);
176
- runGitOrExit(root, ["add", "-A", "--", ...changedPaths]);
172
+ const tracked = runGit(root, ["ls-files", "-z", "--", ...changedPaths]);
173
+ if (tracked.status !== 0) {
174
+ fail(`Cannot determine tracked task paths: ${tracked.stderr.trim() || tracked.stdout.trim()}`);
175
+ }
176
+ const trackedPaths = tracked.stdout.split("\0").filter(Boolean);
177
+ if (trackedPaths.length > 0) {
178
+ runGitOrExit(root, ["add", "-u", "--", ...trackedPaths]);
179
+ }
180
+ const untracked = runGit(root, ["ls-files", "--others", "--exclude-standard", "-z", "--", ...changedPaths]);
181
+ if (untracked.status !== 0) {
182
+ fail(`Cannot determine untracked task paths: ${untracked.stderr.trim() || untracked.stdout.trim()}`);
183
+ }
184
+ const untrackedPaths = untracked.stdout.split("\0").filter(Boolean);
185
+ if (untrackedPaths.length > 0) {
186
+ runGitOrExit(root, ["add", "--", ...untrackedPaths]);
187
+ }
177
188
  runOrExit(root, [process.execPath, [join(root, ".naome", "bin", "check-task-state.js"), "--commit-gate"]]);
178
189
  runGitOrExit(root, ["commit", "-m", message]);
179
190
  return { before, after: gitHead(root) };
@@ -356,47 +367,7 @@ function findAncestorWithAnyMarker(startPath, markers) {
356
367
  }
357
368
 
358
369
  function printHelp() {
359
- const commands = [
360
- "naome status [--json]",
361
- "naome next [--json]",
362
- "naome intent --prompt-file <path> [--json]",
363
- "naome intent --prompt <text> [--json]",
364
- "naome route --prompt-file <path> [--execute] [--json]",
365
- "naome route --prompt <text> [--execute] [--json]",
366
- "naome explain --prompt-file <path> [--json]",
367
- "naome explain --prompt <text> [--json]",
368
- "naome context select --changed [--json]",
369
- "naome context select --prompt-file <path> [--json]",
370
- "naome context select --prompt <text> [--json]",
371
- "naome doctor [--json]",
372
- "naome task render-state [--write] [--json]",
373
- "naome task migrate-ledger [--write] [--json]",
374
- "naome quality init [--baseline|--deep-baseline] [--json]",
375
- "naome quality check --changed [--include-scanned-paths] [--json]",
376
- "naome quality check --path <path> [--path <path>...] [--include-scanned-paths] [--json]",
377
- "naome quality report [--deep] [--include-scanned-paths] [--json]",
378
- "naome quality cache status [--json]",
379
- "naome quality cache clear",
380
- "naome semantic report [--deep] [--json]",
381
- "naome semantic check --changed [--json]",
382
- "naome semantic check --path <path> [--path <path>...] [--json]",
383
- "naome semantic route --finding <id> [--json]",
384
- "naome semantic loop [--json]",
385
- "naome repo model [--write] [--json]",
386
- "naome repo check [--json]",
387
- "naome repo explain --path <path> [--json]",
388
- "naome structure report [--json]",
389
- "naome structure explain --path <path> [--json]",
390
- "naome cleanup plan [--json]",
391
- "naome cleanup route --path <path> [--json]",
392
- "naome refresh-integrity [--json]",
393
- "naome workflow agent-plan|context-delta|proof-plan|capabilities|edit-watchdog|decision-gate|digest [--json]",
394
- "naome workflow search-profile|check-search|phases|processes|mutations [--json]",
395
- "naome install",
396
- "naome sync",
397
- "naome commit -m \"type(scope): message\"",
398
- "node .naome/bin/naome.js commit -m \"type(scope): message\""
399
- ];
370
+ const commands = "naome status [--json]|naome next [--json]|naome intent --prompt-file <path> [--json]|naome intent --prompt <text> [--json]|naome route --prompt-file <path> [--execute] [--json]|naome route --prompt <text> [--execute] [--json]|naome explain --prompt-file <path> [--json]|naome explain --prompt <text> [--json]|naome context select --changed [--json]|naome context select --prompt-file <path> [--json]|naome context select --prompt <text> [--json]|naome doctor [--json]|naome task render-state [--write] [--json]|naome task migrate-ledger [--write] [--json]|naome quality init [--baseline|--deep-baseline] [--json]|naome quality check --changed [--include-scanned-paths] [--json]|naome quality check --path <path> [--path <path>...] [--include-scanned-paths] [--json]|naome quality report [--deep] [--include-scanned-paths] [--json]|naome quality cache status [--json]|naome quality cache clear|naome semantic report [--deep] [--json]|naome semantic check --changed [--json]|naome semantic check --path <path> [--path <path>...] [--json]|naome semantic route --finding <id> [--json]|naome semantic loop [--json]|naome repo model [--write] [--json]|naome repo check [--json]|naome repo explain --path <path> [--json]|naome structure report [--json]|naome structure explain --path <path> [--json]|naome cleanup plan [--json]|naome cleanup route --path <path> [--json]|naome refresh-integrity [--json]|naome workflow agent-plan|context-delta|proof-plan|capabilities|edit-watchdog|decision-gate|digest [--json]|naome workflow search-profile|check-search|phases|processes|mutations [--json]|naome install|naome sync|naome commit -m \"type(scope): message\"|node .naome/bin/naome.js commit -m \"type(scope): message\"".split("|");
400
371
  console.log(["Usage:", ...commands.map((command) => ` ${command}`)].join("\n"));
401
372
  }
402
373
 
@@ -4,16 +4,16 @@
4
4
  "integrity": {
5
5
  ".naome/bin/check-harness-health.js": "sha256:dc4de52b79c69600b9ba47b924e2c2b8de61a2cbfab6d1ccc0f1924d963db657",
6
6
  ".naome/bin/check-task-state.js": "sha256:df54489a22b426180266e5e0fb5f9ec381477419f688435248afbf2b9b38ea81",
7
- ".naome/bin/naome.js": "sha256:d343f367da21bf45272331eec2ea34862a0bf056978780c62d6cae02e0f7993a",
7
+ ".naome/bin/naome.js": "sha256:a34c2e50a68d15ff2722a57590ccddc504e025d3c98ea62fd700d7ec1a789b9a",
8
8
  ".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
9
9
  ".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
10
10
  "AGENTS.md": "sha256:e8b2fc786c1c72b69ba8f2b2ffce4f459e799c7453ce9ff4a9f6448a8f9e6b4f",
11
- "docs/naome/agent-workflow.md": "sha256:78faeb4eed157b60f0b60bc43da36c713fc4a3436b93bd963ce5f3c12dc91f22",
11
+ "docs/naome/agent-workflow.md": "sha256:2fd1fd02eb6849133b9e8227421914580b1c469a60388a063c1b6ed48016b48d",
12
12
  "docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
13
13
  "docs/naome/execution.md": "sha256:bfc5d55838942ec8e3d790b59e3c634ff5bf6a2298265cef3dca9788a097eafb",
14
14
  "docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
15
15
  "docs/naome/index.md": "sha256:07ef776f49130319a5280bdb3ae38af22141708253f38eb983a4336fbae1b25a",
16
- "docs/naome/task-ledger.md": "sha256:1e524085a2f88811941fd9f2f48ca826bc3e0e4816039d07e795637847714cbd",
16
+ "docs/naome/task-ledger.md": "sha256:ac637a31abdd13eee15a49086594e63f5c88fe12a5cf621b227310788ae7e583",
17
17
  "docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
18
18
  },
19
19
  "machineOwned": [
@@ -114,10 +114,13 @@ Use this workflow after first-run intake is complete.
114
114
  task-state automatically; if a legacy-only active task is still present, run
115
115
  `node .naome/bin/naome.js task migrate-ledger --write --json` before adding
116
116
  completion proof.
117
- 5. Record proof in `.naome/tasks/<task-id>/proofs/`. If legacy compatibility
118
- work is unavoidable, use compact `proofPathSets` and `proofBatches` in
119
- `.naome/task-state.json` and include every changed in-scope path reported by
120
- git in expanded proof evidence.
117
+ 5. Record proof as compact `proofPathSets` and `proofBatches` in
118
+ `.naome/tasks/<task-id>/task.json` when many checks share evidence paths.
119
+ Use `.naome/tasks/<task-id>/proofs/` only when separate per-check files are
120
+ needed for parallel writers or durable audit detail. If legacy compatibility
121
+ work is unavoidable, use the same compact fields in `.naome/task-state.json`
122
+ and include every changed in-scope path reported by git in expanded proof
123
+ evidence.
121
124
  6. Run `node .naome/bin/naome.js task render-state --write --json` before
122
125
  external compatibility checks. Do not hand-edit the rendered projection when
123
126
  `.naome/tasks/active.json` exists.
@@ -8,7 +8,16 @@ Status: Uninitialized
8
8
 
9
9
  ## Known Boundaries
10
10
 
11
- - Unknown.
11
+ - NAOME information falls into durable project state, durable task ledger,
12
+ generated projection, local runtime state, run evidence, and product source.
13
+ - Durable project state is committed repository or package state needed to
14
+ reinstall or reconstruct the harness.
15
+ - `.naome/task-state.json` is a generated compatibility projection when
16
+ `.naome/tasks/active.json` exists. Render it from the ledger instead of
17
+ hand-editing it.
18
+ - `.naome/tmp/` is local runtime state and must not be committed.
19
+ - Per-check proof files are run evidence. Prefer compact ledger proof batches
20
+ when many release checks share the same evidence paths.
12
21
 
13
22
  ## Assumed Boundaries
14
23
 
@@ -20,7 +29,7 @@ Status: Uninitialized
20
29
 
21
30
  ## Generated Or External Code
22
31
 
23
- - Unknown.
32
+ - Generated NAOME projections must be reproducible from durable state.
24
33
 
25
34
  ## Evidence
26
35
 
@@ -26,6 +26,9 @@ new deterministic task tooling can use `.naome/tasks/` as the source of truth.
26
26
  - `mutations.json` records touched paths and mutation ownership.
27
27
  - `proofs/<check-id>.json` stores one verification result per check so parallel
28
28
  checks do not rewrite the same file.
29
+ - `task.json` may also contain compact `proofPathSets` and `proofBatches`.
30
+ Prefer that release shape when many checks share evidence paths and detailed
31
+ command logs are already retained by CI or the local run history.
29
32
 
30
33
  ## Compatibility
31
34
 
@@ -60,7 +63,7 @@ whether product changes stay inside `allowedPaths`.
60
63
  The intended long-term model is:
61
64
 
62
65
  ```text
63
- task spec + events + mutations + proofs + verification config
66
+ task spec + events + mutations + compact proof batches + verification config
64
67
  => canonical task model
65
68
  => generated task-state projection
66
69
  => gates / route / commit / completion
@@ -69,3 +72,12 @@ task spec + events + mutations + proofs + verification config
69
72
  This keeps old repositories backward-compatible while making future parallel
70
73
  agents safer: separate agents and checks can write separate event/proof files
71
74
  instead of all competing for `.naome/task-state.json`.
75
+
76
+ ## Information Policy
77
+
78
+ Use `node .naome/bin/naome.js workflow information --path <path> --json` before
79
+ changing NAOME control files whose retention is unclear. Durable configuration,
80
+ templates, task specs, and task events are restored from repository or package
81
+ state. `.naome/task-state.json` is generated from durable state. `.naome/tmp/`
82
+ is local runtime state. Per-check proof files are run evidence; compact release
83
+ proof batches keep release diffs readable without losing verification coverage.
@@ -17,10 +17,6 @@ touched-file feedback. This catches local size, symbol, duplicate, structure,
17
17
  and stale-policy issues before the task grows. It does not replace the final
18
18
  `repository-quality-check`; always run the changed-file gate before completion.
19
19
 
20
- Optional Codex hooks can provide the same kind of early feedback during an
21
- agent run. They are acceleration only; final proof still comes from the
22
- commands in this document and `.naome/verification.json`.
23
-
24
20
  ## Known Checks
25
21
 
26
22
  | Check id | Command | Cwd | Cost | Last verified |
@@ -1,121 +0,0 @@
1
- import { createInterface } from "node:readline/promises";
2
- import { stdin as input, stdout as output } from "node:process";
3
- import { existsSync, readFileSync } from "node:fs";
4
- import { join } from "node:path";
5
-
6
- import { replaceHarnessFile } from "./harness-file-ops.js";
7
- import { printSection } from "./output.js";
8
-
9
- const HOOK_CONFIG_PATH = ".codex/hooks.json";
10
- const HOOK_FEATURE_CONFIG_PATH = ".codex/config.toml";
11
- const HOOK_DISPATCHER_PATH = ".naome/bin/codex-hook.js";
12
- const HOOK_IO_PATH = ".naome/bin/codex-hook-io.js";
13
- const HOOK_POLICY_PATH = ".naome/bin/codex-hook-policy.js";
14
- const HOOK_RUNTIME_PATH = ".naome/bin/codex-hook-runtime.js";
15
- const HOOK_DOC_PATH = "docs/naome/codex-hooks.md";
16
-
17
- const CODEX_HOOK_MACHINE_PATHS = [
18
- HOOK_FEATURE_CONFIG_PATH,
19
- HOOK_CONFIG_PATH,
20
- HOOK_DISPATCHER_PATH,
21
- HOOK_IO_PATH,
22
- HOOK_POLICY_PATH,
23
- HOOK_RUNTIME_PATH,
24
- HOOK_DOC_PATH,
25
- ];
26
- const CODEX_HOOK_EXECUTABLE_PATHS = [HOOK_DISPATCHER_PATH];
27
-
28
- export async function resolveCodexHooksPreference(ctx) {
29
- const override = parseCodexHooksOverride(process.env.NAOME_CODEX_HOOKS);
30
- if (override !== null) {
31
- setCodexHooksEnabled(ctx, override);
32
- return;
33
- }
34
-
35
- if (hasManagedCodexHooks(ctx)) {
36
- setCodexHooksEnabled(ctx, true);
37
- return;
38
- }
39
-
40
- if (!process.stdin.isTTY || process.env.CI === "true") {
41
- setCodexHooksEnabled(ctx, false);
42
- return;
43
- }
44
-
45
- printSection(ctx, "Optional Codex Hooks");
46
- console.log(`${ctx.color.dim("purpose")} earlier NAOME feedback for Codex agents`);
47
- console.log(`${ctx.color.dim("scope ")} repo-local acceleration only; normal NAOME gates remain authoritative`);
48
- console.log(`${ctx.color.dim("human ")} optional; declining keeps install and sync working`);
49
- console.log("");
50
-
51
- const rl = createInterface({ input, output });
52
- const answer = await rl.question(`${ctx.color.yellow("?")} Install optional Codex Hooks for this repository? (y/N) `);
53
- rl.close();
54
-
55
- setCodexHooksEnabled(ctx, answer.trim().toLowerCase() === "y");
56
- }
57
-
58
- export function ensureCodexHooks(ctx, archiveDirName) {
59
- if (!ctx.codexHooksEnabled) {
60
- return;
61
- }
62
-
63
- ensureCodexHookManifestPaths(ctx);
64
- for (const relativePath of ctx.optionalCodexHookPaths) {
65
- replaceHarnessFile(ctx, relativePath, archiveDirName);
66
- }
67
- }
68
-
69
- export function ensureCodexHookManifestPaths(ctx) {
70
- for (const relativePath of CODEX_HOOK_MACHINE_PATHS) {
71
- appendUnique(ctx.machineOwnedPaths, relativePath);
72
- appendUnique(ctx.localOnlyMachineOwnedPaths, relativePath);
73
- appendUnique(ctx.localOnlyGitExcludeEntries, relativePath);
74
- appendUnique(ctx.localOnlyGitUntrackPaths, relativePath);
75
- }
76
- for (const relativePath of CODEX_HOOK_EXECUTABLE_PATHS) {
77
- ctx.executableMachineOwnedPaths.add(relativePath);
78
- }
79
- }
80
-
81
- function setCodexHooksEnabled(ctx, enabled) {
82
- ctx.codexHooksEnabled = enabled;
83
- if (enabled) {
84
- ensureCodexHookManifestPaths(ctx);
85
- }
86
- }
87
-
88
- function hasManagedCodexHooks(ctx) {
89
- const hookConfigPath = join(ctx.targetRoot, HOOK_CONFIG_PATH);
90
- if (!existsSync(hookConfigPath)) {
91
- return false;
92
- }
93
-
94
- try {
95
- const hooks = JSON.parse(readFileSync(hookConfigPath, "utf8"));
96
- return hooks.schema === "naome.codex-hooks.v1";
97
- } catch {
98
- return false;
99
- }
100
- }
101
-
102
- function parseCodexHooksOverride(value) {
103
- if (value === undefined) {
104
- return null;
105
- }
106
-
107
- const normalized = value.trim().toLowerCase();
108
- if (["1", "true", "yes", "y", "on"].includes(normalized)) {
109
- return true;
110
- }
111
- if (["0", "false", "no", "n", "off"].includes(normalized)) {
112
- return false;
113
- }
114
- return null;
115
- }
116
-
117
- function appendUnique(values, value) {
118
- if (!values.includes(value)) {
119
- values.push(value);
120
- }
121
- }
@@ -1,2 +0,0 @@
1
- [features]
2
- codex_hooks = true
@@ -1,70 +0,0 @@
1
- {
2
- "schema": "naome.codex-hooks.v1",
3
- "version": 1,
4
- "hooks": {
5
- "SessionStart": [
6
- {
7
- "matcher": "startup|resume|clear",
8
- "hooks": [
9
- {
10
- "type": "command",
11
- "command": "node .naome/bin/codex-hook.js --event SessionStart"
12
- }
13
- ]
14
- }
15
- ],
16
- "UserPromptSubmit": [
17
- {
18
- "hooks": [
19
- {
20
- "type": "command",
21
- "command": "node .naome/bin/codex-hook.js --event UserPromptSubmit"
22
- }
23
- ]
24
- }
25
- ],
26
- "PreToolUse": [
27
- {
28
- "matcher": "*",
29
- "hooks": [
30
- {
31
- "type": "command",
32
- "command": "node .naome/bin/codex-hook.js --event PreToolUse"
33
- }
34
- ]
35
- }
36
- ],
37
- "PermissionRequest": [
38
- {
39
- "matcher": "*",
40
- "hooks": [
41
- {
42
- "type": "command",
43
- "command": "node .naome/bin/codex-hook.js --event PermissionRequest"
44
- }
45
- ]
46
- }
47
- ],
48
- "PostToolUse": [
49
- {
50
- "matcher": "*",
51
- "hooks": [
52
- {
53
- "type": "command",
54
- "command": "node .naome/bin/codex-hook.js --event PostToolUse"
55
- }
56
- ]
57
- }
58
- ],
59
- "Stop": [
60
- {
61
- "hooks": [
62
- {
63
- "type": "command",
64
- "command": "node .naome/bin/codex-hook.js --event Stop"
65
- }
66
- ]
67
- }
68
- ]
69
- }
70
- }