Skip to content

Commit 4631299

Browse files
committed
docs: close E4 in STATUS Next; P2-6 plan; sustained pace protocol
Move Checks 1-4 to Proven. Document how to run paced >=100 eps (--pace-eps) without claiming it. Add packaging migration plan only.
1 parent 639909e commit 4631299

4 files changed

Lines changed: 144 additions & 11 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to AgentFlow are documented in this file.
44

55
## [Unreleased]
66

7+
### Docs — STATUS/Next after E4 + drain ≥100; P2-6 plan only
8+
9+
- STATUS: E4 Checks 1–4 in Proven; Next is sustained ≥100 (with
10+
`--pace-eps` protocol) and P2-6 packaging plan — not delivery topology.
11+
- Plan (no code): `docs/plans/p2-6-runtime-namespace-migration.md`.
12+
713
### Perf — S10 stretch try: 107.3 eps bridge apply on 2000-event drain
814

915
- Live Mac compose (1 Flink TM): 2000-event realpath drain cleared at

‎docs/STATUS.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
AgentFlow's product axis — **event → live metric** on the real streaming path
99
(Kafka → Flink → serving bridge → ClickHouse → API with Redis push
1010
invalidation) — is implemented, measured, and documented. Current work is
11-
raising the write-path throughput ceiling and turning documented limits into
12-
passed ones (endurance, scale, delivery topology).
11+
raising the write-path ceiling from **drain-window** numbers to **sustained**
12+
ones, and packaging hygiene for the next breaking release.
1313

1414
## Proven
1515

@@ -19,6 +19,7 @@ passed ones (endurance, scale, delivery topology).
1919
| In-process demo freshness | 1.06 s p50 / 1.99 s p95 | [freshness-benchmark.md](freshness-benchmark.md) |
2020
| Real-path throughput measured | produce ~700 eps; bridge apply is the ceiling (see below) | [perf/throughput-realpath.md](perf/throughput-realpath.md) |
2121
| 2-pod control plane on kind | webhook registered on pod A visible on pod B; verify script PASS | [perf/e4-2pod-topology-2026-07-09.md](perf/e4-2pod-topology-2026-07-09.md) |
22+
| E4 Checks 1–4 (2 pods, delivery + alert single-page) | **PASS** on kind | [perf/e4-check4-alert-single-page-2026-07-17.md](perf/e4-check4-alert-single-page-2026-07-17.md) |
2223
| 4 h endurance soak (real path + API reads) | bounded lag (peak 2 915 → 0), bridge RSS/FD flat, one faulted batch replayed exactly-once by the journal guard, **zero cache drift** | [perf/soak-s11-2026-07-10.md](perf/soak-s11-2026-07-10.md) |
2324
| At-scale on own data (S13) | **51.2 M rows / 2.87 M orders / 4 years of legend history**, analyst queries 20–730 ms, all 17 §12 invariants pass incl. full-scan GTIN validation | [perf/scale-own-data-2026-07-11.md](perf/scale-own-data-2026-07-11.md) |
2425
| Security pass (offline/unit remainder) | closed; third-party pen-test **not** claimed | [security-s12-2026-07-09.md](security-s12-2026-07-09.md), [security-audit.md](security-audit.md) |
@@ -72,14 +73,13 @@ batched path (fold rules, idempotency, replay) are in
7273

7374
## Next
7475

75-
1. **Delivery topology** — Checks 1–4 live on kind
76-
([perf/e4-replica-topology-2026-07-11.md](perf/e4-replica-topology-2026-07-11.md),
77-
[perf/e4-check3-exactly-one-delivery-2026-07-16.md](perf/e4-check3-exactly-one-delivery-2026-07-16.md),
78-
[perf/e4-check4-alert-single-page-2026-07-17.md](perf/e4-check4-alert-single-page-2026-07-17.md)).
79-
Phase 3 automated topology proof is closed.
80-
2. **≥ 100 eps sustained** — multi-hour / paced produce at ≥ 100 eps with
81-
bounded lag (numeric drain bar observed at 107.3 eps on a 2000-burst —
82-
[perf/throughput-realpath-100eps-try-2026-07-17.md](perf/throughput-realpath-100eps-try-2026-07-17.md)).
76+
1. **≥ 100 eps sustained** — multi-hour / paced produce at ≥ 100 eps with
77+
bounded lag. Drain-window ≥100 is already measured (107.3 eps @ 2000);
78+
protocol and flags: [perf/throughput-realpath-100eps-try-2026-07-17.md](perf/throughput-realpath-100eps-try-2026-07-17.md)
79+
(`--pace-eps 100 --count …`). Needs a healthy Flink hop for the whole window.
80+
2. **P2-6 packaging** (breaking) — rename wheel package `src` →
81+
`agentflow_runtime` with deprecation shim; plan only until a release
82+
window: [plans/p2-6-runtime-namespace-migration.md](plans/p2-6-runtime-namespace-migration.md).
8383

