@sreetej510/pi-shipd-checks 0.11.7 → 0.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 +27 -38
- package/dist/fargate-worker.mjs +65 -2820
- package/dist/index.js +68 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,22 +4,15 @@ A [pi](https://github.com/earendil-works/pi) coding agent extension for benchmar
|
|
|
4
4
|
|
|
5
5
|
## What it does
|
|
6
6
|
|
|
7
|
-
For `/checks`:
|
|
8
|
-
|
|
9
|
-
1. Snapshots the current git `HEAD` into a throwaway temp directory
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(never `solution.patch`), given write/edit/bash access to iterate until `./test.sh new`
|
|
17
|
-
passes or they give up. The extension independently re-verifies each solver's result and
|
|
18
|
-
compares passing solver diffs with the reference to surface behavioral gaps.
|
|
19
|
-
4. Runs solver workers in one AWS ECS Fargate Spot task when enabled, with the source snapshot
|
|
20
|
-
and partial results in S3. A Spot interruption retries the task and resumes completed
|
|
21
|
-
solver indexes.
|
|
22
|
-
5. Posts a chat summary and merges solver results into `shipd_report.json` in your project root.
|
|
7
|
+
For `/checks solve`:
|
|
8
|
+
|
|
9
|
+
1. Snapshots only the current git `HEAD` into a throwaway temp directory; the source checkout is never modified.
|
|
10
|
+
2. Sends the exact contents of `agent_prompt.md` as each solver's sole first user message. No prompt file, task Dockerfile, `test.patch`, `solution.patch`, or uncommitted test files are overlaid into a solver workspace. The Dockerfile is used only by the harness to provision the Fargate environment.
|
|
11
|
+
3. Runs several configurable (default 3) independent Claude Code CLI solver invocations in parallel, each with its own isolated clean-HEAD workspace and only the `Bash` tool enabled. Captures each solver's `stream-json` trace of assistant and tool events (not private chain-of-thought). There is no test-driven repair loop, and the test patch remains unavailable until that solver exits.
|
|
12
|
+
4. After a solver finishes, the harness applies `test.patch` to its workspace, then runs `bash test.sh --output_path <file> base` and `bash test.sh --output_path <file> new` as an unprivileged user with a fresh writable `HOME` and cache. It captures both full logs.
|
|
13
|
+
5. After all solvers exit and their tests run, the read-only local Pi reviewer receives an untouched clean-HEAD tree plus `agent_prompt.md`, all patch files, standalone copies of new test files, each solver's patch, and every solver's test logs. No patch is applied in the review workspace.
|
|
14
|
+
6. Runs the Claude CLI solvers inside one AWS ECS Fargate Spot task. A Spot interruption retries the task and resumes completed solver indexes. The local Claude Code login file is transferred through private, server-side-encrypted S3 objects, then run objects are deleted.
|
|
15
|
+
7. Posts a chat summary and logs results in `.pi/shipd-checks/<runId>/`, including `agent_steps.jsonl` per solver, and `shipd_report.json` in your project root.
|
|
23
16
|
|
|
24
17
|
The agent-callable `gap-finder` tool runs one exhaustive read-only agent over the prompt, repository, and tests. It
|
|
25
18
|
reviews requirements sentence by sentence, performs its own evidence and fairness check, and returns confirmed
|
|
@@ -74,30 +67,28 @@ Shipd tokens; do not run overlapping invocations for the same challenge.
|
|
|
74
67
|
|
|
75
68
|
## Commands
|
|
76
69
|
|
|
77
|
-
|
|
70
|
+
`/checks solve` runs the benchmark using `agent_prompt.md`; it requires that prompt file, `Dockerfile`, and `test.patch` (which supplies `test.sh` and the test files). The solver sees only clean `HEAD` plus the prompt text; the harness applies `test.patch` after the solver exits. `solution.patch` is not required by the solver; when present, the local reviewer receives it as the task-author reference patch. `/checks --config` is separate and configures the local Pi reviewer/analysis models and Claude solver settings. The gap-finder, solution-precheck, and prompt-humanizer tools are enabled per project with `/analyze:on`.
|
|
78
71
|
|
|
79
72
|
| Command | Effect |
|
|
80
73
|
|---|---|
|
|
81
|
-
| `/checks` | Open a menu
|
|
82
|
-
| `/checks
|
|
83
|
-
| `/checks --
|
|
74
|
+
| `/checks` | Open a menu for settings or `solve` |
|
|
75
|
+
| `/checks solve` | Run isolated Claude CLI solvers and base/new tests, then use a local Pi reviewer to assess test fairness and failed agents |
|
|
76
|
+
| `/checks --config` | Configure local Pi reviewer/analysis models, Solver model (Claude), Claude solver effort, timeout, and parallel agent count |
|
|
84
77
|
| `/shipd:auth` | Open a browser for first-time Shipd sign-in and save the session |
|
|
85
78
|
| `/shipd:link <url>` | Save the Shipd job link for the current chat session |
|
|
86
79
|
| `/analyze:on` | Enable the gap-finder, solution-precheck, and prompt-humanizer tools for the current project |
|
|
87
80
|
| `/analyze:off` | Disable the gap-finder, solution-precheck, and prompt-humanizer tools for the current project |
|
|
88
81
|
|
|
89
|
-
**Shortcut:** `Ctrl+Shift+X` cancels an in-progress `/checks` run
|
|
82
|
+
**Shortcut:** `Ctrl+Shift+X` cancels an in-progress `/checks` run, stopping its active Fargate task or local Pi review. A cancelled run skips final report writing.
|
|
90
83
|
|
|
91
84
|
## Configuration
|
|
92
85
|
|
|
93
86
|
`/checks --config` opens the row-based settings menu with two sections:
|
|
94
87
|
|
|
95
|
-
- **Solver**:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
`analyzeGap.timeoutMinutes`, `analyzeGap.provider`, `analyzeGap.modelId`, and
|
|
100
|
-
`analyzeGap.thinkingLevel`. Fargate resources are selected automatically and are not configurable in this menu.
|
|
88
|
+
- **Solver**: Solver model (Claude: `haiku`, `sonnet`, or `opus`), solver effort (`low`, `medium`, `high`, `xhigh`, or `max`), one-shot timeout, parallel agent count, and the local Pi reviewer model/thinking level. Solver effort defaults to `low` when unset and is passed explicitly to Claude. Diffs, agent output, `agent_steps.jsonl` traces, base/new logs, and the local reviewer assessment are saved under `.pi/shipd-checks/<runId>/` and summarized in `shipd_report.json`.
|
|
89
|
+
- **Analysis Tools**: timeout, model, and thinking level for the separate agent-callable gap-finder and solution-precheck tools. The timeout applies to each read-only agent. These are stored under `analyzeGap.timeoutMinutes`, `analyzeGap.provider`, `analyzeGap.modelId`, and `analyzeGap.thinkingLevel`. Fargate resources are selected automatically and are not configurable in this menu.
|
|
90
|
+
|
|
91
|
+
For each Claude solver, `shipd_report.json` records CLI-reported input/cache/output token totals, final and peak request-context token counts, context-window size/utilization, API-call count, and cost when available. When the CLI explicitly reports thinking tokens, `totalTokens` subtracts them from raw input-plus-output; otherwise it remains the raw total. The raw total is also recorded when a subtraction is made. The local Pi reviewer records session usage when the provider reports it. Per-agent, reviewer, and aggregate usage appears once under `solverTokenUsage`; `solverRunSummary` contains outcomes, while `solverReview` contains the assessment and reviewer model settings.
|
|
101
92
|
|
|
102
93
|
The humanizer candidate counts are configured separately in `~/.pi/agent/checks-config.json`. `candidateCount` controls
|
|
103
94
|
how many drafts are requested from CoreWeave (1–10); `topCount` controls the maximum returned (1–10, capped at
|
|
@@ -154,8 +145,8 @@ On-Demand fallback. Spot interruptions are retried according to `fargate.maxRetr
|
|
|
154
145
|
}
|
|
155
146
|
```
|
|
156
147
|
|
|
157
|
-
The task role is
|
|
158
|
-
while dependencies or agents are running.
|
|
148
|
+
The task role is recommended for long-running jobs because temporary presigned URLs can expire
|
|
149
|
+
while dependencies or agents are running; it is needed if a run may exceed the URL lifetime.
|
|
159
150
|
|
|
160
151
|
3. Create an ECS execution role trusted by `ecs-tasks.amazonaws.com`, attach the AWS-managed
|
|
161
152
|
`service-role/AmazonECSTaskExecutionRolePolicy`, and create the CloudWatch log group. The
|
|
@@ -183,14 +174,12 @@ On-Demand fallback. Spot interruptions are retried according to `fargate.maxRetr
|
|
|
183
174
|
on later runs (unless `projectProfiles` already overrides the repository). They upgrade when
|
|
184
175
|
normalized CPU is at least 95% for more than seven minutes, downgrade when CPU is at least 95%
|
|
185
176
|
for under two minutes, and otherwise retain the profile. Only the selected next profile is
|
|
186
|
-
written to `projectProfiles`; CPU telemetry is included in `shipd_report.json` for
|
|
187
|
-
runs, but no telemetry history is retained. Quality patch prechecks always use the `medium`
|
|
177
|
+
written to `projectProfiles`; CPU telemetry is included in `shipd_report.json` for Claude
|
|
178
|
+
benchmark runs, but no telemetry history is retained. Quality patch prechecks always use the `medium`
|
|
188
179
|
profile and do not update adaptive sizing. Set `projectProfiles` to override solver-gap
|
|
189
180
|
resources per repository: `{"C:/path/to/repo":"large"}`.
|
|
190
181
|
|
|
191
|
-
5.
|
|
192
|
-
`/checks --solver-gap-finder`. Projects need `Dockerfile`, `agent_prompt.md`,
|
|
193
|
-
`solution.patch`, `test.patch`, and `test.sh`.
|
|
182
|
+
5. Sign in to Claude Code locally so `%USERPROFILE%\\.claude\\.credentials.json` exists. The Fargate runner copies that login file for this run; it does not upload Pi's `auth.json`. Configure the Solver model (Claude), thinking/effort level, count, and timeout in `/checks --config`, then run `/checks solve`. Projects need `Dockerfile`, `agent_prompt.md`, and `test.patch`, which should add `test.sh` with `--output_path <file> base` and `--output_path <file> new` modes. A task role is recommended for runs that may exceed the 55-minute pre-signed URL lifetime.
|
|
194
183
|
|
|
195
184
|
Use `/analyze:on` and `/analyze:off` to control the gap-finder, solution-precheck, and prompt-humanizer tools per project, like HPC. The
|
|
196
185
|
enabled project list is stored alongside the other settings in `~/.pi/agent/checks-config.json`.
|
|
@@ -245,11 +234,11 @@ Or, for local development, point at the entry point directly:
|
|
|
245
234
|
| `src/index.ts` | Extension entry point: message renderer, cancel shortcut, command registration |
|
|
246
235
|
| `src/submit.ts` | `quality-check`: Playwright draft filling, sequential quality checks, scheduled polling, and report extraction |
|
|
247
236
|
| `src/command.ts` | The `/checks` command: argument parsing, `--config` flow, run orchestration |
|
|
248
|
-
| `src/agents.ts` | Spawns and races
|
|
249
|
-
| `src/solvergap.ts` |
|
|
237
|
+
| `src/agents.ts` | Spawns and races local Pi gap-finder, solution-precheck, and benchmark-review sessions |
|
|
238
|
+
| `src/solvergap.ts` | Benchmark artifact-directory constant |
|
|
250
239
|
| `src/fargate-docker.ts` | Supported Dockerfile parsing for remote solver setup |
|
|
251
|
-
| `src/fargate-runner.ts` | ECS Fargate Spot/S3 orchestration for
|
|
252
|
-
| `src/fargate-worker.ts` | ESM worker that runs
|
|
240
|
+
| `src/fargate-runner.ts` | ECS Fargate Spot/S3 orchestration for Claude CLI benchmark runs, patch-prechecks, and detector tasks; retries and cleanup |
|
|
241
|
+
| `src/fargate-worker.ts` | ESM worker that runs isolated Claude CLI solvers or patch prechecks in the shared task |
|
|
253
242
|
| `src/resource-usage.ts` | Container CPU sampling for adaptive profile selection |
|
|
254
243
|
| `src/prompts.ts` | All prompt text sent to those agents |
|
|
255
244
|
| `src/tools.ts` | Custom tools the agents call to submit their structured results |
|