skillwiki 0.10.21 → 0.10.23

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.
Files changed (49) hide show
  1. package/dist/chunk-6ZDKTNLA.js +294 -0
  2. package/dist/{chunk-65Q5UGND.js → chunk-BASWDOQB.js} +2 -2
  3. package/dist/{chunk-Y6KRDGI2.js → chunk-C2DKFJFA.js} +6 -1
  4. package/dist/chunk-EQPU2BPM.js +468 -0
  5. package/dist/{chunk-GNS2ZV5P.js → chunk-PQG26AGJ.js} +1 -1
  6. package/dist/{chunk-I5JD3BQZ.js → chunk-QBZYEEBD.js} +13 -296
  7. package/dist/chunk-QNTBNNEL.js +616 -0
  8. package/dist/{chunk-UNPZDCWN.js → chunk-SYKSL3JQ.js} +860 -700
  9. package/dist/cli.js +2334 -273
  10. package/dist/{index-projection-HAXDEM2F.js → index-projection-FRWTZB5Y.js} +3 -2
  11. package/dist/{managed-write-preflight-CTXX2MHQ.js → managed-write-preflight-4LPVMP42.js} +3 -3
  12. package/dist/skillwiki-mcp.js +6 -4
  13. package/dist/sources-L2SQV63E.js +10 -0
  14. package/package.json +1 -1
  15. package/skills/.claude-plugin/plugin.json +1 -1
  16. package/skills/.codex-plugin/plugin.json +1 -1
  17. package/skills/README.md +13 -2
  18. package/skills/agents/wiki-add-task.md +2 -1
  19. package/skills/agents/wiki-archive.md +8 -9
  20. package/skills/agents/wiki-audit.md +2 -1
  21. package/skills/agents/wiki-lint.md +2 -1
  22. package/skills/agents/wiki-query.md +3 -1
  23. package/skills/agents/wiki-reingest.md +9 -8
  24. package/skills/package.json +1 -1
  25. package/skills/proj-decide/SKILL.md +35 -5
  26. package/skills/skills/proj-decide/SKILL.md +35 -5
  27. package/skills/skills/using-skillwiki/SKILL.md +19 -13
  28. package/skills/skills/wiki-add-task/SKILL.md +4 -3
  29. package/skills/skills/wiki-archive/SKILL.md +23 -18
  30. package/skills/skills/wiki-audit/SKILL.md +3 -1
  31. package/skills/skills/wiki-init/SKILL.md +12 -1
  32. package/skills/skills/wiki-lint/SKILL.md +2 -1
  33. package/skills/skills/wiki-query/SKILL.md +7 -0
  34. package/skills/skills/wiki-reingest/SKILL.md +12 -8
  35. package/skills/skills/wiki-remove/SKILL.md +22 -5
  36. package/skills/skills/wiki-sync/SKILL.md +39 -54
  37. package/skills/using-skillwiki/SKILL.md +19 -13
  38. package/skills/wiki-add-task/SKILL.md +4 -3
  39. package/skills/wiki-archive/SKILL.md +23 -18
  40. package/skills/wiki-audit/SKILL.md +3 -1
  41. package/skills/wiki-init/SKILL.md +12 -1
  42. package/skills/wiki-lint/SKILL.md +2 -1
  43. package/skills/wiki-query/SKILL.md +7 -0
  44. package/skills/wiki-reingest/SKILL.md +12 -8
  45. package/skills/wiki-remove/SKILL.md +22 -5
  46. package/skills/wiki-sync/SKILL.md +39 -54
  47. package/templates/SCHEMA.md +8 -5
  48. package/templates/web-clipper/llm-wiki-clippings.json +56 -0
  49. package/templates/web-clipper/readme.txt +16 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki-archive
3
- description: Archive a superseded typed-knowledge page. Moves page to _archive/, removes from index.md, logs the action.
3
+ description: Archive a superseded typed page or preserve-move an exact raw source through the attended lifecycle workflow.
4
4
  ---
5
5
 
6
6
  # wiki-archive
@@ -8,7 +8,8 @@ description: Archive a superseded typed-knowledge page. Moves page to _archive/,
8
8
  ## When This Skill Activates
9
9
 
10
10
  - User wants to retire, supersede, or remove a typed-knowledge page from active use.
11
- - A page has been replaced by a newer version and should be kept for reference but excluded from lint and queries.
11
+ - A page has been replaced by a newer version and should be kept for reference but excluded from active use.
12
+ - The user explicitly requests a structural archive of one exact raw source while preserving its bytes under `raw/`.
12
13
 
13
14
  ## Output language
14
15
 
@@ -20,29 +21,32 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
20
21
 
21
22
  ## Probe
22
23
 
23
- Same matrix as `using-skillwiki` → **CLI probe and failsafe**: PRIMARY (`skillwiki archive`), FAILSAFE-GIT (hand tombstone + `git mv` to `_archive/` + push), or FAIL CLOSED.
24
+ Same matrix as `using-skillwiki` → **CLI probe and failsafe**. FAILSAFE-GIT is permitted for typed pages only. Raw archive requires the SkillWiki attended approval flow; if it is unavailable, fail closed.
24
25
 
25
26
  ## Steps (PRIMARY)
26
27
 
27
28
  0. Resolve vault: `skillwiki path` and `skillwiki lang`.
