Skip to content

D65 — kg is published as an installable tool with public docs, and nothing private goes with it

  • Status: Accepted — amends D43 (the demos are examples) and D47i (a dataset's CI installs kg from the public code); amended by D69 (kg is renamed Analects) D70 (it is published to PyPI from a GitHub release) and D71 (the public repository is named)
  • Date: 2026-10-01
  • Origin: slice 39, preparing the repository to be open-sourced
  • Area: build

Decision

  • An installable tool.
  • The packs ship inside the package (kg/packs/builtin), so uv tool install or pip install gives a working kg anywhere.
  • Where packs are found, in order: --packs, $KG_PACKS, a project's own packs/ folder, then the packs kg ships with.
  • With no packs found, kg says where it looked and stops, rather than loading an empty schema.
  • One layout.
Folder Holds
src/kg/ the code and its packs
examples/ one investigation per data product (the demos, D43)
docs/ the docs site: getting-started/, guides/, reference/ (the design, the CLI, MCP), decisions/ (these ADRs, ids unchanged), project/ (roadmap, backlog, history)
tests/ the unit tests and the golden sessions
scripts/ the ADR index, the CLI reference and the release check
  • Data lives in dataset repositories (kg dataset init), never in the code repository. Epoch's CSVs are downloaded from Epoch.
  • Public docs.
  • The docs are task-led (install, a first research run, connecting MCP, importing sources, publishing a site, sharing a dataset, hosting a peer, writing a pack).
  • They are built with MkDocs and published on GitHub Pages.
  • llms.txt lists them for language-model clients.
  • The CLI reference is generated from the CLI, and CI fails if it is stale.
  • Licences. The code is Apache-2.0. Datasets and sites are CC-BY-4.0 unless a dataset says otherwise, and every value keeps its source's attribution.
  • Nothing private is published.
  • scripts/release_check.py, run in CI, fails on:
    • a home path, a key or token's shape, or an email that isn't a placeholder;
    • a tracked graph or .env;
    • any private_terms in the local kg.yaml.
  • A person lists their own names and their proprietary words there.
  • Material derived from a proprietary list or a private research scope is removed from the published tree.
  • In an accepted ADR it is redacted in place, marked "[redacted — D65]". That is the one edit to an accepted ADR beyond its status line, its area and a repaired transcription. The reasoning stays; only what would reveal private work goes.
  • Public facts used as examples (Epoch's rows, a developer's own press release) stay.
  • A fresh public repository. The public repository starts from the cleaned tree as its first commit. The private repository keeps the history, which names private work and personal addresses in commit messages that cannot be redacted in place.

Why

The repository was written as a private build log. A person who finds it needs to install it, run research, connect an agent and host what they find, and none of that was written down for them. Packs that only load from a clone are a trap for anyone who installs the tool. And a public repository must not carry a user's proprietary list or anything derived from it (AGENTS.md, D47f), in its files or in its history.