Core concept

The harness

The harness is the runtime contract generated into an attached workspace. It makes the skills, fixed roles, service boundaries, workspace records, and audit trail work together without turning the workspace into a black box.

Three connected planes #

TradingCodex uses a clear division of responsibility. Each plane has a different job, and none substitutes for another.

PlaneOwns
Codex control planeHead Manager instructions, fixed-role configuration, skills, and dynamic role orchestration.
Service planeMCP identity and capability checks, artifacts, policy, orders, approvals, broker execution, and audit.
Workspace system planeGenerated configuration, run records, research Markdown, source snapshots, audit files, and local launchers.

Research orchestration is Codex-native. The service does not classify an investment request, select a team, compile a DAG, or schedule analyst tasks.

What attach creates #

tcx attach projects the workspace contract into a folder you own. It includes separate instructions for Head Manager and a compact fixed-role base, fixed-role TOML, hooks, the available skill bundles, local policies and run state, research folders, and the tcx and tcx-calc launchers. The compact child base keeps role safety and evidence rules without copying the root coordination manual into every specialist turn.

  • Readable workspace files. Research, source snapshots, Dataset manifests, Calculation records, Decision Memory, non-private provenance, Strategies, and Brain sources can remain version-controlled.
  • Large data stays local. Content-addressed Dataset Parquet payloads persist in the workspace but the managed privacy block excludes them from Git by default; manifests and withdrawal records remain reviewable.
  • Private state stays local. Runtime databases, credentials, private Investor Context, private calculation inputs, and transient process state are excluded by the managed privacy block or remain run-scoped in scratch.
  • No automatic publication. Attach and update do not stage files, create a commit, configure a remote, or push.

Useful tools, separated authority #

Normal analysis uses trading-research. Native Codex governs ordinary shell, browser, public network, workdir, and user-file access; generated permissions deny secrets, protected trading/ records, TradingCodex runtime state, and local/private services. Numeric roles use the separate tcx-calc launcher and runtime for scratch-local calculation scripts. Head Manager can search compact Dataset and Calculation cards, while the assigned role works with the needed rows and records reusable results. The viewer remains read-only.

Controlled trading/, connector, and managed lifecycle changes use a fresh matching Build, Brain, or Strategy turn. Those markers provide a proof for the matching service call, not filesystem elevation. Orders, approvals, broker access, and durable ledgers always stay behind typed service gates.

What the hooks enforce #

Hooks record compact run and child lifecycle context, parse reserved Build/Brain/Strategy/order prompts, inject one-turn service proofs, and block raw credentials, protected order records, and direct broker effects.

Hooks do not replace Codex. They do not infer investment meaning, choose roles, parse ordinary shell or network commands, constrain workdirs, select models, or validate calculation syntax. Native Codex and the tcx-calc launcher own those behaviors.

Why artifacts matter #

Save an authenticated research artifact when a result supports a decision, reuse, audit, or another role. The service verifies the role identity and run binding, derives hashes, and records consumed lineage. A narrow bounded answer can remain direct.

Saved work keeps source/as-of posture, uncertainty, handoff state, and the evidence behind synthesis visible after the task ends. The browser exposes that trail read-only; it does not launch Codex, create runs, or mutate skills.