martin-loop 0.1.3 → 0.1.5
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 +52 -16
- package/demo/seeded-workspace/README.md +35 -0
- package/demo/seeded-workspace/TASKS.md +29 -0
- package/demo/seeded-workspace/martin.config.yaml +11 -0
- package/demo/seeded-workspace/package.json +8 -0
- package/demo/seeded-workspace/src/invoice-summary.js +11 -0
- package/demo/seeded-workspace/test/invoice-summary.test.js +20 -0
- package/dist/vendor/adapters/claude-cli.d.ts +19 -4
- package/dist/vendor/adapters/claude-cli.js +55 -24
- package/dist/vendor/adapters/cli-bridge.d.ts +1 -0
- package/dist/vendor/adapters/cli-bridge.js +154 -28
- package/dist/vendor/adapters/index.d.ts +1 -0
- package/dist/vendor/adapters/index.js +1 -0
- package/dist/vendor/adapters/verifier-only.d.ts +7 -0
- package/dist/vendor/adapters/verifier-only.js +57 -0
- package/dist/vendor/cli/index.d.ts +6 -1
- package/dist/vendor/cli/index.js +124 -7
- package/dist/vendor/contracts/index.d.ts +3 -1
- package/dist/vendor/core/compiler.d.ts +2 -0
- package/dist/vendor/core/compiler.js +10 -4
- package/dist/vendor/core/context-integrity.d.ts +26 -0
- package/dist/vendor/core/context-integrity.js +56 -0
- package/dist/vendor/core/index.d.ts +5 -2
- package/dist/vendor/core/index.js +186 -54
- package/dist/vendor/core/policy.d.ts +6 -0
- package/docs/distribution/DIRECTORY-SUBMISSIONS.md +89 -0
- package/docs/distribution/INTEGRATION-OUTREACH.md +61 -0
- package/docs/distribution/UNDER-3-CHALLENGE.md +65 -0
- package/docs/oss/CLAUDE-CODE-WALKTHROUGH.md +142 -0
- package/docs/oss/EXAMPLES.md +9 -1
- package/docs/oss/OSS-BOUNDARY-REPORT.json +3 -7
- package/docs/oss/OSS-BOUNDARY-REPORT.md +2 -2
- package/docs/oss/QUICKSTART.md +33 -3
- package/docs/oss/RALPH-LOOP-SAFETY.md +113 -0
- package/docs/oss/README.md +6 -3
- package/docs/oss/RELEASE-SURFACE-REPORT.json +1 -1
- package/docs/oss/RELEASE-SURFACE-REPORT.md +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Can your AI coding agent finish this task under $3?
|
|
2
|
+
|
|
3
|
+
MartinLoop is testing a simple question:
|
|
4
|
+
|
|
5
|
+
Can an AI coding agent complete a task under a fixed budget, with verifier-passed completion and an inspectable run record?
|
|
6
|
+
|
|
7
|
+
## Current repo-backed comparison
|
|
8
|
+
|
|
9
|
+
Same task, same starting state:
|
|
10
|
+
|
|
11
|
+
- governed MartinLoop run: `$2.30`
|
|
12
|
+
- uncontrolled retry loop: `$5.20`
|
|
13
|
+
- governed outcome: `completed` and verifier-passed with an inspectable record
|
|
14
|
+
- uncontrolled outcome: failed after repeated retries with no comparable audit trail
|
|
15
|
+
|
|
16
|
+
These numbers match the current public benchmark story shown in the repo README and visualized in [`docs/assets/side-by-side.svg`](../assets/side-by-side.svg).
|
|
17
|
+
|
|
18
|
+
## Why this matters
|
|
19
|
+
|
|
20
|
+
The claim is not that every governed run is always cheaper. The claim is that the run becomes inspectable and enforceable:
|
|
21
|
+
|
|
22
|
+
- budget policy is explicit
|
|
23
|
+
- verifier success is explicit
|
|
24
|
+
- stop reasons are explicit
|
|
25
|
+
- artifacts are inspectable after the run
|
|
26
|
+
|
|
27
|
+
That makes a coding-agent result easier to trust, replay, compare, and audit.
|
|
28
|
+
|
|
29
|
+
## Reproduce it
|
|
30
|
+
|
|
31
|
+
From the repo root:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm --filter @martin/benchmarks test
|
|
35
|
+
pnpm --filter @martin/benchmarks eval
|
|
36
|
+
pnpm --filter @martin/benchmarks eval:phase12
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## What to share back
|
|
40
|
+
|
|
41
|
+
If you run a similar challenge with Claude Code, Codex CLI, Cursor, Aider, Cline, Continue, OpenHands, SWE-agent, Goose, or an internal coding agent, share:
|
|
42
|
+
|
|
43
|
+
- total budget used
|
|
44
|
+
- number of attempts
|
|
45
|
+
- verifier result
|
|
46
|
+
- whether the final run was auditable
|
|
47
|
+
- whether rollback evidence was available
|
|
48
|
+
|
|
49
|
+
## Try MartinLoop without risking your repo
|
|
50
|
+
|
|
51
|
+
You can copy the public demo sandbox first:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx martin-loop demo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then run the sandbox locally with the printed next steps.
|
|
58
|
+
|
|
59
|
+
## Claim boundary
|
|
60
|
+
|
|
61
|
+
This page intentionally stays inside the current public evidence boundary:
|
|
62
|
+
|
|
63
|
+
- the `$2.30` and `$5.20` figures are the current repo-backed benchmark story used in the public README
|
|
64
|
+
- the reproduction commands above are real commands from this repository
|
|
65
|
+
- the benchmark harness remains a workspace-level surface, so challenge claims should stay tied to repo-backed outputs rather than generic marketing numbers
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Claude Code Walkthrough
|
|
2
|
+
|
|
3
|
+
This walkthrough shows how to put MartinLoop around a Claude Code-driven coding task so the run has a budget, a verifier gate, an explicit stop reason, and an inspectable run record.
|
|
4
|
+
|
|
5
|
+
Back to the repo overview: [README.md](../../README.md)
|
|
6
|
+
|
|
7
|
+
## What MartinLoop adds around Claude Code
|
|
8
|
+
|
|
9
|
+
Claude Code is the coding engine. MartinLoop is the governance layer around it.
|
|
10
|
+
|
|
11
|
+
- **Budget**: hard USD, token, and iteration limits decide how far the run can go.
|
|
12
|
+
- **Verifier**: the run only counts as complete when the post-run verification command passes.
|
|
13
|
+
- **Stop reason**: MartinLoop records why the run stopped, such as `completed`, `budget_exit`, or `human_escalation`.
|
|
14
|
+
- **Run record**: each run appends a JSONL record under `~/.martin/runs/` so you can inspect it later.
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- Node.js 20+
|
|
19
|
+
- `pnpm` 10.x if you are running from this repo
|
|
20
|
+
- Claude Code CLI installed and authenticated
|
|
21
|
+
- A repo you want Claude Code to work in
|
|
22
|
+
|
|
23
|
+
## Install MartinLoop
|
|
24
|
+
|
|
25
|
+
For the published CLI:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g martin-loop
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For repo-local development in this monorepo:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm install
|
|
35
|
+
pnpm build
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Simple local run
|
|
39
|
+
|
|
40
|
+
Run MartinLoop with the default Claude adapter and a verifier command:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
martin run "fix the auth regression" \
|
|
44
|
+
--engine claude \
|
|
45
|
+
--budget 3.00 \
|
|
46
|
+
--verify "pnpm test"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
What happens:
|
|
50
|
+
|
|
51
|
+
- MartinLoop hands the objective to Claude Code
|
|
52
|
+
- Claude Code attempts the work
|
|
53
|
+
- MartinLoop runs the verifier command
|
|
54
|
+
- the loop only finishes as `completed` when the agent result and verifier both pass
|
|
55
|
+
|
|
56
|
+
## Budget example
|
|
57
|
+
|
|
58
|
+
Use a hard cap and a smaller iteration budget when you want Claude Code to stay tightly bounded:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
martin run "tighten the login retry handling" \
|
|
62
|
+
--engine claude \
|
|
63
|
+
--budget 2.00 \
|
|
64
|
+
--soft-limit-usd 1.25 \
|
|
65
|
+
--max-iterations 2 \
|
|
66
|
+
--max-tokens 20000 \
|
|
67
|
+
--verify "pnpm --filter @martin/core test"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This is the key MartinLoop value-add for Claude Code workflows: the agent can keep trying, but only inside a contract you can review before the spend drifts.
|
|
71
|
+
|
|
72
|
+
## Verifier example
|
|
73
|
+
|
|
74
|
+
Use a verifier that matches the exact scope of the change:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
martin run "update the OSS quickstart wording" \
|
|
78
|
+
--engine claude \
|
|
79
|
+
--cwd . \
|
|
80
|
+
--allow-path README.md \
|
|
81
|
+
--allow-path docs/oss/** \
|
|
82
|
+
--deny-path apps/control-plane/** \
|
|
83
|
+
--accept "Only documentation files may change" \
|
|
84
|
+
--verify "pnpm --filter @martin/core test"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The verifier gate matters because Claude Code producing a patch is not the same thing as the repo being in a valid state.
|
|
88
|
+
|
|
89
|
+
## Inspect example
|
|
90
|
+
|
|
91
|
+
After a run, inspect the persisted JSONL record:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
martin inspect --file ~/.martin/runs/<workspaceId>.jsonl
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Look for:
|
|
98
|
+
|
|
99
|
+
- the final lifecycle state and stop reason
|
|
100
|
+
- budget and token totals
|
|
101
|
+
- verifier outcome
|
|
102
|
+
- attempt count and failure classification
|
|
103
|
+
|
|
104
|
+
## Safe repo-local dry run
|
|
105
|
+
|
|
106
|
+
If you want to validate the MartinLoop flow without real model spend, use stub mode first:
|
|
107
|
+
|
|
108
|
+
### PowerShell
|
|
109
|
+
|
|
110
|
+
```powershell
|
|
111
|
+
$env:MARTIN_LIVE='false'
|
|
112
|
+
$repoRoot = (Get-Location).Path
|
|
113
|
+
pnpm run:cli -- run `
|
|
114
|
+
--cwd $repoRoot `
|
|
115
|
+
--objective "Summarize the current runtime state" `
|
|
116
|
+
--verify "pnpm --filter @martin/core test"
|
|
117
|
+
Remove-Item Env:MARTIN_LIVE
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This does not invoke Claude Code, and it will usually end with a recorded non-success stop reason because no live provider request was attempted. That is still the fastest way to confirm the loop, persistence, and verifier path are wired correctly before you switch to a live Claude run.
|
|
121
|
+
|
|
122
|
+
## Common errors and troubleshooting
|
|
123
|
+
|
|
124
|
+
### `claude` is not found
|
|
125
|
+
|
|
126
|
+
MartinLoop can only use the Claude adapter when the Claude Code CLI is installed and available on `PATH`. Confirm the CLI itself works before you debug MartinLoop.
|
|
127
|
+
|
|
128
|
+
### The run stops with `budget_exit`
|
|
129
|
+
|
|
130
|
+
The configured budget, iteration limit, or token ceiling was too tight for the requested task. Either narrow the task or raise the budget intentionally.
|
|
131
|
+
|
|
132
|
+
### The verifier fails even though Claude Code produced a patch
|
|
133
|
+
|
|
134
|
+
That means MartinLoop did its job. The patch was attempted, but the repo did not reach a verified state. Tighten the scope, change the verifier, or ask Claude Code to address the failing checks directly.
|
|
135
|
+
|
|
136
|
+
### The run exits with `human_escalation`
|
|
137
|
+
|
|
138
|
+
That usually means MartinLoop detected a path that should not proceed unattended, such as an unsafe verifier or a control boundary that needs review.
|
|
139
|
+
|
|
140
|
+
### `martin inspect` cannot find the file
|
|
141
|
+
|
|
142
|
+
Run another task first, or point `inspect` at the correct JSONL file under `~/.martin/runs/`.
|
package/docs/oss/EXAMPLES.md
CHANGED
|
@@ -107,7 +107,15 @@ Example `martin_run` payload:
|
|
|
107
107
|
}
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
## 6.
|
|
110
|
+
## 6. GitHub Actions budget gate example
|
|
111
|
+
|
|
112
|
+
See [`examples/github-actions-budget-gate/`](../../examples/github-actions-budget-gate/) for a CI-safe example that runs MartinLoop with a budget cap, an explicit verifier, and an uploaded JSONL run record artifact.
|
|
113
|
+
|
|
114
|
+
## 7. OpenCode-style adapter example
|
|
115
|
+
|
|
116
|
+
If you want a runnable, no-credentials-required adapter sketch for another coding runtime, see [`examples/opencode-adapter/`](../../examples/opencode-adapter/). It shows how to keep MartinLoop's budget, verifier, and JSONL record shape stable around an OpenCode-style workflow without claiming a native adapter already exists.
|
|
117
|
+
|
|
118
|
+
## 8. What to inspect in artifacts
|
|
111
119
|
|
|
112
120
|
For a repo-backed attempt, look at:
|
|
113
121
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-
|
|
2
|
+
"generatedAt": "2026-05-11T21:47:36.834Z",
|
|
3
3
|
"verdict": "go",
|
|
4
4
|
"publicSurface": {
|
|
5
5
|
"packageName": "martin-loop",
|
|
@@ -56,15 +56,11 @@
|
|
|
56
56
|
"classificationReason": "Intended Phase 13 OSS core surface."
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
"name": "@
|
|
59
|
+
"name": "@martinloop/mcp",
|
|
60
60
|
"path": "packages/mcp",
|
|
61
61
|
"private": false,
|
|
62
62
|
"publishAccess": "public",
|
|
63
|
-
"workspaceDependencies": [
|
|
64
|
-
"@martin/adapters",
|
|
65
|
-
"@martin/contracts",
|
|
66
|
-
"@martin/core"
|
|
67
|
-
],
|
|
63
|
+
"workspaceDependencies": [],
|
|
68
64
|
"classification": "oss_core",
|
|
69
65
|
"classificationReason": "Intended Phase 13 OSS core surface."
|
|
70
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Martin Loop Phase 13 OSS Core Boundary
|
|
2
2
|
|
|
3
|
-
Generated: 2026-
|
|
3
|
+
Generated: 2026-05-11T21:47:36.834Z
|
|
4
4
|
|
|
5
5
|
## Verdict
|
|
6
6
|
**GO**
|
|
@@ -30,7 +30,7 @@ Generated: 2026-04-22T11:35:54.851Z
|
|
|
30
30
|
| @martin/core | packages/core | yes | n/a | @martin/contracts |
|
|
31
31
|
| @martin/adapters | packages/adapters | yes | n/a | @martin/core |
|
|
32
32
|
| @martin/cli | packages/cli | no | public | @martin/adapters, @martin/contracts, @martin/core |
|
|
33
|
-
| @
|
|
33
|
+
| @martinloop/mcp | packages/mcp | no | public | none |
|
|
34
34
|
|
|
35
35
|
## Non-OSS Workspace Packages
|
|
36
36
|
| Package | Path | Reason |
|
package/docs/oss/QUICKSTART.md
CHANGED
|
@@ -9,8 +9,9 @@ The frozen public launch target is:
|
|
|
9
9
|
- `npm install martin-loop`
|
|
10
10
|
- `npx martin-loop ...`
|
|
11
11
|
- `import { MartinLoop } from "martin-loop"`
|
|
12
|
+
- `npx @martinloop/mcp`
|
|
12
13
|
|
|
13
|
-
That launch surface is
|
|
14
|
+
That runtime launch surface is implemented in the root package facade and smoke-validated from a clean temporary install. The MCP package shape is also smoke-validated from a packed tarball. This quickstart still documents the honest RC-from-source path because public registry publication is a separate release step.
|
|
14
15
|
|
|
15
16
|
## Prerequisites
|
|
16
17
|
|
|
@@ -114,10 +115,39 @@ For persisted run folders, inspect the `contract.json`, `state.json`, `ledger.js
|
|
|
114
115
|
|
|
115
116
|
## MCP server
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
The publish-ready MCP install target is:
|
|
118
119
|
|
|
119
120
|
```bash
|
|
120
|
-
|
|
121
|
+
npx @martinloop/mcp
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Claude Code one-line install:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# macOS/Linux
|
|
128
|
+
claude mcp add --scope user martin-loop -- npx @martinloop/mcp
|
|
129
|
+
|
|
130
|
+
# Windows PowerShell/cmd
|
|
131
|
+
claude mcp add --scope user martin-loop cmd /c "npx @martinloop/mcp"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Official MCP Registry publication has an extra metadata step beyond npm packaging. Do not mark `@martinloop/mcp` registry-ready unless both of these exist and match:
|
|
135
|
+
|
|
136
|
+
- `packages/mcp/package.json` with `mcpName`
|
|
137
|
+
- `packages/mcp/server.json` with the official server metadata
|
|
138
|
+
|
|
139
|
+
After publishing `@martinloop/mcp` to npm, run the official registry publisher from `packages/mcp`:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mcp-publisher login github
|
|
143
|
+
mcp-publisher publish
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For repo-local verification from source:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pnpm --filter @martinloop/mcp build
|
|
150
|
+
pnpm --filter @martinloop/mcp smoke:pack
|
|
121
151
|
node packages/mcp/dist/server.js
|
|
122
152
|
```
|
|
123
153
|
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Ralph-Style Loop Safety Guide
|
|
2
|
+
|
|
3
|
+
Ralph-style loops are useful because they keep trying until a coding task reaches a stopping condition. MartinLoop is not a replacement for that pattern. It is the governance layer that makes the pattern safer to run unattended.
|
|
4
|
+
|
|
5
|
+
For install and first-run steps, start with the repo quickstart: [README.md#quick-start](../../README.md#quick-start)
|
|
6
|
+
|
|
7
|
+
## 1. What Ralph-style loops do well
|
|
8
|
+
|
|
9
|
+
Ralph-style loops are good at persistence:
|
|
10
|
+
|
|
11
|
+
- they retry after a failed attempt
|
|
12
|
+
- they keep working toward a concrete objective
|
|
13
|
+
- they help teams automate long-running coding tasks that would otherwise need constant supervision
|
|
14
|
+
|
|
15
|
+
That persistence is the reason teams use them. The problem is not the existence of the loop. The problem is what happens when the loop keeps running without a clear governance contract.
|
|
16
|
+
|
|
17
|
+
## 2. Where unattended loops fail
|
|
18
|
+
|
|
19
|
+
An unattended coding loop can fail in ways that are expensive even when no single attempt looks dramatic on its own:
|
|
20
|
+
|
|
21
|
+
- spend keeps accumulating across retries
|
|
22
|
+
- verifier failures repeat without a meaningful strategy change
|
|
23
|
+
- file edits drift outside the intended task boundary
|
|
24
|
+
- the final outcome is hard to audit because the reasoning trail is incomplete
|
|
25
|
+
- operators know that the loop stopped, but not whether it stopped for success, safety, or exhaustion
|
|
26
|
+
|
|
27
|
+
Those are governance failures, not only model failures.
|
|
28
|
+
|
|
29
|
+
## 3. Why max iterations alone are not enough
|
|
30
|
+
|
|
31
|
+
A max-iteration limit is helpful, but it only answers one question: "How many times may this loop try?"
|
|
32
|
+
|
|
33
|
+
It does not answer:
|
|
34
|
+
|
|
35
|
+
- how much budget can be spent before the next attempt is rejected
|
|
36
|
+
- whether the verifier command is safe to run
|
|
37
|
+
- whether the patch stayed inside the approved file scope
|
|
38
|
+
- whether a failed run left rollback evidence behind
|
|
39
|
+
- whether the recorded outcome is trustworthy enough to resume or inspect later
|
|
40
|
+
|
|
41
|
+
Iteration caps are one guardrail. They are not a full control layer.
|
|
42
|
+
|
|
43
|
+
## 4. What MartinLoop adds
|
|
44
|
+
|
|
45
|
+
MartinLoop governs the loop before, during, and after execution:
|
|
46
|
+
|
|
47
|
+
- **Budget governance** rejects work that would exceed the configured spend, token, or iteration envelope
|
|
48
|
+
- **Verifier gates** only allow a run to finish as `completed` when the agent result and verification state both pass
|
|
49
|
+
- **Safety leash checks** evaluate verifier commands, file boundaries, and approval-sensitive actions before work is accepted
|
|
50
|
+
- **Stop reasons** make the final lifecycle state explicit, such as `completed`, `budget_exit`, or `human_escalation`
|
|
51
|
+
- **Run records** append JSONL evidence under `~/.martin/runs/` so operators can inspect what happened later
|
|
52
|
+
- **Rollback evidence** preserves the recovery boundary for repo-backed runs when persistence is configured
|
|
53
|
+
|
|
54
|
+
That is why MartinLoop should be thought of as a companion governance layer around a Ralph-style loop, not an argument against using one.
|
|
55
|
+
|
|
56
|
+
## 5. Example governed run
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
martin run "fix the auth regression" \
|
|
60
|
+
--budget 3.00 \
|
|
61
|
+
--soft-limit-usd 2.00 \
|
|
62
|
+
--max-iterations 2 \
|
|
63
|
+
--verify "pnpm test"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This changes the operator contract in a few important ways:
|
|
67
|
+
|
|
68
|
+
- the next attempt can be rejected before overspend happens
|
|
69
|
+
- the run still has to satisfy the verifier
|
|
70
|
+
- the final state is inspectable instead of being inferred from logs alone
|
|
71
|
+
|
|
72
|
+
## 6. Example stop reason
|
|
73
|
+
|
|
74
|
+
MartinLoop returns an explicit lifecycle state and reason when a run stops:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"decision": {
|
|
79
|
+
"shouldExit": true,
|
|
80
|
+
"lifecycleState": "budget_exit",
|
|
81
|
+
"status": "exited",
|
|
82
|
+
"reason": "Martin exited because the budget governor hit a hard limit."
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
That answer is more useful than "the loop stopped" because it tells the operator whether the run ended for success, safety, or exhaustion.
|
|
88
|
+
|
|
89
|
+
## 7. Example JSONL run record
|
|
90
|
+
|
|
91
|
+
Each run appends a JSONL record shaped like:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"loopId": "loop_example123",
|
|
96
|
+
"workspaceId": "ws_demo",
|
|
97
|
+
"projectId": "proj_demo",
|
|
98
|
+
"status": "exited",
|
|
99
|
+
"lifecycleState": "budget_exit",
|
|
100
|
+
"budget": {
|
|
101
|
+
"maxUsd": 3,
|
|
102
|
+
"softLimitUsd": 2,
|
|
103
|
+
"maxIterations": 2,
|
|
104
|
+
"maxTokens": 20000
|
|
105
|
+
},
|
|
106
|
+
"metadata": {
|
|
107
|
+
"policyProfile": "balanced",
|
|
108
|
+
"telemetryDestination": "local-only"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The full record can also include attempts, events, verifier outcomes, and persisted artifact references. That is the evidence trail MartinLoop adds around a retrying coding loop.
|
package/docs/oss/README.md
CHANGED
|
@@ -8,11 +8,11 @@ Martin Loop is a governed AI coding-loop runtime. The core runtime is real and v
|
|
|
8
8
|
- `@martin/core`: the runtime controller, persistence layer, grounding scanner, leash engine, patch-truth scoring, and rollback restoration logic
|
|
9
9
|
- `@martin/adapters`: normalized Claude CLI, Codex CLI, and direct-provider or stub adapter surfaces
|
|
10
10
|
- `@martin/cli`: the local operator CLI for `run`, `inspect`, and `resume`
|
|
11
|
-
- `@
|
|
11
|
+
- `@martinloop/mcp`: the MCP server surface for `martin_run`, `martin_inspect`, and `martin_status`
|
|
12
12
|
|
|
13
13
|
## What is still outside the initial OSS promise
|
|
14
14
|
|
|
15
|
-
- The root workspace now exposes the `martin-loop` public package facade, but registry publication is still a
|
|
15
|
+
- The root workspace now exposes the `martin-loop` public package facade, and `@martinloop/mcp` now has a standalone tarball shape validated via `pnpm --filter @martinloop/mcp smoke:pack`, but registry publication is still a separate release step.
|
|
16
16
|
- `@martin/contracts`, `@martin/core`, and `@martin/adapters` are still marked `private` in their package manifests.
|
|
17
17
|
- The hosted control-plane and local dashboard remain in the repo, but they are not yet the finalized public OSS boundary.
|
|
18
18
|
- The benchmark harness remains a workspace-only RC surface under `benchmarks/` and is not part of the publishable CLI boundary yet.
|
|
@@ -55,8 +55,9 @@ The current engineering memo freezes these public-launch targets for release pla
|
|
|
55
55
|
- install target: `npm install martin-loop`
|
|
56
56
|
- CLI target: `npx martin-loop ...`
|
|
57
57
|
- SDK target: `import { MartinLoop } from "martin-loop"`
|
|
58
|
+
- MCP target (publish-ready): `npx @martinloop/mcp`
|
|
58
59
|
|
|
59
|
-
Those targets are
|
|
60
|
+
Those runtime targets are implemented in the root package facade and verified through a clean-install smoke test. The MCP target is packaged and verified through a tarball launch smoke test. During the current RC phase, the honest operator path still includes the repo-local workflow documented below and in the quickstart, because public registry publication and broader release packaging remain separate release steps.
|
|
60
61
|
|
|
61
62
|
## Reproducibility
|
|
62
63
|
|
|
@@ -87,6 +88,8 @@ The current release-candidate gate is:
|
|
|
87
88
|
|
|
88
89
|
- [`docs/oss/QUICKSTART.md`](./QUICKSTART.md) for clone-to-first-run setup
|
|
89
90
|
- [`docs/oss/EXAMPLES.md`](./EXAMPLES.md) for grounded CLI and MCP examples
|
|
91
|
+
- [`docs/oss/CLAUDE-CODE-WALKTHROUGH.md`](./CLAUDE-CODE-WALKTHROUGH.md) for a Claude Code-specific governed-run walkthrough
|
|
92
|
+
- [`docs/oss/RALPH-LOOP-SAFETY.md`](./RALPH-LOOP-SAFETY.md) for a technical guide to governing Ralph-style loops safely
|
|
90
93
|
- [`docs/oss/OSS-BOUNDARY-REPORT.md`](./OSS-BOUNDARY-REPORT.md) for the current machine-checked OSS boundary and public-surface status
|
|
91
94
|
- [`docs/oss/RELEASE-SURFACE-REPORT.md`](./RELEASE-SURFACE-REPORT.md) for the current machine-checked release-surface audit
|
|
92
95
|
- [`docs/pilot/README.md`](../pilot/README.md) for the pilot-prep package that remains explicitly gated behind Phase 13 completion
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "martin-loop",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Martin Loop dual-track monorepo for the OSS runtime and hosted SaaS control plane.",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Keesan12/martin-loop.git"
|
|
11
|
+
},
|
|
8
12
|
"packageManager": "pnpm@10.17.1",
|
|
9
13
|
"main": "./dist/index.js",
|
|
10
14
|
"types": "./dist/index.d.ts",
|
|
@@ -21,8 +25,10 @@
|
|
|
21
25
|
},
|
|
22
26
|
"files": [
|
|
23
27
|
"dist",
|
|
28
|
+
"demo",
|
|
24
29
|
"README.md",
|
|
25
|
-
"docs/oss"
|
|
30
|
+
"docs/oss",
|
|
31
|
+
"docs/distribution"
|
|
26
32
|
],
|
|
27
33
|
"publishConfig": {
|
|
28
34
|
"access": "public"
|