comprehende 0.5.0 → 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 +1 -1
- package/dist/git/diff.js +2 -5
- package/package.json +1 -1
- package/skills/comprehende/SKILL.md +4 -4
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ This tool is for preventing this cognitive surrender while trying to maintain mo
|
|
|
42
42
|
|
|
43
43
|
`comprehende serve` and `comprehende export` share one UI and one git payload. Serve resolves refs to commit SHAs when it starts, then computes those payloads from the objects on each request. Export writes the same JSON (and image bytes) next to the UI so any static file server can host the review.
|
|
44
44
|
|
|
45
|
-
`pnpm dev` and `pnpm exec` run with this package as cwd, so they only make sense when _this_ repo is the one under review. To review a different project from a checkout, `cd` into it and run `npx comprehende@0.5.
|
|
45
|
+
`pnpm dev` and `pnpm exec` run with this package as cwd, so they only make sense when _this_ repo is the one under review. To review a different project from a checkout, `cd` into it and run `npx comprehende@0.5.1` (or `node /path/to/comprehende/dist/cli/main.js` after `pnpm build`).
|
|
46
46
|
|
|
47
47
|
## Release
|
|
48
48
|
|
package/dist/git/diff.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isImagePath
|
|
1
|
+
import { isImagePath } from "../schema/image.js";
|
|
2
2
|
import { isLockfilePath } from "../schema/lockfile.js";
|
|
3
3
|
import { git } from "./exec.js";
|
|
4
4
|
import { parseNameStatus, parseNumstat } from "./name-status.js";
|
|
@@ -363,10 +363,7 @@ function classifyDiffFile(file) {
|
|
|
363
363
|
if (!isImagePath(file.path) && (file.oldPath === undefined || !isImagePath(file.oldPath))) {
|
|
364
364
|
return file;
|
|
365
365
|
}
|
|
366
|
-
|
|
367
|
-
return asImageFile(file);
|
|
368
|
-
}
|
|
369
|
-
return file;
|
|
366
|
+
return asImageFile(file);
|
|
370
367
|
}
|
|
371
368
|
function asImageFile(file) {
|
|
372
369
|
return { ...file, image: true, hunks: [imageLiveHunk(file.path, file.oldPath)] };
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ Group a git diff into review concerns and serve a local UI. The point is cogniti
|
|
|
12
12
|
Run every command inside the repository under review. Cwd is the repo; there is no `--repo` flag. Use the pinned CLI:
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npx comprehende@0.5.
|
|
15
|
+
npx comprehende@0.5.1 <command>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
The review document is interpretation only. It holds groups, summaries, and hunk pointers. Do not copy patch text into it. `serve` reads the diff from git.
|
|
@@ -20,12 +20,12 @@ The review document is interpretation only. It holds groups, summaries, and hunk
|
|
|
20
20
|
## Workflow
|
|
21
21
|
|
|
22
22
|
1. Resolve base and head. Use the refs the user named; three-dot (`base...head`) is the merge request or branch diff. When the change is already on the default branch, use the request's recorded base and head SHAs; the moving default-branch `HEAD` includes later merges. When only the head SHA is known, base is the merge-base of that head with the named base branch. Fetch refs missing from the local clone. Done when both refs resolve in cwd; if one still does not resolve, stop and tell the user rather than guess a ref.
|
|
23
|
-
2. Run `npx comprehende@0.5.
|
|
23
|
+
2. Run `npx comprehende@0.5.1 index [--base <ref>] [--head <ref>]` and keep the JSON outside the work tree (stdout or a temp file). Defaults: `--head` is `HEAD`; `--base` is `origin/HEAD`, falling back to `main` or `master`. The index lists hunk refs (path plus `@@` ranges), image files (`oldStart` and `newStart` 0), and `skipped` (lockfiles and non-image binaries). It carries no line content.
|
|
24
24
|
3. Recover the why and write the what. Read the sources listed under The why, read `git diff --stat <base>...<head>` and the diffs themselves, then write document `summary` (always) and document `why` (only when a source names the motive). Summaries come from the code, not the log.
|
|
25
25
|
4. Group the hunks by review concern, following the Grouping rules. Done when every hunk ref from the index appears in at least one group and every group has its `why`.
|
|
26
26
|
5. Write `review.json` in a fresh temp directory outside the repository (`mktemp -d` or the platform equivalent; the work tree stays untouched, with no new gitignore entries). Shape per [references/review.schema.json](./references/review.schema.json); worked example in [references/example.md](./references/example.md). Copy hunk objects verbatim from the index. Set document `size` from review burden, not `git diff --stat`.
|
|
27
|
-
6. Run `npx comprehende@0.5.
|
|
28
|
-
7. Run `npx comprehende@0.5.
|
|
27
|
+
6. Run `npx comprehende@0.5.1 validate --data "$REVIEW_DIR/review.json"` with the absolute path. On failure, fix groups or coverage; the diff is git's, leave it alone. Done when validate exits 0.
|
|
28
|
+
7. Run `npx comprehende@0.5.1 serve --data "$REVIEW_DIR/review.json" --open` and give the user the localhost URL (`127.0.0.1` only).
|
|
29
29
|
|
|
30
30
|
## The why
|
|
31
31
|
|