Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .tmp/proof/rule-preview-api.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
Offline operator-rule preview with rule-preview-config.json.
Slack API, Socket Mode, retrieval and Pi calls raise in the proof process.
No chunks or distances apply: this endpoint only inspects loaded rules.

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/health
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 20
content-type: application/json
{
"status": "healthy"
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": " How do I RESET VPN access?\n"}'
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 223
content-type: application/json
{
"question": "How do I RESET VPN access?",
"match": {
"rule_id": "vpn-reset",
"match_type": "contains",
"matched_keyword": "reset vpn",
"priority": 10,
"response": "Use the IT portal at https://it.example.com/vpn to reset VPN access."
}
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": "OFFICE HOURS"}'
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 194
content-type: application/json
{
"question": "OFFICE HOURS",
"match": {
"rule_id": "office-hours",
"match_type": "exact",
"matched_keyword": "office hours",
"priority": 0,
"response": "The support desk runs 9am to 5pm, Monday to Friday."
}
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": "Where is TICKET #4821?"}'
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 189
content-type: application/json
{
"question": "Where is TICKET #4821?",
"match": {
"rule_id": "ticket",
"match_type": "regex",
"matched_keyword": "ticket #?\\d+",
"priority": 0,
"response": "Look up the ticket in the support portal."
}
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": "How do I reset email?"}'
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 49
content-type: application/json
{
"question": "How do I reset email?",
"match": null
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": " \n\t "}'
HTTP/1.1 422 Unprocessable Content
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 154
content-type: application/json
{
"detail": [
{
"type": "string_too_short",
"loc": [
"body",
"question"
],
"msg": "String should have at least 1 character",
"input": " \n\t ",
"ctx": {
"min_length": 1
}
}
]
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/rules/preview -H 'Content-Type: application/json' -d '{"question": 123}'
HTTP/1.1 422 Unprocessable Content
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 112
content-type: application/json
{
"detail": [
{
"type": "string_type",
"loc": [
"body",
"question"
],
"msg": "Input should be a valid string",
"input": 123
}
]
}

$ curl --silent --show-error --include --max-time 10 http://127.0.0.1:18059/api/ask -H 'Content-Type: application/json' -d '{"question": "How do I RESET VPN access?"}'
HTTP/1.1 200 OK
date: Mon, 16 Nov 2026 14:21:48 GMT
server: uvicorn
content-length: 162
content-type: application/json
{
"answer": "Use the IT portal at https://it.example.com/vpn to reset VPN access.",
"sources": [
{
"source": "operator_rule",
"rule_id": "vpn-reset"
}
],
"confidence": "high"
}

All response assertions passed. Preview and API answer select the same rule.
32 changes: 32 additions & 0 deletions .tmp/proof/rule-preview-backend-start.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[dev-backend] $ uv run uvicorn app.main:app --reload --host 127.0.0.1 --port 18…
INFO: Will watch for changes in these directories: ['/Users/johnny/.paseo/worktrees/0x03bguv/tasty-hedgehog/backend']
INFO: Uvicorn running on http://127.0.0.1:18059 (Press CTRL+C to quit)
INFO: Started reloader process [34598] using WatchFiles
INFO: Started server process [34657]
INFO: Waiting for application startup.
{"timestamp": "2026-11-16T14:21:28.106608+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "app.main", "message": "Starting Wingman backend...", "event_type": "log", "request_id": null, "trace_id": null}
{"timestamp": "2026-11-16T14:21:28.114661+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "app.main", "message": "Database initialized", "event_type": "log", "request_id": null, "trace_id": null}
INFO: Application startup complete.
INFO: 127.0.0.1:54831 - "GET /health HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.535859+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "b3b5cdccd1e942a58bf4af8cd7d77b9e", "trace_id": "b3b5cdccd1e942a58bf4af8cd7d77b9e", "request_method": "GET", "request_path": "/health", "route": "/health", "status_code": 200, "duration_ms": 0.53, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54832 - "POST /api/rules/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.560690+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "d8893f36a4c34f3ab1fee3c749d809e6", "trace_id": "d8893f36a4c34f3ab1fee3c749d809e6", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 200, "duration_ms": 9.41, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54834 - "POST /api/rules/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.577942+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "9c494068ece84b64aee19c973fbb441d", "trace_id": "9c494068ece84b64aee19c973fbb441d", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 200, "duration_ms": 0.72, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54835 - "POST /api/rules/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.592262+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "2766ec1b0f744df4a43bfbc08b97b818", "trace_id": "2766ec1b0f744df4a43bfbc08b97b818", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 200, "duration_ms": 0.72, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54836 - "POST /api/rules/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.606412+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "a9d41ea7e6b141cab377ab767b5dc139", "trace_id": "a9d41ea7e6b141cab377ab767b5dc139", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 200, "duration_ms": 0.61, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54837 - "POST /api/rules/preview HTTP/1.1" 422 Unprocessable Content
{"timestamp": "2026-11-16T14:21:48.620734+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "7baf10d4255c45ecafdcc5c8fd136bf0", "trace_id": "7baf10d4255c45ecafdcc5c8fd136bf0", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 422, "duration_ms": 0.33, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:54838 - "POST /api/rules/preview HTTP/1.1" 422 Unprocessable Content
{"timestamp": "2026-11-16T14:21:48.634238+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "ad6871e0d2554cb795de6e699bca3094", "trace_id": "ad6871e0d2554cb795de6e699bca3094", "request_method": "POST", "request_path": "/api/rules/preview", "route": "/api/rules/preview", "status_code": 422, "duration_ms": 0.29, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
{"timestamp": "2026-11-16T14:21:48.648333+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "app.rag", "message": "Operator rule vpn-reset answered a question", "event_type": "log", "request_id": "3be154cb62d04c1fa94a7a655b422087", "trace_id": "3be154cb62d04c1fa94a7a655b422087"}
INFO: 127.0.0.1:54839 - "POST /api/ask HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T14:21:48.648640+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "wingman.wide_event", "message": "http_request", "event_type": "http_request", "request_id": "3be154cb62d04c1fa94a7a655b422087", "trace_id": "3be154cb62d04c1fa94a7a655b422087", "request_method": "POST", "request_path": "/api/ask", "route": "/api/ask", "status_code": 200, "duration_ms": 0.69, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: Shutting down
INFO: Waiting for application shutdown.
{"timestamp": "2026-11-16T14:21:54.451885+00:00", "level": "INFO", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "app.main", "message": "Shutting down Wingman backend...", "event_type": "log", "request_id": null, "trace_id": null}
INFO: Application shutdown complete.
INFO: Finished server process [34657]
INFO: Stopping reloader process [34598]
Loading
Loading