Repository navigation
Audit 2026-10-17: SDK instrumentor TypeError, SQLite foreign keys, health 503, docs behind key, metadata redaction - #62
Merged
Conversation
- SDK Python: the instrumentors assigned a bound method as a class attribute, so every instrumented create() failed with TypeError (missing self); plain wrappers now, idempotent across instrument() calls. - Backend: SQLite connections enable foreign_keys, busy_timeout and WAL; DELETE /v1/traces removes the evaluations (they were orphaned); /health answers 503 when the database fails; /docs, /redoc and /openapi.json close when OBSERVATORY_API_KEY is set; metadata capture mode redacts the free-form metadata dict instead of storing it whole; timeline buckets over 60 minutes no longer collapse to hourly; shutdown waits for the background loops before disposing the engine. - CLI: serve binds to 127.0.0.1 by default. nginx: proxy_read_timeout for /ws/. .dockerignore files so images never carry .venv or observatory.db. CI targets main only. .env.example lists the variables the code reads; roadmap gains the Later section it referred to. Full report: manitos/docs/auditoria_sistema_2026_10_17.md
…ORY_DB; status shows why it fails (timeout, HTTP status, db) and exits non-zero
main already contains this branch's changes (squashed into #64). Resolved with main's version: the conflicts in .env.example and backend/app/api/traces.py, and the instrumentors, where the automatic merge re-added the local _unwrap/_as_method that main moved to _patching.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Findings of the read-only audit of the three repos on 2026-10-17 (full report in
manitos/docs/auditoria_sistema_2026_10_17.md). Only the safe fixes, each with a regression test:instrument(openai=True)/anthropic=Trueassigned a bound method as a class attribute, so every instrumentedcreate()raisedTypeError: missing 1 required positional argument: 'self'. Plain wrappers bind the instance;instrument()twice stays reversible.foreign_keys,busy_timeoutand WAL;DELETE /v1/traces/{id}andbatch-deleteremove the evaluations (orphans counted in/summary);/healthanswers 503degradedwhenSELECT 1fails;/docs,/redoc,/openapi.jsonclose whenOBSERVATORY_API_KEYis set;metadatacapture mode redacts the free-formmetadatadict (it was stored whole);timelinebuckets over 60 min no longer collapse to hourly (epoch-based); lifespan waits for the background loops beforeengine.dispose().servebinds to127.0.0.1by default (docs/security.md said loopback)..dockerignore(images carriedbackend/.venvandobservatory.db), nginxproxy_read_timeoutfor/ws/, CI targetsmainonly (the other branch no longer exists),.env.examplelists the variables the code reads (RATE_LIMIT_BATCHaligned to 120/minute), roadmap gains the "Later" section it referred to.Not changed (decisions for the owner, listed in the report):
OBSERVATORY_API_KEYis unset in the live unit (auth off end to end);/ws/livekey in the query string;/v1/traces/batchappends spans to an existing trace of any project; import accepts anyproject_id/actor_id_hash; the LLM judge activates on a bareOPENAI_API_KEY; the SDK tracer snapshots spans at start (no duration/tokens reach the backend); the TS auto-instrumentation is a no-op; systemd unit never runsalembic upgrade.Verified:
ruff checkclean, backend 236 passed, SDK Python 48 passed, CLI 63 passed, dashboardtscclean.