# Inkhaven 1.3.21 — Scripting the ConLang Suite from Bund

_RFC LANG-1 is complete (P1–P10). This release opens the whole ConLang Suite to
**Bund**, Inkhaven's scripting layer: a single script can now define, inspect,
generate, AI-author, and typeset an entire constructed language — fully
interchangeable with the JSON/CLI path. No new dependencies. Reference:
[CONLANG.md](../CONLANG.md)._

## The `ink.lang.*` tree

The new `src/scripting/stdlib/lang.rs` exposes the engine as ~37 words. Every one
is also reachable as the shorter `lang.X` (the `ink.` prefix dropped).

- **Define a whole language from a script.** `lang.init`, `lang.add_word`, and
  `lang.define` (writes a phonology / grammar / morphology / typology / sample
  HJSON block under a chapter) build a language that is byte-for-byte identical to
  a hand-authored one — so you may use JSON/HJSON *or* Bund, freely mixed.

- **Inspect every layer** (`store_read`, allowed by default): `list`,
  `generate_word`, `syllabify`, `ipa`, `stress`, `tone`, `transliterate`,
  `gloss`, `paradigm`, `derive`, `agree`, `sentence`, `relative`, `complement`,
  `coordinate`, `stats`, `audit`, `query`, `gaps`, `sound_change`, `cognates`,
  `family_tree`, `names`, `prose`, `poem`. Structured results come back as native
  Bund dicts/lists (a sentence yields `{ surface, gloss, literal }`; `stats` the
  full profile).

- **Mutate** (`store_write`, default-denied): `remove_word`, `derive_add`,
  `grammar_set`, `idiom_add`, `metaphor_add`.

- **AI generation** (`ai_write`, default-denied, **advisory** — returns data,
  never auto-writes): `compose` (themed blessing / curse / incantation),
  `reconstruct` (a proto-form from cognates), `realism_check`, and
  `generate_lexicon` (forms from the deterministic generator, AI assigns meaning,
  the dedup gate runs — survivors returned for you to commit).

- **Produce files** (`fs_write`, default-denied): `dictionary`, `grammar_book`,
  and `font_build` (compiles UFO/TTF), plus `glyph_lint` (`fs_read`) and
  `glyph_draft` (AI-drafts a glyph SVG; needs both `fs_write` and `ai_write`).

## Building artefacts natively

Bund's `{ … }` is a lambda, not a dict, so `lang.dict` turns a flat
`[ key val key val … ]` list into a real dict. It is aliased to self-documenting
names — `word`, `rule`, `phoneme`, `block` — so a script reads like what it
builds (`[ "ipa" "k" "kind" "consonant" ] phoneme`). Hand a dict to `lang.define`
and it serialises to the same HJSON the book stores.

## Safety model

Each word is classified into the existing scripting policy categories:
read-only inspectors are `store_read` (allowed); book mutators are `store_write`;
the AI words are `ai_write`; the file producers are `fs_write` — all
default-denied, opted into per project via
`scripting: { enabled_categories: [ … ] }`. A word that needs two capabilities
(e.g. `glyph_draft` writes a file *and* calls the LLM) checks the second one at
run time. Paths are confined to the project root by the same sandbox as
`ink.fs.*`. The AI words stay **advisory** — they return data; a script commits
anything it keeps through the separately-gated `add_word`.

## Also in this release

- The developer's guide *Developing a Constructed Language with Inkhaven* gains a
  *Scripting (Bund)* section, and its end-of-chapter **"What you learned"** recap
  boxes are recoloured pastel mint-green so they stand out from the cream callouts
  and blue term boxes.

## Design notes

- **Zero new dependencies.** The Bund layer reuses the existing `conlang::*`
  engine through store-based loaders newly exposed in `cli::language`.
- **Interchangeable.** A Bund-built language opens, inspects, and renders
  identically through the `inkhaven language …` CLI and the editor.

Tests 1533 (no net new — the suite already covered the engine; the new words are
thin, policy-pinned wrappers, validated live against DeepSeek for the AI/file
paths). Full reference: [CONLANG.md](../CONLANG.md).

## Looking ahead

The next major LANG track is planned in
[`LANG-2_PLAN.md`](../PROPOSALS/LANG-2_PLAN.md) — **Sociolinguistics & Contact**
(dialects, registers, loanword adaptation, areal features, speech communities) —
where a dialect is a sound-change chain applied synchronously and a loanword is a
phonotactic repair, reusing the LANG-1 engines.
