neurastream 0.1.6 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neurastream",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Harness-agnostic agent orchestration: queue, guards, blockers, scoring, ledger.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readdirSync, realpathSync, statSync } from "node:fs";
2
- import { basename, join } from "node:path";
2
+ import { basename, join, resolve } from "node:path";
3
3
  import type { Config } from "./config.ts";
4
4
  import { nowSec } from "./clock.ts";
5
5
  import { printText } from "./help.ts";
@@ -31,7 +31,8 @@ export function wipCheck(args: string[], cfg: Config): number {
31
31
  for (const repo of repos(cfg.paths.work_roots)) {
32
32
  if (!statSync(repo).isDirectory()) continue;
33
33
  const commonRaw = gitText(repo, ["rev-parse", "--git-common-dir"]) || ".";
34
- const common = realpathSync(join(repo, commonRaw));
34
+ // resolve, not join: a linked worktree's common dir comes back absolute (os.path.join keeps it).
35
+ const common = realpathSync(resolve(repo, commonRaw));
35
36
  if (seen.has(common)) continue;
36
37
  seen.add(common);
37
38
  const url = gitText(repo, ["config", "remote.origin.url"]);
@@ -59,7 +60,9 @@ export function wipCheck(args: string[], cfg: Config): number {
59
60
  }
60
61
  }
61
62
 
62
- unlanded.sort((a, b) => b.ts - a.ts);
63
+ // Python sorts (ts, name, br, sha, n) tuples descending; ties on ts fall through to the next field.
64
+ const cmp = (x: string | number, y: string | number): number => (x < y ? -1 : x > y ? 1 : 0);
65
+ unlanded.sort((a, b) => cmp(b.ts, a.ts) || cmp(b.name, a.name) || cmp(b.br, a.br) || cmp(b.sha, a.sha) || cmp(b.n, a.n));
63
66
  printText(`UNLANDED branches (commits on no remote): ${unlanded.length} limit ${limit}`);
64
67
  for (const row of unlanded) {
65
68
  const age = pyFixedWidth((now - row.ts) / 3600, 1, 6);