Field Manual / 2026

Repository Architecture Field Manual

How to read, design and reason about mature software systems. Package boundaries, plugins, local/cloud authority, persistence, sync, RPC/gRPC, CAD, multiplayer, native runtimes and IDE/CLI UX.

Files are syntax. Directories are responsibility. Packages are contracts. Processes are failure boundaries. Protocols are promises across boundaries.

Four-pass method

PassQuestion
CartographyWhat are the top-level responsibilities?
AuthorityWho is allowed to decide truth?
ContractsWhere are schemas, APIs, manifests and migrations?
MotionTrace one operation end-to-end.
repo/
├─ apps/        deployable products
├─ packages/    reusable capabilities
├─ schemas/     wire/data contracts
├─ migrations/  executable data history
├─ tooling/     build/release/codegen
└─ examples/    executable documentation
Boundaries

Packages, layers and plugins

Dependency direction is the invisible architecture. High-level product code may depend on stable lower-level capabilities; the reverse dependency usually signals a leak.

UI / CLI / HTTP
      │
      ▼
application commands
      │
      ▼
domain / core
      │ interfaces
  ┌───┼────┐
 DB  net   fs
 adapters

Plugin contract checklist

  • Discovery and stable identity
  • Frontend/backend/native entry points
  • Capability grants rather than entire host internals
  • Activation/disposal lifecycle
  • Process/WASM/worker isolation
  • Host API and protocol compatibility
  • Scoped persistence and observability
Dynamic import is not a plugin architecture. The architecture is the constrained, versioned contract around the imported code.
Authority

Local vs cloud

“Local” and “cloud” describe placement. Authority describes who is allowed to decide. A robust design can have cloud-owned identity, locally owned live execution, and separately durable operation receipts.

PlaneOwns
Controlidentity, policy, enrollment, configuration
Datalatency-sensitive payload and execution
Observabilitylogs, traces, metrics, receipts
Build/releasetrusted artifacts, signing, SBOM, publishing
cloud policy ── authorizes ──▶ local runtime
                                  │
                            live session/data
                                  │
                         durable receipt/event
Protocols

RPC, gRPC, generated contracts

A process boundary turns ordinary calls into distributed-systems calls: they can time out, be retried, arrive twice, arrive late, or fail after the remote side committed work.

foo.proto ── protoc ──▶ foo.pb.go
                     ├▶ foo_grpc.pb.go
                     ├▶ Python/TS/Rust bindings
                     └▶ descriptors

.proto, .capnp, GraphQL schemas, OpenAPI documents, JSON-RPC methods and WIT interfaces are all ways of turning assumptions into inspectable contracts.

State

Persistence and migrations

A database is not one thing. Relational truth, local working state, immutable artifacts, event history, caches and search indexes need different guarantees.

001_create.sql
002_add_nullable_owner.sql
003_backfill_owner.sql
004_enforce_owner.sql

The staged sequence above is architecture: it allows mixed-version software and existing data to survive change.

Synchronization

Conflict policy over a network

ModelCore idea
Optimistic concurrencyVersion check then retry/rebase
CRDTReplicas merge by datatype rules and converge
Server authoritativeClients send intent; server validates simulation truth
Event sourcingOrdered events are durable history; projections derive state
client intent ──▶ authority ──▶ accepted state/event ──▶ clients
                     │
              validate + simulate
WebSocket is transport. It does not answer who wins a conflict.
Creative systems

CAD / 3D / scene representations

Learn representation before format. STL is usually triangle mesh; STEP commonly carries precise CAD geometry; OpenSCAD is source code that produces geometry; USD is scene description/composition; IFC carries BIM semantics.

RepresentationPreserves
Meshrenderable surface
B-repprecise topology + surfaces
Parametricfeature history + constraints
Scene graphhierarchy, transforms, references, materials, time
BIMbuilding semantics + geometry + relationships

“4D” usually means 3D plus time: animation, simulation, or BIM scheduling—not one magic fourth-dimensional file format.

Developer experience

IDE / CLI as systems architecture

