Skip to content

Commit 7dc13bb

Browse files
committed
docs(skill): fix 5 factual mistakes flagged in self-review
All five were verified against the real openkb code and live CLI output before fixing. Net effect: an agent following the skill no longer hallucinates commands or off-by-one page reads, and the reference docs match what `openkb list` / `index.md` / summary frontmatter actually contain. 1. SKILL.md no longer references a nonexistent `openkb where` — uses `openkb status` everywhere (the rest of the skill already did; line 67 was a stale fragment from an earlier iteration). 2. SKILL.md's `jq` long-doc-page instruction is now unambiguous: `jq '.[N-1]' wiki/sources/<doc>.json` (N = 1-indexed PDF page number). Previous "(page N, 0-indexed)" wording risked systematic off-by-one in agent reads. 3. references/commands.md shows the real `openkb list` Type column: `pageindex` (for `long_pdf` registry entries) and `short` (for every other format), matching `_TYPE_DISPLAY_MAP` in cli.py. The prior "long_pdf / md" example was the raw registry values, not the displayed ones. 4. references/wiki-schema.md's index.md example now shows `(short)` / `(pageindex)` type tags (what the compile pipeline emits), not the raw `(long_pdf)` / `(md)` placeholders. 5. references/wiki-schema.md's summary frontmatter `full_text:` is no longer described as "short docs only" — long PDFs also have the field, pointing at the `.json` paginated content. The remaining `long_pdf` strings in the docs intentionally describe the raw registry value in `.openkb/hashes.json`, contrasted with the displayed `pageindex` — they're the correct framing now.
1 parent 5827d07 commit 7dc13bb

3 files changed

Lines changed: 26 additions & 10 deletions

File tree

skills/openkb/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ After capturing the KB path from `openkb status`, drill in via:
6464

6565
## Read content
6666

67-
(Paths shown relative to the KB root from `openkb where`. Prepend it
68-
in real calls.)
67+
(Paths shown relative to the KB root captured from `openkb status`'s
68+
first line. Prepend it in real calls.)
6969

7070
| Goal | How |
7171
|---|---|
7272
| Read a concept page | `Read <kb>/wiki/concepts/<slug>.md` |
7373
| Read a document's summary | `Read <kb>/wiki/summaries/<doc>.md` |
7474
| Read a short doc's full text | `Read <kb>/wiki/sources/<doc>.md` |
75-
| Read a long doc's specific page | `jq '.[N]' <kb>/wiki/sources/<doc>.json` (page N, 0-indexed) |
75+
| Read a long doc's specific page | `jq '.[N-1]' <kb>/wiki/sources/<doc>.json` (where N is the 1-indexed PDF page number; `.[0]` is page 1) |
7676
| Get a synthesized answer across sources | `openkb query "<question>"` |
7777
| Find an exact phrase | `Grep -r "<phrase>" <kb>/wiki/` |
7878
| Follow a `[[wikilink]]` | `Read` the linked path under `<kb>/wiki/` |

skills/openkb/references/commands.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ openkb list
1313
Documents (2):
1414
Name Type Pages
1515
---------------------------------------- ------------ --------
16-
paper.pdf long_pdf 42
16+
paper.pdf pageindex 42
1717
notes.md short
1818
1919
Summaries (2):
@@ -28,9 +28,15 @@ Concepts (5):
2828
- multi-head-attention
2929
```
3030

31-
- `Type` shows the registry's `type` field: `long_pdf` for
32-
PageIndex-indexed PDFs, otherwise the file extension (`md`,
33-
`docx`, `pdf`, …).
31+
- `Type` is the *display* form of the registry's `type` field, mapped
32+
through `_TYPE_DISPLAY_MAP`:
33+
- PageIndex-indexed long PDFs (registry `type: long_pdf`) display
34+
as `pageindex`.
35+
- Every other format (`md`, `docx`, `pdf` short, `txt`, …) displays
36+
as `short`.
37+
The raw registry value lives in `.openkb/hashes.json`; the displayed
38+
value is what surfaces in `openkb list` and in `index.md` type tags
39+
(`(short)` / `(pageindex)`).
3440
- `Pages` only populated for long PDFs.
3541
- The Summaries and Concepts lists are simply directory listings of
3642
`wiki/summaries/` and `wiki/concepts/` minus their `.md` suffix.

skills/openkb/references/wiki-schema.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Plain Markdown with three top-level sections:
4646
# Knowledge Base Index
4747

4848
## Documents
49-
- [[summaries/paper]] (long_pdf) — Brief from the summary frontmatter.
50-
- [[summaries/notes]] (md) — ...
49+
- [[summaries/paper]] (pageindex) — Brief from the summary frontmatter.
50+
- [[summaries/notes]] (short) — ...
5151

5252
## Concepts
5353
- [[concepts/attention]] — Brief from the concept frontmatter.
@@ -57,6 +57,11 @@ Plain Markdown with three top-level sections:
5757
- [[explorations/some-saved-query]] — User's saved query answer.
5858
```
5959

60+
The type tag in parentheses is always either `(short)` or
61+
`(pageindex)` — never the file extension. Short = anything the
62+
markitdown path can convert (md, docx, html, txt, short PDFs);
63+
pageindex = a long PDF indexed by PageIndex.
64+
6065
Section headings are kept even when empty (e.g. after removing all
6166
documents the `## Documents` heading stays). Entry order is roughly
6267
insertion order, not alphabetical.
@@ -70,10 +75,15 @@ Per-document summary. Frontmatter:
7075
sources: [raw/paper.pdf] # The original ingested file
7176
brief: One-line description.
7277
doc_type: short # short | pageindex
73-
full_text: sources/paper.md # short docs only — link to the source
78+
full_text: sources/paper.md # short docs: .md ; long PDFs: .json
7479
---
7580
```
7681

82+
`full_text` always points at the converted source file: short docs
83+
get `sources/<name>.md` (markitdown output); long PDFs get
84+
`sources/<name>.json` (per-page content array — see the long-doc
85+
section below for how to read it).
86+
7787
Body is the LLM-synthesized summary plus a `## Related Concepts`
7888
section linking to the concepts this doc touches.
7989

0 commit comments

Comments
 (0)