chore(config): declare WORKFLOW_SCOPE_MODE with a strict default

The flag reaches all three compose app services and the sysadmin catalog, and unknown values stay on the existing hard block.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-21 09:26:03 +00:00
co-authored by Cursor
parent 4af4a9de13
commit 8b84ee4ecf
7 changed files with 17 additions and 0 deletions
+2
View File
@@ -38,6 +38,7 @@ import (
"chat-agent-system/internal/taskrun"
"chat-agent-system/internal/traceimpact"
"chat-agent-system/internal/workflowdef"
"chat-agent-system/internal/workflowscope"
"chat-agent-system/internal/workspace"
"github.com/jackc/pgx/v5/pgxpool"
@@ -324,6 +325,7 @@ func sysadminFeatureValues(cfg *config.Config) func() map[string]string {
"MULTI_INTENT_U10_MUTATE": strconv.FormatBool(pflags.U10Mutate),
"MULTI_INTENT_U11_DOCGOV": strconv.FormatBool(pflags.U11DocGov),
"MULTI_INTENT_U12_RUN_CONTROL": strconv.FormatBool(pflags.U12RunControl),
"WORKFLOW_SCOPE_MODE": string(workflowscope.CurrentMode()),
"SEMANTIC_SUMMARY_SHADOW": strconv.FormatBool(sflags.Shadow),
"SEMANTIC_SUMMARY_REPLACE": strconv.FormatBool(sflags.Replace),
"PI_CHANGE_REPORT_NARRATIVE": strconv.FormatBool(docrevision.PIChangeReportNarrativeEnabled()),
@@ -77,6 +77,15 @@ func TestComposeAppDeclaresSemanticSummaryAndNarrativeShadowFlags(t *testing.T)
}
}
func TestComposeAppDeclaresWorkflowScopeMode(t *testing.T) {
for _, name := range composeFilesForFlagCheck {
block := serviceBlockText(t, readComposeFile(t, name), "app")
if !strings.Contains(block, "WORKFLOW_SCOPE_MODE: ${WORKFLOW_SCOPE_MODE:-strict}") {
t.Errorf("%s: app service must declare WORKFLOW_SCOPE_MODE with strict default", name)
}
}
}
// E-6: main must explicitly disable demo-user seeding at the compose layer
// (defense in depth; internal/auth/bootstrap.go already gates on cfg.Env=="main").
func TestComposeMainSeedDemoUsersExplicitFalse(t *testing.T) {
+1
View File
@@ -113,6 +113,7 @@ var featureCatalog = []featureSpec{
{key: "MULTI_INTENT_U10_MUTATE", label: "U10 变更适配器", group: "intentflow", fallback: "false", description: "低/中风险 mutate 动作适配器"},
{key: "MULTI_INTENT_U11_DOCGOV", label: "U11 文档治理适配器", group: "intentflow", fallback: "false", description: "docgov 动作适配器"},
{key: "MULTI_INTENT_U12_RUN_CONTROL", label: "U12 运行控制适配器", group: "intentflow", fallback: "false", description: "workflow/run-control 动作适配器"},
{key: "WORKFLOW_SCOPE_MODE", label: "工作流作用域裁决", group: "intent", fallback: "strict", description: "文档命中裁决:strict 命中他流即拦截;weighted 按工作流关系权重打分"},
{key: "SEMANTIC_SUMMARY_SHADOW", label: "语义摘要影子", group: "ctxmgr", fallback: "false", description: "上下文语义摘要影子生成"},
{key: "SEMANTIC_SUMMARY_REPLACE", label: "语义摘要替换", group: "ctxmgr", fallback: "false", description: "语义摘要替换确定性叙事(保留位,未接线)"},
{key: "PI_CHANGE_REPORT_NARRATIVE", label: "PI 变更报告叙事", group: "docrevision", fallback: "false", description: "变更报告 PI 叙事增强;默认仅确定性回退"},