@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
@@ -53,7 +53,7 @@ exports.gateErrorDecision = gateErrorDecision;
53
53
  exports.wiredSpecsDir = wiredSpecsDir;
54
54
  exports.evaluateHook = evaluateHook;
55
55
  exports.readSpecsSync = readSpecsSync;
56
- // @implements A-SPEC-476.7, A-SPEC-226.3, A-SPEC-774.28, A-SPEC-747.4, A-SPEC-747.7, A-SPEC-774.23, A-SPEC-753.3, A-SPEC-773, A-SPEC-773.1, A-SPEC-773.2, A-SPEC-134.2,A-SPEC-278,A-SPEC-733, A-SPEC-734, A-SPEC-747, A-SPEC-477.1, A-SPEC-753, A-SPEC-163.7, A-SPEC-768.2, A-SPEC-772.1, A-SPEC-747.3, A-SPEC-774.26, A-SPEC-163.8, A-SPEC-790, A-SPEC-790.2, A-SPEC-790.7, A-SPEC-790.8
56
+ // @implements A-SPEC-476.7, A-SPEC-226.3, A-SPEC-774.28, A-SPEC-747.4, A-SPEC-747.7, A-SPEC-774.23, A-SPEC-753.3, A-SPEC-773, A-SPEC-773.1, A-SPEC-773.2, A-SPEC-134.2,A-SPEC-278,A-SPEC-733, A-SPEC-734, A-SPEC-747, A-SPEC-477.1, A-SPEC-753, A-SPEC-163.7, A-SPEC-768.2, A-SPEC-772.1, A-SPEC-747.3, A-SPEC-774.26, A-SPEC-163.8, A-SPEC-790, A-SPEC-790.2, A-SPEC-790.7, A-SPEC-790.8, A-SPEC-792.5
57
57
  const powershell_shell_1 = require("../guardrail/powershell-shell");
58
58
  const shell_argument_roles_1 = require("../guardrail/shell-argument-roles");
59
59
  // @implements A-SPEC-549.3 — the hook's deny reasons are English here; hooks-english.test.ts drives
@@ -64,6 +64,8 @@ const shell_argument_roles_1 = require("../guardrail/shell-argument-roles");
64
64
  const registry_1 = require("../messages/registry");
65
65
  const root_1 = require("../project/root");
66
66
  const scratch_root_1 = require("../project/scratch-root");
67
+ const crypto = __importStar(require("node:crypto"));
68
+ const full_autonomy_1 = require("../governance/full-autonomy"); // @implements A-SPEC-792.5
67
69
  const fs = __importStar(require("node:fs"));
68
70
  const path = __importStar(require("node:path"));
69
71
  const os = __importStar(require("node:os"));
@@ -1733,6 +1735,22 @@ function evaluateHook(input, specsDir, opts) {
1733
1735
  }
1734
1736
  // @implements A-SPEC-133 — resolved once so every gate in this call shares one timestamp.
1735
1737
  const nowTs = opts?.now ?? new Date().toISOString();
1738
+ // @implements A-SPEC-792.5 — the full autonomy profile covering this project, read at most once per call. Under it no
1739
+ // refusal files a request: every place that would queue one answers with the route instead.
1740
+ let fullCache;
1741
+ const fullEntry = () => {
1742
+ if (fullCache === undefined) {
1743
+ try {
1744
+ const s = (0, full_autonomy_1.readFullProfile)(opts.home ?? os.homedir(), opts.projectRoot);
1745
+ fullCache = s.active ? s.entry : null;
1746
+ }
1747
+ catch {
1748
+ fullCache = null;
1749
+ }
1750
+ }
1751
+ return fullCache;
1752
+ };
1753
+ const hintOrRoute = (req, extra) => (fullEntry() !== null ? (0, full_autonomy_1.fullModeRefusalTail)(req.kind) : (0, approval_queue_1.queueHint)(opts.projectRoot, req, extra));
1736
1754
  // @implements A-SPEC-125.4
1737
1755
  // Bash/shell risk gate: this branch runs BEFORE the Write/Edit phaseCheck logic below and
1738
1756
  // is intentionally fail-CLOSED — a classifier throw on the Bash surface denies, never
