@itradingai/aiwiki 0.2.18 → 0.2.20

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 (67) hide show
  1. package/README.md +16 -12
  2. package/dist/src/app.js +9 -17
  3. package/dist/src/ingest.js +52 -27
  4. package/dist/src/lint.js +84 -1
  5. package/dist/src/payload.js +25 -10
  6. package/dist/src/wiki-entry.js +3 -3
  7. package/dist/src/workspace.js +18 -9
  8. package/docs/20260607-aiwiki-feature-pruning-plan.md +468 -0
  9. package/docs/20260607-aiwiki-long-term-operating-roadmap.md +409 -0
  10. package/docs/AGENT_HANDOFF.md +6 -7
  11. package/docs/FAQ.md +8 -2
  12. package/docs/README.md +8 -4
  13. package/docs/RELEASE.md +9 -14
  14. package/docs/ROADMAP.md +5 -0
  15. package/docs/SHOWCASE.md +19 -9
  16. package/docs/USAGE.md +23 -19
  17. package/docs/development-log.md +227 -0
  18. package/examples/demo-run/README.md +28 -0
  19. package/examples/demo-run/context-output.json +341 -0
  20. package/examples/demo-run/ingest-agent-output.txt +25 -0
  21. package/examples/demo-run/ingest-file-output.txt +23 -0
  22. package/examples/demo-run/input/agent-enriched-payload.json +88 -0
  23. package/examples/demo-run/input/local-article.md +5 -0
  24. package/examples/demo-run/lint-output.json +46 -0
  25. package/examples/demo-run/query-output.txt +54 -0
  26. package/examples/demo-run/setup-output.txt +9 -0
  27. package/examples/demo-run/status-output.txt +20 -0
  28. package/examples/obsidian-vault-sample/02-raw/articles/llm-wiki-notes.md +32 -0
  29. package/examples/obsidian-vault-sample/02-raw/articles/local-article.md +33 -0
  30. package/examples/obsidian-vault-sample/03-sources/article-cards/llm-wiki-notes.md +62 -0
  31. package/examples/obsidian-vault-sample/03-sources/article-cards/local-article.md +58 -0
  32. package/examples/obsidian-vault-sample/04-claims/_suggestions/llm-wiki-notes-claims.md +58 -0
  33. package/examples/obsidian-vault-sample/05-wiki/source-knowledge/llm-wiki-notes.md +103 -0
  34. package/examples/obsidian-vault-sample/05-wiki/source-knowledge/local-article.md +72 -0
  35. package/examples/obsidian-vault-sample/06-assets/_suggestions/llm-wiki-notes-assets.md +29 -0
  36. package/examples/obsidian-vault-sample/07-topics/ready/llm-wiki-notes-topics.md +29 -0
  37. package/examples/obsidian-vault-sample/08-outputs/outlines/llm-wiki-notes-outline.md +43 -0
  38. package/examples/obsidian-vault-sample/09-runs/20260608-160603905-085f05/payload.json +24 -0
  39. package/examples/obsidian-vault-sample/09-runs/20260608-160603905-085f05/processing-summary.md +56 -0
  40. package/examples/obsidian-vault-sample/09-runs/20260608-160603905-085f05/raw.md +33 -0
  41. package/examples/obsidian-vault-sample/09-runs/20260608-160603905-085f05/source-card.md +58 -0
  42. package/examples/obsidian-vault-sample/09-runs/20260608-160603905-085f05/wiki-entry.md +72 -0
  43. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/creative-assets.md +29 -0
  44. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/draft-outline.md +43 -0
  45. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/payload.json +91 -0
  46. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/processing-summary.md +67 -0
  47. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/raw.md +32 -0
  48. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/source-card.md +62 -0
  49. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/topics.md +29 -0
  50. package/examples/obsidian-vault-sample/09-runs/20260608-160603980-89f570/wiki-entry.md +103 -0
  51. package/examples/obsidian-vault-sample/_system/index.md +37 -0
  52. package/examples/obsidian-vault-sample/_system/log.md +8 -0
  53. package/examples/obsidian-vault-sample/_system/purpose.md +31 -0
  54. package/examples/obsidian-vault-sample/_system/schemas/aiwiki-frontmatter.md +21 -0
  55. package/examples/obsidian-vault-sample/_system/templates/review-note.md +16 -0
  56. package/examples/obsidian-vault-sample/_system/templates/source-card.md +34 -0
  57. package/examples/obsidian-vault-sample/aiwiki.yaml +18 -0
  58. package/examples/obsidian-vault-sample/dashboards/AIWiki Home.md +31 -0
  59. package/examples/obsidian-vault-sample/dashboards/Recent Runs.md +10 -0
  60. package/examples/obsidian-vault-sample/dashboards/Review Queue.md +12 -0
  61. package/examples/obsidian-vault-sample/dashboards/Source Cards.md +10 -0
  62. package/examples/obsidian-vault-sample/dashboards/Topic Pipeline.md +10 -0
  63. package/examples/obsidian-vault-sample/dashboards/Wiki Entries.md +10 -0
  64. package/package.json +13 -2
  65. package/skill/LINT_PROTOCOL.md +6 -4
  66. package/skill/SKILL.md +12 -5
  67. package/docs/POSITIONING_CONTEXT_COMPILER_PLAN.md +0 -347
