@kuznai/inception-engine 0.24.0 → 0.25.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.
@@ -1,8 +1,8 @@
1
1
  import assert from "node:assert/strict";
2
- import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
2
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { describe, it } from "node:test";
5
- import { lookupDeployment, registerDeployment, } from "../../src/core/ownership.js";
5
+ import { defaultRegistryPersistence, lookupDeployment, registerDeployment, } from "../../src/core/ownership.js";
6
6
  import { executeRevert, planRevert, planRevertAll, } from "../../src/core/revert.js";
7
7
  import { logger } from "../../src/logger.js";
8
8
  import { exists, makeTmpDir } from "../helpers/fs.js";
@@ -159,7 +159,8 @@ describe("executeRevert reserved state protections", () => {
159
159
  try {
160
160
  const target = path.join(home, ".inception-engine", "registry.json");
161
161
  await mkdir(path.dirname(target), { recursive: true });
162
- await writeFile(target, "{}");
162
+ const initialContent = '{\n "version": 1,\n "deployments": {}\n}\n';
163
+ await writeFile(target, initialContent);
163
164
  const { failed, succeeded } = await executeRevert([
164
165
  {
165
166
  kind: "file-write",
@@ -171,7 +172,7 @@ describe("executeRevert reserved state protections", () => {
171
172
  assert.equal(succeeded, 0);
172
173
  assert.equal(failed.length, 1);
173
174
  assert.match(failed[0]?.error ?? "", /Refusing to modify inception-engine state directory/);
174
- assert.equal(await readFile(target, "utf-8"), "{}");
175
+ assert.equal(await readFile(target, "utf-8"), initialContent);
175
176
  }
176
177
  finally {
177
178
  await rm(home, { recursive: true, force: true });
@@ -256,20 +257,21 @@ describe("executeRevert — copy method (cross-platform)", () => {
256
257
  agent: "claude-code",
257
258
  method: "copy",
258
259
  });
259
- const registryFile = path.join(home, ".inception-engine", "registry.json");
260
- await chmod(registryFile, 0o444);
261
- const { succeeded, skipped, failed } = await executeRevert(actions, false, false, home);
260
+ // Simulate an unwritable registry via a failing RegistryPersistence
261
+ // instead of relying on chmod, which is not enforced for admin processes
262
+ // on Windows (e.g. GitHub Actions windows-latest runners).
263
+ const failingRegistry = {
264
+ load: (h) => defaultRegistryPersistence.load(h),
265
+ save: async () => {
266
+ throw Object.assign(new Error("EACCES: permission denied, open 'registry.json'"), { code: "EACCES" });
267
+ },
268
+ };
269
+ const { succeeded, skipped, failed } = await executeRevert(actions, false, false, home, { registry: failingRegistry });
262
270
  assert.equal(succeeded, 0);
263
271
  assert.equal(skipped, 0);
264
272
  assert.equal(failed.length, 1);
265
273
  }
266
274
  finally {
267
- try {
268
- await chmod(path.join(home, ".inception-engine", "registry.json"), 0o666);
269
- }
270
- catch {
271
- /* best effort */
272
- }
273
275
  await rm(home, { recursive: true, force: true });
274
276
  await rm(sourceDir, { recursive: true, force: true });
275
277
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuznai/inception-engine",
3
- "version": "0.24.0",
3
+ "version": "0.25.1",
4
4
  "description": "Deploy AI agent skills from a git repo to user home directories",
5
5
  "license": "MIT",
6
6
  "author": "Damian Piątkowski",