@holmes-lab/holmes-kit 0.37.2 → 0.38.0

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 (34) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +12 -2
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/approve-status.js +2 -1
  5. package/dist/holmes/cli/approve.js +24 -3
  6. package/dist/holmes/cli/autonomy.d.ts +28 -0
  7. package/dist/holmes/cli/autonomy.js +62 -8
  8. package/dist/holmes/cli/index.js +59 -4
  9. package/dist/holmes/cli/runtime-binding-approval.js +2 -3
  10. package/dist/holmes/governance/approval-queue.d.ts +7 -1
  11. package/dist/holmes/governance/approval-queue.js +10 -28
  12. package/dist/holmes/governance/autonomy.d.ts +3 -1
  13. package/dist/holmes/governance/autonomy.js +28 -2
  14. package/dist/holmes/governance/full-autonomy.d.ts +72 -0
  15. package/dist/holmes/governance/full-autonomy.js +308 -0
  16. package/dist/holmes/guardrail/operator-person.js +3 -2
  17. package/dist/holmes/guardrail/refusal-codes.js +13 -4
  18. package/dist/holmes/guardrail/run-refusals.js +7 -6
  19. package/dist/holmes/guardrail/write-target.js +4 -1
  20. package/dist/holmes/hooks/pre-tool-use.d.ts +2 -0
  21. package/dist/holmes/hooks/pre-tool-use.js +55 -10
  22. package/dist/holmes/hooks/stop.js +3 -3
  23. package/dist/holmes/mcp/elicit-approval.js +5 -6
  24. package/dist/holmes/mcp/handlers/approval-ask.js +4 -3
  25. package/dist/holmes/mcp/handlers/review-verdict.js +3 -2
  26. package/dist/holmes/mcp/handlers/spec-approval.d.ts +2 -0
  27. package/dist/holmes/mcp/handlers/spec-approval.js +23 -5
  28. package/dist/holmes/mcp/handlers.d.ts +2 -0
  29. package/dist/holmes/mcp/handlers.js +2 -1
  30. package/dist/holmes/mcp/operator-recovery.d.ts +7 -2
  31. package/dist/holmes/mcp/operator-recovery.js +15 -58
  32. package/dist/holmes/mcp/tool-schemas.js +1 -1
  33. package/package.json +1 -1
  34. package/playbooks/promote-slice/PLAYBOOK.md +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  <!-- @implements A-SPEC-209 -->
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.38.0] - 2026-10-22
11
+
12
+ Full autonomy mode, and no approval decided by a typed terminal command (REQ-792). Owner direction, 2026-10-22: "full, 100% self-driving mode must be supported", and "the lowest-grade approval UX — approving with a command in a terminal — must be zero".
13
+
14
+ ### Added
15
+ - **Full autonomy profile (A-SPEC-792.3, 792.4, 792.5, 792.7).** `holmes-kit autonomy full --scope <dir>` issues one user-level profile (`~/.holmes/full-autonomy.json`). Issuing it is the person's act, decided once in the session's approval form, and an agent can never issue it. Inside the scope, no judgment waits for a person:
16
+ - **Spec seals.** A seal the grader hands to a person seals with actor `full-autonomy:`. Three rules are refused at once, each naming the step that needs no person: a REQ never admitted through triage, an undeclared `breaking_change`, and an unknown kind. The owner's `autonomy.ceiling` still binds.
17
+ - **Shell acts.** A workspace-local destructive git act (`reset --hard`, `clean -f`, `restore .`, `branch -D`) or an `rm -rf` inside the scope or the scratch root is approved only after a restorable recovery point is written under `refs/holmes/full/`. If that point cannot be written, the act is refused.
18
+ - **Everything else** — acts outside the scope, `cd` or `-C` elsewhere, secrets and environment reads, config, approval or ledger writes, and push or publish unless the profile allows them — is refused at once with a route. Nothing is queued, so a headless run never waits for a person. The refusal's `[holmes-refusal]` line names `full-autonomy.refused` (class `permanent`), so an orchestrator changes its plan instead of pausing for a person or calling `approval_ask` for a request that does not exist (A-SPEC-792.8).
19
+ - **Measured.** G0 round 5 ran 6 headless Holmes runs (Claude Code, Haiku) under one profile. It filed 0 approval requests, and no run waited.
20
+ - **Flags.** `--allow-push` and `--allow-publish` are off by default. `--no-architecture` keeps architecture documents with the owner.
21
+ - **Revoking.** `--revoke` needs no proof.
22
+ - **Visibility.** `autonomy status`, `doctor` and the session banner name an active profile.
23
+
24
+ ### Changed
25
+ - **No agent-facing text tells a person to type an approval command (A-SPEC-792.1).** Thirteen places named `approve --grant … --target …`: refusals, MCP recovery hints, approval_ask's own refusal, the run wait, refusal codes, form notices, Stop lines and the promote-slice playbook. Each now names `approval_ask` with the request id, and a static census pins zero. The `approve` CLI remains the operator's tool.
26
+ - **A shell grant lasts until it is used (A-SPEC-792.2).** It still covers only the exact command, in the workspace where it was minted, once. A command granted again after a spent grant gets a fresh nonce (`<id>.r<n>`) instead of a replay refusal.
27
+
10
28
  ## [0.37.2] - 2026-10-22
11
29
 
12
30
  Three approval-UX fixes found by the SDLC comparison's feasibility gate (G0). In G0 round 1, headless Claude Code agents in Holmes workspaces filed 11 approval requests. One of them ended a run waiting for a person who was never coming, so the run changed no code. With these fixes, rounds 2 and 3 had no run blocked by an approval.
package/README.md CHANGED
@@ -9,8 +9,8 @@
9
9
  <!-- holmes-kit:attest:begin -->
10
10
  ![traced files](.ax/badges/traced.svg)
11
11
 
12
- **474/474** source files (100%) trace to an approved spec · **945/1021** approved A-SPECs (92.5%) are anchored from code.
13
- Measured at `1d8fd9d2ab01` (specs `sha256:7cc2b555ea49`) — reproduce with `holmes-kit attest --exclude docs/goals/probes/`.
12
+ **475/475** source files (100%) trace to an approved spec · **954/1030** approved A-SPECs (92.6%) are anchored from code.
13
+ Measured at `622ce26a4958` (specs `sha256:35b66c9f8ccd`) — reproduce with `holmes-kit attest --exclude docs/goals/probes/`.
14
14
  <!-- holmes-kit:attest:end -->
15
15
 
16
16
  ---
