Skip to content

Commit 210d8fe

Browse files
committed
more perf
1 parent e662f9f commit 210d8fe

131 files changed

Lines changed: 4149 additions & 3537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.maggus/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
agent: claude
2-
model: sonnet
2+
model: haiku
33
include: []
44
approval_mode: opt-in
55
auto_continue: null

.maggus/features/feature_046.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
<!-- maggus-id: e6292fba-8caa-4626-8dc9-62addb3ef33b -->
2+
# Feature 046: Transport Layer Split (Tcp/, Quic/, Connection/)
3+
4+
## Introduction
5+
6+
Splits the flat `TurboHttp.Transport` namespace into three component-based sub-namespaces:
7+
`Tcp/`, `Quic/`, and `Connection/`. Currently all 15 transport files share a single
8+
`TurboHttp.Transport` namespace, making it impossible to distinguish TCP concerns from
9+
QUIC concerns from connection-management concerns at a glance.
10+
11+
This is the lowest-risk batch of the production code restructuring because `Transport/` is
12+
an internal layer with a small, well-defined set of consumers (Streams engines and test files).
13+
14+
### Architecture Context
15+
16+
- **Vision alignment:** Makes the transport layer navigable by protocol (TCP vs. QUIC) and
17+
responsibility (connection lifecycle), matching how contributors think about the problem.
18+
- **Components involved:** `TurboHttp.Transport` (all 15 files), `TurboHttp.Streams` (engines
19+
that import transport types), `TurboHttp.Tests.Transport` (8 test files)
20+
- **New namespaces introduced:** `TurboHttp.Transport.Tcp`, `TurboHttp.Transport.Quic`,
21+
`TurboHttp.Transport.Connection`
22+
- **Prerequisite for:** Feature 047–052 (those batches may reference transport types)
23+
24+
---
25+
26+
## Goals
27+
28+
- Move 15 transport files into `Tcp/`, `Quic/`, and `Connection/` subfolders
29+
- Update namespace declarations in all moved files
30+
- Update all `using` directives across the solution (Streams engines, test files)
31+
- Build green and all tests pass after the move
32+
33+
---
34+
35+
## File Mapping
36+
37+
### Tcp/ (3 files)
38+
| File | Old namespace | New namespace |
39+
|------|--------------|---------------|
40+
| `TcpConnectionStage.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Tcp` |
41+
| `TcpOptionsFactory.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Tcp` |
42+
| `DirectConnectionFactory.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Tcp` |
43+
44+
### Quic/ (5 files)
45+
| File | Old namespace | New namespace |
46+
|------|--------------|---------------|
47+
| `QuicConnectionStage.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Quic` |
48+
| `QuicConnectionManager.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Quic` |
49+
| `QuicClientProvider.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Quic` |
50+
| `QuicOptions.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Quic` |
51+
| `StreamDirection.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Quic` |
52+
53+
### Connection/ (7 files)
54+
| File | Old namespace | New namespace |
55+
|------|--------------|---------------|
56+
| `IClientProvider.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
57+
| `ClientByteMover.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
58+
| `ClientState.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
59+
| `ConnectionHandle.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
60+
| `ConnectionLease.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
61+
| `ConnectionManagerActor.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
62+
| `AbruptCloseException.cs` | `TurboHttp.Transport` | `TurboHttp.Transport.Connection` |
63+
64+
---
65+
66+
## Tasks
67+
68+
### TASK-046-001: Audit Transport/ Consumers
69+
**Description:** As a developer, I want to know every file outside `Transport/` that imports
70+
`TurboHttp.Transport` types so that no `using` directive is missed during the move.
71+
72+
**Token Estimate:** ~10k tokens
73+
**Predecessors:** none
74+
**Successors:** TASK-046-002
75+
**Parallel:** no — audit output gates the migration
76+
**Model:** haiku
77+
78+
**Acceptance Criteria:**
79+
- [ ] Run Roslyn Navigator `find_references` on `IClientProvider`, `ClientByteMover`,
80+
`ConnectionLease`, `ConnectionManagerActor`, `TcpConnectionStage`, `QuicConnectionStage`
81+
- [ ] Produce a list of all files that carry `using TurboHttp.Transport;`
82+
- [ ] Confirm the list matches expectation (Streams engines + test files only)
83+
- [ ] No external public API surface imports transport types directly
84+
85+
---
86+
87+
### TASK-046-002: Move and Re-namespace Transport Files
88+
**Description:** As a developer, I want all 15 transport files physically moved into
89+
`Tcp/`, `Quic/`, and `Connection/` subfolders and their namespace declarations updated
90+
so that the folder structure matches the code organisation.
91+
92+
**Token Estimate:** ~30k tokens
93+
**Predecessors:** TASK-046-001
94+
**Successors:** TASK-046-003
95+
**Parallel:** no
96+
97+
**Acceptance Criteria:**
98+
- [ ] `src/TurboHttp/Transport/Tcp/` contains exactly 3 files
99+
- [ ] `src/TurboHttp/Transport/Quic/` contains exactly 5 files
100+
- [ ] `src/TurboHttp/Transport/Connection/` contains exactly 7 files
101+
- [ ] `src/TurboHttp/Transport/` root contains no `.cs` files
102+
- [ ] Every moved file declares the correct new namespace
103+
- [ ] No file content changes other than the `namespace` line
104+
105+
---
106+
107+
### TASK-046-003: Update All `using` Directives
108+
**Description:** As a developer, I want every consumer of transport types to import the
109+
correct new sub-namespace so that the solution compiles without errors.
110+
111+
**Token Estimate:** ~20k tokens
112+
**Predecessors:** TASK-046-002
113+
**Successors:** TASK-046-004
114+
**Parallel:** no
115+
116+
**Acceptance Criteria:**
117+
- [ ] All `using TurboHttp.Transport;` replaced with the appropriate sub-namespace(s)
118+
in every consumer file identified by TASK-046-001
119+
- [ ] No `using TurboHttp.Transport;` remains anywhere in the solution
120+
- [ ] No logic changes — only `using` directive updates
121+
122+
---
123+
124+
### TASK-046-004: Build and Test Verification
125+
**Description:** As a developer, I want the full build and test suite to pass after the
126+
Transport split so that the migration is confirmed safe.
127+
128+
**Token Estimate:** ~10k tokens
129+
**Predecessors:** TASK-046-003
130+
**Successors:** none
131+
**Parallel:** no
132+
**Model:** haiku
133+
134+
**Acceptance Criteria:**
135+
- [ ] `dotnet build ./src/TurboHttp.sln` — zero errors, zero warnings introduced
136+
- [ ] `dotnet test --project TurboHttp.Tests/TurboHttp.Tests.csproj` — green
137+
- [ ] `dotnet test --project TurboHttp.StreamTests/TurboHttp.StreamTests.csproj` — green
138+
- [ ] `dotnet test --project TurboHttp.IntegrationTests/TurboHttp.IntegrationTests.csproj` — green
139+
140+
---
141+
142+
## Task Dependency Graph
143+
144+
```
145+
TASK-046-001 ──→ TASK-046-002 ──→ TASK-046-003 ──→ TASK-046-004
146+
```
147+
148+
| Task | Estimate | Predecessors | Parallel | Model |
149+
|------|----------|--------------|----------|-------|
150+
| TASK-046-001 | ~10k | none | no | haiku |
151+
| TASK-046-002 | ~30k | 001 | no ||
152+
| TASK-046-003 | ~20k | 002 | no ||
153+
| TASK-046-004 | ~10k | 003 | no | haiku |
154+
155+
**Total estimated tokens:** ~70k
156+
157+
---
158+
159+
## Functional Requirements
160+
161+
- FR-1: All 15 transport files land in exactly one of `Tcp/`, `Quic/`, or `Connection/`
162+
- FR-2: No `.cs` file remains in `Transport/` root after completion
163+
- FR-3: The public contract of all transport types is unchanged — no method, property,
164+
or constructor signatures modified
165+
- FR-4: Build produces zero errors and zero new warnings
166+
- FR-5: Full test suite (unit + stream + integration) passes unchanged
167+
168+
## Non-Goals
169+
170+
- No logic changes of any kind
171+
- No changes to `Streams/` folder structure
172+
- No changes to `Protocol/` (covered by Features 047–052)
173+
- No public API surface changes
174+
175+
## Success Metrics
176+
177+
- `src/TurboHttp/Transport/*.cs` directory is empty
178+
- CI build green on first run after merge
179+
180+
## Open Questions
181+
182+
*(none)*

