Services overview
Where this code lives. The code described here lives in this repository, under
service/andcontracts/, imported from core at512567eee71e31bb39f580c4f7acf8b865e9d1b2with its history (ADR-0002). Citations of those files point here; citations of what stays in core (its ADRs, the CLI, the Python appenders) point at core at4eecb124, where they were checked. Core’s counterpart record is ADR 2026-10-29-1, the events domain and its Java services live in spec-kitty-events (accepted in core PR spec-kitty/spec-kitty#6782, merged on 2026-10-30).
The events domain has two services, one per side of a CQRS split (read-write split):
- The Mission Status Read API (
mission-status-api) exists. It is a read-only, loopback-only HTTP service (service/README.md). - The write service (
command-cli) is built and runnable, and its write core servescheckout_append(service/command-cli/README.md, #156, #160, #161).- It implements the launcher contract and the protocol surface of
contracts/mission-write(#6675). - The canonical writer (#160) and the lane authority (#161) are built: a durable,
byte-exact status append under the same per-Mission lock core’s Python writer takes, and
the lane machine with its guards, dependency gating and claim rules.
coordination_ref_commitwaits for migration step 4. See event-log lock and append and the write-service protocol, and core’s binding (#6195) lands when a release carries this write core.
- It implements the launcher contract and the protocol surface of
C4 level 1: context
- Read API. Its consumers are external UIs: the dashboard in
spec-kitty-mission-uiand Kitty Desktop (core ADR 2026-10-01-2, Amendment 2026-10-03). No spec-kitty command starts it, and it is not in the PyPI wheel (README, first paragraph). Core pins its release for CI only (ADR-0002, decision 3). - Write service. One resident service per repository, keyed on the git common dir, reached through the CLI’s EventBridge port (core ADR 2026-10-22-1 D-2, D-3).
- Today the CLI still appends to every event log itself (event ledger writers and readers, “Current state: writers”).
Core’s own C4 pages
(docs/architecture/diagrams/01_context,
02_containers)
still say services/mission-status-api/ “does not exist yet”. That is stale: the service
ships. The diagrams on this page follow the code.
C4 level 2: containers
| Container | What it is | Evidence |
|---|---|---|
mission-status-api | The root Gradle project in core (:mission-status-api in service/ here): the query-service deployable. Spring Boot 4 (Spring MVC on virtual threads), Java 25, a GraalVM native binary for four targets plus a JVM jar. | README, “Package layout” and “Release and binaries”; core ADR 2026-10-01-2 Amendment 2026-10-03 (D-4) |
domain-model | The Mission status types (Mission, work package, lane, status event, snapshot). No declared dependency, no java.io or java.nio.file. | README, “Package layout”; DomainModelBoundaryTest |
event-log | The line codec, the event ordering and StatusReducer, and the ledger file mechanics (LedgerLocks, TornTailRepair). Depends on domain-model and the Jackson streaming parser only. | README, “Package layout”; EventLogBoundaryTest |
| contracts | contracts/mission-status/openapi.yaml (read) and contracts/mission-write/openapi.yaml (write), 1.0.0-SNAPSHOT and 1.0.1-SNAPSHOT. | contracts/mission-write/CHANGELOG.md; writers-and-readers page, “The read API contract” |
command-cli | The write-service deployable named by #6117 decision 12 (service/command-cli, #156): Spring Boot 4, Java 25, a GraalVM native binary for four targets plus a JVM jar. It implements the launcher contract, the protocol surface and the write core (#160, #161); checkout_append is served and coordination_ref_commit waits for migration step 4. | service/command-cli/README.md; core ADR 2026-10-22-1 D-1 |
The four module names are #6117 decision 12’s: domain-model, event-log, query-service
and command-cli (core ADR 2026-10-22-1 D-1). The read service and the write service share
domain-model; the read service stays read-only and separate (D-8).
Onion layering
Dependencies point inward only. The domain is pure, the application holds the query services and their ports, and the adapters hold HTTP in and the file system out. The read service’s package layout:
domain.model(thedomain-modellibrary),domain.readmodelanddomain.redaction.application.query(MissionStatusQueryService,ProjectionCache,stream), withapplication.query.port.inandapplication.query.port.outholding interfaces only.application.commandis reserved and empty.adapter.in.http,adapter.out.filesystem(with itscodec), andconfig.
The rules, and the tests that enforce them
ArchitectureRulesTest
runs the fourteen rules defined in
ArchitectureRules.
It also fails when the number of rules run differs from the number defined, and every rule
has a positive control in ArchitectureControlsTest. The rule texts, shortened:
- The domain is free of frameworks, JSON, file APIs and concurrency, and creates no thread.
- The application depends only on itself, the domain and the JDK, and creates no thread (the executor is injected).
adapter.in.httpreaches, among project packages, onlyapplication.query.port.in, the domain and itself.adapter.out.filesystemreaches onlyapplication.query.port.out, the domain and itself.- No adapter depends on an adapter of the other direction.
- Nothing outside
configdepends onconfig. - File APIs are used only in
adapter.out.filesystem(not its codec) and inevent-log’sadapter.out.ledger. - JSON libraries and Spring are used only in adapters and
config. - Contract DTO packages are used only in
adapter.in.http. - No
ProcessBuilderand noRuntime.exec. - The port-level conformance subset is source-neutral (a test-scope rule).
- The codec is pure decoding: no file API, used only by
adapter.out.filesystemand test support. - A class directly in a query port package is an interface.
- Nothing in
application.querydepends onapplication.command.
The two libraries carry their own boundary tests, because they build on their own:
DomainModelBoundaryTest:domain-modeldepends only on itself and the rule 1b JDK packages, and all 18 types it held at extraction (#6192) are still checked.EventLogBoundaryTest: the codec depends only on itself,domain-model, the Jackson streaming parser and the JDK; the reducer has no parser, codec or I/O; the ledger package uses the JDK alone; and the module holds those three packages and no other.
Where it lives
In core until the import (4eecb124) | Since the import, in this repository |
|---|---|
services/mission-status-api/ (with domain-model/ and event-log/) | service/ |
contracts/mission-status/, contracts/mission-write/, _shared, tools, lint | contracts/ |
CLI client shapes src/specify_cli/status/write_service_protocol.py, the EventBridge, the launcher | stay in core |
The import kept git history (git filter-repo from the frozen core SHA 512567eee71e31bb39f580c4f7acf8b865e9d1b2) and ran on
the operator’s go-signal (ADR-0002,
decision 2). The build and release line are in
ADR-0003.