Skip to content

D4b: Rewrite SKILL.md as a teacher — lead with the domain/mental model (edges, schema types, date anchors) - #1271

Merged
malibio merged 2 commits into
mainfrom
worktree-issue-1269-d4b-skill-teacher-rewrite
May 30, 2026
Merged

malibio merged 2 commits into
mainfrom
worktree-issue-1269-d4b-skill-teacher-rewrite

Conversation

@malibio

@malibio malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #1269

…on judgment (closes #1269)

Add "How NodeSpace Thinks" section covering edges + fractional ordering, schema-defined
node types with built-in purposes, and date nodes as the temporal spine. Reframe "When
to Use" as session-judgment workflow (search-at-start / save-as-you-go / persists-across-
sessions). Preserve preflight, CLI reference, and output-format sections intact.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review Summary

This PR rewrites `packages/skill/SKILL.md` to satisfy the D4b "teacher, not wrapper" requirement from issue #1269. The structural intent is sound and represents a genuine improvement: the rewrite successfully leads with the domain model (mental model section before mechanism sections), explicitly names the four D0 pillars, and replaces the old feature-bullet "When to Use" with actionable session-judgment framing. All preserved sections (preflight, CLI reference, output format) are intact and untouched. Tests pass, the skill package builds cleanly, and the stale DB/transport claims from the original are correctly removed.

One correctness defect was identified in the new worked example that will cause the documented workflow to silently fail at runtime.


Findings

[Improvement] `packages/skill/SKILL.md` Lines 234–235 — `--title-contains` on date nodes always returns empty results

The new "Attach a finding to today's date node" example documents:

```bash
nodespace node query --type date --title-contains "2026-05-30"
```

This command cannot return results. Two independently verifiable reasons:

  1. Date nodes never receive a `title` value. In `packages/core/src/services/node_service/crud.rs` at `compute_title()` (line 1993–1995), date nodes are explicitly excluded from title computation and always return `None`. The DB row `title` column is `NULL` for every date node.

  2. The `--title-contains` SQL filter requires `title IS NOT NULL`. In `packages/core/src/db/sqlite_store.rs` at `query_nodes()` (line 836–843), the generated condition is `title IS NOT NULL AND LOWER(title) LIKE ?1`. A date node with `title = NULL` will never satisfy this condition.

Additionally, `--type date` and `--title-contains` cannot be combined even if titles existed: the `content_contains` and `title_contains` filter paths are separate early-return branches (lines 810–843) that do not compose with `node_type`. The `node_type` filter only applies when neither early-return branch fires.

The correct pattern leverages the fact that date nodes use their date string as the node ID (`crud.rs` line 351–352: `else if params.node_type == "date" { params.content.clone() }`):

```bash

The date string IS the node ID — get it directly

nodespace node get "2026-05-30"

Returns the node (or a "not found" error if it doesn't exist yet)

```

The `--parent` flag accepts the date string directly; the daemon will auto-create the date container via `ensure_date_exists` if absent. So the entire lookup-then-attach pattern collapses to a single command:

```bash

Attach a finding — date node is auto-created if it doesn't exist

nodespace node create --type text --content "Discovered: rate limiter uses fixed windows" --parent "2026-05-30"
```

This bug makes the documented workflow non-functional for any agent following the SKILL.md example, which is the primary audience of this document.


[Improvement] `packages/skill/SKILL.md` Lines 230–242 — Date node example section, secondary

The comment `# → use the returned id as parent for today's findings` is slightly misleading because the "returned id" from `node create --type date` is the date string itself (content = ID for date nodes). Stating this identity explicitly would help agents understand why `--parent "2026-05-30"` works without a separate lookup step and builds correctly on the mental model section.


Coordination Note (Informational)

Issue #1265 (D5, PR #1270) — which rewrites the skill shims to shell the CLI — is currently open and not yet merged. The issue text recommends landing D5 before D4b. This PR's SKILL.md rewrite is pure prose with no shim-level references, so the content is unlikely to conflict materially; noting it here in case D5 needs to update the "Preflight" or "Prerequisites" sections when it lands.


Nits

  • Nit: Line 12 — "the temporal spine of the graph" is evocative but slightly jargon-heavy for an LLM audience with no prior NodeSpace exposure. "daily container nodes" or "the date-based organizing layer" is more literal.
  • Nit: Lines 22–24 — the session-judgment list uses "Session start / During the session / Session end." The issue's exact framing was "search-at-start / save-as-you-go / persists-across-sessions" — the current phrasing captures the same idea but loses the mnemonic density. Optional.

Verdict

The `--title-contains` date-node example is a correctness defect that will cause the documented workflow to silently produce empty results. The fix is a targeted rewrite of that one example block: replace the `query --title-contains` lookup with a direct `nodespace node get "YYYY-MM-DD"` and collapse the attach step to a single `node create --parent "YYYY-MM-DD"`. All other acceptance criteria from #1269 are satisfied. Fix the example and this PR is ready to merge.

… query

Replace the broken `node query --type date --title-contains` lookup with
a direct `--parent "YYYY-MM-DD"` call. Date nodes have NULL titles by
design (excluded from compute_title) so the title filter always returns
empty; the daemon's ensure_date_exists auto-creates the node on first use.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@malibio
malibio merged commit d46512d into main May 30, 2026
@malibio
malibio deleted the worktree-issue-1269-d4b-skill-teacher-rewrite branch May 30, 2026 14:30
malibio added a commit that referenced this pull request Jun 22, 2026
…l (edges, schema types, date anchors) (#1271)

* D4b: Rewrite SKILL.md as a teacher — lead with domain model and session judgment (closes #1269)

Add "How NodeSpace Thinks" section covering edges + fractional ordering, schema-defined
node types with built-in purposes, and date nodes as the temporal spine. Reframe "When
to Use" as session-judgment workflow (search-at-start / save-as-you-go / persists-across-
sessions). Preserve preflight, CLI reference, and output-format sections intact.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix(skill): correct date-node attachment example — use direct ID, not query

Replace the broken `node query --type date --title-contains` lookup with
a direct `--parent "YYYY-MM-DD"` call. Date nodes have NULL titles by
design (excluded from compute_title) so the title filter always returns
empty; the daemon's ensure_date_exists auto-creates the node on first use.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Michael Libio <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D4b: Rewrite SKILL.md as a teacher — lead with the domain/mental model (edges, schema types, date anchors)

1 participant