Skip to content
Merged
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
168 changes: 168 additions & 0 deletions .tmp/proof/document-delete-api.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
Local SQLite and Chroma, fixed embeddings, Slack authentication mocked and API calls blocked.
No real tokens, remote databases, model calls or paid embeddings. Distances are fixture squared L2 values.
$ curl -sS -X GET http://127.0.0.1:18055/health -w '
%{http_code}'
HTTP 200
{
"status": "healthy"
}

$ curl -sS -X POST http://127.0.0.1:18055/api/documents -H 'Content-Type: application/json' -d '{"title": "VPN guide", "content": "Reset VPN via IT portal.", "source": "api"}' -w '
%{http_code}'
HTTP 200
{
"id": 1,
"message": "Document added successfully"
}

$ curl -sS -X POST http://127.0.0.1:18055/api/documents -H 'Content-Type: application/json' -d '{"title": "VPN guide", "content": "Reset VPN via IT portal.", "source": "api"}' -w '
%{http_code}'
HTTP 200
{
"id": 2,
"message": "Document added successfully"
}

$ curl -sS -X POST http://127.0.0.1:18055/api/retrieval/preview -H 'Content-Type: application/json' -d '{"question": "How do I reset VPN?"}' -w '
%{http_code}'
HTTP 200
{
"question": "How do I reset VPN?",
"channel_id": null,
"top_k": 5,
"max_distance": null,
"items": [
{
"content": "Reset VPN via IT portal.",
"metadata": {
"chunk": 0,
"document_id": 2,
"source": "api",
"title": "VPN guide"
},
"distance": 1.0
},
{
"content": "Reset VPN via IT portal.",
"metadata": {
"chunk": 0,
"document_id": 1,
"source": "api",
"title": "VPN guide"
},
"distance": 1.0
}
]
}

Inject fixture Chroma deletion outage.
$ curl -sS -X DELETE http://127.0.0.1:18055/api/documents/1 -w '
%{http_code}'
HTTP 503
{
"detail": {
"message": "Document deletion is unavailable",
"document_id": 1
}
}

$ curl -sS -X GET http://127.0.0.1:18055/api/documents/1 -w '
%{http_code}'
HTTP 200
{
"id": 1,
"title": "VPN guide",
"content": "Reset VPN via IT portal.",
"source": "api",
"created_at": "2026-11-16T07:41:58.529092",
"updated_at": "2026-11-16T07:41:58.529098"
}

Remove fixture outage and retry the same saved ID.
$ curl -sS -X DELETE http://127.0.0.1:18055/api/documents/1 -w '
%{http_code}'
HTTP 200
{
"id": 1,
"message": "Document deleted successfully"
}

$ curl -sS -X GET http://127.0.0.1:18055/api/documents/1 -w '
%{http_code}'
HTTP 404
{
"detail": "Document not found"
}

$ curl -sS -X POST http://127.0.0.1:18055/api/documents/1/index -w '
%{http_code}'
HTTP 404
{
"detail": "Document not found"
}

$ curl -sS -X DELETE http://127.0.0.1:18055/api/documents/1 -w '
%{http_code}'
HTTP 404
{
"detail": "Document not found"
}

$ curl -sS -X GET http://127.0.0.1:18055/api/documents -w '
%{http_code}'
HTTP 200
{
"items": [
{
"id": 2,
"title": "VPN guide",
"source": "api",
"created_at": "2026-11-16T07:41:58.577149",
"content_preview": "Reset VPN via IT portal."
}
],
"total": 1,
"limit": 50,
"offset": 0
}

$ curl -sS -X POST http://127.0.0.1:18055/api/retrieval/preview -H 'Content-Type: application/json' -d '{"question": "How do I reset VPN?"}' -w '
%{http_code}'
HTTP 200
{
"question": "How do I reset VPN?",
"channel_id": null,
"top_k": 5,
"max_distance": null,
"items": [
{
"content": "Reset VPN via IT portal.",
"metadata": {
"chunk": 0,
"document_id": 2,
"source": "api",
"title": "VPN guide"
},
"distance": 1.0
}
]
}

