HomeTrang chủ The rigBộ máy
The machinery · honest about its limitsBộ máy · trung thực về giới hạn

The rig

gate · trace · telemetry

Behind the 109 skills sits the enforcement layer: fifty hooks in three tiers, a multi-agent coordination layer (claims · task-store · plan-approval · write-guard), and read-only telemetry that ends every report with what it cannot measure. It reports whether the machinery runs — never whether the product wins the market.Sau 109 skill là lớp cưỡng chế: năm mươi hook ba hạng, một lớp phối hợp đa-agent (claims · task-store · plan-approval · write-guard), và telemetry chỉ-đọc kết mỗi báo cáo bằng cái nó không đo được. Nó báo máy móc có chạy không — không bao giờ báo sản phẩm có thắng thị trường không.

What it can and can't tell youNó nói được gì và không nói được gì

✓ It can tell you✓ Nó nói được

  • which skills actually ran, and in what chainskill nào thực sự chạy, theo chuỗi nào
  • whether a hard stage was blocked, and who actedstage cứng có bị chặn không, ai đã thao tác
  • declared vs actual workflow deviationslệch chuỗi khai-báo vs thực-tế

✗ It can't tell you✗ Nó không nói được

  • market / user outcome — usage ≠ effectivenesskết quả thị trường / người dùng — mức dùng ≠ hiệu quả
  • exact token / dollar cost — not attributedtoken / $ chính xác — không quy được
  • semantic correctness — only ran / coarse exitđúng-sai ngữ nghĩa — chỉ ran / exit thô

Inspect the rig yourselfTự kiểm bộ máy

Everything is on the filesystem — no dashboard, no server. These commands read what the harness recorded.Mọi thứ nằm trên filesystem — không dashboard, không server. Các lệnh này đọc cái harness đã ghi.

See what actually ranXem cái thực sự chạy

python3 harness/scripts/analyze_telemetry.py --lens all — the workflow lens compares declared vs actual; the mandatory ## NOT measured block keeps a partial read from looking complete.python3 harness/scripts/analyze_telemetry.py --lens all — workflow lens so khai-báo vs thực-tế; khối bắt buộc ## NOT measured chặn việc đọc một phần trông như đủ.

Read the audit trailĐọc sổ audit

Open state/trace/trace-YYYYMMDD.jsonl — append-only gate / approval / DEC events, each with an actor + ts. It never rotates.Mở state/trace/trace-YYYYMMDD.jsonl — sự kiện gate / approval / DEC append-only, mỗi cái có actor + ts. Không xoay vòng.

Verify integrityKiểm toàn vẹn

python3 harness/scripts/verify_install.py --strict hashes every tracked file and checks the registered hooks match. Tamper with one and it fails.python3 harness/scripts/verify_install.py --strict hash mọi file tracked và kiểm hook đã đăng ký khớp. Sửa một cái là fail.

Toggle or silenceBật/tắt hoặc làm im

Flip a hook in harness/data/harness-hooks.yaml (git-tracked — the diff shows). Silence all observation with HARNESS_TELEMETRY_DISABLED=1.Bật/tắt một hook trong harness/data/harness-hooks.yaml (tracked git — lộ diff). Tắt mọi quan sát bằng HARNESS_TELEMETRY_DISABLED=1.

Worked example: declared vs actualVí dụ thật: khai-báo vs thực-tế

Worked exampleVí dụ thật

The workflow lens — declared vs actualWorkflow lens — khai-báo vs thực-tế