package/docs/USAGE.md CHANGED
@@ -56,14 +56,14 @@ aiwiki status
56
56
 
57
57
  ## 2. 让宿主 Agent 学会 AIWiki
58
58
 
59
- 初始化知识库之后,先让宿主 Agent 学会 AIWiki。推荐先扫描本机支持的宿主 Agent:
59
+ 初始化知识库之后,先让宿主 Agent 学会 AIWiki。主路径推荐使用幂等同步:
60
60
 
61
61
  ```bash
62
- aiwiki agent list
63
- aiwiki agent check
62
+ aiwiki agent sync --yes
63
+ aiwiki agent check --json
64
64
  ```
65
65
 
66
- 再启动安装向导:
66
+ 旧的安装向导仍然兼容,但不再作为首选路径:
67
67
 
68
68
  ```bash
69
69
  aiwiki agent install
@@ -93,7 +93,7 @@ aiwiki prompt agent
93
93
 
94
94
  把输出内容安装成宿主 Agent 的 skill,或粘贴到宿主 Agent 的项目/会话说明里。不同 Agent 的安装入口不同,所以 AIWiki 提供自动安装向导和通用协议两条路径。
95
95
 
96
- `aiwiki agent check` 用来确认本机检测到哪些宿主 Agent、哪些已经安装 AIWiki 对接文件、哪些还需要运行 `aiwiki agent install --agent <id> --yes`。
96
+ `aiwiki agent check --json` 用来确认本机检测到哪些宿主 Agent、哪些已经安装 AIWiki 对接文件、哪些还需要运行 `aiwiki agent sync --agent <id> --yes`。
97
97
 
98
98
  ## 3. 日常使用
99
99
 
@@ -127,7 +127,7 @@ source_url: https://example.com/article
127
127
  summary: 这里是文章前段摘要,方便 Agent 快速告诉用户文章大意。
128
128
  run_id: 20260507-153012-abc123
129
129
  run_dir: F:\knowledge_data\aiwiki\09-runs\20260507-153012-abc123
130
- files: 15
130
+ files: 8
131
131
  processing_summary: 09-runs/20260507-153012-abc123/processing-summary.md
132
132
  wiki_entry: 05-wiki/source-knowledge/article-slug.md
133
133
  wiki_entry_generation_mode: agent_enriched
@@ -138,7 +138,7 @@ grounding_needs_review: no
138
138
  grounding_markers: none
139
139
  grounding_claims_with_quotes: 1/1
140
140
  source_card: 03-sources/article-cards/article-slug.md
141
- draft_outline: 09-runs/20260507-153012-abc123/draft-outline.md
141
+ draft_outline: 09-runs/20260507-153012-abc123/draft-outline.md # 仅在生成大纲时出现
142
142
  dashboard: dashboards/AIWiki Home.md
143
143
  review_queue: dashboards/Review Queue.md
144
144
  warnings: 0
@@ -186,25 +186,26 @@ Obsidian 入口:dashboards/AIWiki Home.md
186
186
 
187
187
  ## 5. 成功后会生成什么
188
188
 
189
- 每次 run 会写入:
189
+ 每次成功 run 先看核心产物:
190
190
 
191
191
  ```text
