Gå til hovedinnhold

Architecture Decisions: neokapi

These are the Architecture Decisions for the neokapi framework, the open content and language engine. Everything here is Apache-2.0 and describes the framework modules: the repository root, the cobra-free host runtime, the shared CLI base, the kapi binary, Kapi Desktop, and the in-repo plugins.

Each decision describes the current state of its subsystem, not the history of how it got there. When a subsystem evolves, its decision is updated in place; the history lives in version control.

Tactical detail (SQL schemas, wire formats, algorithm pseudocode) is separated into Implementation Notes.

How the corpus is organized

Six series, by concern. A decision's identifier is its series letter and its position within the series, and it does not change when a neighbour is added or retired:

SeriesConcern
F: Foundationswhat the framework is, what a unit of content is, and how it is identified and serialized
E: Enginehow content is read, processed, written, and extended
C: Contextwhat a project knows, where it keeps it, and what governs it
S: Surfacesthe CLI, the desktop app, agent surfaces, and the runtime libraries
M: Multilingualwhat it takes for content to exist in more than one language
A: Assurancehow the framework proves it works

Each series is a directory, and its decisions sort by sidebar_position within it. The sidebar is generated from the directory: adding a decision means adding a file, never editing a list.

F: Foundations

ADTitleScope
F-01The framework and its modulesthe Go modules, go.work, the enforced dependency direction
F-02The content modelPart and Resource, Block, Run, Overlay, the semantic vocabulary, Layers
F-03Identityshort ids, the durable content key, occurrences
F-04The content-model wire schemathe canonical proto, protoconvert, frozen field numbers, the drift guard

E: Engine

ADTitleScope
E-01The processing enginechannel-based streaming, the Executor, parallel block tools, collectors
E-02The format systemreaders and writers, detection, registries, skeletons, non-translatable context
E-03The tool systemthe Tool interface, locale cardinality, annotations, side effects, schemas
E-04Flows and I/O bindingsource and sink bindings, process-only runs, ingest versus run transforms
E-05The plugin systemmanifest-driven out-of-process plugins, the transport modes, presets
E-06Execution trustthe exec class, per-project consent keyed to the approved argv
E-07Model and translation providersthe model provider interface, machine-translation backends, credentials
E-08Document structure tierstagged structure versus geometric reconstruction, the native and browser readers

C: Context

ADTitleScope
C-01The project modelthe kapi.yaml recipe, the committed .kapi/ layout, the store interface, ProjectContext
C-02Coordinates and governancethe product × channel space and the declared axes, per-file resolution, validity windows
C-03The context store and graph.kapi/work/store.db, the shared subsystem tables, the property graph and its query shapes
C-04Unit state and the decision record.kapi/state/, the working set, document identity, kapi commit, basis and target-hash staleness
C-05Freshness and the composite refone ref per stream, compare-and-swap per component, the staleness gate
C-06Context retrievalby location and by content, on the CLI and over MCP
C-07Voice profilesthe profile model, starter packs, the vocabulary and voice checks, scoring
C-08Termsthe concept model, the committed source, tiered lookup, validity
C-09Content memorytiered matching, entity generalization, version chains and governed reuse, the two-stage rebuild
C-10Redaction and clearancethe placeholder model, the local vault, the three policy readers

S: Surfaces

ADTitleScope
S-01The kapi CLIthe command tree, output formats, the credential store, exit codes
S-02Kapi Desktopthe desktop app, the project home and point map, the Context hub, governance editing, runs through the up venue
S-03Agent surfaces: MCP and skillsthe embedded skill, the curated MCP surface, apply_edits and the review verbs
S-04Toolbox utilitiesthe multi-call binary, block-text projection, exit codes
S-05The i18n runtime for Reactthe runtime, build-time extraction, re-attach, in-context review
S-06The visual editor data modelthe render projection, the shared preview kit, the edit round-trip

M: Multilingual

ADTitleScope
M-01Bilingual format interopthe extract and merge round trip, target alignment, exchange carriers
M-02Segmentationthe stand-off overlay, the engine registry, per-project selection
M-03Multimodal contentimage, audio and video extraction, confidence-gated escalation, provenance
M-04Math and equationsthe equation converter, formula blocks, translatable prose inside math
M-05Prompts and batchingthe prompt library, batching, the placeholder protocol
M-06Content packagesthe block bundle and the project parcel
M-07Metadata in other languagestool, format and plugin metadata, compiled catalogs

A: Assurance

ADTitleScope
A-01Testing and documentationthe test pyramid, the eval bands, the docs site and its pseudo-locale, recordings
A-02Parity with the Okapi Frameworkthe parity harness, the local report, faithful output