TriAgentFlow / TAF is a lightweight, file-based governance framework for auditable multi-agent AI development workflows.
三角色智能体开发工作流
Leader plans. Workers execute. Verifier audits independently. phase_gate decides.
Leader → Worker / Worker Shards → Verifier / Verifier Join → phase_gate
TAF Core is platform-neutral. It runs through a file protocol (scripts/ + .phase_control/) and can be wrapped by platform-specific adapters such as Hermes, Trae, or future Codex integration.
Formerly HTE / Hermes Team Engine. See CHANGELOG.md for rename history.
hmte-*script names are a legacy CLI prefix retained for backward compatibility.
TriAgentFlow separates complex AI development into three distinct roles so that planning, execution, and verification are never done by the same unchecked agent:
| Role | Responsibility | Artifacts |
|---|---|---|
| Leader | Breaks down the goal, maintains phase state, writes instructions, controls phase transitions. | phases.json, instruction files, state.json |
| Worker | Executes scoped tasks, runs commands, and produces evidence. | command logs, evidence bundles |
| Verifier | Independently audits evidence and outputs a verdict. | verdict JSON |
The phase_gate script is the only hard gate. It reads files, checks evidence, verifies the verdict, and returns an exit code. A model saying "PASS" cannot override a non-zero exit code.
- Evidence: A structured record of what the Worker did, what changed, and what tests ran. Stored in
.phase_control/evidence/. - Command Log: A machine-readable log of every command executed by the Worker. Stored in
.phase_control/logs/. - Verdict: An independent PASS / FAIL / BLOCK decision produced by the Verifier. Stored in
.phase_control/verdicts/. - phase_gate: The Core gate script that decides whether a phase may proceed.
- Not a runtime or daemon. TAF is a file-based workflow protocol, not a long-running service.
- Not a database or dashboard. It uses JSON/JSONL files and shell scripts, not SQLite or Web UI.
- Not a DAG engine. It does not use dependencies, topological sorting, or
ThreadPoolExecutor. - Not a single-agent prompt. It enforces role separation through evidence and gates.
- Not platform-specific. Hermes, Trae, and Codex are adapters; TAF Core is the source of truth.
Platform adapters are thin wrappers that deliver TAF prompts and agent templates into a specific IDE or platform. They do not replace Core protocols, schemas, or gates.
| Adapter | Status | Purpose |
|---|---|---|
| CLI / File Protocol | baseline | Run TAF directly with shell scripts and .phase_control/. |
| Hermes | supported legacy integration | Hermes skill profile and agent prompts. |
| Trae | TAF-Trae-Lite | Rules, Skill, and Custom Agent templates for the Trae IDE. |
| Codex | planned | Future adapter; not release-ready. |
See docs/platforms/README.md for adapter guides.
git clone https://github.com/mohammedabdalmonim411-afk/hmte.git
cd hmteThe repository name remains
hmtefor historical compatibility. The public project name is TriAgentFlow / TAF.
mkdir -p /path/to/your/project/scripts
cp -R scripts/. /path/to/your/project/scripts/cd /path/to/your/project
bash scripts/hmte-kickoff.sh "your task description".phase_control/ will be created automatically. Do not create it manually.
bash scripts/hmte-goal-lock.shbash scripts/hmte-exec.sh phase_a --attempt 1 -- npm testAfter the Worker produces evidence and the Verifier produces a verdict:
bash scripts/phase_gate.sh phase_a --attempt 1Exit 0 means proceed; non-zero means stop and fix.
When all phases have passed:
bash scripts/hmte-final-check.sh --mode release.
├── README.md # This file
├── CHANGELOG.md # Version history
├── HERMES.md # Project policy and workflow rules
├── scripts/ # Core gate and workflow scripts
│ ├── phase_gate.sh # Phase hard gate (wrapper)
│ ├── hmte-final-check.sh # Final release gate
│ ├── hmte-release-gate.sh # Outer release/audit gate
│ ├── hmte-exec.sh # Command execution logger
│ ├── hmte-eval.sh # Protocol eval harness
│ └── ...
├── docs/ # Protocol and governance docs
│ ├── HTE_PROTOCOL.md # Core protocol specification
│ ├── PROJECT_BOUNDARIES.md # Architecture constraints
│ ├── VERIFIER_MANDATE.md # Verifier rules
│ ├── RELEASE_GATE_PROTOCOL.md # Release gate protocol
│ ├── platforms/ # Platform adapter guides
│ │ ├── README.md
│ │ └── trae-adapter.md
│ └── ...
├── src/
│ ├── agents/ # Core agent prompt templates
│ └── skills/hmte/ # Canonical schemas and skill files
│ ├── evidence-schema.json
│ ├── verdict-schema.json
│ └── delegation-receipt-schema.json
├── adapters/ # Platform-specific adapters
│ └── trae/ # TAF-Trae-Lite Adapter
├── evals/ # Eval cases and fixtures
└── evidence-schema.json # Backward-compatible stub
└── verdict-schema.json # Backward-compatible stub
Canonical schemas live in
src/skills/hmte/. Root-levelevidence-schema.jsonandverdict-schema.jsonare deprecated backward-compatibility stubs.
Run the protocol eval harness and release gates:
bash scripts/hmte-eval.sh
bash scripts/hmte-final-check.sh --mode release
bash scripts/hmte-release-gate.sh --mode auditRun the Trae Adapter conformance tests:
bash adapters/trae/tests/run_all.sh
bash adapters/trae/examples/run_positive_example.sh
bash adapters/trae/examples/run_negative_example.shRun the E2E regression suites:
bash scripts/e2e-core-workflow-test.sh
bash scripts/e2e-parallel-workflow-test.sh
bash scripts/e2e-anti-fake-test.sh
bash scripts/e2e-p0-hardening-test.shA high-level diagram of the v2.1 architecture is also available at docs/assets/taf-v2.1-architecture.png.
- v1.2–v1.8 — Core protocol, command logs, phase_gate, audit flow, anti-fake tests, run ledger, controlled parallelism.
- v2.0 — Plan-Grounded Audit Governance: Plan Contract, Lock, Fidelity, Mandate, Coverage, Anomaly, Disposition, PASS Contradiction, Zero-Finding.
- v2.1 — Platform-neutral release framing, TAF-Trae-Lite Adapter, schema duplicate cleanup, public-safe docs.
- Leader Jail runtime hook integration
- OBSERVED-level delegation proof
- CI/CD templates
- Codex platform adapter (not release-ready)
See CONTRIBUTING.md.
MIT License — see LICENSE for details.
