@maind-dev/cli 0.4.0 → 0.6.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 +50 -0
- package/build/index.js +3930 -58
- package/build/meta.json +1 -0
- package/package.json +20 -11
- package/build/auth.js +0 -76
- package/build/auth.js.map +0 -1
- package/build/ci-report.js +0 -146
- package/build/ci-report.js.map +0 -1
- package/build/ci-result.js +0 -145
- package/build/ci-result.js.map +0 -1
- package/build/context.js +0 -157
- package/build/context.js.map +0 -1
- package/build/git-context.js +0 -212
- package/build/git-context.js.map +0 -1
- package/build/git.js +0 -162
- package/build/git.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/mcp-client.js +0 -221
- package/build/mcp-client.js.map +0 -1
- package/build/render.js +0 -81
- package/build/render.js.map +0 -1
package/README.md
CHANGED
|
@@ -55,11 +55,61 @@ Writes two artifacts (defaults shown):
|
|
|
55
55
|
| `--run-ref <id>` | `$GITHUB_RUN_ID` | Build identifier stored in the manifest |
|
|
56
56
|
| `--mcp-url <url>` | `$MAIND_MCP_URL` or prod | MCP endpoint override |
|
|
57
57
|
|
|
58
|
+
## Review (`maind review`)
|
|
59
|
+
|
|
60
|
+
Provenance-backed review findings for a change set (ADR-228). The CLI links the
|
|
61
|
+
code-index engine directly — no bridge needed in CI: it enumerates hunk-graded
|
|
62
|
+
changed symbols + closed-enum risk flags **locally**, sends only symbol names and
|
|
63
|
+
counts to the maind `review_changes` tool (paths, lines, and diff content never
|
|
64
|
+
leave the machine), and renders the citable findings (convention id + version +
|
|
65
|
+
matched symbols).
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
maind review --base origin/main --comment
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Artifacts (defaults shown):
|
|
72
|
+
|
|
73
|
+
| File | Purpose |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `.maind/review.md` | Full findings report — always written, even fail-open |
|
|
76
|
+
| `.maind/review.json` | Review manifest (`maind.review.manifest/v1`) — counts, citations, served attribution |
|
|
77
|
+
| `.maind/review-comment.md` | With `--comment`: PR-comment markdown; line 1 carries the `<!-- maind-review -->` idempotency marker |
|
|
78
|
+
|
|
79
|
+
The CLI never posts the comment itself — your workflow posts the file via
|
|
80
|
+
`gh api`, so provider tokens stay outside the CLI.
|
|
81
|
+
|
|
82
|
+
### Review options
|
|
83
|
+
|
|
84
|
+
| Flag | Default | Meaning |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `--base <ref>` | — | Review the diff against this ref; without it, uncommitted work |
|
|
87
|
+
| `--uncommitted` | off | With `--base`: also include uncommitted changes |
|
|
88
|
+
| `--summary <text>` | — | Prose change summary (enables index-less review) |
|
|
89
|
+
| `--out <path>` | `.maind/review.md` | Report path (manifest lands next to it as `.json`) |
|
|
90
|
+
| `--comment [<path>]` | off | Also write PR-comment markdown |
|
|
91
|
+
| `--json` | off | Print the review manifest JSON to stdout |
|
|
92
|
+
| `--gate` | off | Server-side `pass\|warn\|block` verdict (Team plan) |
|
|
93
|
+
| `--fail-on block\|warn` | — | With `--gate`: exit `1` when the verdict crosses the threshold |
|
|
94
|
+
| `--strict` | off | Infra errors exit `2` instead of failing open |
|
|
95
|
+
| `--project-key <hex>` | auto | Repo `project_key` override |
|
|
96
|
+
| `--mcp-url <url>` | `$MAIND_MCP_URL` or prod | MCP endpoint override |
|
|
97
|
+
|
|
98
|
+
### Exit codes
|
|
99
|
+
|
|
100
|
+
| Code | Meaning |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `0` | Advisory run (default) — findings never fail a build; plan-gate on `--gate` also exits `0` with a hint |
|
|
103
|
+
| `1` | Only a server verdict crossing `--fail-on` (requires `--gate`) |
|
|
104
|
+
| `2` | Infra error, only under `--strict` |
|
|
105
|
+
|
|
58
106
|
## Fail-open contract
|
|
59
107
|
|
|
60
108
|
A context pull must never fail a build. On any error (missing key, network,
|
|
61
109
|
auth) the CLI still writes explanatory artifacts (the manifest carries an
|
|
62
110
|
`error` field) and exits `0`. The agent simply runs without extra context.
|
|
111
|
+
`maind review` follows the same contract: advisory runs exit `0` no matter
|
|
112
|
+
what; only the explicit `--gate` + `--fail-on` combination is fail-closed.
|
|
63
113
|
|
|
64
114
|
## Example: GitHub Actions
|
|
65
115
|
|