scene-capability-engine 3.6.49 → 3.6.50

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 CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.6.50] - 2026-03-14
11
+
12
+ ### Changed
13
+ - Switched the SCE co-work baseline to default-on: multi-agent config defaults to `enabled=true`, `init/adopt/takeover` now provision `.sce/config/multi-agent.json`, and adoption metadata defaults `multiUserMode` to true while keeping the central coordinator opt-in.
14
+ - Added `scripts/collab-governance-gate.js` and a shared collaboration-governance gate helper so co-work governance can run as a reusable push/publish preflight instead of remaining a report-only audit.
15
+ - Updated `sce timeline push` to fail fast on collaboration governance drift before creating a push checkpoint or executing `git push`, ensuring managed push flow respects `.gitignore` collaboration boundaries, runtime-state tracking hygiene, multi-agent config validity, legacy naming cleanup, and steering boundary rules.
16
+ - Wired `gate:collab-governance` into `prepublishOnly` so npm publish now enforces the same co-work governance baseline as managed push.
17
+
10
18
  ## [3.6.49] - 2026-03-14
11
19
 
12
20
  ### Changed
package/README.md CHANGED
@@ -142,6 +142,7 @@ SCE is opinionated by default.
142
142
  - When business scene/module/page/entity context is missing, SCE must route to clarification first; unknown business scope must not be turned into blanket disable.
143
143
  - `verify` and `release` enforce problem-closure and related gates when a spec is bound.
144
144
  - Autonomous program execution applies gate evaluation, fallback-chain logic, governance replay, and auto-remediation.
145
+ - Co-work baseline is enabled by default: initialized/adopted SCE projects provision `.sce/config/multi-agent.json` with `enabled=true`, while the central coordinator stays opt-in.
145
146
  - State persistence prefers SQLite, not ad hoc local caches.
146
147
  - Oversized source files must trigger periodic refactor assessment; SCE recommends project-specific thresholds, with `2000 / 4000 / 10000` as the default source-file fallback.
147
148
  - Release validation defaults to integration test coverage via `npm run test:release` for faster publish feedback.
@@ -217,5 +218,5 @@ MIT. See [LICENSE](LICENSE).
217
218
 
218
219
  ---
219
220
 
220
- **Version**: 3.6.49
221
+ **Version**: 3.6.50
221
222
  **Last Updated**: 2026-03-14
package/README.zh.md CHANGED
@@ -147,6 +147,7 @@ SCE 默认是强治理的。
147
147
  - 缺少业务场景/模块/页面/实体上下文时,SCE 必须先进入澄清,而不是把未知业务范围直接变成一刀切禁用
148
148
  - 当 spec 绑定时,`verify` 和 `release` 默认执行 problem-closure 等相关门禁
149
149
  - `close-loop-program` 默认带 gate 评估、fallback-chain、governance replay、auto-remediation
150
+ - co-work 基线默认开启:初始化或接管后的 SCE 项目会落地 `.sce/config/multi-agent.json` 且 `enabled=true`,但中央 coordinator 仍保持按需开启
150
151
  - 状态持久化默认优先走 SQLite,而不是零散本地缓存
151
152
  - 超大源文件必须定期触发重构评估;SCE 优先建议按项目给出阈值,若项目尚未设定,则默认参考 `2000 / 4000 / 10000`
152
153
  - 发布默认验证走 integration gate:`npm run test:release`
@@ -222,5 +223,5 @@ MIT,见 [LICENSE](LICENSE)。
222
223
 
223
224
  ---
224
225
 
225
- **版本**:3.6.49
226
+ **版本**:3.6.50
226
227
  **最后更新**:2026-03-14
@@ -2,8 +2,8 @@
2
2
 
3
3
  > Quick reference for all `sce` commands
4
4
 
5
- **Version**: 3.6.34
6
- **Last Updated**: 2026-03-08
5
+ **Version**: 3.6.50
6
+ **Last Updated**: 2026-03-14
7
7
 
8
8
  ---
9
9
 
@@ -127,7 +127,7 @@ sce timeline restore <snapshot-id> --prune --json
127
127
  # Update timeline policy
128
128
  sce timeline config --enabled true --interval 30 --max-entries 120 --json
129
129
 
130
- # Push with pre-push snapshot
130
+ # Push with co-work governance gate + pre-push snapshot
131
131
  sce timeline push origin main
