@sema-agent/core 7.33.8 → 7.35.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.
- package/CHANGELOG.md +462 -3
- package/dist/agents/cross-session-judge.d.ts +16 -7
- package/dist/agents/cross-session-judge.js +18 -15
- package/dist/agents/peer-session-drain.d.ts +4 -0
- package/dist/agents/peer-session-drain.js +5 -2
- package/dist/agents/repair-loop.d.ts +1 -1
- package/dist/agents/subagent.d.ts +3 -0
- package/dist/agents/subagent.js +12 -3
- package/dist/brain/anthropic.js +1 -0
- package/dist/brain/errors.d.ts +23 -1
- package/dist/brain/errors.js +19 -2
- package/dist/brain/open-responses.js +1 -0
- package/dist/brain/openai.js +1 -0
- package/dist/brain/status-sink.d.ts +7 -1
- package/dist/brain/stream-engine.d.ts +3 -0
- package/dist/brain/stream-engine.js +2 -1
- package/dist/brain/stream-shared.d.ts +3 -1
- package/dist/brain/stream-shared.js +16 -4
- package/dist/core/a2a.d.ts +3 -1
- package/dist/core/a2a.js +1 -1
- package/dist/core/ask-origin.d.ts +379 -154
- package/dist/core/ask-origin.js +224 -45
- package/dist/core/ask-question.js +2 -1
- package/dist/core/ask-unresolvable-notice.d.ts +5 -2
- package/dist/core/ask-unresolvable-notice.js +4 -3
- package/dist/core/auto-mode-arming.d.ts +17 -4
- package/dist/core/auto-mode-arming.js +31 -6
- package/dist/core/auto-mode-defaults.d.ts +16 -7
- package/dist/core/auto-mode-defaults.js +2 -1
- package/dist/core/auto-mode-directive.d.ts +18 -30
- package/dist/core/auto-mode-directive.js +9 -18
- package/dist/core/auto-mode-prompt.d.ts +62 -1
- package/dist/core/auto-mode-prompt.js +42 -4
- package/dist/core/auto-mode-rebuild.d.ts +2 -1
- package/dist/core/auto-mode-rebuild.js +1 -0
- package/dist/core/auto-mode.d.ts +32 -3
- package/dist/core/auto-mode.js +80 -41
- package/dist/core/checkpoint-store.d.ts +54 -35
- package/dist/core/checkpoint-store.js +58 -3
- package/dist/core/child-clamp-seats.js +1 -0
- package/dist/core/classifier-unavailable-arm.d.ts +57 -0
- package/dist/core/classifier-unavailable-arm.js +17 -0
- package/dist/core/effective-path-target.d.ts +12 -0
- package/dist/core/effective-path-target.js +18 -7
- package/dist/core/engine-notice.d.ts +53 -2
- package/dist/core/fs-write-gate-policy.d.ts +5 -1
- package/dist/core/fs-write-gate-policy.js +4 -1
- package/dist/core/gate-fold.js +19 -3
- package/dist/core/gate-lanes.js +116 -50
- package/dist/core/gate-outcome.d.ts +40 -7
- package/dist/core/gate-outcome.js +26 -4
- package/dist/core/governance-codes.d.ts +18 -2
- package/dist/core/governance-codes.js +23 -1
- package/dist/core/hooks.d.ts +53 -29
- package/dist/core/hooks.js +1 -3
- package/dist/core/mcp.js +1 -1
- package/dist/core/message-utils.d.ts +2 -1
- package/dist/core/message-utils.js +2 -1
- package/dist/core/mode-policy.d.ts +185 -0
- package/dist/core/mode-policy.js +184 -0
- package/dist/core/oracle-isolation.d.ts +3 -3
- package/dist/core/permission-rule-model.d.ts +20 -3
- package/dist/core/permission-rule-model.js +40 -3
- package/dist/core/permission-rule-provider.d.ts +22 -11
- package/dist/core/permission-rule-provider.js +17 -7
- package/dist/core/permission-rules.d.ts +23 -1
- package/dist/core/permission-rules.js +56 -9
- package/dist/core/persisted-rule-arms.d.ts +14 -10
- package/dist/core/persisted-rule-arms.js +13 -6
- package/dist/core/present-plan-tool.d.ts +1 -1
- package/dist/core/present-plan-tool.js +3 -3
- package/dist/core/read-only-shell.d.ts +19 -19
- package/dist/core/read-only-shell.js +38 -12
- package/dist/core/retired-keys.d.ts +9 -3
- package/dist/core/retired-keys.js +5 -1
- package/dist/core/runner/active-skill-scope.js +5 -4
- package/dist/core/runner/assemble-result.js +2 -2
- package/dist/core/runner/classifier-ladder.d.ts +43 -1
- package/dist/core/runner/classifier-ladder.js +29 -0
- package/dist/core/runner/contracts.d.ts +62 -38
- package/dist/core/runner/denial-limit-arms.d.ts +35 -7
- package/dist/core/runner/denial-limit-arms.js +15 -9
- package/dist/core/runner/env-capability-census.js +1 -1
- package/dist/core/runner/file-history-request.d.ts +26 -0
- package/dist/core/runner/file-history-request.js +90 -0
- package/dist/core/runner/gate-exit.d.ts +30 -4
- package/dist/core/runner/gate-exit.js +28 -7
- package/dist/core/runner/permission-rule-lanes.d.ts +11 -6
- package/dist/core/runner/permission-rule-lanes.js +55 -48
- package/dist/core/runner/persisted-path-rows.d.ts +64 -0
- package/dist/core/runner/persisted-path-rows.js +89 -0
- package/dist/core/runner/prepare-artifact.d.ts +5 -1
- package/dist/core/runner/prepare-artifact.js +9 -3
- package/dist/core/runner/prepare-ask-lane.d.ts +6 -4
- package/dist/core/runner/prepare-ask-lane.js +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +39 -13
- package/dist/core/runner/prepare-caps-and-workflow.js +58 -29
- package/dist/core/runner/prepare-file-history.d.ts +9 -3
- package/dist/core/runner/prepare-file-history.js +4 -90
- package/dist/core/runner/prepare-gate-stations.d.ts +37 -9
- package/dist/core/runner/prepare-gate-stations.js +46 -29
- package/dist/core/runner/prepare-hands-readface.d.ts +40 -17
- package/dist/core/runner/prepare-hands-readface.js +64 -53
- package/dist/core/runner/prepare-inherited-gate.d.ts +30 -23
- package/dist/core/runner/prepare-inherited-gate.js +45 -25
- package/dist/core/runner/prepare-park-ask.d.ts +6 -4
- package/dist/core/runner/prepare-park-ask.js +7 -5
- package/dist/core/runner/prepare-policy-chain.d.ts +25 -4
- package/dist/core/runner/prepare-policy-chain.js +203 -180
- package/dist/core/runner/prepare-protocol-tools.d.ts +28 -0
- package/dist/core/runner/prepare-protocol-tools.js +13 -3
- package/dist/core/runner/prepare-run-refs.d.ts +6 -6
- package/dist/core/runner/prepare-run-refs.js +9 -4
- package/dist/core/runner/prepare-safety-scan.d.ts +5 -0
- package/dist/core/runner/prepare-safety-scan.js +19 -3
- package/dist/core/runner/prepare-suspend-saga.d.ts +5 -5
- package/dist/core/runner/prepare-suspend-saga.js +6 -6
- package/dist/core/runner/prepare-task.js +56 -24
- package/dist/core/runner/prepare-wiring-manifest.d.ts +10 -6
- package/dist/core/runner/prepare-wiring-manifest.js +5 -3
- package/dist/core/runner/read-root-grant.d.ts +9 -0
- package/dist/core/runner/read-root-grant.js +12 -0
- package/dist/core/runner/retired-runner-deps.js +1 -0
- package/dist/core/runner/run-brain-sinks.js +3 -1
- package/dist/core/runner/run-identity-wiring.js +1 -1
- package/dist/core/runner/run-leg.js +29 -18
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +3 -1
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +2 -2
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/run-turn-boundary.js +1 -1
- package/dist/core/runner/runtask.d.ts +1 -0
- package/dist/core/runner/runtask.js +8 -11
- package/dist/core/runner/session-mode-seats.d.ts +48 -0
- package/dist/core/runner/session-mode-seats.js +73 -0
- package/dist/core/runner/session-rule-policy.js +3 -2
- package/dist/core/runner/stream-mode-verb.d.ts +27 -0
- package/dist/core/runner/stream-mode-verb.js +19 -0
- package/dist/core/runner/turn-attachments.d.ts +3 -3
- package/dist/core/runner/turn-attachments.js +1 -1
- package/dist/core/runner/write-protection-station.d.ts +7 -1
- package/dist/core/runner/write-protection-station.js +6 -3
- package/dist/core/runner-deps.d.ts +31 -34
- package/dist/core/runtime-caps.d.ts +12 -3
- package/dist/core/safety-axis-vocab.d.ts +2 -2
- package/dist/core/safety-axis-vocab.js +1 -1
- package/dist/core/secret-env.d.ts +30 -58
- package/dist/core/secret-env.js +149 -586
- package/dist/core/sensitive-path-policy.d.ts +4 -2
- package/dist/core/sensitive-path-policy.js +41 -31
- package/dist/core/store-contracts/checkpoint-store-contract.js +2 -1
- package/dist/core/task-event.d.ts +1 -1
- package/dist/core/task-result.d.ts +1 -1
- package/dist/core/task-spec.d.ts +41 -89
- package/dist/core/task-stream.d.ts +16 -0
- package/dist/core/terminal-cause.js +1 -0
- package/dist/core/tighten-task-spec.d.ts +2 -2
- package/dist/core/tighten-task-spec.js +12 -14
- package/dist/core/tool-catalog-entries.js +4 -3
- package/dist/core/tool-policy.d.ts +84 -30
- package/dist/core/tool-policy.js +76 -16
- package/dist/core/tool-registry.d.ts +38 -0
- package/dist/core/tool-registry.js +25 -1
- package/dist/core/tool-roster.d.ts +17 -2
- package/dist/core/tool-roster.js +11 -1
- package/dist/core/tool-spec.d.ts +8 -9
- package/dist/core/trace.d.ts +18 -6
- package/dist/core/types.d.ts +2 -1
- package/dist/core/wiring-manifest.d.ts +31 -5
- package/dist/core/wiring-manifest.js +28 -1
- package/dist/core/write-protect.d.ts +11 -1
- package/dist/core/write-protect.js +26 -15
- package/dist/engine/execution-env/node-execution-env.d.ts +6 -1
- package/dist/engine/execution-env/node-execution-env.js +16 -3
- package/dist/engine/harness/agent-harness.js +2 -1
- package/dist/engine/harness/types.d.ts +6 -7
- package/dist/engine/llm/types.d.ts +2 -4
- package/dist/engine/loop/types.d.ts +7 -0
- package/dist/engine/lsp/node-lsp-manager.js +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +15 -6
- package/dist/orchestration/workflow-governance.js +1 -1
- package/dist/orchestration/workflow-primitives.d.ts +1 -1
- package/dist/orchestration/workflow-size-guideline.js +2 -2
- package/dist/stores/file/index.d.ts +5 -3
- package/dist/stores/file/session-store.d.ts +8 -2
- package/dist/stores/file/session-store.js +5 -5
- package/dist/tools/artifact/artifact-tool.d.ts +17 -0
- package/dist/tools/artifact/artifact-tool.js +16 -1
- package/dist/tools/fs/bash-readonly-classifier.d.ts +28 -7
- package/dist/tools/fs/bash-readonly-classifier.js +88 -0
- package/dist/tools/fs/containment-face.d.ts +9 -3
- package/dist/tools/fs/containment-face.js +2 -0
- package/dist/tools/fs/file-read-check.d.ts +50 -0
- package/dist/tools/fs/file-read-check.js +79 -0
- package/dist/tools/fs/fs-bash.d.ts +3 -3
- package/dist/tools/fs/fs-read.d.ts +1 -0
- package/dist/tools/fs/fs-search-tools.d.ts +2 -2
- package/dist/tools/fs/fs-search-tools.js +4 -4
- package/dist/tools/fs/fs-shared.js +20 -6
- package/dist/tools/fs/fs-write.d.ts +4 -3
- package/dist/tools/fs/fs-write.js +9 -9
- package/dist/tools/fs/index.d.ts +39 -3
- package/dist/tools/fs/index.js +38 -15
- package/dist/tools/fs/read-deny-home.d.ts +93 -0
- package/dist/tools/fs/read-deny-home.js +225 -0
- package/dist/tools/fs/read-deny.d.ts +176 -34
- package/dist/tools/fs/read-deny.js +268 -61
- package/dist/tools/fs/safety.d.ts +6 -1
- package/dist/tools/fs/safety.js +18 -5
- package/dist/tools/fs/search.d.ts +3 -0
- package/dist/tools/fs/search.js +47 -9
- package/dist/tools/fs/shell-read-check.d.ts +52 -13
- package/dist/tools/fs/shell-read-check.js +199 -20
- package/dist/tools/fs/shell-read-establish.d.ts +7 -3
- package/dist/tools/fs/shell-read-establish.js +134 -21
- package/dist/tools/fs/shell-read-identity.d.ts +7 -0
- package/dist/tools/fs/shell-read-identity.js +21 -0
- package/dist/tools/fs/shell-read-judge.d.ts +92 -32
- package/dist/tools/fs/shell-read-judge.js +43 -18
- package/dist/tools/fs/shell-read-plan.d.ts +4 -0
- package/dist/tools/fs/shell-read-plan.js +26 -4
- package/dist/tools/fs/shell-read-write-targets.d.ts +73 -0
- package/dist/tools/fs/shell-read-write-targets.js +173 -0
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +117 -11
- package/wire-changes/core@7.34.0.json +2621 -0
- package/wire-changes/core@7.35.0.json +584 -0
|
@@ -204,12 +204,11 @@ export interface RunnerDeps {
|
|
|
204
204
|
*/
|
|
205
205
|
readDenyPatterns?: readonly import("../tools/fs/read-deny.js").ReadDenyEntry[];
|
|
206
206
|
/**
|
|
207
|
-
* The deployment's built-in deny-table TIER selection — the
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* refuses a read or demotes a shell one. A leg's active tiers are REPORTED on its wiring manifest
|
|
207
|
+
* The deployment's built-in deny-table TIER selection — the switch for the built-in table. EXACTLY the
|
|
208
|
+
* listed tiers of {@link import("../tools/fs/read-deny.js").READ_FACE_BUILTIN_DENY_TABLE} are active (`[]` =
|
|
209
|
+
* none — explicit and legal: nothing from that table refuses a read); ABSENT =
|
|
210
|
+
* {@link import("../tools/fs/read-deny.js").READ_DENY_DEFAULT_TIERS} (`credentials` and the home-anchored
|
|
211
|
+
* `agent-config`). A leg's active tiers are REPORTED on its wiring manifest
|
|
213
212
|
* ({@link import("./wiring-manifest.js").WiringManifest.readDeny}). Composes with
|
|
214
213
|
* {@link readDenyBuiltinExclude} (tiers first, then row removal); never touches the additions
|
|
215
214
|
* seats or the write faces. Unknown tier names refuse loudly at prepare (#123). DEPLOYMENT seat
|
|
@@ -633,9 +632,9 @@ export interface RunnerDeps {
|
|
|
633
632
|
* `autoMode` (the per-principal deny bit of the user-enabled auto mode), `allowMemoryOptOut` (may this
|
|
634
633
|
* principal declare a capture opt-out), and `forceDurableGate` (forces a run onto the durable-approval
|
|
635
634
|
* path so a policy `ask` suspends to the wire — where a checkpoint store is wired; a store-less leg
|
|
636
|
-
* announces `config.durable_gate_unavailable`)
|
|
637
|
-
*
|
|
638
|
-
* (
|
|
635
|
+
* announces `config.durable_gate_unavailable`), and `bypassPermissions` (the deny bit of the
|
|
636
|
+
* `bypassPermissions` mode — a denied request folds to `default`, announced). `allowUltracode` is a shell/UX
|
|
637
|
+
* concern (reasoning-tier, not a core primitive).
|
|
639
638
|
*/
|
|
640
639
|
runtimeCapsResolver?: (principal: string | undefined) => RuntimeCaps | undefined | Promise<RuntimeCaps | undefined>;
|
|
641
640
|
/**
|
|
@@ -705,7 +704,7 @@ export interface RunnerDeps {
|
|
|
705
704
|
/**
|
|
706
705
|
* design/143 批2b — the auto-mode classifier's DEPLOYMENT assembly face. This is the
|
|
707
706
|
* CAPABILITY arm of the three-arm arming: a run arms auto mode only when the task carries the
|
|
708
|
-
* auto-mode INTENT (
|
|
707
|
+
* auto-mode INTENT (`TaskSpec.permissionMode: "auto"`, or the mode inherited on the chain by an
|
|
709
708
|
* engine-spawned child) AND this face is present AND the per-principal DENY bit is not set
|
|
710
709
|
* ({@link RuntimeCaps.autoMode}` !== false` — absent is not a denial).
|
|
711
710
|
*
|
|
@@ -717,6 +716,14 @@ export interface RunnerDeps {
|
|
|
717
716
|
* `summarize → default`; tier default `flash`) via the brain's simple-completion pipe — same
|
|
718
717
|
* lane as compaction/consolidation, no tools, no session writes.
|
|
719
718
|
*/
|
|
719
|
+
/**
|
|
720
|
+
* The deployment's A2A peer switches. `isolatePeers: true` makes every A2A peer skill's egress default an
|
|
721
|
+
* OPERATOR mandate: its ask is `operator_forced` (kept under `bypassPermissions`, not settled by `dontAsk`)
|
|
722
|
+
* instead of the releasable `tool_marks_a2a`. Absent ⇒ the default (a permission mode may release it, disclosed).
|
|
723
|
+
*/
|
|
724
|
+
a2a?: {
|
|
725
|
+
isolatePeers?: true;
|
|
726
|
+
};
|
|
720
727
|
autoMode?: {
|
|
721
728
|
/** Rule overrides for the four permissions sections (omitted section = CC defaults verbatim). */
|
|
722
729
|
rules?: import("./auto-mode-prompt.js").AutoModeRules;
|
|
@@ -726,9 +733,15 @@ export interface RunnerDeps {
|
|
|
726
733
|
sessionContext?: readonly string[];
|
|
727
734
|
/** Transcript-window bounds for the classify prompt (defaults: 40 entries / 2000 chars each). */
|
|
728
735
|
window?: import("./auto-mode-prompt.js").AutoModeWindowOptions;
|
|
729
|
-
/** Classify round-trip cap, ms
|
|
730
|
-
*
|
|
731
|
-
*
|
|
736
|
+
/** Classify round-trip cap, ms — ONE ladder rung (see `classifierFallback`), not the whole classification;
|
|
737
|
+
* default `AUTO_MODE_DEFAULT_TIMEOUT_MS` (180 000, sized for a self-hosted gateway's queue + prefill; worst
|
|
738
|
+
* case two rungs = 360 s). A rung past the cap did not rule: the walk moves to the next candidate; with none
|
|
739
|
+
* left the classification is `unavailable` — the call goes on to a person where the leg has an approval seat
|
|
740
|
+
* (a live approver or a durable park), and is DENIED with a sentence that says so where it has none; the
|
|
741
|
+
* user hears it either way (`classifier.unavailable`). The next call is classified afresh. A present value
|
|
742
|
+
* that is not a number of milliseconds in [1, 2147483647] is REFUSED loudly at every leg's prepare while this face
|
|
743
|
+
* is present, whatever mode the leg starts in (`config.auto_mode_timeout_invalid`) — never clamped, never read as the
|
|
744
|
+
* default; there is no OFF. */
|
|
732
745
|
timeoutMs?: number;
|
|
733
746
|
/**
|
|
734
747
|
* What a classification does when the classifier SEAT does not rule (the leg threw / rejected, the cap
|
|
@@ -744,8 +757,8 @@ export interface RunnerDeps {
|
|
|
744
757
|
* (worst case two `timeoutMs` caps); `"none"` buys that back for the deny.
|
|
745
758
|
*
|
|
746
759
|
* A value outside the closed set ({@link import("./auto-mode.js").AUTO_MODE_CLASSIFIER_FALLBACKS}) is
|
|
747
|
-
* REFUSED loudly at prepare
|
|
748
|
-
* as the default.
|
|
760
|
+
* REFUSED loudly at every leg's prepare while this face is present, whatever mode the leg starts in
|
|
761
|
+
* (`config.auto_mode_classifier_fallback_invalid`) — never clamped, never read as the default.
|
|
749
762
|
*/
|
|
750
763
|
classifierFallback?: import("./auto-mode.js").AutoModeClassifierFallback;
|
|
751
764
|
/**
|
|
@@ -764,8 +777,9 @@ export interface RunnerDeps {
|
|
|
764
777
|
* the run STOPS with `TaskResult.errorCode = "classifier.denial_limit"` (a notice of the same
|
|
765
778
|
* code is minted).
|
|
766
779
|
*
|
|
767
|
-
* Every member optional (defaults 3 / 20 / 120_000). A present member with a bad value is
|
|
768
|
-
* loudly at prepare
|
|
780
|
+
* Every member optional (defaults 3 / 20 / 120_000). A present member with a bad value, a member that is
|
|
781
|
+
* not one of the three, or a value that is not a record, is refused loudly at every leg's prepare while this face is present, whatever mode the
|
|
782
|
+
* leg starts in (`config.auto_mode_denial_limit_invalid`) — never clamped, never silently read as the default.
|
|
769
783
|
* See {@link import("./auto-mode.js").AutoModeDenialLimitOptions}.
|
|
770
784
|
*/
|
|
771
785
|
denialLimit?: import("./auto-mode.js").AutoModeDenialLimitOptions;
|
|
@@ -1354,23 +1368,6 @@ export interface RunnerDeps {
|
|
|
1354
1368
|
* deployment wires the factory.
|
|
1355
1369
|
*/
|
|
1356
1370
|
executionEnvFactory?: import("./remote-env.js").ExecutionEnvFactory;
|
|
1357
|
-
/**
|
|
1358
|
-
* design/77 §1 Gate-1 (oracleIsolation) — a **DISTINCT** trusted control-plane factory that mints the
|
|
1359
|
-
* ISOLATED grader env an out-of-process oracle grades in (the 4th auto-promote gate). It is a SIBLING of
|
|
1360
|
-
* {@link executionEnvFactory}, never the same env: the worker runs in `executionEnvFactory`'s env, the
|
|
1361
|
-
* grader in `graderEnvFactory`'s — so a worker can't corrupt the env that judges it. It inherits the exact
|
|
1362
|
-
* same trust contract: `TaskSpec` deliberately has NO env field (design/44 §7 Q4), so an untrusted caller
|
|
1363
|
-
* can never inject/swap a grader env and grade itself; only the trusted deployment wires this factory. The
|
|
1364
|
-
* RESERVED SEAM, stated plainly (ruled 2026-08-04, field-liveness review): the engine has NO call
|
|
1365
|
-
* site for this factory today — nothing mints, wraps, or asserts through it yet. The intended wirer
|
|
1366
|
-
* is the hardened-grader path a deployment builds on its remote-env side (the k8s pod-spec-patch
|
|
1367
|
-
* seam is the documented server-side half); when that live runner lands, the env it mints is to be
|
|
1368
|
-
* wrapped in a {@link import("./oracle-isolation.js").GraderEnv} and asserted via
|
|
1369
|
-
* {@link import("./oracle-isolation.js").assertOracleIsolation} before any positive oracle verdict.
|
|
1370
|
-
* **Auto-promote stays mandate-OFF until the four gates are implemented + verified end-to-end** (design/77
|
|
1371
|
-
* §7); this seam only makes auto-accept implementable — it does not turn it on.
|
|
1372
|
-
*/
|
|
1373
|
-
graderEnvFactory?: import("./remote-env.js").ExecutionEnvFactory;
|
|
1374
1371
|
/**
|
|
1375
1372
|
* Containment root for the file tools (design/44 §4 invariant 7): every path must resolve within it,
|
|
1376
1373
|
* else the tool rejects (`PathNotInRoot`). Default `process.cwd()`. A defense-in-depth guard rail at the
|
|
@@ -81,8 +81,8 @@ export interface WorkflowGovernanceBaseline {
|
|
|
81
81
|
* · GRANT-shaped, `=== true` opts in / absent is OFF: {@link allowObservers};
|
|
82
82
|
* · FORCE-shaped, `true` mandates / absent is the caller's opt-in default: {@link forceDurableGate}
|
|
83
83
|
* (binds only where a checkpoint store is wired; announced `config.durable_gate_unavailable` where none is).
|
|
84
|
-
* These
|
|
85
|
-
*
|
|
84
|
+
* These seven are the caps the ENGINE enforces — {@link bypassPermissions} is the seventh, the deny bit of the
|
|
85
|
+
* `bypassPermissions` mode; `allowUltracode` stays a shell-UX concern (see {@link RunnerDeps.runtimeCapsResolver}).
|
|
86
86
|
*/
|
|
87
87
|
/**
|
|
88
88
|
* #692 C-d — WHICH plane's ratchet denied auto mode, when the resolver knows: the three settings sources
|
|
@@ -135,7 +135,7 @@ export interface RuntimeCaps {
|
|
|
135
135
|
/**
|
|
136
136
|
* The per-principal auto-mode DENY bit (CC 2.1.250 polarity — the mirror of the settings-plane
|
|
137
137
|
* `permissions.disableAutoMode` ratchet: an organization may only take auto mode AWAY; it is the
|
|
138
|
-
* USER who turns it on,
|
|
138
|
+
* USER who turns it on, by requesting the mode at {@link TaskSpec.permissionMode}).
|
|
139
139
|
*
|
|
140
140
|
* **POLARITY: `=== false` DENIES; ABSENT IS NOT A DENIAL.** This is the family's deny-shaped
|
|
141
141
|
* member (like {@link allowWorkflows} / {@link allowFork}), NOT a grant-shaped one like
|
|
@@ -157,6 +157,15 @@ export interface RuntimeCaps {
|
|
|
157
157
|
* manifest) — a source named for a denial that did not happen is a marshalling error, never a fact.
|
|
158
158
|
*/
|
|
159
159
|
autoModeDenySource?: AutoModeDenySource;
|
|
160
|
+
/**
|
|
161
|
+
* The per-principal `bypassPermissions` DENY bit — the engine seat of the settings-plane
|
|
162
|
+
* `permissions.disableBypassPermissionsMode: "disable"` ratchet. **`=== false` DENIES; ABSENT IS NOT A DENIAL**
|
|
163
|
+
* (the family's deny shape, like {@link autoMode}). A task that requests `bypassPermissions` on a leg whose
|
|
164
|
+
* caps carry `false` runs in `default` instead, announced once (`config.permission_mode_unavailable`,
|
|
165
|
+
* `by: "operator_deny"`) and reported on `wiring_manifest.permissionMode` — a mode declaration is folded, never
|
|
166
|
+
* a 4xx. A steer into `bypassPermissions` on such a leg folds the same way.
|
|
167
|
+
*/
|
|
168
|
+
bypassPermissions?: boolean;
|
|
160
169
|
/**
|
|
161
170
|
* design/383 §3.1 — may this principal declare a session memory-capture OPT-OUT
|
|
162
171
|
* (`TaskSpec.memory.capture: "off"` / the Runner flip verb)? `false` = the deployment REQUIRES
|
|
@@ -25,8 +25,8 @@ export declare const SAFETY_AXIS_VOCABULARY: {
|
|
|
25
25
|
readonly safetyAxis: readonly ["egress", "irreversible", "shell"];
|
|
26
26
|
/** `RiskDescriptor.severity` — ToolEmu-style tier (5 = most severe), the inbox triage key (checkpoint-store.ts:85). */
|
|
27
27
|
readonly severity: readonly [1, 2, 3, 4, 5];
|
|
28
|
-
/** `TaskSpec.shellGate` (declared in core/types.ts) —
|
|
29
|
-
readonly shellGate: readonly ["
|
|
28
|
+
/** `TaskSpec.shellGate` (declared in core/types.ts) — the operator's shell floor; one value (`always`). */
|
|
29
|
+
readonly shellGate: readonly ["always"];
|
|
30
30
|
/** `ToolPolicy` decision — per-tool adjudication; `deny` short-circuits the `deny > ask > allow` fold (tool-policy.ts). */
|
|
31
31
|
readonly permissionDecision: readonly ["allow", "ask", "deny"];
|
|
32
32
|
};
|
|
@@ -4,7 +4,7 @@ export const SAFETY_AXIS_VOCABULARY = {
|
|
|
4
4
|
irreversibility: ["never", "maybe", "always"],
|
|
5
5
|
safetyAxis: ["egress", "irreversible", "shell"],
|
|
6
6
|
severity: [1, 2, 3, 4, 5],
|
|
7
|
-
shellGate: ["
|
|
7
|
+
shellGate: ["always"],
|
|
8
8
|
permissionDecision: ["allow", "ask", "deny"],
|
|
9
9
|
};
|
|
10
10
|
const _toolEffectExhaustive = true;
|
|
@@ -1,77 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The environment a spawned child inherits: which of this process's variables it must not see.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* downstream adapter composes its own child env; only the secret PATTERN is shared with it.
|
|
4
|
+
* A child the engine spawns may run what the MODEL chose (a tool shell, a gate over model-written code, a language
|
|
5
|
+
* server). Under the `"scrub"` policy (the default) it inherits every variable but those the judgment below names —
|
|
6
|
+
* deleted whole, never rewritten; `"all"` and a `string[]` allow list are the caller's explicit alternatives
|
|
7
|
+
* ({@link inheritedHostEnv}). One judgment per variable ({@link classifySecretEnvEntry}), the first rule that answers:
|
|
8
|
+
* 1. exempt — git's environment config and the proxy variables, handed on as written ({@link isExemptEnvName});
|
|
9
|
+
* 2. `exact-name` — a known credential name ({@link CREDENTIAL_ENV_NAMES});
|
|
10
|
+
* 3. `prefix-rule` — the OpenTelemetry settings ({@link OTEL_ENV_RE});
|
|
11
|
+
* 4. `namespace-rule` — a credential word as any segment of a name in the engine's own `SEMA_` namespace;
|
|
12
|
+
* 5. `name-rule` — a credential-shaped name ({@link nameIsCredentialShaped}) off {@link NON_SECRET_ENV_EXACT_NAMES};
|
|
13
|
+
* 6. `value-rule` — a value that carries a credential ({@link valueCarriesCredential}).
|
|
14
|
+
* {@link isSecretEnvKey} and {@link scrubSecretEnv} both answer with this one judgment. The exempt families, the
|
|
15
|
+
* credential names, the name shape and the value predicate follow the reference implementation's subprocess-env scrub
|
|
16
|
+
* as written, three ways stricter: plural `TOKENS` is a credential word unless a count word touches it, the GitHub
|
|
17
|
+
* token names are not held back from the name shape, and the name shape always runs.
|
|
19
18
|
*/
|
|
20
19
|
import type { RedactionConfidence, RedactionSource } from "./arg-summary.js";
|
|
21
20
|
import { type EngineNotice } from "./engine-notice.js";
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly value?: string;
|
|
27
|
-
}
|
|
28
|
-
export declare function readGitConfigParameters(text: string): GitConfigEntry[] | undefined;
|
|
29
|
-
/** Which rule classified a key as secret-shaped — the env arm's `kind` vocabulary. */
|
|
30
|
-
export type SecretEnvFindingKind = "suffix-rule" | "namespace-rule" | "exact-name" | "family-rule";
|
|
31
|
-
/** One env entry the `scrub` policy withheld — dropped, or, for a member of git's config record, handed on holding a
|
|
32
|
-
* placeholder half: the key (the VALUE is never carried — this record is meant to be loggable), the rule that
|
|
33
|
-
* classified it, how strong that claim is, and the minting module. */
|
|
21
|
+
/** Which rule withheld an entry. */
|
|
22
|
+
export type SecretEnvFindingKind = "exact-name" | "name-rule" | "namespace-rule" | "prefix-rule" | "value-rule";
|
|
23
|
+
/** One env entry the `"scrub"` policy withheld (deleted): its name — never its value, so the record is loggable —, the
|
|
24
|
+
* rule that withheld it, how strong that claim is, and the minting module. */
|
|
34
25
|
export interface SecretEnvFinding {
|
|
35
26
|
key: string;
|
|
36
27
|
kind: SecretEnvFindingKind;
|
|
37
28
|
confidence: RedactionConfidence;
|
|
38
29
|
source: RedactionSource;
|
|
39
30
|
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
export declare function classifyExactEnvName(key: string, credentialNames: ReadonlySet<string>, exemptNames: ReadonlySet<string>): ExactEnvNameVerdict;
|
|
48
|
-
/** Is `key` a secret-pattern env var (one the fail-closed `scrub` policy drops before spawning a shell)? Pass the
|
|
49
|
-
* entry's `value` — and the environment it sits in as `env`, and the child's `platform` — to get exactly the scrub's
|
|
50
|
-
* answer for that entry: a git config member is judged with its index group, which only the environment holds; without
|
|
51
|
-
* a value the name alone decides (a `GIT_CONFIG_KEY_<i>` then reads as secret — the name cannot clear itself).
|
|
52
|
-
* `platform` is as for {@link scrubSecretEnv}. */
|
|
53
|
-
export declare function isSecretEnvKey(key: string, value?: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
|
|
54
|
-
/** Drop every secret-pattern key (see {@link isSecretEnvKey}) from an env object — the fail-closed `scrub`
|
|
55
|
-
* policy. git's indexed record is withheld entry by entry and never renumbered ({@link readGitEnvConfigRecord}): a
|
|
56
|
-
* withheld entry git reads keeps its names, each holding its half of the placeholder entry `sema.withheld` (key) / an
|
|
57
|
-
* empty string (value), so `GIT_CONFIG_COUNT` and every other index reach the child as the host wrote them. `findings`
|
|
58
|
-
* is an OPTIONAL caller-owned collector: pass an array to learn which entries were withheld (by name) and why, read it
|
|
59
|
-
* back after the call. A finding's name is absent from the result unless it is such a record member, which is present
|
|
60
|
-
* holding the placeholder half. `platform` is the platform the child runs on — where git reads this environment:
|
|
61
|
-
* Windows reads env names case-insensitively, so there any spelling of a record member is that member; elsewhere git
|
|
62
|
-
* looks up the capitalised names only and every other spelling is judged on its own, apart from the record. It defaults
|
|
63
|
-
* to this process's own platform, the answer for a child spawned on this host; a host whose child runs elsewhere (a
|
|
64
|
-
* remote or sandboxed execution environment) passes that environment's platform. */
|
|
65
|
-
export declare function scrubSecretEnv(env: NodeJS.ProcessEnv, findings?: SecretEnvFinding[], platform?: NodeJS.Platform): NodeJS.ProcessEnv;
|
|
31
|
+
/** Does the `"scrub"` policy withhold `key`? With `value`, exactly the answer {@link scrubSecretEnv} gives for that
|
|
32
|
+
* entry; without it, the answer for its name alone (the value rule then has nothing to read). */
|
|
33
|
+
export declare function isSecretEnvKey(key: string, value?: string): boolean;
|
|
34
|
+
/** The `"scrub"` policy: `env` without every entry {@link isSecretEnvKey} withholds, the rest as written. `findings` is
|
|
35
|
+
* an optional caller-owned collector: each withheld entry is pushed onto it (name, rule, confidence), none of them
|
|
36
|
+
* present in the result. `env` itself is not modified. */
|
|
37
|
+
export declare function scrubSecretEnv(env: NodeJS.ProcessEnv, findings?: SecretEnvFinding[]): NodeJS.ProcessEnv;
|
|
66
38
|
/** How much of this process's environment a child spawned on this host inherits — the `inheritEnv` value. */
|
|
67
39
|
export type InheritEnvPolicy = "all" | "scrub" | string[];
|
|
68
40
|
/**
|
|
69
41
|
* The environment a child spawned ON THIS HOST inherits, by an {@link InheritEnvPolicy}: `"scrub"` (and absent) is
|
|
70
|
-
* this process's environment through {@link scrubSecretEnv}
|
|
42
|
+
* this process's environment through {@link scrubSecretEnv}; `"all"` is this process's environment
|
|
71
43
|
* verbatim (the explicit opt-out); a `string[]` is exactly the named variables that are set, verbatim — a strict allow
|
|
72
44
|
* list, so a name it leaves out (`PATH` included) is not inherited. `findings` collects what the scrub withheld, and
|
|
73
|
-
* only the `"scrub"` arm adds to it. Any other value reads as `"scrub"
|
|
74
|
-
*
|
|
45
|
+
* only the `"scrub"` arm adds to it. Any other value reads as `"scrub"`; both spawn sites that take a policy — the
|
|
46
|
+
* tool shell's `NodeExecutionEnv` (at construction) and the oracle gate (per gate) — refuse a malformed one through
|
|
47
|
+
* {@link inheritEnvPolicyProblem} before it gets here.
|
|
75
48
|
*/
|
|
76
49
|
export declare function inheritedHostEnv(policy: InheritEnvPolicy | undefined, findings?: SecretEnvFinding[]): NodeJS.ProcessEnv;
|
|
77
50
|
/** Why `value` is not an {@link InheritEnvPolicy} (absent counts as one — the scrub), or `undefined` when it is. */
|
|
@@ -86,4 +59,3 @@ export declare function __resetSecretEnvScrubNoticeAnnouncement(): void;
|
|
|
86
59
|
* findings array is a no-op.
|
|
87
60
|
*/
|
|
88
61
|
export declare function announceSecretEnvScrub(onNotice: ((notice: EngineNotice) => void) | undefined, findings: readonly SecretEnvFinding[]): void;
|
|
89
|
-
export {};
|