Wire outcomes + decisions/journal + session hooks for cortex-dbx MCP#2
Open
jessekemp1 wants to merge 5 commits into
Open
Wire outcomes + decisions/journal + session hooks for cortex-dbx MCP#2jessekemp1 wants to merge 5 commits into
jessekemp1 wants to merge 5 commits into
Conversation
Outcomes endpoints (/v2/outcomes, /v2/outcomes/stats) were returning 501 because cortex.v2.learning.outcomes.OutcomeDetector never existed. Rewired to read directly from ~/.cortex/model_outcomes.jsonl — same backing store the intelligence layer already uses. Added Claude Code session lifecycle hooks: - session_briefing.sh (SessionStart): surfaces recommendations + plan progress - session_debrief.sh (Stop): prompts agent to record decisions before exit
The existing /decisions/record endpoint expects Co-Navigator UI fields (prediction_id, scenario_chosen, etc.). Added /decisions/journal that accepts the MCP tool's schema (decision, context, alternatives, rationale) and writes to the same decisions.jsonl file.
Maps the 18 cortex MCP tools against cortex-dbx: 4 broken, 3 missing, 3 degraded. Root cause is the FastAPI bridge proxy layer that cortex-dbx avoids via direct function calls. Per-tool fix specs.
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
d1973e8) —/v2/outcomesand/v2/outcomes/statswere returning 501 becausecortex.v2.learning.outcomes.OutcomeDetectornever existed. Rewired both to read directly from~/.cortex/model_outcomes.jsonl, the same backing store the intelligence layer already uses.4270850) — added/decisions/journalthat accepts the MCP tool's schema (decision,context,alternatives,rationale) and writes to~/.cortex/decisions.jsonl. The existing/decisions/recordexpects Co-Navigator UI fields and was the wrong shape for MCP callers.d1973e8,b512973) —hooks/session_briefing.sh(SessionStart) surfaces recommendations + plan progress;hooks/session_debrief.sh(Stop) prompts the agent to record decisions before exit. Latest update aligns with the cortex-dbx MCP integration shape.2975733,806839b) —CORTEX_FIXES_SPEC.mdmaps the 18 cortex MCP tools against cortex-dbx: 4 broken, 3 missing, 3 degraded. Root cause: the FastAPI bridge proxy layer that cortex-dbx avoids via direct function calls.Test plan
curl localhost:8765/v2/outcomesreturns 200 with entries from~/.cortex/model_outcomes.jsonlcurl localhost:8765/v2/outcomes/statsreturns 200 with aggregate counts/decisions/journalwith{decision, context, alternatives, rationale}appends a row to~/.cortex/decisions.jsonlThis pull request and its description were written by Isaac.