Commit Graph

234 Commits

Author SHA1 Message Date
ar9av 275ecc8095 fix(packaging): bundle scripts/ in the wheel (#152)
The daily-update skill's Setup Mode references scripts/daily-update.sh,
the launchd plist, and wiki-notify.sh via $OBSIDIAN_WIKI_REPO/scripts/ —
same class of gap as #143 (the Stop hook), which didn't cover this
directory. force-include scripts/ under obsidian_wiki/_data/scripts/ so
pip/uv installs actually have it, and exclude __pycache__/*.pyc from the
wheel target since force-include copies straight from the working tree
(a local scripts/__pycache__ was otherwise leaking stray .pyc files in).
2026-07-25 22:00:29 -07:00
Arnav ea4508114e feat(sync): share one GitHub-sync implementation across setup.sh and the CLI (#153) (#154)
setup.sh had an interactive git-sync flow (git init, .gitignore, remote,
a generated sync.sh, optional cron) that `obsidian-wiki setup` — the entry
point pip/uv installs actually run — never had, so those installs silently
skipped it and .env.example documented a var nothing ever read.

Move the git plumbing into obsidian_wiki/sync.py (configure_sync/run_sync/
get_remote) and expose it as `obsidian-wiki sync-setup <url>` and
`obsidian-wiki sync`. `obsidian-wiki setup` now offers the same interactive
prompt setup.sh always had (or accepts --remote non-interactively), and
setup.sh's own prompt delegates into the same module via the CLI instead of
re-implementing it. Sync status is read live from the vault's own `git
remote` (via `obsidian-wiki info`) rather than a config var that could drift.
2026-07-25 21:52:11 -07:00
Arnav 073a04cd37 feat(batch): make source discovery git-aware for repo ingestion (#148) (#150)
wiki-ingest previously walked repo folders with a hardcoded SKIP_DIRS
list, so custom-ignored paths (anything not literally node_modules/
.venv/dist/...) leaked into the ingest plan. batch-plan now detects a
`.git` folder and enumerates files via `git ls-files`, so a repo's own
.gitignore decides what's skipped. Docs updated to spell out the
"clone locally, add to OBSIDIAN_SOURCES_DIR" workflow for public/private
repos on any host.
2026-07-24 18:08:51 -07:00
Arnav 2363445eac fix(lint): stage trust-ledger enforcement behind strict_trust (#146) (#147)
Legacy vaults fail-closed on every pre-existing page after the trust-ledger
rollout: missing base_confidence/lifecycle and a missing ledger became
mandatory failures with no opt-out, skipping the staged migration from #28.

Split confidence/lifecycle out of the core required-frontmatter check into a
separate confidence_missing_fields finding, and add a strict_trust switch to
lint_vault (default off): missing trust fields, ledger errors, stale reviews,
and score mismatches now warn by default and only fail once a vault owner
opts in via --strict-trust or OBSIDIAN_TRUST_STRICT=1. Ledger presence alone
no longer silently enables strict mode.
v2026.07.9
2026-07-23 11:43:07 -07:00
Arnav 035dad5199 Merge pull request #145 from Ar9av/fix/cache-manifest-shapes-134
fix: make cache-check/cache-update work with the manifest shape the skills write (#134)
v2026.07.8
2026-07-18 10:11:16 -07:00
ar9av 5016cde0a5 fix(cache): support list-shaped manifests and prefixed hashes (#134)
cache-check / cache-update assumed a dict-keyed manifest with bare hex
hashes, but the wiki-ingest skill writes 'sources' as a list of entry
objects with sha256:-prefixed content_hash and vault-relative paths.
Against a skill-built manifest the commands crashed, then (once past the
crash) reported every file as modified/new. Both shapes occur in real
vaults.

- _load/_iter: read both dict- and list-shaped 'sources' transparently
- compare content_hash prefix-insensitively (strip optional algo: prefix)
- match paths across raw / absolute / vault-relative forms
- update_source edits in place, preserving manifest shape, duplicate-path
  entries, skill-written fields, and top-level keys (stats/version)
- don't flag URL / pseudo-path source keys as missing-on-disk
- add regression tests covering all four failure modes from the issue
2026-07-18 09:55:31 -07:00
Arnav 6740bb592f Merge pull request #144 from Ar9av/fix/bundle-stop-hook-143
fix: bundle wiki-stop-capture.sh in the published wheel (#143)
2026-07-18 09:50:39 -07:00
ar9av 14bdb41096 fix(packaging): bundle wiki-stop-capture.sh in the wheel (#143)
The wiki-setup skill wires a Claude Code Stop hook pointing at
<REPO_PATH>/.claude/hooks/wiki-stop-capture.sh, but /.claude is pruned
from the sdist, so the script was missing from the published wheel and
the installed hook dangled at a nonexistent path.

- force-include the hook into the wheel under _data/hooks/ (and re-add it
  to the sdist, which the wheel is built from)
- wiki-setup now resolves the packaged hooks/ path, falls back to the
  source-checkout .claude/hooks/ path, then to a GitHub raw fetch
- wiki-setup now creates .manifest.json so 'obsidian-wiki doctor' passes
  its required-core-files check (secondary note in the issue)
- add regression tests pinning the packaging config and skill wiring
2026-07-18 09:37:34 -07:00
Arnav e508c528d3 Merge pull request #142 from mike840609/agent/readme-translation-sync
docs: advisory README translation drift check with backfill script
2026-07-18 09:33:34 -07:00
Mike Tsai e8172201fc refactor(ci): make README translation sync advisory, not a merge gate
The readme-sync workflow no longer fails when README.md and
README_TW.md don't change together. Instead, check_readme_sync.py
reports drift: it lists commits that touched README.md after the
last README_TW.md update, plus the pending English diff to translate
and backfill. CI surfaces drift as a warning annotation only.

Claude-Session: https://claude.ai/code/session_01PG9Pz6tcUfgpTHLjq3BT5Q
2026-07-18 10:35:45 +08:00
Arnav 4d684e3b21 Merge pull request #141 from mike840609/fix/propagate-ripgrep-preference-to-skill-examples
fix(skills): replace hardcoded grep examples with rg
v2026.07.7
2026-07-16 14:20:56 -07:00
Mike Tsai dafc90aa4d fix(ci): compare README changes from PR merge base 2026-07-16 01:48:00 +08:00
Mike Tsai d2b89f15c4 docs: require synchronized README translations 2026-07-16 00:53:18 +08:00
Mike Tsai d07e8f950e ci: require README translations to change together 2026-07-16 00:48:58 +08:00
Mike Tsai f4b6368f84 test: enforce paired README changes 2026-07-16 00:45:17 +08:00
Mike Tsai 00a42eabcf fix(skills): replace hardcoded grep examples with rg
PR #129 added a "prefer ripgrep" policy to llm-wiki/SKILL.md, but six
other skills still hardcoded literal grep commands in their examples,
bypassing that policy. Swap them to rg with correct flag mapping
(--include="*.md" -> --glob '*.md'; -r dropped since rg recurses by
default).
2026-07-16 00:10:36 +08:00
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