keyboard / palette / CLI / agent
              │
        command registry
              │
       application handler
              │
   filesystem / terminal / git / RPC
              │
       structured receipt

A PTY, terminal emulator, shell, transport, session manager and UI are distinct layers. LSP and DAP show how deliberately boring protocols can create rich tooling ecosystems.

File atlas

Read unfamiliar extensions by lifecycle

Ask: who writes it, who consumes it, can it be regenerated, and what contract does it encode?

FileFamilyInterpretation
.ts / .tsxTypeScript / TS+JSXWeb/server/CLI packages; .tsx usually contains JSX syntax.
.js / .mjs / .cjsJavaScript module variantsES module vs CommonJS boundaries; package.json `type` also matters.
.jsxJavaScript + JSXReact-style UI source.
.rsRustCrates, native runtimes, CLIs, WASM, systems code.
.goGoServices, CLIs, networking, generated protobuf stubs.
.swiftSwiftApple-platform apps, services, packages, native tooling.
.m / .mmObjective-C / Objective-C++Apple-native bridges and older platform code.
.cCPortable low-level code and stable FFI surfaces.
.cc / .cpp / .cxxC++CAD kernels, engines, runtimes, high-performance native systems.
.h / .hpp / .hxxHeadersDeclarations, templates and public native interfaces.
.pyPythonAutomation, ML, data tooling, SDKs, plugins.
.rbRubyAutomation/server ecosystems.
.kt / .ktsKotlin / scriptAndroid, JVM, Gradle Kotlin build scripts.
.javaJavaJVM services/Android/libraries.
.csC#Unity, .NET services/tools, CAD connectors.
.luaLuaEmbedded scripting; common in games and configurable runtimes.
.zigZigSystems code, C interoperability, build tooling.
.ex / .exsElixirConcurrent/network services; mix project scripts.
.erl / .hrlErlangBEAM/OTP systems.
.scalaScalaJVM functional/data systems.
.dartDartFlutter applications and tooling.
.gdGDScriptGodot game/application scripting.
.shader / .glsl / .vert / .fragShader sourcesGPU programs; vertex/fragment stages and variants.
.metalMetal Shading LanguageApple GPU shader source.
.hlslHigh-Level Shader LanguageDirectX-style GPU shader source.
.wgslWebGPU Shading LanguageWebGPU shader source.
.protoProtobuf / gRPC IDLmessages, enums, services, field numbers.
.capnpCap’n Proto schemaRPC/data layout and generated bindings.
.graphql / .gqlGraphQL schema/querytypes, operations, fragments.
.avscAvro schemaData serialization / streaming ecosystems.
.fbsFlatBuffers schemaZero-copy-ish serialized data/codegen.
.thriftThrift IDLCross-language service/data contracts.
.witWASM component interfaceTyped host/guest interfaces.
.jsonschema / schema.jsonJSON SchemaValidation and config/data contracts.
openapi.yamlOpenAPI contractHTTP operations, request/response schemas.
.d.tsTypeScript declarationsPublic type shape without implementation.
.swiftinterfaceSwift textual module interfaceStable-ish compiler-visible public API representation.
.defWindows module definitionDLL exports/imports.
.idlGeneric interface definition languageCOM or other RPC/interface systems depending on ecosystem.
.sqlSQL sourceMigrations, queries, schema, seeds.
.sqlite / .db / .sqlite3SQLite databaseBinary embedded relational database.
.wal / .shmSQLite write-ahead log/shared memoryLive database sidecar files; not source assets.
.csv / .tsvDelimited tablesSimple interchange; weak types.
.jsonStructured textConfig/data/API payloads; no comments in strict JSON.
.jsoncJSON with commentsConfig files such as modern Wrangler.
.jsonl / .ndjsonOne JSON object per lineStreaming/log/data pipelines.
.yaml / .ymlHuman-oriented structured dataCI, manifests, deployment and API contracts.
.tomlConfig/package manifestsRust Cargo, Python, tool configs.
.xmlStructured markupBuild files, interchange formats, legacy APIs.
.parquetColumnar analyticsEfficient typed analytical datasets.
.arrow / .featherApache Arrow ecosystemColumnar in-memory/interchange data.
.orcColumnar dataBig-data analytics.
.duckdbDuckDB database fileEmbedded analytical database.
.pbfProtocol Buffer binarySerialized protobuf data; also used by OpenStreetMap PBF conventions.
.msgpackMessagePack binaryCompact JSON-like binary serialization.
.cborCBOR binaryCompact typed binary data, common in protocols/embedded systems.
Info.plistProperty listBundle metadata, capabilities and application configuration.
.plistApple property listXML/binary structured settings/data.
.entitlementsCode-signing entitlementsCapabilities such as keychain groups, sandbox permissions.
.xcassetsAsset catalog bundleApp icons, images, colors, symbol assets.
.storyboardInterface Builder UI documentXML UI graph; common in UIKit-era apps.
.xibInterface Builder UI fileReusable UI view/window definition.
.stringsLocalization stringsLocalized key/value resources.
.stringsdictPlural/localization rulesStructured localized variations.
.mobileprovisionProvisioning profileSigning/device/team entitlement material.
.xcconfigXcode build configurationComposable build setting files.
.swiftmoduleCompiled Swift moduleCompiler artifact; platform/toolchain specific.
.ipaiOS application archivePackaged signed app payload.
.appApplication bundleDirectory bundle containing executable + resources.
.framework / .xcframeworkApple binary framework bundlesLibraries/resources for one or many platforms/architectures.
.onnxOpen Neural Network ExchangePortable model graph/weights across runtimes.
.safetensorsTensor weightsSafer/simple tensor storage common in ML ecosystems.
.ggufQuantized LLM model containerLocal inference ecosystems such as llama.cpp family.
.tfliteTensorFlow Lite modelMobile/embedded inference.
.mlmodel / .mlpackageCore ML modelApple ML deployment formats.

