moonbook

moon add vectie/moonbook@0.1.1
Download zip
Author
Version
0.1.1
License
Apache-2.0
Last updated
14 days ago
Downloads
17

Dependencies

README

#MoonBook

Platform product ยท local alpha. Read the product contract for book ownership, the Bookkeeper Three-Gap boundary, capability status and release gates.

๐Ÿ“š MoonBit-native executable book workspace + ๐Ÿงฑ static renderer + ๐ŸŒ local server + ๐Ÿง  persistent wiki workspace + โœจ marketing website projection + ๐Ÿงญ generated journal timeline + ๐ŸŽ“ evidence-linked reader projections

MoonBit MoonBook Wiki SUMMARY.md HTML Renderer Serve Watch Rabbita

MoonBook is a MoonBit-native executable book and wiki workspace for durable sources, generated pages, review queues, and book-owned tools.

In the wider Moon architecture, MoonBook is the executable book: MoonWiki edits what the book says, MoonCode edits what the book can do, and MoonClaw executes bounded work. See Executable Book Boundary. Start with docs/README.md for the documentation map, implementation boundary, testing guidance, operational notes, and future plan.

MoonBook treats a book as a live workspace: raw sources, durable wiki pages, review queues, generated projections, executable events, and book-owned tools are one native product surface rather than separate documentation scripts.

