Skip to content

feat: add 'franklin predict' prediction mode#82

Merged
VickyXAI merged 2 commits into
mainfrom
feat/prediction-mode
Jul 13, 2026
Merged

feat: add 'franklin predict' prediction mode#82
VickyXAI merged 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.)
VickyXAI pushed a commit that referenced this pull request Jul 13, 2026
…accounting

Review follow-up to #82:
- frameUntrusted on PredictionMarket, DefiLlama, and trading list outputs
  so third-party market text can't act as model instructions (prompt-injection
  surface named by the prediction command's read-then-decide flow).
- predict --json now accumulates token usage across research turns instead of
  reporting only the final turn.
@VickyXAI VickyXAI merged commit f20aa2f into main Jul 13, 2026
2 checks passed
VickyXAI pushed a commit that referenced this pull request Jul 13, 2026
…-model tool calls

Lands the open PR queue (#82, #99, #98, #101), each reviewed and hardened
against Franklin's spend-accounting and untrusted-input invariants:
- franklin predict headless prediction mode (#82)
- /market command + agent_talent marketplace tool (#99, rebase of #83)
- broadened free-model tool-call recovery + llama aliases (#101)
- Renovate org preset (#98)

Review hardening: frameUntrusted on all external market/marketplace output;
402 amount bounded before signing ($5/hire backstop + catalog-price cap);
/market run records spend; bare tool-call envelope requires a registered tool
name; predict --json accumulates usage across turns.

Verified: 554/554 local, tsc clean.
@VickyXAI VickyXAI deleted the feat/prediction-mode branch July 13, 2026 03:30
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.

2 participants