@hongmaple0820/scale-engine 0.19.0 → 0.21.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.
Files changed (52) hide show
  1. package/README.en.md +17 -3
  2. package/README.md +143 -9
  3. package/dist/api/cli.js +1187 -30
  4. package/dist/api/cli.js.map +1 -1
  5. package/dist/codegraph/CodeIntelligence.d.ts +135 -0
  6. package/dist/codegraph/CodeIntelligence.js +460 -0
  7. package/dist/codegraph/CodeIntelligence.js.map +1 -0
  8. package/dist/context/ContextBudget.d.ts +90 -0
  9. package/dist/context/ContextBudget.js +322 -0
  10. package/dist/context/ContextBudget.js.map +1 -0
  11. package/dist/eval/WorkflowEval.d.ts +161 -0
  12. package/dist/eval/WorkflowEval.js +379 -0
  13. package/dist/eval/WorkflowEval.js.map +1 -0
  14. package/dist/governance/GovernanceRoi.d.ts +25 -0
  15. package/dist/governance/GovernanceRoi.js +70 -0
  16. package/dist/governance/GovernanceRoi.js.map +1 -0
  17. package/dist/governance/ProgressiveGovernance.d.ts +22 -0
  18. package/dist/governance/ProgressiveGovernance.js +159 -0
  19. package/dist/governance/ProgressiveGovernance.js.map +1 -0
  20. package/dist/memory/MemoryBrain.d.ts +135 -0
  21. package/dist/memory/MemoryBrain.js +635 -0
  22. package/dist/memory/MemoryBrain.js.map +1 -0
  23. package/dist/memory/index.d.ts +1 -0
  24. package/dist/memory/index.js +1 -0
  25. package/dist/memory/index.js.map +1 -1
  26. package/dist/output/GovernanceDashboard.d.ts +57 -0
  27. package/dist/output/GovernanceDashboard.js +250 -0
  28. package/dist/output/GovernanceDashboard.js.map +1 -0
  29. package/dist/output/index.d.ts +2 -0
  30. package/dist/output/index.js +1 -0
  31. package/dist/output/index.js.map +1 -1
  32. package/dist/skills/SkillRadar.d.ts +83 -0
  33. package/dist/skills/SkillRadar.js +384 -0
  34. package/dist/skills/SkillRadar.js.map +1 -0
  35. package/dist/workflow/GovernanceTemplates.js +220 -194
  36. package/dist/workflow/GovernanceTemplates.js.map +1 -1
  37. package/dist/workflow/UpgradeManager.d.ts +140 -0
  38. package/dist/workflow/UpgradeManager.js +434 -0
  39. package/dist/workflow/UpgradeManager.js.map +1 -0
  40. package/docs/CODE_INTELLIGENCE.md +138 -0
  41. package/docs/CONTEXT_BUDGET.md +87 -0
  42. package/docs/GOVERNANCE_DASHBOARD.md +69 -0
  43. package/docs/MEMORY_BRAIN.md +104 -0
  44. package/docs/README.md +17 -8
  45. package/docs/SKILL_RADAR.md +115 -0
  46. package/docs/WORKFLOW_EVAL.md +151 -0
  47. package/docs/start/README.md +5 -1
  48. package/examples/demo-projects/agent-governance-demo/CONTEXT.md +14 -0
  49. package/examples/demo-projects/agent-governance-demo/README.md +32 -21
  50. package/examples/demo-projects/agent-governance-demo/docs/CONTEXT-MAP.md +14 -0
  51. package/examples/demo-projects/agent-governance-demo/package.json +6 -1
  52. package/package.json +7 -1
@@ -202,10 +202,10 @@ scale verify <task-id> --profile default
202
202
  scale verify <task-id> --service <service-name>
203
203
  scale verify <task-id> --artifact-gate warn
204
204
  scale verify <task-id> --artifact-gate block
