@sreetej510/pi-shipd-checks 0.11.6 → 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 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 (via
10
- `git archive HEAD | tar -x`) — it never touches your working directory, staged, or
11
- uncommitted changes.
12
- 2. Copies `agent_prompt.md`, `solution.patch`, and `test.patch` from your project root into
13
- that temp dir.
14
- 3. Optionally runs the solver gap finder: several (configurable, default 3) TDD-style solver
15
- agents, each in its own throwaway git repo with `test.patch` and `agent_prompt.md` applied
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
@@ -37,8 +30,9 @@ or correctness evidence. The adapter is experimental and was trained on all 519
37
30
  assigned to EVAL and HOLDOUT; treat all outputs as unapproved drafts.
38
31
 
39
32
  The agent-callable `quality-check` tool runs `create_patches.sh` in the current working directory and reads
40
- `agent_prompt.md`, `test.patch`, and `solution.patch`. It fills the authenticated Shipd draft fields and computes a SHA-256
41
- of the exact prompt content. The last passing prompt hash is stored as a custom entry in the current chat session. If the
33
+ `agent_prompt.md`, `test.patch`, and `solution.patch`. Before checking or running Prompt Quality, it uploads all three
34
+ contents to the authenticated Shipd draft fields and waits for the editor update to settle. It computes a SHA-256 of the
35
+ exact prompt content. The last passing prompt hash is stored as a custom entry in the current chat session. If the
42
36
  hash matches, it skips the Shipd Prompt Quality check entirely and reports a cached `PASS`; if it differs or is absent, it
43
37
  checks the refreshed status after filling the fields and runs only when the check is stale or has a `Run` button. Otherwise it
44
38
  uses the current report. A new hash is saved only after Prompt Quality passes. On failure, only `promptQuality` is returned; there are no Test/Solution results or `stoppedReason`.
@@ -73,30 +67,28 @@ Shipd tokens; do not run overlapping invocations for the same challenge.
73
67
 
74
68
  ## Commands
75
69
 
76
- `--config` must be used alone; solver-gap-finder is the only `/checks` run mode. The gap-finder, solution-precheck, and prompt-humanizer tools are enabled per project with `/analyze:on`.
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`.
77
71
 
78
72
  | Command | Effect |
79
73
  |---|---|
80
- | `/checks` | Open a menu with config and solver-gap-finder options |
81
- | `/checks --config` | Configure reviewer, solver, and analysis models |
82
- | `/checks --solver-gap-finder` | Run several solver agents TDD-style against `agent_prompt.md` + `test.patch`, then compare their solutions to the real solution to find gaps |
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 |
83
77
  | `/shipd:auth` | Open a browser for first-time Shipd sign-in and save the session |
84
78
  | `/shipd:link <url>` | Save the Shipd job link for the current chat session |
85
79
  | `/analyze:on` | Enable the gap-finder, solution-precheck, and prompt-humanizer tools for the current project |
86
80
  | `/analyze:off` | Disable the gap-finder, solution-precheck, and prompt-humanizer tools for the current project |
87
81
 
88
- **Shortcut:** `Ctrl+Shift+X` cancels an in-progress `/checks` run. Cancellation is propagated to active solver sessions and their spawned shell/test process trees; post-cancel verification, comparison, and artifact writing are skipped.
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.
89
83
 
90
84
  ## Configuration
91
85
 
92
86
  `/checks --config` opens the row-based settings menu with two sections:
93
87
 
94
- - **Solver**: reviewer model and thinking level for the final solver-result reviewer, plus the
95
- solver model, thinking level, timeout, parallel solver count, and artifact-saving setting.
96
- - **Analysis Tools**: timeout, model, and thinking level shared by the agent-callable gap-finder and
97
- solution-precheck tools. The timeout applies to each read-only agent. These are stored under
98
- `analyzeGap.timeoutMinutes`, `analyzeGap.provider`, `analyzeGap.modelId`, and
99
- `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.
100
92
 
101
93
  The humanizer candidate counts are configured separately in `~/.pi/agent/checks-config.json`. `candidateCount` controls
102
94
  how many drafts are requested from CoreWeave (1–10); `topCount` controls the maximum returned (1–10, capped at
@@ -153,8 +145,8 @@ On-Demand fallback. Spot interruptions are retried according to `fargate.maxRetr
153
145
  }
154
146
  ```
155
147
 
156
- The task role is required for long-running jobs because temporary presigned URLs can expire
157
- 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.
158
150
 
159
151
  3. Create an ECS execution role trusted by `ecs-tasks.amazonaws.com`, attach the AWS-managed
160
152
  `service-role/AmazonECSTaskExecutionRolePolicy`, and create the CloudWatch log group. The
@@ -182,14 +174,12 @@ On-Demand fallback. Spot interruptions are retried according to `fargate.maxRetr
182
174
  on later runs (unless `projectProfiles` already overrides the repository). They upgrade when
183
175
  normalized CPU is at least 95% for more than seven minutes, downgrade when CPU is at least 95%
184
176
  for under two minutes, and otherwise retain the profile. Only the selected next profile is
185
- written to `projectProfiles`; CPU telemetry is included in `shipd_report.json` for solver-gap
186
- 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`
187
179
  profile and do not update adaptive sizing. Set `projectProfiles` to override solver-gap
188
180
  resources per repository: `{"C:/path/to/repo":"large"}`.
189
181
 
190
- 5. Restart pi, use `/checks --config` to select the solver and reviewer models, then run
191
- `/checks --solver-gap-finder`. Projects need `Dockerfile`, `agent_prompt.md`,
192
- `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.
193
183
 
194
184
  Use `/analyze:on` and `/analyze:off` to control the gap-finder, solution-precheck, and prompt-humanizer tools per project, like HPC. The
195
185
  enabled project list is stored alongside the other settings in `~/.pi/agent/checks-config.json`.
@@ -244,11 +234,11 @@ Or, for local development, point at the entry point directly:
244
234
  | `src/index.ts` | Extension entry point: message renderer, cancel shortcut, command registration |
245
235
  | `src/submit.ts` | `quality-check`: Playwright draft filling, sequential quality checks, scheduled polling, and report extraction |
246
236
  | `src/command.ts` | The `/checks` command: argument parsing, `--config` flow, run orchestration |
247
- | `src/agents.ts` | Spawns and races the gap-finder, solution-precheck, reviewer, and solver agent sessions |
248
- | `src/solvergap.ts` | Local solver result persistence and comparison artifacts |
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 |
249
239
  | `src/fargate-docker.ts` | Supported Dockerfile parsing for remote solver setup |
250
- | `src/fargate-runner.ts` | ECS Fargate Spot/S3 orchestration for solver, patch-precheck, and batched detector tasks; retries and cleanup |
251
- | `src/fargate-worker.ts` | ESM worker that runs solver workspaces or patch prechecks in the shared task |
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 |
252
242
  | `src/resource-usage.ts` | Container CPU sampling for adaptive profile selection |
253
243
  | `src/prompts.ts` | All prompt text sent to those agents |
254
244
  | `src/tools.ts` | Custom tools the agents call to submit their structured results |