8484
External gates remain unchanged and are listed in the README scope note:
8585
production CDC onboarding, a benchmark on production-grade hardware, and a

‎docs/perf/throughput-realpath-100eps-try-2026-07-17.md‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Mac compose stand, and the bridge is not trailing Flink on that window
4949
metrics `:9108`, `config/serving.yaml` (ClickHouse).
5050
- Co-tenant containers left stopped; no `docker system prune`.
5151

52-
## Reproduce
52+
## Reproduce (drain window — this run)
5353

5454
```bash
5555
export PATH=$HOME/bin:/usr/local/bin:$PATH
@@ -65,6 +65,32 @@ docker compose -f docker-compose.yml -f docker-compose.flink.yml \
6565
--bridge-metrics http://127.0.0.1:9108/metrics --latency-samples 0 --no-md
6666
```
6767

68+
## How to measure *sustained* ≥100 (not yet run)
69+
70+
The driver already supports paced produce (`--pace-eps`). Closing the sustained
71+
claim is a **longer produce window** with lag remaining bounded while the
72+
*target ingress* is ≥100 eps — not another unpaced backlog drain.
73+
74+
```bash
75+
# Example: 15 min @ 100 eps target ≈ 90_000 events (wall ~900 s of produce)
76+
# then catch-up; raise --catchup-timeout-seconds if lag is high.
77+
# Pass criteria (proposed, not yet signed off as product bar):
78+
# - produce pace ≈ 100 eps (driver)
79+
# - bridge_apply_eps and flink_eps stay near the produce rate over the window
80+
# - lag_peak bounded and lag_end → 0 after catch-up
81+
# - apply_failures_delta == 0
82+
.venv/bin/python scripts/benchmark_throughput_realpath.py \
83+
--bootstrap 127.0.0.1:19092 \
84+
--count 90000 --pace-eps 100 \
85+
--bridge-metrics http://127.0.0.1:9108/metrics \
86+
--latency-samples 0 --catchup-timeout-seconds 600 --no-md
87+
```
88+
89+
**Stand constraints (Mac 6 GiB):** keep `--scale flink-taskmanager=1`; stop
90+
co-tenants; do not claim multi-hour until a run of that length actually
91+
finishes with healthy Flink. A 15 min paced arm is a first step; multi-hour
92+
remains a separate soak-class exercise.
93+
6894
## Honest claim (what to put in SSOT)
6995

