Commit Graph

268 Commits

Author SHA1 Message Date
Arnav 1951480ba6 Merge pull request #138 from mike840609/feat/pre-write-vault-snapshot
feat(skills): snapshot vault before destructive writes
v2026.07.6
2026-07-14 09:51:56 -07:00
Arnav e9def5a70b Merge pull request #139 from Ar9av/fix/cache-relative-manifest-keys-136
fix(cache): resolve vault-relative manifest keys in cache-check (#136)
2026-07-14 09:51:34 -07:00
ar9av 95424e4b91 fix(cache): resolve vault-relative manifest keys in cache-check
check_sources only matched a manifest entry by the passed key or its
abspath, and detected missing files with Path(key).exists() against CWD.
When the manifest stored vault-relative keys (e.g. _raw/articles/foo.md),
callers passing an absolute path got 'new' instead of 'unchanged', and
every relative key was reported 'missing' when CWD != vault root — so the
docstring's documented abs-or-rel key support was unusable.

Also try the vault-relative form on lookup, and resolve relative manifest
keys against the vault root when checking existence. Add relative-key
tests to close the CI gap (every prior test used absolute keys).

Fixes #136
2026-07-14 09:15:37 -07:00
Arnav 0a9c1f3d70 Merge pull request #137 from Ar9av/fix/skill-manifest-schema-drift-135
docs(wiki-ingest): fix Step 7 manifest schema drift from cache.py (#135)
2026-07-14 09:12:02 -07:00
Mike Tsai 9113e17065 fix(skills): harden pre-write vault snapshots 2026-07-15 00:06:31 +08:00
ar9av cc8768e668 docs(wiki-ingest): align Step 7 manifest schema with cache.py
The Step 7 example wrote ingested_at/pages_created/pages_updated, but
cache.py reads and writes content_hash/last_ingested/pages_produced. An
agent following the docs wrote fields cache-check never reads, so every
source looked new on the next run and incremental-skip detection died.

Rename the fields to match the code, drop the never-persisted
size_bytes/modified_at/pages_updated, and note that source_type/project
are advisory only.

Fixes #135
2026-07-14 08:54:57 -07:00
Mike Tsai cb9d7320d6 feat(skills): git snapshot vault before destructive skill writes
Closes #4

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e5m1CuEE5DTQcFFmeCgRu
2026-07-14 08:17:24 +08:00
Arnav 50a8edfb60 Merge pull request #133 from mike840609/feature/wiki-narrate
feat: add wiki-narrate skill
v2026.07.5
2026-07-12 12:51:38 -07:00
Arnav 09279defd6 Merge pull request #132 from singgihanggana/fix/deterministic-trust-ledger
fix(lint): add approved confidence trust ledger
2026-07-12 12:43:24 -07:00
Mike Tsai 568b7ee024 docs: remove superpowers planning docs
These were working docs for the wiki-narrate skill, not meant to ship
as part of the vault framework.
2026-07-12 21:03:53 +08:00
Singgih Lukman Anggana e21b4781bb fix(trust): close metadata and relationship gaps
Validate updated timestamps before fingerprint comparison, support dash-only relationship list items, and reject ambiguous normalized qualified targets and unsupported relationship fields.
2026-07-12 19:20:16 +07:00
Singgih Lukman Anggana e5cd869fdb fix(trust): harden ledger validation
Reject symlinked writes and malformed or ambiguous trust data, enforce complete page coverage and strict timestamps/lifecycle values, and parse typed relationships independent of key order.
2026-07-12 19:06:44 +07:00
Singgih Lukman Anggana 6242472b8f fix(lint): add approved confidence trust ledger
Replace source-string confidence guesses with a manually approved, fingerprinted review ledger. Add exact relationship validation, fail-closed CLI checks, partial review recording, and regression coverage.
2026-07-12 18:24:38 +07:00
Mike Tsai efee785d63 docs: exclude _readouts/ from vault-scanning skills
wiki-narrate saves derived readouts to _readouts/, but cross-linker,
wiki-export, and wiki-lint scanned every .md in the vault and would
have linked, exported, or lint-flagged them. Exclude the directory in
all three and document it in the AGENTS.md vault structure.
2026-07-12 17:37:36 +08:00
Mike Tsai 3b3a093e51 docs: add wiki narrate implementation plan 2026-07-12 14:08:18 +08:00
Mike Tsai 198befd96b docs: document wiki narrate 2026-07-12 14:08:18 +08:00
Mike Tsai 8a70487395 feat: add wiki narrate skill 2026-07-12 14:08:18 +08:00
Mike Tsai 0158052289 test: enforce closed wiki narrate voices 2026-07-12 14:08:18 +08:00
Mike Tsai b539ede21e test: define wiki narrate contract 2026-07-12 14:08:18 +08:00
Mike Tsai 468046a045 docs: add wiki-narrate design 2026-07-12 14:08:18 +08:00
Mike Tsai 2cc64265e5 docs: route wiki-context-pack, wiki-stage-commit, obsidian-layout-adjustment in skill table (#131)
Three skills existed in .skills/ but were missing from the AGENTS.md
Skill Routing table, making them invisible to agent dispatch.


Claude-Session: https://claude.ai/code/session_015e5m1CuEE5DTQcFFmeCgRu

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
v2026.07.4
2026-07-11 12:52:43 -07:00
Mike Tsai bf485024ad Add Traditional Chinese README (#130) v2026.07.3 2026-07-09 11:46:58 -07:00
Mike Tsai ef25564d2c Prefer ripgrep in wiki retrieval guidance (#129) 2026-07-09 11:06:43 -07:00
Arnav e3ead02a32 Merge pull request #128 from dctact/codex/issue-127-obsidian-layout-adjustment-skill
Add Obsidian layout adjustment skill
v2026.07.2
2026-07-07 14:12:47 -07:00
Arnav c1acd8961e Merge pull request #126 from snvtac/snvtac/125-remove-dangling-agent-mirror-symlinks
fix: remove dangling skill mirror symlinks
2026-07-07 13:42:07 -07:00
dctact 8d231a1468 feat: add Obsidian layout adjustment skill
Links #127
2026-07-07 12:53:21 -04:00
Haoqian Li 2f91a81f1f fix: remove dangling skill mirror symlinks 2026-07-07 20:37:51 +08:00
Arnav 1f290b05de Merge pull request #124 from yulin0629/fix/ingest-delta-detection-bugs
fix: two silent delta-detection bugs in ingest helpers (manifest.py, extract-jsonl.py)
v2026.07.1
2026-07-03 13:50:19 -07:00
Yician Wang 69ff8cc36a fix(extract): check missing output before the --since gate
The staleness order still let --since suppress a missing output: a source
older than the cutoff with no output file was skipped, leaving the very bug
this branch fixes (never-extracted older sessions) partly alive and
contradicting needs_extraction's own docstring.

Move the "output missing -> extract" check ahead of the --since gate, so a
missing output is always (re)extracted and --since only narrows files that
already have an output. Add a regression test: missing output + future
--since still extracts.

AI-Agent: Claude Code
AI-Session-IDs: session_01PPCNXmXUvemmyvWxrJ3D5E
2026-07-03 22:48:16 +08:00
Yician Wang 754d917467 fix(manifest): stop normalize from corrupting relative source keys
cmd_normalize warned on relative keys but still ran them through
canonical() (os.path.abspath), which resolves them against the CWD and
rewrote e.g. "-Users-x-github/abc.jsonl" to "/cwd/-Users-x-github/abc.jsonl",
counted it as re-keyed, and persisted the corruption on a non-dry-run write.

Preserve relative keys untouched (ckey = key), skip the re-key count for
them, and only canonicalize absolute keys. normalize's dedup/canonicalize
purpose applies to absolute keys only; for relative keys it is now a safe
no-op. Collision merge logic is unchanged.

AI-Agent: Claude Code
AI-Session-IDs: session_01PPCNXmXUvemmyvWxrJ3D5E
2026-07-03 22:48:16 +08:00
Yician Wang 84cff259b2 fix(extract): key incremental staleness on output file, not manifest wallclock
extract-jsonl.py decided re-extraction from the .extract-manifest.json
extracted_at wallclock. A session whose output was missing or that landed
after the first run was treated as already-done and never re-extracted, so
downstream ingest saw it as missing until a manual rerun (e.g. session
2d83ed0d). --since additionally acted as a hard gate that hid never-extracted
older sessions.

Make needs_extraction idempotent on the output file: (re)extract when the
output is missing or the source is newer than it; --since only narrows the
scan range. The manifest (read by nothing else) is removed. Add
test_extract_staleness.py covering missing/newer/older cases.

AI-Agent: Claude Code
AI-Session-IDs: session_01PPCNXmXUvemmyvWxrJ3D5E
2026-07-03 22:48:16 +08:00
Yician Wang 99eb09f9ce fix(manifest): match relative source keys in delta scan
cmd_delta keyed every manifest source through canonical() (os.path.abspath),
which resolves relative keys (e.g. "-Users-x-github/abc.jsonl" under
~/.claude/projects/) against the CWD. Real vaults store most keys relatively,
so every already-ingested file was misreported as NEW (446 vs 384 known on the
live vault).

Add a basename-indexed suffix fallback: when a scanned absolute path has no
direct canonical match, look it up by basename and confirm the relative key is
a path suffix (O(1) avg, no O(n^2) scan). Absolute keys keep their exact prior
behavior. cmd_normalize is unchanged but now warns on relative keys, which it
would otherwise rewrite to CWD-based garbage.

AI-Agent: Claude Code
AI-Session-IDs: session_01PPCNXmXUvemmyvWxrJ3D5E
2026-07-03 22:48:16 +08:00
ar9av 8c29591dee docs: document doctor, lint, and query commands v2026.07 2026-07-02 07:49:27 -07:00
ar9av 7036ea812c Add obsidian-wiki query command 2026-07-01 22:15:19 -07:00
ar9av 87eefd8846 Add obsidian-wiki lint command 2026-07-01 22:14:08 -07:00
ar9av 1fae7928a4 Add obsidian-wiki doctor command 2026-07-01 22:11:29 -07:00
ar9av ee9061d642 docs: include repo URL in agent setup section 2026-06-30 21:20:26 -07:00
ar9av ab49f4ceb6 docs: add "Let your agent set it up" section to Quick Start
Points readers to .skills/wiki-setup/SKILL.md as the zero-command setup path — open the repo in any agent and say "set up my wiki".
2026-06-30 21:19:45 -07:00
Arnav 9a915c953d Merge pull request #123 from Ar9av/feat/graphrag-query
feat(graphrag): graph-index query pre-pass eliminates speculative page reads
v2026.06.10
2026-06-30 13:53:11 -07:00
ar9av a7fb1d69fe feat(graphrag): graph-index query pre-pass eliminates speculative page reads
Adds obsidian-wiki graph-query <vault> "<question>" — queries the compiled
wikilink index before opening any page bodies, returning ranked candidates,
a should_read shortlist, and multi-hop paths. Replaces the current approach
of opening 5-10 pages speculatively per query.

- New obsidian_wiki/graphrag.py: build_index() (frontmatter + wikilinks,
  in/out degree, tier), rank_candidates() (score = title/tag/summary match
  + degree bonus + tier weight), find_path() (BFS multi-hop, max_depth=4),
  classify_query() (direct/path/gap/list routing), query() top-level entry.
- index_only=true when top candidate has exact title match + non-empty
  summary — skips page reads entirely for lookup queries.
- CLI: graph-query <vault> "<question>" [--top N] [--max-read N] [--pretty]
- wiki-query SKILL.md gets Step 0: run graph-query first; use should_read
  instead of speculative reads; skip to Step 5 when index_only=true.
- 34 new tests: index building, ranking, path finding, query classification,
  integration, and CLI.
2026-06-30 13:52:53 -07:00
Arnav 0221e0db9a Merge pull request #122 from Ar9av/feat/batch-extract
feat(batch): parallel subagent batch planning for large-folder ingestion
2026-06-30 13:50:17 -07:00
ar9av 6069d775d6 feat(batch): parallel subagent batch planning for large-folder ingestion
Adds obsidian-wiki batch-plan <vault> <source-dir> — splits a source
directory into sized batches and emits a dispatch plan the skill uses
to spawn parallel Claude subagents, each handling one batch independently.

- New obsidian_wiki/batch.py: file classification (text/pdf/image/office/
  code/skip), discover_sources() directory walker (respects SKIP_DIRS,
  excludes code by default since ast-extract handles those), _make_batches()
  (byte + file-count limits), plan_batches() top-level entry that integrates
  with the cache module to skip unchanged files before splitting.
- CLI: batch-plan <vault> <source-dir> [--max-mb N] [--max-files N]
        [--no-cache] [--include-code] [--pretty]
- wiki-ingest SKILL.md gets Step 0: run batch-plan for directories >20 files,
  dispatch each batch as a parallel subagent, run cross-linker once all done.
- 30 new tests: classification, discovery, splitting, cache integration, CLI.
2026-06-30 13:49:53 -07:00
Arnav d99df43480 Merge pull request #121 from Ar9av/feat/graph-analysis
feat(graph-analysis): wikilink graph analysis with community detection and god nodes
2026-06-30 13:47:34 -07:00
ar9av e87ef958b2 feat(graph-analysis): wikilink graph analysis with community detection and god nodes
Adds obsidian-wiki graph-analyse <vault> — computes god nodes, community
clusters, surprising cross-community connections, dead-ends, and isolated
pages from the vault's wikilink graph. No LLM, no API calls.

- New obsidian_wiki/graph_analysis.py: parse_vault_graph() (wikilink + tag
  extraction), god_nodes() (degree ranking), detect_communities_greedy()
  (label-propagation, pure Python, O(n·k)), detect_communities() (tries
  leidenalg+igraph first, falls back to greedy), surprising_connections()
  (cross-community edges ranked by inverse sqrt of cross-degree product),
  analyse_vault() top-level entry returning JSON-ready dict.
- CLI: graph-analyse <vault> [--top N] [--pretty]
- Optional obsidian-wiki[graph] extra for Leiden (leidenalg + igraph).
- wiki-status SKILL.md insights mode updated: now calls graph-analyse first
  instead of building the wikilink graph manually, with fallback instructions.
- 27 new tests covering parsing, metrics, community detection, surprising
  connections, full integration, and CLI.
2026-06-30 13:47:16 -07:00
Arnav 46889cf83f Merge pull request #120 from Ar9av/feat/content-hash-cache
feat(cache): content-hash cache for reliable incremental ingestion
2026-06-30 13:43:14 -07:00
ar9av b470eedf3e feat(cache): content-hash cache for reliable incremental ingestion
Replaces the manual sha256sum shell dance with a dedicated Python module
and three CLI subcommands. Pure stdlib — no new runtime dependencies.

- New obsidian_wiki/cache.py: sha256_file/sha256_dir (chunked, memory-safe),
  check_sources() classifies a list of paths as new/modified/unchanged/missing
  vs .manifest.json; update_source() records hash + pages_produced + timestamp
  after a successful ingest.
- CLI: cache-check <vault> <sources...> → JSON classification
       cache-update <vault> <source> [--pages ...] → write hash to manifest
       cache-hash <path> → just compute and return SHA-256
- wiki-ingest SKILL.md updated: append-mode section now uses cache-check /
  cache-update instead of platform-specific sha256sum invocations. Falls back
  to the old manual approach if obsidian-wiki is not installed.
- 25 new tests covering hash stability, mtime-independence, manifest round-trips,
  and all three CLI commands.
2026-06-30 13:42:54 -07:00
Arnav caae3c2e06 Merge pull request #119 from Ar9av/feat/ast-extractor
feat(ast-extractor): local code structure extraction with no LLM calls
2026-06-30 13:40:40 -07:00
ar9av 7535910719 feat(ast-extractor): local code structure extraction with no LLM calls
Adds `obsidian-wiki ast-extract <path>` — a free, local pass that extracts
classes, functions, imports, and inheritance edges from code files using
deterministic regex patterns before any token is spent on the LLM.

- New `obsidian_wiki/ast_extractor.py`: Graph/Node/Edge datamodel + per-language
  LangSpec patterns for Python, JS/TS, Go, Rust, Java, Kotlin, Ruby, C/C++,
  Swift, Shell (12 languages). Outputs god_nodes (top hubs by degree), stats,
  and a node-link JSON dict compatible with any graph tool.
- New `ast-extract` CLI subcommand with `--pretty` flag.
- Optional `obsidian-wiki[ast]` extra for tree-sitter upgrade path.
- wiki-ingest SKILL.md gets Step 1c: run ast-extract first on code sources,
  seed entity pages from class nodes, skip sending code files to the LLM.
- 19 new tests covering file extraction, directory merge, CLI output, edge cases.
2026-06-30 13:27:30 -07:00
Arnav d6dee95ede Add inline vault targeting docs
Document @name named-vault routing across shared skills, bootstrap docs, and README; add regression tests for config-resolution consistency.
v2026.06.9
2026-06-29 16:24:47 -07:00
Waldo Zins 693f01aae6 fix(pi-history): require session-grounded provenance (#116)
* fix(pi-history): require session-grounded provenance

Add a session knowledge closure rule, evidence ledger, and source verification gate so extracted wiki claims must cite Pi session entries instead of relying on model memory.

AI-Agent: Pi

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Arnav <f2016731@pilani.bits-pilani.ac.in>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
v2026.06.8
2026-06-27 15:48:00 -07:00