@warren-dean/code-kit 0.38.1 → 0.38.2

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.
@@ -9,7 +9,7 @@
9
9
  "name": "code-kit",
10
10
  "source": "./",
11
11
  "description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
12
- "version": "0.38.1",
12
+ "version": "0.38.2",
13
13
  "category": "development",
14
14
  "tags": ["guardrails", "architecture", "lanes", "layers", "spec-driven", "ci", "multi-agent"],
15
15
  "license": "MIT"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-kit",
3
- "version": "0.38.1",
3
+ "version": "0.38.2",
4
4
  "description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
5
5
  "author": {
6
6
  "name": "Warren Langeveldt"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  What changed in each release of code-kit, newest first. Versions follow the plugin manifest and the npm package `@warren-dean/code-kit`. Each release is also on [GitHub Releases](https://github.com/warrendeanlangeveldt/code-kit/releases).
4
4
 
5
+ ## 0.38.2 (2026-11-16)
6
+
7
+ - **Layers that name one file.** A layer whose path is a single file (`server/routes.ts`) never matched the imports of it, which are written without the extension (`./routes`) or with the `.js` TypeScript gives them, so the layer rules let those imports through. They're now held to the rules like any other. A `routes*` pattern written to get round it still works.
8
+
5
9
  ## 0.38.1 (2026-11-16)
6
10
 
7
11
  - **Shared lists found from the history.** In a project built as streams, `code-kit next` now tells the platform's lead (or the lead in the main checkout) when a core file looks like a shared list: three stories of two or more streams changed it only by adding lines. It names the stories and gives the `anyActor` entry to propose to you, so a project set up before shared lists existed finds its own without re-running init.
@@ -39,6 +39,27 @@ export function targetOf(spec, rel, aliases) {
39
39
  : posix.normalize(posix.join(aliases[prefix], spec.slice(prefix.length)));
40
40
  }
41
41
 
42
+ const SOURCE_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'];
43
+
44
+ /**
45
+ * The layer an import's target is in: the path as written, as a file with each source extension (a layer
46
+ * may name one file, and `./routes` imports `routes.ts`; `./routes.js` in TypeScript names `routes.ts`),
47
+ * or a folder's index.
48
+ */
49
+ function layerOfImport(target, layers) {
50
+ const bare = target.replace(/\.(js|jsx|mjs|cjs)$/, '');
51
+ for (const candidate of [
52
+ target,
53
+ ...SOURCE_EXTENSIONS.map((ext) => `${bare}${ext}`),
54
+ `${target}/index`,
55
+ ...SOURCE_EXTENSIONS.map((ext) => `${target}/index${ext}`),
56
+ ]) {
57
+ const layer = layerOf(candidate, layers);
58
+ if (layer) return layer;
59
+ }
60
+ return null;
61
+ }
62
+
42
63
  /** Every import in `source` (the file at repo path `rel`) that breaks the layer rules. */
43
64
  export function layerProblems(rel, source, config) {
44
65
  if (!CODE.test(rel) || config.layers.length === 0) return [];
@@ -53,7 +74,7 @@ export function layerProblems(rel, source, config) {
53
74
  problems.push(`${rel} (${layer.name}) may not import the package ${spec}.`);
54
75
  continue;
55
76
  }
56
- const to = layerOf(target, config.layers) ?? layerOf(`${target}/index`, config.layers);
77
+ const to = layerOfImport(target, config.layers);
57
78
  // STRM-5: a module uses core and its own stream's modules; core uses no module.
58
79
  const crossing = to && crossesStreams(layer, to);
59
80
  if (crossing) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warren-dean/code-kit",
3
- "version": "0.38.1",
3
+ "version": "0.38.2",
4
4
  "description": "Keeps AI coding agents inside your project's rules: lanes, layer rules, protected paths and proof before finish, enforced by Claude Code hooks and in CI",
5
5
  "license": "MIT",
6
6
  "author": "Warren Langeveldt",