7096
| Claim | Status | Evidence |
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# P2-6 — Runtime namespace: `src` → `agentflow_runtime`
2+
3+
> Plan only. **Do not implement** until a breaking release window is
4+
> scheduled. Source of the finding: `audit_gpt_11_07_26.md` §P2-6.
5+
6+
## Problem
7+
8+
| Today | Risk |
9+
|-------|------|
10+
| Distribution name `agentflow-runtime` | Fine |
11+
| Wheel packages top-level **`src`** (`[tool.hatch.build.targets.wheel] packages = ["src"]`) | Namespace collision with any other project that also ships `src`; non-idiomatic public import (`from src.serving…`) |
12+
| Import surface used everywhere in-repo | `src.*` in app code, tests, Docker/helm command lines, Flink image layout, docs |
13+
14+
## Target
15+
16+
- Installable package name: **`agentflow_runtime`** (import path matches
17+
distribution intent; aligns with wheel evidence paths in
18+
`docs/runbooks/release-rollback.md`).
19+
- Deprecation window: keep a top-level **`src`** shim that re-exports or
20+
warns, then remove in N+1.
21+
- No change to distribution name `agentflow-runtime` unless a separate
22+
rename is decided.
23+
24+
## Non-goals (this plan)
25+
26+
- Renaming `sdk/agentflow` or `sdk-ts` packages.
27+
- Making `agentflow-integrations` publishable (separate P2-6 bullet —
28+
either first-class CI/publish or explicit “internal”).
29+
- Full monorepo re-layout.
30+
31+
## Migration phases
32+
33+
### Phase 0 — inventory (no code move)
34+
35+
1. List all runtime entrypoints that hardcode `src.`:
36+
- process modules: `python -m src.processing.bridge_consumer`,
37+
`src.serving.api.main:app` (uvicorn / helm / staging Dockerfile)
38+
- tests / mypy `packages=["src"]` if any
39+
- docs and scripts
40+
2. Confirm hatch config: today only `packages = ["src"]` under
41+
`[tool.hatch.build.targets.wheel]`.
42+
3. Build a wheel and record `unzip -l dist/*.whl | head` so the before/after
43+
tree is evidence-backed.
44+
45+
### Phase 1 — physical package + dual import (breaking-prep)
46+
47+
1. Move or package-dir map `src/` content so imports are
48+
`agentflow_runtime.…` while **source tree stays reviewable** (prefer
49+
`src/agentflow_runtime/` layout *or* hatch `packages` map — pick one in
50+
implementation PR, not both ad hoc).
51+
2. Provide `src/__init__.py` shim:
52+
- re-export / path-hook / `import agentflow_runtime as …` pattern that
53+
keeps `import src.serving…` working for one minor line.
54+
- optional `DeprecationWarning` on first import of `src` (env-gated so
55+
tests stay quiet until the window starts).
56+
3. Update **first-party** entrypoints only when shim is green:
57+
- helm chart `command` / uvicorn module path
58+
- staging Dockerfile CMD
59+
- `scripts/k8s_staging_up.sh` inline Dockerfile
60+
- compose if any
61+
4. Gate: unit + contract + a wheel install smoke
62+
(`python -c "import agentflow_runtime; import src"`).
63+
64+
### Phase 2 — first-party cutover
65+
66+
1. Change in-repo imports `src.` → `agentflow_runtime.` (codemod + review).
67+
2. Keep shim for external consumers / old docs.
68+
3. mypy/ruff package paths, pytest `pythonpath`, coverage sources.
69+
70+
### Phase 3 — remove shim (breaking release)
71+
72+
1. Drop top-level `src` from the wheel.
73+
2. Changelog + migration note in `docs/migration/`.
74+
3. Tag as minor/major per semver policy for the release line.
75+
76+
## Compatibility matrix (related P2-6 tail)
77+
78+
| Artifact | Versioning today | Note |
79+
|----------|------------------|------|
80+
| `agentflow-runtime` | `2.0.0` in pyproject | This plan |
81+
| Python SDK `sdk/` | separate | Pin matrix in contract tests later |
82+
| TS SDK `sdk-ts/` | separate | Same |
83+
| `integrations/` | `1.0.1`, not in main publish workflow | Declare internal **or** promote |
84+
85+
Do not block the namespace rename on integrations publish.
86+
87+
## Verification checklist (when implementing)
88+
89+
- [ ] `python -m build` wheel contains `agentflow_runtime/…` and (phase 1–2) `src/…` shim only
90+
- [ ] `pip install dist/*.whl` → both import styles work in phase 1–2
91+
- [ ] helm/staging still boots API (`uvicorn …:app`)
92+
- [ ] bridge: `python -m agentflow_runtime.processing.bridge_consumer` (or shim module path)
93+
- [ ] CI unit + contract green; no accidental `packages = ["src"]` only
94+
95+
## Decision needed before coding
96+
97+
1. **Layout:** `src/agentflow_runtime/` (src-layout) vs rename tree root.
98+
2. **Shim lifetime:** one minor vs one major.
99+
3. **Warning default:** on vs off until phase 2 complete.
100+
101+
Until those three are answered in a release ticket, leave code as-is.

0 commit comments

Comments
 (0)