Commit 33e5f2f
refactor(debugger): exact event→line mapping + tracer-free concept view (#7)
A rigorous QA pass (per-pattern) found the source debugger's heuristic
anchoring mapped events to the wrong line across every pattern, snapped
breakpoints invisibly to unrelated lines, and leaked tracer identifiers
(t *trace.Tracer, t.Pace, a broker t field) into the "concept" view.
Re-architect so the concept and its instrumentation are genuinely separate:
- trace stays the dedicated event library; pacing moves out to a tracer-free
pace(ctx, d) helper that scales by the speed carried on the context, so
concept code has no instrumentation.
- Narration hooks are standalone statements sitting directly on the operation
they describe; registry.go drops the hook lines and the residual tracer
param/args and maps each event to the exact adjacent statement (above, or
below for a Block) — an exact, non-heuristic map. Hook-only ifs are dropped
so no dead {} remains.
- Breakpoints are settable only on real stop lines and fire exactly there —
no snapping, the dot never moves onto a brace/decl/dead line.
- cmd/genconcepts materializes the pure concept into internal/concepts/<name>/
(one compilable package per pattern) via `go generate ./...`.
- Fix mismodeling surfaced by QA: buffered blocks only when full, timeout's
result channel cap, pub-sub broker kind (mutex, not cond), critical-section
and cancel() now highlight their own line.
Verified across all 27 patterns: 0 tracer leaks, 0 breakpoints on a
brace/blank, 0 events off their stop line. Adds patterns/debug_test.go to
lock the contract.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent b72ac01 commit 33e5f2f
63 files changed
Lines changed: 2647 additions & 575 deletions
File tree
- backend
- cmd/genconcepts
- internal
- concepts
- atomic
- buffered
- close_range
- cond
- context_cancel
- context_timeout
- errgroup
- fan_out_in
- generator
- goroutine_leak
- goroutines
- graceful_shutdown
- mutex
- once
- or_done
- pipeline
- pubsub
- rate_limit
- rwmutex
- select_default
- select_
- semaphore
- tee
- ticker
- timeout
- unbuffered
- worker_pool
- patterns
- server
- trace
- frontend/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
| |||
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
154 | | - | |
155 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
| |||
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
170 | 182 | | |
171 | | - | |
172 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
173 | 189 | | |
174 | 190 | | |
175 | 191 | | |
| |||
0 commit comments