Skip to content

feat(notebook): rename ledger to notebook with subject-oriented grounding and add topic-awareness layerRefactor/notebook#6

Merged
ofriw merged 9 commits into
mainfrom
refactor/notebook
May 26, 2026
Merged

feat(notebook): rename ledger to notebook with subject-oriented grounding and add topic-awareness layerRefactor/notebook#6
ofriw merged 9 commits into
mainfrom
refactor/notebook

Conversation

@ofriw
Copy link
Copy Markdown
Contributor

@ofriw ofriw commented May 25, 2026

Note: This PR was generated by an AI agent. If you'd like to talk with other humans, drop by our Discord!


Summary

This PR renames the ledger subsystem to notebook, upgrades its semantics from a sparse continuity cache to durable subject-oriented grounding, and introduces a topic-awareness layer that uses the active semantic frame to drive spawn-vs-handoff decisions with boundary detection.

What changed

Renamed ledger/notebook/ — the directory, state property (state.ledgerstate.notebookPages), all public tools (ledger_addnotebook_write, ledger_getnotebook_read, ledger_listnotebook_index), and the interactive /ledger command → /notebook. Backward-compatible rehydration scans for both ledger-entry and notebook-entry persisted custom types, so no data loss across upgrades.

Semantic upgrade — the notebook is now framed as durable cross-context grounding organized by subject/thread, not a running stream-of-consciousness cache. The CONTEXT_PRIMER, tool descriptions, and prompt guidelines all steer toward pages that outlive a single session: architecture, decisions, constraints, open questions. Transient task state belongs in the handoff brief, not the notebook.

New topic-awareness layernotebook/topic.ts + notebook/topic-tool.ts add an activeNotebookTopic field to state, a notebook_topic_set tool, and a pendingTopicBoundaryHint mechanism. When the topic changes, the watchdog emits a boundary nudge (even below the 30% context heuristic) recommending a deliberate handoff. The TUI shows the topic in the status bar (🧭 topic), and the high-context warning widget is now topic-aware. Handoff compaction automatically clears the active topic so the next context starts fresh.

Breaking changes

  • All ledger public API symbols renamed: migrate any extension code or stored session references from ledger_* to notebook_* tool names.
  • State shape: state.ledgerstate.notebookPages (affects direct state access).
  • /ledger TUI command renamed to /notebook; the command now also accepts a topic argument (/notebook <topic>) to set the active frame.
  • The watchdog nudge format has changed: it no longer emits the old percent-only reminders and instead generates topic-aware guidance. Any code parsing nudge text programmatically will need updating.

Value

The rename signals a real semantic upgrade — the notebook is a carefully curated set of durable pages for cross-context reuse, not a firehose of continuity scribbles. The topic-awareness layer gives the agent a lightweight frame for context-boundary decisions: stay and spawn within a topic, handoff when the topic shifts. This directly reduces the amount of stale context dragged across job boundaries, and the boundary hint mechanism catches mid-task pivots that would otherwise silently degrade context quality.


Attached is an agent optimized description of the changes in this PR - AGENT_REVIEW.md

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.

1 participant