28
- 1. Identify the target page. Confirm with the user which page to archive (show full relPath).
29
- 2. Run `skillwiki archive <page> [vault]`. On a vault-sync leaf host where S3 stale originals must be pruned, use `skillwiki archive <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1` only when that remote path deletion is explicitly intended. Read the JSON output. Successful archive **always** writes a live-path tombstone under `meta/delete-intents/` so snapshot cannot resurrect the live key.
30
- 3. Verify with `skillwiki index-check [vault]` confirm no ghost entries remain.
31
- 4. Run `skillwiki lint [vault]` check for broken wikilinks from other pages that still reference the archived page. If found, update those pages to point to the replacement or remove the stale link.
32
- 5. **Raw file archiving (N9 Reingest Protocol only):** When archiving a `raw/` file due to content drift, update ALL `^[raw/...]` citation markers and `sources:` frontmatter entries that reference the old path. Change `raw/articles/foo.md` to `_archive/raw/articles/foo.md` in every referencing page. Verify with `skillwiki audit` that no broken markers remain.
33
- 6. Append a `log.md` entry: `## [{date}] archive | {relPath} _archive/{subdir}/`.
34
- 7. Commit/push so tombstone + archive land on private `main`.
29
+ 1. Identify the target page and show its full vault-relative path. Raw targets must be exact `raw/...` paths; basename inference is refused.
30
+ 2. For a typed page, run `skillwiki archive <page> [vault]` using the normal managed mutation workflow.
31
+ 3. For a raw article, paper, or transcript:
32
+ 1. Run `skillwiki archive <exact-raw-path> [vault]` and inspect the dry-run, destination, complete-file hash, citation impact, and state-bound approval token.
33
+ 2. If the user approves that exact live plan, run the identical command with `--apply --approve <token>`.
34
+ 3. The destination is `raw/archived/<category>/...`. The command copies exclusively, verifies complete-file SHA-256, retires the old address, records append-only relocation history, and leaves the raw bytes unchanged.
35
+ 4. Maintained citations may be rewritten to the new address; historical addresses also resolve through relocation history. Legacy `_archive/raw/` is read-compatible only and is never a new-write destination.
36
+ 4. On a vault-sync leaf where remote stale-path pruning is explicitly intended, add `--remote ... --remote-delete --max-remote-deletes 1`. This prunes only the retired address; the preserved raw destination remains.
37
+ 5. Verify with `skillwiki index-check [vault]`, `skillwiki lint [vault]`, and `skillwiki audit <referencing-page>` where applicable.
38
+ 6. Commit/push through the normal vault-sync workflow so the tombstone, preserved destination, and relocation event land together.
35
39
 
36
40
  ## FAILSAFE-GIT (no skillwiki)
37
41
 
38
- 1. Confirm path. Write `meta/delete-intents/<slug>.json` with `action: "archive"`, `source: "failsafe-git"`, schema `vault-delete-intent/v1`.
39
- 2. `git mv` live path `_archive/<same relPath>` (create dirs as needed); update `index.md` if typed.
40
- 3. Commit with `Delete-Intent` / `Delete-Source: failsafe-git` trailers; push to private `main`.
41
- 4. Optional single-path `rclone deletefile` for the **live** path if remote configured.
42
+ 1. Confirm the target is not under `raw/`. Raw preserve-moves fail closed without the CLI transaction.
43
+ 2. Write `meta/delete-intents/<slug>.json` with `action: "archive"`, `source: "failsafe-git"`, schema `vault-delete-intent/v1`.
44
+ 3. `git mv` the typed page to `_archive/<same relPath>`; update `index.md`.
45
+ 4. Commit with `Delete-Intent` / `Delete-Source: failsafe-git` trailers; push to private `main`.
42
46
 
43
47
  ## Reversibility
44
48
 
45
- Archiving is locally reversible: move the file back from `_archive/` to its original directory, re-add the wikilink entry to `index.md`, and **delete the matching tombstone** under `meta/delete-intents/`. If `--remote-delete` was used, the stale active-path object is pruned from the remote after the archive move, but the archived copy remains and a restore will republish the active path on the next push once the tombstone is cleared.
49
+ Typed archiving is locally reversible from `_archive/`. Raw archive is reversible only through another attended preserve-move that keeps exact bytes under `raw/`; do not hand-edit or recreate the source at its old address.
46
50
 
47
51
  ## Stop conditions
48
52
 
@@ -52,8 +56,9 @@ Archiving is locally reversible: move the file back from `_archive/` to its orig
52
56
 
53
57
  ## Forbidden
54
58
 
55
- - Archiving `raw/` files outside the N9 Reingest Protocol (raw is immutable except during content-drift reingestion).
56
- - Archiving raw files without updating all `^[raw/...]` citation markers that reference them.
57
- - Archiving without user confirmation.
59
+ - Rewriting raw content or frontmatter during archive.
60
+ - Moving raw evidence outside `raw/`, including new writes to `_archive/raw/`.
61
+ - Moving `raw/assets/**` as a side effect of source archive; referenced asset paths stay frozen.
62
+ - Applying a raw archive without a fresh state-bound token and attended explicit invocation.
58
63
  - Deleting local vault files with bare `rm` / bare `git rm` without a delete-intent tombstone (causes snapshot resurrection).
59
64
  - Remote stale-path pruning only via explicit `skillwiki archive --remote ... --remote-delete` (PRIMARY) or bounded single-path rclone in FAILSAFE-GIT.
@@ -21,7 +21,8 @@ Standard four reads.
21
21
  0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
22
22
  1. `skillwiki audit <page>`. Read the JSON report.
23
23
  2. Reason over the report:
24
- - For each unresolved marker: suggest ingesting the missing source or correcting the path.
24
+ - Resolve citations against active `raw/`, `raw/archived/`, `raw/duplicates/`, and append-only relocation history. Legacy `_archive/raw/` is read-compatible only, not a valid new destination.
25
+ - For each unresolved marker: distinguish a genuinely missing target from a stale historical path, then suggest ingesting the missing source or correcting maintained-page metadata.
25
26
  - For each `unused_sources` entry: suggest adding a body marker or removing from `sources:`.
26
27
  - For each `missing_from_sources` entry: suggest adding to `sources:`.
27
28
  3. Append one `log.md` entry summarizing the audit and any suggested follow-ups.
@@ -31,3 +32,4 @@ None — audit always completes.
31
32
 
32
33
  ## Forbidden
33
34
  - Auto-applying suggested fixes (audit is observation-only).
35
+ - Rewriting raw evidence while repairing an audit finding.
@@ -22,7 +22,18 @@ None for the first run.
22
22
  3. Propose a 10–15 tag taxonomy tailored to the domain. Confirm or accept the user's revision.
23
23
  4. Ask the language question: "What language should generated page prose use? Default is `en`. Aliases like `chinese-traditional` or `zh-Hant` are accepted."
24
24
  5. Run `skillwiki init --target <dir> --domain "<answer>" --taxonomy "<comma list>" --lang "<lang>"`.
