@deftai/directive 0.119.1 → 0.119.2

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/authz.js CHANGED
@@ -13,10 +13,11 @@
13
13
  * deft authz:grant -- --parent <parent.xbrief.json> --draft <draft.json> [--repo owner/name] [--confirm]
14
14
  * deft authz:revoke -- <grant-id> [--confirm]
15
15
  *
16
- * **UAT-active hard refuse (#3110):** while any UAT lease is active, ALL mutating
17
- * verbs (`uat-start`, `uat-suspend`, `grant`, `revoke`) refuse unconditionally —
18
- * no TTY, no `--confirm`, no typed phrase path. Self-approval under UAT is
19
- * impossible by construction (agent PTY cannot mint operator-cli authority).
16
+ * **UAT-active mint refuse (#3110 / #4632):** while any UAT lease is active,
17
+ * `uat-start`, `grant`, and `revoke` refuse unconditionally — no TTY, `--confirm`,
18
+ * or typed phrase path. `uat-suspend` skips that mint-refuse and still requires
19
+ * multi-factor human presence (real operator console). Suspend reuses the typed
20
+ * phrase `mint`; it is not a remint.
20
21
  *
21
22
  * **Outside UAT:** mutating verbs require multi-factor human presence: interactive
22
23
  * TTY + controlling terminal + `--confirm` + typed phrase `mint`; agent/CI env
@@ -222,16 +223,19 @@ function helpText() {
222
223
  "",
223
224
  "Human-origin grants are minted only via this CLI (origin.kind=operator-cli).",
224
225
  "Self-authored xBRIEF/lifecycle/dispatch tokens never satisfy implement gates (#2944).",
225
- "While any UAT lease is ACTIVE (#3110): ALL mutating verbs refuse unconditionally",
226
- " (grant / uat-start / uat-suspend / revoke) — no TTY, --confirm, or phrase path.",
227
- " Self-approval under UAT is impossible by construction. Mint grants BEFORE uat-start.",
226
+ "While any UAT lease is ACTIVE (#3110 / #4632): grant / uat-start / revoke refuse",
227
+ " unconditionally — no TTY, --confirm, or phrase path. Self-approval remint under",
228
+ " UAT is impossible by construction. Mint grants BEFORE uat-start.",
229
+ " uat-suspend is reachable from a real operator console: listed agent/CI markers",
230
+ " empty, stdin+stdout TTY, controlling terminal, --confirm, typed phrase 'mint'",
231
+ " (suspend reuses the mint phrase; it is not a remint). Agent/CI and missing-factor",
232
+ " seams still refuse (exit 2). After suspend, grant is available again through",
233
+ " the same human-presence gate.",
228
234
  "Outside UAT, mutating verbs require multi-factor human presence (#3110):",
229
235
  " - Interactive TTY (stdin+stdout) + controlling terminal (/dev/tty|\\\\.\\CONIN$)",
230
236
  " - Explicit --confirm (argv flag alone never enough)",
231
237
  " - Typed phrase 'mint' on the controlling TTY (PTY+--confirm alone never enough)",
232
238
  " - Known agent/CI env markers always refuse (fail-closed).",
233
- " End UAT only after the lease is cleared out-of-band (state edit / suspend path",
234
- " that does not run while the lease is active) — or suspend before re-minting.",
235
239
  "",
236
240
  "Structural scope:decompose apply (#3239 / #3291):",
237
241
  " Pass --parent + --draft (paths under project root). Digest is SHA-256 of exact",
@@ -263,17 +267,21 @@ export function main(argv = process.argv.slice(2), seams = {}) {
263
267
  }
264
268
  const resolved = resolveHumanPresenceMintSeams(seams);
265
269
  /**
266
- * Mutating-verb gate stack (#3110):
267
- * 1. Active UAT → hard refuse (no multi-factor escape; self-approval impossible)
268
- * 2. Else multi-factor: TTY + controlling tty + --confirm + typed phrase; agent/CI markers refuse
270
+ * Mutating-verb gate stack (#3110 / #4632):
271
+ * 1. Active UAT mint-refuse for grant / uat-start / revoke (no multi-factor escape)
272
+ * 2. uat-suspend skips that mint-refuse so campaign-end stays reachable
273
+ * 3. Multi-factor human presence: TTY + controlling tty + --confirm + typed phrase;
274
+ * agent/CI markers refuse. Suspend reuses phrase `mint`.
269
275
  * Required-arg validation runs before this so missing --campaign / --ops still report clearly.
270
276
  */
271
277
  const gateConfirm = () => {
272
278
  if (args.cmd === "show")
273
279
  return null;
274
- const uatBlocked = refuseMintWhileUatActive(`authz:${args.cmd}`, args.projectRoot);
275
- if (uatBlocked !== null)
276
- return uatBlocked;
280
+ if (args.cmd !== "uat-suspend") {
281
+ const uatBlocked = refuseMintWhileUatActive(`authz:${args.cmd}`, args.projectRoot);
282
+ if (uatBlocked !== null)
283
+ return uatBlocked;
284
+ }
277
285
  return refuseNonInteractiveMint({
278
286
  verb: `authz:${args.cmd}`,
279
287
  confirm: args.confirm,
@@ -434,12 +442,18 @@ export function main(argv = process.argv.slice(2), seams = {}) {
434
442
  "The in-process simulator is test-only and is discarded on process exit.\n");
435
443
  return 2;
436
444
  }
445
+ const resolved = onePrUnit.resolveProductionAppStore(process.env);
446
+ if (!resolved.ok) {
447
+ process.stderr.write(`${resolved.message}\n`);
448
+ return 2;
449
+ }
437
450
  const claim = onePrUnit.mintOnePrUnitGrant({
438
451
  actor: args.actor,
439
452
  approvalRef: args.note ?? "authz:grant --template one-pr-unit",
440
453
  rationale: args.note ?? "one-PR-unit",
441
454
  origins: args.issueIds.map((issueId) => ({ repo: args.repo, issueId })),
442
455
  repo: args.repo,
456
+ store: resolved.store,
443
457
  });
444
458
  process.stdout.write(`✓ one-PR-unit claim minted id=${claim.id} state=${claim.state} (reserved unbound)\n`);
445
459
  process.stdout.write(" Opaque id is not a bearer. Only the App store plus the bound PR node id authorizes.\n");
@@ -81,7 +81,14 @@ export function parseArgs(argv) {
81
81
  parsed.posture = posture;
82
82
  }
83
83
  else {
84
- return { ...parsed, error: `unrecognized argument: ${arg}` };
84
+ const error = `unrecognized argument: ${arg}`;
85
+ if (arg === "--session-id" || arg?.startsWith("--session-id=")) {
86
+ return {
87
+ ...parsed,
88
+ error: `${error} Drop the flag and retry deft verify:session-ritual -- --tier=gated.`,
89
+ };
90
+ }
91
+ return { ...parsed, error };
85
92
  }
86
93
  }
87
94
  return parsed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.119.1",
3
+ "version": "0.119.2",
4
4
  "description": "Directive CLI — npm install path for the Deft Directive framework.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://deftai.github.io/directive/",
@@ -34,8 +34,8 @@
34
34
  "provenance": true
35
35
  },
36
36
  "dependencies": {
37
- "@deftai/directive-core": "^0.119.1",
38
- "@deftai/directive-content": "^0.119.1"
37
+ "@deftai/directive-core": "^0.119.2",
38
+ "@deftai/directive-content": "^0.119.2"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -b"