buildproof 3.11.0 → 3.12.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/README.md +1 -1
- package/bin/buildproof.js +5 -2
- package/core/intent.js +62 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Pull request checks (3.8.0; free trial, then Team and Enterprise): `buildproof c
|
|
|
31
31
|
|
|
32
32
|
Audit report (3.9.0; free trial, then Enterprise): `buildproof audit --since 2026-01-01` writes a signed HTML + JSON report of every accepted and rejected change; `buildproof audit --verify report.json` shows any later edit. Team dashboard (Team and Enterprise): `buildproof team` opens it; your licence key unlocks your own team's certificates.
|
|
33
33
|
|
|
34
|
-
AI bug hunt (3.10.0; Pro and up, and the trial): `buildproof hunt --base main` uploads the change to the BuildProof server, where the hunter runs your code and the AI-written tests in a locked-down container (no network) and reports only bugs it PROVED (a test that fails on the new code and passes on the old). By default your own local model (Ollama) answers the AI's questions - free; `--cloud` uses the server's AI (one cloud check; 5 in the trial; `buildproof credits --buy 20`). Your code is deleted from the server when the check ends.
|
|
34
|
+
AI bug hunt (3.10.0; Pro and up, and the trial): `buildproof hunt --base main` uploads the change to the BuildProof server, where the hunter runs your code and the AI-written tests in a locked-down container (no network) and reports only bugs it PROVED (a test that fails on the new code and passes on the old). By default your own local model (Ollama) answers the AI's questions - free; `--cloud` uses the server's AI (one cloud check; 5 in the trial; `buildproof credits --buy 20`). Your code is deleted from the server when the check ends. Since 3.12 the hunter is told what the change was meant to do: taken from `--intent "..."`, else from the pull request (GitHub) or merge request (GitLab) title and description, else from the commit messages since the base. This helps it tell a real bug from an intended change. `--no-intent` turns it off.
|
|
35
35
|
|
|
36
36
|
CLI: `buildproof start | check [--claim "..."] | accept [--force] | rollback | connect | verify <cert.html> | status | ci [--base origin/main] [--spec spec.md]`. `buildproof check` exits 0 only when proven.
|
|
37
37
|
|
package/bin/buildproof.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* buildproof ci [folder] [--base origin/main] [--spec spec.md] pull request check for CI (--init writes the GitHub workflow)
|
|
19
19
|
* buildproof spec [folder] [--base main] check the change against .buildproof/spec.md (every requirement needs a passing test)
|
|
20
20
|
* buildproof audit [--since 2026-01-01] [--out report.html] signed audit report of every checked change buildproof team team dashboard
|
|
21
|
-
* buildproof hunt [folder] [--base main] [--cloud] AI bug hunt on the server (your own model by default) buildproof credits [--buy 20]
|
|
21
|
+
* buildproof hunt [folder] [--base main] [--cloud] [--intent "..."] [--no-intent] AI bug hunt on the server (your own model by default) buildproof credits [--buy 20]
|
|
22
22
|
*
|
|
23
23
|
* Hook mode (installed by "connect"): --hook=claude | --hook=cursor | --hook=git
|
|
24
24
|
*/
|
|
@@ -120,7 +120,10 @@ async function main() {
|
|
|
120
120
|
if (cmd === 'credits') { const r = await hc.credits({ license, server, buy: typeof flag('buy') === 'string' ? flag('buy') : null, open: openUrl }); out(r.text, r.code); }
|
|
121
121
|
const root = path.resolve(positional[0] || process.cwd());
|
|
122
122
|
const base = typeof flag('base') === 'string' ? flag('base') : (require('../core/ci').findBase(root, null) || 'HEAD~1');
|
|
123
|
-
const
|
|
123
|
+
const intent = require('../core/intent'); // 3.12: the judge gets the change intent from --intent, the PR / MR, or the commit messages
|
|
124
|
+
const it = intent.resolve({ flag: flag('intent'), off: !!flag('no-intent'), root, base });
|
|
125
|
+
if (it.intent) console.log(` intent ${intent.LABEL[it.source]}: ${it.intent.split('\n')[0].slice(0, 100)}`);
|
|
126
|
+
const r = await hc.run({ root, base, cloud: !!flag('cloud'), intent: it.intent, cfg: config.load(), license, server, log: (l) => console.log(l) });
|
|
124
127
|
out(r.text, r.code);
|
|
125
128
|
}
|
|
126
129
|
if (cmd === 'audit') { // Enterprise audit report: signed HTML + JSON of every checked change in a period
|
package/core/intent.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* Automatic change intent for `buildproof hunt` (3.12).
|
|
4
|
+
* The bug hunter's judge works far better when it knows what the change was meant to do.
|
|
5
|
+
* Order: explicit --intent, then the pull/merge request (GitHub, GitLab), then the commit messages base..HEAD.
|
|
6
|
+
* The text is untrusted: it is only ever passed as data to the judge, trimmed and cleaned here.
|
|
7
|
+
*/
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const { execFileSync } = require('child_process');
|
|
10
|
+
|
|
11
|
+
const MAX = 1500;
|
|
12
|
+
|
|
13
|
+
function clean(s) {
|
|
14
|
+
return String(s || '')
|
|
15
|
+
.replace(/<!--[\s\S]*?-->/g, ' ') // PR templates: hidden comments
|
|
16
|
+
.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, '')
|
|
17
|
+
.replace(/\r\n?/g, '\n')
|
|
18
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
19
|
+
.trim();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function cut(s) { return s.length > MAX ? s.slice(0, MAX - 3).trimEnd() + '...' : s; }
|
|
23
|
+
|
|
24
|
+
function join(title, body) {
|
|
25
|
+
const t = clean(title), b = clean(body);
|
|
26
|
+
return cut(t && b ? `${t}\n\n${b}` : t || b);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function fromGitHub(env) {
|
|
30
|
+
const p = env.GITHUB_EVENT_PATH;
|
|
31
|
+
if (!p) return '';
|
|
32
|
+
let ev; try { ev = JSON.parse(fs.readFileSync(p, 'utf8')); } catch { return ''; }
|
|
33
|
+
const pr = ev && (ev.pull_request || (ev.issue && ev.issue.pull_request && ev.issue));
|
|
34
|
+
return pr ? join(pr.title, pr.body) : '';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function fromGitLab(env) {
|
|
38
|
+
return env.CI_MERGE_REQUEST_TITLE ? join(env.CI_MERGE_REQUEST_TITLE, env.CI_MERGE_REQUEST_DESCRIPTION) : '';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function fromCommits(root, base) {
|
|
42
|
+
if (!base) return '';
|
|
43
|
+
try {
|
|
44
|
+
const out = execFileSync('git', ['log', '--no-merges', '-n', '20', '--format=%s%n%n%b%x1e', `${base}..HEAD`], { cwd: root, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], windowsHide: true, timeout: 15000 });
|
|
45
|
+
const msgs = out.split('\x1e').map(clean).filter(Boolean);
|
|
46
|
+
return cut(msgs.join('\n\n'));
|
|
47
|
+
} catch { return ''; }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** -> { intent, source } ; source: 'flag' | 'github-pr' | 'gitlab-mr' | 'commits' | 'none' | 'off' */
|
|
51
|
+
function resolve({ flag, off, root, base, env = process.env } = {}) {
|
|
52
|
+
if (typeof flag === 'string' && flag.trim()) return { intent: cut(clean(flag)), source: 'flag' };
|
|
53
|
+
if (off) return { intent: '', source: 'off' };
|
|
54
|
+
let t = fromGitHub(env); if (t) return { intent: t, source: 'github-pr' };
|
|
55
|
+
t = fromGitLab(env); if (t) return { intent: t, source: 'gitlab-mr' };
|
|
56
|
+
t = fromCommits(root, base); if (t) return { intent: t, source: 'commits' };
|
|
57
|
+
return { intent: '', source: 'none' };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const LABEL = { flag: 'from --intent', 'github-pr': 'from the pull request title and description', 'gitlab-mr': 'from the merge request title and description', commits: 'from the commit messages' };
|
|
61
|
+
|
|
62
|
+
module.exports = { resolve, LABEL, MAX };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buildproof",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "BuildProof - proof gate for AI-written code: test-integrity guard, fail-closed checks, scope lock, full rollback, signed certificates, local AI under supervision.",
|
|
5
5
|
"main": "core/server.js",
|
|
6
6
|
"scripts": {
|