@@ -1822,14 +1840,41 @@ function evaluateHook(input, specsDir, opts) {
1822
1840
  // @implements A-SPEC-244 — the refusal itself files the review request. The queue kind is the
1823
1841
  // approval SCOPE kind ('shell'), so the reviewing CLI can mint a covering grant mechanically.
1824
1842
  hardHitlCovered = covers;
1825
- if (!covers) {
1843
+ const full = covers ? null : fullEntry();
1844
+ if (full !== null) {
1845
+ // @implements A-SPEC-792.5 — a full scope approves a scoped destructive act after a recovery point and refuses
1846
+ // every other act at once; nothing is filed, so a run never waits on it.
1847
+ const v = (0, full_autonomy_1.fullModeShellVerdict)({ command, reasons: assessment.reasons, cwd: shellBase, workspace: opts.projectRoot, scratchRoot: (0, scratch_root_1.trustedScratchRoot)(), entry: full });
1848
+ if (v.outcome === 'refuse')
1849
+ return deny(`refused${(0, full_autonomy_1.fullModeRefusalTail)('shell', v.route)}`);
1850
+ let recoveryRef;
1851
+ if (v.recovery) {
1852
+ const r = (0, full_autonomy_1.writeRecoveryRef)(opts.projectRoot, nowTs);
1853
+ if ('error' in r)
1854
+ return deny(`refused${(0, full_autonomy_1.fullModeRefusalTail)('shell', r.error)}`);
1855
+ recoveryRef = r.ref;
1856
+ }
1857
+ try {
1858
+ new ledger_store_1.FileLedgerStore(path.join(opts.projectRoot, '.ax', 'ledger')).append({
1859
+ ts: nowTs, actor: `full-autonomy:${full.scope}`, kind: 'full-autonomy-approved',
1860
+ summary: `hard-hitl shell act approved under full autonomy${recoveryRef ? ` (recovery ${recoveryRef})` : ''}`.slice(0, 200),
1861
+ inputs: [crypto.createHash('sha256').update(command).digest('hex')],
1862
+ rationale: assessment.reasons.join('; ').slice(0, 300),
1863
+ });
1864
+ }
1865
+ catch { /* the act is approved; the audit row is best effort like the other gate records */ }
1866
+ hardHitlCovered = true;
1867
+ }
1868
+ else if (!covers) {
1826
1869
  // @implements A-SPEC-564.2 — the base reason's length rides along so the refusal record
1827
1870
  // knows the FULL feedback cost (base + hint), not just the hint's half.
1828
1871
  const base = 'requires an approval that covers this command';
1829
1872
  return deny(base
1830
1873
  + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'shell', target: command, why: assessment.reasons.join('; ') }, { baseReasonBytes: base.length }));
1831
1874
  }
1832
- pendingApprovals.push(resolved);
1875
+ else {
1876
+ pendingApprovals.push(resolved);
1877
+ }
1833
1878
  }
1834
1879
  // Bash BYPASS gates (adversarial review: `cat > evil.ts` created ungoverned files, `echo x >
1835
1880
  // .claude/settings.json` forged hook config, and `echo $HOLMES_LEDGER_KEY` harvested the very
@@ -1959,7 +2004,7 @@ function evaluateHook(input, specsDir, opts) {
1959
2004
  : '[Holmes-Kit] command reads or dumps process environment (holds out-of-band approval secrets) — requires operator approval';
1960
2005
  const resolved = resolveForCommand('config-write');
1961
2006
  if (!resolved) {
1962
- let hint = (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: command, why: reason });
2007
+ let hint = hintOrRoute({ kind: 'config-write', target: command, why: reason }); // A-SPEC-792.5
1963
2008
  // The queue deliberately suppresses duplicate writes, not the pending operator decision.
1964
2009
  const id = (0, approval_queue_1.approvalRequestId)('config-write', command);
1965
2010
  if (!hint && (0, approval_queue_1.readQueue)(opts.projectRoot).pending.some((request) => request.id === id)) {
@@ -2173,7 +2218,7 @@ function evaluateHook(input, specsDir, opts) {
2173
2218
  return null;
2174
2219
  }
2175
2220
  return { permissionDecision: 'deny', permissionDecisionReason: `[Holmes-Kit] ${why} — an out-of-band approval that includes config-write is required (A-SPEC-728)`
2176
- + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: command, why }) };
2221
+ + hintOrRoute({ kind: 'config-write', target: command, why }) }; // A-SPEC-792.5
2177
2222
  };
2178
2223
  let configWriteLifted = false;
2179
2224
  if (userCfgKind) {
@@ -2675,7 +2720,7 @@ function evaluateHook(input, specsDir, opts) {
2675
2720
  const userResolved = (0, approval_grants_1.resolveApproval)(opts.projectRoot, weApproval, { kind: 'config-write', target: norm }, nowTs);
2676
2721
  if (userResolved === undefined) {
2677
2722
  return { permissionDecision: 'deny', permissionDecisionReason: `[Holmes-Kit] ${userKind} is a hook/approval config — it can forge HOLMES_APPROVAL or turn governance off, so an out-of-band approval that includes config-write is required`
2678
- + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: norm, why: `writing ${userKind}` }) };
2723
+ + hintOrRoute({ kind: 'config-write', target: norm, why: `writing ${userKind}` }) }; // A-SPEC-792.5
2679
2724
  }
2680
2725
  if (userResolved.source === 'grant' && userResolved.approval.nonce)
2681
2726
  (0, approval_grants_1.consumeGrantFile)(opts.projectRoot, userResolved.approval.nonce);
@@ -2721,7 +2766,7 @@ function evaluateHook(input, specsDir, opts) {
2721
2766
  permissionDecision: 'deny',
2722
2767
  permissionDecisionReason: '[Holmes-Kit] the role policy (.ax/roles/) defines the very authority this gate enforces —'
2723
2768
  + ' an agent cannot change it itself. An out-of-band approval that includes config-write is required.'
2724
- + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: norm, why: 'writing the role policy (.ax/roles/)' }),
2769
+ + hintOrRoute({ kind: 'config-write', target: norm, why: 'writing the role policy (.ax/roles/)' }), // A-SPEC-792.5
2725
2770
  };
2726
2771
  }
2727
2772
  if (rolesResolved.source === 'grant' && rolesResolved.approval.nonce)