132
132
  ```
133
133
 
@@ -135,6 +135,7 @@ Timeline policy:
135
135
  - default enabled with local retention under `.sce/timeline/snapshots/`
136
136
  - stage/key-event checkpoints are automatically captured for `studio` and `session` commands
137
137
  - interval auto-checkpoints are integrated in the same flow via timeline checkpoint capture
138
+ - `timeline push` now blocks before snapshot/push when collaboration governance drifts, so tracked runtime state, missing co-work ignore rules, legacy `.kiro*` references, invalid multi-agent config, or steering boundary drift cannot pass through managed push flow
138
139
 
139
140
  ### Value Metrics
140
141
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  > Enable multiple AI agents to work on the same sce project simultaneously without conflicts.
4
4
 
5
- **Version**: 1.44.0
6
- **Last Updated**: 2026-02-12
5
+ **Version**: 3.6.50
6
+ **Last Updated**: 2026-03-14
7
7
 
8
8
  ---
9
9
 
@@ -25,31 +25,31 @@ The Multi-Agent Parallel Coordination system solves this with six layers of prot
25
25
  10. **Spec Lifecycle Manager** — Spec state machine and auto-completion (v1.44.0)
26
26
  11. **Sync Barrier** — Agent Spec-switch synchronization (v1.44.0)
27
27
 
28
- All components are **zero overhead in single-agent mode** they become no-ops when multi-agent mode is not enabled.
28
+ SCE provisions the co-work baseline by default. If a project explicitly sets `enabled: false`, all components fall back to single-agent no-op behavior.
29
29
 
30
30
  ---
31
31
 
32
32
  ## Quick Start
33
33
 
34
- ### 1. Enable Multi-Agent Mode
34
+ ### 1. Review Multi-Agent Mode Baseline
35
35
 
36
- Create the configuration file `.sce/config/multi-agent.json`:
36
+ SCE provisions `.sce/config/multi-agent.json` by default:
37
37
 
38
38
  ```json
39
39
  {
40
40
  "enabled": true,
41
- "coordinator": false,
42
- "heartbeatIntervalMs": 30000,
43
- "heartbeatTimeoutMs": 120000
41
+ "coordinatorEnabled": false,
42
+ "heartbeatIntervalMs": 60000,
43
+ "heartbeatTimeoutMs": 180000
44
44
  }
45
45
  ```
46
46
 
47
47
  | Field | Description | Default |
48
48
  |-------|-------------|---------|
49
- | `enabled` | Enable multi-agent coordination | `false` |
50
- | `coordinator` | Enable central task assignment | `false` |
51
- | `heartbeatIntervalMs` | Heartbeat interval in ms | `30000` |
52
- | `heartbeatTimeoutMs` | Agent considered inactive after this | `120000` |
49
+ | `enabled` | Enable multi-agent coordination | `true` |
50
+ | `coordinatorEnabled` | Enable central task assignment | `false` |
51
+ | `heartbeatIntervalMs` | Heartbeat interval in ms | `60000` |
52
+ | `heartbeatTimeoutMs` | Agent considered inactive after this | `180000` |
53
53
 
54
54
  ### 2. Each Agent Registers Itself
55
55
 
@@ -504,9 +504,9 @@ All components check `MultiAgentConfig.isEnabled()` before doing anything:
504
504
  ```json
505
505
  {
506
506
  "enabled": true,
507
- "coordinator": false,
508
- "heartbeatIntervalMs": 30000,
509
- "heartbeatTimeoutMs": 120000
507
+ "coordinatorEnabled": false,
508
+ "heartbeatIntervalMs": 60000,
509
+ "heartbeatTimeoutMs": 180000
510
510
  }