25
- 6. **Suggest first sources.** Propose 3–5 initial sources (URLs, papers, articles) appropriate to the domain. Prompt the user to provide the first one to ingest, then hand off to wiki-ingest.
25
+ 6. Report the installed Web Clipper assets at
26
+ `_Templates/web-clipper/llm-wiki-clippings.json` and
27
+ `_Templates/web-clipper/readme.txt`. Tell the user to open Obsidian Web
28
+ Clipper Settings, import the JSON, and repeat the import for every browser
29
+ profile that should capture into the vault. Re-init preserves existing
30
+ customized copies, including short files.
31
+ 7. Explain that the generic template preserves `{{content}}`; remote HTTP(S)
32
+ images remain external dependencies. An attended local-asset capture may
33
+ choose any URL-friendly path under `raw/assets/`, but it must write the asset,
34
+ emit an explicit vault-qualified `![[raw/assets/...]]` embed, verify
35
+ resolution/preview, and only then finalize the immutable raw note.
36
+ 8. **Suggest first sources.** Propose 3–5 initial sources (URLs, papers, articles) appropriate to the domain. Prompt the user to provide the first one to ingest, then hand off to wiki-ingest.
26
37
 
27
38
  ## Stop conditions
28
39
 
@@ -15,7 +15,7 @@ Standard four reads.
15
15
  2. For lint-only maintenance, run `skillwiki lint <vault> --summary`. This returns bounded bucket counts, capped examples, and `details_command` hints without full item arrays.
16
16
  3. Drill into important buckets with `skillwiki lint <vault> --only <bucket>` when examples are insufficient for remediation.
17
17
  4. Reason over findings; present grouped by severity with concrete suggested actions per kind. If the CLI was recently updated with new lint checks, re-running lint on the full vault may flag pre-existing pages that predate the new rule — treat these as legitimate findings, not false positives.
18
- 5. Treat `sensitive_content` as a security error. Drill down with `skillwiki lint <vault> --only sensitive_content --human`. Redaction is allowed as a security exception to raw immutability only through `skillwiki lint <vault> --fix --only sensitive_content`; never print the secret value in the report.
18
+ 5. Treat `sensitive_content` as a security error. Drill down with `skillwiki lint <vault> --only sensitive_content --human`; never print the secret value. Raw findings are report/quarantine-only: `--fix` must not redact, rewrite, or recompute existing raw evidence. Maintained-page repairs may proceed only through their approved write workflow.
19
19
  6. If `log_rotate_needed` is present and the user consents, run `skillwiki log-rotate <vault> --apply`. Otherwise leave alone.
20
20
  7. **Post-migration verification**: If the user recently migrated content (e.g., moved entity/concept pages to another vault), re-run `skillwiki lint <vault> --summary` and verify that broken_wikilinks count decreased. Remaining broken links for migrated content indicate pages still referencing the moved files — these should be cleaned up (remove citations or migrate the referencing pages too).
21
21
  8. Append a `log.md` entry summarizing lint counts only when the user asked to record the maintenance result. Do not log routine `health` reports by default.
@@ -24,5 +24,6 @@ None — lint reports all findings even on per-page errors.
24
24
  ## Forbidden
25
25
  - Auto-rotating logs.
26
26
  - Auto-updating sha256 fields.
27
+ - Rewriting or redacting existing raw content/frontmatter, even for a sensitive-content finding.
27
28
  - Modifying any page beyond a user-approved lint summary entry in `log.md`.
28
29
  - Printing live credentials, access keys, tokens, passwords, cookies, bearer headers, private keys, or other authenticating secrets in findings or summaries.
@@ -13,6 +13,8 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
13
13
  ## Steps
14
14
  0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
15
15
  1. **Determine scope.** Ask the user once if ambiguous: vault | current project | project+concepts.
16
+ - Ordinary questions are typed-knowledge-first. Run `skillwiki query "<text>" [vault]` without widening into raw captures.
17
+ - Explicit freshness language — `new`, `recent`, `fresh`, `clipped`, `raw`, `pending`, `undigested`, `unprocessed`, `not yet ingested`, or `not yet integrated` — requests the pending evidence channel. Run `skillwiki sources pending [vault]` for inventory and `skillwiki query "<text>" [vault] --include-pending` for synthesis support.
16
18
  2. **Refresh graph.** If `.skillwiki/graph.json` is missing or older than 24h: `skillwiki graph build <vault>`.
17
19
  3. **Compute overlap.** `skillwiki overlap <vault>`.
18
20
  4. **Score candidates** in prompt using the 4 signals:
@@ -22,6 +24,9 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
22
24
  - Type affinity: 1.0×
23
25
  5. **Read top candidates** in full (frontmatter + body).
24
26
  6. **Synthesize answer** with explicit citations to the candidate pages.
27
+ - When pending evidence was requested, keep the CLI's `pending_sources` separate from ranked typed `results`. Pending captures never change typed scores or ordering.
28
+ - Label raw captures as **pending evidence**, not established vault knowledge. Explain that they have not yet been distilled into a maintained page.
29
+ - Weak typed results may justify suggesting a pending lookup, but never silently broaden the query.
25
30
  7. **Sensitive content guard.** Before filing any query or comparison page, scan the generated body for live credentials, access keys, tokens, passwords, cookies, bearer headers, or private keys. Redact before writing. If the answer depends on preserving a live secret, STOP and ask for a redacted source or explicit rotation/remediation direction.
26
31
  8. **Optional file.** If the user accepts, first run `skillwiki page publish --help`. If it is unavailable, fail closed and leave the result unpublished. Otherwise:
27
32
  1. Resolve the vault and create a temporary directory outside the vault.
@@ -52,4 +57,6 @@ When a wiki page (especially a work item `tasks.md`) claims that fixes were appl
52
57
  - Filing without the `skillwiki page publish` dry-run passing.
53
58
  - Directly creating a final typed page or separately editing `index.md` or `log.md` for its publication.
54
59
  - Skipping the orientation reads even for "quick" queries.
60
+ - Treating a pending raw capture as integrated typed knowledge, or mixing it into typed ranking.
61
+ - Silently searching pending sources when the user did not request fresh/raw/unprocessed material.
55
62
  - Writing live credentials, access keys, tokens, passwords, cookies, bearer headers, private keys, or other authenticating secrets to the vault.
