diff --git a/AGENTS.md b/AGENTS.md index 5cf10b7..5e92d52 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,9 +17,12 @@ between first-party entities (cms, orchestrator, ninja CLI). the ABI hooks directly and never sees these Go structs. - **The SDK ships no page chrome.** A template renders only its `TemplateDocument`; the **host** composes the document envelope - (doctype / `` / `` / `` + bn chrome) around it. A guest - expresses its envelope needs (title, meta, asset hooks) through - `templates.PageDocument` — never by emitting head/body markup itself. + (doctype / `` / `` / `` + bn chrome) around it. Through + `templates.PageDocument` a guest supplies the body plus envelope attributes + (body class, `lang`, extra `` attributes, and head/body-end extra + HTML) — never head/body markup itself. Title, meta, and site chrome are + host-authored: the host builds them from the doc map it also hands the guest + as `doc_json`. ## Critical Rules diff --git a/README.md b/README.md index eeb51ea..5a7638e 100644 --- a/README.md +++ b/README.md @@ -16,23 +16,15 @@ never the first-party `core` module. context rehydration), its capability stubs (`plugin/wasmguest/caps/`), and the `database/sql` driver over the host DB (`plugin/wasmguest/bnwasm/`). - **Guest-facing type packages** plugins consume: `blocks/` (incl. `blocks/builtin`, - `blocks/shared`, `blocks/tags`), `templates/` (registry + `templates/pongo`), - `templates/bn/` (the templ chrome — see sync rule below), `auth/`, `settings/`, + `blocks/shared`, `blocks/tags`), `templates/` (the template registry + types, + including `PageDocument` — the body-plus-envelope contribution a full-page + template makes; the host owns the chrome), `auth/`, `settings/`, `content/`, `gating/`, `crypto/`, `rbac/`, `video/`, `ai/`, `subscriptions/`, `menus/`, `datasources/`. The Go surface here is **one language binding**. The proto tree is the contract: a non-Go plugin implements the ABI hooks directly and never sees the Go structs. -## `templates/bn` synced-copy rule - -`templates/bn/*` is **authored in the cms repo** (`cms/backend/templates/bn`) and -**synced into here** via cms `make sync-templates`. Do not hand-edit the copy in -this repo — edit it in cms and re-sync. Drift is enforced by check-safety **check 31** -(`check-safety/check_templatesync.go`), which compares this repo's `templates/bn` -against the cms authoritative copy. (This chrome is transitional: it is deleted from -the SDK once host-side head/body injection lands — Phase 3.) - ## Rules - **NEVER use `replace` directives** in `go.mod`. Module resolution goes through the