hierarchical-codex
hierarchical-codex
hierarchical-codex は、ネイティブ Codex サブエージェントのための決定論的 MCP コントロールプレーンです。Codex は依然として spawn_agent により UI に表示される Sol → Terra → Luna スレッドを作成します。このプロジェクトは、それらのスレッドを囲む永続状態、ポリシーゲート、予算、アーティファクト、エビデンスワークフロー、およびリカバリプロトコルを提供します。
ステータス: エンジニアリング MVP。コントロールプレーン、Codex プロジェクト統合、フック、テスト、運用ドキュメントは実装済みです。ターゲットとなる各 App/IDE デプロイメントで、モデルの利用可能性と正確な Codex コアバージョンを検証してください。
設計上の選択
このプロジェクトは、1 つの明確なルートに従います:
モデル駆動のスポーン、コードによる制約の強制。
Codex native execution plane
spawn_agent / wait_agent / send_message / Subagents UI
|
| task_id in TaskEnvelope
v
TypeScript MCP control plane
SQLite task ledger / leases / budgets / artifacts / evidence / audit
^
|
Codex Skills + Profiles + Hooks
orchestration policy / model-effort routing / spawn veto / stop checksMCP とフックはネイティブスレッドを作成しません。Sol または Terra モデルがネイティブの spawn_agent を呼び出し、コードが周囲のワークフローを検証して記録します。
Related MCP server: dingdawg-governance
実装済み機能
楽観的バージョンを持つミッションおよびタスク台帳。
直接親ロールポリシー: Sol ディレクター → Terra コーディネーター → Luna リーフ。
モデル/エフォートマトリックス:
Sol:
high,xhigh,maxTerra:
xhigh,maxLuna:
high,xhigh,max
依存関係を考慮した準備状態と、上限付きの子割り当て。
期限付きワーカーリース、ハートビート、解放、および安全な回収。
階層的なトークン、コスト、ウォールタイム、ツール呼び出し、子カウントの予算。
コンテンツアドレス方式のアーティファクトストレージと、上限付き読み取り。
候補 → チェック済み → 検証済み → コミット済みのエビデンスゲート。
プロデューサー/レビュアーの分離。
リクエストハッシュによる冪等な変更と、追記専用の監査イベント。
再起動またはコンテキスト圧縮後のリカバリスナップショット。
プロジェクトスコープの Codex スキル、エージェントプロファイル、MCP 設定、およびフック。
要件
Node.js 22.5 以降。開発では Node 26 を使用しています。
Codex ライフサイクルフック用に Python 3.10 以降。
Codex 0.148.0 以降が推奨される本番ベースラインであり、ネイティブのマルチエージェントツール、カスタムエージェント、MCP、フックを備えています。
.codex/config.tomlとプロジェクトフックが読み込まれる、信頼された Codex プロジェクト。
クイックスタート
cd "/mnt/tools/others/codes/web project/hierarchical-codex"
npm install
npm run check
npm run doctor次に:
Codex App、Codex CLI、または Codex VS Code 拡張機能で このリポジトリのルート を開きます。
npm run doctorはスキルを ChatGPT にインストールしません。App はこのフォルダをワークスペースとして使用する必要があります。プロンプトが表示されたらプロジェクトを信頼します。信頼されていないプロジェクトでは
.codexスキルが非表示になります。gpt-5.6-solで 新しい ルート会話を開始します (スキルは起動時に読み込まれます)。$を入力してprismを選択するか、$prism <mission>を呼び出します。ピッカーが空の場合でも、AGENTS.mdがルート Sol に指示を与えます。Subagents UI でネイティブの子アクティビティを確認し、MCP ツールを通じて永続状態を確認します。
VS Code Codex 拡張機能または CLI で 他のフォルダ からフルスタックを使用するには、npm run build の後に npm run install:user を実行します。docs/USER_INSTALL.md を参照してください。このリポジトリの .codex/config.toml を ~/.codex にコピーしないでください。Sol がデフォルトモデルとして固定され、通常のサブエージェントがブロックされます。
プロジェクトの MCP 設定は、リポジトリルートを作業ディレクトリとして node dist/cli.js を起動します。ソース変更後は npm run build を実行してください。
開発コマンド
npm run dev # Run the stdio MCP server from TypeScript
npm run doctor # Validate runtime and Codex integration files
npm run test # Unit and integration tests
npm run typecheck # Strict TypeScript checks
npm run lint # ESLint
npm run format # Prettier
npm run build # Compile dist/
npm run check # Full local quality gate
npm run install:user # Install skill, agents, hooks, and MCP into ~/.codex
npm run doctor:user # Verify the user-global install
npm run uninstall:user # Remove the managed user-global filesMCP サーバーはプロトコルメッセージを stdout に書き込みます。アプリケーションログは stderr を使用する必要があります。stdout へのログ出力は stdio MCP トランスポートを破損させます。
ランタイム状態
デフォルトでは、状態はプロジェクトローカルであり、Git によって無視されます:
.hierarchical-codex/
├── control-plane.sqlite
└── artifacts/
└── <sha-prefix>/<sha256>ユーザーグローバルインストール (npm run install:user) は、台帳を ~/.local/share/hierarchical-codex/ に保存するため、Codex MCP サンドボックスが書き込めます。そのディレクトリが書き込み可能でない場合、サーバーは一時パスにフォールバックし、選択したホームを stderr に記録します。
設定環境変数:
HIERARCHICAL_CODEX_HOMEHIERARCHICAL_CODEX_DBHIERARCHICAL_CODEX_ARTIFACTSHIERARCHICAL_CODEX_MAX_ARTIFACT_BYTESHIERARCHICAL_CODEX_DEFAULT_LEASE_SECONDSHIERARCHICAL_CODEX_MAX_LEASE_SECONDSHIERARCHICAL_CODEX_EVENT_PAGE_SIZE
MCP ツール
ミッション:
mission_createmission_getmission_close
タスクとリース:
task_allocatetask_gettask_claimtask_starttask_heartbeattask_releasetask_blocktask_failtask_canceltask_supersedetask_set_efforttask_commit
アーティファクトとエビデンス:
artifact_putartifact_getresult_submit_candidateresult_checkresult_verify
会計とリカバリ:
budget_reportrecovery_snapshot
契約については docs/API.md を、オーケストレーションシーケンスについては docs/PROTOCOL.md を参照してください。
リポジトリ構造
.agents/skills/ Codex orchestration Skill
.codex/agents/ Sol/Terra/Luna custom profiles
.codex/hooks/ Python policy gates
.codex/config.toml MCP and native agent configuration
src/domain/ State and policy definitions
src/infra/ SQLite repository and artifact storage
src/mcp/ MCP tool registration
tests/ Control-plane, policy, and hook tests
docs/ Architecture, protocol, operations, ADRs, records重要な境界
外部 MCP コードは内部のネイティブ
spawn_agentレジストリを呼び出せません。フックはコンテキストを拒否、書き換え、または追加できますが、
SubagentStartは作成後のサブエージェントを防ぐことはできません。ネイティブ UI の状態は観察用です。SQLite が永続的なワークフローソースです。
この MVP はシングルホストです。SQLite は変更を直列化しますが、分散コンセンサスシステムではありません。
トークン使用量はエージェント/ホストによって報告されます。MCP サーバーはモデルトークンを独立して計測できません。
このリポジトリは現在
UNLICENSEDです。外部配布の前に明示的なライセンスを追加してください。
ドキュメント
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityAmaintenanceGovernance/control plane for MCP-enabled coding-agent workflows with validation, findings, approvals, budgets, and proof bundles.5511
- AlicenseAqualityBmaintenanceUniversal governance layer for AI agents — MCP-native, fail-closed, LNN interpretability. Governed receipts, IPFS audit proofs, and rollback for any agent in any framework.398Apache 2.0
- AlicenseAqualityAmaintenanceGoverned agent execution gateway for LLM workflows, providing deterministic FSM-based execution, audit trails, and idempotency guarantees via MCP.5MIT
- AlicenseAqualityAmaintenanceLocal-first multi-agent delegation and approval control for Codex via MCP, with persistent task DAG, isolated worktrees, and a web console.141MIT
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IrisRainbowNeko/codex-on-rails'
If you have feedback or need assistance with the MCP directory API, please join our Discord server