.maggus/features/feature_047.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<!-- maggus-id: 2b3cd031-d4f4-4ef5-bc5f-5dad3ca4be9e -->
2+
# Feature 047: Protocol/Http10 + Protocol/Cookies Migration (RFC1945 + RFC6265)
3+
4+
## Introduction
5+
6+
Renames two small RFC-folder namespaces in the Protocol layer to component-based names:
7+
8+
- `TurboHttp.Protocol.RFC1945``TurboHttp.Protocol.Http10` (2 files)
9+
- `TurboHttp.Protocol.RFC6265``TurboHttp.Protocol.Cookies` (2 files)
10+
11+
This is the smallest and lowest-risk production-code batch: 4 files total, few consumers,
12+
and neither namespace is referenced by any public API surface.
13+
14+
### Architecture Context
15+
16+
- **Vision alignment:** Replaces RFC number labels with readable component names, making
17+
the Protocol layer self-documenting.
18+
- **Components involved:** `Protocol/RFC1945/`, `Protocol/RFC6265/`, the Http10/Http11 decode
19+
stages, and the Cookie bidi stage in Streams.
20+
- **Prerequisite:** Feature 046 (Transport split) should be complete; there is no hard
21+
dependency, but migrating in batch order keeps the solution stable.
22+
23+
---
24+
25+
## Goals
26+
27+
- Rename `Protocol/RFC1945/``Protocol/Http10/` and update namespaces
28+
- Rename `Protocol/RFC6265/``Protocol/Cookies/` and update namespaces
29+
- Update all `using` directives across the solution
30+
- Build and tests green after both renames
31+
32+
---
33+
34+
## File Mapping
35+
36+
### Protocol/Http10/ — RFC1945 (2 files)
37+
| File | Old namespace | New namespace |
38+
|------|--------------|---------------|
39+
| `Http10Encoder.cs` | `TurboHttp.Protocol.RFC1945` | `TurboHttp.Protocol.Http10` |
40+
| `Http10Decoder.cs` | `TurboHttp.Protocol.RFC1945` | `TurboHttp.Protocol.Http10` |
41+
42+
### Protocol/Cookies/ — RFC6265 (2 files)
43+
| File | Old namespace | New namespace |
44+
|------|--------------|---------------|
45+
| `CookieJar.cs` | `TurboHttp.Protocol.RFC6265` | `TurboHttp.Protocol.Cookies` |
46+
| `CookieParser.cs` | `TurboHttp.Protocol.RFC6265` | `TurboHttp.Protocol.Cookies` |
47+
48+
**Primary consumers to update:**
49+
- `src/TurboHttp/Streams/Stages/Decoding/Http10DecoderStage.cs`
50+
- `src/TurboHttp/Streams/Stages/Encoding/Http10EncoderStage.cs`
51+
- `src/TurboHttp/Streams/Stages/Features/CookieBidiStage.cs`
52+
- Any test files under `TurboHttp.Tests/` and `TurboHttp.StreamTests/` referencing these types
53+
54+
---
55+
56+
## Tasks
57+
58+
### TASK-047-001: Audit RFC1945 + RFC6265 Consumers
59+
**Description:** As a developer, I want to know every file outside `Protocol/RFC1945/` and
60+
`Protocol/RFC6265/` that imports these namespaces so that no `using` directive is missed.
61+
62+
**Token Estimate:** ~8k tokens
63+
**Predecessors:** none
64+
**Successors:** TASK-047-002
65+
**Parallel:** no — audit gates the rename
66+
**Model:** haiku
67+
68+
**Acceptance Criteria:**
69+
- [ ] Run Roslyn Navigator `find_references` on `Http10Encoder`, `Http10Decoder`,
70+
`CookieJar`, `CookieParser`
71+
- [ ] Produce complete list of consumer files
72+
- [ ] Confirm consumers are limited to Streams stages and test files
73+
74+
---
75+
76+
### TASK-047-002: Rename RFC1945 → Http10 and RFC6265 → Cookies
77+
**Description:** As a developer, I want the four files physically moved to new folders with
78+
updated namespace declarations so that the folder structure matches the component names.
79+
80+
**Token Estimate:** ~15k tokens
81+
**Predecessors:** TASK-047-001
82+
**Successors:** TASK-047-003
83+
**Parallel:** no
84+
85+
**Acceptance Criteria:**
86+
- [ ] `src/TurboHttp/Protocol/Http10/` contains `Http10Encoder.cs` and `Http10Decoder.cs`
87+
- [ ] `src/TurboHttp/Protocol/Cookies/` contains `CookieJar.cs` and `CookieParser.cs`
88+
- [ ] `src/TurboHttp/Protocol/RFC1945/` does not exist
89+
- [ ] `src/TurboHttp/Protocol/RFC6265/` does not exist
90+
- [ ] Namespace declarations updated; no other content changed
91+
92+
---
93+
94+
### TASK-047-003: Update All `using` Directives
95+
**Description:** As a developer, I want all consumer files updated to import the new
96+
namespace names so that the solution compiles without errors.
97+
98+
**Token Estimate:** ~10k tokens
99+
**Predecessors:** TASK-047-002
100+
**Successors:** TASK-047-004
101+
**Parallel:** no
102+
103+
**Acceptance Criteria:**
104+
- [ ] No `using TurboHttp.Protocol.RFC1945;` anywhere in the solution
105+
- [ ] No `using TurboHttp.Protocol.RFC6265;` anywhere in the solution
106+
- [ ] All consumer files import `TurboHttp.Protocol.Http10` or `TurboHttp.Protocol.Cookies`
107+
as appropriate
108+
- [ ] No logic changes — only `using` directive updates
109+
110+
---
111+
112+
### TASK-047-004: Build and Test Verification
113+
**Description:** Confirm the build and all tests pass after the rename.
114+
115+
**Token Estimate:** ~8k tokens
116+
**Predecessors:** TASK-047-003
117+
**Successors:** none
118+
**Parallel:** no
119+
**Model:** haiku
120+
121+
**Acceptance Criteria:**
122+
- [ ] `dotnet build ./src/TurboHttp.sln` — zero errors, zero warnings introduced
123+
- [ ] `dotnet test --project TurboHttp.Tests/TurboHttp.Tests.csproj` — green
124+
- [ ] `dotnet test --project TurboHttp.StreamTests/TurboHttp.StreamTests.csproj` — green
125+
- [ ] `dotnet test --project TurboHttp.IntegrationTests/TurboHttp.IntegrationTests.csproj` — green
126+
127+
---
128+
129+
## Task Dependency Graph
130+
131+
```
132+
TASK-047-001 ──→ TASK-047-002 ──→ TASK-047-003 ──→ TASK-047-004
133+
```
134+
135+
| Task | Estimate | Predecessors | Parallel | Model |
136+
|------|----------|--------------|----------|-------|
137+
| TASK-047-001 | ~8k | none | no | haiku |
138+
| TASK-047-002 | ~15k | 001 | no ||
139+
| TASK-047-003 | ~10k | 002 | no ||
140+
| TASK-047-004 | ~8k | 003 | no | haiku |
141+
142+
**Total estimated tokens:** ~41k
143+
144+
---
145+
146+
## Functional Requirements
147+
148+
- FR-1: `RFC1945/` and `RFC6265/` folders deleted from `Protocol/`
149+
- FR-2: `Http10/` and `Cookies/` folders exist with correct files
150+
- FR-3: No type signatures, method signatures, or logic changed
151+
- FR-4: Build zero errors, all tests green
152+
153+
## Non-Goals
154+
155+
- No test logic changes
156+
- No HTTP/1.0 or Cookie implementation changes
157+
- No changes to `RFC9112/` (HTTP/1.1) — covered by Feature 049
158+
159+
## Success Metrics
160+
161+
- `Protocol/RFC1945/` and `Protocol/RFC6265/` do not exist
162+
- CI green after merge
163+
164+
## Open Questions
165+
166+
*(none)*

0 commit comments

Comments
 (0)