@callabens/projectmind 0.1.0-dev.1 → 0.1.0-dev.2
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 +66 -4
- package/dist/apps/cli/src/index.js +321 -9
- package/dist/apps/cli/src/index.js.map +1 -1
- package/dist/packages/core/src/index.d.ts +12 -1
- package/dist/packages/core/src/index.js +1 -1
- package/dist/packages/core/src/index.js.map +1 -1
- package/dist/packages/core/src/schema.d.ts +177 -0
- package/dist/packages/core/src/schema.js +17 -2
- package/dist/packages/core/src/schema.js.map +1 -1
- package/dist/packages/doctor/src/index.d.ts +15 -0
- package/dist/packages/doctor/src/index.js +81 -0
- package/dist/packages/doctor/src/index.js.map +1 -0
- package/dist/packages/evidence/src/index.d.ts +1 -0
- package/dist/packages/evidence/src/index.js +70 -6
- package/dist/packages/evidence/src/index.js.map +1 -1
- package/dist/packages/graph/src/index.js +143 -30
- package/dist/packages/graph/src/index.js.map +1 -1
- package/dist/packages/intent/src/index.d.ts +21 -1
- package/dist/packages/intent/src/index.js +63 -1
- package/dist/packages/intent/src/index.js.map +1 -1
- package/dist/packages/intent/src/templates.d.ts +17 -0
- package/dist/packages/intent/src/templates.js +40 -0
- package/dist/packages/intent/src/templates.js.map +1 -0
- package/dist/packages/mcp/src/index.d.ts +11 -0
- package/dist/packages/mcp/src/index.js +175 -36
- package/dist/packages/mcp/src/index.js.map +1 -1
- package/dist/packages/parser/src/index.d.ts +3 -1
- package/dist/packages/parser/src/index.js +17 -3
- package/dist/packages/parser/src/index.js.map +1 -1
- package/dist/packages/proofpack/src/index.d.ts +87 -0
- package/dist/packages/proofpack/src/index.js +144 -1
- package/dist/packages/proofpack/src/index.js.map +1 -1
- package/dist/packages/report/src/index.d.ts +1 -1
- package/dist/packages/report/src/index.js +6 -3
- package/dist/packages/report/src/index.js.map +1 -1
- package/dist/packages/report/src/pr-comment.d.ts +2 -0
- package/dist/packages/report/src/pr-comment.js +74 -0
- package/dist/packages/report/src/pr-comment.js.map +1 -0
- package/dist/packages/sdk/src/examples/eslint-check.d.ts +1 -0
- package/dist/packages/sdk/src/examples/eslint-check.js +18 -0
- package/dist/packages/sdk/src/examples/eslint-check.js.map +1 -0
- package/dist/packages/sdk/src/scaffold.d.ts +5 -0
- package/dist/packages/sdk/src/scaffold.js +45 -0
- package/dist/packages/sdk/src/scaffold.js.map +1 -0
- package/dist/packages/verifier/src/index.js +5 -2
- package/dist/packages/verifier/src/index.js.map +1 -1
- package/package.json +11 -5
- package/schemas/proofpack-v1.schema.json +46 -1
- package/scripts/demo.mjs +80 -0
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callabens/projectmind",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.2",
|
|
4
4
|
"description": "Local-first evidence verification and project intelligence for coding agents.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"packageManager": "pnpm@11.25.0",
|
|
8
8
|
"scripts": {
|
|
9
|
+
"dev": "node scripts/serve-public.mjs",
|
|
9
10
|
"test": "node --experimental-strip-types --test tests/*.test.ts",
|
|
10
11
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
11
12
|
"build": "tsc -p tsconfig.build.json",
|
|
12
13
|
"lint": "node --experimental-strip-types scripts/lint.ts",
|
|
13
14
|
"validate": "npm run lint && npm run typecheck && npm run schema:check && npm test && npm run build",
|
|
14
|
-
"validate:windows": "npm run lint && npm run typecheck && npm run schema:check && node --experimental-strip-types --test tests/structured-evidence.test.ts tests/proofpack-schema.test.ts && node --experimental-strip-types --test --test-name-pattern=\"AST scanner|graph resolves|scanner includes|base-ref comparison|initialization builds|config can be loaded|verification refuses\" tests/hardening.test.ts tests/projectmind.test.ts && npm run build",
|
|
15
|
+
"validate:windows": "npm run lint && npm run typecheck && npm run schema:check && node --experimental-strip-types --test tests/coverage-binding.test.ts tests/intent-templates.test.ts tests/quickstart.test.ts tests/structured-evidence.test.ts tests/proofpack-cli.test.ts tests/proofpack-schema.test.ts tests/provider-scaffold.test.ts tests/python-support.test.ts tests/pr-comment.test.ts tests/windows-lifecycle.test.ts && node --experimental-strip-types --test --test-name-pattern=\"AST scanner|graph resolves|scanner includes|base-ref comparison|initialization builds|config can be loaded|verification refuses\" tests/hardening.test.ts tests/projectmind.test.ts && npm run build",
|
|
15
16
|
"projectmind": "node --experimental-strip-types apps/cli/src/index.ts",
|
|
16
17
|
"pack:check": "pnpm build && pnpm pack --out ../projectmind-preview.tgz",
|
|
17
18
|
"pack:repro": "pnpm build && node -e \"require('node:fs').mkdirSync('artifacts',{recursive:true})\" && pnpm pack --out artifacts/projectmind-preview-a.tgz && pnpm pack --out artifacts/projectmind-preview-b.tgz && node scripts/compare-packages.mjs artifacts/projectmind-preview-a.tgz artifacts/projectmind-preview-b.tgz",
|
|
@@ -46,11 +47,16 @@
|
|
|
46
47
|
"./provider-examples/git-diff-check": {
|
|
47
48
|
"types": "./dist/packages/sdk/src/examples/git-diff-check.d.ts",
|
|
48
49
|
"import": "./dist/packages/sdk/src/examples/git-diff-check.js"
|
|
50
|
+
},
|
|
51
|
+
"./provider-examples/eslint-check": {
|
|
52
|
+
"types": "./dist/packages/sdk/src/examples/eslint-check.d.ts",
|
|
53
|
+
"import": "./dist/packages/sdk/src/examples/eslint-check.js"
|
|
49
54
|
}
|
|
50
55
|
},
|
|
51
56
|
"files": [
|
|
52
57
|
"dist/apps",
|
|
53
58
|
"dist/packages",
|
|
59
|
+
"scripts/demo.mjs",
|
|
54
60
|
"schemas",
|
|
55
61
|
"README.md",
|
|
56
62
|
"LICENSE",
|
|
@@ -63,9 +69,9 @@
|
|
|
63
69
|
"evidence",
|
|
64
70
|
"mcp"
|
|
65
71
|
],
|
|
66
|
-
"homepage": "https://github.com/
|
|
72
|
+
"homepage": "https://github.com/callabens/ProjectMind#readme",
|
|
67
73
|
"bugs": {
|
|
68
|
-
"url": "https://github.com/
|
|
74
|
+
"url": "https://github.com/callabens/ProjectMind/issues"
|
|
69
75
|
},
|
|
70
76
|
"publishConfig": {
|
|
71
77
|
"access": "public",
|
|
@@ -74,6 +80,6 @@
|
|
|
74
80
|
},
|
|
75
81
|
"repository": {
|
|
76
82
|
"type": "git",
|
|
77
|
-
"url": "git+https://github.com/
|
|
83
|
+
"url": "git+https://github.com/callabens/ProjectMind.git"
|
|
78
84
|
}
|
|
79
85
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/
|
|
2
|
+
"$id": "https://github.com/callabens/ProjectMind/blob/main/schemas/proofpack-v1.schema.json",
|
|
3
3
|
"$ref": "#/definitions/ProjectMindProofPackV1",
|
|
4
4
|
"definitions": {
|
|
5
5
|
"ProjectMindProofPackV1": {
|
|
@@ -92,6 +92,12 @@
|
|
|
92
92
|
"items": {
|
|
93
93
|
"$ref": "#/definitions/ProjectMindProofPackV1/properties/projectMindVersion"
|
|
94
94
|
}
|
|
95
|
+
},
|
|
96
|
+
"coveragePaths": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": {
|
|
99
|
+
"$ref": "#/definitions/ProjectMindProofPackV1/properties/projectMindVersion"
|
|
100
|
+
}
|
|
95
101
|
}
|
|
96
102
|
},
|
|
97
103
|
"required": [
|
|
@@ -367,6 +373,45 @@
|
|
|
367
373
|
],
|
|
368
374
|
"additionalProperties": false
|
|
369
375
|
},
|
|
376
|
+
"coverageSummary": {
|
|
377
|
+
"type": "object",
|
|
378
|
+
"properties": {
|
|
379
|
+
"provider": {
|
|
380
|
+
"type": "string",
|
|
381
|
+
"const": "lcov"
|
|
382
|
+
},
|
|
383
|
+
"files": {
|
|
384
|
+
"type": "array",
|
|
385
|
+
"items": {
|
|
386
|
+
"type": "object",
|
|
387
|
+
"properties": {
|
|
388
|
+
"path": {
|
|
389
|
+
"$ref": "#/definitions/ProjectMindProofPackV1/properties/intent/properties/requirements/items/properties/coveragePaths/items"
|
|
390
|
+
},
|
|
391
|
+
"linesFound": {
|
|
392
|
+
"type": "integer",
|
|
393
|
+
"minimum": 0
|
|
394
|
+
},
|
|
395
|
+
"linesHit": {
|
|
396
|
+
"type": "integer",
|
|
397
|
+
"minimum": 0
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"required": [
|
|
401
|
+
"path",
|
|
402
|
+
"linesFound",
|
|
403
|
+
"linesHit"
|
|
404
|
+
],
|
|
405
|
+
"additionalProperties": false
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"required": [
|
|
410
|
+
"provider",
|
|
411
|
+
"files"
|
|
412
|
+
],
|
|
413
|
+
"additionalProperties": false
|
|
414
|
+
},
|
|
370
415
|
"evidenceError": {
|
|
371
416
|
"$ref": "#/definitions/ProjectMindProofPackV1/properties/projectMindVersion"
|
|
372
417
|
}
|
package/scripts/demo.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
+
const sourceCli = join(projectRoot, "apps/cli/src/index.ts");
|
|
9
|
+
const builtCli = join(projectRoot, "dist/apps/cli/src/index.js");
|
|
10
|
+
const sourceMode = existsSync(sourceCli);
|
|
11
|
+
const cli = sourceMode ? sourceCli : builtCli;
|
|
12
|
+
const cliPrefix = sourceMode ? ["--experimental-strip-types", cli] : [cli];
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const keep = args.includes("--keep");
|
|
15
|
+
const paceIndex = args.indexOf("--pace");
|
|
16
|
+
const pace = paceIndex >= 0 ? Number(args[paceIndex + 1]) : 0;
|
|
17
|
+
if (!Number.isFinite(pace) || pace < 0 || pace > 10_000) throw new Error("--pace must be between 0 and 10000 milliseconds.");
|
|
18
|
+
|
|
19
|
+
const root = mkdtempSync(join(tmpdir(), "projectmind-demo-"));
|
|
20
|
+
const wait = () => pace > 0 ? new Promise((resolveDelay) => setTimeout(resolveDelay, pace)) : Promise.resolve();
|
|
21
|
+
const heading = async (text) => {
|
|
22
|
+
await wait();
|
|
23
|
+
console.log(`\n=== ${text} ===\n`);
|
|
24
|
+
};
|
|
25
|
+
const show = async (command, commandArgs, expectedCodes = [0]) => {
|
|
26
|
+
await wait();
|
|
27
|
+
console.log(`$ ${command}`);
|
|
28
|
+
const result = spawnSync(process.execPath, commandArgs, { cwd: root, encoding: "utf8", env: { ...process.env, NO_COLOR: "1" } });
|
|
29
|
+
if (result.stdout.trim()) console.log(result.stdout.trim());
|
|
30
|
+
if (result.stderr.trim()) console.error(result.stderr.trim());
|
|
31
|
+
if (!expectedCodes.includes(result.status ?? 1)) throw new Error(`${command} exited ${result.status ?? "without a status"}.`);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
mkdirSync(join(root, "src"));
|
|
37
|
+
mkdirSync(join(root, "tests"));
|
|
38
|
+
writeFileSync(join(root, ".gitignore"), ".projectmind/\n");
|
|
39
|
+
writeFileSync(join(root, "package.json"), JSON.stringify({
|
|
40
|
+
name: "projectmind-demo",
|
|
41
|
+
type: "module",
|
|
42
|
+
scripts: { test: "node --test tests/login.test.js" },
|
|
43
|
+
}, null, 2));
|
|
44
|
+
writeFileSync(join(root, "src/login.js"), "export const login = (user) => Boolean(user?.trim());\n");
|
|
45
|
+
writeFileSync(join(root, "tests/login.test.js"), 'import test from "node:test"; import assert from "node:assert/strict"; import { login } from "../src/login.js"; test("valid user can log in", () => assert.equal(login("demo"), true));\n');
|
|
46
|
+
execFileSync("git", ["init", "-q"], { cwd: root });
|
|
47
|
+
execFileSync("git", ["add", "."], { cwd: root });
|
|
48
|
+
execFileSync("git", ["-c", "user.name=ProjectMind Demo", "-c", "user.email=demo@example.com", "commit", "-qm", "demo fixture"], { cwd: root });
|
|
49
|
+
|
|
50
|
+
console.log("ProjectMind trust-gate demo");
|
|
51
|
+
console.log("Isolated temporary repository; no network or model API is used.");
|
|
52
|
+
|
|
53
|
+
await heading("1. Initialize and declare intent");
|
|
54
|
+
await show("projectmind init", [...cliPrefix, "init"]);
|
|
55
|
+
await show('projectmind intent create "Protect login" --require "Valid user can log in"', [...cliPrefix, "intent", "create", "Protect login", "--require", "Valid user can log in"]);
|
|
56
|
+
|
|
57
|
+
await heading("2. A passing but unbound test is not proof");
|
|
58
|
+
const unbound = await show("projectmind verify", [...cliPrefix, "verify"], [2]);
|
|
59
|
+
if (!unbound.stdout.includes("NOT_VERIFIED") || !unbound.stdout.includes("structured test binding is missing")) throw new Error("Expected the unbound requirement to fail closed.");
|
|
60
|
+
|
|
61
|
+
await heading("3. Bind exact command and testcase");
|
|
62
|
+
const config = JSON.parse(readFileSync(join(root, ".projectmind/config.json"), "utf8"));
|
|
63
|
+
const testCommand = config.verification.commands.find((item) => item.provider === "node-test-junit")?.command;
|
|
64
|
+
if (!testCommand) throw new Error("Demo initialization did not create structured Node test evidence.");
|
|
65
|
+
await show("projectmind intent bind REQ-1 --command <configured> --test \"valid user can log in\"", [...cliPrefix, "intent", "bind", "REQ-1", "--command", testCommand, "--test", "valid user can log in"]);
|
|
66
|
+
const verified = await show("projectmind verify", [...cliPrefix, "verify"]);
|
|
67
|
+
if (!verified.stdout.includes("\nVERIFIED\n") || !verified.stdout.includes("ProofPack:")) throw new Error("Expected bound fresh evidence to verify.");
|
|
68
|
+
|
|
69
|
+
await heading("4. Break behavior; stale success cannot be reused");
|
|
70
|
+
writeFileSync(join(root, "src/login.js"), "export const login = () => false;\n");
|
|
71
|
+
const broken = await show("projectmind verify", [...cliPrefix, "verify"], [2]);
|
|
72
|
+
if (!broken.stdout.includes("NOT_VERIFIED")) throw new Error("Expected the regression to fail closed.");
|
|
73
|
+
|
|
74
|
+
await heading("Demo complete");
|
|
75
|
+
console.log("Observed: NOT_VERIFIED -> VERIFIED -> NOT_VERIFIED");
|
|
76
|
+
console.log("Every verdict came from fresh, explicitly bound repository evidence.");
|
|
77
|
+
if (keep) console.log(`Demo repository kept at: ${root}`);
|
|
78
|
+
} finally {
|
|
79
|
+
if (!keep) rmSync(root, { recursive: true, force: true });
|
|
80
|
+
}
|