@sema-agent/core 5.57.0 → 5.59.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 +96 -0
- package/dist/agents/cascade.d.ts +1 -1
- package/dist/agents/cumulative-stats.d.ts +1 -1
- package/dist/agents/observer.d.ts +2 -2
- package/dist/agents/peer-admission.d.ts +1 -1
- package/dist/agents/retain-ledger.d.ts +2 -2
- package/dist/agents/roster-store.d.ts +8 -8
- package/dist/agents/send-message-tool.d.ts +2 -2
- package/dist/agents/subagent-steps.d.ts +1 -1
- package/dist/agents/subagent.d.ts +13 -13
- package/dist/agents/team.d.ts +5 -5
- package/dist/agents/tool-filter.d.ts +2 -2
- package/dist/agents/verify.d.ts +1 -1
- package/dist/bench/metrics.d.ts +35 -35
- package/dist/brain/degrading.d.ts +1 -1
- package/dist/brain/errors.d.ts +3 -3
- package/dist/brain/reasoning.d.ts +2 -2
- package/dist/brain/repetition.d.ts +1 -1
- package/dist/brain/route-adjudicator.d.ts +8 -1
- package/dist/brain/route-adjudicator.js +8 -1
- package/dist/brain/status-sink.d.ts +2 -2
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/config/catalog.d.ts +5 -5
- package/dist/core/arg-summary.d.ts +4 -4
- package/dist/core/ask-class.d.ts +2 -2
- package/dist/core/ask-question.d.ts +1 -1
- package/dist/core/auto-compaction.d.ts +15 -15
- package/dist/core/auto-mode.d.ts +5 -5
- package/dist/core/background-agent-store.d.ts +20 -20
- package/dist/core/background-shell.d.ts +4 -4
- package/dist/core/checkpoint-store.d.ts +35 -27
- package/dist/core/context-edit.d.ts +1 -1
- package/dist/core/context-guard.d.ts +1 -1
- package/dist/core/exec-output-tail.d.ts +6 -6
- package/dist/core/file-snapshot-store.d.ts +8 -8
- package/dist/core/git-worktree-env.d.ts +3 -3
- package/dist/core/governance-codes.d.ts +37 -10
- package/dist/core/governance-codes.js +54 -1
- package/dist/core/hooks.d.ts +73 -33
- package/dist/core/hooks.js +87 -25
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/locked-config.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/mailbox-store.d.ts +1 -1
- package/dist/core/mcp.d.ts +3 -3
- package/dist/core/memory-engine/consolidation-driver.d.ts +211 -0
- package/dist/core/memory-engine/consolidation-driver.js +427 -0
- package/dist/core/memory-engine/consolidation.d.ts +119 -3
- package/dist/core/memory-engine/consolidation.js +22 -1
- package/dist/core/memory-engine/data-plane.d.ts +1 -1
- package/dist/core/memory-engine/distiller.d.ts +550 -0
- package/dist/core/memory-engine/distiller.js +598 -0
- package/dist/core/memory-engine/dual-root.d.ts +1 -1
- package/dist/core/memory-engine/engine.d.ts +143 -10
- package/dist/core/memory-engine/engine.js +149 -23
- package/dist/core/memory-engine/file-backend.d.ts +14 -2
- package/dist/core/memory-engine/file-backend.js +3 -0
- package/dist/core/memory-engine/index.d.ts +6 -3
- package/dist/core/memory-engine/index.js +4 -2
- package/dist/core/memory-engine/layout.js +20 -6
- package/dist/core/memory-engine/origin-clearance.d.ts +1 -1
- package/dist/core/memory-engine/scope-contract.d.ts +4 -4
- package/dist/core/memory-engine/sync-client.d.ts +16 -16
- package/dist/core/memory-engine/sync.d.ts +4 -4
- package/dist/core/memory-engine/types.d.ts +17 -0
- package/dist/core/memory-recall.d.ts +1 -1
- package/dist/core/memory.d.ts +2 -2
- package/dist/core/permission-rule-consent.d.ts +185 -36
- package/dist/core/permission-rule-consent.js +219 -44
- package/dist/core/permission-rule-model.d.ts +235 -31
- package/dist/core/permission-rule-model.js +105 -35
- package/dist/core/permission-rules.d.ts +9 -9
- package/dist/core/remote-env.d.ts +8 -8
- package/dist/core/roles.d.ts +3 -3
- package/dist/core/roles.js +1 -0
- package/dist/core/runner/assemble-result.d.ts +2 -2
- package/dist/core/runner/compaction-call-options.d.ts +3 -3
- package/dist/core/runner/memory-consolidation-driver.d.ts +49 -0
- package/dist/core/runner/memory-consolidation-driver.js +60 -0
- package/dist/core/runner/memory-consolidation.d.ts +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +3 -3
- package/dist/core/runner/prepare-task.d.ts +21 -21
- package/dist/core/runner/prepare-task.js +24 -17
- package/dist/core/runner/prepare-workspace-restore.d.ts +2 -2
- package/dist/core/runner/runtask.d.ts +11 -11
- package/dist/core/runner/runtask.js +4 -4
- package/dist/core/runner/session-rule-policy.d.ts +1 -1
- package/dist/core/runner/teardown-bounded.d.ts +1 -1
- package/dist/core/runner/tool-disclosure.d.ts +2 -2
- package/dist/core/runner/turn-attachments.d.ts +11 -11
- package/dist/core/scheduler.d.ts +5 -5
- package/dist/core/secret-env.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/session-policy-store.d.ts +2 -2
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +3 -3
- package/dist/core/session.d.ts +1 -1
- package/dist/core/shutdown-debug.d.ts +2 -2
- package/dist/core/side-query.d.ts +2 -2
- package/dist/core/spec-contract.d.ts +1 -1
- package/dist/core/store-contracts/contract-harness.d.ts +2 -2
- package/dist/core/store-contracts/contract-kit-version.d.ts +2 -2
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/mailbox-store-contract.js +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +12 -12
- package/dist/core/task-registry-monitor.d.ts +1 -1
- package/dist/core/task-registry-shared.d.ts +41 -41
- package/dist/core/task-registry.d.ts +12 -12
- package/dist/core/tool-detach.d.ts +2 -2
- package/dist/core/tool-errors.d.ts +3 -3
- package/dist/core/tool-policy.d.ts +113 -28
- package/dist/core/tool-policy.js +80 -1
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +2 -2
- package/dist/core/tools.d.ts +1 -1
- package/dist/core/trace.d.ts +26 -23
- package/dist/core/types.d.ts +164 -86
- package/dist/core/types.js +4 -3
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +7 -7
- package/dist/core/wiring-manifest.d.ts +5 -5
- package/dist/core/workflow-journal-store.d.ts +14 -14
- package/dist/core/workflow-run-store-contract.d.ts +1 -1
- package/dist/core/workflow-run-store-contract.js +1 -1
- package/dist/core/workflow-run-store.d.ts +4 -4
- package/dist/engine/compaction/compaction.d.ts +3 -3
- package/dist/engine/compaction/utils.d.ts +2 -2
- package/dist/engine/execution-env/kill-tree.d.ts +1 -1
- package/dist/engine/execution-env/node-execution-env.d.ts +8 -8
- package/dist/engine/harness/agent-harness.d.ts +6 -6
- package/dist/engine/harness/messages.d.ts +1 -1
- package/dist/engine/harness/types.d.ts +10 -10
- package/dist/engine/llm/types.d.ts +14 -14
- package/dist/engine/loop/agent-loop.d.ts +3 -3
- package/dist/engine/loop/types.d.ts +4 -4
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/import-validate.d.ts +1 -1
- package/dist/engine/session/log-digest.d.ts +1 -1
- package/dist/engine/session/memory-repo.d.ts +2 -2
- package/dist/engine/session/session.d.ts +4 -4
- package/dist/fixtures/index.d.ts +4 -4
- package/dist/index.d.ts +6 -5
- package/dist/index.js +5 -4
- package/dist/orchestration/goal.d.ts +1 -1
- package/dist/orchestration/run-spec.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +12 -12
- package/dist/orchestration/workflow-governance.d.ts +4 -4
- package/dist/orchestration/workflow-observe.d.ts +1 -1
- package/dist/orchestration/workflow-script-runner.d.ts +1 -1
- package/dist/orchestration/workflow-script-store.d.ts +9 -9
- package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +5 -5
- package/dist/orchestration/workflow.d.ts +10 -10
- package/dist/prompt-assembly/artifact-store.d.ts +1 -1
- package/dist/prompt-assembly/artifact.d.ts +1 -1
- package/dist/prompt-assembly/assemble.d.ts +1 -1
- package/dist/prompt-assembly/composer.d.ts +2 -2
- package/dist/prompt-assembly/epoch.d.ts +2 -2
- package/dist/prompt-assembly/event-registry.d.ts +1 -1
- package/dist/prompt-assembly/explain.d.ts +3 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +1 -1
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -4
- package/dist/prompt-assembly/types.d.ts +12 -12
- package/dist/prompts/coordinator.d.ts +1 -1
- package/dist/prompts/default.d.ts +8 -8
- package/dist/prompts/simple-sections.d.ts +3 -3
- package/dist/prompts/supervisor.d.ts +2 -2
- package/dist/scenarios/full-body.d.ts +3 -3
- package/dist/scenarios/scenario-registry.d.ts +1 -1
- package/dist/stores/cc/sidecar-transcript.d.ts +3 -3
- package/dist/stores/file/fs-atomic.d.ts +2 -2
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/session-store.d.ts +2 -2
- package/dist/stores/file/workflow-journal-store.d.ts +4 -4
- package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
- package/dist/tools/fs/encoding.d.ts +4 -4
- package/dist/tools/fs/fs-bash.d.ts +3 -3
- package/dist/tools/fs/fs-pdf.d.ts +1 -1
- package/dist/tools/fs/fs-shared.d.ts +6 -6
- package/dist/tools/fs/index.d.ts +2 -2
- package/dist/tools/fs/notebook.d.ts +1 -1
- package/dist/tools/fs/pdf.d.ts +1 -1
- package/dist/tools/fs/read-deny.d.ts +1 -1
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +2 -2
- package/dist/tools/monitor.d.ts +3 -3
- package/dist/tools/task-list.d.ts +2 -2
- package/dist/tools/web.d.ts +4 -4
- package/dist/tools/worktree.d.ts +5 -5
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +1826 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.59.0 — 2026-08-24
|
|
4
|
+
|
|
5
|
+
### BREAKING (narrow, named)
|
|
6
|
+
- **`ConsolidationDriverEngine` requires `readConsolidationPlanFoldEvidence`** (the member-level
|
|
7
|
+
conservation wall's read face). `MemoryEngine` satisfies it as before; a custom driver-engine stub
|
|
8
|
+
must add the member (compile error otherwise). Default-off feature shipped one version ago —
|
|
9
|
+
blast radius is stub authors only.
|
|
10
|
+
|
|
11
|
+
### Changed — consolidation safety narrowings (design/376 slice ③; default-off face, all fail-closed)
|
|
12
|
+
- **Member-level conservation wall**: a run whose planned members were deleted/excluded/folded by
|
|
13
|
+
another writer mid-run now settles `driver_failed` naming the missing ids, where a numeric offset
|
|
14
|
+
previously produced a false `converged`. Attribution uses the exact plan-frozen cycle-id grammar
|
|
15
|
+
(prefix-shadow ids cannot re-satisfy a member). Count witnesses remain the fast pass.
|
|
16
|
+
- **C-2 scan-refusal reach**: scan findings refuse per PRODUCT (disclosed; whole-plan refusal past
|
|
17
|
+
`min(floor(0.25×submitted), 8)` — knobs `scanRefusalRatioCap`/`scanRefusalMaxPerPlan`, bad values
|
|
18
|
+
refuse loudly); an empty or frozen-empty plan refuses instead of settling a vacuous completed;
|
|
19
|
+
refused input ids are excluded from the completion fingerprint and ride the plan file under a
|
|
20
|
+
bidirectional v2⇔member version gate (a pre-field worker parks loudly on a v2 plan instead of
|
|
21
|
+
settling wrong). WIDENING, named: refused products' edges no longer trip the supersession fuse.
|
|
22
|
+
- **C-3 instruction-form hard gate is unconditional**: a clean visible set refuses instruction-form
|
|
23
|
+
products by default (previously committed), naming the host escape hatch
|
|
24
|
+
`consolidation.allowInstructionProducts: true` (screened exactly-true; opens the clean arm only —
|
|
25
|
+
a marked set refuses with no opening knob).
|
|
26
|
+
- Registry reads are journal-aware (a committed journal wins; an unreadable journal throws
|
|
27
|
+
fail-closed instead of serving a clean-looking stale registry).
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **`NOTICE_AUDIENCE` registry (closed)**: `ENGINE_NOTICE_CODES` is the 27-code catalog,
|
|
31
|
+
`NOTICE_AUDIENCE` answers for every member (8 user / 19 operator) in compile-time lockstep both
|
|
32
|
+
directions; `task.user_steer_undrained`/`task.user_followup_undrained` now carry `sessionId`
|
|
33
|
+
filled from the real run; catalog/code/audience types root-exported for downstream table diffing.
|
|
34
|
+
- **`AskRequest.hasBidiControls`** presence bit (additive): minted at the ask throat over
|
|
35
|
+
execution-snapshot args + tool preview for the directional-control class (U+061C/200E/200F/
|
|
36
|
+
202A-202E/2066-2069); presence-only (never `false`; absence covers budget exhaustion), zero
|
|
37
|
+
rewriting; the scan charges every character — values, object keys, Map keys, inherited names —
|
|
38
|
+
through ONE bounded reader (node budget + 1M code-unit allowance). Plus
|
|
39
|
+
**`renderUntrustedCommandText`** root export: the lossy DISPLAY baseline for raw command bytes
|
|
40
|
+
(strips Cf, folds controls to spaces, code-point cap with ellipsis; identity stays on raw).
|
|
41
|
+
- **Read faces**: `readConsolidationGateState` (present|absent|corrupt-with-detail; legacy face
|
|
42
|
+
byte-unchanged), `readConsolidationPlanFoldEvidence` (ok/absent/corrupt; applied-only edges),
|
|
43
|
+
`MemoryEngine.listMemoryScopes()`/File-backend `listScopes()` with the `supported` discriminator
|
|
44
|
+
(a backend that cannot enumerate answers `supported:false` with a reason, never `[]`).
|
|
45
|
+
- **Export tiers v1**: the export-surface snapshot carries a machine-readable `tiers` column
|
|
46
|
+
(stable/advanced/internal; self-declared heuristic) with a three-leg gate (every live export
|
|
47
|
+
tiered, no stale rows, live derivation ≡ frozen column).
|
|
48
|
+
- `OriginClearanceRow`/`OriginClearanceEvent` root type exports (server design/316 car-B compile
|
|
49
|
+
prerequisite). Export surface 1749 → 1758, all additive.
|
|
50
|
+
|
|
51
|
+
## 5.58.0 — 2026-08-24
|
|
52
|
+
|
|
53
|
+
### BREAKING (design/375 case A — per-segment batch consent; ships as one window, no compatibility arms)
|
|
54
|
+
- **`AskRequest.ruleSuggestions` → `ruleOffers`**: a closed discriminated union
|
|
55
|
+
(`single{rule,match,command}` | `batch{rules(1..5), uncoveredSegments}`); at most 2 offers, the
|
|
56
|
+
whole-string exact single always at index 0, the batch always last; choosing a batch is ONE yes to
|
|
57
|
+
all its members. `PendingAction.tool_approval` carries the same seat. An unknown offer kind
|
|
58
|
+
degrades to a single opaque row preserving the original wire index (fail toward asking).
|
|
59
|
+
- **`RuleApprovalRecord` schema:2**: `schema`+`offers` required; `selectedCandidate` → `selectedOffer`.
|
|
60
|
+
Pre-v2 rows refuse loudly (`record_schema_stale`, envelope read, ownership concealment keeps
|
|
61
|
+
precedence) — pending approvals from before the upgrade are re-asked, never migrated. Supplying the
|
|
62
|
+
retired `selectedCandidate` key (or `selectedOffer: null`) refuses `config.invalid_argument`.
|
|
63
|
+
- **`redeemRuleBatch`** returns a per-member discriminated table `{members, rev}` keyed by
|
|
64
|
+
`candidateIndex` (success rows carry `alreadyRedeemed`+`dot`, refused rows carry `reason`;
|
|
65
|
+
exactly one row per selected-offer member, projection map fixed); the three-array `ImportResult`
|
|
66
|
+
shape is deleted. `RuleApprovalRecordStore.get` may return `StaleRuleApprovalRecord` (envelope).
|
|
67
|
+
- **Engine conjunction arm** (§5.1): a compound command whose EVERY segment is admitted by some
|
|
68
|
+
eligible persisted rule is allowed — the segment deny/ask fence stays strictly ahead, whole-string
|
|
69
|
+
exact and the compound-prefix form keep their precedence, and a single-command prefix still never
|
|
70
|
+
admits a compound. `PersistedRuleHit` becomes `{ rules }` (covering set; evidence dots = union).
|
|
71
|
+
Eligibility is two-layered and single-sourced (`eligiblePersisted`/`eligibleContext`;
|
|
72
|
+
tombstoned/foreign-scope rules can never join a conjunction).
|
|
73
|
+
- The suggester mints offers (`suggestRulesForCommand` returns `RuleOffer[]`; only uncovered
|
|
74
|
+
segments enter a batch; the compound-prefix candidate is no longer offered — existing
|
|
75
|
+
compound-prefix rules keep matching forever); the card-edit face accepts one edited rule judged by
|
|
76
|
+
the single-rule coverage predicate.
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- **LLM-driven memory consolidation, slices 1+2 (design/376; default OFF, additive)**: the fold-plan
|
|
80
|
+
distiller becomes a product module (frozen prompt contract byte-equal to the benchmark's, canonical
|
|
81
|
+
hash pinned; structural repairs counted, repair-budget abort); `runMemoryConsolidationDriver` host
|
|
82
|
+
verb with a first-class run row (claim/attempt single-writer, stale-rev replay guard, write-failure
|
|
83
|
+
groups end the run `driver_failed`, `memory.consolidation_incomplete` notice, FORCED announcement
|
|
84
|
+
once per run); `consolidate` model role resolving consolidate → summarize → loud refusal (never the
|
|
85
|
+
default model). The bench rig now consumes the product module (scripted-arm projection digest
|
|
86
|
+
unchanged across the port). Auto-trigger wiring is a later slice; nothing runs without an explicit
|
|
87
|
+
driver seat.
|
|
88
|
+
- **Dependency-direction gate**: the engine's bottom-of-graph position is frozen mechanically (no
|
|
89
|
+
sibling `@sema-agent/*` in manifest or src imports).
|
|
90
|
+
|
|
91
|
+
### Fixed
|
|
92
|
+
- **Internal-wording sweep over the shipped surface** (S10 class): board-coordinate and campaign-name
|
|
93
|
+
vocabulary cleared to zero across shipped `.d.ts` JSDoc and runtime strings (744 comment lines
|
|
94
|
+
rewritten 1:1, two runtime string leaks fixed); the wording gate's lexicon now also catches
|
|
95
|
+
3-digit coordinate forms.
|
|
96
|
+
- Bench provenance axis (P1) landed with two harness fixes (seed origin carriage, read/write
|
|
97
|
+
provenance mode mismatch) — measurement only, no engine behavior change.
|
|
98
|
+
|
|
3
99
|
## 5.57.0 — 2026-08-23
|
|
4
100
|
|
|
5
101
|
### Added
|
package/dist/agents/cascade.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ export interface CascadeAttempt {
|
|
|
105
105
|
index: number;
|
|
106
106
|
model: ModelRef;
|
|
107
107
|
passed: boolean;
|
|
108
|
-
/** This rung's OWN+nested spend. ABSENT when the rung ran unpriced (RB-368 knownness
|
|
108
|
+
/** This rung's OWN+nested spend. ABSENT when the rung ran unpriced (RB-368 knownness batch-4
|
|
109
109
|
* F4) — a fabricated 0 here both misreported the attempt and let escalation ride under a finite
|
|
110
110
|
* ceiling the engine could not actually enforce. */
|
|
111
111
|
costMicroUsd?: number;
|
|
@@ -58,7 +58,7 @@ export interface CumulativeStatsAccumulator {
|
|
|
58
58
|
/**
|
|
59
59
|
* TRUE when ANY contributing leg published no `costMicroUsd`, i.e. it ran on a model with neither a
|
|
60
60
|
* `RunnerDeps.pricing` entry nor a `Model.cost` declaration (`stats.costMicroUsd` is contractually
|
|
61
|
-
* ABSENT there — types.ts / RB-368
|
|
61
|
+
* ABSENT there — types.ts / RB-368).
|
|
62
62
|
*
|
|
63
63
|
* Accumulating such a leg as `?? 0` publishes a total that is not one: the operation's real cost is
|
|
64
64
|
* unknown, and reporting the priced legs' partial sum makes "no price table" indistinguishable from
|
|
@@ -257,12 +257,12 @@ export declare class ObserverPairing {
|
|
|
257
257
|
retire(state: Exclude<ObserverPairingState, "armed">): void;
|
|
258
258
|
}
|
|
259
259
|
export declare function markObserverTaskId(taskId: string): void;
|
|
260
|
-
/**
|
|
260
|
+
/** lifecycle revocation: the wiring unmarks at observed-run settle (after the final
|
|
261
261
|
* drain + session release), so the set tracks LIVE observers only instead of growing per delegation
|
|
262
262
|
* forever (and a long-dead observer id no longer trips the SendMessage target refusal). */
|
|
263
263
|
export declare function unmarkObserverTaskId(taskId: string): void;
|
|
264
264
|
export declare function isObserverTaskId(taskId: string): boolean;
|
|
265
|
-
/** Diagnostic face
|
|
265
|
+
/** Diagnostic face: how many observer identities are currently LIVE — a test's
|
|
266
266
|
* lifecycle assertion ("armed here, revoked after settle") without exposing the ids themselves. */
|
|
267
267
|
export declare function observerTaskIdCount(): number;
|
|
268
268
|
/** CC @18371202 — SendMessage refusal when the SENDER is an observer run. */
|
|
@@ -127,7 +127,7 @@ export interface PeerAdmissionOptions {
|
|
|
127
127
|
export declare function createPeerAdmission(options?: PeerAdmissionOptions): PeerAdmission;
|
|
128
128
|
export declare function peerAdmissionFor(scope: string | undefined, recipientKey: string, config: PeerAdmissionConfig, options?: PeerAdmissionOptions): PeerAdmission;
|
|
129
129
|
/**
|
|
130
|
-
* The delivery legs' ONE admission entry
|
|
130
|
+
* The delivery legs' ONE admission entry: registry seat-commit follows the SAME
|
|
131
131
|
* refusal-is-side-effect-free rule as the sender table inside `admit` — the instance is looked up
|
|
132
132
|
* WITHOUT an LRU touch (a detached fresh one serves a first-contact recipient), judged, and only an
|
|
133
133
|
* ADMITTED message commits the seat (insert + touch + bounded eviction). A refusal to a
|
|
@@ -96,7 +96,7 @@ export interface RetainLedgerHooks {
|
|
|
96
96
|
* `prepareTask` when the spec opts in, threaded to delegation tools as the TRUSTED `ctx.subagentRetain`,
|
|
97
97
|
* and disposed by the Runner in the task's terminal `finally` (D4: abort in-flight resumes + unpin +
|
|
98
98
|
* release every retained session — retain is NOT durable; resume is reachable only while the parent run
|
|
99
|
-
* lives
|
|
99
|
+
* lives). Leaks are double-bounded by `max` + `ttlMs`.
|
|
100
100
|
*/
|
|
101
101
|
export declare class SubagentRetainLedger {
|
|
102
102
|
readonly ttlMs: number;
|
|
@@ -159,7 +159,7 @@ export declare class SubagentRetainLedger {
|
|
|
159
159
|
get size(): number;
|
|
160
160
|
get(parentToolCallId: string): SubagentRetainEntry | undefined;
|
|
161
161
|
wasEvicted(parentToolCallId: string): boolean;
|
|
162
|
-
/**
|
|
162
|
+
/** LAZY TTL sweep: evict every settled idle entry whose retain TTL
|
|
163
163
|
* elapsed (unpin + release + tombstone), so an expired session is freed at the NEXT ledger touch
|
|
164
164
|
* (every spawn-registration and resume entry call this) rather than only when its own resume is tried.
|
|
165
165
|
* fidelity R4-1: no longer the only reaper — `markSettled` also arms a per-entry ACTIVE timer, so
|
|
@@ -8,7 +8,7 @@ export interface RosterEntry {
|
|
|
8
8
|
sessionId?: string;
|
|
9
9
|
/** The spawn's parent tool-call id (retain-ledger key), when known. */
|
|
10
10
|
toolUseId?: string;
|
|
11
|
-
/**
|
|
11
|
+
/** the ROOT host session of the delegation tree at spawn (recovery-face grouping
|
|
12
12
|
* key; equals the spawner's session at depth 1). Stored verbatim; no predicate arm consumes it
|
|
13
13
|
* yet (enumeration/recovery is the reader). */
|
|
14
14
|
rootSessionId?: string;
|
|
@@ -19,11 +19,11 @@ export interface RosterEntry {
|
|
|
19
19
|
* inherited default. Closed set, single member today; absent = bound normally (or no word). */
|
|
20
20
|
modelFallback?: "inherit_no_tier_binding";
|
|
21
21
|
/** Spawn owner (task/session id) — consumers re-apply access checks against these two axes.
|
|
22
|
-
*
|
|
22
|
+
* A-2: REQUIRED (default-deny predicate; an axis-less row would be unreachable). */
|
|
23
23
|
owner: string;
|
|
24
|
-
/** Spawn principal scope.
|
|
24
|
+
/** Spawn principal scope. A-2: REQUIRED (`"default"` is the single-tenant spelling). */
|
|
25
25
|
scope: string;
|
|
26
|
-
/**
|
|
26
|
+
/** mirrors the live registry's explicit session-scoping flag: session-ID owner matching
|
|
27
27
|
* is permitted ONLY when the spawn was session-scoped (TaskRegistry.canAccess parity — without
|
|
28
28
|
* the flag, a task-scoped agent that fell out of the live registry would become visible through
|
|
29
29
|
* the durable fallback to same-session callers the registry itself rejects). */
|
|
@@ -33,7 +33,7 @@ export interface RosterEntry {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* The caller's access axes for a roster read — the SAME predicate the live task registry applies
|
|
36
|
-
* (`canAccess`): scope mismatch = invisible; then owner match, or session match.
|
|
36
|
+
* (`canAccess`): scope mismatch = invisible; then owner match, or session match. (S1
|
|
37
37
|
* review): resolution MUST filter the candidate pool by access BEFORE the latest-wins reduce —
|
|
38
38
|
* reduce-then-check lets one tenant's newer same-name entry shadow (and thereby suppress) another
|
|
39
39
|
* tenant's older authorized binding. Implementations (incl. pg/tidb) apply this in the query.
|
|
@@ -43,7 +43,7 @@ export interface RosterAccess {
|
|
|
43
43
|
scope?: string;
|
|
44
44
|
sessionId?: string;
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
46
|
+
/** Ruled 2026-07-22: DEFAULT-DENY both axes (TaskRegistry.canAccess byte-parity —
|
|
47
47
|
* the polarity split was the defect). Entries are written with both axes (spawn chain guarantees
|
|
48
48
|
* it; {@link RosterEntry} requires them), so a missing axis is a broken row, answered with a miss. */
|
|
49
49
|
export declare function entryAccessible(e: RosterEntry, access: RosterAccess): boolean;
|
|
@@ -77,7 +77,7 @@ export interface RosterStore {
|
|
|
77
77
|
/** Record (or supersede — latest-wins per normalized name is applied at READ time) a binding. */
|
|
78
78
|
record(entry: RosterEntry): void | Promise<void>;
|
|
79
79
|
/** Resolve a name for a CALLER: filter by {@link RosterAccess} FIRST, then latest `createdAt`
|
|
80
|
-
* wins within the authorized pool (
|
|
80
|
+
* wins within the authorized pool (filter-before-reduce). Undefined = miss. */
|
|
81
81
|
resolve(name: string, access: RosterAccess): RosterEntry | undefined | Promise<RosterEntry | undefined>;
|
|
82
82
|
/** All live entries (diagnostics / deployment listing; order unspecified). */
|
|
83
83
|
list(): RosterEntry[] | Promise<RosterEntry[]>;
|
|
@@ -148,7 +148,7 @@ export declare class FileRosterStore implements RosterStore {
|
|
|
148
148
|
* miss on resolve/list — advisory layer), but it is no longer SILENT: an IO failure or corrupt
|
|
149
149
|
* document was indistinguishable from an honestly empty roster. Never fires on plain ENOENT. */
|
|
150
150
|
private discloseCorrupt;
|
|
151
|
-
/**
|
|
151
|
+
/** two read grades: MISSING file (ENOENT) is an honest empty roster, but a corrupt or
|
|
152
152
|
* transiently unreadable file must THROW on the mutation path — treating it as empty would let
|
|
153
153
|
* the next `record` atomically REPLACE the existing file with just one row (silent data loss).
|
|
154
154
|
* Read paths (resolve/list) degrade the throw to a miss via `lenient`. */
|
|
@@ -59,7 +59,7 @@ export interface SendMessageToolOptions {
|
|
|
59
59
|
senderName?: string;
|
|
60
60
|
/** design/147 S1c — the deployment's durable roster, consulted after the live registry misses. */
|
|
61
61
|
roster?: import("./roster-store.js").RosterStore;
|
|
62
|
-
/** design/147 S3a
|
|
62
|
+
/** design/147 S3a — the PARENT run's retain ledger (RunInternals.parentRetainLedger):
|
|
63
63
|
* the sibling leg's retain entries live there. Consulted AFTER the own-run and session ledgers. */
|
|
64
64
|
siblingRetain?: SubagentRetainLedger;
|
|
65
65
|
/** RB-390 — the SPAWNING run's taskId when THIS run is a delegated child (RunInternals.parentTaskId,
|
|
@@ -78,7 +78,7 @@ export interface SendMessageToolOptions {
|
|
|
78
78
|
* session-scoped sibling registers with owner = the parent's sessionId, which the parent's
|
|
79
79
|
* taskId alone cannot satisfy when the two differ (same rationale as ToolExecuteContext.parentSessionId). */
|
|
80
80
|
parentSessionId?: string;
|
|
81
|
-
/**
|
|
81
|
+
/** the process-level background-child observer (RunnerDeps.onBackgroundChildEvent) — the
|
|
82
82
|
* mount fills this so a SendMessage resume re-emits the spawn→tick→terminal family (fleet row
|
|
83
83
|
* revival). Rides the OPTS closure like notify; RB-409's {@link enrichCtx} feeds the ctx twin. */
|
|
84
84
|
onBackgroundChildEvent?: (event: import("../core/types.js").BackgroundChildEvent) => void;
|
|
@@ -84,7 +84,7 @@ export declare class SubagentStepRecorder {
|
|
|
84
84
|
editedFiles(): SubagentEditedFile[] | undefined;
|
|
85
85
|
/** The child's most recent tool intent as one human line ("Bash npm test", "Edit src/x.ts"); undefined if none. */
|
|
86
86
|
currentAction(): string | undefined;
|
|
87
|
-
/**
|
|
87
|
+
/** {@link currentAction} pre-formatted into a fleet-view Progress-section
|
|
88
88
|
* shape — the SAME `{tool, target}` pair `currentAction` already concatenates into one line, exposed
|
|
89
89
|
* separately so a consumer can look the tool up in its own registry instead of parsing prose.
|
|
90
90
|
* Undefined if none observed (mirrors {@link currentAction}'s own undefined case exactly). */
|
|
@@ -335,8 +335,8 @@ export interface SubagentSteerHandle {
|
|
|
335
335
|
/**
|
|
336
336
|
* design/122 D1 — the retained child session id; present ONLY when the parent run enabled
|
|
337
337
|
* {@link import("../core/types.js").TaskSpec.retainSubagentSessions} AND this child was actually
|
|
338
|
-
* retained. ⚠️ Control-plane only
|
|
339
|
-
* clients; target children by the opaque `parentToolCallId` instead
|
|
338
|
+
* retained. ⚠️ Control-plane only: this is a continuation CAPABILITY — never expose it to
|
|
339
|
+
* clients; target children by the opaque `parentToolCallId` instead.
|
|
340
340
|
*/
|
|
341
341
|
childSessionId?: string;
|
|
342
342
|
/**
|
|
@@ -385,7 +385,7 @@ export declare function createSubagentResume(deps: {
|
|
|
385
385
|
* apply to EVERY stop cycle, spawn and resume alike). Absent ⇒ honest ungated degradation (no
|
|
386
386
|
* registry to count against — the pre-C1 immediate send). */
|
|
387
387
|
registry?: import("../core/task-registry.js").TaskRegistry;
|
|
388
|
-
/** design/147 S1a
|
|
388
|
+
/** design/147 S1a — the RESUMING caller's live injection entry: overrides the retained
|
|
389
389
|
* snapshot's spawn-turn `parentNotify` (that lane is torn down with its turn — uplinks through it
|
|
390
390
|
* would PARK instead of reaching the currently active parent turn, behind a success receipt). */
|
|
391
391
|
currentParentNotify?: (n: TaskNotificationPayload, opts?: {
|
|
@@ -442,7 +442,7 @@ export declare function createSubagentResume(deps: {
|
|
|
442
442
|
taskId?: string;
|
|
443
443
|
/** S2b RB-27② — the resuming caller's resolved registry access (pairs with taskId). */
|
|
444
444
|
taskAccess?: import("../core/task-registry.js").TaskAccess;
|
|
445
|
-
/**
|
|
445
|
+
/** the process-level background-child observer (ctx.onBackgroundChildEvent, Runner-filled).
|
|
446
446
|
* When present TOGETHER with a revived registry row (taskId + successful revive), the resume cycle
|
|
447
447
|
* re-emits the SAME spawn→tick→terminal event family as a first spawn — a fleet view's row revives
|
|
448
448
|
* on the spawn frame (server treats spawn-after-tombstone as row revival). The spawn frame is
|
|
@@ -450,11 +450,11 @@ export declare function createSubagentResume(deps: {
|
|
|
450
450
|
* tick — the observer's tombstone-period tick rejection depends on that order). No revived row ⇒
|
|
451
451
|
* no frames (the steer-handle resume path has no a*-domain row to project). */
|
|
452
452
|
bgSink?: (event: import("../core/types.js").BackgroundChildEvent) => void;
|
|
453
|
-
/**
|
|
453
|
+
/** row lifetime class echoed onto the revive frames (mirrors the registry row). */
|
|
454
454
|
sessionScoped?: boolean;
|
|
455
|
-
/**
|
|
455
|
+
/** the row's display description, echoed onto the revive spawn frame (resume-marked). */
|
|
456
456
|
rowDescription?: string;
|
|
457
|
-
/**
|
|
457
|
+
/** the row's original observer metadata, reproduced on the revive frames so
|
|
458
458
|
* a consumer rebuilding a tombstoned row gets its TYPE/name/ancestry back (never a blank row). */
|
|
459
459
|
rowName?: string;
|
|
460
460
|
rowAgentType?: string;
|
|
@@ -516,10 +516,10 @@ export interface SubagentToolOptions {
|
|
|
516
516
|
*/
|
|
517
517
|
background?: {
|
|
518
518
|
registry: import("../core/task-registry.js").TaskRegistry;
|
|
519
|
-
/**
|
|
519
|
+
/** A-2 (BREAKING 1.365.0): REQUIRED — the registry is default-deny on both axes, so a
|
|
520
520
|
* background registration without a declared owner would be unreachable by every caller. */
|
|
521
521
|
owner: string;
|
|
522
|
-
/**
|
|
522
|
+
/** A-2 (BREAKING 1.365.0): REQUIRED — `"default"` is the single-tenant spelling (explicit,
|
|
523
523
|
* matching the engine chain's `principal ?? "default"`), never implied by omission. */
|
|
524
524
|
scope: string;
|
|
525
525
|
/**
|
|
@@ -559,7 +559,7 @@ export interface SubagentToolOptions {
|
|
|
559
559
|
* vetoes the park: the child settles failed exactly as pre-153, and the already-minted
|
|
560
560
|
* checkpoint is expired (no orphans). Never called for sync children or non-suspending runs.
|
|
561
561
|
*
|
|
562
|
-
* ⚠️ Implementation obligation (
|
|
562
|
+
* ⚠️ Implementation obligation (field-proven): "migrates it here"
|
|
563
563
|
* means ACTIVELY PROMOTE — a check-only implementation that merely LOOKS UP the host durable
|
|
564
564
|
* store rejects every child whose session lives in a split/transient tier (a subRunner's
|
|
565
565
|
* private TTL store), and the veto fires on EVERY park: the checkpoint expires within
|
|
@@ -658,7 +658,7 @@ export interface SubagentToolOptions {
|
|
|
658
658
|
* agent is selected) govern them verbatim: an explicit allowlist must NAME an injected tool for the
|
|
659
659
|
* child to see it; `"*"`/absent allowlist = all. Nested delegation threads the SAME factory down
|
|
660
660
|
* (`createSubagentToolNode(opts, depth+1)` carries it), so a grandchild spawn re-evaluates it — per-spawn,
|
|
661
|
-
* at every level; each child gets its own instances bound to its own spawn moment (
|
|
661
|
+
* at every level; each child gets its own instances bound to its own spawn moment (the
|
|
662
662
|
* server-side factory is execute-time late-bound, so per-spawn evaluation is the confirmed shape).
|
|
663
663
|
* A THROWING/rejecting factory degrades THAT spawn to zero injected tools (the child still runs)
|
|
664
664
|
* with a FIXED generic `note:` disclosure on the report/async card (same lane as the model-override
|
|
@@ -793,7 +793,7 @@ export declare function asyncLaunchedReceipt(p: {
|
|
|
793
793
|
taskId: string;
|
|
794
794
|
/** The lane's own "what is running" opener — the Agent lane and the fork lane say different things. */
|
|
795
795
|
workingLine: string;
|
|
796
|
-
/** Whether a real notification sink is wired (
|
|
796
|
+
/** Whether a real notification sink is wired (the receipt speaks the RUNTIME sink truth). */
|
|
797
797
|
notify: boolean;
|
|
798
798
|
/**
|
|
799
799
|
* RB-220 — mirrors {@link import("../core/types.js").ToolExecuteContext.oneShot}: this run has no
|
|
@@ -821,7 +821,7 @@ export declare function createSubagentTool(opts: SubagentToolOptions): ToolSpec;
|
|
|
821
821
|
* "All tools except …"; neither ⇒ "All tools". sema delta: `allowTools: ["*"]` is the documented
|
|
822
822
|
* allow-everything sentinel (AgentDefinition.allowTools) — treated as NO allowlist, not a literal list.
|
|
823
823
|
*
|
|
824
|
-
*
|
|
824
|
+
* deliberate: this renders the AUTHORED list raw — upstream's listing does too (gHm reads the
|
|
825
825
|
* definition; the unknown-item split happens later, at spawn, in its resolveAgentTools). It is the
|
|
826
826
|
* DECLARED boundary, NOT the effective child roster: an unknown entry may appear here while the
|
|
827
827
|
* spawn-time filter (resolveToolSubset — the authority) drops it, and an alias-form divergence can
|
package/dist/agents/team.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type TeamEvent = {
|
|
|
45
45
|
role: string;
|
|
46
46
|
text: string;
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
48
|
+
/** budget axes: the cumulative team budget was exhausted after this member's turn settled —
|
|
49
49
|
* remaining rounds/members are skipped and the discussion goes straight to synthesis. */
|
|
50
50
|
| {
|
|
51
51
|
type: "budget_stop";
|
|
@@ -113,7 +113,7 @@ export interface TeamDiscussionOptions {
|
|
|
113
113
|
/**
|
|
114
114
|
* `maxWalltimeMs`/`maxTurns` are PER-RUN caps forwarded to every member/summary/synthesizer run.
|
|
115
115
|
*
|
|
116
|
-
* `maxTokens`/`maxCostUsd` (
|
|
116
|
+
* `maxTokens`/`maxCostUsd` (CollabTemplate.budget mid-flight enforcement) are CUMULATIVE
|
|
117
117
|
* team budgets over member + summary + synthesizer spend (nested/delegated spend included, same
|
|
118
118
|
* coordinate as the `stats` totals). Enforcement is checked after each member turn settles and is
|
|
119
119
|
* booked — the crossing member is never killed in flight — and once a budget is exhausted
|
|
@@ -176,7 +176,7 @@ export interface TeamResult {
|
|
|
176
176
|
* conclusion — so callers can tell a junk conclusion from a legitimate one. */
|
|
177
177
|
conclusionValid: boolean;
|
|
178
178
|
transcript: TeamTurn[];
|
|
179
|
-
/** `costMicroUsd
|
|
179
|
+
/** `costMicroUsd`: cumulative team LLM spend in integer micro-USD (member + summary +
|
|
180
180
|
* synthesizer, nested included) — the same engine coordinate as `TaskResult.stats.costMicroUsd`.
|
|
181
181
|
* Always set (0 when no run reported cost); optional only for type-level back-compat. */
|
|
182
182
|
stats: {
|
|
@@ -185,7 +185,7 @@ export interface TeamResult {
|
|
|
185
185
|
costMicroUsd?: number;
|
|
186
186
|
};
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
188
|
+
* budget-stop attribution: set when a cumulative budget axis was exhausted and the
|
|
189
189
|
* discussion stopped dispatching further members/rounds early. `round`/`role`/`memberIndex`
|
|
190
190
|
* identify the LAST member turn that ran (the one whose settled totals crossed the budget);
|
|
191
191
|
* everything scheduled after it was skipped and the transcript went straight to synthesis.
|
|
@@ -202,7 +202,7 @@ export interface TeamResult {
|
|
|
202
202
|
failures: number;
|
|
203
203
|
/** How many times the shared transcript was summarized to stay under maxTranscriptTokens. */
|
|
204
204
|
transcriptCompactions: number;
|
|
205
|
-
/** design/80 D-B
|
|
205
|
+
/** design/80 D-B: set when a member durably PAUSED (suspended/needs_review) on a HITL gate —
|
|
206
206
|
* the discussion STOPS (no synthesis on a half-done team) and surfaces the resume capability so the caller
|
|
207
207
|
* can resume the paused member via the token, then re-run. `conclusionValid` is false in this case. */
|
|
208
208
|
durablePause?: boolean;
|
|
@@ -13,10 +13,10 @@ import type { ToolSpec } from "../core/types.js";
|
|
|
13
13
|
* newly-added sensitive tool to every agent. Names not present in the pool are ignored (no error) — an
|
|
14
14
|
* allow/deny list is a filter over what's available, not an assertion that those tools exist.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* anchor ruling (dual-leg verified, adversarially reviewed): this spawn-time item-level filter IS
|
|
17
17
|
* the upstream shape for allow entries — CC's resolveAgentTools partitions unknown names into an
|
|
18
18
|
* `invalidTools` bucket nobody consumes at runtime (88 readable source), and a live 2.1.207 probe shows
|
|
19
|
-
* the agent stays listed/delegable with the unknown item silently dropped, zero warnings. The
|
|
19
|
+
* the agent stays listed/delegable with the unknown item silently dropped, zero warnings. The
|
|
20
20
|
* "rejected at startup" posture this replaced had no verbatim anchor and did not survive verification.
|
|
21
21
|
* The asymmetric prepare-time fail-loud for `TaskSpec.agents` DENY entries is a deliberate sema
|
|
22
22
|
* extension (no upstream deny-list exists): an allow-typo silently narrows (safe direction), a
|
package/dist/agents/verify.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { ModelRef, TaskResult, TaskSpec, ToolSpec } from "../core/types.js"
|
|
|
25
25
|
* orthogonal to and composable with the Stop hook (wire the verdict into a stop() hook to make it a
|
|
26
26
|
* hard completion gate).
|
|
27
27
|
*
|
|
28
|
-
* DEPLOYMENT POSTURE (
|
|
28
|
+
* DEPLOYMENT POSTURE (ruled 2026-07-14): opt-in library primitive ONLY — never a scenario default,
|
|
29
29
|
* never deployed implicitly. It is a **thin composition** over existing core seams — a verifier subtask
|
|
30
30
|
* (own model role), a read-only tool set (via tool `effect`), {@link TaskSpec.outputSchema} for the
|
|
31
31
|
* verdict, and the teacher-style fix loop — so it adds no Runner-core surface. Off by default; opt in
|