docs: simplify jt808 mileage runtime state

This commit is contained in:
lingniu
2026-07-01 13:29:08 +08:00
parent 97ea77ed27
commit cea8ceeabe
3 changed files with 31 additions and 9 deletions

View File

@@ -35,6 +35,31 @@ class VehicleStatRepositoryContractTest {
.doesNotContain("speed integral");
}
@Test
void targetArchitectureDocumentsMetricTableAsOnlyJt808MileageRuntimeState() throws IOException {
String architecture = Files.readString(repositoryRoot().resolve("docs/target-architecture.md"));
assertThat(architecture)
.contains("Runtime state: none outside `vehicle_stat_metric`")
.contains("Restart recovery reads the same metric row")
.contains("JT808 daily mileage is stored only in `vehicle_stat_metric`")
.doesNotContain("state-store")
.doesNotContain("Redis mileage state")
.doesNotContain("production memory");
}
@Test
void jt808MileageRunbookDocumentsMetricTableAsOnlyRuntimeState() throws IOException {
String runbook = Files.readString(repositoryRoot()
.resolve("docs/operations/jt808-daily-mileage-runbook.md"));
assertThat(runbook)
.contains("Runtime state: none outside `vehicle_stat_metric`")
.contains("Restart recovery reads the same `daily_mileage_km` metric row")
.doesNotContain("Redis mileage state")
.doesNotContain("state-store");
}
private static Path repositoryRoot() {
Path path = Path.of("").toAbsolutePath();
while (path != null && !Files.exists(path.resolve("docs/superpowers/plans"))) {