@sema-agent/core 7.15.0 → 7.17.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 +202 -0
- package/dist/agents/builtin-agents.d.ts +3 -3
- package/dist/agents/cross-session-envelope.d.ts +0 -1
- package/dist/agents/cross-session-envelope.js +0 -1
- package/dist/agents/peer-notices.d.ts +0 -9
- package/dist/agents/peer-notices.js +0 -63
- package/dist/agents/subagent.js +7 -15
- package/dist/brain/request-params.d.ts +2 -2
- package/dist/config/defaults.d.ts +0 -7
- package/dist/config/defaults.js +0 -2
- package/dist/core/artifact-host.d.ts +218 -0
- package/dist/core/artifact-host.js +92 -0
- package/dist/core/ask-origin.d.ts +29 -3
- package/dist/core/ask-origin.js +17 -9
- package/dist/core/ask-question.d.ts +25 -0
- package/dist/core/ask-question.js +4 -0
- package/dist/core/ask-unresolvable-notice.d.ts +30 -21
- package/dist/core/ask-unresolvable-notice.js +16 -8
- package/dist/core/auto-compaction.d.ts +10 -10
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/background-agent-store.d.ts +5 -5
- package/dist/core/background-shell.d.ts +1 -1
- package/dist/core/checkpoint-execution-record.d.ts +0 -3
- package/dist/core/checkpoint-execution-record.js +0 -4
- package/dist/core/checkpoint-store.d.ts +71 -99
- package/dist/core/checkpoint-store.js +9 -16
- package/dist/core/context-edit.d.ts +36 -104
- package/dist/core/context-edit.js +37 -60
- package/dist/core/effective-path-target.d.ts +68 -8
- package/dist/core/effective-path-target.js +42 -30
- package/dist/core/engine-notice.d.ts +46 -32
- package/dist/core/env-budget.d.ts +31 -0
- package/dist/core/env-budget.js +39 -0
- package/dist/core/exec-output-tail.d.ts +5 -5
- package/dist/core/file-history-store.js +3 -6
- package/dist/core/fs-write-gate-policy.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.js +3 -3
- package/dist/core/gate-lanes.js +9 -15
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +4 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +18 -17
- package/dist/core/lsp-session.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/lsp.js +5 -4
- package/dist/core/mcp.d.ts +5 -5
- package/dist/core/mcp.js +4 -48
- package/dist/core/memory-engine/delegation-settlement.d.ts +37 -12
- package/dist/core/memory-engine/delegation-settlement.js +128 -39
- package/dist/core/memory-engine/engine.d.ts +9 -8
- package/dist/core/memory-engine/engine.js +115 -120
- package/dist/core/memory-engine/file-backend.d.ts +17 -5
- package/dist/core/memory-engine/file-backend.js +78 -34
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +2 -2
- package/dist/core/memory-engine/layout.d.ts +152 -54
- package/dist/core/memory-engine/layout.js +441 -104
- package/dist/core/memory-engine/types.d.ts +8 -3
- package/dist/core/memory-engine/types.js +5 -0
- package/dist/core/memory-recall.d.ts +0 -8
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/oracle-isolation.js +2 -2
- package/dist/core/parent-spec-seat.d.ts +66 -0
- package/dist/core/parent-spec-seat.js +47 -0
- package/dist/core/permission-rule-model.d.ts +11 -6
- package/dist/core/permission-rule-model.js +53 -37
- package/dist/core/permission-rules.js +8 -3
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/remote-env.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +19 -0
- package/dist/core/retired-keys.js +15 -0
- package/dist/core/runner/abort-race.d.ts +3 -3
- package/dist/core/runner/active-skill-scope.d.ts +2 -2
- package/dist/core/runner/active-skill-scope.js +3 -3
- package/dist/core/runner/assemble-result.d.ts +42 -40
- package/dist/core/runner/assemble-result.js +5 -4
- package/dist/core/runner/checkpoint-scope.d.ts +4 -4
- package/dist/core/runner/clock-and-limits.d.ts +3 -3
- package/dist/core/runner/compaction-call-options.d.ts +35 -99
- package/dist/core/runner/compaction-knobs.d.ts +4 -4
- package/dist/core/runner/compaction-seams.d.ts +5 -5
- package/dist/core/runner/contracts.d.ts +232 -233
- package/dist/core/runner/decide-continuation.d.ts +6 -6
- package/dist/core/runner/denial-limit-arms.d.ts +8 -8
- package/dist/core/runner/derived-route-fallback.d.ts +2 -2
- package/dist/core/runner/gate-exit.d.ts +6 -6
- package/dist/core/runner/gate-exit.js +15 -1
- package/dist/core/runner/git-status-frame.d.ts +7 -7
- package/dist/core/runner/halt-attribution.d.ts +35 -0
- package/dist/core/runner/halt-attribution.js +16 -0
- package/dist/core/runner/inherited-ask-grants.d.ts +6 -6
- package/dist/core/runner/memory-capture-optout.d.ts +1 -1
- package/dist/core/runner/memory-consolidation-driver.d.ts +4 -4
- package/dist/core/runner/memory-consolidation.d.ts +6 -8
- package/dist/core/runner/memory-consolidation.js +0 -1
- package/dist/core/runner/park-commit.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.d.ts +19 -19
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -4
- package/dist/core/runner/prepare-artifact.d.ts +53 -0
- package/dist/core/runner/prepare-artifact.js +77 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +3 -3
- package/dist/core/runner/prepare-boundary-parks.d.ts +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +9 -7
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -3
- package/dist/core/runner/prepare-config-doors.d.ts +24 -24
- package/dist/core/runner/prepare-config-doors.js +5 -2
- package/dist/core/runner/prepare-context-lane.d.ts +8 -8
- package/dist/core/runner/prepare-context-lane.js +2 -13
- package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +3 -3
- package/dist/core/runner/prepare-file-history.js +3 -52
- package/dist/core/runner/prepare-gate-stations.d.ts +5 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +35 -38
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-inherited-gate.d.ts +9 -6
- package/dist/core/runner/prepare-inherited-gate.js +7 -8
- package/dist/core/runner/prepare-listings.d.ts +3 -3
- package/dist/core/runner/prepare-lsp.d.ts +3 -3
- package/dist/core/runner/prepare-memory-engine-session.d.ts +5 -5
- package/dist/core/runner/prepare-memory.d.ts +4 -6
- package/dist/core/runner/prepare-memory.js +10 -9
- package/dist/core/runner/prepare-offload-wrappers.d.ts +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +6 -6
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -7
- package/dist/core/runner/prepare-policy-chain.js +15 -30
- package/dist/core/runner/prepare-prompt-assembly.js +1 -1
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -5
- package/dist/core/runner/prepare-protocol-tools.d.ts +1 -1
- package/dist/core/runner/prepare-question-face.d.ts +4 -4
- package/dist/core/runner/prepare-run-refs.d.ts +11 -11
- package/dist/core/runner/prepare-safety-scan.d.ts +2 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -4
- package/dist/core/runner/prepare-suspend-saga.js +0 -2
- package/dist/core/runner/prepare-task.d.ts +12 -12
- package/dist/core/runner/prepare-task.js +10 -9
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +2 -3
- package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -4
- package/dist/core/runner/prepare-wiring-manifest.js +9 -7
- package/dist/core/runner/prepare-workspace-restore.d.ts +1 -1
- package/dist/core/runner/remote-env-retry.d.ts +3 -3
- package/dist/core/runner/resume-admission.d.ts +1 -1
- package/dist/core/runner/resume-admission.js +2 -1
- package/dist/core/runner/resume-claim.d.ts +1 -1
- package/dist/core/runner/resume-internals-and-config.d.ts +1 -1
- package/dist/core/runner/resume-internals-and-config.js +4 -0
- package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
- package/dist/core/runner/resume-preflight.d.ts +1 -1
- package/dist/core/runner/resume-review-outcome.d.ts +1 -1
- package/dist/core/runner/retired-runner-deps.d.ts +3 -0
- package/dist/core/runner/retired-runner-deps.js +7 -0
- package/dist/core/runner/run-brain-sinks.d.ts +1 -1
- package/dist/core/runner/run-clock-and-content.d.ts +4 -4
- package/dist/core/runner/run-compaction-machinery.d.ts +3 -3
- package/dist/core/runner/run-git-lane.d.ts +1 -1
- package/dist/core/runner/run-harness-handlers.d.ts +2 -2
- package/dist/core/runner/run-harness-handlers.js +2 -3
- package/dist/core/runner/run-identity-wiring.d.ts +4 -4
- package/dist/core/runner/run-leg.d.ts +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +2 -2
- package/dist/core/runner/run-reasoning-seat.d.ts +2 -2
- package/dist/core/runner/run-settle-and-teardown.d.ts +5 -5
- package/dist/core/runner/run-settle-and-teardown.js +3 -1
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +2 -2
- package/dist/core/runner/run-terminal-adoption.d.ts +5 -5
- package/dist/core/runner/runtask.d.ts +14 -14
- package/dist/core/runner/session-file-state-replay.d.ts +3 -3
- package/dist/core/runner/session-file-state-replay.js +3 -3
- package/dist/core/runner/session-rule-policy.d.ts +2 -2
- package/dist/core/runner/session-rule-policy.js +3 -4
- package/dist/core/runner/steer-admission.d.ts +2 -2
- package/dist/core/runner/stream-halt-verbs.d.ts +1 -1
- package/dist/core/runner/stream-halt-verbs.js +1 -1
- package/dist/core/runner/stream-reap.d.ts +1 -1
- package/dist/core/runner/stream-steer-verb.js +1 -4
- package/dist/core/runner/synthetic-tools.d.ts +8 -8
- package/dist/core/runner/teardown-bounded.d.ts +2 -2
- package/dist/core/runner/tool-defer-gate.d.ts +1 -1
- package/dist/core/runner/tool-disclosure.d.ts +33 -33
- package/dist/core/runner/tool-end-body.d.ts +3 -3
- package/dist/core/runner/tool-face-overlay.d.ts +2 -2
- package/dist/core/runner/tool-output-projection.d.ts +2 -2
- package/dist/core/runner/turn-attachments.d.ts +53 -53
- package/dist/core/runner/usage-accounting.d.ts +4 -4
- package/dist/core/runner/workspace-path.d.ts +1 -1
- package/dist/core/runner/workspace-path.js +3 -0
- package/dist/core/runner-deps.d.ts +30 -49
- package/dist/core/safe-notify.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +4 -4
- package/dist/core/session.d.ts +2 -2
- package/dist/core/skill-tool-specifier.d.ts +1 -1
- package/dist/core/skills-directory.d.ts +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +1 -1
- package/dist/core/strategy-store.d.ts +8 -11
- package/dist/core/task-event.d.ts +20 -17
- package/dist/core/task-limits.d.ts +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +5 -5
- package/dist/core/task-registry-monitor.d.ts +2 -2
- package/dist/core/task-registry-shared.d.ts +27 -27
- package/dist/core/task-registry-shared.js +3 -13
- package/dist/core/task-registry.d.ts +8 -8
- package/dist/core/task-result.d.ts +37 -37
- package/dist/core/task-spec.d.ts +5 -5
- package/dist/core/task-stream.d.ts +16 -11
- package/dist/core/tool-catalog-entries.d.ts +1 -0
- package/dist/core/tool-catalog-entries.js +5 -0
- package/dist/core/tool-conformance.d.ts +0 -2
- package/dist/core/tool-conformance.js +1 -3
- package/dist/core/tool-errors.d.ts +5 -0
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-policy.d.ts +51 -22
- package/dist/core/tool-policy.js +28 -5
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +11 -11
- package/dist/core/tool-spec.d.ts +34 -38
- package/dist/core/tools.d.ts +2 -2
- package/dist/core/trace.d.ts +12 -15
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +4 -3
- package/dist/core/workflow-journal-store.d.ts +11 -11
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -2
- package/dist/engine/execution-env/node-execution-env.js +4 -2
- package/dist/engine/harness/agent-harness.d.ts +47 -4
- package/dist/engine/harness/agent-harness.js +52 -9
- package/dist/engine/llm/types.d.ts +1 -1
- package/dist/engine/loop/agent-loop.js +15 -8
- package/dist/engine/loop/types.d.ts +5 -0
- package/dist/index.d.ts +21 -16
- package/dist/index.js +17 -12
- package/dist/internal/harness.d.ts +1 -0
- package/dist/orchestration/run-spec.d.ts +3 -0
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +12 -6
- package/dist/orchestration/run-workflow-tool.js +23 -5
- package/dist/orchestration/workflow-primitives.d.ts +4 -2
- package/dist/orchestration/workflow-primitives.js +1 -4
- package/dist/orchestration/workflow-types.d.ts +34 -4
- package/dist/orchestration/workflow-types.js +2 -0
- package/dist/orchestration/workflow.d.ts +39 -7
- package/dist/orchestration/workflow.js +234 -113
- package/dist/prompt-assembly/assemble.d.ts +2 -2
- package/dist/prompt-assembly/assemble.js +9 -9
- package/dist/prompt-assembly/composer.d.ts +6 -7
- package/dist/prompt-assembly/composer.js +10 -10
- package/dist/prompt-assembly/epoch.js +1 -1
- package/dist/prompt-assembly/event-registry.d.ts +0 -21
- package/dist/prompt-assembly/packs/sema-default.js +30 -30
- package/dist/prompt-assembly/types.d.ts +14 -14
- package/dist/prompts/coordinator.d.ts +0 -13
- package/dist/prompts/coordinator.js +0 -3
- package/dist/stores/file/checkpoint-store.js +1 -5
- package/dist/stores/file/file-history-store.js +2 -2
- package/dist/stores/file/permission-rule-store.d.ts +4 -35
- package/dist/stores/file/permission-rule-store.js +4 -148
- package/dist/tools/artifact/artifact-text.d.ts +62 -0
- package/dist/tools/artifact/artifact-text.js +68 -0
- package/dist/tools/artifact/artifact-tool.d.ts +52 -0
- package/dist/tools/artifact/artifact-tool.js +351 -0
- package/dist/tools/artifact/local-stub.d.ts +26 -0
- package/dist/tools/artifact/local-stub.js +296 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +114 -48
- package/dist/tools/fs/bash-readonly-classifier.js +171 -60
- package/dist/tools/fs/encoding.d.ts +31 -40
- package/dist/tools/fs/fs-bash.d.ts +49 -45
- package/dist/tools/fs/fs-bash.js +19 -27
- package/dist/tools/fs/fs-pdf.d.ts +8 -8
- package/dist/tools/fs/fs-search-tools.d.ts +4 -4
- package/dist/tools/fs/fs-search-tools.js +5 -2
- package/dist/tools/fs/fs-shared.d.ts +146 -158
- package/dist/tools/fs/fs-shared.js +3 -11
- package/dist/tools/fs/fs-write.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +13 -14
- package/dist/tools/fs/index.d.ts +78 -78
- package/dist/tools/fs/index.js +4 -1
- package/dist/tools/fs/notebook.d.ts +24 -25
- package/dist/tools/fs/pdf.d.ts +3 -3
- package/dist/tools/fs/read-deny.d.ts +22 -22
- package/dist/tools/fs/read-face.d.ts +21 -24
- package/dist/tools/fs/repo-map.d.ts +8 -8
- package/dist/tools/fs/safety.d.ts +233 -130
- package/dist/tools/fs/safety.js +131 -31
- package/dist/tools/fs/search.d.ts +63 -71
- package/dist/tools/fs/search.js +8 -6
- package/package.json +6 -2
- package/test/export-surface.snapshot.json +119 -39
|
@@ -29,7 +29,7 @@ export interface RunNotificationLaneInput<R> {
|
|
|
29
29
|
/** borrowed-mutable — the Runner's per-session parked-notification store: the torn-down lane and the escalation pend here. */
|
|
30
30
|
pendingSessionNotifications: PendingSessionNotifications;
|
|
31
31
|
/** borrowed-readonly — the orchestrator's entry (a lane may not name the orchestrator; the driver hands it in), as the ONE
|
|
32
|
-
* contract the orchestrator's own declaration is pinned to ({@link PrepareTaskFn}, contracts.ts
|
|
32
|
+
* contract the orchestrator's own declaration is pinned to ({@link PrepareTaskFn}, contracts.ts). */
|
|
33
33
|
prepareTask: PrepareTaskFn;
|
|
34
34
|
/** borrowed-readonly — the lanes after this one, entered in this lane's last continuation with what it prepared and bound. */
|
|
35
35
|
next: (lane: RunNotificationLaneResult) => Promise<R>;
|
|
@@ -44,7 +44,7 @@ export interface RunNotificationLaneResult {
|
|
|
44
44
|
}) => Promise<"queued" | "parked" | "dropped_duplicate">;
|
|
45
45
|
/** The turn-open dedup set (the cross-layer double-park dedup): the identity lane registers a redelivered frame's key here. */
|
|
46
46
|
deliveredAtTurnOpen: Set<string>;
|
|
47
|
-
/**
|
|
47
|
+
/** The peer inbound chain ref this run carries (the spawn chain's, or a fresh one). */
|
|
48
48
|
peerInboundChainRef: PeerInboundChainRef;
|
|
49
49
|
/** The model catalog pinned BEFORE prepare (the natural-snapshot closure for swapDeps): the budget seats resolve against it. */
|
|
50
50
|
modelCatalog: RunnerDeps["models"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The run body's REASONING seat (R5), verbatim from `Runner.runLocked`: the leg-entry resolution of
|
|
3
3
|
* the requested reasoning intensity against the model's real capability, the ONE publisher that writes both faces
|
|
4
4
|
* (the `reasoning.resolved` trace frame and the `TaskResult.effectiveReasoning` seat on the backstop carrier), and
|
|
5
5
|
* the wire-facts consumer that lets the leg's FIRST committed request correct the cap-blind mint (once; foreign
|
|
@@ -18,7 +18,7 @@ export interface RunReasoningSeatInput {
|
|
|
18
18
|
export interface RunReasoningSeatResult {
|
|
19
19
|
/** The CONSUMPTION half of {@link ReasoningWireFacts} — installed as the third brain ALS sink. */
|
|
20
20
|
observeReasoningWireFacts: (facts: ReasoningWireFacts) => void;
|
|
21
|
-
/**
|
|
21
|
+
/** The leg's resolution as a READ FACE over this lane's own `let` (the leg-entry mint, then at most one
|
|
22
22
|
* first-committed-request correction): the settle lane's result assembly reads it for `effectiveReasoning`. */
|
|
23
23
|
reasoningResolution: {
|
|
24
24
|
readonly current: ResolvedReasoning | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The run body's SETTLE AND TEARDOWN (R15), verbatim from `Runner.runLocked`: the end-of-task
|
|
3
3
|
* compaction's frames and detector reset, the nested-stats fold, the prefix-cache observability and its loud
|
|
4
4
|
* mismatch / low-hit disclosures, the cross-slice cumulative spend fold, the human-review and mechanism counters,
|
|
5
5
|
* the result assembly (`assembleResult` — the one place the leg's facts become a TaskResult), the resume leg's
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* prompt-suggestion kickoff — then, in its finally, the four teardown legs in the order they were: the shell-lane
|
|
11
11
|
* children settle, the background-shell sweep, the registry clears / the background-agent abort / the retained
|
|
12
12
|
* child sessions, and the owned env's teardown. The suggestion pass (`suggestNextPrompts`, with its four bounds) and the
|
|
13
|
-
* owned-env teardown (`teardownOwnedEnv`) are the lane's own module-private functions since
|
|
13
|
+
* owned-env teardown (`teardownOwnedEnv`) are the lane's own module-private functions since S7, verbatim from
|
|
14
14
|
* the Runner's private methods: each has this one caller, and a sibling file would be a lane-to-lane reach (the S6 legs' reading).
|
|
15
15
|
*
|
|
16
16
|
* Async (eleven first-level awaits, all of them the same awaits at the same positions). The `queue.push("done")` and
|
|
@@ -51,7 +51,7 @@ export interface RunSettleAndTeardownInput {
|
|
|
51
51
|
parentToolCallId: string | undefined;
|
|
52
52
|
/** borrowed-readonly — the sub-agent display name for the terminal tick. */
|
|
53
53
|
subagentName: string | undefined;
|
|
54
|
-
/** borrowed-readonly — the loop-liveness latch: `userHalted`
|
|
54
|
+
/** borrowed-readonly — the loop-liveness latch: `userHalted` = the halt verb was ACCEPTED (the unconsumed-halt notice's input; it does not sign the seat). */
|
|
55
55
|
loopLatch: {
|
|
56
56
|
readonly userHalted: boolean;
|
|
57
57
|
};
|
|
@@ -80,10 +80,10 @@ export interface RunSettleAndTeardownInput {
|
|
|
80
80
|
abortedLive: boolean;
|
|
81
81
|
/** borrowed-readonly — the leg's snapshot of `loopLatch.userInterrupted`: names the origin of a stop that landed after the answer settled. */
|
|
82
82
|
userInterruptedLive: boolean;
|
|
83
|
-
/** borrowed-readonly —
|
|
83
|
+
/** borrowed-readonly — the terminal-adoption lane's ONE evaluation of `answerSettled` (a clean `"stop"` final, no continuation
|
|
84
84
|
* lost). Read by the arbitration (`ResultFlags.answerSettled`), the teardown's stop-source attribution and the notice. */
|
|
85
85
|
answerSettled: boolean;
|
|
86
|
-
/** borrowed-readonly —
|
|
86
|
+
/** borrowed-readonly — the answered-but-never-collected deliveries the leg's finally settled. */
|
|
87
87
|
strandedHumanAnswers: ReadonlyArray<{
|
|
88
88
|
deliveryId: string;
|
|
89
89
|
toolCallId: string;
|
|
@@ -11,6 +11,7 @@ import { defaultTaskRegistry } from "../task-registry.js";
|
|
|
11
11
|
import { emitTrace } from "../trace.js";
|
|
12
12
|
import { deliverEngineNotice } from "../types.js";
|
|
13
13
|
import { assembleResult } from "./assemble-result.js";
|
|
14
|
+
import { discloseUnconsumedHalt } from "./halt-attribution.js";
|
|
14
15
|
import { TIMER_LATENESS_REPORT_MS } from "./clock-and-limits.js";
|
|
15
16
|
import { resumeDecisionWasNegative } from "./decide-continuation.js";
|
|
16
17
|
import { drainForwardedFramesBeforeDone, forwardsSubagentEvents } from "./prepare-run-refs.js";
|
|
@@ -102,7 +103,7 @@ export async function runSettleAndTeardown(input) {
|
|
|
102
103
|
rewindNotes: prepared.rewindNotes,
|
|
103
104
|
editedFiles: prepared.editedFilesSnapshot(),
|
|
104
105
|
haltedOnUserRejection: prepared.batchHaltRef.current !== undefined,
|
|
105
|
-
|
|
106
|
+
haltConsumption: prepared.harness.haltConsumption(),
|
|
106
107
|
strandedHumanAnswers,
|
|
107
108
|
remoteEnvFailures: prepared.remoteEnvFailures,
|
|
108
109
|
effectiveReadFace: prepared.effectiveReadFace,
|
|
@@ -136,6 +137,7 @@ export async function runSettleAndTeardown(input) {
|
|
|
136
137
|
},
|
|
137
138
|
});
|
|
138
139
|
}
|
|
140
|
+
discloseUnconsumedHalt({ accepted: loopLatch.userHalted, consumption: prepared.harness.haltConsumption(), onNotice: runner.deps.onNotice, sessionId: prepared.sessionId, runId: rs.telemetry.runId, taskId: spec.taskId });
|
|
139
141
|
if (resume !== undefined &&
|
|
140
142
|
resume.pendingActionStarted !== true &&
|
|
141
143
|
result.terminal.kind !== "completed" &&
|
|
@@ -15,7 +15,7 @@ export interface RunTelemetryAndBudgetSeatsInput {
|
|
|
15
15
|
stats: Stats;
|
|
16
16
|
/** borrowed-mutable — the stream layer's backstop carrier: the effective task id and session id are published here. */
|
|
17
17
|
taskIdRef: TaskIdRef | undefined;
|
|
18
|
-
/** borrowed-readonly — the invocation's frozen tracer
|
|
18
|
+
/** borrowed-readonly — the invocation's frozen tracer, absence included; undefined when the seat was omitted. */
|
|
19
19
|
entryTracer: {
|
|
20
20
|
tracer: TaskSpec["tracer"];
|
|
21
21
|
} | undefined;
|
|
@@ -32,7 +32,7 @@ export interface RunTelemetryAndBudgetSeatsInput {
|
|
|
32
32
|
sessions: SessionStore;
|
|
33
33
|
}
|
|
34
34
|
export interface RunTelemetryAndBudgetSeatsResult {
|
|
35
|
-
/**
|
|
35
|
+
/** The price-table door — a table adopted MID-RUN that cannot price marks the spend unpriced. */
|
|
36
36
|
noteUnevaluablePriceTable: (p: ModelPricing) => void;
|
|
37
37
|
}
|
|
38
38
|
export declare function runTelemetryAndBudgetSeats(input: RunTelemetryAndBudgetSeatsInput): RunTelemetryAndBudgetSeatsResult;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The run body's TERMINAL ADOPTION (R14), verbatim from `Runner.runLocked`, between the leg's finally and
|
|
3
3
|
* the settle: the typed causes lifted over the leg's anonymous end (the brain-call guardrail's stall, the tool gate's own
|
|
4
4
|
* stop, the platform lane's external cause — which alone overrides a real throw), the usage ledger's FINAL charge with its
|
|
5
5
|
* slow-charge disclosure, the live-abort orphan reconcile and its synthetic `tool_end` frames, the held session-write
|
|
6
6
|
* drain, the user-interruption marker, the durable park's carried caller input and the held agent_end account's settle,
|
|
7
|
-
* the dropped post-compact announce disclosure, and the end-of-task compaction pass (`finish` — since
|
|
7
|
+
* the dropped post-compact announce disclosure, and the end-of-task compaction pass (`finish` — since S7 the lane's
|
|
8
8
|
* own module-private function, verbatim from the Runner's private method: the pass has one caller, and a sibling file would be a
|
|
9
9
|
* lane-to-lane reach, the S6 legs' reading).
|
|
10
10
|
*
|
|
@@ -58,14 +58,14 @@ export interface RunTerminalAdoptionInput<R> {
|
|
|
58
58
|
};
|
|
59
59
|
/** borrowed-readonly — the window-safety builder the end-of-task lane shares with the boundary / PTL lanes. */
|
|
60
60
|
windowSafetyOptions: (mainModel: Model) => Pick<MaybeCompactOptions, "fallbackBudget" | "onWindowSafety">;
|
|
61
|
-
/** borrowed-readonly — the held agent_end account, as the read face on the identity lane's Result
|
|
61
|
+
/** borrowed-readonly — the held agent_end account, as the read face on the identity lane's Result. */
|
|
62
62
|
undrainedUserAtEnd: {
|
|
63
63
|
readonly current: {
|
|
64
64
|
steer: number;
|
|
65
65
|
followUp: number;
|
|
66
66
|
} | undefined;
|
|
67
67
|
};
|
|
68
|
-
/** borrowed-readonly —
|
|
68
|
+
/** borrowed-readonly — did the run end with a person's steer / follow-up still pending (the identity lane's read face)? Folded
|
|
69
69
|
* into the answer-settled verdict this lane evaluates once. */
|
|
70
70
|
userInputLostAtEnd: {
|
|
71
71
|
readonly current: boolean;
|
|
@@ -92,7 +92,7 @@ export interface RunTerminalAdoptionResult {
|
|
|
92
92
|
threw: unknown;
|
|
93
93
|
/** The end-of-task compaction pass's outcome. */
|
|
94
94
|
comp: EndOfTaskCompaction;
|
|
95
|
-
/**
|
|
95
|
+
/** This lane's ONE evaluation of {@link answerSettled}: a clean `"stop"` final with no queued continuation lost. The
|
|
96
96
|
* settle lane hands it to the arbitration (`ResultFlags.answerSettled`), the teardown attribution and the notice. */
|
|
97
97
|
answerSettled: boolean;
|
|
98
98
|
}
|
|
@@ -16,7 +16,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
16
16
|
readonly sessions: SessionStore;
|
|
17
17
|
/** Per-sessionId serialization so two tasks never mutate one session concurrently. */
|
|
18
18
|
private sessionLocks;
|
|
19
|
-
/**
|
|
19
|
+
/** Per-session read-file-state seats (CC parity: readFileState is session-scoped;
|
|
20
20
|
* sema's map stays per-task, so the session scope lives here). A bounded CACHE, never an
|
|
21
21
|
* authority: a durable resume's checkpoint seed wins on its leg, and a miss (cross-process,
|
|
22
22
|
* evicted) falls back to the transcript-replay rung. See {@link SessionReadFileStates}. */
|
|
@@ -38,7 +38,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
38
38
|
* observed `already_resolved` and by the FIFO cap — an evicted entry only ever degrades to the explicit
|
|
39
39
|
* re-supply requirement (fail-loud), never fail-open. */
|
|
40
40
|
private readonly parentConstraintRegistry;
|
|
41
|
-
/**
|
|
41
|
+
/** Same-process suspended-env reap handles by token: the fence contract is
|
|
42
42
|
* "only the expire WINNER destroys the paused env", and the terminal resume-preflight arm
|
|
43
43
|
* (resumeStream) can now BE that winner — without this registry the losing stream-side
|
|
44
44
|
* reapSuspended returned early and the paused env this process holds leaked forever. Registered
|
|
@@ -47,7 +47,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
47
47
|
* the ORIGINAL stream's closure as the reaping owner, deliberately), and when the terminal arm
|
|
48
48
|
* wins. Bounded by live suspended streams (the closures hold the same handles). */
|
|
49
49
|
private readonly suspendedEnvReaps;
|
|
50
|
-
/**
|
|
50
|
+
/** SAME-RUNNER claim marks for {@link suspendedEnvReaps}: a token appears
|
|
51
51
|
* here from the moment an in-process actor ATTEMPTS its settling CAS (the terminal preflight's
|
|
52
52
|
* expire; a resume's resolve) until that actor's duty decision is done. The losing stream-side
|
|
53
53
|
* reap preserves a record ONLY while a local claim is in flight — a CROSS-Runner settlement
|
|
@@ -61,12 +61,12 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
61
61
|
* `swapDeps` replaces the object and a rung reading after its own await must see the replacement. */
|
|
62
62
|
private readonly depsSeat;
|
|
63
63
|
constructor(deps: RunnerDeps);
|
|
64
|
-
/**
|
|
64
|
+
/** Fire `RunnerDeps.onTaskOutcome` through the single swallow-guarded chokepoint
|
|
65
65
|
* ({@link emitTaskOutcome}: mechanical-tier only, throwing sink never breaks the caller). Public so
|
|
66
66
|
* thin compositions OVER the Runner (`runGoal`) can emit at their terminal state without reaching
|
|
67
67
|
* into private deps. */
|
|
68
68
|
emitTaskOutcome(outcome: TaskOutcome): void;
|
|
69
|
-
/**
|
|
69
|
+
/** The deployment agent catalog (RunnerDeps.agents/builtinAgents), exposed READ-ONLY
|
|
70
70
|
* so the Agent-tool lane (`createSubagentTool`) defaults to the SAME registry the workflow lane
|
|
71
71
|
* consumes (single source; the types.ts "pass the same array" follow-on made structural). The array
|
|
72
72
|
* is a fresh copy — a caller mutating it never rewrites this Runner's own deps; the definitions
|
|
@@ -77,7 +77,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
77
77
|
models?: Record<string, Model>;
|
|
78
78
|
roles?: ModelRoles;
|
|
79
79
|
};
|
|
80
|
-
/**
|
|
80
|
+
/** The deployment-level gating baseline, exposed READ-ONLY so thin
|
|
81
81
|
* assemblers over the Runner (`runSpec`) can COMPOSE with it. The task-level engine semantic is a
|
|
82
82
|
* WHOLE-SLOT override (`spec.toolPolicy ?? deps.toolPolicy`, same for hooks — prepare-task), so any
|
|
83
83
|
* assembler that sets `spec.toolPolicy`/`spec.hooks` without folding these in silently shadows the
|
|
@@ -124,8 +124,8 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
124
124
|
* policy gate, no accounting — caller-trusted. */
|
|
125
125
|
sideQuery(spec: SideQuerySpec): Promise<SideQueryResult>;
|
|
126
126
|
/** Run a task and stream live events; await `.result()` for the final TaskResult. `resume` (internal)
|
|
127
|
-
* drives a
|
|
128
|
-
* `internals` (internal
|
|
127
|
+
* drives a durable resume through the same loop instead of a fresh objective prompt.
|
|
128
|
+
* `internals` (internal) is a TRUSTED run-scoped channel for live per-task state the
|
|
129
129
|
* Runner cannot see from `spec` (today: a `runRepairLoop` attempt's live `repairBundle`) — NOT a
|
|
130
130
|
* `TaskSpec` field; undefined on the public path.
|
|
131
131
|
* **Eager:** the task starts executing the moment this stream is constructed (fire-and-forget), NOT lazily
|
|
@@ -133,7 +133,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
133
133
|
* happen. Iterating just observes events (the buffer is backpressure-free); `.result()` awaits completion. */
|
|
134
134
|
runTaskStream(spec: TaskSpec, resume?: ResumeRun, internals?: RunInternals): TaskStream;
|
|
135
135
|
/**
|
|
136
|
-
|
|
136
|
+
* The run body as ONE driver method: `runLocked`'s signature, the lane order, and the two assemblies
|
|
137
137
|
* the driver keeps (the harness handlers, the turn boundary). The lanes' products are threaded under the names they hand
|
|
138
138
|
* back; the two continuations the S6 driver spelled as private methods (`runSeatLanes` / `runAssembliesAndLegs`, joined by
|
|
139
139
|
* a `RunSeatsHandoff` re-spelling of two lanes' Results) are the `next` closures of the two async lanes they follow — the
|
|
@@ -147,7 +147,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
147
147
|
/** Run a task to completion and return a machine-readable result. */
|
|
148
148
|
runTask(spec: TaskSpec, internals?: RunInternals): Promise<TaskResult>;
|
|
149
149
|
/**
|
|
150
|
-
* Resume a task suspended at a durable approval gate
|
|
150
|
+
* Resume a task suspended at a durable approval gate. The token came back as
|
|
151
151
|
* `TaskResult.checkpointToken` from a `status:"suspended"` run; `outcome` carries the human/external
|
|
152
152
|
* decision (`allow`/`deny`, with an optional `updatedInput` arg rewrite or `reason`); `taskConfig`
|
|
153
153
|
* **re-supplies** the same tools / model / policy the task ran with (a token cannot reconstruct tool
|
|
@@ -164,7 +164,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
164
164
|
* v1 serves only the `human`/`policy_ask` gate (F4). A `task_done` checkpoint (1C Path A) is not
|
|
165
165
|
* resumable here — the caller orchestrates that one and reads its handle directly.
|
|
166
166
|
*
|
|
167
|
-
* **🔒 Authorization boundary
|
|
167
|
+
* **🔒 Authorization boundary — token-as-auth, scope is store-level
|
|
168
168
|
* isolation, NOT caller authorization.** `resume` is TOKEN-AS-AUTH: whoever presents a valid, still-`pending`
|
|
169
169
|
* checkpoint token resolves it. The scope passed to the store CAS is the checkpoint's OWN `cp.scope` (read
|
|
170
170
|
* off the row), so the store's scope-WHERE is store-level multi-tenant DATA isolation (one tenant's reaper /
|
|
@@ -192,7 +192,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
192
192
|
* {@link CheckpointError.code}.
|
|
193
193
|
*/
|
|
194
194
|
resume(token: CheckpointToken, outcome: ResumeOutcome, taskConfig: ResumeTaskConfig,
|
|
195
|
-
/**
|
|
195
|
+
/** Same TRUSTED run-internals seam as {@link resumeStream} — the convenience wrapper
|
|
196
196
|
* FORWARDS it (it used to silently drop a 4th arg, so a cross-process re-supply through resume()
|
|
197
197
|
* looked wired but always failed `resume.parent_constraint_missing`). */
|
|
198
198
|
internals?: RunInternals): Promise<TaskResult>;
|
|
@@ -235,7 +235,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
235
235
|
* catches shape MISTAKES, not a untrusted trusted caller). */
|
|
236
236
|
internals?: RunInternals): Promise<TaskStream>;
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
238
|
+
* The resume decision ladder after admission (E3–E10), driving the eight `resume-*` lanes in
|
|
239
239
|
* the order the one-function ladder had: the review / park twins, the approval twin and its bindings, the
|
|
240
240
|
* checkpoint screen, the internals-and-config rungs (whose one window await is taken HERE, where the ladder
|
|
241
241
|
* took it), then the three async rungs after it — apply, preflight, claim — each entering the next in its own last
|
|
@@ -244,7 +244,7 @@ export declare class Runner implements RunnerSelfSeat {
|
|
|
244
244
|
*/
|
|
245
245
|
private resumeLadder;
|
|
246
246
|
/**
|
|
247
|
-
*
|
|
247
|
+
* The ladder's POST-CLAIM rung (E11), the driver's own: the post-consume hook, the answering
|
|
248
248
|
* face minted from the decide's answer, the resumed leg's spec (identity continuity, the existing-session
|
|
249
249
|
* requirement, the stripped pre-aborted preempt signal), the reopen compensation and the execution-record
|
|
250
250
|
* verb bound to the row, the two post-CAS abort re-checks, and the hand-off to `runTaskStream` with the plain
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
* a `git checkout`, a bash command — anything this transcript does not record) therefore fails
|
|
19
19
|
* the staleness comparison and the edit is refused, exactly as it is inside a single task. A
|
|
20
20
|
* reconstruction that re-read the file to build its hash would instead wave the dirty edit
|
|
21
|
-
* through; that is the one thing this module must never do. (
|
|
21
|
+
* through; that is the one thing this module must never do. (This is
|
|
22
22
|
* deliberately STRICTER than CC's own rehydrate, whose Edit arm re-reads the disk and would
|
|
23
23
|
* admit a between-turns external change — same gate satisfaction, no staleness give-up.)
|
|
24
24
|
* 2. **Only records whose full post-condition is PROVABLE qualify.** A whole-file `Read` and a
|
|
25
|
-
* `Write` carry the text verbatim. An `Edit` card
|
|
25
|
+
* `Write` carry the text verbatim. An `Edit` card carries a diff BASE — the
|
|
26
26
|
* pre-edit whole text plus the resolved mutations — so its post-condition is RECOMPUTED through
|
|
27
27
|
* the same single-source application step the tool itself used (`applyRecordedEdit`); a card
|
|
28
28
|
* that cannot recompute (malformed, offloaded, or its oldString absent from its own base) falls
|
|
@@ -45,7 +45,7 @@ export interface TranscriptFileRecord {
|
|
|
45
45
|
*
|
|
46
46
|
* Records are read only from SUCCESSFUL results (an `isError` result changed nothing and proves
|
|
47
47
|
* nothing). A `Write` proves the post-condition it just persisted; a whole-file `Read` proves what it
|
|
48
|
-
* just served. An `Edit` card
|
|
48
|
+
* just served. An `Edit` card proves the post-condition RECOMPUTED from its recorded
|
|
49
49
|
* diff base + mutations — or, when it cannot prove (malformed / offloaded / inconsistent), retracts
|
|
50
50
|
* whatever an earlier record said (leaving a stale entry behind would blame the user for the agent's
|
|
51
51
|
* own edit, "modified since read", the next turn). A `NotebookEdit` always retracts (deliberate
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isAbsoluteForFamily, pathFamilyOf } from "../../tools/fs/safety.js";
|
|
2
2
|
import { applyRecordedEdit } from "../../tools/fs/fs-shared.js";
|
|
3
3
|
import { normalizeFileText } from "../../tools/fs/encoding.js";
|
|
4
4
|
import { isOffloadedDetailReplacement } from "../tool-result-store.js";
|
|
@@ -75,7 +75,7 @@ export function wholeFileRecordsFromTranscript(messages) {
|
|
|
75
75
|
if (typeof changed !== "string")
|
|
76
76
|
continue;
|
|
77
77
|
const replayed = replayedEditContent(rest);
|
|
78
|
-
if (replayed !== undefined &&
|
|
78
|
+
if (replayed !== undefined && isAbsoluteForFamily(pathFamilyOf({ root: changed }), changed)) {
|
|
79
79
|
byPath.set(changed, { path: changed, content: replayed, at: m.timestamp });
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
@@ -97,7 +97,7 @@ export function wholeFileRecordsFromTranscript(messages) {
|
|
|
97
97
|
const nested = rest.file;
|
|
98
98
|
const holder = isRead ? (typeof nested === "object" && nested !== null ? nested : undefined) : rest;
|
|
99
99
|
const filePath = holder?.filePath;
|
|
100
|
-
if (typeof filePath !== "string" || !
|
|
100
|
+
if (typeof filePath !== "string" || !isAbsoluteForFamily(pathFamilyOf({ root: filePath }), filePath))
|
|
101
101
|
continue;
|
|
102
102
|
const content = isRead ? wholeFileFromReadCard(rest) : typeof rest.content === "string" ? rest.content : undefined;
|
|
103
103
|
if (content === undefined)
|
|
@@ -12,7 +12,7 @@ import type { SessionPermissionRules } from "../session-policy-store.js";
|
|
|
12
12
|
* `NotebookEdit` (whose target is `notebook_path`) lives in the superset
|
|
13
13
|
* {@link PATH_CONFINABLE_WRITE_TOOLS} below, NOT here: `createActiveSkillScopePolicy` reads THIS set and
|
|
14
14
|
* deliberately keeps fail-closed-denying notebooks under a manifest `allowPaths` fence (widening the
|
|
15
|
-
* skill face is a separate capability decision
|
|
15
|
+
* skill face is a separate capability decision). */
|
|
16
16
|
export declare const PATH_WRITE_TOOLS: ReadonlySet<string>;
|
|
17
17
|
/** The FULL path-confinable write-tool set: {@link PATH_WRITE_TOOLS} plus `NotebookEdit`, whose write
|
|
18
18
|
* target is `notebook_path` and is extracted by the shared tool-aware {@link writeTargetPath} (
|
|
@@ -60,7 +60,7 @@ export declare function isWithin(root: string, p: string): boolean;
|
|
|
60
60
|
* so a symlink can't carry across a write out); a write-capable tool that cannot be path-confined (e.g. `bash`)
|
|
61
61
|
* is DENIED while `allowDirs` is set (fail-closed, mirrors active-skill-scope MAJOR-2).
|
|
62
62
|
* Returns `allow` when nothing constrains the call. `env`/`rootPath` are the task's real exec env + root, so
|
|
63
|
-
* matching sees the actual filesystem (a remote/E2B task resolves in its container).
|
|
63
|
+
* matching sees the actual filesystem (a remote/E2B task resolves in its container). A relative
|
|
64
64
|
* TARGET prefers the call's live tracked cwd ({@link ToolCallRequest.cwd}) when the engine stamps one;
|
|
65
65
|
* `allowDirs` entries always resolve against `rootPath`.
|
|
66
66
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { canonicalizeTarget, writeTargetPath } from "../../tools/fs/safety.js";
|
|
2
|
-
import { isWinFormPath } from "../../tools/fs/safety.js";
|
|
1
|
+
import { canonicalizeTarget, isWinFormPath, pathFamilyOf, writeTargetPath } from "../../tools/fs/safety.js";
|
|
3
2
|
import { createCoarseCommandNamePolicy, namespacedCoveringEntries, namespacedCoveringHit } from "../tool-policy.js";
|
|
4
3
|
import { declaredPathTargetOf, isProtectedWrite, pathConfinableWriteToolNames, skillScopeWriteToolNames } from "../tool-registry.js";
|
|
5
4
|
import { pathTargetBaseOf } from "../effective-path-target.js";
|
|
@@ -66,13 +65,13 @@ export function createSessionRulePolicy(rules, opts) {
|
|
|
66
65
|
if (typeof path !== "string" || path.length === 0) {
|
|
67
66
|
return deny(`write tool "${req.toolName}" denied: session rule confines writes to allowDirs but the call has no resolvable path`);
|
|
68
67
|
}
|
|
69
|
-
const canon = await canonicalizeTarget(env, path, signal, pathTargetBaseOf(declared, { root: rootPath, cwd: req.cwd }));
|
|
68
|
+
const canon = await canonicalizeTarget(env, path, signal, pathFamilyOf({ root: rootPath, cwd: req.cwd ?? env.cwd }), pathTargetBaseOf(declared, { root: rootPath, cwd: req.cwd }));
|
|
70
69
|
if (!canon.ok) {
|
|
71
70
|
return deny(`write to "${path}" denied: its real target could not be resolved against the session-rule allowDirs`);
|
|
72
71
|
}
|
|
73
72
|
const roots = [];
|
|
74
73
|
for (const raw of allowDirs) {
|
|
75
|
-
const r = await canonicalizeTarget(env, raw, signal, rootPath);
|
|
74
|
+
const r = await canonicalizeTarget(env, raw, signal, pathFamilyOf({ root: rootPath ?? env.cwd }), rootPath);
|
|
76
75
|
if (r.ok)
|
|
77
76
|
roots.push(r.key);
|
|
78
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Admission bookkeeping for HUMAN INPUTS accepted mid-run
|
|
2
|
+
* Admission bookkeeping for HUMAN INPUTS accepted mid-run: the per-leg ordinal an
|
|
3
3
|
* accepted input is stamped with, and the field-for-field "is this repeat the same instruction" test the
|
|
4
4
|
* live steer verb applies under an already-used `inputId`. Two accepting arms share both — the stream's
|
|
5
5
|
* `steer` verb and the run body — which is why the ordinal is keyed on the leg's harness in a module-level
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { AcceptedSteerInput } from "./contracts.js";
|
|
12
12
|
export declare function nextHumanInputSeq(key: object): number;
|
|
13
|
-
/**
|
|
13
|
+
/** Is a repeat under an already-accepted `inputId` the SAME
|
|
14
14
|
* instruction (an idempotent retry) or a different one wearing a used key? Compared field for field,
|
|
15
15
|
* exactly like the parked leg's replay check: the key alone is never evidence of a replay, and two
|
|
16
16
|
* callers colliding on one id must not silently lose the second instruction. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The TaskStream façade's HALT verbs (T7), verbatim from `Runner.runTaskStream`: `halt` (the bare
|
|
3
3
|
* user interrupt — the finished-task refusal, the fresh liveness test on the resolved handle, `apply` with its
|
|
4
4
|
* pre-abort ownership snapshot, the conjunctive attribution seat, the unconsumed-halt and turn-cut notices, and
|
|
5
5
|
* the birth-window poll; never on the steer FIFO chain) and `destroy` (the once-memoized reap: abort, await the
|
|
@@ -19,7 +19,7 @@ export function streamHaltVerbs(input) {
|
|
|
19
19
|
if (receipt.accepted && !abortOwnedBeforeHalt) {
|
|
20
20
|
h.loop.userHalted = true;
|
|
21
21
|
}
|
|
22
|
-
else {
|
|
22
|
+
else if (!h.loop.userHalted) {
|
|
23
23
|
deliverEngineNotice(runner.deps.onNotice, {
|
|
24
24
|
code: "task.halt_unconsumed",
|
|
25
25
|
message: "a user halt arrived while the run was already ending for its own reason: nothing was cut or stopped " +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The TaskStream façade's REAP lane (T4), verbatim from `Runner.runTaskStream`: `destroy()`'s
|
|
3
3
|
* once-memoized work for a run that SUSPENDED. Runs AFTER `run` has settled (the destroy verb awaits the run before
|
|
4
4
|
* calling it), fences any concurrent resume first (the single-shot `expire` CAS — only the winner destroys the
|
|
5
5
|
* paused env; a loser retires its reap record only when no same-Runner claimant is in flight), evicts the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { uuidv7 } from "../../internal/harness.js";
|
|
2
2
|
import { snapshotActorAssertion } from "../../internal/llm.js";
|
|
3
|
-
import {
|
|
3
|
+
import { MAX_STEER_INPUT_ID_CHARS } from "../checkpoint-store.js";
|
|
4
4
|
import { formatHookFeedback, hookSeatExpiredError, runHookSeat } from "../hooks.js";
|
|
5
5
|
import { buildHumanInputEvent, frameMidTurnUserInput, projectHumanInput } from "../human-input-projection.js";
|
|
6
6
|
import { isSystemInjectionPriority, SYSTEM_INJECTION_PRIORITIES } from "../task-notification.js";
|
|
@@ -23,9 +23,6 @@ export function streamSteerVerb(input) {
|
|
|
23
23
|
if (inputId === "" || inputId.length > MAX_STEER_INPUT_ID_CHARS) {
|
|
24
24
|
throw steeringError(`inputId must be a non-empty string of at most ${MAX_STEER_INPUT_ID_CHARS} characters`, "steering.invalid_content");
|
|
25
25
|
}
|
|
26
|
-
if (inputId === LEGACY_PENDING_STEER_INPUT_ID) {
|
|
27
|
-
throw steeringError(`inputId "${LEGACY_PENDING_STEER_INPUT_ID}" is reserved for a pre-queue parked steer and cannot be supplied by a caller`, "steering.invalid_content");
|
|
28
|
-
}
|
|
29
26
|
}
|
|
30
27
|
const priorityIn = options?.priority;
|
|
31
28
|
if (priorityIn !== undefined && !isSystemInjectionPriority(priorityIn)) {
|
|
@@ -5,7 +5,7 @@ import type { ActiveSkillScope } from "./active-skill-scope.js";
|
|
|
5
5
|
/** Reserved name of the injected structured-output tool (CC 2.1.187 `StructuredOutput`; batch-A rename — old
|
|
6
6
|
* "submit_output" is canonicalized for pre-rename durable state). */
|
|
7
7
|
export declare const OUTPUT_TOOL_NAME = "StructuredOutput";
|
|
8
|
-
/** Reserved name of the injected blocked-report signal tool (
|
|
8
|
+
/** Reserved name of the injected blocked-report signal tool (PascalCase: `report_blocked`→`ReportBlocked`). */
|
|
9
9
|
export declare const REPORT_BLOCKED_TOOL_NAME = "ReportBlocked";
|
|
10
10
|
/** Name of the injected code-review findings echo tool (CC 2.1.207 parity — 锚 pretty.js:361412 `BCe`). */
|
|
11
11
|
export declare const REPORT_FINDINGS_TOOL_NAME = "ReportFindings";
|
|
@@ -80,7 +80,7 @@ interface SkillLike {
|
|
|
80
80
|
name: string;
|
|
81
81
|
description: string;
|
|
82
82
|
content: string;
|
|
83
|
-
/** Optional Gate-3 runtime capability manifest
|
|
83
|
+
/** Optional Gate-3 runtime capability manifest — carried through so a successful
|
|
84
84
|
* `skill` load can push its scope frame. Skills without one stay unscoped (backward-compatible). */
|
|
85
85
|
manifest?: SkillManifest;
|
|
86
86
|
/** Optional attachments (SkillSpec.files): disclosed as paths in the block, delivered inline on
|
|
@@ -102,7 +102,7 @@ export interface SkillListingEntry {
|
|
|
102
102
|
files?: Array<{
|
|
103
103
|
path: string;
|
|
104
104
|
}>;
|
|
105
|
-
/**
|
|
105
|
+
/** The skill's rank in the DEPLOYMENT'S DECLARATION order (`TaskSpec.skills`, first-wins
|
|
106
106
|
* dedupe applied, 0 = declared first). Lower = higher priority. Used ONLY to decide which skills keep
|
|
107
107
|
* their descriptions when the block overflows its byte budget ({@link buildSkillsBlock} tier B); the
|
|
108
108
|
* DISPLAY order stays name-sorted, so adding this never moves a line.
|
|
@@ -113,7 +113,7 @@ export interface SkillListingEntry {
|
|
|
113
113
|
* skill-usage store, and no bundled/user distinction (every skill arrives through the same
|
|
114
114
|
* caller-supplied `TaskSpec.skills`). Declaration order is the one priority statement the deployment
|
|
115
115
|
* can actually make here, and it is the same statement 220's bundled-pin encodes ("these matter most,
|
|
116
|
-
* keep their descriptions"). Absent ⇒ the entry's array index is used, i.e. the
|
|
116
|
+
* keep their descriptions"). Absent ⇒ the entry's array index is used, i.e. the prior behavior. */
|
|
117
117
|
declaredRank?: number;
|
|
118
118
|
}
|
|
119
119
|
/** Dedupe by name (first occurrence wins) and sort by name — one deterministic list shared by the
|
|
@@ -139,12 +139,12 @@ export declare function skillListingLine(s: SkillListingEntry): string;
|
|
|
139
139
|
* render can never blow the budget it was sized against —
|
|
140
140
|
* A. everything fits → every skill gets its full `- name: description` line (byte-identical to
|
|
141
141
|
* the pre-C4 render for every block that was legal under the old cap);
|
|
142
|
-
* B.
|
|
142
|
+
* B. (CC 220 `sbs` @317547-317586) — reserve the cap marker + EVERY skill's name-only line
|
|
143
143
|
* first, then spend the remaining slack on descriptions in PRIORITY order
|
|
144
144
|
* ({@link SkillListingEntry.declaredRank}), admitting each description whose incremental cost
|
|
145
145
|
* still fits and skipping (not stopping at) the ones that do not. Every skill stays listed;
|
|
146
146
|
* the ones that lose their description are the low-priority ones, not the alphabetically late
|
|
147
|
-
* ones. This replaces the
|
|
147
|
+
* ones. This replaces the prior "longest full-line PREFIX" cut, which had two defects the
|
|
148
148
|
* anchor does not: the surviving set was decided by name sort order (a skill named `zip-deploy`
|
|
149
149
|
* lost its description to `aardvark-lint` for no reason connected to either skill), and one
|
|
150
150
|
* oversized description truncated the block at itself instead of being skipped over;
|
|
@@ -154,7 +154,7 @@ export declare function buildSkillsBlock(skills: ReadonlyArray<SkillListingEntry
|
|
|
154
154
|
/**
|
|
155
155
|
* The injected `skill` tool: returns a skill's full body as a tool result.
|
|
156
156
|
*
|
|
157
|
-
* When a {@link ActiveSkillScope} is supplied (
|
|
157
|
+
* When a {@link ActiveSkillScope} is supplied (Gate-3) and the loaded skill carries a
|
|
158
158
|
* `manifest`, a successful load PUSHES a scope frame onto the per-task LIFO stack, so the rest of the
|
|
159
159
|
* invocation is deny-narrowed to the manifest's tools/paths. Nested loads (a skill whose body loads
|
|
160
160
|
* another skill) STACK and compose MONOTONICALLY as the INTERSECTION of every active frame's
|
|
@@ -162,7 +162,7 @@ export declare function buildSkillsBlock(skills: ReadonlyArray<SkillListingEntry
|
|
|
162
162
|
* the test/lifecycle may pop explicitly via `scope.pop()` to model a skill frame closing). Skills with
|
|
163
163
|
* NO manifest push nothing (unscoped, backward-compatible).
|
|
164
164
|
*
|
|
165
|
-
* v1 lifetime is heuristic (
|
|
165
|
+
* v1 lifetime is heuristic (a residual): the model controls its own turns, so push-on-load
|
|
166
166
|
* is the trigger and the worst case (a frame never popped) is simply continued narrowing — never a
|
|
167
167
|
* widening, so it stays safe-by-construction.
|
|
168
168
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bounded await for BEST-EFFORT teardown /
|
|
3
3
|
* cleanup legs on a run's settle path.
|
|
4
4
|
*
|
|
5
5
|
* The defect class: `resume()`/`runTask` settle only when the run body returns, and the body's tail
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* proceeds. The abandoned leg keeps running (nothing can cancel a wedged promise); the incident
|
|
18
18
|
* report says exactly that, so a leaked env/process is attributable instead of anonymous.
|
|
19
19
|
*
|
|
20
|
-
* Timer discipline (
|
|
20
|
+
* Timer discipline (with-retry.ts same doctrine): the race timer is deliberately NOT
|
|
21
21
|
* unref'd — the caller awaits this in FOREGROUND control flow, and an unref'd timer lets an
|
|
22
22
|
* otherwise-empty event loop exit mid-wait, which un-settles the very await this module exists to
|
|
23
23
|
* bound. The timer is itself bounded, and cleared the moment the leg settles.
|
|
@@ -2,7 +2,7 @@ import type { Model } from "../../internal/llm.js";
|
|
|
2
2
|
import type { ToolSpec } from "../types.js";
|
|
3
3
|
import type { ToolFingerprintInput } from "../cache-break-detector.js";
|
|
4
4
|
/**
|
|
5
|
-
* The deferral GATE
|
|
5
|
+
* The deferral GATE: which mounted tool names ship as placeholders on a request. Pure
|
|
6
6
|
* registry logic over names and sizes — no harness, no I/O. `tool-disclosure.ts` owns the placeholder
|
|
7
7
|
* and ToolSearch mechanics that act on the set this module decides; `prepare-defer-classify.ts` is the
|
|
8
8
|
* phase that assembles the inputs from the mounted face.
|