scene-capability-engine 3.6.39 → 3.6.44

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/bin/scene-capability-engine.js +42 -2
  3. package/docs/developer-guide.md +1 -1
  4. package/docs/releases/README.md +5 -0
  5. package/docs/releases/v3.6.40.md +19 -0
  6. package/docs/releases/v3.6.41.md +20 -0
  7. package/docs/releases/v3.6.42.md +19 -0
  8. package/docs/releases/v3.6.43.md +17 -0
  9. package/docs/releases/v3.6.44.md +17 -0
  10. package/docs/spec-collaboration-guide.md +1 -1
  11. package/docs/zh/releases/README.md +5 -0
  12. package/docs/zh/releases/v3.6.40.md +19 -0
  13. package/docs/zh/releases/v3.6.41.md +20 -0
  14. package/docs/zh/releases/v3.6.42.md +19 -0
  15. package/docs/zh/releases/v3.6.43.md +17 -0
  16. package/docs/zh/releases/v3.6.44.md +17 -0
  17. package/lib/adoption/adoption-logger.js +1 -1
  18. package/lib/adoption/adoption-strategy.js +29 -29
  19. package/lib/adoption/detection-engine.js +16 -13
  20. package/lib/adoption/smart-orchestrator.js +3 -3
  21. package/lib/adoption/strategy-selector.js +19 -15
  22. package/lib/adoption/template-sync.js +3 -3
  23. package/lib/auto/autonomous-engine.js +5 -5
  24. package/lib/auto/handoff-release-gate-history-loaders-service.js +24 -4
  25. package/lib/auto/handoff-run-service.js +37 -0
  26. package/lib/backup/backup-system.js +10 -10
  27. package/lib/collab/collab-manager.js +8 -5
  28. package/lib/collab/dependency-manager.js +1 -1
  29. package/lib/commands/adopt.js +2 -2
  30. package/lib/commands/auto.js +239 -97
  31. package/lib/commands/collab.js +10 -4
  32. package/lib/commands/status.js +3 -3
  33. package/lib/commands/studio.js +8 -0
  34. package/lib/repo/config-manager.js +2 -2
  35. package/lib/spec/bootstrap/context-collector.js +5 -4
  36. package/lib/spec-gate/rules/default-rules.js +8 -8
  37. package/lib/upgrade/migration-engine.js +5 -5
  38. package/lib/upgrade/migrations/1.0.0-to-1.1.0.js +3 -3
  39. package/lib/utils/tool-detector.js +4 -4
  40. package/lib/utils/validation.js +6 -6
  41. package/lib/workspace/multi/workspace-context-resolver.js +3 -3
  42. package/lib/workspace/multi/workspace-registry.js +3 -3
  43. package/lib/workspace/multi/workspace-state-manager.js +3 -3
  44. package/lib/workspace/spec-delivery-audit.js +553 -0
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.6.44] - 2026-03-13
11
+
12
+ ### Fixed
13
+ - Fixed spec delivery sync auditing in GitHub tag-release workflows so detached `HEAD` checkouts no longer fail the hard gate for missing upstream tracking, while declared deliverable tracking and worktree integrity checks remain enforced.
14
+
15
+ ## [3.6.43] - 2026-03-13
16
+
17
+ ### Changed
18
+ - Tightened release-gate preflight blocking semantics so advisory drift alerts no longer hard-block release publish unless drift produced blocked runs.
19
+ - Updated the release workflow preflight step to print the captured preflight JSON when `sce auto handoff preflight-check --require-pass` fails, so future release failures expose the actual blocking reasons immediately.
20
+
21
+ ## [3.6.42] - 2026-03-13
22
+
23
+ ### Changed
24
+ - Hardened release-gate preflight loading so `sce auto handoff preflight-check` now falls back to the latest `release-gate-*.json` report when the history index is missing, empty, or temporarily unavailable during release execution.
25
+ - Improved release workflow diagnostics for `Build release gate history index` by capturing and surfacing the command stderr in release evidence artifacts instead of masking the underlying failure behind an empty summary.
26
+
27
+ ### Fixed
28
+ - Fixed release history loading so a single malformed release-gate report or seed entry is skipped with a warning instead of aborting the entire gate-index build.
29
+
30
+ ## [3.6.41] - 2026-03-13
31
+
32
+ ### Added
33
+ - Added targeted regression coverage in `tests/unit/collab/collab-manager.test.js` to lock the collaboration assignment metadata migration on `sceInstance` while preserving legacy read compatibility.
34
+
35
+ ### Changed
36
+ - Completed SCE takeover baseline alignment for the repository and committed the managed `.sce` baseline state used by takeover audit/apply flows.
37
+ - Migrated active runtime naming from legacy `kiro*` internals to `sce*` across backup, adoption, bootstrap, spec-gate, auto, repo-config, and CLI-init paths so the live codebase reflects SCE ownership consistently.
38
+ - Updated developer-facing docs and adoption tests to use `hasSceDir` / `sceInstance` as the canonical naming while preserving compatibility aliases where old project state may still exist.
39
+
40
+ ### Fixed
41
+ - Fixed collaboration assignment persistence so new metadata writes `sceInstance` instead of the stale `kiroInstance` field, while graph/status readers still accept older metadata written by previous versions.
42
+
43
+ ## [3.6.40] - 2026-03-13
44
+
45
+ ### Added
46
+ - Added spec delivery sync auditing via `lib/workspace/spec-delivery-audit.js` and the new `sce workspace delivery-audit` command so specs can declare required deliverables in `.sce/specs/<spec>/deliverables.json`.
47
+ - Added Spec `121-00-spec-delivery-sync-integrity-gate` with requirements, design, tasks, and a dogfooded delivery manifest to formalize this governance capability.
48
+ - Added unit/integration coverage for delivery-sync behavior across workspace CLI, handoff preflight/run orchestration, and studio release gating.
49
+
50
+ ### Changed
51
+ - Wired auto-handoff preflight and run precheck to evaluate declared spec deliverables against git tracking, worktree cleanliness, and upstream sync state.
52
+ - Extended studio release gating so spec delivery sync audit is now a required release-evidence step alongside the existing git/errorbook/handoff gates.
53
+ - Exported reusable git helper functions from `scripts/git-managed-gate.js` so higher-level workspace governance checks can share the same branch/upstream parsing logic.
54
+
10
55
  ## [3.6.39] - 2026-03-13
