skillwiki 0.10.89 → 0.10.91

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.
@@ -4512,10 +4512,16 @@ function isHygieneCommand(command) {
4512
4512
  }
4513
4513
  return false;
4514
4514
  }
4515
+ function isEventLedgerPath(rel) {
4516
+ const n = rel.replace(/\\/g, "/").replace(/^\.\//, "");
4517
+ return n === "meta/log-events" || n.startsWith("meta/log-events/");
4518
+ }
4515
4519
  function measureDirtyVolume(vault) {
4516
4520
  const empty = (extra = {}) => ({
4517
4521
  porcelain_lines: 0,
4518
4522
  expanded_files: 0,
4523
+ content_files: 0,
4524
+ ledger_files: 0,
4519
4525
  modified: 0,
4520
4526
  untracked: 0,
4521
4527
  buckets: [],
@@ -4545,7 +4551,13 @@ function measureDirtyVolume(vault) {
4545
4551
  let modified = 0;
4546
4552
  let untracked = 0;
4547
4553
  let expanded = 0;
4554
+ let contentFiles = 0;
4555
+ let ledgerFiles = 0;
4548
4556
  const bucketMap = /* @__PURE__ */ new Map();
4557
+ const classify = (rel, n) => {
4558
+ if (isEventLedgerPath(rel)) ledgerFiles += n;
4559
+ else contentFiles += n;
4560
+ };
4549
4561
  const addBucket = (rel, n) => {
4550
4562
  const top = rel.split(/[/\\]/)[0] || ".";
4551
4563
  bucketMap.set(top, (bucketMap.get(top) ?? 0) + n);
@@ -4567,20 +4579,27 @@ function measureDirtyVolume(vault) {
4567
4579
  const files = listFilesRecursive(abs);
4568
4580
  expanded += files.length;
4569
4581
  addBucket(rel, files.length);
4582
+ for (const file of files) {
4583
+ classify(relative2(vault, file).replace(/\\/g, "/"), 1);
4584
+ }
4570
4585
  } else {
4571
4586
  expanded += 1;
4572
4587
  addBucket(rel, 1);
4588
+ classify(rel, 1);
4573
4589
  }
4574
4590
  } else {
4575
4591
  modified += 1;
4576
4592
  expanded += 1;
4577
4593
  addBucket(rel, 1);
4594
+ classify(rel, 1);
4578
4595
  }
4579
4596
  }
4580
4597
  const buckets = [...bucketMap.entries()].map(([bucket, count]) => ({ bucket, count })).sort((a, b) => b.count - a.count);
4581
4598
  return {
4582
4599
  porcelain_lines: lines.length,
4583
4600
  expanded_files: expanded,
4601
+ content_files: contentFiles,
4602
+ ledger_files: ledgerFiles,
4584
4603
  modified,
4585
4604
  untracked,
4586
4605
  buckets,
@@ -4613,7 +4632,7 @@ function evaluateDirtyVolumeGate(input) {
4613
4632
  const threshold = input.threshold ?? DEFAULT_DIRTY_VOLUME_THRESHOLD;
4614
4633
  const report = measureDirtyVolume(input.vault);
4615
4634
  report.threshold = threshold;
4616
- report.over_threshold = report.is_git_repo && report.expanded_files > threshold;
4635
+ report.over_threshold = report.is_git_repo && report.content_files > threshold;
4617
4636
  if (input.skip) {
4618
4637
  return { allowed: true, reason: "skipped", report };
4619
4638
  }
@@ -4632,7 +4651,7 @@ function evaluateDirtyVolumeGate(input) {
4632
4651
  reason: "over_threshold",
4633
4652
  code: GateError.VAULT_DIRTY_BACKLOG,
4634
4653
  report,
4635
- humanHint: `Vault dirty volume ${report.expanded_files} exceeds threshold ${threshold} (porcelain ${report.porcelain_lines}; buckets: ${top || "none"}). Triage/commit keep-set before more non-hygiene writes. Hygiene commands still allowed.`
4654
+ humanHint: `Vault content dirty volume ${report.content_files} exceeds threshold ${threshold} (event-ledger ${report.ledger_files} excluded; porcelain ${report.porcelain_lines}; buckets: ${top || "none"}). Triage/commit keep-set before more non-hygiene writes. Do not git add meta/log-events. Hygiene commands still allowed.`
4636
4655
  };
4637
4656
  }
4638
4657
  var SATURATION_PATTERNS = [
package/dist/cli.js CHANGED
@@ -53,7 +53,7 @@ import {
53
53
  snapshotterHealthChecks,
54
54
  upsertIndexEntry,
55
55
  vectorIndexStatus
56
- } from "./chunk-IZ6I7GSG.js";
56
+ } from "./chunk-ZYVP52PM.js";
57
57
  import {
58
58
  normalizeDistTag,
59
59
  readCache,
@@ -9352,6 +9352,8 @@ function githubRecord(p) {
9352
9352
  function withDirty(rec, p) {
9353
9353
  if (p.dirty !== void 0) rec.dirty = p.dirty;
9354
9354
  if (p.untracked !== void 0) rec.untracked = p.untracked;
9355
+ if (p.ledger_untracked !== void 0) rec.ledger_untracked = p.ledger_untracked;
9356
+ if (p.content_untracked !== void 0) rec.content_untracked = p.content_untracked;
9355
9357
  return rec;
9356
9358
  }
9357
9359
  function localRecord(p, githubOid) {
@@ -9418,8 +9420,10 @@ function formatPlane(name, rec) {
9418
9420
  if (rec.oid) parts.push(`oid=${rec.oid.slice(0, 12)}`);
9419
9421
  if (rec.behind !== void 0) parts.push(`behind=${rec.behind}`);
9420
9422
  if (rec.age_hours !== void 0) parts.push(`age_hours=${rec.age_hours}`);
9421
- if (rec.dirty !== void 0) parts.push(`dirty=${rec.dirty}`);
9422
- if (rec.untracked !== void 0) parts.push(`untracked=${rec.untracked}`);
9423
+ if (rec.ledger_untracked !== void 0) parts.push(`ledger_untracked=${rec.ledger_untracked}`);
9424
+ if (rec.content_untracked !== void 0) parts.push(`content_untracked=${rec.content_untracked}`);
9425
+ if (rec.ledger_untracked === void 0 && rec.dirty !== void 0) parts.push(`dirty=${rec.dirty}`);
9426
+ if (rec.ledger_untracked === void 0 && rec.untracked !== void 0) parts.push(`untracked=${rec.untracked}`);
9423
9427
  if (rec.blocked_reason) parts.push(rec.blocked_reason);
9424
9428
  if (rec.detail && rec.detail !== rec.blocked_reason) parts.push(rec.detail);
9425
9429
  return parts.join(" ");
@@ -9492,13 +9496,17 @@ function defaultCopyStatusDeps(input) {
9492
9496
  const dirty = measureDirtyVolume(input.vault);
9493
9497
  const dirtyCount = dirty.is_git_repo ? dirty.expanded_files : void 0;
9494
9498
  const untrackedCount = dirty.is_git_repo ? dirty.untracked : void 0;
9495
- const dirtyHint = dirtyCount && dirtyCount > 0 ? `dirty=${dirtyCount} untracked=${untrackedCount ?? 0} live-ahead of GitHub; do not git add` : void 0;
9499
+ const ledgerUntracked = dirty.is_git_repo ? dirty.ledger_files : void 0;
9500
+ const contentUntracked = dirty.is_git_repo ? dirty.content_files : void 0;
9501
+ const dirtyHint = dirtyCount && dirtyCount > 0 ? ledgerUntracked && ledgerUntracked > 0 ? `event-ledger live-ahead of GitHub; do not git add` : `live-ahead of GitHub; do not git add` : void 0;
9496
9502
  return {
9497
9503
  head,
9498
9504
  behind: Number.isFinite(behind) ? behind : void 0,
9499
9505
  blockedReason,
9500
9506
  dirty: dirtyCount,
9501
9507
  untracked: untrackedCount,
9508
+ ledger_untracked: dirtyCount && dirtyCount > 0 ? ledgerUntracked : void 0,
9509
+ content_untracked: dirtyCount && dirtyCount > 0 ? contentUntracked : void 0,
9502
9510
  detail: dirtyHint ?? blockedReason
9503
9511
  };
9504
9512
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-IZ6I7GSG.js";
4
+ } from "./chunk-ZYVP52PM.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
  import "./chunk-ZUHA2EXE.js";
7
7
  import "./chunk-6WE7E6VB.js";
@@ -100,6 +100,45 @@ CLOUD_REMOTE="${CLOUD_REMOTE:-cloud:cloud/wiki}"
100
100
  REPAIR_SCRIPT="${WIKI_GIT_REPAIR_SCRIPT:-$SCRIPT_DIR/wiki-git-repair-v3.sh}"
101
101
  MAX_S3_ONLY_NOTES="${WIKI_SNAPSHOT_MAX_S3_ONLY_NOTES:-200}"
102
102
  MAX_TOMBSTONE_PRUNES="${WIKI_SNAPSHOT_MAX_TOMBSTONE_PRUNES:-10}"
103
+
104
+ # Classified inventory: event ledger + local scratch are not GitHub-promotable notes.
105
+ # Cap and rclone must share this class. Do not raise MAX_S3_ONLY_NOTES instead.
106
+ # meta/log-events stay S3-authoritative; snapshot copies them separately for --events-from.
107
+ snapshot_non_promotable_path() {
108
+ local p="${1#./}"
109
+ case "$p" in
110
+ .skillwiki/*|.claude/*|.obsidian/*|.antigravitycli/*|.playwright-cli/*|.superpowers/*|.snapshots/*|.git/*|.drafts/*)
111
+ return 0 ;;
112
+ tmp/*|logs|logs/*|meta/log-events|meta/log-events/*)
113
+ return 0 ;;
114
+ raw/._.DS_Store|._.DS_Store)
115
+ return 0 ;;
116
+ ._*)
117
+ return 0 ;;
118
+ .conflict*|*.conflict-*)
119
+ return 0 ;;
120
+ esac
121
+ return 1
122
+ }
123
+
124
+ # rclone exclude leaves leftover non-promotable files in the worktree.
125
+ # `git add -A` would promote them (live 0.10.90 leak). Pathspecs match
126
+ # snapshot_non_promotable_path. Already-tracked ledger history is left as-is.
127
+ snapshot_git_add_promotable() {
128
+ git add --all -- . \
129
+ ':!.skillwiki' \
130
+ ':!.claude' \
131
+ ':!.obsidian' \
132
+ ':!.antigravitycli' \
133
+ ':!.playwright-cli' \
134
+ ':!.superpowers' \
135
+ ':!.snapshots' \
136
+ ':!.drafts' \
137
+ ':!tmp' \
138
+ ':!logs' \
139
+ ':!meta/log-events'
140
+ }
141
+
103
142
  PROJECTION_PARITY_TIMEOUT_SECONDS="${WIKI_SNAPSHOT_PROJECTION_PARITY_TIMEOUT_SECONDS:-120}"
104
143
  PROJECTION_PARITY_POLL_SECONDS="${WIKI_SNAPSHOT_PROJECTION_PARITY_POLL_SECONDS:-2}"
105
144
  PROJECTION_READ_TIMEOUT_SECONDS="${WIKI_SNAPSHOT_PROJECTION_READ_TIMEOUT_SECONDS:-15}"
@@ -185,7 +224,14 @@ snapshot_direct_s3_preflight() {
185
224
  fi
186
225
  SNAPSHOT_REMOTE_INVENTORY_READY=1
187
226
 
188
- grep -vE '^(\.skillwiki/|\.claude/|\.obsidian/|\.antigravitycli/|\.playwright-cli/|\.superpowers/|raw/\._\.DS_Store$|\._\.DS_Store$)' "$direct_paths" | LC_ALL=C sort -u > "$direct_notes" || true
227
+ : > "$direct_notes"
228
+ while IFS= read -r snapshot_inv_path || [ -n "$snapshot_inv_path" ]; do
229
+ [ -n "$snapshot_inv_path" ] || continue
230
+ if snapshot_non_promotable_path "$snapshot_inv_path"; then
231
+ continue
232
+ fi
233
+ printf '%s\n' "$snapshot_inv_path"
234
+ done < "$direct_paths" | LC_ALL=C sort -u > "$direct_notes" || true
189
235
  (
190
236
  cd "$SNAPSHOT_WORKTREE" || exit 1
191
237
  if git rev-parse --verify --quiet origin/main >/dev/null 2>&1; then
@@ -939,6 +985,11 @@ RCLONE_OPTS=(
939
985
  --exclude ".antigravitycli/**"
940
986
  --exclude ".playwright-cli/**"
941
987
  --exclude ".superpowers/**"
988
+ --exclude ".drafts/**"
989
+ --exclude "tmp/**"
990
+ --exclude "logs"
991
+ --exclude "logs/**"
992
+ --exclude "meta/log-events/**"
942
993
  --exclude "._*"
943
994
  --exclude ".conflict*"
944
995
  --exclude "*.conflict-*"
@@ -1254,10 +1305,14 @@ fi
1254
1305
 
1255
1306
  # Commit
1256
1307
  echo "Committing changes..."
1257
- if ! git add -A; then
1308
+ if ! snapshot_git_add_promotable; then
1258
1309
  log "ERROR: git add failed"
1259
1310
  exit 1
1260
1311
  fi
1312
+ ledger_leftover="$(git ls-files -o --exclude-standard -- meta/log-events | wc -l | tr -d ' ')"
1313
+ if [ "${ledger_leftover:-0}" -gt 0 ]; then
1314
+ log "WARN: classified inventory left $ledger_leftover untracked event-ledger path(s) unstaged"
1315
+ fi
1261
1316
 
1262
1317
  if ! git commit -m "Snapshot $DATE"; then
1263
1318
  log "ERROR: git commit failed"
@@ -1290,7 +1345,7 @@ if [ "$PULL_SUCCESS" = false ]; then
1290
1345
  if ! raw_dedup_guard || ! conflict_marker_guard; then
1291
1346
  exit 1
1292
1347
  fi
1293
- git add -A || true
1348
+ snapshot_git_add_promotable || true
1294
1349
  git commit -m "Snapshot $DATE (post-repair)" || true
1295
1350
  else
1296
1351
  log "ERROR: Repair failed after pull failure"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.89",
3
+ "version": "0.10.91",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.89",
3
+ "version": "0.10.91",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 21 prompt-only skills (wiki-*, proj-*, using-skillwiki, skillwiki-mcp) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.89",
3
+ "version": "0.10.91",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 21 prompt-only skills backed by the deterministic skillwiki CLI.",
5
5
  "author": {
6
6
  "name": "karlorz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.89",
3
+ "version": "0.10.91",
4
4
  "description": "Project-aware Karpathy-style knowledge base: 21 prompt-only skills (wiki-*, proj-*, using-skillwiki, skillwiki-mcp) backed by HTTP MCP wiki_capture.",
5
5
  "author": {
6
6
  "name": "karlorz"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.10.89",
3
+ "version": "0.10.91",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",