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

-33
View File
@@ -1,33 +0,0 @@
info:
name: Get Scan Status
type: http
seq: 4
http:
method: GET
url: '{{base_url}}/api/scanner/status/{{job_id}}'
auth: inherit
docs: |-
## Get Scan Status
Retrieves the status and progress of an asynchronous scan job.
**Method:** GET
**Endpoint:** /api/scanner/status/:jobId
**Authentication:** Required (Bearer token, Admin only)
**URL Parameters:**
- `jobId` (string, required): The job ID returned from the scan endpoint
- Example: `550e8400-e29b-41d4-a716-446655440000`
**Response:**
```json
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"error": "",
"result": {
"message": "scan completed",
"library_id": "550e8400-e29b-41d4-a716-446655440000"
-28
View File
@@ -1,28 +0,0 @@
info:
name: Get Watch Mode Status
type: http
seq: 7
http:
method: GET
url: '{{base_url}}/api/scanner/watch/status'
auth: inherit
docs: |-
## Get Watch Mode Status
Retrieves the current status of watch mode for all libraries.
**Method:** GET
**Endpoint:** /api/scanner/watch/status
**Authentication:** Required (Bearer token, Admin only)
**Response:** HTTP 200 (OK)
```json
{
"watching_libraries": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
],
"total_watching": 2
-74
View File
@@ -1,74 +0,0 @@
info:
name: Scan Media Items (Background)
type: http
seq: 1
http:
method: POST
url: "{{base_url}}/api/scanner/scan"
headers:
- name: Content-Type
value: application/json
params:
- name: ""
value: ""
type: query
body:
type: json
data: |-
{
"library_id": "{{library_id}}",
"force": true
}
auth: inherit
runtime:
scripts:
- type: after-response
code: |-
function onResponse(res) {
try {
const responseBody = res.getBody();
const job_id = responseBody.job_id;
if (job_id) {
bru.setEnvVar("job_id", job_id, { persist: true });
console.log("Access job_id saved:", job_id);
}
if (!job_id) {
console.log("No job_ids found in response.");
}
} catch (error) {
console.error("Error in post-response script:", error.message);
}
}
onResponse(res);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Scan Media Items (Background)
Triggers an asynchronous media items scanning operation. The scan runs in the background and can be monitored using the job ID.
**Method:** POST
**Endpoint:** /api/scanner/scan
**Authentication:** Required (Bearer token, Admin only)
**Request Body:**
- `folder_paths` (array of strings, required): List of folder paths to scan
- Example: `["/path/to/media", "/another/path"]`
**Response:** HTTP 202 (Accepted)
```json
{
"message": "scan job enqueued",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending"
-32
View File
@@ -1,32 +0,0 @@
info:
name: Start Scanner
type: http
seq: 2
http:
method: POST
url: '{{base_url}}/api/scanner/start'
auth: inherit
docs: |-
## Start Scanner
Starts the media scanner service for indexing library content.
**Method:** POST
**Endpoint:** /api/scanner/start
**Authentication:** Required (Bearer token)
**Response:**
- JSON object containing scanner status
- `status` (string): Scanner state ("started", "running")
- `message` (string): Status message
- `started_at` (string): Timestamp when scanner started
**Status Codes:**
- 200: Scanner started successfully
- 401: Unauthorized
- 403: Forbidden (insufficient permissions)
- 409: Scanner already running
- 500: Internal server error
-12
View File
@@ -1,12 +0,0 @@
info:
name: Start Watch Mode
type: http
seq: 5
http:
method: POST
url: '{{base_url}}/api/scanner/watch/start'
auth: inherit
body:
type: json
data: "{\n \"library_id\": \"{{library_id"
docs: "## Start Watch Mode\n \n Starts real-time file system monitoring for a specific library. New media items will be detected and processed almost instantly.\n \n **Method:** POST\n \n **Endpoint:** /api/scanner/watch/start\n \n **Authentication:** Required (Bearer token, Admin only)\n \n **Request Body:**\n - `library_id` (string, required): UUID of the library to watch\n - Example: `\"550e8400-e29b-41d4-a716-446655440000\"`\n \n **Response:** HTTP 200 (OK)\n ```json\n {\n \"message\": \"watch mode started for library\",\n \"library_id\": \"550e8400-e29b-41d4-a716-446655440000\""
-32
View File
@@ -1,32 +0,0 @@
info:
name: Stop Scanner
type: http
seq: 3
http:
method: POST
url: '{{base_url}}/api/scanner/stop'
auth: inherit
docs: |-
## Stop Scanner
Stops the currently running media scanner service.
**Method:** POST
**Endpoint:** /api/scanner/stop
**Authentication:** Required (Bearer token)
**Response:**
- JSON object containing scanner status
- `status` (string): Scanner state ("stopped", "idle")
- `message` (string): Status message
- `stopped_at` (string): Timestamp when scanner stopped
**Status Codes:**
- 200: Scanner stopped successfully
- 401: Unauthorized
- 403: Forbidden (insufficient permissions)
- 409: Scanner not running
- 500: Internal server error
-12
View File
@@ -1,12 +0,0 @@
info:
name: Stop Watch Mode
type: http
seq: 6
http:
method: POST
url: '{{base_url}}/api/scanner/watch/stop'
auth: inherit
body:
type: json
data: "{\n \"library_id\": \"{{library_id"
docs: "## Stop Watch Mode\n \n Stops real-time file system monitoring for a specific library.\n \n **Method:** POST\n \n **Endpoint:** /api/scanner/watch/stop\n \n **Authentication:** Required (Bearer token, Admin only)\n \n **Request Body:**\n - `library_id` (string, required): UUID of the library to stop watching\n - Example: `\"550e8400-e29b-41d4-a716-446655440000\"`\n \n **Response:** HTTP 200 (OK)\n ```json\n {\n \"message\": \"watch mode stopped for library\",\n \"library_id\": \"550e8400-e29b-41d4-a716-446655440000\""
+21
View File
@@ -0,0 +1,21 @@
info:
name: Cancel Scan
type: http
seq: 1
http:
method: POST
url: '{{base_url}}/api/scanner/cancel/{{job_id}}'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Cancel Scan
`POST /api/scanner/cancel/:jobId` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/cancel_scan.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+21
View File
@@ -0,0 +1,21 @@
info:
name: Get Active Scans
type: http
seq: 2
http:
method: GET
url: '{{base_url}}/api/scanner/active'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Active Scans
`GET /api/scanner/active` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/get_active_scans.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+21
View File
@@ -0,0 +1,21 @@
info:
name: Get Scan Status
type: http
seq: 3
http:
method: GET
url: '{{base_url}}/api/scanner/status/{{job_id}}'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Scan Status
`GET /api/scanner/status/:jobId` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/get_scan_status.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+21
View File
@@ -0,0 +1,21 @@
info:
name: Get Scan Summary
type: http
seq: 4
http:
method: GET
url: '{{base_url}}/api/scanner/active-summary'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Scan Summary
`GET /api/scanner/active-summary` — auth: jwt.
Canonical reference: `docs/developer/api/scanner/get_scan_summary.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+21
View File
@@ -0,0 +1,21 @@
info:
name: Get Watch Mode Status
type: http
seq: 5
http:
method: GET
url: '{{base_url}}/api/scanner/watch/status'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Get Watch Mode Status
`GET /api/scanner/watch/status` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/get_watch_mode_status.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+28
View File
@@ -0,0 +1,28 @@
info:
name: Scan Library
type: http
seq: 6
http:
method: POST
url: '{{base_url}}/api/scanner/scan'
auth: inherit
body:
type: json
data: |-
{
"library_id": "550e8400-e29b-41d4-a716-446655440000",
"force": false
}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Scan Library
`POST /api/scanner/scan` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/scan_library.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+27
View File
@@ -0,0 +1,27 @@
info:
name: Start Scanner
type: http
seq: 7
http:
method: POST
url: '{{base_url}}/api/scanner/start'
auth: inherit
body:
type: json
data: |-
{
"folder_paths": ["/data/books"]
}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Start Scanner
`POST /api/scanner/start` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/start_scanner.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+27
View File
@@ -0,0 +1,27 @@
info:
name: Start Watch Mode
type: http
seq: 8
http:
method: POST
url: '{{base_url}}/api/scanner/watch/start'
auth: inherit
body:
type: json
data: |-
{
"library_id": "550e8400-e29b-41d4-a716-446655440000"
}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Start Watch Mode
`POST /api/scanner/watch/start` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/start_watch_mode.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+21
View File
@@ -0,0 +1,21 @@
info:
name: Stop Scanner
type: http
seq: 9
http:
method: POST
url: '{{base_url}}/api/scanner/stop'
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Stop Scanner
`POST /api/scanner/stop` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/stop_scanner.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+27
View File
@@ -0,0 +1,27 @@
info:
name: Stop Watch Mode
type: http
seq: 10
http:
method: POST
url: '{{base_url}}/api/scanner/watch/stop'
auth: inherit
body:
type: json
data: |-
{
"library_id": "550e8400-e29b-41d4-a716-446655440000"
}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# Stop Watch Mode
`POST /api/scanner/watch/stop` — auth: jwt+admin.
Canonical reference: `docs/developer/api/scanner/stop_watch_mode.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.