@lamentis/naome 1.3.5 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.lock CHANGED
@@ -76,7 +76,7 @@ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
76
76
 
77
77
  [[package]]
78
78
  name = "naome-cli"
79
- version = "1.3.5"
79
+ version = "1.3.6"
80
80
  dependencies = [
81
81
  "naome-core",
82
82
  "serde_json",
@@ -84,7 +84,7 @@ dependencies = [
84
84
 
85
85
  [[package]]
86
86
  name = "naome-core"
87
- version = "1.3.5"
87
+ version = "1.3.6"
88
88
  dependencies = [
89
89
  "serde",
90
90
  "serde_json",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "naome-cli"
3
- version = "1.3.5"
3
+ version = "1.3.6"
4
4
  edition.workspace = true
5
5
  license.workspace = true
6
6
  repository.workspace = true
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "naome-core"
3
- version = "1.3.5"
3
+ version = "1.3.6"
4
4
  edition.workspace = true
5
5
  license.workspace = true
6
6
  repository.workspace = true
@@ -1,3 +1,5 @@
1
+ import { posix } from "node:path";
2
+
1
3
  import { ensureArchiveDirectory, copyTemplateFile, walk } from "./filesystem.js";
2
4
  import {
3
5
  ensureBuiltInVerificationChecks,
@@ -19,7 +21,7 @@ import { printError } from "./output.js";
19
21
  import { compareVersions } from "./version.js";
20
22
  import { confirmAgentsTakeover, takeoverExistingAgents } from "./agents.js";
21
23
 
22
- const legacyCodexHookPaths = [
24
+ const legacyOptionalHookPaths = [
23
25
  ".codex/config.toml",
24
26
  ".codex/hooks.json",
25
27
  ".naome/bin/codex-hook-io.js",
@@ -63,10 +65,14 @@ export async function runExistingInstall(ctx, existingInstall) {
63
65
  }
64
66
 
65
67
  ensureArchiveDirectory(ctx);
66
- await runRepair(ctx, existingInstall.version, { fromVersion: existingInstall.version });
68
+ await runRepair(ctx, existingInstall.version, {
69
+ existingManifest: existingInstall.manifest,
70
+ fromVersion: existingInstall.version,
71
+ retireLegacyOptionalHooks: true,
72
+ });
67
73
  } else {
68
74
  ensureArchiveDirectory(ctx);
69
- await runRepair(ctx, existingInstall.version);
75
+ await runRepair(ctx, existingInstall.version, { existingManifest: existingInstall.manifest });
70
76
  }
71
77
  }
72
78
 
@@ -89,14 +95,57 @@ async function runRepair(ctx, version, options = {}) {
89
95
  ensureBuiltInVerificationChecks(ctx);
90
96
  ensureTestingProofHarnessSections(ctx);
91
97
  ensureRepositoryStructurePolicyFiles(ctx);
92
- removeLegacyCodexHookFiles(ctx, `repair-${version}`);
98
+ removeRetiredMachineOwnedFiles(ctx, options.existingManifest, `repair-${version}`, {
99
+ extraPaths: options.retireLegacyOptionalHooks ? legacyOptionalHookPaths : [],
100
+ });
93
101
  refreshManifestHealthMetadata(ctx);
94
102
  ensureCompleteUpgradeState(ctx, options.fromVersion ?? null);
95
103
  ensureLocalOnlySourceControlBoundary(ctx);
96
104
  }
97
105
 
98
- function removeLegacyCodexHookFiles(ctx, archiveDirName) {
99
- for (const relativePath of legacyCodexHookPaths) {
106
+ function removeRetiredMachineOwnedFiles(ctx, manifest, archiveDirName, options = {}) {
107
+ const currentOwnedPaths = new Set([
108
+ ...ctx.machineOwnedPaths,
109
+ ...ctx.projectOwnedPaths,
110
+ ...ctx.localOnlyMachineOwnedPaths,
111
+ ctx.nativeBinaryRelativePath,
112
+ ].filter(Boolean));
113
+ const retiredPaths = [
114
+ ...(Array.isArray(manifest?.machineOwned) ? manifest.machineOwned : []),
115
+ ...(Array.isArray(options.extraPaths) ? options.extraPaths : []),
116
+ ];
117
+
118
+ for (const relativePath of [...new Set(retiredPaths)]) {
119
+ if (!isSafeManifestPath(relativePath)) {
120
+ const pathLabel = String(relativePath);
121
+ ctx.skipped.push(pathLabel);
122
+ ctx.unsafeSkipped.push(pathLabel);
123
+ continue;
124
+ }
125
+
126
+ if (currentOwnedPaths.has(relativePath)) {
127
+ continue;
128
+ }
129
+
100
130
  removeLegacyHarnessFile(ctx, relativePath, archiveDirName);
101
131
  }
102
132
  }
133
+
134
+ function isSafeManifestPath(relativePath) {
135
+ if (
136
+ typeof relativePath !== "string" ||
137
+ relativePath.length === 0 ||
138
+ relativePath.includes("\0") ||
139
+ relativePath.includes("\\") ||
140
+ relativePath.includes(":")
141
+ ) {
142
+ return false;
143
+ }
144
+
145
+ if (posix.isAbsolute(relativePath)) {
146
+ return false;
147
+ }
148
+
149
+ const normalizedPath = posix.normalize(relativePath);
150
+ return normalizedPath === relativePath && normalizedPath !== "." && !normalizedPath.startsWith("../");
151
+ }
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamentis/naome",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Native-first CLI for the NAOME agent harness.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -10,7 +10,6 @@
10
10
  "ai",
11
11
  "harness",
12
12
  "repository",
13
- "codex",
14
13
  "claude"
15
14
  ],
16
15
  "repository": {