11
56
 
12
57
  ### Added
@@ -33,6 +33,7 @@ const {
33
33
  migrateLegacyKiroDirectories,
34
34
  } = require('../lib/workspace/legacy-kiro-migrator');
35
35
  const { auditSceTracking } = require('../lib/workspace/sce-tracking-audit');
36
+ const { auditSpecDeliverySync } = require('../lib/workspace/spec-delivery-audit');
36
37
  const { applyTakeoverBaseline } = require('../lib/workspace/takeover-baseline');
37
38
 
38
39
  const i18n = getI18n();
@@ -259,8 +260,8 @@ program
259
260
  }
260
261
 
261
262
  // 检查是否已存在 .sce 目录
262
- const kiroDir = path.join(process.cwd(), '.sce');
263
- if (fs.existsSync(kiroDir) && !options.force) {
263
+ const sceDir = path.join(process.cwd(), '.sce');
264
+ if (fs.existsSync(sceDir) && !options.force) {
264
265
  console.log(chalk.yellow(t('cli.commands.init.alreadyExists')));
265
266
  const { overwrite } = await inquirer.prompt([
266
267
  {
@@ -783,6 +784,45 @@ workspaceCmd
783
784
  console.log(chalk.gray(`Conflict files: ${report.conflict_files}`));
784
785
  });
785
786
 
787
+ workspaceCmd
788
+ .command('delivery-audit')
789
+ .description('Audit spec delivery manifests against git tracking and upstream sync state')
790
+ .option('--spec <name>', 'Audit one spec only')
791
+ .option('--require-manifest', 'Fail when no deliverables.json manifests are found')
792
+ .option('--json', 'Output in JSON format')
793
+ .option('--strict', 'Exit non-zero when delivery sync violations are found')
794
+ .action(async (options) => {
795
+ const report = await auditSpecDeliverySync(process.cwd(), {
796
+ spec: options.spec,
797
+ requireManifest: options.requireManifest === true
798
+ });
799
+
800
+ if (options.json) {
801
+ console.log(JSON.stringify(report, null, 2));
802
+ } else if (report.passed) {
803
+ if (report.reason === 'no-manifests') {
804
+ console.log(chalk.yellow('⚠ Spec delivery audit found no manifests.'));
805
+ } else {
806
+ console.log(chalk.green('✓ Spec delivery audit passed.'));
807
+ }
808
+ console.log(chalk.gray(`Manifest count: ${report.summary.manifest_count}`));
809
+ if (report.warnings.length > 0) {
810
+ report.warnings.forEach((item) => console.log(chalk.gray(` - ${item}`)));
811
+ }
812
+ } else {
813
+ console.log(chalk.red('✖ Spec delivery audit failed.'));
814
+ report.violations.forEach((item) => console.log(chalk.gray(` - ${item}`)));
815
+ if (report.warnings.length > 0) {
816
+ console.log(chalk.yellow('Warnings:'));
817
+ report.warnings.forEach((item) => console.log(chalk.gray(` - ${item}`)));
818
+ }
819
+ }
820
+
821
+ if (!report.passed && options.strict) {
822
+ process.exitCode = 1;
823
+ }
824
+ });
825
+
786
826
  workspaceCmd
787
827
  .command('tracking-audit')
788
828
  .description('Audit tracked .sce assets required for deterministic CI/release behavior')
@@ -424,7 +424,7 @@ Analyzes project structure and returns analysis result.
424
424
  {
425
425
  mode: 'fresh' | 'partial' | 'full',
426
426
  projectType: 'nodejs' | 'python' | 'mixed',
427
- hasKiroDir: boolean,
427
+ hasSceDir: boolean,
428
428
  hasSpecs: boolean,
429
429
  hasVersion: boolean,
430
430
  conflicts: string[],
@@ -9,6 +9,11 @@ This directory stores release-facing documents:
9
9
  ## Archived Versions
10
10
 
11
11
  - [Release checklist](../release-checklist.md)
12
+ - [v3.6.44 release notes](./v3.6.44.md)
13
+ - [v3.6.43 release notes](./v3.6.43.md)
14
+ - [v3.6.42 release notes](./v3.6.42.md)
15
+ - [v3.6.41 release notes](./v3.6.41.md)
16
+ - [v3.6.40 release notes](./v3.6.40.md)
12
17
  - [v3.6.39 release notes](./v3.6.39.md)
13
18
  - [v3.6.38 release notes](./v3.6.38.md)
14
19
  - [v3.6.37 release notes](./v3.6.37.md)
@@ -0,0 +1,19 @@
1
+ # v3.6.40 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Added spec delivery sync governance so each spec can declare its real deliverables and SCE can verify those files are tracked, committed, and upstream-synced before release or handoff.
8
+ - Added a dedicated `sce workspace delivery-audit` command and wired it into auto-handoff preflight/run plus studio release gates.
9
+ - Dogfooded the capability with a new `121-00-spec-delivery-sync-integrity-gate` spec and matching delivery manifest.
10
+
11
+ ## Verification
12
+
13
+ - `npx jest tests/unit/workspace/spec-delivery-audit.test.js tests/unit/commands/auto.test.js tests/unit/auto/handoff-run-service.test.js tests/unit/commands/studio.test.js tests/integration/workspace-delivery-audit-cli.integration.test.js --runInBand`
14
+
15
+ ## Release Notes
16
+
17
+ - Delivery sync is intentionally implemented as `manifest + audit + gate`, not as an automatic file copy/sync mechanism. Git remains the only source of truth.
18
+ - When manifests exist, blocking specs now fail if declared files are missing, untracked, dirty, or only local because the branch is ahead of upstream.
19
+ - When no delivery manifests exist yet, the audit remains advisory by default, so older repos are not hard-blocked until they opt into explicit deliverable governance.
@@ -0,0 +1,20 @@
1
+ # v3.6.41 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Completed a practical SCE takeover cleanup pass so the repo now aligns with the current takeover baseline and active code paths consistently use SCE naming.
8
+ - Fixed collaboration assignment metadata so new writes persist `sceInstance`, while older `kiroInstance` metadata remains readable for backward compatibility.
9
+ - Removed high-value legacy naming drift across active modules such as backup, adoption, bootstrap, spec gate, auto runtime, repo config, and CLI initialization without disturbing the intentional `.kiro` migration layer.
10
+
11
+ ## Verification
12
+
13
+ - `npx jest tests/unit/collab/collab-manager.test.js tests/unit/adoption/strategy-selector.test.js tests/unit/adoption/adoption-logger.test.js tests/unit/adoption.test.js --runInBand`
14
+ - `node bin/sce.js workspace takeover-audit --json`
15
+
16
+ ## Release Notes
17
+
18
+ - This release is intentionally a value-focused cleanup, not a blind repository-wide rename. Real legacy migration support for `.kiro` remains in place.
19
+ - Canonical runtime naming is now `hasSceDir` and `sceInstance`; compatibility aliases remain where existing project state or metadata may still depend on older keys.
20
+ - No `.kiro-workspaces` runtime artifact was present in the repository. The shipped work targets only active naming debt and one real collaboration metadata bug.
@@ -0,0 +1,19 @@
1
+ # v3.6.42 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Hardened handoff release preflight so release publishing can continue when `release-gate-history.json` is temporarily unavailable but the current `release-gate-*.json` report is present.
8
+ - Made release-gate history loading more fault-tolerant by skipping malformed report or seed entries with warnings instead of aborting the full index build.
9
+ - Improved release workflow diagnostics by persisting `gate-index` stderr into the release evidence bundle when history index generation fails.
10
+
11
+ ## Verification
12
+
13
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|falls back to latest release gate report when history index is empty"`
14
+ - `npx jest tests/unit/auto/handoff-release-gate-history-loaders-service.test.js --runInBand`
15
+
16
+ ## Release Notes
17
+
18
+ - This patch is targeted at the failed `v3.6.41` release workflow path, specifically the chain where history index generation failed and the subsequent hard gate blocked publish.
19
+ - The release policy remains strict. The change only adds a safe fallback to the current gate report and exposes better diagnostics for the real upstream failure.
@@ -0,0 +1,17 @@
1
+ # v3.6.43 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Fixed the second-stage release blocker uncovered by `v3.6.42`: advisory drift alerts no longer cause `Enforce handoff preflight hard gate` to fail when there are no drift-blocked runs.
8
+ - Improved release workflow observability again so a failed preflight gate now prints the generated JSON payload directly into the Actions log.
9
+
10
+ ## Verification
11
+
12
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|advisory drift alerts without blocked runs|falls back to latest release gate report when history index is empty"`
13
+
14
+ ## Release Notes
15
+
16
+ - `v3.6.42` fixed the missing-history path, but exposed a separate policy bug where advisory drift alerts were treated as hard blockers.
17
+ - `v3.6.43` narrows the hard gate back to real release blockers: failed latest gate or drift-blocked history.
@@ -0,0 +1,17 @@
1
+ # v3.6.44 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Fixed the final release blocker in GitHub Actions tag workflows: spec delivery sync now accepts detached `HEAD` release checkouts when declared deliverables are tracked and the worktree is clean.
8
+
9
+ ## Verification
10
+
11
+ - `npx jest tests/unit/workspace/spec-delivery-audit.test.js --runInBand`
12
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|advisory drift alerts without blocked runs|falls back to latest release gate report when history index is empty"`
13
+
14
+ ## Release Notes
15
+
16
+ - This patch specifically targets GitHub Actions `push` workflows on `v*` tags, where the repository is checked out at detached `HEAD` and therefore has no upstream tracking branch by design.
17
+ - Deliverable tracking, worktree cleanliness, and missing-file detection are still enforced; only the branch-upstream proof is skipped in that release context.
@@ -348,7 +348,7 @@ Collaboration metadata is stored in `.sce/specs/{spec-name}/collaboration.json`:
348
348
  }
349
349
  ],
350
350
  "assignment": {
351
- "kiroInstance": "SCE-1",
351
+ "sceInstance": "SCE-1",
352
352
  "assignedAt": "2026-02-01T10:00:00Z"
353
353
  },
354
354
  "status": {
@@ -9,6 +9,11 @@
9
9
  ## 历史版本归档
10
10
 
11
11
  - [发布检查清单](../release-checklist.md)
12
+ - [v3.6.44 发布说明](./v3.6.44.md)
13
+ - [v3.6.43 发布说明](./v3.6.43.md)
14
+ - [v3.6.42 发布说明](./v3.6.42.md)
15
+ - [v3.6.41 发布说明](./v3.6.41.md)
16
+ - [v3.6.40 发布说明](./v3.6.40.md)
12
17
  - [v3.6.39 发布说明](./v3.6.39.md)
13
18
  - [v3.6.38 发布说明](./v3.6.38.md)
14
19
  - [v3.6.37 发布说明](./v3.6.37.md)
@@ -0,0 +1,19 @@
1
+ # v3.6.40 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 新增 spec 交付同步治理能力。每个 spec 可以声明真实交付文件,SCE 会在 handoff 或 release 前校验这些文件是否已纳入 git、已提交并具备 upstream 同步证明。
8
+ - 新增 `sce workspace delivery-audit` 命令,并将其接入 auto handoff preflight/run 与 studio release gate。
9
+ - 使用新的 `121-00-spec-delivery-sync-integrity-gate` spec 和对应交付清单对这项能力进行了自举治理。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/workspace/spec-delivery-audit.test.js tests/unit/commands/auto.test.js tests/unit/auto/handoff-run-service.test.js tests/unit/commands/studio.test.js tests/integration/workspace-delivery-audit-cli.integration.test.js --runInBand`
14
+
15
+ ## 发布说明
16
+
17
+ - 这项能力刻意采用 `manifest + audit + gate`,而不是做自动文件同步工具;git 仍然是唯一可信的交付事实来源。
18
+ - 一旦 spec 提供了 delivery manifest,blocking 模式下若声明文件缺失、未跟踪、工作区有脏改动,或分支相对 upstream 未同步,都会直接失败。
19
+ - 对于尚未建立 delivery manifest 的老仓库,默认仍保持 advisory 模式,不会立刻形成硬阻断。
@@ -0,0 +1,20 @@
1
+ # v3.6.41 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 完成了一轮务实的 SCE 接管清理,仓库当前已经与 takeover baseline 对齐,活跃代码路径的命名也统一回到了 SCE。
8
+ - 修复协作分配元数据写入逻辑,新写入统一持久化 `sceInstance`,同时继续兼容读取旧的 `kiroInstance` 元数据。
9
+ - 清理了备份、adoption、bootstrap、spec gate、auto runtime、repo config、CLI 初始化等活跃模块中的高价值 legacy 命名漂移,但没有破坏刻意保留的 `.kiro` 迁移兼容层。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/collab/collab-manager.test.js tests/unit/adoption/strategy-selector.test.js tests/unit/adoption/adoption-logger.test.js tests/unit/adoption.test.js --runInBand`
14
+ - `node bin/sce.js workspace takeover-audit --json`
15
+
16
+ ## 发布说明
17
+
18
+ - 这次发布刻意只做“有价值清理”,不是全仓盲目重命名。真正的 `.kiro` legacy migration 支持仍然保留。
19
+ - 运行时规范命名现在以 `hasSceDir` 和 `sceInstance` 为准;对历史项目状态和旧元数据所需的兼容别名仍然继续支持。
20
+ - 仓库内并不存在实际的 `.kiro-workspaces` 运行时目录遗留;本次交付主要消化的是活跃命名债和一个真实的协作元数据写入缺陷。
@@ -0,0 +1,19 @@
1
+ # v3.6.42 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 加固了 handoff release preflight:当发布过程里 `release-gate-history.json` 临时不可用,但当前 `release-gate-*.json` 已生成时,发布仍可继续判定。
8
+ - 提升了 release-gate history 加载的容错性,单个异常 report 或 seed entry 现在会被告警跳过,而不是直接打断整个 gate-index 构建。
9
+ - 补强了发布工作流诊断信息:当 history index 生成失败时,会把 `gate-index` 的 stderr 一并落到 release evidence 中。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|falls back to latest release gate report when history index is empty"`
14
+ - `npx jest tests/unit/auto/handoff-release-gate-history-loaders-service.test.js --runInBand`
15
+
16
+ ## 发布说明
17
+
18
+ - 这个补丁版直接针对 `v3.6.41` 发布工作流失败链路,重点修复的是 history index 构建失败后又把 publish 阻断的路径。
19
+ - 发布门槛本身没有放松,只是在当前 gate report 已经存在时提供了安全回退,并补上真实上游错误的诊断暴露。
@@ -0,0 +1,17 @@
1
+ # v3.6.43 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 修复了 `v3.6.42` 暴露出的第二层发布阻断问题:当 drift 只有 advisory alert、没有 `drift-blocked runs` 时,不再让 `Enforce handoff preflight hard gate` 失败。
8
+ - 再次补强了发布工作流可观测性:如果 preflight gate 失败,现在会把生成出来的 JSON 直接打印到 Actions 日志里。
9
+
10
+ ## 验证
11
+
12
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|advisory drift alerts without blocked runs|falls back to latest release gate report when history index is empty"`
13
+
14
+ ## 发布说明
15
+
16
+ - `v3.6.42` 修的是 history 缺失链路,但同时暴露出另一个策略缺陷:advisory drift alert 被误当成了 hard blocker。
17
+ - `v3.6.43` 把 hard gate 收敛回真正应该阻断发布的条件:最新 release gate 失败,或 history 中存在 drift-blocked runs。
@@ -0,0 +1,17 @@
1
+ # v3.6.44 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 修复了 GitHub Actions tag 发布工作流中的最后一个阻断点:当声明交付文件都已被跟踪且工作区干净时,spec delivery sync 现在允许 detached `HEAD` 的 release checkout 通过。
8
+
9
+ ## 验证
10
+
11
+ - `npx jest tests/unit/workspace/spec-delivery-audit.test.js --runInBand`
12
+ - `npx jest tests/unit/commands/auto.test.js --runInBand --testNamePattern "preflight-check|advisory drift alerts without blocked runs|falls back to latest release gate report when history index is empty"`
13
+
14
+ ## 发布说明
15
+
16
+ - 这个补丁版专门针对 GitHub Actions 的 `v*` tag push 发布场景;该场景天然是 detached `HEAD`,本来就不具备 branch upstream tracking。
17
+ - 声明文件是否已跟踪、工作区是否干净、是否缺文件这些真正的交付完整性校验仍然继续强制执行;放开的只是该发布环境下无意义的 upstream 证明。
@@ -307,7 +307,7 @@ class AdoptionLogger {
307
307
  */
308
308
  detectionResult(state) {
309
309
  this.info('Project state detected', {
310
- hasKiroDir: state.hasKiroDir,
310
+ hasSceDir: state.hasSceDir !== undefined ? state.hasSceDir : state.hasKiroDir,
311
311
  hasVersionFile: state.hasVersionFile,
312
312
  currentVersion: state.currentVersion,
313
313
  targetVersion: state.targetVersion,
@@ -34,7 +34,7 @@ class AdoptionStrategy {
34
34
  * @param {string} projectPath - Absolute path to project root
35
35
  * @returns {string}
36
36
  */
37
- getKiroPath(projectPath) {
37
+ getScePath(projectPath) {
38
38
  return path.join(projectPath, this.sceDir);
39
39
  }
40
40
 
@@ -65,17 +65,17 @@ class AdoptionStrategy {
65
65
  /**
66
66
  * Creates initial directory structure
67
67
  *
68
- * @param {string} kiroPath - Path to .sce/ directory
68
+ * @param {string} scePath - Path to .sce/ directory
69
69
  * @returns {Promise<void>}
70
70
  */
71
- async createDirectoryStructure(kiroPath) {
72
- await ensureDirectory(kiroPath);
73
- await ensureDirectory(path.join(kiroPath, 'specs'));
74
- await ensureDirectory(path.join(kiroPath, 'steering'));
75
- await ensureDirectory(path.join(kiroPath, 'tools'));
76
- await ensureDirectory(path.join(kiroPath, 'config'));
77
- await ensureDirectory(path.join(kiroPath, 'backups'));
78
- await ensureDirectory(path.join(kiroPath, 'hooks'));
71
+ async createDirectoryStructure(scePath) {
72
+ await ensureDirectory(scePath);
73
+ await ensureDirectory(path.join(scePath, 'specs'));
74
+ await ensureDirectory(path.join(scePath, 'steering'));
75
+ await ensureDirectory(path.join(scePath, 'tools'));
76
+ await ensureDirectory(path.join(scePath, 'config'));
77
+ await ensureDirectory(path.join(scePath, 'backups'));
78
+ await ensureDirectory(path.join(scePath, 'hooks'));
79
79
  }
80
80
 
81
81
  /**
@@ -90,7 +90,7 @@ class AdoptionStrategy {
90
90
  */
91
91
  async copyTemplateFiles(projectPath, options = {}) {
92
92
  const { overwrite = false, skip = [], resolutionMap = {} } = options;
93
- const kiroPath = this.getKiroPath(projectPath);
93
+ const scePath = this.getScePath(projectPath);
94
94
  const templatePath = this.getTemplatePath();
95
95
 
96
96
  const created = [];
@@ -144,7 +144,7 @@ class AdoptionStrategy {
144
144
  }
145
145
 
146
146
  const sourcePath = path.join(templatePath, file);
147
- const destPath = path.join(kiroPath, file);
147
+ const destPath = path.join(scePath, file);
148
148
 
149
149
  // Check if source exists
150
150
  const sourceExists = await pathExists(sourcePath);
@@ -208,11 +208,11 @@ class FreshAdoption extends AdoptionStrategy {
208
208
  const warnings = [];
209
209
 
210
210
  try {
211
- const kiroPath = this.getKiroPath(projectPath);
211
+ const scePath = this.getScePath(projectPath);
212
212
 
213
213
  // Check if .sce/ already exists
214
- const kiroExists = await pathExists(kiroPath);
215
- if (kiroExists) {
214
+ const sceExists = await pathExists(scePath);
215
+ if (sceExists) {
216
216
  throw new Error('.sce/ directory already exists - use partial or full adoption');
217
217
  }
218
218
 
@@ -230,7 +230,7 @@ class FreshAdoption extends AdoptionStrategy {
230
230
  }
231
231
 
232
232
  // Create directory structure
233
- await this.createDirectoryStructure(kiroPath);
233
+ await this.createDirectoryStructure(scePath);
234
234
  filesCreated.push('.sce/');
235
235
  filesCreated.push('.sce/specs/');
236
236
  filesCreated.push('.sce/steering/');
@@ -299,16 +299,16 @@ class PartialAdoption extends AdoptionStrategy {
299
299
  const warnings = [];
300
300
 
301
301
  try {
302
- const kiroPath = this.getKiroPath(projectPath);
302
+ const scePath = this.getScePath(projectPath);
303
303
 
304
304
  // Check if .sce/ exists
305
- const kiroExists = await pathExists(kiroPath);
306
- if (!kiroExists) {
305
+ const sceExists = await pathExists(scePath);
306
+ if (!sceExists) {
307
307
  throw new Error('.sce/ directory does not exist - use fresh adoption');
308
308
  }
309
309
 
310
310
  // Check if version.json exists
311
- const versionPath = path.join(kiroPath, 'version.json');
311
+ const versionPath = path.join(scePath, 'version.json');
312
312
  const versionExists = await pathExists(versionPath);
313
313
  if (versionExists) {
314
314
  warnings.push('version.json already exists - use full adoption for upgrades');
@@ -328,12 +328,12 @@ class PartialAdoption extends AdoptionStrategy {
328
328
  }
329
329
 
330
330
  // Ensure all required directories exist
331
- const specsPath = path.join(kiroPath, 'specs');
332
- const steeringPath = path.join(kiroPath, 'steering');
333
- const toolsPath = path.join(kiroPath, 'tools');
334
- const configPath = path.join(kiroPath, 'config');
335
- const backupsPath = path.join(kiroPath, 'backups');
336
- const hooksPath = path.join(kiroPath, 'hooks');
331
+ const specsPath = path.join(scePath, 'specs');
332
+ const steeringPath = path.join(scePath, 'steering');
333
+ const toolsPath = path.join(scePath, 'tools');
334
+ const configPath = path.join(scePath, 'config');
335
+ const backupsPath = path.join(scePath, 'backups');
336
+ const hooksPath = path.join(scePath, 'hooks');
337
337
 
338
338
  if (!await pathExists(specsPath)) {
339
339
  await ensureDirectory(specsPath);
@@ -437,11 +437,11 @@ class FullAdoption extends AdoptionStrategy {
437
437
  const warnings = [];
438
438
 
439
439
  try {
440
- const kiroPath = this.getKiroPath(projectPath);
440
+ const scePath = this.getScePath(projectPath);
441
441
 
442
442
  // Check if .sce/ exists
443
- const kiroExists = await pathExists(kiroPath);
444
- if (!kiroExists) {
443
+ const sceExists = await pathExists(scePath);
444
+ if (!sceExists) {
445
445
  throw new Error('.sce/ directory does not exist - use fresh adoption');
446
446
  }
447
447
 
@@ -31,8 +31,8 @@ class DetectionEngine {
31
31
  */
32
32
  async analyze(projectPath) {
33
33
  try {
34
- const kiroPath = path.join(projectPath, this.sceDir);
35
- const hasKiroDir = await pathExists(kiroPath);
34
+ const scePath = path.join(projectPath, this.sceDir);
35
+ const hasSceDir = await pathExists(scePath);
36
36
 
37
37
  let hasVersionFile = false;
38
38
  let hasSpecs = false;
@@ -41,9 +41,9 @@ class DetectionEngine {
41
41
  let existingVersion = null;
42
42
  let steeringDetection = null;
43
43
 
44
- if (hasKiroDir) {
44
+ if (hasSceDir) {
45
45
  // Check for version.json
46
- const versionPath = path.join(kiroPath, this.versionFile);
46
+ const versionPath = path.join(scePath, this.versionFile);
47
47
  hasVersionFile = await pathExists(versionPath);
48
48
 
49
49
  if (hasVersionFile) {
@@ -57,7 +57,7 @@ class DetectionEngine {
57
57
  }
58
58
 
59
59
  // Check for specs/
60
- const specsPath = path.join(kiroPath, this.specsDir);
60
+ const specsPath = path.join(scePath, this.specsDir);
61
61
  hasSpecs = await pathExists(specsPath);
62
62
 
63
63
  // Check for steering/ using SteeringManager
@@ -65,7 +65,7 @@ class DetectionEngine {
65
65
  hasSteering = steeringDetection.hasExistingSteering;
66
66
 
67
67
  // Check for tools/
68
- const toolsPath = path.join(kiroPath, this.toolsDir);
68
+ const toolsPath = path.join(scePath, this.toolsDir);
69
69
  hasTools = await pathExists(toolsPath);
70
70
  }
71
71
 
@@ -73,10 +73,11 @@ class DetectionEngine {
73
73
  const projectType = await this.detectProjectType(projectPath);
74
74
 
75
75
  // Detect conflicts (only if we're going to add template files)
76
- const conflicts = hasKiroDir ? await this.detectConflicts(projectPath) : [];
76
+ const conflicts = hasSceDir ? await this.detectConflicts(projectPath) : [];
77
77
 
78
78
  return {
79
- hasKiroDir,
79
+ hasSceDir,
80
+ hasKiroDir: hasSceDir,
80
81
  hasVersionFile,
81
82
  hasSpecs,
82
83
  hasSteering,
@@ -98,8 +99,9 @@ class DetectionEngine {
98
99
  * @returns {AdoptionMode} - 'fresh', 'partial', or 'full'
99
100
  */
100
101
  determineStrategy(result) {
102
+ const hasSceDir = result && result.hasSceDir !== undefined ? result.hasSceDir : result.hasKiroDir;
101
103
  // Fresh adoption: no .sce/ directory
102
- if (!result.hasKiroDir) {
104
+ if (!hasSceDir) {
103
105
  return 'fresh';
104
106
  }
105
107
 
@@ -152,7 +154,7 @@ class DetectionEngine {
152
154
  const conflicts = [];
153
155
 
154
156
  try {
155
- const kiroPath = path.join(projectPath, this.sceDir);
157
+ const scePath = path.join(projectPath, this.sceDir);
156
158
 
157
159
  // Define template files that might conflict
158
160
  const templateFiles = [
@@ -177,7 +179,7 @@ class DetectionEngine {
177
179
  ];
178
180
 
179
181
  for (const templateFile of templateFiles) {
180
- const filePath = path.join(kiroPath, templateFile);
182
+ const filePath = path.join(scePath, templateFile);
181
183
  const exists = await pathExists(filePath);
182
184
 
183
185
  if (exists) {
@@ -249,12 +251,13 @@ class DetectionEngine {
249
251
  */
250
252
  getSummary(result) {
251
253
  const lines = [];
254
+ const hasSceDir = result && result.hasSceDir !== undefined ? result.hasSceDir : result.hasKiroDir;
252
255
 
253
256
  lines.push('Project Analysis:');
254
257
  lines.push(` Project Type: ${result.projectType}`);
255
- lines.push(` .sce/ Directory: ${result.hasKiroDir ? 'Yes' : 'No'}`);
258
+ lines.push(` .sce/ Directory: ${hasSceDir ? 'Yes' : 'No'}`);
256
259
 
257
- if (result.hasKiroDir) {
260
+ if (hasSceDir) {
258
261
  lines.push(` version.json: ${result.hasVersionFile ? 'Yes' : 'No'}`);
259
262
  if (result.existingVersion) {
260
263
  lines.push(` Current Version: ${result.existingVersion}`);
@@ -317,10 +317,10 @@ class SmartOrchestrator {
317
317
 
318
318
  } else if (mode === 'smart-adopt' || mode === 'smart-update') {
319
319
  // Check which template files exist and differ
320
- const kiroPath = path.join(projectPath, '.sce');
320
+ const scePath = path.join(projectPath, '.sce');
321
321
 
322
322
  for (const templateFile of templateFiles) {
323
- const filePath = path.join(kiroPath, templateFile);
323
+ const filePath = path.join(scePath, templateFile);
324
324
  const fs = require('fs-extra');
325
325
 
326
326
  if (await fs.pathExists(filePath)) {
@@ -340,7 +340,7 @@ class SmartOrchestrator {
340
340
  }
341
341
 
342
342
  // Always preserve CURRENT_CONTEXT.md if it exists
343
- const currentContextPath = path.join(kiroPath, 'steering/CURRENT_CONTEXT.md');
343
+ const currentContextPath = path.join(scePath, 'steering/CURRENT_CONTEXT.md');
344
344
  const fs = require('fs-extra');
345
345
  if (await fs.pathExists(currentContextPath)) {
346
346
  plan.filesToPreserve.push('steering/CURRENT_CONTEXT.md');