oh-my-codex 0.21.36 → 0.21.38
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 +6 -6
- package/Cargo.toml +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +88 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js +81 -2
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +122 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +123 -0
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/package-manager-ownership.js +1 -1
- package/dist/cli/package-manager-ownership.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +35 -4
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +25 -4
- package/dist/config/generator.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
package/Cargo.lock
CHANGED
|
@@ -32,7 +32,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "omx-api"
|
|
35
|
-
version = "0.21.
|
|
35
|
+
version = "0.21.38"
|
|
36
36
|
dependencies = [
|
|
37
37
|
"serde",
|
|
38
38
|
"serde_json",
|
|
@@ -40,14 +40,14 @@ dependencies = [
|
|
|
40
40
|
|
|
41
41
|
[[package]]
|
|
42
42
|
name = "omx-explore-harness"
|
|
43
|
-
version = "0.21.
|
|
43
|
+
version = "0.21.38"
|
|
44
44
|
dependencies = [
|
|
45
45
|
"libc",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "omx-mux"
|
|
50
|
-
version = "0.21.
|
|
50
|
+
version = "0.21.38"
|
|
51
51
|
dependencies = [
|
|
52
52
|
"serde",
|
|
53
53
|
"serde_json",
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
|
|
56
56
|
[[package]]
|
|
57
57
|
name = "omx-runtime"
|
|
58
|
-
version = "0.21.
|
|
58
|
+
version = "0.21.38"
|
|
59
59
|
dependencies = [
|
|
60
60
|
"fs2",
|
|
61
61
|
"libc",
|
|
@@ -67,7 +67,7 @@ dependencies = [
|
|
|
67
67
|
|
|
68
68
|
[[package]]
|
|
69
69
|
name = "omx-runtime-core"
|
|
70
|
-
version = "0.21.
|
|
70
|
+
version = "0.21.38"
|
|
71
71
|
dependencies = [
|
|
72
72
|
"fs2",
|
|
73
73
|
"serde",
|
|
@@ -76,7 +76,7 @@ dependencies = [
|
|
|
76
76
|
|
|
77
77
|
[[package]]
|
|
78
78
|
name = "omx-sparkshell"
|
|
79
|
-
version = "0.21.
|
|
79
|
+
version = "0.21.38"
|
|
80
80
|
dependencies = [
|
|
81
81
|
"omx-mux",
|
|
82
82
|
]
|
package/Cargo.toml
CHANGED
|
@@ -574,6 +574,41 @@ command = "node"
|
|
|
574
574
|
await rm(wd, { recursive: true, force: true });
|
|
575
575
|
}
|
|
576
576
|
});
|
|
577
|
+
it("reports claim-digest mismatches in setup and doctor", async () => {
|
|
578
|
+
const wd = await mkdtemp(join(tmpdir(), "omx-doctor-plugin-cache-claim-digest-"));
|
|
579
|
+
try {
|
|
580
|
+
const home = join(wd, "home");
|
|
581
|
+
const codexDir = join(home, ".codex");
|
|
582
|
+
await mkdir(codexDir, { recursive: true });
|
|
583
|
+
const setupRes = runOmx(wd, ["setup", "--scope", "user", "--plugin", "--force"], { HOME: home, CODEX_HOME: codexDir });
|
|
584
|
+
if (shouldSkipForSpawnPermissions(setupRes.error))
|
|
585
|
+
return;
|
|
586
|
+
assert.equal(setupRes.status, 0, setupRes.stderr || setupRes.stdout);
|
|
587
|
+
const version = await packagedPluginVersion();
|
|
588
|
+
const cacheDir = join(codexDir, "plugins", "cache", "oh-my-codex-local", "oh-my-codex", version);
|
|
589
|
+
const completePath = join(cacheDir, ".omx-complete");
|
|
590
|
+
const completion = JSON.parse(await readFile(completePath, "utf-8"));
|
|
591
|
+
const wrongDigest = `${completion.claimDigest[0] === "0" ? "1" : "0"}${completion.claimDigest.slice(1)}`;
|
|
592
|
+
await writeFile(completePath, `${JSON.stringify({ ...completion, claimDigest: wrongDigest })}\n`);
|
|
593
|
+
const setupWithDrift = runOmx(wd, ["setup", "--scope", "user", "--plugin"], {
|
|
594
|
+
HOME: home,
|
|
595
|
+
CODEX_HOME: codexDir,
|
|
596
|
+
});
|
|
597
|
+
if (shouldSkipForSpawnPermissions(setupWithDrift.error))
|
|
598
|
+
return;
|
|
599
|
+
assert.equal(setupWithDrift.status, 0, setupWithDrift.stderr || setupWithDrift.stdout);
|
|
600
|
+
assert.match(setupWithDrift.stdout, /claim digest mismatch/);
|
|
601
|
+
const doctorRes = runOmx(wd, ["doctor"], { HOME: home, CODEX_HOME: codexDir });
|
|
602
|
+
if (shouldSkipForSpawnPermissions(doctorRes.error))
|
|
603
|
+
return;
|
|
604
|
+
assert.equal(doctorRes.status, 0, doctorRes.stderr || doctorRes.stdout);
|
|
605
|
+
assert.match(doctorRes.stdout, /Skills: plugin marketplace oh-my-codex-local cache provenance is invalid: cache snapshot claim digest mismatch/);
|
|
606
|
+
assert.match(doctorRes.stdout, /Plugin versions: expected cache directory .* has invalid plugin cache provenance: cache snapshot claim digest mismatch/);
|
|
607
|
+
}
|
|
608
|
+
finally {
|
|
609
|
+
await rm(wd, { recursive: true, force: true });
|
|
610
|
+
}
|
|
611
|
+
});
|
|
577
612
|
it("warns with pointer-specific diagnostics when the cached manifest drifts", async () => {
|
|
578
613
|
const wd = await mkdtemp(join(tmpdir(), "omx-doctor-plugin-cache-pointer-drift-"));
|
|
579
614
|
try {
|
|
@@ -1719,6 +1754,59 @@ command = "node"
|
|
|
1719
1754
|
await rm(wd, { recursive: true, force: true });
|
|
1720
1755
|
}
|
|
1721
1756
|
});
|
|
1757
|
+
it("doctor and its plugin-cache repair command handle stale OMX plugin hook trust (#3918)", async () => {
|
|
1758
|
+
const wd = await mkdtemp(join(tmpdir(), "omx-doctor-plugin-hook-trust-3918-"));
|
|
1759
|
+
try {
|
|
1760
|
+
const home = join(wd, "home");
|
|
1761
|
+
const codexDir = join(home, ".codex");
|
|
1762
|
+
const configPath = join(codexDir, "config.toml");
|
|
1763
|
+
await mkdir(codexDir, { recursive: true });
|
|
1764
|
+
const initialSetup = runOmx(wd, ["setup", "--scope", "user", "--plugin"], {
|
|
1765
|
+
HOME: home,
|
|
1766
|
+
CODEX_HOME: codexDir,
|
|
1767
|
+
});
|
|
1768
|
+
if (shouldSkipForSpawnPermissions(initialSetup.error))
|
|
1769
|
+
return;
|
|
1770
|
+
assert.equal(initialSetup.status, 0, initialSetup.stderr || initialSetup.stdout);
|
|
1771
|
+
const pluginManifest = JSON.parse(await readFile(join(repoRoot(), "plugins", "oh-my-codex", ".codex-plugin", "plugin.json"), "utf-8"));
|
|
1772
|
+
const pluginHooksPath = join(codexDir, "plugins", "cache", "oh-my-codex-local", "oh-my-codex", pluginManifest.version, "hooks", "hooks.json");
|
|
1773
|
+
const initialPluginHooks = await readFile(pluginHooksPath, "utf-8");
|
|
1774
|
+
const mutatedHooks = JSON.parse(initialPluginHooks);
|
|
1775
|
+
mutatedHooks.hooks.PostCompact[0].hooks[0].command += " --cache-rebuild-probe";
|
|
1776
|
+
await writeFile(pluginHooksPath, `${JSON.stringify(mutatedHooks, null, 2)}\n`);
|
|
1777
|
+
const pluginKey = "oh-my-codex@oh-my-codex-local:hooks/hooks.json:post_compact:0:0";
|
|
1778
|
+
const staleHash = `sha256:${"1".repeat(64)}`;
|
|
1779
|
+
const configWithStalePluginTrust = [
|
|
1780
|
+
(await readFile(configPath, "utf-8")).trimEnd(),
|
|
1781
|
+
"",
|
|
1782
|
+
"# OMX-owned Codex hook trust state",
|
|
1783
|
+
`[hooks.state.${JSON.stringify(pluginKey)}]`,
|
|
1784
|
+
`trusted_hash = ${JSON.stringify(staleHash)}`,
|
|
1785
|
+
"# End OMX-owned Codex hook trust state",
|
|
1786
|
+
"",
|
|
1787
|
+
].join("\n");
|
|
1788
|
+
await writeFile(configPath, configWithStalePluginTrust, "utf-8");
|
|
1789
|
+
const doctorResult = runOmx(wd, ["doctor"], { HOME: home, CODEX_HOME: codexDir });
|
|
1790
|
+
if (shouldSkipForSpawnPermissions(doctorResult.error))
|
|
1791
|
+
return;
|
|
1792
|
+
assert.equal(doctorResult.status, 0, doctorResult.stderr || doctorResult.stdout);
|
|
1793
|
+
assert.match(doctorResult.stdout, /Native hooks: plugin-scoped hooks are enabled, but cached plugin hook files or pinned hook launcher/);
|
|
1794
|
+
assert.match(doctorResult.stdout, /run `omx setup --plugin --repair-plugin-cache` to refresh the plugin cache/);
|
|
1795
|
+
assert.doesNotMatch(doctorResult.stdout, /managed_trust_key_conflict/);
|
|
1796
|
+
const setupResult = runOmx(wd, ["setup", "--scope", "user", "--plugin", "--repair-plugin-cache"], {
|
|
1797
|
+
HOME: home,
|
|
1798
|
+
CODEX_HOME: codexDir,
|
|
1799
|
+
});
|
|
1800
|
+
if (shouldSkipForSpawnPermissions(setupResult.error))
|
|
1801
|
+
return;
|
|
1802
|
+
assert.equal(setupResult.status, 0, setupResult.stderr || setupResult.stdout);
|
|
1803
|
+
assert.doesNotMatch(await readFile(configPath, "utf-8"), /oh-my-codex@oh-my-codex-local:hooks\/hooks\.json:/);
|
|
1804
|
+
assert.equal(await readFile(pluginHooksPath, "utf-8"), initialPluginHooks);
|
|
1805
|
+
}
|
|
1806
|
+
finally {
|
|
1807
|
+
await rm(wd, { recursive: true, force: true });
|
|
1808
|
+
}
|
|
1809
|
+
});
|
|
1722
1810
|
it("still rejects stale foreign trust at a managed-first migration destination", async () => {
|
|
1723
1811
|
const wd = await mkdtemp(join(tmpdir(), "omx-doctor-hooks-stale-destination-trust-"));
|
|
1724
1812
|
try {
|