@maind-dev/cli 0.70.0 → 0.71.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
@@ -89,9 +89,10 @@ The CLI never posts the comment itself — your workflow posts the file via
89
89
  | `--out <path>` | `.maind/review.md` | Report path (manifest lands next to it as `.json`) |
90
90
  | `--comment [<path>]` | off | Also write PR-comment markdown |
91
91
  | `--json` | off | Print the review manifest JSON to stdout |
92
- | `--gate` | off | Server-side `pass\|warn\|block` verdict (Team plan) |
92
+ | `--gate` | off | Server-side `pass\|warn\|block` verdict (Team plan) — the server matches the changed symbols itself and records a replayable run (attest mode, below) |
93
93
  | `--fail-on block\|warn` | — | With `--gate`: exit `1` when the verdict crosses the threshold |
94
94
  | `--strict` | off | Infra errors exit `2` instead of failing open |
95
+ | `--no-report` | off | With `--gate`: write no record — the verdict, and whether the run would be attestation-grade, are still computed |
95
96
  | `--project-key <hex>` | auto | Repo `project_key` override |
96
97
  | `--mcp-url <url>` | `$MAIND_MCP_URL` or prod | MCP endpoint override |
97
98
 
@@ -105,13 +106,15 @@ The CLI never posts the comment itself — your workflow posts the file via
105
106
 
106
107
  ### Detector findings (with `--gate`)
107
108
 
108
- With `--gate`, the CLI also runs the four repo-health detectors from
109
+ With `--gate`, the CLI also runs the eight repo-health detectors from
109
110
  `@maind/code-index` on this machine — number collisions in counter-style
110
111
  namespaces (`ADR-263-*.md` twice), spec drift (a registry vs. the artefact it
111
112
  declares), dead theme classes (a Tailwind v4 utility pointing at a token that
112
- does not exist), and table ACL (Supabase default grants never revoked) — and
113
- sends them to `review_verdict` as a third finding class next to convention
114
- findings and risk flags (ADR-324).
113
+ does not exist), table ACL (Supabase default grants never revoked), duplicate
114
+ changelog headings, unparsable workflow YAML, release claims (a changelog
115
+ version npm never published) and prose added to agent docs — and sends them to
116
+ `review_verdict` as a third finding class next to convention findings and risk
117
+ flags (ADR-324).
115
118
 
116
119
  Only a **commitment** leaves the machine: `detector_id`, `detector_version`,
117
120
  `rule_id`, `level`, `baseline`, an `evidence_hash` (sha256 over the normalised
@@ -120,9 +123,9 @@ stay local — they appear in the report (`.maind/review.md`) but never in the
120
123
  manifest, the PR comment or the wire.
121
124
 
122
125
  Block-eligible is only a finding this branch **introduces** (`level: open`,
123
- `baseline: introduced`). Objective detectors (number collisions, spec drift,
124
- dead theme classes) block by default; table ACL warns, because it encodes an
125
- architecture opinion — a team policy can override either way, with a reason.
126
+ `baseline: introduced`). Objective detectors block by default; table ACL and
127
+ agent-doc prose warn, because they encode an opinion — a team policy can
128
+ override either way, with a reason.
126
129
 
127
130
  `diff_stats.detector_coverage` reports whether every detector ran or honestly
128
131
  abstained (`full`), whether one could not run or could not grade against the
@@ -131,6 +134,50 @@ attestation-grade; `partial` never does — the verdict still stands. Servers
131
134
  before 0.48.0 ignore the section silently; the CLI detects the missing echo
132
135
  and says so (`server_acknowledged: false` in the manifest).
133
136
 
137
+ ### Attest mode (with `--gate`)
138
+
139
+ Since `0.70.0`, `--gate` sends `review_verdict` what findings are made of — the
140
+ changed symbols (up to 1000), the raw risk flags, the detector findings with one
141
+ run entry per catalogued detector, diff statistics and the commit anchors —
142
+ instead of findings the client assembled. The server matches the symbols against
143
+ its full visible code-review convention set itself, so a client cannot leave a
144
+ finding out, and records a **format-3** run that anyone with repo access can
145
+ recompute (`maind verify`, below).
146
+
147
+ A record is written only where it can be worth something: `--no-report`, a
148
+ checkout without an `origin` remote, or a shallow clone without a merge base
149
+ (use `fetch-depth: 0`) compute the verdict but write no record — the report says
150
+ why. A server older than `0.62.0` rejects the call; the CLI then falls back to
151
+ the legacy two-call path and says so.
152
+
153
+ ## Verify a record (`maind verify`)
154
+
155
+ ```bash
156
+ maind verify <run-id> # the record with this id (owner, org auditors)
157
+ maind verify --commit <sha|ref> # the best visible record for that commit (default HEAD)
158
+ ```
159
+
160
+ Recomputes a `review_runs` record from a **clean scratch checkout** of its
161
+ commit, diffed against the record's own base — not today's tip of the base
162
+ branch — and lets the server compare under the record's policy snapshot. Nothing
163
+ is persisted. The scratch checkout shares the repository's object database and
164
+ is removed afterwards (`--keep-scratch` keeps it); a missing commit is fetched
165
+ from `origin` by sha (`--no-fetch` forbids it) — a pull request head stays
166
+ reachable after its branch is deleted. Needs `0.71.0` or later.
167
+
168
+ | Code | Meaning |
169
+ |---|---|
170
+ | `0` | verified — inputs, environment and result are equal |
171
+ | `1` | mismatch — at the same index version and merge base, the checkout yields different inputs than the record claims |
172
+ | `3` | stale (same inputs, the convention corpus or engine moved — re-attest, not a forgery finding), unverifiable (legacy record, not attestation-grade), or not available (no record, no access, no plan) |
173
+ | `2` | infrastructure error |
174
+
175
+ Owners and org auditors can verify by record id; any member of the record's
176
+ organization can verify by commit from a clone of the repository. `maind gate`
177
+ runs the same check as its `attestation` line and never blocks on it: `ok` when
178
+ the record for HEAD verifies, `REPORTED` on a mismatch, `NOT CHECKED` with the
179
+ reason otherwise.
180
+
134
181
  ## Fail-open contract
135
182
 
136
183
  A context pull must never fail a build. On any error (missing key, network,