511
511
  ```
512
512
 
@@ -0,0 +1,21 @@
1
+ # v3.6.50 Release Notes
2
+
3
+ Release date: 2026-03-14
4
+
5
+ ## Highlights
6
+
7
+ - Switched the SCE co-work baseline to default-on: initialized/adopted/takeover-aligned projects now provision `.sce/config/multi-agent.json` with `enabled=true`, while the central coordinator remains opt-in.
8
+ - Added a reusable `collab-governance-gate` and wired it into both `sce timeline push` and `prepublishOnly`, so managed push/publish flow now blocks on co-work governance drift instead of relying on report-only auditing.
9
+ - Synced template/runtime release metadata and multi-agent guidance so shipped documentation reflects the new default co-work baseline and the current package version.
10
+
11
+ ## Validation
12
+
13
+ - `npx jest tests/unit/scripts/collab-governance-gate.test.js tests/unit/commands/timeline.test.js --runInBand`
14
+ - `npx jest tests/unit/collab/multi-agent-config.test.js tests/unit/workspace/takeover-baseline.test.js tests/integration/takeover-baseline-cli.integration.test.js --runInBand`
15
+ - `node scripts/collab-governance-gate.js --json`
16
+ - `npm run prepublishOnly`
17
+
18
+ ## Release Notes
19
+
20
+ - This patch closes the gap where SCE had co-work governance rules and auditing, but initialized/adopted projects still defaulted to a disabled multi-agent baseline.
21
+ - Managed push and publish now share the same co-work governance gate, which prevents collaboration boundary drift from slipping through one path while being caught by another.
@@ -102,7 +102,7 @@ Your steering strategy choice is saved in `.sce/adoption-config.json`:
102
102
  "adoptedAt": "2026-01-23T10:00:00.000Z",
103
103
  "steeringStrategy": "use-sce",
104
104
  "steeringBackupId": "steering-2026-01-23T10-00-00-000Z",
105
- "multiUserMode": false,
105
+ "multiUserMode": true,
106
106
  "lastUpdated": "2026-01-23T10:00:00.000Z"
107
107
  }
108
108
  ```