Current wiki workspaces use a raw-first bootstrap flow:

  • MoonClaw workers stage discovered research artifacts under raw/bootstrap/
  • MoonBook materializes those raw research envelopes into durable wiki/* pages
  • SKILL.md files are repo-owned static templates copied from seed/, not generated at runtime
  • recurring standing-watch checks are skill-guided book-local decisions: MoonBook compares the current baseline to new evidence, records update | no_change | needs_review | failed, and leaves scheduling to MoonTown
  • reverse-document work is also skill-guided: MoonBook keeps the same workspace loop while document-reverse-engineer deconstructs a finished document into logic, style, improvement, and regenerated draft artifacts

The CLI is now split more cleanly:

  • moonbook book ... for workspace/book lifecycle
  • moonbook pack ... for add-on installation
  • moonbook skill ... for skill inventory, diagnostics, and live skill management
  • moonbook doctor ... for top-level health checks
  • moonbook wiki ... for wiki-specific operations

It is designed for:

  • ๐Ÿ“– MoonBook markdown workspaces
  • ๐Ÿ—๏ธ static HTML builds
  • ๐ŸŒ local serve + watch workflows
  • ๐Ÿงพ durable markdown knowledge bases
  • โœจ polished marketing websites under site/
  • ๐Ÿงญ compact history pages under wiki/history/
  • ๐Ÿง  bounded Keeper memory for active, user, and working context
  • ๐Ÿง  governed Bookkeeper metacognition with persistent information, cognition, and execution gaps
  • ๐Ÿงฌ immutable plan revision proposals and parent/child lineage
  • ๐Ÿงญ procedure candidates that require repeated success or explicit review before promotion
  • ๐Ÿง  wiki ingest/query/review/lint flows
  • ๐Ÿ”Œ optional runtime integration through extension packs
  • ๐Ÿ™๏ธ optional moontown extension runtime for town-to-book orchestration without changing the core wiki contract

#โœจ What MoonBook Feels Like

markdown / summary / wiki / website workspace -> parse and normalize structure -> render to static HTML -> serve or watch locally -> ingest sources into a persistent wiki -> revise entities, concepts, synthesis, and review queues -> ship a polished marketing website from site/

MoonBook is strongest when you want one local system to handle:

  • ๐Ÿ“ authored markdown books
  • ๐Ÿ” repeatable static builds
  • ๐Ÿงญ readable navigation and rendering
  • ๐Ÿ—‚๏ธ persistent wiki pages between sessions
  • ๐ŸŒ a marketing-oriented website projection for demos and launches
  • ๐Ÿงญ a journey layer that turns noisy runs into a readable operator timeline
  • ๐ŸŽ“ Learn, Apply, and Research views over one accepted book revision
  • ๐Ÿง  small rewriteable Keeper memory between worker runs
  • ๐Ÿงฉ a typed MoonBook knowledge bundle for suite consumers
  • ๐Ÿ•ธ๏ธ a generated graph of durable pages and cross-links
  • ๐Ÿค runtime-agnostic wiki workspaces without hard-coupling to one agent

#News

  • 2026-08-01: replaced the generic generated course mockup with reader-first Learn, Apply, and Research routes sourced from the book's actual course, practice, and research artifacts; added the typed moonbook.reader_projection.v1 contract, fail-closed quality/review readiness, provenance state, and a systematic plain-language + learning-science authoring loop
  • 2026-07-31: added the generic moonbook/bookkeeper.outcome.submit@0.1.0 intake plus moonbook/bookkeeper.outcome.close@0.1.0: external decision evidence enters the existing Rabbita review queue, deterministic Three-Gap assessment and capability proposal gates replay safely, and no receipt grants activation
  • 2026-07-12: added governed Bookkeeper metacognition with a persistent three-gap graph, consequence/invalidation-aware beliefs, evidence-qualified procedure learning, immutable plan revision lineage, and MoonFlow v3 reconciliation
  • 2026-06-28: added the seeded document-reverse-engineer routine so a finished document can enter MoonBook from the reverse side: deconstruction, argument map, style profile, improvement plan, and regenerated draft over the same durable workspace loop
  • 2026-06-19: added the native moonbook.book_state.v1 snapshot plus moonbook.knowledge_bundle.v1, generated graph files, wiki state, wiki bundle, wiki graph, and lint checks for missing MoonBook page metadata so suite tools can consume book state through concise MoonBook contracts instead of scraping wiki pages
  • 2026-05-18: added MoonBook-side standing-watch support for 24/7 topic monitoring: seeded skills/standing-watch/SKILL.md, dedicated standing-watch book tasks, worker context with baseline/history, result marker contracts, and durable wiki/history/standing-watch.md decision records
  • 2026-04-22: tightened the MoonBook/MoonClaw boundary so MoonClaw returns raw research envelopes while MoonBook owns durable wiki materialization, source quality/readiness classification, generated research-report projection, and a static research-report skill for article-quality synthesis
  • 2026-04-22: made book/site/index.html open the live generated marketing projection so readers no longer land on the generic authored source-site shell after build
  • 2026-04-17: added skill hub as a dedicated live backend for managing skills across the machine, with whole-machine scan roots, in-browser editing, automatic snapshots, rollback, /api/debug, and SSE-driven refresh
  • 2026-04-16: refactored the CLI around top-level book, pack, skill, and doctor surfaces, and added a first skill manager with inventory, show, compare, sync, install, scaffold, and doctor commands over workspace plus seeded skills
  • 2026-04-16: added wiki/history/journey.md as a compact run timeline, split the generated site into marketing and journal views, and embedded a ctc-inspired course projection plus wiki-course skill route
  • 2026-04-13: added Keeper evidence and insight maintenance so persisted worker results now append support records, stage durable promotions for review, refresh keeper health pages, maintain a synthesis map, and hydrate workers with better memory/page recall
  • 2026-04-15: added an optional site/ authored website layer for wiki workspaces, plus a dedicated marketing routine/skill boundary, and taught the build pipeline to publish it into book/site/ alongside the rendered book and wiki
  • 2026-04-19: clarified the website split so site/index.html stays a standalone repo-owned source page while the live generated projections are emitted separately into book/site/generated/
  • 2026-04-05: split wiki maintenance internals into dedicated workspace, maintenance-plan, and review-helper files; tightened summary dedupe by page path; cleaned entity/concept/claim normalization; updated the docs to reflect the refactored wiki package layout
  • 2026-04-08: added an extension API surface for accept_goal, produce_task_batch, hydrate_worker_context, persist_result, summarize_state, and report_health, plus a moontown extension runtime so MoonBook can act as a per-domain harness without losing its standalone wiki behavior
  • 2026-04-05: added wiki review lifecycle commands with pending/approved queues, maintenance-plan updates, query-signal propagation, stronger claim status/support/confidence handling, and review-queue lint checks
  • 2026-04-05: deepened wiki ingest so sources now update related entity pages, concept pages, relationship sections, synthesis pages, and a structured claims register instead of only generating source summaries
  • 2026-04-05: refactored MoonClaw integration into an explicit extension-pack model so wiki workspaces stay agent-agnostic by default
  • 2026-04-04: added wiki init, wiki ingest, wiki query, and wiki lint as the first persistent wiki workflow slice on top of the MoonBook renderer and CLI
  • 2026-04-04: hardened serve and watch with polling rebuilds, .gitignore filtering, --open, --dest-dir, generated 404 pages, and more complete HTML output behavior

#๐Ÿš€ Current Capabilities

  • ๐Ÿ“š native MoonBit book/config model
  • ๐Ÿงญ top-level CLI split into book, pack, skill, doctor, and wiki
  • ๐Ÿงญ SUMMARY.md parsing with numbering, nesting, parts, separators, draft chapters, duplicate detection, and README-to-index normalization
  • ๐Ÿ—๏ธ end-to-end init, build, serve, watch, load, test, clean, and version commands
  • ๐Ÿงฐ skill list, skill show, skill compare, skill sync, skill install, skill scaffold, skill doctor, and skill hub for workspace plus machine-wide skill operations
  • ๐ŸŒ local static HTTP serving with polling rebuilds and current CLI conveniences like --open, --dest-dir, and --watcher poll|native
  • ๐Ÿงฑ HTML rendering with sidebar navigation, breadcrumbs, previous/next links, local asset copying, code-block handling, tables, footnotes, raw HTML passthrough, and GitHub-style markdown layout cues
  • ๐ŸŒ optional repo-owned site/ source website that is copied into book/site/ during build and serve
  • โœจ generated live marketing projection emitted into book/site/generated/ from a skill-authored marketing-brief.md, keeping product copy out of renderer code
  • ๐Ÿงญ native book-state snapshot through moonbook wiki state [root], writing state/state.json
  • ๐Ÿงฉ native knowledge bundle export through moonbook wiki bundle [root], writing book/knowledge/manifest.json, graph.json, and pages.json
  • ๐Ÿ•ธ๏ธ native graph projection through moonbook wiki graph [root] and generated book/site/generated/graph.json
  • ๐Ÿ“ฆ generated book/site/generated/book-state.json plus knowledge-bundle.json so suite apps can read current book state through stable MoonBook contracts
  • ๐Ÿ”Ž generated research-report projection with executive summary, architecture/runtime/memory sections, relationships, maturity gaps, and evidence table derived from raw/bootstrap/ plus wiki synthesis pages
  • ๐Ÿงพ seeded skills/research-report/SKILL.md that tells keepers how to turn research-question, source-screen, evidence-matrix, local sources, and synthesis briefs into reader-facing reports without dumping raw table rows
  • ๐Ÿงฉ seeded skills/document-reverse-engineer/SKILL.md for turning a strong finished document into deconstruction, argument map, style profile, improvement plan, and regenerated draft artifacts
  • ๐Ÿ•ฐ๏ธ seeded skills/standing-watch/SKILL.md for recurring topic checks that compare new evidence against the current book baseline and emit machine-readable decision, source-count, fact-count, changed-page, and book_changed markers
  • ๐Ÿงญ durable standing-watch history under wiki/history/standing-watch.md, written when a book-local watch result is persisted
  • ๐Ÿงญ generated journal view emitted into book/site/generated/journal.html from live journey and workspace state
  • ๐ŸŽ“ generated reader view emitted into book/site/generated/course.html, selecting the actual Learn, Apply, and Research artifacts without substituting generic workspace prose
  • ๐Ÿงพ typed moonbook.reader_projection.v1 state emitted at book/site/generated/reader-state.json, with audience/outcome, nine reader-loop dimensions, source revision/digest/references, review receipts, view-specific semantics, and explicit publishability issues
  • ๐Ÿ› ๏ธ generated skill manager emitted into book/site/generated/skills.html with inventory, duplicate detection, bundled-reference diagnostics, copyable lifecycle commands, override drift comparison against seeded baselines, and staged sync commands for candidate bundles
  • ๐Ÿ–ฅ๏ธ dedicated skill hub backend with a browser UI for machine-wide skill scanning, direct in-browser editing, automatic snapshots, rollback, debug inspection, and live SSE refresh
  • ๐Ÿง  wiki workspace bootstrap with:
    • raw/
    • keeper/
    • site/
    • wiki/
    • wiki/history/
    • index.md
    • log.md
    • AGENTS.md
    • seeded entities/, concepts/, synthesis/, queries/, reviews/, and sources/
    • seeded synthesis/evidence.md, synthesis/map.md, plus keeper/INSIGHTS.md
  • ๐Ÿ“ฅ wiki ingest that:
    • imports sources
    • creates source pages
    • updates entity pages
    • updates concept pages
    • adds relationship sections from structured claims
    • adds reciprocal relationship signals to related entity/concept pages
    • updates synthesis/overview.md
    • updates synthesis/claims.md
    • updates synthesis/map.md
    • updates synthesis/maintenance-plan.md
    • queues low-confidence or contested items in reviews/pending.md
    • keeps history/journey.md compact and operator-readable as persisted work accumulates
  • ๐Ÿ”Ž wiki query that:
    • searches maintained wiki pages
    • synthesizes answers with citations
    • optionally saves query pages
    • updates synthesis/query-insights.md
    • captures query takeaways into keeper/MEMORY.md
    • propagates Query Signals into cited pages
    • updates synthesis/map.md
    • updates the maintenance plan
    • can queue review items for promotion
  • โœ… wiki review that:
    • lists pending review items
    • approves or rejects them
    • moves them into reviews/approved.md
    • promotes approved changes back into synthesis/claims/pages and cited query pages
    • resolves linked evidence records and refreshes Keeper insights
  • ๐Ÿฉบ wiki lint that checks:
    • orphan pages
    • missing index entries
    • placeholder sections
    • stale wording
    • simple contradictions
    • missing concept pages
    • weak synthesis/claim coverage
    • unqueued low-confidence claims
    • review backlog growth
    • crowded Keeper memory and missing evidence capture
  • ๐Ÿ”Œ extension-based add-ons with moonclaw and moontown packs
  • ๐Ÿงฑ workspace-owned source semantics so placeholder files like .gitkeep do not become durable source pages
  • ๐Ÿ™๏ธ optional moontown extension runtime that exposes a town-facing extension API over the same workspace
  • ๐Ÿง  Keeper memory bootstrap with keeper/MEMORY.md, keeper/USER.md, keeper/WORKING.md, and keeper/POLICY.md
  • ๐Ÿงพ evidence tracking in wiki/synthesis/evidence.md for persisted worker results and review outcomes
  • ๐Ÿ” generic product-outcome intake and closure through bookkeeper.outcome.submit and bookkeeper.outcome.close, reusing the durable Bookkeeper journal and advancing only through exact named-human reviews
  • ๐Ÿ—บ๏ธ synthesis coverage tracking in wiki/synthesis/map.md
  • ๐Ÿ“ˆ Keeper health snapshots in keeper/INSIGHTS.md
  • ๐Ÿ‡ Rabbita frontend with a documentation-first operator dashboard under ui/, now wired to moonbook-ui-state.json and rebuild-triggered live refresh

#๐Ÿงฉ Main Subsystems

  • core MoonBook data model and config decoding
  • summary SUMMARY.md parsing and numbering logic
  • driver book initialization, loading, preprocessing, manifest writing, and build orchestration
  • html static HTML shell and markdown rendering layer
  • cmd/main native CLI entrypoint
  • wiki wiki workspace bootstrap, extension packs, ingest, query, review, extension APIs, and shared maintenance/workspace helpers
  • reader_projection public MoonBit contract, JSON round-trip, evidence/review binding, and deterministic readiness checks for Learn, Apply, and Research views
  • internal filesystem/path/server helpers adapted where needed from MoonClaw
  • ui Rabbita frontend work

#โšก Quick Start

From the repo root:

cd ~/Workspace/moonbook

Check the project:

moon check

Create and build a normal book:

moon run cmd/main -- book init ./book-example moon run cmd/main -- build ./book-example moon run cmd/main -- serve ./book-example -n 127.0.0.1 -p 3000 -o

Create a wiki workspace:

moon run cmd/main -- wiki init ./research-wiki moon run cmd/main -- wiki enable moonclaw ./research-wiki moon run cmd/main -- wiki enable moontown ./research-wiki moon run cmd/main -- wiki extension catalog ./research-wiki moon run cmd/main -- wiki ingest ./research-wiki ./raw/article.md moon run cmd/main -- wiki extension tasks ./research-wiki "refresh synthesis for new source" moon run cmd/main -- wiki query ./research-wiki "retrieval synthesis" --save moon run cmd/main -- wiki state ./research-wiki moon run cmd/main -- wiki bundle ./research-wiki moon run cmd/main -- wiki graph ./research-wiki moon run cmd/main -- wiki review list ./research-wiki moon run cmd/main -- wiki review approve ./research-wiki <review-id> moon run cmd/main -- wiki lint ./research-wiki moon run cmd/main -- build ./research-wiki # optional: open ./research-wiki/book/site/index.html for the authored source website # optional: open ./research-wiki/book/site/generated/index.html for the live generated projection # optional: open ./research-wiki/book/site/generated/journal.html for the generated journal view # optional: open ./research-wiki/book/site/generated/course.html for the generated course view # optional: open ./research-wiki/book/site/generated/skills.html for the generated skill manager # optional: inspect ./research-wiki/state/state.json for the standalone book-state snapshot # optional: inspect ./research-wiki/book/site/generated/book-state.json, knowledge-bundle.json, and graph.json for suite consumers moon run cmd/main -- skill hub ./research-wiki -n 127.0.0.1 -p 3456

Useful validation commands:

moon test summary moon test driver moon test html moon test wiki

#Docs

#Current Boundary

MoonBook already handles a large local vertical slice, but it still lacks the full renderer surface expected of a production executable-book system: theme/search/print output, websocket live reload, a true native watcher backend, external renderer/preprocessor execution under MoonBook-owned contracts, and broader markdown/HTML edge-case coverage.

On the wiki side, MoonBook now has a real persistent workspace loop with init+enable+ingest+query+review+lint+serve, bounded Keeper memory, evidence capture for persisted results, a maintained synthesis map, staged durable promotion through review, and a book-local planning task surface. It still stops short of a full domain-tuned wiki-maintainer brain: claim handling is still heuristic, synthesis planning is still lighter than a full claim graph, and extension runtimes still need stronger use of the native book-state and executable-event contracts.

MoonBook also now exposes an extension API surface intended for town-level orchestrators like moontown, including a machine-readable catalog export for the persisted town bootstrap path. That integration stays optional and file-based. A plain MoonBook workspace still builds, serves, and behaves as a standalone wiki without requiring any external control plane.

That extension API surface now also smooths over two integration details:

  • wiki extension context can resolve external bootstrap-style task ids onto the nearest local MoonBook task kind instead of requiring an exact task id from the latest task batch
  • wiki enable moonclaw seeds .moonsuite/products/moonclaw/providers.json with the MoonClaw provider target name moonbook, so MoonClaw has a suite-local manifest for wiki extension tasks/context/persist

The moonclaw add-on is also aligned with MoonClaw's current role substrate: MoonBook seeds a host-owned Keeper policy, wiki-maintainer/review skills, and role-aware controller/worker profiles so the embedded planner feels book-specific without hard-coding MoonClaw product policy into MoonBook core.

#
moonbook_capability_pack_version

fn moonbook_capability_pack_version() -> String

Installed MoonBook pack version used by MoonFlow capability truth.

#
moonbook_mooncode_draft_delivery_capability_json

fn moonbook_mooncode_draft_delivery_capability_json() -> Json

Generic MoonFlow capability for the one product-owned mutation that turns an exact reviewed Bookkeeper egress into an inert MoonClaw proposal draft.

#
moonbook_moonflow_adapter_capability_json

fn moonbook_moonflow_adapter_capability_json() -> Json

Describe MoonBook's executable-document and reconciliation boundary. MoonBook owns durable intent and reviewed cognition, while MoonFlow owns scheduling and execution state.

#
moonbook_moonflow_adapter_declaration_json

fn moonbook_moonflow_adapter_declaration_json() -> Json

Host-binding declaration consumed by MoonFlow capability catalog compilation. It deliberately contains no health claim.

#
moonbook_moonflow_adapter_health_json

fn moonbook_moonflow_adapter_health_json(checked_at~ : String, valid_until~ : String, evidence_ref~ : String, evidence_digest~ : String) -> Json raise

Build a short-lived health attestation from host-verified evidence. A repository checkout cannot truthfully publish a permanent healthy file, so callers must supply the observation window and exact evidence identity.

#
moonbook_outcome_closure_operation_id

fn moonbook_outcome_closure_operation_id() -> String

Canonical product-owned operation replacing the aspirational canvas verb bookkeeper.close-loop.

#
moonbook_outcome_closure_operation_ref

fn moonbook_outcome_closure_operation_ref() -> String

#
moonbook_outcome_submission_operation_id

fn moonbook_outcome_submission_operation_id() -> String

Canonical MoonDesk/MoonTown intake and replay alias for the exact ProductOutcomeSubmission emitted by MoonClaw. It always enters MoonBook's existing named-human gates.

#
moonbook_outcome_submission_operation_ref

fn moonbook_outcome_submission_operation_ref() -> String

#
moonbook_requirements_prepare_operation_id

fn moonbook_requirements_prepare_operation_id() -> String

Product-owned operation for deterministic, review-pending MoonWiki requirements preparation.

#
moonbook_requirements_prepare_operation_ref

fn moonbook_requirements_prepare_operation_ref() -> String

#
moonwiki_moonflow_adapter_capability_json

fn moonwiki_moonflow_adapter_capability_json() -> Json

Historical alias metadata for callers that once treated MoonWiki as a product. MoonWiki is functionality inside MoonBook and this alias is deliberately non-callable.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

ยฉ 2026 mooncakes.io