205
- scale verify <task-id> --require-installed-skills
206
- scale verify <task-id> --profile productSmoke
207
- scale task-artifacts check --dir docs/worklog/tasks/<task-dir> --level L
208
- scale artifact render --task-id <task-dir> --type release-report
205
+ scale verify <task-id> --require-installed-skills
206
+ scale verify <task-id> --profile productSmoke
207
+ scale task-artifacts check --dir docs/worklog/tasks/<task-dir> --level L
208
+ scale artifact render --task-id <task-dir> --type release-report
209
209
  scale artifact doctor --task-id <task-dir>
210
210
  \`\`\`
211
211
 
@@ -217,6 +217,32 @@ Keep \`.scale/engineering-standards.json\` and \`.scale/frameworks.json\` as the
217
217
  Keep \`.scale/engineering-standards-baseline.json\` as the temporary exception list for known legacy standards findings; it must not be used to hide new or changed-file problems.
218
218
  Use \`artifactGate: "warn"\` while introducing the workflow, then move M/L/CRITICAL work to \`"block"\` once templates and local gates are stable.
219
219
 
220
+ ## Workflow Upgrade
221
+
222
+ Do not rerun \`scale init\` as a blind upgrade command. Generated governance files may contain local project adaptations.
223
+
224
+ Use the guarded upgrade flow:
225
+
226
+ \`\`\`bash
227
+ scale upgrade check --dir .
228
+ scale upgrade plan --dir . --html
229
+ scale upgrade apply --dir . --confirm
230
+ scale upgrade rollback --dir .
231
+ scale tools outdated --dir .
232
+ scale skill outdated --dir .
233
+ scale preflight --preflight-profile quick
234
+ \`\`\`
235
+
236
+ Rules:
237
+
238
+ - \`.scale/governance.lock.json\` records generated file hashes and pack versions.
239
+ - Clean or missing generated files can be planned safely.
240
+ - Locally changed generated files require manual review before replacement or merge.
241
+ - \`scale upgrade apply --confirm\` only restores missing generated files and refreshes the lock after writing \`.scale/backups/upgrade-*/manifest.json\`.
242
+ - \`scale upgrade rollback\` only rolls back the latest SCALE-managed safe apply.
243
+ - Third-party skills, MCP servers, browser tools, desktop automation, and external CLI tools are never auto-installed by the upgrade flow.
244
+ - Community sources require source, install script, permission, and changelog review. Desktop automation is treated as high risk.
245
+
220
246
  ## HTML Artifacts
221
247
 
222
248
  Markdown remains the editable source of truth for task artifacts. HTML artifacts are derived human-review surfaces for plan comparison, implementation plans, code reviews, status reports, incident reports, and release reports.
@@ -301,15 +327,15 @@ Default policy:
301
327
  - unsafe HTML sinks, dynamic code execution, empty catch blocks, and type suppressions require remediation before release.
302
328
  - framework and architecture rules live in \`.scale/frameworks.json\` and module standards docs.
303
329
  - \`.scale/frameworks.json > bannedImports\` blocks direct use of deprecated ORMs, unsafe SDKs, or off-system UI components.
304
- - \`.scale/frameworks.json > lastReviewedAt/reviewIntervalDays\` warns when module framework decisions need review.
305
- - \`.scale/engineering-standards.json > blockingRules\` promotes selected warning rule IDs to release-blocking findings.
306
- - \`.scale/engineering-standards.json > allowedFindingPatterns\` allows narrow rule/path/evidence exceptions without hiding unrelated findings in the same file.
307
- - \`.scale/engineering-standards-baseline.json\` may hold known legacy findings during rollout, but normal task gates should prefer \`--changed\` or \`--changed-files\` so new work is blocked without forcing a whole-repo cleanup.
308
- - \`.scale/verification.json > policy.engineeringStandardsGate\` controls whether preflight and task verification treat standards as \`off\`, \`warn\`, or \`block\`.
309
- - \`.scale/product-smoke.json\` defines real product-path probes. Use it to prove a routed user/business flow, not only build, unit tests, or \`/health\`.
310
- - \`.scale/verification.json > policy.productSmokeGate\` controls whether missing or failed product smoke evidence warns or blocks M/L/CRITICAL delivery.
311
- - Full standards scans are for release readiness, scheduled remediation, and architecture cleanup. Changed-file scans are the default for day-to-day feature and bug branches.
312
- - Use \`scale standards baseline --write\` only during an explicit rollout or remediation planning task. It writes the machine-readable baseline and a \`standards-legacy-debt.md\` classification report for staged cleanup.
330
+ - \`.scale/frameworks.json > lastReviewedAt/reviewIntervalDays\` warns when module framework decisions need review.
331
+ - \`.scale/engineering-standards.json > blockingRules\` promotes selected warning rule IDs to release-blocking findings.
332
+ - \`.scale/engineering-standards.json > allowedFindingPatterns\` allows narrow rule/path/evidence exceptions without hiding unrelated findings in the same file.
333
+ - \`.scale/engineering-standards-baseline.json\` may hold known legacy findings during rollout, but normal task gates should prefer \`--changed\` or \`--changed-files\` so new work is blocked without forcing a whole-repo cleanup.
334
+ - \`.scale/verification.json > policy.engineeringStandardsGate\` controls whether preflight and task verification treat standards as \`off\`, \`warn\`, or \`block\`.
335
+ - \`.scale/product-smoke.json\` defines real product-path probes. Use it to prove a routed user/business flow, not only build, unit tests, or \`/health\`.
336
+ - \`.scale/verification.json > policy.productSmokeGate\` controls whether missing or failed product smoke evidence warns or blocks M/L/CRITICAL delivery.
337
+ - Full standards scans are for release readiness, scheduled remediation, and architecture cleanup. Changed-file scans are the default for day-to-day feature and bug branches.
338
+ - Use \`scale standards baseline --write\` only during an explicit rollout or remediation planning task. It writes the machine-readable baseline and a \`standards-legacy-debt.md\` classification report for staged cleanup.
313
339
 
314
340
  ## Automation Templates
315
341
 
@@ -742,67 +768,67 @@ TBD
742
768
  `;
