@bilalimamoglu/sift 0.4.5 → 0.5.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/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  npm install -g @bilalimamoglu/sift
22
22
  ```
23
23
 
24
- <sub>Works with pytest, vitest, jest, tsc, ESLint, webpack, Cargo, terraform, npm audit, and more.</sub>
24
+ <sub>Best today on noisy pytest, vitest, jest, `tsc`, ESLint, common build failures, `npm audit`, and `terraform plan` output.</sub>
25
25
 
26
26
  </div>
27
27
 
@@ -33,6 +33,8 @@ When an agent hits noisy output, it can eventually make sense of the log wall, b
33
33
 
34
34
  `sift` narrows that output locally first. It groups repeated failures, surfaces likely root causes, and points to the next useful step so your agent starts from signal instead of raw noise.
35
35
 
36
+ It is not a generic repo summarizer, not a shell telemetry product, and not a benchmark dashboard. It is a local-first triage layer for noisy command output in coding-agent workflows.
37
+
36
38
  Turn 13,000 lines of test output into 2 root causes.
37
39
 
38
40
  <p align="center">
@@ -53,13 +55,56 @@ With `sift`, the same run becomes:
53
55
  - Decision: stop and act.
54
56
  ```
55
57
 
56
- In the largest benchmark fixture, sift compressed 198,026 raw output tokens to 129. That is what the agent reads instead of the full log.
58
+ In one large `test-status` benchmark fixture, `sift` compressed 198,026 raw output tokens to 129. That is scoped proof for a noisy test-debugging case, not a promise that every preset behaves the same way.
59
+
60
+ ---
61
+
62
+ ## Quick Start
63
+
64
+ ### 1. Install
65
+
66
+ ```bash
67
+ npm install -g @bilalimamoglu/sift
68
+ ```
69
+
70
+ Requires Node.js 20+.
71
+
72
+ ### 2. Try the main workflow
73
+
74
+ If you are new, start here and ignore hook beta and native surfaces for now:
75
+
76
+ ```bash
77
+ sift exec --preset test-status -- pytest -q
78
+ ```
79
+
80
+ Other common entry points:
81
+
82
+ ```bash
83
+ sift exec --preset test-status -- npx vitest run
84
+ sift exec --preset test-status -- npx jest
85
+ sift exec "what changed?" -- git diff
86
+ ```
87
+
88
+ ### 3. Zoom only if needed
89
+
90
+ Think of the workflow like this:
91
+
92
+ - `standard` = map
93
+ - `focused` = zoom
94
+ - raw traceback = last resort
95
+
96
+ ```bash
97
+ sift rerun
98
+ sift rerun --remaining --detail focused
99
+ ```
100
+
101
+ If `standard` already gives you the likely root cause, anchor, and fix, stop there and act.
57
102
 
58
103
  ---
59
104
 
60
105
  ## Benchmark Results
61
106
 
62
- The output reduction above measures a single command's raw output. The table below measures the full end-to-end debug session: how many tokens, tool calls, and seconds the agent spends to reach the same outcome.
107
+ The output reduction above measures a single command's raw output. The table below measures one replayed end-to-end debug loop: how many tokens, tool calls, and seconds the agent spent to reach the same outcome in that benchmarked scenario.
63
108
 
64
109
  Real debug loop on a 640-test Python backend with 124 repeated setup errors, 3 contract failures, and 511 passing tests:
65
110
 
@@ -129,7 +174,7 @@ Every built-in preset tries local parsing first. When the heuristic handles the
129
174
  <td width="33%" valign="top">
130
175
 
131
176
  ### Agent and Automation Friendly
132
- Use `sift` in Codex, Claude, CI, hooks, or shell scripts so downstream tooling gets short, structured answers instead of raw noise.
177
+ Use `sift` in Codex, Claude, CI, hooks, or shell scripts when you want downstream tooling to receive a short first pass instead of the raw log wall.
133
178
 
134
179
  </td>
135
180
  </tr>
@@ -137,134 +182,69 @@ Use `sift` in Codex, Claude, CI, hooks, or shell scripts so downstream tooling g
137
182
 
138
183
  ---
139
184
 
