@memnexus-ai/mx-agent-cli 0.1.297 → 0.1.299

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.
Files changed (75) hide show
  1. package/dist/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
  2. package/dist/agent-config/settings.json +7 -1
  3. package/dist/commands/bootstrap.d.ts.map +1 -1
  4. package/dist/commands/bootstrap.js +5 -0
  5. package/dist/commands/bootstrap.js.map +1 -1
  6. package/dist/commands/check.d.ts +20 -0
  7. package/dist/commands/check.d.ts.map +1 -0
  8. package/dist/commands/check.js +30 -0
  9. package/dist/commands/check.js.map +1 -0
  10. package/dist/commands/create.d.ts.map +1 -1
  11. package/dist/commands/create.js +5 -0
  12. package/dist/commands/create.js.map +1 -1
  13. package/dist/commands/gh.d.ts +38 -0
  14. package/dist/commands/gh.d.ts.map +1 -0
  15. package/dist/commands/gh.js +162 -0
  16. package/dist/commands/gh.js.map +1 -0
  17. package/dist/commands/git-credential.d.ts +22 -0
  18. package/dist/commands/git-credential.d.ts.map +1 -0
  19. package/dist/commands/git-credential.js +53 -0
  20. package/dist/commands/git-credential.js.map +1 -0
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +7 -0
  23. package/dist/commands/init.js.map +1 -1
  24. package/dist/commands/new.d.ts +24 -0
  25. package/dist/commands/new.d.ts.map +1 -1
  26. package/dist/commands/new.js +68 -6
  27. package/dist/commands/new.js.map +1 -1
  28. package/dist/commands/pr-set-body.d.ts +120 -35
  29. package/dist/commands/pr-set-body.d.ts.map +1 -1
  30. package/dist/commands/pr-set-body.js +343 -108
  31. package/dist/commands/pr-set-body.js.map +1 -1
  32. package/dist/commands/pr-sync.d.ts +2 -1
  33. package/dist/commands/pr-sync.d.ts.map +1 -1
  34. package/dist/commands/pr-sync.js +129 -32
  35. package/dist/commands/pr-sync.js.map +1 -1
  36. package/dist/index.d.ts +3 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +82 -2
  39. package/dist/index.js.map +1 -1
  40. package/dist/lib/check-run.d.ts +131 -0
  41. package/dist/lib/check-run.d.ts.map +1 -0
  42. package/dist/lib/check-run.js +291 -0
  43. package/dist/lib/check-run.js.map +1 -0
  44. package/dist/lib/coordination-token.d.ts +39 -1
  45. package/dist/lib/coordination-token.d.ts.map +1 -1
  46. package/dist/lib/coordination-token.js +149 -9
  47. package/dist/lib/coordination-token.js.map +1 -1
  48. package/dist/lib/creation-login.d.ts +42 -0
  49. package/dist/lib/creation-login.d.ts.map +1 -0
  50. package/dist/lib/creation-login.js +62 -0
  51. package/dist/lib/creation-login.js.map +1 -0
  52. package/dist/lib/gh-remote.d.ts +46 -5
  53. package/dist/lib/gh-remote.d.ts.map +1 -1
  54. package/dist/lib/gh-remote.js +80 -16
  55. package/dist/lib/gh-remote.js.map +1 -1
  56. package/dist/lib/gh-token-run.d.ts +551 -0
  57. package/dist/lib/gh-token-run.d.ts.map +1 -0
  58. package/dist/lib/gh-token-run.js +1246 -0
  59. package/dist/lib/gh-token-run.js.map +1 -0
  60. package/dist/lib/git-credential.d.ts +120 -0
  61. package/dist/lib/git-credential.d.ts.map +1 -0
  62. package/dist/lib/git-credential.js +204 -0
  63. package/dist/lib/git-credential.js.map +1 -0
  64. package/dist/lib/github-app-token.d.ts +288 -0
  65. package/dist/lib/github-app-token.d.ts.map +1 -0
  66. package/dist/lib/github-app-token.js +519 -0
  67. package/dist/lib/github-app-token.js.map +1 -0
  68. package/dist/lib/memory.d.ts.map +1 -1
  69. package/dist/lib/memory.js +35 -2
  70. package/dist/lib/memory.js.map +1 -1
  71. package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
  72. package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
  73. package/dist/lib/repo-guard-state-dirs.js +170 -0
  74. package/dist/lib/repo-guard-state-dirs.js.map +1 -0
  75. package/package.json +1 -1
@@ -1,47 +1,75 @@
1
1
  /**
2
2
  * mx-agent pr set-body <pr> --body-file <path> | --body <text>
3
3
  *
4
- * A PR-body write that CANNOT silently no-op.
4
+ * A PR-body write that CANNOT silently no-op, made through the mx-bott
5
+ * wrapper `mx-agent gh` (v76, #769; plan comment 6445387241, revision 1
6
+ * comment 6445483410; PO scope decision memory 9e889132).
5
7
  *
6
- * WHY THIS EXISTS. Documented twice — the sub-case "a tool that reports success
7
- * and does nothing" in
8
- * mx-agent-system/coe/nominations/2026-07-27-controls-report-healthy-while-doing-nothing-appendix.md
9
- * and the instance on PR #4616 — and it bit another team again afterwards.
10
- * `gh pr edit` is broken repo-wide on the `gh` we ship
11
- * (2.46.0, Debian trixie, `.devcontainer/Dockerfile:21`, unpinned). Its
12
- * `PullRequestByNumber` prefetch unconditionally selects `projectCards`;
13
- * GitHub returns the whole `repository.pullRequest` node as null plus a
14
- * NOT_FOUND error, and gh aborts BEFORE sending the mutation. It exits 1 and
15
- * prints only a GraphQL notice that Projects (classic) "is being deprecated" —
16
- * nothing about the body, the edit, or the failure. Upstream fixed this in
17
- * v2.73.0 (May 2025) via feature detection; Debian trixie has no such
18
- * candidate. Measured 2026-08-01 on PR #4785: `--add-label`, `--add-assignee`,
19
- * `--milestone` and `--remove-label` all fail identically, so the defect is the
20
- * prefetch and not any one flag.
8
+ * WHAT IT RUNS. Three calls to this build's own `mx-agent gh`, in order:
9
+ * 1. pre-read: gh pr view <N> --json body,updatedAt
10
+ * 2. edit: gh pr edit <N> --body-file <absolute path>
11
+ * 3. post-read: gh pr view <N> --json body,updatedAt
12
+ * The wrapper mints an mx-bott token, so the edit is authored by mx-bott and
13
+ * needs the mint, which needs an `az` login on this machine. There is NO
14
+ * fallback to plain `gh` or to the REST API: a refused or failed mint is a
15
+ * failure, with nothing written.
21
16
  *
22
- * WHY VERIFICATION IS THE POINT, NOT THE EXIT STATUS. This defect has bitten
23
- * twice. The second time (PR #4616) the exit status was never wrong — checking
24
- * `$?`, dropping a `tail -1`, or adding `set -o pipefail` would all have
25
- * passed while nothing was written. "Don't discard exit statuses" is the wrong
26
- * lesson. The only check that catches a write that reports success and does
27
- * nothing is reading the artifact's content back.
17
+ * WHICH BINARY. `spawnSync(process.execPath, [<entry>, 'gh', ...])`, where
18
+ * <entry> is `realpathSync(process.argv[1])`, the script this process runs.
19
+ * No spawn uses the bare command `gh`, and no spawn looks `mx-agent` up on
20
+ * PATH: the PATH `mx-agent` can be an older build with no `gh` command.
21
+ * The prefix is injectable for tests (PrSetBodyOptions.wrapperPrefix).
28
22
  *
29
- * TWO CHECKS, DELIBERATELY:
30
- * 1. The PATCH response's own `body` field. That is the server's account of
31
- * what it stored, returned by the same request that stored it, so unlike a
32
- * re-read it cannot race with propagation.
33
- * 2. A second, fresh GET. This catches the case the response check cannot: a
34
- * write that the API acknowledged but that is not what the PR now serves
35
- * (a concurrent overwrite, a rejected-but-200 path).
36
- * Neither check alone is sufficient — check 1 can only see what one request
37
- * claims, and check 2 alone is the read-back-too-early failure (#F4) that
38
- * returns your own unpropagated write. Any mismatch in either exits non-zero
39
- * with a diff. Success is printed only after both have passed.
23
+ * WHY THE gh 2.46.0 PATH IS GONE. Until v76 this command PATCHed over REST,
24
+ * because `gh pr edit` on gh 2.46.0 aborted before sending the mutation and
25
+ * printed only a Projects-classic notice (PR #4616, PR #4785; COE appendix
26
+ * mx-agent-system/coe/nominations/2026-07-27-controls-report-healthy-while-doing-nothing-appendix.md).
27
+ * `.devcontainer/Dockerfile` now pins gh 2.97.0, and the wrapper refuses
28
+ * `pr edit` below 2.97.0 (MIN_GH_VERSION_FOR_PR_EDIT in lib/gh-token-run.ts).
29
+ *
30
+ * WHY VERIFICATION IS THE POINT, NOT THE EXIT STATUS. The PR #4616 failure
31
+ * had a correct exit status. The only check that catches a write that reports
32
+ * success and does nothing is reading the stored body back. `pr edit` does
33
+ * not return the body, so the one check is the fresh post-read:
34
+ * - It must equal the intended body after CRLF normalisation. On a mismatch
35
+ * it is retried up to POST_READ_RETRIES times, POST_READ_RETRY_MS apart,
36
+ * because a read can return the old body before the write propagates.
37
+ * - NO-OP RULE. When the intended body differs from the pre-read body, and
38
+ * the final post-read body equals the pre-read body, and `updatedAt` has
39
+ * not changed, the edit is reported as a silent no-op.
40
+ * - When the intended body equals the pre-read body, a no-op cannot be told
41
+ * apart from a write. The command says so instead of claiming either.
42
+ * Any mismatch exits non-zero with a diff. Success is printed only after the
43
+ * post-read matches.
44
+ *
45
+ * BODY BYTES. The body is read once, as bytes, and checked: not empty, at most
46
+ * BODY_MAX_BYTES, strict UTF-8, no NUL. A `--body-file` is read through the
47
+ * wrapper's own readBodyFileForGh, so its denylist (`~/.ssh`, the gh config,
48
+ * and the rest of BODY_FILE_DENYLIST_HOME) applies here too; the bytes are
49
+ * the text it returns (security gate on PR #790). The same bytes are written to a 0600
50
+ * file in a private mkdtemp directory, which is the file passed to the
51
+ * wrapper and is removed in `finally`. So the sent text and the compared text
52
+ * are identical. An empty body is refused before any call: the wrapper reads
53
+ * an empty `--body-file` as an empty `--body`, which is not a supported edit.
54
+ *
55
+ * TIMEOUT. Every wrapper call is bounded by WRAPPER_TIMEOUT_MS and killed with
56
+ * SIGTERM after it (bar-raiser 6a and red-team 3 on PR #790). A pre-read that
57
+ * times out or is killed has written nothing. An edit or post-read that does
58
+ * is UNCONFIRMED: the edit may have been sent. The restore route is to re-run
59
+ * set-body with the original body.
60
+ *
61
+ * REPOSITORY. The wrapper is pinned to GH_REPO. A `--repo` value or an
62
+ * `origin` remote that is not that repository, compared case-insensitively,
63
+ * is refused before any call: silently editing a different repository than
64
+ * the one named would be worse than refusing.
40
65
  */
