pitroom 0.6.0 → 0.6.3
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/.claude-plugin/marketplace.json +4 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +20 -10
- package/CHANGELOG.md +21 -0
- package/PRIVACY.md +31 -0
- package/README.md +24 -13
- package/assets/icon.svg +32 -0
- package/assets/logo.svg +32 -0
- package/dist/pitroom.mjs +1 -1
- package/package.json +3 -1
- package/skills/pitroom-debugging/root-cause-tracing.md +6 -5
- package/skills/pitroom-debugging/find-polluter.sh +0 -72
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "pitroom",
|
|
10
10
|
"description": "Delegate research, fixes, tests and parallel investigations to cheap OpenCode, Codex or Claude Code workers, with verified answers, exact diffs and cost receipts.",
|
|
11
|
-
"
|
|
12
|
-
|
|
11
|
+
"source": {
|
|
12
|
+
"source": "npm",
|
|
13
|
+
"package": "pitroom"
|
|
14
|
+
},
|
|
13
15
|
"author": {
|
|
14
16
|
"name": "TahaAtas"
|
|
15
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pitroom",
|
|
3
3
|
"description": "A free pit crew for your expensive coding agent: the superpowers development workflow, run by cheap workers. Delegate research, fixes, tests, reviews and whole plans from Claude Code, Codex or any agent to OpenCode, Codex or Claude Code workers, with receipts that prove the savings.",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TahaAtas"
|
|
7
7
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pitroom",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "A free pit crew for your expensive coding agent: delegate research, fixes, tests and parallel investigations to cheap
|
|
3
|
+
"version": "0.6.3",
|
|
4
|
+
"description": "A free pit crew for your expensive coding agent: delegate research, fixes, tests, reviews and parallel investigations to cheap worker agents running your own models, with verified answers, exact diffs and cost receipts.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TahaAtas"
|
|
7
7
|
},
|
|
@@ -9,21 +9,31 @@
|
|
|
9
9
|
"repository": "https://github.com/ATASTECH/pitroom",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"keywords": [
|
|
12
|
-
"
|
|
13
|
-
"codex",
|
|
12
|
+
"agent-skills",
|
|
14
13
|
"cost",
|
|
15
14
|
"delegation",
|
|
16
|
-
"opencode",
|
|
17
15
|
"parallel",
|
|
18
16
|
"subagents",
|
|
19
|
-
"
|
|
17
|
+
"tokens",
|
|
18
|
+
"workers",
|
|
19
|
+
"workflow"
|
|
20
20
|
],
|
|
21
21
|
"skills": "./skills/",
|
|
22
|
-
"hooks": {},
|
|
23
22
|
"interface": {
|
|
24
23
|
"displayName": "Pitroom",
|
|
25
|
-
"shortDescription": "Cheap
|
|
26
|
-
"longDescription": "Pitroom lets
|
|
27
|
-
"
|
|
24
|
+
"shortDescription": "Cheap workers for your agent",
|
|
25
|
+
"longDescription": "Pitroom lets your coding agent hand bounded work to worker agents running your own free, paid or local models: read-only research, isolated code changes, second-opinion reviews and parallel crews, with per-run permission profiles, a git guard, verified file references, exact diffs and cost receipts. Fourteen skills adapt a full development workflow (brainstorm, plan, worker-driven development, review, debugging, TDD, verification). Requires the pitroom command (npm i -g pitroom), Node.js 18 or newer and at least one worker agent CLI, installed and signed in.",
|
|
26
|
+
"developerName": "TahaAtas",
|
|
27
|
+
"category": "Developer Tools",
|
|
28
|
+
"capabilities": [
|
|
29
|
+
"Read",
|
|
30
|
+
"Write"
|
|
31
|
+
],
|
|
32
|
+
"websiteURL": "https://github.com/ATASTECH/pitroom",
|
|
33
|
+
"supportURL": "https://github.com/ATASTECH/pitroom/issues",
|
|
34
|
+
"brandColor": "#FF6A2B",
|
|
35
|
+
"logo": "./assets/logo.svg",
|
|
36
|
+
"composerIcon": "./assets/icon.svg",
|
|
37
|
+
"privacyPolicyURL": "https://github.com/ATASTECH/pitroom/blob/main/PRIVACY.md"
|
|
28
38
|
}
|
|
29
39
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Skills
|
|
6
|
+
- `pitroom-debugging` no longer bundles `find-polluter.sh`, an executable that ran the project's tests in a loop (a directory scan flagged it as a security risk). The test-pollution hunt is now a written procedure: bisect the test files by hand, in an isolated copy, with the project's own test command.
|
|
7
|
+
|
|
8
|
+
## 0.6.2
|
|
9
|
+
|
|
10
|
+
### Directory listing
|
|
11
|
+
- The Codex manifest no longer names other assistants or platforms in its name, descriptions and keywords (the OpenAI directory flags them), and carries an app icon (`assets/logo.svg`, `assets/icon.svg`) and a `privacyPolicyURL`.
|
|
12
|
+
- `PRIVACY.md`: what Pitroom stores and what reaches a worker's model provider.
|
|
13
|
+
|
|
14
|
+
## 0.6.1
|
|
15
|
+
|
|
16
|
+
### Install
|
|
17
|
+
- The Claude Code and Codex marketplace now installs the published npm package (under 0.5 MB, no dependencies) instead of copying the whole repository: before, `claude plugin install` also copied `src/` and `test/` and ran `npm install` for the development tools (39 MB). One `.claude-plugin/marketplace.json` serves both agents.
|
|
18
|
+
- The README has an install table per agent: Claude Code plugin, Codex plugin (skills only, no session-start hook, the `pitroom` command comes from npm) and npm with `pitroom install`.
|
|
19
|
+
|
|
20
|
+
### Directory listing
|
|
21
|
+
- The Codex manifest carries the listing fields the public plugin directory asks for (short description, developer, capabilities, links) and no longer declares `hooks`, which the directory does not accept.
|
|
22
|
+
- `docs/releasing.md` lists the release steps and how to submit to the Anthropic and OpenAI directories.
|
|
23
|
+
|
|
3
24
|
## 0.6.0
|
|
4
25
|
|
|
5
26
|
### Workflow skills
|
package/PRIVACY.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pitroom privacy policy
|
|
2
|
+
|
|
3
|
+
_Last updated: 2026-09-30_
|
|
4
|
+
|
|
5
|
+
Pitroom is a command-line tool and a set of agent skills that run on your own computer. This page says what it does with your data.
|
|
6
|
+
|
|
7
|
+
## What the Pitroom authors collect
|
|
8
|
+
|
|
9
|
+
Nothing. Pitroom has no accounts, no analytics and no telemetry, and its own code makes no network requests. No data is sent to the authors.
|
|
10
|
+
|
|
11
|
+
## What happens when you delegate work
|
|
12
|
+
|
|
13
|
+
Pitroom starts a worker agent CLI that you installed and signed in to yourself. Whatever you ask a worker to do is handled by that CLI and by the model provider behind it:
|
|
14
|
+
|
|
15
|
+
- the task text you or your agent write;
|
|
16
|
+
- the files the worker reads in your project;
|
|
17
|
+
- for reviews, the diff under review with 10 lines of context, written to a package file the reviewer reads.
|
|
18
|
+
|
|
19
|
+
That data goes to the provider of the worker's model, under that provider's terms and privacy policy, not under this one. Pitroom does not filter the content it hands to a worker: secrets that are committed to a reviewed range are sent as they are. Workers cannot read `.env` files or private key files through Pitroom's permission profiles. To keep code on your machine, point the worker at a local model.
|
|
20
|
+
|
|
21
|
+
## What Pitroom stores on your computer
|
|
22
|
+
|
|
23
|
+
- Run records (the task, the worker's answer, diffs, receipts and the savings ledger) in `~/.local/state/pitroom`, or in the folder named by `PITROOM_HOME`.
|
|
24
|
+
- Optional settings in `~/.config/pitroom/config.json`.
|
|
25
|
+
- Private working copies of your project for isolated runs, inside the state folder. They are removed when you apply or discard a run.
|
|
26
|
+
|
|
27
|
+
Nothing is stored in your repository. To delete the records, run `pitroom clean` or remove the state folder.
|
|
28
|
+
|
|
29
|
+
## Changes and contact
|
|
30
|
+
|
|
31
|
+
If this policy changes, the new version is published in this file with a new date. Questions and requests: <https://github.com/ATASTECH/pitroom/issues>.
|
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Model-agnostic · Verified answers · Receipts, not vibes · OpenCode / Codex /
|
|
|
12
12
|
|
|
13
13
|
[](https://github.com/ATASTECH/pitroom/releases/latest)
|
|
14
14
|
[](https://github.com/ATASTECH/pitroom/releases)
|
|
15
|
+
[](https://www.npmjs.com/package/pitroom)
|
|
15
16
|
[](https://github.com/ATASTECH/pitroom/stargazers)
|
|
16
17
|
[](https://github.com/ATASTECH/pitroom/actions/workflows/ci.yml)
|
|
17
18
|
[](LICENSE)
|
|
@@ -145,9 +146,9 @@ Every run prints a receipt, and `pitroom savings` adds them up:
|
|
|
145
146
|
|
|
146
147
|
### 01
|
|
147
148
|
|
|
148
|
-
**
|
|
149
|
+
**Install**
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
Plugin or npm (below)
|
|
151
152
|
|
|
152
153
|
</td>
|
|
153
154
|
|
|
@@ -155,9 +156,9 @@ Clone the repository
|
|
|
155
156
|
|
|
156
157
|
### 02
|
|
157
158
|
|
|
158
|
-
**
|
|
159
|
+
**Connect a worker**
|
|
159
160
|
|
|
160
|
-
|
|
161
|
+
OpenCode, Codex or Claude Code
|
|
161
162
|
|
|
162
163
|
</td>
|
|
163
164
|
|
|
@@ -186,24 +187,34 @@ Ask your agent, or run `pitroom`
|
|
|
186
187
|
|
|
187
188
|
Requires Node.js 18+ and at least one worker CLI: [OpenCode](https://opencode.ai) v2+ (the default worker), [Codex CLI](https://github.com/openai/codex) or [Claude Code](https://claude.com/claude-code).
|
|
188
189
|
|
|
190
|
+
### Choose how to install
|
|
191
|
+
|
|
192
|
+
| You use | Install | What you get |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| **Claude Code** | `claude plugin marketplace add ATASTECH/pitroom`<br>`claude plugin install pitroom@pitroom`<br>(inside a session: `/plugin marketplace add ATASTECH/pitroom`, `/plugin install pitroom@pitroom`) | The 14 skills, the session-start hook that introduces Pitroom, and a card after each `pitroom` command. The plugin is the published npm package: under 0.5 MB, no dependencies. |
|
|
195
|
+
| **Codex** | `codex plugin marketplace add ATASTECH/pitroom`<br>`codex plugin add pitroom@pitroom`<br>and `npm i -g pitroom` | The 14 skills. Codex plugins have no session-start hook, so Pitroom is not introduced on its own: the skills load when a task matches, or ask for one by name. The `pitroom` command itself comes from npm. |
|
|
196
|
+
| **Any other agent, or only the CLI** | `npm i -g pitroom`<br>`pitroom install` | The CLI, and the skills linked into `~/.agents/skills` and `~/.claude/skills`. |
|
|
197
|
+
|
|
189
198
|
```bash
|
|
190
|
-
|
|
191
|
-
node dist/pitroom.mjs install # skills → ~/.agents/skills + ~/.claude/skills, launcher → ~/.local/bin/pitroom
|
|
192
|
-
pitroom doctor --probe # worker CLI, models, permissions, skills, one live round trip
|
|
199
|
+
pitroom doctor --probe # worker CLI, models, permissions, skills, one live round trip
|
|
193
200
|
```
|
|
194
201
|
|
|
195
|
-
|
|
202
|
+
Pick one path: `doctor` warns if the skills load twice. To run `pitroom` yourself in a terminal (`watch`, `savings`, the status line below), install it from npm as well; the plugins alone do not put it on your PATH.
|
|
196
203
|
|
|
197
|
-
|
|
198
|
-
/plugin marketplace add /path/to/pitroom
|
|
199
|
-
/plugin install pitroom@pitroom
|
|
200
|
-
```
|
|
204
|
+
### Your first run
|
|
201
205
|
|
|
202
|
-
|
|
206
|
+
Pitroom is a toolbox, not a procedure: your agent uses it when it helps, or you ask explicitly:
|
|
203
207
|
|
|
204
208
|
> Use pitroom to map how sessions are created and invalidated, then propose a fix.
|
|
205
209
|
> Split this into a pitroom crew: audit auth, billing and uploads for missing input validation.
|
|
206
210
|
|
|
211
|
+
Or start a worker yourself and read its receipt:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
pitroom "Which files read the session cookie? Cite file:line."
|
|
215
|
+
pitroom savings # what all your runs saved so far
|
|
216
|
+
```
|
|
217
|
+
|
|
207
218
|
---
|
|
208
219
|
|
|
209
220
|
## Modes
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-label="Pitroom">
|
|
2
|
+
<rect width="512" height="512" rx="112" fill="#0B1020"/>
|
|
3
|
+
<rect x="128" y="88" width="24" height="336" rx="12" fill="#F4F6FB"/>
|
|
4
|
+
<g>
|
|
5
|
+
<rect x="152" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
6
|
+
<rect x="192" y="104" width="40" height="40" fill="#1B2547"/>
|
|
7
|
+
<rect x="232" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
8
|
+
<rect x="272" y="104" width="40" height="40" fill="#1B2547"/>
|
|
9
|
+
<rect x="312" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
10
|
+
<rect x="352" y="104" width="40" height="40" fill="#1B2547"/>
|
|
11
|
+
<rect x="152" y="144" width="40" height="40" fill="#1B2547"/>
|
|
12
|
+
<rect x="192" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
13
|
+
<rect x="232" y="144" width="40" height="40" fill="#1B2547"/>
|
|
14
|
+
<rect x="272" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
15
|
+
<rect x="312" y="144" width="40" height="40" fill="#1B2547"/>
|
|
16
|
+
<rect x="352" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
17
|
+
<rect x="152" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
18
|
+
<rect x="192" y="184" width="40" height="40" fill="#1B2547"/>
|
|
19
|
+
<rect x="232" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
20
|
+
<rect x="272" y="184" width="40" height="40" fill="#1B2547"/>
|
|
21
|
+
<rect x="312" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
22
|
+
<rect x="352" y="184" width="40" height="40" fill="#1B2547"/>
|
|
23
|
+
<rect x="152" y="224" width="40" height="40" fill="#1B2547"/>
|
|
24
|
+
<rect x="192" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
25
|
+
<rect x="232" y="224" width="40" height="40" fill="#1B2547"/>
|
|
26
|
+
<rect x="272" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
27
|
+
<rect x="312" y="224" width="40" height="40" fill="#1B2547"/>
|
|
28
|
+
<rect x="352" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
29
|
+
<rect x="152" y="104" width="240" height="160" fill="none" stroke="#F4F6FB" stroke-width="4"/>
|
|
30
|
+
</g>
|
|
31
|
+
<rect x="88" y="424" width="144" height="24" rx="12" fill="#FF6A2B"/>
|
|
32
|
+
</svg>
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-label="Pitroom">
|
|
2
|
+
<rect width="512" height="512" rx="112" fill="#0B1020"/>
|
|
3
|
+
<rect x="128" y="88" width="24" height="336" rx="12" fill="#F4F6FB"/>
|
|
4
|
+
<g>
|
|
5
|
+
<rect x="152" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
6
|
+
<rect x="192" y="104" width="40" height="40" fill="#1B2547"/>
|
|
7
|
+
<rect x="232" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
8
|
+
<rect x="272" y="104" width="40" height="40" fill="#1B2547"/>
|
|
9
|
+
<rect x="312" y="104" width="40" height="40" fill="#F4F6FB"/>
|
|
10
|
+
<rect x="352" y="104" width="40" height="40" fill="#1B2547"/>
|
|
11
|
+
<rect x="152" y="144" width="40" height="40" fill="#1B2547"/>
|
|
12
|
+
<rect x="192" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
13
|
+
<rect x="232" y="144" width="40" height="40" fill="#1B2547"/>
|
|
14
|
+
<rect x="272" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
15
|
+
<rect x="312" y="144" width="40" height="40" fill="#1B2547"/>
|
|
16
|
+
<rect x="352" y="144" width="40" height="40" fill="#F4F6FB"/>
|
|
17
|
+
<rect x="152" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
18
|
+
<rect x="192" y="184" width="40" height="40" fill="#1B2547"/>
|
|
19
|
+
<rect x="232" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
20
|
+
<rect x="272" y="184" width="40" height="40" fill="#1B2547"/>
|
|
21
|
+
<rect x="312" y="184" width="40" height="40" fill="#F4F6FB"/>
|
|
22
|
+
<rect x="352" y="184" width="40" height="40" fill="#1B2547"/>
|
|
23
|
+
<rect x="152" y="224" width="40" height="40" fill="#1B2547"/>
|
|
24
|
+
<rect x="192" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
25
|
+
<rect x="232" y="224" width="40" height="40" fill="#1B2547"/>
|
|
26
|
+
<rect x="272" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
27
|
+
<rect x="312" y="224" width="40" height="40" fill="#1B2547"/>
|
|
28
|
+
<rect x="352" y="224" width="40" height="40" fill="#F4F6FB"/>
|
|
29
|
+
<rect x="152" y="104" width="240" height="160" fill="none" stroke="#F4F6FB" stroke-width="4"/>
|
|
30
|
+
</g>
|
|
31
|
+
<rect x="88" y="424" width="144" height="24" rx="12" fill="#FF6A2B"/>
|
|
32
|
+
</svg>
|
package/dist/pitroom.mjs
CHANGED
|
@@ -2720,7 +2720,7 @@ function inside(file, roots) {
|
|
|
2720
2720
|
var escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2721
2721
|
|
|
2722
2722
|
// src/core/run.ts
|
|
2723
|
-
var VERSION2 = true ? "0.6.
|
|
2723
|
+
var VERSION2 = true ? "0.6.3" : "0.0.0-dev";
|
|
2724
2724
|
function planWork(o) {
|
|
2725
2725
|
if (!o.plan) return { task: o.task.trim(), tier: o.tier };
|
|
2726
2726
|
if (o.continueFrom) throw new UserError("a follow-up continues its parent's task; drop --plan/--step");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pitroom",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "A free pit crew for your expensive coding agent: the superpowers development workflow, run by cheap workers. Delegate research, fixes, tests, reviews and whole plans from Claude Code, Codex or any agent to OpenCode, Codex or Claude Code workers, with receipts that prove the savings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "TahaAtas",
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
"hooks",
|
|
22
22
|
".claude-plugin",
|
|
23
23
|
".codex-plugin",
|
|
24
|
+
"assets",
|
|
24
25
|
"docs/backends.md",
|
|
25
26
|
"README.md",
|
|
26
27
|
"CHANGELOG.md",
|
|
28
|
+
"PRIVACY.md",
|
|
27
29
|
"LICENSE"
|
|
28
30
|
],
|
|
29
31
|
"engines": {
|
|
@@ -98,13 +98,14 @@ npm test 2>&1 | grep 'DEBUG git init'
|
|
|
98
98
|
|
|
99
99
|
If something appears during tests but you don't know which test:
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
Bisect the test files by hand, in an isolated copy so a polluting test cannot touch the real tree (`pitroom run -i`, or a scratch clone):
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
1. List the test files that could be responsible (for example the ones matching `src/**/*.test.ts`), in a fixed order.
|
|
104
|
+
2. Before the first run, confirm the unwanted file or directory (for example `.git`) does not exist yet. If it does, remove it from the copy first.
|
|
105
|
+
3. Run one test file at a time with your project's own test command, and after each run check whether the unwanted file has appeared.
|
|
106
|
+
4. The first file after which it appears is the polluter. Stop there, then read that test and trace how it gets there (the stack-trace technique above).
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
If the list is long, halve it: run the first half together, check, and continue in the half that polluted. Only run test commands you would run anyway, and never pass unchecked file names to a shell.
|
|
108
109
|
|
|
109
110
|
## Real Example: Empty projectDir
|
|
110
111
|
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Bisection script to find which test creates unwanted files/state
|
|
3
|
-
# Usage: ./find-polluter.sh <file_or_dir_to_check> <test_pattern>
|
|
4
|
-
# Example: ./find-polluter.sh '.git' 'src/**/*.test.ts'
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
if [ $# -ne 2 ]; then
|
|
9
|
-
echo "Usage: $0 <file_to_check> <test_pattern>"
|
|
10
|
-
echo "Example: $0 '.git' 'src/**/*.test.ts'"
|
|
11
|
-
exit 1
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
POLLUTION_CHECK="$1"
|
|
15
|
-
TEST_PATTERN="$2"
|
|
16
|
-
|
|
17
|
-
echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
|
|
18
|
-
echo "Test pattern: $TEST_PATTERN"
|
|
19
|
-
echo ""
|
|
20
|
-
|
|
21
|
-
# Get list of test files (find . emits ./-prefixed paths, so accept the
|
|
22
|
-
# pattern written with or without a leading ./)
|
|
23
|
-
TEST_PATTERN="${TEST_PATTERN#./}"
|
|
24
|
-
# find -path can't match '**/' against zero directory levels, so a pattern
|
|
25
|
-
# like src/**/*.test.ts would skip src/top.test.ts; also try the pattern
|
|
26
|
-
# with '**/' collapsed to cover files directly under the base directory.
|
|
27
|
-
TEST_FILES=$(find . \( -path "./$TEST_PATTERN" -o -path "./${TEST_PATTERN//\*\*\//}" \) | sort -u)
|
|
28
|
-
if [ -z "$TEST_FILES" ]; then
|
|
29
|
-
TOTAL=0
|
|
30
|
-
else
|
|
31
|
-
TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
echo "Found $TOTAL test files"
|
|
35
|
-
echo ""
|
|
36
|
-
|
|
37
|
-
COUNT=0
|
|
38
|
-
for TEST_FILE in $TEST_FILES; do
|
|
39
|
-
COUNT=$((COUNT + 1))
|
|
40
|
-
|
|
41
|
-
# Skip if pollution already exists
|
|
42
|
-
if [ -e "$POLLUTION_CHECK" ]; then
|
|
43
|
-
echo "⚠️ Pollution already exists before test $COUNT/$TOTAL"
|
|
44
|
-
echo " Skipping: $TEST_FILE"
|
|
45
|
-
continue
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
echo "[$COUNT/$TOTAL] Testing: $TEST_FILE"
|
|
49
|
-
|
|
50
|
-
# Run the test
|
|
51
|
-
npm test "$TEST_FILE" > /dev/null 2>&1 || true
|
|
52
|
-
|
|
53
|
-
# Check if pollution appeared
|
|
54
|
-
if [ -e "$POLLUTION_CHECK" ]; then
|
|
55
|
-
echo ""
|
|
56
|
-
echo "🎯 FOUND POLLUTER!"
|
|
57
|
-
echo " Test: $TEST_FILE"
|
|
58
|
-
echo " Created: $POLLUTION_CHECK"
|
|
59
|
-
echo ""
|
|
60
|
-
echo "Pollution details:"
|
|
61
|
-
ls -la "$POLLUTION_CHECK"
|
|
62
|
-
echo ""
|
|
63
|
-
echo "To investigate:"
|
|
64
|
-
echo " npm test $TEST_FILE # Run just this test"
|
|
65
|
-
echo " cat $TEST_FILE # Review test code"
|
|
66
|
-
exit 1
|
|
67
|
-
fi
|
|
68
|
-
done
|
|
69
|
-
|
|
70
|
-
echo ""
|
|
71
|
-
echo "✅ No polluter found - all tests clean!"
|
|
72
|
-
exit 0
|