skillwiki 0.10.14 → 0.10.16

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.
@@ -6521,6 +6521,33 @@ function resolveSnapshotGitWorktree(config) {
6521
6521
  const defaultPath = "/root/wiki-git";
6522
6522
  return existsSync13(defaultPath) ? defaultPath : void 0;
6523
6523
  }
6524
+ var SNAPSHOT_SEMANTIC_TO_SYSTEMD = {
6525
+ load_state: "LoadState",
6526
+ unit_file_state: "UnitFileState",
6527
+ active_state: "ActiveState",
6528
+ sub_state: "SubState",
6529
+ next_elapse: "NextElapseUSecRealtime",
6530
+ result: "Result",
6531
+ exec_main_status: "ExecMainStatus",
6532
+ exec_main_code: "ExecMainCode",
6533
+ active_enter_timestamp: "ActiveEnterTimestamp",
6534
+ inactive_enter_timestamp: "InactiveEnterTimestamp",
6535
+ exec_main_start_timestamp: "ExecMainStartTimestamp",
6536
+ exec_main_exit_timestamp: "ExecMainExitTimestamp",
6537
+ invocation_id: "InvocationID"
6538
+ };
6539
+ function semanticToSystemdProp(semantic) {
6540
+ return SNAPSHOT_SEMANTIC_TO_SYSTEMD[semantic];
6541
+ }
6542
+ function normalizeSystemdValue(raw) {
6543
+ if (raw == null) return void 0;
6544
+ const v = raw.trim();
6545
+ if (!v || v === "n/a" || v === "N/A") return void 0;
6546
+ return v;
6547
+ }
6548
+ function hasCompletedRunEvidence(...timestamps) {
6549
+ return timestamps.some((t) => normalizeSystemdValue(t ?? void 0) != null);
6550
+ }
6524
6551
  function loadSnapshotFixture(env) {
6525
6552
  const path = env.VS_SNAPSHOT_HEALTH_FIXTURE;
6526
6553
  if (!path || !existsSync13(path)) return null;
@@ -6537,19 +6564,22 @@ function systemctlShowProperty(scope, unit, prop) {
6537
6564
  encoding: "utf8",
6538
6565
  timeout: 2e3,
6539
6566
  stdio: ["pipe", "pipe", "pipe"]
6540
- }).trim();
6541
- return out || void 0;
6567
+ });
6568
+ return normalizeSystemdValue(out);
6542
6569
  } catch {
6543
6570
  return void 0;
6544
6571
  }
6545
6572
  }
6546
6573
  function snapshotProp(kind, prop, fixture, scope) {
6547
6574
  if (fixture) {
6548
- const v = fixture[kind][prop];
6575
+ const bag = fixture[kind];
6576
+ const v = bag[prop];
6549
6577
  return v == null ? void 0 : String(v);
6550
6578
  }
6551
6579
  const unit = kind === "timer" ? "wiki-snapshot.timer" : "wiki-snapshot.service";
6552
- return systemctlShowProperty(scope, unit, prop);
6580
+ const liveProp = semanticToSystemdProp(prop);
6581
+ if (!liveProp) return void 0;
6582
+ return systemctlShowProperty(scope, unit, liveProp);
6553
6583
  }