140
- ## Setup and Agent Integration
141
-
142
- Most built-in presets run entirely on local heuristics with no API key required. If you want deeper fallback for ambiguous cases, `sift` also supports OpenAI-compatible and OpenRouter-compatible endpoints.
143
-
144
- Start with the guided installer:
145
-
146
- ```bash
147
- sift install
148
- ```
149
-
150
- During install, pick the mode that matches reality:
151
- - `agent-escalation`: best if Codex or Claude is already open. `sift` gives the first answer, then your agent keeps going.
152
- - `provider-assisted`: best if you want `sift` itself to ask a cheap fallback model when needed. This is the API-key path.
153
- - `local-only`: best if `sift` is working alone and you want everything to stay local.
154
-
155
- Then try the normal diagnosis loop:
156
-
157
- ```bash
158
- sift exec --preset test-status -- pytest -q
159
- ```
160
-
161
- If you choose `provider-assisted` during install, `sift` now continues directly into provider, model, and API-key setup instead of making you run a second command.
162
-
163
- Use `sift config setup` later when you want to revisit or change those choices:
164
-
165
- ```bash
166
- sift config setup
167
- sift doctor
168
- ```
169
-
170
- OpenAI setup defaults to `gpt-5-nano`, with `gpt-5.4-nano` and `gpt-5-mini` offered as backup choices during setup.
171
-
172
- Before pushing release-sensitive changes, run the same shared gate used by CI and the release workflow:
173
-
174
- ```bash
175
- npm run verify:release
176
- ```
177
-
178
- That gate runs under a CI-like environment on purpose so wrapper-noise regressions show up locally before they embarrass the repo in publish.
179
-
180
- If you want one extra paranoid pass before a release or risky push, use the clean-room variant too:
181
-
182
- ```bash
183
- npm run verify:release:clean
184
- ```
185
-
186
- That copies the repo into a temporary clean directory, runs `npm ci`, then executes the shared core gate there so warm local `node_modules` do not hide CI failures.
187
-
188
- If you want pushes to enforce the same core gate automatically inside this repo:
189
-
190
- ```bash
191
- npm run setup:hooks
192
- ```
185
+ ## Presets
193
186
 
194
- That installs the tracked `.githooks/pre-push` hook, which runs `npm run verify:release:core` before every push.
187
+ | Preset | What it does | Needs provider? |
188
+ |--------|--------------|:---------------:|
189
+ | `test-status` | Groups pytest, vitest, and jest failures into root-cause buckets with anchors and fix suggestions. | No |
190
+ | `typecheck-summary` | Parses `tsc` output and groups issues by error code. | No |
191
+ | `lint-failures` | Parses ESLint output and groups failures by rule. | No |
192
+ | `build-failure` | Extracts the first concrete build error from common toolchains. | Fallback only |
193
+ | `contract-drift` | Detects explicit snapshot, golden, OpenAPI, manifest, or generated-artifact drift without broadening into generic repo analysis. | Fallback only |
194
+ | `audit-critical` | Pulls high and critical `npm audit` findings. | No |
195
+ | `infra-risk` | Detects destructive signals in `terraform plan`. | No |
196
+ | `diff-summary` | Summarizes change sets and likely risks in diff output. | Yes |
197
+ | `log-errors` | Extracts the strongest error signals from noisy logs. | Fallback only |
195
198
 
196
- If you want the older low-level controls, you can still preview, inspect, or remove the managed blocks directly:
199
+ When output already exists in a pipeline, use pipe mode instead of `exec`:
197
200
 
198
201
  ```bash
199
- sift agent show codex
200
- sift agent install codex --dry-run
201
- sift agent status
202
- sift agent remove codex
202
+ pytest -q 2>&1 | sift preset test-status
203
+ npm audit 2>&1 | sift preset audit-critical
203
204
  ```
204
205
 
205
- Command-first details live in [docs/cli-reference.md](docs/cli-reference.md).
206
-
207
206
  ---
208
207
 
209
- ## Quick Start
210
-
211
- ### 1. Install
212
-
213
- ```bash
214
- npm install -g @bilalimamoglu/sift
215
- ```
216
-
217
- Requires Node.js 20+.
208
+ ## Setup and Agent Integration
218
209
 
219
- ### 2. Get a useful first pass before your agent reads the full log
210
+ If you want deeper integration after the first successful `sift exec` run, start with:
220
211
 
221
212
  ```bash
222
- sift exec --preset test-status -- pytest -q
213
+ sift install
223
214
  ```
224
215
 
225
- Other common entry points:
216
+ Most built-in presets run entirely on local heuristics with no API key required. If you want deeper fallback for ambiguous cases, `sift` also supports OpenAI-compatible and OpenRouter-compatible endpoints.
226
217
 
