@ericrisco/rsc 4.0.0 → 4.0.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.
package/targets/sello.mjs CHANGED
@@ -45,6 +45,11 @@ export const SELLO_STATE_PATHS = [
45
45
  '.rsc/automation-gaps.md', '.rsc/review-ledger.jsonl',
46
46
  ];
47
47
 
48
+ // Worktrees nested inside the project (the assistant's native `.claude/worktrees/`, rsc's own
49
+ // `.worktrees/`) are other checkouts, not part of this change. Untracked, they showed up as one
50
+ // `.claude/…` path, scored as harness — tier 2 for every task of a run that used isolation.
51
+ export const NESTED_WORKTREES = /^(?:\.claude\/worktrees|\.worktrees)(?:\/|$)/;
52
+
48
53
  export function selloPaths(root) {
49
54
  return {
50
55
  config: join(root, '.rsc', 'sello-config.json'),
@@ -241,7 +246,8 @@ export function computeCandidate(rawRoot, cfg = null) {
241
246
 
242
247
  const names = new Set();
243
248
  for (const n of nulList(git(root, 'diff', '--name-only', '-z', base))) names.add(n);
244
- for (const n of nulList(git(root, 'ls-files', '--others', '--exclude-standard', '-z'))) names.add(n);
249
+ // Untracked nested worktrees are other checkouts; committed paths under them are part of the change.
250
+ for (const n of nulList(git(root, 'ls-files', '--others', '--exclude-standard', '-z'))) if (!NESTED_WORKTREES.test(n)) names.add(n);
245
251
  for (const p of SELLO_STATE_PATHS) names.delete(p);
246
252
 
247
253
  const files = {};
@@ -266,7 +272,7 @@ export function computeCandidate(rawRoot, cfg = null) {
266
272
  // Untracked files never appear in numstat, so a fix hidden in a new file would
267
273
  // cost zero budget. Count their lines.
268
274
  for (const n of nulList(git(root, 'ls-files', '--others', '--exclude-standard', '-z'))) {
269
- if (SELLO_STATE_PATHS.includes(n) || numstat[n] !== undefined) continue;
275
+ if (SELLO_STATE_PATHS.includes(n) || NESTED_WORKTREES.test(n) || numstat[n] !== undefined) continue;
270
276
  try {
271
277
  const st = lstatSync(join(root, n));
272
278
  if (st.isFile()) numstat[n] = readFileSync(join(root, n), 'utf8').split('\n').length;