@miroshnik/elves 2026.1026.2 → 2026.1026.3

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.
@@ -2,7 +2,7 @@ import {
2
2
  invariant2,
3
3
  codeOnly2,
4
4
  envNamesInCode2
5
- } from "./harness-q8q5bvat.js";
5
+ } from "./harness-dgtt7kht.js";
6
6
  import {
7
7
  locale_default
8
8
  } from "./harness-xqp7tdyr.js";
@@ -15631,9 +15631,10 @@ function testFileAt(stack, root) {
15631
15631
  for (const m of stack.matchAll(STACK_FILE)) {
15632
15632
  const abs = m[1];
15633
15633
  const rel = path2.relative(root, abs).split(path2.sep).join("/");
15634
- if (!rel.startsWith(".."))
15635
- return { rel, abs };
15636
15634
  const i = abs.indexOf("/tests/");
15635
+ const inTests = i >= 0 && !path2.relative(abs.slice(0, i + "/tests".length), root).startsWith("..");
15636
+ if (!rel.startsWith("..") && !inTests)
15637
+ return { rel, abs };
15637
15638
  if (i >= 0)
15638
15639
  return { rel: abs.slice(i + 1), abs };
15639
15640
  }
@@ -23,7 +23,7 @@ import {
23
23
  envNamesInCode2,
24
24
  dotenvNames2,
25
25
  envVars2
26
- } from "./harness-q8q5bvat.js";
26
+ } from "./harness-dgtt7kht.js";
27
27
  export {
28
28
  ENV_SERVICE2 as ENV_SERVICE,
29
29
  codeFiles2 as codeFiles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miroshnik/elves",
3
- "version": "2026.1026.2",
3
+ "version": "2026.1026.3",
4
4
  "type": "module",
5
5
  "description": "Elves — a development flow with AI agents: shared rules and skills for any agent; install — bunx @miroshnik/elves install -g; the installer and skill scripts — TypeScript under Bun, tests — bun test in tests/",
6
6
  "repository": {
@@ -72,5 +72,5 @@
72
72
  "eslint-plugin-boundaries": "^7.2.0",
73
73
  "knip": "^6.41.0"
74
74
  },
75
- "gitHead": "d4afa46ebc54c4c981f5f22822bebbd9c21e4d95"
75
+ "gitHead": "dc0511ec6dc2569d601baa3490d19fd386bffd26"
76
76
  }
@@ -892,13 +892,18 @@ export function testFileIn(stack: string, root: string): string | null {
892
892
  return testFileAt(stack, root)?.rel ?? null;
893
893
  }
894
894
 
895
- /** The same plus the file's absolute path: `rel` — from the project root, `abs` ends with `rel`. */
895
+ /**
896
+ * The same plus the file's absolute path: `rel` — from the project root, `abs` ends with `rel`. A runner outside the
897
+ * project root (a monorepo package's directory) or inside its `tests/` (a package of tests, #754) — `rel` from the
898
+ * directory with that `tests/`, not from the runner's cwd.
899
+ */
896
900
  function testFileAt(stack: string, root: string): { rel: string; abs: string } | null {
897
901
  for (const m of stack.matchAll(STACK_FILE)) {
898
902
  const abs = m[1]!;
899
903
  const rel = path.relative(root, abs).split(path.sep).join("/");
900
- if (!rel.startsWith("..")) return { rel, abs };
901
904
  const i = abs.indexOf("/tests/");
905
+ const inTests = i >= 0 && !path.relative(abs.slice(0, i + "/tests".length), root).startsWith("..");
906
+ if (!rel.startsWith("..") && !inTests) return { rel, abs };
902
907
  if (i >= 0) return { rel: abs.slice(i + 1), abs };
903
908
  }
904
909
  return null;