harness-everything 0.57.4 → 1.0.0
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.releaserc.json +2 -0
- package/AGENTS.md +8 -2
- package/CHANGELOG.md +23 -0
- package/README.md +4 -4
- package/benchmarks/results/live-host/agy-2026-11-22/README.md +49 -0
- package/benchmarks/results/live-host/agy-2026-11-23/README.md +48 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md +40 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/edit-state-final.json +11 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/events-2026-11-24.jsonl +103 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/host-version.txt +3 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/live-event-trace-probe.js +11 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/plugin-load-lines.txt +2 -0
- package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/reminder-excerpt.txt +1 -0
- package/ci/doc-capability-consistency.test.js +15 -3
- package/ci/lib/opencode-v2-driver.js +169 -0
- package/ci/mechanism-2ao-plugin-sync.test.js +235 -2
- package/ci/mechanism-2n-opencode-plugin.test.js +387 -223
- package/ci/mechanism-2p-opencode-v2-entrypoint.test.js +24 -15
- package/ci/mechanism-2u-issue-42-regressions.test.js +41 -2
- package/ci/mechanism-2w-platform-compatibility.test.js +29 -5
- package/ci/mechanism-2x-release-automation.test.js +3 -1
- package/ci/mechanism-30-opencode-plugin-loadability.test.js +78 -45
- package/ci/mechanism-338-opencode-async.test.js +367 -194
- package/ci/mechanism-341-opencode-lane.test.js +143 -183
- package/ci/mechanism-39-opencode-verify-outcomes.test.js +118 -86
- package/ci/mechanism-394-opencode-ledger-lesson.test.js +46 -97
- package/ci/mechanism-397-opencode-observations.test.js +58 -47
- package/ci/mechanism-453-opencode-v2-driver.test.js +51 -0
- package/ci/mechanism-453-opencode-v2-only-events.test.js +241 -0
- package/ci/mechanism-agy-hooks.test.js +1096 -0
- package/ci/mechanism-agy-plugin-package.test.js +76 -0
- package/ci/telemetry.test.js +31 -24
- package/docs/architecture.md +4 -2
- package/docs/platform-capabilities.md +62 -26
- package/docs/platform-compatibility.json +41 -6
- package/docs/system-one-observations.md +1 -1
- package/docs/telemetry.md +1 -1
- package/docs/troubleshooting.md +2 -2
- package/hooks/scripts/agy-post-tool.js +124 -0
- package/hooks/scripts/agy-pre-invocation.js +185 -0
- package/hooks/scripts/agy-pre-tool.js +158 -0
- package/hooks/scripts/agy-session-start.js +54 -0
- package/hooks/scripts/agy-stop.js +152 -0
- package/hooks/scripts/lib/agy-adapter-core.js +168 -0
- package/hooks/scripts/state-persist.js +50 -10
- package/opencode-plugin/README.md +60 -66
- package/opencode-plugin/index.mjs +11 -13
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +18 -0
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/agy-post-tool.js +124 -0
- package/plugins/harness-everything/hooks/scripts/agy-pre-invocation.js +185 -0
- package/plugins/harness-everything/hooks/scripts/agy-pre-tool.js +158 -0
- package/plugins/harness-everything/hooks/scripts/agy-session-start.js +54 -0
- package/plugins/harness-everything/hooks/scripts/agy-stop.js +152 -0
- package/plugins/harness-everything/hooks/scripts/lib/agy-adapter-core.js +168 -0
- package/plugins/harness-everything/hooks/scripts/state-persist.js +50 -10
- package/plugins/harness-everything/hooks.json +44 -0
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/rules/AGENTS.md +117 -0
- package/sbom.cdx.json +12 -12
- package/scripts/plugin-sync.js +105 -14
- package/scripts/sync-openai-plugin.js +16 -1
- package/scripts/sync-release-version.js +1 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
function readJsonStdin(timeoutMs = 1500) {
|
|
7
|
+
return new Promise(resolve => {
|
|
8
|
+
let raw = '';
|
|
9
|
+
let settled = false;
|
|
10
|
+
|
|
11
|
+
const timer = setTimeout(() => {
|
|
12
|
+
if (settled) return;
|
|
13
|
+
settled = true;
|
|
14
|
+
try {
|
|
15
|
+
resolve(raw.trim() ? JSON.parse(raw) : {});
|
|
16
|
+
} catch (_) {
|
|
17
|
+
resolve({});
|
|
18
|
+
}
|
|
19
|
+
}, timeoutMs);
|
|
20
|
+
|
|
21
|
+
process.stdin.setEncoding('utf8');
|
|
22
|
+
process.stdin.on('data', chunk => { raw += chunk; });
|
|
23
|
+
process.stdin.on('end', () => {
|
|
24
|
+
if (settled) return;
|
|
25
|
+
settled = true;
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
try {
|
|
28
|
+
resolve(raw.trim() ? JSON.parse(raw) : {});
|
|
29
|
+
} catch (_) {
|
|
30
|
+
resolve({});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
process.stdin.on('error', () => {
|
|
34
|
+
if (settled) return;
|
|
35
|
+
settled = true;
|
|
36
|
+
clearTimeout(timer);
|
|
37
|
+
resolve({});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function resolveKernelRouter() {
|
|
43
|
+
const candidates = [
|
|
44
|
+
path.join(__dirname, '..', '..', '..', 'skills', 'harness-everything', 'scripts', 'kernel-router.js'),
|
|
45
|
+
path.join(__dirname, '..', '..', '..', 'harness-everything', 'scripts', 'kernel-router.js'),
|
|
46
|
+
path.join(__dirname, '..', '..', 'harness-everything', 'scripts', 'kernel-router.js')
|
|
47
|
+
];
|
|
48
|
+
return candidates.find(candidate => fs.existsSync(candidate)) || null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getAgySessionId(payload) {
|
|
52
|
+
if (!payload || typeof payload !== 'object') return '';
|
|
53
|
+
const candidate = payload.conversationId || payload.session_id || payload.sessionId || '';
|
|
54
|
+
return typeof candidate === 'string' ? candidate.trim() : String(candidate || '').trim();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function getAgyWorkspacePaths(payload) {
|
|
58
|
+
if (!payload || typeof payload !== 'object') return [];
|
|
59
|
+
const roots = [];
|
|
60
|
+
if (Array.isArray(payload.workspacePaths)) {
|
|
61
|
+
for (const entry of payload.workspacePaths) {
|
|
62
|
+
if (typeof entry === 'string' && entry.trim()) roots.push(entry.trim());
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (typeof payload.cwd === 'string' && payload.cwd.trim()) {
|
|
66
|
+
roots.push(payload.cwd.trim());
|
|
67
|
+
}
|
|
68
|
+
return [...new Set(roots)];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getAgyEffectiveCwd(payload) {
|
|
72
|
+
if (payload && typeof payload === 'object') {
|
|
73
|
+
if (typeof payload.cwd === 'string' && payload.cwd.trim()) {
|
|
74
|
+
return payload.cwd.trim();
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(payload.workspacePaths)) {
|
|
77
|
+
const first = payload.workspacePaths.find(entry => typeof entry === 'string' && entry.trim());
|
|
78
|
+
if (first) return first.trim();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return process.cwd();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function normalizeAgyStatePayload(payload, overrideCwd) {
|
|
85
|
+
const base = payload && typeof payload === 'object' ? payload : {};
|
|
86
|
+
const sessionId = getAgySessionId(base);
|
|
87
|
+
const effectiveCwd = (typeof overrideCwd === 'string' && overrideCwd.trim())
|
|
88
|
+
? overrideCwd.trim()
|
|
89
|
+
: getAgyEffectiveCwd(base);
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
...base,
|
|
93
|
+
...(sessionId ? { session_id: sessionId, sessionId, conversationId: sessionId } : {}),
|
|
94
|
+
cwd: effectiveCwd
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const MAX_SYMLINK_HOPS = 40;
|
|
99
|
+
const realpath = fs.realpathSync.native || fs.realpathSync;
|
|
100
|
+
|
|
101
|
+
function canonicalizePath(targetPath, baseDir, depth = 0) {
|
|
102
|
+
if (depth > MAX_SYMLINK_HOPS) return null;
|
|
103
|
+
if (typeof targetPath !== 'string' || !targetPath.trim()) return null;
|
|
104
|
+
const resolved = (typeof baseDir === 'string' && baseDir.trim())
|
|
105
|
+
? path.resolve(baseDir, targetPath)
|
|
106
|
+
: path.resolve(targetPath);
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
return realpath(resolved);
|
|
110
|
+
} catch (_) {
|
|
111
|
+
const suffix = [];
|
|
112
|
+
let current = resolved;
|
|
113
|
+
while (true) {
|
|
114
|
+
try {
|
|
115
|
+
const stat = fs.lstatSync(current);
|
|
116
|
+
if (stat.isSymbolicLink()) {
|
|
117
|
+
const linkTarget = fs.readlinkSync(current);
|
|
118
|
+
const resolvedLink = path.resolve(path.dirname(current), linkTarget);
|
|
119
|
+
const nextPath = suffix.length > 0 ? path.join(resolvedLink, ...suffix) : resolvedLink;
|
|
120
|
+
return canonicalizePath(nextPath, null, depth + 1);
|
|
121
|
+
}
|
|
122
|
+
} catch (_) {
|
|
123
|
+
// Entry does not exist yet; continue ascending to nearest existing ancestor.
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const parent = path.dirname(current);
|
|
127
|
+
if (parent === current) return resolved;
|
|
128
|
+
suffix.unshift(path.basename(current));
|
|
129
|
+
current = parent;
|
|
130
|
+
try {
|
|
131
|
+
const realAncestor = realpath(current);
|
|
132
|
+
return path.join(realAncestor, ...suffix);
|
|
133
|
+
} catch (_) {}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function isOutOfBoundsPath(filePath, allowedRoots, baseDir) {
|
|
139
|
+
if (typeof filePath !== 'string' || !filePath.trim()) return true;
|
|
140
|
+
const roots = (Array.isArray(allowedRoots) ? allowedRoots : [allowedRoots])
|
|
141
|
+
.filter(root => typeof root === 'string' && root.trim());
|
|
142
|
+
if (roots.length === 0) return false;
|
|
143
|
+
|
|
144
|
+
const resolveBase = (typeof baseDir === 'string' && baseDir.trim()) ? baseDir : roots[0];
|
|
145
|
+
const canonicalTarget = canonicalizePath(filePath, resolveBase);
|
|
146
|
+
if (!canonicalTarget) return true;
|
|
147
|
+
|
|
148
|
+
const normTarget = process.platform === 'win32' ? canonicalTarget.toLowerCase() : canonicalTarget;
|
|
149
|
+
return !roots.some(root => {
|
|
150
|
+
const canonicalRoot = canonicalizePath(root);
|
|
151
|
+
if (!canonicalRoot) return false;
|
|
152
|
+
const normRoot = process.platform === 'win32' ? canonicalRoot.toLowerCase() : canonicalRoot;
|
|
153
|
+
if (normTarget === normRoot) return true;
|
|
154
|
+
const prefix = normRoot.endsWith(path.sep) ? normRoot : normRoot + path.sep;
|
|
155
|
+
return normTarget.startsWith(prefix);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
module.exports = {
|
|
160
|
+
readJsonStdin,
|
|
161
|
+
resolveKernelRouter,
|
|
162
|
+
getAgySessionId,
|
|
163
|
+
getAgyWorkspacePaths,
|
|
164
|
+
getAgyEffectiveCwd,
|
|
165
|
+
normalizeAgyStatePayload,
|
|
166
|
+
canonicalizePath,
|
|
167
|
+
isOutOfBoundsPath
|
|
168
|
+
};
|
|
@@ -2,10 +2,40 @@
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const { getWorkspaceRoot, getSessionDir } = require('./lib/harness-state');
|
|
5
|
-
const { cwdOf, classifyShell, isVerificationShell, directMutationInWorkspace } = require('./lib/workflow-isolation');
|
|
5
|
+
const { cwdOf, classifyShell, isVerificationShell, directMutationInWorkspace, mutationPaths } = require('./lib/workflow-isolation');
|
|
6
|
+
const { getAgyWorkspacePaths, isOutOfBoundsPath } = require('./lib/agy-adapter-core');
|
|
6
7
|
const { observeTool } = require('./lib/telemetry');
|
|
7
8
|
const { readCodexToolOutcome } = require('./lib/codex-tool-outcome');
|
|
8
9
|
const codex = process.argv.includes('--codex');
|
|
10
|
+
const agy = process.argv.includes('--agy');
|
|
11
|
+
|
|
12
|
+
function agyMutationTargets(payload, toolName) {
|
|
13
|
+
if (toolName === 'apply_patch') {
|
|
14
|
+
return mutationPaths(payload).map(v => String(v || '').trim()).filter(Boolean);
|
|
15
|
+
}
|
|
16
|
+
const input = (payload && (payload.tool_input ?? payload.toolInput ?? payload.input)) || {};
|
|
17
|
+
const candidates = [
|
|
18
|
+
input.file_path,
|
|
19
|
+
input.filePath,
|
|
20
|
+
input.path,
|
|
21
|
+
input.TargetFile,
|
|
22
|
+
input.Path,
|
|
23
|
+
input.targetFile
|
|
24
|
+
];
|
|
25
|
+
const target = candidates.find(value => typeof value === 'string' && value.trim());
|
|
26
|
+
return target ? [target.trim()] : [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function agyDirectMutationInWorkspace(payload, mutationCwd, root, toolName) {
|
|
30
|
+
const targets = agyMutationTargets(payload, toolName);
|
|
31
|
+
if (targets.length === 0) return false;
|
|
32
|
+
const agyRoots = getAgyWorkspacePaths(payload);
|
|
33
|
+
if (typeof root === 'string' && root.trim() && !agyRoots.includes(root.trim())) {
|
|
34
|
+
agyRoots.push(root.trim());
|
|
35
|
+
}
|
|
36
|
+
if (agyRoots.length === 0) return false;
|
|
37
|
+
return targets.some(target => !isOutOfBoundsPath(target, agyRoots, mutationCwd));
|
|
38
|
+
}
|
|
9
39
|
|
|
10
40
|
function isSuccessfulMetadataStep(command, cwd) {
|
|
11
41
|
// A line break starts a second shell command, so it can never be metadata-only.
|
|
@@ -83,14 +113,19 @@ function processState(payload) {
|
|
|
83
113
|
const stdout = codexResult?.stdout ?? toolResponse.stdout ?? payload.stdout ?? '';
|
|
84
114
|
const stderr = codexResult?.stderr ?? toolResponse.stderr ?? payload.stderr ?? payload.error ?? '';
|
|
85
115
|
const rawExitCode = toolResponse.exitCode ?? toolResponse.exit_code ?? payload.exitCode;
|
|
86
|
-
const exitCode = codex ? codexResult.exitCode
|
|
116
|
+
const exitCode = codex ? codexResult.exitCode
|
|
117
|
+
: agy ? (Number.isInteger(rawExitCode) ? rawExitCode : undefined)
|
|
118
|
+
: typeof rawExitCode === 'number' ? rawExitCode : undefined;
|
|
87
119
|
const stderrSignal = typeof stderr === 'string' && stderr.trim().length > 0;
|
|
88
120
|
const hookEvent = captureEventName;
|
|
89
121
|
const isSuccessEvent = hookEvent === 'PostToolUse';
|
|
122
|
+
const agyErrorSignal = agy && typeof payload.error === 'string' && payload.error.trim().length > 0;
|
|
90
123
|
const isFailed = codex ? codexResult.outcome === 'failure' :
|
|
91
|
-
hookEvent === 'PostToolUseFailure' || (exitCode !== undefined && exitCode !== 0) ||
|
|
124
|
+
hookEvent === 'PostToolUseFailure' || agyErrorSignal || (exitCode !== undefined && exitCode !== 0) ||
|
|
92
125
|
(!isSuccessEvent && exitCode === undefined && stderrSignal);
|
|
93
|
-
const verifiedSuccess = codex ? codexResult.outcome === 'success'
|
|
126
|
+
const verifiedSuccess = codex ? codexResult.outcome === 'success'
|
|
127
|
+
: agy ? (!isFailed && exitCode === 0)
|
|
128
|
+
: !isFailed && (isSuccessEvent || exitCode === 0);
|
|
94
129
|
const toolName = payload.tool_name || payload.tool || 'command';
|
|
95
130
|
let editAfterCapture = false;
|
|
96
131
|
let stateOnlyCandidate = false;
|
|
@@ -98,11 +133,13 @@ function processState(payload) {
|
|
|
98
133
|
let output = (stderrSignal ? stderr : stdout) || (typeof payload.output === 'string' ? payload.output : '');
|
|
99
134
|
if (output.length > 500) output = '...' + output.slice(-500);
|
|
100
135
|
state.status = 'failed'; state.timestamp = new Date().toISOString(); state.tool = toolName; state.exitCode = exitCode; state.errorSummary = output.trim();
|
|
101
|
-
} else if ((!codex || verifiedSuccess) && state.status === 'failed') {
|
|
136
|
+
} else if (((!codex && !agy) || verifiedSuccess) && state.status === 'failed') {
|
|
102
137
|
state.lastResolved = { tool: state.tool, timestamp: state.timestamp }; state.status = 'idle'; state.timestamp = new Date().toISOString(); delete state.exitCode; delete state.errorSummary;
|
|
103
138
|
}
|
|
104
139
|
const isDirectTool = toolName === 'Edit' || toolName === 'Write' || toolName === 'apply_patch';
|
|
105
|
-
if (isDirectTool &&
|
|
140
|
+
if (isDirectTool && (agy
|
|
141
|
+
? agyDirectMutationInWorkspace(payload, cwdOf(payload, root), root, toolName)
|
|
142
|
+
: directMutationInWorkspace(payload, cwdOf(payload, root), root))) state.lastEditAt = Date.now();
|
|
106
143
|
const isShell = toolName === 'Bash' || toolName === 'PowerShell' || toolName === 'exec_command';
|
|
107
144
|
const command = (payload.tool_input && payload.tool_input.command) || '';
|
|
108
145
|
if (isShell) {
|
|
@@ -114,10 +151,6 @@ function processState(payload) {
|
|
|
114
151
|
{ toolName, sessionId, agentId: payload.agent_id }));
|
|
115
152
|
const metadataStep = !stateOnlyCandidate && verifiedSuccess
|
|
116
153
|
&& isSuccessfulMetadataStep(command, cwdOf(payload, root));
|
|
117
|
-
if (!metadataStep && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
118
|
-
if (stateOnlyCandidate) editAfterCapture = true;
|
|
119
|
-
else state.lastEditAt = Date.now();
|
|
120
|
-
}
|
|
121
154
|
// The host-specific outcome must confirm success before verification advances.
|
|
122
155
|
// Pilot ON only: a registered, argv-validated doc-check that resolves to this install's own runtime is the document
|
|
123
156
|
// verification evidence, and only at the shipped pin (R3-02). Any other path earns no verification evidence. OFF stays legacy.
|
|
@@ -129,6 +162,13 @@ function processState(payload) {
|
|
|
129
162
|
const verifies = stateOnlyCandidate ? false : docCheckCandidate
|
|
130
163
|
? Boolean(pinCheckable) && docCheck.fileDigest(installedCheck.installed) === docCheck.SHIPPED_DOC_CHECK_DIGEST
|
|
131
164
|
: !(pilotEnabled && docCheck.trustRisk(command)) && isVerificationShell(command, { cwd: cwdOf(payload, root), root });
|
|
165
|
+
// On AGY hosts that omit shell error/exitCode, an unconfirmed verification-only command must not advance lastEditAt
|
|
166
|
+
// and defeat agy-stop.js's bounded continuation fingerprint.
|
|
167
|
+
const agyUnknownOutcomeVerify = agy && !verifiedSuccess && !isFailed && verifies;
|
|
168
|
+
if (!metadataStep && !agyUnknownOutcomeVerify && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
169
|
+
if (stateOnlyCandidate) editAfterCapture = true;
|
|
170
|
+
else state.lastEditAt = Date.now();
|
|
171
|
+
}
|
|
132
172
|
if (verifiedSuccess && verifies) {
|
|
133
173
|
const verifiedAt = Date.now();
|
|
134
174
|
const verifiedExitCode = exitCode ?? null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"harness-everything": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"type": "command",
|
|
6
|
+
"command": "node ./hooks/scripts/agy-session-start.js"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"PreInvocation": [
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "node ./hooks/scripts/agy-pre-invocation.js"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"PreToolUse": [
|
|
16
|
+
{
|
|
17
|
+
"matcher": "run_command|write_file|edit_file|write_to_file|replace_file_content|multi_replace_file_content",
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "node ./hooks/scripts/agy-pre-tool.js"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"PostToolUse": [
|
|
27
|
+
{
|
|
28
|
+
"matcher": "run_command|write_file|edit_file|write_to_file|replace_file_content|multi_replace_file_content",
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"type": "command",
|
|
32
|
+
"command": "node ./hooks/scripts/agy-post-tool.js"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"Stop": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "node ./hooks/scripts/agy-stop.js"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "harness-everything",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Miya Daniel",
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Operating guide for AI agents working inside the Harness-everything repository — how we work, layout, change rules, quality gates, and release policy.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AGENTS.md — Working in This Repository
|
|
6
|
+
|
|
7
|
+
You are modifying **Harness**: an orchestrated agent operating system (skills + hooks/plugins + routing) for AI coding agents. Changes here ship to real agent sessions. A vague `SKILL.md`, a stale manifest, a contradictory platform claim or a bypassable selected workflow can misroute other people's agents. Precision is the product.
|
|
8
|
+
|
|
9
|
+
## How We Work
|
|
10
|
+
|
|
11
|
+
Harness exists to put agents on the **fastest path to a working result**, not to fence them in. Prefer mechanisms that make the right action the easy one over written demands that agents talk themselves out of.
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart LR
|
|
15
|
+
A["1. Wire the whole path<br/>(smallest end-to-end version)"] --> B["2. Record a baseline<br/>on that path"]
|
|
16
|
+
B --> C["3. Improve one thing per stage,<br/>compare to the baseline"]
|
|
17
|
+
C --> D["4. Lock behaviour<br/>with tests against drift"]
|
|
18
|
+
C -. "effect not measurable<br/>on the full path" .-> A
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **Whole path first.** Do not polish details or add tests for parts that are not connected yet.
|
|
22
|
+
- **Stages follow the full path.** A stage whose effect cannot be measured end to end is split wrongly.
|
|
23
|
+
- **Mechanisms over mandates.** Put recurring rules in CI, hooks, mods or templates so actions match them naturally. A new prose MUST is the last resort.
|
|
24
|
+
- **Dogfood the rules.** Docs, packets and reports written here follow the same doc rules Harness ships.
|
|
25
|
+
- **Coordinator role.** In multi-agent work the coordinator dispatches and analyses. Agents and the reviewer check each step; the coordinator re-verifies everything at the final stage.
|
|
26
|
+
|
|
27
|
+
### Writing docs (this file included)
|
|
28
|
+
|
|
29
|
+
1. **Mermaid** for anything that can be drawn: flows, stages, dependencies, state.
|
|
30
|
+
2. **Short bullets or tables** for rules and facts.
|
|
31
|
+
3. **Prose** only for detail that needs it; link it rather than inline it.
|
|
32
|
+
|
|
33
|
+
## Repository Layout
|
|
34
|
+
|
|
35
|
+
| Path | What it is |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `<skill-name>/SKILL.md` | One canonical skill per top-level directory. Frontmatter: `name`, `description`, `metadata.author`, `metadata.version`. |
|
|
38
|
+
| `hooks/` | Claude Code lifecycle hooks and shared mechanisms (circuit breaker, workflow/action/scope guards, stop gates). Not every host packages every hook. |
|
|
39
|
+
| `harness-everything/scripts/` | Runtime: kernel/tier routing, workflow contract, verification, bootstrap, self-heal. |
|
|
40
|
+
| `opencode-plugin/` | OpenCode V2 native plugin (OpenCode 1.x / V1 unsupported). Mechanism-tested, with partial live-host evidence (see the boundary below). |
|
|
41
|
+
| `.agents/plugins/` + `plugins/harness-everything/` | Local OpenAI/Codex marketplace + `.codex-plugin` package with canonical skill copies and packaged session/prompt hooks. |
|
|
42
|
+
| `submission/openai/` | Public OpenAI Skills-only listing/test inputs. The public artifact does not include local `.codex-plugin` lifecycle hooks. |
|
|
43
|
+
| `evals/<skill>/` | Trigger/routing eval per skill (waza format). Required for every canonical routed skill. |
|
|
44
|
+
| `behavioral-evals/` | LLM-behavior cases run via headless CLI sessions, structurally validated by CI. |
|
|
45
|
+
| `benchmarks/` | BENCHMARK_SOP fixtures and recorded results. Evidence lives here or nowhere. |
|
|
46
|
+
| `.claude-plugin/` | Claude Code plugin manifests. Must list exactly the on-disk canonical skills. |
|
|
47
|
+
| `docs/platform-capabilities.md` | Canonical platform/install/enforcement/evidence matrix. |
|
|
48
|
+
| `docs/repository-contract.md` | Generated Node/workflow/action/gate contract. Regenerate with `npm run docs:sync`; never hand-edit. |
|
|
49
|
+
| `.nvmrc` | Primary dev/CI Node runtime. `package.json#engines.node` stays the supported minimum. |
|
|
50
|
+
| `docs/`, `references/` | Philosophy, architecture, workflow docs, shared checklists. |
|
|
51
|
+
|
|
52
|
+
## OpenCode evidence boundary
|
|
53
|
+
|
|
54
|
+
- **Support boundary (V2-only, #453):** Harness supports the OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported.
|
|
55
|
+
- New features, fixes, tests, and host compatibility work target V2 only. No V1 public entrypoint, V1-only event fallback, V1 hook registration, or compatibility mode may be added.
|
|
56
|
+
- Retain historical V1 artifacts, but never promote them to current V2 capability evidence.
|
|
57
|
+
- Reintroducing V1 support requires an explicit owner-approved support-contract change; it is not a routine compatibility fix.
|
|
58
|
+
- State the V2 API family as the supported boundary. Tested V2 versions are recorded separately (`2.1.3` server-log load-only; `2.1.4` limited session workspace trace; and one isolated `2.1.4` macOS 26.6.2 [V2 lifecycle trace](benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) establishing V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery on a long-lived server — standalone `opencode run` exits before verification finishes; router/context injection, observations, ledger lessons, session create/delete reset, cancellation, global scope, npm install, and other versions/OSes were not exercised); none establishes a validated minimum patch version or coverage of every V2 release.
|
|
59
|
+
|
|
60
|
+
**Historical / unsupported V1 evidence:** the retained [OpenCode evidence](benchmarks/results/live-host/opencode-2026-09-16/README.md) documents project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS). It is preserved as historical/unsupported evidence only and does not establish current V2 capability:
|
|
61
|
+
|
|
62
|
+
- The final snapshot is post-reset (`hardLock: false`, `count: 1`).
|
|
63
|
+
- Hard lock is only an interactive observation with no retained blocked-tool trace.
|
|
64
|
+
- Historical reflection was operator-seeded, then agent-rewritten; agent-controlled state deletion reset the breaker. Rule-of-3 enforcement has since been retired.
|
|
65
|
+
- Global scope, npm-package installation, and other OpenCode versions remain unverified.
|
|
66
|
+
|
|
67
|
+
## Change Rules
|
|
68
|
+
|
|
69
|
+
**Skills and routing**
|
|
70
|
+
|
|
71
|
+
1. **Every canonical SKILL.md keeps ≤ 500 tokens** (CI gate) and contains `## USE FOR:` and `## DO NOT USE FOR:`. Detail goes in references/guides.
|
|
72
|
+
2. **Descriptions are routing surfaces.** Differentiate neighbouring skills deliberately; `test:collision` guards overlap.
|
|
73
|
+
3. **A new canonical skill ships with a routing eval.** The positive task `description:` exactly matches the skill frontmatter description.
|
|
74
|
+
|
|
75
|
+
**Release and distribution**
|
|
76
|
+
|
|
77
|
+
4. **Versions:** normal PRs never bump versions. `semantic-release` owns SemVer; `scripts/sync-release-version.js` syncs distributions. Nested sub-skills inherit their parent's version.
|
|
78
|
+
5. **Distribution manifests are generated facts.** After add/remove/rename run `npm run plugin:sync`, `npm run test:consistency` and `npm run test:plugin:openai`.
|
|
79
|
+
6. **Platform capability claims are tested contracts.** Update `docs/platform-capabilities.md` with integration changes. Package/mechanism evidence is not live-host evidence; public Skills-only behavior has no local lifecycle hooks.
|
|
80
|
+
7. **Runtime/workflow claims are generated facts.** `package.json`, `.nvmrc`, Dockerfile and active workflows feed `scripts/repository-contract.js`; run `npm run docs:sync` after relevant changes.
|
|
81
|
+
8. **CHANGELOG.md:** human notes go under `[Unreleased]`; semantic-release owns stable headings, tags and release notes.
|
|
82
|
+
9. **Conventional Commit type is release input:** breaking→major, `feat`→minor, `fix`/`perf`/`refactor`/`build`/`revert`→patch; docs/test/ci/style/chore do not release alone.
|
|
83
|
+
|
|
84
|
+
**Workflow behaviour**
|
|
85
|
+
|
|
86
|
+
10. **Selected workflow is a semantic contract; tactics remain flexible.** Compose ordered requirement steps with declared required/optional skill or reference bindings. Resolve a binding only when its step (or dependency-ready Fable stage) is active; required bindings MUST resolve before that step passes, and applicable skill core contracts MUST be followed. Unknown/unavailable bindings stay visible. Selected-topology obligations MUST resolve; missing host evidence yields reminders, not a persistent Harness lock.
|
|
87
|
+
11. **User-visible Harness Status is mandatory for non-trivial work.** One Markdown block headed `### 🚦 Harness Status` with bold `Current`, `Read / Evidence`, `Next`, optional `Risk / Blocked`; use nested evidence bullets when useful. Emit it before substantive execution, after major phases, on direction changes, at long-run boundaries and before completion. The routing checkpoint is internal state, not a second block. Not a hard lock.
|
|
88
|
+
12. **Tier-3/Fable isolation disposition is mandatory before broad mutation.** Use a verified linked Git worktree, or record an explicit degraded fallback when isolation is unavailable or the user chooses to stay in place. Ordinary isolation SHOULD be used when it materially reduces collision risk. Failure to isolate is a visible gap, not a Harness deadlock. See [workflow-runtime.md](docs/workflow-runtime.md).
|
|
89
|
+
13. **Use contract strength deliberately** ([philosophy.md](docs/philosophy.md#contract-strength-must--should--may)): MUST = required semantic obligation, SHOULD = default with an evidence-based exception, MAY = optional. Do not use recommend/prefer/advisory/guidance to weaken a MUST.
|
|
90
|
+
14. **The turn label line is mandatory on every turn, trivial ones included.** End each turn's final message with one hidden `<!-- harness-label {...} -->` line giving your post-work judgement ([docs/routing.md](docs/routing.md#turn-label-line)). It records data and never gates routing.
|
|
91
|
+
|
|
92
|
+
## Verification Before You Claim Done
|
|
93
|
+
|
|
94
|
+
```mermaid
|
|
95
|
+
flowchart LR
|
|
96
|
+
F["npm run verify:all -- --fast<br/>(pre-push subset)"] --> V["npm run verify:all<br/>(CI order, PASS/FAIL/UNCHECKED report)"]
|
|
97
|
+
V -. optional .-> C["-- --clean<br/>(fresh worktree of HEAD)"]
|
|
98
|
+
V -. optional .-> N["-- --node22<br/>(Node 22 smoke lane)"]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- `npm run verify:all` runs a local subset of the hosted `ci.yml` gates and prints paste-ready PASS/FAIL/UNCHECKED evidence: 12 rows in the full plan, 4 with `--fast` (`npm test`, `test:mutations`, `test:consistency`, `test:portability`).
|
|
102
|
+
- Full rows: `npm test`, `test:mutations`, `test:consistency`, `test:references`, `test:release`, `test:collision`, `test:routing:skills`, `test:routing:invariants`, `test:plugin:openai`, `test:plugin:submission`, `test:platform:compatibility`, `test:portability`. `test:mechanism` runs inside `npm test`; `test:repo-contract` and `test:docs:capabilities` run inside `test:consistency`. Hosted CI runs the two `test:routing:*` rows inside `self-regression`.
|
|
103
|
+
- Hosted `ci.yml` jobs it does not run: `pilot-offline-evidence`, both System One Windows runtime-pin jobs, `release-semantics` (`test:release:semantics`), `skill-quality` (waza per-skill checks; only the optional `waza:check` row runs, and only when waza is installed), `installer-e2e` (`ci/installer-roundtrip.test.js`) and `npm ci` under Node 22 in `runtime-floor`. Local rows also run on one OS, where hosted `self-regression` and `consistency` run three.
|
|
104
|
+
- With waza (`~/bin/waza`): `waza check <skill-dir>`, `waza spec verify <skill> evals/<skill>/eval.yaml --fail --threshold 1`, `waza tokens check`.
|
|
105
|
+
- CI runs Node.js 24 on Ubuntu/Windows/macOS plus a Node.js 22 floor lane ([repository-contract.md](docs/repository-contract.md)). Node 22 install compatibility stays UNCHECKED locally.
|
|
106
|
+
- Never report "it works" from code reading. Name the evidence layer: package, deterministic mechanism, live host or behavior.
|
|
107
|
+
|
|
108
|
+
## Behavioral & Benchmark Evidence
|
|
109
|
+
|
|
110
|
+
| Claim | Evidence required |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Hook/plugin contract holds | Deterministic mechanism test |
|
|
113
|
+
| A real host loaded and fired it | Preserved host/session artifact |
|
|
114
|
+
| Behavior improved | Paired evidence per #71 (baseline vs treatment) |
|
|
115
|
+
|
|
116
|
+
- Behavior runs: `node behavioral-evals/run.js run --engine opencode` (or `--engine claude`). On demand; costs tokens. The weekly workflow validates structure and runs live cases only where the CLI exists.
|
|
117
|
+
- Benchmarks: `node benchmarks/run.js scaffold <scenario>`, run both variants, then `record` with evidence logs.
|
package/sbom.cdx.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"$schema": "https://cyclonedx.org/schema/bom-1.7.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.7",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:ff5d04d0-54bd-5ddb-9f0d-9cfa7c77a6ce",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-24T15:33:36.933Z",
|
|
9
9
|
"tools": [
|
|
10
10
|
{
|
|
11
11
|
"vendor": "Harness Everything",
|
|
12
12
|
"name": "generate-sbom.js",
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "1.0.0"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "application",
|
|
18
|
-
"bom-ref": "pkg:npm/harness-everything@0.
|
|
18
|
+
"bom-ref": "pkg:npm/harness-everything@1.0.0",
|
|
19
19
|
"name": "harness-everything",
|
|
20
|
-
"version": "0.
|
|
21
|
-
"purl": "pkg:npm/harness-everything@0.
|
|
20
|
+
"version": "1.0.0",
|
|
21
|
+
"purl": "pkg:npm/harness-everything@1.0.0"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -948,15 +948,15 @@
|
|
|
948
948
|
},
|
|
949
949
|
{
|
|
950
950
|
"type": "library",
|
|
951
|
-
"bom-ref": "pkg:npm/fast-uri@3.1.
|
|
951
|
+
"bom-ref": "pkg:npm/fast-uri@3.1.9",
|
|
952
952
|
"name": "fast-uri",
|
|
953
|
-
"version": "3.1.
|
|
953
|
+
"version": "3.1.9",
|
|
954
954
|
"scope": "excluded",
|
|
955
|
-
"purl": "pkg:npm/fast-uri@3.1.
|
|
955
|
+
"purl": "pkg:npm/fast-uri@3.1.9",
|
|
956
956
|
"hashes": [
|
|
957
957
|
{
|
|
958
958
|
"alg": "SHA-512",
|
|
959
|
-
"content": "
|
|
959
|
+
"content": "hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ=="
|
|
960
960
|
}
|
|
961
961
|
]
|
|
962
962
|
},
|
|
@@ -1930,7 +1930,7 @@
|
|
|
1930
1930
|
"ref": "pkg:npm/ajv@8.20.0",
|
|
1931
1931
|
"dependsOn": [
|
|
1932
1932
|
"pkg:npm/fast-deep-equal@3.1.3",
|
|
1933
|
-
"pkg:npm/fast-uri@3.1.
|
|
1933
|
+
"pkg:npm/fast-uri@3.1.9",
|
|
1934
1934
|
"pkg:npm/json-schema-traverse@1.0.0",
|
|
1935
1935
|
"pkg:npm/require-from-string@2.0.2"
|
|
1936
1936
|
]
|
|
@@ -2033,7 +2033,7 @@
|
|
|
2033
2033
|
]
|
|
2034
2034
|
},
|
|
2035
2035
|
{
|
|
2036
|
-
"ref": "pkg:npm/harness-everything@0.
|
|
2036
|
+
"ref": "pkg:npm/harness-everything@1.0.0",
|
|
2037
2037
|
"dependsOn": [
|
|
2038
2038
|
"pkg:npm/%40commitlint/cli@19.8.1",
|
|
2039
2039
|
"pkg:npm/%40commitlint/config-conventional@19.8.1",
|