dsh-chief 1.6.0 → 1.7.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/chief-executor.js CHANGED
@@ -521,6 +521,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
521
521
  const rootId = String(execCtx.rootId || '')
522
522
  const board = execCtx.board || {}
523
523
  const readOnlyToolsOnly = Boolean(execCtx.readOnlyToolsOnly)
524
+ const safetyGuardEnabled = execCtx.safetyGuardEnabled !== false
524
525
  const approvedOnce = Boolean(execCtx.approvedOnce)
525
526
  const capabilityScope = execCtx.capabilityScope || null
526
527
 
@@ -563,7 +564,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
563
564
  const resolvedAbsTarget = rawTargetPath ? path.resolve(cwd, rawTargetPath) : ''
564
565
  const rawCommand = tool === 'run_command' ? String(args.command || args.cmd || '').trim() : ''
565
566
 
566
- // Stage 3: 安全卫兵硬性规则(优先于任何权限等级、策略插件与逐项批准)
567
+ // Stage 3: 安全卫兵硬性规则(优先于任何权限等级、策略插件与逐项批准;受人类可控 safetyGuardEnabled 开关控制)
567
568
  const guardRes = evaluateSafetyGuardHardRules({
568
569
  tool,
569
570
  opClass,
@@ -572,6 +573,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
572
573
  args,
573
574
  cwd,
574
575
  board,
576
+ safetyGuardEnabled,
575
577
  })
576
578
  if (guardRes.blocked) {
577
579
  writeAudit({
@@ -1093,6 +1095,7 @@ export async function runChiefAgenticLoop(deps, {
1093
1095
  board = null,
1094
1096
  maxSteps = 4,
1095
1097
  readOnlyToolsOnly = false,
1098
+ safetyGuardEnabled = true,
1096
1099
  disableTools = false,
1097
1100
  lazyDeferWorkspaceWritesToLead = false,
1098
1101
  callLlmFn,
@@ -1182,6 +1185,7 @@ export async function runChiefAgenticLoop(deps, {
1182
1185
  args: (c && c.args && typeof c.args === 'object') ? c.args : {},
1183
1186
  cwd,
1184
1187
  board,
1188
+ safetyGuardEnabled,
1185
1189
  })
1186
1190
  if (!preDef || preDef.decision !== 'deny') {
1187
1191
  if (typeof recordAuditFn === 'function') {
@@ -1222,6 +1226,7 @@ export async function runChiefAgenticLoop(deps, {
1222
1226
  policyPlugins,
1223
1227
  board,
1224
1228
  readOnlyToolsOnly,
1229
+ safetyGuardEnabled,
1225
1230
  upsertArchiveFn,
1226
1231
  compactNowFn,
1227
1232
  queueApprovalFn,