Skip to content

Commit 00fe7f5

Browse files
committed
chore: save session state [skip ci]
1 parent e0e8448 commit 00fe7f5

2 files changed

Lines changed: 36 additions & 33 deletions

File tree

STATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ spool, cache, secrets, HTTP client, DLQ — with zero additional wiring.
144144
- **Config cascade unified spec** — rustlib and pylib must be identical. Both search `./`, `./config/`, `/config/`, `~/.config/{app_name}/`. Home `.env` opt-in. PG layer is built-for-not-with (YAML gitops already centralised). See [CONFIG-CASCADE.md](docs/CONFIG-CASCADE.md)
145145
- **Common patterns in rustlib first** — if all 6 DFE projects will use the same pattern, implement it in rustlib first, publish, then consume. Never duplicate common logic across downstream projects. This applies to: worker pool, batch pipeline, pipeline stats, DLQ routing, metrics groups, config cascade, CLI framework.
146146
- **DFE parallelisation pattern** — split sequential hot loops into parallel (pure `&self` computation via rayon) and sequential (mutable state: buffer push, mark_pending, stats, DLQ) phases. The `BatchProcessor` trait + `BatchPipeline` struct in rustlib provide the common framework. Each DFE app implements `BatchProcessor` for its domain. See `src/pipeline/` module.
147+
- **ServiceRuntime** — pre-built infrastructure for DFE service apps. Created by `run_app()` before `run_service()`. Contains MetricsManager, DfeMetrics, MemoryGuard (optional), shutdown token (with K8s pre-stop delay), worker pool (optional), scaling pressure (optional), RuntimeContext. Apps receive it fully wired. See `src/cli/runtime.rs`.
148+
- **RuntimeContext** — rich runtime metadata detected once at startup (pod_name, namespace, node_name, container_id, memory_limit_bytes, cpu_quota_cores). Global singleton via OnceLock. All modules read from this instead of doing their own env var lookups. No-ops on bare metal. See `src/env.rs`.
149+
- **K8s pre-stop compliance** — shutdown handler sleeps `PRESTOP_DELAY_SECS` (default 5 in K8s, 0 elsewhere) before cancelling the token. Prevents traffic routing to a draining pod.
150+
- **Deployment contract CI bridge**`container-manifest.json` (minimal CI subset), `Dockerfile.runtime` (runtime stage fragment for CI composition), OCI labels (static from contract, dynamic injected by CI), `from_cargo_toml()` for auto-detecting native deps, `schema_version` field.
151+
- **Commit type discipline**`fix:` for most changes (PATCH bump). `feat:` only for genuinely new user-facing features. `BREAKING CHANGE:` NEVER written without explicit user approval. See `/projects/hyperi-ai/docs/superpowers/plans/2026-04-01-commit-type-enforcement.md`.
147152

148153
---
149154

TODO.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,34 @@
88

99
## Current Tasks
1010