@@ -8,7 +8,7 @@ description: Detect and act on source drift. Runs skillwiki drift, reviews chang
8
8
  ## When This Skill Activates
9
9
 
10
10
  - User wants to check if any vault sources have changed since ingestion.
11
- - Periodic drift check during lint or maintenance cycles.
11
+ - Periodic drift check during lint or maintenance cycles; scheduled/headless runs report only.
12
12
  - User explicitly asks to re-ingest a specific source.
13
13
 
14
14
  ## Output language
@@ -28,17 +28,19 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
28
28
  - **identity_conflicts:** The fetched source no longer matches the raw filename/source identity. STOP and surface the conflict. Do not archive or reingest until a human chooses the correct source/filename pair.
29
29
  - **fetch_failed:** Could not re-fetch. Show error details.
30
30
  - **unchanged:** No action needed.
31
- 3. For each drifted source, ask the user: archive old + ingest new, or skip?
32
- 4. If the user approves re-ingest for a source:
33
- a. Run `skillwiki archive <raw-path>` to archive the old raw file.
34
- b. Follow the `wiki-ingest` skill to ingest the updated content as a new raw file.
35
- c. Update any concept/entity pages that cite the old source to reference the new one.
36
- 5. Append a `log.md` entry summarizing: scanned, drifted, re-ingested, skipped.
31
+ 3. Report-only is the default. `skillwiki drift --apply` must not rewrite raw hashes or content; it reports the need for a new capture.
32
+ 4. For each drifted source, ask the user whether to create a new capture and preserve-archive the old address, or skip.
33
+ 5. If the user explicitly approves one source:
34
+ a. Follow `wiki-ingest` to create the updated content as a **new** raw capture. Verify it before changing the old address.
35
+ b. Preview `skillwiki archive <exact-old-raw-path>`.
36
+ c. Apply only with the live `--apply --approve <token>` flow. The old complete bytes move to `raw/archived/<category>/...`; they are never rewritten.
37
+ d. Update maintained concept/entity pages to cite the new capture where the editorial meaning requires it. Relocation history continues to resolve the old archived evidence.
38
+ 6. Append a log event/entry summarizing: scanned, drifted, newly captured, archived, skipped.
37
39
 
38
40
  ## N9 Compliance
39
41
 
40
42
  Raw files are immutable (N9). Re-ingest never modifies an existing raw file. Instead:
41
- - Archive the old raw file (moves to `_archive/raw/`).
43
+ - Preserve the old raw file under `raw/archived/<category>/` through the attended structural transaction.
42
44
  - Create a new raw file with updated content and new sha256.
43
45
  - This preserves full provenance history.
44
46
 
@@ -51,6 +53,8 @@ Raw files are immutable (N9). Re-ingest never modifies an existing raw file. Ins
51
53
  ## Forbidden
52
54
 
53
55
  - Modifying files in `raw/` directly (N9).
56
+ - Writing new archives to legacy `_archive/raw/`.
57
+ - Running raw structural apply from scheduled or headless maintenance.
54
58
  - Re-ingesting without user approval for each drifted source.
55
59
  - Re-ingesting a source listed under `identity_conflicts` without explicit user approval and a corrected target filename/source URL.
56
60
  - Skipping the drift check and assuming sources have changed.
@@ -1,13 +1,14 @@
1
1
  ---
2
2
  name: wiki-remove
3
- description: Hard-delete a vault path with a durable delete-intent tombstone so S3+snapshot cannot resurrect it. Prefer skillwiki remove; if CLI missing, failsafe-git via private GitHub.
3
+ description: Remove maintained vault paths with durable delete intent; raw evidence requires the separate attended exact-target sources dispose workflow.
4
4
  ---
5
5
 
6
6
  # wiki-remove
7
7
 
8
8
  ## When This Skill Activates
9
9
 
10
- - User wants to permanently remove a vault path (not archive-for-reference).
10
+ - User wants to permanently remove a maintained vault path (not archive-for-reference).
11
+ - User explicitly requests permanent disposal of one exact raw object.
11
12
  - Cleanup of stale pages that should not return via snapshot resurrection.
12
13
  - User says hard delete, remove for real, stop resurrecting.
13
14
 
@@ -17,7 +18,7 @@ If `skillwiki` is available: run `skillwiki lang` at the start. Otherwise defaul
17
18
 
18
19
  ## Pre-orientation
19
20
 
20
- Read SCHEMA/index only as needed. Confirm full vault-relative path with the user before delete.
21
+ Read SCHEMA/index only as needed. Confirm the full vault-relative path. First classify the target as maintained content or `raw/**` evidence.
21
22
 
22
23
  ## Probe (required)
23
24
 
@@ -33,7 +34,7 @@ Read SCHEMA/index only as needed. Confirm full vault-relative path with the user
33
34
 
34
35
  Do not auto `npm install -g skillwiki` in headless/goal/satellite sessions.
35
36
 
36
- ## PRIMARY steps
37
+ ## PRIMARY — maintained pages
37
38
 
38
39
  1. Resolve vault: `skillwiki path`.
39
40
  2. Confirm path with user.
@@ -44,9 +45,22 @@ Do not auto `npm install -g skillwiki` in headless/goal/satellite sessions.
44
45
  5. Commit + push via normal wiki-sync / git (tombstone + deletion must reach private `main` for durability).
45
46
  6. Report MODE=primary, paths, and whether remote-delete ran.
46
47
 
48
+ `skillwiki remove` must refuse every `raw/**` target. Do not bypass that refusal.
49
+
50
+ ## PRIMARY — exact raw disposal
51
+
52
+ Permanent raw disposal is exceptional and never inferred from cleanup, dedup, stale, archive, or reingest intent.
53
+
54
+ 1. Require an explicit user request naming one exact raw file and a reason. Refuse basenames, globs, directories, symlinks, batches, and inferred targets.
55
+ 2. Run `skillwiki sources dispose <exact-raw-path> [vault] --reason "<text>"`.
56
+ 3. Present the preview: complete-file SHA-256, byte size, typed/other/asset inbound references, delete-intent path, recoverability statement, operation ID, and approval token.
57
+ 4. Only in the same attended session, after the user approves that exact preview, run the identical command with `--write --approve <token>`.
58
+ 5. The command revalidates bytes and inbound references under the managed lock, writes append-only approval/completion events plus durable delete intent, then removes the exact object.
59
+ 6. Scheduled/headless disposal is always refused. A stale token never authorizes changed state.
60
+
47
61
  ## FAILSAFE-GIT steps (no skillwiki CLI)