The DOCX edition contains the expanded CAD, native-binary, build-system, media, archive and package-format tables.

Repository observatory

Public codebases worth reading

  • Cloudflare workers-sdk — Wrangler, Miniflare, C3, Vite integration; developer tooling monorepo.
  • Cloudflare workerd — Native Workers runtime; Cap’n Proto/native/runtime rabbit holes.
  • Microsoft VS Code — Layered editor/workbench core and extension host.
  • Eclipse Theia — Framework for custom browser/desktop IDEs.
  • Zed — Rust workspace, native editor, collaboration and agent subsystems.
  • OpenAI Codex — Coding-agent CLI/runtime and app-server protocol surfaces.
  • Directus — Headless data platform and extension SDK.
  • Payload — TypeScript/Next app framework + CMS monorepo.
  • Automerge — CRDT core in Rust, JS/WASM surface, binary/sync protocol.
  • Nakama — Go realtime game backend and runtime extensions.
  • Colyseus — TypeScript multiplayer rooms and synchronized authoritative state.
  • Godot — C++ game engine with unusually educational root boundaries.
  • Bevy — Rust ECS engine and plugin architecture.
  • FreeCAD — Parametric CAD application and workbench ecosystem.
  • OpenSCAD — Programmatic geometry / CAD compiler mental model.
  • OpenUSD — Scene description, composition, C++ and asset system.
  • Speckle — AEC collaboration server/viewer/connectors/SDK ecosystem.
  • Swift Package Manager — Swift package/build graph and large modular Swift codebase.
  • gRPC — Cross-language RPC implementation; native build systems.
  • gRPC Go — Go RPC stack and protobuf/gRPC code generation.
Choose a question and compare two repositories. Do not wander through ten giant repos without a hypothesis.
Engineering practice

What mature teams optimize

  • Explicit ownership and small blast radius
  • Compatibility during rolling change
  • Structured observability and correlation IDs
  • Data migration discipline
  • Cancellation, deadlines, retries and idempotency
  • Least-privilege capabilities and trust boundaries
  • Tests aligned with architectural boundaries
  • Reproducible builds and generated artifacts
  • Deletion of old shims and duplicate authority
identity ≠ permission ≠ capability ≠ possession of every secret