Skip to content

Repository files navigation

TriAgentFlow / TAF

TriAgentFlow / TAF is a lightweight, file-based governance framework for auditable multi-agent AI development workflows.

三角色智能体开发工作流

Version License

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.


What TAF Is

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.

Core Concepts

  • 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.

What TAF Is Not

  • 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

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.


Quick Start

1. Clone the repository

git clone https://github.com/mohammedabdalmonim411-afk/hmte.git
cd hmte

The repository name remains hmte for historical compatibility. The public project name is TriAgentFlow / TAF.

2. Copy workflow scripts into your target project

mkdir -p /path/to/your/project/scripts
cp -R scripts/. /path/to/your/project/scripts/

3. Start a TAF workflow

cd /path/to/your/project
bash scripts/hmte-kickoff.sh "your task description"

.phase_control/ will be created automatically. Do not create it manually.

4. Lock acceptance criteria

bash scripts/hmte-goal-lock.sh

5. Run phase commands

bash scripts/hmte-exec.sh phase_a --attempt 1 -- npm test

6. Audit and gate

After the Worker produces evidence and the Verifier produces a verdict:

bash scripts/phase_gate.sh phase_a --attempt 1

Exit 0 means proceed; non-zero means stop and fix.

7. Final release check

When all phases have passed:

bash scripts/hmte-final-check.sh --mode release

Repository Structure

.
├── 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-level evidence-schema.json and verdict-schema.json are deprecated backward-compatibility stubs.


Validation

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 audit

Run 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.sh

Run 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.sh

Architecture

TAF Architecture

A high-level diagram of the v2.1 architecture is also available at docs/assets/taf-v2.1-architecture.png.


Roadmap

Completed

  • 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.

Future / Planned

  • Leader Jail runtime hook integration
  • OBSERVED-level delegation proof
  • CI/CD templates
  • Codex platform adapter (not release-ready)

Contributing

See CONTRIBUTING.md.


License

MIT License — see LICENSE for details.

About

TriAgentFlow (TAF) — a three-role (Leader / Worker / Verifier) AI development workflow with plan-grounded audit governance. Formerly HTE.

Topics

Resources

Code of conduct

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages