@memnexus-ai/mx-agent-cli 0.1.269 → 0.1.270
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/dist/__tests__/codex-deploy-config.test.d.ts +2 -0
- package/dist/__tests__/codex-deploy-config.test.d.ts.map +1 -0
- package/dist/__tests__/codex-deploy-config.test.js +1170 -0
- package/dist/__tests__/codex-deploy-config.test.js.map +1 -0
- package/dist/__tests__/codex-trust-keys.test.d.ts +2 -0
- package/dist/__tests__/codex-trust-keys.test.d.ts.map +1 -0
- package/dist/__tests__/codex-trust-keys.test.js +731 -0
- package/dist/__tests__/codex-trust-keys.test.js.map +1 -0
- package/dist/__tests__/codex-write-race.test.d.ts +2 -0
- package/dist/__tests__/codex-write-race.test.d.ts.map +1 -0
- package/dist/__tests__/codex-write-race.test.js +372 -0
- package/dist/__tests__/codex-write-race.test.js.map +1 -0
- package/dist/__tests__/runtime-codex-guard-proof.test.js +75 -0
- package/dist/__tests__/runtime-codex-guard-proof.test.js.map +1 -1
- package/dist/commands/codex-deploy-config.d.ts +111 -0
- package/dist/commands/codex-deploy-config.d.ts.map +1 -0
- package/dist/commands/codex-deploy-config.js +400 -0
- package/dist/commands/codex-deploy-config.js.map +1 -0
- package/dist/commands/codex-prove-guards.d.ts +20 -0
- package/dist/commands/codex-prove-guards.d.ts.map +1 -1
- package/dist/commands/codex-prove-guards.js +54 -1
- package/dist/commands/codex-prove-guards.js.map +1 -1
- package/dist/commands/codex-trust-keys.d.ts +12 -0
- package/dist/commands/codex-trust-keys.d.ts.map +1 -0
- package/dist/commands/codex-trust-keys.js +169 -0
- package/dist/commands/codex-trust-keys.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/runtime/codex-adapter.d.ts.map +1 -1
- package/dist/lib/runtime/codex-adapter.js +15 -15
- package/dist/lib/runtime/codex-adapter.js.map +1 -1
- package/dist/lib/runtime/codex-config.d.ts +211 -0
- package/dist/lib/runtime/codex-config.d.ts.map +1 -1
- package/dist/lib/runtime/codex-config.js +769 -40
- package/dist/lib/runtime/codex-config.js.map +1 -1
- package/dist/lib/runtime/codex-hooks-list.d.ts +91 -0
- package/dist/lib/runtime/codex-hooks-list.d.ts.map +1 -0
- package/dist/lib/runtime/codex-hooks-list.js +418 -0
- package/dist/lib/runtime/codex-hooks-list.js.map +1 -0
- package/dist/lib/runtime/codex-trust-keys.d.ts +95 -0
- package/dist/lib/runtime/codex-trust-keys.d.ts.map +1 -0
- package/dist/lib/runtime/codex-trust-keys.js +279 -0
- package/dist/lib/runtime/codex-trust-keys.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mx-agent codex deploy-config` — deploy the Codex config artifacts for a worktree
|
|
3
|
+
* WITHOUT launching a session (#4875).
|
|
4
|
+
*
|
|
5
|
+
* ─── THE DEADLOCK THIS BREAKS ─────────────────────────────────────────────────
|
|
6
|
+
* Until this command existed, `deployCodexConfig` had exactly one caller:
|
|
7
|
+
* `CodexAdapter.deployConfig`, invoked from `runStart` after the launch gate. Verified
|
|
8
|
+
* ordering in `start.ts`:
|
|
9
|
+
*
|
|
10
|
+
* preflight() → assertLaunchAllowed() → persist .mx-runtime → claim leader lock
|
|
11
|
+
* → rebase → deployConfig() → launch()
|
|
12
|
+
*
|
|
13
|
+
* `assertLaunchAllowed` refuses unless project trust is already granted AND the guards
|
|
14
|
+
* are proven (or `MX_AGENT_CODEX_PHASE1_DEV=1` is set). So the ONLY way to regenerate
|
|
15
|
+
* `.codex/*` was to pass a gate that needs a proof, which needs a deployed hooks file,
|
|
16
|
+
* which needs the gate — and the escape was the development hatch, which starts a real
|
|
17
|
+
* Codex session with NO enforced guard. A new team could not deploy its config at all.
|
|
18
|
+
*
|
|
19
|
+
* This command is the deploy half on its own. It deploys and stops:
|
|
20
|
+
* NO session launch. NO leader-lock claim. NO `.mx-runtime` write. NO rebase.
|
|
21
|
+
* NO `.claude/` regeneration. It never calls `assertLaunchAllowed`.
|
|
22
|
+
*
|
|
23
|
+
* ─── WHY BYPASSING THE GATE HERE IS NOT A WEAKENING ───────────────────────────
|
|
24
|
+
* The launch gate is unchanged and is still evaluated, from disk, at launch. Deploying
|
|
25
|
+
* config grants no capability: the artifacts it writes are INERT until a human grants
|
|
26
|
+
* Codex hook trust for their exact bytes, and `.codex/hooks.json` deployed without a
|
|
27
|
+
* grant is exactly the state the launch gate refuses on. What this removes is the need
|
|
28
|
+
* to start an unguarded session in order to produce the bytes a human is about to be
|
|
29
|
+
* asked to trust.
|
|
30
|
+
*
|
|
31
|
+
* ─── WHAT IT STILL REFUSES ────────────────────────────────────────────────────
|
|
32
|
+
* - An instruction file over `project_doc_max_bytes` (Codex truncates it silently).
|
|
33
|
+
* - A worktree whose team slug cannot be resolved, and a `--team` that is not in the
|
|
34
|
+
* catalog: without a real slug the generated `AGENTS.override.md` silently loses its
|
|
35
|
+
* behavioral block, and a silently degraded instruction file is the failure this
|
|
36
|
+
* surface exists to prevent.
|
|
37
|
+
* - A deploy that produced no behavioral block, whatever the reason.
|
|
38
|
+
* - A `--path` that is not a directory, and a `--path` outside the worktree directory.
|
|
39
|
+
*
|
|
40
|
+
* ─── SCOPE: THIS WRITES ONE WORKTREE, AND THAT IS ENFORCED ────────────────────
|
|
41
|
+
* Under OpenAI Codex bug #27133 the file Codex actually READS is the MAIN repo's
|
|
42
|
+
* `/workspace/.codex/hooks.json`, which governs every Codex session in the fleet — and
|
|
43
|
+
* `AGENTS.override.md` in the main repo REPLACES AGENTS.md for every main-repo Codex
|
|
44
|
+
* session. A `--main-repo` variant that writes them is DELIBERATELY NOT IMPLEMENTED: it
|
|
45
|
+
* is a fleet-wide privileged write, and the authorization question (who may invoke it,
|
|
46
|
+
* whether an agent may at all, what backup and verification it must force) is open.
|
|
47
|
+
*
|
|
48
|
+
* SAYING SO WAS NOT ENOUGH (security review MF-1). The header claimed
|
|
49
|
+
* `worktree-guard.sh` as the compensating control, and it is not one: the guard blocks
|
|
50
|
+
* `cd /workspace` and shell idioms, not an mx-agent flag, and the reviewer confirmed by
|
|
51
|
+
* execution that `--path /workspace` deployed both fleet-wide files and reported
|
|
52
|
+
* success. `resolveCodexDeployTarget` now CONTAINS the target: the path is
|
|
53
|
+
* `realpathSync`'d first, so it cannot be aimed through a symlink, and must then be a
|
|
54
|
+
* DIRECT CHILD of `<projectRoot>/<worktreeDir>`. The project root itself, a symlink to
|
|
55
|
+
* it, a sibling outside the worktree directory and a nested path inside a worktree are
|
|
56
|
+
* all refused, by name.
|
|
57
|
+
*
|
|
58
|
+
* AND CONTAINING THE ARGUMENT IS NOT CONTAINING THE WRITES (security review round 2,
|
|
59
|
+
* MF-1). Checking the directory name proved nothing about where the bytes landed:
|
|
60
|
+
* `mkdirSync`/`writeFileSync` follow symlinks, so a `.codex` directory symlink, a
|
|
61
|
+
* COMMITTED relative symlink (`.codex -> ../../.codex`), a single-file symlink at
|
|
62
|
+
* `.codex/hooks.json`, and a directory swapped for a symlink after the check all wrote
|
|
63
|
+
* the main repo's fleet-wide files and reported success. Two changes close it: the target
|
|
64
|
+
* carries the RESOLVED path (so the checked path and the written path are the same one),
|
|
65
|
+
* and every write goes through `containedWriteRefusal`, which lstats each component from
|
|
66
|
+
* the worktree root down and refuses on the first symlink, naming the file and its real
|
|
67
|
+
* destination. A refused write makes the deploy `ok = false`.
|
|
68
|
+
*/
|
|
69
|
+
import chalk from 'chalk';
|
|
70
|
+
import { existsSync, lstatSync, realpathSync, statSync } from 'fs';
|
|
71
|
+
import { basename, dirname, join, resolve } from 'path';
|
|
72
|
+
import { listTeams } from '../lib/catalog.js';
|
|
73
|
+
import { loadProjectConfig, resolveProjectConfig } from '../lib/project-config.js';
|
|
74
|
+
import { CODEX_DEFAULT_MODEL, codexDeployReportLines, deployCodexConfig, instructionChainOverBudgetMessage, } from '../lib/runtime/codex-config.js';
|
|
75
|
+
import { findProjectRoot, getCurrentBranch, getSlot } from '../lib/worktree.js';
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the team slug that owns a worktree directory — the inverse of
|
|
78
|
+
* `findWorktreePath`, which prefix-matches `<slug>` or `<slug>-*` under `.worktrees/`.
|
|
79
|
+
*
|
|
80
|
+
* FAILS CLOSED on 0 or >1 matches. Guessing here would produce an
|
|
81
|
+
* `AGENTS.override.md` with the wrong team's behavioral block, or none at all, and the
|
|
82
|
+
* operator's only signal would be a file that looks deployed.
|
|
83
|
+
*/
|
|
84
|
+
export function inferTeamSlug(projectRoot, worktreeName, teamsDir) {
|
|
85
|
+
const candidates = listTeams(projectRoot, teamsDir)
|
|
86
|
+
.map((t) => t.slug)
|
|
87
|
+
.filter((slug) => worktreeName === slug || worktreeName.startsWith(`${slug}-`));
|
|
88
|
+
if (candidates.length === 1)
|
|
89
|
+
return { slug: candidates[0] };
|
|
90
|
+
if (candidates.length === 0) {
|
|
91
|
+
return {
|
|
92
|
+
error: `Could not resolve which team owns the worktree directory "${worktreeName}" — no catalog ` +
|
|
93
|
+
`entry in ${teamsDir} matches it. Pass the team explicitly: ` +
|
|
94
|
+
'`mx-agent codex deploy-config <team>`. Refusing to deploy without it: the generated ' +
|
|
95
|
+
'AGENTS.override.md would carry no behavioral block, and a silently degraded instruction ' +
|
|
96
|
+
'file is worse than no deploy.',
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// Longest match first is a plausible tie-break and a bad one: `retrieval` and
|
|
100
|
+
// `retrieval-eval` are both real shapes, and picking one would be a coin flip that
|
|
101
|
+
// writes another team's roleguide into this worktree.
|
|
102
|
+
return {
|
|
103
|
+
error: `The worktree directory "${worktreeName}" matches more than one team in ${teamsDir} ` +
|
|
104
|
+
`(${candidates.sort().join(', ')}). Pass the team explicitly: ` +
|
|
105
|
+
'`mx-agent codex deploy-config <team>`.',
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The refusal MF-1 exists to produce. Exported so the test asserts the shipped string
|
|
110
|
+
* rather than a paraphrase of it.
|
|
111
|
+
*/
|
|
112
|
+
export const OUT_OF_TREE_REFUSAL = 'deploy-config writes one worktree; the main repo\'s .codex/hooks.json governs every Codex ' +
|
|
113
|
+
'session in the fleet and is not deployable through this command.';
|
|
114
|
+
/**
|
|
115
|
+
* Is `target` a worktree this command may write?
|
|
116
|
+
*
|
|
117
|
+
* REALPATH FIRST, THEN CONTAINMENT (security review MF-1). `--path` was checked only for
|
|
118
|
+
* being a directory, so `--path /workspace --team <any catalog slug>` wrote the main
|
|
119
|
+
* repo's `.codex/hooks.json` — the file that governs every Codex session in the fleet
|
|
120
|
+
* under #27133 — and `/workspace/AGENTS.override.md`, which REPLACES AGENTS.md for every
|
|
121
|
+
* main-repo Codex session. It reported success and said nothing about fleet scope.
|
|
122
|
+
*
|
|
123
|
+
* The order matters: resolving symlinks BEFORE comparing is what stops the check being
|
|
124
|
+
* aimed through one (`.worktrees/innocent -> /workspace` passes any purely textual
|
|
125
|
+
* prefix test). And the rule is DIRECT CHILD, not "starts with": a nested path inside a
|
|
126
|
+
* worktree is not a worktree, and a prefix test would also accept
|
|
127
|
+
* `<projectRoot>/.worktrees-backup`.
|
|
128
|
+
*/
|
|
129
|
+
export function resolveContainedWorktree(projectRoot, worktreeDir, target) {
|
|
130
|
+
let realTarget;
|
|
131
|
+
try {
|
|
132
|
+
realTarget = realpathSync(target);
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
return {
|
|
136
|
+
error: `${target} could not be resolved to a real path (${err instanceof Error ? err.message : String(err)}).`,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const worktreesRoot = resolve(projectRoot, worktreeDir);
|
|
140
|
+
// ── THE WORKTREES ROOT ITSELF MUST BE A REAL DIRECTORY (security review SF-C) ──
|
|
141
|
+
// `realpathSync` was applied to it, so a `.worktrees` that is ITSELF a symlink was
|
|
142
|
+
// resolved and then used as the containment reference. The reviewer executed it: with
|
|
143
|
+
// `.worktrees -> <projectRoot>`, every top-level directory in the main repo became a
|
|
144
|
+
// "worktree" and passed. The rule this check exists to enforce is a real directory
|
|
145
|
+
// named by the project config, not whatever a link in its place points at.
|
|
146
|
+
let rootStat;
|
|
147
|
+
try {
|
|
148
|
+
rootStat = lstatSync(worktreesRoot);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
rootStat = null;
|
|
152
|
+
}
|
|
153
|
+
if (rootStat === null) {
|
|
154
|
+
return {
|
|
155
|
+
error: `${worktreesRoot} does not exist, so nothing can be a worktree under it. ` +
|
|
156
|
+
`${OUT_OF_TREE_REFUSAL}`,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (rootStat.isSymbolicLink() || !rootStat.isDirectory()) {
|
|
160
|
+
return {
|
|
161
|
+
error: `${worktreesRoot} is not a real directory — it is a symlink or a non-directory. Resolving ` +
|
|
162
|
+
'it and then containing against its destination would make every child of that ' +
|
|
163
|
+
'destination look like a worktree, which is how a link in place of the worktree ' +
|
|
164
|
+
`directory turns the main repository into a deploy target. ${OUT_OF_TREE_REFUSAL}`,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const realWorktreesRoot = realpathSync(worktreesRoot);
|
|
168
|
+
// The RESOLVED path is what the caller must carry forward (MF-1): returning the
|
|
169
|
+
// argument meant the check and the write named different files, and a directory swapped
|
|
170
|
+
// for a symlink between the two was written through.
|
|
171
|
+
if (dirname(realTarget) === realWorktreesRoot)
|
|
172
|
+
return { realPath: realTarget };
|
|
173
|
+
let realProjectRoot = projectRoot;
|
|
174
|
+
try {
|
|
175
|
+
realProjectRoot = realpathSync(projectRoot);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// Fall through — the message below is the same either way.
|
|
179
|
+
}
|
|
180
|
+
const aimedAtRoot = realTarget === realProjectRoot;
|
|
181
|
+
return {
|
|
182
|
+
error: `${target}${realTarget === target ? '' : ` (which resolves to ${realTarget})`} is not a ` +
|
|
183
|
+
`worktree — it is not a direct child of ${realWorktreesRoot}. ` +
|
|
184
|
+
(aimedAtRoot
|
|
185
|
+
? 'That path IS the main repository. '
|
|
186
|
+
: realTarget.startsWith(`${realWorktreesRoot}/`)
|
|
187
|
+
? 'It is inside a worktree rather than being one; deploy into the worktree itself. '
|
|
188
|
+
: '') +
|
|
189
|
+
`${OUT_OF_TREE_REFUSAL} Pass a worktree directory, e.g. ` +
|
|
190
|
+
`${join(realWorktreesRoot, '<team>-<date>')}.`,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/** The refusal text alone, for callers and tests that only need the verdict. */
|
|
194
|
+
export function containmentError(projectRoot, worktreeDir, target) {
|
|
195
|
+
const resolved = resolveContainedWorktree(projectRoot, worktreeDir, target);
|
|
196
|
+
return 'error' in resolved ? resolved.error : null;
|
|
197
|
+
}
|
|
198
|
+
export function resolveCodexDeployTarget(opts = {}) {
|
|
199
|
+
let projectRoot;
|
|
200
|
+
try {
|
|
201
|
+
projectRoot = opts.projectRoot ?? findProjectRoot();
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
205
|
+
}
|
|
206
|
+
const cfg = resolveProjectConfig(loadProjectConfig(projectRoot));
|
|
207
|
+
const worktreePath = resolve(opts.path ?? opts.cwd ?? process.cwd());
|
|
208
|
+
if (!existsSync(worktreePath) || !statSync(worktreePath).isDirectory()) {
|
|
209
|
+
return { error: `${worktreePath} is not a directory — there is no worktree to deploy into.` };
|
|
210
|
+
}
|
|
211
|
+
// CONTAINMENT BEFORE ANYTHING ELSE IS WRITTEN OR EVEN RESOLVED (MF-1), and the target
|
|
212
|
+
// carries the RESOLVED path from here on. Keeping the argument string meant the path
|
|
213
|
+
// that passed the check was not the path that got written: swapping the checked
|
|
214
|
+
// directory for a symlink to the project root in between deployed the fleet-wide files,
|
|
215
|
+
// which the reviewer executed. The deploy's own per-write containment
|
|
216
|
+
// (`containedWriteRefusal`) re-checks this root at write time as well.
|
|
217
|
+
const contained = resolveContainedWorktree(projectRoot, cfg.worktreeDir, worktreePath);
|
|
218
|
+
if ('error' in contained)
|
|
219
|
+
return { error: contained.error };
|
|
220
|
+
const realWorktreePath = contained.realPath;
|
|
221
|
+
const worktreeName = basename(realWorktreePath);
|
|
222
|
+
let teamSlug = opts.team;
|
|
223
|
+
if (!teamSlug) {
|
|
224
|
+
const inferred = inferTeamSlug(projectRoot, worktreeName, cfg.teamsDir);
|
|
225
|
+
if ('error' in inferred)
|
|
226
|
+
return { error: inferred.error };
|
|
227
|
+
teamSlug = inferred.slug;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
// AN EXPLICIT `--team` WAS NEVER CHECKED (security review SF-7). Inference fails
|
|
231
|
+
// closed on an unknown directory name, but passing the slug by hand skipped that
|
|
232
|
+
// entirely: the reviewer ran `--team totally-not-a-team` and got a successful deploy
|
|
233
|
+
// whose only trace of the problem was a warning line. The catalog is the same source
|
|
234
|
+
// inference consults, so the two paths now refuse the same set of slugs.
|
|
235
|
+
const known = listTeams(projectRoot, cfg.teamsDir).map((t) => t.slug);
|
|
236
|
+
if (!known.includes(teamSlug)) {
|
|
237
|
+
return {
|
|
238
|
+
error: `No team "${teamSlug}" in ${cfg.teamsDir}. The team decides which roleguide supplies ` +
|
|
239
|
+
'the behavioral block folded into AGENTS.override.md, so an unknown slug produces an ' +
|
|
240
|
+
'instruction file with no behavioral reinforcement — deployed, and looking deployed. ' +
|
|
241
|
+
`Known teams: ${known.sort().join(', ') || '(none)'}.`,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Same two-key lookup `runStart` performs — `.slots.json` may be keyed by the full
|
|
246
|
+
// directory name or by the bare slug — and the same 0 fallback.
|
|
247
|
+
const slot = getSlot(projectRoot, worktreeName, cfg.worktreeDir) ??
|
|
248
|
+
getSlot(projectRoot, teamSlug, cfg.worktreeDir) ??
|
|
249
|
+
0;
|
|
250
|
+
return {
|
|
251
|
+
target: {
|
|
252
|
+
projectRoot,
|
|
253
|
+
worktreePath: realWorktreePath,
|
|
254
|
+
worktreeName,
|
|
255
|
+
teamSlug,
|
|
256
|
+
slot,
|
|
257
|
+
branch: getCurrentBranch(realWorktreePath),
|
|
258
|
+
baseBranch: cfg.baseBranch,
|
|
259
|
+
projectSlug: cfg.projectSlug,
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* The last line the operator reads, for a given outcome. Separate and pure because it is
|
|
265
|
+
* the line that tells them whether re-granting hook trust is optional or REQUIRED, and a
|
|
266
|
+
* branch that is only reachable through `console.log` is a branch no test asserts.
|
|
267
|
+
*/
|
|
268
|
+
export function closingTrustGuidance(outcome) {
|
|
269
|
+
// GATED ON WHETHER THE BYTES CHANGED (MF-2). "Next: grant trust" reads as an optional
|
|
270
|
+
// finishing step, which is right for a first deploy and wrong for one that has just
|
|
271
|
+
// invalidated every existing grant — there, re-granting is the difference between
|
|
272
|
+
// guards that run and guards that silently do not, in sessions that are already open.
|
|
273
|
+
if (outcome.hookTrustInvalidated) {
|
|
274
|
+
return {
|
|
275
|
+
level: 'warn',
|
|
276
|
+
text: 'Next (REQUIRED — the hooks file changed, so the grants above are stale): re-grant Codex ' +
|
|
277
|
+
'hook trust for the NEW bytes (`mx-agent codex trust-keys` prints the keys, the current ' +
|
|
278
|
+
'hashes and a pasteable TOML block), then `mx-agent codex prove-guards`. Until that is ' +
|
|
279
|
+
'done the containment guards do not run, and nothing else will say so.',
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
// AND ON WHETHER IT COULD TELL (SF-G). "This deploy did not invalidate your grants" and
|
|
283
|
+
// "this deploy could not find out" are different facts, and only one of them means the
|
|
284
|
+
// operator can skip the next step.
|
|
285
|
+
if (outcome.hookTrustUnverifiable) {
|
|
286
|
+
return {
|
|
287
|
+
level: 'warn',
|
|
288
|
+
text: 'Next (REQUIRED — this deploy could NOT determine whether it invalidated the existing ' +
|
|
289
|
+
'hook-trust grants for this worktree): treat every grant for this hooks file as ' +
|
|
290
|
+
'UNVERIFIED, not as current. Codex silently declines to run an entry whose hash stopped ' +
|
|
291
|
+
'matching, including in a session running right now. Compare and re-grant with ' +
|
|
292
|
+
'`mx-agent codex trust-keys`, then `mx-agent codex prove-guards`.',
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
level: 'info',
|
|
297
|
+
text: 'Next: grant Codex hook trust for these bytes (`mx-agent codex trust-keys` prints the keys, ' +
|
|
298
|
+
'the current hashes and a pasteable TOML block), then `mx-agent codex prove-guards`.',
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Deploy for a resolved target. Pure of process control — it neither exits nor prints,
|
|
303
|
+
* so the tests can assert the outcome and the CLI entry point owns the exit code.
|
|
304
|
+
*/
|
|
305
|
+
export function deployCodexConfigOnly(target) {
|
|
306
|
+
const result = deployCodexConfig({
|
|
307
|
+
projectRoot: target.projectRoot,
|
|
308
|
+
worktreePath: target.worktreePath,
|
|
309
|
+
worktreeName: target.worktreeName,
|
|
310
|
+
branch: target.branch,
|
|
311
|
+
slot: target.slot,
|
|
312
|
+
teamSlug: target.teamSlug,
|
|
313
|
+
// The SAME model the adapter deploys with (`CodexAdapter` defaults to this and
|
|
314
|
+
// `runStart` passes no model for Codex). The generated config.toml carries the
|
|
315
|
+
// model, so a different default here would produce different bytes than a launch
|
|
316
|
+
// does — and the operator would be granting hook trust against bytes `start` is
|
|
317
|
+
// about to replace.
|
|
318
|
+
model: CODEX_DEFAULT_MODEL,
|
|
319
|
+
baseBranch: target.baseBranch,
|
|
320
|
+
...(target.projectSlug ? { projectSlug: target.projectSlug } : {}),
|
|
321
|
+
});
|
|
322
|
+
const lines = codexDeployReportLines(result);
|
|
323
|
+
const hookTrustInvalidated = result.hookTrustInvalidated;
|
|
324
|
+
let ok = true;
|
|
325
|
+
// A REFUSED WRITE IS A FAILED DEPLOY (security review MF-1). The refusal already
|
|
326
|
+
// renders as a warning naming the file and its real destination; what it must not do is
|
|
327
|
+
// leave `ok = true`, which is how a deploy aimed through a symlink at the main repo
|
|
328
|
+
// reported success on a worktree that has no artifacts at all.
|
|
329
|
+
if (result.writeRefusals.length > 0)
|
|
330
|
+
ok = false;
|
|
331
|
+
// A FAILED WRITE IS ALSO A FAILED DEPLOY (delta re-review MUST FIX). Same rule, one
|
|
332
|
+
// level less exotic: the reason the bytes did not land does not change the fact that an
|
|
333
|
+
// artifact this worktree needs is not on disk. The reviewer measured 2466 of 2500
|
|
334
|
+
// deploys reporting ok=true while AGENTS.override.md — the file Codex reads INSTEAD of
|
|
335
|
+
// AGENTS.md — sat there at zero bytes.
|
|
336
|
+
if (result.writeFailures.length > 0)
|
|
337
|
+
ok = false;
|
|
338
|
+
if (result.chain.overBudget) {
|
|
339
|
+
lines.push({
|
|
340
|
+
level: 'warn',
|
|
341
|
+
text: instructionChainOverBudgetMessage(result.chain, 'refusing to report this deployment as usable'),
|
|
342
|
+
});
|
|
343
|
+
ok = false;
|
|
344
|
+
}
|
|
345
|
+
// A MISSING BEHAVIORAL BLOCK IS A REFUSAL, NOT A WARNING (security review SF-7). The
|
|
346
|
+
// generator already emits "Behavioral block MISSING", and it emitted it into a run
|
|
347
|
+
// that reported ok=true — an operator reading the exit code learns nothing, and the
|
|
348
|
+
// header of this file names a silently degraded instruction file as the one failure
|
|
349
|
+
// this surface exists to prevent. The check is on the OUTCOME, not on the slug, so it
|
|
350
|
+
// also catches an unreadable roleguide and a roleguide with no markers.
|
|
351
|
+
if (!result.hasBehavioralBlock) {
|
|
352
|
+
lines.push({
|
|
353
|
+
level: 'warn',
|
|
354
|
+
text: 'refusing to report this deployment as usable: the generated AGENTS.override.md carries ' +
|
|
355
|
+
'NO behavioral block, so a Codex session started from it runs with no behavioral ' +
|
|
356
|
+
'reinforcement at all. Codex reads this file once at session start and there is no ' +
|
|
357
|
+
'per-turn re-injection to make up for it. Fix the team\'s roleguide (it needs the ' +
|
|
358
|
+
'behavioral-start/behavioral-end markers) and redeploy.',
|
|
359
|
+
});
|
|
360
|
+
ok = false;
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
ok,
|
|
364
|
+
lines,
|
|
365
|
+
written: result.written,
|
|
366
|
+
hookTrustInvalidated,
|
|
367
|
+
hookTrustUnverifiable: result.hookTrustUnverifiable,
|
|
368
|
+
writeRefusals: result.writeRefusals,
|
|
369
|
+
writeFailures: result.writeFailures,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
/** CLI entry point. Exits non-zero on any refusal — a deploy that cannot be used is not a pass. */
|
|
373
|
+
export function runCodexDeployConfig(opts = {}) {
|
|
374
|
+
const resolved = resolveCodexDeployTarget({
|
|
375
|
+
...(opts.path ? { path: opts.path } : {}),
|
|
376
|
+
...(opts.team ? { team: opts.team } : {}),
|
|
377
|
+
});
|
|
378
|
+
if ('error' in resolved) {
|
|
379
|
+
console.error(chalk.red(`Error: ${resolved.error}`));
|
|
380
|
+
process.exit(1);
|
|
381
|
+
}
|
|
382
|
+
const { target } = resolved;
|
|
383
|
+
console.log(chalk.dim(` Worktree: ${target.worktreePath} (team ${target.teamSlug}, slot ${target.slot})`));
|
|
384
|
+
const outcome = deployCodexConfigOnly(target);
|
|
385
|
+
for (const line of outcome.lines) {
|
|
386
|
+
console.log(line.level === 'warn' ? chalk.yellow(` ⚠ ${line.text}`) : chalk.dim(` ${line.text}`));
|
|
387
|
+
}
|
|
388
|
+
// Say what was NOT done, every time. The operator arriving here from the G-7 runbook
|
|
389
|
+
// has just been told that regeneration launches a session, claims the lock and
|
|
390
|
+
// rewrites `.mx-runtime`; none of that happened, and silence would leave them
|
|
391
|
+
// guessing which of the two paths they just took.
|
|
392
|
+
console.log(chalk.dim(' Deploy only: no session was launched, no leader lock claimed, no .mx-runtime written, ' +
|
|
393
|
+
'no rebase performed. The launch gate is unchanged — `mx-agent start <team> --runtime codex` ' +
|
|
394
|
+
'still requires project trust and a current guard proof.'));
|
|
395
|
+
const closing = closingTrustGuidance(outcome);
|
|
396
|
+
console.log(closing.level === 'warn' ? chalk.yellow(` ${closing.text}`) : chalk.dim(` ${closing.text}`));
|
|
397
|
+
if (!outcome.ok)
|
|
398
|
+
process.exit(1);
|
|
399
|
+
}
|
|
400
|
+
//# sourceMappingURL=codex-deploy-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-deploy-config.js","sourceRoot":"","sources":["../../src/commands/codex-deploy-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,iCAAiC,GAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAahF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,WAAmB,EACnB,YAAoB,EACpB,QAAgB;IAEhB,MAAM,UAAU,GAAG,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAClB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,UAAU,CAA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AE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACtG,CAAC;IACD,qFAAqF;IACrF,+EAA+E;IAC/E,8EAA8E;IAC9E,kDAAkD;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CACnB,0FAA0F;QAC1F,8FAA8F;QAC9F,yDAAyD,CAC1D,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3G,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex's own per-entry hashes, or a stated reason there are none (#4876).
|
|
3
|
+
*
|
|
4
|
+
* REQUIRED, AND WITH NO DEFAULT, on purpose. `codexHookTrustPreconditions` treats a
|
|
5
|
+
* missing observation as "not checked", and a proof that quietly skipped the check would
|
|
6
|
+
* be exactly the false green KI-CODEX-TRUST-HASH-NOT-VERIFIED describes: a stale
|
|
7
|
+
* `trusted_hash` means Codex silently does not run the entry, so proving that the entry's
|
|
8
|
+
* command refuses proves nothing about the live session. `unavailable` REFUSES rather
|
|
9
|
+
* than degrading — a gate that cannot run must not allow.
|
|
10
|
+
*/
|
|
11
|
+
export type TrustHashObservation = {
|
|
12
|
+
kind: 'observed';
|
|
13
|
+
hashes: ReadonlyMap<string, string>;
|
|
14
|
+
source: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'unavailable';
|
|
17
|
+
reason: string;
|
|
18
|
+
};
|
|
1
19
|
export interface ProbeOutcome {
|
|
2
20
|
status: number | null;
|
|
3
21
|
stderr: string;
|
|
@@ -52,6 +70,8 @@ export declare function proveCodexGuards(opts: {
|
|
|
52
70
|
runner?: CommandRunner;
|
|
53
71
|
/** Base environment for the probes. Defaults to the current process env. */
|
|
54
72
|
env?: NodeJS.ProcessEnv;
|
|
73
|
+
/** Codex's own per-entry hashes, from `hooks/list`. No default — see the type. */
|
|
74
|
+
hashes: TrustHashObservation;
|
|
55
75
|
}): ProveGuardsResult;
|
|
56
76
|
export interface RunProveGuardsOptions {
|
|
57
77
|
path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-prove-guards.d.ts","sourceRoot":"","sources":["../../src/commands/codex-prove-guards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-prove-guards.d.ts","sourceRoot":"","sources":["../../src/commands/codex-prove-guards.ts"],"names":[],"mappings":"AA+EA;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EA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,CAAC,EAAE,MAAM,CAAC;CACf;AAED,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,qBAA0B,GAAG,IAAI,CA0D1E"}
|
|
@@ -53,7 +53,11 @@ import { createHash } from 'crypto';
|
|
|
53
53
|
import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'fs';
|
|
54
54
|
import { tmpdir } from 'os';
|
|
55
55
|
import { join } from 'path';
|
|
56
|
-
import { CODEX_HOOKS_FILENAME, PHASE1_PORTED_GUARDS, buildCodexHooksJson, codexAgentGateCommand, codexHookCommand, codexHookTrustPreconditions, readDeployedHooksDoc, } from '../lib/runtime/codex-config.js';
|
|
56
|
+
import { CODEX_HOOKS_FILENAME, PHASE1_PORTED_GUARDS, buildCodexHooksJson, codexAgentGateCommand, codexHookCommand, codexHookTrustPreconditions, readDeployedHooksDoc, resolveCodexHome, } from '../lib/runtime/codex-config.js';
|
|
57
|
+
import { queryCodexHooksList } from '../lib/runtime/codex-hooks-list.js';
|
|
58
|
+
import { buildTrustKeyReport, shaCodexHooksFiles } from '../lib/runtime/codex-trust-keys.js';
|
|
59
|
+
import { renderTrustKeyReport } from './codex-trust-keys.js';
|
|
60
|
+
import { findProjectRoot } from '../lib/worktree.js';
|
|
57
61
|
import { GUARD_PROOF_FILENAME, GUARD_PROOF_VERSION, fileSha256, runningCliVersion, writeGuardProof, } from '../lib/runtime/codex-guard-proof.js';
|
|
58
62
|
const defaultRunner = (command, payload, env) => {
|
|
59
63
|
const r = spawnSync('bash', ['-c', command], {
|
|
@@ -162,8 +166,17 @@ export function proveCodexGuards(opts) {
|
|
|
162
166
|
// Trust first. A guard that refuses when it is RUN, registered in a file Codex will
|
|
163
167
|
// not run, is not a control — and recording it as proven is the false green this
|
|
164
168
|
// whole change exists to remove.
|
|
169
|
+
//
|
|
170
|
+
// #4876: including the HASH half. Without Codex's own hashes the trust check can only
|
|
171
|
+
// say a record exists; a record bound to bytes that changed is a record Codex ignores.
|
|
172
|
+
if (opts.hashes.kind === 'unavailable') {
|
|
173
|
+
return fail('Could not read Codex\'s own per-entry hook hashes, so a recorded trusted_hash cannot be ' +
|
|
174
|
+
'compared to anything and a STALE grant would be indistinguishable from a current one. ' +
|
|
175
|
+
`Refusing to record a proof on an unverifiable grant. Reason: ${opts.hashes.reason}`);
|
|
176
|
+
}
|
|
165
177
|
const trust = codexHookTrustPreconditions({
|
|
166
178
|
worktreePath: opts.worktreePath,
|
|
179
|
+
observedHashes: opts.hashes.hashes,
|
|
167
180
|
...(opts.codexHome ? { codexHome: opts.codexHome } : {}),
|
|
168
181
|
});
|
|
169
182
|
const unmet = trust.filter((t) => !t.satisfied);
|
|
@@ -340,11 +353,51 @@ export function runCodexProveGuards(opts = {}) {
|
|
|
340
353
|
process.exit(1);
|
|
341
354
|
}
|
|
342
355
|
const codexVersion = ((probe.stdout ?? '').replace(/\r/g, '').trim().split(/\s+/).pop() ?? '').trim();
|
|
356
|
+
// #4876: read Codex's own per-entry hashes before proving anything. This costs one
|
|
357
|
+
// `codex app-server` invocation (seconds), which is affordable here — this is a
|
|
358
|
+
// human-run command with a person waiting — and is NOT wired into the launch banner
|
|
359
|
+
// for the same reason it is affordable here: that path runs several times per start.
|
|
360
|
+
let mainRepoPath = worktreePath;
|
|
361
|
+
try {
|
|
362
|
+
mainRepoPath = findProjectRoot();
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
// Not in a repo — the worktree file is then the only key set, and the report below
|
|
366
|
+
// reports the main-repo file as unreadable rather than inventing one.
|
|
367
|
+
}
|
|
368
|
+
// Both hooks files are hashed BEFORE the call and again after it (SF-8) — a deploy
|
|
369
|
+
// landing inside the window would otherwise let a carried hash describe bytes that are
|
|
370
|
+
// no longer on disk, and this command binds a PROOF to the result.
|
|
371
|
+
const shaBefore = shaCodexHooksFiles([worktreePath, mainRepoPath]);
|
|
372
|
+
// ONE resolver for the Codex config directory, honouring CODEX_HOME (security review
|
|
373
|
+
// SF-A). Reading the wrong file here reports every grant as absent, and this command
|
|
374
|
+
// binds a PROOF to the answer.
|
|
375
|
+
const codexHomeResolution = resolveCodexHome();
|
|
376
|
+
if ('error' in codexHomeResolution) {
|
|
377
|
+
console.error(`Refusing to prove guards: ${codexHomeResolution.error}`);
|
|
378
|
+
process.exit(1);
|
|
379
|
+
}
|
|
380
|
+
const report = buildTrustKeyReport({
|
|
381
|
+
worktreePath,
|
|
382
|
+
mainRepoPath,
|
|
383
|
+
codexHome: codexHomeResolution.home,
|
|
384
|
+
hooksList: queryCodexHooksList({ cwd: worktreePath }),
|
|
385
|
+
shaBefore,
|
|
386
|
+
});
|
|
343
387
|
const result = proveCodexGuards({
|
|
344
388
|
worktreePath,
|
|
345
389
|
codexVersion,
|
|
346
390
|
now: new Date().toISOString().replace(/\.\d{3}Z$/, 'Z'),
|
|
391
|
+
hashes: report.error
|
|
392
|
+
? { kind: 'unavailable', reason: report.error }
|
|
393
|
+
: { kind: 'observed', hashes: report.observedHashes, source: 'codex app-server hooks/list' },
|
|
347
394
|
});
|
|
395
|
+
// Printed whether or not the proof succeeds: when it fails on trust, these lines name
|
|
396
|
+
// the exact entries and carry the pasteable grant block.
|
|
397
|
+
if (!result.ok) {
|
|
398
|
+
for (const line of renderTrustKeyReport(report))
|
|
399
|
+
console.log(line);
|
|
400
|
+
}
|
|
348
401
|
for (const line of result.lines)
|
|
349
402
|
console.log(line);
|
|
350
403
|
if (!result.ok)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-prove-guards.js","sourceRoot":"","sources":["../../src/commands/codex-prove-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,C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C,SAAS,EAAE,mBAAmB,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;QACrD,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,gBAAgB,CAAC;QAC9B,YAAY;QACZ,YAAY;QACZ,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;QACvD,MAAM,EAAE,MAAM,CAAC,KAAK;YAClB,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE;YAC/C,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,6BAA6B,EAAE;KAC/F,CAAC,CAAC;IACH,sFAAsF;IACtF,yDAAyD;IACzD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,KAAK,MAAM,IAAI,IAAI,oBAAoB,CAAC,MAAM,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK;QAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TrustKeyReport } from '../lib/runtime/codex-trust-keys.js';
|
|
2
|
+
export interface RunTrustKeysOptions {
|
|
3
|
+
path?: string;
|
|
4
|
+
json?: boolean;
|
|
5
|
+
codexHome?: string;
|
|
6
|
+
/** Injected for tests — otherwise `hooks/list` is run against the worktree. */
|
|
7
|
+
report?: TrustKeyReport;
|
|
8
|
+
}
|
|
9
|
+
export declare function renderTrustKeyReport(report: TrustKeyReport): string[];
|
|
10
|
+
/** CLI entry point. Exits non-zero when any entry is not verifiably granted. */
|
|
11
|
+
export declare function runCodexTrustKeys(opts?: RunTrustKeysOptions): void;
|
|
12
|
+
//# sourceMappingURL=codex-trust-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-trust-keys.d.ts","sourceRoot":"","sources":["../../src/commands/codex-trust-keys.ts"],"names":[],"mappings":"AAwBA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,oCAAoC,CAAC;AAW5C,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CA6ErE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,IAAI,CAkEtE"}
|