@sema-agent/core 7.5.2 → 7.6.1
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 +67 -0
- package/dist/agents/agent-transcript-tool.d.ts +2 -2
- package/dist/agents/cascade.d.ts +4 -5
- package/dist/agents/cascade.js +12 -10
- package/dist/agents/repair-loop.d.ts +7 -5
- package/dist/agents/repair-loop.js +13 -15
- package/dist/agents/retain-ledger.d.ts +2 -3
- package/dist/agents/send-message-tool.d.ts +2 -2
- package/dist/agents/session-util.d.ts +2 -2
- package/dist/agents/subagent.d.ts +27 -46
- package/dist/agents/subagent.js +119 -105
- package/dist/agents/suspend-guard.d.ts +31 -19
- package/dist/agents/suspend-guard.js +14 -8
- package/dist/agents/teacher.d.ts +2 -2
- package/dist/agents/teacher.js +9 -9
- package/dist/agents/team.d.ts +6 -5
- package/dist/agents/team.js +10 -8
- package/dist/agents/verify.d.ts +8 -9
- package/dist/agents/verify.js +17 -17
- package/dist/core/a2a.js +2 -1
- package/dist/core/agent-definition.d.ts +172 -0
- package/dist/core/agent-definition.js +1 -0
- package/dist/core/ask-origin.d.ts +60 -7
- package/dist/core/ask-origin.js +26 -1
- package/dist/core/checkpoint-store.d.ts +78 -76
- package/dist/core/checkpoint-store.js +17 -1
- package/dist/core/delegation-frames.d.ts +298 -0
- package/dist/core/delegation-frames.js +21 -0
- package/dist/core/engine-notice.d.ts +555 -0
- package/dist/core/engine-notice.js +55 -0
- package/dist/core/gate-fold.d.ts +12 -0
- package/dist/core/gate-fold.js +158 -0
- package/dist/core/gate-lanes.d.ts +93 -0
- package/dist/core/gate-lanes.js +626 -0
- package/dist/core/gate-outcome.d.ts +189 -0
- package/dist/core/gate-outcome.js +70 -0
- package/dist/core/hands-band.d.ts +134 -0
- package/dist/core/hands-band.js +1 -0
- package/dist/core/hooks.d.ts +22 -177
- package/dist/core/hooks.js +53 -851
- package/dist/core/mcp-failure.d.ts +142 -0
- package/dist/core/mcp-failure.js +145 -0
- package/dist/core/mcp-server-spec.d.ts +217 -0
- package/dist/core/mcp-server-spec.js +1 -0
- package/dist/core/mcp.d.ts +21 -77
- package/dist/core/mcp.js +76 -150
- package/dist/core/model-seat.d.ts +99 -0
- package/dist/core/model-seat.js +1 -0
- package/dist/core/pause-registry.d.ts +131 -0
- package/dist/core/pause-registry.js +27 -0
- package/dist/core/reminder-mint.d.ts +10 -0
- package/dist/core/reminder-mint.js +3 -0
- package/dist/core/runner/assemble-result.d.ts +32 -41
- package/dist/core/runner/assemble-result.js +55 -74
- package/dist/core/runner/contracts.d.ts +427 -69
- package/dist/core/runner/denial-limit-arms.d.ts +1 -1
- package/dist/core/runner/denial-limit-arms.js +3 -3
- package/dist/core/runner/gate-exit.d.ts +242 -0
- package/dist/core/runner/gate-exit.js +124 -0
- package/dist/core/runner/park-commit.d.ts +17 -23
- package/dist/core/runner/park-commit.js +14 -15
- package/dist/core/runner/prepare-ask-lane.d.ts +0 -3
- package/dist/core/runner/prepare-ask-lane.js +3 -5
- package/dist/core/runner/prepare-boundary-parks.d.ts +3 -6
- package/dist/core/runner/prepare-boundary-parks.js +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +2 -7
- package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -7
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -7
- package/dist/core/runner/prepare-gate-stations.js +29 -54
- package/dist/core/runner/prepare-inherited-gate.js +1 -1
- package/dist/core/runner/prepare-memory.d.ts +44 -26
- package/dist/core/runner/prepare-park-ask.d.ts +2 -4
- package/dist/core/runner/prepare-park-ask.js +5 -5
- package/dist/core/runner/prepare-task.d.ts +2 -2
- package/dist/core/runner/prepare-task.js +8 -9
- package/dist/core/runner/prepare-wiring-manifest.d.ts +7 -15
- package/dist/core/runner/prepare-wiring-manifest.js +9 -10
- package/dist/core/runner/runtask.d.ts +20 -102
- package/dist/core/runner/runtask.js +119 -121
- package/dist/core/runner/terminal-projection.d.ts +22 -0
- package/dist/core/runner/terminal-projection.js +28 -0
- package/dist/core/runner-deps.d.ts +1416 -0
- package/dist/core/runner-deps.js +1 -0
- package/dist/core/runtime-caps.d.ts +164 -0
- package/dist/core/runtime-caps.js +1 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +4 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +8 -2
- package/dist/core/task-event.d.ts +910 -0
- package/dist/core/task-event.js +1 -0
- package/dist/core/task-limits.d.ts +110 -0
- package/dist/core/task-limits.js +1 -0
- package/dist/core/task-result.d.ts +809 -0
- package/dist/core/task-result.js +1 -0
- package/dist/core/task-spec.d.ts +1370 -0
- package/dist/core/task-spec.js +1 -0
- package/dist/core/task-stream.d.ts +382 -0
- package/dist/core/task-stream.js +1 -0
- package/dist/core/terminal-cause.d.ts +137 -0
- package/dist/core/terminal-cause.js +9 -0
- package/dist/core/tool-policy.d.ts +43 -139
- package/dist/core/tool-policy.js +79 -112
- package/dist/core/tool-spec.d.ts +1174 -0
- package/dist/core/tool-spec.js +1 -0
- package/dist/core/types.d.ts +27 -7789
- package/dist/core/types.js +2 -76
- package/dist/core/warm-resume.d.ts +2 -2
- package/dist/core/wiring-manifest.d.ts +6 -3
- package/dist/core/workflow-journal-store.js +3 -4
- package/dist/engine/harness/agent-harness.d.ts +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.js +9 -6
- package/dist/orchestration/builtin-workflows.d.ts +2 -2
- package/dist/orchestration/builtin-workflows.js +1 -1
- package/dist/orchestration/goal.d.ts +2 -2
- package/dist/orchestration/goal.js +8 -7
- package/dist/orchestration/run-spec.d.ts +2 -2
- package/dist/orchestration/run-spec.js +5 -3
- package/dist/orchestration/run-workflow-tool.d.ts +4 -4
- package/dist/orchestration/run-workflow-tool.js +4 -4
- package/dist/orchestration/workflow-governance.d.ts +4 -4
- package/dist/orchestration/workflow-governance.js +4 -2
- package/dist/orchestration/workflow-primitives.d.ts +1 -1
- package/dist/orchestration/workflow-primitives.js +1 -1
- package/dist/orchestration/workflow.d.ts +15 -4
- package/dist/orchestration/workflow.js +64 -39
- package/dist/prompts/supervisor.d.ts +1 -1
- package/dist/prompts/supervisor.js +3 -3
- package/dist/scenarios/scenario-registry.d.ts +3 -3
- package/dist/scenarios/scenario-registry.js +1 -1
- package/dist/scenarios/teacher-quickstart.d.ts +2 -2
- package/dist/server/http.d.ts +2 -2
- package/dist/stores/file/fs-atomic.d.ts +88 -12
- package/dist/stores/file/fs-atomic.js +184 -55
- package/dist/stores/file/index.d.ts +1 -0
- package/dist/stores/file/index.js +1 -0
- package/package.json +3 -1
- package/test/export-surface.snapshot.json +82 -22
package/dist/core/hooks.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ActorAssertion, DocumentContent, ImageContent, TextContent } from "../internal/llm.js";
|
|
2
2
|
import type { ExecutionEnv, FileError, Result, SessionTreeEntry } from "../internal/harness-types.js";
|
|
3
3
|
import type { DecisionReason, PermissionResult, ResolvedAsk, ToolCallRequest, ToolPolicy } from "./tool-policy.js";
|
|
4
|
+
import type { GateOutcome } from "./gate-outcome.js";
|
|
5
|
+
export { normalizeOrgGateVerdict, normalizePersistedRuleHit, persistedRuleMandateOf } from "./gate-lanes.js";
|
|
6
|
+
export { cloneObserverInput } from "./runner/gate-exit.js";
|
|
4
7
|
import { type AskClass } from "./ask-class.js";
|
|
5
|
-
import {
|
|
8
|
+
import type { AutoModeDenialTracker } from "./auto-mode.js";
|
|
9
|
+
export { formatHookFeedback } from "./reminder-mint.js";
|
|
6
10
|
import type { WiringLegKind } from "./wiring-manifest.js";
|
|
7
11
|
/**
|
|
8
12
|
* In-process hook seam (design/37) — a provider-agnostic interception layer modeled on CC's hooks,
|
|
@@ -385,30 +389,7 @@ export declare function runHookSeat<T>(seat: HookSeatName, bound: HookSeatBound,
|
|
|
385
389
|
* expiry, including the ones where the bound was never reached.)
|
|
386
390
|
*/
|
|
387
391
|
export declare function hookSeatExpiredError(seat: HookSeatName, timeoutMs: number, cause: "timeout" | "aborted", consequence: string): Error;
|
|
388
|
-
/**
|
|
389
|
-
* Where a {@link Hooks.permissionDenied} deny came from — our gate-source enum standing in for CC's
|
|
390
|
-
* `decision_reason_type` ('classifier'|'asyncAgent'|'mode'|'rule'), named after OUR adjudicate-chain
|
|
391
|
-
* sources (design/134 R5):
|
|
392
|
-
* - `"policy"` — the ToolPolicy denied directly, or a policy-raised `ask` resolved to deny
|
|
393
|
-
* (headless auto-deny / approver said no / approval aborted).
|
|
394
|
-
* - `"hook"` — a PreToolUse hook `ask` (folded allow→ask) resolved to deny, OR the engine's fail-closed
|
|
395
|
-
* interception of a hook that THREW (RB-442). (A hook's own `deny` short-circuit is EXCLUDED from the
|
|
396
|
-
* event — a decision the hook made; the crash interception is a decision the ENGINE made. The
|
|
397
|
-
* exclusion is ours on that merit; see {@link Hooks.permissionDenied} for why it must NOT be read
|
|
398
|
-
* as a parity claim about this seat's trigger surface.)
|
|
399
|
-
* - `"safety"` — the gate's deterministic egress/irreversibility tighten (design/70 / design/77 §4)
|
|
400
|
-
* raised the `ask` that resolved to deny, from an explicit per-tool mark.
|
|
401
|
-
* - `"shellGate"` — same tighten-deny, but the tool's irreversibility tier was installed by the COARSE
|
|
402
|
-
* `TaskSpec.shellGate` doctrine (design/80 D-E), not an explicit per-tool mark.
|
|
403
|
-
* - `"planMode"` — the design/108 plan-mode write-deny short-circuit (a read-only fidelity gate).
|
|
404
|
-
* - `"org"` (design/182 §7) — the ORG layer: an organization deny rule, or the fail-closed tighten an
|
|
405
|
-
* org-governed deployment applies while it cannot adjudicate against a snapshot (that tighten's ask
|
|
406
|
-
* then resolving to deny). Its own word rather than `"policy"` because the authority is the ORG's
|
|
407
|
-
* published snapshot, not this deployment's `ToolPolicy` — an operator reading "policy" on a call
|
|
408
|
-
* their own policy allowed would be looking in the wrong place.
|
|
409
|
-
*/
|
|
410
|
-
export type PermissionDeniedSource = "policy" | "hook" | "safety" | "shellGate" | "planMode" | "classifier" | "org";
|
|
411
|
-
/** The payload a {@link Hooks.permissionDenied} callback observes (CC-exact fields + `source`). */
|
|
392
|
+
/** The payload a {@link Hooks.permissionDenied} callback observes (CC-exact fields + the gate outcome). */
|
|
412
393
|
export interface PermissionDeniedPayload {
|
|
413
394
|
/** #281 件A — the run/leg identity envelope. Present on every ENGINE emission (the gate's single
|
|
414
395
|
* deny exit, the hook-crash intercept, the plan-mode and compliance denies); absent only when a
|
|
@@ -421,33 +402,20 @@ export interface PermissionDeniedPayload {
|
|
|
421
402
|
toolCallId: string;
|
|
422
403
|
/** Human/model-readable deny reason (CC `reason`) — the RAW decision text, NOT `<system-reminder>`-wrapped. */
|
|
423
404
|
reason: string;
|
|
424
|
-
/**
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
/** #548 — the deny is the classifier denial-limit fallback's AUTO-DENY (core's own window elapsed;
|
|
434
|
-
* see {@link import("./tool-policy.js").ResolvedAsk.autoDenied}). Carried verbatim from the resolver;
|
|
435
|
-
* absent on every other deny. */
|
|
436
|
-
autoDenied?: true;
|
|
405
|
+
/**
|
|
406
|
+
* The gate outcome this deny is — the SAME object the call's `tool_end` frame carries as `gate` and
|
|
407
|
+
* the engine's per-call sideband records (one mint, three faces). `disposition.deniedBy` says which
|
|
408
|
+
* LAYER refused (our `decision_reason_type` analog for the refusing half); when the refusal came through
|
|
409
|
+
* an ask resolution, `settlement` says how the wait ended and `origin` who asked. Nothing is read out of
|
|
410
|
+
* an absence: a direct policy / hook / plan-mode / compliance deny carries no settlement because it
|
|
411
|
+
* settled none.
|
|
412
|
+
*/
|
|
413
|
+
gate: GateOutcome;
|
|
437
414
|
/** {@link HookSeatSignal} — this invocation's own abort signal. On an OBSERVATION seat the deny has
|
|
438
415
|
* already happened and nothing this callback does can change it, so the signal says exactly one
|
|
439
416
|
* thing: stop reading, nobody is waiting for your answer any more. */
|
|
440
417
|
signal?: AbortSignal;
|
|
441
418
|
}
|
|
442
|
-
/**
|
|
443
|
-
* 1.256 复审 MED-1 — observe-only payload isolation for {@link Hooks.permissionDenied}: clone the tool
|
|
444
|
-
* args before they ride the observer payload, so a hook mutating `payload.input` can never pollute the
|
|
445
|
-
* LIVE args object (later events / audit records share it). Same posture as the postToolUseFailure
|
|
446
|
-
* details clone (prepare-task): `structuredClone` first; a non-structured-cloneable graph
|
|
447
|
-
* (functions/handles) falls back to a SHALLOW plain object/array copy (top-level mutation isolated);
|
|
448
|
-
* a non-object primitive passes through as-is (immutable anyway).
|
|
449
|
-
*/
|
|
450
|
-
export declare function cloneObserverInput(input: unknown): unknown;
|
|
451
419
|
/** Context for {@link Hooks.stopFailure} — aligned with the TaskResult error face (observe-only). */
|
|
452
420
|
export interface StopFailureContext {
|
|
453
421
|
/** #281 件A — the run/leg identity envelope (always present on the engine's emission; the seat is
|
|
@@ -927,15 +895,6 @@ export interface UserPromptSubmitResult {
|
|
|
927
895
|
/** Injected ahead of the user's prompt (wrapped as a `<system-reminder>`). */
|
|
928
896
|
additionalContext?: string;
|
|
929
897
|
}
|
|
930
|
-
/** Wrap model-facing hook/gate feedback in a `<system-reminder>` so it reads as guidance, not data.
|
|
931
|
-
* NOTE (council design/74 #6): this does NOT escape a literal `</system-reminder>` in `text` — callers MUST
|
|
932
|
-
* pass trusted, first-party strings (every current caller does: fixed gate/limit messages). If a future
|
|
933
|
-
* caller needs to relay UNTRUSTED content (tool output, user data), it must sanitize the close tag first
|
|
934
|
-
* (or use the `delimitUntrusted` fence), or a crafted payload could break out of the reminder framing.
|
|
935
|
-
* design/319 (A ticket): `mark` is the session's reminder provenance mark — run-scoped callers thread it
|
|
936
|
-
* so the open tag carries the value the system-prompt declaration names (rendered by the mint home; the
|
|
937
|
-
* body is byte-untouched). Absent ⇒ the historic bare open tag (a caller outside a run). */
|
|
938
|
-
export declare function formatHookFeedback(text: string, mark?: string): string;
|
|
939
898
|
/** The outcome of the two-phase tool gate, mapped onto the harness `tool_call` hook return shape. */
|
|
940
899
|
export interface ToolGateResult {
|
|
941
900
|
/** Block execution (the loop emits an error tool result with `reason`). */
|
|
@@ -943,46 +902,14 @@ export interface ToolGateResult {
|
|
|
943
902
|
/** Model-readable block reason (already `<system-reminder>`-wrapped). */
|
|
944
903
|
reason?: string;
|
|
945
904
|
/**
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
951
|
-
*
|
|
952
|
-
* allow. The caller records it on its own per-call sideband so it reaches that call's `tool_end`
|
|
953
|
-
* frame: the machine-readable half of the disclosure `reason` makes in words, on a channel no tool
|
|
954
|
-
* and no post-tool hook can write.
|
|
955
|
-
*/
|
|
956
|
-
settledBy?: import("./tool-policy.js").ApprovalSettledBy;
|
|
957
|
-
/**
|
|
958
|
-
* The ask resolver's deny-arm classification (see {@link import("./tool-policy.js").AskDenyResolution}),
|
|
959
|
-
* present only on a BLOCK whose deny came through an ask resolution and passed the closed-vocabulary
|
|
960
|
-
* screen at the deny exit (a self-declared word on a policy's own deny is dropped there, never
|
|
961
|
-
* forwarded). Rides beside {@link settledBy} to the caller's per-call sideband and the call's
|
|
962
|
-
* `tool_end` frame — the machine-readable "why was this refused" a consumer classifies on.
|
|
963
|
-
*/
|
|
964
|
-
resolution?: import("./tool-policy.js").AskDenyResolution;
|
|
965
|
-
/**
|
|
966
|
-
* `true` ⇔ this BLOCK is the classifier denial-limit fallback's own auto-deny: the ask's window
|
|
967
|
-
* (`AskRequest.denialLimitFallback.autoDenyAfterMs`) elapsed with nobody answering and the resolver
|
|
968
|
-
* refused it itself — the same fact the `permissionDenied` observer payload's `autoDenied` carries,
|
|
969
|
-
* read from the same two places (this gate's own resolution, or the module-private attestation an
|
|
970
|
-
* inherited arm bound to THIS call). Rides to the call's `tool_end` frame so a consumer can tell
|
|
971
|
-
* "the classifier fallback's own 120 s window auto-denied" from "the approval factory's own window
|
|
972
|
-
* (`approvalTimeoutMs`) elapsed" — both settle as `settledBy:"timeout"` / `resolution:"window_expired"`,
|
|
973
|
-
* and the factory's deadline NEVER carries this. A durable park's expiry settles on the decide lane
|
|
974
|
-
* with no `resolution` word, so it is told apart by that absence, not by this bit.
|
|
975
|
-
* Absent everywhere else (a person's no, a policy deny, an executing call).
|
|
905
|
+
* The record of this pass ({@link GateOutcome}): its final disposition, the ask it settled (if any) and
|
|
906
|
+
* that ask's origin. Present on BOTH terminal exits, the block and the allow — an approved call is a
|
|
907
|
+
* settled approval too, and a caller that saw the record only on refusals would read its absence on an
|
|
908
|
+
* execution as "nobody approved this". Absent only on the durable-suspend exit, where the pass decided
|
|
909
|
+
* nothing yet. The caller records it on its own per-call sideband so it reaches that call's `tool_end`
|
|
910
|
+
* frame, and the deny observer receives the same object: one mint, three faces.
|
|
976
911
|
*/
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* design/252 G-7 — WHOSE settlement that was: the identifier the approval channel reported, carried
|
|
980
|
-
* out verbatim beside {@link settledBy}. This layer authenticates nothing and compares nothing; the
|
|
981
|
-
* value was screened for shape at the seam that received it (`screenApproverAttribution`) and is a
|
|
982
|
-
* transcription from there on. Present only where the caller settled something AND reported an
|
|
983
|
-
* identity — absent everywhere else, and absence never means "nobody": it means nobody said.
|
|
984
|
-
*/
|
|
985
|
-
approver?: string;
|
|
912
|
+
gate?: GateOutcome;
|
|
986
913
|
/** Rewritten args to execute with (re-validated by the loop); omitted when nothing rewrote. */
|
|
987
914
|
updatedInput?: unknown;
|
|
988
915
|
/**
|
|
@@ -1140,53 +1067,6 @@ export interface PersistedRuleCoverage {
|
|
|
1140
1067
|
}
|
|
1141
1068
|
/** Every shape a lane may answer with. A bare string stays valid and unchanged. */
|
|
1142
1069
|
export type PersistedRuleAnswer = string | PersistedRuleHit | PersistedRuleCoverage | PersistedRuleUnreadable | undefined;
|
|
1143
|
-
/**
|
|
1144
|
-
* design/252 review r3 — read a foreign {@link OrgGateVerdict} the way the personal-rule answer is read:
|
|
1145
|
-
* OWN DATA properties only, never the prototype chain, never an accessor.
|
|
1146
|
-
*
|
|
1147
|
-
* Unlike the personal-rule normalizer below, this one accepts ANY non-array object as the carrier —
|
|
1148
|
-
* not only a plain record. The two seams tighten in opposite directions when a shape is refused: the
|
|
1149
|
-
* personal lane is a LOOSENING seam, so refusing a class instance degrades toward asking; this answer
|
|
1150
|
-
* carries the org's DENY, and folding a structurally valid `{status:"available", verdict:{behavior:
|
|
1151
|
-
* "deny"}}` class instance into `unavailable` would LOOSEN it — from a deny nobody can approve into a
|
|
1152
|
-
* real-approval ask a person can clear. A class instance's fields are its own data properties, so the
|
|
1153
|
-
* own-data read below already gives the full pollution guarantee (inherited members never authorize);
|
|
1154
|
-
* the prototype test added nothing here but the downgrade.
|
|
1155
|
-
*
|
|
1156
|
-
* The two seams are the same class of trust boundary and were not being read the same way. What that
|
|
1157
|
-
* cost here is worse than on the personal lane, because this answer is GOVERNANCE:
|
|
1158
|
-
* · an inherited `revision` (a polluted `Object.prototype`) stamped a fabricated snapshot version onto
|
|
1159
|
-
* a human's approval request — a WRONG record, which is worse than an absent one;
|
|
1160
|
-
* · an inherited `verdict` invented an org rule, and with it an org ask or deny the lane never gave;
|
|
1161
|
-
* · an answer that is not a record at all read as "available, nothing to say", i.e. the governance
|
|
1162
|
-
* fail-open the availability contract exists to prevent.
|
|
1163
|
-
* Anything this function cannot read as a well-formed answer becomes `unavailable` — the fail-CLOSED
|
|
1164
|
-
* word, never the empty one.
|
|
1165
|
-
*/
|
|
1166
|
-
export declare function normalizeOrgGateVerdict(answer: unknown, unreadable: string): OrgGateVerdict;
|
|
1167
|
-
/**
|
|
1168
|
-
* Normalize the accepted {@link ToolGateInput.persistedRules} answers into one reading.
|
|
1169
|
-
*
|
|
1170
|
-
* `{}` = a clean negative (no rule admits this call). `{ unreadable: true }` = the lane could not read
|
|
1171
|
-
* its source. `{ hit }` = a match, whose `rules` is the non-empty coverage set (design/375). An answer
|
|
1172
|
-
* outside every accepted shape — a number, `null`, an object with neither `rules` nor `unreadable`, an
|
|
1173
|
-
* EMPTY `rules` array, the retired pre-375 `{ rule, dots? }` single-rule object — is read as a clean
|
|
1174
|
-
* negative rather than a match: this is a LOOSENING seam, so an answer nobody can name degrades toward
|
|
1175
|
-
* asking, never toward an allow built on it. All-or-nothing across the set's TEXTS for the same
|
|
1176
|
-
* reason: a set with one unreadable member is a different (smaller) claim than the lane made, and a
|
|
1177
|
-
* decision must not stand on a claim nobody made — one bad member drops the whole answer to the clean
|
|
1178
|
-
* negative. Per-member DOTS stay individually optional (identity lost ⇒ `"not_reported"`, exactly the
|
|
1179
|
-
* single-rule contract).
|
|
1180
|
-
*
|
|
1181
|
-
* The hit's dots are COPIED, not aliased. The array travels onto an ask that may sit in front of a
|
|
1182
|
-
* person for a long time; a lane that retains and mutates its own array would otherwise change what the
|
|
1183
|
-
* approver is looking at, and what an audit later reads, after the evidence was stamped.
|
|
1184
|
-
*/
|
|
1185
|
-
export declare function normalizePersistedRuleHit(hit: PersistedRuleAnswer): {
|
|
1186
|
-
hit?: PersistedRuleHit;
|
|
1187
|
-
unreadable?: true;
|
|
1188
|
-
coverage?: readonly import("./permission-rule-model.js").SegmentCoverage[];
|
|
1189
|
-
};
|
|
1190
1070
|
/** Inputs to the two-phase tool gate. `adjudicate`/`resolveAsk` are pre-bound to the task abort
|
|
1191
1071
|
* signal; when the caller also supplies {@link ToolGateInput.callSignal}, the Runner's closures
|
|
1192
1072
|
* additionally bind their waits to that per-call signal (`AbortSignal.any` of the two), so a turn
|
|
@@ -1703,41 +1583,6 @@ export declare function createPreToolUseConstraintPolicy(preToolUse: NonNullable
|
|
|
1703
1583
|
* walltime and no cancel, the race never fires. So the same seat bound rides here too, and the two
|
|
1704
1584
|
* installations of one callback are now bounded the same way for the same reason. */
|
|
1705
1585
|
timeoutMs?: number): ToolPolicy;
|
|
1706
|
-
/**
|
|
1707
|
-
* The mandate provenance of one call, judged from the SAME mark inputs the gate is driven with —
|
|
1708
|
-
* the single source for "could a persisted allow rule clear this ask?". Allow rules silence the
|
|
1709
|
-
* classifier's questions, never a mandated one, and this predicate is the mandated-family half of
|
|
1710
|
-
* that boundary (the real-approval/governance half rides the decision's own `requiresRealApproval`
|
|
1711
|
-
* bit, which the org layer stamps):
|
|
1712
|
-
* · `probeMandated` — this CALL's own reversibility probe declared its demotion STRUCTURAL
|
|
1713
|
-
* (`"probe_mandate"`), judged FIRST because it is the only per-call member here: the three below
|
|
1714
|
-
* are properties of the TOOL and are true of every call on the seat, so a mandate that is true of
|
|
1715
|
-
* this one call must not be shadowed by the tier that happens to carry it (#502: the built-in
|
|
1716
|
-
* shell probe raises it for a listed reader naming a path outside the session's roots — a boundary
|
|
1717
|
-
* the deployment declared, which is exactly what the classify tier alone cannot say);
|
|
1718
|
-
* · `egress` — the tool's own external-write mark, judged next: it is the tool's declaration even
|
|
1719
|
-
* when the coarse doctrine also installed a shell tier on the same seat;
|
|
1720
|
-
* · `shellGated` + tier `"always"` — the operator's per-call confirmation doctrine
|
|
1721
|
-
* (`"operator_always"`); the classify doctrine installs `"maybe"`, and THOSE asks stay the rule
|
|
1722
|
-
* lane's home turf (`undefined`) — that is the don't-ask-again main case, and the per-call member
|
|
1723
|
-
* above is deliberately the ONLY thing that carves a mandate out of it;
|
|
1724
|
-
* · a tool's OWN `"always"`/`"maybe"` irreversibility tier without the doctrine (`"tool_marks"`).
|
|
1725
|
-
*
|
|
1726
|
-
* Two consumers, one derivation: the gate's silencing arm (a matching rule is disclosed as shadowed
|
|
1727
|
-
* instead of clearing the ask) and the runner's suggestion factory (a mandated ask offers no
|
|
1728
|
-
* "stop asking me this" option — a rule minted from it would never clear it). A drift between the
|
|
1729
|
-
* two would let a card offer a rule the lane then refuses to honor. The per-call member reaches both
|
|
1730
|
-
* the same way every other per-call fact does: the gate stamps it on the surviving ask, the
|
|
1731
|
-
* synchronous sites read it off the decision they spread, and the park leg threads its own parameter.
|
|
1732
|
-
*/
|
|
1733
|
-
export declare function persistedRuleMandateOf(marks: {
|
|
1734
|
-
egress?: boolean;
|
|
1735
|
-
shellGated?: boolean;
|
|
1736
|
-
irreversibility?: "never" | "maybe" | "always";
|
|
1737
|
-
/** #502: the surviving ask's engine-stamped `probeMandated` — see
|
|
1738
|
-
* {@link import("./types.js").ReversibilityVerdict.mandated}. */
|
|
1739
|
-
probeMandated?: boolean;
|
|
1740
|
-
}): "operator_always" | "tool_marks" | "probe_mandate" | undefined;
|
|
1741
1586
|
/**
|
|
1742
1587
|
* The park closure's ONE structural seat — what the gate hands the durable park beyond the twelve
|
|
1743
1588
|
* positional seats. Every member is optional and read by name, so a new thing the park must know
|