mcts-mem 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/lint.js +9 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcts-mem",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Build, verify, and explore an MCTS-Mem design tree — a structured, linter-checked memory of how a project was decided.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/lint.js CHANGED
@@ -177,9 +177,16 @@ export function lint(root, opts = {}) {
177
177
  for (const b of [...n.facts, ...n.moves]) treeEntries.add(b.replace(/\s+/g, ' '));
178
178
  }
179
179
  for (const p of ctx.nodeFiles) {
180
- const rel = path.relative(repoRoot, p);
180
+ // Resolve each node against the tree root (which is git's cwd) and let
181
+ // git map it to the worktree root via the `HEAD:./<path>` form. Deriving
182
+ // the path from `rev-parse --show-toplevel` is fragile on Windows, where
183
+ // the toplevel git reports and the realpath'd root can differ (short vs
184
+ // long names, drive-letter case): path.relative then yields a bogus
185
+ // ../.. chain, every lookup misses, and R-append silently never runs.
186
+ // Forward-slash because git pathspecs always use '/'.
187
+ const rel = path.relative(ctx.root, p).split(path.sep).join('/');
181
188
  let old;
182
- try { old = git('show', `HEAD:${rel}`); } catch { continue; } // new file
189
+ try { old = git('show', `HEAD:./${rel}`); } catch { continue; } // new file
183
190
  const on = parseNode(old);
184
191
  const oldEntries = [...on.facts, ...on.moves].map((b) => b.replace(/\s+/g, ' '));
185
192
  const gone = oldEntries.filter((e) => !treeEntries.has(e));