Commit aa6982e
authored
Add captcha task-start and challenge-result events (#332)
## Summary
- add task-level `captcha_solve_started` and challenge-level
`captcha_challenge_result` telemetry
- distinguish challenge outcomes as `solved`, `failure`, `timeout`, or
`abandoned`
- require `data` on both new events and `duration_ms` on challenge
results
- preserve the existing generated captcha type and solve-result status
symbols for downstream Go consumers
## Contract
`captcha_solve_started` records that a solver accepted one task.
`task_id` pairs that start with its terminal `captcha_solve_result`,
while `challenge_id` groups every task from one visible challenge.
Delivery remains best-effort and unordered, so event arrival or absence
does not indicate current solve state.
`captcha_challenge_result` is emitted once for the visible challenge.
`failure` means the producer reached an explicit terminal solver failure
or exhausted its attempts while the challenge remained. `timeout` is
reserved for an actual challenge-level wait budget. `abandoned` covers
observation ending without either a solved signal or an explicit
terminal solver outcome.
The shared captcha taxonomy keeps the legacy generated
`BrowserCaptchaSolveResultEventDataCaptchaType` name and constants
through a schema alias. Existing relay code therefore compiles unchanged
when it updates this module.
## Rollout
Schema and generated image API types only; no producer behavior changes
here. The public API schema and extension producer are updated in their
corresponding PRs before consumers rely on the new challenge event.
## Testing
- `go test ./lib/oapi ./lib/events/...` — pass, including
generated-symbol and required-field compatibility coverage
- `go build ./...` — pass
- `go vet ./...` — pass
- OpenAPI generation run twice — byte-identical generated output
- `go test ./lib/capmonsterrelay` on `kernel/kernel#3432` with this
module replacement — pass without relay changes
- GitHub `test-server-e2e` — all cases except
`TestReplayRecordingIncludesAudioTrack`; that unrelated test failed
twice because the generated audio track ended 0.38s / 1.29s before its
recording-duration threshold. The base branch has a green full e2e run
on the same base commit.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit 1183b8d. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 4cfb000 commit aa6982e
5 files changed
Lines changed: 1064 additions & 585 deletions
File tree
- server
- lib
- events
- oapi
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
24 | 34 | | |
25 | 35 | | |
26 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments