skillwiki 0.9.18 → 0.9.19

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.
package/dist/cli.js CHANGED
@@ -5806,6 +5806,8 @@ function checkVaultGitAhead(resolvedPath) {
5806
5806
  );
5807
5807
  }
5808
5808
  function checkVaultGitBehind(resolvedPath) {
5809
+ const staleRemote = checkStaleRemoteMain(resolvedPath);
5810
+ if (staleRemote) return staleRemote;
5809
5811
  return checkVaultGitComparison(
5810
5812
  resolvedPath,
5811
5813
  "vault_git_behind",
@@ -5815,6 +5817,47 @@ function checkVaultGitBehind(resolvedPath) {
5815
5817
  "0 commits behind origin/main"
5816
5818
  );
5817
5819
  }
5820
+ function gitRefHash(resolvedPath, ref) {
5821
+ try {
5822
+ const out = execSync2(`git rev-parse --verify ${ref}`, {
5823
+ cwd: resolvedPath,
5824
+ encoding: "utf8",
5825
+ stdio: ["pipe", "pipe", "pipe"],
5826
+ timeout: 2e3
5827
+ }).trim();
5828
+ return out || void 0;
5829
+ } catch {
5830
+ return void 0;
5831
+ }
5832
+ }
5833
+ function remoteMainHash(resolvedPath) {
5834
+ try {
5835
+ const out = execSync2("git ls-remote origin refs/heads/main", {
5836
+ cwd: resolvedPath,
5837
+ encoding: "utf8",
5838
+ stdio: ["pipe", "pipe", "pipe"],
5839
+ timeout: 3e3
5840
+ }).trim();
5841
+ const hash = out.split(/\s+/)[0];
5842
+ return /^[0-9a-f]{40}$/i.test(hash) ? hash : void 0;
5843
+ } catch {
5844
+ return void 0;
5845
+ }
5846
+ }
5847
+ function checkStaleRemoteMain(resolvedPath) {
5848
+ if (resolvedPath === void 0) return void 0;
5849
+ if (!existsSync11(join29(resolvedPath, ".git"))) return void 0;
5850
+ const localOrigin = gitRefHash(resolvedPath, "origin/main");
5851
+ if (!localOrigin) return void 0;
5852
+ const remoteMain = remoteMainHash(resolvedPath);
5853
+ if (!remoteMain || remoteMain === localOrigin) return void 0;
5854
+ return check(
5855
+ "warn",
5856
+ "vault_git_behind",
5857
+ "Vault commits behind",
5858
+ `Remote main differs from local origin/main (${remoteMain.slice(0, 8)} != ${localOrigin.slice(0, 8)}) \u2014 run git fetch before trusting behind count`
5859
+ );
5860
+ }
5818
5861
  function checkVaultGitComparison(resolvedPath, id, label, range, nonZeroSuffix, zeroDetail) {
5819
5862
  if (resolvedPath === void 0) {
5820
5863
  return check("pass", id, label, "No vault path \u2014 check skipped");
@@ -6254,6 +6297,53 @@ function vaultSyncChecks(input) {
6254
6297
  const packagedSnapshotPath = join29(shareDir, "wiki-snapshot.sh");
6255
6298
  const legacySnapshotPath = "/root/.hermes/scripts/wiki-snapshot-v3.sh";
6256
6299
  const snapshotPath = input.snapshotScriptPath ?? (existsSync11(packagedSnapshotPath) ? packagedSnapshotPath : legacySnapshotPath);
6300
+ function snapshotLastStatusCheck() {
6301
+ const snapshotLog = join29(logDir, "wiki-snapshot.log");
6302
+ try {
6303
+ const logContent = readFileSync7(snapshotLog, "utf8");
6304
+ const lines = logContent.trim().split("\n").filter(Boolean);
6305
+ if (lines.length === 0) {
6306
+ return check(
6307
+ "warn",
6308
+ "vault_sync_last_push_age",
6309
+ "Vault sync last snapshot status",
6310
+ "Snapshot log file is empty"
6311
+ );
6312
+ }
6313
+ const lastLine = [...lines].reverse().find(
6314
+ (line) => /ERROR|Status: complete|Push successful|No changes to commit/.test(line)
6315
+ ) ?? lines[lines.length - 1];
6316
+ if (/ERROR/.test(lastLine)) {
6317
+ return check(
6318
+ "error",
6319
+ "vault_sync_last_push_age",
6320
+ "Vault sync last snapshot status",
6321
+ `Last snapshot failed: ${lastLine.slice(0, 160)}`
6322
+ );
6323
+ }
6324
+ if (/Status: complete|Push successful|No changes to commit/.test(lastLine)) {
6325
+ return check(
6326
+ "pass",
6327
+ "vault_sync_last_push_age",
6328
+ "Vault sync last snapshot status",
6329
+ lastLine.slice(0, 160)
6330
+ );
6331
+ }
6332
+ return check(
6333
+ "warn",
6334
+ "vault_sync_last_push_age",
6335
+ "Vault sync last snapshot status",
6336
+ `Last snapshot log entry: ${lastLine.slice(0, 160)}`
6337
+ );
6338
+ } catch {
6339
+ return check(
6340
+ "warn",
6341
+ "vault_sync_last_push_age",
6342
+ "Vault sync last snapshot status",
6343
+ `Snapshot log not found at ${snapshotLog}`
6344
+ );
6345
+ }
6346
+ }
6257
6347
  if (input.vaultSyncRole === "snapshotter") {
6258
6348
  const c12 = existsSync11(snapshotPath) ? check("pass", "vault_sync_installed", "Vault sync installed", `Found snapshot script: ${snapshotPath}`) : check("error", "vault_sync_installed", "Vault sync installed", `Snapshot script not found at ${snapshotPath}`);
6259
6349
  const serviceScope = input.vaultSyncServiceScope ?? "user";
@@ -6279,12 +6369,7 @@ function vaultSyncChecks(input) {
6279
6369
  c22 = check("error", "vault_sync_jobs_enabled", "Vault sync jobs enabled", `wiki-snapshot.timer check failed (${serviceScope})`);
6280
6370
  }
6281
6371
  }
6282
- const c32 = check(
6283
- "pass",
6284
- "vault_sync_last_push_age",
6285
- "Vault sync last push recency",
6286
- "Snapshotter host \u2014 leaf wiki-push log not applicable"
6287
- );
6372
+ const c32 = snapshotLastStatusCheck();
6288
6373
  const cFetch2 = check(
6289
6374
  "pass",
6290
6375
  "vault_sync_last_fetch_status",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.9.18",
3
+ "version": "0.9.19",
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.9.18",
3
+ "version": "0.9.19",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 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.9.18",
3
+ "version": "0.9.19",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 18 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.9.18",
3
+ "version": "0.9.19",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",