48
62
 
49
- Agent **must** have git (and preferably gh) access to private vault remote.
63
+ Agent **must** have git (and preferably gh) access to private vault remote. This fallback is for maintained pages only. If the target is under `raw/`, fail closed until `skillwiki sources dispose` is available; never reproduce raw disposal by hand.
50
64
 
51
65
  1. Confirm path with user. Set `PATH_REL` (vault-relative, no `..`).
52
66
  2. Write tombstone `meta/delete-intents/<slug>.json` where slug is path with `/` → `__`, e.g. `summaries/foo.md` → `summaries__foo.md.json`:
@@ -83,6 +97,7 @@ Delete-Source: failsafe-git
83
97
  - FAIL CLOSED (no CLI and no private git access).
84
98
  - Push to private wiki fails.
85
99
  - Path invalid or under `_archive/` without explicit restore/remove policy.
100
+ - Raw target cannot be processed by the attended exact-target CLI flow.
86
101
 
87
102
  ## Forbidden
88
103
 
@@ -90,6 +105,8 @@ Delete-Source: failsafe-git
90
105
  - Force-push.
91
106
  - Unbounded `rclone sync` / mass remote delete.
92
107
  - Claiming fleet delete complete without tombstone on `origin/main` (and push success).
108
+ - Passing raw paths to ordinary `skillwiki remove`, or using FAILSAFE-GIT/bare filesystem deletion for raw evidence.
109
+ - Scheduled, headless, batch, glob, directory, basename-inferred, or stale-token raw disposal.
93
110
 
94
111
  ## Reversibility
95
112
 
@@ -162,7 +162,7 @@ git -C "$VAULT" rebase --continue
162
162
 
163
163
  **Prevention**:
164
164
  - Sync more frequently — don't let local fall >5 commits behind origin/main
165
- - Bundle archive commits `skillwiki archive --batch` groups 5-10 transcript archives into one commit, reducing rebase surface
165
+ - Prefer smaller, attended exact-target archive operations and sync promptly; there is no batch raw-archive apply mode.
166
166
  - For vaults with snapshot cron, prefer smaller, more frequent syncs over large batch rebases
167
167
 
168
168
  See `concepts/wiki-sync-rebase-conflict-storm-pattern.md` for detailed analysis.
@@ -174,72 +174,58 @@ When the user mentions editing from Obsidian desktop and Claude Code on a server
174
174
  - If both devices edit the same page between syncs, conflicts are inevitable — the Conflict Resolution section handles this.
175
175
  - Suggest enabling auto-commit in Obsidian (Community Plugins: `obsidian-git`) to reduce dirty-state drift.
176
176
 
177
- ## Rclone-backed vault with git snapshotting (cron pattern)
178
- Some deployments use a cloud-backed vault (`rclone mount`) with a separate git repository for versioned snapshots. This pattern separates "live working vault" from "versioned backup".
179
- ### Architecture
180
- ```
181
- ~/wiki → rclone mount to cloud storage (S3/IDrive/etc) — live vault
182
- ~/wiki-git → git repository cloned from GitHub — snapshot target
183
- cron hourly → rsync ~/wiki/ → ~/wiki-git/ → git commit → git push
184
- ```
185
- On snapshotter hosts, `~/wiki` remains the active SkillWiki vault for path resolution unless the operator explicitly configures otherwise. `~/wiki-git` is snapshot infrastructure, not the default authoring or dev-loop vault. Agents may author the live vault path when the host policy allows it, but should not point project work or `fleet context` at `~/wiki-git` unless `skillwiki path` intentionally resolves there.
177
+ ## Host-aware write and promotion authority
186
178
 
