skillwiki 0.10.83 → 0.10.85

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.
@@ -6545,16 +6545,15 @@ function rankPages(pages, graph, queryTerms, structuralSeedLimit) {
6545
6545
  if (!page.historicalCycle) hasDirectOperationalSeed = true;
6546
6546
  }
6547
6547
  const suppressRepetitiveHistoricalCycles = historicalCyclePageCount >= 3 && hasDirectOperationalSeed;
6548
- const gatedSeedPages = structuralSeedLimit !== void 0 && seedPages.length > structuralSeedLimit ? [...seedPages].sort(
6548
+ const gatedSeedPages = structuralSeedLimit !== void 0 && seedPages.length > structuralSeedLimit ? seedPages.sort(
6549
6549
  (a, b) => b.keywordScore - a.keywordScore || a.relPath.localeCompare(b.relPath)
6550
6550
  ).slice(0, structuralSeedLimit) : seedPages;
6551
- const seedPaths = new Set(gatedSeedPages.map((page) => page.relPath));
6552
- const operationalSeedPaths = new Set(
6553
- gatedSeedPages.filter((page) => !page.historicalCycle).map((page) => page.relPath)
6551
+ const structuralSeedPages = suppressRepetitiveHistoricalCycles ? gatedSeedPages.filter((page) => !page.historicalCycle) : gatedSeedPages;
6552
+ const structuralSeedPaths = new Set(
6553
+ structuralSeedPages.map((page) => page.relPath)
6554
6554
  );
6555
- const structuralSeedPaths = suppressRepetitiveHistoricalCycles ? operationalSeedPaths : seedPaths;
6556
6555
  const results = pages.map((page) => {
6557
- const sourceOverlap = scoreSourceOverlap(page, pages, structuralSeedPaths);
6556
+ const sourceOverlap = scoreSourceOverlap(page, structuralSeedPages);
6558
6557
  const wikilink = scoreWikilink(page.relPath, structuralSeedPaths, graph);
6559
6558
  const aa = scoreAdamicAdar(page.relPath, structuralSeedPaths, graph);
6560
6559
  const typeAffinity = scoreTypeAffinity(page.type, queryTerms);
@@ -6577,11 +6576,11 @@ function rankPages(pages, graph, queryTerms, structuralSeedLimit) {
6577
6576
  } : void 0
6578
6577
  };
6579
6578
  }
6580
- function scoreSourceOverlap(page, allPages, seedPaths) {
6579
+ function scoreSourceOverlap(page, seedPages) {
6581
6580
  if (page.sources.length === 0) return 0;
6582
6581
  let total = 0;
6583
- for (const seed of allPages) {
6584
- if (seed.relPath === page.relPath || !seedPaths.has(seed.relPath)) continue;
6582
+ for (const seed of seedPages) {
6583
+ if (seed.relPath === page.relPath) continue;
6585
6584
  const shared = page.sources.filter((s) => seed.sources.includes(s)).length;
6586
6585
  total += shared;
6587
6586
  }
package/dist/cli.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  snapshotterHealthChecks,
53
53
  upsertIndexEntry,
54
54
  vectorIndexStatus
55
- } from "./chunk-W5VVEW2H.js";
55
+ } from "./chunk-GZKT2XC5.js";
56
56
  import {
57
57
  normalizeDistTag,
58
58
  readCache,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-W5VVEW2H.js";
4
+ } from "./chunk-GZKT2XC5.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
  import "./chunk-ZUHA2EXE.js";
7
7
  import "./chunk-BO7JIJIA.js";
@@ -482,12 +482,16 @@ snapshot_freeze_projection_expectations() {
482
482
  return 1
483
483
  fi
484
484
 
485
- PROJECTION_EXPECTED_INDEX_SHA256="$(snapshot_projection_hash_file "$PROJECTION_STATE_DIR/expected-index.md")" || return 1
486
- PROJECTION_EXPECTED_LOG_SHA256="$(snapshot_projection_hash_file "$PROJECTION_STATE_DIR/expected-log.md")" || return 1
485
+ snapshot_record_projection_expectation_hashes || return 1
487
486
  log "projection expected bytes frozen index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 log_sha256=$PROJECTION_EXPECTED_LOG_SHA256"
488
487
  return 0
489
488
  }
490
489
 
490
+ snapshot_record_projection_expectation_hashes() {
491
+ PROJECTION_EXPECTED_INDEX_SHA256="$(snapshot_projection_hash_file "$PROJECTION_STATE_DIR/expected-index.md")" || return 1
492
+ PROJECTION_EXPECTED_LOG_SHA256="$(snapshot_projection_hash_file "$PROJECTION_STATE_DIR/expected-log.md")" || return 1
493
+ }
494
+
491
495
  snapshot_live_projection_matches_frozen() {
492
496
  local live_index_sha live_log_sha
493
497
  if ! cmp -s "$PROJECTION_STATE_DIR/expected-index.md" "$WIKI_DIR/index.md" \
@@ -558,6 +562,51 @@ snapshot_wait_for_direct_projection_parity() {
558
562
  done
559
563
  }
560
564
 
565
+ snapshot_refresh_projection_expectations_from_store() {
566
+ if [ -z "$PROJECTION_STATE_DIR" ]; then
567
+ return 0
568
+ fi
569
+
570
+ local index_pid log_pid index_rc log_rc
571
+ timeout "$PROJECTION_READ_TIMEOUT_SECONDS" \
572
+ rclone cat "${CLOUD_REMOTE%/}/index.md" --retries 1 \
573
+ >"$PROJECTION_STATE_DIR/expected-index.md" 2>>"$LOG_FILE" &
574
+ index_pid=$!
575
+ timeout "$PROJECTION_READ_TIMEOUT_SECONDS" \
576
+ rclone cat "${CLOUD_REMOTE%/}/log.md" --retries 1 \
577
+ >"$PROJECTION_STATE_DIR/expected-log.md" 2>>"$LOG_FILE" &
578
+ log_pid=$!
579
+ wait "$index_pid"
580
+ index_rc=$?
581
+ wait "$log_pid"
582
+ log_rc=$?
583
+ if [ "$index_rc" -ne 0 ]; then
584
+ log "ERROR: could not read current store index.md after sync"
585
+ return 1
586
+ fi
587
+ if [ "$log_rc" -ne 0 ]; then
588
+ log "ERROR: could not read current store log.md after sync"
589
+ return 1
590
+ fi
591
+ snapshot_record_projection_expectation_hashes || return 1
592
+ log "projection expectations refreshed from store after sync expected_index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 expected_log_sha256=$PROJECTION_EXPECTED_LOG_SHA256"
593
+ return 0
594
+ }
595
+
596
+ snapshot_gate_projection_candidate() {
597
+ local refresh_fail="$1"
598
+ local verify_fail="$2"
599
+ if ! snapshot_refresh_projection_expectations_from_store; then
600
+ log "$refresh_fail"
601
+ return 1
602
+ fi
603
+ if ! snapshot_verify_projection_candidate; then
604
+ log "$verify_fail"
605
+ return 1
606
+ fi
607
+ return 0
608
+ }
609
+
561
610
  snapshot_verify_worktree_projection_parity() {
562
611
  if [ -z "$PROJECTION_STATE_DIR" ]; then
563
612
  return 0
@@ -1014,8 +1063,9 @@ snapshot_reconcile_delete_intents() {
1014
1063
  if ! snapshot_reconcile_delete_intents; then
1015
1064
  exit 1
1016
1065
  fi
1017
- if ! snapshot_verify_projection_candidate; then
1018
- log "FAIL projection candidate verification; snapshot promotion refused"
1066
+ if ! snapshot_gate_projection_candidate \
1067
+ "FAIL projection expectation refresh after sync; snapshot promotion refused" \
1068
+ "FAIL projection candidate verification; snapshot promotion refused"; then
1019
1069
  exit 1
1020
1070
  fi
1021
1071
 
@@ -1088,8 +1138,9 @@ if [ "$needs_repair" = true ]; then
1088
1138
  if ! snapshot_reconcile_delete_intents; then
1089
1139
  exit 1
1090
1140
  fi
1091
- if ! snapshot_verify_projection_candidate; then
1092
- log "FAIL post-repair projection candidate verification; snapshot promotion refused"
1141
+ if ! snapshot_gate_projection_candidate \
1142
+ "FAIL post-repair projection expectation refresh after sync; snapshot promotion refused" \
1143
+ "FAIL post-repair projection candidate verification; snapshot promotion refused"; then
1093
1144
  exit 1
1094
1145
  fi
1095
1146
  if ! snapshot_freeze_git_receipt; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.83",
3
+ "version": "0.10.85",
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.83",
3
+ "version": "0.10.85",
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.83",
3
+ "version": "0.10.85",
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.83",
3
+ "version": "0.10.85",
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.83",
3
+ "version": "0.10.85",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",