743
769
  }
744
770
  function productSmokeTemplate() {
745
- return `# Product Smoke
746
-
747
- ## Real Product Path
748
-
749
- Describe the smallest end-to-end path that proves the change works through the real product boundary.
750
-
751
- Example:
752
-
753
- \`\`\`text
754
- UI or client -> gateway/router -> service -> database/storage/queue -> observable result
755
- \`\`\`
756
-
757
- Do not use a green health endpoint as the only proof when the user-facing path depends on routing, authentication, storage, async tasks, browser behavior, or third-party integration.
758
-
759
- ## Quick Setup
760
-
761
- 1. Open \`.scale/product-smoke.json\`.
762
- 2. Replace the example command with one real product path command.
763
- 3. Set that probe's \`enabled\` field to \`true\`.
764
- 4. Run \`scale preflight --profile productSmoke --json\`.
765
- 5. Run \`scale runtime final-check --level M --json\`.
766
-
767
- \`status: "skipped"\` means no real product path was exercised. It does not count as completion evidence.
768
-
769
- ## Setup
770
-
771
- - Base URL:
772
- - Test user or tenant:
773
- - Required fixtures:
774
- - Services that must be running:
775
-
776
- ## Smoke Commands
777
-
778
- | Command | Expected Result | Evidence Artifact |
779
- | --- | --- | --- |
780
- | TBD | TBD | TBD |
781
-
782
- ## Runtime Evidence
783
-
784
- Record at least one runtime evidence item:
785
-
786
- \`\`\`bash
787
- scale runtime record \\
788
- --kind command \\
789
- --title "Product smoke: <flow>" \\
790
- --status passed \\
791
- --command "<exact smoke command>" \\
792
- --exit-code 0 \\
793
- --summary "<business result, task id, status, or observable output>" \\
794
- --artifacts ".agent/logs/<service>/<smoke>.json" \\
795
- --metadata-json '{"productSmoke":true,"realProductPath":true}'
796
- \`\`\`
797
-
798
- ## Assertions
799
-
800
- - [ ] Request crossed the real product boundary, not only an isolated unit.
801
- - [ ] Authentication or user identity path was exercised when relevant.
802
- - [ ] Persistence/storage/queue side effect was verified when relevant.
803
- - [ ] Async task or eventual state was polled to terminal status when relevant.
804
- - [ ] Failure output is specific enough to diagnose the failing layer.
805
- - [ ] Runtime artifacts are ignored or deliberately promoted according to resource governance.
771
+ return `# Product Smoke
772
+
773
+ ## Real Product Path
774
+
775
+ Describe the smallest end-to-end path that proves the change works through the real product boundary.
776
+
777
+ Example:
778
+
779
+ \`\`\`text
780
+ UI or client -> gateway/router -> service -> database/storage/queue -> observable result
781
+ \`\`\`
782
+
783
+ Do not use a green health endpoint as the only proof when the user-facing path depends on routing, authentication, storage, async tasks, browser behavior, or third-party integration.
784
+
785
+ ## Quick Setup
786
+
787
+ 1. Open \`.scale/product-smoke.json\`.
788
+ 2. Replace the example command with one real product path command.
789
+ 3. Set that probe's \`enabled\` field to \`true\`.
790
+ 4. Run \`scale preflight --profile productSmoke --json\`.
791
+ 5. Run \`scale runtime final-check --level M --json\`.
792
+
793
+ \`status: "skipped"\` means no real product path was exercised. It does not count as completion evidence.
794
+
795
+ ## Setup
796
+
797
+ - Base URL:
798
+ - Test user or tenant:
799
+ - Required fixtures:
800
+ - Services that must be running:
801
+
802
+ ## Smoke Commands
803
+
804
+ | Command | Expected Result | Evidence Artifact |
805
+ | --- | --- | --- |
806
+ | TBD | TBD | TBD |
807
+
808
+ ## Runtime Evidence
809
+
810
+ Record at least one runtime evidence item:
811
+
812
+ \`\`\`bash
813
+ scale runtime record \\
814
+ --kind command \\
815
+ --title "Product smoke: <flow>" \\
816
+ --status passed \\
817
+ --command "<exact smoke command>" \\
818
+ --exit-code 0 \\
819
+ --summary "<business result, task id, status, or observable output>" \\
820
+ --artifacts ".agent/logs/<service>/<smoke>.json" \\
821
+ --metadata-json '{"productSmoke":true,"realProductPath":true}'
822
+ \`\`\`
823
+
824
+ ## Assertions
825
+
826
+ - [ ] Request crossed the real product boundary, not only an isolated unit.
827
+ - [ ] Authentication or user identity path was exercised when relevant.
828
+ - [ ] Persistence/storage/queue side effect was verified when relevant.
829
+ - [ ] Async task or eventual state was polled to terminal status when relevant.
830
+ - [ ] Failure output is specific enough to diagnose the failing layer.
831
+ - [ ] Runtime artifacts are ignored or deliberately promoted according to resource governance.
806
832
  `;
807
833
  }