187
- ### Implementation (wiki-snapshot.sh)
188
- ```bash
189
- #!/bin/bash
190
- WIKI_DIR="/root/wiki"
191
- GIT_DIR="/root/wiki-git"
192
- DATE=$(date +%Y%m%d_%H%M%S)
193
- # Sync from rclone mount to git repo (quiet mode for slow mounts)
194
- rsync -a --delete -q \
195
- --exclude='.snapshots' --exclude='.git' --exclude='.obsidian' --exclude='.skillwiki' \
196
- "$WIKI_DIR/" "$GIT_DIR/"
197
- cd "$GIT_DIR" || exit 1
198
- git config user.email "cron@hermes.local"
199
- git config user.name "Hermes Snapshot"
200
- # Check for changes
201
- if [ -z "$(git status --porcelain)" ]; then
202
- exit 0 # Nothing to commit
203
- fi
204
- git add -A
205
- git commit -m "Snapshot $DATE"
206
- # Pull with rebase to handle remote changes (e.g., README edits on GitHub)
207
- if ! git pull --rebase origin main 2>/dev/null; then
208
- git pull origin main 2>/dev/null || true
209
- fi
210
- git push origin main || echo "Push failed"
211
- ```
212
- ### Pitfalls specific to this pattern
213
- 1. **Divergent branches from external pushes**: If something else pushes to the same GitHub repo (manual edits from macOS desktop, GitHub web UI edits, another server), the local `~/wiki-git` will diverge. The `--rebase` flag handles most cases, but if commits conflict:
214
- ```bash
215
- cd ~/wiki-git
216
- git rebase --abort 2>/dev/null || true
217
- git fetch origin main
218
- git reset --hard origin/main
219
- bash ~/.hermes/scripts/wiki-snapshot.sh # Re-sync fresh
220
- ```
221
- **Prevention**: Avoid editing the GitHub repo directly via web interface or uncoordinated clones. The canonical flow is **single-writer-git** (see `concepts/vault-write-authority-model.md`):
222
- - Server (sg01): agents may author the live vault at `~/wiki`; the snapshot job promotes cloud-backed live-vault state into `~/wiki-git`, then commits and pushes — **sole git writer to `main`**
223
- - macOS/desktop: edit → `wiki-push` rclone copy to S3 (NO git push) → consume sg01 snapshots via `wiki-fetch-notify` (opt-in `WIKI_FETCH_PULL_ON_DELTA=1`) or manual `skillwiki sync`
224
- - `wiki-sync` skill push is for **explicit** agent/human edit commits only, not automated background pushes
225
- 2. **Slow rsync on rclone mounts**: The rclone FUSE mount can be slow for large directory listings. Use `rsync -q` (quiet) to reduce output overhead, and consider `--delete-delay` instead of `--delete` if file churn is high. The rclone mount latency can cause `du` and `find` operations to timeout — this is normal, not an error.
226
- 3. **Golden Rule violation**: Never mix sync methods on the same vault. If using rclone mount + git snapshotting, do NOT also enable Obsidian Sync, Syncthing, or iCloud on `~/wiki`. The rclone mount IS the sync mechanism.
227
- 4. **Credential exposure**: The rclone mount and git remote use different credentials. Ensure git credentials are cached or use HTTPS with token, but never commit rclone config to git.
179
+ Resolve the live vault with `skillwiki path` first. Then choose the host role:
180
+
181
+ | Host role | Live vault | Authoring surface | Promotion to GitHub |
182
+ | --- | --- | --- | --- |
183
+ | Authorized Git-backed leaf (e.g. macOS) | Git vault from `skillwiki path` | Managed SkillWiki publishers against that vault | `skillwiki sync push "$VAULT"` after lint-delta |
184
+ | Protected snapshotter (sg01) | `/root/wiki` (rclone FUSE; not a Git repo) | Managed SkillWiki publishers against `/root/wiki` | S3 → `wiki-snapshot.timer` (default) → protected `/root/wiki-git` pipeline → GitHub |
185
+
186
+ High-signal safety rule:
187
+
188
+ > Do not author, copy, edit, stage, commit, pull, reset, or push agent changes
189
+ > in `/root/wiki-git`.
190
+
191
+ ### Protected snapshotter rules (sg01)
192
+
193
+ - Author only via managed commands against the live vault (`skillwiki path` usually `/root/wiki`).
194
+ - Do **not** run `skillwiki sync push /root/wiki` (not a Git repo) or `skillwiki sync push /root/wiki-git` (blocked as protected snapshot worktree).
195
+ - Do **not** `cd` into `/root/wiki-git` or `~/wiki-git` for ordinary authoring.
196
+ - Do **not** rsync, copy, or edit files into the snapshot worktree as an agent/operator workflow.
197
+ - Do **not** run `git reset --hard`, direct commits, or manual snapshot scripts to "fix" divergence.
198
+ - Promotion is owned by `wiki-snapshot.timer` by default. Publishers never start systemd units.
199
+ - `skillwiki work-complete` may finish with `committed=false` on sg01; later snapshot promotion owns the Git commit/push.
200
+
201
+ ### Authorized Git leaf rules
202
+
203
+ - Use managed publication (`skillwiki page publish`, `skillwiki project-page publish`, etc.) against the resolved Git vault.
204
+ - Then use this skill's push workflow (`skillwiki sync status` → lint-delta → commit → `skillwiki sync push` / `git push` as documented above).
205
+ - Never treat a snapshot worktree mirror as a substitute for the live vault.
206
+
207
+ ### Historical rationale (not executable)
208
+
209
+ Some older deployments separated a cloud-backed live vault from a Git snapshot worktree. That architecture still exists on protected snapshotters, but the snapshot worktree is **pipeline-internal**. Historical recipes that rsync into the worktree, reset it hard to origin/main, or run snapshot shell scripts by hand are obsolete and must not be copied.
228
210
 
229
211
  ## Stop conditions
230
- - `skillwiki sync status` reports `not_a_repo` — the vault is not a git repository. Advise the user to initialize one.
212
+ - `skillwiki sync status` reports `not_a_repo` — the vault is not a git repository. On protected snapshotters this is expected for the FUSE live path; do not switch to `/root/wiki-git` to force a push.
231
213
  - Lint errors are found before a push — do not push until resolved.
232
214
  - `git push` or `git pull` fails with a network error — report and stop.
233
215
  - Peer lock is held or peer stashes exist — abort and ask the user to wait or pass `--force`.
234
216
  - Untracked file collision detected on pull — surface to user for manual resolution.
217
+ - Host is a protected snapshotter and the requested operation would author or push via `/root/wiki-git` — refuse and use managed live-vault publication + timer promotion instead.
235
218
 
236
219
  ## Forbidden
237
220
  - Pushing when lint errors exist.
238
221
  - Auto-resolving body conflicts without user review.
239
222
  - Force-pushing (`git push --force`).
240
- - Modifying files in `raw/` to resolve conflicts (N9 archive and re-ingest instead).
223
+ - Rewriting raw content/frontmatter to resolve conflicts. Preserve-moves must stay under `raw/` (normally `raw/archived/` or `raw/duplicates/`) and require an attended approved structural command; scheduled/headless sync remains report-only.
241
224
  - Stashing without the `wiki-sync:...` name format (breaks peer detection).
242
225
  - Force-deleting a peer's lockfile (use `--force` only if peer is confirmed dead).
226
+ - Authoring, copying, editing, staging, committing, pulling, resetting, or pushing agent changes in `/root/wiki-git` (or any configured snapshot worktree).
227
+ - Running `skillwiki sync push` against a protected snapshot worktree or against a non-Git FUSE live vault.
228
+ - Invoking snapshot services/scripts or `git reset --hard` in the snapshot worktree as a recovery shortcut.
243
229
 
244
230
  ## Convergence safeguards (2026-07-11)
245
231
 
@@ -256,4 +242,3 @@ Drop a local commit from rebase only when every path is proven present on the ta
256
242
  - CLI: `skillwiki sync lint-delta <vault> --base-ref origin/main`
257
243
  - Block publication only when `new_errors > 0`; inherited full debt remains visible.