192
192
  09-runs/<run-id>/payload.json
193
193
  09-runs/<run-id>/raw.md
194
194
  09-runs/<run-id>/source-card.md
195
- 09-runs/<run-id>/creative-assets.md
196
- 09-runs/<run-id>/topics.md
197
- 09-runs/<run-id>/draft-outline.md
195
+ 09-runs/<run-id>/wiki-entry.md
198
196
  09-runs/<run-id>/processing-summary.md
197
+ 02-raw/articles/
198
+ 03-sources/article-cards/
199
+ 05-wiki/source-knowledge/
199
200
  ```
200
201
 
201
- 同时写入长期目录:
202
+ 只有 payload 有对应内容或 `request.outputs` 明确请求时,才会出现可选增强产物:
202
203
 
203
204
  ```text
204
- 02-raw/articles/
205
- 03-sources/article-cards/
205
+ 09-runs/<run-id>/creative-assets.md
206
+ 09-runs/<run-id>/topics.md
207
+ 09-runs/<run-id>/draft-outline.md
206
208
  04-claims/_suggestions/
207
- 05-wiki/source-knowledge/
208
209
  06-assets/_suggestions/
209
210
  07-topics/ready/
210
211
  08-outputs/outlines/
@@ -212,6 +213,8 @@ Obsidian 入口:dashboards/AIWiki Home.md
212
213
 
213
214
  `05-wiki/source-knowledge` 是默认知识层;`09-runs` 用于追溯每次处理。
214
215
 
216
+ 可以直接查看仓库里的 `examples/demo-run/` 和 `examples/obsidian-vault-sample/`,它们由当前 CLI 生成,展示普通本地文件只生成核心产物、enriched Agent payload 才生成可选增强产物。
217
+
215
218
  Wiki Entry 有两种质量模式:
216
219
 
217
220
  - `agent_enriched` / `enriched`:宿主 Agent 提供了 `analysis` 或 `wiki_entry`。
@@ -252,10 +255,10 @@ AIWiki 生成的 Markdown 按 Obsidian vault 内路径组织,文件正文会
252
255
 
253
256
  链接规则:
254
257
  - wikilink 使用 vault 相对路径,统一为 `/`,并去掉 `.md` 后缀。
255
- - `05-wiki/source-knowledge` 是默认知识入口;`03-sources/article-cards` 会链接到 Wiki 条目、原文、Claim 建议、素材建议、选题、大纲和本次处理记录。
256
- - `02-raw/articles`、`04-claims/_suggestions`、`06-assets/_suggestions`、`07-topics/ready`、`08-outputs/outlines` 会回链到资料卡,Obsidian 的 Backlinks/Graph View 可以串起同一篇资料。
258
+ - `02-raw/articles`、`03-sources/article-cards`、`05-wiki/source-knowledge` 和 `09-runs/<run-id>` 是核心产物;`04-claims/_suggestions`、`06-assets/_suggestions`、`07-topics/ready`、`08-outputs/outlines` 只在 payload 有对应内容或 `request.outputs` 明确请求时生成。
259
+ - `03-sources/article-cards` 只链接本次实际生成的可选增强产物,避免空目录和断链。
257
260
  - `09-runs/<run-id>/processing-summary.md` 会把本次生成的 Markdown 文件列成可点击 wikilink;`payload.json` 不是 Markdown,保留普通路径。
258
- - frontmatter 会写入 `aiwiki_id`、`type`、`status`、`slug`、`source_url`、`content_fingerprint`、`created_at`、`captured_at`、`run_id`、`source_card`、`raw_note`、`claims_note`、`assets_note`、`topics_note`、`outline_note`、`run_summary`、`tags` 等字段,便于后续用 Obsidian Search / Properties / Dataview 做筛选。
261
+ - frontmatter 会写入 `aiwiki_id`、`type`、`status`、`slug`、`source_url`、`content_fingerprint`、`created_at`、`captured_at`、`run_id`、`source_card`、`raw_note`、`run_summary` 等核心字段;`claims_note`、`assets_note`、`topics_note`、`outline_note` 只在对应产物存在时出现。
259
262
 
260
263
  ### Obsidian 数据库入口
261
264
 
