bruno: regenerate collection from canonical docs + permanent docs↔Bruno parity gate

WO4. The old collection was the drifted artifact AGENTS.md warned about:
bodies pre-truncated at their first {{var}}, routes renamed server-side
but not here (/api/notes/:media_id, /api/book-matching/search,
/api/collections/:id/rules/test), an orphan universal-progress suite for
routes that no longer exist.

scripts/gen_bruno_from_docs.py emits one OpenCollection request per
frontmatter'd endpoint doc (191 requests): gate-verified example-request
JSON as body, {{env}} params per the environment file, device-token
routes get an explicit Bearer {{device_token}} header, login/register/
refresh keep the token-capture after-response scripts that chain the
collection. Old 1:1 mirrors deleted (128); hand-authored NewDevDBSetup,
environments, and edge-case suites kept. 30 scenario files with
truncated bodies (the documented corruption) deleted — they could not
run.

internal/docs/drift_test.go gains TestBrunoMirrorsDocs: every
frontmatter'd doc must have a Bruno request with matching method+URL
shape — the collection can never silently drift from the docs again.
opencollection.yml README block replaced with the real run instructions.

make test green (9 pkgs, parity test included in internal/docs).
This commit is contained in:
John O'Keefe committed 2026-10-24 18:35:51 -04:00
1 parent 6fc501b35a
commit acd82fff0a
353 files changed
+5165 -5293

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
info:
name: Get Library
type: http
seq: 1
http:
method: GET
url: '{{base_url}}/api/sync/koreader/library'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Library
`GET /api/sync/koreader/library` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/get_library.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: Get Metadata
type: http
seq: 2
http:
method: GET
url: '{{base_url}}/api/sync/koreader/metadata/{{book_uuid}}'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Metadata
`GET /api/sync/koreader/metadata/:uuid` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/get_metadata.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: Get KOReader Rating
type: http
seq: 3
http:
method: GET
url: '{{base_url}}/api/sync/koreader/rating'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get KOReader Rating
`GET /api/sync/koreader/rating` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/get_rating.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: Get KOReader Review
type: http
seq: 4
http:
method: GET
url: '{{base_url}}/api/sync/koreader/review'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get KOReader Review
`GET /api/sync/koreader/review` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/get_review.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+30
View File
@@ -0,0 +1,30 @@
info:
name: Push KOReader Stats
type: http
seq: 5
http:
method: POST
url: '{{base_url}}/api/sync/koreader/stats'
auth: inherit
body:
type: json
data: |-
{
"total_seconds": 3600
}
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Push KOReader Stats
`POST /api/sync/koreader/stats` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/push_stats.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: Resolve Book:<|end|><|start|> assistant to=edit<|channel|>analysis <|constrain|>xml<|message|><rfl:parameter name="path">
type: http
seq: 6
http:
method: GET
url: '{{base_url}}/api/sync/koreader/resolve'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Resolve Book:<|end|><|start|> assistant to=edit<|channel|>analysis <|constrain|>xml<|message|><rfl:parameter name="path">
`GET /api/sync/koreader/resolve` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/resolve_book.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+30
View File
@@ -0,0 +1,30 @@
info:
name: Set KOReader Rating
type: http
seq: 7
http:
method: POST
url: '{{base_url}}/api/sync/koreader/rating'
auth: inherit
body:
type: json
data: |-
{
"rating": 8
}
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Set KOReader Rating
`POST /api/sync/koreader/rating` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/set_rating.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+30
View File
@@ -0,0 +1,30 @@
info:
name: Set KOReader Review
type: http
seq: 8
http:
method: POST
url: '{{base_url}}/api/sync/koreader/review'
auth: inherit
body:
type: json
data: |-
{
"review": "A slow start, but the second act earns it."
}
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Set KOReader Review
`POST /api/sync/koreader/review` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/set_review.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+53
View File
@@ -0,0 +1,53 @@
info:
name: Sync Bookmarks
type: http
seq: 9
http:
method: POST
url: '{{base_url}}/api/sync/koreader/bookmarks'
auth: inherit
body:
type: json
data: |-
{
"book_sha256": "64-hex-char-sha256",
"bookmarks": [
{
"chapter": 3,
"datetime": "2026-08-20T10:00:00Z",
"pos0": "/body/Doc[4]/Sec[2]",
"page": 25,
"text": "",
"type": "bookmark",
"percentage": 0.125
}
],
"highlights": [
{
"datetime": "2026-08-20T10:05:00Z",
"pos0": "/body/Doc[4]/Sec[2]/text()[3]:0",
"pos1": "/body/Doc[4]/Sec[2]/text()[3]:42",
"text": "Text to remember",
"notes": "Why this matters",
"type": "highlight",
"color": "blue",
"dedup_key": "echo-key-from-server"
}
]
}
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Sync Bookmarks
`POST /api/sync/koreader/bookmarks` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/sync_bookmarks.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+47
View File
@@ -0,0 +1,47 @@
info:
name: Sync Progress
type: http
seq: 10
http:
method: POST
url: '{{base_url}}/api/sync/koreader/progress'
auth: inherit
body:
type: json
data: |-
{
"books": [
{
"uuid": "774641f9-317b-4087-8e04-53bb4392ae56",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"title": "1984",
"authors": ["George Orwell"],
"percentage": 0.045,
"context_text": "from day to day, but there was none in which Goldstein was not the principal figure. He was the prim",
"page": 14,
"total_pages": 311,
"epubcfi": "/body/DocFragment[1]/body/p[29]/text().598",
"device_info": {
"koreader_version": "v2026.07.1",
"device_model": "emulator"
}
}
],
"sync_mode": "immediate"
}
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Sync Progress
`POST /api/sync/koreader/progress` — auth: device-token.
Canonical reference: `docs/developer/api/koreader/sync_progress.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.