$ curl -sS -X DELETE http://127.0.0.1:18055/api/documents/invalid -w '
%{http_code}'
HTTP 422
{
"detail": [
{
"type": "int_parsing",
"loc": [
"path",
"document_id"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "invalid"
}
]
}

All curl status, ownership, saved-record and raw-distance assertions passed.
50 changes: 50 additions & 0 deletions .tmp/proof/document-delete-backend-start.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[dev-backend] $ uv run uvicorn app.main:app --reload --host 127.0.0.1 --port 18…
/Users/johnny/.paseo/worktrees/0x03bguv/happy-whale/.tmp/offline-delete/sitecustomize.py:39: LangChainDeprecationWarning: The class `Chroma` was deprecated in LangChain 0.2.9 and will be removed in 1.0. An updated version of the class exists in the `langchain-chroma package and should be used instead. To use it run `pip install -U `langchain-chroma` and import as `from `langchain_chroma import Chroma``.
vector_store.vector_store = Chroma(
INFO: Will watch for changes in these directories: ['/Users/johnny/.paseo/worktrees/0x03bguv/happy-whale/backend']
INFO: Uvicorn running on http://127.0.0.1:18055 (Press CTRL+C to quit)
INFO: Started reloader process [87286] using WatchFiles
/Users/johnny/.paseo/worktrees/0x03bguv/happy-whale/.tmp/offline-delete/sitecustomize.py:39: LangChainDeprecationWarning: The class `Chroma` was deprecated in LangChain 0.2.9 and will be removed in 1.0. An updated version of the class exists in the `langchain-chroma package and should be used instead. To use it run `pip install -U `langchain-chroma` and import as `from `langchain_chroma import Chroma``.
vector_store.vector_store = Chroma(
/Users/johnny/.paseo/worktrees/0x03bguv/happy-whale/.tmp/offline-delete/sitecustomize.py:39: LangChainDeprecationWarning: The class `Chroma` was deprecated in LangChain 0.2.9 and will be removed in 1.0. An updated version of the class exists in the `langchain-chroma package and should be used instead. To use it run `pip install -U `langchain-chroma` and import as `from `langchain_chroma import Chroma``.
vector_store.vector_store = Chroma(
INFO: Started server process [87737]
INFO: Waiting for application startup.
{"timestamp": "2026-11-16T07:41:52.160300+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-16T07:41:52.239284+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:62699 - "GET /health HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.493973+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": "7a144586dd4f4bdf9b14585e02941495", "trace_id": "7a144586dd4f4bdf9b14585e02941495", "request_method": "GET", "request_path": "/health", "route": "/health", "status_code": 200, "duration_ms": 0.38, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62701 - "POST /api/documents HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.559223+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": "0c32a5e8891146d09f46a39bf5abb195", "trace_id": "0c32a5e8891146d09f46a39bf5abb195", "request_method": "POST", "request_path": "/api/documents", "route": "/api/documents", "status_code": 200, "duration_ms": 37.63, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62702 - "POST /api/documents HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.581342+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": "cd41ac9830af49e8b82be15c8c8d4af8", "trace_id": "cd41ac9830af49e8b82be15c8c8d4af8", "request_method": "POST", "request_path": "/api/documents", "route": "/api/documents", "status_code": 200, "duration_ms": 4.82, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
{"timestamp": "2026-11-16T07:41:58.601498+00:00", "level": "WARNING", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "chromadb.segment.impl.vector.local_persistent_hnsw", "message": "Number of requested results 5 is greater than number of elements in index 2, updating n_results = 2", "event_type": "log", "request_id": "bfb92b5aa41f4174a40a7ad9a2b0fd0c", "trace_id": "bfb92b5aa41f4174a40a7ad9a2b0fd0c"}
INFO: 127.0.0.1:62703 - "POST /api/retrieval/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.602815+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": "bfb92b5aa41f4174a40a7ad9a2b0fd0c", "trace_id": "bfb92b5aa41f4174a40a7ad9a2b0fd0c", "request_method": "POST", "request_path": "/api/retrieval/preview", "route": "/api/retrieval/preview", "status_code": 200, "duration_ms": 2.32, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
{"timestamp": "2026-11-16T07:41:58.634815+00:00", "level": "ERROR", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "app.main", "message": "Deleting saved document 1 failed", "event_type": "log", "request_id": "b0ad8b4da6614333b4bfd99593b0a3f7", "trace_id": "b0ad8b4da6614333b4bfd99593b0a3f7", "error_class": "RuntimeError", "error_message": "Fixture Chroma deletion outage", "error_stack_hash": "973fea20d9548f56"}
INFO: 127.0.0.1:62704 - "DELETE /api/documents/1 HTTP/1.1" 503 Service Unavailable
{"timestamp": "2026-11-16T07:41:58.636470+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": "b0ad8b4da6614333b4bfd99593b0a3f7", "trace_id": "b0ad8b4da6614333b4bfd99593b0a3f7", "request_method": "DELETE", "request_path": "/api/documents/1", "route": "/api/documents/1", "status_code": 503, "duration_ms": 6.17, "error_class": null, "error_message": null, "sample_reason": "ERROR"}
INFO: 127.0.0.1:62705 - "GET /api/documents/1 HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.655289+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": "a5861f85e1fe4e88839082ac547b3030", "trace_id": "a5861f85e1fe4e88839082ac547b3030", "request_method": "GET", "request_path": "/api/documents/1", "route": "/api/documents/1", "status_code": 200, "duration_ms": 1.4, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62706 - "DELETE /api/documents/1 HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.674830+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": "b35ccada3c1048ddaf8779e3365b0b68", "trace_id": "b35ccada3c1048ddaf8779e3365b0b68", "request_method": "DELETE", "request_path": "/api/documents/1", "route": "/api/documents/1", "status_code": 200, "duration_ms": 5.49, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62708 - "GET /api/documents/1 HTTP/1.1" 404 Not Found
{"timestamp": "2026-11-16T07:41:58.692042+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": "b33891bb22db4a31a5912b4fcb7ab52e", "trace_id": "b33891bb22db4a31a5912b4fcb7ab52e", "request_method": "GET", "request_path": "/api/documents/1", "route": "/api/documents/1", "status_code": 404, "duration_ms": 1.15, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62709 - "POST /api/documents/1/index HTTP/1.1" 404 Not Found
{"timestamp": "2026-11-16T07:41:58.710124+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": "b0cd35c3dfc34f379a245c5f06590b14", "trace_id": "b0cd35c3dfc34f379a245c5f06590b14", "request_method": "POST", "request_path": "/api/documents/1/index", "route": "/api/documents/1/index", "status_code": 404, "duration_ms": 1.17, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62710 - "DELETE /api/documents/1 HTTP/1.1" 404 Not Found
{"timestamp": "2026-11-16T07:41:58.729168+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": "1ff5261a18d5454d9b6273ec15a34854", "trace_id": "1ff5261a18d5454d9b6273ec15a34854", "request_method": "DELETE", "request_path": "/api/documents/1", "route": "/api/documents/1", "status_code": 404, "duration_ms": 1.14, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62711 - "GET /api/documents HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.745716+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": "090cbe7790714dd0b32d2a561314b97f", "trace_id": "090cbe7790714dd0b32d2a561314b97f", "request_method": "GET", "request_path": "/api/documents", "route": "/api/documents", "status_code": 200, "duration_ms": 3.25, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
{"timestamp": "2026-11-16T07:41:58.760629+00:00", "level": "WARNING", "service_name": "wingman-backend", "environment": "development", "service_version": "0.1.0", "logger": "chromadb.segment.impl.vector.local_persistent_hnsw", "message": "Number of requested results 5 is greater than number of elements in index 1, updating n_results = 1", "event_type": "log", "request_id": "c9ba233af74043d3b1367762dc607a62", "trace_id": "c9ba233af74043d3b1367762dc607a62"}
INFO: 127.0.0.1:62712 - "POST /api/retrieval/preview HTTP/1.1" 200 OK
{"timestamp": "2026-11-16T07:41:58.761697+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": "c9ba233af74043d3b1367762dc607a62", "trace_id": "c9ba233af74043d3b1367762dc607a62", "request_method": "POST", "request_path": "/api/retrieval/preview", "route": "/api/retrieval/preview", "status_code": 200, "duration_ms": 2.13, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: 127.0.0.1:62713 - "DELETE /api/documents/invalid HTTP/1.1" 422 Unprocessable Content
{"timestamp": "2026-11-16T07:41:58.791505+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": "29e0eeb1b8424ce08e7559ed3474c0df", "trace_id": "29e0eeb1b8424ce08e7559ed3474c0df", "request_method": "DELETE", "request_path": "/api/documents/invalid", "route": "/api/documents/invalid", "status_code": 422, "duration_ms": 0.6, "error_class": null, "error_message": null, "sample_reason": "RANDOM"}
INFO: Shutting down
INFO: Waiting for application shutdown.
{"timestamp": "2026-11-16T07:42:10.218428+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 [87737]
INFO: Stopping reloader process [87286]
Loading
Loading