@@ -0,0 +1,21 @@
1
+ # v3.6.50 发布说明
2
+
3
+ 发布日期:2026-03-14
4
+
5
+ ## 重点变化
6
+
7
+ - 将 SCE 的 co-work 基线切换为默认开启:`init` / `adopt` / `takeover` 对齐后的项目现在都会落地 `.sce/config/multi-agent.json` 且 `enabled=true`,中央 coordinator 仍保持按需开启。
8
+ - 新增可复用的 `collab-governance-gate`,并接入 `sce timeline push` 与 `prepublishOnly`,让托管 push / publish 在 co-work 治理漂移时直接阻断,而不是只做报告型审计。
9
+ - 同步更新模板、运行时说明和版本元数据,确保发出的文档与默认 co-work 基线、当前包版本保持一致。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/scripts/collab-governance-gate.test.js tests/unit/commands/timeline.test.js --runInBand`
14
+ - `npx jest tests/unit/collab/multi-agent-config.test.js tests/unit/workspace/takeover-baseline.test.js tests/integration/takeover-baseline-cli.integration.test.js --runInBand`
15
+ - `node scripts/collab-governance-gate.js --json`
16
+ - `npm run prepublishOnly`
17
+
18
+ ## 发布说明
19
+
20
+ - 这个补丁版补齐了一个关键缺口:SCE 虽然已经具备 co-work 治理规则和审计能力,但此前新接入项目默认仍可能落在关闭态。
21
+ - 现在托管 push 与 publish 共用同一条 co-work governance gate,避免一条链路能放过的协作治理漂移,在另一条链路才被发现。
@@ -2,8 +2,8 @@
2
2
  * Multi-Agent Configuration Manager
3
3
  *
4
4
  * Manages `.sce/config/multi-agent.json` for multi-Agent parallel coordination.
5
- * When the config file does not exist or is corrupted, returns a default
6
- * disabled configuration so that single-Agent mode is completely unaffected.
5
+ * Co-work baseline is enabled by default for SCE-managed projects; a project
6
+ * can still opt out explicitly by setting `enabled: false`.
7
7
  *
8
8
  * Requirements: 7.1 (no extra files when disabled), 7.4 (auto-init on first enable)
9
9
  */
@@ -16,7 +16,7 @@ const CONFIG_DIR = '.sce/config';
16
16
 
17
17
  /** @type {import('./multi-agent-config').MultiAgentConfigData} */
18
18
  const DEFAULT_CONFIG = Object.freeze({
19
- enabled: false,
19
+ enabled: true,
20
20
  heartbeatIntervalMs: 60000,
21
21
  heartbeatTimeoutMs: 180000,
22
22
  coordinatorEnabled: false,
@@ -36,7 +36,7 @@ class MultiAgentConfig {
36
36
 
37
37
  /**
38
38
  * Read the current configuration.
39
- * Returns the default (disabled) config when the file is missing or corrupted.
39
+ * Returns the default config when the file is missing or corrupted.
40
40
  *
41
41
  * @returns {Promise<object>} Resolved configuration
42
42
  */
@@ -5,6 +5,10 @@ const {
5
5
  ProjectTimelineStore,
6
6
  captureTimelineCheckpoint
7
7
  } = require('../runtime/project-timeline');
8
+ const {
9
+ evaluateCollabGovernanceGate,
10
+ formatCollabGovernanceGateBlockMessage
11
+ } = require('../workspace/collab-governance-gate');
8
12
  const {
9
13
  summarizeTimelineAttention,
10
14
  buildTimelineEntryViewModel,
@@ -172,8 +176,21 @@ async function runTimelineConfigCommand(options = {}, dependencies = {}) {
172
176
 
173
177
  async function runTimelinePushCommand(gitArgs = [], options = {}, dependencies = {}) {
174
178
  const projectPath = dependencies.projectPath || process.cwd();
179
+ const collabGovernanceGate = dependencies.evaluateCollabGovernanceGate || evaluateCollabGovernanceGate;
180
+ const checkpointRunner = dependencies.captureTimelineCheckpoint || captureTimelineCheckpoint;
181
+ const runGitPush = dependencies.spawnSync || spawnSync;
182
+
183
+ const gatePayload = await collabGovernanceGate({
184
+ projectPath
185
+ }, dependencies);
186
+ if (!gatePayload.passed) {
187
+ const error = new Error(formatCollabGovernanceGateBlockMessage(gatePayload));
188
+ error.exitCode = 2;
189
+ error.gate = gatePayload;
190
+ throw error;
191
+ }
175
192
 
176
- const checkpoint = await captureTimelineCheckpoint({
193
+ const checkpoint = await checkpointRunner({
177
194
  trigger: 'push',
178
195
  event: 'git.push.preflight',
179
196
  summary: normalizeText(options.summary) || 'pre-push timeline checkpoint',
@@ -183,7 +200,7 @@ async function runTimelinePushCommand(gitArgs = [], options = {}, dependencies =
183
200
  fileSystem: dependencies.fileSystem
184
201
  });
185
202
 
186
- const result = spawnSync('git', ['push', ...(Array.isArray(gitArgs) ? gitArgs : [])], {
203
+ const result = runGitPush('git', ['push', ...(Array.isArray(gitArgs) ? gitArgs : [])], {
187
204
  cwd: projectPath,
188
205
  stdio: 'inherit',
189
206
  windowsHide: true
@@ -277,7 +294,7 @@ function registerTimelineCommands(program) {
277
294
 
278
295
  timeline
279
296
  .command('push [gitArgs...]')
280
- .description('Create a pre-push timeline snapshot, then run git push')
297
+ .description('Run collaboration governance gate, create a pre-push timeline snapshot, then run git push')
281
298
  .option('--summary <text>', 'Summary for pre-push checkpoint')
282
299
  .option('--json', 'Output as JSON')
283
300
  .action(async (gitArgs, options) => safeRun(runTimelinePushCommand, options, gitArgs));
@@ -73,7 +73,7 @@ class AdoptionConfig {
73
73
  config = {
74
74
  version: '1.0.0',
75
75
  adoptedAt: new Date().toISOString(),
76
- multiUserMode: false
76
+ multiUserMode: true
77
77
  };
78
78
  }
79
79
 
@@ -139,7 +139,7 @@ class AdoptionConfig {
139
139
  */
140
140
  async isMultiUserMode() {
141
141
  const config = await this.read();
142
- return config ? (config.multiUserMode || false) : false;
142
+ return config ? (typeof config.multiUserMode === 'boolean' ? config.multiUserMode : true) : true;
143
143
  }
144
144
 
145
145
  /**
@@ -153,7 +153,7 @@ class AdoptionConfig {
153
153
  version: '1.0.0',
154
154
  adoptedAt: new Date().toISOString(),
155
155
  steeringStrategy: options.steeringStrategy || 'use-sce',
156
- multiUserMode: options.multiUserMode || false,
156
+ multiUserMode: typeof options.multiUserMode === 'boolean' ? options.multiUserMode : true,
157
157
  ...options
158
158
  };
159
159
 
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ const { auditCollabGovernance } = require('./collab-governance-audit');
4
+
5
+ async function evaluateCollabGovernanceGate(options = {}, dependencies = {}) {
6
+ const projectPath = options.projectPath || dependencies.projectPath || process.cwd();
7
+ const audit = await (dependencies.auditCollabGovernance || auditCollabGovernance)(
8
+ projectPath,
9
+ options,
10
+ dependencies
11
+ );
12
+
13
+ return {
14
+ mode: 'collab-governance-gate',
15
+ project_path: projectPath,
16
+ passed: audit.passed === true,
17
+ reason: audit.reason || (audit.passed === true ? 'passed' : 'violations'),
18
+ summary: audit.summary || {},
19
+ warnings: Array.isArray(audit.warnings) ? audit.warnings : [],
20
+ violations: Array.isArray(audit.violations) ? audit.violations : [],
21
+ audit
22
+ };
23
+ }
24
+
25
+ function formatCollabGovernanceGateBlockMessage(payload = {}, maxViolations = 3) {
26
+ const violations = Array.isArray(payload.violations) ? payload.violations.filter(Boolean) : [];
27
+ if (violations.length === 0) {
28
+ return 'collaboration governance gate blocked push';
29
+ }
30
+
31
+ const visibleViolations = violations.slice(0, Math.max(1, maxViolations));
32
+ const suffix = violations.length > visibleViolations.length
33
+ ? ` (+${violations.length - visibleViolations.length} more)`
34
+ : '';
35
+ return `collaboration governance gate blocked push: ${visibleViolations.join('; ')}${suffix}`;
36
+ }
37
+
38
+ async function runCollabGovernanceGate(options = {}, dependencies = {}) {
39
+ const payload = await evaluateCollabGovernanceGate(options, dependencies);
40
+
41
+ if (options.json) {
42
+ process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
43
+ } else if (payload.passed) {
44
+ process.stdout.write('[collab-governance-gate] passed\n');
45
+ process.stdout.write(
46
+ `[collab-governance-gate] missing-ignore-rules=${payload.summary.missing_gitignore_rules || 0} legacy-references=${payload.summary.legacy_reference_count || 0}\n`
47
+ );
48
+ } else {
49
+ process.stdout.write('[collab-governance-gate] blocked\n');
50
+ payload.violations.forEach((item) => {
51
+ process.stdout.write(`[collab-governance-gate] violation=${item}\n`);
52
+ });
53
+ }
54
+
55
+ return {
56
+ ...payload,
57
+ exit_code: options.failOnViolation && !payload.passed ? 2 : 0
58
+ };
59
+ }
60
+
61
+ module.exports = {
62
+ evaluateCollabGovernanceGate,
63
+ formatCollabGovernanceGateBlockMessage,
64
+ runCollabGovernanceGate
65
+ };
@@ -10,6 +10,9 @@ const {
10
10
  const {
11
11
  cloneStateStoragePolicyDefaults
12
12
  } = require('../state/state-storage-policy');
13
+ const {
14
+ DEFAULT_CONFIG: MULTI_AGENT_CONFIG_DEFAULTS
15
+ } = require('../collab/multi-agent-config');
13
16
 
14
17
  const TAKEOVER_BASELINE_SCHEMA_VERSION = '1.0';
15
18
  const CLARIFICATION_FIRST_CORE_PRINCIPLE_HEADING = '## 11. 业务场景未知时必须先澄清,禁止直接彻底禁用';
@@ -349,6 +352,10 @@ const TAKEOVER_DEFAULTS = Object.freeze({
349
352
  max_direct_fix_rounds_before_debug: 2,
350
353
  forbid_bypass_workarounds: true
351
354
  },
355
+ collaboration: {
356
+ multi_user_mode: true,
357
+ multi_agent: _clone(MULTI_AGENT_CONFIG_DEFAULTS)
358
+ },
352
359
  errorbook_convergence: _clone(ERRORBOOK_CONVERGENCE_DEFAULTS),
353
360
  migration_policy: {
354
361
  legacy_kiro_supported: false,
@@ -440,7 +447,7 @@ function _buildAdoptionConfig(existing, nowIso, sceVersion) {
440
447
  steeringStrategy: typeof base.steeringStrategy === 'string' && base.steeringStrategy.trim()
441
448
  ? base.steeringStrategy
442
449
  : 'use-sce',
443
- multiUserMode: base.multiUserMode === true,
450
+ multiUserMode: typeof base.multiUserMode === 'boolean' ? base.multiUserMode : true,
444
451
  runtimePolicy: {
445
452
  agent_parity_permissions: true,
446
453
  autonomous_default: true
@@ -456,6 +463,14 @@ function _buildAdoptionConfig(existing, nowIso, sceVersion) {
456
463
  };
457
464
  }
458
465
 
466
+ function _buildMultiAgentConfig(existing) {
467
+ const base = _isObject(existing) ? _clone(existing) : {};
468
+ return {
469
+ ..._clone(MULTI_AGENT_CONFIG_DEFAULTS),
470
+ ...base
471
+ };
472
+ }
473
+
459
474
  function _buildTakeoverBaselineConfig(existing, sceVersion) {
460
475
  const base = _isObject(existing) ? _clone(existing) : {};
461
476
  return {
@@ -749,6 +764,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
749
764
  const autoConfigPath = path.join(sceRoot, 'auto', 'config.json');
750
765
  const takeoverConfigPath = path.join(sceRoot, 'config', 'takeover-baseline.json');
751
766
  const errorbookRegistryPath = path.join(sceRoot, 'config', 'errorbook-registry.json');
767
+ const multiAgentConfigPath = path.join(sceRoot, 'config', 'multi-agent.json');
752
768
  const sessionGovernancePath = path.join(sceRoot, 'config', 'session-governance.json');
753
769
  const specDomainPolicyPath = path.join(sceRoot, 'config', 'spec-domain-policy.json');
754
770
  const problemEvalPolicyPath = path.join(sceRoot, 'config', 'problem-eval-policy.json');
@@ -762,6 +778,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
762
778
  const existingAuto = await _readJsonSafe(autoConfigPath, fileSystem);
763
779
  const existingTakeover = await _readJsonSafe(takeoverConfigPath, fileSystem);
764
780
  const existingErrorbookRegistry = await _readJsonSafe(errorbookRegistryPath, fileSystem);
781
+ const existingMultiAgentConfig = await _readJsonSafe(multiAgentConfigPath, fileSystem);
765
782
  const existingSessionGovernance = await _readJsonSafe(sessionGovernancePath, fileSystem);
766
783
  const existingSpecDomainPolicy = await _readJsonSafe(specDomainPolicyPath, fileSystem);
767
784
  const existingProblemEvalPolicy = await _readJsonSafe(problemEvalPolicyPath, fileSystem);
@@ -772,6 +789,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
772
789
  const desiredAutoConfig = _buildAutoConfig(existingAuto);
773
790
  const desiredTakeover = _buildTakeoverBaselineConfig(existingTakeover, sceVersion);
774
791
  const desiredErrorbookRegistry = _buildErrorbookRegistryConfig(existingErrorbookRegistry);
792
+ const desiredMultiAgentConfig = _buildMultiAgentConfig(existingMultiAgentConfig);
775
793
  const desiredSessionGovernance = _deepMerge(existingSessionGovernance || {}, SESSION_GOVERNANCE_DEFAULTS);
776
794
  const desiredSpecDomainPolicy = _deepMerge(existingSpecDomainPolicy || {}, SPEC_DOMAIN_POLICY_DEFAULTS);
777
795
  const desiredProblemEvalPolicy = _deepMerge(existingProblemEvalPolicy || {}, PROBLEM_EVAL_POLICY_DEFAULTS);
@@ -802,6 +820,11 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
802
820
  apply,
803
821
  fileSystem
804
822
  }));
823
+ fileResults.push(await _reconcileJsonFile(multiAgentConfigPath, desiredMultiAgentConfig, {
824
+ projectPath,
825
+ apply,
826
+ fileSystem
827
+ }));
805
828
  fileResults.push(await _reconcileJsonFile(sessionGovernancePath, desiredSessionGovernance, {
806
829
  projectPath,
807
830
  apply,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.6.49",
3
+ "version": "3.6.50",
4
4
  "description": "SCE (Scene Capability Engine) - A CLI tool and npm package for spec-driven development with AI coding assistants.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -44,11 +44,13 @@
44
44
  "audit:refactor-trigger": "node scripts/refactor-trigger-audit.js",
45
45
  "audit:steering": "node scripts/steering-content-audit.js --fail-on-error",
46
46
  "audit:clarification-first": "node scripts/clarification-first-audit.js --fail-on-violation",
47
+ "gate:collab-governance": "node scripts/collab-governance-gate.js --fail-on-violation",
47
48
  "audit:state-storage": "node scripts/state-storage-tiering-audit.js",
48
49
  "report:release-docs": "node scripts/release-doc-version-audit.js --json",
49
50
  "report:refactor-trigger": "node scripts/refactor-trigger-audit.js --json",
50
51
  "report:steering-audit": "node scripts/steering-content-audit.js --json",
51
52
  "report:clarification-first-audit": "node scripts/clarification-first-audit.js --json",
53
+ "report:collab-governance": "node scripts/collab-governance-gate.js --json",
52
54
  "report:state-storage": "node scripts/state-storage-tiering-audit.js --json",
53
55
  "report:interactive-approval-projection": "node scripts/interactive-approval-event-projection.js --action doctor --json",
54
56
  "audit:interactive-approval-projection": "node scripts/interactive-approval-event-projection.js --action doctor --fail-on-drift --fail-on-parse-error",
@@ -90,7 +92,7 @@
90
92
  "gate:release-asset-integrity": "node scripts/release-asset-integrity-check.js",
91
93
  "report:release-risk-remediation": "node scripts/release-risk-remediation-bundle.js --json",
92
94
  "report:moqui-core-regression": "node scripts/moqui-core-regression-suite.js --json",
93
- "prepublishOnly": "npm run test:release && npm run test:skip-audit && npm run test:sce-tracking && npm run gate:npm-runtime-assets && npm run test:brand-consistency && npm run audit:release-docs && npm run audit:steering && npm run audit:clarification-first && npm run gate:git-managed && npm run gate:errorbook-registry-health && npm run gate:errorbook-release && npm run report:interactive-governance -- --fail-on-alert",
95
+ "prepublishOnly": "npm run test:release && npm run test:skip-audit && npm run test:sce-tracking && npm run gate:npm-runtime-assets && npm run test:brand-consistency && npm run audit:release-docs && npm run audit:steering && npm run audit:clarification-first && npm run gate:collab-governance && npm run gate:git-managed && npm run gate:errorbook-registry-health && npm run gate:errorbook-release && npm run report:interactive-governance -- --fail-on-alert",
94
96
  "publish:manual": "npm publish --access public",
95
97
  "install-global": "npm install -g .",
96
98
  "uninstall-global": "npm uninstall -g scene-capability-engine"
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('path');
5
+ const { runCollabGovernanceGate } = require('../lib/workspace/collab-governance-gate');
6
+
7
+ function parseArgs(argv = []) {
8
+ const options = {
9
+ projectPath: process.cwd(),
10
+ failOnViolation: false,
11
+ json: false,
12
+ help: false
13
+ };
14
+
15
+ for (let index = 0; index < argv.length; index += 1) {
16
+ const token = argv[index];
17
+ const next = argv[index + 1];
18
+
19
+ if (token === '--project-path' && next) {
20
+ options.projectPath = path.resolve(next);
21
+ index += 1;
22
+ } else if (token === '--fail-on-violation') {
23
+ options.failOnViolation = true;
24
+ } else if (token === '--json') {
25
+ options.json = true;
26
+ } else if (token === '--help' || token === '-h') {
27
+ options.help = true;
28
+ }
29
+ }
30
+
31
+ return options;
32
+ }
33
+
34
+ function printHelp() {
35
+ const lines = [
36
+ 'Usage: node scripts/collab-governance-gate.js [options]',
37
+ '',
38
+ 'Options:',
39
+ ' --project-path <path> Project path (default: cwd)',
40
+ ' --fail-on-violation Exit with code 2 when violations exist',
41
+ ' --json Print JSON payload',
42
+ ' -h, --help Show help'
43
+ ];
44
+ process.stdout.write(`${lines.join('\n')}\n`);
45
+ }
46
+
47
+ if (require.main === module) {
48
+ const options = parseArgs(process.argv.slice(2));
49
+ if (options.help) {
50
+ printHelp();
51
+ process.exit(0);
52
+ }
53
+
54
+ runCollabGovernanceGate(options)
55
+ .then((result) => {
56
+ process.exitCode = result.exit_code;
57
+ })
58
+ .catch((error) => {
59
+ const payload = {
60
+ mode: 'collab-governance-gate',
61
+ passed: false,
62
+ error: error.message
63
+ };
64
+ if (options.json) {
65
+ process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
66
+ } else {
67
+ process.stderr.write(`[collab-governance-gate] error=${error.message}\n`);
68
+ }
69
+ process.exitCode = 1;
70
+ });
71
+ }
72
+
73
+ module.exports = {
74
+ parseArgs,
75
+ runCollabGovernanceGate
76
+ };
@@ -71,8 +71,8 @@ When multiple AI agents work on the same project simultaneously:
71
71
  - **SteeringFileLock** (`lib/lock`) — Steering file write serialization
72
72
  - **MergeCoordinator** (`lib/collab`) — Git branch isolation per agent
73
73
  - **Coordinator** (`lib/collab`) — Central task assignment (optional)
74
- - Config: `.sce/config/multi-agent.json` (`enabled: true` to activate)
75
- - All components are no-ops in single-agent mode (zero overhead)
74
+ - Config: `.sce/config/multi-agent.json` (default `enabled: true`; set `enabled: false` to opt out)
75
+ - If a project opts out with `enabled: false`, all components fall back to single-agent no-op behavior
76
76
  - See `docs/multi-agent-coordination-guide.md` for full API reference
77
77
 
78
78
  ### Spec-Level Steering & Context Sync
@@ -83,7 +83,7 @@ Fourth steering layer (L4) and Spec lifecycle coordination for multi-agent scena
83
83
  - **SpecLifecycleManager** (`lib/collab`) — Spec state machine (planned → assigned → in-progress → completed → released) with auto-completion detection
84
84
  - **SyncBarrier** (`lib/collab`) — Agent Spec-switch synchronization barrier (uncommitted changes check, steering reload)
85
85
  - **Coordinator Integration** — `completeTask` auto-checks Spec completion; `assignTask` runs SyncBarrier
86
- - All components are no-ops in single-agent mode (zero overhead)
86
+ - If needed, a project can still opt out by setting `enabled: false`, which restores single-agent no-op behavior
87
87
  - See `docs/multi-agent-coordination-guide.md` for full API reference
88
88
 
89
89
  ### Autonomous Control
@@ -151,7 +151,7 @@ Look in .sce/specs/ directory
151
151
 
152
152
  ### When Working in Multi-Agent Mode
153
153
 
154
- If `.sce/config/multi-agent.json` exists with `enabled: true`:
154
+ By default `.sce/config/multi-agent.json` is provisioned with `enabled: true`:
155
155
  1. Register with AgentRegistry before starting work
156
156
  2. Acquire task locks before modifying any task
157
157
  3. Use TaskStatusStore for concurrent-safe tasks.md updates
@@ -243,6 +243,6 @@ A Spec is a complete feature definition with three parts:
243
243
  ---
244
244
 
245
245
  **Project Type**: Spec-driven development
246
- **sce Version**: 3.6.49
246
+ **sce Version**: 3.6.50
247
247
  **Last Updated**: 2026-03-14
248
248
  **Purpose**: Guide AI tools to work effectively with this project
@@ -0,0 +1,8 @@
1
+ {
2
+ "enabled": true,
3
+ "heartbeatIntervalMs": 60000,
4
+ "heartbeatTimeoutMs": 180000,
5
+ "coordinatorEnabled": false,
6
+ "maxRetries": 5,
7
+ "retryBaseDelayMs": 100
8
+ }
@@ -112,6 +112,17 @@
112
112
  "max_direct_fix_rounds_before_debug": 2,
113
113
  "forbid_bypass_workarounds": true
114
114
  },
115
+ "collaboration": {
116
+ "multi_user_mode": true,
117
+ "multi_agent": {
118
+ "enabled": true,
119
+ "heartbeatIntervalMs": 60000,
120
+ "heartbeatTimeoutMs": 180000,
121
+ "coordinatorEnabled": false,
122
+ "maxRetries": 5,
123
+ "retryBaseDelayMs": 100
124
+ }
125
+ },
115
126
  "migration_policy": {
116
127
  "legacy_kiro_supported": false,
117
128
  "require_manual_legacy_migration_confirmation": true