fix: resolve 15 code review findings (5 critical, 10 warnings)#12
Merged
Conversation
Wave 1 (supplement/create): - README.md: added FastAPI app section (endpoints + curl examples) - docs/architecture.md: added Configuration, Logging, Embedding cache, Resilience, and Entry points sections - docs/CONFIGURATION.md: all 20 Settings fields documented by subsystem Wave 2 (create): - docs/GETTING-STARTED.md: prerequisites, install, configure, first run - docs/DEVELOPMENT.md: dev env, code style, project layout, extension guides - docs/TESTING.md: pytest setup, singleton reset fixture, fakeredis patterns - docs/DEPLOYMENT.md: Docker Compose stack, three runtimes, persistence options - docs/API.md: REST endpoints + MCP tool schemas derived from source Fixes applied after codebase verification (7 claims corrected): - thesis corpus ingest → thesis corpus (README + examples.md) - ColourConsoleRenderer → ConsoleRenderer (architecture.md) - EMBEDDING_CACHE_DIR default "" with effective-path note (CONFIGURATION.md) - ../DEVELOPMENT.md link → DEVELOPMENT.md (GETTING-STARTED.md) - session-scoped → function-scoped fixture (TESTING.md) - 404 error strings add "Task " prefix (API.md) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e dead try/except
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves E402 — module level import not at top of file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rag.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 9, 2026
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.
Summary
Deep code review (
/gsd-code-review --depth=deep) across 22 source files surfaced 19 findings. This PR resolves all 5 critical blockers and all 10 warnings. 123 tests pass.Critical Fixes (5)
"memory_guidance"toBlackboard.allowed_types; was raisingValueErrorsilently on every run, agents never received memory contextblackboardfromself.blackboardto a local variable in_execute_inner, eliminating cross-session data contamination under concurrent requestsDELETE /tasks/{task_id}now cancels the in-flightasyncio.Task; previously the background coroutine continued writing to a deleted dict key causingKeyErrorRedisSessionStoremigrated from synchronousredistoredis.asyncio; was blocking the event loop on every Redis round-triptimeout=120kwarg from OpenAI client call;asyncio.wait_foralready handles the timeout, double-wrapping caused connection leaks and misattributed errorsWarning Fixes (10)
_add_entrynow logs a warning on exception instead of silently swallowing errorsembedding_cache.pynow readsEMBEDDING_CACHE_DIRviaget_settings()instead ofos.environdirectly; addedreset_embedding_cache()to test fixtureredis.keys()(O(N) blocking scan) withredis.scan_iter()inBlackboard_estimate_costnow includes input token cost; was systematically under-reporting spend and could allow budget overrunsif route.activate_synthesizer:guard insideif budget_tight:branch_tasksdict capped at 1000 entries with LRU eviction viaOrderedDict; was growing unboundeddatetime.utcnow()withdatetime.now(timezone.utc)across 5 locations_is_sentence_terminatorfunction intools/mcp/rag.pyprint(..., file=sys.stderr)with structuredlogger.error(..., exc_info=True)in corpus ingestVerification
pytest tests/ -x -q)Files Changed
apps/api/main.py·core/blackboard/engine.py·core/corpus/ingest.py·core/embedding_cache.py·core/orchestrator/thesis_flow.py·core/router/engine.py·core/sessions/store.py·providers/adapters.py·providers/unified.py·tests/conftest.py·tools/mcp/rag.py🤖 Generated with Claude Code