808
834
  function planTemplate() {
@@ -983,132 +1009,132 @@ function productSmokeConfigTemplate(mode) {
983
1009
  }, null, 2) + '\n';
984
1010
  }
985
1011
  function productSmokePowerShellScript() {
986
- return `# Product smoke probe runner generated by scale-engine.
987
- $ErrorActionPreference = "Stop"
988
-
989
- $Root = (Resolve-Path (Join-Path $PSScriptRoot "..\\..")).Path
990
- $ConfigPath = Join-Path $Root ".scale\\product-smoke.json"
991
- $LogDir = Join-Path $Root ".agent\\logs"
992
- $LogPath = Join-Path $LogDir "product-smoke.json"
993
-
994
- New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
995
-
996
- $NodeProgram = @'
997
- ${productSmokeNodeProgram()}
998
- '@
999
-
1000
- $TempFile = [System.IO.Path]::GetTempFileName() + ".js"
1001
- Set-Content -Path $TempFile -Value $NodeProgram -Encoding UTF8
1002
- try {
1003
- node $TempFile $ConfigPath $LogPath
1004
- exit $LASTEXITCODE
1005
- } finally {
1006
- Remove-Item -Force $TempFile -ErrorAction SilentlyContinue
1007
- }
1012
+ return `# Product smoke probe runner generated by scale-engine.
1013
+ $ErrorActionPreference = "Stop"
1014
+
1015
+ $Root = (Resolve-Path (Join-Path $PSScriptRoot "..\\..")).Path
1016
+ $ConfigPath = Join-Path $Root ".scale\\product-smoke.json"
1017
+ $LogDir = Join-Path $Root ".agent\\logs"
1018
+ $LogPath = Join-Path $LogDir "product-smoke.json"
1019
+
1020
+ New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
1021
+
1022
+ $NodeProgram = @'
1023
+ ${productSmokeNodeProgram()}
1024
+ '@
1025
+
1026
+ $TempFile = [System.IO.Path]::GetTempFileName() + ".js"
1027
+ Set-Content -Path $TempFile -Value $NodeProgram -Encoding UTF8
1028
+ try {
1029
+ node $TempFile $ConfigPath $LogPath
1030
+ exit $LASTEXITCODE
1031
+ } finally {
1032
+ Remove-Item -Force $TempFile -ErrorAction SilentlyContinue
1033
+ }
1008
1034
  `;
1009
1035
  }
1010
1036
  function productSmokeShellScript() {
1011
- return `#!/usr/bin/env sh
1012
- set -eu
1013
-
1014
- ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
1015
- CONFIG_PATH="$ROOT/.scale/product-smoke.json"
1016
- LOG_DIR="$ROOT/.agent/logs"
1017
- LOG_PATH="$LOG_DIR/product-smoke.json"
1018
-
1019
- mkdir -p "$LOG_DIR"
1020
-
1021
- node - "$CONFIG_PATH" "$LOG_PATH" <<'NODE'
1022
- ${productSmokeNodeProgram()}
1023
- NODE
1037
+ return `#!/usr/bin/env sh
1038
+ set -eu
1039
+
1040
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
1041
+ CONFIG_PATH="$ROOT/.scale/product-smoke.json"
1042
+ LOG_DIR="$ROOT/.agent/logs"
1043
+ LOG_PATH="$LOG_DIR/product-smoke.json"
1044
+
1045
+ mkdir -p "$LOG_DIR"
1046
+
1047
+ node - "$CONFIG_PATH" "$LOG_PATH" <<'NODE'
1048
+ ${productSmokeNodeProgram()}
1049
+ NODE
1024
1050
  `;
1025
1051
  }
