harness-everything 0.49.0 → 0.51.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/.github/workflows/ci.yml +0 -82
- package/.github/workflows/doc-governance.yml +91 -0
- package/.github/workflows/release.yml +5 -2
- package/CHANGELOG.md +150 -115
- package/ci/mechanism-2ax-doc-lifecycle.test.js +142 -12
- package/ci/mechanism-prb-outline-review.test.js +783 -107
- package/ci/release-unreleased-heading.test.js +24 -0
- package/docs/doc-workflow-reconciliation.md +29 -16
- package/docs/document-lifecycle.md +19 -0
- package/docs/platform-capabilities.md +2 -0
- package/docs/repository-contract.md +1 -0
- package/hooks/scripts/lib/doc-reconciliation-pilot.js +12 -0
- package/hooks/scripts/lib/doc-reconciliation-provider.js +575 -12
- package/hooks/scripts/lib/workflow-obligations.js +8 -4
- package/hooks/scripts/state-persist.js +26 -7
- package/hooks/scripts/w6-state-operations.js +239 -0
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +2 -2
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +12 -0
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +575 -12
- package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +8 -4
- package/plugins/harness-everything/hooks/scripts/state-persist.js +26 -7
- package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +239 -0
- package/plugins/harness-everything/plugin.json +1 -1
- package/sbom.cdx.json +7 -7
- package/scripts/doc-governance-guard.js +31 -8
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "harness-everything",
|
|
11
11
|
"source": "./",
|
|
12
12
|
"description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.51.0",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Miya Daniel"
|
|
16
16
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harness-everything",
|
|
3
3
|
"description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.51.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Miya Daniel"
|
|
7
7
|
},
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -21,88 +21,6 @@ jobs:
|
|
|
21
21
|
- name: Verify pilot instrumentation, sanitizer and offline replay
|
|
22
22
|
run: python3 benchmarks/issue290-pilot/check.py
|
|
23
23
|
|
|
24
|
-
doc-governance:
|
|
25
|
-
runs-on: ubuntu-latest
|
|
26
|
-
steps:
|
|
27
|
-
- uses: actions/checkout@v7
|
|
28
|
-
with:
|
|
29
|
-
fetch-depth: 0
|
|
30
|
-
- uses: actions/setup-node@v7
|
|
31
|
-
with:
|
|
32
|
-
node-version: 24
|
|
33
|
-
- name: Run base-owned document governance guard
|
|
34
|
-
env:
|
|
35
|
-
HARNESS_GUARD_EVENT: ${{ github.event_name }}
|
|
36
|
-
HARNESS_GUARD_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
37
|
-
HARNESS_GUARD_CANDIDATE_SHA: ${{ github.event.pull_request.head.sha }}
|
|
38
|
-
run: |
|
|
39
|
-
node -e 'const crypto = require("node:crypto");
|
|
40
|
-
const fs = require("node:fs");
|
|
41
|
-
const os = require("node:os");
|
|
42
|
-
const path = require("node:path");
|
|
43
|
-
const { spawnSync } = require("node:child_process");
|
|
44
|
-
(function main() {
|
|
45
|
-
const guardPath = "scripts/doc-governance-guard.js";
|
|
46
|
-
const event = process.env.HARNESS_GUARD_EVENT || "unknown";
|
|
47
|
-
const baseInput = process.env.HARNESS_GUARD_BASE_SHA || "";
|
|
48
|
-
const candidateInput = process.env.HARNESS_GUARD_CANDIDATE_SHA || "";
|
|
49
|
-
function warn(state, message) {
|
|
50
|
-
console.log("::warning title=" + state + "::" + message);
|
|
51
|
-
if (process.env.GITHUB_STEP_SUMMARY) fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, "## Document governance guard\n\n**" + state + "**: " + message + "\n\n", "utf8");
|
|
52
|
-
}
|
|
53
|
-
function git(args) {
|
|
54
|
-
const result = spawnSync("git", args, { encoding: "buffer", maxBuffer: 16 * 1024 * 1024, env: { ...process.env, GIT_CONFIG_NOSYSTEM: "1", GIT_NO_REPLACE_OBJECTS: "1", GIT_PAGER: "cat", GIT_TERMINAL_PROMPT: "0" } });
|
|
55
|
-
if (result.error) throw result.error;
|
|
56
|
-
if (result.status !== 0) throw new Error("git " + args[0] + " failed: " + Buffer.from(result.stderr || result.stdout || "").toString("utf8").trim());
|
|
57
|
-
return Buffer.from(result.stdout || "");
|
|
58
|
-
}
|
|
59
|
-
function resolveCommit(input, label) {
|
|
60
|
-
if (!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(input)) throw new Error(label + " is not a full commit SHA");
|
|
61
|
-
const resolved = git(["rev-parse", "--verify", "--quiet", "--end-of-options", input + "^{commit}"]).toString("ascii").trim().toLowerCase();
|
|
62
|
-
if (resolved !== input.toLowerCase()) throw new Error(label + " did not resolve to the supplied commit SHA");
|
|
63
|
-
return resolved;
|
|
64
|
-
}
|
|
65
|
-
if (event !== "pull_request") {
|
|
66
|
-
warn("UNCHECKED", "No externally selected PR base/head is available for event " + event + "; the base-owned guard was not executed.");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
try {
|
|
70
|
-
const base = resolveCommit(baseInput, "PR base SHA");
|
|
71
|
-
const candidate = resolveCommit(candidateInput, "PR head SHA");
|
|
72
|
-
const checkout = process.env.GITHUB_SHA || "unavailable";
|
|
73
|
-
console.log("PR head SHA used by the guard: " + candidate);
|
|
74
|
-
console.log("GITHUB_SHA used by checkout and the ordinary suite: " + checkout + " (the pull_request checkout may be a synthetic merge commit).");
|
|
75
|
-
const entries = git(["ls-tree", "-z", "--full-tree", base, "--", guardPath]);
|
|
76
|
-
if (entries.length === 0) {
|
|
77
|
-
warn("BOOTSTRAP_UNCHECKED", "Trusted base " + base + " has no " + guardPath + "; candidate guard was not executed. Independent review of the frozen candidate guard is required.");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (entries[entries.length - 1] !== 0) throw new Error("base guard tree entry is not NUL terminated");
|
|
81
|
-
const entry = entries.subarray(0, entries.length - 1);
|
|
82
|
-
const tab = entry.indexOf(9);
|
|
83
|
-
if (tab < 0 || entry.subarray(tab + 1).toString("utf8") !== guardPath) throw new Error("base guard tree entry is malformed");
|
|
84
|
-
const [mode, type, oid] = entry.subarray(0, tab).toString("ascii").split(" ");
|
|
85
|
-
if (!(["100644", "100755"].includes(mode)) || type !== "blob" || !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(oid || "")) throw new Error("base guard is not a regular Git blob");
|
|
86
|
-
const guardBytes = git(["cat-file", "blob", oid]);
|
|
87
|
-
const digest = crypto.createHash("sha256").update(guardBytes).digest("hex");
|
|
88
|
-
console.log("Base guard blob: " + oid + "; SHA-256: " + digest);
|
|
89
|
-
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "harness-doc-governance-"));
|
|
90
|
-
const tempGuard = path.join(tempDir, "doc-governance-guard.js");
|
|
91
|
-
try {
|
|
92
|
-
fs.writeFileSync(tempGuard, guardBytes, { mode: 0o600 });
|
|
93
|
-
const result = spawnSync(process.execPath, [tempGuard, "--repo", process.cwd(), "--base", base, "--candidate", candidate], { encoding: "buffer", maxBuffer: 64 * 1024 * 1024, env: { ...process.env, GIT_CONFIG_NOSYSTEM: "1", GIT_NO_REPLACE_OBJECTS: "1", GIT_PAGER: "cat", GIT_TERMINAL_PROMPT: "0" } });
|
|
94
|
-
if (result.error) throw result.error;
|
|
95
|
-
if (result.stdout) process.stdout.write(result.stdout);
|
|
96
|
-
if (result.stderr) process.stderr.write(result.stderr);
|
|
97
|
-
process.exitCode = result.status === null ? 1 : result.status;
|
|
98
|
-
} finally {
|
|
99
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
100
|
-
}
|
|
101
|
-
} catch (error) {
|
|
102
|
-
console.error("Document governance guard setup failed: " + (error.message || String(error)));
|
|
103
|
-
process.exitCode = 1;
|
|
104
|
-
}
|
|
105
|
-
})();'
|
|
106
24
|
self-regression:
|
|
107
25
|
strategy:
|
|
108
26
|
fail-fast: false
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Document Governance
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
doc-governance:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v7
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
- uses: actions/setup-node@v7
|
|
17
|
+
with:
|
|
18
|
+
node-version: 24
|
|
19
|
+
- name: Run base-owned document governance guard
|
|
20
|
+
env:
|
|
21
|
+
HARNESS_GUARD_EVENT: ${{ github.event_name }}
|
|
22
|
+
HARNESS_GUARD_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
23
|
+
HARNESS_GUARD_CANDIDATE_SHA: ${{ github.event.pull_request.head.sha }}
|
|
24
|
+
run: |
|
|
25
|
+
node -e 'const crypto = require("node:crypto");
|
|
26
|
+
const fs = require("node:fs");
|
|
27
|
+
const os = require("node:os");
|
|
28
|
+
const path = require("node:path");
|
|
29
|
+
const { spawnSync } = require("node:child_process");
|
|
30
|
+
(function main() {
|
|
31
|
+
const guardPath = "scripts/doc-governance-guard.js";
|
|
32
|
+
const event = process.env.HARNESS_GUARD_EVENT || "unknown";
|
|
33
|
+
const baseInput = process.env.HARNESS_GUARD_BASE_SHA || "";
|
|
34
|
+
const candidateInput = process.env.HARNESS_GUARD_CANDIDATE_SHA || "";
|
|
35
|
+
function warn(state, message) {
|
|
36
|
+
console.log("::warning title=" + state + "::" + message);
|
|
37
|
+
if (process.env.GITHUB_STEP_SUMMARY) fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, "## Document governance guard\n\n**" + state + "**: " + message + "\n\n", "utf8");
|
|
38
|
+
}
|
|
39
|
+
function git(args) {
|
|
40
|
+
const result = spawnSync("git", args, { encoding: "buffer", maxBuffer: 16 * 1024 * 1024, env: { ...process.env, GIT_CONFIG_NOSYSTEM: "1", GIT_NO_REPLACE_OBJECTS: "1", GIT_PAGER: "cat", GIT_TERMINAL_PROMPT: "0" } });
|
|
41
|
+
if (result.error) throw result.error;
|
|
42
|
+
if (result.status !== 0) throw new Error("git " + args[0] + " failed: " + Buffer.from(result.stderr || result.stdout || "").toString("utf8").trim());
|
|
43
|
+
return Buffer.from(result.stdout || "");
|
|
44
|
+
}
|
|
45
|
+
function resolveCommit(input, label) {
|
|
46
|
+
if (!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(input)) throw new Error(label + " is not a full commit SHA");
|
|
47
|
+
const resolved = git(["rev-parse", "--verify", "--quiet", "--end-of-options", input + "^{commit}"]).toString("ascii").trim().toLowerCase();
|
|
48
|
+
if (resolved !== input.toLowerCase()) throw new Error(label + " did not resolve to the supplied commit SHA");
|
|
49
|
+
return resolved;
|
|
50
|
+
}
|
|
51
|
+
if (event !== "pull_request") {
|
|
52
|
+
warn("UNCHECKED", "No externally selected PR base/head is available for event " + event + "; the base-owned guard was not executed.");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const base = resolveCommit(baseInput, "PR base SHA");
|
|
57
|
+
const candidate = resolveCommit(candidateInput, "PR head SHA");
|
|
58
|
+
const checkout = process.env.GITHUB_SHA || "unavailable";
|
|
59
|
+
console.log("PR head SHA used by the guard: " + candidate);
|
|
60
|
+
console.log("GITHUB_SHA used by checkout and the ordinary suite: " + checkout + " (the pull_request checkout may be a synthetic merge commit).");
|
|
61
|
+
const entries = git(["ls-tree", "-z", "--full-tree", base, "--", guardPath]);
|
|
62
|
+
if (entries.length === 0) {
|
|
63
|
+
warn("BOOTSTRAP_UNCHECKED", "Trusted base " + base + " has no " + guardPath + "; candidate guard was not executed. Independent review of the frozen candidate guard is required.");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (entries[entries.length - 1] !== 0) throw new Error("base guard tree entry is not NUL terminated");
|
|
67
|
+
const entry = entries.subarray(0, entries.length - 1);
|
|
68
|
+
const tab = entry.indexOf(9);
|
|
69
|
+
if (tab < 0 || entry.subarray(tab + 1).toString("utf8") !== guardPath) throw new Error("base guard tree entry is malformed");
|
|
70
|
+
const [mode, type, oid] = entry.subarray(0, tab).toString("ascii").split(" ");
|
|
71
|
+
if (!(["100644", "100755"].includes(mode)) || type !== "blob" || !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(oid || "")) throw new Error("base guard is not a regular Git blob");
|
|
72
|
+
const guardBytes = git(["cat-file", "blob", oid]);
|
|
73
|
+
const digest = crypto.createHash("sha256").update(guardBytes).digest("hex");
|
|
74
|
+
console.log("Base guard blob: " + oid + "; SHA-256: " + digest);
|
|
75
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "harness-doc-governance-"));
|
|
76
|
+
const tempGuard = path.join(tempDir, "doc-governance-guard.js");
|
|
77
|
+
try {
|
|
78
|
+
fs.writeFileSync(tempGuard, guardBytes, { mode: 0o600 });
|
|
79
|
+
const result = spawnSync(process.execPath, [tempGuard, "--repo", process.cwd(), "--base", base, "--candidate", candidate], { encoding: "buffer", maxBuffer: 64 * 1024 * 1024, env: { ...process.env, GIT_CONFIG_NOSYSTEM: "1", GIT_NO_REPLACE_OBJECTS: "1", GIT_PAGER: "cat", GIT_TERMINAL_PROMPT: "0" } });
|
|
80
|
+
if (result.error) throw result.error;
|
|
81
|
+
if (result.stdout) process.stdout.write(result.stdout);
|
|
82
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
83
|
+
process.exitCode = result.status === null ? 1 : result.status;
|
|
84
|
+
} finally {
|
|
85
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error("Document governance guard setup failed: " + (error.message || String(error)));
|
|
89
|
+
process.exitCode = 1;
|
|
90
|
+
}
|
|
91
|
+
})();'
|
|
@@ -19,12 +19,15 @@ permissions:
|
|
|
19
19
|
id-token: write
|
|
20
20
|
|
|
21
21
|
jobs:
|
|
22
|
-
# Release publication
|
|
22
|
+
# Release publication waits for the full CI matrix and document governance.
|
|
23
23
|
gate:
|
|
24
24
|
uses: ./.github/workflows/ci.yml
|
|
25
25
|
|
|
26
|
+
doc-governance:
|
|
27
|
+
uses: ./.github/workflows/doc-governance.yml
|
|
28
|
+
|
|
26
29
|
release:
|
|
27
|
-
needs: gate
|
|
30
|
+
needs: [gate, doc-governance]
|
|
28
31
|
runs-on: ubuntu-latest
|
|
29
32
|
steps:
|
|
30
33
|
- name: Checkout full release history
|