Same data, two renders: md to read (note the ## NOT measured honesty block) and json to pipe. The registry ships exactly one lens today; lenses not yet built are named, not hidden. real output Cùng dữ liệu, hai kiểu render: md để đọc (để ý khối trung thực ## NOT measured) và json để nối ống. Registry hôm nay ship đúng một lens; lens chưa dựng được nêu tên, không giấu. đầu ra thật

analyze_telemetry.py --lens all --format md
# Telemetry

## lens: workflow_chains

_sessions analyzed: 1 · sufficient: False · gated: True_

| chain          | count |
| -------------- | ----: |
| ck-plan → cook | 1     |

**Deviations (undeclared chains):**

| chain          | count |
| -------------- | ----: |
| ck-plan → cook | 1     |

## NOT measured

- token / dollar cost per skill or session (not attributed)
- semantic correctness or quality of any run (only ran / coarse exit)
- wall-clock for non-script work (only harness/scripts & harness/e2e Bash runs are timed)
- human review depth or plan-approval quality
- lenses not yet shipped: usage, session, health, reliability, validate, memory, product_memory (not yet shipped — the JSONL data is retained; the read-only lens is added later without touching this spine)
{
  "lens": "workflow_chains",
  "days": 30,
  "sessions_analyzed": 1,
  "sufficient": false,
  "min_sessions": 5,
  "common_chains": [
    {
      "chain": "ck-plan → cook",
      "count": 1
    }
  ],
  "declared_chains": [
    "plan → cook",
    "cook → test",
    "test → cook"
  ],
  "deviations": [
    {
      "chain": "ck-plan → cook",
      "count": 1
    }
  ],
  "gated": true
}

No chart library is vendored — the page stays dependency-free. The ## NOT measured section is mandatory: it stops a partial read from looking like full coverage.Không nhúng thư viện vẽ nào — trang giữ không-phụ-thuộc. Mục ## NOT measured là bắt buộc: nó chặn việc đọc một phần trông như đo đủ.

Three hook tiers — the class is carved in codeBa hạng hook — hạng khắc trong code

Config (harness-hooks.yaml, tracked in git) can flip a hook on/off and change its mode — but it can never change a hook's tier. The fail posture follows the tier.Config (harness-hooks.yaml, tracked git) bật/tắt và đổi mode một hook — nhưng không bao giờ đổi được hạng. Tư thế-khi-lỗi theo hạng.

telemetry
default ONmặc định ON
fail-open, silent. 5 sinks record skill/script runs, session shape, subagent outcomes — an internal error never blocks a tool.fail-open, im lặng. 5 sink ghi skill/script-run, hình phiên, kết cục subagent — lỗi nội bộ không bao giờ cản tool.
nudge
default OFFmặc định OFF
advisory on stderr. memory-gap reminds, never blocks. A blocking hook is never fallback-enabled.advisory ở stderr. memory-gap nhắc, không bao giờ chặn. Hook chặn không bao giờ bật theo fallback.
compliance
ON + blockingON + blocking
fail-closed, exit 2. gate_stage + write_guard. On error — even a missing dep — it blocks and prints the fix command.fail-closed, exit 2. gate_stage + write_guard. Khi lỗi — kể cả thiếu dep — chặn và in lệnh sửa.

Multi-agent coordination (W2)Phối hợp đa-agent (W2)

Several agents/devs work in parallel without stepping on each other — and the presence gate gets harder to cheat cheaply.Nhiều agent/dev làm song song mà không dẫm chân nhau — và presence gate khó gian rẻ hơn.

A claim has a 4-hour lease and self-reclaims if its owner hangs — atomicity from a spike, never unlink+recreate:Một claim có lease 4 giờ và tự reclaim nếu chủ treo — atomicity từ spike, không bao giờ unlink+tạo lại:

Free acquire Claimed lease 4h hết Reclaimable reclaim+verify Claimed

task-store · GitHubtask-store · GitHub

4 methods over urllib (no new dep), a 5-class error taxonomy, retry-1 on GET only (never on a write). The token comes only from env — no error ever serializes a header (a NoTokenLeak invariant tests every class). And no network call lives in the gate path (a grep invariant proves it).4 method qua urllib (không thêm dep), taxonomy 5 lớp lỗi, retry-1 chỉ GET (không retry write). Token chỉ từ env — không error nào serialize header (invariant NoTokenLeak test mọi lớp). Và không network call nào ở đường gate (invariant grep chứng minh).

plan-approval & write-guardplan-approval & write-guard

Plan approval gates pr/ship/deploy on remote CI: a plan_hash must match the normalized plan dir (ignores frontmatter + the auto-updated ## Phases section). Write-guard blocks edits to gate config (a GUARD_LIST constant) locally and a pre-push step scrubs every HARNESS_* var — tamper-evident, not tamper-proof.Plan approval gác pr/ship/deploy trên CI remote: plan_hash phải khớp plan dir chuẩn-hóa (bỏ qua frontmatter + section ## Phases tự cập nhật). Write-guard chặn sửa config gate (hằng GUARD_LIST) local và một bước pre-push scrub mọi biến HARNESS_* — tamper-evident, không tamper-proof.

Two books, two lawsHai sổ, hai luật

state/trace/trace-YYYYMMDD.jsonlaudit · gate / approval / DECaudit · gate / approval / DECnever rotateskhông xoay vòng
state/telemetry/*.jsonlusage · counts / shape / outcomesusage · count / shape / outcomerotates 8MBxoay 8MB

Every record setdefaults an actor + ts. The lens registry ships one lens; the rest are named "absent" so a missing module is visible, never silently dropped:Mọi record setdefault một actor + ts. Registry lens ship một lens; còn lại gắn "absent" để module vắng nhìn thấy được, không bao giờ drop âm thầm:

workflow
declared vs actualkhai vs thực
usage
absent (W3)absent (W3)
session
absent (W3)absent (W3)
health
absent (W3)absent (W3)
reliability
absent (W3)absent (W3)
⚖️ "This is NOT measured""Cái này KHÔNG đo được"
  • token / dollar cost per skill or session — not attributedtoken / $ mỗi skill hay phiên — không quy được
  • semantic correctness or quality — only ran / coarse exitđúng-sai hay chất lượng — chỉ ran / exit thô
  • human review depth or plan-approval qualityđộ sâu review của người hay chất lượng plan-approval

Prove the tree is intactChứng minh cây còn nguyên

Install integrityToàn vẹn cài đặt

The manifest hashes every git-tracked harness file; --strict also checks that registered hooks match. Tamper with a tracked file and this fails. real outputManifest hash mọi file harness tracked git; --strict còn kiểm hook đã đăng ký khớp. Sửa một file tracked là cái này fail. đầu ra thật

python3 harness/scripts/verify_install.py --strict
verify_install OK: manifest + hook registration consistent
🔒
Offline & self-contained. The harness makes no network call in the gate path; state/ is always gitignored and never enters git. Global kill-switch for all observation: HARNESS_TELEMETRY_DISABLED=1. Delete harness/ and it's gone.Offline & tự chứa. Harness không gọi mạng ở đường gate; state/ luôn gitignored và không bao giờ vào git. Công tắc tổng cho mọi quan sát: HARNESS_TELEMETRY_DISABLED=1. Xóa harness/ là hết.

FAQHỏi đáp

Can config just disable the compliance gate?Config có thể tắt béng compliance gate không?
Config (harness-hooks.yaml, git-tracked) can toggle a hook on/off and change its mode, but never its tier. The fail posture follows the tier, so compliance stays fail-closed — and any edit shows in the diff.Config (harness-hooks.yaml, tracked git) bật/tắt và đổi mode một hook, nhưng không bao giờ đổi hạng. Tư thế-khi-lỗi theo hạng, nên compliance vẫn fail-closed — và mọi sửa lộ diff.
Trace vs telemetry — what's the difference?Trace vs telemetry — khác gì?
Trace is the audit book (gate / approval / DEC events) and never rotates. Telemetry is the usage book (counts / shape / outcomes) and rotates at 8MB. Both setdefault an actor + ts on every record.Trace là sổ audit (sự kiện gate / approval / DEC), không xoay vòng. Telemetry là sổ usage (count / shape / outcome), xoay ở 8MB. Cả hai setdefault actor + ts mỗi record.
Does the harness phone home?Harness có "gọi về nhà" không?
No. There is no network call in the gate path (a grep invariant proves it), and state/ is gitignored. Turn off all observation with HARNESS_TELEMETRY_DISABLED=1.Không. Không có network call ở đường gate (invariant grep chứng minh), và state/ gitignored. Tắt mọi quan sát bằng HARNESS_TELEMETRY_DISABLED=1.
What can telemetry not tell me?Telemetry không nói được gì?
Token/dollar cost (not attributed), semantic correctness (only ran / coarse exit), human-review depth, and market/user outcome. The ## NOT measured block names these in every report.Token/$ (không quy được), đúng-sai ngữ nghĩa (chỉ ran / exit thô), độ sâu review của người, và kết quả thị trường/người dùng. Khối ## NOT measured nêu rõ chúng trong mọi báo cáo.
How do I remove the harness?Gỡ harness thế nào?
Delete the harness/ directory. It's self-contained — a CI invariant forbids the string .claude/skills/ inside harness/.Xoá thư mục harness/. Nó tự chứa — một invariant CI cấm chuỗi .claude/skills/ trong harness/.