UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

851 lines (850 loc) • 22.2 kB
{ "repo": "core", "version": "7.32.0", "from": "c016a8efa8f6783d10207f15b6d101864a6a2db6", "to": "v7.32.0", "added": [ { "name": "BackgroundHardKillOutcome", "kind": "type", "tier": "advanced", "at": [ "src/core/background-shell.ts:164", "src/index.ts:1321" ], "criteriaCovered": false, "breaking": false }, { "name": "BackgroundShellHardKillReceipt", "kind": "interface", "tier": "advanced", "at": [ "src/core/task-registry.ts:194", "src/index.ts:1221" ], "criteriaCovered": true, "breaking": false }, { "name": "PERSISTED_RULE_MANDATES", "kind": "variable", "tier": "advanced", "at": [ "src/core/ask-origin.ts:431", "src/index.ts:1426" ], "criteriaCovered": false, "breaking": false }, { "name": "PersistedRuleMandate", "kind": "type", "tier": "advanced", "at": [ "src/core/ask-origin.ts:432", "src/index.ts:1426" ], "criteriaCovered": false, "breaking": false }, { "name": "ReadRootGrantScreen", "kind": "type", "tier": "advanced", "at": [ "src/core/read-root-grant-screen.ts:10", "src/index.ts:1425" ], "criteriaCovered": false, "breaking": false }, { "name": "isPersistedRuleMandate", "kind": "function", "tier": "advanced", "at": [ "src/core/ask-origin.ts:435", "src/index.ts:1426" ], "criteriaCovered": false, "breaking": false } ], "removed": [], "changed": [], "narrowed": [ { "id": "F3", "source": "behaviorFlips.summary", "text": "NARROWING (#1093; the `admits_artifact_store` reason of F2's notice; +0 exports). (a) The grant never admits the local artifact store: a granted directory that contains the wired `localArtifactStub` store (`capabilities.storageDir`), lies inside it or is it widens nothing (`reason: \"admits_artifact_store\"`), judged in the store's physical form — a store declared through a symlinked parent and not yet created included — by the function the Artifact mount judges with (`rootAdmittingArtifactStore`). (b) That mount judgment is now two-way: a declared read root INSIDE the store (e.g. `additionalReadDirectories: [<store>/sub]`) refuses the Artifact mount with `config.artifact_host_invalid`, where before only a store inside a root did (KL-1093e closed). (c) Roots are identities: the Runner's shell read station no longer re-resolves its roots, so a DECLARED `additionalReadDirectories` / `additionalDirectories` root swapped for a link before the run's first shell judgment no longer vouches for the link's target. (d) A `createApprovalPolicy` `approve` seat has no card: an answer carrying `readRootGrant` there is a fail-closed deny naming the member, where before the member was ignored and the call allowed. WHO IS HURT: a deployment whose declared read root sits inside its local artifact store (no Artifact tool), and an approve seat that attached the member." }, { "id": "F4", "source": "behaviorFlips.summary", "text": "Behaviour change with a NARROWING (#1107; +1 optional `list()` row key `retained`; +0 exports for this half): ONE retain predicate (`retainsBackgroundProcesses`: the env capability, the task lane or the row mark retains; a dying isolated env overrides) answers every face — the Bash card and its launch / adoption receipts, the Monitor receipt, the row stamp (taken once at registration from the env and the launching task's lane, which the Runner's Bash and Monitor always state), teardown settle and dispose, the park-only sweeps, the session reap, the exit hard face and `list()` (`retained?: true`). A task-level `TaskSpec.retainBackgroundProcesses` run's Bash card and receipts no longer say background processes \"do NOT survive the session\". NARROWING at the session reap: a retained row is left alone (row, watcher, process) and every other session shell row is killed and settled — the settle-without-kill outcome is gone; a row launched under a non-retaining run's receipt is no longer re-labelled retained by a later retaining run's teardown and is reaped as its receipt said; a Monitor row launched with the task lane is stamped retained. WHO IS HURT: a reader of a retain-env row's `killed` status after the reap (the process was alive), and a mixed-lane session that relied on a later run's declaration to keep an earlier shell." }, { "id": "F7", "source": "behaviorFlips.summary", "text": "Model-facing text + one construction-time NARROWING (#1108; +0 exports): SendMessage's continuation sentence and ListAgents' recorded-agent label and finished-agent reach speak the subagent transcript tier, one helper (`sendMessageContinuationTier` = `resolveSubagentTranscriptTier` over the mount's session store, gated on all three revival seats: row store, mailbox, reviver). `full` keeps \"by name or task_id, even across restarts\" / \"agent (durable record)\"; `rows` (a process-local or undeclared transcript placement — a Runner's default session store) says the record outlives a restart and the conversation does not / \"agent (record kept; conversation not kept across restarts)\"; `none` = session retention only / \"agent (recorded name)\". `createListAgentsTool` / `mountListAgents` take `continuationTier` (absent ⇒ the `none` wording); the Runner fills it from the same seats as its SendMessage. `createSendMessageTool` reads the session store's subagent placement at construction, and a junk `durability` declaration throws `config.store_durability_invalid` where it constructed before." }, { "id": "G2", "source": "criteria.title", "text": "#1093 NARROWING — the grant never admits the local artifact store, a root inside the store refuses the mount, a declared root is an identity, an approve seat's grant is a deny" } ], "closedSetMembers": [ { "set": "BackgroundHardKillOutcome", "at": [ "src/core/background-shell.ts:164" ], "newSet": true, "added": [ "already_gone", "killed", "no_pgid" ], "removed": [], "breaking": false, "criteriaCovered": false }, { "set": "ENGINE_NOTICE_CODES", "at": [ "src/core/governance-codes.ts:319" ], "newSet": false, "added": [ "approval.read_root_grant_rejected", "approval.read_root_granted" ], "removed": [], "breaking": false, "criteriaCovered": true } ], "closedSetsUnreadable": [], "typeKeys": [ { "type": "ApprovalSeatOutcome", "at": [ "src/core/tool-policy.ts:1326" ], "arms": "flattened", "added": [ "readRootGrant" ], "addedDetail": [ { "key": "readRootGrant", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "AskCarry", "at": [ "src/core/hooks.ts:2147" ], "added": [ "mandate" ], "addedDetail": [ { "key": "mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "AskOutcome", "at": [ "src/core/tool-policy.ts:3151" ], "added": [ "readRootGrant" ], "addedDetail": [ { "key": "readRootGrant", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "AskRequest", "at": [ "src/core/tool-policy.ts:2685" ], "added": [ "mandate" ], "addedDetail": [ { "key": "mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "BackgroundBashTaskHandle", "at": [ "src/core/task-registry-shared.ts:145" ], "via": "TaskRegistry.BackgroundBashTaskHandle", "added": [ "retainStatedAtLaunch" ], "addedDetail": [ { "key": "retainStatedAtLaunch", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "BackgroundShellCapability", "at": [ "src/core/background-shell.ts:92" ], "added": [ "killBackgroundNow" ], "addedDetail": [ { "key": "killBackgroundNow", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "CheckpointSummary", "at": [ "src/core/checkpoint-store.ts:2093" ], "added": [ "mandate" ], "addedDetail": [ { "key": "mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "ListAgentsToolOptions", "at": [ "src/agents/list-agents-tool.ts:58" ], "added": [ "continuationTier" ], "addedDetail": [ { "key": "continuationTier", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "MonitorTaskHandle", "at": [ "src/core/task-registry-shared.ts:431" ], "via": "TaskRegistry.MonitorTaskHandle", "added": [ "retainStatedAtLaunch" ], "addedDetail": [ { "key": "retainStatedAtLaunch", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "PendingAction", "at": [ "src/core/checkpoint-store.ts:962" ], "added": [ "tool_approval.mandate" ], "addedDetail": [ { "key": "tool_approval.mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "PermissionResult", "at": [ "src/core/tool-policy.ts:448" ], "added": [ "ask.mandate" ], "addedDetail": [ { "key": "ask.mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "PreToolUseResult", "at": [ "src/core/hooks.ts:1159" ], "added": [ "ask.mandate" ], "addedDetail": [ { "key": "ask.mandate", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "RegisterBackgroundBashInput", "at": [ "src/core/task-registry.ts:153" ], "via": "TaskRegistry.RegisterBackgroundBashInput", "added": [ "retainBackgroundProcesses" ], "addedDetail": [ { "key": "retainBackgroundProcesses", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "RegisterMonitorInput", "at": [ "src/core/task-registry-shared.ts:528" ], "added": [ "retainBackgroundProcesses" ], "addedDetail": [ { "key": "retainBackgroundProcesses", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "ResolvedAsk", "at": [ "src/core/tool-policy.ts:3414" ], "arms": "flattened", "added": [ "readRootGrant" ], "addedDetail": [ { "key": "readRootGrant", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": false }, { "type": "SubagentToolOptions", "at": [ "src/agents/subagent.ts:2747" ], "added": [ "inheritedTools" ], "addedDetail": [ { "key": "inheritedTools", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true }, { "type": "ToolExecuteContext", "at": [ "src/core/tool-spec.ts:603" ], "added": [ "mountsCallerTool" ], "addedDetail": [ { "key": "mountsCallerTool", "optional": true } ], "addedRequired": [], "removed": [], "breaking": false, "criteriaCovered": true } ], "typeKeysUnreadableArms": [ { "type": "ApprovalSeatOutcome", "at": "src/core/tool-policy.ts:1326", "reasons": [ "a union carrying 1 arm(s) whose keys this reader does not follow (a generic reference (`Extract<…>`)) — a key missing from this type at `to` is still reported REMOVED, carrying `uncertain` so the writer checks whether it moved there" ] }, { "type": "ResolvedAsk", "at": "src/core/tool-policy.ts:3414", "reasons": [ "a union carrying 1 arm(s) whose keys this reader does not follow (a generic reference (`Extract<…>`)) — a key missing from this type at `to` is still reported REMOVED, carrying `uncertain` so the writer checks whether it moved there", "a union of 2 key-bearing arm(s) with no discriminating property (no property is declared by every key-bearing arm with literal words that no other arm shares), so its arms are read TOGETHER — a key added to one arm while a sibling already carries that name moves nothing in this manifest" ] } ], "typeKeysFlattenedCount": 216, "declarationMoves": [ { "name": "PERSISTED_RULE_MANDATES", "kind": "variable", "onSurface": true, "from": [ "src/core/ask-origin.ts" ], "to": [ "src/core/ask-origin.ts", "src/index.ts" ] }, { "name": "PersistedRuleMandate", "kind": "type", "onSurface": true, "from": [ "src/core/ask-origin.ts" ], "to": [ "src/core/ask-origin.ts", "src/index.ts" ] }, { "name": "SessionReadFileStates", "kind": null, "onSurface": false, "from": [ "src/core/runner/prepare-hands-readface.ts" ], "to": [ "src/core/runner/session-read-file-states.ts" ] }, { "name": "sessionSeatAnchorHolds", "kind": null, "onSurface": false, "from": [ "src/core/runner/prepare-hands-readface.ts" ], "to": [ "src/core/runner/session-read-file-states.ts" ] } ], "mintMoves": [], "criteriaObserves": [ { "kind": "engineNoticeCode", "name": "approval.read_root_grant_rejected", "assertions": [ "G1.b", "G2.a" ] }, { "kind": "engineNoticeCode", "name": "approval.read_root_granted", "assertions": [ "G1.a" ] }, { "kind": "engineNoticeCode", "name": "config.artifact_host_invalid", "assertions": [ "G2.b" ] }, { "kind": "taskEventField", "name": "tool_end.isError", "assertions": [ "G3.a", "G3.b" ] }, { "kind": "taskEventField", "name": "tool_end.output", "assertions": [ "G1.a", "G2.a", "G3.a", "G5.a", "G8.a" ] }, { "kind": "typeMember", "name": "AskOutcome.readRootGrant", "assertions": [ "G1.a", "G1.b" ] }, { "kind": "typeMember", "name": "AskRequest.args", "assertions": [ "G2.b" ] }, { "kind": "typeMember", "name": "AskRequest.mandate", "assertions": [ "G4.a" ] }, { "kind": "typeMember", "name": "AskRequest.mandated", "assertions": [ "G4.a" ] }, { "kind": "typeMember", "name": "AskRequest.readRootCandidate", "assertions": [ "G1.a" ] }, { "kind": "typeMember", "name": "AskRequest.ruleOffersAbsence", "assertions": [ "G4.a" ] }, { "kind": "typeMember", "name": "BackgroundPoll.status", "assertions": [ "G5.a" ] }, { "kind": "typeMember", "name": "BackgroundShellCapability.killBackgroundNow", "assertions": [ "G6.a" ] }, { "kind": "typeMember", "name": "BackgroundShellHardKillReceipt.outcome", "assertions": [ "G6.a", "G9.a" ] }, { "kind": "typeMember", "name": "BackgroundShellHardKillReceipt.owner", "assertions": [ "G9.a" ] }, { "kind": "typeMember", "name": "BackgroundShellHardKillReceipt.retained", "assertions": [ "G6.a" ] }, { "kind": "typeMember", "name": "CheckpointSummary.mandate", "assertions": [ "G4.a" ] }, { "kind": "typeMember", "name": "CodeToolsConfig.subagent", "assertions": [ "G3.a" ] }, { "kind": "typeMember", "name": "EngineNotice.detail", "assertions": [ "G1.a", "G1.b", "G2.a" ] }, { "kind": "typeMember", "name": "EngineNotice.message", "assertions": [ "G2.a" ] }, { "kind": "typeMember", "name": "ListAgentsToolOptions.continuationTier", "assertions": [ "G8.a" ] }, { "kind": "typeMember", "name": "PendingAction.mandate", "assertions": [ "G4.a" ] }, { "kind": "typeMember", "name": "PermissionResult.action", "assertions": [ "G2.b" ] }, { "kind": "typeMember", "name": "RunnerDeps.artifactHost", "assertions": [ "G2.a" ] }, { "kind": "typeMember", "name": "RunnerDeps.executionEnv", "assertions": [ "G7.a" ] }, { "kind": "typeMember", "name": "RunnerDeps.executionEnvFactory", "assertions": [ "G7.a" ] }, { "kind": "typeMember", "name": "SubagentToolOptions.allowTools", "assertions": [ "G3.b" ] }, { "kind": "typeMember", "name": "SubagentToolOptions.extraTools", "assertions": [ "G3.b" ] }, { "kind": "typeMember", "name": "SubagentToolOptions.inheritedTools", "assertions": [ "G3.a" ] }, { "kind": "typeMember", "name": "SubagentToolOptions.tools", "assertions": [ "G3.b" ] }, { "kind": "typeMember", "name": "TaskRegistry.killAllBackgroundShellsNow", "assertions": [ "G6.a", "G9.a" ] }, { "kind": "typeMember", "name": "TaskRegistry.list", "assertions": [ "G5.a" ] }, { "kind": "typeMember", "name": "TaskRegistry.reapSessionBackground", "assertions": [ "G5.a", "G9.a" ] }, { "kind": "typeMember", "name": "TaskSpec.additionalReadDirectories", "assertions": [ "G2.b" ] }, { "kind": "typeMember", "name": "TaskSpec.retainBackgroundProcesses", "assertions": [ "G5.a", "G7.a" ] }, { "kind": "typeMember", "name": "ToolExecuteContext.mountsCallerTool", "assertions": [ "G3.b" ] }, { "kind": "typeMember", "name": "ToolSpec.description", "assertions": [ "G8.a" ] }, { "kind": "typeMember", "name": "WiringManifest.fleet.subagentTranscripts", "assertions": [ "G8.a" ] } ], "consumersHint": { "cli": [ "ApprovalSeatOutcome", "AskCarry", "AskOutcome", "AskRequest", "CheckpointSummary", "ENGINE_NOTICE_CODES", "PERSISTED_RULE_MANDATES", "PendingAction", "PermissionResult", "PreToolUseResult", "ResolvedAsk", "ToolExecuteContext" ], "server": [ "ApprovalSeatOutcome", "AskCarry", "AskOutcome", "AskRequest", "BackgroundShellCapability", "CheckpointSummary", "ENGINE_NOTICE_CODES", "PendingAction", "PermissionResult", "PreToolUseResult", "SubagentToolOptions", "ToolExecuteContext" ], "sdk": [ "AskRequest", "CheckpointSummary", "ENGINE_NOTICE_CODES", "PendingAction", "PermissionResult", "PreToolUseResult" ], "note": "scanned cli@4e593722 server@fdf1ec74 sdk@35f83df — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it. Ledger files (**/docs/core-consumption/**, **/docs/wire-consumption/**, **/*LEDGER*.json) are not evidence of use — server: 4 name(s) matched ONLY in bookkeeping files and were set aside (ListAgentsToolOptions, RegisterBackgroundBashInput, RegisterMonitorInput, ResolvedAsk)" }, "breakingCount": 0, "breakingItems": [], "toResolvedAt": "ef4d392c3cf502986af9e2f94d9cec9d39cc810d" }