41
66
  import { spawnSync } from 'child_process';
42
- import { readFileSync } from 'fs';
67
+ import { chmodSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'fs';
68
+ import { tmpdir } from 'os';
69
+ import { join, resolve } from 'path';
43
70
  import chalk from 'chalk';
44
- import { resolveOwnerRepo } from '../lib/gh-remote.js';
71
+ import { OWNER_REPO_SHAPE_REASONS, resolveOwnerRepo, validateOwnerRepoShape, } from '../lib/gh-remote.js';
72
+ import { BODY_ARG_MAX_BYTES, GH_REPO, readBodyFileForGh } from '../lib/gh-token-run.js';
45
73
  /**
46
74
  * Thrown for every failure path so the caller exits non-zero with one readable
47
75
  * message. `message` already contains the diff when there is one.
@@ -52,6 +80,51 @@ export class PrSetBodyError extends Error {
52
80
  this.name = 'PrSetBodyError';
53
81
  }
54
82
  }
83
+ /** Bound on each wrapper call. The child is killed with WRAPPER_KILL_SIGNAL after it. */
84
+ export const WRAPPER_TIMEOUT_MS = 120_000;
85
+ export const WRAPPER_KILL_SIGNAL = 'SIGTERM';
86
+ /** 1 to 10 digits, as the wrapper's own PR number check (PR_NUMBER_RE in lib/gh-token-run.ts, without `#`). */
87
+ const PR_NUMBER_RE = /^[0-9]{1,10}$/;
88
+ /**
89
+ * Replace C0 and C1 control characters, DEL, and the bidi embedding,
90
+ * override and isolate characters with `?`. Used on every API- or gh-returned
91
+ * text that is put into a message (security gate on PR #790, optional item).
92
+ * `keepNewlines` keeps tab and LF, for multi-line stderr.
93
+ */
94
+ export function stripControls(s, keepNewlines = false) {
95
+ const re = keepNewlines
96
+ // eslint-disable-next-line no-control-regex
97
+ ? /[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g
98
+ // eslint-disable-next-line no-control-regex
99
+ : /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g;
100
+ return s.replace(re, '?');
101
+ }
102
+ /** Post-read retries after the first post-read, on a mismatch only. */
103
+ export const POST_READ_RETRIES = 3;
104
+ /** Wait between post-read attempts. */
105
+ export const POST_READ_RETRY_MS = 1000;
106
+ /**
107
+ * The largest body accepted, in bytes. The wrapper passes the body to gh as
108
+ * one argument, `--body=<text>`, capped at BODY_ARG_MAX_BYTES, so the body
109
+ * itself can be 131,064 bytes at most.
110
+ */
111
+ export const BODY_MAX_BYTES = BODY_ARG_MAX_BYTES - '--body='.length;
112
+ /** The wrapper's mint failures (GitHubAppTokenErrorCode, plus the wrapper's own two). */
113
+ const MINT_CODES = [
114
+ 'vault-secret-missing', 'vault-unreadable', 'key-empty', 'key-not-pem', 'key-unusable',
115
+ 'installation-not-found', 'installation-lookup-failed', 'permission-not-accepted',
116
+ 'token-request-failed', 'token-response-invalid', 'network', 'mint-failed', 'token-shape',
117
+ ];
118
+ /** Refusal codes that get a specific explanation. Every other code is named as it is. */
119
+ const REFUSAL_HINTS = {
120
+ 'gh-missing': '/usr/bin/gh is not installed',
121
+ 'gh-version-unknown': 'gh --version could not be read',
122
+ 'gh-too-old-for-pr-edit': 'pr edit needs gh 2.97.0 or later',
123
+ 'body-file-denied': 'the temp directory is under a denylisted path; check TMPDIR',
124
+ 'body-file-denied-fd': 'the temp directory is under a denylisted path; check TMPDIR',
125
+ 'body-arg-too-large': `the body is over ${BODY_MAX_BYTES} bytes`,
126
+ 'tempdir-unsafe': 'the temp directory parent holds a ":"; check TMPDIR',
127
+ };
55
128
  /**
56
129
  * GitHub returns bodies with CRLF line endings for content submitted with
57
130
  * either ending, so comparing raw text reports a difference on every line of a
@@ -72,8 +145,7 @@ function normalize(s) {
72
145
  * failure message, so it is treated as untrusted.
73
146
  */
74
147
  export function renderBodyDiff(intended, actual) {
75
- // eslint-disable-next-line no-control-regex
76
- const clean = (s) => s.replace(/[\u0000-\u001f\u007f]/g, '?').slice(0, 160);
148
+ const clean = (s) => stripControls(s).slice(0, 160);
77
149
  const a = normalize(intended).split('\n');
78
150
  const b = normalize(actual).split('\n');
79
151
  const out = [
@@ -96,124 +168,287 @@ export function renderBodyDiff(intended, actual) {
96
168
  * `owner/repo` shape. Exactly two segments, each of them GitHub's own name
97
169
  * alphabet, and neither of them a path traversal.
98
170
  *
99
- * SF-3 (security review). `repo` is interpolated straight into the API path
100
- * `repos/${repo}/pulls/${n}`, and `--repo` used to reach that line without any
101
- * check at all — only the git-remote path was constrained, by the parser in
102
- * resolveOwnerRepo. `--repo '../..'` produced `repos/../../pulls/N`, which gh
103
- * resolves to a DIFFERENT endpoint than the one the message names, so the
104
- * command's own error text would misreport what it touched. The check now
105
- * applies to the value regardless of where it came from, which also covers a
106
- * remote URL whose path parses as `../..`.
171
+ * SF-3 (security review). Kept from the REST version: the value is checked
172
+ * regardless of where it came from, before the pin check below, so a
173
+ * malformed value gets this message rather than the pin message.
107
174
  *
108
175
  * `.`/`..` are rejected as whole segments only. A repo legitimately named
109
176
  * `.github` or `some.repo` passes; `..` does not.
177
+ *
178
+ * The check itself is `validateOwnerRepoShape` in `lib/gh-remote.ts`, shared
179
+ * with `pr-sync` (#785). This wrapper keeps its trim, its return value and both
180
+ * messages. It is a shape check and does not confirm the repository exists.
110
181
  */
111
- const OWNER_REPO_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
112
182
  export function validateOwnerRepo(repo, source) {
113
183
  const value = String(repo ?? '').trim();
114
- if (!OWNER_REPO_RE.test(value)) {
184
+ const reason = validateOwnerRepoShape(value);
185
+ if (reason === OWNER_REPO_SHAPE_REASONS.shape) {
115
186
  throw new PrSetBodyError(`pr set-body: ${source} '${value}' is not a valid owner/repo — expected two segments of ` +
116
187
  'letters, digits, dot, dash or underscore, e.g. memnexus-ai/memnexus. Nothing was written.');
117
188
  }
118
- const segments = value.split('/');
119
- if (segments.some((s) => s === '.' || s === '..')) {
189
+ if (reason !== null) {
120
190
  throw new PrSetBodyError(`pr set-body: ${source} '${value}' contains a path segment ('.' or '..') that would ` +
121
191
  'change which API endpoint is written. Nothing was written.');
122
192
  }
123
193
  return value;
124
194
  }
125
- /** Run `gh` with argv (never a shell) and return status/stdout/stderr as strings. */
126
- function gh(spawn, args, input) {
127
- const r = spawn('gh', args, {
195
+ /**
196
+ * The repository must be the one the wrapper is pinned to, compared
197
+ * case-insensitively (GitHub names are case-insensitive).
198
+ */
199
+ export function checkPinnedRepo(repo, source) {
200
+ if (repo.toLowerCase() !== GH_REPO.toLowerCase()) {
201
+ throw new PrSetBodyError(`pr set-body: ${source} '${repo}' is not ${GH_REPO}. set-body writes through mx-agent gh, ` +
202
+ `which is pinned to ${GH_REPO}, so it cannot edit another repository. Nothing was written.`);
203
+ }
204
+ }
205
+ /**
206
+ * This build's own `mx-agent`: the node binary and the realpath of the script
207
+ * this process runs. Throws when that script cannot be resolved.
208
+ */
209
+ export function defaultWrapperPrefix() {
210
+ const entry = process.argv[1];
211
+ let real;
212
+ try {
213
+ real = realpathSync(String(entry ?? ''));
214
+ }
215
+ catch {
216
+ throw new PrSetBodyError('pr set-body: cannot resolve this mx-agent build\'s own entry script, so the mx-agent gh ' +
217
+ 'wrapper cannot be started. Nothing was written.');
218
+ }
219
+ return [process.execPath, real];
220
+ }
221
+ /**
222
+ * Check the body bytes: not empty, within BODY_MAX_BYTES, strict UTF-8 with a
223
+ * BOM kept (as the wrapper decodes), and no NUL. Returns the decoded text.
224
+ */
225
+ export function checkBodyBytes(bytes) {
226
+ if (bytes.length === 0) {
227
+ throw new PrSetBodyError('pr set-body: an empty body is not supported through the mx-bott wrapper; nothing was written.');
228
+ }
229
+ if (bytes.length > BODY_MAX_BYTES) {
230
+ throw new PrSetBodyError(`pr set-body: the body is ${bytes.length} bytes; the mx-bott wrapper accepts at most ` +
231
+ `${BODY_MAX_BYTES}. Nothing was written.`);
232
+ }
233
+ let text;
234
+ try {
235
+ text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes);
236
+ }
237
+ catch {
238
+ throw new PrSetBodyError('pr set-body: the body is not valid UTF-8. Nothing was written.');
239
+ }
240
+ if (text.includes('\u0000')) {
241
+ throw new PrSetBodyError('pr set-body: the body contains a NUL byte. Nothing was written.');
242
+ }
243
+ return text;
244
+ }
245
+ /** Run this build's `mx-agent gh <args>` with argv (never a shell). */
246
+ function wrapper(spawn, prefix, args, timeoutMs) {
247
+ const r = spawn(prefix[0], [...prefix.slice(1), 'gh', ...args], {
128
248
  encoding: 'utf-8',
129
249
  stdio: 'pipe',
130
- ...(input === undefined ? {} : { input }),
250
+ timeout: timeoutMs,
251
+ killSignal: WRAPPER_KILL_SIGNAL,
131
252
  });
132
253
  const asStr = (v) => typeof v === 'string' ? v : v ? v.toString('utf-8') : '';
133
- return { status: r.status, stdout: asStr(r.stdout), stderr: asStr(r.stderr) };
254
+ return {
255
+ status: r.status,
256
+ stdout: asStr(r.stdout),
257
+ stderr: asStr(r.stderr),
258
+ signal: r.signal ?? null,
259
+ error: r.error ?? null,
260
+ };
261
+ }
262
+ /** The `mx-agent gh: <code>` lines on stderr, in order. */
263
+ function wrapperCodes(stderr) {
264
+ const codes = [];
265
+ for (const m of stderr.matchAll(/^mx-agent gh: ([a-z0-9-]+)\s*$/gm))
266
+ codes.push(m[1]);
267
+ return codes;
268
+ }
269
+ /** Bounded, control characters removed: gh's stderr is shown in a message. */
270
+ function cleanStderr(stderr) {
271
+ const s = stripControls(stderr.trim(), true).slice(0, 600);
272
+ return s || '(no stderr)';
273
+ }
274
+ const NOTHING_WRITTEN = {
275
+ refused: 'Nothing was written.',
276
+ ghFailed: 'Nothing was written.',
277
+ interrupted: 'Nothing was written.',
278
+ };
279
+ /** The restore route named by every UNCONFIRMED interruption. */
280
+ const RESTORE_ROUTE = 'To restore, re-run mx-agent pr set-body with the original body.';
281
+ /** Turn a failed wrapper call into one readable message. */
282
+ function wrapperFailure(step, r, outcome, timeoutMs) {
283
+ if (r.error !== null && r.error.code === 'ETIMEDOUT') {
284
+ return new PrSetBodyError(`pr set-body: ${step}: the mx-agent gh wrapper timed out after ${timeoutMs} ms and was killed ` +
285
+ `with ${WRAPPER_KILL_SIGNAL}. ${outcome.interrupted}`);
286
+ }
287
+ // Red-team 1 on PR #790: only an error with no exit status means the child
288
+ // never started. A null status with no error is a child killed by a signal,
289
+ // which may already have sent the edit.
290
+ if (r.status === null && r.error !== null) {
291
+ return new PrSetBodyError(`pr set-body: ${step}: the mx-agent gh wrapper could not be started. ${outcome.refused}`);
292
+ }
293
+ if (r.status === null) {
294
+ return new PrSetBodyError(`pr set-body: ${step}: the mx-agent gh wrapper was killed by ${r.signal ?? 'an unknown signal'}. ` +
295
+ outcome.interrupted);
296
+ }
297
+ if (/unknown command/i.test(r.stderr)) {
298
+ return new PrSetBodyError(`pr set-body: ${step}: this mx-agent build has no gh wrapper; rebuild the CLI. ${outcome.refused}`);
299
+ }
300
+ const code = wrapperCodes(r.stderr).find((c) => c !== 'revoke-failed');
301
+ if (code !== undefined && MINT_CODES.includes(code)) {
302
+ return new PrSetBodyError(`pr set-body: ${step}: the mx-bott token mint failed (mx-agent gh: ${code}). set-body needs ` +
303
+ 'the mx-bott mint, which needs an az login on this machine. There is no fallback to plain gh. ' +
304
+ outcome.refused);
305
+ }
306
+ if (code !== undefined) {
307
+ const hint = REFUSAL_HINTS[code];
308
+ return new PrSetBodyError(`pr set-body: ${step}: the mx-agent gh wrapper refused the call (mx-agent gh: ${code})` +
309
+ `${hint ? `: ${hint}` : ''}. ${outcome.refused}`);
310
+ }
311
+ return new PrSetBodyError(`pr set-body: ${step}: gh exited ${r.status}. ${outcome.ghFailed}\n ${cleanStderr(r.stderr)}`);
134
312
  }
135
- /** Pull `.body` out of a gh api JSON response, or throw a readable error. */
136
- function bodyFromResponse(raw, what) {
313
+ /** Pass a `revoke-failed` line through as a warning. Never changes the outcome. */
314
+ function warnRevoke(r) {
315
+ if (wrapperCodes(r.stderr).includes('revoke-failed')) {
316
+ console.error(chalk.yellow('pr set-body: warning: mx-agent gh: revoke-failed (the mx-bott token was not revoked; it expires within 1 hour)'));
317
+ }
318
+ }
319
+ /** Parse `pr view --json body,updatedAt` stdout, or throw a readable error. */
320
+ function parseView(raw, what, unconfirmed) {
137
321
  let parsed;
138
322
  try {
139
323
  parsed = JSON.parse(raw);
140
324
  }
141
325
  catch {
142
- throw new PrSetBodyError(`pr set-body: could not parse the ${what} as JSON. The write is UNCONFIRMED — ` +
143
- 'do not report it as applied.');
326
+ throw new PrSetBodyError(`pr set-body: could not parse the ${what} as JSON. ${unconfirmed}`);
144
327
  }
145
328
  if (typeof parsed !== 'object' || parsed === null) {
146
- throw new PrSetBodyError(`pr set-body: the ${what} was not a JSON object. The write is UNCONFIRMED.`);
329
+ throw new PrSetBodyError(`pr set-body: the ${what} was not a JSON object. ${unconfirmed}`);
147
330
  }
148
- const body = parsed.body;
331
+ const rec = parsed;
149
332
  // A PR with an empty body serialises as null, which is a legitimate value.
150
- if (body === null)
151
- return '';
333
+ const body = rec.body === null ? '' : rec.body;
152
334
  if (typeof body !== 'string') {
153
- throw new PrSetBodyError(`pr set-body: the ${what} carried no string 'body' field. The write is UNCONFIRMED.`);
335
+ throw new PrSetBodyError(`pr set-body: the ${what} held no string 'body' field. ${unconfirmed}`);
154
336
  }
155
- return body;
337
+ if (typeof rec.updatedAt !== 'string') {
338
+ throw new PrSetBodyError(`pr set-body: the ${what} held no string 'updatedAt' field. ${unconfirmed}`);
339
+ }
340
+ return { body, updatedAt: rec.updatedAt };
156
341
  }
342
+ const defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
157
343
  export async function runPrSetBody(options, spawn = spawnSync) {
158
344
  const { pr, bodyFile, body, quiet = false } = options;
159
345
  const cwd = options.cwd ?? process.cwd();
160
- if (!/^[0-9]+$/.test(String(pr ?? '').trim())) {
346
+ const sleep = options.sleep ?? defaultSleep;
347
+ const timeoutMs = options.timeoutMs ?? WRAPPER_TIMEOUT_MS;
348
+ if (!PR_NUMBER_RE.test(String(pr ?? '').trim())) {
161
349
  throw new PrSetBodyError(`pr set-body: '${pr}' is not a PR number`);
162
350
  }
163
351
  const prNumber = String(pr).trim();
164
352
  if ((bodyFile && body !== undefined) || (!bodyFile && body === undefined)) {
165
353
  throw new PrSetBodyError('pr set-body: pass exactly one of --body-file <path> or --body <text>');
166
354
  }
167
- let intended;
355
+ // Read once, as bytes. These bytes are both what is sent and what is compared.
356
+ let bytes;
168
357
  if (bodyFile) {
169
- try {
170
- intended = readFileSync(bodyFile, 'utf-8');
171
- }
172
- catch (err) {
173
- throw new PrSetBodyError(`pr set-body: cannot read --body-file ${bodyFile}: ${err instanceof Error ? err.message : String(err)}`);
358
+ // The wrapper's own reader and denylist, not readFileSync (security gate
359
+ // on PR #790): a denylisted file is refused before any call. It decodes
360
+ // strictly and refuses NUL itself; checkBodyBytes then applies the empty
361
+ // and size checks to the same text.
362
+ const r = readBodyFileForGh(bodyFile);
363
+ if (!r.ok) {
364
+ throw new PrSetBodyError(`pr set-body: --body-file refused (mx-agent gh: ${r.code}). Nothing was written.`);
174
365
  }
366
+ bytes = Buffer.from(r.text, 'utf-8');
175
367
  }
176
368
  else {
177
- intended = body;
369
+ bytes = Buffer.from(body, 'utf-8');
178
370
  }
179
- // The value is validated on BOTH paths (SF-3): --repo used to bypass the only
180
- // constraint that existed, which was the git-remote parser's own shape check.
371
+ const intended = checkBodyBytes(bytes);
372
+ // SF-3 shape check on both paths, then the pin, both before any call.
373
+ const source = options.repo === undefined ? 'git remote origin' : '--repo';
181
374
  const rawRepo = options.repo ?? resolveOwnerRepo(cwd, 'origin', spawn);
182
375
  if (!rawRepo) {
183
- throw new PrSetBodyError('pr set-body: could not resolve owner/repo from the git remote — pass --repo <owner/repo>');
184
- }
185
- const repo = validateOwnerRepo(rawRepo, options.repo === undefined ? 'git remote origin' : '--repo');
186
- // 1. Write. JSON on stdin rather than `-f body=@file`, so the payload is
187
- // typed exactly once and no `@`/`-f` value-coercion rule can reinterpret it.
188
- const patchPath = `repos/${repo}/pulls/${prNumber}`;
189
- const patch = gh(spawn, ['api', '-X', 'PATCH', patchPath, '--input', '-'], JSON.stringify({ body: intended }));
190
- if (patch.status !== 0) {
191
- throw new PrSetBodyError(`pr set-body: PATCH ${patchPath} failed (exit ${patch.status}). Nothing was written.\n` +
192
- ` ${patch.stderr.trim() || '(no stderr)'}`);
193
- }
194
- // 2. Check the response's own account of what was stored.
195
- const stored = bodyFromResponse(patch.stdout, 'PATCH response');
196
- if (normalize(stored) !== normalize(intended)) {
197
- throw new PrSetBodyError(`pr set-body: PATCH ${patchPath} returned success but stored a DIFFERENT body.\n` +
198
- `${renderBodyDiff(intended, stored)}\n` +
199
- ' The PR body is NOT what you asked for. Do not report this write as applied.');
200
- }
201
- // 3. Re-read on a fresh request. Cache-Control defeats any intermediary that
202
- // would serve the response we just checked back to us.
203
- const reread = gh(spawn, ['api', '-H', 'Cache-Control: no-cache', patchPath]);
204
- if (reread.status !== 0) {
205
- throw new PrSetBodyError(`pr set-body: the write was accepted but the verification re-read of ${patchPath} failed ` +
206
- `(exit ${reread.status}). The write is UNCONFIRMED.\n ${reread.stderr.trim() || '(no stderr)'}`);
207
- }
208
- const served = bodyFromResponse(reread.stdout, 're-read response');
209
- if (normalize(served) !== normalize(intended)) {
210
- throw new PrSetBodyError(`pr set-body: the PATCH response matched, but a fresh read of ${patchPath} serves a ` +
211
- 'DIFFERENT body (concurrent overwrite, or the write did not stick).\n' +
212
- `${renderBodyDiff(intended, served)}\n` +
213
- ' Do not report this write as applied.');
214
- }
215
- if (!quiet) {
216
- console.log(chalk.green(`✓ PR #${prNumber} body set and verified twice (PATCH response + fresh re-read)`));
376
+ throw new PrSetBodyError(`pr set-body: could not resolve owner/repo from the git remote — pass --repo ${GH_REPO}`);
377
+ }
378
+ const repo = validateOwnerRepo(rawRepo, source);
379
+ checkPinnedRepo(repo, source);
380
+ const prefix = options.wrapperPrefix ?? defaultWrapperPrefix();
381
+ if (prefix.length === 0) {
382
+ throw new PrSetBodyError('pr set-body: empty mx-agent wrapper prefix. Nothing was written.');
383
+ }
384
+ const viewArgs = ['pr', 'view', prNumber, '--json', 'body,updatedAt'];
385
+ const dir = resolve(mkdtempSync(join(tmpdir(), 'mx-agent-set-body-')));
386
+ try {
387
+ chmodSync(dir, 0o700);
388
+ const file = join(dir, 'body.md');
389
+ writeFileSync(file, bytes, { mode: 0o600, flag: 'wx' });
390
+ chmodSync(file, 0o600);
391
+ // 1. Pre-read: the old body and updatedAt, for the no-op rule.
392
+ const pre = wrapper(spawn, prefix, viewArgs, timeoutMs);
393
+ // Custody 1 on PR #790: a revoke failure is reported on the failure paths too.
394
+ warnRevoke(pre);
395
+ if (pre.status !== 0)
396
+ throw wrapperFailure('pre-read (pr view)', pre, NOTHING_WRITTEN, timeoutMs);
397
+ const before = parseView(pre.stdout, 'pre-read output', 'Nothing was written.');
398
+ const sameAsOld = normalize(before.body) === normalize(intended);
399
+ // 2. Edit. The wrapper reads the file; gh never opens it. stdout is not parsed.
400
+ const edit = wrapper(spawn, prefix, ['pr', 'edit', prNumber, '--body-file', file], timeoutMs);
401
+ warnRevoke(edit);
402
+ if (edit.status !== 0) {
403
+ throw wrapperFailure('edit (pr edit)', edit, {
404
+ refused: 'Nothing was written.',
405
+ ghFailed: 'The write is UNCONFIRMED — do not report it as applied.',
406
+ interrupted: `The edit may have been sent; the write is UNCONFIRMED. ${RESTORE_ROUTE}`,
407
+ }, timeoutMs);
408
+ }
409
+ // 3. Post-read, retried on a mismatch only.
410
+ let after = null;
411
+ for (let attempt = 0; attempt <= POST_READ_RETRIES; attempt++) {
412
+ if (attempt > 0)
413
+ await sleep(POST_READ_RETRY_MS);
414
+ const post = wrapper(spawn, prefix, viewArgs, timeoutMs);
415
+ warnRevoke(post);
416
+ if (post.status !== 0) {
417
+ const unconfirmed = 'The edit was accepted but the verification read failed. The write is UNCONFIRMED.';
418
+ throw wrapperFailure('post-read (pr view)', post, {
419
+ refused: unconfirmed,
420
+ ghFailed: unconfirmed,
421
+ interrupted: `${unconfirmed} ${RESTORE_ROUTE}`,
422
+ }, timeoutMs);
423
+ }
424
+ after = parseView(post.stdout, 'post-read output', 'The write is UNCONFIRMED.');
425
+ if (normalize(after.body) === normalize(intended))
426
+ break;
427
+ }
428
+ const served = after;
429
+ if (normalize(served.body) !== normalize(intended)) {
430
+ // No-op rule: a change was asked for, nothing changed, and updatedAt did not move.
431
+ if (!sameAsOld && normalize(served.body) === normalize(before.body) && served.updatedAt === before.updatedAt) {
432
+ throw new PrSetBodyError(`pr set-body: SILENT NO-OP on PR #${prNumber}: pr edit reported success, but the body is ` +
433
+ `still the old body and updatedAt is unchanged (${stripControls(before.updatedAt).slice(0, 64)}).\n` +
434
+ `${renderBodyDiff(intended, served.body)}\n` +
435
+ ' Nothing was written. Do not report this write as applied.');
436
+ }
437
+ throw new PrSetBodyError(`pr set-body: PR #${prNumber} serves a DIFFERENT body after ${POST_READ_RETRIES + 1} reads ` +
438
+ '(the write did not stick, or another writer overwrote it).\n' +
439
+ `${renderBodyDiff(intended, served.body)}\n` +
440
+ ' The PR body is NOT what you asked for. Do not report this write as applied.');
441
+ }
442
+ if (sameAsOld) {
443
+ console.error(chalk.yellow(`pr set-body: note: the new body equals PR #${prNumber}'s old body, so a write cannot be ` +
444
+ 'told apart from a no-op. The PR now serves the intended body.'));
445
+ }
446
+ if (!quiet) {
447
+ console.log(chalk.green(`✓ PR #${prNumber} body set through mx-agent gh (mx-bott) and verified by a fresh read`));
448
+ }
449
+ }
450
+ finally {
451
+ rmSync(dir, { recursive: true, force: true });
217
452
  }
218
453
  }
219
454
  //# sourceMappingURL=pr-set-body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr-set-body.js","sourceRoot":"","sources":["../../src/commands/pr-set-body.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAoB,MAAM,qBAAqB,CAAC;AAiBzE;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;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AAK,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,SAAS,QAAQ,sEAAsE,CAAC,CACrG,CAAC;QACJ,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -16,11 +16,12 @@
16
16
  * mx-agent pr-sync # all teams
17
17
  * mx-agent pr-sync --name retrieval # one team
18
18
  */
19
+ import { type SpawnSyncFn } from '../lib/gh-remote.js';
19
20
  export interface PrSyncOptions {
20
21
  name?: string;
21
22
  apiUrl?: string;
22
23
  apiToken?: string;
23
24
  quiet?: boolean;
24
25
  }
25
- export declare function runPrSync(options: PrSyncOptions): Promise<void>;
26
+ export declare function runPrSync(options: PrSyncOptions, spawn?: SpawnSyncFn): Promise<void>;
26
27
  //# sourceMappingURL=pr-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr-sync.d.ts","sourceRoot":"","sources":["../../src/commands/pr-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAaH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4CD,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuHrE"}
1
+ {"version":3,"file":"pr-sync.d.ts","sourceRoot":"","sources":["../../src/commands/pr-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH,OAAO,EAA4C,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAyBjG,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4DD,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,GAAE,WAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsLrG"}