Skip to content

docs(skills): use the POSIX read verbs in literary analysis, drop canvas - #1424

Open
phernandez wants to merge 1 commit into
posix-meta-predicatesfrom
skill-posix-tooling
Open

docs(skills): use the POSIX read verbs in literary analysis, drop canvas#1424
phernandez wants to merge 1 commit into
posix-meta-predicatesfrom
skill-posix-tooling

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

The memory-literary-analysis pipeline predates the POSIX surface, so it is written entirely in write_note/edit_note/search_notes/list_directory. A 138-chapter run following it would never call find --meta or cat --section — which means the planned Moby Dick re-run would measure nothing about the tools we just built and shipped. Updating the skill is a prerequisite for that eval, not polish.

Also removes the canvas instructions: that tool was taken out.

What changed

  • New Tools section naming the read verbs and the two rules that compound across a long run: never read a note to check a field (that is what --meta predicates and --fields projection are for), and never read a whole file to reach one part of it. States the fallback plainly for anyone without the verbs.
  • Phase 2: build a chapter offset map once (grep -n for headings), then read chapters by line range instead of reloading the source text per chapter — the largest single read saving on a long work, and it survives context compaction.
  • Phase 3: find what needs enriching with find --meta ... --fields instead of re-reading every note to see which are thin. Null fields are the work queue.
  • Phase 4: coverage checks (every chapter present, no sequence gaps, required context fields set) alongside the existing schema validation, plus bm orphans — framed around relation density, since a pass that adds notes while leaving orphans has made the graph worse.
  • Phase 5 was canvas generation; it is now graph exploration — traversal that answers second-order questions and produces analysis/ synthesis notes.
  • Two new guidelines: read narrowly, query don't scan.

Verification

just package-check-skills — 15 skills validated. No canvas references remain anywhere in the packaged skills.

Notes

Temporal-qualifier authoring guidance (SPEC-82) will be a follow-up to this once that lands — chapter [event] observations and character [arc] observations are where narrative time gets authored, and that is what makes the Moby Dick run the validation for temporal semantics.

🤖 Generated with Claude Code

https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp

The pipeline was written before the POSIX surface existed, so a 138-chapter
run never touched the tools that make it affordable. Add a Tools section
with the two rules that compound at scale (never read a note to check a
field; never read a whole file to reach one part), a chapter offset map
built once so chapters are read by line range, --meta/--fields queries for
finding what needs enriching and for coverage checks, and orphan checking
framed around relation density rather than note count.

Phase 5 becomes graph exploration: the canvas tool was removed, so the
JSON Canvas instructions are replaced with traversal that produces
synthesis notes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T01:27:24.583334Z 57068c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57068c1c28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


```bash
grep -n '^CHAPTER ' moby-dick.txt # or the work's heading pattern
bm cat moby-dick.txt --lines 4200-4890 # one chapter, not the whole text

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Read the raw source with a resource-capable command

When the source is the .txt file shown here, bm cat ... --lines cannot read it: bm cat --help defines its operand as a note identifier, while _apply_note_slice rejects entities without Markdown content with a 404 (src/basic_memory/api/v2/routers/knowledge_router.py:771-777). Non-Markdown files such as moby-dick.txt are raw resources, so the chapter-reading workflow fails at its central step; use a raw-file range reader or first ingest the text as a Markdown note.

Useful? React with 👍 / 👎.

Comment on lines +427 to +428
bm find --meta 'note_type=chapter' --fields chapter_number,pov,setting # coverage at a glance
bm find --meta 'note_type=character' --fields role,status # who is still a stub

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match the schema's note-type casing

These predicates return no Chapter or Character rows created by this skill because the schemas use note_type="Chapter", "Character", and "Theme", while find aliases note_type to frontmatter type and metadata equality is case-sensitive (src/basic_memory/mcp/tools/posix_tools.py:398-400, src/basic_memory/repository/sqlite_search_repository.py:944-947, and src/basic_memory/repository/postgres_search_repository.py:1200-1203). The same lowercase mismatch recurs in the validation and exploration examples, leaving the proposed work queues and coverage checks empty.

Useful? React with 👍 / 👎.

Comment on lines +509 to +510
bm find --meta 'note_type=chapter' --fields chapter_number # every chapter present?
bm find --meta 'note_type=chapter' --fields pov,setting # any missing required context?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Paginate the coverage queries

For the 100+ chapter runs this skill targets, these commands inspect only the first 10 matches because bm find --help reports a default --page-size of 10 (src/basic_memory/schemas/directory.py:8, used by src/basic_memory/cli/commands/posix.py:741-744). Although the response can report a total, the displayed chapter numbers and projected fields cannot reveal sequence gaps or null fields after page one, so the checks do not prove completeness unless they iterate every page.

Useful? React with 👍 / 👎.

```bash
bm find --meta 'note_type=chapter' --fields chapter_number # every chapter present?
bm find --meta 'note_type=chapter' --fields pov,setting # any missing required context?
bm find --name '*.md' --meta 'note_type=character' # entity inventory vs. seed list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the incompatible filename filter

This exact inventory command exits with find: 'name' cannot combine with 'meta'; the bm find manual explicitly states that --name is refused alongside metadata mode and recommends scoping with the positional path instead (src/basic_memory/man/man1/find(1).md:50-55). Consequently, the documented entity-inventory coverage check never produces an inventory.

Useful? React with 👍 / 👎.

]
}
```bash
bm tool build-context --url 'memory://characters/major/*' --depth 2 # the character web

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the build-context URL positionally

bm tool build-context --help declares URL as a required positional argument and has no --url option; the command's own examples likewise use bm tool build-context memory://... (src/basic_memory/cli/commands/tool.py:985-990). Running the newly documented command therefore exits during argument parsing with No such option: --url, preventing the Phase 5 traversal.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant