# {{displayName}} — LLM Wiki Contract

> Generated by the `lisa-wiki` plugin from `{{wikiRoot}}/lisa-wiki.config.json`.
> kernelVersion: {{kernelVersion}} · schemaVersion: {{schemaVersion}} · rendered: {{generatedDate}}
> This snapshot keeps the wiki self-describing **without** the plugin installed. Re-render with
> `/setup --upgrade`; do not hand-edit — change the config instead.

## Purpose
{{purpose}}

## What this is
A git-native markdown knowledge base under `{{wikiRoot}}/`, owned by **{{org}}**, maintained by the
lisa-wiki kernel. Three layers: immutable **raw sources** (`{{wikiRoot}}/sources/`), the LLM-owned
**synthesis** layer (the category directories), and this **schema** layer (config + this contract).
Repository mode: **{{mode}}**.

## Layout
- `{{wikiRoot}}/index.md` — navigation map of every page (read first).
- `{{wikiRoot}}/log.md` — append-only operation ledger.
- `{{wikiRoot}}/start-here.md` — orientation + purpose.
- `{{wikiRoot}}/sources/` — provenance (source notes); layout: **{{sourceLayout}}**.
- `{{wikiRoot}}/state/` — per-source ingestion cursors (JSON).
- `{{wikiRoot}}/staff/` — digital-staff role pages (optional).
- Synthesis categories: {{categories}}.

## Answering questions (query-first)
When you need to answer a question about this project — its code, architecture, decisions, domain
concepts, conventions, or documentation — reach for the wiki **first**: run `/query "<question>"`
(Codex: `$lisa-wiki-query`) before ad-hoc code search, grep, or a web lookup. The wiki is the
curated, cited source of truth for this project, so a query is usually faster and more accurate than
re-deriving the answer from raw files.

This is the **primary** method, not the only one. If `/query` returns nothing relevant, the answer
is not in the wiki yet, or the question is about live/uncommitted state, fall back to reading the
code, browsing `{{wikiRoot}}/index.md`, or other tools — and consider `/ingest` to capture any
durable knowledge you had to reconstruct so the next query succeeds.

## Ordered ingestion pipeline (never reorder)
`source note → synthesis → index → log → verify → state → commit/PR`.
State advances **only** after source notes + synthesis + index + log + verification all pass.
Connectors write **only** their source note (+ run metadata); the kernel performs synthesis, index,
log, verification, state advancement, and PR.

## Standards
- Frontmatter required on new/touched synthesis pages and source notes
  (`type`, `created`, `updated`, `related`, `sources`[, `sensitivity`]).
- `index.md` is a per-category table; `log.md` is an append-only table with the fixed operation
  vocabulary: `INIT, SETUP, INGEST, CREATE, UPDATE, MERGE, DEPRECATE, LINT, QUERY, REBUILD-INDEX`.
- Cite sources in plain text, e.g. `Source: {{wikiRoot}}/sources/<system>/<note>.md`.
- Do not invent facts; weak or unverified material → `{{wikiRoot}}/open-questions/`.

## Sources & connectors
Enabled connectors: {{connectors}}.
Universal sources every project may ingest: self + other registered projects' git/PR history,
**project-scoped** memory, and roles. **Memory is project-scoped ONLY — never global/unrelated.**
External-write connectors (e.g. Slack OAuth, CRM writeback) run only with explicit intent and never
auto-merge. A bare full ingest runs every enabled non-external-write source.

## Safety
- Source retention: **{{sourceRetention}}**. Default sensitivity: **{{sensitivityDefault}}**.
- Pre-commit: `git diff --check`, secret scan, tenant/contamination scan, touched-file guard.
- Never commit secrets/OAuth artifacts. In wrapper/standalone modes, never stage child-repo contents.

## Git
{{prPolicy}}.

## README
Mode: **{{readmeMode}}** (rich keeps the public README; stub points to `/onboard-me`; preserve leaves it).

## Commands
`/ingest` · `/query` · `/lint` · `/setup` · `/migrate` · `/add-ingest` · `/add-role` · `/onboard-me` · `/doctor`
(On Codex, invoke the matching `lisa-wiki-*` skills, e.g. `$lisa-wiki-ingest`.)
