feat: Agentic Trading session type (engine implementation, default-disabled)#177
Open
jordanrburger wants to merge 1 commit into
Open
feat: Agentic Trading session type (engine implementation, default-disabled)#177jordanrburger wants to merge 1 commit into
jordanrburger wants to merge 1 commit into
Conversation
Adds a fourth scheduled session type — an autonomous equity-trading loop against an operator-configured Robinhood account via the robinhood-trading MCP. Real money, opt-in, not financial advice; ships OFF and no-ops until explicitly enabled. - schedule.py: SlotType.TRADING + SlotPriority.TRADING (25); dispatches via the standard 5-min tick (a type: trading slot) — no new launchd plist. - bootstrap.py: TRADING brain assembly (phases/core + phases/trading, mode:[trading]) wired into _assemble() + both stage-5 loops; run-trading.sh runner; trading.sh + trading-config.py scripts; config + ledgers seeded install-only (never overwritten). - phases/trading/trading-loop.md: 6-step loop with hard guardrails (capital cap, single-name cap, mandatory stop, daily-loss cap, circuit breaker, settled-cash-only) and a graceful degrade to PENDING-APPROVAL when a headless session can't place an order. git-setup opted into trading mode. - templates: run-trading.sh.tmpl (master-switch guard before any spend), trading.sh (on/off/status), config.yaml (enabled:false + account placeholder), watchlist/decision-log/nav-history scaffolds. - defaults/schedule.yaml: commented-out ET-pinned trading slots (opt-in). - CHANGELOG [Unreleased]; manifests left for the release-time bump. Verified: end-to-end install renders all 9 artifacts; TRADING.md assembles with no briefing leakage; ruff/format/mypy/version-sync green; shellcheck -S error clean; 882 tests pass (+1 new trading install test).
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.
What this is
The implementation of the Agentic Trading subsystem in the engine — the follow-up to the design-only PR #171. This makes Agentic Trading a real, distributable Scout feature: any install can enable it, and it's generated by
scoutctl bootstraplike every other session type.How it integrates (engine-native, not a vault copy)
The vault build used a dedicated launchd plist; the engine version instead uses the standard schedule dispatcher — a
type: tradingslot fires through the existing 5-minute tick. No new plist.schedule.pySlotType.TRADING+SlotPriority.TRADING = 25;_PRIORITY_BY_TYPEentrybootstrap.py_assemble()gains aTRADINGbrain (sourcesphases/core+phases/trading,mode: [trading]); added to both stage-5 loops;run-trading.sh→_CAT1B_RUNNERS;trading.sh→_CAT1_TEMPLATES;trading-config.py→_CAT1_FILES_FROM_PLUGIN; config + 3 ledgers →_INSTALL_ONLY_TEMPLATES(never overwritten)phases/trading/trading-loop.mdphases/core/git-setup.mdtradingmode so the brain inherits the shared git/timezone/cost conventionstemplates/run-trading.sh.tmpl(guards on the master switch before any spend),scripts/trading.sh.tmpl(on/off/status),scripts/trading-config.py,config.yaml.tmpl(enabled: false+ account placeholder), watchlist/decision-log/nav-history scaffoldsdefaults/schedule.yamltrading-market-open/trading-pre-closeslots (opt-in)CHANGELOG.md[Unreleased]entry (manifests left for the release-time bump)Two gates keep it safe
config.yaml: enabledshipsfalse;run-trading.shexits before any spend when off, and the brain re-confirms in-session.Verification
TRADING.mdassembles with the loop + git-setup conventions and no briefing-phase leakage.ruff check✓ ·ruff format --check✓ ·mypy✓ (69 files) ·versioning check✓ (4 manifests in sync) ·shellcheck -S error✓ on the templates.test_install_seeds_agentic_trading_subsystem_disabled; extended the assembled-brains test to coverTRADING).Deliberately out of scope (follow-ups)
connectors.yamlentry for Robinhood (the brain manages its own MCP availability) — avoids touching connector-health vocabulary.[Unreleased]).🤖 Generated with Claude Code