Skip to content

feat: add 'franklin predict' prediction mode#82

Open
KillerQueen-Z wants to merge 2 commits into
mainfrom
feat/prediction-mode
Open

feat: add 'franklin predict' prediction mode#82
KillerQueen-Z wants to merge 2 commits into
mainfrom
feat/prediction-mode

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Collaborator

What

Adds a headless prediction mode to Franklin:

  • predictionCapabilities (src/tools/index.ts) — a tight, research-only capability profile: web search, webfetch, Exa search/answer/read, search X, prediction markets, and a little market data. Excludes filesystem, shell, media generation, swaps/trade execution, phone/voice and the GPU sandbox — a forecaster looks things up, it doesn't act on the world.
  • franklin predict (src/commands/predict.ts) — a non-interactive command. franklin predict --model M --question Q --json runs one model as a disciplined bettor (research the question, read live odds, commit to a pick) and prints a single JSON envelope: { finalText, trace, turnReason, usage }.

Why

Lets non-interactive callers drive grounded, tool-using predictions over the CLI. First consumer is franklin.bet (github.com/BlockRunAI/franklin-bet), which fans a question out across the model council and renders the consensus + each model's research trail.

Notes

  • Additive only — new command + new exported profile + registration. No existing behaviour changed.
  • Not yet published to npm; this is for review. Once merged + released, npm i -g @blockrun/franklin gives downstreams franklin predict.
  • The contract with downstreams is the --json envelope shape, not raw stdout.

A headless command + restricted capability profile for forecasting one
real-world event. predictionCapabilities exposes only research tools
(web search, webfetch, Exa, search X, prediction markets, market data) —
no filesystem, shell, media, swaps, phone or sandbox. 'franklin predict
--model M --question Q --json' runs the agent and prints a JSON envelope
(finalText + tool trace + usage), so non-interactive callers (e.g.
franklin.bet) can drive grounded, tool-using predictions over the CLI.
Some models never stop calling tools and hit maxTurns with an EMPTY answer
(wasting the spend). Adds opt-in agent governance, used by prediction mode:

- forceAnswerOnFinalTurn / maxToolCalls: withhold tools once the tool budget
  (or final turn) is reached, so the model must commit to a text answer.
- disableModelFallback: don't silently switch to a different model on empty/
  stalled output — a one-shot caller wants a clean abstain from the asked model.
- disableGroundingRetry: skip the 'ungrounded claims → force tool use' retry,
  which fought the forced answer and polluted structured output.

predict defaults: maxTurns 8, maxToolCalls 6 (tool budget is the real limiter;
turns are slack for a thinking turn + the forced-answer turn). Verified: GPT-5.5
and DeepSeek V4 Pro, which previously returned empty at maxTurns, now answer
cleanly. (MiniMax M3 / Kimi K2.6 still fail — upstream OpenRouter function-call
defects, not addressed here.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant