From c72e97490a53041b207d6d769ab1d8fab35e2259 Mon Sep 17 00:00:00 2001 From: thxCode Date: Tue, 24 Nov 2026 22:51:53 +0800 Subject: [PATCH 1/4] docs(site): implement three-zone governance and strict pretty YAML Signed-off-by: thxCode --- .../skills/loopwright-code-review/SKILL.md | 4 +- .agents/skills/loopwright-docs/SKILL.md | 186 +- .../loopwright-docs/references/conventions.md | 287 +-- .../loopwright-docs/references/page-map.md | 90 +- .agents/skills/loopwright-overview/SKILL.md | 2 +- .agents/skills/loopwright-step/SKILL.md | 2 +- .gitignore | 1 + README.md | 5 +- docs/README.md | 25 +- docs/configuration/controller-and-registry.md | 299 +-- docs/configuration/decision-routing.md | 76 +- docs/configuration/evolution-campaign.md | 111 +- docs/configuration/sandbox-backends.md | 4 +- docs/configuration/task-contract.md | 215 +- docs/configuration/taskpack.md | 331 +-- docs/contribute/memory.md | 4 +- docs/getting-started/architecture.md | 39 +- docs/getting-started/installation.md | 2 +- docs/operations/cli.md | 208 +- docs/operations/coding-agents.md | 262 +-- docs/operations/github-action.md | 156 +- docs/operations/github-app.md | 48 +- docs/references/README.md | 61 + docs/references/bootstrap-interview.md | 6 +- docs/references/cli-and-action-reference.md | 153 ++ docs/references/coding-agent-protocol.md | 194 ++ .../controller-and-registry-schema.md | 152 ++ .../taskpack-and-contract-schema.md | 163 ++ docs/walkthroughs/declarative-taskpack.md | 129 +- ...-campaigns.md => evolutionary-campaign.md} | 44 +- docs/walkthroughs/managed-controller.md | 65 +- packages/cli/test/check-docs-rules.test.ts | 658 ++++-- packages/cli/test/docs-and-site.test.ts | 237 +- scripts/check-docs.mjs | 953 +++++++- scripts/site.mjs | 1988 ++++++++++++++--- site/content/docs/_index.md | 2 + site/data/navigation.yaml | 4 +- site/hugo.toml | 3 +- site/layouts/home.llms.txt | 53 +- site/layouts/index.html | 2 + site/layouts/partials/link-destination.html | 36 +- site/layouts/partials/markdown-content.html | 177 +- site/layouts/partials/readme-table-rows.html | 29 + 43 files changed, 5185 insertions(+), 2281 deletions(-) create mode 100644 docs/references/README.md create mode 100644 docs/references/cli-and-action-reference.md create mode 100644 docs/references/coding-agent-protocol.md create mode 100644 docs/references/controller-and-registry-schema.md create mode 100644 docs/references/taskpack-and-contract-schema.md rename docs/walkthroughs/{evolutionary-campaigns.md => evolutionary-campaign.md} (76%) create mode 100644 site/layouts/partials/readme-table-rows.html diff --git a/.agents/skills/loopwright-code-review/SKILL.md b/.agents/skills/loopwright-code-review/SKILL.md index 0eb2b71..3171342 100644 --- a/.agents/skills/loopwright-code-review/SKILL.md +++ b/.agents/skills/loopwright-code-review/SKILL.md @@ -61,7 +61,7 @@ Evaluate every changed file against these five Loopwright-specific axes: - **Deterministic error codes**: Every failure path must emit its canonical typed error code (`TASKPACK_MANIFEST_INVALID`, `GITHUB_APP_CONFIG_INVALID`, `DECISION_POLICY_INVALID`, etc.) with actionable diagnostic context and zero swallowed exceptions. 5. **Test, Documentation, & Closure Parity**: - Verify unit and negative-path tests cover new schemas, boundary limits, duplicate keys, symlink rejection, and error codes. - - Verify documentation updates obey `loopwright-docs` (`npm run lint:docs` and `npm run site`), keep the 15 public `docs/` pages free of links to `development.md` or `contribute/**`, and keep `.github/workflows/` under least-privilege `permissions` and strictly protected against untrusted taskpack/sandbox writes. + - Verify documentation updates obey `loopwright-docs` (`npm run lint:docs` and `npm run site`), keep the 15 public `docs/` pages and `site/content/**` free of links to `development.md`, `contribute/**`, or `references/**`, and keep `.github/workflows/` under least-privilege `permissions` and strictly protected against untrusted taskpack/sandbox writes. - Verify capability closure claims in `@loopwright/cli` (`loopwright closure --verify-failures`) honestly separate local/fixture verification from `blocked_external` live qualification. ### 4. Check hard repository invariants (`.opencodereview/rule.json`) @@ -70,7 +70,7 @@ Cross-check every rule in [`.opencodereview/rule.json`](../../../.opencodereview - `.github/workflows/` maintains least-privilege `permissions` and remains strictly protected against untrusted taskpack and sandbox writes. - Zero host filesystem paths, agent scratch paths, or internal wave/task tags in tracked files. -- `docs/README.md` `## Module map` and `## All pages` stay synchronized with `docs/**/*.md` and `.agents/skills/*/SKILL.md`. +- `docs/README.md` (`## Module map`, `## All pages`, `## Reference`, and `## Contribute`) and `docs/references/README.md` stay synchronized with `docs/**/*.md` and `.agents/skills/*/SKILL.md`. ### 5. Run the over-engineering pass diff --git a/.agents/skills/loopwright-docs/SKILL.md b/.agents/skills/loopwright-docs/SKILL.md index ff562cb..583b49e 100644 --- a/.agents/skills/loopwright-docs/SKILL.md +++ b/.agents/skills/loopwright-docs/SKILL.md @@ -2,68 +2,76 @@ name: loopwright-docs description: >- Write, update, or review Loopwright documentation under docs/, README.md, and examples/: - route each fact to its owning page via references/page-map.md, enforce human-first - decomposition, 80% ASD-STE100 sentence bounds, Macro + Micro Pretty YAML configuration - blocks, SVG + hidden Mermaid diagrams, and keep docs/README.md, site/data/navigation.yaml, - and scripts/check-docs.mjs in sync. + route each fact across the three documentation zones via references/page-map.md, enforce + human-first decomposition, 80% ASD-STE100 sentence bounds, Strict Pretty Block-Style YAML + configuration blocks, kind-plural and H1-H3 heading rules, SVG + hidden Mermaid diagrams, + and keep docs/README.md, docs/references/README.md, site/data/navigation.yaml, + site/content/docs/_index.md, site/layouts/index.html, and scripts/check-docs.mjs in sync. --- # Loopwright Documentation -Use the [module map](../../../docs/README.md#module-map) and [page map](references/page-map.md) to locate owning guides, specifications, code entry points, and related modules. [AGENTS.md](../../../AGENTS.md#finding-sources) defines the repository source hierarchy; this skill defines the authoring and verification procedure. +Use the [module map](../../../docs/README.md#module-map) and [page map](references/page-map.md) to locate owning guides, flat machine references, specifications, code entry points, and related modules. [AGENTS.md](../../../AGENTS.md#finding-sources) defines the repository source hierarchy; this skill defines the three-zone authoring and verification procedure. -All documentation under `docs/` follows one page shape, one shared index (`docs/README.md`), and one public/contributor boundary. Detailed writing, heading, table, YAML, and diagram rules live in [references/conventions.md](references/conventions.md). Canonical page ownership and budgets live in [references/page-map.md](references/page-map.md). +All documentation under `docs/` (`34` Markdown files: `docs/README.md` shared index + `15` Public Human Site pages + `6` Flat LLM Reference `docs/references/*.md` files + `12` Repo-only `Contribute` pages) follows strict zone governance, one shared index (`docs/README.md`), and one-way public link isolation. Detailed writing, plurality, heading, table, Pretty YAML, and diagram rules live in [references/conventions.md](references/conventions.md). Canonical page ownership and budgets live in [references/page-map.md](references/page-map.md). ## Triggers Activate this skill whenever: - Adding, editing, splitting, or reviewing any Markdown file under `docs/`, `README.md`, or `examples/*.md`. -- Documenting a new or changed configuration surface (`controller.draft.yaml`, `registry.draft.yaml`, `.loopwright/taskpack.yaml`, `github-app.yaml`, `decisions.yaml`, `examples/task.yaml`, or `action.yml`). -- Updating `docs/README.md`, `site/data/navigation.yaml`, or SVG diagrams under `docs/assets/diagrams/`. +- Documenting a new or changed configuration surface (`controller.draft.yaml`, `registry.draft.yaml`, `.loopwright/taskpack.yaml`, `.loopwright/suite.yaml`, `campaign.yaml`, `github-app.yaml`, `decisions.yaml`, `examples/task.yaml`, or `action.yml`). +- Updating `docs/README.md`, `docs/references/README.md`, `site/data/navigation.yaml`, `site/content/docs/_index.md`, `site/layouts/index.html`, or SVG diagrams under `docs/assets/diagrams/`. - Auditing documentation compliance with `npm run lint:docs`, `node scripts/check-docs.mjs --report`, or `npm run site`. ## Step-by-Step Workflow -### Step 1: Route the change via `page-map.md` +### Step 1: Route the change across the Three Zones (`page-map.md`) -1. Read [`docs/README.md`](../../../docs/README.md) and [`references/page-map.md`](references/page-map.md) to identify the single page that owns the concept, contract, or operational procedure. -2. State each normative fact once on its owning page; link to that page from every other guide or walkthrough. -3. Verify whether the target page is one of the **15 public site pages** (across 4 groups: `Getting Started`, `Operations`, `Walkthroughs`, `Configuration`) or one of the **12 repository-only pages** (`docs/development.md` and `docs/contribute/**/*.md`, including `docs/contribute/adr/*.md`). +1. Read [`docs/README.md`](../../../docs/README.md), [`docs/references/README.md`](../../../docs/references/README.md), and [`references/page-map.md`](references/page-map.md) to identify the single file that owns the concept, contract, schema dictionary, or operational procedure. +2. State each normative fact once on its owning page; link to that page from other guides within allowed zone boundaries. +3. Classify the target into one of Loopwright's **three documentation zones**: + - **Public Human Site (`15` pages across `4` groups: `Getting Started`, `Operations`, `Walkthroughs`, `Configuration`)**: Concise human-first mental models, task workflows, annotated block-style Pretty YAML Macro examples, Micro constraint bullets, and core enum tables. + - **Flat LLM Reference (`docs/references/*.md`, `6` flat files: `README.md` hub + `5` topic files)**: Exhaustive field/bound/flag/exit-code lookup tables, `StepYield` and overlay-apply protocol contracts, and interactive bootstrap interview procedures exported as static `/references/*.md` via `llms.txt`. + - **Repo-only `Contribute` (`12` pages: `docs/development.md` and `docs/contribute/**/*.md`, including `docs/contribute/adr/*.md`)**: Internal subsystem architecture, cryptographic/SQLite/Pi runtime invariants, and ADRs linked under `llms.txt` `## Optional` as GitHub `blob/` URLs. -### Step 2: Author with human-first decomposition (`conventions.md`) +### Step 2: Author with human-first decomposition & strict formatting (`conventions.md`) Follow every rule in [`references/conventions.md`](references/conventions.md): -1. **Decompose for human readers first**: - - Open every concept or capability with a plain-language mental model (1–3 short sentences), followed by a `gpustack`-style Blueprint SVG diagram (`docs/assets/diagrams/*.svg`, generated via `scripts/generate-diagrams.mjs`, paired with a hidden Mermaid comment) or lifecycle table, an annotated two-space Pretty YAML Macro block (listing every schema field), and Micro constraint bullets (`<= 20` words each) plus domain-grouped 2D Markdown tables listing every valid enum choice. - - Never write bare `spec:` or headless YAML fragments: every ```` ```yaml ```` / ```` ```yml ```` block across `docs/`, `README.md`, and `examples/*.md` must include a Kubernetes-aligned top-level header envelope: - - **Multi-instance referenced objects** (`Taskpack`, `TrustedRegistry`): `apiVersion`, `kind`, `metadata: { name: }` (`metadata.name` only — never `metadata.id` or `metadata.version`), and `spec`. - - **One-off configurations** (`ControllerConfig`, `TaskContract`, `GitHubAppConfig`, `DecisionPolicy`): `apiVersion`, `kind`, and `spec` only. +1. **Decompose for human readers first & keep YAML strictly block-style**: + - Open every public concept or capability with a plain-language mental model (1–3 short sentences), followed by a `gpustack`-style Blueprint SVG diagram (`docs/assets/diagrams/*.svg`, generated via `scripts/generate-diagrams.mjs`, paired with a hidden Mermaid comment) or lifecycle table, an annotated two-space Pretty YAML Macro block, and Micro constraint bullets (`<= 20` words each) plus domain-grouped 2D Markdown tables. Offload exhaustive bound/flag/error-code dictionaries to `docs/references/*.md` rather than packing mega-bullets into public pages. + - **Strict Pretty Block-Style YAML (mandatory)**: Every ```` ```yaml ```` / ```` ```yml ```` block across `docs/`, `README.md`, and `examples/*.md` MUST use multi-line 2-space block style — **zero non-empty flow mappings (`{ k: v }`) and zero non-empty flow sequences (`[a, b]`, `[{ ... }]`)**, allowing only explicit empty `{}` and `[]`. Reject YAML anchors (`&`), aliases (`*`), merge keys (`<<`), custom tags (`!`), and duplicate keys. Never compress YAML into inline flow syntax to game page line caps; trim duplicate subfields to `docs/references/` while keeping every shown YAML block strictly 2-space block-style Pretty YAML. + - Never write bare `spec:` or headless YAML fragments: every YAML block must declare its complete Kubernetes-aligned top-level header envelope: + - **Named multi-instance / cross-referenced objects** (`Taskpack`, `TaskpackSuite`, `TrustedRegistry`, `EvolutionCampaign`): `apiVersion`, `kind`, `metadata` with 2-space nested `name: ` (`metadata.name` only — never `metadata.id` or `metadata.version`), and `spec`. + - **One-off / standalone objects** (`ControllerConfig`, `TaskContract`, `GitHubAppConfig`, `DecisionPolicy`, `VerificationProfile`, `AttemptReceipt`): `apiVersion`, `kind`, and `spec` only. - **GitHub Actions workflows**: `name`, `on`, and `jobs`. - Annotate `Optional` fields only in YAML `#` comments (omit `# Required` and `# Conditional`), avoid `: ` inside inline `#` comments (which breaks Hugo Chroma comment highlighting), and write `hex: ` (`imageDigest: sha256:`) instead of 64-character dummy hashes. - Keep every SVG card (`scripts/generate-diagrams.mjs`) to `<= 10` words in plain English, using the real Loopwright logo (`docs/assets/logo.png`) in header and middle hub badges, with zero `[]` / `{}` array/object syntax and zero `camelCase` / `snake_case` code clutter. -2. **Enforce 80% ASD-STE100 sentence discipline**: - - Keep procedural sentences `<= 20` words and conceptual sentences `<= 25` words. - - Use active voice (`Controller rejects stale leases`, not `Stale leases are rejected by the controller`) and imperative step headings (`Step 1: Generate draft configs`). +2. **Enforce 80% ASD-STE100 sentence & plurality discipline**: + - Keep procedural sentences `<= 20` words and conceptual sentences `<= 25` words, in active voice (`Controller rejects stale leases`) with imperative step headings (`Step 1: Generate draft configs`). + - **Menu & heading grammatical-number parity**: Use plural nouns for collections (`Walkthroughs`, `Operations`, `Sandbox Backends`, `Coding Agents`), singular nouns for single workflows or resource kinds (`Declarative Taskpack`, `Managed Controller`, `Evolutionary Campaign`, `Taskpack`, `Task Contract`, `Evolution Campaign`), and keep siblings of one type in the same grammatical number. + - **Checked Kind-Plural rule in authored prose**: Keep the singular resource kind inside backticks and place `s` or an explicit plural noun outside (write `` `Taskpack`s ``, `` `TaskpackSuite`s ``, `` `TaskContract`s ``, `` `TrustedRegistry` objects ``, `` `ControllerConfig`s ``, `` `GitHubAppConfig`s ``, `` `DecisionPolicy` objects ``, `` `EvolutionCampaign`s ``, `` `AttemptReceipt`s `` — never `` `Taskpacks` ``, `` `TrustedRegistries` ``, `` `DecisionPolicies` ``, or `` `TrustedRegistry`s ``). - Eliminate all banned AI filler words and self-referential page narration (`seamlessly`, `delve`, `tapestry`, `leverage`, `utilize`, `cutting-edge`, `empower`, `it is worth noting`, `in order to`, `this page describes`, `this document describes`, `comprehensive guide`). -3. **Follow the 1:1:1 naming rule, page shape, heading, paragraph, table, and reading footer caps**: - - **1:1:1 alignment for all 15 public pages**: Every public page must reside at `docs//.md` across the 4 groups (`docs/getting-started/`, `docs/operations/`, `docs/walkthroughs/`, `docs/configuration/`), and its `site/data/navigation.yaml` label, `# H1` title, and `docs/README.md` `## All pages` label must match character for character. - - Start with `# ` matching `docs/README.md` `## All pages` character for character. - - Write 1–3 intro paragraphs (`<= 5` lines and `<= 500` chars per prose paragraph) before `## Contents`. - - Keep `## Contents` synchronized in exact order with all subsequent `## ` H2 headings. - - Keep each page to `<= 10` `##` sections (excluding `## Contents`) and within its line cap (`<= 200` lines for `docs/getting-started/architecture.md`, `<= 220` lines for `docs/contribute/adr/*.md`, and `<= 400` lines for all other non-index `docs/**/*.md` pages). - - Keep every `##` / `###` / `####` heading to `<= 4` words and `<= 32` characters (`Step N: ` allows `<= 4` words after the colon and `<= 38` total characters), with zero articles (`a`, `an`, `the`) and zero interrogative words (`what`, `where`, `when`, `how`, `which`, `why`, `who`, `whose`, `whom`). Name complete YAML schema sections directly after their resource `kind` (`## Taskpack`, `## TaskContract`, `## TrustedRegistry`, `## ControllerConfig`, `## DecisionPolicy`, `## GitHubAppConfig`). - - Keep every table column header to `1–3` words and `<= 24` characters without articles (`a`, `an`, `the`), demonstratives (`this`, `that`, `these`, `those`), or interrogatives; keep uniform column counts across all rows and keep every table cell `<= 180` characters. - - End every non-index page with a `\n---\n` reading footer: `**See also** — [Title](path.md) (short description) · ...` (required on all 27 pages) and `**Next** → [Title](path.md) — short description` (required on all 15 public site pages). - -### Step 3: Align `docs/README.md` and `site/data/navigation.yaml` - -When adding, renaming, or re-scoping a page or module boundary: - -1. Update `docs/README.md` (`## Reading paths`, `## Module map`, `## Specs`, and `## All pages`) so every page's `# H1` title matches its `## All pages` link label character for character. -2. Update `site/data/navigation.yaml` so every public page lives at `/docs///` and its `labels` entry equals its `# H1` title character for character (1:1:1 alignment). -3. Keep `docs/development.md` and `docs/contribute/**` out of `site/data/navigation.yaml`. +3. **Follow the 1:1:1 naming rule, heading ceiling, section/line caps, and zone footers**: + - **1:1:1 alignment for all 15 public pages**: Every public page resides at `docs//.md` across the 4 groups (`docs/getting-started/`, `docs/operations/`, `docs/walkthroughs/`, `docs/configuration/`), with exact character-for-character equality across its `site/data/navigation.yaml` label, `# H1` title, and `docs/README.md` `## All pages` label. + - **Hard `H1`–`H3` heading depth ceiling**: Never use `####`, `#####`, or `######` (`H4+` forbidden across all `docs/**/*.md`). Use bold lead-in bullets or 2D tables under `###` subsections instead. + - **Heading wording & caps**: Keep every `##` / `###` heading to `<= 4` words and `<= 32` characters (`Step N: ` allows `<= 4` words after the colon and `<= 38` total characters), with zero articles (`a`, `an`, `the`), zero interrogatives (`what`, `where`, `when`, `how`, `which`, `why`, `who`, `whose`, `whom`), and zero layout-container heading nouns (`row`, `rows`, `table`, `tables`, `column`, `columns`, `guide`, `guides`, `entries`, `section`, `sections`). Name complete YAML schema sections directly after their resource `kind` (`## Taskpack`, `## TaskpackSuite`, `## TaskContract`, `## TrustedRegistry`, `## ControllerConfig`, `## DecisionPolicy`, `## GitHubAppConfig`, `## EvolutionCampaign`). + - **Section & line caps**: Keep content `##` H2 sections (excluding `## Contents`) to `<= 8` on the 15 public pages and `<= 10` on the 12 `Contribute` pages (`docs/README.md` and `docs/references/*.md` are exempt from the H2 cap). Keep line counts within `<= 200` (`docs/getting-started/architecture.md`), `<= 220` (`docs/contribute/adr/*.md`), `<= 800` (`docs/references/*.md`), and `<= 400` (all other non-index `docs/**/*.md` pages). + - **Contents & prose caps**: Write 1–3 intro paragraphs (`<= 5` lines and `<= 500` chars per prose paragraph) before `## Contents` and keep `## Contents` synchronized in exact order with subsequent `## ` H2 headings (`docs/references/README.md` is exempt from `## Contents`). + - **Table caps**: Keep column headers to `1–3` words and `<= 24` chars without articles, demonstratives, or interrogatives; maintain uniform column counts and keep cells `<= 180` chars. + - **Zone-specific headers & footers**: + - Every flat `docs/references/*.md` file must declare `Evidence: contract | recorded capture | synthetic simulation.` before its first `## ` heading, end with `\n---\n\n**See also** — [Title](path.md) (desc) · ...`, and **never** include `**Next**`. + - Every public site page (15) must end with `\n---\n\n**See also** — ...` followed by `**Next** → [Title](path.md) — short description`. + - Every repo-only `Contribute` page (12) must end with `\n---\n\n**See also** — ...` (optional `**Next**` if present must match `**Next** → [Title](path.md) — desc`). + +### Step 3: Synchronize Indexes, Reference Hub, and Site Surfaces + +When adding, renaming, or re-scoping a page or reference: + +1. Update `docs/README.md` across its three top-level zone tables — `## All pages` (`15` public pages only; never nest `### Contribute` inside `## All pages`), `## Reference` (all flat `docs/references/*.md` files), and `## Contribute` (`12` repo-only pages) — with exact `# H1` label equality, plus `## Reading paths`, `## Module map`, and `## Specs`. +2. Update `docs/references/README.md` whenever flat `docs/references/*.md` files or anchored symbols change; ensure `docs/references/` contains zero subdirectories and `docs/references/README.md` links every sibling `docs/references/*.md`. +3. Update `site/data/navigation.yaml`, `site/content/docs/_index.md`, and `site/layouts/index.html` in lockstep so all three link to the exact 15 public pages (`check-docs.mjs` enforces 15-of-15 parity across all three). ### Step 4: Run verification gates @@ -72,72 +80,80 @@ Run the documentation linter and static site generator before finishing: ```bash node scripts/check-docs.mjs --report # Non-blocking audit summary during authoring (exit 0) npm run lint:docs # Strict documentation contract gate (exit 1 on any violation) -npm run site # Build Hugo site, export Markdown/llms.txt, verify 0 broken links +npm run site # Stage references, build Hugo site, verify llms.txt/sitemap/index.json/links ``` ## Explicit Boundary Rules 1. **`specs/` are engineering records, never user docs**: - Design rationale, rejected alternatives, benchmark methodology, and historical task breakdowns belong in `specs/`. - - Never rewrite files under `specs/` as user documentation, and never copy raw specification walls of text into `docs/`. User guides state the active operational contract and link to `specs/` only from `docs/README.md` or contributor guides when needed. -2. **Public site (`15` pages) vs. repository-only `Contribute` (`12` pages) vs. static `llms.txt` references**: - - `docs/development.md` and `docs/contribute/**/*.md` (including `docs/contribute/adr/*.md`) remain in repository `docs/` (and in `docs/README.md`) for contributors and coding agents, but are excluded from `site/` (`site/hugo.toml`, `site/data/navigation.yaml`, `site/public/llms.txt`). - - `docs/references/bootstrap-interview.md` is excluded from HTML site navigation (`site/data/navigation.yaml` stays at `15` public HTML pages across `4` groups) and exported as static Markdown at `/references/bootstrap-interview.md` alongside `llms.txt` (`scripts/site.mjs` rewrites its relative `docs/` links). - - **Hard link boundary**: None of the 15 public `docs/` pages may link to `development.md` or `contribute/**` (directly or via relative path), because those targets do not exist on the published Hugo site. Repository-only pages may link to each other and to any public page. + - Never rewrite files under `specs/` as user documentation, and never copy raw specification walls of text into `docs/`. +2. **Three-Zone Governance & One-Way Public Link Isolation**: + - **Public Human Site (`15` pages)** renders to HTML, Markdown (`/docs///index.md`), `index.json`, `sitemap.xml`, and `llms.txt` topic sections. + - **Flat LLM Reference (`docs/references/*.md`, `6` flat files)** is excluded from HTML navigation, `index.json`, and `sitemap.xml`; `scripts/site.mjs` (`stageReferenceDocs()`) rewrites relative links before Hugo runs into `/references/*.md` and exposes them under `llms.txt` `## Reference`. + - **Repo-only `Contribute` (`12` pages)** is excluded from Hugo HTML, `index.json`, and `sitemap.xml`, and exposed under `llms.txt` `## Optional` as GitHub `blob/` URLs. + - **Hard one-way link isolation**: None of the 15 public `docs/` pages or `site/content/**` files may link to `development.md`, `contribute/**`, or `references/**` — via relative paths, root-relative paths (`/references/...`, `/docs/references/...`, `/docs/contribute/...`, `/docs/development/...`), or same-origin/GitHub blob URLs. (Literal copy-paste URLs inside fenced prompt code blocks are permitted.) `docs/references/*.md` and `docs/contribute/**` may freely link inward to public pages. 3. **Keep the front door small (`docs/getting-started/architecture.md <= 200` lines)**: - - `docs/getting-started/architecture.md` introduces Loopwright's four-stage execution chain (**1. Admit**, **2. Execute**, **3. Verify**, **4. Publish & Remember**), the `architecture-flow.svg` diagram with its hidden Mermaid comment, core vocabulary, and links to deep public configuration pages. + - `docs/getting-started/architecture.md` introduces Loopwright's four-stage execution chain (**1. Admit**, **2. Execute**, **3. Verify**, **4. Publish & Remember**), `architecture-flow.svg` with its hidden Mermaid comment, operating modes, and routing links to public guides. 4. **Evidence and unknown-outcome honesty**: - Distinguish deterministic local/fixture verification from live provider, host sandbox, billing, or GitHub production qualification. Never claim an unverified capability is production-qualified, and preserve `unknown` external outcome semantics in operational examples. ## Where a Fact Belongs -| Topic | Owning Guide | -| --- | --- | -| End-to-end 4-stage execution flow, runtime baseline, vocabulary, and module overview | [Architecture](../../../docs/getting-started/architecture.md) | -| Laptop CLI installation (`@gpustack/loopwright` via `npm`/`pnpm`), release tarballs, and Action setup | [Installation](../../../docs/getting-started/installation.md) | -| Reusable GitHub Action (`action.yml`) inputs, permissions, and workflow setup | [GitHub Action](../../../docs/operations/github-action.md) | -| GitHub App deployment, `github-app.yaml`, webhook server, and installation tokens | [GitHub App](../../../docs/operations/github-app.md) | -| Local CLI subcommands (`init`, `check`, `run`, `inspect`, `reconcile`, `closure`) | [CLI](../../../docs/operations/cli.md) | -| Zero-secret OAuth coding agent operation (`loopwright step`), `--role-model` routing, and local overlay application | [Coding Agents](../../../docs/operations/coding-agents.md) | -| End-to-end `.loopwright/taskpack.yaml` onboarding and prompt migration walkthrough | [Declarative Taskpack](../../../docs/walkthroughs/declarative-taskpack.md) | -| End-to-end out-of-repo `TrustedRegistry`, `ControllerConfig`, relationship topology SVG, and CLI governance | [Managed Controller](../../../docs/walkthroughs/managed-controller.md) | -| End-to-end evolutionary campaign setup (`EVOLVE-BLOCK`, `runner relay\|worker`, `loopwright evolve`, bundle export) | [Evolutionary Campaigns](../../../docs/walkthroughs/evolutionary-campaigns.md) | -| Complete `Taskpack` (`.loopwright/taskpack.yaml`) field and enum reference | [Taskpack](../../../docs/configuration/taskpack.md) | -| `TaskContract`, `VerificationProfile`, `AttemptReceipt`, and schema bounds | [Task Contract](../../../docs/configuration/task-contract.md) | -| Bounded controller loop, `ControllerConfig`, `TrustedRegistry`, and repair retries | [Controller and Registry](../../../docs/configuration/controller-and-registry.md) | -| Native OS sandboxes (`macos-seatbelt`, `linux-bwrap`, `linux-landlock`), Docker, and `spec.sandbox` | [Sandbox Backends](../../../docs/configuration/sandbox-backends.md) | -| System-One decision routing, `decisions.yaml`, `spec.decisions`, and 3-zone policy | [Decision Routing](../../../docs/configuration/decision-routing.md) | -| Complete `EvolutionCampaign` (`campaign.yaml`) schema, islands, `teamEvolution`, and `evolution-bundle.v1` contract | [Evolution Campaign](../../../docs/configuration/evolution-campaign.md) | -| Canonical RFC 8785 JCS hashing, SHA-256 digests, and domain separation (repo-only) | [Identity](../../../docs/contribute/identity.md) | -| Independent verification hooks, HMAC `gate.v1` tokens, and receipt authority (repo-only) | [Evidence](../../../docs/contribute/evidence.md) | -| SQLite WAL state store, lease fencing, monotonic clock guards, and recovery (repo-only) | [State](../../../docs/contribute/state.md) | -| Isolated Pi runtime adapter, physical send admission, and secret scrubbing (repo-only) | [Pi Adapter](../../../docs/contribute/pi-adapter.md) | -| Offline runner parity, frozen taskpack corpus, and deterministic replay (repo-only) | [Runner Taskpack](../../../docs/contribute/runner-taskpack.md) | -| Reviewed memory proposals, CAS compaction, and retention bounds (repo-only) | [Memory](../../../docs/contribute/memory.md) | -| Webhook intake, collaborator permission gates, and taskpack compilation internals (repo-only) | [GitHub App Internals](../../../docs/contribute/github-app-internals.md) | -| Capability closure matrix, `blocked_external` evidence, and failure codes (repo-only) | [Closure Matrix](../../../docs/contribute/closure-matrix.md) | -| Architectural Decision Records (`0001` local state, `0002` isolated Pi SDK) (repo-only) | [ADR 0001](../../../docs/contribute/adr/0001-local-state-authority.md), [ADR 0002](../../../docs/contribute/adr/0002-isolated-pi-sdk.md) | -| Repository build, test, lint, site commands, and contributor workflow (repo-only) | [Development](../../../docs/development.md) | -| Package layer boundaries, security invariants, and workspace internals (repo-only) | [Internals](../../../docs/contribute/internals.md) | +| Topic | Zone | Owning File | +| --- | --- | --- | +| End-to-end 4-stage execution flow, runtime baseline, vocabulary, and module overview | Public | [Architecture](../../../docs/getting-started/architecture.md) | +| Laptop CLI installation (`@gpustack/loopwright` via `npm`/`pnpm`), release tarballs, Action setup, and bootstrap prompts | Public | [Installation](../../../docs/getting-started/installation.md) | +| Reusable GitHub Action (`action.yml`) workflow setup, permissions, and common inputs | Public | [GitHub Action](../../../docs/operations/github-action.md) | +| GitHub App deployment, `github-app.yaml` overview, webhook server, and installation tokens | Public | [GitHub App](../../../docs/operations/github-app.md) | +| Local CLI workflows (`init`, `check`, `run`, `suite`, `runner`, `evolve`, `inspect`, `reconcile`, `closure`) | Public | [CLI](../../../docs/operations/cli.md) | +| Zero-secret OAuth coding agent operation (`loopwright step`), `--role-model` routing, and overlay workflow | Public | [Coding Agents](../../../docs/operations/coding-agents.md) | +| End-to-end `.loopwright/taskpack.yaml` onboarding and prompt migration walkthrough | Public | [Declarative Taskpack](../../../docs/walkthroughs/declarative-taskpack.md) | +| End-to-end out-of-repo `TrustedRegistry`, `ControllerConfig`, relationship topology SVG, and CLI governance | Public | [Managed Controller](../../../docs/walkthroughs/managed-controller.md) | +| End-to-end evolutionary campaign setup (`EVOLVE-BLOCK`, `runner relay\|worker`, `loopwright evolve`, bundle export) | Public | [Evolutionary Campaign](../../../docs/walkthroughs/evolutionary-campaign.md) | +| Core `Taskpack` (`.loopwright/taskpack.yaml`) and `TaskpackSuite` (`.loopwright/suite.yaml`) mental model and YAML | Public | [Taskpack](../../../docs/configuration/taskpack.md) | +| Core `TaskContract`, `VerificationProfile`, and `AttemptReceipt` mental model, budgets, and evidence tiers | Public | [Task Contract](../../../docs/configuration/task-contract.md) | +| Bounded controller loop, `ControllerConfig`, `TrustedRegistry`, and repair retry controls | Public | [Controller and Registry](../../../docs/configuration/controller-and-registry.md) | +| Native OS sandboxes (`macos-seatbelt`, `linux-bwrap`, `linux-landlock`), Docker, and `spec.sandbox` | Public | [Sandbox Backends](../../../docs/configuration/sandbox-backends.md) | +| System-One decision routing, `decisions.yaml`, `spec.decisions`, and 3-zone policy | Public | [Decision Routing](../../../docs/configuration/decision-routing.md) | +| `EvolutionCampaign` (`campaign.yaml`) islands, stages, `teamEvolution`, and `evolution-bundle.v1` overview | Public | [Evolution Campaign](../../../docs/configuration/evolution-campaign.md) | +| Task routing, exact resource/CLI aliases, and reference evidence labels | Reference | [Reference Hub](../../../docs/references/README.md) | +| Interactive agent interview protocol for Mode 1, Mode 2, and Mode 3 repository onboarding | Reference | [Bootstrap Interview Reference](../../../docs/references/bootstrap-interview.md) | +| Exhaustive `Taskpack`, `TaskpackSuite`, `TaskContract`, `AttemptReceipt`, and `EvolutionCampaign` bounds | Reference | [Taskpack and Contract Reference](../../../docs/references/taskpack-and-contract-schema.md) | +| Exhaustive `TrustedRegistry`, `ControllerConfig`, `DecisionPolicy`, and `AdvisoryDecisionPort` tables | Reference | [Controller and Registry Reference](../../../docs/references/controller-and-registry-schema.md) | +| Exhaustive 44 `action.yml` inputs, 23 CLI subcommand actions, exit codes, and `GitHubAppConfig` bounds | Reference | [CLI and Action Reference](../../../docs/references/cli-and-action-reference.md) | +| `StepYield` JSON schema, lease diagnostics, exit codes, and verified `node -e` overlay-apply script | Reference | [Coding Agent Protocol Reference](../../../docs/references/coding-agent-protocol.md) | +| Repository build, test, lint, site commands, and contributor workflow | Contribute | [Development](../../../docs/development.md) | +| Package layer boundaries, security invariants, and workspace internals | Contribute | [Internals](../../../docs/contribute/internals.md) | +| Canonical RFC 8785 JCS hashing, SHA-256 digests, and domain separation | Contribute | [Identity](../../../docs/contribute/identity.md) | +| Independent verification hooks, HMAC `gate.v1` tokens, and receipt authority | Contribute | [Evidence](../../../docs/contribute/evidence.md) | +| SQLite WAL state store, lease fencing, monotonic clock guards, and recovery | Contribute | [State](../../../docs/contribute/state.md) | +| Isolated Pi runtime adapter, physical send admission, and secret scrubbing | Contribute | [Pi Adapter](../../../docs/contribute/pi-adapter.md) | +| Offline runner parity, frozen taskpack corpus, and deterministic replay | Contribute | [Runner Taskpack](../../../docs/contribute/runner-taskpack.md) | +| Reviewed memory proposals, CAS compaction, and retention bounds | Contribute | [Memory](../../../docs/contribute/memory.md) | +| Webhook intake, collaborator permission gates, and taskpack compilation internals | Contribute | [GitHub App Internals](../../../docs/contribute/github-app-internals.md) | +| Capability closure matrix, `blocked_external` evidence, and failure codes | Contribute | [Closure Matrix](../../../docs/contribute/closure-matrix.md) | +| Architectural Decision Records (`0001` local state, `0002` isolated Pi SDK) | Contribute | [ADR 0001](../../../docs/contribute/adr/0001-local-state-authority.md), [ADR 0002](../../../docs/contribute/adr/0002-isolated-pi-sdk.md) | ## Sync Invariants | Artifact | Pinned To | Verification Gate | | --- | --- | --- | -| `docs/README.md` `## All pages` | All 27 `docs/**/*.md` files and their exact `# H1` titles | `npm run lint:docs` (`scripts/check-docs.mjs`) | +| `docs/README.md` (`## All pages`, `## Reference`, `## Contribute`) | `15` public pages, all flat `docs/references/*.md` (`6`), and `12` `Contribute` pages with exact `# H1` titles | `npm run lint:docs` and `npm run site` | +| `docs/references/README.md` | Flat `docs/references/` (0 subdirectories) linking every sibling `docs/references/*.md` | `npm run lint:docs` (`scripts/check-docs.mjs`) | | `docs/README.md` `## Module map` | Nine module IDs, guides, specs, code paths, and skill consumers | `npm run lint:docs` (`scripts/check-docs.mjs`) | -| Each page's `## Contents` | Subsequent `## ` H2 headings in exact document order | `npm run lint:docs` (`scripts/check-docs.mjs`) | -| Public `docs/` links (`15` pages) | Zero links to `development.md` or `contribute/**` | `npm run lint:docs` and `npm run site` | -| `site/data/navigation.yaml` | The 15 public `docs//.md` pages with exact 1:1:1 group/filename/label/`# H1` parity | `npm run lint:docs` and `npm run site` | -| `site/public/llms.txt` | Generated from the 15 public pages during `npm run site` | `npm run site` (`scripts/site.mjs`) | +| Each page's `## Contents` | Subsequent `## ` H2 headings in exact order (`docs/references/README.md` exempt) | `npm run lint:docs` (`scripts/check-docs.mjs`) | +| Public `docs/` (`15`) + `site/content/**` links | Zero links to `development.md`, `contribute/**`, or `references/**` (relative, root-relative, or same-origin) | `npm run lint:docs` and `npm run site` | +| `site/data/navigation.yaml`, `site/content/docs/_index.md`, `site/layouts/index.html` | Exact 15 public `docs//.md` pages with 1:1:1 group/filename/label/`# H1` parity | `npm run lint:docs` and `npm run site` | +| `site/public/llms.txt` & `site/public/references/*.md` | All 3 zones (`15` Public + `6` rewritten `/references/*.md` + `12` GitHub `Optional` Contribute links) and 0 leaks in `index.json`/`sitemap.xml` | `npm run site` (`scripts/site.mjs`) | ## Pre-Finish Checklist -- [ ] `node scripts/check-docs.mjs` passes with `0 error(s)`. -- [ ] `npm run site` passes with `0 broken link(s)` and exports all 15 public pages. -- [ ] Every public page satisfies 1:1:1 parity: `docs//.md`, `navigation.yaml` label === `# H1` title === `docs/README.md` `## All pages` label. -- [ ] `docs/getting-started/architecture.md` is `<= 200` lines and embeds `architecture-flow.svg` plus its hidden Mermaid comment. -- [ ] All configuration blocks use complete two-space Pretty YAML with Kubernetes-aligned top-level header envelopes (`metadata: { name }` on `Taskpack` and `TrustedRegistry`; `apiVersion` + `kind` + `spec` only on `ControllerConfig`, `TaskContract`, `GitHubAppConfig`, and `DecisionPolicy`; or GitHub Actions `name`, `on`, `jobs` — zero bare `spec:` fragments), `Optional`-only inline `#` comments without `: `, `hex: ` placeholders, `<= 20`-word Micro bullets, and uniform 2D enum tables. -- [ ] Every non-index `docs/**/*.md` page ends with `\n---\n\n**See also** — [Title](path.md) (desc) · ...` (and `**Next** → [Title](path.md) — desc` on all 15 public pages). -- [ ] Zero public pages link to `development.md` or `contribute/**`. +- [ ] `node scripts/check-docs.mjs` passes with `0 error(s)` across all `34` `docs/**/*.md` files. +- [ ] `npm run site` passes with `0 broken link(s)`, exports all `15` public pages + `6` rewritten `references/*.md` files, and emits zero excluded-zone entries in `index.json` or `sitemap.xml`. +- [ ] Every public page satisfies 1:1:1 parity (`docs//.md`, `navigation.yaml` label === `# H1` title === `docs/README.md` `## All pages` label) and is linked in both `site/content/docs/_index.md` and `site/layouts/index.html`. +- [ ] `docs/getting-started/architecture.md` is `<= 200` lines and embeds `architecture-flow.svg` plus its hidden Mermaid comment; public pages have `<= 8` content `##` H2s (`<= 400` lines); `Contribute` pages have `<= 10` content `##` H2s (`<= 400` lines, ADRs `<= 220`); `docs/references/*.md` are flat (`<= 800` lines), open with `Evidence:`, and omit `**Next**`. +- [ ] Zero `H4`–`H6` (`####+`) headings, zero layout-container heading nouns, and zero malformed kind-plurals (such as `` `Taskpacks` `` or `` `TrustedRegistry`s ``) appear in `docs/**/*.md`. +- [ ] All YAML blocks use strict 2-space block-style Pretty YAML (zero non-empty `{ ... }` flow mappings and zero non-empty `[ ... ]` flow sequences; `metadata.name` on `Taskpack`, `TaskpackSuite`, `TrustedRegistry`, and `EvolutionCampaign`; `apiVersion` + `kind` + `spec` only on `ControllerConfig`, `TaskContract`, `GitHubAppConfig`, `DecisionPolicy`, `VerificationProfile`, and `AttemptReceipt`; or GitHub Actions `name`, `on`, `jobs`), `Optional`-only `#` comments without `: `, and `hex: ` placeholders. +- [ ] Zero public pages or `site/content/**` files link to `development.md`, `contribute/**`, or `references/**`. - [ ] Zero banned AI filler words, zero interrogative headings or table headers, and zero paragraphs over `5` lines or `500` characters. diff --git a/.agents/skills/loopwright-docs/references/conventions.md b/.agents/skills/loopwright-docs/references/conventions.md index 0cfd2e6..acc8802 100644 --- a/.agents/skills/loopwright-docs/references/conventions.md +++ b/.agents/skills/loopwright-docs/references/conventions.md @@ -1,19 +1,27 @@ -# Documentation Conventions — Human-First Decomposition, Page Shape, and Writing Rules +# Documentation Conventions — Three-Zone Governance, Human-First Decomposition, Strict Pretty YAML, and Writing Rules -Every page under `docs/`, `README.md`, and `examples/*.md` is written for human engineers and repository operators first, and checked deterministically by `scripts/check-docs.mjs` and `scripts/site.mjs`. +Every file under `docs/`, `README.md`, and `examples/*.md` is written for human engineers and repository operators first, routed cleanly across Loopwright's three documentation zones, and checked deterministically by `scripts/check-docs.mjs` and `scripts/site.mjs`. -## 1. Human-First Decomposition Pattern +## 1. Three-Zone Architecture & Human-First Decomposition -Never dump dense implementation prose, raw TypeScript interfaces, or unannotated JSON schemas onto a reader. Decompose every concept, subsystem, or operational workflow into four progressive layers: +Loopwright splits `docs/` (`34` Markdown files: `docs/README.md` shared index + `33` zone pages) into three strict zones: + +| Zone | Source Paths | Human Site (HTML / Sidebar / `index.json` / `sitemap.xml`) | `/llms.txt` Surface | Outbound Link Policy | +| --- | --- | --- | --- | --- | +| **Public Human Site** (`15` pages) | `docs/{getting-started,operations,walkthroughs,configuration}/*.md` | **Included** (`site/data/navigation.yaml`, `site/content/docs/_index.md`, `site/layouts/index.html`) | Topic `##` sections → `/docs///index.md` | Public pages, `docs/assets/`, non-`docs/` repo files. **Never** `development.md`, `contribute/**`, or `references/**`. | +| **Flat LLM Reference** (`6` flat files) | `docs/references/*.md` (0 subdirectories) | **Excluded** (0 HTML, sidebar, `index.json`, or `sitemap.xml` entries) | `## Reference` → static `/references/.md` (links rewritten before Hugo runs) | Sibling `references/*.md`, public pages, `docs/assets/`, repo & `Contribute` paths (rewritten to GitHub `blob/`). | +| **Repo-Only `Contribute`** (`12` pages) | `docs/development.md`, `docs/contribute/**/*.md` | **Excluded** (0 HTML, sidebar, `index.json`, or `sitemap.xml` entries) | `## Optional` → GitHub `blob//docs/...` | Any repository path. | + +Never dump dense implementation prose, raw TypeScript interfaces, or unannotated JSON schemas onto a human reader. Decompose every public concept, subsystem, or operational workflow into four progressive layers, and route exhaustive machine lookup tables to `docs/references/*.md`: 1. **Mental model (1–3 short sentences)**: State what the component or workflow does, what boundary it enforces, and when an operator uses it. 2. **Visual flow or lifecycle table**: - For 3 or more interacting stages or components, embed a committed SVG diagram (`docs/assets/diagrams/*.svg`) paired with a hidden `` comment immediately below. - For two-dimensional comparisons (modes, sandbox backends, error codes, failure outcomes), present a uniform 2D Markdown table. -3. **Macro view (Complete Annotated Pretty YAML)**: Show a complete, copy-pasteable two-space Pretty YAML configuration or manifest (`apiVersion`, `kind`, `metadata`, `spec`) listing **every** schema field (required and optional) with inline `#` comments marking required fields, defaults, bounds, and security constraints. -4. **Micro view (Constraint bullets + Domain-grouped reference tables)**: Immediately beneath the Macro YAML block, list key field rules as short bullets (`- ****: .`) and document **every schema field, numeric bound, and valid enum choice** (`kind`, `mode`, `provider`, `disclosurePolicy`, `preferredBackends`, `networkMode`, `requiredCapabilities`, `implementation`, `enforcement`) in **domain-grouped** 2D Markdown tables (`### `). Never merge values from unrelated YAML fields or domains (for example, mixing provider names with numeric retry counts `1` / `2`) into a single generic `Value | Meaning | Constraints` table. +3. **Macro view (Annotated Block-Style Pretty YAML)**: Show a copy-pasteable two-space block-style Pretty YAML configuration or manifest (`apiVersion`, `kind`, `metadata.name` when applicable, `spec`) with inline `#` comments marking `Optional` fields, defaults, and security constraints. +4. **Micro view (Constraint bullets + Focused domain tables)**: Beneath the Macro YAML block, list essential field rules as short bullets (`- ****: .`) and group core enum choices in 2D Markdown tables (`### `). Offload exhaustive field-by-field bound matrices, 44-input / 23-subcommand flag encyclopedias, and verbatim protocol scripts to `docs/references/*.md`. Never merge values from unrelated YAML fields or domains into a single generic `Value | Meaning | Constraints` table. -## 2. Sentence & Voice Discipline (80% ASD-STE100) +## 2. Sentence Discipline (80% ASD-STE100), Shared Glossary, and Plurality Rules Apply controlled-English discipline across `README.md`, `docs/**/*.md`, and `examples/*.md`: @@ -25,7 +33,10 @@ Apply controlled-English discipline across `README.md`, `docs/**/*.md`, and `exa - Do not write: `Stale lease tokens are rejected by the controller prior to verification being executed.` - **Imperative procedures**: Address operator actions with direct imperative verbs (`Create`, `Validate`, `Inspect`, `Run`). Number dependent steps as `Step N: `. - **Zero self-referential page narration**: Never write `This page describes`, `This document describes`, `This section covers`, or `In this guide we will`. State the technical fact or operator instruction directly. -- **Consistent Loopwright terminology**: Use one canonical name for each domain concept: + +### Shared Glossary + +Use one canonical name for each domain concept and avoid mechanical slang (`wiring`, `plumbing`, `knob`, `arm/leg`): | Concept | Canonical Term | Avoid | | --- | --- | --- | @@ -33,63 +44,58 @@ Apply controlled-English discipline across `README.md`, `docs/**/*.md`, and `exa | Monotonic SQLite admission lock | `lease fence` | lock token, session lock, DB mutex | | Monotonic wall/monotonic time guard | `monotonic clock guard` | clock check, time skew guard | | Cryptographic verification receipt token | `gate token` (`gate.v1`) | check signature, verification hash | -| Repository automation manifest | `taskpack` (`.loopwright/taskpack.yaml`) | repo workflow, automation config | -| Calibrated System-One triage node | `decision router` (`@loopwright/decisions`) | AI classifier, fast model router | +| Repository automation manifest | `taskpack` (`.loopwright/taskpack.yaml`, `Taskpack`) | repo workflow, automation config | +| Multi-domain suite manifest | `taskpack suite` (`.loopwright/suite.yaml`, `TaskpackSuite`) | multi-pack config, domain bundle | +| Out-of-repo approved handler catalog | `trusted registry` (`TrustedRegistry`) | plugin list, handler config | +| Bounded island optimization manifest | `evolution campaign` (`campaign.yaml`, `EvolutionCampaign`) | search job, genetic config | +| Calibrated System-One triage node | `decision router` (`@loopwright/decisions`, `DecisionPolicy`) | AI classifier, fast model router | | Reviewed content-addressed memory | `reviewed memory` (`@loopwright/memory`) | agent memory, vector store | | Qualification and failure ledger | `closure matrix` (`loopwright closure`) | readiness table, feature matrix | | Uncertain external side effect | `unknown outcome` (`unknown`) | ambiguous failure, partial error | -- **Banned AI filler words and phrases**: `scripts/check-docs.mjs` rejects the following case-insensitively in `docs/**/*.md` prose: - - `seamlessly` - - `delve` - - `tapestry` - - `leverage` - - `utilize` - - `cutting-edge` - - `empower` - - `it is worth noting` - - `in order to` - - `this page describes` - - `this document describes` - - `comprehensive guide` - - Also avoid figurative puffery such as `robust`, `streamline`, `unlock`, `pivotal`, or `crucial` unless naming a literal identifier. - -## 3. Page Shape & `gpustack`-Style Reading Footer Contract - -Every page under `docs/**/*.md` (except the index `docs/README.md`) must follow this exact structure: +### Menu, Sidebar, and Heading Plurality Rules -```markdown -# +1. **Collections use plural nouns**: `Walkthroughs`, `Operations`, `Sandbox Backends` (collection of OS/container backends), `Coding Agents` (collection of external host agents). +2. **One capability, workflow, or resource kind uses a singular noun**: `Architecture`, `Installation`, `GitHub Action`, `GitHub App`, `CLI`, `Declarative Taskpack`, `Managed Controller`, `Evolutionary Campaign`, `Taskpack`, `Task Contract`, `Controller and Registry`, `Decision Routing`, `Evolution Campaign`. +3. **Siblings of one type share the same grammatical number**: Every workflow walkthrough under `Walkthroughs` is singular (`Declarative Taskpack`, `Managed Controller`, `Evolutionary Campaign` — never mixing singular siblings with plural `Evolutionary Campaigns`). -Short introductory paragraph (1 to 3 paragraphs, each <= 5 lines and <= 500 characters) -stating the component role, safety boundary, and operator entry point. +### Checked Kind-Plural Rules in Authored Prose -## Contents +In authored prose across `docs/**/*.md` (including paragraphs, list items, headings, and table cells), keep the **singular PascalCase resource `kind` inside backticks** and place the plural `s` or an explicit plural noun outside. `scripts/check-docs.mjs` (`checkKindPlurals`) enforces this deterministically: -- [Overview](#overview) -- [Configuration](#configuration) -- [Step 1: Generate draft files](#step-1-generate-draft-files) -- [Verification](#verification) -- [Troubleshooting](#troubleshooting) +| Pattern | Kinds | Correct | Never Write (CI Fail) | +| --- | --- | --- | --- | +| **Regular kinds** | `Taskpack`, `TaskpackSuite`, `TaskContract`, `ControllerConfig`, `GitHubAppConfig`, `EvolutionCampaign`, `AttemptReceipt`, `VerificationProfile` | `` `Taskpack`s ``, `` `TaskpackSuite`s ``, `` `TaskContract`s ``, `` `ControllerConfig`s ``, `` `GitHubAppConfig`s ``, `` `EvolutionCampaign`s ``, `` `AttemptReceipt`s ``, `` `VerificationProfile`s `` | `` `Taskpacks` ``, `` `TaskpackSuites` ``, `` `TaskContracts` ``, `` `ControllerConfigs` ``, `` `GitHubAppConfigs` ``, `` `EvolutionCampaigns` ``, `` `AttemptReceipts` ``, `` `VerificationProfiles` `` | +| **Irregular `-y` kinds** | `TrustedRegistry`, `DecisionPolicy` | `` `TrustedRegistry` objects ``, `` `DecisionPolicy` objects `` (or `manifests` / `files`) | `` `TrustedRegistries` ``, `` `TrustedRegistry`s ``, `` `DecisionPolicies` ``, `` `DecisionPolicy`s `` | -## Overview +- **Explicit Kind-Plural Exemptions**: Fenced code blocks, 4-space/tab indented code blocks, HTML comments, CLI commands/flags (`--taskpacks`, `loopwright ...`), file/API paths (`packages/taskpack/...`), and YAML/property expressions (`spec.domains`) retain literal spelling. +- **Count nouns & units**: Match noun and verb to number (`1 island`, `2 islands`), keep units singular (`4 MiB`, `5000 ms`), and form abbreviation plurals with plain `s` (`GPUs`, `NPUs`, `PRs`, never `GPU's`). -... +### Banned AI Filler Phrases -## Configuration +`scripts/check-docs.mjs` rejects the following case-insensitively in `docs/**/*.md` prose: +`seamlessly`, `delve`, `tapestry`, `leverage`, `utilize`, `cutting-edge`, `empower`, `it is worth noting`, `in order to`, `this page describes`, `this document describes`, `comprehensive guide`. Also avoid figurative puffery (`robust`, `streamline`, `unlock`, `pivotal`, `crucial`) unless naming a literal identifier. -... +## 3. Page Shape, Flat Reference Contract, and Reading Footers -## Step 1: Generate draft files +### Public (`15` Pages) & Contribute (`12` Pages) Shape -... +Every public and contributor page under `docs/**/*.md` follows this structure: -## Verification +```markdown +# -... +Short introductory paragraph (1 to 3 paragraphs, each <= 5 lines and <= 500 characters) +stating the component role, safety boundary, and operator entry point. -## Troubleshooting +## Contents +- [Overview](#overview) +- [Taskpack](#taskpack) +- [Step 1: Generate draft files](#step-1-generate-draft-files) +- [Verification](#verification) + +## Overview ... --- @@ -99,131 +105,148 @@ stating the component role, safety boundary, and operator entry point. **Next** → [Declarative Taskpack](../walkthroughs/declarative-taskpack.md) — author and verify a repository taskpack end to end. ``` +### Flat `docs/references/*.md` Contract (`6` Flat Files) + +Every file in `docs/references/` must be flat (zero nested subdirectories, zero symlinks) and obey: + +1. **Opening `Evidence:` label line**: Declare `Evidence: contract.`, `Evidence: recorded capture.`, or `Evidence: synthetic simulation.` before the first `## ` heading. +2. **Hub vs. topic `## Contents`**: Topic files (`bootstrap-interview.md`, `taskpack-and-contract-schema.md`, `controller-and-registry-schema.md`, `cli-and-action-reference.md`, `coding-agent-protocol.md`) include synchronized `## Contents`; `docs/references/README.md` (`# Reference Hub`) is exempt from `## Contents` and must link every sibling `docs/references/*.md`. +3. **Reference reading footer (`**See also**` only, zero `**Next**`)**: Every `docs/references/*.md` file must end with `\n---\n\n**See also** — [Title](target.md) (description) · ...` and is **strictly forbidden** from including `**Next**`. + ### 1:1:1 Group Directory, Filename Slug, Sidebar Label, and `# H1` Title Rule -Every public documentation page (all 15 pages published to `site/`) must obey strict **1:1:1 alignment**: +Every public documentation page (all `15` pages published to `site/`) must obey strict **1:1:1 alignment**: -1. **Group directory matches navigation group**: Public pages reside inside one of the 4 group-matching directories under `docs/`: +1. **Group directory matches navigation group**: - `Getting Started` → `docs/getting-started/` - `Operations` → `docs/operations/` - `Walkthroughs` → `docs/walkthroughs/` - `Configuration` → `docs/configuration/` -2. **Filename matches `# H1` slug**: `path.basename(file, '.md') === slugify(h1Title)` (for example, `# Controller and Registry` → `docs/configuration/controller-and-registry.md`, `# Task Contract` → `docs/configuration/task-contract.md`, `# CLI` → `docs/operations/cli.md`). -3. **Exact label equality across all surfaces**: `site/data/navigation.yaml` `labels["/docs///"]` === page `# H1` title === `docs/README.md` `## All pages` link label. Never mix `Taskpack Manifest` in the sidebar with `# Taskpack Manifest Reference` in the article or `Task Contracts` with `# Task Contracts and Schemas`. - -### Reading Footer Format (`\n---\n`) - -`site/layouts/partials/article-content.html` splits page content on `\n---\n` and renders the trailing `**See also**` / `**Next**` block into `