skillwiki 0.10.84 → 0.10.86
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.
|
@@ -181,7 +181,7 @@ snapshot_direct_s3_preflight() {
|
|
|
181
181
|
fi
|
|
182
182
|
SNAPSHOT_REMOTE_INVENTORY_READY=1
|
|
183
183
|
|
|
184
|
-
grep -vE '^(\.skillwiki/|\.claude/|\.obsidian/|\.antigravitycli/|\.playwright-cli/|raw/\._\.DS_Store$|\._\.DS_Store$)' "$direct_paths" | LC_ALL=C sort -u > "$direct_notes" || true
|
|
184
|
+
grep -vE '^(\.skillwiki/|\.claude/|\.obsidian/|\.antigravitycli/|\.playwright-cli/|\.superpowers/|raw/\._\.DS_Store$|\._\.DS_Store$)' "$direct_paths" | LC_ALL=C sort -u > "$direct_notes" || true
|
|
185
185
|
(
|
|
186
186
|
cd "$SNAPSHOT_WORKTREE" || exit 1
|
|
187
187
|
if git rev-parse --verify --quiet origin/main >/dev/null 2>&1; then
|
|
@@ -482,12 +482,16 @@ snapshot_freeze_projection_expectations() {
|
|
|
482
482
|
return 1
|
|
483
483
|
fi
|
|
484
484
|
|
|
485
|
-
|
|
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" \
|
|
@@ -500,6 +504,20 @@ snapshot_live_projection_matches_frozen() {
|
|
|
500
504
|
return 0
|
|
501
505
|
}
|
|
502
506
|
|
|
507
|
+
snapshot_projection_log_is_store_ahead() {
|
|
508
|
+
local freeze="${1:-}"
|
|
509
|
+
local remote="${2:-}"
|
|
510
|
+
local freeze_bytes remote_bytes
|
|
511
|
+
[ -f "$freeze" ] && [ -f "$remote" ] || return 1
|
|
512
|
+
freeze_bytes="$(wc -c < "$freeze" | tr -d ' ')"
|
|
513
|
+
remote_bytes="$(wc -c < "$remote" | tr -d ' ')"
|
|
514
|
+
case "$freeze_bytes" in ''|*[!0-9]*) return 1 ;; esac
|
|
515
|
+
case "$remote_bytes" in ''|*[!0-9]*) return 1 ;; esac
|
|
516
|
+
[ "$freeze_bytes" -gt 0 ] || return 1
|
|
517
|
+
[ "$remote_bytes" -gt "$freeze_bytes" ] || return 1
|
|
518
|
+
head -c "$freeze_bytes" "$remote" | cmp -s "$freeze" -
|
|
519
|
+
}
|
|
520
|
+
|
|
503
521
|
snapshot_wait_for_direct_projection_parity() {
|
|
504
522
|
if [ -z "$PROJECTION_STATE_DIR" ]; then
|
|
505
523
|
# Test-only skip path above. Production always has frozen state.
|
|
@@ -541,6 +559,19 @@ snapshot_wait_for_direct_projection_parity() {
|
|
|
541
559
|
log "projection direct-store parity confirmed attempts=$attempts expected_index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 live_index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 remote_index_sha256=$remote_index_sha expected_log_sha256=$PROJECTION_EXPECTED_LOG_SHA256 live_log_sha256=$PROJECTION_EXPECTED_LOG_SHA256 remote_log_sha256=$remote_log_sha"
|
|
542
560
|
return 0
|
|
543
561
|
fi
|
|
562
|
+
if cmp -s "$PROJECTION_STATE_DIR/expected-index.md" "$remote_index" \
|
|
563
|
+
&& snapshot_projection_log_is_store_ahead "$PROJECTION_STATE_DIR/expected-log.md" "$remote_log"; then
|
|
564
|
+
if ! cp "$remote_index" "$PROJECTION_STATE_DIR/expected-index.md" \
|
|
565
|
+
|| ! cp "$remote_log" "$PROJECTION_STATE_DIR/expected-log.md"; then
|
|
566
|
+
log "ERROR: could not adopt store-ahead projection bytes"
|
|
567
|
+
return 1
|
|
568
|
+
fi
|
|
569
|
+
snapshot_record_projection_expectation_hashes || return 1
|
|
570
|
+
remote_index_sha="$(snapshot_projection_hash_file "$remote_index" 2>/dev/null || echo unavailable)"
|
|
571
|
+
remote_log_sha="$(snapshot_projection_hash_file "$remote_log" 2>/dev/null || echo unavailable)"
|
|
572
|
+
log "projection store-ahead log accepted attempts=$attempts expected_index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 remote_index_sha256=$remote_index_sha expected_log_sha256=$PROJECTION_EXPECTED_LOG_SHA256 remote_log_sha256=$remote_log_sha"
|
|
573
|
+
return 0
|
|
574
|
+
fi
|
|
544
575
|
fi
|
|
545
576
|
|
|
546
577
|
now="$(date +%s)"
|
|
@@ -558,6 +589,51 @@ snapshot_wait_for_direct_projection_parity() {
|
|
|
558
589
|
done
|
|
559
590
|
}
|
|
560
591
|
|
|
592
|
+
snapshot_refresh_projection_expectations_from_store() {
|
|
593
|
+
if [ -z "$PROJECTION_STATE_DIR" ]; then
|
|
594
|
+
return 0
|
|
595
|
+
fi
|
|
596
|
+
|
|
597
|
+
local index_pid log_pid index_rc log_rc
|
|
598
|
+
timeout "$PROJECTION_READ_TIMEOUT_SECONDS" \
|
|
599
|
+
rclone cat "${CLOUD_REMOTE%/}/index.md" --retries 1 \
|
|
600
|
+
>"$PROJECTION_STATE_DIR/expected-index.md" 2>>"$LOG_FILE" &
|
|
601
|
+
index_pid=$!
|
|
602
|
+
timeout "$PROJECTION_READ_TIMEOUT_SECONDS" \
|
|
603
|
+
rclone cat "${CLOUD_REMOTE%/}/log.md" --retries 1 \
|
|
604
|
+
>"$PROJECTION_STATE_DIR/expected-log.md" 2>>"$LOG_FILE" &
|
|
605
|
+
log_pid=$!
|
|
606
|
+
wait "$index_pid"
|
|
607
|
+
index_rc=$?
|
|
608
|
+
wait "$log_pid"
|
|
609
|
+
log_rc=$?
|
|
610
|
+
if [ "$index_rc" -ne 0 ]; then
|
|
611
|
+
log "ERROR: could not read current store index.md after sync"
|
|
612
|
+
return 1
|
|
613
|
+
fi
|
|
614
|
+
if [ "$log_rc" -ne 0 ]; then
|
|
615
|
+
log "ERROR: could not read current store log.md after sync"
|
|
616
|
+
return 1
|
|
617
|
+
fi
|
|
618
|
+
snapshot_record_projection_expectation_hashes || return 1
|
|
619
|
+
log "projection expectations refreshed from store after sync expected_index_sha256=$PROJECTION_EXPECTED_INDEX_SHA256 expected_log_sha256=$PROJECTION_EXPECTED_LOG_SHA256"
|
|
620
|
+
return 0
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
snapshot_gate_projection_candidate() {
|
|
624
|
+
local refresh_fail="$1"
|
|
625
|
+
local verify_fail="$2"
|
|
626
|
+
if ! snapshot_refresh_projection_expectations_from_store; then
|
|
627
|
+
log "$refresh_fail"
|
|
628
|
+
return 1
|
|
629
|
+
fi
|
|
630
|
+
if ! snapshot_verify_projection_candidate; then
|
|
631
|
+
log "$verify_fail"
|
|
632
|
+
return 1
|
|
633
|
+
fi
|
|
634
|
+
return 0
|
|
635
|
+
}
|
|
636
|
+
|
|
561
637
|
snapshot_verify_worktree_projection_parity() {
|
|
562
638
|
if [ -z "$PROJECTION_STATE_DIR" ]; then
|
|
563
639
|
return 0
|
|
@@ -825,6 +901,7 @@ RCLONE_OPTS=(
|
|
|
825
901
|
--exclude ".claude/**"
|
|
826
902
|
--exclude ".antigravitycli/**"
|
|
827
903
|
--exclude ".playwright-cli/**"
|
|
904
|
+
--exclude ".superpowers/**"
|
|
828
905
|
--exclude "._*"
|
|
829
906
|
--exclude ".conflict*"
|
|
830
907
|
--exclude "*.conflict-*"
|
|
@@ -1014,8 +1091,9 @@ snapshot_reconcile_delete_intents() {
|
|
|
1014
1091
|
if ! snapshot_reconcile_delete_intents; then
|
|
1015
1092
|
exit 1
|
|
1016
1093
|
fi
|
|
1017
|
-
if !
|
|
1018
|
-
|
|
1094
|
+
if ! snapshot_gate_projection_candidate \
|
|
1095
|
+
"FAIL projection expectation refresh after sync; snapshot promotion refused" \
|
|
1096
|
+
"FAIL projection candidate verification; snapshot promotion refused"; then
|
|
1019
1097
|
exit 1
|
|
1020
1098
|
fi
|
|
1021
1099
|
|
|
@@ -1088,8 +1166,9 @@ if [ "$needs_repair" = true ]; then
|
|
|
1088
1166
|
if ! snapshot_reconcile_delete_intents; then
|
|
1089
1167
|
exit 1
|
|
1090
1168
|
fi
|
|
1091
|
-
if !
|
|
1092
|
-
|
|
1169
|
+
if ! snapshot_gate_projection_candidate \
|
|
1170
|
+
"FAIL post-repair projection expectation refresh after sync; snapshot promotion refused" \
|
|
1171
|
+
"FAIL post-repair projection candidate verification; snapshot promotion refused"; then
|
|
1093
1172
|
exit 1
|
|
1094
1173
|
fi
|
|
1095
1174
|
if ! snapshot_freeze_git_receipt; then
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.86",
|
|
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.
|
|
3
|
+
"version": "0.10.86",
|
|
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"
|