@@ -22,6 +22,15 @@ Measured at `1d8fd9d2ab01` (specs `sha256:7cc2b555ea49`) — reproduce with `hol
22
22
  ---
23
23
 
24
24
  ### 🛡️ Currently Supported Features (Production Features)
25
+ - **Full autonomy mode — no judgment waits for a person, and no approval is typed in a terminal** *(new in 0.38.0)*:
26
+ - **Issuing.** `holmes-kit autonomy full --scope <dir>` issues a user-level profile. The person decides it once, in the session's approval form, and an agent can never issue it.
27
+ - **Inside the scope**, every judgment ends at once:
28
+ - A seal the grader hands to a person seals as `full-autonomy:`. An un-admitted REQ or an undeclared or unknown grade is refused, and the refusal names its fix.
29
+ - A workspace-local destructive git act, or an `rm -rf` inside the scope, passes after a restorable recovery point is written under `refs/holmes/full/`.
30
+ - Everything else is refused with a route and never queued: secrets, config, approval or ledger writes, acts outside the scope, and push or publish unless the profile allows them. A headless benchmark run never waits on a person.
31
+ - **Revoking.** `--revoke` ends the profile.
32
+ - **Typed commands are gone.** No refusal, hint, form or playbook names a typed `approve --grant` any more. The agent calls `approval_ask` with the id.
33
+ - **Shell grants** last until they are used.
25
34
  - **Approvals happen in the session, not in a separate terminal** *(new in 0.37.0 — security fix, upgrade recommended)*: a refusal now ends with `Agent: call approval_ask with id "req-…"`. The MCP tool `approval_ask` shows that request in the harness's approval form, and the person's answer is recorded exactly as `holmes-kit approve` records it. That covers shell, config and code-write approvals (on Claude Code today; Codex and Antigravity are a named gap until measured) and a request a run awaits. `review_verdict` records an independent review verdict the same way. The form waits for the person (no 240-second limit). An agent's own shell, and the session's `!`, can no longer run `approve --grant`, `--watch` or `autonomy on`: through 0.36.1 an agent could approve its own refused command by running the command its refusal printed.
26
35
  - **An orchestrator can run governed agents, and reviews become gates** *(new in 0.36.0)*: `holmes-kit run start --worktree <dir> --engine claude|codex|agy [--scope <A-SPEC>]…` opens a run that pins the CLI, MCP and hook builds, prints the headless command and a stop key, and ends only with that key (`run status`, `run transition`, `run stop`). Inside a run every judgement fails closed: agent launches are refused, refusals are logged with a repeat stop, an approval pauses the run until the operator decides it in a terminal, a declared stage machine (analysis → design → implement → review → test → done) denies writes per stage, and Stop and push wait for an independent passing review. `holmes-kit review record|status|gate|mrp` records verdicts bound to a commit range, refuses self-review (an agent-harness ancestor process included), and assembles the merge-ready package. Every deny ends with a `[holmes-refusal]` line carrying a stable code. A project can cap its semantic tier (`semantic.maxTier`) and its automatic approval (`autonomy.ceiling`) in `ax.config.json`, and only an approval can raise either. doctor counts cloud embedding requests. `approve --withdraw` lets a run close its own request. Interactive sessions keep 0.35.25 verdicts, except for the gate holes this release closes: path-less spec staging, computed shell writes, executable files and side paths under a role policy, and Claude Code's PowerShell tool on Windows. Interactive agent launches may carry the autonomy options measured to keep the child's Holmes gate. This is an interim release of the role/phase goal: the acceptance scenario with a reference orchestrator has not been run yet.
27
36
 
@@ -316,6 +325,7 @@ flowchart LR
316
325
  | `holmes-kit doctor --target <root> --registry <bindings.json>` | Diagnose the same operator registry used by custom routing installations |
317
326
  | `holmes-kit autonomy status` | Show the current autonomous-approval posture (project default + session envelope) |
318
327
  | `holmes-kit autonomy on --for 2h` | Self-drive low-risk specs for this session only (expiring; needs a TTY or `HOLMES_APPROVAL`) |
328
+ | `holmes-kit autonomy full --scope <dir>` | Full autonomy inside `<dir>` (decided once in the session approval form): no judgment there waits for a person; `--allow-push`, `--allow-publish`, `--no-architecture`; `--revoke` ends it |
319
329
  | `holmes-kit autonomy off` | End session autonomy immediately; if the project default in `.mcp.json` still keeps autonomy on, it says so and exits 1 instead of claiming OFF |
320
330
  | `holmes-kit semantic-setup` | Download and verify the local `bge-m3` model (retry/recovery; shared across projects) |
321
331
  | `holmes-kit semantic-check` | Verify local inference **offline**, without downloading anything |
package/dist/.build-id CHANGED
@@ -1 +1 @@
1
- 40e7e026-mvibagi4
1
+ 06fb6baa-mvj2vrie
@@ -87,10 +87,11 @@ function statusContext(root, now = new Date().toISOString()) {
87
87
  delegation = { mode: 'off' };
88
88
  }
89
89
  const liveGrants = new Set();
90
+ // @implements A-SPEC-792.2 — a re-grant's nonce is `<id>.r<n>`; it is live for request `<id>`.
90
91
  try {
91
92
  for (const g of (0, approval_grants_1.readGrants)(root).grants)
92
93
  if (typeof g.nonce === 'string')
93
- liveGrants.add(g.nonce);
94
+ liveGrants.add(g.nonce.replace(/\.r\d+$/, ''));
94
95
  }
95
96
  catch { /* no grants dir */ }
96
97
  return { now, workspace, delegation, liveGrants };
@@ -49,7 +49,7 @@ exports.decisionDetail = decisionDetail;
49
49
  exports.renderRefusals = renderRefusals;
50
50
  exports.renderNonTtyHint = renderNonTtyHint;
51
51
  exports.runInteractive = runInteractive;
52
- // @implements A-SPEC-246, A-SPEC-626, A-SPEC-532.5, A-SPEC-770.3, A-SPEC-770.6, A-SPEC-770.12, A-SPEC-779.2
52
+ // @implements A-SPEC-246, A-SPEC-626, A-SPEC-532.5, A-SPEC-770.3, A-SPEC-770.6, A-SPEC-770.12, A-SPEC-779.2, A-SPEC-792.2
53
53
  // @implements A-SPEC-549.4 — renderPending and renderNonTtyHint in this file are the English CLI
54
54
  // surface the Hangul-absence guard reads.
55
55
  const execution_context_1 = require("../project/execution-context");
@@ -171,6 +171,21 @@ const TAMPERED = ['queue record is not self-consistent — id is not derived fro
171
171
  function recordIsSelfConsistent(entry) {
172
172
  return entry.id === (0, approval_queue_1.approvalRequestId)(entry.kind, entry.target);
173
173
  }
174
+ /**
175
+ * @implements A-SPEC-792.2 — the request id is the nonce while it is unspent; a second decision for the same act takes
176
+ * `<id>.r<n>`, so it is not refused as a replay of the first (measured 2026-10-21/22: a spec `git add` granted twice).
177
+ * The suffix keeps the request id readable in the ledger and in `approve --status`.
178
+ */
179
+ function freshNonce(root, id) {
180
+ const { FileLedgerStore } = require('../governance/ledger-store');
181
+ const ledger = new FileLedgerStore(path.join(root, '.ax', 'ledger'));
182
+ if (!ledger.isNonceConsumed(id))
183
+ return id;
184
+ for (let n = 1; n <= 1000; n++)
185
+ if (!ledger.isNonceConsumed(`${id}.r${n}`))
186
+ return `${id}.r${n}`;
187
+ return null;
188
+ }
174
189
  function grantRequest(root, id, opts) {
175
190
  const ttl = opts.ttlMinutes ?? exports.DEFAULT_TTL_MINUTES;
176
191
  if (typeof ttl !== 'number' || !Number.isFinite(ttl) || !Number.isInteger(ttl) || ttl <= 0 || ttl > MAX_TTL_MINUTES) {
@@ -181,7 +196,10 @@ function grantRequest(root, id, opts) {
181
196
  // expire by time; it ends when it is used, revoked, or the content changes (the subject no longer matches). Measured
182
197
  // 2026-10-04: five seal grants expired unused after 30 minutes. An explicit --ttl still bounds it; a request without
183
198
  // a subject keeps the default, because there the clock is all that stands between the decision and a changed act.
184
- const untilUsed = opts.ttlMinutes === undefined && typeof entry?.subject === 'string' && entry.subject !== '';
199
+ // @implements A-SPEC-792.2 — a shell grant's scope is the exact command text, so a different act already has a
200
+ // different id: the clock only re-asked the person about the identical act (field report 2026-10-22).
201
+ const untilUsed = opts.ttlMinutes === undefined
202
+ && ((typeof entry?.subject === 'string' && entry.subject !== '') || entry?.kind === 'shell');
185
203
  if (!entry)
186
204
  return { ok: false, reason: `no pending request ${(0, screen_safe_1.rowField)(id, 40)} — check with ${(0, npx_bin_1.holmesKitCommand)(root)} approve --list` };
187
205
  if (!recordIsSelfConsistent(entry))
@@ -192,6 +210,9 @@ function grantRequest(root, id, opts) {
192
210
  // second guard is not defence in depth, it is a line nobody can prove still works (round-3
193
211
  // mutation test: neutering it left the suite green).
194
212
  const expires = untilUsed ? approval_grants_1.GRANT_NO_EXPIRY : new Date(Date.now() + ttl * 60_000).toISOString();
213
+ const nonce = freshNonce(root, id);
214
+ if (nonce === null)
215
+ return { ok: false, reason: `request ${(0, screen_safe_1.rowField)(id, 40)} has been granted and spent too many times — file a new request` };
195
216
  // @implements A-SPEC-649 — the grant names WHERE it was minted and WHAT the operator read, so a
196
217
  // copy in another clone and a seal of changed content are refused by name (measured 2026-09-14:
197
218
  // both were accepted). A legacy workspace has no id to name; a request filed without a subject
@@ -222,7 +243,7 @@ function grantRequest(root, id, opts) {
222
243
  expires,
223
244
  // Stated, never implied by a missing field: a file that merely lacks an expiry is not a grant (isNarrow).
224
245
  ...(untilUsed ? { lifetime: 'until-used' } : {}),
225
- nonce: id,
246
+ nonce,
226
247
  };
227
248
  // @implements A-SPEC-262.1 — AUDIT AND AUTHORITY STAND OR FALL TOGETHER.
228
249
  // Round-3 wrote the grant first and discarded the append's failure: a live nonce with no record.
@@ -1,3 +1,4 @@
1
+ import { FullProfileFlags } from '../governance/full-autonomy';
1
2
  import { Approval } from '../guardrail/risk-gate';
2
3
  /** `--for` accepts `2h` / `90m` / `7d` / a bare number of hours. Minutes, capped at 7 days (like grants);
3
4
  * null on a malformed value; default 2h when omitted. */
@@ -7,6 +8,10 @@ export interface AutonomyIO {
7
8
  isTTY: boolean;
8
9
  approval?: Approval;
9
10
  env?: NodeJS.ProcessEnv;
11
+ /** @implements A-SPEC-792.7 — the home whose full autonomy profile `status` reports (default os.homedir()). */
12
+ home?: string;
13
+ /** Internal: `status` without the full-profile line (the posture line it is followed by). */
14
+ postureOnly?: boolean;
10
15
  }
11
16
  /** @implements A-SPEC-771 — the delegation subcommand's own inputs, parsed by the CLI entry and passed through. */
12
17
  export interface AutonomyExtra {
@@ -62,6 +67,29 @@ export declare function autonomyGrantGate(input: {
62
67
  now: string;
63
68
  envApproval?: Approval;
64
69
  }, deps: AutonomyGrantDeps): AutonomyGrantVerdict;
70
+ /** @implements A-SPEC-792.3 — the flags are the request's subject, so a grant for one set cannot issue another. */
71
+ export declare function fullProfileSubject(flags: FullProfileFlags): string;
72
+ /**
73
+ * @implements A-SPEC-792.3 — may `autonomy full --scope` write the entry? The same order as `autonomyGrantGate`
74
+ * (A-SPEC-718.7): a covering approval (the session form's grant), a person's own terminal, otherwise a request the
75
+ * session form decides. The scope's real path is the target, so the request names exactly what it would open.
76
+ */
77
+ export declare function fullProfileGate(input: {
78
+ scope: string;
79
+ askRoot: string;
80
+ flags: FullProfileFlags;
81
+ now: string;
82
+ envApproval?: Approval;
83
+ }, deps: AutonomyGrantDeps): AutonomyGrantVerdict;
84
+ /** @implements A-SPEC-792.3 — write or revoke an entry once the gate (issue) has passed; revoking needs no proof. */
85
+ export declare function runAutonomyFull(home: string, args: {
86
+ scope: string;
87
+ flags?: FullProfileFlags;
88
+ revoke: boolean;
89
+ }, io: {
90
+ now: string;
91
+ actor: string;
92
+ }): AutonomyResult;
65
93
  /** @implements A-SPEC-718.7 — the posture `autonomy status` reports, never coloured by the caller's own environment. */
66
94
  export declare function autonomyPostureLine(root: string, now: string): string;
67
95
  /**
@@ -35,13 +35,18 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.parseForMinutes = parseForMinutes;
37
37
  exports.autonomyGrantGate = autonomyGrantGate;
38
+ exports.fullProfileSubject = fullProfileSubject;
39
+ exports.fullProfileGate = fullProfileGate;
40
+ exports.runAutonomyFull = runAutonomyFull;
38
41
  exports.autonomyPostureLine = autonomyPostureLine;
39
42
  exports.runAutonomy = runAutonomy;
40
- // @implements A-SPEC-553.1, A-SPEC-553.2, A-SPEC-771, A-SPEC-718.7
43
+ // @implements A-SPEC-553.1, A-SPEC-553.2, A-SPEC-771, A-SPEC-718.7, A-SPEC-792.3, A-SPEC-792.7
41
44
  const fs = __importStar(require("node:fs"));
45
+ const full_autonomy_1 = require("../governance/full-autonomy");
46
+ const autonomy_1 = require("../governance/autonomy");
42
47
  const path = __importStar(require("node:path"));
43
48
  const risk_gate_1 = require("../guardrail/risk-gate");
44
- const autonomy_1 = require("../governance/autonomy");
49
+ const autonomy_2 = require("../governance/autonomy");
45
50
  const delegation_1 = require("../governance/delegation");
46
51
  const PROJECT_DEFAULT_ON = 'autonomous spec approval: ON (project default, .mcp.json) — governance-critical still ask you. '
47
52
  + 'Turn it off by removing HOLMES_AUTONOMOUS_APPROVAL from .mcp.json (or holmes-kit init --no-autonomy).';
@@ -112,6 +117,49 @@ function autonomyGrantGate(input, deps) {
112
117
  const id = (0, approval_queue_1.approvalRequestId)(action.kind, action.target);
113
118
  return { proceed: false, id, message: `${why}${(0, approval_queue_1.pendingRequestLine)(id, action.kind, input.askRoot, title, input.root)}` };
114
119
  }
120
+ /** @implements A-SPEC-792.3 — the flags are the request's subject, so a grant for one set cannot issue another. */
121
+ function fullProfileSubject(flags) {
122
+ return `push=${flags.push ? 1 : 0};publish=${flags.publish ? 1 : 0};architecture=${flags.architecture ? 1 : 0}`;
123
+ }
124
+ /**
125
+ * @implements A-SPEC-792.3 — may `autonomy full --scope` write the entry? The same order as `autonomyGrantGate`
126
+ * (A-SPEC-718.7): a covering approval (the session form's grant), a person's own terminal, otherwise a request the
127
+ * session form decides. The scope's real path is the target, so the request names exactly what it would open.
128
+ */
129
+ function fullProfileGate(input, deps) {
130
+ const action = { kind: 'autonomy-profile', target: input.scope, subject: fullProfileSubject(input.flags) };
131
+ const covering = deps.resolve(input.askRoot, input.envApproval, action, input.now);
132
+ if (covering !== undefined) {
133
+ const nonce = covering.approval.nonce;
134
+ return { proceed: true, approval: covering.approval, ...(covering.source === 'grant' && typeof nonce === 'string' ? { spend: nonce } : {}) };
135
+ }
136
+ const why = deps.guard();
137
+ if (why === null)
138
+ return { proceed: true };
139
+ const title = `full autonomy for ${input.scope} (${action.subject})`;
140
+ deps.enqueue(input.askRoot, { ...action, why: `no judgment under ${input.scope} waits for a person (${action.subject})`, title });
141
+ const id = (0, approval_queue_1.approvalRequestId)(action.kind, action.target);
142
+ return { proceed: false, id, message: `${why}${(0, approval_queue_1.pendingRequestLine)(id, action.kind, input.askRoot, title, input.scope)}` };
143
+ }
144
+ /** @implements A-SPEC-792.3 — write or revoke an entry once the gate (issue) has passed; revoking needs no proof. */
145
+ function runAutonomyFull(home, args, io) {
146
+ if (args.revoke) {
147
+ const n = (0, full_autonomy_1.removeFullProfileEntry)(home, args.scope === '' ? undefined : args.scope);
148
+ return { ok: true, exitCode: 0, message: n > 0 ? `full autonomy revoked (${n} scope${n === 1 ? '' : 's'})` : 'full autonomy: nothing to revoke' };
149
+ }
150
+ let scope;
151
+ try {
152
+ scope = fs.realpathSync.native(args.scope);
153
+ }
154
+ catch {
155
+ return { ok: false, exitCode: 2, message: `--scope ${args.scope} does not exist` };
156
+ }
157
+ if (!fs.statSync(scope).isDirectory())
158
+ return { ok: false, exitCode: 2, message: `--scope ${args.scope} is not a directory` };
159
+ const flags = args.flags ?? { push: false, publish: false, architecture: true };
160
+ (0, full_autonomy_1.addFullProfileEntry)(home, { scope, flags, issuedAt: io.now, issuedBy: io.actor });
161
+ return { ok: true, exitCode: 0, message: `full autonomy: ON for ${scope} (${fullProfileSubject(flags)}) — no judgment there waits for a person` };
162
+ }
115
163
  /** @implements A-SPEC-718.7 — the posture `autonomy status` reports, never coloured by the caller's own environment. */
116
164
  function autonomyPostureLine(root, now) {
117
165
  return runAutonomy(root, 'status', undefined, { now, isTTY: false, env: {} }).message;
@@ -124,20 +172,26 @@ function autonomyPostureLine(root, now) {
124
172
  */
125
173
  function runAutonomy(root, sub, forStr, io, extra = {}) {
126
174
  const env = io.env ?? process.env;
127
- const markerPath = path.join(root, ...autonomy_1.SESSION_AUTONOMY_MARKER);
175
+ const markerPath = path.join(root, ...autonomy_2.SESSION_AUTONOMY_MARKER);
128
176
  if (sub === undefined || sub === 'status') {
177
+ // @implements A-SPEC-792.7 — an active full profile is named first; the posture line follows unchanged.
178
+ const full = io.postureOnly ? '' : (0, autonomy_1.fullAutonomyLine)(root, io.home);
179
+ if (full !== '') {
180
+ const rest = runAutonomy(root, sub, forStr, { ...io, postureOnly: true }, extra);
181
+ return { ...rest, message: `${full}\n${rest.message}` };
182
+ }
129
183
  // @implements A-SPEC-771 — an active run delegation is reported beside whichever posture is on.
130
184
  const delegationLine = delegationStatusLine(root, io.now);
131
185
  const withDelegation = (message) => delegationLine === null ? message : `${message}\n${delegationLine}`;
132
- const envOn = typeof env[autonomy_1.AUTONOMY_ENV] === 'string' && env[autonomy_1.AUTONOMY_ENV] !== '';
186
+ const envOn = typeof env[autonomy_2.AUTONOMY_ENV] === 'string' && env[autonomy_2.AUTONOMY_ENV] !== '';
133
187
  if (envOn)
134
188
  return { ok: true, exitCode: 0, message: withDelegation('autonomous spec approval: ON (project default, .mcp.json) — governance-critical still ask you') };
135
189
  // @implements A-SPEC-553.2 — the same project default the server and the session banner read
136
190
  // (A-SPEC-560.2). The CLI read only the shell environment, which never carries .mcp.json's env, and
137
191
  // answered OFF while the server sealed specs autonomously.
138
- if ((0, autonomy_1.projectDefaultAutonomy)(root))
192
+ if ((0, autonomy_2.projectDefaultAutonomy)(root))
139
193
  return { ok: true, exitCode: 0, message: withDelegation(PROJECT_DEFAULT_ON) };
140
- if ((0, autonomy_1.sessionAutonomyActive)(root, io.now)) {
194
+ if ((0, autonomy_2.sessionAutonomyActive)(root, io.now)) {
141
195
  let expires = '';
142
196
  try {
143
197
  expires = String(JSON.parse(fs.readFileSync(markerPath, 'utf8')).expires);
@@ -186,8 +240,8 @@ function runAutonomy(root, sub, forStr, io, extra = {}) {
186
240
  }
187
241
  // @implements A-SPEC-553.2 — the emergency control never reports a de-escalation that did not happen
188
242
  // (A-SPEC-558.1): with the project default (or the environment switch) still on, autonomy is still ON.
189
- const envStillOn = typeof env[autonomy_1.AUTONOMY_ENV] === 'string' && env[autonomy_1.AUTONOMY_ENV] !== '';
190
- if (envStillOn || (0, autonomy_1.projectDefaultAutonomy)(root)) {
243
+ const envStillOn = typeof env[autonomy_2.AUTONOMY_ENV] === 'string' && env[autonomy_2.AUTONOMY_ENV] !== '';
244
+ if (envStillOn || (0, autonomy_2.projectDefaultAutonomy)(root)) {
191
245
  return { ok: false, exitCode: 1, message: 'session autonomy ended, but autonomous spec approval is still ON: the project default in .mcp.json '
192
246
  + '(HOLMES_AUTONOMOUS_APPROVAL) keeps it on — remove it from .mcp.json (or holmes-kit init --no-autonomy) to turn it off.' };
193
247
  }
@@ -37,7 +37,7 @@ exports.isBrokenPipe = void 0;
37
37
  exports.packageRoot = packageRoot;
38
38
  exports.main = main;
39
39
  exports.installPipeGuard = installPipeGuard;
40
- // @implements A-SPEC-704, A-SPEC-773, A-SPEC-770.11,A-SPEC-709, A-SPEC-734,A-SPEC-751, A-SPEC-752, A-SPEC-772.4, A-SPEC-779, A-SPEC-102.2, A-SPEC-774.20, A-SPEC-102.7, A-SPEC-779.2
40
+ // @implements A-SPEC-704, A-SPEC-773, A-SPEC-770.11,A-SPEC-709, A-SPEC-734,A-SPEC-751, A-SPEC-752, A-SPEC-772.4, A-SPEC-779, A-SPEC-102.2, A-SPEC-774.20, A-SPEC-102.7, A-SPEC-779.2, A-SPEC-792.3
41
41
  // @implements A-SPEC-549.2
42
42
  // @implements A-SPEC-591, A-SPEC-626
43
43
  const cli_execution_1 = require("./cli-execution");
@@ -81,7 +81,7 @@ const KNOWN_FLAGS = {
81
81
  'runtime-binding': ['help', 'workspace', 'package', 'release-package', 'registry', 'dry-run', 'activate-hooks'],
82
82
  guidance: ['help', 'target', 'dry-run'],
83
83
  init: ['help', 'target', 'mode', 'specs-dir', 'settings', 'matcher', 'dry-run', 'no-mcp', 'remove', 'force', 'agent', 'mcp-launcher', 'autonomy', 'no-autonomy'],
84
- autonomy: ['help', 'target', 'for', 'run', 'allow', 'limit', 'rationale'], // @implements A-SPEC-771.1 — the run delegation's flags
84
+ autonomy: ['help', 'target', 'for', 'run', 'allow', 'limit', 'rationale', 'scope', 'revoke', 'allow-push', 'allow-publish', 'no-architecture'], // @implements A-SPEC-771.1 — the run delegation's flags; A-SPEC-792.3 — the full profile's
85
85
  doctor: ['help', 'target', 'json', 'agent', 'registry'],
86
86
  // @implements A-SPEC-702 — a statement, not a gate: how many source files trace to an approved spec.
87
87
  attest: ['help', 'target', 'exclude', 'json', 'badge', 'readme'],
@@ -136,7 +136,7 @@ class UnknownFlagError extends Error {
136
136
  // A-SPEC-251.1 (round 26): `yes` — `upgrade --yes` was refused as "--yes requires a value", so the non-interactive
137
137
  // upgrade its own guidance names could not run (measured).
138
138
  // A-SPEC-774.24: --accept-unknown-versions names its fields, so it is a value flag, not one of these.
139
- const BOOLEAN_FLAGS = new Set(['badge', 'readme', 'help', 'dry-run', 'no-mcp', 'remove', 'force', 'json', 'list', 'status', 'watch', 'autonomy', 'no-autonomy', 'yes']); // A-SPEC-650: --status
139
+ const BOOLEAN_FLAGS = new Set(['badge', 'readme', 'help', 'dry-run', 'no-mcp', 'remove', 'force', 'json', 'list', 'status', 'watch', 'autonomy', 'no-autonomy', 'yes', 'allow-push', 'allow-publish', 'no-architecture']); // `--revoke` stays a value flag: `approve --revoke <id>` // A-SPEC-650: --status
140
140
  /** @implements A-SPEC-770.11 — value flags whose value may be omitted; the handler supplies the default. */
141
141
  const OPTIONAL_VALUE_FLAGS = new Set(['refusals']);
142
142
  /** @implements A-SPEC-771.1 — value flags that may be given more than once. */
@@ -371,7 +371,7 @@ async function main(argv) {
371
371
  // silently wrote into CWD while the named target stayed stale (round-3 HIGH).
372
372
  const expected = cmd === 'runtime-binding' ? ['setup', 'status', 'remove'] : cmd === 'guidance' ? ['check', 'refresh'] : cmd === 'skills' ? ['refresh'] : cmd === 'ledger' ? ['rechain']
373
373
  : cmd === 'semantic-key' ? ['set', 'unset', 'status']
374
- : cmd === 'autonomy' ? ['status', 'on', 'off', 'delegate', 'revoke-delegation'] // @implements A-SPEC-771.1
374
+ : cmd === 'autonomy' ? ['status', 'on', 'off', 'delegate', 'revoke-delegation', 'full'] // @implements A-SPEC-771.1, A-SPEC-792.3
375
375
  : cmd === 'roles' ? ['migrate'] // @implements A-SPEC-774.10
376
376
  : cmd === 'run' ? ['start', 'status', 'stop', 'transition'] // @implements A-SPEC-774.17, A-SPEC-781
377
377
  : cmd === 'review' ? ['record', 'status', 'gate', 'mrp'] : []; // @implements A-SPEC-102.2, A-SPEC-102.6
@@ -481,6 +481,61 @@ async function main(argv) {
481
481
  let effective = approval;
482
482
  let spend;
483
483
  const minutes = sub === 'on' ? parseForMinutes(forStr) : null;
484
+ if (sub === 'full') {
485
+ // @implements A-SPEC-792.3 — the full profile: issued through the session form (the autonomyGrantGate order),
486
+ // revoked freely. It is user-level, so the home directory holds it, whatever workspace asked.
487
+ const { fullProfileGate, runAutonomyFull } = require('./autonomy');
488
+ const os4 = require('node:os');
489
+ const home = os4.homedir();
490
+ const rawScope = str('scope');
491
+ const scopeArg = rawScope === undefined ? '' : rawScope.replace(/^~(?=$|\/)/, home);
492
+ // `--revoke` alone, `--revoke <scope>` or `--revoke --scope <scope>` (it is a value flag shared with approve).
493
+ if (flags.revoke !== undefined) {
494
+ const revokeScope = typeof flags.revoke === 'string' ? flags.revoke.replace(/^~(?=$|\/)/, home) : scopeArg;
495
+ const r = runAutonomyFull(home, { scope: revokeScope, revoke: true }, { now, actor: approval?.actor ?? 'operator' });
496
+ process[r.ok ? 'stdout' : 'stderr'].write(`${r.message}\n`);
497
+ return r.exitCode;
498
+ }
499
+ if (scopeArg === '') {
500
+ process.stderr.write('autonomy full needs --scope <path> (or --revoke)\n');
501
+ return 2;
502
+ }
503
+ let scope;
504
+ try {
505
+ scope = fs.realpathSync.native(scopeArg);
506
+ }
507
+ catch {
508
+ process.stderr.write(`--scope ${scopeArg} does not exist\n`);
509
+ return 2;
510
+ }
511
+ const fullFlags = { push: flags['allow-push'] === true, publish: flags['allow-publish'] === true, architecture: flags['no-architecture'] !== true };
512
+ const { resolveApproval } = require('../governance/approval-grants');
513
+ const { enqueueApprovalRequest } = require('../governance/approval-queue');
514
+ const { resolveProjectRoot } = require('../project/root');
515
+ let askRoot = root;
516
+ try {
517
+ const p = resolveProjectRoot(process.cwd());
518
+ if (p.marker === '.ax')
519
+ askRoot = p.root;
520
+ }
521
+ catch { /* the target's own project */ }
522
+ const v = fullProfileGate({ scope, askRoot, flags: fullFlags, now, envApproval: approval }, {
523
+ guard: () => operatorActGuard('issuing a full autonomy profile'),
524
+ resolve: (r, env, action, n) => resolveApproval(r, env, action, n),
525
+ enqueue: (r, req) => { enqueueApprovalRequest(r, req); },
526
+ });
527
+ if (!v.proceed) {
528
+ process.stderr.write(`${withRefusalLine(v.message)}\n`);
529
+ return 2;
530
+ }
531
+ const r = runAutonomyFull(home, { scope, flags: fullFlags, revoke: false }, { now, actor: v.approval?.actor ?? 'operator' });
532
+ if (r.ok && v.spend !== undefined) {
533
+ const { consumeGrantFile } = require('../governance/approval-grants');
534
+ consumeGrantFile(askRoot, v.spend);
535
+ }
536
+ process[r.ok ? 'stdout' : 'stderr'].write(`${r.message}\n`);
537
+ return r.exitCode;
538
+ }
484
539
  if (sub === 'on' && minutes !== null) {
485
540
  // @implements A-SPEC-718.7 — the person grants it in the session form: a refused `on` files an autonomy-grant
486
541
  // request in the asking session's project (where approval_ask finds it), and the retry spends the grant.
@@ -35,9 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.runtimePlanDigest = runtimePlanDigest;
37
37
  exports.applyApprovedRuntimePlan = applyApprovedRuntimePlan;
38
- // @implements A-SPEC-752, A-SPEC-752.14, A-SPEC-770.3, A-SPEC-770.6
38
+ // @implements A-SPEC-752, A-SPEC-752.14, A-SPEC-770.3, A-SPEC-770.6, A-SPEC-792.1
39
39
  const path = __importStar(require("node:path"));
40
- const npx_bin_1 = require("../project/npx-bin");
41
40
  const node_crypto_1 = require("node:crypto");
42
41
  const risk_gate_1 = require("../guardrail/risk-gate");
43
42
  const approval_grants_1 = require("../governance/approval-grants");
@@ -83,7 +82,7 @@ function applyApprovedRuntimePlan(root, subject, envApproval, check, apply, appr
83
82
  const id = (0, approval_queue_1.approvalRequestId)(action.kind, target);
84
83
  if (result.reason !== 'written' && result.reason !== 'duplicate')
85
84
  throw new Error(`Cannot queue governance-wiring approval: ${result.reason}; nothing installed`);
86
- throw new Error(`governance-wiring approval required for plan ${subject}; request ${id}. In ${approvalRoot === root ? 'this workspace' : `the workspace ${approvalRoot}`} run ${(0, npx_bin_1.holmesKitCommand)(approvalRoot)} approve --list, then ${(0, npx_bin_1.holmesKitCommand)(approvalRoot)} approve --grant ${id} and retry the same runtime-binding command. If an old decision remains, revoke it and retry to request the current plan.`);
85
+ throw new Error(`governance-wiring approval required for plan ${subject}; request ${id}. In ${approvalRoot === root ? 'this workspace' : `the workspace ${approvalRoot}`} the person approves request ${id} in a session's approval form (approval_ask with id "${id}"), then retry the same runtime-binding command. If an old decision remains, revoke it and retry to request the current plan.`);
87
86
  };
