gossipcat 0.4.6 → 0.4.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.
@@ -21314,6 +21314,7 @@ __export(sandbox_exports, {
21314
21314
  auditDispatchBoundary: () => auditDispatchBoundary,
21315
21315
  auditFilesystemSinceSentinel: () => auditFilesystemSinceSentinel,
21316
21316
  buildAuditExclusions: () => buildAuditExclusions,
21317
+ buildFindPruneArgs: () => buildFindPruneArgs,
21317
21318
  cleanupTaskSentinel: () => cleanupTaskSentinel,
21318
21319
  defaultScanRoots: () => defaultScanRoots,
21319
21320
  detectBoundaryEscapes: () => detectBoundaryEscapes,
@@ -21588,8 +21589,15 @@ function canonicalize(p) {
21588
21589
  return p.replace(/\/+$/, "") || "/";
21589
21590
  }
21590
21591
  }
21591
- function defaultScanRoots() {
21592
+ function defaultScanRoots(writeMode, projectRoot) {
21592
21593
  const out = /* @__PURE__ */ new Set();
21594
+ if (writeMode === "scoped") {
21595
+ try {
21596
+ out.add(canonicalize(projectRoot));
21597
+ } catch {
21598
+ }
21599
+ return Array.from(out);
21600
+ }
21593
21601
  try {
21594
21602
  out.add(canonicalize((0, import_os2.homedir)()));
21595
21603
  } catch {
@@ -21617,19 +21625,40 @@ function buildAuditExclusions(projectRoot, ownWorktree) {
21617
21625
  const root = canonicalize(projectRoot);
21618
21626
  for (const v of expandTmpVariants(`${root}/.gossip`)) excl.add(v);
21619
21627
  for (const v of expandTmpVariants(`${root}/.claude`)) excl.add(v);
21628
+ for (const v of expandTmpVariants(`${root}/.git`)) excl.add(v);
21620
21629
  try {
21621
21630
  const home = canonicalize((0, import_os2.homedir)());
21622
- for (const sub of ["Library", ".cache", ".npm", ".claude/projects"]) {
21631
+ for (const sub of ["Library", ".cache", ".npm", ".claude"]) {
21623
21632
  for (const v of expandTmpVariants(`${home}/${sub}`)) excl.add(v);
21624
21633
  }
21625
21634
  } catch {
21626
21635
  }
21636
+ try {
21637
+ const tmp = canonicalize((0, import_os2.tmpdir)());
21638
+ for (const pat of ["com.apple.*", "itunescloudd", "TemporaryItems"]) {
21639
+ for (const v of expandTmpVariants(`${tmp}/${pat}`)) excl.add(v);
21640
+ }
21641
+ } catch {
21642
+ }
21627
21643
  if (ownWorktree) {
21628
21644
  const wt = canonicalize(ownWorktree);
21629
21645
  for (const v of expandTmpVariants(wt)) excl.add(v);
21630
21646
  }
21631
21647
  return Array.from(excl);
21632
21648
  }
21649
+ function buildFindPruneArgs(scanRoot, exclusions, sentinel) {
21650
+ const args = [scanRoot];
21651
+ if (exclusions.length > 0) {
21652
+ args.push("(");
21653
+ for (let i = 0; i < exclusions.length; i++) {
21654
+ if (i > 0) args.push("-o");
21655
+ args.push("-path", exclusions[i]);
21656
+ }
21657
+ args.push(")", "-prune", "-o");
21658
+ }
21659
+ args.push("-type", "f", "-newer", sentinel, "-print");
21660
+ return args;
21661
+ }
21633
21662
  function auditFilesystemSinceSentinel(projectRoot, meta3, options = {}) {
21634
21663
  const platform2 = options.platform ?? process.platform;
21635
21664
  const logFailures = options.logFailures ?? true;
@@ -21654,20 +21683,19 @@ function auditFilesystemSinceSentinel(projectRoot, meta3, options = {}) {
21654
21683
  if (sentinelMtimeMs === 0) {
21655
21684
  return { violations: [], skipped: "sentinel stat failed" };
21656
21685
  }
21657
- const scanRoots = options.scanRoots ?? defaultScanRoots();
21686
+ const scanRoots = options.scanRoots ?? defaultScanRoots(
21687
+ options.writeMode ?? meta3.writeMode,
21688
+ projectRoot
21689
+ );
21658
21690
  const exclusions = buildAuditExclusions(projectRoot, meta3.worktreePath);
21659
21691
  const findBin = options.findBinary ?? "find";
21660
21692
  const violations = [];
21661
21693
  for (const root of scanRoots) {
21662
21694
  if (!(0, import_fs34.existsSync)(root)) continue;
21663
21695
  const canonRoot = canonicalize(root);
21664
- const args = [canonRoot, "-type", "f", "-newer", sentinel];
21665
21696
  const sentinelDir = canonicalize((0, import_path38.join)(projectRoot, ".gossip", SENTINEL_DIR));
21666
21697
  const allExcl = [...exclusions, ...expandTmpVariants(sentinelDir)];
21667
- for (const e of allExcl) {
21668
- args.push("-not", "-path", e);
21669
- args.push("-not", "-path", `${e}/*`);
21670
- }
21698
+ const args = buildFindPruneArgs(canonRoot, allExcl, sentinel);
21671
21699
  try {
21672
21700
  const out = (0, import_child_process5.execFileSync)(findBin, args, {
21673
21701
  encoding: "utf-8",
@@ -21739,7 +21767,9 @@ function runLayer3Audit(projectRoot, taskId) {
21739
21767
  return { blockError, warnPrefix };
21740
21768
  }
21741
21769
  try {
21742
- const l3 = auditFilesystemSinceSentinel(projectRoot, meta3);
21770
+ const l3 = auditFilesystemSinceSentinel(projectRoot, meta3, {
21771
+ writeMode: meta3.writeMode
21772
+ });
21743
21773
  if (l3.violations && l3.violations.length > 0) {
21744
21774
  const list = l3.violations.slice(0, 20).join(", ");
21745
21775
  if (enforcement === "block") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gossipcat",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Multi-agent orchestration for Claude Code — parallel review, consensus, adaptive dispatch",
5
5
  "mcpName": "io.github.ataberk-xyz/gossipcat",
6
6
  "repository": {