@holmes-lab/holmes-kit 0.35.2 → 0.35.3
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/CHANGELOG.md +25 -0
- package/README.md +4 -3
- package/dist/.build-id +1 -1
- package/dist/holmes/governance/approval-queue.d.ts +5 -0
- package/dist/holmes/governance/approval-queue.js +14 -3
- package/dist/holmes/governance/autonomy.d.ts +1 -1
- package/dist/holmes/governance/autonomy.js +1 -1
- package/dist/holmes/hooks/pre-tool-use.js +12 -3
- package/dist/holmes/mcp/approval-policy.d.ts +4 -1
- package/dist/holmes/mcp/approval-policy.js +5 -4
- package/dist/holmes/mcp/elicit-approval.d.ts +0 -2
- package/dist/holmes/mcp/elicit-approval.js +3 -4
- package/dist/holmes/mcp/handlers/review-evidence.d.ts +1 -2
- package/dist/holmes/mcp/handlers/review-evidence.js +4 -12
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +2 -2
- package/dist/holmes/mcp/handlers/spec-approval.js +4 -9
- package/dist/holmes/mcp/handlers.d.ts +1 -9
- package/dist/holmes/mcp/handlers.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
<!-- @implements A-SPEC-209 -->
|
|
8
|
+
## [0.35.3] - 2026-10-05
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
|
|
12
|
+
- **An approval prompt that is not answered is held, never approved** (A-SPEC-718.1, A-SPEC-718.2). With autonomous
|
|
13
|
+
approval on, an in-session approval dialog that ran out of time was recorded as an approval under the actor
|
|
14
|
+
`autonomous-timeout:<harness>`. This applied to exactly the acts autonomy reserves for a person: sealing a spec that
|
|
15
|
+
loosens a gate or is graded high-risk, and recording a critical review finding as resolved. A session left
|
|
16
|
+
unattended could therefore seal them with no human decision. The rule was unreachable on machines with a runtime
|
|
17
|
+
registry until 0.35.2 restored the in-session dialog there, and was observed live on 0.35.2. An unanswered dialog
|
|
18
|
+
now returns the request to the approval queue in every mode, and the dialog no longer says that silence approves.
|
|
19
|
+
Upgrade is recommended for every project that runs with autonomous approval on.
|
|
20
|
+
To audit earlier sessions, search the provenance ledger for `autonomous-timeout`: each such record is a seal or a
|
|
21
|
+
resolution no person decided, and can be withdrawn with `spec_unseal` or by reopening the finding.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **The request a constitution-debt refusal files is listed by `holmes-kit approve`** (A-SPEC-134.2). Since 0.35.1 a
|
|
26
|
+
code write refused under constitution debt printed a request id and pointed the operator at `holmes-kit approve`,
|
|
27
|
+
but the request went to the local refusal log — one line for every refused edit — so `approve --list` and the
|
|
28
|
+
interactive inbox showed nothing; only `approve --grant <id>` reached it. `code-write` is now a decision kind: the
|
|
29
|
+
request is written once per path to the approval queue and listed like any other. A repeated refusal of the same
|
|
30
|
+
path names the pending request instead of saying the request could not be saved. The request's target is the
|
|
31
|
+
project-relative file path, which is now written to the tracked queue file.
|
|
32
|
+
|
|
8
33
|
## [0.35.2] - 2026-10-05
|
|
9
34
|
|
|
10
35
|
### Security
|
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
|
|
|
24
24
|
### 🛡️ Currently Supported Features (Production Features)
|
|
25
25
|
|
|
26
26
|
- **The protected store is recognised however a shell command spells it** *(new in 0.35.2 — security fix, upgrade recommended)*: through 0.35.1 a path into `.ax/specs`, `.ax/ledger`, `.ax/approvals` or `.ax/state` written directly after a shell expansion, a variable, or a character the shell removes at run time was not seen as protected, so a removal, move or overwrite of governance state could pass the gate. The store spelling now counts wherever it appears in a command, and an output redirect to a computed target is not a read. Reads still pass. A directory that merely ends in `.ax` and has a child named like the store's is judged as the store. Limit: a path assembled so the spelling never appears in the command text is outside this rule.
|
|
27
|
+
- **An unanswered approval is held, never approved** *(new in 0.35.3 — security fix, upgrade recommended)*: with autonomous approval on, an in-session approval dialog that ran out of time used to be recorded as an approval (actor `autonomous-timeout:<harness>`) — for exactly the seals and critical-finding resolutions autonomy reserves for a person. An unanswered dialog now returns the request to the approval queue in every mode. To audit earlier sessions, search the provenance ledger for `autonomous-timeout`.
|
|
27
28
|
- **Approvals that fit how people work** *(new in 0.35.2)*: an approval for a request that carries the approved content's digest (a spec seal) no longer expires after 30 minutes — it stays valid until used, revoked, or the content changes (`--ttl` still bounds it; requests without a digest keep the default). With autonomous approval on, a gate change declared `gate-behavior: tightens — …` or `gate-behavior: wording — …` is sealed without the operator; any other gate change still asks, and a seal handed to the operator says which rule handed it over. On a machine with a runtime registry the in-session approval dialog is reachable again, and `init`/`upgrade` no longer replace wiring the registry owns. Not yet changed: the in-session dialog's own time limit.
|
|
28
29
|
- **Separate development and consumer runtimes** *(new in 0.35.0)*: `runtime-binding setup` explicitly registers a checkout and its built package in an operator-owned registry. Normal Claude, Codex and Antigravity launches select that development package for the registered workspace; other workspaces select the configured release. Missing or conflicting bindings refuse with diagnosis instead of silently switching builds. Setup previews exact changes and requires authority for a changed installation; a validated unchanged plan needs no new grant. Normal migration preserves disabled hooks and native trust. `--activate-hooks` explicitly restores selected Holmes entries, while native trust and global disable switches still require native review. See [development runtime setup and recovery](docs/install-guide.md#development-and-consumer-runtime-binding) for the workflow and current approval limitation. Configuration readiness does not prove live three-harness enforcement.
|
|
29
30
|
- **Bounded routed-hook recovery** *(new in 0.35.0)*: routed hooks share an 18-second input/selection/execution budget and allow up to 8 seconds for owned-process cleanup. Failure reports the selected runtime and diagnosis commands, retains unresolved findings, and directs an approved repair followed by retry of the original operation. Cleanup uncertainty is reported; persistent MCP sessions have no hook lifetime deadline. Literal recovery prompts and recognized installer previews are distinguished from actual shell writes without permitting command substitutions or protected output targets.
|
|
@@ -34,7 +35,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
|
|
|
34
35
|
- 🚦 **The gate only ever denies** *(changed in 0.31.0)*: an action Holmes does not deny is left to your harness's own permission flow — Claude Code and Codex get no permission decision, Antigravity gets `ask` (or `allow` for a read inside the workspace that git does not ignore). Earlier versions answered `allow`, which Claude Code treats as "bypassing permission prompt", so anything the shell model missed ran unconfirmed. In Claude Code's default mode you now see its confirmations again, as without Holmes.
|
|
35
36
|
- 🪝 **The Codex gate loads again on codex-cli 0.155** *(new in 0.31.0)*: plugin hooks were removed upstream, so `init --agent codex` wires the Holmes PreToolUse and Stop kernels into the user-level `$CODEX_HOME/hooks.json`, keeps every hook it does not own, and `--remove` takes away only its own groups. Codex runs a user hook only after you trust it once with `/hooks`; Holmes never forges that trust, and `doctor` says so instead of claiming enforcement.
|
|
36
37
|
- 🧭 **The shell gate judges by identity, from where the command really runs** *(new in 0.31.0)*: wiring files, the whole `.ax` store and the files inside it are protected as shell WORDS resolved against each segment's real base — a `cd` moves the base only when it is certain to have run, an uncertain or expanded one (`cd .a?`, a link made in the same command, `cd "$X"`) leaves it unknown and the command is judged at every base it could have produced, and the base starts at the harness's own working directory (the payload `cwd`, a Codex `workdir`), not the project root. Every evaluation runs under a fail-closed deadline wall. The Codex oracle asks the installed Codex whether your config loads — locally, over copies, with plugins and every proxy closed, `sqlite_home`/`analytics`/`otel` isolated from the user copy alone, and a verdict it could not obtain labelled `approximate`. Source walkers skip nested git working trees only when git says the tree is not the project's, read regular files only, and ask git once per scan; every reader on a gate path is linear in its input.
|
|
37
|
-
- 🪟 **Approval stays inside the agent session** *(new in 0.29.0)*: Claude Code, Codex, and Antigravity use the same capability-negotiated route. Holmes opens a direct MCP form only when that live client advertises `elicitation.form`; otherwise it exposes one sensitive, challenge-bound `approval_commit` continuation in the same agent session. The host may render its native tool confirmation, but its arrival is recorded as `host-gated`, never claimed as proof that a human answered. The server issues an opaque, memory-only intent bound to the action kind, target, subject digest, workspace and MCP run; only one matching retry can consume it. No `config.toml` value or persisted `HOLMES_APPROVAL` is authority. The `holmes-kit approve` TUI is recovery-only when a session cannot present approval. Under autonomous mode, eligible low-risk work stays automatic and an ordinary unclassified HITL request queues without interrupting the agent;
|
|
38
|
+
- 🪟 **Approval stays inside the agent session** *(new in 0.29.0)*: Claude Code, Codex, and Antigravity use the same capability-negotiated route. Holmes opens a direct MCP form only when that live client advertises `elicitation.form`; otherwise it exposes one sensitive, challenge-bound `approval_commit` continuation in the same agent session. The host may render its native tool confirmation, but its arrival is recorded as `host-gated`, never claimed as proof that a human answered. The server issues an opaque, memory-only intent bound to the action kind, target, subject digest, workspace and MCP run; only one matching retry can consume it. No `config.toml` value or persisted `HOLMES_APPROVAL` is authority. The `holmes-kit approve` TUI is recovery-only when a session cannot present approval. Under autonomous mode, eligible low-risk work stays automatic and an ordinary unclassified HITL request queues without interrupting the agent; high-risk or irreversible work is shown in the session and waits for an answer. Timeout, cancel, deny, malformed and unavailable outcomes never approve *(timeout: since 0.35.3)*.
|
|
38
39
|
- 🧾 **A new prompt is checked against governed intent before it becomes a new spec** *(new in 0.29.0)*: `requirement_triage` reads the approved REQ/H-SPEC/A-SPEC/T-SPEC lineage, a receipt-bound current RTM graph, source and requirement-document semantic coverage, code anchors, and exact-HEAD execution evidence before recommending `fulfilled`, `existing-change`, `new`, or `ambiguous`. BM25 is always present; a verified local BGE-M3 cache and explicit Gemini opt-in add candidates and also enter the ranking score, so when lexical evidence is weak or tied a semantic match can decide which lineage leads — every such answer shows its semantic coverage, and a run that used no semantic score says `lexicalOnly: true`. A cold, stale, unreadable, failed, partial, or absent lane remains visible as ambiguity; a workspace with no semantic tier, or with transfer switched off by `HOLMES_NO_SEMANTIC_WARM`, runs **lexical-only** — it can still author a new REQ, and the answer and its evidence say `lexicalOnly: true` (set it in the environment of both your harness — its hooks spawn the background refresh — and the Holmes MCP server; a refresh recorded as suppressed also keeps triage from embedding. The switch stops automatic transfer: the background refresh embeds neither source nor requirement documents, and `requirement_triage` does not embed the prompt; tools you invoke explicitly under an opted-in cloud tier — `maintenance_analyze`, `issue_localize`, `rtm_reindex` — still embed their query or index as before). The detached refresh worker warms both versioned semantic populations under existing cloud-consent rules; a persisted v2 artifact binds prompt, workspace, HEAD, and receipt generation. New REQ creation — through `spec_create` or `spec_slice_init` — verifies that evidence at one shared MCP boundary, so no supported harness or tool can bypass it.
|
|
39
40
|
- 🧭 **One governed operating contract survives every harness** *(new in 0.28.0)*: the common managed block in `AGENTS.md` carries the same No Spec, No Code rules to Claude Code, Codex CLI, and Antigravity while leaving the repository's own rules outside the block intact. `holmes-kit guidance check` names a stale or locally conflicted managed block, `guidance refresh` first plans the change and then replaces only the Holmes-owned region, and `doctor` runs the same check. An installer or upgrader cannot silently discard local guidance.
|
|
40
41
|
- 🧷 **A worktree can prove which workspace the MCP server serves before an edit** *(new in 0.28.0)*: `workspace_preflight` returns the bound root/store identity and reports a foreign caller as a mismatch without registering, rebinding, or writing anything. `holmes-kit doctor --agent claude|codex|antigravity` checks each harness's local wiring prerequisites and states that preparation is not evidence of live hook enforcement. This is paired with a packaged Superpowers compatibility playbook that preserves Holmes specifications, RED/GREEN evidence, review closure, and finish/reconciliation requirements through the corresponding Superpowers workflow. Fixture and subprocess coverage preserve neighboring configuration and foreign-root isolation; live linked-worktree and paid-harness acceptance remain explicitly unverified until observed.
|
|
@@ -83,7 +84,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
|
|
|
83
84
|
- 📋 **Requirements & specification governance**: strict **"No Spec, No Code"** across a 4-tier chain (`REQ ➔ H-SPEC ➔ A-SPEC ➔ T-SPEC`) with `// @implements A-SPEC-XXX` code anchors — comma-lists and every anchor in a file participate in the gate.
|
|
84
85
|
- 🔴 **Inbuilt TDD — RED-first, enforced not asked** *(0.9.0)*: constitution article **ART-8** requires a recorded `red-assertion → green` sequence in the ledger, and a `red-error` (a test that could not run) is not a valid RED — so "the covering test failed *correctly*" is judged mechanically, not on trust. Ships observe-first (`redFirstEvidence: track`). Where superpowers *asks* for RED-first, holmes-kit *proves* it.
|
|
85
86
|
- 🧱 **Deterministic gate, hardened** *(0.8.0, 0.13.0)*: shell writes are judged at the segment's **effective working directory**, the governing anchor is the whole set rather than the first match, a project is governed when **any** spec exists, and `cp`/`mv` are classified by **destination**. Every gate change ships with two consecutive clean adversarial rounds.
|
|
86
|
-
- 🤖 **Autonomous approval — three layers, always bounded** *(0.8.0, reworked 0.13.0; session UX 0.29.0)*: a project default (`init --autonomy`) and an expiring per-session envelope let the agent seal **low-risk** specs itself under an `autonomous:<client>` actor. Ordinary unclassified HITL work queues without a form; governance-critical, high-risk or irreversible work stays in-session human-confirmed
|
|
87
|
+
- 🤖 **Autonomous approval — three layers, always bounded** *(0.8.0, reworked 0.13.0; session UX 0.29.0)*: a project default (`init --autonomy`) and an expiring per-session envelope let the agent seal **low-risk** specs itself under an `autonomous:<client>` actor. Ordinary unclassified HITL work queues without a form; governance-critical, high-risk or irreversible work stays in-session human-confirmed; a form that is not answered returns to the approval queue *(since 0.35.3 — it was recorded as an approval before)*. The agent can never grant autonomy to itself, the posture is surfaced at every session start, and off is byte-identical to a human-gated project.
|
|
87
88
|
- 🧭 **Compatibility and evolution gates** *(0.14.0, 0.15.0)*: a new A-SPEC seals only with `harness_impact:` and `os_impact:` declared and machine-cross-checked against Files-to-Touch; separately, a changed in-scope source that **newly introduces an external dependency** raises a spec-reappraisal — a warning when manual, a queued item under autonomy, never a blocked turn.
|
|
88
89
|
- 🚢 **Release autonomy + docs-currency gate** *(0.13.0, machine-checked in 0.23.2)*: `npm publish` stays **human-approved by default** while a deterministic classifier lets a low-risk release self-publish under the ledger; a major bump or any gate-behavior/security/architecture spec forces HITL. The publish gate refuses a release whose docs never caught up — a stale doc is a false claim.
|
|
89
90
|
- 🧠 **3-tier semantic layer** *(local preparation default in 0.29.0)*: BGE-M3 is prepared and verified locally during a normal npm installation (zero repository-text egress); `HOLMES_SKIP_MODEL_INSTALL=1` is the explicit opt-out. `cloud` remains the opt-in `gemini-embedding-001` tier. Measured on 305 traceability cases: recall 0.486 → 0.667 → **0.887**; on lexical-zero requests 0% → 52% → **92%**. Surfaced additively, never as a hard filter.
|
|
@@ -91,7 +92,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
|
|
|
91
92
|
- 🐞 **Causal defect localization & CPG** *(equalized in 0.5–0.7)*: AST code property graph (CFG/DDG/CDG) and dataflow taint reachability across 7 languages — **42 language×layer cells graded on measured evidence** (11 corpora, 39,344 functions, zero invariant violations; C++ conditional on 67.9% parse coverage, disclosed in the matrix).
|
|
92
93
|
- 📏 **Measured, not claimed** *(0.3.x)*: performance is judged against a pre-registered modeled-human band (R 0.67–0.78 / P ≈0.9±). Current official grade: **band entry on recall; division-of-labor precision 0.727 = 81% of the modeled human**, reproduced by an independent context-free judge on a fresh blind window. No superhuman claims until both metrics exceed the band.
|
|
93
94
|
- 📊 **RTM dashboard & heatmaps** *(0.12.0–0.12.1)*: `holmes-kit serve` renders a real 2D coverage matrix (requirements × pipeline stages) with an honesty census, drills into a symbol's **CFG as a layered DAG with PDG colour overlays**, and a non-CFG language is named rather than faked. Standalone HTML/SVG reports (`generateRtmHeatmap`) cover spec coverage and taint reachability.
|
|
94
|
-
- 🔔 **Approval UX** *(0.3.1; inbox split 0.15.0; in-session recovery 0.29.0)*: the agent-session UI is primary; the tracked queue is the fallback when the client cannot present it. A form timeout is distinguished from cancel/unavailable, and
|
|
95
|
+
- 🔔 **Approval UX** *(0.3.1; inbox split 0.15.0; in-session recovery 0.29.0)*: the agent-session UI is primary; the tracked queue is the fallback when the client cannot present it. A form timeout is distinguished from cancel/unavailable, and in every mode it returns the request to the queue. The queue holds **decision-seeking requests only** — plain gate refusals live in a local per-machine log (raw commands never leave the machine), after 1,404 single-shot refusals were measured burying a 2-item inbox.
|
|
95
96
|
- ⬆️ **Zero-config upgrades & session banner** *(0.8.0–0.12.2)*: `holmes-kit upgrade` re-pins **every** recorded workspace in one command (`--dry-run`/`--yes`), and every session start states the version, the governance rule and any newer published version — from every harness's MCP startup, not just Claude's. The write stays your explicit choice, never a silent auto-install.
|
|
96
97
|
- 🧰 **Governance UX tools** *(0.10.0)*: `spec_unseal` (return a sealed spec to editable `draft` in one act, out-of-band approval required), `approval_status` and `ledger_timeline` for read-only observability, and a structured `conflict` on optimistic-concurrency refusal.
|
|
97
98
|
- 🚦 **Push & server-side re-validation** *(hardened in 0.8.0)*: a local `pre-push` evidence gate (test-run ledger head == push HEAD, green, executed > 0) plus a server-side workflow that re-runs `npm ci → build → full suite → tarball install probe`, so a `--no-verify` push or a hook-less clone is still caught.
|
package/dist/.build-id
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
39b711d0-muupj0n0
|
|
@@ -20,6 +20,11 @@ import { ExecutionContext } from '../project/execution-context';
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const QUEUE_RELPATH: string;
|
|
22
22
|
export declare const DECISION_KINDS: ReadonlySet<string>;
|
|
23
|
+
/**
|
|
24
|
+
* The line a refusal ends with to name its pending request and the operator command.
|
|
25
|
+
* @implements A-SPEC-134.2 — one wording for a request just filed and for one that was already pending.
|
|
26
|
+
*/
|
|
27
|
+
export declare function pendingRequestLine(id: string): string;
|
|
23
28
|
export interface RefusalRecord {
|
|
24
29
|
event: 'requested';
|
|
25
30
|
id: string;
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.DECISION_KINDS = exports.QUEUE_RELPATH = void 0;
|
|
37
|
+
exports.pendingRequestLine = pendingRequestLine;
|
|
37
38
|
exports.refusalsFilename = refusalsFilename;
|
|
38
39
|
exports.isRefusalsFilename = isRefusalsFilename;
|
|
39
40
|
exports.readRefusals = readRefusals;
|
|
@@ -47,7 +48,7 @@ exports.queueHint = queueHint;
|
|
|
47
48
|
exports.grantableRequests = grantableRequests;
|
|
48
49
|
exports.openOccurrences = openOccurrences;
|
|
49
50
|
exports.asPendingRequest = asPendingRequest;
|
|
50
|
-
// @implements A-SPEC-244, A-SPEC-626, A-SPEC-752, A-SPEC-754
|
|
51
|
+
// @implements A-SPEC-134.2, A-SPEC-244, A-SPEC-626, A-SPEC-752, A-SPEC-754
|
|
51
52
|
const execution_context_1 = require("../project/execution-context");
|
|
52
53
|
const root_1 = require("../project/root");
|
|
53
54
|
const node_crypto_1 = require("node:crypto");
|
|
@@ -85,9 +86,19 @@ exports.QUEUE_RELPATH = path.join('.ax', 'approvals', 'queue.jsonl');
|
|
|
85
86
|
// human, review_record's refusal points that human at `holmes-kit approve`, and without this entry the
|
|
86
87
|
// request went to the refusal log so the inbox stayed empty (measured 2026-09-14 on Windows: two
|
|
87
88
|
// expired session dialogs, then `approve --list` answered "No requests awaiting approval").
|
|
89
|
+
// @implements A-SPEC-134.2 — `code-write` is a decision too: the constitution-debt refusal points the operator at
|
|
90
|
+
// `holmes-kit approve`, and its target is a project-relative path, not a command line, so the reason shell
|
|
91
|
+
// requests stay out of the tracked queue does not apply.
|
|
88
92
|
exports.DECISION_KINDS = new Set([
|
|
89
|
-
'spec-approve', 'config-write', 'autonomy-grant', 'spec-reappraisal', 'review-resolve', 'governance-wiring',
|
|
93
|
+
'spec-approve', 'config-write', 'autonomy-grant', 'spec-reappraisal', 'review-resolve', 'governance-wiring', 'code-write',
|
|
90
94
|
]);
|
|
95
|
+
/**
|
|
96
|
+
* The line a refusal ends with to name its pending request and the operator command.
|
|
97
|
+
* @implements A-SPEC-134.2 — one wording for a request just filed and for one that was already pending.
|
|
98
|
+
*/
|
|
99
|
+
function pendingRequestLine(id) {
|
|
100
|
+
return `\n[승인 대기 ${id}] 운영자: ${(0, npx_bin_1.npxBin)()} holmes-kit approve`;
|
|
101
|
+
}
|
|
91
102
|
const REFUSALS_FILE_RE = /^refusals\.([^.]+)\.jsonl$/;
|
|
92
103
|
function refusalsFilename(replica) {
|
|
93
104
|
return `refusals.${replica}.jsonl`;
|
|
@@ -508,7 +519,7 @@ function queueHint(root, req, opts) {
|
|
|
508
519
|
// @implements A-SPEC-564.2 — the hint is composed BEFORE the enqueue so the refusal record can
|
|
509
520
|
// carry its own feedback cost: reasonBytes = the caller's base reason + this hint, i.e. the text
|
|
510
521
|
// that actually re-enters the conversation. Observation only — nothing reads it on a gate path.
|
|
511
|
-
const hint = denialLine + (opts?.pendingHint ? opts.pendingHint(id) :
|
|
522
|
+
const hint = denialLine + (opts?.pendingHint ? opts.pendingHint(id) : pendingRequestLine(id));
|
|
512
523
|
return enqueueApprovalRequest(root, { ...req, reasonBytes: (opts?.baseReasonBytes ?? 0) + hint.length })
|
|
513
524
|
? hint
|
|
514
525
|
: denialLine;
|
|
@@ -41,7 +41,7 @@ export declare function specApprovalAutonomyReason(spec: Spec, resolveParent: (i
|
|
|
41
41
|
* `specApprovalAutonomy(...) === 'hitl'`: an upstream REQ/H-SPEC with no implemented A-SPEC is
|
|
42
42
|
* not identified as high-risk yet, so autonomous mode queues it without interrupting the agent.
|
|
43
43
|
* Architecture, an explicitly high-risk A-SPEC, and an upstream document leading to either remain
|
|
44
|
-
* visible to a human;
|
|
44
|
+
* visible to a human; a prompt that is not answered is held (A-SPEC-718.1).
|
|
45
45
|
*/
|
|
46
46
|
export declare function requiresAutonomousApprovalPrompt(spec: Spec, descendants?: Spec[]): boolean;
|
|
47
47
|
export declare const SESSION_AUTONOMY_MARKER: readonly [".ax", "state", "autonomy.json"];
|
|
@@ -249,7 +249,7 @@ function specApprovalAutonomyReason(spec, resolveParent, descendants) {
|
|
|
249
249
|
* `specApprovalAutonomy(...) === 'hitl'`: an upstream REQ/H-SPEC with no implemented A-SPEC is
|
|
250
250
|
* not identified as high-risk yet, so autonomous mode queues it without interrupting the agent.
|
|
251
251
|
* Architecture, an explicitly high-risk A-SPEC, and an upstream document leading to either remain
|
|
252
|
-
* visible to a human;
|
|
252
|
+
* visible to a human; a prompt that is not answered is held (A-SPEC-718.1).
|
|
253
253
|
*/
|
|
254
254
|
function requiresAutonomousApprovalPrompt(spec, descendants) {
|
|
255
255
|
switch (spec.type) {
|
|
@@ -48,7 +48,7 @@ exports.gateErrorDecision = gateErrorDecision;
|
|
|
48
48
|
exports.wiredSpecsDir = wiredSpecsDir;
|
|
49
49
|
exports.evaluateHook = evaluateHook;
|
|
50
50
|
exports.readSpecsSync = readSpecsSync;
|
|
51
|
-
// @implements A-SPEC-278, A-SPEC-733, A-SPEC-734, A-SPEC-747, A-SPEC-477.1, A-SPEC-753, A-SPEC-163.7
|
|
51
|
+
// @implements 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
|
|
52
52
|
const shell_argument_roles_1 = require("../guardrail/shell-argument-roles");
|
|
53
53
|
// @implements A-SPEC-549.3 — the hook's deny reasons are English here; hooks-english.test.ts drives
|
|
54
54
|
// evaluateHook in this file to prove it.
|
|
@@ -2580,11 +2580,20 @@ function evaluateHook(input, specsDir, opts) {
|
|
|
2580
2580
|
if (debt && debt.length > 0 && !cureOnly
|
|
2581
2581
|
&& (0, approval_grants_1.resolveApproval)(projectRoot, weApproval, { kind: 'code-write', target: relPath }, nowTs) === undefined) {
|
|
2582
2582
|
const why = `code write under constitution debt (${debt.join(', ')})`;
|
|
2583
|
+
let hint = (0, approval_queue_1.queueHint)(projectRoot, { kind: 'code-write', target: relPath, why });
|
|
2584
|
+
// @implements A-SPEC-134.2 — a decision-kind request that is already pending is not written again, so the
|
|
2585
|
+
// hint is empty for it. The refusal still names that request; "could not persist" is for a queue that
|
|
2586
|
+
// really could not be written.
|
|
2587
|
+
if (!hint) {
|
|
2588
|
+
const id = (0, approval_queue_1.approvalRequestId)('code-write', relPath);
|
|
2589
|
+
if ((0, approval_queue_1.readQueue)(projectRoot).pending.some((request) => request.id === id)) {
|
|
2590
|
+
hint = (0, approval_queue_1.pendingRequestLine)(id);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2583
2593
|
return {
|
|
2584
2594
|
permissionDecision: 'deny',
|
|
2585
2595
|
permissionDecisionReason: `[Holmes-Kit] constitution-debt outstanding (${debt.join(', ')}) — resolve the constitution (a clean turn clears it) before writing new code, or supply a covering approval`
|
|
2586
|
-
+ (
|
|
2587
|
-
|| ' — could not persist the approval request; ask the operator to check the project approval queue storage'),
|
|
2596
|
+
+ (hint || ' — could not persist the approval request; ask the operator to check the project approval queue storage'),
|
|
2588
2597
|
};
|
|
2589
2598
|
}
|
|
2590
2599
|
}
|
|
@@ -7,7 +7,10 @@ export type ApprovalPolicyDecision = {
|
|
|
7
7
|
kind: 'hold';
|
|
8
8
|
reason: string;
|
|
9
9
|
};
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The sole response transition table; timeout is never a synonym for cancel or deny.
|
|
12
|
+
* A-SPEC-718.1: it is not a synonym for approve either — an unanswered prompt is held in every mode.
|
|
13
|
+
*/
|
|
11
14
|
export declare function resolveApprovalPresentation(result: ApprovalPresentationResult, options: {
|
|
12
15
|
autonomous: boolean;
|
|
13
16
|
harness: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveApprovalPresentation = resolveApprovalPresentation;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The sole response transition table; timeout is never a synonym for cancel or deny.
|
|
6
|
+
* A-SPEC-718.1: it is not a synonym for approve either — an unanswered prompt is held in every mode.
|
|
7
|
+
*/
|
|
5
8
|
function resolveApprovalPresentation(result, options) {
|
|
6
9
|
const harness = options.harness.trim() || 'unknown';
|
|
7
10
|
switch (result.kind) {
|
|
8
11
|
case 'approve': return { kind: 'approved', actor: `elicitation:${harness}`, ...(result.reason ? { reason: result.reason } : {}) };
|
|
9
|
-
case 'timeout': return
|
|
10
|
-
? { kind: 'approved', actor: `autonomous-timeout:${harness}`, reason: 'in-session approval timeout' }
|
|
11
|
-
: { kind: 'hold', reason: 'approval prompt timed out' };
|
|
12
|
+
case 'timeout': return { kind: 'hold', reason: 'approval prompt timed out' };
|
|
12
13
|
case 'deny': return { kind: 'hold', reason: result.reason ? `denied: ${result.reason}` : 'denied' };
|
|
13
14
|
case 'question': return { kind: 'hold', reason: `question: ${result.reason}` };
|
|
14
15
|
case 'cancel': return { kind: 'hold', reason: 'cancelled' };
|
|
@@ -34,8 +34,6 @@ export interface ElicitApprovalRequest {
|
|
|
34
34
|
target: string;
|
|
35
35
|
/** Human-facing one-liner: what is being approved (id, title, sealed-or-not). */
|
|
36
36
|
summary: string;
|
|
37
|
-
/** Server-derived outcome wording; only explicit autonomy may select automatic approval. */
|
|
38
|
-
timeoutBehavior?: 'queue' | 'autonomous-approve';
|
|
39
37
|
}
|
|
40
38
|
/** The human's decision. `null` from interpretElicitResult means "no answer in this shape". */
|
|
41
39
|
export interface ElicitDecision {
|
|
@@ -9,7 +9,7 @@ exports.buildDecisionForm = buildDecisionForm;
|
|
|
9
9
|
exports.buildReasonForm = buildReasonForm;
|
|
10
10
|
exports.runElicitFlow = runElicitFlow;
|
|
11
11
|
exports.interpretElicitResult = interpretElicitResult;
|
|
12
|
-
// @implements A-SPEC-718, A-SPEC-263.1, A-SPEC-732
|
|
12
|
+
// @implements A-SPEC-718.2, A-SPEC-718, A-SPEC-263.1, A-SPEC-732
|
|
13
13
|
const npx_bin_1 = require("../project/npx-bin");
|
|
14
14
|
/**
|
|
15
15
|
* The decision comes INTO the session (REQ-263): an approval-shaped refusal (spec_approve without a
|
|
@@ -108,9 +108,8 @@ const flat = (s, max) => s.replace(/[\u0000-\u001f\u007f\u0085\u2028\u2029\u200b
|
|
|
108
108
|
*/
|
|
109
109
|
function buildDecisionForm(req, attempt, timeoutMs) {
|
|
110
110
|
const redisplay = attempt > 1 ? `⚠ 재표시 ${attempt}/${exports.MAX_PRESENTATIONS} — 이전 다이얼로그는 만료되어 무효입니다\n` : '';
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
: `⏱ ${timeoutMs / 1000}초 내 미결정 시 승인 큐로 회송됩니다(운영자: ${(0, npx_bin_1.npxBin)()} holmes-kit approve).`;
|
|
111
|
+
// @implements A-SPEC-718.2 — one outcome for silence, in every mode: the request returns to the queue.
|
|
112
|
+
const timeoutNotice = `⏱ ${timeoutMs / 1000}초 내 미결정 시 승인 큐로 회송됩니다(운영자: ${(0, npx_bin_1.npxBin)()} holmes-kit approve).`;
|
|
114
113
|
return {
|
|
115
114
|
// @implements A-SPEC-497.1 — the forewarning is the LAST line and template-owned: it survives a
|
|
116
115
|
// cap-filling summary (appended after the caps) and tells the human, before the clock runs out,
|
|
@@ -11,9 +11,8 @@ export interface ReviewEvidenceContext {
|
|
|
11
11
|
projectRootOf(root: string): string;
|
|
12
12
|
basisFor(root: string | undefined, withDisk?: boolean): Basis;
|
|
13
13
|
hasElicitor(): boolean;
|
|
14
|
-
tryElicit(kind: string, target: string, summary: string
|
|
14
|
+
tryElicit(kind: string, target: string, summary: string): Promise<ElicitOutcome>;
|
|
15
15
|
elicitApproval(reason?: string): Approval;
|
|
16
|
-
autonomousApproval(derivedFrom?: string[], source?: 'immediate' | 'timeout'): Approval;
|
|
17
16
|
resolveHandlerApproval(root: string | undefined, approval: Approval | undefined, action: {
|
|
18
17
|
kind: string;
|
|
19
18
|
target: string;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.summarizeReviewNeeded = summarizeReviewNeeded;
|
|
37
37
|
exports.createReviewEvidenceHandlers = createReviewEvidenceHandlers;
|
|
38
|
-
// @implements A-SPEC-718, A-SPEC-746, A-SPEC-617, A-SPEC-100.2, A-SPEC-102.1, A-SPEC-133, A-SPEC-135, A-SPEC-141, A-SPEC-157, A-SPEC-160, A-SPEC-189, A-SPEC-191, A-SPEC-244, A-SPEC-245, A-SPEC-263.1, A-SPEC-497.1, A-SPEC-732
|
|
38
|
+
// @implements A-SPEC-718.1, A-SPEC-718.2, A-SPEC-718, A-SPEC-746, A-SPEC-617, A-SPEC-100.2, A-SPEC-102.1, A-SPEC-133, A-SPEC-135, A-SPEC-141, A-SPEC-157, A-SPEC-160, A-SPEC-189, A-SPEC-191, A-SPEC-244, A-SPEC-245, A-SPEC-263.1, A-SPEC-497.1, A-SPEC-732
|
|
39
39
|
const path = __importStar(require("node:path"));
|
|
40
40
|
const findings_1 = require("../../review/findings");
|
|
41
41
|
const review_targets_1 = require("../../review/review-targets");
|
|
@@ -45,7 +45,6 @@ const ledger_store_1 = require("../../governance/ledger-store");
|
|
|
45
45
|
const ledger_lock_1 = require("../../governance/ledger-lock");
|
|
46
46
|
const approval_grants_1 = require("../../governance/approval-grants");
|
|
47
47
|
const provenance_chain_1 = require("../../governance/provenance-chain");
|
|
48
|
-
const autonomy_1 = require("../../governance/autonomy");
|
|
49
48
|
/**
|
|
50
49
|
* @implements A-SPEC-746 — the review-needed backlog as an agent reads it: one row per spec (signals
|
|
51
50
|
* merged, files unioned), newest first, without the from/to digests — 64-hex identifiers were most of
|
|
@@ -132,6 +131,7 @@ function createReviewEvidenceHandlers(context) {
|
|
|
132
131
|
// not covered by env/grant, ask now and carry the grant into the lock as data. TOCTOU folds
|
|
133
132
|
// fail-closed — state moved so the lift is no longer needed → the grant is simply unused;
|
|
134
133
|
// state moved so a lift IS needed that the snapshot missed → no grant → the standard refusal.
|
|
134
|
+
// @implements A-SPEC-718.1 — only a person's answer is a grant here; this handler holds no autonomous channel.
|
|
135
135
|
const elicitGrants = new Map();
|
|
136
136
|
// A DENY at pre-scan is carried as data too (round-1): throwing here judged a stale snapshot —
|
|
137
137
|
// a finding concurrently resolved by someone else no longer needs a lift inside the lock, and
|
|
@@ -144,13 +144,6 @@ function createReviewEvidenceHandlers(context) {
|
|
|
144
144
|
const elicitExpiries = new Map();
|
|
145
145
|
if (context.hasElicitor()) {
|
|
146
146
|
try {
|
|
147
|
-
// @implements A-SPEC-732 (round 2) — autonomy is read at the project root, never a raw root.
|
|
148
|
-
const autonomyOn = (0, autonomy_1.autonomousApprovalEnabled)(process.env, (() => { try {
|
|
149
|
-
return context.projectRootOf(a.root);
|
|
150
|
-
}
|
|
151
|
-
catch {
|
|
152
|
-
return undefined;
|
|
153
|
-
} })(), new Date().toISOString());
|
|
154
147
|
const snapshot = new Map();
|
|
155
148
|
for (const f of new findings_1.FindingsLedger(findingsFile).list())
|
|
156
149
|
snapshot.set(f.id, f);
|
|
@@ -168,13 +161,12 @@ function createReviewEvidenceHandlers(context) {
|
|
|
168
161
|
}
|
|
169
162
|
if (context.resolveHandlerApproval(a.root, env0, { kind: 'review-resolve', target: f.id }, new Date().toISOString()) !== undefined)
|
|
170
163
|
continue; // an open door never summons a human
|
|
171
|
-
const out = await context.tryElicit('review-resolve', f.id, `열린 치명 발견 ${f.id} 의 해소
|
|
164
|
+
const out = await context.tryElicit('review-resolve', f.id, `열린 치명 발견 ${f.id} 의 해소 기록`);
|
|
172
165
|
if (out.kind === 'answered' && out.decision.granted)
|
|
173
166
|
elicitGrants.set(f.id, { approval: context.elicitApproval(out.decision.reason), source: 'elicitation' });
|
|
174
167
|
else if (out.kind === 'answered')
|
|
175
168
|
elicitDenials.set(f.id, out.decision.reason ?? '(사유 없음)');
|
|
176
|
-
|
|
177
|
-
elicitGrants.set(f.id, { approval: context.autonomousApproval(undefined, 'timeout'), source: 'autonomous' });
|
|
169
|
+
// @implements A-SPEC-718.1 — an expired dialog grants nothing in any mode.
|
|
178
170
|
else if (out.kind === 'expired')
|
|
179
171
|
elicitExpiries.set(f.id, out.waitedMs);
|
|
180
172
|
}
|
|
@@ -10,9 +10,9 @@ export interface SpecApprovalContext {
|
|
|
10
10
|
resolver(specs: Spec[]): (id: string) => Spec | null;
|
|
11
11
|
projectRootOf(root: string): string;
|
|
12
12
|
cachedScan(root: string, repoRoot?: string): ScannedFile[];
|
|
13
|
-
tryElicit(kind: string, target: string, summary: string
|
|
13
|
+
tryElicit(kind: string, target: string, summary: string): Promise<ElicitOutcome>;
|
|
14
14
|
elicitApproval(reason?: string): Approval;
|
|
15
|
-
autonomousApproval(derivedFrom?: string[]
|
|
15
|
+
autonomousApproval(derivedFrom?: string[]): Approval;
|
|
16
16
|
approvalAdapter(): ApprovalAdapter;
|
|
17
17
|
approvalHarness(): string;
|
|
18
18
|
prepareHostApproval(input: {
|
|
@@ -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-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
|
|
38
|
+
// @implements 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
|
|
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");
|
|
@@ -205,7 +205,7 @@ function createSpecApprovalHandlers(context) {
|
|
|
205
205
|
// The MODEL text is capped BEFORE the server markers are appended (round-2): a ~185+ char
|
|
206
206
|
// title pushed '(재봉인)' past the dialog's 200-char summary cap, dressing a re-seal (the
|
|
207
207
|
// more consequential act) as a first approval. The cap cuts the title, never the marker.
|
|
208
|
-
const out = await tryElicit('spec-approve', a.id, `${a.id} — ${target.spec.title.slice(0, 120)}${resealing ? ' (재봉인)' : ''}${noIntake ? ' (triage 기록 없음)' : ''}
|
|
208
|
+
const out = await tryElicit('spec-approve', a.id, `${a.id} — ${target.spec.title.slice(0, 120)}${resealing ? ' (재봉인)' : ''}${noIntake ? ' (triage 기록 없음)' : ''}`);
|
|
209
209
|
const presentation = out.kind === 'answered'
|
|
210
210
|
? (out.decision.granted ? { kind: 'approve', reason: out.decision.reason } : { kind: 'deny', reason: out.decision.reason })
|
|
211
211
|
: out.kind === 'expired' ? { kind: 'timeout' } : { kind: 'unavailable' };
|
|
@@ -214,19 +214,14 @@ function createSpecApprovalHandlers(context) {
|
|
|
214
214
|
approveResolved = { approval: elicitApproval(out.kind === 'answered' ? out.decision.reason : undefined), source: 'elicitation' };
|
|
215
215
|
decidedSubject = targetSubject;
|
|
216
216
|
}
|
|
217
|
-
else if (decision.kind === 'approved' && presentation.kind === 'timeout') {
|
|
218
|
-
approveResolved = { approval: autonomousApproval(undefined, 'timeout'), source: 'autonomous' };
|
|
219
|
-
decidedSubject = targetSubject;
|
|
220
|
-
}
|
|
221
217
|
else if (out.kind === 'answered') {
|
|
222
218
|
// The human ANSWERED (deny/question/decline): the answer is the message, and no queue
|
|
223
219
|
// entry is filed — a decided request is not a pending one (REQ-246 visibility).
|
|
224
220
|
return { ok: false, reason: `spec_approve: 세션에서 거부됨 — ${out.decision.reason ?? '(사유 없음)'}. 사유를 해소한 뒤 다시 시도하십시오.` };
|
|
225
221
|
}
|
|
226
222
|
else if (out.kind === 'expired') {
|
|
227
|
-
// @implements A-SPEC-718 — a direct in-session prompt may time out.
|
|
228
|
-
//
|
|
229
|
-
// OFF keeps the established fail-closed expiry + queue behavior.
|
|
223
|
+
// @implements A-SPEC-718.1 — a direct in-session prompt may time out. Silence is not a
|
|
224
|
+
// decision in any mode: the expiry is reported and the request stays in the queue.
|
|
230
225
|
elicitExpiredMs = out.waitedMs;
|
|
231
226
|
}
|
|
232
227
|
else if (out.kind === 'silent' && context.approvalAdapter().kind === 'host-gated-tool' && bindingOk()) {
|
|
@@ -406,15 +406,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
|
|
|
406
406
|
root: string;
|
|
407
407
|
base?: string;
|
|
408
408
|
head?: string;
|
|
409
|
-
since
|
|
410
|
-
/**
|
|
411
|
-
* A root the caller named that this process cannot read is the CALLER'S mistake, not a fault.
|
|
412
|
-
* @implements A-SPEC-189 §10 (round 11)
|
|
413
|
-
*/
|
|
414
|
-
? /**
|
|
415
|
-
* A root the caller named that this process cannot read is the CALLER'S mistake, not a fault.
|
|
416
|
-
* @implements A-SPEC-189 §10 (round 11)
|
|
417
|
-
*/: string;
|
|
409
|
+
since?: string;
|
|
418
410
|
}) => Promise<{
|
|
419
411
|
requirementSemanticWarm?: {
|
|
420
412
|
tier: string;
|
|
@@ -38,7 +38,7 @@ exports.isHandlerRefusal = isHandlerRefusal;
|
|
|
38
38
|
exports.unreadableAmong = unreadableAmong;
|
|
39
39
|
exports.makeHandlers = makeHandlers;
|
|
40
40
|
exports.collectDecisions = collectDecisions;
|
|
41
|
-
// @implements A-SPEC-723, 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
|
|
41
|
+
// @implements A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, 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
42
|
const operator_recovery_1 = require("./operator-recovery");
|
|
43
43
|
// @implements A-SPEC-643
|
|
44
44
|
// @implements A-SPEC-642
|
|
@@ -812,7 +812,7 @@ function makeRawHandlers(store, opts) {
|
|
|
812
812
|
// other failure mode (no channel, wrong kind, a throwing elicitor) is `silent`, whose refusal
|
|
813
813
|
// stays byte-identical to the pre-elicitation one — nothing is ever worse than before the
|
|
814
814
|
// channel existed.
|
|
815
|
-
const tryElicit = async (kind, target, summary
|
|
815
|
+
const tryElicit = async (kind, target, summary) => {
|
|
816
816
|
// @implements A-SPEC-540.1 — operator opt-out: with HOLMES_ELICIT=off the server never shows the
|
|
817
817
|
// in-client prompt, folding to the byte-identical `silent` (refuse+enqueue) path so claude/agy/
|
|
818
818
|
// codex all converge on one out-of-band surface (holmes-kit approve). Unset ⇒ unchanged.
|
|
@@ -823,7 +823,7 @@ function makeRawHandlers(store, opts) {
|
|
|
823
823
|
if (!opts?.elicit || !elicit_approval_1.ELICITABLE_KINDS.has(kind))
|
|
824
824
|
return { kind: 'silent' };
|
|
825
825
|
try {
|
|
826
|
-
return await opts.elicit({ kind, target, summary
|
|
826
|
+
return await opts.elicit({ kind, target, summary });
|
|
827
827
|
}
|
|
828
828
|
catch {
|
|
829
829
|
return { kind: 'silent' };
|
|
@@ -845,11 +845,12 @@ function makeRawHandlers(store, opts) {
|
|
|
845
845
|
// rides the existing seal path, but its actor names `autonomous:<client>` so an audit can tell a
|
|
846
846
|
// self-approved seal from a human-approved (elicitation) or operator (env/grant) one. Single-use
|
|
847
847
|
// by construction — it exists only inside this call, persisted nowhere.
|
|
848
|
-
|
|
849
|
-
|
|
848
|
+
// @implements A-SPEC-718.1 — its only source is the grader's `auto`; an expired prompt never reaches it.
|
|
849
|
+
const autonomousApproval = (derivedFrom) => ({
|
|
850
|
+
actor: `autonomous:${opts?.clientName?.() ?? 'unknown'}`,
|
|
850
851
|
token: crypto.randomUUID(),
|
|
851
852
|
// @implements A-SPEC-587 — an upstream grade is DERIVED; the audit line names the A-SPECs it came from.
|
|
852
|
-
rationale: `autonomous grant (${'HOLMES_AUTONOMOUS_APPROVAL'} enabled,
|
|
853
|
+
rationale: `autonomous grant (${'HOLMES_AUTONOMOUS_APPROVAL'} enabled, spec grade auto${derivedFrom && derivedFrom.length > 0 ? ` — derived from ${derivedFrom.join(', ')}` : ''})`,
|
|
853
854
|
});
|
|
854
855
|
// @implements A-SPEC-617, A-SPEC-100.2, A-SPEC-102.1, A-SPEC-133, A-SPEC-135, A-SPEC-141, A-SPEC-157, A-SPEC-160, A-SPEC-189, A-SPEC-191, A-SPEC-244, A-SPEC-245, A-SPEC-263.1, A-SPEC-497.1
|
|
855
856
|
const reviewEvidence = (0, review_evidence_1.createReviewEvidenceHandlers)({
|
|
@@ -862,7 +863,6 @@ function makeRawHandlers(store, opts) {
|
|
|
862
863
|
hasElicitor: () => Boolean(opts?.elicit),
|
|
863
864
|
tryElicit,
|
|
864
865
|
elicitApproval,
|
|
865
|
-
autonomousApproval,
|
|
866
866
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
867
867
|
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
868
868
|
});
|
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.35.
|
|
4
|
+
"version": "0.35.3",
|
|
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",
|