6554
6584
  function parseIsoToMs(ts) {
6555
6585
  if (!ts || ts === "MISSING") return null;
@@ -6582,18 +6612,22 @@ function snapshotterHealthChecks(scope, logDir, env) {
6582
6612
  const sResult = snapshotProp("service", "result", fixture, scope) ?? null;
6583
6613
  const sExecMainStatus = snapshotProp("service", "exec_main_status", fixture, scope);
6584
6614
  const sActiveEnter = snapshotProp("service", "active_enter_timestamp", fixture, scope) ?? null;
6615
+ const sInactiveEnter = snapshotProp("service", "inactive_enter_timestamp", fixture, scope) ?? null;
6616
+ const sExecMainStart = snapshotProp("service", "exec_main_start_timestamp", fixture, scope) ?? null;
6617
+ const sExecMainExit = snapshotProp("service", "exec_main_exit_timestamp", fixture, scope) ?? null;
6618
+ const completedEvidence = hasCompletedRunEvidence(sExecMainExit, sInactiveEnter, sActiveEnter);
6585
6619
  let serviceResult;
6586
6620
  if (sActive == null && sResult == null) {
6587
6621
  serviceResult = check("warn", "vault_sync_snapshot_service_result", "Vault sync snapshot service result", "wiki-snapshot.service properties unavailable (read-only)");
6588
6622
  } else if (sActive === "active" || sActive === "activating") {
6589
- const startMs = parseIsoToMs(sActiveEnter);
6623
+ const startMs = parseIsoToMs(sExecMainStart) ?? parseIsoToMs(sActiveEnter);
6590
6624
  const runSec = startMs == null ? null : Math.floor((nowMs - startMs) / 1e3);
6591
6625
  if (runSec != null && runSec > timeout) {
6592
6626
  serviceResult = check("error", "vault_sync_snapshot_service_result", "Vault sync snapshot service result", `wiki-snapshot.service running ${runSec}s beyond timeout ${timeout}s`);
6593
6627
  } else {
6594
6628
  serviceResult = check("pass", "vault_sync_snapshot_service_result", "Vault sync snapshot service result", `wiki-snapshot.service in progress (running ${runSec ?? "?"}s)`);
6595
6629
  }
6596
- } else if (sResult === "success" && (sExecMainStatus ?? "0") === "0" && sActiveEnter != null) {
6630
+ } else if (sResult === "success" && (sExecMainStatus ?? "0") === "0" && completedEvidence) {
6597
6631
  serviceResult = check("pass", "vault_sync_snapshot_service_result", "Vault sync snapshot service result", "wiki-snapshot.service result=success ExecMainStatus=0");
6598
6632
  } else if (sResult === "failed" || sExecMainStatus != null && sExecMainStatus !== "0") {
6599
6633
  serviceResult = check("error", "vault_sync_snapshot_service_result", "Vault sync snapshot service result", `wiki-snapshot.service result=${sResult ?? "missing"} ExecMainStatus=${sExecMainStatus ?? "missing"}`);
package/dist/cli.js CHANGED
@@ -83,7 +83,7 @@ import {
83
83
  upsertIndexEntry,
84
84
  validateLogEvent,
85
85
  writeLogEvent
86
- } from "./chunk-2AOOMDZ7.js";
86
+ } from "./chunk-24MVNAFJ.js";
87
87
  import {
88
88
  normalizeDistTag,
89
89
  readCache,
@@ -6625,8 +6625,9 @@ async function runSnapshotMaintenanceDryRun(input) {
6625
6625
  const home = input.home ?? env.HOME ?? "";
6626
6626
  const audit = input.auditSink ?? defaultAuditSink(home);
6627
6627
  const now = input.now ?? Date.now();
6628
+ const liveVaultPath = input.liveVaultPath ? canonicalize(input.liveVaultPath) : await resolveLiveVault({ env, home });
6628
6629
  const fleetLoad = input.fleetLoad !== void 0 ? input.fleetLoad : await loadFleetManifestAndHost({
6629
- vault: input.liveVaultPath ?? "",
6630
+ vault: liveVaultPath,
6630
6631
  env,
6631
6632
  home,
6632
6633
  cwd: process.cwd(),
@@ -6656,7 +6657,6 @@ async function runSnapshotMaintenanceDryRun(input) {
6656
6657
  audit(makeAuditEvent(input, fleetLoad.hostId, now, "refusal", "MAINTENANCE_MISSING_GIT_REPO"));
6657
6658
  return { exitCode: ExitCode.PROTECTED_SNAPSHOTTER_WRITE_BLOCKED, result: refusalErr("MAINTENANCE_MISSING_GIT_REPO", `snapshot worktree is not a git repository: ${requested}`) };
6658
6659
  }
6659
- const liveVaultPath = input.liveVaultPath ? canonicalize(input.liveVaultPath) : await resolveLiveVault({ env, home });
6660
6660
  if (liveVaultPath && requested === canonicalize(liveVaultPath)) {
6661
6661
  audit(makeAuditEvent(input, fleetLoad.hostId, now, "refusal", "MAINTENANCE_LIVE_VAULT_TARGET"));
6662
6662
  return { exitCode: ExitCode.PROTECTED_SNAPSHOTTER_WRITE_BLOCKED, result: refusalErr("MAINTENANCE_LIVE_VAULT_TARGET", "requested path is the live vault, not the snapshot worktree") };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-2AOOMDZ7.js";
4
+ } from "./chunk-24MVNAFJ.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
  import "./chunk-NMUYMNNB.js";
7
7
  import "./chunk-OWPQJOFG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.14",
3
+ "version": "0.10.16",
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.14",
3
+ "version": "0.10.16",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 19 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.14",
3
+ "version": "0.10.16",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 19 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/skills",
3
- "version": "0.10.14",
3
+ "version": "0.10.16",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",