88
87
  check();
89
88
  if (!resolve())
@@ -29,7 +29,13 @@ export declare const DECISION_KINDS: ReadonlySet<string>;
29
29
  * without a title (A-SPEC-770.1's bytes). Every field is flattened and bounded and loses `]`, so the bracket closes once.
30
30
  */
31
31
  export declare function requestLabel(kind: string | undefined, target: string | undefined, title: string | undefined): string;
32
- export declare function pendingRequestLine(id: string, kind?: string, root?: string, title?: string, target?: string): string;
32
+ /**
33
+ * @implements A-SPEC-792.1 — the header and the in-session route only. The `운영자: … approve --grant <id> --target …`
34
+ * clause (A-SPEC-770, 770.1, 770.2) is gone: an agent relayed it verbatim and the person typed it in a terminal
35
+ * (field report 2026-10-22), the UX REQ-792 removes. The request id still names the workspace's queue entry, and the
36
+ * approve CLI still finds it by id; nothing tells a person to type it.
37
+ */
38
+ export declare function pendingRequestLine(id: string, kind?: string, _root?: string, title?: string, target?: string): string;
33
39
  /**
34
40
  * @implements A-SPEC-718.5 — the in-session route, addressed to the agent: since A-SPEC-779.4 neither the agent's shell
35
41
  * nor the session's `!` can type the operator line above, so without this line an agent has no way to ask.
@@ -56,7 +56,6 @@ const execution_context_1 = require("../project/execution-context");
56
56
  const run_mode_1 = require("./run-mode");
57
57
  const root_1 = require("../project/root");
58
58
  const node_crypto_1 = require("node:crypto");
59
- const npx_bin_1 = require("../project/npx-bin");
60
59
  const fs = __importStar(require("node:fs"));
61
60
  const path = __importStar(require("node:path"));
62
61
  const screen_safe_1 = require("../cli/screen-safe");
@@ -110,26 +109,15 @@ function requestLabel(kind, target, title) {
110
109
  const f = (s, max) => (0, screen_safe_1.flattenField)(s, max).replace(/[\]「」]/g, ' ').trim();
111
110
  return ` · ${f(kind ?? '', 40)} ${f(target ?? '', 60)} 「${f(title, 80)}」`;
112
111
  }
113
- function pendingRequestLine(id, kind, root, title, target) {
112
+ /**
113
+ * @implements A-SPEC-792.1 — the header and the in-session route only. The `운영자: … approve --grant <id> --target …`
114
+ * clause (A-SPEC-770, 770.1, 770.2) is gone: an agent relayed it verbatim and the person typed it in a terminal
115
+ * (field report 2026-10-22), the UX REQ-792 removes. The request id still names the workspace's queue entry, and the
116
+ * approve CLI still finds it by id; nothing tells a person to type it.
117
+ */
118
+ function pendingRequestLine(id, kind, _root, title, target) {
114
119
  const label = requestLabel(kind, target, title); // @implements A-SPEC-770.12
115
- // @implements A-SPEC-770.3 — the version that issued the hint, past any older copy the bare npx command resolves first.
116
- const command = `${(0, npx_bin_1.holmesKitCommand)(root)} approve`; // A-SPEC-770.6 — the root the request is stored in
117
- // @implements A-SPEC-770.2 — the request lives in the refusal log / queue of the workspace whose hook refused, not in
118
- // the shell's cwd (measured 2026-10-12: a command run under a worktree filed its request in the development root;
119
- // 2026-10-13, Codex X1: the hint carried no `--target` at all). With a root, every command names it; a root with
120
- // white space is double-quoted once; a root is never folded or relativised. Without a root the A-SPEC-770.1 lines
121
- // are produced byte for byte.
122
- const targetFlag = root === undefined ? '' : ` --target ${/\s/.test(root) ? `"${root}"` : root}`;
123
- // @implements A-SPEC-770 — a request outside the decision inbox (A-SPEC-563.1 routes gate refusals to the local
124
- // refusal log) names the id-bearing command, because the bare command opens a screen that by design does not list
125
- // it. Field report (jarvis, 2026-10-11): the operator ran the bare command, saw six old inbox requests, and the
126
- // agent's shell command was refused again with the same id. A decision kind keeps the short line: it IS listed.
127
- // @implements A-SPEC-770.1 — the id rides the `--grant` flag: the CLI refuses a positional id (`unexpected
128
- // argument: req-…`, measured by the operator on 0.35.17 with the command this line used to name).
129
- if (kind !== undefined && !exports.DECISION_KINDS.has(kind)) {
130
- return `\n[승인 대기 ${id}${label}] 운영자: ${command} --grant ${id}${targetFlag} — 인박스 화면에는 뜨지 않는 거부입니다(${command} --refusals${targetFlag} 로 조회)${approvalAskLine(id)}`;
131
- }
132
- return root === undefined ? `\n[승인 대기 ${id}${label}] 운영자: ${command}${approvalAskLine(id)}` : `\n[승인 대기 ${id}${label}] 운영자: ${command} --grant ${id}${targetFlag}${approvalAskLine(id)}`;
120
+ return `\n[승인 대기 ${id}${label}]${approvalAskLine(id)}`;
133
121
  }
134
122
  /**
135
123
  * @implements A-SPEC-718.5 — the in-session route, addressed to the agent: since A-SPEC-779.4 neither the agent's shell
@@ -571,14 +559,8 @@ function queueHint(root, req, opts) {
571
559
  // template-owned margin; this producer, read by the operator AND relayed by the agent, never got
572
560
  // one. The first row keeps the template's own opening; the rest sit under the margin.
573
561
  const question = `\n[보류 — 운영자 질문: ${(0, screen_safe_1.flattenField)(held.question ?? '(질문 없음)', 300)}] 게이트는 닫혀 있습니다.`;
574
- if (opts?.reviewCommand) {
575
- // Fold only prose: inserted newlines/margins inside literal shell paths
576
- // would change the command the operator is being asked to execute.
577
- return (0, screen_safe_1.wrapColumns)(question + ' 이 질문에 대한 답을 사용자에게 보고하십시오. 결정은 운영자 승인 UI에서 내립니다.', 76, ' \u2502 ')
578
- + `\n운영자 검토: ${opts.reviewCommand}`;
579
- }
580
- return (0, screen_safe_1.wrapColumns)(question
581
- + ` 이 질문에 대한 답을 사용자에게 보고하십시오. 결정은 운영자가 ${(0, npx_bin_1.holmesKitCommand)(root)} approve 에서 내립니다.`, 76, ' \u2502 ');
562
+ // @implements A-SPEC-792.1 — the decision is the person's in the session form, never a command to type.
563
+ return (0, screen_safe_1.wrapColumns)(question + ' 이 질문에 대한 답을 사용자에게 보고하십시오. 결정은 세션 승인 창에서 내립니다 — 답을 받은 뒤 approval_ask 로 ' + id + ' 를 다시 물으십시오.', 76, ' \u2502 ');
582
564
  }
583
565
  const decided = state.decisions[id];
584
566
  const denialLine = decided?.event === 'denied'
@@ -61,7 +61,9 @@ export declare function sessionAutonomyActive(root: string, now: string): boolea
61
61
  * (A-SPEC-553.1). `root`/`now` are optional so env-only callers are byte-identical. */
62
62
  export declare function projectDefaultAutonomy(root: string): boolean;
63
63
  export declare function autonomousApprovalEnabled(env: NodeJS.ProcessEnv, root?: string, now?: string): boolean;
64
- export declare function autonomyBanner(env: NodeJS.ProcessEnv, root: string, now: string): string;
64
+ /** @implements A-SPEC-792.7 — the full profile covering `root`, as one line (without the banner prefix), or ''. */
65
+ export declare function fullAutonomyLine(root: string, home?: string): string;
66
+ export declare function autonomyBanner(env: NodeJS.ProcessEnv, root: string, now: string, home?: string): string;
65
67
  export declare function autonomyMarkerShouldPrune(root: string, now: string): boolean;
66
68
  export declare function versionBumpKind(from: string, to: string): 'major' | 'minor' | 'patch' | 'none';
67
69
  export declare function releaseAutonomy(specs: Spec[], versionBump: 'major' | 'minor' | 'patch' | 'none', env: NodeJS.ProcessEnv, root?: string, now?: string): ApprovalAutonomy;
@@ -46,11 +46,12 @@ exports.requiresAutonomousApprovalPrompt = requiresAutonomousApprovalPrompt;
46
46
  exports.sessionAutonomyActive = sessionAutonomyActive;
47
47
  exports.projectDefaultAutonomy = projectDefaultAutonomy;
48
48
  exports.autonomousApprovalEnabled = autonomousApprovalEnabled;
49
+ exports.fullAutonomyLine = fullAutonomyLine;
49
50
  exports.autonomyBanner = autonomyBanner;
50
51
  exports.autonomyMarkerShouldPrune = autonomyMarkerShouldPrune;
51
52
  exports.versionBumpKind = versionBumpKind;
52
53
  exports.releaseAutonomy = releaseAutonomy;
53
- // @implements A-SPEC-532.1, A-SPEC-718, A-SPEC-532.3, A-SPEC-532.4, A-SPEC-532.7
54
+ // @implements A-SPEC-532.1, A-SPEC-718, A-SPEC-532.3, A-SPEC-532.4, A-SPEC-532.7, A-SPEC-792.7
54
55
  // Whether a spec approval may be sealed AUTONOMOUSLY by the agent, or must still ask a human through
55
56
  // the MCP elicitation TUI. The governance chain (REQ→H→A→T→CPG + RTM + taint + phase gate) already
56
57
  // forces quality structurally, so a low/mid-risk spec self-approving under an explicitly-enabled
@@ -67,6 +68,8 @@ const scope_judgment_1 = require("../guardrail/scope-judgment");
67
68
  /** The out-of-band switch. An agent cannot read or set it — the pre-tool-use gate blocks that
68
69
  * (A-SPEC-532.2), the same self-disarm protection HOLMES_APPROVAL and HOLMES_GATE_BYPASS have. */
69
70
  const delegation_1 = require("./delegation"); // @implements A-SPEC-771 — the run delegation, the third envelope
71
+ const full_autonomy_1 = require("./full-autonomy"); // @implements A-SPEC-792.7
72
+ const os = __importStar(require("node:os"));
70
73
  exports.AUTONOMY_ENV = 'HOLMES_AUTONOMOUS_APPROVAL';
71
74
  /**
72
75
  * Path prefixes whose files govern the gate, the ledger, taint boundaries, or this session's own
@@ -377,7 +380,30 @@ function autonomousApprovalEnabled(env, root, now) {
377
380
  }
378
381
  // @implements A-SPEC-554.1 — the session-start REMINDER (the headless hook surfaces, it never decides).
379
382
  // Only ON postures get a line; OFF is silent (a permanent line is one nobody reads). Wired below.
380
- function autonomyBanner(env, root, now) {
383
+ /** @implements A-SPEC-792.7 — the full profile covering `root`, as one line (without the banner prefix), or ''. */
384
+ function fullAutonomyLine(root, home = os.homedir()) {
385
+ let s;
386
+ try {
387
+ s = (0, full_autonomy_1.readFullProfile)(home, root);
388
+ }
389
+ catch {
390
+ return '';
391
+ }
392
+ if (!s.active)
393
+ return '';
394
+ const f = s.entry.flags;
395
+ const onOff = (b) => (b ? 'on' : 'off');
396
+ return `full autonomy: ON (scope ${s.entry.scope}; push ${onOff(f.push)}, publish ${onOff(f.publish)}, architecture ${onOff(f.architecture)}) — no judgment here waits for a person`;
397
+ }
398
+ function autonomyBanner(env, root, now, home) {
399
+ // @implements A-SPEC-792.7 — an active full profile is named first; without one the banner is what it was.
400
+ const full = fullAutonomyLine(root, home);
401
+ const posture = postureBanner(env, root, now);
402
+ if (full === '')
403
+ return posture;
404
+ return `[Holmes-Kit] ${full}; a refusal names its route${posture === '' ? '' : `\n${posture}`}`;
405
+ }
406
+ function postureBanner(env, root, now) {
381
407
  const v = env[exports.AUTONOMY_ENV];
382
408
  // @implements A-SPEC-771 — one added line names an active run delegation, beside whichever posture line applies.
383
409
  const delegation = (0, delegation_1.readDelegation)(root, now);