@@ -2742,7 +2787,7 @@ function evaluateHook(input, specsDir, opts) {
2742
2787
  // wording false as harnesses grow (REQ-155: a diagnosis that points at the wrong file has negative value).
2743
2788
  const kindName = configKind ?? (0, write_target_2.protectedKindOf)(opts.projectRoot, norm) ?? 'config';
2744
2789
  return { permissionDecision: 'deny', permissionDecisionReason: `[Holmes-Kit] ${kindName} is a hook/approval config — it can forge HOLMES_APPROVAL or turn governance off, so an out-of-band approval that includes config-write is required`
2745
- + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: norm, why: `writing ${kindName}` }) };
2790
+ + hintOrRoute({ kind: 'config-write', target: norm, why: `writing ${kindName}` }) }; // A-SPEC-792.5
2746
2791
  }
2747
2792
  if (cfgResolved.source === 'grant' && cfgResolved.approval.nonce)
2748
2793
  (0, approval_grants_1.consumeGrantFile)(opts.projectRoot, cfgResolved.approval.nonce);
@@ -2759,7 +2804,7 @@ function evaluateHook(input, specsDir, opts) {
2759
2804
  const capsResolved = (0, approval_grants_1.resolveApproval)(opts.projectRoot, weApproval, { kind: 'config-write', target: norm }, nowTs);
2760
2805
  if (capsResolved === undefined) {
2761
2806
  return { permissionDecision: 'deny', permissionDecisionReason: `[Holmes-Kit] this write raises or removes a project cap in ax.config.json (${capsAct}) — a cap narrows this agent, so only the owner lifts it: an out-of-band approval that includes config-write is required (A-SPEC-476.3)`
2762
- + (0, approval_queue_1.queueHint)(opts.projectRoot, { kind: 'config-write', target: norm, why: `raising a project cap (${capsAct})` }) };
2807
+ + hintOrRoute({ kind: 'config-write', target: norm, why: `raising a project cap (${capsAct})` }) }; // A-SPEC-792.5
2763
2808
  }
2764
2809
  if (capsResolved.source === 'grant' && capsResolved.approval.nonce)
2765
2810
  (0, approval_grants_1.consumeGrantFile)(opts.projectRoot, capsResolved.approval.nonce);
