This is the implementation-oriented reference for people and agents
maintaining the accompanying source tree. The executable code under
kilin/, its validated resources and actual call paths are authoritative.
These pages explain the architecture and contracts; they do not authorize
changing the implementation merely to make a description true. Suspected
runtime defects should be logged separately from documentation corrections.
The root README is the installation/entry-point guide, tutorials demonstrate use, and Python docstrings specify individual API signatures and validation. Each tool's own README describes its settings, requests and outputs. These references complement rather than replace one another. The supported environment is defined in Development.
| Task | First reference | Next boundary to inspect |
|---|---|---|
| Understand the system | Architecture | Module map, then the owning subsystem and source |
| Explain an answer | Answering | Retrieval, Traces |
| Import/update local data | Source pipeline | Workspaces, index identity |
| Add a type, reader or tool | Extension interfaces | Configuration, tool services |
| Change desktop behavior | GUI architecture | Protocol, conversation ownership |
| Debug/test/release | Development | README publication, macOS builds, Performance, Security |
Each shared rule has one detailed home. Other pages retain enough local context to be understandable, then link here rather than repeat precedence, mutable values or failure procedures. This table assigns documentation responsibility, not authority over the source implementation.
| Primary reference | Detailed contract it owns |
|---|---|
| Architecture | Overall component boundaries, core/GUI dependency direction and state lifetimes. |
| Project workspaces | Creation, source-directory convention, resources, explicit updates and filesystem failure residue. |
| Source pipeline | Selection versus reading, source coordinates, extraction and chunk identity. |
| Retrieval pipeline | Ranking/fusion, context expansion, persisted index identity and empty/incremental indexes. |
| Answering pipeline | Routing/history, answer production, completion/recovery, partial results and turn commitment. |
| Model management | Backends, loading/cache/network behavior, chat/embedding sessions and model-specific limitations. |
| Configuration | Setting ownership, precedence, canonical identifiers and project overrides. |
| Packaged defaults | Validated core JSON keys, values, bounds and effects; not per-tool defaults. |
| Tool packages | Package boundaries, safe generated outputs and internal/final model-call policy. |
| Extension interfaces | Steps and interface obligations for adding types, readers, tools and other components. |
| GUI architecture | Desktop process/lifecycle integration and presentation ownership. |
| GUI protocol | Commands, events, payloads, interactive waits, cancellation and restart. |
| Conversation ownership | Writer leases, atomic files, switching, archival and cleanup guarantees. |
| Conversation memory | Turn UUIDs, authoritative feedback, active branch origins, independent indexing and separate prompt provenance. |
| Trace recording | Diagnostic activation/content, trace metadata, event versus checkpoint failure policy. |
| Security | Trust boundaries, sensitive data, deployment responsibilities and explicit non-guarantees. |
| Performance | Trace-derived measurements, reproducible workloads and limits of timing evidence. |
| Development | Coding/documentation process, test runners, packaging and PR verification. |
| README publication | Branch-relative README links, generated PyPI metadata, release tags and checks. |
| macOS builds | Ad-hoc development builds, native artifact checks, limitations and manual testing. |
| Module map | Complete production Python inventory and the primary reference for each module. |
| Architecture diagrams | Editable SVG inventory, ownership, accessibility and visual-maintenance rules. |
The GUI README is the desktop companion. Individual tool READMEs own tool-specific parameter values and outputs; use the tool index to find one. Do not infer behavior or safety from a tool identifier alone.
These are starting points, not exhaustive test selections. Read the primary contract, inspect the listed implementation and its callers, then expand the regression set for the actual change. Owner pages explain design rationale, invariants, failure boundaries and native/model checks that substitutes cannot cover. The verification procedure still applies after a focused subset passes.
| Proposed change | Contract to read first | Update/review together | Representative verification |
|---|---|---|---|
| Create/open projects or change their layout | Workspaces | Reservation, profile publication, resources, GUI activation and saved-layout compatibility. | Creation, transactions, GUI creation |
| Import, synchronize or remove sources | Source pipeline, workspace updates | Selection, provenance/version records, original-file protection and explicit index refresh. | Source management, source changes |
| Add a reader or change chunk boundaries | Source extensions | Dispatch, exact text/coordinates, citation previews, chunk IDs and cache reuse. | Readers, chunking, index provenance |
| Change retrieval, expansion or saved indexes | Retrieval | All channel depths/order, model identity, evidence labels, checksum and empty-state behavior. | Retrieval, RAG corrections, empty projects |
| Change answer completion or tool model calls | Answering, tool policy | Side-call isolation, thinking/budgets, retries, partial status, usage and committed history. | Completion, recovery, budgets |
| Add a project type, tool or template | Extensions | Parser/registry, intents, settings/resources, package data, local README and module map. | Type contracts, tool boundaries, resources |
| Change model loading or generation controls | Models | Backend/tokenizer, history, completion metadata, download policy, cleanup and saved configuration. | Runtime, chat units, embedding units |
| Change defaults or saved settings | Configuration | Owning JSON/validator, initialization versus reopening, GUI controls and cache invalidation. | Core defaults, tool settings, documented values |
| Change conversation fields or writer ownership | Conversation ownership, conversation memory, traces | Store/logger/RAG/GUI writers, old-state fixtures, lock cleanup and trace consumers. | Format, ownership, lifecycle |
| Change GUI commands, events or Stop | Protocol, GUI lifecycle | Bridge, input thread/dispatcher, interactive waits, page state and actual committed results. | Protocol, resume, native smoke |
| Change tracing or performance analysis | Traces, measurements | Event producers, projection, checkpoint/failure policy, parser fixtures and privacy. | Trace logger, benchmark parser |
The module map assigns every production Python module to a primary reference. The diagrams are editable schematics of boundaries and flows, not exhaustive API/state-machine specifications. Source and owner-page conditions take precedence over a simplified arrow or caption.
Documentation checks verify links, inventories, selected source-backed contracts and organization. They do not establish that every prose claim is correct, that evidence is factually sufficient, or that native models and Qt work on every host. Distinguish observed behavior, tested guarantees and proposals in reviews; do not fill gaps with architectural intent.
Integrated-documentation maintenance, PR verification, README publication, diagram maintenance.