@orkestrel/probe 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Orkestrel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @orkestrel/probe
2
+
3
+ Prove a claim about a code change with type, lint, and runtime evidence, from the workspace's own
4
+ TypeScript, Oxlint, and Vitest.
5
+
6
+ A claim carries a `case` — the edit you believe is correct — and a `control`, the same edit
7
+ deliberately broken, naming the stage it must fail at. `prove` runs every stage over the case and
8
+ the control and returns a `Verdict`. When the case ran clean and the control broke where it said it
9
+ would, the verdict carries a `receipt`: a one-line token naming the claim, the stage, the tool
10
+ versions, and the TypeScript project that judged the candidates.
11
+
12
+ Read [`guides/probe.md`](guides/probe.md) before you make a claim. It states the prerequisites, the
13
+ receipt's verification method and its limits, and what a receipt does not vouch for.
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npm install --save-dev @orkestrel/probe
19
+ ```
20
+
21
+ `typescript`, `oxlint`, and `vitest` are optional peers, resolved from the workspace probe inspects.
22
+
23
+ ## The `probe` binary
24
+
25
+ The package installs a `probe` binary that serves the `prove` Model Context Protocol tool over a
26
+ newline-delimited JSON stdio transport. Register the resolved JavaScript entry rather than a global
27
+ install, an `npx` invocation, or the `node_modules/.bin` shim:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "probe": {
33
+ "command": "node",
34
+ "args": ["node_modules/@orkestrel/probe/dist/bin/main.js"],
35
+ "cwd": "/srv/checkout"
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ ## Proving a claim in process
42
+
43
+ ```ts
44
+ import type { Claim } from '@orkestrel/probe'
45
+ import { Probe } from '@orkestrel/probe/server'
46
+
47
+ const claim: Claim = {
48
+ project: 'configs/src/tsconfig.core.json',
49
+ case: {
50
+ files: [{ path: 'src/core/greeting.ts', text: "export const GREETING = 'hi'\n" }],
51
+ test: {
52
+ path: 'tmp/probe/greeting.test.ts',
53
+ text: "import { expect, test } from 'vitest'\nimport { GREETING } from '../../src/core/greeting.js'\ntest('greets', () => expect(GREETING).toBe('hi'))\n",
54
+ },
55
+ },
56
+ control: {
57
+ files: [{ path: 'src/core/greeting.ts', text: "export const GREETING: number = 'hi'\n" }],
58
+ test: {
59
+ path: 'tmp/probe/greeting.test.ts',
60
+ text: "import { expect, test } from 'vitest'\nimport { GREETING } from '../../src/core/greeting.js'\ntest('greets', () => expect(GREETING).toBe('hi'))\n",
61
+ },
62
+ stage: 'type',
63
+ reason: 'a string literal assigned to a number must not compile',
64
+ },
65
+ }
66
+
67
+ const probe = new Probe({ workspace: process.cwd() })
68
+ const verdict = await probe.prove(claim)
69
+ console.log(verdict.receipt)
70
+ await probe.destroy()
71
+ ```
72
+
73
+ probe executes caller-supplied test code with the privileges of the process that hosts it. Give it a
74
+ workspace and a caller you already trust with a shell.
75
+
76
+ ## Development
77
+
78
+ ```sh
79
+ npm install
80
+ npm test
81
+ ```
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { isProbeError } from "../src/core/index.js";
3
+ import { ProbeServer } from "../src/server/index.js";
4
+ //#region src/bin/main.ts
5
+ try {
6
+ new ProbeServer().start();
7
+ } catch (error) {
8
+ if (!isProbeError(error)) throw error;
9
+ console.error(`[${error.origin}] ${error.code}: ${error.message.split(/\r?\n|\r/u).join(" ")}`);
10
+ process.exitCode = 1;
11
+ }
12
+ //#endregion
13
+
14
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","names":[],"sources":["../../src/bin/main.ts"],"sourcesContent":["import { isProbeError } from '@src/core'\nimport { ProbeServer } from '@src/server'\n\ntry {\n\tnew ProbeServer().start()\n} catch (error) {\n\tif (!isProbeError(error)) throw error\n\tconsole.error(`[${error.origin}] ${error.code}: ${error.message.split(/\\r?\\n|\\r/u).join(' ')}`)\n\tprocess.exitCode = 1\n}\n"],"mappings":";;;;AAGA,IAAI;CACH,IAAI,YAAY,CAAC,CAAC,MAAM;AACzB,SAAS,OAAO;CACf,IAAI,CAAC,aAAa,KAAK,GAAG,MAAM;CAChC,QAAQ,MAAM,IAAI,MAAM,OAAO,IAAI,MAAM,KAAK,IAAI,MAAM,QAAQ,MAAM,WAAW,CAAC,CAAC,KAAK,GAAG,GAAG;CAC9F,QAAQ,WAAW;AACpB"}