1026
1052
  function productSmokeNodeProgram() {
1027
- return `const fs = require('fs');
1028
- const cp = require('child_process');
1029
- const path = require('path');
1030
-
1031
- const configPath = process.argv[2];
1032
- const logPath = process.argv[3];
1033
-
1034
- function writeReport(report) {
1035
- fs.mkdirSync(path.dirname(logPath), { recursive: true });
1036
- fs.writeFileSync(logPath, JSON.stringify(report, null, 2) + '\\n', 'utf8');
1037
- process.stdout.write(JSON.stringify(report, null, 2) + '\\n');
1038
- }
1039
-
1040
- if (!fs.existsSync(configPath)) {
1041
- writeReport({
1042
- version: 1,
1043
- status: 'failed',
1044
- verifiedAt: new Date().toISOString(),
1045
- message: 'Missing .scale/product-smoke.json',
1046
- results: []
1047
- });
1048
- process.exit(1);
1049
- }
1050
-
1051
- const config = JSON.parse(fs.readFileSync(configPath, 'utf8').replace(/^\\uFEFF/, ''));
1052
- const probes = Array.isArray(config.probes) ? config.probes.filter(probe => probe && probe.enabled === true) : [];
1053
-
1054
- if (probes.length === 0) {
1055
- const status = config.emptyProbeBehavior === 'block' ? 'failed' : 'skipped';
1056
- writeReport({
1057
- version: 1,
1058
- status,
1059
- verifiedAt: new Date().toISOString(),
1060
- message: 'No enabled product smoke probes. Enable probes in .scale/product-smoke.json after defining the real product path.',
1061
- results: []
1062
- });
1063
- process.exit(status === 'failed' ? 1 : 0);
1064
- }
1065
-
1066
- const results = probes.map((probe) => {
1067
- const startedAt = new Date().toISOString();
1068
- const expectedExitCode = Number.isInteger(probe.expected && probe.expected.exitCode) ? probe.expected.exitCode : 0;
1069
- const command = String(probe.command || '');
1070
- if (!command.trim()) {
1071
- return {
1072
- id: String(probe.id || 'unnamed-probe'),
1073
- description: String(probe.description || ''),
1074
- command,
1075
- expectedExitCode,
1076
- exitCode: 1,
1077
- status: 'failed',
1078
- startedAt,
1079
- endedAt: new Date().toISOString(),
1080
- outputTail: 'Probe command is empty'
1081
- };
1082
- }
1083
- const result = cp.spawnSync(command, {
1084
- cwd: process.cwd(),
1085
- shell: true,
1086
- encoding: 'utf8',
1087
- timeout: Number(config.timeoutMs || 180000)
1088
- });
1089
- const output = String(result.stdout || '') + String(result.stderr || '') + String(result.error ? result.error.message : '');
1090
- const exitCode = typeof result.status === 'number' ? result.status : 1;
1091
- return {
1092
- id: String(probe.id || 'unnamed-probe'),
1093
- description: String(probe.description || ''),
1094
- command,
1095
- expectedExitCode,
1096
- exitCode,
1097
- status: exitCode === expectedExitCode ? 'passed' : 'failed',
1098
- startedAt,
1099
- endedAt: new Date().toISOString(),
1100
- outputTail: output.length > 2000 ? output.slice(-2000) : output
1101
- };
1102
- });
1103
-
1104
- const failed = results.filter(result => result.status !== 'passed');
1105
- writeReport({
1106
- version: 1,
1107
- status: failed.length === 0 ? 'passed' : 'failed',
1108
- verifiedAt: new Date().toISOString(),
1109
- results
1110
- });
1111
- process.exit(failed.length === 0 ? 0 : 1);
1053
+ return `const fs = require('fs');
1054
+ const cp = require('child_process');
1055
+ const path = require('path');
1056
+
1057
+ const configPath = process.argv[2];
1058
+ const logPath = process.argv[3];
1059
+
1060
+ function writeReport(report) {
1061
+ fs.mkdirSync(path.dirname(logPath), { recursive: true });
1062
+ fs.writeFileSync(logPath, JSON.stringify(report, null, 2) + '\\n', 'utf8');
1063
+ process.stdout.write(JSON.stringify(report, null, 2) + '\\n');
1064
+ }
1065
+
1066
+ if (!fs.existsSync(configPath)) {
1067
+ writeReport({
1068
+ version: 1,
1069
+ status: 'failed',
1070
+ verifiedAt: new Date().toISOString(),
1071
+ message: 'Missing .scale/product-smoke.json',
1072
+ results: []
1073
+ });
1074
+ process.exit(1);
1075
+ }
1076
+
1077
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8').replace(/^\\uFEFF/, ''));
1078
+ const probes = Array.isArray(config.probes) ? config.probes.filter(probe => probe && probe.enabled === true) : [];
1079
+
1080
+ if (probes.length === 0) {
1081
+ const status = config.emptyProbeBehavior === 'block' ? 'failed' : 'skipped';
1082
+ writeReport({
1083
+ version: 1,
1084
+ status,
1085
+ verifiedAt: new Date().toISOString(),
1086
+ message: 'No enabled product smoke probes. Enable probes in .scale/product-smoke.json after defining the real product path.',
1087
+ results: []
1088
+ });
1089
+ process.exit(status === 'failed' ? 1 : 0);
1090
+ }
1091
+
1092
+ const results = probes.map((probe) => {
1093
+ const startedAt = new Date().toISOString();
1094
+ const expectedExitCode = Number.isInteger(probe.expected && probe.expected.exitCode) ? probe.expected.exitCode : 0;
1095
+ const command = String(probe.command || '');
1096
+ if (!command.trim()) {
1097
+ return {
1098
+ id: String(probe.id || 'unnamed-probe'),
1099
+ description: String(probe.description || ''),
1100
+ command,
1101
+ expectedExitCode,
1102
+ exitCode: 1,
1103
+ status: 'failed',
1104
+ startedAt,
1105
+ endedAt: new Date().toISOString(),
1106
+ outputTail: 'Probe command is empty'
1107
+ };
1108
+ }
1109
+ const result = cp.spawnSync(command, {
1110
+ cwd: process.cwd(),
1111
+ shell: true,
1112
+ encoding: 'utf8',
1113
+ timeout: Number(config.timeoutMs || 180000)
1114
+ });
1115
+ const output = String(result.stdout || '') + String(result.stderr || '') + String(result.error ? result.error.message : '');
1116
+ const exitCode = typeof result.status === 'number' ? result.status : 1;
1117
+ return {
1118
+ id: String(probe.id || 'unnamed-probe'),
1119
+ description: String(probe.description || ''),
1120
+ command,
1121
+ expectedExitCode,
1122
+ exitCode,
1123
+ status: exitCode === expectedExitCode ? 'passed' : 'failed',
1124
+ startedAt,
1125
+ endedAt: new Date().toISOString(),
1126
+ outputTail: output.length > 2000 ? output.slice(-2000) : output
1127
+ };
1128
+ });
1129
+
1130
+ const failed = results.filter(result => result.status !== 'passed');
1131
+ writeReport({
1132
+ version: 1,
1133
+ status: failed.length === 0 ? 'passed' : 'failed',
1134
+ verifiedAt: new Date().toISOString(),
1135
+ results
1136
+ });
1137
+ process.exit(failed.length === 0 ? 0 : 1);
1112
1138
  `;
1113
1139
  }
1114
1140
  function packageVersion() {
@@ -1 +1 @@
1
- {"version":3,"file":"GovernanceTemplates.js","sourceRoot":"","sources":["../../src/workflow/GovernanceTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EACL,6BAA6B,GAG9B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,oCAAoC,EACpC,kCAAkC,EAClC,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAE1F,OAAO,EAAE,kBAAkB,EAA8B,MAAM,wBAAwB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AAqCrE,MAAM,UAAU,wBAAwB,CACtC,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,EAC1B,UA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Report } from './GovernanceLock.js';
3
+ import { type GovernancePackId } from './GovernanceTemplatePacks.js';
4
+ export type UpgradeStatus = 'missing-lock' | 'clean' | 'updates-available' | 'local-changes';
5
+ export type UpgradeApplyMode = 'safe' | 'manual-review';
6
+ export type UpgradeRisk = 'low' | 'medium' | 'high';
7
+ export type ThirdPartyTrust = 'trusted' | 'community' | 'high-risk';
8
+ export type ThirdPartyUpdatePolicy = 'check-only' | 'manual-review' | 'blocked';
9
+ export interface UpgradeManagerOptions {
10
+ projectDir?: string;
11
+ targetScaleVersion?: string;
12
+ }
13
+ export interface UpgradeApplyOptions extends UpgradeManagerOptions {
14
+ confirm?: boolean;
15
+ }
16
+ export interface UpgradeCheckReport {
17
+ version: 1;
18
+ projectDir: string;
19
+ status: UpgradeStatus;
20
+ scaleEngine: {
21
+ currentVersion: string | null;
22
+ latestVersion: string;
23
+ upToDate: boolean;
24
+ };
25
+ governanceLock: {
26
+ exists: boolean;
27
+ path: string;
28
+ };
29
+ governancePack: {
30
+ id: GovernancePackId | null;
31
+ currentVersion: number | null;
32
+ latestVersion: number | null;
33
+ upToDate: boolean;
34
+ };
35
+ generatedFiles: {
36
+ total: number;
37
+ clean: number;
38
+ changed: number;
39
+ missing: number;
40
+ };
41
+ drift: GovernanceDriftReport;
42
+ thirdParty: ThirdPartyUpdateReport;
43
+ recommendedCommands: string[];
44
+ }
45
+ export interface ThirdPartyUpdateReport {
46
+ version: 1;
47
+ policy: 'check-only';
48
+ summary: {
49
+ total: number;
50
+ trusted: number;
51
+ community: number;
52
+ highRisk: number;
53
+ reviewRequired: number;
54
+ blocked: number;
55
+ };
56
+ reviewRequired: number;
57
+ entries: ThirdPartyUpdateEntry[];
58
+ }
59
+ export interface ThirdPartyUpdateEntry {
60
+ id: string;
61
+ name: string;
62
+ category: ToolCapabilityCategory;
63
+ source?: string;
64
+ trust: ThirdPartyTrust;
65
+ updatePolicy: ThirdPartyUpdatePolicy;
66
+ installPolicy: 'never-auto-install';
67
+ latestVersion: 'unknown';
68
+ reason: string;
69
+ }
70
+ export interface UpgradePlanReport {
71
+ version: 1;
72
+ projectDir: string;
73
+ status: UpgradeStatus;
74
+ applyMode: UpgradeApplyMode;
75
+ blockers: UpgradePlanBlocker[];
76
+ steps: UpgradePlanStep[];
77
+ check: UpgradeCheckReport;
78
+ recommendedCommands: string[];
79
+ }
80
+ export interface UpgradePlanBlocker {
81
+ code: 'missing-governance-lock' | 'local-generated-file-changed';
82
+ path?: string;
83
+ message: string;
84
+ }
85
+ export interface UpgradePlanStep {
86
+ action: 'initialize-governance-lock' | 'upgrade-scale-engine' | 'upgrade-governance-pack' | 'restore-missing-generated-file' | 'review-local-change' | 'review-third-party-capability' | 'run-preflight';
87
+ path?: string;
88
+ risk: UpgradeRisk;
89
+ reason: string;
90
+ command?: string;
91
+ }
92
+ export interface UpgradeBackupManifest {
93
+ version: 1;
94
+ id: string;
95
+ createdAt: string;
96
+ projectDir: string;
97
+ files: UpgradeBackupEntry[];
98
+ }
99
+ export interface UpgradeBackupEntry {
100
+ path: string;
101
+ existed: boolean;
102
+ backupPath?: string;
103
+ }
104
+ export interface UpgradeApplyReport {
105
+ version: 1;
106
+ projectDir: string;
107
+ ok: boolean;
108
+ applied: boolean;
109
+ reason: string;
110
+ changedFiles: string[];
111
+ backup?: {
112
+ id: string;
113
+ dir: string;
114
+ manifestPath: string;
115
+ };
116
+ plan: UpgradePlanReport;
117
+ }
118
+ export interface UpgradeRollbackReport {
119
+ version: 1;
120
+ projectDir: string;
121
+ ok: boolean;
122
+ applied: boolean;
123
+ reason: string;
124
+ backup?: {
125
+ id: string;
126
+ dir: string;
127
+ manifestPath: string;
128
+ };
129
+ restoredFiles: string[];
130
+ }
131
+ export declare function createUpgradeCheckReport(options?: UpgradeManagerOptions): UpgradeCheckReport;
132
+ export declare function createUpgradePlanReport(options?: UpgradeManagerOptions): UpgradePlanReport;
133
+ export declare function applyUpgradePlan(options?: UpgradeApplyOptions): UpgradeApplyReport;
134
+ export declare function rollbackLatestUpgrade(options?: UpgradeManagerOptions): UpgradeRollbackReport;
135
+ export declare function createThirdPartyUpdateReport(category?: ToolCapabilityCategory | ToolCapabilityCategory[]): ThirdPartyUpdateReport;
136
+ export declare function writeUpgradePlanHtml(report: UpgradePlanReport, outputPath?: string): string;
137
+ export declare function listAvailableGovernancePackVersions(): Array<{
138
+ id: GovernancePackId;
139
+ version: number;
140
+ }>;