227
- ```bash
228
- sift exec --preset test-status -- npx vitest run
229
- sift exec --preset test-status -- npx jest
230
- sift exec "what changed?" -- git diff
231
- ```
218
+ During install, pick the mode that matches reality:
219
+ - `agent-escalation`: `sift` gives the first answer, then your agent keeps going
220
+ - `provider-assisted`: `sift` itself can ask a cheap fallback model when needed
221
+ - `local-only`: keep everything local
232
222
 
233
- ### 3. Zoom only if needed
223
+ Runtime-native files are small guidance surfaces, not a second execution system:
224
+ - Codex: managed `AGENTS.md` block plus a generated `SKILL.md`
225
+ - Claude: managed `CLAUDE.md` block plus a generated `.claude/commands/sift/` command pack
226
+ - Cursor: optional `.cursor/skills/sift/SKILL.md` path when you want an explicit native Cursor skill
234
227
 
235
- Think of the workflow like this:
228
+ Default rule:
229
+ - use `sift exec` for the normal first pass
230
+ - use `sift hook` only as an optional beta shortcut for a tiny known-command set
236
231
 
237
- - `standard` = map
238
- - `focused` = zoom
239
- - raw traceback = last resort
232
+ Optional local evidence surfaces:
240
233
 
241
234
  ```bash
242
- sift rerun
243
- sift rerun --remaining --detail focused
235
+ sift gain
236
+ sift discover
244
237
  ```
245
238
 
246
- If `standard` already gives you the likely root cause, anchor, and fix, stop there and act.
239
+ - `gain` shows local, metadata-only first-pass history
240
+ - `discover` stays quiet unless your own local history is strong enough to justify a concrete suggestion
247
241
 
248
- ---
242
+ If you want the full install, ownership, and touched-files details, see [docs/cli-reference.md](docs/cli-reference.md). The short version: `sift` does **not** write shell rc files, PATH entries, git hooks, or arbitrary repo files during install.
249
243
 
250
- ## Presets
251
-
252
- | Preset | What it does | Needs provider? |
253
- |--------|--------------|:---------------:|
254
- | `test-status` | Groups pytest, vitest, and jest failures into root-cause buckets with anchors and fix suggestions. | No |
255
- | `typecheck-summary` | Parses `tsc` output and groups issues by error code. | No |
256
- | `lint-failures` | Parses ESLint output and groups failures by rule. | No |
257
- | `build-failure` | Extracts the first concrete build error from common toolchains. | Fallback only |
258
- | `audit-critical` | Pulls high and critical `npm audit` findings. | No |
259
- | `infra-risk` | Detects destructive signals in `terraform plan`. | No |
260
- | `diff-summary` | Summarizes change sets and likely risks in diff output. | Yes |
261
- | `log-errors` | Extracts the strongest error signals from noisy logs. | Fallback only |
262
-
263
- When output already exists in a pipeline, use pipe mode instead of `exec`:
244
+ If you want this repo's tracked pre-push verification hook to actually run on your machine, you still need to activate it once:
264
245
 
265
246
  ```bash
266
- pytest -q 2>&1 | sift preset test-status
267
- npm audit 2>&1 | sift preset audit-critical
247
+ npm run setup:hooks
268
248
  ```
269
249
 
270
250
  ---
@@ -294,6 +274,8 @@ sift exec --preset test-status --goal diagnose --format json -- pytest -q
294
274
  sift rerun --goal diagnose --format json
295
275
  ```
296
276
 
277
+ Diagnose JSON is summary-first on purpose. If `read_targets.anchor_kind=traceback` and `read_targets.context_hint.kind=exact_window`, read that narrow range first. If the read target is lower-confidence or `search_only`, treat it as a representative hint rather than exact root-cause proof.
278
+
297
279
  ---
298
280
 
299
281
  ## Limitations
@@ -301,6 +283,7 @@ sift rerun --goal diagnose --format json
301
283
  - sift adds the most value when output is long, repetitive, and shaped by a small number of root causes. For short, obvious failures it may not save much.
302
284
  - The deepest local heuristic coverage is in test debugging (pytest, vitest, jest). Other presets have solid heuristics but less depth.
303
285
  - sift does not help with interactive or TUI-based commands.
286
+ - sift is not a generic repo summarizer or broad mismatch detector. It works best when the command output itself carries strong failure or drift evidence.
304
287
  - When heuristics cannot explain the output confidently, sift either falls back to a provider or returns the strongest local first pass it can, depending on how you choose to use it.
305
288
 
306
289
  ---