From da1827c5192d2784fcecf01578b5f307ea15a8c1 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Sun, 3 May 2026 20:37:04 +0300 Subject: [PATCH] docs: record collector endpoint and outbox checks --- docs/tasks/lethe-collector-claude-code.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/tasks/lethe-collector-claude-code.md b/docs/tasks/lethe-collector-claude-code.md index c8e4c47084776defa6b09f2822cb2e0c68d3ed78..b67e330f9bce02710b36f00a5003dccc5aec5114 100644 --- a/docs/tasks/lethe-collector-claude-code.md +++ b/docs/tasks/lethe-collector-claude-code.md @@ -289,20 +289,21 @@ Positive: - CK2 — `go build ./cmd/lethe-collector` succeeds. - CK3 — `lethe-collector status` with a minimal config opens the state DB and reports the configured source. - CK4 — runner tests cover offset-0 backfill and bounded daemon drain. +- CK5 — sender tests cover trailing-slash `server_url` normalization. Negative: -- CK5 — `lethe-collector status --config ./tmp/missing.yaml` exits non-zero with `CONFIG_NOT_FOUND` surfaced. +- CK6 — `lethe-collector status --config ./tmp/missing.yaml` exits non-zero with `CONFIG_NOT_FOUND` surfaced. Invariants / assumptions: -- CK6 (IV7) — `internal/collector` has no `os.Hostname` call; host flows from collector config. -- CK7 (IV9, AS1) — sender posts only `TurnEvent` NDJSON to `/api/v1/ingest`. -- CK8 (UK1) — Tailscale header injection remains unverifiable without the deployed Tailscale path. +- CK7 (IV7) — `internal/collector` has no `os.Hostname` call; host flows from collector config. +- CK8 (IV9, AS1) — sender posts only `TurnEvent` NDJSON to `/api/v1/ingest`. +- CK9 (UK1) — Tailscale header injection remains unverifiable without the deployed Tailscale path. Interfaces: -- CK9 (IF1) — `config.Load(path string) (*Config, error)` is exercised by CLI and config tests. -- CK10 (IF2) — `state.Store` offset/outbox methods are exercised by runner and state tests. -- CK11 (IF3) — `Sender.PostBatch(ctx, events)` is exercised by sender, outbox, and runner tests. -- CK12 (IF4) — `RunOnce` / `RunDaemon` are exercised by CLI wiring and runner tests. +- CK10 (IF1) — `config.Load(path string) (*Config, error)` is exercised by CLI and config tests. +- CK11 (IF2) — `state.Store` offset/outbox methods are exercised by runner and state tests. +- CK12 (IF3) — `Sender.PostBatch(ctx, events)` is exercised by sender, outbox, and runner tests. +- CK13 (IF4) — `RunOnce` / `RunDaemon` are exercised by CLI wiring and runner tests. Smoke: `go run ./cmd/lethe-collector --config ./tmp/collector-smoke.yaml status` → prints host, state DB, outbox stats, source list, and `lag_bytes`. @@ -319,6 +320,7 @@ Smoke: `go run ./cmd/lethe-collector --config ./tmp/collector-smoke.yaml status` - ureview (re-review): added `lag_bytes` per file to `status` output using `parser.SourceFile.Size` from discovery. - ureview (final): bounded daemon drain uses `http.timeout` — no separate `shutdown_grace` config exists for the collector. - ureview (final): backfill offset-0 semantics are implemented as `RunBackfillOnce` instead of a mode flag on `RunOnce` — explicit call sites are safer than a boolean parameter that could be misused in daemon loops. +- ureview (final): enforced the outbox size cap before replay and normalized trailing slashes in `server_url` — keeps IV5 and IV9 true for preexisting state and valid-looking URLs. - ureview (final): normalized sender `serverURL` and enforced outbox cap before every replay to fix IV5/IV9 violations found in review. ### Deferred (needs user input)