258
244
  - Missing/malformed delta evidence blocks (never silent lint skip).
259
-
@@ -37,14 +37,17 @@ Invoke a skillwiki skill when the user:
37
37
 
38
38
  ## Vault Structure
39
39
  A skillwiki vault has three layers. The canonical architecture lives in `SCHEMA.md` at the vault root — read it before creating any new directories.
40
- **Layer 1 — Raw (`raw/`):** Immutable source material. Never modify after ingest. `raw/transcripts/` doubles as the ad-hoc capture point for meeting notes and unprocessed ideas.
40
+ **Layer 1 — Raw (`raw/`):** Immutable evidence. Existing content/frontmatter is never autonomously rewritten or removed. Attended structural workflows may rename, relocate, archive, or deduplicate only when exact bytes remain somewhere under `raw/`. Permanent disposal requires explicit exact-target user intent. `raw/transcripts/` is the ad-hoc capture point for meeting notes and unprocessed ideas.
41
41
  ```
42
42
  raw/
43
- ├── articles/ # Web articles, clippings
44
- ├── papers/ # PDFs, arxiv papers
45
- ├── transcripts/ # Meeting notes, interviews, ad-hoc captures
46
- └── assets/ # Images, diagrams referenced by sources
43
+ ├── articles/ # Active Web articles and clippings
44
+ ├── papers/ # Active PDFs and papers
45
+ ├── transcripts/ # Active meeting notes and ad-hoc captures
46
+ ├── assets/ # Stable flexible asset pool; no fixed internal taxonomy
47
+ ├── archived/{articles,papers,transcripts}/
48
+ └── duplicates/{articles,papers,transcripts}/
47
49
  ```
50
+ Use explicit vault-root asset embeds such as `![[raw/assets/example/diagram.png]]`. Agents may choose flat or URL-friendly nested paths. Once an immutable capture references an asset, that path freezes; routine source archive/dedup never moves the asset. Remote images remain external dependencies unless separately captured.
48
51
  Raw frontmatter:
