@dsmm/dsmm 0.3.22 → 0.3.23
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/agent-presets/dsmm-builder/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-coding/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-complex/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-creative/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-deep/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-frontend/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-planner/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-quick/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-research/agent.cordis.yml +1 -7
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -7
- package/cordis.patch.yml +3 -0
- package/docs/compatibility.md +13 -1
- package/docs/maintenance.md +22 -9
- package/docs/model-routing.md +25 -3
- package/docs/native-permissions.md +20 -4
- package/docs/releasing.md +3 -3
- package/docs/roadmap.md +33 -11
- package/docs/runtime-recovery.md +5 -3
- package/docs/testing.md +10 -0
- package/docs/web-fetch-fakeip.md +8 -2
- package/dsh-plugin.json +1 -1
- package/lib/agent-prompt-scope.d.ts +6 -0
- package/lib/agent-prompt-scope.js +66 -0
- package/lib/client/RoleToolView-data.d.ts +4 -2
- package/lib/client/RoleToolView-data.js +18 -4
- package/lib/client/RoleToolView-locales.d.ts +4 -0
- package/lib/client/RoleToolView-locales.js +2 -0
- package/lib/client/RoleToolView.d.ts +9 -3
- package/lib/client/RoleToolView.js +27 -8
- package/lib/client/children-locales.d.ts +4 -4
- package/lib/client/index.js +6 -1
- package/lib/client/role-call-observations.d.ts +21 -0
- package/lib/client/role-call-observations.js +150 -0
- package/lib/client.js +401 -96
- package/lib/dsh-types.d.ts +15 -0
- package/lib/index.js +4 -1
- package/lib/live-pi-ai-owner.d.ts +1 -2
- package/lib/live-pi-ai-owner.js +10 -7
- package/lib/locale-guidance.d.ts +3 -0
- package/lib/locale-guidance.js +12 -0
- package/lib/model-family.d.ts +14 -0
- package/lib/model-family.js +138 -35
- package/lib/model-routing.d.ts +23 -2
- package/lib/model-routing.js +145 -7
- package/lib/native-admission.d.ts +36 -1
- package/lib/native-admission.js +408 -24
- package/lib/native-pi-ai-wire.js +17 -4
- package/lib/profile-remote.d.ts +2 -0
- package/lib/profile-remote.js +12 -3
- package/lib/profile-types.d.ts +5 -0
- package/lib/prompts.d.ts +3 -2
- package/lib/prompts.js +20 -38
- package/lib/role-control-remote.d.ts +5 -2
- package/lib/role-control-remote.js +84 -4
- package/lib/role-control-rpc.d.ts +8 -1
- package/lib/role-control-rpc.js +122 -50
- package/lib/role-control-types.d.ts +62 -1
- package/lib/role-control-types.js +3 -0
- package/lib/role-invocation.js +1 -1
- package/lib/role-llm-runtime.js +2 -2
- package/lib/role-routing.d.ts +27 -7
- package/lib/role-routing.js +129 -16
- package/lib/role-subagents.js +8 -23
- package/lib/runtime-recovery.js +23 -6
- package/lib/session-metadata.d.ts +13 -1
- package/lib/session-metadata.js +21 -1
- package/lib/web-fetch-address-policy.d.ts +6 -2
- package/lib/web-fetch-fakeip.d.ts +6 -0
- package/lib/web-fetch-fakeip.js +29 -2
- package/package.json +2 -2
- package/prompts/deepwork.md +0 -1
- package/prompts/source/deepwork/claude-opus-5.md +2 -8
- package/prompts/source/deepwork/codex.md +2 -8
- package/prompts/source/deepwork/gemini-4.md +1 -7
- package/prompts/source/deepwork/gemini.md +0 -6
- package/prompts/source/deepwork/glm.md +3 -10
- package/prompts/source/deepwork/gpt.md +7 -15
- package/prompts/source/deepwork/kimi.md +1 -7
- package/prompts/source/deepwork/planner.md +0 -4
- package/prompts/source/deepwork/swe-2.md +2 -8
- package/prompts/source/shared/dsh-host-contract.md +0 -1
- package/prompts/source/shared/locale.md +1 -6
package/lib/role-subagents.js
CHANGED
|
@@ -4,7 +4,6 @@ import { pathToFileURL } from "node:url";
|
|
|
4
4
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
5
5
|
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
6
6
|
import { DSMM_ROLES } from "./roles.js";
|
|
7
|
-
import { registerRoleHarnessIdentity } from "./role-identity.js";
|
|
8
7
|
import { isDsmmRoleId } from "./roles.js";
|
|
9
8
|
import { DsmmRolePolicy, roleToolName } from "./role-policy.js";
|
|
10
9
|
import { roleProviderName } from "./role-providers.js";
|
|
@@ -13,10 +12,10 @@ import { childOwnedSessionEvents } from "./session-scope.js";
|
|
|
13
12
|
import { agentForScope, nativeAgentContext, scopeParentOf } from "./native-scope.js";
|
|
14
13
|
import { roleRouteRuntimeState } from "./role-routing.js";
|
|
15
14
|
import { modelRouteFromCall } from "./role-llm.js";
|
|
16
|
-
import {
|
|
15
|
+
import { buildDsmmDelegationGuidance } from "./prompts.js";
|
|
17
16
|
const hostControls = ["send_message", "interrupt_agent", "exit_plan_mode", "ask_user_question", "todo_write", "job_output", "job_list", "job_kill"];
|
|
18
17
|
// Agent-owned policy realms survive a bundle reinstall; do not register another
|
|
19
|
-
//
|
|
18
|
+
// delegation/tools layer on the same retained live Agent.
|
|
20
19
|
const admittedRealms = new WeakMap();
|
|
21
20
|
const callableDefinitions = new WeakMap();
|
|
22
21
|
/** Keep native controls on the frozen startup substrate, not desired-save reconciliation. */
|
|
@@ -200,7 +199,7 @@ function registerRoleTool(agent, agentCtx, tools, entry, getSettings, policy, ad
|
|
|
200
199
|
signal.throwIfAborted();
|
|
201
200
|
const requestedBackground = background && args.run_in_background === true;
|
|
202
201
|
assertCurrent();
|
|
203
|
-
const pending = await admission.reserve(exec, invocation, provider, request.maxDepth);
|
|
202
|
+
const pending = await admission.reserve(exec, invocation, provider, args.description, requestedBackground ? "parent" : "caller", request.maxDepth);
|
|
204
203
|
let activation;
|
|
205
204
|
let cancellation;
|
|
206
205
|
const cancel = () => { if (activation) {
|
|
@@ -216,9 +215,8 @@ function registerRoleTool(agent, agentCtx, tools, entry, getSettings, policy, ad
|
|
|
216
215
|
await cancellation;
|
|
217
216
|
pending.signal.throwIfAborted();
|
|
218
217
|
}
|
|
219
|
-
const view = invocationView(invocation, args.description, "continuable", { childId: activation.childId });
|
|
220
218
|
if (requestedBackground)
|
|
221
|
-
return { kind: "continuable", subagentId: activation.childId, messageId: activation.messageId ?? null, invocation: { ...view } };
|
|
219
|
+
return { kind: "continuable", subagentId: activation.childId, messageId: activation.messageId ?? null, invocation: { ...pending.view() } };
|
|
222
220
|
const result = await activation.result;
|
|
223
221
|
if (result.stopReason !== "completed")
|
|
224
222
|
incomplete.set(exec.token, result);
|
|
@@ -228,7 +226,7 @@ function registerRoleTool(agent, agentCtx, tools, entry, getSettings, policy, ad
|
|
|
228
226
|
if (result.stopReason !== "completed")
|
|
229
227
|
throw new SubagentError(`Role activation ended: ${result.stopReason}`, "DSMM_INCOMPLETE");
|
|
230
228
|
return { kind: "foreground", output: result.output,
|
|
231
|
-
...(result.structured === undefined ? {} : { structured: result.structured }), invocation: { ...view } };
|
|
229
|
+
...(result.structured === undefined ? {} : { structured: result.structured }), invocation: { ...pending.view() } };
|
|
232
230
|
}
|
|
233
231
|
finally {
|
|
234
232
|
pending.signal.removeEventListener("abort", cancel);
|
|
@@ -250,15 +248,6 @@ export async function registerHeadlessRoleTools(ctx, controller, getSettings, po
|
|
|
250
248
|
return;
|
|
251
249
|
}
|
|
252
250
|
const states = new WeakMap();
|
|
253
|
-
const reconcileIdentity = (agent, identity = policy.identity(agent)) => {
|
|
254
|
-
const role = identity.role;
|
|
255
|
-
const state = states.get(agent);
|
|
256
|
-
if (state === undefined || state.identityRole === role)
|
|
257
|
-
return;
|
|
258
|
-
state.identityPrompt?.();
|
|
259
|
-
state.identityPrompt = role === undefined ? undefined : registerRoleHarnessIdentity(agent, role, identity.child);
|
|
260
|
-
state.identityRole = role;
|
|
261
|
-
};
|
|
262
251
|
const reconcile = (agent) => {
|
|
263
252
|
const state = states.get(agent);
|
|
264
253
|
if (state === undefined)
|
|
@@ -273,16 +262,14 @@ export async function registerHeadlessRoleTools(ctx, controller, getSettings, po
|
|
|
273
262
|
const promptRealm = Reflect.get(prompt, symbols.original) ?? prompt;
|
|
274
263
|
if (state.promptRealm !== promptRealm) {
|
|
275
264
|
state.guidance?.();
|
|
276
|
-
state.
|
|
277
|
-
state.identityRole = undefined;
|
|
278
|
-
state.guidance = getTraceable(agentCtx, prompt).section({ name: "dsmm:delegation-identity", order: 49, text(context) {
|
|
265
|
+
state.guidance = getTraceable(agentCtx, prompt).section({ name: "dsmm:delegation", order: 49, text(context) {
|
|
279
266
|
if (context.scope !== agent && agentForScope(ctx, context.scope) !== agent)
|
|
280
267
|
return "";
|
|
281
268
|
const identity = policy.identity(agent), tools = states.get(agent)?.tools, settings = getSettings(agent);
|
|
282
269
|
if (identity.role === undefined)
|
|
283
|
-
return
|
|
270
|
+
return "";
|
|
284
271
|
const captured = capturedRoleInvocation(agent);
|
|
285
|
-
return
|
|
272
|
+
return buildDsmmDelegationGuidance(settings, { scope: identity.child ? "child" : "root", tools: tools?.schemas(agent) ?? [],
|
|
286
273
|
delegation: tools === undefined ? [] : admittedCallableRoleInventory(agent, settings, policy, tools),
|
|
287
274
|
...(captured === undefined ? {} : { invocation: roleInvocationObservation(captured, DSMM_ROLES.find(role => role.id === captured.target).name, "continuable", getSettings, agent, { childId: agent.id }) }),
|
|
288
275
|
runtimeAdmission: getSettings.subagentRuntime?.(), capabilities: { continuable: true, nativeChildDelivery: true,
|
|
@@ -290,7 +277,6 @@ export async function registerHeadlessRoleTools(ctx, controller, getSettings, po
|
|
|
290
277
|
} });
|
|
291
278
|
state.promptRealm = promptRealm;
|
|
292
279
|
}
|
|
293
|
-
reconcileIdentity(agent, identity);
|
|
294
280
|
const subagents = agentCtx.get("subagents");
|
|
295
281
|
const host = ctx.get?.("tools");
|
|
296
282
|
const names = [...hostControls, ...host?.schemas().map((row) => row.name).filter((name) => name.startsWith(`mcp__${settings.lsp.serverName}__`)) ?? []];
|
|
@@ -347,7 +333,6 @@ export async function registerHeadlessRoleTools(ctx, controller, getSettings, po
|
|
|
347
333
|
const state = states.get(agent);
|
|
348
334
|
state?.restriction?.();
|
|
349
335
|
state?.guard?.();
|
|
350
|
-
state?.identityPrompt?.();
|
|
351
336
|
state?.guidance?.();
|
|
352
337
|
for (const dispose of state?.owned ?? [])
|
|
353
338
|
dispose();
|
package/lib/runtime-recovery.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createUserMessage, expandAssistantStream } from "@deepseek-ai/dsh-llm";
|
|
2
2
|
import { foldDurableRecoveryWork, isCurrentRecoveryStep } from "./recovery-policy.js";
|
|
3
3
|
import { isDsmmRoleId } from "./roles.js";
|
|
4
|
-
import { applyModelRoute, isUnavailableRouteFailure, latestNativeModelSelection, liveRolePolicyIdentity, recordAdmittedRecoveryRoute, roleRouteLock, sameExactModelRoute, selectInitialModelRouteChoice } from "./role-routing.js";
|
|
4
|
+
import { applyModelRoute, hostModelSelection, isUnavailableRouteFailure, latestNativeModelSelection, liveRolePolicyIdentity, recordAdmittedRecoveryRoute, roleRouteLock, sameExactModelRoute, sameModelRoute, selectInitialModelRouteChoice } from "./role-routing.js";
|
|
5
5
|
import { modelRouteFromCall, modelRouteFromHeader, projectModelRouteParameters } from "./role-llm.js";
|
|
6
6
|
import { childOwnedSessionEvents, resolveSelectedAgentPreset, sessionEvents } from "./session-scope.js";
|
|
7
7
|
import { resolveAdmittedDsmmRole as resolveEffectiveDsmmRole } from "./role-policy.js";
|
|
@@ -11,6 +11,7 @@ import { currentRequestRouting } from "./request-routing.js";
|
|
|
11
11
|
const installedContexts = new WeakSet();
|
|
12
12
|
const RECOVERY_WARNING = "dsmm runtime recovery refused an unproven or exhausted retry";
|
|
13
13
|
const CONTINUATION_WARNING = "dsmm runtime recovery continuation steering failed for turn";
|
|
14
|
+
const SWITCH_BLOCKED_WARNING = "dsmm runtime recovery cross-route fallback is unavailable on this Host version; retrying the current route";
|
|
14
15
|
function warnSafely(ctx, message) {
|
|
15
16
|
try {
|
|
16
17
|
ctx.logger?.warn(message);
|
|
@@ -68,6 +69,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings, bindReques
|
|
|
68
69
|
let pendingByAgent = new WeakMap();
|
|
69
70
|
let attemptsByAgent = new WeakMap();
|
|
70
71
|
let continuationsByAgent = new WeakMap();
|
|
72
|
+
const switchBlocked = new WeakSet();
|
|
71
73
|
const waits = new Set();
|
|
72
74
|
let active = true;
|
|
73
75
|
let disposeRequest;
|
|
@@ -248,8 +250,9 @@ export function registerRuntimeRecovery(ctx, controller, getSettings, bindReques
|
|
|
248
250
|
const decision = attempt?.decision;
|
|
249
251
|
decision?.assertCurrent();
|
|
250
252
|
const header = frame.agent.session.requestHeader?.();
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
const headerRoute = header === undefined ? undefined : modelRouteFromHeader(header);
|
|
254
|
+
if (!active || frame.signal.aborted || lock === undefined || headerRoute === undefined
|
|
255
|
+
|| headerRoute.provider !== frame.provider || !sameModelRoute(headerRoute, lock.route) || headerRoute.reasoningEffort !== lock.route.reasoningEffort
|
|
253
256
|
|| attempt === undefined || attempt.policy !== policy || attempt.generation !== lock.generation
|
|
254
257
|
|| !decision?.configuredRoot && latestNativeModelSelection(frame.agent)?.seq !== attempt.manualSelectionSeq
|
|
255
258
|
|| !isCurrentRecoveryStep(recoveryEvents(frame.agent), frame.turn, frame.step) || !positiveNoOutput(frame, attempt))
|
|
@@ -265,7 +268,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings, bindReques
|
|
|
265
268
|
attempt.consumed = true;
|
|
266
269
|
const resolved = resolveRoleRuntimePolicy(settings, role);
|
|
267
270
|
const bounds = resolved.rateLimit;
|
|
268
|
-
let route =
|
|
271
|
+
let route = attempt.route;
|
|
269
272
|
let candidateIndex = lock.candidateIndex;
|
|
270
273
|
let switching = false;
|
|
271
274
|
if (unavailable) {
|
|
@@ -281,6 +284,20 @@ export function registerRuntimeRecovery(ctx, controller, getSettings, bindReques
|
|
|
281
284
|
if (!switching && lock.retries >= bounds.maxRetries)
|
|
282
285
|
return undefined;
|
|
283
286
|
}
|
|
287
|
+
// A fixed step selection has no public same-step candidate-switch seam.
|
|
288
|
+
// Rate-limit switching degrades to a bounded current-route retry;
|
|
289
|
+
// unavailable routes stay final.
|
|
290
|
+
if (switching && hostModelSelection(frame.agent) !== undefined) {
|
|
291
|
+
if (unavailable)
|
|
292
|
+
return undefined;
|
|
293
|
+
if (!switchBlocked.has(frame.agent)) {
|
|
294
|
+
switchBlocked.add(frame.agent);
|
|
295
|
+
warnSafely(ctx, SWITCH_BLOCKED_WARNING);
|
|
296
|
+
}
|
|
297
|
+
switching = false;
|
|
298
|
+
if (lock.retries >= bounds.maxRetries)
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
284
301
|
if (switching) {
|
|
285
302
|
if (!unavailable && lock.switches >= bounds.maxSwitches)
|
|
286
303
|
return undefined;
|
|
@@ -294,8 +311,8 @@ export function registerRuntimeRecovery(ctx, controller, getSettings, bindReques
|
|
|
294
311
|
const selected = await selectInitialModelRouteChoice(llm ?? {}, candidates, frame.signal, parameterPolicy.mode === "passthrough" ? ctx.get?.("dsmmLlmRoutes") : undefined, decision?.configuredRoot && parameterPolicy.mode === "native-defaults" ? route => modelRouteFromCall(projectModelRouteParameters(route, "dsmm-config", false)) : undefined, assertRouteCurrent);
|
|
295
312
|
assertRouteCurrent();
|
|
296
313
|
route = parameterPolicy.mode === "native-defaults"
|
|
297
|
-
? modelRouteFromCall(projectModelRouteParameters(selected.
|
|
298
|
-
: selected.
|
|
314
|
+
? modelRouteFromCall(projectModelRouteParameters(selected.proposal, decision?.configuredRoot || selected.requestedRoute.reasoningEffort === undefined ? "dsmm-config" : "native", false))
|
|
315
|
+
: selected.proposal;
|
|
299
316
|
candidateIndex = index + 1 + candidates.findIndex(candidate => sameExactModelRoute(candidate, selected.requestedRoute));
|
|
300
317
|
}
|
|
301
318
|
const serverMinimum = frame.failure.providerRetryAfterMs;
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import type { DshSession } from "./dsh-types.js";
|
|
1
|
+
import type { DshSession, DshSessionEvent } from "./dsh-types.js";
|
|
2
2
|
import type { DsmmRolePolicyEventData } from "./dsh-events.js";
|
|
3
|
+
import type { DsmmModelRoute } from "./settings.js";
|
|
4
|
+
export interface DsmmModelSelectionRecordData {
|
|
5
|
+
readonly version: 1;
|
|
6
|
+
readonly source: "dsmm-selection" | "activation-setup";
|
|
7
|
+
readonly selectionSeq: number;
|
|
8
|
+
readonly route: Readonly<Pick<DsmmModelRoute, "provider" | "model" | "reasoningEffort">>;
|
|
9
|
+
}
|
|
3
10
|
declare module "@deepseek-ai/dsh-session/types" {
|
|
4
11
|
interface PluginRecordMap {
|
|
5
12
|
"plugin:dsmm/mode": {
|
|
6
13
|
active: boolean;
|
|
7
14
|
};
|
|
8
15
|
"plugin:dsmm/role-policy": DsmmRolePolicyEventData;
|
|
16
|
+
"plugin:dsmm/model-selection": DsmmModelSelectionRecordData;
|
|
9
17
|
}
|
|
10
18
|
}
|
|
11
19
|
/** Model-hidden observations use the official ignorable record boundary, never authorization. */
|
|
12
20
|
export declare function appendModeRecord(session: DshSession, active: boolean): void;
|
|
13
21
|
export declare function appendRolePolicyRecord(session: DshSession, data: DsmmRolePolicyEventData): void;
|
|
22
|
+
export declare function appendModelSelectionRecord(session: DshSession, data: DsmmModelSelectionRecordData): void;
|
|
23
|
+
export declare function readModelSelectionRecord(event: DshSessionEvent): (DsmmModelSelectionRecordData & {
|
|
24
|
+
recordSeq: number;
|
|
25
|
+
}) | undefined;
|
|
14
26
|
//# sourceMappingURL=session-metadata.d.ts.map
|
package/lib/session-metadata.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { appendPluginRecord } from "@deepseek-ai/dsh-session";
|
|
1
|
+
import { appendPluginRecord, pluginRecordOf } from "@deepseek-ai/dsh-session";
|
|
2
2
|
/** Model-hidden observations use the official ignorable record boundary, never authorization. */
|
|
3
3
|
export function appendModeRecord(session, active) {
|
|
4
4
|
appendPluginRecord(session, "plugin:dsmm/mode", { active });
|
|
@@ -6,4 +6,24 @@ export function appendModeRecord(session, active) {
|
|
|
6
6
|
export function appendRolePolicyRecord(session, data) {
|
|
7
7
|
appendPluginRecord(session, "plugin:dsmm/role-policy", data);
|
|
8
8
|
}
|
|
9
|
+
export function appendModelSelectionRecord(session, data) {
|
|
10
|
+
appendPluginRecord(session, "plugin:dsmm/model-selection", data);
|
|
11
|
+
}
|
|
12
|
+
export function readModelSelectionRecord(event) {
|
|
13
|
+
const record = pluginRecordOf(event);
|
|
14
|
+
if (record?.type !== "plugin:dsmm/model-selection" || !isRecord(record.data))
|
|
15
|
+
return undefined;
|
|
16
|
+
const { version, source, selectionSeq, route } = record.data;
|
|
17
|
+
if (version !== 1 || source !== "dsmm-selection" && source !== "activation-setup"
|
|
18
|
+
|| !Number.isSafeInteger(selectionSeq) || typeof selectionSeq !== "number" || selectionSeq < 0 || !isRecord(route)
|
|
19
|
+
|| Object.keys(route).some(key => !["provider", "model", "reasoningEffort"].includes(key))
|
|
20
|
+
|| typeof route.provider !== "string" || route.provider.trim() === "" || typeof route.model !== "string" || route.model.trim() === ""
|
|
21
|
+
|| route.reasoningEffort !== undefined && (typeof route.reasoningEffort !== "string" || route.reasoningEffort.trim() === ""))
|
|
22
|
+
return undefined;
|
|
23
|
+
return { version, source, selectionSeq, route: { provider: route.provider, model: route.model,
|
|
24
|
+
...(route.reasoningEffort === undefined ? {} : { reasoningEffort: route.reasoningEffort }) }, recordSeq: Number(record.seq) };
|
|
25
|
+
}
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
9
29
|
//# sourceMappingURL=session-metadata.js.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { LookupAddress } from "node:dns";
|
|
2
|
-
|
|
2
|
+
/** The 0.2.1 injected-resolver contract, kept locally: 0.2.2 removed the seam and the export. */
|
|
3
|
+
export type AddressResolver = (hostname: string, signal: AbortSignal) => Promise<{
|
|
4
|
+
address: string;
|
|
5
|
+
family: 4 | 6;
|
|
6
|
+
}[]>;
|
|
3
7
|
export type AddressLookup = (hostname: string, options: {
|
|
4
8
|
all: true;
|
|
5
9
|
order: "verbatim";
|
|
@@ -20,5 +24,5 @@ export declare class FakeIpAddressPolicy {
|
|
|
20
24
|
allowsTranslatedIpv4(input: string): boolean;
|
|
21
25
|
}
|
|
22
26
|
/** Resolve once; the native provider pins exactly this validated, nonempty set. */
|
|
23
|
-
export declare function createFakeIpResolver(policy?: FakeIpAddressPolicy, lookup?: AddressLookup):
|
|
27
|
+
export declare function createFakeIpResolver(policy?: FakeIpAddressPolicy, lookup?: AddressLookup): AddressResolver;
|
|
24
28
|
//# sourceMappingURL=web-fetch-address-policy.d.ts.map
|
|
@@ -16,6 +16,12 @@ export declare class FakeIpHttpFetchProvider implements WebFetchProvider {
|
|
|
16
16
|
private readonly limits;
|
|
17
17
|
private readonly policy;
|
|
18
18
|
private readonly resolver;
|
|
19
|
+
/**
|
|
20
|
+
* 0.2.1 accepted an injected address resolver; 0.2.2 removed that seam and
|
|
21
|
+
* routes every request through the process-wide dispatcher. The owner of the
|
|
22
|
+
* process transport policy stays the Host — this adapter never installs one.
|
|
23
|
+
*/
|
|
24
|
+
private readonly resolverAccepted;
|
|
19
25
|
constructor(config?: Config, lookup?: AddressLookup);
|
|
20
26
|
available(): boolean;
|
|
21
27
|
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
package/lib/web-fetch-fakeip.js
CHANGED
|
@@ -4,6 +4,7 @@ import { HttpFetchProvider, DEFAULT_USER_AGENT } from "@deepseek-ai/dsh-web-fetc
|
|
|
4
4
|
import { proxyRouteFor } from "@deepseek-ai/dsh-http-proxy";
|
|
5
5
|
import { isIP } from "node:net";
|
|
6
6
|
import { FakeIpAddressPolicy, createFakeIpResolver, isFakeIpAddress, stripIpv6Brackets, } from "./web-fetch-address-policy.js";
|
|
7
|
+
const dualHttpFetchProvider = HttpFetchProvider;
|
|
7
8
|
export const name = "dsmm-http-fakeip";
|
|
8
9
|
export const FETCH_PROVIDER_ID = "dsmm-http-fakeip";
|
|
9
10
|
export const inject = ["web"];
|
|
@@ -59,13 +60,22 @@ export class FakeIpHttpFetchProvider {
|
|
|
59
60
|
limits;
|
|
60
61
|
policy;
|
|
61
62
|
resolver;
|
|
63
|
+
/**
|
|
64
|
+
* 0.2.1 accepted an injected address resolver; 0.2.2 removed that seam and
|
|
65
|
+
* routes every request through the process-wide dispatcher. The owner of the
|
|
66
|
+
* process transport policy stays the Host — this adapter never installs one.
|
|
67
|
+
*/
|
|
68
|
+
resolverAccepted;
|
|
62
69
|
constructor(config = {}, lookup) {
|
|
63
70
|
this.limits = resolveLimits(config);
|
|
64
71
|
this.policy = new FakeIpAddressPolicy(config);
|
|
65
72
|
this.resolver = createFakeIpResolver(this.policy, lookup);
|
|
73
|
+
this.resolverAccepted = Object.hasOwn(new HttpFetchProvider(this.limits), "resolveAddresses");
|
|
66
74
|
}
|
|
67
75
|
available() {
|
|
68
|
-
return
|
|
76
|
+
return this.resolverAccepted
|
|
77
|
+
? new dualHttpFetchProvider(this.limits, this.resolver).available()
|
|
78
|
+
: new dualHttpFetchProvider(this.limits).available();
|
|
69
79
|
}
|
|
70
80
|
fetch(request, signal) {
|
|
71
81
|
if (signal?.aborted)
|
|
@@ -83,6 +93,23 @@ export class FakeIpHttpFetchProvider {
|
|
|
83
93
|
catch (error) {
|
|
84
94
|
return Promise.reject(error);
|
|
85
95
|
}
|
|
96
|
+
if (!this.resolverAccepted) {
|
|
97
|
+
// 0.2.2 neither resolves nor pins addresses: the native provider sends the
|
|
98
|
+
// request through the installed dispatcher. Answer-level enforcement this
|
|
99
|
+
// adapter owned on 0.2.1 has no public seam back, so a configured local
|
|
100
|
+
// deny fails closed for direct hostnames and native IPv6 literals whose
|
|
101
|
+
// translated destination cannot be checked. IPv4/mapped literals retain
|
|
102
|
+
// their entry checks above.
|
|
103
|
+
const host = stripIpv6Brackets(url.hostname);
|
|
104
|
+
const literal = isIP(host) !== 0;
|
|
105
|
+
const nativeIpv6Literal = isIP(host) === 6 && !host.toLowerCase().startsWith("::ffff:");
|
|
106
|
+
const route = proxyRouteFor(url);
|
|
107
|
+
if (this.policy.requiresLocalDeny && (!literal || nativeIpv6Literal) && !route.proxied) {
|
|
108
|
+
return Promise.reject(new WebError("direct destinations cannot enforce local address denies on this Host version", "WEB_FAKEIP_PROXY_UNSUPPORTED"));
|
|
109
|
+
}
|
|
110
|
+
const limits = nativeIpv6Literal ? { ...this.limits, maxRedirects: 0 } : this.limits;
|
|
111
|
+
return new HttpFetchProvider(limits).fetch(request, signal);
|
|
112
|
+
}
|
|
86
113
|
// Same-origin redirects preserve the full routing key. Recheck inside the
|
|
87
114
|
// resolver as well: rc.2 otherwise sends proxied Fake-IP literals direct.
|
|
88
115
|
const resolve = (hostname, innerSignal) => {
|
|
@@ -97,7 +124,7 @@ export class FakeIpHttpFetchProvider {
|
|
|
97
124
|
const limits = this.policy.requiresLocalDeny || nativeIpv6Literal
|
|
98
125
|
? { ...this.limits, maxRedirects: 0 }
|
|
99
126
|
: this.limits;
|
|
100
|
-
return new
|
|
127
|
+
return new dualHttpFetchProvider(limits, resolve).fetch(request, signal);
|
|
101
128
|
}
|
|
102
129
|
}
|
|
103
130
|
/** Mount only when the operator has explicitly selected this adapter. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsmm/dsmm",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
|
|
5
5
|
"author": "Hugefiver",
|
|
6
6
|
"license": "LicenseRef-AAAPL",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
],
|
|
115
115
|
"engines": {
|
|
116
116
|
"node": ">=22",
|
|
117
|
-
"dsh": ">=0.2.1-rc.2 <0.3.0"
|
|
117
|
+
"dsh": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"@deepseek-ai/dsh-web-fetch-http": "0.2.1-rc.2",
|
package/prompts/deepwork.md
CHANGED
|
@@ -176,7 +176,6 @@ Use the current DSH 0.2.1-rc.2 catalog: read/glob/grep for files, web_search/web
|
|
|
176
176
|
Logical source role names map to IDs dsmm-<name> (explore is only the code-search alias). Inspect this Agent's actual admitted tool inventory: per-role exposes individual role tools plus dsmm_category; parameterized exposes dsmm_role/dsmm_category and their permitted target enums. description/prompt are assignment inputs; optional level, route and run_in_background depend on the actual schema and captured admission. Omitted/normal retains the default route; low/high/max requires that target's configured complete route or effort-only override, with exact native preflight. route additionally needs deployment allowRouteOverride=true; no suffix role/tool or arbitrary effort is inferred. Layout/level never changes target/read-only/depth/ownership authority. A read-only planner returns complete Markdown for authorized coordinator persistence, never through file/shell writes or a child proxy.
|
|
177
177
|
One-shot defaults foreground and is never revived after settlement. When enabled and admitted, native jobs own one-shot background; a managed continuable configuration defaults background and returns a durable child ID, while explicit run_in_background:false starts a non-reusable one-shot. Existing continuable children use actual exposed send_message for running/idle/same-ID cold delivery and actual native user queue/steer; acceptance is not completion. Original child route/locale/authority remains captured and intersects current exact-parent authority, not parent-new-policy inheritance. Legacy conservative evidence permits useful proven capabilities and denies missing-evidence capabilities with reasons. A foreground handoff, only through an actually wired user control, moves the existing run to native-job ownership without another start; no static text declares a new tool or RPC. Managed delivery requires disabling the stock subagents row and binding the unique PUBLIC DSMM SubagentRuntime subclass at explicit startup, then restart. Stock cannot be hot-replaced. Background/capacity/depth/ownership/cancellation remain mandatory. Native continuation is not task_id/resume/retry.
|
|
178
178
|
The native main model picker, explicit user route and catalog are authoritative. Model guidance calibrates behavior only; it does not select a provider/model, grant permissions, declare external independence or change advertised effort. Oracle independence requires a different model was explicitly selected and verified in the actual route. Default inventory has no synthetic tiers or additional Oracle slots.
|
|
179
|
-
Follow the current user's explicit visible-output language request, then this Agent's immutable captured locale when supplied, then applicable host/user language guidance or current request/context. All DSMM roles/categories follow this priority even with common mode off. Preserve identifiers, code, paths, commands, protocol fields and exact quotes; child assignments retain explicit language requests. This contract copies no Root locale/configuration, promises no internal reasoning language and changes neither host UI nor project locale.
|
|
180
179
|
Role persona and access remain when Deepwork is explicitly off; common workflow and DSMM skills do not. Git/install/login/destructive actions need exact authorization regardless of mode. All delegation guidance is intersected with enabled roles, mounted capabilities, inherited permissions and native depth; runtime policy enforces those ceilings, not these static texts.
|
|
181
180
|
</dsmm-host-contract>
|
|
182
181
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# CLAUDE OPUS 5 EXECUTION CALIBRATION
|
|
4
|
-
|
|
5
|
-
Apply this additive layer only to a Claude Opus 5 or 5.5 orchestrator (including valid dated or named snapshots). The role prompt, workflow rules, explicit user configuration/authorization, verification requirements including required evidence/review, applicable loaded skills, and effective terminal policies remain authoritative and override this additive calibration.
|
|
1
|
+
# Bounded Execution
|
|
6
2
|
|
|
7
3
|
## Scope fidelity
|
|
8
4
|
|
|
@@ -21,10 +17,8 @@ Apply this additive layer only to a Claude Opus 5 or 5.5 orchestrator (including
|
|
|
21
17
|
- Reuse passing evidence while it still covers the claim and no change materially affects tested behavior or interfaces; rerun only affected or missing checks.
|
|
22
18
|
- Preserve every required final review and required evidence; efficiency never removes them.
|
|
23
19
|
- Prefer a path, a commit, or the uncommitted working-tree change over an invented hash, checksum, or revision stamp. Treat RED/GREEN as evidence at a real deterministic seam rather than a universal gate.
|
|
24
|
-
-
|
|
20
|
+
- Scale process to the request rather than defaulting upward, and recheck only what the current step depends on when runtime or path state drifts.
|
|
25
21
|
|
|
26
22
|
## Communication
|
|
27
23
|
|
|
28
24
|
- Start with one sentence stating the intended outcome, stay quiet between tool calls, and finish with a short outcome-first report.
|
|
29
|
-
|
|
30
|
-
</deepwork-mode>
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
# Native Tool Compatibility
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This is a host-compatibility base, not a second GPT behavioral calibration. Detected GPT/Codex-family models receive the shared `gpt.md` calibration once, subordinate to their role.
|
|
6
|
-
|
|
7
|
-
Use the currently observed DSH per-role or parameterized role/category tools for permitted delegation, an available native tracking surface or authorized plan for coordination, and exposed editing/LSP tools rather than Codex-only names. Level/route/background and same-ID continuation depend on captured admission and actual schemas, never on templates. Do not send task_id or invent a control RPC. Load matching skills through native skill invocation.
|
|
8
|
-
|
|
9
|
-
</deepwork-mode>
|
|
3
|
+
Use the currently observed DSH per-role or parameterized role/category tools for permitted delegation, an available native tracking surface or authorized plan for coordination, and exposed editing/LSP tools rather than names from another host. Level/route/background and same-ID continuation depend on captured admission and actual schemas, never on templates. Do not send task_id or invent a control RPC. Load matching skills through native skill invocation.
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# GEMINI 4.x RELIABILITY CALIBRATION
|
|
4
|
-
|
|
5
|
-
Apply only to Gemini 4.x models, including Argon-named variants. This local additive adapts generic Gemini guidance; it is not an independently sourced Argon prompt or a claim of new capabilities. The role prompt, effective workflow, authorization, permissions, native tool inventory and verification requirements remain authoritative.
|
|
1
|
+
# Evidence-grounded Execution
|
|
6
2
|
|
|
7
3
|
- Distinguish a request to explain, investigate or review from authorization to implement. Take the next in-scope action when authorized; do not substitute confident reasoning or a promise for execution.
|
|
8
4
|
- Base file, configuration and runtime claims on inspected evidence rather than guessed contents. Reuse still-valid observations; retrieve again only for a concrete missing fact or relevant change, not a ritual reread.
|
|
9
5
|
- Use the actual admitted tools and schemas for execution and verification. A plausible patch or successful compilation alone does not prove the requested behavior; exercise the affected surface when available and disclose missing coverage.
|
|
10
6
|
- Keep specialist use within the role's delegation contract. Calibration does not turn a planner, reviewer or category worker into an orchestrator, grant file writes, or create tools or native task lifecycle handles.
|
|
11
7
|
- Preserve required content and scope. Do not add polish, abstractions, workflow gates or adjacent cleanup merely because they seem useful. Stop repeated checks or retries without new evidence; report unmet requirements instead of asserting success.
|
|
12
|
-
|
|
13
|
-
</gemini-4-calibration>
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<deepwork-mode>
|
|
2
|
-
|
|
3
|
-
**MANDATORY**: The first time you respond after this mode activates in a conversation, say exactly: "DEEPWORK MODE ENABLED!" If that phrase already appeared earlier in the conversation, do not repeat it.
|
|
4
|
-
|
|
5
1
|
### Skill Reference (load on demand)
|
|
6
2
|
|
|
7
3
|
Load the full `brainstorming` native skill when material uncertainty needs discovery or design, not merely because a request changes behavior. Clear, authorized work follows the applicable workflow directly. Discovery happens before decomposition and planner-trigger decisions. Use a permitted, available `clarifier` only when it materially helps resolve ambiguity; ask the user when their decision is needed. Other skills are on-demand native skills:
|
|
@@ -192,5 +188,3 @@ Git writes require authorization for the exact action. A semantically clear requ
|
|
|
192
188
|
- **NO LOCK SCAFFOLDING**: Don't build tooling, scripts, manifests, or harnesses that pin, freeze, or re-assert the state of unrelated files, the environment, or prior work. Don't re-confirm the working directory or unrelated file state you already observed when runtime or path state drifts benignly.
|
|
193
189
|
|
|
194
190
|
THE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.
|
|
195
|
-
|
|
196
|
-
</deepwork-mode>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<deepwork-mode>
|
|
2
|
-
|
|
3
1
|
### Skill Reference (load on demand)
|
|
4
2
|
|
|
5
3
|
Load the full `brainstorming` native skill when material uncertainty needs discovery or design, not merely because a request changes behavior. Clear, authorized work follows the applicable workflow directly. Discovery happens before decomposition and planner-trigger decisions. Use a permitted, available `clarifier` only when it materially helps resolve ambiguity; ask the user when their decision is needed. Other skills are on-demand native skills:
|
|
@@ -15,7 +13,6 @@ Load the full `brainstorming` native skill when material uncertainty needs disco
|
|
|
15
13
|
| remove-ai-slops | user asks to "remove slop", "deslop", clean AI code | remove-ai-slops |
|
|
16
14
|
|
|
17
15
|
Do NOT load a skill unless its trigger matches. Loading unnecessary skills wastes context.
|
|
18
|
-
**MANDATORY**: The FIRST time you respond after this mode activates in a conversation, you MUST say "DEEPWORK MODE ENABLED!" to the user. Say it ONCE per conversation: if "DEEPWORK MODE ENABLED!" already appears in an earlier turn, do NOT say it again.
|
|
19
16
|
|
|
20
17
|
[HIGH PRECISION] Outcome first, scope tight, evidence proportional to risk.
|
|
21
18
|
|
|
@@ -100,9 +97,7 @@ Before implementation, reach operational certainty:
|
|
|
100
97
|
- `docs/superpowers/specs/` and `docs/superpowers/plans/` hold final product requirements to be delivered, one final deliverable per artifact. Changed requirements use separate plans, not accumulated change histories. Other tasks, including complex maintenance, use conversation coordination or task-owned temporary plans elsewhere; complexity does not determine artifact location.
|
|
101
98
|
- Git commits bound compatibility. Uncommitted interim implementations may change incompatibly for final requirements without transition shims or preservation tests. An uncommitted edit does not erase committed contracts or expand API/security/data/permission/irreversible-action authorization.
|
|
102
99
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
GLM 5.2 behaves like Opus 4.6, is tuned to think and act like Fable 5, and should write code with GPT 5.5 precision.
|
|
100
|
+
## Analysis and Execution
|
|
106
101
|
|
|
107
102
|
<thinking_depth>
|
|
108
103
|
- Use the thinking channel for all reasoning, planning, and analysis. Do NOT put deliberation, option-weighing, or step-by-step reasoning in the visible output — the user only sees the final answer and actions.
|
|
@@ -114,13 +109,13 @@ GLM 5.2 behaves like Opus 4.6, is tuned to think and act like Fable 5, and shoul
|
|
|
114
109
|
- Keep private deliberation in the thinking channel. Visible updates give current results, constraints, risks, and observed evidence, not a decision history, reasoning chain, or options weighed internally. Final-answer brevity doesn't replace substantive phase updates.
|
|
115
110
|
</thinking_depth>
|
|
116
111
|
|
|
117
|
-
<
|
|
112
|
+
<execution_checks>
|
|
118
113
|
- Do not confuse enough information with permission to skip required product planning. Complex product business-logic or behavior implementation still uses the planner/critic sequence; non-product routine work does not inherit it.
|
|
119
114
|
- Do not narrate options in the visible output — weigh them in the thinking channel and state the decision.
|
|
120
115
|
- Do not stop with a promise to do work; do the work now unless blocked by user-only input.
|
|
121
116
|
- Before reporting progress, audit each claim against inspected, still-valid evidence covering that claim.
|
|
122
117
|
- If tests fail, say they fail and include the evidence. If a step was skipped, say it was skipped.
|
|
123
|
-
</
|
|
118
|
+
</execution_checks>
|
|
124
119
|
|
|
125
120
|
## NO EXCUSES. NO COMPROMISES.
|
|
126
121
|
|
|
@@ -263,5 +258,3 @@ Done means all are true:
|
|
|
263
258
|
## GIT AUTHORIZATION
|
|
264
259
|
|
|
265
260
|
Git writes require authorization for the exact action. A semantically clear request is sufficient authorization, but implement/fix does not authorize commit, and commit does not authorize push, tag, rebase, or release.
|
|
266
|
-
|
|
267
|
-
</deepwork-mode>
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
**MANDATORY**: The first time you respond after this mode activates in a conversation, say exactly: "DEEPWORK MODE ENABLED!" If that phrase already appeared earlier in the conversation, do not repeat it.
|
|
4
|
-
|
|
5
|
-
# GPT EXECUTION CALIBRATION
|
|
6
|
-
|
|
7
|
-
This is the shared behavioral calibration for all detected GPT/Codex-family models. The role prompt, applicable skills, explicit configuration, authorization, and delegation contract remain authoritative. Calibration never expands a role's permissions or changes runtime model capabilities.
|
|
1
|
+
# Execution Discipline
|
|
8
2
|
|
|
9
3
|
## Outcome and authority
|
|
10
4
|
|
|
@@ -40,11 +34,11 @@ Use LSP for symbols and dedicated search/read tools for files and text; ast-grep
|
|
|
40
34
|
|
|
41
35
|
The behaviors below are prohibited categories, not discouraged habits. The instant you notice one starting — even mid-tool-call — abort it. Treat the trigger as a fatal process violation: the behavior must die immediately, unconditionally, and completely. Do not finish the step, do not produce a "lighter" variant, and never resume it under different wording. If it already produced artifacts, discard them before continuing. Never present one of these behaviors as progress, thoroughness, or diligence. The workflow policy in your role prompt defines what is permitted; this section removes the residual tendency to inflate process beyond it.
|
|
42
36
|
|
|
43
|
-
- Hash locking.
|
|
44
|
-
- Repeat verification.
|
|
45
|
-
- Ceremony tests.
|
|
46
|
-
- Gate inflation.
|
|
47
|
-
- Over-asking.
|
|
37
|
+
- Hash locking. Do not substitute invented hashes, checksums, fingerprints, revision stamps, or content digests for real references. Use a path, a commit, or the uncommitted working-tree change instead. Hashing is justified only by an explicit external integrity, release, security, or protocol requirement; a hash invented as a receipt is waste, not evidence: delete it and continue.
|
|
38
|
+
- Repeat verification. Do not re-derive facts already proven by tool results, re-read files unchanged since the last read, re-run checks whose inputs have not changed since the last green result, and ask the user or a subagent to reconfirm known facts. Reuse the existing evidence and move on; run at most one appropriate final pass, and only after relevant inputs actually changed.
|
|
39
|
+
- Ceremony tests. Do not apply full TDD universally, start with bulk fixtures or test matrices, invent scenario quotas, add string/regex/snapshot locks on documentation, commit messages, package metadata, or non-boundary wording, and add infrastructure/environment freeze tests to prove prompt or document edits. Scale tests to the plausible regression at real deterministic seams. RED/GREEN is evidence at such a seam, never a universal gate. A small edit needs only the tests covering the changed area, and a trivial adjustment verified by re-reading the changed lines needs no test run at all.
|
|
40
|
+
- Gate inflation. Do not add verification rounds, approval checkpoints, review loops, and sign-off steps no governing contract required. Capability does not add process; doubt is resolved by evidence, not by another gate.
|
|
41
|
+
- Over-asking. Do not ask for confirmation when repository evidence already settles the question. Decide from context, state the safe assumption, and continue. Ask only when a protected choice, unavailable input, destructive action, or material rework requires it.
|
|
48
42
|
|
|
49
43
|
Correction after a trigger: stop, revert or delete what the behavior produced, state in one sentence that the behavior was suppressed and what was discarded, then continue the authorized work. Suppression never licenses hiding it when it consumed user-visible work; report it honestly in the final report and never repeat it.
|
|
50
44
|
|
|
@@ -54,7 +48,7 @@ Start from the required user outcome and plausible failures. Read covering tests
|
|
|
54
48
|
|
|
55
49
|
Tests protect valid requirements, functionality, and external interfaces. Do not use strings, regexes, snapshots, or parsed-content comparisons to lock documentation, commit messages, package descriptions, or non-boundary error/log wording. Update corresponding tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling checks; do not preserve uncommitted interim behavior as a regression contract.
|
|
56
50
|
|
|
57
|
-
Do not add tests that freeze incidental files or lockfiles, build-tool details, descriptive package metadata, local OS/shell/path/PATH/CWD settings, dependency/runtime versions, or environment snapshots unrelated to product behavior or an explicit external or necessary delivery contract. Each test must expose a concrete failure of such a requirement; otherwise don't add it. Verify executable configuration and delivery through observable behavior, not whole-file string/hash equality or parsed incidental state. Integrity, provenance, security, and protocol pins remain appropriate only for their concrete boundary.
|
|
51
|
+
Do not add tests that freeze incidental files or lockfiles, build-tool details, descriptive package metadata, local OS/shell/path/PATH/CWD settings, dependency/runtime versions, or environment snapshots unrelated to product behavior or an explicit external or necessary delivery contract. Each test must expose a concrete failure of such a requirement; otherwise don't add it. Verify executable configuration and delivery through observable behavior, not whole-file string/hash equality or parsed incidental state. Integrity, provenance, security, and protocol pins remain appropriate only for their concrete boundary. Thoroughness must not become infrastructure/environment freeze tests or tests added merely to prove prompt/document edits.
|
|
58
52
|
|
|
59
53
|
Exercise the real surface where applicable: run the CLI/API, drive the UI/TUI, load config or prompts, or inspect built output. File edits or a compile-only result don't by themselves prove delivery. Retain enough observed evidence to support claims; report unavailable surface coverage honestly. Clean up only resources created for this work.
|
|
60
54
|
|
|
@@ -74,5 +68,3 @@ In user-facing responses, state conclusions, reasons, and actions directly. Pref
|
|
|
74
68
|
At substantive phase transitions, blockers, material plan changes, or after a long work segment, briefly explain the known result, current work, and next step. Don't broadcast every tool call or todo update, require fixed labels, expose private deliberation, or append a decision history to deliverables.
|
|
75
69
|
|
|
76
70
|
Stop when the complete authorized outcome and necessary evidence are satisfied. For answerable research or explanation, answer without extra agents or planning cycles. The final report states the delivered outcome, verification evidence, remaining risks, and unverified items; don't hide required unfinished work as optional next steps. Prefer short prose, using lists only for genuine enumeration.
|
|
77
|
-
|
|
78
|
-
</deepwork-mode>
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# KIMI EXECUTION CALIBRATION
|
|
4
|
-
|
|
5
|
-
Apply to Kimi models and supported K2 short aliases. All generations and named aliases share this calibration; a matching name does not establish model availability or capabilities. This is shared behavioral guidance, not a model identity, parameter family or routing rule. The role prompt, user policy, authorization boundaries, verification requirements, and delegation permissions remain authoritative.
|
|
1
|
+
# Outcome-first Execution
|
|
6
2
|
|
|
7
3
|
- Keep execution outcome-first. Once the requested result and its observable completion evidence are clear, move through routine implementation transitions directly instead of repeatedly reopening equivalent approaches.
|
|
8
4
|
- Treat ordinary sequencing as mechanical: use known dependencies and file ownership to choose the next permitted action. Reserve deeper analysis for correctness, dependency boundaries, failure diagnosis, and verification that can change the result.
|
|
@@ -13,5 +9,3 @@ Apply to Kimi models and supported K2 short aliases. All generations and named a
|
|
|
13
9
|
- Scale the pipeline to the request rather than defaulting upward; the governing workflow policy decides what the request needs.
|
|
14
10
|
- A light execution path cannot bypass policy for complex business or behavior changes. Those changes still require the orchestrator-managed `planner → plan-critic → implementation` flow; only genuinely bounded, low-risk work or an explicit permitted exception may use a lighter path.
|
|
15
11
|
- If browser work is necessary, use a temporary blank profile/context owned by the current run. Do not connect to an existing browser or CDP session, log in, import or synchronize settings, extensions, cookies, auth/storage state, or another profile; report authentication-gated coverage as unverified.
|
|
16
|
-
|
|
17
|
-
</kimi-calibration>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<deepwork-mode>
|
|
2
|
-
|
|
3
1
|
<deepwork-skill-layer>
|
|
4
2
|
This prompt is loaded by the skill-driven deepwork workflow. The on-demand native `writing-plans` skill supplies planning techniques; this planner doctrine governs proportional, outcome-oriented use of them.
|
|
5
3
|
</deepwork-skill-layer>
|
|
@@ -43,5 +41,3 @@ Use the native `writing-plans` skill to produce the plan requested by the orches
|
|
|
43
41
|
- Include relevant verification cases for stale state, dirty worktrees, misleading success output, and prompt injection; report current evidence and gaps, not a trial history.
|
|
44
42
|
- Plan for evidence, not ritual: reference work by path, commit, or uncommitted change rather than by hash or revision stamp, and don't specify verification rounds, approval checkpoints, sign-off steps, or universal RED/GREEN gates the governing contract didn't require. Size regression coverage to concrete risk at real deterministic seams rather than scenario quotas or bulk fixtures.
|
|
45
43
|
- Scale the plan to the request: don't manufacture phases, review rounds, or lock scaffolding the work does not need, and don't plan re-confirmation of environment facts the work does not depend on.
|
|
46
|
-
|
|
47
|
-
</deepwork-mode>
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# SWE-2 EXECUTION CALIBRATION
|
|
4
|
-
|
|
5
|
-
Apply only to the SWE-2 model and its effort-suffixed lanes. SWE-2 is not a Kimi reasoning family: do not infer Kimi identity, thinking parameters, defaults, or permissions from this calibration. The role prompt, user policy, authorization boundaries, verification requirements, and delegation permissions remain authoritative.
|
|
1
|
+
# Decisive Execution
|
|
6
2
|
|
|
7
3
|
- Drive toward the concrete requested outcome. Once a decisive fact is available—such as the dependency boundary, failing cause, or verification result—stop extending analysis that cannot change the decision and take the next permitted action in the same turn.
|
|
8
4
|
- Do not end a work turn with only “I will” or “next I would” when the stated action is available, safe, in scope, and executable now. Perform it, then report observed evidence.
|
|
9
5
|
- Spend analytical depth where it changes correctness: inspect interfaces before edits, diagnose actual failures, and verify the changed surface. Do not manufacture alternative execution orders after dependencies already settle one.
|
|
10
|
-
- Do not manufacture process either.
|
|
6
|
+
- Do not manufacture process either. Once a fact is settled, prefer a path, a commit, or the uncommitted working-tree change over an invented hash or revision stamp, don't re-run checks whose inputs haven't changed, and don't re-confirm environment facts the current step doesn't depend on.
|
|
11
7
|
- Scale the pipeline to the request rather than defaulting upward; the governing workflow policy decides what the request needs.
|
|
12
8
|
- Direct action cannot bypass policy for complex business or behavior changes. Those changes still require the orchestrator-managed `planner → plan-critic → implementation` flow; only genuinely bounded, low-risk work or an explicit permitted exception may use a lighter path.
|
|
13
9
|
- If browser work is necessary, use a temporary blank profile/context owned by the current run. Do not connect to an existing browser or CDP session, log in, import or synchronize settings, extensions, cookies, auth/storage state, or another profile; report authentication-gated coverage as unverified.
|
|
14
|
-
|
|
15
|
-
</swe-2-calibration>
|
|
@@ -3,6 +3,5 @@ Use the current DSH 0.2.1-rc.2 catalog: read/glob/grep for files, web_search/web
|
|
|
3
3
|
Logical source role names map to IDs dsmm-<name> (explore is only the code-search alias). Inspect this Agent's actual admitted tool inventory: per-role exposes individual role tools plus dsmm_category; parameterized exposes dsmm_role/dsmm_category and their permitted target enums. description/prompt are assignment inputs; optional level, route and run_in_background depend on the actual schema and captured admission. Omitted/normal retains the default route; low/high/max requires that target's configured complete route or effort-only override, with exact native preflight. route additionally needs deployment allowRouteOverride=true; no suffix role/tool or arbitrary effort is inferred. Layout/level never changes target/read-only/depth/ownership authority. A read-only planner returns complete Markdown for authorized coordinator persistence, never through file/shell writes or a child proxy.
|
|
4
4
|
One-shot defaults foreground and is never revived after settlement. When enabled and admitted, native jobs own one-shot background; a managed continuable configuration defaults background and returns a durable child ID, while explicit run_in_background:false starts a non-reusable one-shot. Existing continuable children use actual exposed send_message for running/idle/same-ID cold delivery and actual native user queue/steer; acceptance is not completion. Original child route/locale/authority remains captured and intersects current exact-parent authority, not parent-new-policy inheritance. Legacy conservative evidence permits useful proven capabilities and denies missing-evidence capabilities with reasons. A foreground handoff, only through an actually wired user control, moves the existing run to native-job ownership without another start; no static text declares a new tool or RPC. Managed delivery requires disabling the stock subagents row and binding the unique PUBLIC DSMM SubagentRuntime subclass at explicit startup, then restart. Stock cannot be hot-replaced. Background/capacity/depth/ownership/cancellation remain mandatory. Native continuation is not task_id/resume/retry.
|
|
5
5
|
The native main model picker, explicit user route and catalog are authoritative. Model guidance calibrates behavior only; it does not select a provider/model, grant permissions, declare external independence or change advertised effort. Oracle independence requires a different model was explicitly selected and verified in the actual route. Default inventory has no synthetic tiers or additional Oracle slots.
|
|
6
|
-
Follow the current user's explicit visible-output language request, then this Agent's immutable captured locale when supplied, then applicable host/user language guidance or current request/context. All DSMM roles/categories follow this priority even with common mode off. Preserve identifiers, code, paths, commands, protocol fields and exact quotes; child assignments retain explicit language requests. This contract copies no Root locale/configuration, promises no internal reasoning language and changes neither host UI nor project locale.
|
|
7
6
|
Role persona and access remain when Deepwork is explicitly off; common workflow and DSMM skills do not. Git/install/login/destructive actions need exact authorization regardless of mode. All delegation guidance is intersected with enabled roles, mounted capabilities, inherited permissions and native depth; runtime policy enforces those ceilings, not these static texts.
|
|
8
7
|
</dsmm-host-contract>
|