11-
### v1.20.0 Release
12-
13-
Release branch and v1.20.0 tag exist. Core pillar work done.
14-
- [x] Release-merge to release branch
15-
- [ ] Verify crates.io publication succeeded
16-
- [x] Docs consolidation (TRANSPORT.md, CORE-PILLARS.md)
17-
- [x] Redis vs Kafka comparison table in TRANSPORT.md
18-
19-
### Metrics Manifest (v1.22)
20-
21-
- [x] **Metrics manifest infrastructure**`MetricDescriptor`, `MetricRegistry`, `ManifestResponse` types
22-
- Standards-aligned: OpenMetrics (type/description/unit), OTel Advisory (labels/buckets)
23-
- Novel HyperI extensions: `group`, `use_cases`, `dashboard_hint`
24-
- `MetricRegistry` (Arc<RwLock>) tightly coupled into `MetricsManager`
25-
- Every `counter()`/`gauge()`/`histogram()` call auto-pushes descriptor
26-
- New `_with_labels()` methods for declaring label keys and groups
27-
- `set_build_info()`, `set_use_cases()`, `set_dashboard_hint()` enrichment
28-
- [x] **`/metrics/manifest` endpoint** — JSON contract on both axum and raw server paths
29-
- Correct path ordering (manifest checked before /metrics in raw server)
30-
- Explicit Content-Type: application/json
31-
- [x] **`DfeMetrics::register(&MetricsManager)` breaking change** — platform metrics tightly coupled
32-
- All 24 dfe_* metrics auto-appear in manifest with correct labels and group="platform"
33-
- [x] **dfe_groups updated** — all 8 groups use `_with_labels()` internally
34-
- `AppMetrics::new()` calls `set_build_info()` automatically
35-
- Label-based metrics push descriptors with correct key names
36-
- Histogram buckets captured in manifest
37-
- [x] **Downstream dfe-* projects updated** (committed, not pushed — waiting for parallelism remediation)
38-
- dfe-loader, dfe-receiver, dfe-archiver, dfe-fetcher, dfe-transform-vector, dfe-transform-vrl
39-
- Phase 3 (dfe-transform-wasm, dfe-transform-elastic, dfe-transform-splack) deferred
40-
- [ ] **Phase 2 enrichment**`set_use_cases()` / `set_dashboard_hint()` content (deferred to parallelism remediation)
41-
- [ ] **Regenerate container + metrics contract artefacts** per project (deferred to push time)
11+
### Phase 2: Parallelism + Batching (all DFE projects)
12+
13+
Common patterns needed in rustlib first:
14+
- [ ] `BatchAccumulator<T>` — bounded channel + drain-on-threshold for receiver batching
15+
- [ ] SIMD-optimised batch processing — sonic-rs batch parse, memchr for NDJSON splitting
16+
- [ ] Evaluate columnar batch layout — if SoA (struct-of-arrays) layout improves cache locality for batch transforms, adopt it. NOT necessarily Arrow — could be simple Vec<Field> columns. Profile before deciding.
17+
- [ ] Mutex audit enforcement — document/lint pattern for hot-path Mutex detection
18+
19+
Per-project parallelism work:
20+
- [ ] dfe-archiver — per-destination writers (remove single Mutex), parallel compression
21+
- [ ] dfe-receiver — request batching (accumulate N bodies → batch validate+route → batch produce)
22+
- [ ] dfe-receiver — Splunk HEC / OTLP / gRPC parallel per-event processing via fan_out_async
23+
- [ ] dfe-fetcher — within-source parallel service fetching via fan_out_async
24+
- [ ] dfe-transform-vrl — parallel deserialisation (Phase 1 of pipeline, currently sequential)
25+
- [ ] Per-project: adversarial parallel tests, throughput benchmarks
26+
27+
Phase 2 spec: `docs/superpowers/specs/2026-04-01-phase2-parallelism-batching.md`
28+
29+
### Phase 3: Non-Integrated Transforms
30+
31+
- [ ] dfe-transform-wasm — parallel WASM invocation per batch
32+
- [ ] dfe-transform-elastic — assess rustlib integration level, discuss
33+
- [ ] dfe-transform-splunk — assess rustlib integration level, discuss
34+
35+
### Metrics Manifest Enrichment (deferred)
36+
37+
- [ ] `set_use_cases()` / `set_dashboard_hint()` content per metric group
38+
- [ ] Regenerate container + metrics contract artefacts per project
4239

4340
### Completed Previous Sessions
4441

@@ -101,9 +98,10 @@ Release branch and v1.20.0 tag exist. Core pillar work done.
10198

10299
## Notes
103100

104-
- Use `CARGO_BUILD_JOBS=2` for all cargo commands
105101
- Transport backends: Kafka, gRPC, Memory, File, Pipe, HTTP, Redis/Valkey
106102
- Core pillars plan: `docs/superpowers/plans/2026-03-26-core-pillars.md`
107103
- Two deployment modes: Kafka-mediated (persistence) vs direct gRPC (low latency)
108104
- Routed transport is receiver/fetcher only — all other stages are 1:1
109-
- v1.20.0 released with breaking transport trait split (feat!: commit)
105+
- Common patterns in rustlib first — if all 6 DFE projects use the same pattern, implement in rustlib
106+
- DFE parallelisation playbook: `/projects/dfe-loader/docs/PARALLELISE-REMEDIATION.md`
107+
- Phase 2 spec: `docs/superpowers/specs/2026-04-01-phase2-parallelism-batching.md`

0 commit comments

Comments
 (0)