tr-plugin-meta-harness 0.3.0 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/DESIGN.md +86 -0
  2. package/README.md +257 -11
  3. package/capability/BRICK.md +1 -1
  4. package/capability/index.mjs +154 -13
  5. package/cli.mjs +426 -41
  6. package/package.json +15 -3
  7. package/plugin.json +1457 -119
  8. package/skills/meta-harness/SKILL.md +63 -25
  9. package/src/adoption.mjs +102 -0
  10. package/src/agent-user.mjs +194 -0
  11. package/src/alerts.mjs +220 -14
  12. package/src/cascade.mjs +185 -0
  13. package/src/chat.mjs +80 -0
  14. package/src/codex-models.mjs +54 -0
  15. package/src/compat-harness.mjs +117 -0
  16. package/src/control.mjs +145 -0
  17. package/src/coordinator.mjs +267 -358
  18. package/src/dispatch-request.mjs +76 -0
  19. package/src/dispatch.mjs +119 -0
  20. package/src/documentation-authority.mjs +57 -0
  21. package/src/documentation.mjs +120 -32
  22. package/src/executor.mjs +101 -22
  23. package/src/gate-adapters/agy.mjs +155 -0
  24. package/src/gate-adapters/claude.mjs +303 -0
  25. package/src/gate-adapters/cline.mjs +111 -0
  26. package/src/gate-adapters/codex.mjs +164 -0
  27. package/src/gate-adapters/cursor.mjs +164 -0
  28. package/src/gate-adapters/devin.mjs +116 -0
  29. package/src/gate-adapters/dsh.mjs +284 -0
  30. package/src/gate-adapters/grok.mjs +112 -0
  31. package/src/gate-adapters/hermes.mjs +217 -0
  32. package/src/gate-adapters/hook-files.mjs +156 -0
  33. package/src/gate-adapters/index.mjs +131 -0
  34. package/src/gate-adapters/openclaw-plugin/gate-client.js +205 -0
  35. package/src/gate-adapters/openclaw-plugin/index.js +25 -0
  36. package/src/gate-adapters/openclaw-plugin/openclaw.plugin.json +9 -0
  37. package/src/gate-adapters/openclaw-plugin/package.json +15 -0
  38. package/src/gate-adapters/openclaw.mjs +288 -0
  39. package/src/gate-adapters/pi.mjs +146 -0
  40. package/src/gate.mjs +18 -0
  41. package/src/harness-updates.mjs +170 -0
  42. package/src/included-usage.mjs +344 -0
  43. package/src/jobs.mjs +135 -0
  44. package/src/json-reply.mjs +22 -0
  45. package/src/learner.mjs +97 -67
  46. package/src/maintenance.mjs +18 -0
  47. package/src/mcp-server.mjs +228 -0
  48. package/src/model-catalog.mjs +195 -0
  49. package/src/model-selection.mjs +67 -0
  50. package/src/paths.mjs +23 -0
  51. package/src/pool.mjs +69 -0
  52. package/src/process-manager.mjs +246 -0
  53. package/src/process-worker.mjs +18 -0
  54. package/src/reasoning.mjs +231 -0
  55. package/src/remote-operation.mjs +76 -0
  56. package/src/review.mjs +241 -0
  57. package/src/reviews.mjs +25 -0
  58. package/src/router-benchmark-corpus.mjs +16 -0
  59. package/src/router-benchmark.mjs +208 -0
  60. package/src/router.mjs +265 -346
  61. package/src/runtime.mjs +30 -8
  62. package/src/session/claude.mjs +358 -0
  63. package/src/session/codex.mjs +501 -0
  64. package/src/session/result.mjs +90 -0
  65. package/src/session/resume.mjs +393 -0
  66. package/src/session/run.mjs +258 -0
  67. package/src/session-jobs.mjs +77 -0
  68. package/src/setup.mjs +6 -3
  69. package/src/ssss-store.mjs +20 -0
  70. package/src/telemetry.mjs +267 -0
  71. package/src/termination.mjs +28 -0
  72. package/src/threads.mjs +150 -0
  73. package/src/usage-queue.mjs +137 -0
  74. package/src/verify-ssss.mjs +102 -0
  75. package/src/worker.mjs +955 -84
  76. package/src/worktree.mjs +244 -0
  77. package/ui/chunks/adapter-docs-freshness.md +16 -0
  78. package/ui/chunks/chat-handoff.md +26 -0
  79. package/ui/chunks/fleet-maintenance.md +21 -0
  80. package/ui/chunks/harness-inventory.md +21 -0
  81. package/ui/chunks/included-access.md +18 -0
  82. package/ui/chunks/included-usage-verification.md +15 -0
  83. package/ui/chunks/independent-review.md +17 -0
  84. package/ui/chunks/managed-execution.md +20 -0
  85. package/ui/chunks/official-documentation.md +18 -0
  86. package/ui/chunks/quota-recovery.md +21 -0
  87. package/ui/chunks/review-routing-decision.md +16 -0
  88. package/ui/chunks/route-work.md +18 -0
  89. package/ui/chunks/routing-evidence.md +18 -0
  90. package/ui/chunks/run-ledger.md +18 -0
  91. package/ui/chunks/session-controls.md +16 -0
  92. package/ui/home.js +198 -0
  93. package/ui/DESIGN.md +0 -32
  94. package/ui/card.js +0 -845
