Finance City Foundation Plan¶
STATUS=INTERIM_ONLY
PLAN_AUTHORITY=INTERIM
CANONICAL_WORK_AUTHORITY=BEADS
BEAD_AUTHORITY=BLOCKED
CAUSE=bc-uld / native_store_unavailable
THIS FILE IS NOT THE EXECUTION QUEUE.
THIS FILE DOES NOT AUTHORIZE IMPLEMENTATION.
ALL FC-* ITEMS MUST BE MATERIALIZED INTO CANONICAL BEADS.
1. Operating State & Governance Envelope¶
STATUS=DEGRADED_PLANNING
GATE_ZERO=bc-uld
FACTORY_DURABILITY=DEGRADED
BEAD_WRITE_AUTHORITY=UNAVAILABLE
IMPLEMENTATION_CLAIMING=BLOCKED
PLANNING_AND_RESEARCH=ALLOWED
NEXT_MATERIALIZATION=MATERIALIZE_MINIMUM_EXECUTABLE_GRAPH
FINANCE_PLAN=INTERIM
CANONICAL_BEADS_CREATED=NO
GAS_CITY_MULTI_CITY_SUPPORT=VERIFIED
FINANCE_CITY_RUNTIME_ISOLATION=NOT_YET_PROVEN
NAS_BASELINE=MEASURED
RESOURCE_BUDGET=PROVISIONAL
FINANCE_CITY_ACTUAL_FOOTPRINT=NOT_ESTABLISHED
BROKER_LEADING_CANDIDATE=ALPACA
BROKER_SELECTED=NOT_ESTABLISHED
FOUNDATION_ARCHITECTURE=PROPOSED
ROLE_OWNERSHIP=CORRECTED_TO_SEPARATION_OF_DUTIES
FOUNDATION_INSTALLATION_BLOCKERS=bc-uld, DSM_shared_folder
BROKER_INTEGRATION_TEST_BLOCKERS=broker_account
LIVE_EXECUTION_BLOCKERS=Stage_2_acceptance, KYC, explicit_operator_authorization, funding
LIVE_CAPITAL=OUT_OF_SCOPE
ACCEPT_EDITS_POSTURE=DISABLED_IN_DEGRADED_MODE
SOURCE_IMPLEMENTATION_CHANGES=0
PRODUCTION_MUTATIONS=0
FINANCIAL_ACTIONS=0
Governing Rule of Degradation¶
A durability failure changes what the Factory is authorized to mutate. It narrows implementation authority to zero until canonical Bead write authority is restored. It does not stop research, architecture, measurement, dependency design, or preparation. Work remains reconstructable from durable records without relying on transient human memory or ephemeral agent chat sessions.
2. Gas City Multi-City Architecture Verification¶
All findings are classified against live runtime inspection of Gas City v1.4.2 on Oracle and macOS hosts, and upstream official documentation (https://docs.gascity.com/):
| Property | Value | Upstream Verification Status | Technical Mechanism & Evidence |
|---|---|---|---|
MULTI_CITY_SUPPORTED |
YES | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Verified live: gc cities lists BluCity and DropCity concurrently on host. |
MULTI_CITY_ON_ONE_HOST_SUPPORTED |
YES | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Single machine-wide supervisor process (gc supervisor) manages multiple registered cities. |
SUPERVISOR_RELATIONSHIP |
UNIFIED_CONTROLLER | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
One supervisor hosts the typed API and web dashboard (port 8372); cities register via gc register / gc init. |
CITY_ISOLATION_MODEL |
DIRECTORY_BOUND | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Each city is an independent directory containing its own city.toml, pack.toml, .gc/, and .beads/. |
DOLT_RELATIONSHIP |
ISOLATED_STORE | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Each city runs its own local Dolt server on dedicated port (recorded in .beads/dolt-server.port) or connects to configured Dolt host. |
BEADS_RELATIONSHIP |
INDEPENDENT_NAMESPACE | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Each city has its own .beads/identity.toml with unique project UUID (e.g., BluCity vs DropCity). Rigs have scoped bead prefixes. |
SESSION_ISOLATION |
TMUX_SOCKET_ISOLATED | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Default tmux socket tmux -L <city_name> dedicated per city; sessions stored in <city>/.gc/sessions/. |
AGENT_ISOLATION |
CONFIG_BOUND | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Agents execute within their declared pack/city bindings with independent process environments and session keys. |
PACK_ISOLATION |
IMPORT_SCOPED | UPSTREAM_VERIFIED |
Packs imported via city.toml [imports.*] or rig imports [rigs.imports.*]; versions pinned in packs.lock. |
RIG_ISOLATION |
PROJECT_SCOPED | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Each rig carries its own git repository, directory path, and prefix namespace. |
ORDER_ISOLATION |
CONTROLLER_SCOPED | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Orders trigger only inside the declaring city's reconciliation loop; order runs do not leak across cities. |
EVENT_ISOLATION |
APPEND_LOG_SCOPED | UPSTREAM_VERIFIED / CURRENT_RUNTIME_VERIFIED |
Each city maintains its own <city>/.gc/events.jsonl append-only log. |
PORT_REQUIREMENTS |
BOUNDED | CURRENT_RUNTIME_VERIFIED |
Supervisor: 8372 (API/Dashboard). Dedicated dynamic Dolt port per city, or distinct database on shared Dolt host. Controller uses local UNIX domain socket (.gc/controller.sock). |
RESOURCE_ISOLATION |
OS_CGROUP_BOUNDED | CURRENT_RUNTIME_VERIFIED |
Process-level isolation via OS; session concurrency capped by [workspace] max_active_sessions. |
UPSTREAM_RECOMMENDED_TOPOLOGY |
SUPERVISED_MULTI_CITY | UPSTREAM_VERIFIED |
Separate city directory registered with machine-wide supervisor for distinct security/credential/regulatory domains. |
3. Infrastructure & Host Resource Measurements¶
Live Host Measurements (Captured 2026-10-03)¶
HOST 1: Oracle Platform Host (bluefly-platform)
Architecture: ARM64 (Ampere Altra)
Uptime: 10 days, 17:11 (load average: 1.87, 1.55, 1.13)
Total Memory: 23,974 MB (~24 GB)
Used Memory: 13,137 MB (~13.1 GB)
Free Memory: 5,508 MB
Available Memory: 10,837 MB (~10.8 GB)
Swap: 0 MB
Root Disk (/dev/sda1): 193 GB total, 142 GB used, 51 GB available (74% used)
NAS Mount (/mnt/nas): 5.3 TB total, 2.0 TB used, 3.3 TB available (38% used)
HOST 2: Synology NAS Host (blueflynas)
Architecture: x86_64 (Intel Celeron/Atom)
Uptime: 87 days, 14:07 (load average: 2.37, 1.11, 0.97)
Total Memory: 9,796 MB (~10 GB)
Used Memory: 7,272 MB
Available Memory: 1,385 MB (TIGHT)
Swap: 7,927 MB total, 6,055 MB used (HEAVY SWAP)
Volume 1 (/volume1): 5.3 TB total, 2.0 TB used, 3.3 TB available
Resource Allocation Decision & Budget¶
- Compute & Runtime Placement:
- Primary Execution Host:
bluefly-platform(Oracle). It possesses 10.8 GB of unallocated available RAM and zero swap pressure, ideal for running the Finance City Gas City controller, Python data workers, and backtesters. - NAS Role (
blueflynas): Strictly cold storage, historical Parquet archives, and Dolt backup synchronization (/mnt/nas). Do not run active Python quant or financial agent workloads on NAS due to high swap thrashing (6 GB swap active) and low available RAM (<1.4 GB). - Finance City Bounded Resource Budget:
max_active_sessions = 4(City controller, market data collector, research analyst, risk auditor).- RAM Budget: 2.0 GB - 2.5 GB peak (well within 10.8 GB runway on Platform).
- Platform Disk Budget: 15 GB hot SSD storage for local cache / Parquet files.
- NAS Storage Budget: Up to 500 GB cold historical market data on
/volume1/AgentPlatform. - CPU Utilization Cap: <= 1.5 cores during active backtesting; < 0.1 core at idle.
4. Authority Boundaries¶
To prevent architectural drift and ensure pure separation of concerns:
┌────────────────────────────────────────────────────────────────────────┐
│ FINANCE CITY │
├────────────────────────────────────────────────────────────────────────┤
│ Gas City │ Orchestration, process lifecycle, session routing │
│ Beads │ Durable work authority, dependencies, claim state │
│ Finance Pack │ Reusable behavioral composition (agents, doctor) │
│ Rig │ External code project / repository boundary │
│ Formula │ Repeatable deterministic workflow execution │
│ Order │ Scheduled & event-driven trigger automation │
│ Event │ Immutable append-only operational observability │
│ Drupal │ Governed human control surface, approvals, audit │
│ Broker │ External financial execution authority (API) │
│ Data Providers │ External factual data sources (SEC, FRED, Market) │
│ WITNESS │ Independent requested-effect verification gate │
└────────────────────────────────────────────────────────────────────────┘
Drupal Anti-Patterns (Strictly Forbidden)¶
Drupal must never be used as: - A trading engine or order execution loop - A financial portfolio ledger or balance sheet of record - A market data tick store or timeseries database - A cron/job scheduler for financial execution - An agent runtime or LLM execution host - A replacement for Gas City or Beads
Drupal may be used solely as: - A human-facing governance dashboard - An approval gate UI for Stage 5 human trade sign-off - A read-only compliance viewer for thesis journals and audit receipts - A policy inspection surface (Gin theme + Views + JSON:API)
5. Upstream Capability Decisions & Evaluations¶
Every proposed capability follows the doctrine: Upstream-First -> Contrib/Open-Source-First -> Configuration -> Composition -> Custom LAST.
| Capability | Upstream Candidates | License | Maintenance & Maturity | Fit & Evaluation | Disposition |
|---|---|---|---|---|---|
| Market Data Normalization | OpenBB Platform, yfinance, FMP, Polygon | AGPL-3.0 / Apache-2.0 | Active (OpenBB v4+), industry standard | High. Normalizes 500+ sources to standardized Pydantic data schemas. | COMPOSE_UPSTREAM (OpenBB Platform core) |
| SEC Filings & Disclosures | edgar-tools, official SEC EDGAR API |
MIT / Public Domain | Active, fast Python library for 10-K, 10-Q, 8-K, Form 4 | High. Native SEC JSON/XBRL parsing with zero custom scraping. | USE_UPSTREAM (edgar-tools) |
| Economic & Macro Data | FRED API (fredapi), World Bank |
MIT / BSD | Stable, official St. Louis Fed API | High. Deterministic macro series (inflation, yields, employment). | USE_UPSTREAM (fredapi) |
| Backtesting Engine | NautilusTrader, Lean, Backtrader | LGPL-3.0 / Apache-2.0 | NautilusTrader (Rust/Python, active), Lean (C#/Python) | High. Production-grade event-driven backtesting with tick precision. | USE_UPSTREAM (NautilusTrader) |
| Portfolio Accounting & Ledger | Ghostfolio, Rotki, Portfolio Performance | AGPL-3.0 / EPL | Highly active open source wealth/portfolio trackers | High. Clean REST API, multi-currency, holding breakdown, audit trail. | COMPOSE_UPSTREAM (Ghostfolio engine) |
| Quantitative Risk Calculation | Riskfolio-Lib, PyPortfolioOpt |
BSD-3 / MIT | Highly cited, active Python quant libraries | High. Deterministic VaR, CVaR, Sharpe, drawdowns, covariance. | USE_UPSTREAM (Riskfolio-Lib) |
| Broker Integration (Paper/Live) | Alpaca-py, ib_insync (Interactive Brokers) |
Apache-2.0 / BSD | Alpaca-py is official, active; IB is enterprise | High. Alpaca provides seamless paper/live API parity, subaccounts, webhooks. | USE_UPSTREAM (alpaca-py) |
| Audit Trails & Versioned Store | Dolt (running v2.4.0 on Bluefly) | Apache-2.0 | Core Bluefly platform database | High. Versioned SQL with branch/diff/commit capabilities for trade decisions. | USE_UPSTREAM (Dolt hq) |
| Secrets & Credential System | 1Password CLI (op) |
Commercial (Active) | Canonical Bluefly secret authority | High. Reference-based injection (op://...), zero plaintext keys on disk. |
USE_UPSTREAM (1Password) |
| Scheduling & Patrols | Gas City Orders | Upstream GC Core | Canonical Gas City scheduler | High. Cron and cooldown orders triggering formulas natively. | CONFIGURE_UPSTREAM (Gas City Orders) |
| Workflow Execution | Gas City Formulas | Upstream GC Core | Canonical Gas City step compiler (v2) | High. Deterministic steps, parameter verification, human handoff gates. | CONFIGURE_UPSTREAM (Gas City Formulas) |
| Event Stream & Bus | Gas City Events (events.jsonl) |
Upstream GC Core | Immutable append-only event stream | High. Emits structured events (gc event emit) observable by all agents. |
USE_UPSTREAM (Gas City Events) |
| Human Interface / Approvals | Drupal 11 + Canvas + Gin | GPL-2.0+ | Canonical Bluefly CMS platform | High. Least-privilege roles, workflow approvals, immutable revision log. | COMPOSE_UPSTREAM (Drupal 11 Site) |
6. Financial Staging & Safety Progression¶
Financial capabilities are strictly gated across 7 capability stages. Advancement between stages requires explicit acceptance evidence and independent WITNESS sign-off.
STAGE 0: READ-ONLY RESEARCH
- Capabilities: SEC filing analysis, macro news ingestion, earnings calendar tracking.
- Broker Access: NONE.
- Financial Risk: $0.00.
- Acceptance Gate: Deterministic data ingestion without hallucinated metrics.
STAGE 1: MARKET DATA & EVIDENCE NORMALIZATION
- Capabilities: Daily market scans, price/volume anomaly detection, thesis generation.
- Broker Access: NONE (Market data APIs only).
- Financial Risk: $0.00.
- Acceptance Gate: Ingestion pipeline latency < 60s, schema validation 100% clean.
STAGE 2: PORTFOLIO SIMULATION & THESIS DRIFT
- Capabilities: Tracking hypothetical positions in Dolt, monitoring thesis invalidation.
- Broker Access: NONE.
- Financial Risk: $0.00.
- Acceptance Gate: Deterministic thesis comparison (Bull vs Bear counter-thesis required).
STAGE 3: QUANTITATIVE BACKTESTING
- Capabilities: Historical strategy simulation via NautilusTrader / Python quant tools.
- Broker Access: NONE.
- Financial Risk: $0.00.
- Acceptance Gate: Walk-forward validation, zero lookahead bias, verified Sharpe/drawdown.
STAGE 4: PAPER TRADING (SANDBOX BROKER)
- Capabilities: Simulated order submission via Alpaca Paper API, position reconciliation.
- Broker Access: PAPER TRADING CREDENTIALS ONLY.
- Financial Risk: $0.00 (Virtual capital only).
- Acceptance Gate: 100% order idempotency, simulated fill reconciliation, zero slippage errors.
STAGE 5: HUMAN-APPROVED LIVE EXECUTION (OPERATOR-GATED)
- Capabilities: Single orders generated by formula, queued in Drupal for human approval.
- Broker Access: LIVE BROKER API (Strictly limited credentials).
- Financial Risk: Hard-bounded (Max $100 - $500 per order).
- Acceptance Gate: MANDATORY Thomas Scola 2FA human sign-off per order. No autonomous fills.
STAGE 6: LIMITED POLICY-GOVERNED AUTOMATION (FUTURE/OPTIONAL)
- Capabilities: Autonomous execution within bounded risk envelope (micro-trades only).
- Broker Access: LIVE BROKER API with hardware/IP allowlists.
- Financial Risk: Bounded by hard daily loss and drawdown stops.
- Acceptance Gate: Formal audit by independent WITNESS agent and Thomas Scola.
7. Deterministic Risk Policy Controls¶
Hard algorithmic safety bounds must never be delegated to an LLM or prompt. They must be compiled into deterministic code (Python/Bash gate) that executes before any order reaches a broker API.
DETERMINISTIC_RISK_ENVELOPE:
MAX_ORDER_VALUE: $500.00 USD (Stage 5 default)
MAX_POSITION_VALUE: $2,500.00 USD
MAX_PORTFOLIO_EXPOSURE: $10,000.00 USD total
MAX_DAILY_LOSS: $250.00 USD (Immediate trading halt if reached)
MAX_DRAWDOWN: 5.0% of total portfolio value
MAX_OPEN_ORDERS: 3 concurrent orders
ALLOWED_INSTRUMENTS: [EQUITIES_US, ETFS_US] (No options, no margin, no shorting)
ALLOWED_MARKETS: [NYSE, NASDAQ]
ALLOWED_ORDER_TYPES: [LIMIT] (Market orders strictly prohibited to prevent slippage)
TRADING_WINDOWS: 09:45 AM - 03:45 PM EST (Excludes open/close volatility)
PRICE_DEVIATION_LIMIT: 1.0% max deviation from last quoted tick
STALE_DATA_LIMIT: 60 seconds max tick age before order rejection
DUPLICATE_ORDER_PROTECTION: Deterministic idempotency key based on (ticker, date, signal_id)
KILL_SWITCH: Instant cancel-all via `gc formula cook finance-kill-switch`
HUMAN_APPROVAL_THRESHOLD: 100% of live orders require manual approval in Stage 5
8. Broker Capability & Decision Matrix¶
| Evaluation Dimension | Alpaca Securities (Alpaca-py) | Interactive Brokers (IBKR / ib_insync) | Tradier |
|---|---|---|---|
READ_ONLY_API |
YES (Scoped API keys) | YES (Read-only user permissions) | YES |
PAPER_TRADING |
YES (Completely isolated sandbox environment & keys) | YES (Paper trading account mirror) | YES (Sandbox endpoint) |
ORDER_API |
YES (REST + WebSockets, JSON) | YES (TWS/Gateway socket API) | YES (REST) |
ACCOUNT_API |
YES (Real-time equity, cash, buying power) | YES (Portfolio & margin updates) | YES |
WEBHOOKS |
YES (Real-time trade fill / status notifications) | NO (Polling or persistent socket stream) | YES (Events stream) |
IDEMPOTENCY |
YES (Client order ID client_order_id deduplication) |
YES (Client order ID tracking) | Partial |
RATE_LIMITS |
200 requests/minute (Generous for agent scale) | Varies by Gateway connection | 120 requests/minute |
AUDITABILITY |
Comprehensive JSON activity history | Full trade logs & flex queries | Account history API |
API_AUTH |
Key ID + Secret Key headers | Local Gateway session or OAuth | Bearer Token |
IP_CONTROLS |
YES (IP allowlisting supported on keys) | YES (Trusted IP access via Portal) | NO |
SUBACCOUNT_SUPPORT |
YES (Broker API architecture) | YES (Family / Institutional accounts) | YES |
SANDBOX_QUALITY |
EXCELLENT (Full paper market simulation) | GOOD (Requires local Gateway running) | FAIR |
ORDER_TYPES |
Limit, Stop, Stop-Limit, Trailing-Stop | All exchange-supported order types | Standard orders |
MARKET_COVERAGE |
US Equities, ETFs, Crypto | Global multi-asset (Global exchanges) | US Equities, Options |
FEES |
$0 commission on US equities | Tiered / Fixed low commission | $0 equities |
DATA_FEES |
Free standard market data, optional SIP $99/mo | Market data subscriptions required | Free sandbox data |
LEGAL/ACCOUNT_REQ |
Simple individual/entity onboarding | Full institutional onboarding | Standard brokerage |
| VERDICT | PRIMARY CANDIDATE (Stage 4 & 5) | SECONDARY CANDIDATE (Long-term multi-market) | FALLBACK |
9. Pack, Agent, Formula, Rig, and Event Architecture¶
Pack Design: blucity-packs/finance/core¶
Following Gas City Pack Schema 2:
blucity-packs/finance/core/
├── pack.toml
├── agents/
│ ├── market-intelligence/
│ ├── thesis-researcher/
│ ├── contrarian-critic/
│ ├── risk-gatekeeper/
│ └── portfolio-accountant/
├── assets/
│ └── docs/
├── commands/
├── doctor/
│ ├── data-providers.sh
│ └── risk-bounds.sh
├── formulas/
├── orders/
├── skills/
└── template-fragments/
Agent Roles & Contracts¶
market-intelligence: Ingests market news, macro announcements, price spikes, and SEC filings. Emitsmarket.signal_detected.thesis-researcher: Evaluates fundamental filings, balance sheets, and competitive position. Authors structured Bull theses.contrarian-critic: MANDATORY Red-Team agent. Synthesizes Bear counter-arguments, failure modes, and invalidation triggers.risk-gatekeeper: Deterministically validates candidate theses against portfolio concentration and safety envelope.portfolio-accountant: Tracks simulated and paper positions, P&L, Sharpe, and journal receipts in Dolt.
Formulas¶
finance-market-daily-brief: Generates daily pre-market synthesis across watchlists.finance-thesis-evaluate: Complete research pipeline for a target ticker (fundamentals -> SEC -> Bull -> Bear -> Synthesis).finance-filing-delta-audit: Ingests latest 10-K/10-Q and diffs against prior period.finance-portfolio-risk-audit: Computes current sector exposure, concentration, and VaR.finance-paper-position-simulate: Submits simulated paper order to Alpaca Paper sandbox with idempotency verification.finance-kill-switch: Emergency manual formula canceling all open orders and liquidating paper exposures.
Orders¶
finance-daily-morning-scan: Runs weekdays at 08:30 EST via cron (@cron 30 8 * * 1-5).finance-sec-filing-patrol: Checks EDGAR feed every 2 hours during market days (@cooldown 2h).finance-portfolio-risk-patrol: Daily risk audit at market close 16:15 EST.
Events Model¶
finance.signal_detected: Fired when price/volume/news anomaly exceeds threshold.finance.filing_ingested: Fired when a new 10-K, 10-Q, or Form 4 is parsed.finance.thesis_updated: Fired when Bull/Bear synthesis is recorded.finance.risk_alert: Fired when a concentration or drawdown threshold is approached.finance.paper_trade_executed: Fired when a paper order fill receipt is verified.
10. Complete Finance City Work Graph (FC-01 through FC-20)¶
Every planning unit is assigned a temporary FC-* identifier. No Bead IDs are manufactured. All items are blocked by bc-uld for materialization.
FC-01: Finance City Directory & Supervisor Registration
PLAN_ID=FC-01
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Establish Finance City root directory and supervisor registration
PURPOSE=Create /opt/bluefly/financecity (or Sites/blueflyio/FinanceCity) root with city.toml, .beads identity, and register with Gas City supervisor on port 8372.
TYPE=task
PRIORITY=P0
DEPENDENCIES=NONE
OWNER_ROLE=harbormaster
RIG=financecity
ACCEPTANCE_CRITERIA=gc cities lists FinanceCity; supervisor status reports healthy; dedicated tmux socket configured.
EVIDENCE_REQUIRED=gc cities output and supervisor health check log.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-02: Finance City Resource Limits & Platform Sizing
PLAN_ID=FC-02
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Configure Finance City session caps and memory bounds
PURPOSE=Set [workspace] max_active_sessions = 4 in city.toml and establish resource bounds matching the 2.5 GB RAM budget on bluefly-platform.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-01
OWNER_ROLE=harbormaster
RIG=financecity
ACCEPTANCE_CRITERIA=city.toml contains max_active_sessions = 4; verify process limits prevent memory runaway.
EVIDENCE_REQUIRED=city.toml diff and gc config validation.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=NO
FC-03: Finance City Dolt Store & Bead Prefix Allocation
PLAN_ID=FC-03
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Allocate Finance City Dolt namespace and bead prefix 'fc'
PURPOSE=Configure dedicated Dolt database 'finance' or prefix 'fc' on Dolt 127.0.0.1:3308 with independent schema migrations.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-01
OWNER_ROLE=foundry
RIG=financecity
ACCEPTANCE_CRITERIA=Dolt database initialized; .beads/identity.toml contains unique project UUID; bd store ping succeeds.
EVIDENCE_REQUIRED=bd store ping output and identity.toml contents.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-04: Upstream Finance Pack Schema 2 Scaffolding
PLAN_ID=FC-04
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Scaffold blucity-packs/finance/core pack repository
PURPOSE=Create canonical Gas City Pack Schema 2 directory structure under blucity-packs/finance/core with pack.toml and doctor checks.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-01
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=gc pack lint passes; all 10 canonical Schema 2 directories present; pack.toml declares schema = 2.
EVIDENCE_REQUIRED=gc pack lint stdout and git tree listing.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-05: Market Intelligence Agent Contract & Prompt
PLAN_ID=FC-05
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Author market-intelligence agent definition and contract
PURPOSE=Define agent prompt, capabilities, and strict read-only tool bindings for market scanning and anomaly detection.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-04
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=agent.toml and prompt.template.md follow platform hygiene law; no shell escape permissions.
EVIDENCE_REQUIRED=gc prime finance.market-intelligence execution receipt.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=NO
FC-06: Thesis Researcher & Contrarian Critic Agent Pair
PLAN_ID=FC-06
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement Thesis Researcher and mandatory Contrarian Critic agents
PURPOSE=Establish structurally forced disagreement: Bull thesis author and Bear red-team critic that must both evaluate every candidate asset.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-05
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Contrarian agent rejects theses lacking falsification criteria; Bull thesis cannot be approved without Bear counter-review.
EVIDENCE_REQUIRED=Paired test run transcript demonstrating thesis challenge.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-07: Deterministic Risk Gatekeeper Agent & Script
PLAN_ID=FC-07
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement deterministic Risk Gatekeeper agent and hard check script
PURPOSE=Create algorithmic policy gate that rejects any candidate order violating position, loss, or price deviation limits without LLM discretion.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-04
OWNER_ROLE=sentinel
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Automated test proving orders above $500 or outside 1% price deviation are deterministically blocked with exit code 1.
EVIDENCE_REQUIRED=Unit test suite execution proving 100% boundary enforcement.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-08: Portfolio Accountant Agent & Dolt Journal Store
PLAN_ID=FC-08
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement portfolio-accountant agent and Dolt decision journal schema
PURPOSE=Track portfolio holdings, historical decisions, predictions vs outcomes, and P&L in versioned Dolt tables.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-03, FC-04
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Dolt schema migrations for `theses`, `decisions`, `positions`, `performance_receipts`; test insert and rollback.
EVIDENCE_REQUIRED=Dolt commit log and SQL query verification.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=NO
FC-09: SEC EDGAR Ingestion Formula (Stage 0)
PLAN_ID=FC-09
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement finance-sec-filing-delta-audit formula
PURPOSE=Automate retrieval of 10-K, 10-Q, and Form 4 filings via edgar-tools; diff sections against prior periods and emit filing delta receipts.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-04
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Formula downloads filing for test ticker (e.g. AAPL), parses risk factors delta, produces structured JSON receipt.
EVIDENCE_REQUIRED=Receipt artifact showing section delta and zero hallucinated text.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=NO
FC-10: Market Daily Brief Formula (Stage 1)
PLAN_ID=FC-10
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement finance-market-daily-brief formula
PURPOSE=Aggregate macro calendar, earnings dates, and watchlist overnight price movement into morning executive brief.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-05, FC-09
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Executes in < 45 seconds; outputs structured Markdown brief to ContextControl/Drupal dashboard.
EVIDENCE_REQUIRED=Daily brief artifact sample across 10-stock test watchlist.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=NO
FC-11: Full Investment Thesis Evaluation Formula (Stage 2)
PLAN_ID=FC-11
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement finance-thesis-evaluate composite formula
PURPOSE=Chains Market Signal -> Company Research -> SEC Evidence -> Bull Case -> Bear Case -> Risk Check -> Durable Thesis Receipt.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-06, FC-07, FC-08, FC-10
OWNER_ROLE=refinery
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Generates complete thesis record with explicit invalidation conditions and confidence scoring.
EVIDENCE_REQUIRED=Dolt-persisted thesis record verified by independent WITNESS.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-12: Quantitative Backtesting Engine Integration (Stage 3)
PLAN_ID=FC-12
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Integrate NautilusTrader / Python quant backtesting formula
PURPOSE=Execute deterministic strategy backtest against historical Parquet data without LLM mathematical speculation.
TYPE=task
PRIORITY=P2
DEPENDENCIES=FC-11
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Executes walk-forward backtest on historical dataset; outputs Sharpe, Sortino, Max Drawdown, and trade log.
EVIDENCE_REQUIRED=Backtest output receipt with deterministic metrics reproduction.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-13: 1Password Secrets Boundary & Broker Credential Vault
PLAN_ID=FC-13
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Establish 1Password reference vault for financial credentials
PURPOSE=Configure 1Password item templates for Alpaca Paper / Market Data API keys; enforce zero plaintext secrets on disk.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-01
OWNER_ROLE=sentinel
RIG=financecity
ACCEPTANCE_CRITERIA=op read references used in runtime wrapper; no tokens present in git, environment dumps, or logs.
EVIDENCE_REQUIRED=Secret scanner audit report showing 0 leaks.
BLOCKERS=bc-uld
OPERATOR_GATE=YES
WITNESS_REQUIRED=YES
FC-14: Alpaca Paper Trading Broker Adapter (Stage 4)
PLAN_ID=FC-14
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement Alpaca Paper Trading sandbox adapter and verification formula
PURPOSE=Integrate alpaca-py client for paper trading; enforce client_order_id idempotency, sandbox endpoint enforcement, and order audit trail.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-07, FC-13
OWNER_ROLE=forge
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Proves sandbox execution: submits limit buy for 1 paper share of test asset, verifies fill receipt in Dolt.
EVIDENCE_REQUIRED=Alpaca Paper API fill receipt and order ledger entry.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-15: Emergency Financial Kill Switch Formula
PLAN_ID=FC-15
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement finance-kill-switch emergency abort formula
PURPOSE=Provide instant, deterministic halt: cancels all open orders across broker endpoints, halts all orders/agents, emits emergency event.
TYPE=task
PRIORITY=P0
DEPENDENCIES=FC-14
OWNER_ROLE=sentinel
RIG=blucity-packs
ACCEPTANCE_CRITERIA=Execution halts trading within < 500ms; cancels pending paper orders; logs audit receipt.
EVIDENCE_REQUIRED=Kill switch drill execution trace and verified order cancellations.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-16: Drupal 11 Human Approval Surface (Stage 5 Gate)
PLAN_ID=FC-16
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Configure Drupal human approval workflow for live execution
PURPOSE=Build lightweight Drupal content moderation workflow for candidate live orders: shows thesis, bull/bear arguments, risk check, require 2FA signoff.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-07, FC-11
OWNER_ROLE=drupal
RIG=finance-portal
ACCEPTANCE_CRITERIA=Orders stay in 'Draft/Pending Review' until Thomas approves; rejection immediately aborts execution.
EVIDENCE_REQUIRED=Workflow audit log showing blocked execution without human transition.
BLOCKERS=bc-uld
OPERATOR_GATE=YES
WITNESS_REQUIRED=YES
FC-17: Disaster Recovery, Backup & Dolt Replication
PLAN_ID=FC-17
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Implement Dolt automated backup and disaster recovery sync
PURPOSE=Configure daily snapshot replication of Finance City Dolt store to Synology NAS cold storage (/volume1/AgentPlatform).
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-03
OWNER_ROLE=foundry
RIG=financecity
ACCEPTANCE_CRITERIA=dolt_backup sync executes cleanly to NAS; recovery drill proves 100% data restoration.
EVIDENCE_REQUIRED=Backup log and successful table check.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-18: End-to-End Paper Trading Lifecycle Validation Drill
PLAN_ID=FC-18
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Execute end-to-end Stage 4 paper trading validation drill
PURPOSE=Run full autonomous loop in sandbox: Signal -> Thesis -> Counter-Thesis -> Risk Gate -> Paper Trade -> Fill -> Dolt Journal -> WITNESS.
TYPE=task
PRIORITY=P1
DEPENDENCIES=FC-06, FC-07, FC-08, FC-11, FC-14, FC-15
OWNER_ROLE=witness
RIG=financecity
ACCEPTANCE_CRITERIA=Complete lifecycle proven with zero human interventions; all receipts verified and signed off by independent witness.
EVIDENCE_REQUIRED=Complete Gas City event log and witness audit certificate.
BLOCKERS=bc-uld
OPERATOR_GATE=NO
WITNESS_REQUIRED=YES
FC-19: Operator Gate Zero: Live Brokerage Account Provisioning
PLAN_ID=FC-19
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Operator Gate: Live brokerage account onboarding and funding
PURPOSE=Human operator legal agreements, identity verification, account provisioning, and minimal funding ($500 maximum test capital).
TYPE=task
PRIORITY=P3
DEPENDENCIES=FC-18
OWNER_ROLE=operator
RIG=financecity
ACCEPTANCE_CRITERIA=Live broker API credentials provisioned into 1Password; trading privileges strictly limited to cash US equities.
EVIDENCE_REQUIRED=Operator sign-off receipt.
BLOCKERS=bc-uld, OPERATOR_ACTION
OPERATOR_GATE=YES
WITNESS_REQUIRED=YES
FC-20: Stage 5 Controlled Live Execution Pilot
PLAN_ID=FC-20
BEAD_STATUS=NOT_YET_CREATED
MATERIALIZATION_REQUIRED=YES
BLOCKED_BY=bc-uld
TITLE=Execute controlled Stage 5 live trade pilot with 100% human sign-off
PURPOSE=Pilot single live limit order ($50 - $100 test trade) requiring explicit Drupal UI approval, followed by fill verification and holding audit.
TYPE=task
PRIORITY=P3
DEPENDENCIES=FC-16, FC-19
OWNER_ROLE=witness
RIG=financecity
ACCEPTANCE_CRITERIA=Order placed ONLY after manual Drupal approval; order executes at limit price; fill recorded in Dolt; holding confirmed via broker API.
EVIDENCE_REQUIRED=Live broker fill confirmation and witness verification receipt.
BLOCKERS=bc-uld, OPERATOR_ACTION
OPERATOR_GATE=YES
WITNESS_REQUIRED=YES
11. Future Materialization Mapping Table¶
This table maps every planning identifier to its eventual canonical Bead state. At materialization time, search existing canonical Beads first to prevent duplication.
| Plan ID | Title | Owner Role | Depends On | Ready When | Actual Bead ID |
|---|---|---|---|---|---|
FC-01 |
Establish Finance City root and supervisor registration | harbormaster |
NONE |
Gate Zero restored | PENDING_MATERIALIZATION |
FC-02 |
Configure Finance City session caps and memory bounds | harbormaster |
FC-01 |
FC-01 verified | PENDING_MATERIALIZATION |
FC-03 |
Allocate Finance City Dolt namespace and bead prefix 'fc' | foundry |
FC-01 |
FC-01 verified | PENDING_MATERIALIZATION |
FC-04 |
Scaffold blucity-packs/finance/core pack repository | forge |
FC-01 |
FC-01 verified | PENDING_MATERIALIZATION |
FC-05 |
Author market-intelligence agent definition and contract | forge |
FC-04 |
FC-04 verified | PENDING_MATERIALIZATION |
FC-06 |
Implement Thesis Researcher & Contrarian Critic pair | forge |
FC-05 |
FC-05 verified | PENDING_MATERIALIZATION |
FC-07 |
Implement deterministic Risk Gatekeeper agent & script | sentinel |
FC-04 |
FC-04 verified | PENDING_MATERIALIZATION |
FC-08 |
Implement portfolio-accountant & Dolt journal store | forge |
FC-03, FC-04 |
FC-03, FC-04 verified | PENDING_MATERIALIZATION |
FC-09 |
Implement SEC EDGAR Ingestion Formula (Stage 0) | forge |
FC-04 |
FC-04 verified | PENDING_MATERIALIZATION |
FC-10 |
Implement Market Daily Brief Formula (Stage 1) | forge |
FC-05, FC-09 |
FC-05, FC-09 verified | PENDING_MATERIALIZATION |
FC-11 |
Implement Full Investment Thesis Formula (Stage 2) | refinery |
FC-06, FC-07, FC-08, FC-10 |
Prerequisites verified | PENDING_MATERIALIZATION |
FC-12 |
Quantitative Backtesting Engine Integration (Stage 3) | forge |
FC-11 |
FC-11 verified | PENDING_MATERIALIZATION |
FC-13 |
1Password Secrets Boundary & Broker Credential Vault | sentinel |
FC-01 |
FC-01 verified | PENDING_MATERIALIZATION |
FC-14 |
Alpaca Paper Trading Broker Adapter (Stage 4) | forge |
FC-07, FC-13 |
FC-07, FC-13 verified | PENDING_MATERIALIZATION |
FC-15 |
Emergency Financial Kill Switch Formula | sentinel |
FC-14 |
FC-14 verified | PENDING_MATERIALIZATION |
FC-16 |
Drupal 11 Human Approval Surface (Stage 5 Gate) | drupal |
FC-07, FC-11 |
FC-07, FC-11 verified | PENDING_MATERIALIZATION |
FC-17 |
Disaster Recovery, Backup & Dolt Replication | foundry |
FC-03 |
FC-03 verified | PENDING_MATERIALIZATION |
FC-18 |
End-to-End Paper Trading Validation Drill (Stage 4) | witness |
FC-06, FC-07, FC-08, FC-11, FC-14, FC-15 |
Prerequisites verified | PENDING_MATERIALIZATION |
FC-19 |
Operator Gate: Live Brokerage Account Provisioning | operator |
FC-18 |
Stage 4 drill certified | PENDING_MATERIALIZATION |
FC-20 |
Stage 5 Controlled Live Execution Pilot | witness |
FC-16, FC-19 |
Operator signoff complete | PENDING_MATERIALIZATION |
12. Canonical Bead Materialization Protocol (Post-bc-uld)¶
When bc-uld is resolved and native_store_unavailable clears, Harbormaster will execute this deterministic sequence:
1. QUALIFY CANONICAL BEADS:
Execute `bd store ping` and verify Dolt write transactions succeed.
2. PREMISE-REFRESH FC-* ITEMS:
Re-read this file to ensure no environmental drift occurred during degradation.
3. SEARCH CANONICAL BEADS FOR EXISTING OWNERS:
`bd list --all` and search for existing beads covering any FC-* items.
DO NOT create duplicate beads. If an existing bead owns the effect, map FC-* -> existing Bead ID.
4. MATERIALIZE GENUINE GAPS:
For unmatched items, execute `bd create` preserving exact titles, roles, and priorities:
`bd create --title="[FC-01] Establish Finance City root..." --role=harbormaster --priority=P0`
5. RECORD CANONICAL MAPPINGS:
Update this file replacing PENDING_MATERIALIZATION with the allocated Bead IDs.
6. BIND DEPENDENCIES:
Execute `bd dep add <child_bead> <parent_bead>` mirroring the dependency graph in Section 10.
7. CANONICAL READBACK & VERIFICATION:
`bd graph` and `bd show` to confirm the entire work graph is intact.
8. ROUTE & CLAIM:
Route ready beads (FC-01) to owning agent via `gc sling` and `gc hook --claim`.