@@ -324,9 +327,10 @@ aiwiki lint
324
327
  aiwiki lint --severity warning
325
328
  aiwiki lint --json
326
329
  aiwiki lint --no-write
330
+ aiwiki lint --fix-empty-dirs --json
327
331
  ```
328
332
 
329
- `lint` 会先输出 `lint_summary`、`top_issue` 和报告路径,再按 Errors / Warnings / Info 分组展示问题。每个问题会尽量给出建议动作,例如 `enrich`、`fix_link`、`reingest`、`archive` 或 `mark_reviewed`。`--severity` 只查看指定级别,`--json` 给宿主 Agent 使用,`--no-write` 只在终端检查而不更新 `dashboards/Lint Report.md`。
333
+ `lint` 会先输出 `lint_summary`、`safe_fixes`、`top_issue` 和报告路径,再按 Errors / Warnings / Info 分组展示问题。每个问题会尽量给出建议动作,例如 `enrich`、`fix_link`、`reingest`、`archive`、`mark_reviewed` 或 `remove_empty_optional_dir`。`--severity` 只查看指定级别,`--json` 给宿主 Agent 使用,`--no-write` 只在终端检查而不更新 `dashboards/Lint Report.md`。`--fix-empty-dirs --json` 只会删除已知且为空的可选增强目录,并在 `safe_fixes.applied` 里报告删除了什么。
330
334
 
331
335
  查看下一步建议:
332
336
 
@@ -2,6 +2,233 @@
2
2
 
3
3
  This log records queue-driven AIWiki development milestones that should remain visible to future maintainers, not only in automation chat history.
4
4
 
5
+ ## 2026-06-08 - Base contract cleanup and safe optional directory pruning
6
+
7
+ Status: implemented and locally verified, committed locally, blocked before GitHub push and npm publication. Test-server verification is now required before both GitHub push and npm publication.
8
+
9
+ Version target: `@itradingai/aiwiki@0.2.19`
10
+
11
+ Commit: `3ae25b9` (`Stabilize AIWiki base contract before public-trial work`)
12
+
13
+ ### Goal
14
+
15
+ Make the base AIWiki experience quieter and more reliable before public-trial work. A new workspace should show the core knowledge workflow first, not a set of empty enhancement directories or legacy command paths. Agents should also have a safe, machine-readable way to detect and remove only empty optional directories.
16
+
17
+ The scoped acceptance criteria were:
18
+
19
+ - keep the main help and quick-start path focused on setup, Agent sync/check, ingest, context/query, lint, status, and doctor;
20
+ - preserve legacy command behavior without presenting legacy commands as the primary path;
21
+ - create only core directories by default in new workspaces;
22
+ - create optional long-term directories only when ingest actually writes related outputs;
23
+ - treat missing optional directories as normal in doctor and directory summaries;
24
+ - report empty optional directories as safe-fix lint issues with stable JSON metadata;
25
+ - make `lint --fix-empty-dirs --json` delete only known empty optional directories and empty known optional parent directories;
26
+ - keep the base CLI out of crawling, vector search, RAG-over-wiki, RBAC, RSS, scheduled collection, and browser-plugin scope.
27
+
28
+ ### Implemented
29
+
30
+ - `src/workspace.ts`
31
+ - Split core directories from optional enhancement directories.
32
+ - Made setup/init/doctor summaries core-first.
33
+ - Kept optional directories valid when they already exist, but stopped requiring them for a healthy workspace.
34
+
35
+ - `src/payload.ts`, `src/ingest.ts`, and `src/wiki-entry.ts`
36
+ - Preserved `request.outputs` as an additive request instead of normalizing every ingest into all optional artifacts.
37
+ - Kept core ingest artifacts stable: Source Card, Wiki Entry, and Processing Summary.
38
+ - Created claims, assets, topics, and outline files only when payload content or explicit outputs require them.
39
+ - Omitted optional frontmatter links when the corresponding files are not written.
40
+
41
+ - `src/lint.ts` and `src/app.ts`
42
+ - Added safe-fix metadata for empty known optional directories.
43
+ - Added `safe_fixes.available`, `safe_fixes.applied`, and `safe_fixes.only_safe_fixes` to JSON output.
44
+ - Added `aiwiki lint --fix-empty-dirs --json`.
45
+ - Kept deletion deliberately narrow: known optional empty directories only, never core directories, unknown directories, non-empty directories, or files.
46
+ - Reduced main help to the core user path while preserving existing command behavior.
47
+
48
+ - Documentation and packaged skill files
49
+ - Updated README, usage docs, FAQ, Agent handoff, lint protocol, and skill instructions for the core-first workflow.
50
+ - Documented the Agent flow: run `aiwiki lint --json`, apply safe fixes only when allowed, rerun lint, and report the changed directories.
51
+ - Tightened package file inclusion so unrelated untracked docs are not accidentally packed.
52
+
53
+ - Tests
54
+ - Updated workspace tests for the smaller default directory contract.
55
+ - Added ingest coverage for minimal output behavior.
56
+ - Added CLI coverage for `lint --fix-empty-dirs --json` and help/setup guidance.
57
+
58
+ ### Verification
59
+
60
+ - `npm test`: passed, 59 tests.
61
+ - `npm run release:check`: passed, including tests and `scripts/release-check.mjs`.
62
+ - `npm pack --dry-run`: passed for `@itradingai/aiwiki@0.2.19`, 35 files, package size 77.1 kB, shasum `3f436503bb0dc3019b188941f06f3c518bbecc0b`.
63
+ - Verification used `D:/Program Files/nodejs/npm.cmd` with a repo-local npm cache because the PowerShell `npm` shim points to a missing `C:/Users/Max/AppData/Roaming/npm/npm-cli.js`.
64
+
65
+ ### Release State
66
+
67
+ The implementation is committed locally, but the GitHub push failed before publication:
68
+
69
+ ```text
70
+ Warning: Identity file C:/Users/Max/.ssh/id_ed25519 not accessible: Permission denied.
71
+ git@github.com: Permission denied (publickey).
72
+ fatal: Could not read from remote repository.
73
+ ```
74
+
75
+ Because GitHub push failed, npm publication was not attempted. The task queue and human board are marked `blocked`, and the Enterprise WeChat blocked notification was delivered successfully with HTTP 200 / `errcode:0`.
76
+
77
+ ### Testing Server Gate
78
+
79
+ Test-server verification must run before updating GitHub or npm.
80
+
81
+ The release gate for `0.2.19` is now a pre-GitHub and pre-npm tarball smoke test: create the exact local npm tarball that would be published, copy that `.tgz` to a task-specific directory on `170.106.73.197`, install it into a task-local Node project, and run the same smoke commands against that installed package. This proves the package artifact before it reaches GitHub or npm.
82
+
83
+ The older published-package smoke test remains useful after npm publication as a final registry sanity check, but it is no longer allowed to be the first remote test. Pushing to GitHub or publishing to npm before test-server verification would make a public delivery surface the first real deployment surface, which is the wrong order for this queue.
84
+
85
+ Required prepublication smoke commands:
86
+
87
+ ```bash
88
+ aiwiki setup --path <tmp-vault> --yes
89
+ aiwiki doctor --path <tmp-vault>
90
+ inspect that only core directories are created by default
91
+ aiwiki ingest-agent --payload <minimal-fixture> --path <tmp-vault>
92
+ inspect that optional output directories remain absent unless needed
93
+ aiwiki lint --json --path <tmp-vault>
94
+ aiwiki lint --fix-empty-dirs --json --path <tmp-vault>
95
+ aiwiki context <topic> --path <tmp-vault>
96
+ aiwiki query <topic> --path <tmp-vault>
97
+ ```
98
+
99
+ The smoke test must use only a task-specific temporary directory on the remote server. Do not install globally, do not reuse a real user vault, and do not clean outside the task directory.
100
+
101
+ ### Resume Steps
102
+
103
+ Remote tarball smoke must pass first. Only after that, restore SSH key access for the current runtime user or configure GitHub authentication so this succeeds:
104
+
105
+ ```powershell
106
+ git push origin main
107
+ ```
108
+
109
+ Then continue the release chain:
110
+
111
+ ```powershell
112
+ npm publish --access public
113
+ npm view @itradingai/aiwiki version
114
+ ```
115
+
116
+ After `npm view` returns `0.2.19`, a short published-package registry sanity check can be run, but the blocking test-server gate must already have passed before both GitHub push and npm publish.
117
+
118
+ ### Notes For Future Changes
119
+
120
+ - Keep optional directories optional. Do not reintroduce required empty claims/assets/topics/outlines directories in new workspaces.
121
+ - Keep safe fixes narrow and auditable. Do not let `--fix-empty-dirs` delete files, core directories, unknown directories, or non-empty directories.
122
+ - Keep main help focused on the core path. Legacy commands can remain compatible without being promoted as first-run guidance.
123
+ - Test-server verification from the local npm tarball must happen before GitHub push and before npm publication. Local pack verification alone is not enough to update GitHub or npm.
124
+
125
+ ## 2026-06-07 - Agent-first skill sync
126
+
127
+ Status: implemented, locally verified, pushed to GitHub, blocked on npm OTP before publication.
128
+
129
+ Version target: `@itradingai/aiwiki@0.2.18`
130
+
131
+ Commit: `e41d634` (`Make Agent skill upgrades safe to sync automatically`)
132
+
133
+ ### Goal
134
+
135
+ Make AIWiki skill upgrades safe for Agent-first operation. The intended user path is that a host AI Agent can upgrade AIWiki, synchronize its local skill instructions, tell the user what changed, and preserve a rollback path without requiring the user to manually inspect Agent home directories.
136
+
137
+ The scoped acceptance criteria were:
138
+
139
+ - provide one idempotent command for first install and future upgrades;
140
+ - keep npm install side-effect free and avoid automatic writes to Agent home directories;
141
+ - detect missing, current, changed, and unsupported Agent targets;
142
+ - back up changed installed skill files before overwrite;
143
+ - support `--dry-run` and `--json` for Agent-driven preview and automation;
144
+ - improve CLI help, README, and Agent handoff docs for skill upgrade behavior;
145
+ - update the packaged AIWiki skill so Agents know how to use the new context/query/lint surfaces.
146
+
147
+ ### Implemented
148
+
149
+ - `src/app.ts`
150
+ - Added `aiwiki agent sync`.
151
+ - Added `aiwiki agent sync --agent <id> --yes`.
152
+ - Added `aiwiki agent sync --dry-run`.
153
+ - Added `aiwiki agent sync --json --yes`.
154
+ - Added `aiwiki agent check --json`.
155
+ - Added command-specific help for `aiwiki agent help`, `aiwiki agent sync --help`, `aiwiki context --help`, and `aiwiki query --help`.
156
+ - Added safe copy behavior that compares source and target files, no-ops when current, and writes timestamped backups before overwrite.
157
+ - Updated next-action guidance from manual install toward `aiwiki agent sync --yes`.
158
+
159
+ - `skill/SKILL.md`
160
+ - Added skill version marker `aiwiki-skill-version: 0.2.18`.
161
+ - Added Agent-first setup and upgrade instructions.
162
+ - Documented `agent sync`, `agent check`, `--dry-run`, `--json`, and backup/rollback behavior.
163
+ - Expanded Agent guidance for filtered/explainable context JSON.
164
+
165
+ - `skill/QUERY_PROTOCOL.md` and `skill/LINT_PROTOCOL.md`
166
+ - Documented filters, query scope, result quality, recommended next action, match reasons, quality signals, and lint/next handling for host Agents.
167
+
168
+ - `skill/UPGRADE_NOTES.md`
169
+ - Added packaged notes that explain the current skill changes, expected Agent behavior after sync, and user-facing summary requirements.
170
+
171
+ - `README.md`, `docs/USAGE.md`, and `docs/AGENT_HANDOFF.md`
172
+ - Added safe skill sync and upgrade instructions for first installs, long-gap upgrades, per-agent sync, JSON status checks, and rollback from backup.
173
+
174
+ - `tests/cli.test.ts`
175
+ - Covered agent sync dry-run, install, JSON current state, changed-file backup, and overwrite behavior.
176
+ - Covered new help text and `agent check --json`.
177
+
178
+ ### Verification
179
+
180
+ - `npm test`: passed, 56 tests.
181
+ - `npm run release:check`: passed, including 56 tests and release-check.
182
+ - `npm pack --dry-run`: passed for `@itradingai/aiwiki@0.2.18`.
183
+ - Clean publish clone verification from `C:\Users\Max\AppData\Local\Temp\aiwiki-publish-dc800e0934564873853c9313d670122c`: `npm ci`, `npm run release:check`, and `npm pack --dry-run` passed.
184
+ - Isolated smoke test with temporary `CODEX_HOME` and `CLAUDE_HOME`: passed for first install, `agent check --json`, changed skill backup, overwrite, and current-state dry-run.
185
+
186
+ ### Release State
187
+
188
+ GitHub push succeeded:
189
+
190
+ ```text
191
+ ceec9a1..e41d634 main -> main
192
+ ```
193
+
194
+ npm publication from a clean clone is blocked by a one-time password challenge:
195
+
196
+ ```text
197
+ npm error code EOTP
198
+ npm error This operation requires a one-time password from your authenticator.
199
+ ```
200
+
201
+ Current registry version remains `0.2.16`, so remote smoke tests for `0.2.18` have not run yet.
202
+
203
+ ### Resume Steps
204
+
205
+ After npm OTP is available, publish from a clean committed tree or a fresh clean clone:
206
+
207
+ ```powershell
208
+ npm publish --otp=<code>
209
+ npm view @itradingai/aiwiki version
210
+ ```
211
+
212
+ After `npm view` returns `0.2.18`, run remote smoke tests for:
213
+
214
+ ```bash
215
+ aiwiki agent sync --dry-run
216
+ aiwiki agent sync --json --yes
217
+ aiwiki agent check --json
218
+ aiwiki context --help
219
+ aiwiki query --help
220
+ ```
221
+
222
+ Use a task-specific temporary Agent home and vault on the remote server. Do not write to real user Agent homes during remote verification.
223
+
224
+ ### Notes For Future Changes
225
+
226
+ - Keep `agent sync` explicit. Do not add npm lifecycle hooks that write into `CODEX_HOME`, `CLAUDE_HOME`, or other Agent home directories.
227
+ - Preserve backup-before-overwrite behavior for any future Agent target.
228
+ - Keep `agent install` compatible, but prefer `agent sync` in user-facing guidance because it handles both first install and upgrade.
229
+ - Do not make the skill upgrade workflow depend on crawling, vector search, RAG-over-wiki, RBAC, RSS, scheduled collection, or browser plugins.
230
+ - Package publication should use a clean clone or clean committed tree because unrelated untracked files can otherwise be included by broad package `files` rules.
231
+
5
232
  ## 2026-06-05 - AIWIKI-004 lint workbench
6
233
 
7
234
  Status: implemented, locally verified, pushed to GitHub, blocked on npm OTP before publication.
@@ -0,0 +1,28 @@
1
+ # AIWiki Demo Run
2
+
3
+ This folder records one generated run from the current CLI contract.
4
+
5
+ ## Inputs
6
+
7
+ - `input/local-article.md`: local Markdown input for `aiwiki ingest-file`.
8
+ - `input/agent-enriched-payload.json`: host-Agent payload with `analysis`, claims, topics, assets, and outline requests.
9
+
10
+ ## Commands
11
+
12
+ ```bash
13
+ aiwiki setup --path ../obsidian-vault-sample --yes
14
+ aiwiki ingest-file --file input/local-article.md --path ../obsidian-vault-sample
15
+ aiwiki ingest-agent --payload input/agent-enriched-payload.json --path ../obsidian-vault-sample
16
+ aiwiki status --path ../obsidian-vault-sample
17
+ aiwiki query "LLM Wiki" --path ../obsidian-vault-sample
18
+ aiwiki context "LLM Wiki" --path ../obsidian-vault-sample
19
+ aiwiki lint --json --path ../obsidian-vault-sample
20
+ ```
21
+
22
+ The captured `*-output.*` files replace machine-specific paths with `<sample-vault>` and `<aiwiki-home>`.
23
+
24
+ ## What To Inspect
25
+
26
+ - Core artifacts appear for both examples: Raw, Source Card, Wiki Entry, Run Summary, and Processing Summary.
27
+ - Optional directories are absent for the plain local-file ingest.
28
+ - Optional claims, assets, topics, and outline appear only for the enriched Agent payload that requested or supplied them.