49
52
  ```yaml
50
53
  ---
@@ -94,6 +97,9 @@ Also mirror these pointers in vault-presync / vault-sync-status skills when oper
94
97
 
95
98
  - typed pages: `skillwiki page publish <draft> <vault> --target <path>` then the same command with `--write`
96
99
  - archive: `skillwiki archive <path> <vault>`
100
+ - pending source inventory: `skillwiki sources pending <vault>`
101
+ - editorial disposition: `skillwiki sources disposition <exact-raw-path> <vault> ...`
102
+ - exceptional raw disposal: `skillwiki sources dispose <exact-raw-path> <vault> --reason ...` then attended `--write --approve <token>`
97
103
  - ad-hoc structural log: `skillwiki log-append <vault> --content '<entry>'` (Release A dual-write) or event materialization (Release B)
98
104
  - project/root index: `skillwiki project-index <slug> <vault> --apply` and `skillwiki index rebuild <vault> --write` only through managed commands
99
105
  - log projection: `skillwiki log materialize <vault> [--write]`
@@ -125,20 +131,20 @@ The vault is shared across hosts, so host-local absolute paths are not durable s
125
131
  | Entry | When | What happens |
126
132
  |-------|------|-------------|
127
133
  | `/wiki-add-task <text>` | You're in a Claude session | Creates `raw/transcripts/YYYY-MM-DD-{type}-{slug}.md` with ad-hoc capture frontmatter |
128
- | Filesystem drop | You're NOT in a Claude session (Obsidian, editor, sync) | Create/edit any `.md` file in `raw/transcripts/` — dev-loop discovers it on next cycle |
134
+ | Filesystem drop | You're NOT in a Claude session (Obsidian, editor, sync) | Create a new `.md` file in `raw/transcripts/` — dev-loop discovers it on next cycle; do not edit it after capture |
129
135
  | Dev-loop discovery | Automatic, next cycle | Scans `raw/transcripts/` for new files since last cycle, surfaces as claimable work |
130
136
 
131
137
  ## Skill Map
132
138
  | Skill | When to Invoke |
133
139
  |-------|----------------|
134
- | `wiki-init` | Bootstrap a new vault SCHEMA.md, index.md, log.md, ~/.skillwiki/.env |
140
+ | `wiki-init` | Bootstrap a vault and install `_Templates/web-clipper/llm-wiki-clippings.json` plus import guidance |
135
141
  | `wiki-ingest` | Convert URLs, files, or pasted text into typed-knowledge pages |
136
- | `wiki-query` | Search the vault and synthesize an answer with ranked results |
142
+ | `wiki-query` | Search typed knowledge by default; explicitly requested fresh/raw evidence uses the separate pending channel |
137
143
  | `wiki-lint` | Vault health and lint checks; use `health` for whole-system reports and `lint --summary` for bounded lint buckets |
138
144
  | `wiki-crystallize` | Distill the current working session into a typed-knowledge page |
139
145
  | `wiki-audit` | Verify raw provenance references and source frontmatter integrity |
140
- | `wiki-archive` | Archive a typed-knowledge page move to `_archive/`, remove from index (writes delete-intent) |
141
- | `wiki-remove` | Hard-delete a path with delete-intent tombstone; failsafe-git if CLI missing |
146
+ | `wiki-archive` | Archive typed pages, or attended preserve-move exact raw sources under `raw/archived/` |
147
+ | `wiki-remove` | Remove maintained pages; exact raw disposal uses the separate attended `sources dispose` flow |
142
148
  | `wiki-reingest` | Detect drift in raw sources (sha256 comparison) and re-ingest updated content |
143
149
  | `wiki-add-task` | Quick-capture ideas, bugs, tasks, notes into `raw/transcripts/` without leaving the current workflow |
144
150
  | `wiki-adapter-prd` | Map foreign PRD formats (CodeStable, RFC, AIDE, Hermes) into vault pages |
@@ -174,8 +180,8 @@ Use `prd_layer` + `prd_pipeline` from `.claude/dev-loop.config.md` as source of
174
180
 
175
181
  ## CLI Backbone
176
182
  All skills are backed by the `skillwiki` CLI — a deterministic tool with no LLM calls. It handles path resolution, config management, validation, health reporting, and linting. Skills invoke it via Bash for the mechanical parts and use Claude for the creative parts.
177
- Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `archive`, `remove`, `drift`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
178
- Run `skillwiki health <vault> --out /tmp/skillwiki-health.json --no-fail` for a bounded whole-system report that includes doctor, lint, vault-sync, query-readiness, source-freshness, risk flags, and self-check coverage. Run `skillwiki lint <vault> --summary` for lint-only bucket counts with capped examples and details commands. Run `skillwiki doctor` to diagnose setup/runtime issues only. Run `skillwiki config list` to see current configuration.
183
+ Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `query`, `sources pending`, `sources disposition`, `sources dispose`, `archive`, `remove`, `drift`, `dedup`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
184
+ Run `skillwiki health <vault> --out /tmp/skillwiki-health.json --no-fail` for a bounded whole-system report that includes the nonblocking source-lifecycle backlog. Pending captures are informational and do not make health fail. Run `skillwiki lint <vault> --summary` for lint-only bucket counts with capped examples and details commands. Run `skillwiki doctor` to diagnose setup/runtime issues only. Run `skillwiki config list` to see current configuration.
179
185
 
180
186
  ## Runtime Host Context and Fleet Freshness
181
187
  Resolve the active project vault with `skillwiki path` first. Then pass that exact path to `skillwiki --human fleet context <vault>` for host identity and safety guidance. `fleet context` is authoritative for host identity. It overrides stale injected SessionStart context, remembered workspace context, and prior conversation summaries. `fleet context` is local and network-free; it reports `identity_status`, resolver trace, warnings, and the fact that remote freshness was not checked.
@@ -214,7 +220,7 @@ Before asking questions or running scheduled maintenance, resolve the session ki
214
220
  ## Typical Workflow
215
221
  1. **Init** (`wiki-init`) — create vault, set domain and taxonomy
216
222
  2. **Ingest** (`wiki-ingest`) — add sources, build pages
217
- 3. **Query** (`wiki-query`) — search and synthesize answers
223
+ 3. **Query** (`wiki-query`) — search typed knowledge; explicitly include pending captures for fresh/raw intent
218
224
  4. **Lint** (`wiki-lint`) — periodic health checks
219
225
  5. **Crystallize** (`wiki-crystallize`) — save session insights as pages
220
226
  6. **Audit** (`wiki-audit`) — verify source integrity
@@ -8,7 +8,7 @@ Capture ad-hoc ideas, bugs, tasks, and notes into the vault. Three entry points
8
8
  |-------|------|-------------|
9
9
  | `/wiki-add-task <text>` | You're in a Claude Code session (NOT Hermes compact) | Creates `raw/transcripts/YYYY-MM-DD-{type}-{slug}.md` with ad-hoc capture frontmatter |
10
10
  | Filesystem drop | Hermes Agent compact mode (no slash commands available) | Same as above — create `.md` in `raw/transcripts/`, dev-loop discovers it |
11
- | Filesystem drop | You're NOT in a Claude session (Obsidian, editor, sync) | Create any `.md` file in `raw/transcripts/` using the vault template — dev-loop discovers it on next cycle |
11
+ | Filesystem drop | You're NOT in a Claude session (Obsidian, editor, sync) | Create a new `.md` file in `raw/transcripts/` using the vault template — dev-loop discovers it on next cycle |
12
12
  | Dev-loop discovery | Automatic, next cycle | Scans `raw/transcripts/` for new files since last cycle, surfaces as claimable work |
13
13
  **Path Rule:** Captures ALWAYS go to `$(skillwiki path)/raw/transcripts/` (Layer 1). Never under `projects/{slug}/raw/` — that violates SCHEMA.md Layer 1 immutability.
14
14
  ### Exception: Explicit project task requests
@@ -47,7 +47,7 @@ project: "[[{slug}]]"
47
47
  - If a `project` slug was provided, set `project: "[[slug]]"`.
48
48
  - If no project, omit the `project` field entirely.
49
49
  - `source_url` is null (these are locally originated captures).
50
- - No `sha256` ad-hoc captures are mutable working notes, not immutable sources.
50
+ - `sha256` may be omitted for locally originated captures, but the completed capture is still immutable evidence. Corrections create a new capture or a maintained work-item note; never rewrite the existing transcript.
51
51
  5. **Write body.** Below the frontmatter, write:
52
52
  ```markdown
53
53
  # {type}: {text}
@@ -79,7 +79,7 @@ Fix the template mismatch between wiki-add-task and the vault template.
79
79
  ```
80
80
  The `kind` field uses the capture type and must be one of: `idea`, `bug`, `task`, `note` (plus the existing `postmortem`, `session-log`, `meeting-notes`, `other` for non-capture raw sources).
81
81
  The `project` and `kind` fields can be set independently — they do not require `work_item`. The `work_item` field is only used when the raw source is directly tied to a project work item (set by `proj-work`).
82
- Ad-hoc captures omit `sha256` they are mutable working notes, not immutable sources. The `sha256` field is reserved for ingested raw sources that require integrity verification.
82
+ Ad-hoc captures may omit `sha256`; omission does not grant mutation authority. Once created, the transcript's content and frontmatter are immutable. The `sha256` field remains required for ingest pipelines that provide integrity verification.
83
83
  ## Stop conditions
84
84
  - `skillwiki path` returns NO_VAULT_CONFIGURED.
85
85
  - No `text` provided (prompt user once, then stop).
@@ -88,6 +88,7 @@ Ad-hoc captures omit `sha256` — they are mutable working notes, not immutable
88
88
  ## Forbidden
89
89
  - Creating an `inbox/` directory. All captures go to `raw/transcripts/`.
90
90
  - Appending to existing capture files — each capture gets its own file.
91
+ - Editing or correcting an existing raw transcript; create a new capture or maintained work-item note instead.
91
92
  - Creating a work item — this is capture-only. Use `proj-work` for full work items.
92
93
  - Writing to any Layer 2 or Layer 3 location. Captures are Layer 1 (raw).
93
94
  - Writing live credentials, access keys, tokens, passwords, cookies, bearer headers, private keys, or other authenticating secrets to the vault.