@@ -0,0 +1,244 @@
1
+ /** Isolated git checkouts for writing and verifying agents. Nothing here merges into the operator's branch. */
2
+ import fs from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import { spawnSync } from 'node:child_process';
6
+
7
+ const SECRET_FILE = /^(\.env(\..*)?|.*\.(pem|key|p12|pfx)|secrets\.enc|id_(rsa|ed25519|ecdsa)|credentials(\.json)?)$/i;
8
+ const git = (cwd, args, timeout = 30000, options) => {
9
+ assertGitPointer(cwd, options);
10
+ return spawnSync('git', args, { cwd, encoding: 'utf8', timeout, maxBuffer: 64 * 1024 * 1024 });
11
+ };
12
+ function must(cwd, args, what, options) {
13
+ const result = git(cwd, args, 30000, options);
14
+ if (result.status !== 0) throw new Error(`${what} failed: ${String(result.stderr || result.error || '').trim().slice(0, 300)}`);
15
+ return result.stdout.trim();
16
+ }
17
+ export const isGitRepo = cwd => git(cwd, ['rev-parse', '--is-inside-work-tree']).status === 0;
18
+ export const headCommit = cwd => must(cwd, ['rev-parse', 'HEAD'], 'Reading HEAD');
19
+ export const isDirty = cwd => git(cwd, ['status', '--porcelain']).stdout.trim().length > 0;
20
+ export const diffBetween = (cwd, base, head) => must(cwd, ['diff', `${base}...${head}`], 'Reading the diff');
21
+
22
+ /** Checkouts this process created and has not removed, so termination can clean them up. */
23
+ const ACTIVE_WORKTREES = new Map();
24
+
25
+ /** `branch` creates a new branch from `ref`. Without it, the checkout is detached at `ref` (read-only use). */
26
+ export function createWorktree(cwd, { branch, ref = 'HEAD', prefix = 'meta-harness-', existingBranch = false } = {}) {
27
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
28
+ const args = branch ? existingBranch ? ['worktree', 'add', directory, branch] : ['worktree', 'add', '-b', branch, directory, ref] : ['worktree', 'add', '--detach', directory, ref];
29
+ const result = git(cwd, args, 120000);
30
+ if (result.status !== 0) {
31
+ fs.rmSync(directory, { recursive: true, force: true });
32
+ throw new Error(`Creating a worktree failed: ${String(result.stderr).trim().slice(0, 300)}`);
33
+ }
34
+ ACTIVE_WORKTREES.set(directory, { cwd, branch: branch || null, base: headCommit(directory) });
35
+ seedMandatorySkills(cwd, directory);
36
+ linkPrivatePlans(cwd, directory);
37
+ return directory;
38
+ }
39
+ /**
40
+ * Plans in docs/projects are private and untracked in public repositories, so a checkout lacks them
41
+ * and an agent would start a duplicate plan (A-116). Link the one real plan folder in; never commit it.
42
+ */
43
+ const PLANS = 'docs/projects';
44
+ function linkPrivatePlans(cwd, directory) {
45
+ const root = git(cwd, ['rev-parse', '--show-toplevel']).stdout.trim();
46
+ const source = path.join(root, PLANS), target = path.join(directory, PLANS);
47
+ if (!root || !fs.existsSync(source) || fs.existsSync(target)) return;
48
+ if (git(cwd, ['ls-files', '--', PLANS]).stdout.trim()) return;
49
+ fs.mkdirSync(path.dirname(target), { recursive: true });
50
+ fs.symlinkSync(source, target);
51
+ }
52
+ /**
53
+ * An agent's own Total Recall preflight needs these two files at the repository root, and they are
54
+ * usually gitignored, so a fresh checkout lacks them and every agent inside it would report itself blocked.
55
+ */
56
+ const MANDATORY_SKILLS = ['.agent/skills/total-recall/SKILL.md', '.agent/skills/ssss/SKILL.md'];
57
+ function seedMandatorySkills(cwd, directory) {
58
+ const root = git(cwd, ['rev-parse', '--show-toplevel']).stdout.trim();
59
+ for (const file of MANDATORY_SKILLS) {
60
+ const source = path.join(root, file), target = path.join(directory, file);
61
+ if (fs.existsSync(source) && !fs.existsSync(target)) {
62
+ fs.mkdirSync(path.dirname(target), { recursive: true });
63
+ fs.copyFileSync(source, target);
64
+ }
65
+ }
66
+ }
67
+ /** Gates need dependencies. Link them only for the gate, after the agent has finished, so no agent can write through the link. */
68
+ export function linkDependencies(cwd, directory) {
69
+ const modules = path.join(cwd, 'node_modules');
70
+ if (fs.existsSync(modules) && !fs.existsSync(path.join(directory, 'node_modules'))) fs.symlinkSync(modules, path.join(directory, 'node_modules'));
71
+ // The repository's gate configuration is usually gitignored too, and without it the gate could not run here.
72
+ const root = git(cwd, ['rev-parse', '--show-toplevel']).stdout.trim();
73
+ const quality = path.join(root, '.agent/skills/code-quality');
74
+ const target = path.join(directory, '.agent/skills/code-quality');
75
+ if (fs.existsSync(quality) && !fs.existsSync(target)) fs.cpSync(quality, target, { recursive: true, filter: source => !source.includes(`${path.sep}reports`) });
76
+ }
77
+ /**
78
+ * Give an agent's checkout its own dependencies before it starts (A-109). A link would let an
79
+ * agent's `npm install` write into the operator's tree, so the checkout gets a copy-on-write
80
+ * clone of `node_modules` (macOS clonefile, Linux reflink: no extra disk), or, when the operator
81
+ * has none, a frozen install from the lockfile. Returns what it did, for the attempt record.
82
+ */
83
+ export function provideDependencies(cwd, directory, { run = spawnSync } = {}) {
84
+ if (!fs.existsSync(path.join(directory, 'package.json'))) return { action: 'none', reason: 'no package.json' };
85
+ const target = path.join(directory, 'node_modules');
86
+ if (fs.existsSync(target)) return { action: 'present' };
87
+ const modules = path.join(cwd, 'node_modules');
88
+ if (fs.existsSync(modules)) {
89
+ const args = process.platform === 'darwin' ? ['-c', '-R', modules, target] : ['-a', '--reflink=auto', modules, target];
90
+ const copied = run('cp', args, { stdio: 'ignore' });
91
+ if (copied.status === 0) return { action: 'cloned' };
92
+ }
93
+ const lock = [['package-lock.json', 'npm', ['ci', '--no-audit', '--no-fund']], ['pnpm-lock.yaml', 'pnpm', ['install', '--frozen-lockfile']], ['yarn.lock', 'yarn', ['install', '--frozen-lockfile']]]
94
+ .find(([file]) => fs.existsSync(path.join(directory, file)));
95
+ if (!lock) return { action: 'none', reason: 'no lockfile' };
96
+ const installed = run(lock[1], lock[2], { cwd: directory, stdio: 'ignore', timeout: 600000 });
97
+ return installed.status === 0 ? { action: 'installed', manager: lock[1] } : { action: 'failed', manager: lock[1] };
98
+ }
99
+
100
+ /**
101
+ * Push a finished job's branch (A-113, Greg 2026-11-09: agents push finished work themselves).
102
+ * Only `meta-harness/...` branches are pushed, so a job can never push a deploy branch.
103
+ * No `origin` remote means nothing to push. Returns what happened, for the job record.
104
+ */
105
+ export function pushBranch(cwd, branch) {
106
+ if (!branch || !branch.startsWith('meta-harness/')) return { pushed: false, reason: 'not a job branch' };
107
+ if (git(cwd, ['remote', 'get-url', 'origin']).status !== 0) return { pushed: false, reason: 'no origin remote' };
108
+ const result = git(cwd, ['push', '-q', '-u', 'origin', `${branch}:${branch}`], 120000);
109
+ return result.status === 0 ? { pushed: true, remote: 'origin', branch } : { pushed: false, reason: String(result.stderr || result.error || '').trim().slice(0, 300) };
110
+ }
111
+ export const deleteBranch = (cwd, branch) => git(cwd, ['branch', '-D', branch]).status === 0;
112
+ export function removeWorktree(cwd, directory) {
113
+ if (!directory) return;
114
+ ACTIVE_WORKTREES.delete(directory);
115
+ for (const link of ['node_modules', PLANS]) {
116
+ try { if (fs.lstatSync(path.join(directory, link)).isSymbolicLink()) fs.rmSync(path.join(directory, link)); } catch { /* no link */ }
117
+ }
118
+ git(cwd, ['worktree', 'remove', '--force', directory], 60000);
119
+ fs.rmSync(directory, { recursive: true, force: true });
120
+ GIT_POINTERS.delete(path.resolve(directory));
121
+ }
122
+ /**
123
+ * An agent user can write the checkout directory, so it can unlink or replace `<cwd>/.git` even though it
124
+ * cannot write inside it. Record it before such a run; commitAll verifies it before root runs git there,
125
+ * because a planted hook or config (core.hooksPath, core.fsmonitor, filter drivers) would run as root.
126
+ */
127
+ const GIT_POINTERS = new Map();
128
+ const gitPointerPath = directory => path.join(path.resolve(directory), '.git');
129
+ /** Filesystem-only inventory: never enter git metadata or follow workspace symlinks. */
130
+ export function gitMetadataEntries(directory) {
131
+ const pending = [path.resolve(directory)], found = [];
132
+ while (pending.length) {
133
+ const cwd = pending.pop();
134
+ const entries = fs.readdirSync(cwd, { withFileTypes: true });
135
+ const dot = entries.find(entry => entry.name === '.git');
136
+ if (dot) found.push({ cwd, metadata: path.join(cwd, '.git'), symlink: dot.isSymbolicLink() });
137
+ const bare = entries.some(entry => entry.name === 'HEAD' && entry.isFile()) &&
138
+ ['objects', 'refs'].every(name => entries.some(entry => entry.name === name && entry.isDirectory()));
139
+ if (bare) { found.push({ cwd, metadata: cwd, symlink: false }); continue; }
140
+ for (const entry of entries) if (entry.name !== '.git' && entry.isDirectory()) pending.push(path.join(cwd, entry.name));
141
+ }
142
+ return found;
143
+ }
144
+
145
+ function snapshotGitPath(dot, lstat) {
146
+ let stat;
147
+ try { stat = lstat(dot); } catch (error) {
148
+ if (error.code !== 'ENOENT') throw error;
149
+ return { type: 'missing' };
150
+ }
151
+ if (stat.isSymbolicLink()) throw new Error(`${dot} is a symlink, so it cannot be protected from the agent user.`);
152
+ if (!stat.isDirectory() && !stat.isFile()) throw new Error(`${dot} is not a git directory or pointer file.`);
153
+ return { type: stat.isDirectory() ? 'directory' : 'file', ino: stat.ino, dev: stat.dev,
154
+ ...(stat.isFile() ? { content: fs.readFileSync(dot) } : {}) };
155
+ }
156
+ export function recordGitPointer(directory, { lstat = fs.lstatSync, protect = [] } = {}) {
157
+ // A second attempt cannot bless metadata that a previous agent already replaced.
158
+ assertGitPointer(directory, { lstat });
159
+ const dot = gitPointerPath(directory);
160
+ const paths = [...new Set([dot, ...protect.map(item => path.resolve(item))])];
161
+ const snapshots = new Map(paths.map(item => [item, snapshotGitPath(item, lstat)]));
162
+ const pointer = snapshots.get(dot);
163
+ GIT_POINTERS.set(path.resolve(directory), { snapshots, entries: new Set(gitMetadataEntries(directory).map(entry => entry.metadata)) });
164
+ return pointer;
165
+ }
166
+ /** The reason the checkout's `.git` is no longer what was recorded, or null. Directories never recorded are not checked. */
167
+ export function gitPointerProblem(directory = process.cwd(), { lstat = fs.lstatSync } = {}) {
168
+ const recorded = GIT_POINTERS.get(path.resolve(directory));
169
+ if (!recorded) return null;
170
+ const { snapshots, entries } = recorded;
171
+ for (const [dot, expected] of snapshots) {
172
+ const problem = gitPathProblem(dot, expected, lstat);
173
+ if (problem) return problem;
174
+ // lstat on the final component alone would follow an agent-replaced ancestor symlink.
175
+ const relative = path.relative(path.resolve(directory), dot);
176
+ if (relative && relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)) {
177
+ for (let parent = path.dirname(dot); parent !== path.resolve(directory); parent = path.dirname(parent)) {
178
+ if (lstat(parent).isSymbolicLink()) return `${parent} is now a symlink`;
179
+ }
180
+ }
181
+ }
182
+ // Root git may inspect embedded repos/submodules. Metadata created during the run is untrusted too.
183
+ try {
184
+ for (const entry of gitMetadataEntries(directory)) if (!entries.has(entry.metadata)) return `${entry.metadata} was created`;
185
+ } catch (error) { return `Cannot inspect git metadata in ${directory}: ${error.message}`; }
186
+ return null;
187
+ }
188
+ function gitPathProblem(dot, expected, lstat) {
189
+ let stat;
190
+ try { stat = lstat(dot); } catch (error) {
191
+ if (error.code !== 'ENOENT') throw error;
192
+ return expected.type === 'missing' ? null : `${dot} was removed`;
193
+ }
194
+ if (expected.type === 'missing') return `${dot} was created`;
195
+ if (stat.isSymbolicLink()) return `${dot} is now a symlink`;
196
+ if (stat.uid !== 0) return `${dot} is not owned by root (uid ${stat.uid})`;
197
+ if (stat.ino !== expected.ino || stat.dev !== expected.dev) return `${dot} was replaced`;
198
+ if (expected.type === 'directory') return stat.isDirectory() ? null : `${dot} was replaced`;
199
+ if (!stat.isFile()) return `${dot} was replaced`;
200
+ return fs.readFileSync(dot).equals(expected.content) ? null : `${dot} changed`;
201
+ }
202
+ function assertGitPointer(directory, options) {
203
+ const problem = gitPointerProblem(directory, options);
204
+ if (problem) throw new Error(`Refusing to run git as root: ${problem} during an agent-user run.`);
205
+ }
206
+ /** Commit whatever the agent left. Returns the commit, or null when it changed nothing. */
207
+ export function commitAll(directory, message, { lstat = fs.lstatSync } = {}) {
208
+ assertGitPointer(directory, { lstat });
209
+ const run = args => git(directory, args, 30000, { lstat });
210
+ const require = (args, what) => must(directory, args, what, { lstat });
211
+ // Stage everything git does not ignore. Naming node_modules in the pathspec fails when it is
212
+ // ignored (A-114), so it is unstaged afterwards instead, for repositories that do not ignore it.
213
+ require(['add', '-A'], 'Staging agent changes');
214
+ run(['rm', '-r', '--cached', '-q', '--ignore-unmatch', '--', 'node_modules']);
215
+ // The linked private plan folder (A-116) is the operator's, never part of the agent's commit.
216
+ try { if (fs.lstatSync(path.join(directory, PLANS)).isSymbolicLink()) run(['rm', '-r', '--cached', '-q', '--ignore-unmatch', '--', PLANS]); } catch { /* no link */ }
217
+ // Seeded skills are scaffolding, not the agent's work. A repository that tracks them keeps normal history.
218
+ for (const file of MANDATORY_SKILLS) if (run(['cat-file', '-e', `HEAD:${file}`]).status !== 0) run(['rm', '--cached', '-q', '--ignore-unmatch', '--', file]);
219
+ if (run(['diff', '--cached', '--quiet']).status === 0) return null;
220
+ const staged = run(['diff', '--cached', '--name-only']).stdout.split('\n').filter(Boolean);
221
+ const secret = staged.filter(file => SECRET_FILE.test(path.basename(file)));
222
+ if (secret.length) throw new Error(`Refusing to commit files that look like credentials: ${secret.join(', ')}`);
223
+ require(['commit', '-m', message], 'Committing agent changes');
224
+ return require(['rev-parse', 'HEAD'], 'Reading HEAD');
225
+ }
226
+ /** Remove owned checkouts. Cancellation keeps branches that contain work. */
227
+ export function removeActiveWorktrees({ preserveChanges = false } = {}) {
228
+ const saved = [];
229
+ for (const [directory, { cwd, branch, base }] of [...ACTIVE_WORKTREES]) {
230
+ let wip = null;
231
+ if (preserveChanges && branch) {
232
+ try { wip = commitAll(directory, 'meta-harness: unfinished work from a cancelled job'); }
233
+ catch (error) {
234
+ // Do not destroy edits if the WIP commit fails (for example, a credential file).
235
+ saved.push({ branch, directory, error: error.message });
236
+ continue;
237
+ }
238
+ if (wip || headCommit(directory) !== base) saved.push({ branch, wip, commit: headCommit(directory) });
239
+ }
240
+ removeWorktree(cwd, directory);
241
+ if (branch && (!preserveChanges || !saved.some(item => item.branch === branch))) deleteBranch(cwd, branch);
242
+ }
243
+ return saved;
244
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: adapter-docs-freshness
5
+ title: Check harness documentation freshness
6
+ description: Distinguish an absent documentation cache from an outdated snapshot, then inspect the official source that governs the adapter.
7
+ timestamp: "2026-11-08T23:12:00Z"
8
+ intents: [check harness docs freshness, find the official source for a harness, verify adapter behavior against current docs]
9
+ surfaces: [page]
10
+ operations: [docs-status, docs-sources, docs-search, docs-read]
11
+ data: ["docs-status:/ok", "docs-sources:/sources"]
12
+ ---
13
+ <section>
14
+ <h2>Check the documentation cache before using it</h2>
15
+ <p>Read documentation status and identify the official source. Search the current snapshot for the behavior you need. Refresh stale or missing documentation through the owner before relying on it.</p>
16
+ </section>
@@ -0,0 +1,26 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ title: Chat handoff
4
+ description: Explain how Total Recall passes the selected brain IDs to a draft in the default Metaharness Chat destination.
5
+ timestamp: '2026-11-08T04:00:00Z'
6
+ plugin: meta-harness
7
+ id: chat-handoff
8
+ intents:
9
+ - open the default chat harness
10
+ - carry selected brains into chat
11
+ - prepare a draft for review
12
+ surfaces: [page, bottom]
13
+ panel: home
14
+ operations: [chat-target, chat-default]
15
+ data: ["chat-target:/configured", "chat-target:/harness/id", "chat-default:/configured"]
16
+ ---
17
+ <section aria-label="Metaharness Chat handoff" data-design-component="chat-handoff" style="box-sizing:border-box;min-width:0;padding:var(--spacing-inset,16px);border:1px solid var(--color-line,#334155);border-radius:var(--radius-frame,8px);background:var(--color-canvas,#0c1427);color:var(--color-text,#f1f5f9);font:14px/1.5 var(--typography-body-font-family,system-ui)">
18
+ <p style="margin:0 0 6px;color:var(--color-signal,#38bdf8);font:600 11px/1.4 var(--typography-label-font-family,monospace);letter-spacing:.08em;text-transform:uppercase">Metaharness / Chat</p>
19
+ <h2 style="margin:0 0 12px;font-size:var(--typography-title-font-size,18px);line-height:1.2;font-weight:650">Carry your brain selection into Chat</h2>
20
+ <ol aria-label="Handoff stages" style="display:flex;flex-wrap:wrap;gap:6px 24px;margin:0 0 12px;padding:8px 12px 8px 32px;border-left:2px solid var(--color-signal,#38bdf8);background:var(--color-surface,#1e293b)">
21
+ <li>Choose brains</li>
22
+ <li>Open the default harness</li>
23
+ <li>Review the draft</li>
24
+ </ol>
25
+ <p style="margin:0;color:var(--color-muted,#94a3b8)">Chat keeps the same default as you switch brains. The draft carries the selected brain IDs so the harness can resolve them through Total Recall.</p>
26
+ </section>
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: fleet-maintenance
5
+ title: Maintain the harness registry
6
+ description: Review upstream versions, register supported adapters and explicitly maintain integrations.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [check harness updates, inspect changelog, configure a custom harness, maintain fleet integrations]
9
+ surfaces: [page]
10
+ operations: [upstream, changelog, adapter, setup, maintenance]
11
+ data: ["adapter:/active/0/id"]
12
+ ---
13
+
14
+ <section>
15
+ <h2>Maintain the harness registry</h2>
16
+ <dl>
17
+ <dt><strong>Release evidence</strong></dt><dd>Check <code>upstream</code> and request <code>changelog</code> where an adapter supports it.</dd>
18
+ <dt><strong>Adapter declarations</strong></dt><dd>Inspect the active registry with <code>adapter list</code>. Register a reviewed definition through the same owner command.</dd>
19
+ <dt><strong>Integration work</strong></dt><dd>Choose a host before using <code>setup</code> or <code>maintenance</code> and review the resulting receipts.</dd>
20
+ </dl>
21
+ </section>
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: harness-inventory
5
+ title: Inspect harness availability
6
+ description: Compare registered adapters, selected nodes, observed installations and adoption evidence.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [inspect harness inventory, check local agents, compare mesh harness availability, verify managed adoption]
9
+ surfaces: [page, right]
10
+ operations: [catalog, status, nodes, inspect, adoption]
11
+ data: ["catalog:/permissions"]
12
+ ---
13
+
14
+ <section style="border-inline-start:2px solid var(--color-signal,#38bdf8);padding-inline-start:1rem">
15
+ <h2>Inspect harness availability</h2>
16
+ <dl>
17
+ <dt><strong>Registry</strong></dt><dd><code>catalog</code> lists the configured adapters and supported command effects.</dd>
18
+ <dt><strong>Selected host</strong></dt><dd><code>nodes</code> lists execution targets. Use <code>inspect</code> or <code>status</code> for observed binary and login state on a specific node.</dd>
19
+ <dt><strong>Managed adoption</strong></dt><dd><code>adoption</code> brings native gate activity and actual managed run receipts together.</dd>
20
+ </dl>
21
+ </section>
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: included-access
5
+ title: Inspect included access
6
+ description: Review the saved usage policy and the separate approval paths for provider bindings.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [check included usage policy, inspect harness billing bindings, verify approved connector access]
9
+ surfaces: [page, right]
10
+ operations: [included-status, included-enforce, included-bind-claude, included-bind-claude-plan, openrouter-bind]
11
+ data: ["included-status:/enabled", "included-status:/policyVersion"]
12
+ ---
13
+
14
+ <section>
15
+ <h2>Inspect included access</h2>
16
+ <p>Read <code>included-status</code> to check the saved policy. The policy distinguishes included subscription access from approved provider bindings.</p>
17
+ <p>Use the owning CLI for an explicit enforcement or binding change. Validate billing evidence and use the Auth store for credential references.</p>
18
+ </section>
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: included-usage-verification
5
+ title: Verify included harness access before dispatch
6
+ description: Read the registered adapters and included-usage status to check whether a proposed harness may run under existing access.
7
+ timestamp: "2026-11-08T23:12:00Z"
8
+ intents: [verify included access before dispatch, find harnesses covered by current access, distinguish subscription use from provider spend]
9
+ surfaces: [page]
10
+ operations: [catalog, included-status, quota]
11
+ ---
12
+ <section>
13
+ <h2>Check which harness can run under existing access</h2>
14
+ <ol><li>Identify the intended adapter in the harness catalog.</li><li>Read included usage and quota for that adapter.</li><li>Queue or reroute when the permitted adapter is unavailable.</li></ol>
15
+ </section>
@@ -0,0 +1,17 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: independent-review
5
+ title: Review a real change
6
+ description: Select the target diff and known author for an independent Metaharness review.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [run independent code review, review a diff, attach review evidence to a thread]
9
+ surfaces: [page]
10
+ operations: [review]
11
+ ---
12
+
13
+ <section style="border-block-start:1px solid var(--color-line,#334155)">
14
+ <h2>Review a real change</h2>
15
+ <p>Select a diff, staged changes or a supported review target. Supply the known author and use the owner’s independent reviewer selection.</p>
16
+ <p>Attach the resulting receipt to its work thread when one is available. Read the verdict and any findings with their source locations.</p>
17
+ </section>
@@ -0,0 +1,20 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: managed-execution
5
+ title: Prepare managed execution
6
+ description: Choose a harness, node, workspace and allowed effects before running a managed command.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [run a plugin command through a harness, dispatch a managed task, maintain an agent runtime]
9
+ surfaces: [page]
10
+ operations: [run-command, runtime, dispatch]
11
+ ---
12
+
13
+ <section>
14
+ <h2>Prepare managed execution</h2>
15
+ <ol>
16
+ <li>Choose a verified node and its absolute workspace.</li>
17
+ <li>Use <code>run-command</code> for a declared plugin operation, <code>dispatch</code> for a task request, or <code>runtime</code> for an allowed maintenance action.</li>
18
+ <li>Submit the approved request through the owner. Read the returned exit status and native tool evidence before treating the task as finished.</li>
19
+ </ol>
20
+ </section>
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: official-documentation
5
+ title: Read verified harness documentation
6
+ description: Find approved sources and inspect cached documentation integrity and freshness.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [find harness documentation, search official command docs, inspect documentation cache freshness]
9
+ surfaces: [page, right]
10
+ operations: [docs-status, docs-sources, docs-read, docs-search, docs-refresh, docs-ensure]
11
+ data: ["docs-status:/ok", "docs-sources:/sources"]
12
+ ---
13
+
14
+ <article>
15
+ <h2>Read verified harness documentation</h2>
16
+ <p>Start with <code>docs-sources</code> for the approved official sources. Use <code>docs-status</code> to check the local copy, then <code>docs-search</code> and <code>docs-read</code> to locate the relevant section.</p>
17
+ <p>Use <code>docs-ensure</code> to refresh missing or stale pages, or <code>docs-refresh</code> to request a refresh. Verify the result through the cache status.</p>
18
+ </article>
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: quota-recovery
5
+ title: Inspect queued work and quota
6
+ description: Review observed usage and decide whether to retry or cancel a queued job.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [show quota wait queue, inspect harness limits, retry after quota resets, cancel queued job]
9
+ surfaces: [page, right]
10
+ operations: [quota, usage-queue, usage-retry, usage-cancel]
11
+ data: ["usage-queue:/ok"]
12
+ ---
13
+
14
+ <section>
15
+ <h2>Inspect queued work and quota</h2>
16
+ <ol>
17
+ <li>Use <code>quota</code> for observed limits on the selected host.</li>
18
+ <li>Use <code>usage-queue</code> to find jobs waiting for included capacity.</li>
19
+ <li>After reviewing the selected job, use <code>usage-retry</code> for an explicit retry or <code>usage-cancel</code> to stop waiting.</li>
20
+ </ol>
21
+ </section>
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: review-routing-decision
5
+ title: Explain why a harness was selected
6
+ description: Review the selected adapter, classifier source and surrounding routing evidence before committing a managed run.
7
+ timestamp: "2026-11-08T23:12:00Z"
8
+ intents: [explain a harness routing choice, review selected adapter before execution, compare route evidence with task needs]
9
+ surfaces: [page]
10
+ operations: [route, benchmarks, learn]
11
+ data: ["route:/selected", "route:/classifier/source", "benchmarks:/synced", "learn:/totalHistoryRuns"]
12
+ ---
13
+ <section>
14
+ <h2>Review the route decision</h2>
15
+ <p>Compare the chosen adapter with the classifier source and available history. A route receipt records the decision. Inspect run evidence separately after execution.</p>
16
+ </section>
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: route-work
5
+ title: Preview task routing
6
+ description: Compare harness choice and workflow stages before approving managed execution.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [preview harness route, decompose a task, plan a coordinated run, inspect selected harness]
9
+ surfaces: [page]
10
+ operations: [route, decompose, coordinate, orchestrate]
11
+ data: ["route:/selected", "route:/classifier/source"]
12
+ ---
13
+
14
+ <section>
15
+ <h2>Preview task routing</h2>
16
+ <p><code>route</code> explains the selected harness and classification source. <code>decompose</code> lays out the work stages.</p>
17
+ <p>Use <code>coordinate</code> or <code>orchestrate</code> to inspect the roles and candidate assignments. Add <code>--execute</code> only after approving the plan, workspace and gates.</p>
18
+ </section>
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: routing-evidence
5
+ title: Review routing evidence
6
+ description: Compare sourced benchmark metadata with observed local run history and alert outcomes.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [review harness benchmarks, inspect routing scorecard, check quota alerts, inspect run history]
9
+ surfaces: [page, right]
10
+ operations: [benchmarks, learn, alerts]
11
+ data: ["benchmarks:/synced", "learn:/totalHistoryRuns"]
12
+ ---
13
+
14
+ <section style="border-inline-start:2px solid var(--color-signal,#38bdf8);padding-inline-start:1rem">
15
+ <h2>Review routing evidence</h2>
16
+ <p><code>benchmarks</code> separates sourced figures from the pass rates measured on this machine. <code>learn</code> summarizes the managed run receipts and identifies recurring limits.</p>
17
+ <p>Use <code>alerts</code> for an explicit check of the operator alert path. Review delivery evidence through the owning alert plugin.</p>
18
+ </section>
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: run-ledger
5
+ title: Follow managed work
6
+ description: Inspect work threads and track Metaharness-owned processes using recorded identities.
7
+ timestamp: "2026-11-08T09:34:00Z"
8
+ intents: [inspect managed process, follow a work thread, find a run receipt, check agent progress]
9
+ surfaces: [page, right]
10
+ operations: [threads, process]
11
+ data: ["process:/ok"]
12
+ ---
13
+
14
+ <section>
15
+ <h2>Follow managed work</h2>
16
+ <p>Use <code>threads list</code> to find tracked work. Use <code>process list</code> to find Metaharness-owned processes and select a run by its recorded ID.</p>
17
+ <p>Inspect the selected process status or log in the owner. Keep the run receipt with the relevant work thread.</p>
18
+ </section>
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: meta-harness
4
+ id: session-controls
5
+ title: Session controls and reviews
6
+ description: Fork, resume, cancel, reply, approve, interrupt, set goals, manage MCP servers, watch progress, and inspect independent reviews.
7
+ timestamp: "2026-11-14T08:51:00Z"
8
+ intents: [control harness sessions, approve or interrupt run, watch session, inspect independent reviews, manage mcp]
9
+ surfaces: [page]
10
+ operations: [fork, resume, cancel, reply, approve, interrupt, goal, mcp, watch, reviews]
11
+ ---
12
+
13
+ <section>
14
+ <h2>Session controls &amp; reviews</h2>
15
+ <p>Manage active harness runs (fork, resume, reply, approve, interrupt, cancel, goal, watch), configure MCP bindings, and review independent verification runs.</p>
16
+ </section>