@@ -3249,7 +3294,7 @@ function evaluateHook(input, specsDir, opts) {
3249
3294
  if (debt && debt.length > 0 && !cureOnly
3250
3295
  && (0, approval_grants_1.resolveApproval)(projectRoot, weApproval, { kind: 'code-write', target: relPath }, nowTs) === undefined) {
3251
3296
  const why = `code write under constitution debt (${debt.join(', ')})`;
3252
- let hint = (0, approval_queue_1.queueHint)(projectRoot, { kind: 'code-write', target: relPath, why });
3297
+ let hint = hintOrRoute({ kind: 'code-write', target: relPath, why }); // A-SPEC-792.5
3253
3298
  // @implements A-SPEC-134.2 — a decision-kind request that is already pending is not written again, so the
3254
3299
  // hint is empty for it. The refusal still names that request; "could not persist" is for a queue that
3255
3300
  // really could not be written.
@@ -65,7 +65,7 @@ exports.collectForbiddenEdgeJudgement = collectForbiddenEdgeJudgement;
65
65
  exports.stopSharedScan = stopSharedScan;
66
66
  exports.scanCodeCycles = scanCodeCycles;
67
67
  exports.writeGuardCount = writeGuardCount;
68
- // @implements A-SPEC-734, A-SPEC-772.1, A-SPEC-770.3, A-SPEC-770.7, A-SPEC-774.21, A-SPEC-778.1, A-SPEC-476.1
68
+ // @implements A-SPEC-734, A-SPEC-772.1, A-SPEC-770.3, A-SPEC-770.7, A-SPEC-774.21, A-SPEC-778.1, A-SPEC-476.1, A-SPEC-792.1
69
69
  // @implements A-SPEC-769.9, A-SPEC-769.10, A-SPEC-769.11
70
70
  const fs = __importStar(require("node:fs"));
71
71
  // @implements A-SPEC-549.3 — evaluateStop's messages are English here; the Hangul-absence guard
@@ -1009,7 +1009,7 @@ function stopBlockText(violations, pending, launcher) {
1009
1009
  : v.article === 'ART-7' ? v.findingId : undefined;
1010
1010
  const request = subject === undefined ? undefined : requestFor.get(subject);
1011
1011
  if (request !== undefined) {
1012
- operator.push(`${line} — request ${request} is pending: the operator decides it, in the session's approval dialog or with ${launcher} approve`);
1012
+ operator.push(`${line} — request ${request} is pending: the operator decides it in the session's approval dialog (approval_ask with id "${request}")`); // A-SPEC-792.1
1013
1013
  }
1014
1014
  else if (v.article === 'ART-4') {
1015
1015
  session.push(`${line} — anchor real covering tests, or, when the design is withdrawn, retire the spec with spec_retire`);
@@ -1878,7 +1878,7 @@ if (require.main === module) {
1878
1878
  else if (ackWaiting.length > 0) {
1879
1879
  // @implements A-SPEC-247 — acknowledged, not clean: name what is waiting so the user sees
1880
1880
  // the standing approval debt exactly once, and the agent knows the ball is not in its court.
1881
- process.stderr.write(`[Holmes-Kit] awaiting approval — items waiting on the owner's decision: ${ackWaiting.join(', ')}. Decide them at ${stopLauncher()} approve. (This debt does not re-block.)\n`);
1881
+ process.stderr.write(`[Holmes-Kit] awaiting approval — items waiting on the owner's decision: ${ackWaiting.join(', ')}. The person decides each in the session's approval form (approval_ask with its id). (This debt does not re-block.)\n`); // A-SPEC-792.1
1882
1882
  }
1883
1883
  else if (guard.capped) {
1884
1884
  process.stderr.write(`[Holmes-Kit] governance gate YIELDING after ${exports.MAX_CONSECUTIVE_BLOCKS} consecutive blocks — issues remain UNRESOLVED:\n${out.reason ?? ''}\n`);
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // @implements A-SPEC-718.2, A-SPEC-718, A-SPEC-263.1, A-SPEC-732, A-SPEC-770.3, A-SPEC-770.6, A-SPEC-792.1
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.MAX_PRESENTATIONS = exports.WAIT_FOR_PERSON_MS = exports.ELICIT_TIMEOUT_MS = exports.ELICITABLE_KINDS = void 0;
4
5
  exports.elicitationDisabled = elicitationDisabled;
@@ -9,8 +10,6 @@ exports.buildDecisionForm = buildDecisionForm;
9
10
  exports.buildReasonForm = buildReasonForm;
10
11
  exports.runElicitFlow = runElicitFlow;
11
12
  exports.interpretElicitResult = interpretElicitResult;
12
- // @implements A-SPEC-718.2, A-SPEC-718, A-SPEC-263.1, A-SPEC-732, A-SPEC-770.3, A-SPEC-770.6
13
- const npx_bin_1 = require("../project/npx-bin");
14
13
  /**
15
14
  * The decision comes INTO the session (REQ-263): an approval-shaped refusal (spec_approve without a
16
15
  * covering HOLMES_APPROVAL) becomes an in-session question when the client advertises the MCP
@@ -94,7 +93,7 @@ function classifyElicitError(e, timeoutMs = exports.ELICIT_TIMEOUT_MS) {
94
93
  * Template-owned text with no interpolated attacker data.
95
94
  */
96
95
  function expiredNotice(waitedMs) {
97
- return `[세션 승인 다이얼로그 만료 — ${Math.round(waitedMs / 1000)}초 무응답] 요청은 승인 큐로 회송되었습니다. 결정: ${(0, npx_bin_1.holmesKitCommand)()} approve. `;
96
+ return `[세션 승인 다이얼로그 만료 — ${Math.round(waitedMs / 1000)}초 무응답] 요청은 승인 큐로 회송되었습니다. 결정: 에이전트가 approval_ask 로 다시 묻습니다. `;
98
97
  }
99
98
  // FLATTEN attacker-influenced text (round-1): the model chooses spec titles and finding ids, and
100
99
  // interpolating them raw let a crafted title inject fake lines ("[시스템] … approve.") into the
@@ -115,8 +114,8 @@ function buildDecisionForm(req, attempt, timeoutMs) {
115
114
  // @implements A-SPEC-718.2 — one outcome for silence, in every mode: the request returns to the queue.
116
115
  // @implements A-SPEC-718.6 — a form that waits for the person says so instead of counting seconds.
117
116
  const timeoutNotice = timeoutMs >= exports.WAIT_FOR_PERSON_MS
118
- ? `⏱ 결정할 때까지 기다립니다 — 결정 없이 세션이 끝나면 요청은 승인 큐에 남습니다(운영자: ${(0, npx_bin_1.holmesKitCommand)()} approve).`
119
- : `⏱ ${timeoutMs / 1000}초 내 미결정 시 승인 큐로 회송됩니다(운영자: ${(0, npx_bin_1.holmesKitCommand)()} approve).`;
117
+ ? `⏱ 결정할 때까지 기다립니다 — 결정 없이 세션이 끝나면 요청은 승인 큐에 남고, 에이전트가 approval_ask 로 다시 물을 수 있습니다.`
118
+ : `⏱ ${timeoutMs / 1000}초 내 미결정 시 승인 큐로 회송됩니다(에이전트가 approval_ask 로 다시 물을 수 있습니다).`;
120
119
  return {
121
120
  // @implements A-SPEC-497.1 — the forewarning is the LAST line and template-owned: it survives a
122
121
  // cap-filling summary (appended after the caps) and tells the human, before the clock runs out,
@@ -223,7 +222,7 @@ function interpretElicitResult(r) {
223
222
  // @implements A-SPEC-732 — the protocol cannot tell a person's decline from a client that declines
224
223
  // forms automatically (codex exec, measured 2026-09-24), so the reason names both and the fallback.
225
224
  if (r.action === 'decline')
226
- return { granted: false, reason: 'the session client declined the approval form (decline) — a person declined, or a client that cannot show forms (e.g. codex exec) declined automatically. If nobody saw the form, set HOLMES_ELICIT=off in the holmes-kit MCP server environment and decide with ' + `${(0, npx_bin_1.holmesKitCommand)()} approve` }; // A-SPEC-770.6
225
+ return { granted: false, reason: 'the session client declined the approval form (decline) — a person declined, or a client that cannot show forms (e.g. codex exec) declined automatically. If nobody saw the form, the person decides it in the approval form of a Claude Code session on this workspace (approval_ask)' }; // A-SPEC-792.1
227
226
  if (r.action !== 'accept')
228
227
  return null; // cancel, absent, anything else: no decision
229
228
  const content = r.content;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FORM_WAITS_FOR_PERSON = void 0;
4
4
  exports.createApprovalAskHandlers = createApprovalAskHandlers;
5
- // @implements A-SPEC-718.4
5
+ // @implements A-SPEC-718.4, A-SPEC-792.1
6
6
  /**
7
7
  * approval_ask — the person decides a pending request in the session's approval form, so no approval needs a typed
8
8
  * command (owner audit 2026-10-20). Since A-SPEC-779.4 neither the agent's shell nor the session's `!` can run
@@ -15,7 +15,6 @@ exports.createApprovalAskHandlers = createApprovalAskHandlers;
15
15
  const elicit_approval_1 = require("../elicit-approval");
16
16
  const approval_queue_1 = require("../../governance/approval-queue");
17
17
  const approve_1 = require("../../cli/approve");
18
- const npx_bin_1 = require("../../project/npx-bin");
19
18
  const screen_safe_1 = require("../../cli/screen-safe");
20
19
  /** Clients whose form waits for the person in every mode measured (claude-code: forms expired unanswered, 2026-10-19). */
21
20
  exports.FORM_WAITS_FOR_PERSON = new Set(['claude-code']);
@@ -30,7 +29,9 @@ function createApprovalAskHandlers(context) {
30
29
  async approval_ask(a) {
31
30
  const root = context.rootOf(a.root);
32
31
  const id = typeof a.id === 'string' ? a.id.trim() : '';
33
- const fallback = `The operator can decide it from their own terminal: ${(0, npx_bin_1.holmesKitCommand)()} approve --grant ${id} --target ${root}`;
32
+ // @implements A-SPEC-792.1 — the route that still reaches a person, never a command to type: a Claude Code session on
33
+ // this workspace, whose form is measured to wait for a person (FORM_WAITS_FOR_PERSON).
34
+ const fallback = `The request stays pending: the person decides it in the approval form of a Claude Code session on this workspace (approval_ask with id "${id}")`;
34
35
  const refuse = (why) => ({ ok: false, id, reason: `${why}. ${fallback}` });
35
36
  // @implements A-SPEC-779.5 — a run's own server never asks; a request a run awaits is the person's to decide in the
36
37
  // interactive session's form (owner, 2026-10-20). The CLI keeps A-SPEC-779's terminal-only rule (grantGuard).
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createReviewVerdictHandlers = createReviewVerdictHandlers;
4
- // @implements A-SPEC-102.9
4
+ // @implements A-SPEC-102.9, A-SPEC-792.1
5
5
  /**
6
6
  * review_verdict — the person records an independent review verdict in the session's approval form. A-SPEC-102.7/102.8
7
7
  * make a CLI verdict independent only from a person's own terminal, so a review meant leaving the session (the owner's
@@ -20,7 +20,8 @@ function createReviewVerdictHandlers(context) {
20
20
  async review_verdict(a) {
21
21
  const root = context.rootOf(a.root);
22
22
  const env = context.env();
23
- const fallback = `The person can record it from their own terminal: holmes-kit review record --base ${a.base} --head ${a.head} --verdict pass`;
23
+ // @implements A-SPEC-792.1 — a Claude Code session's form, never a command to type.
24
+ const fallback = `The verdict stays unrecorded: the person records it in the approval form of a Claude Code session on this workspace (review_verdict for ${a.base}..${a.head})`;
24
25
  const refuse = (why) => ({ ok: false, reason: `${why}. ${fallback}` });
25
26
  const marker = env[RUN];
26
27
  if (typeof marker === 'string' && marker.trim() !== '')
@@ -47,6 +47,8 @@ export interface SpecApprovalContext {
47
47
  foreignRootReason(root?: string): string | null;
48
48
  /** @implements A-SPEC-732 — why no in-session route was offered (unattested server), or ''. */
49
49
  approvalRouteNote?(): string;
50
+ /** @implements A-SPEC-792.4 — the home whose full autonomy profile applies (default os.homedir()). */
51
+ fullAutonomyHome?(): string;
50
52
  }
51
53
  export declare function createSpecApprovalHandlers(context: SpecApprovalContext): {
52
54
  /**
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.createSpecApprovalHandlers = createSpecApprovalHandlers;
37
37
  exports.readProjectFile = readProjectFile;
38
- // @implements A-SPEC-182.3, A-SPEC-718.3, A-SPEC-770.6, A-SPEC-718.1,A-SPEC-718.2, A-SPEC-718, A-SPEC-551.1, A-SPEC-551.2, A-SPEC-627.1, A-SPEC-622, A-SPEC-100.2, A-SPEC-128, A-SPEC-132, A-SPEC-133, A-SPEC-151, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245, A-SPEC-729, A-SPEC-532.7
38
+ // @implements A-SPEC-182.3, A-SPEC-718.3, A-SPEC-770.6, A-SPEC-718.1,A-SPEC-718.2, A-SPEC-718, A-SPEC-551.1, A-SPEC-551.2, A-SPEC-627.1, A-SPEC-622, A-SPEC-100.2, A-SPEC-128, A-SPEC-132, A-SPEC-133, A-SPEC-151, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245, A-SPEC-729, A-SPEC-532.7, A-SPEC-792.1, A-SPEC-792.4
39
39
  // @implements A-SPEC-631, A-SPEC-733
40
40
  const fs = __importStar(require("node:fs"));
41
41
  const compat_impact_1 = require("../../spec/compat-impact");
@@ -48,6 +48,8 @@ const autonomy_1 = require("../../governance/autonomy");
48
48
  const config_1 = require("../../config/config");
49
49
  const write_target_1 = require("../../guardrail/write-target");
50
50
  const delegation_1 = require("../../governance/delegation"); // @implements A-SPEC-771
51
+ const full_autonomy_1 = require("../../governance/full-autonomy"); // @implements A-SPEC-792.4
52
+ const os = __importStar(require("node:os"));
51
53
  const approval_grants_1 = require("../../governance/approval-grants");
52
54
  const spec_digest_1 = require("../../spec/spec-digest");
53
55
  const version_conflict_1 = require("../../spec/version-conflict");
@@ -57,7 +59,6 @@ const review_targets_1 = require("../../review/review-targets");
57
59
  const requirement_triage_evidence_1 = require("../requirement-triage-evidence");
58
60
  const approval_policy_1 = require("../approval-policy");
59
61
  const approval_blockers_1 = require("../../spec/approval-blockers");
60
- const npx_bin_1 = require("../../project/npx-bin");
61
62
  function createSpecApprovalHandlers(context) {
62
63
  const { store, resolver, projectRootOf, cachedScan, tryElicit, elicitApproval, autonomousApproval } = context;
63
64
  return {
@@ -150,7 +151,10 @@ function createSpecApprovalHandlers(context) {
150
151
  catch {
151
152
  return undefined;
152
153
  } })();
153
- const autonomyOn = (0, autonomy_1.autonomousApprovalEnabled)(process.env, autonomyRoot, new Date().toISOString());
154
+ // @implements A-SPEC-792.4 — a full autonomy profile covering this project: no seal here waits for a person.
155
+ const fullState = autonomyRoot === undefined ? null : (0, full_autonomy_1.readFullProfile)(context.fullAutonomyHome?.() ?? os.homedir(), autonomyRoot);
156
+ const fullEntry = fullState !== null && fullState.active ? fullState.entry : null;
157
+ const autonomyOn = fullEntry !== null || (0, autonomy_1.autonomousApprovalEnabled)(process.env, autonomyRoot, new Date().toISOString());
154
158
  // @implements A-SPEC-718.3 — the continuation's only person is the host's own tool confirmation, which
155
159
  // the server cannot see and an allow rule or auto mode removes. Under autonomous approval — the posture
156
160
  // in which nobody is at the keyboard — it is neither spent here nor offered below (measured: the caller
@@ -205,11 +209,25 @@ function createSpecApprovalHandlers(context) {
205
209
  }
206
210
  }
207
211
  if (ceilingNote !== null) {
212
+ // @implements A-SPEC-792.4 — under a full profile the owner's ceiling still binds, and refuses at once.
213
+ if (fullEntry !== null) {
214
+ return { ok: false, reason: `spec_approve: ${a.id} — [full autonomy: the owner's ceiling keeps this seal; the owner changes autonomy.ceiling in ax.config.json]${ceilingNote} (no approval request was filed)` };
215
+ }
208
216
  autonomyNote = ceilingNote;
209
217
  }
210
218
  else if (autonomyOn && risk === 'hitl') {
211
219
  const rule = noIntake ? 'requirement-without-intake' : (0, autonomy_1.specApprovalAutonomyReason)(target.spec, resolver([target.spec]), below);
212
- if (rule !== null) {
220
+ if (rule !== null && fullEntry !== null) {
221
+ // @implements A-SPEC-792.4 — sealed as full-autonomy, or refused with the self-serve route; never asked.
222
+ const verdict = (0, full_autonomy_1.fullSealVerdict)(rule, fullEntry.flags);
223
+ if (verdict.outcome === 'refuse') {
224
+ return { ok: false, reason: `spec_approve: ${a.id} — [full autonomy: ${rule}] ${verdict.route} (no approval request was filed)` };
225
+ }
226
+ const base = autonomousApproval(below?.map((s) => s.id));
227
+ approveResolved = { approval: { ...base, actor: base.actor.replace(/^autonomous:/, 'full-autonomy:'), rationale: `full autonomy (scope ${fullEntry.scope}, rule ${rule})${verdict.mark}` }, source: 'full-autonomy' };
228
+ decidedSubject = targetSubject;
229
+ }
230
+ else if (rule !== null) {
213
231
  autonomyNote = `\n[autonomy: this seal is the operator's — ${rule} (${(0, autonomy_1.autonomyRuleMeaning)(rule)})]${(0, autonomy_1.autonomyNextStep)(rule, a.id)}`; // A-SPEC-532.7
214
232
  // @implements A-SPEC-771 — the operator's run delegation may cover this very rule: then the seal proceeds
215
233
  // as a DELEGATED grant (actor `delegated:<client>`, the run and the rule in the ledger) and no person is
@@ -384,7 +402,7 @@ function createSpecApprovalHandlers(context) {
384
402
  const bound = approveResolved.approval;
385
403
  if (typeof bound.subject === 'string' && bound.subject !== '' && bound.subject !== (0, spec_digest_1.specDigest)(cur.spec)) {
386
404
  const current = (0, spec_digest_1.specDigest)(cur.spec);
387
- return { ok: false, reason: `[grant ${bound.nonce ?? '?'} refused: stale-subject] the grant was minted for another content of ${a.id}; the operator must read the current content and decide again (revoke the stale grant with ${(0, npx_bin_1.holmesKitCommand)(a.root)} approve --revoke).`
405
+ return { ok: false, reason: `[grant ${bound.nonce ?? '?'} refused: stale-subject] the grant was minted for another content of ${a.id}; the person reads the current content and decides again in the session form (approval_ask with the id below); the new grant replaces the stale one.` // A-SPEC-792.1
388
406
  + context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', subject: current, title: cur.spec.title }) };
389
407
  }
390
408
  }
@@ -61,6 +61,8 @@ export interface ElicitOpts {
61
61
  home?: string;
62
62
  installerPackageRoot?: string;
63
63
  };
64
+ /** @implements A-SPEC-792.4 — the home whose `.holmes/full-autonomy.json` spec_approve reads (default: the user's). */
65
+ fullAutonomyHome?: () => string;
64
66
  }
65
67
  /**
66
68
  * @implements A-SPEC-299
@@ -39,7 +39,7 @@ exports.isHandlerRefusal = isHandlerRefusal;
39
39
  exports.unreadableAmong = unreadableAmong;
40
40
  exports.makeHandlers = makeHandlers;
41
41
  exports.collectDecisions = collectDecisions;
42
- // @implements A-SPEC-774.25, A-SPEC-770.12, A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754
42
+ // @implements A-SPEC-774.25, A-SPEC-770.12, A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754, A-SPEC-792.4
43
43
  const operator_recovery_1 = require("./operator-recovery");
44
44
  // @implements A-SPEC-643
45
45
  // @implements A-SPEC-642
@@ -929,6 +929,7 @@ function makeRawHandlers(store, opts) {
929
929
  resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
930
930
  refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, 'spec_approve'),
931
931
  foreignRootReason: (root) => foreignRootReason(store, root),
932
+ ...(opts?.fullAutonomyHome ? { fullAutonomyHome: opts.fullAutonomyHome } : {}), // @implements A-SPEC-792.4
932
933
  });
933
934
  /**
934
935
  * Where the audit record for a governance act belongs — resolved BEFORE the act writes anything.
@@ -1,4 +1,10 @@
1
- /** Formatting only: the caller must return pending text only after a successful enqueue. */
1
+ /**
2
+ * Formatting only: the caller must return pending text only after a successful enqueue.
3
+ *
4
+ * @implements A-SPEC-792.1 — the hint names no command to type. The operator lines it used to carry (`approve --grant`,
5
+ * `approve --watch`, A-SPEC-532.3) were relayed by agents and typed by the person in a terminal — the UX REQ-792 removes.
6
+ * `platform`, `executable` and `cli` once built that command; they are accepted and no longer used.
7
+ */
2
8
  export declare function operatorRecovery(root: string, target: string, operation?: string, options?: {
3
9
  platform?: NodeJS.Platform;
4
10
  executable?: string;
@@ -6,6 +12,5 @@ export declare function operatorRecovery(root: string, target: string, operation
6
12
  /** @implements A-SPEC-770.12 — `requestLabel(kind, target, title)`, set inside the bracket after the id. */
7
13
  label?: string;
8
14
  }): {
9
- reviewCommand: string;
10
15
  pendingHint(id: string): string;
11
16
  };
@@ -1,70 +1,27 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
2
+ // @implements A-SPEC-754, A-SPEC-768, A-SPEC-770.12, A-SPEC-792.1
35
3
  Object.defineProperty(exports, "__esModule", { value: true });
36
4
  exports.operatorRecovery = operatorRecovery;
37
- // @implements A-SPEC-754, A-SPEC-532.3, A-SPEC-768, A-SPEC-770.12
38
- const path = __importStar(require("node:path"));
39
- const unsafeDisplay = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;
40
- function literal(value, platform) {
41
- return platform === 'win32' ? `'${value.replace(/'/g, "''")}'` : `'${value.replace(/'/g, `'\\''`)}'`;
42
- }
43
- /** Formatting only: the caller must return pending text only after a successful enqueue. */
5
+ /**
6
+ * Formatting only: the caller must return pending text only after a successful enqueue.
7
+ *
8
+ * @implements A-SPEC-792.1 — the hint names no command to type. The operator lines it used to carry (`approve --grant`,
9
+ * `approve --watch`, A-SPEC-532.3) were relayed by agents and typed by the person in a terminal — the UX REQ-792 removes.
10
+ * `platform`, `executable` and `cli` once built that command; they are accepted and no longer used.
11
+ */
44
12
  function operatorRecovery(root, target, operation, options) {
13
+ void root;
45
14
  const label = options?.label ?? '';
46
- const platform = options?.platform ?? process.platform;
47
- const executable = options?.executable ?? process.execPath;
48
- // Both src/holmes/mcp (tests) and dist/holmes/mcp (installed) have the same depth.
49
- const cli = options?.cli ?? path.resolve(__dirname, '../../..', 'bin/holmes-kit.js');
50
- const commandSafe = [root, executable, cli].every(value => value.length > 0 && value.length <= 2048 && !unsafeDisplay.test(value));
51
- const command = commandSafe ? `${platform === 'win32' ? '& ' : ''}${literal(executable, platform)} ${literal(cli, platform)} approve --target ${literal(root, platform)}` : '';
52
- const display = (value) => JSON.stringify(value.slice(0, 300)).replace(/[\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g, char => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
15
+ const display = (value) => JSON.stringify(value.slice(0, 300)).replace(/[\u007f-\u009f‪-‮⁦-⁩]/g, char => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
53
16
  return {
54
- reviewCommand: command || 'the installed Holmes-Kit approval UI (path cannot be safely displayed; no command emitted)',
55
17
  pendingHint(id) {
56
18
  if (!/^req-[a-f0-9]{12}$/.test(id))
57
19
  return '';
58
- if (!command)
59
- return `\n[승인 대기 ${id}${label}] The request was recorded. Use the installed approval UI; a path exceeds the safe command display limit. No truncated command is provided.`;
60
- // @implements A-SPEC-532.3 — the resident surface is offered beside the one-off command (owner, 2026-10-04:
61
- // "why am I still pasting commands"): one key per arriving request.
62
- // @implements A-SPEC-768 — the three lines above are the operator's; measured 2026-10-11 (HG arm) the agent read
63
- // "keep the approval surface open" as its own instruction and polled a sealed spec 58 times. One line is the agent's.
64
- return `\n[승인 대기 ${id}${label}] 운영자: ${command} --grant ${literal(id, platform)}`
65
- + `\nOr keep the approval surface open and decide each arriving request with one key: ${command} --watch`
66
- + `\nAfter official approval, retry ${operation ? display(operation) : 'the original MCP operation'} for target ${display(target)} in the same workspace. Do not retry until approval is available.`
67
- // @implements A-SPEC-718.5 — the in-session route first: the person answers the form, nobody types a command.
20
+ // @implements A-SPEC-768 — one line is the agent's; measured 2026-10-11 (HG arm) an agent read an operator line as
21
+ // its own instruction and polled a sealed spec 58 times.
22
+ return `\n[승인 대기 ${id}${label}] The request was recorded.`
23
+ + `\nAfter approval, retry ${operation ? display(operation) : 'the original MCP operation'} for target ${display(target)} in the same workspace. Do not retry until approval is available.`
24
+ // @implements A-SPEC-718.5 — the in-session route: the person answers the form, nobody types a command.
68
25
  + `\nAgent: call approval_ask with id "${id}" — the person decides in this session's approval form; after granted, retry once.`
69
26
  + ' Otherwise check approval_status for the target; sealed:true or request.state granted means retry now — polling a sealed spec is wasted; request.state held carries the operator\'s question.';
70
27
  },
@@ -225,7 +225,7 @@ exports.TOOL_SCHEMAS = {
225
225
  },
226
226
  // @implements A-SPEC-718.4
227
227
  approval_ask: {
228
- description: "Ask the person to decide ONE pending approval request in this session's approval form — the id a refusal named (`[승인 대기 req-…]`), from the approval inbox or this machine's refusal log. The person chooses approve / deny / question; the answer is recorded exactly as `holmes-kit approve --grant/--deny/--ask` would record it (actor `elicitation:<client>`), so after `granted` retry the refused act once. Returns { ok, id, kind, decision: granted|denied|held|undecided, nextAction }. Nothing is recorded without the person's answer: silence leaves the request pending. A request a run awaits is asked here too, from the interactive session (the run resumes on the grant). Refuses, recording nothing, from a run's own server, when the session cannot show a form (HOLMES_ELICIT=off, a server no harness launched, a client without forms), and for a shell/config/code-write request on a client not yet measured to wait for a person (only claude-code today).",
228
+ description: "Ask the person to decide ONE pending approval request in this session's approval form — the id a refusal named (`[승인 대기 req-…]`), from the approval inbox or this machine's refusal log. The person chooses approve / deny / question; the answer is recorded exactly as the operator's grant, deny or question is recorded (actor `elicitation:<client>`), so after `granted` retry the refused act once. Returns { ok, id, kind, decision: granted|denied|held|undecided, nextAction }. Nothing is recorded without the person's answer: silence leaves the request pending. A request a run awaits is asked here too, from the interactive session (the run resumes on the grant). Refuses, recording nothing, from a run's own server, when the session cannot show a form (HOLMES_ELICIT=off, a server no harness launched, a client without forms), and for a shell/config/code-write request on a client not yet measured to wait for a person (only claude-code today).",
229
229
  inputSchema: {
230
230
  type: 'object',
231
231
  properties: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@implements A-SPEC-209",
3
3
  "name": "@holmes-lab/holmes-kit",
4
- "version": "0.37.2",
4
+ "version": "0.38.0",
5
5
  "description": "Holmes-Kit — deterministic Agentic Software Engineering (ASE) harness with causal traceability (spec chain + D-CPG + RTM + phase guardrail)",
6
6
  "main": "dist/holmes/mcp/server.js",
7
7
  "types": "dist/holmes/mcp/server.d.ts",
@@ -15,7 +15,8 @@ description: >-
15
15
  검증에 걸리고, 봉인 후 본문을 고치면 `post-approval-edit`으로, 부모가 움직이면 `stale-parent`로
16
16
  걸린다(REQ-132). `spec_approve`는 사람의 승인을 요구한다(fail-closed) — 요청 인자로는 대체되지 않는다.
17
17
  사람은 세션의 승인 창에서 답한다. 거부가 `[승인 대기 req-…]`를 지목했다면 `approval_ask`에 그 id를 넘겨
18
- 창을 띄운다(0.37.0). 창이 없는 세션에서는 운영자가 자기 터미널에서 `holmes-kit approve --grant <id>`로 결정한다.
18
+ 창을 띄운다(0.37.0). 창이 없는 세션에서는 같은 작업공간의 Claude Code 세션 승인 창에서 결정한다 —
19
+ 명령을 입력하라고 사람에게 넘기지 않는다(0.38.0, REQ-792).
19
20
 
20
21
  이 플레이북은 그 승인을 **언제·무엇에·어떤 근거로** 하는지를 다룬다. 문서를 새로 쓰는 일이라면
21
22
  이것이 아니라 `author-slice`다 — 판별은 3단계에 있다.