kiro-spec-engine 1.47.30 → 1.47.32
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.
|
@@ -769,8 +769,9 @@ Dual-track handoff integration:
|
|
|
769
769
|
- Default mode is dependency-aware: spec integration goals are grouped into dependency batches and executed in topological order.
|
|
770
770
|
- `--continue-from` resumes pending goals from an existing handoff run report (`latest`, session id, or JSON file path). For safety, KSE enforces manifest-path consistency between the previous report and current run.
|
|
771
771
|
- `--continue-strategy auto|pending|failed-only` controls resumed scope. `auto` (default) derives the best strategy from prior run state (`pending` when unprocessed/planned goals exist, otherwise `failed-only` for pure failure replay).
|
|
772
|
-
- Non-dry runs auto-merge release evidence into `.kiro/reports/release-evidence/handoff-runs.json` with session-level gate/ontology/regression snapshots. Merge failures are recorded as warnings without aborting the run.
|
|
772
|
+
- Non-dry runs auto-merge release evidence into `.kiro/reports/release-evidence/handoff-runs.json` with session-level gate/ontology/regression/moqui-baseline snapshots. Merge failures are recorded as warnings without aborting the run.
|
|
773
773
|
- `--release-evidence-window` controls trend snapshot window size (2-50, default `5`) used in merged release evidence (`latest_trend_window` and per-session `trend_window`).
|
|
774
|
+
- Run output includes `moqui_baseline` snapshot by default, with artifacts at `.kiro/reports/release-evidence/moqui-template-baseline.json` and `.kiro/reports/release-evidence/moqui-template-baseline.md`.
|
|
774
775
|
- Run result includes `recommendations` with executable follow-up commands (for example, auto-generated `--continue-from <session>` on failed/incomplete batches).
|
|
775
776
|
- Gate defaults: `--min-spec-success-rate` defaults to `100`, `--max-risk-level` defaults to `high`, and ontology validation requirement is enabled by default.
|
|
776
777
|
- Use `--no-require-ontology-validation` only for emergency bypass; default behavior fails fast at precheck if manifest ontology evidence is missing or not passed.
|
|
@@ -781,11 +782,11 @@ Dual-track handoff integration:
|
|
|
781
782
|
- Markdown report includes `Trend Series` (ASCII success/ontology bars per session) and `Risk Layer View`.
|
|
782
783
|
- `--out` writes the generated regression report using the selected format.
|
|
783
784
|
- Output includes `recommendations` to guide next action when trend degrades or risk escalates.
|
|
784
|
-
- `kse auto handoff evidence [--file <path>] [--session-id <id|latest>] [--window <n>] [--format <json|markdown>] [--out <path>] [--json]`: quick-review merged release evidence and render current-batch gate/ontology/regression/risk-layer overview.
|
|
785
|
+
- `kse auto handoff evidence [--file <path>] [--session-id <id|latest>] [--window <n>] [--format <json|markdown>] [--out <path>] [--json]`: quick-review merged release evidence and render current-batch gate/ontology/regression/moqui-baseline/risk-layer overview.
|
|
785
786
|
- Default evidence file is `.kiro/reports/release-evidence/handoff-runs.json`.
|
|
786
787
|
- `--window` (1-50, default `5`) controls how many recent sessions are aggregated in review.
|
|
787
788
|
- JSON output includes `current_overview`, `aggregates.status_counts`, `aggregates.gate_pass_rate_percent`, and `risk_layers`.
|
|
788
|
-
- Markdown output includes `Current Gate`, `Current Ontology`, `Current Regression`, `Trend Series`, and `Risk Layer View`.
|
|
789
|
+
- Markdown output includes `Current Gate`, `Current Ontology`, `Current Regression`, `Current Moqui Baseline`, `Trend Series`, and `Risk Layer View`.
|
|
789
790
|
- Add `--release-draft <path>` to auto-generate a release notes draft and evidence review markdown in one run.
|
|
790
791
|
- `--release-version` sets draft version tag (defaults to `v<package.json version>`), and `--release-date` accepts `YYYY-MM-DD` (default: current UTC date).
|
|
791
792
|
- Use `--review-out <path>` to override the generated evidence review markdown path (default `.kiro/reports/release-evidence/handoff-evidence-review.md`).
|
|
@@ -893,14 +894,17 @@ kse scene package-ontology-backfill-batch --from-331 --dry-run --out-report .kir
|
|
|
893
894
|
### Moqui Template Baseline Scorecard
|
|
894
895
|
|
|
895
896
|
```bash
|
|
896
|
-
#
|
|
897
|
+
# Preferred CLI entry: score Moqui/ERP templates in the local template library (default filter: moqui|erp)
|
|
898
|
+
kse scene moqui-baseline --json
|
|
899
|
+
|
|
900
|
+
# Script alias (same behavior)
|
|
897
901
|
npm run report:moqui-baseline
|
|
898
902
|
|
|
899
903
|
# Score all scene templates instead of Moqui/ERP subset
|
|
900
|
-
|
|
904
|
+
kse scene moqui-baseline --include-all --json
|
|
901
905
|
|
|
902
906
|
# Customize score thresholds and output paths
|
|
903
|
-
|
|
907
|
+
kse scene moqui-baseline \
|
|
904
908
|
--min-score 75 \
|
|
905
909
|
--min-valid-rate 100 \
|
|
906
910
|
--out .kiro/reports/moqui-template-baseline.json \
|
|
@@ -908,7 +912,7 @@ node scripts/moqui-template-baseline-report.js \
|
|
|
908
912
|
--json
|
|
909
913
|
|
|
910
914
|
# Compare with a previous baseline and fail CI on portfolio gate fail
|
|
911
|
-
|
|
915
|
+
kse scene moqui-baseline \
|
|
912
916
|
--compare-with .kiro/reports/release-evidence/moqui-template-baseline-prev.json \
|
|
913
917
|
--fail-on-portfolio-fail \
|
|
914
918
|
--json
|
|
@@ -13,6 +13,7 @@ This playbook defines a generic (project-agnostic) path to absorb Moqui capabili
|
|
|
13
13
|
KSE defaults already enforce the baseline below:
|
|
14
14
|
|
|
15
15
|
- `kse auto handoff run`: ontology validation is required by default.
|
|
16
|
+
- `kse auto handoff run`: generates Moqui baseline snapshot by default and appends it to release-evidence sessions.
|
|
16
17
|
- `kse scene package-publish-batch`:
|
|
17
18
|
- ontology validation required by default
|
|
18
19
|
- batch ontology gate defaults:
|
|
@@ -27,10 +28,10 @@ Emergency bypass exists but is not recommended:
|
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
30
|
# 0) Generate template baseline scoreboard (Moqui/ERP templates by default)
|
|
30
|
-
|
|
31
|
+
kse scene moqui-baseline --json
|
|
31
32
|
|
|
32
33
|
# 0.1) CI/release mode: compare against previous baseline and enforce portfolio gate
|
|
33
|
-
|
|
34
|
+
kse scene moqui-baseline \
|
|
34
35
|
--compare-with .kiro/reports/release-evidence/moqui-template-baseline-prev.json \
|
|
35
36
|
--fail-on-portfolio-fail \
|
|
36
37
|
--json
|
|
@@ -62,6 +63,8 @@ Required artifacts for each intake batch:
|
|
|
62
63
|
|
|
63
64
|
- `.kiro/reports/moqui-template-baseline.json`
|
|
64
65
|
- `.kiro/reports/moqui-template-baseline.md`
|
|
66
|
+
- `.kiro/reports/release-evidence/moqui-template-baseline.json`
|
|
67
|
+
- `.kiro/reports/release-evidence/moqui-template-baseline.md`
|
|
65
68
|
- `.kiro/reports/handoff-runs/<session>.json`
|
|
66
69
|
- `.kiro/reports/scene-package-ontology-batch.json`
|
|
67
70
|
- `.kiro/templates/scene-packages/registry.json`
|
package/lib/commands/auto.js
CHANGED
|
@@ -9,6 +9,7 @@ const { analyzeGoalSemantics } = require('../auto/semantic-decomposer');
|
|
|
9
9
|
const fs = require('fs-extra');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const chalk = require('chalk');
|
|
12
|
+
const { spawnSync } = require('child_process');
|
|
12
13
|
|
|
13
14
|
const AUTO_ARCHIVE_SCHEMA_VERSION = '1.0';
|
|
14
15
|
const AUTO_ARCHIVE_SCHEMA_SUPPORTED_VERSIONS = new Set([AUTO_ARCHIVE_SCHEMA_VERSION]);
|
|
@@ -18,6 +19,8 @@ const AUTO_HANDOFF_RELEASE_EVIDENCE_FILE = '.kiro/reports/release-evidence/hando
|
|
|
18
19
|
const AUTO_HANDOFF_EVIDENCE_REVIEW_DEFAULT_FILE = '.kiro/reports/release-evidence/handoff-evidence-review.md';
|
|
19
20
|
const AUTO_HANDOFF_RELEASE_EVIDENCE_DIR = '.kiro/reports/release-evidence';
|
|
20
21
|
const AUTO_HANDOFF_RELEASE_GATE_HISTORY_FILE = '.kiro/reports/release-evidence/release-gate-history.json';
|
|
22
|
+
const AUTO_HANDOFF_MOQUI_BASELINE_JSON_FILE = '.kiro/reports/release-evidence/moqui-template-baseline.json';
|
|
23
|
+
const AUTO_HANDOFF_MOQUI_BASELINE_MARKDOWN_FILE = '.kiro/reports/release-evidence/moqui-template-baseline.md';
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Register auto commands
|
|
@@ -1647,6 +1650,20 @@ function registerAutoCommands(program) {
|
|
|
1647
1650
|
if (result.current_overview && result.current_overview.gate) {
|
|
1648
1651
|
console.log(chalk.gray(` Gate passed: ${result.current_overview.gate.passed ? 'yes' : 'no'}`));
|
|
1649
1652
|
}
|
|
1653
|
+
if (result.current_overview && result.current_overview.moqui_baseline) {
|
|
1654
|
+
const moquiBaseline = result.current_overview.moqui_baseline;
|
|
1655
|
+
const moquiSummary = moquiBaseline && moquiBaseline.summary ? moquiBaseline.summary : null;
|
|
1656
|
+
console.log(chalk.gray(` Moqui baseline: ${moquiBaseline.status || 'n/a'}`));
|
|
1657
|
+
if (moquiSummary) {
|
|
1658
|
+
const scoreText = Number.isFinite(Number(moquiSummary.avg_score))
|
|
1659
|
+
? `${moquiSummary.avg_score}`
|
|
1660
|
+
: 'n/a';
|
|
1661
|
+
const validRateText = Number.isFinite(Number(moquiSummary.valid_rate_percent))
|
|
1662
|
+
? `${moquiSummary.valid_rate_percent}%`
|
|
1663
|
+
: 'n/a';
|
|
1664
|
+
console.log(chalk.gray(` Portfolio: ${moquiSummary.portfolio_passed === true ? 'pass' : 'fail'} | avg=${scoreText} | valid-rate=${validRateText}`));
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1650
1667
|
if (result.output_file) {
|
|
1651
1668
|
console.log(chalk.gray(` Output: ${result.output_file}`));
|
|
1652
1669
|
}
|
|
@@ -1771,6 +1788,22 @@ function registerAutoCommands(program) {
|
|
|
1771
1788
|
if (result.gates) {
|
|
1772
1789
|
console.log(chalk.gray(` Gate passed: ${result.gates.passed ? 'yes' : 'no'}`));
|
|
1773
1790
|
}
|
|
1791
|
+
if (result.moqui_baseline) {
|
|
1792
|
+
console.log(chalk.gray(` Moqui baseline: ${result.moqui_baseline.status || 'unknown'}`));
|
|
1793
|
+
if (result.moqui_baseline.summary) {
|
|
1794
|
+
const baselineSummary = result.moqui_baseline.summary;
|
|
1795
|
+
const scoreText = Number.isFinite(Number(baselineSummary.avg_score))
|
|
1796
|
+
? `${baselineSummary.avg_score}`
|
|
1797
|
+
: 'n/a';
|
|
1798
|
+
const validRateText = Number.isFinite(Number(baselineSummary.valid_rate_percent))
|
|
1799
|
+
? `${baselineSummary.valid_rate_percent}%`
|
|
1800
|
+
: 'n/a';
|
|
1801
|
+
console.log(chalk.gray(` Portfolio: ${baselineSummary.portfolio_passed ? 'pass' : 'fail'} | avg=${scoreText} | valid-rate=${validRateText}`));
|
|
1802
|
+
}
|
|
1803
|
+
if (result.moqui_baseline.output && result.moqui_baseline.output.json) {
|
|
1804
|
+
console.log(chalk.gray(` Baseline report: ${result.moqui_baseline.output.json}`));
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1774
1807
|
if (result.output_file) {
|
|
1775
1808
|
console.log(chalk.gray(` Report: ${result.output_file}`));
|
|
1776
1809
|
}
|
|
@@ -8937,6 +8970,21 @@ function renderAutoHandoffEvidenceReviewMarkdown(payload = {}) {
|
|
|
8937
8970
|
const regression = currentOverview.regression && typeof currentOverview.regression === 'object'
|
|
8938
8971
|
? currentOverview.regression
|
|
8939
8972
|
: {};
|
|
8973
|
+
const moquiBaseline = currentOverview.moqui_baseline && typeof currentOverview.moqui_baseline === 'object'
|
|
8974
|
+
? currentOverview.moqui_baseline
|
|
8975
|
+
: {};
|
|
8976
|
+
const moquiSummary = moquiBaseline && moquiBaseline.summary && typeof moquiBaseline.summary === 'object'
|
|
8977
|
+
? moquiBaseline.summary
|
|
8978
|
+
: {};
|
|
8979
|
+
const moquiCompare = moquiBaseline && moquiBaseline.compare && typeof moquiBaseline.compare === 'object'
|
|
8980
|
+
? moquiBaseline.compare
|
|
8981
|
+
: {};
|
|
8982
|
+
const moquiDeltas = moquiCompare && moquiCompare.deltas && typeof moquiCompare.deltas === 'object'
|
|
8983
|
+
? moquiCompare.deltas
|
|
8984
|
+
: {};
|
|
8985
|
+
const moquiFailedTemplates = moquiCompare && moquiCompare.failed_templates && typeof moquiCompare.failed_templates === 'object'
|
|
8986
|
+
? moquiCompare.failed_templates
|
|
8987
|
+
: {};
|
|
8940
8988
|
const window = payload.window || { requested: 5, actual: 0 };
|
|
8941
8989
|
const series = Array.isArray(payload.series) ? payload.series : [];
|
|
8942
8990
|
const riskLayers = payload.risk_layers && typeof payload.risk_layers === 'object'
|
|
@@ -9001,6 +9049,19 @@ function renderAutoHandoffEvidenceReviewMarkdown(payload = {}) {
|
|
|
9001
9049
|
`- Delta risk rank: ${formatAutoHandoffRegressionValue(regression.delta && regression.delta.risk_level_rank)}`,
|
|
9002
9050
|
`- Delta failed goals: ${formatAutoHandoffRegressionValue(regression.delta && regression.delta.failed_goals)}`,
|
|
9003
9051
|
'',
|
|
9052
|
+
'## Current Moqui Baseline',
|
|
9053
|
+
'',
|
|
9054
|
+
`- Status: ${formatAutoHandoffRegressionValue(moquiBaseline.status)}`,
|
|
9055
|
+
`- Portfolio passed: ${moquiSummary.portfolio_passed === true ? 'yes' : (moquiSummary.portfolio_passed === false ? 'no' : 'n/a')}`,
|
|
9056
|
+
`- Avg score: ${formatAutoHandoffRegressionValue(moquiSummary.avg_score)}`,
|
|
9057
|
+
`- Valid-rate: ${formatAutoHandoffRegressionValue(moquiSummary.valid_rate_percent)}%`,
|
|
9058
|
+
`- Baseline failed templates: ${formatAutoHandoffRegressionValue(moquiSummary.baseline_failed)}`,
|
|
9059
|
+
`- Delta avg score: ${formatAutoHandoffRegressionValue(moquiDeltas.avg_score)}`,
|
|
9060
|
+
`- Delta valid-rate: ${formatAutoHandoffRegressionValue(moquiDeltas.valid_rate_percent)}%`,
|
|
9061
|
+
`- Newly failed templates: ${Array.isArray(moquiFailedTemplates.newly_failed) && moquiFailedTemplates.newly_failed.length > 0 ? moquiFailedTemplates.newly_failed.join(', ') : 'none'}`,
|
|
9062
|
+
`- Recovered templates: ${Array.isArray(moquiFailedTemplates.recovered) && moquiFailedTemplates.recovered.length > 0 ? moquiFailedTemplates.recovered.join(', ') : 'none'}`,
|
|
9063
|
+
`- Baseline JSON: ${formatAutoHandoffRegressionValue(moquiBaseline.output && moquiBaseline.output.json)}`,
|
|
9064
|
+
'',
|
|
9004
9065
|
'## Trend Series',
|
|
9005
9066
|
'',
|
|
9006
9067
|
...trendSeriesLines,
|
|
@@ -9092,6 +9153,21 @@ function renderAutoHandoffReleaseNotesDraft(payload = {}, context = {}) {
|
|
|
9092
9153
|
const regression = currentOverview.regression && typeof currentOverview.regression === 'object'
|
|
9093
9154
|
? currentOverview.regression
|
|
9094
9155
|
: {};
|
|
9156
|
+
const moquiBaseline = currentOverview.moqui_baseline && typeof currentOverview.moqui_baseline === 'object'
|
|
9157
|
+
? currentOverview.moqui_baseline
|
|
9158
|
+
: {};
|
|
9159
|
+
const moquiSummary = moquiBaseline && moquiBaseline.summary && typeof moquiBaseline.summary === 'object'
|
|
9160
|
+
? moquiBaseline.summary
|
|
9161
|
+
: {};
|
|
9162
|
+
const moquiCompare = moquiBaseline && moquiBaseline.compare && typeof moquiBaseline.compare === 'object'
|
|
9163
|
+
? moquiBaseline.compare
|
|
9164
|
+
: {};
|
|
9165
|
+
const moquiDeltas = moquiCompare && moquiCompare.deltas && typeof moquiCompare.deltas === 'object'
|
|
9166
|
+
? moquiCompare.deltas
|
|
9167
|
+
: {};
|
|
9168
|
+
const moquiFailedTemplates = moquiCompare && moquiCompare.failed_templates && typeof moquiCompare.failed_templates === 'object'
|
|
9169
|
+
? moquiCompare.failed_templates
|
|
9170
|
+
: {};
|
|
9095
9171
|
const riskLayers = payload.risk_layers && typeof payload.risk_layers === 'object'
|
|
9096
9172
|
? payload.risk_layers
|
|
9097
9173
|
: {};
|
|
@@ -9136,6 +9212,13 @@ function renderAutoHandoffReleaseNotesDraft(payload = {}, context = {}) {
|
|
|
9136
9212
|
`- Regression trend: ${formatAutoHandoffRegressionValue(regression.trend, formatAutoHandoffRegressionValue(payload.trend))}`,
|
|
9137
9213
|
`- Window trend: ${formatAutoHandoffRegressionValue(payload.window_trend && payload.window_trend.trend)}`,
|
|
9138
9214
|
`- Gate pass rate (window): ${formatAutoHandoffRegressionValue(payload.aggregates && payload.aggregates.gate_pass_rate_percent)}%`,
|
|
9215
|
+
`- Moqui baseline portfolio passed: ${moquiSummary.portfolio_passed === true ? 'yes' : (moquiSummary.portfolio_passed === false ? 'no' : 'n/a')}`,
|
|
9216
|
+
`- Moqui baseline avg score: ${formatAutoHandoffRegressionValue(moquiSummary.avg_score)}`,
|
|
9217
|
+
`- Moqui baseline valid-rate: ${formatAutoHandoffRegressionValue(moquiSummary.valid_rate_percent)}%`,
|
|
9218
|
+
`- Moqui baseline failed templates: ${formatAutoHandoffRegressionValue(moquiSummary.baseline_failed)}`,
|
|
9219
|
+
`- Moqui baseline avg score delta: ${formatAutoHandoffRegressionValue(moquiDeltas.avg_score)}`,
|
|
9220
|
+
`- Moqui baseline valid-rate delta: ${formatAutoHandoffRegressionValue(moquiDeltas.valid_rate_percent)}%`,
|
|
9221
|
+
`- Moqui newly failed templates: ${Array.isArray(moquiFailedTemplates.newly_failed) && moquiFailedTemplates.newly_failed.length > 0 ? moquiFailedTemplates.newly_failed.join(', ') : 'none'}`,
|
|
9139
9222
|
'',
|
|
9140
9223
|
'## Status Breakdown',
|
|
9141
9224
|
'',
|
|
@@ -9154,6 +9237,8 @@ function renderAutoHandoffReleaseNotesDraft(payload = {}, context = {}) {
|
|
|
9154
9237
|
`- Evidence review report: ${reviewFile || 'n/a'}`,
|
|
9155
9238
|
`- Handoff report: ${formatAutoHandoffRegressionValue(currentOverview.handoff_report_file)}`,
|
|
9156
9239
|
`- Release evidence JSON: ${formatAutoHandoffRegressionValue(payload.evidence_file)}`,
|
|
9240
|
+
`- Moqui baseline JSON: ${formatAutoHandoffRegressionValue(moquiBaseline.output && moquiBaseline.output.json)}`,
|
|
9241
|
+
`- Moqui baseline markdown: ${formatAutoHandoffRegressionValue(moquiBaseline.output && moquiBaseline.output.markdown)}`,
|
|
9157
9242
|
'',
|
|
9158
9243
|
'## Recommendations'
|
|
9159
9244
|
];
|
|
@@ -9939,6 +10024,25 @@ function buildAutoHandoffRunRecommendations(projectPath, result) {
|
|
|
9939
10024
|
push('kse auto governance stats --days 14 --json');
|
|
9940
10025
|
}
|
|
9941
10026
|
|
|
10027
|
+
const moquiBaseline = result && result.moqui_baseline && typeof result.moqui_baseline === 'object'
|
|
10028
|
+
? result.moqui_baseline
|
|
10029
|
+
: null;
|
|
10030
|
+
const moquiSummary = moquiBaseline && moquiBaseline.summary && typeof moquiBaseline.summary === 'object'
|
|
10031
|
+
? moquiBaseline.summary
|
|
10032
|
+
: null;
|
|
10033
|
+
if (moquiBaseline && moquiBaseline.status === 'error') {
|
|
10034
|
+
push('kse scene moqui-baseline --json');
|
|
10035
|
+
} else if (moquiSummary && moquiSummary.portfolio_passed === false) {
|
|
10036
|
+
push(
|
|
10037
|
+
'kse scene moqui-baseline --include-all ' +
|
|
10038
|
+
'--compare-with .kiro/reports/release-evidence/moqui-template-baseline.json --json'
|
|
10039
|
+
);
|
|
10040
|
+
push(
|
|
10041
|
+
'kse scene package-publish-batch --manifest docs/handoffs/handoff-manifest.json ' +
|
|
10042
|
+
'--dry-run --ontology-task-queue-out .kiro/auto/ontology-remediation.lines --json'
|
|
10043
|
+
);
|
|
10044
|
+
}
|
|
10045
|
+
|
|
9942
10046
|
return recommendations;
|
|
9943
10047
|
}
|
|
9944
10048
|
|
|
@@ -10026,6 +10130,21 @@ function buildAutoHandoffReleaseEvidenceEntry(projectPath, result, reportFile =
|
|
|
10026
10130
|
const regressionDelta = regression && regression.delta && typeof regression.delta === 'object'
|
|
10027
10131
|
? regression.delta
|
|
10028
10132
|
: {};
|
|
10133
|
+
const moquiBaseline = result && result.moqui_baseline && typeof result.moqui_baseline === 'object'
|
|
10134
|
+
? result.moqui_baseline
|
|
10135
|
+
: {};
|
|
10136
|
+
const moquiSummary = moquiBaseline && moquiBaseline.summary && typeof moquiBaseline.summary === 'object'
|
|
10137
|
+
? moquiBaseline.summary
|
|
10138
|
+
: {};
|
|
10139
|
+
const moquiCompare = moquiBaseline && moquiBaseline.compare && typeof moquiBaseline.compare === 'object'
|
|
10140
|
+
? moquiBaseline.compare
|
|
10141
|
+
: {};
|
|
10142
|
+
const moquiDeltas = moquiCompare && moquiCompare.deltas && typeof moquiCompare.deltas === 'object'
|
|
10143
|
+
? moquiCompare.deltas
|
|
10144
|
+
: {};
|
|
10145
|
+
const moquiFailedTemplates = moquiCompare && moquiCompare.failed_templates && typeof moquiCompare.failed_templates === 'object'
|
|
10146
|
+
? moquiCompare.failed_templates
|
|
10147
|
+
: {};
|
|
10029
10148
|
const batchSummary = result && result.batch_summary && typeof result.batch_summary === 'object'
|
|
10030
10149
|
? result.batch_summary
|
|
10031
10150
|
: {};
|
|
@@ -10084,6 +10203,42 @@ function buildAutoHandoffReleaseEvidenceEntry(projectPath, result, reportFile =
|
|
|
10084
10203
|
ontology_undecided_decisions: toNumber(regressionDelta.ontology_undecided_decisions)
|
|
10085
10204
|
}
|
|
10086
10205
|
},
|
|
10206
|
+
moqui_baseline: {
|
|
10207
|
+
status: normalizeHandoffText(moquiBaseline.status),
|
|
10208
|
+
generated: moquiBaseline.generated === true,
|
|
10209
|
+
reason: normalizeHandoffText(moquiBaseline.reason),
|
|
10210
|
+
error: normalizeHandoffText(moquiBaseline.error),
|
|
10211
|
+
summary: {
|
|
10212
|
+
total_templates: toNumber(moquiSummary.total_templates),
|
|
10213
|
+
scoped_templates: toNumber(moquiSummary.scoped_templates),
|
|
10214
|
+
avg_score: toNumber(moquiSummary.avg_score),
|
|
10215
|
+
valid_rate_percent: toNumber(moquiSummary.valid_rate_percent),
|
|
10216
|
+
baseline_passed: toNumber(moquiSummary.baseline_passed),
|
|
10217
|
+
baseline_failed: toNumber(moquiSummary.baseline_failed),
|
|
10218
|
+
portfolio_passed: moquiSummary.portfolio_passed === true
|
|
10219
|
+
},
|
|
10220
|
+
compare: Object.keys(moquiCompare).length === 0
|
|
10221
|
+
? null
|
|
10222
|
+
: {
|
|
10223
|
+
previous_generated_at: normalizeHandoffText(moquiCompare.previous_generated_at),
|
|
10224
|
+
previous_template_root: normalizeHandoffText(moquiCompare.previous_template_root),
|
|
10225
|
+
deltas: {
|
|
10226
|
+
scoped_templates: toNumber(moquiDeltas.scoped_templates),
|
|
10227
|
+
avg_score: toNumber(moquiDeltas.avg_score),
|
|
10228
|
+
valid_rate_percent: toNumber(moquiDeltas.valid_rate_percent),
|
|
10229
|
+
baseline_passed: toNumber(moquiDeltas.baseline_passed),
|
|
10230
|
+
baseline_failed: toNumber(moquiDeltas.baseline_failed)
|
|
10231
|
+
},
|
|
10232
|
+
failed_templates: {
|
|
10233
|
+
newly_failed: Array.isArray(moquiFailedTemplates.newly_failed) ? moquiFailedTemplates.newly_failed : [],
|
|
10234
|
+
recovered: Array.isArray(moquiFailedTemplates.recovered) ? moquiFailedTemplates.recovered : []
|
|
10235
|
+
}
|
|
10236
|
+
},
|
|
10237
|
+
output: {
|
|
10238
|
+
json: normalizeHandoffText(moquiBaseline && moquiBaseline.output ? moquiBaseline.output.json : null),
|
|
10239
|
+
markdown: normalizeHandoffText(moquiBaseline && moquiBaseline.output ? moquiBaseline.output.markdown : null)
|
|
10240
|
+
}
|
|
10241
|
+
},
|
|
10087
10242
|
batch_summary: {
|
|
10088
10243
|
status: normalizeHandoffText(batchSummary.status),
|
|
10089
10244
|
total_goals: toNumber(batchSummary.total_goals),
|
|
@@ -10218,6 +10373,124 @@ async function writeAutoHandoffRunReport(projectPath, result, outCandidate = nul
|
|
|
10218
10373
|
await maybeWriteOutput(result, defaultFile, projectPath);
|
|
10219
10374
|
}
|
|
10220
10375
|
|
|
10376
|
+
function buildAutoHandoffMoquiBaselinePhaseDetails(payload) {
|
|
10377
|
+
const baseline = payload && typeof payload === 'object' ? payload : {};
|
|
10378
|
+
const summary = baseline.summary && typeof baseline.summary === 'object' ? baseline.summary : null;
|
|
10379
|
+
return {
|
|
10380
|
+
status: baseline.status || 'unknown',
|
|
10381
|
+
generated: baseline.generated === true,
|
|
10382
|
+
output: baseline.output || null,
|
|
10383
|
+
portfolio_passed: summary ? summary.portfolio_passed === true : null,
|
|
10384
|
+
avg_score: summary && Number.isFinite(Number(summary.avg_score))
|
|
10385
|
+
? Number(summary.avg_score)
|
|
10386
|
+
: null,
|
|
10387
|
+
valid_rate_percent: summary && Number.isFinite(Number(summary.valid_rate_percent))
|
|
10388
|
+
? Number(summary.valid_rate_percent)
|
|
10389
|
+
: null
|
|
10390
|
+
};
|
|
10391
|
+
}
|
|
10392
|
+
|
|
10393
|
+
async function buildAutoHandoffMoquiBaselineSnapshot(projectPath) {
|
|
10394
|
+
const scriptPath = path.join(projectPath, 'scripts', 'moqui-template-baseline-report.js');
|
|
10395
|
+
if (!(await fs.pathExists(scriptPath))) {
|
|
10396
|
+
return {
|
|
10397
|
+
status: 'skipped',
|
|
10398
|
+
generated: false,
|
|
10399
|
+
reason: `baseline script missing: ${toAutoHandoffCliPath(projectPath, scriptPath)}`
|
|
10400
|
+
};
|
|
10401
|
+
}
|
|
10402
|
+
|
|
10403
|
+
const outputJsonPath = path.join(projectPath, AUTO_HANDOFF_MOQUI_BASELINE_JSON_FILE);
|
|
10404
|
+
const outputMarkdownPath = path.join(projectPath, AUTO_HANDOFF_MOQUI_BASELINE_MARKDOWN_FILE);
|
|
10405
|
+
await fs.ensureDir(path.dirname(outputJsonPath));
|
|
10406
|
+
|
|
10407
|
+
const scriptArgs = [
|
|
10408
|
+
scriptPath,
|
|
10409
|
+
'--out', outputJsonPath,
|
|
10410
|
+
'--markdown-out', outputMarkdownPath,
|
|
10411
|
+
'--json'
|
|
10412
|
+
];
|
|
10413
|
+
|
|
10414
|
+
if (await fs.pathExists(outputJsonPath)) {
|
|
10415
|
+
scriptArgs.push('--compare-with', outputJsonPath);
|
|
10416
|
+
}
|
|
10417
|
+
|
|
10418
|
+
const execution = spawnSync(process.execPath, scriptArgs, {
|
|
10419
|
+
cwd: projectPath,
|
|
10420
|
+
encoding: 'utf8'
|
|
10421
|
+
});
|
|
10422
|
+
|
|
10423
|
+
const stdout = typeof execution.stdout === 'string' ? execution.stdout.trim() : '';
|
|
10424
|
+
const stderr = typeof execution.stderr === 'string' ? execution.stderr.trim() : '';
|
|
10425
|
+
|
|
10426
|
+
if (execution.error) {
|
|
10427
|
+
return {
|
|
10428
|
+
status: 'error',
|
|
10429
|
+
generated: false,
|
|
10430
|
+
error: execution.error.message
|
|
10431
|
+
};
|
|
10432
|
+
}
|
|
10433
|
+
|
|
10434
|
+
if (execution.status !== 0) {
|
|
10435
|
+
return {
|
|
10436
|
+
status: 'error',
|
|
10437
|
+
generated: false,
|
|
10438
|
+
error: stderr || stdout || `baseline script exited with code ${execution.status}`
|
|
10439
|
+
};
|
|
10440
|
+
}
|
|
10441
|
+
|
|
10442
|
+
let reportPayload = null;
|
|
10443
|
+
try {
|
|
10444
|
+
reportPayload = stdout ? JSON.parse(stdout) : await fs.readJson(outputJsonPath);
|
|
10445
|
+
} catch (error) {
|
|
10446
|
+
return {
|
|
10447
|
+
status: 'error',
|
|
10448
|
+
generated: false,
|
|
10449
|
+
error: `failed to parse baseline payload: ${error.message}`
|
|
10450
|
+
};
|
|
10451
|
+
}
|
|
10452
|
+
|
|
10453
|
+
const summary = reportPayload && reportPayload.summary && typeof reportPayload.summary === 'object'
|
|
10454
|
+
? reportPayload.summary
|
|
10455
|
+
: {};
|
|
10456
|
+
const compare = reportPayload && reportPayload.compare && typeof reportPayload.compare === 'object'
|
|
10457
|
+
? reportPayload.compare
|
|
10458
|
+
: null;
|
|
10459
|
+
const failedTemplates = compare && compare.failed_templates && typeof compare.failed_templates === 'object'
|
|
10460
|
+
? compare.failed_templates
|
|
10461
|
+
: {};
|
|
10462
|
+
|
|
10463
|
+
return {
|
|
10464
|
+
status: summary.portfolio_passed === true ? 'passed' : 'failed',
|
|
10465
|
+
generated: true,
|
|
10466
|
+
summary: {
|
|
10467
|
+
total_templates: Number(summary.total_templates) || 0,
|
|
10468
|
+
scoped_templates: Number(summary.scoped_templates) || 0,
|
|
10469
|
+
avg_score: Number.isFinite(Number(summary.avg_score)) ? Number(summary.avg_score) : null,
|
|
10470
|
+
valid_rate_percent: Number.isFinite(Number(summary.valid_rate_percent)) ? Number(summary.valid_rate_percent) : null,
|
|
10471
|
+
baseline_passed: Number(summary.baseline_passed) || 0,
|
|
10472
|
+
baseline_failed: Number(summary.baseline_failed) || 0,
|
|
10473
|
+
portfolio_passed: summary.portfolio_passed === true
|
|
10474
|
+
},
|
|
10475
|
+
compare: compare
|
|
10476
|
+
? {
|
|
10477
|
+
previous_generated_at: compare.previous_generated_at || null,
|
|
10478
|
+
previous_template_root: compare.previous_template_root || null,
|
|
10479
|
+
deltas: compare.deltas || null,
|
|
10480
|
+
failed_templates: {
|
|
10481
|
+
newly_failed: Array.isArray(failedTemplates.newly_failed) ? failedTemplates.newly_failed : [],
|
|
10482
|
+
recovered: Array.isArray(failedTemplates.recovered) ? failedTemplates.recovered : []
|
|
10483
|
+
}
|
|
10484
|
+
}
|
|
10485
|
+
: null,
|
|
10486
|
+
output: {
|
|
10487
|
+
json: toAutoHandoffCliPath(projectPath, outputJsonPath),
|
|
10488
|
+
markdown: toAutoHandoffCliPath(projectPath, outputMarkdownPath)
|
|
10489
|
+
},
|
|
10490
|
+
warnings: stderr ? [stderr] : []
|
|
10491
|
+
};
|
|
10492
|
+
}
|
|
10493
|
+
|
|
10221
10494
|
async function runAutoHandoff(projectPath, options = {}) {
|
|
10222
10495
|
const startedAtMs = Date.now();
|
|
10223
10496
|
const result = {
|
|
@@ -10239,6 +10512,7 @@ async function runAutoHandoff(projectPath, options = {}) {
|
|
|
10239
10512
|
observability_snapshot: null,
|
|
10240
10513
|
spec_status: null,
|
|
10241
10514
|
ontology_validation: null,
|
|
10515
|
+
moqui_baseline: null,
|
|
10242
10516
|
gates: null,
|
|
10243
10517
|
regression: null,
|
|
10244
10518
|
release_evidence: null,
|
|
@@ -10340,6 +10614,25 @@ async function runAutoHandoff(projectPath, options = {}) {
|
|
|
10340
10614
|
null,
|
|
10341
10615
|
continuationBaselineSummary
|
|
10342
10616
|
);
|
|
10617
|
+
const baselinePhase = beginAutoHandoffRunPhase(result, 'moqui-baseline', 'Moqui template baseline scorecard');
|
|
10618
|
+
try {
|
|
10619
|
+
result.moqui_baseline = await buildAutoHandoffMoquiBaselineSnapshot(projectPath);
|
|
10620
|
+
completeAutoHandoffRunPhase(
|
|
10621
|
+
baselinePhase,
|
|
10622
|
+
buildAutoHandoffMoquiBaselinePhaseDetails(result.moqui_baseline)
|
|
10623
|
+
);
|
|
10624
|
+
if (result.moqui_baseline && result.moqui_baseline.status === 'error') {
|
|
10625
|
+
result.warnings.push(`moqui baseline generation failed: ${result.moqui_baseline.error || 'unknown error'}`);
|
|
10626
|
+
}
|
|
10627
|
+
} catch (baselineError) {
|
|
10628
|
+
failAutoHandoffRunPhase(baselinePhase, baselineError);
|
|
10629
|
+
result.moqui_baseline = {
|
|
10630
|
+
status: 'error',
|
|
10631
|
+
generated: false,
|
|
10632
|
+
error: baselineError && baselineError.message ? baselineError.message : `${baselineError}`
|
|
10633
|
+
};
|
|
10634
|
+
result.warnings.push(`moqui baseline generation failed: ${result.moqui_baseline.error}`);
|
|
10635
|
+
}
|
|
10343
10636
|
result.gates = evaluateAutoHandoffRunGates({
|
|
10344
10637
|
policy: result.policy,
|
|
10345
10638
|
dryRun: true,
|
|
@@ -10400,6 +10693,26 @@ async function runAutoHandoff(projectPath, options = {}) {
|
|
|
10400
10693
|
throw error;
|
|
10401
10694
|
}
|
|
10402
10695
|
|
|
10696
|
+
const baselinePhase = beginAutoHandoffRunPhase(result, 'moqui-baseline', 'Moqui template baseline scorecard');
|
|
10697
|
+
try {
|
|
10698
|
+
result.moqui_baseline = await buildAutoHandoffMoquiBaselineSnapshot(projectPath);
|
|
10699
|
+
completeAutoHandoffRunPhase(
|
|
10700
|
+
baselinePhase,
|
|
10701
|
+
buildAutoHandoffMoquiBaselinePhaseDetails(result.moqui_baseline)
|
|
10702
|
+
);
|
|
10703
|
+
if (result.moqui_baseline && result.moqui_baseline.status === 'error') {
|
|
10704
|
+
result.warnings.push(`moqui baseline generation failed: ${result.moqui_baseline.error || 'unknown error'}`);
|
|
10705
|
+
}
|
|
10706
|
+
} catch (baselineError) {
|
|
10707
|
+
failAutoHandoffRunPhase(baselinePhase, baselineError);
|
|
10708
|
+
result.moqui_baseline = {
|
|
10709
|
+
status: 'error',
|
|
10710
|
+
generated: false,
|
|
10711
|
+
error: baselineError && baselineError.message ? baselineError.message : `${baselineError}`
|
|
10712
|
+
};
|
|
10713
|
+
result.warnings.push(`moqui baseline generation failed: ${result.moqui_baseline.error}`);
|
|
10714
|
+
}
|
|
10715
|
+
|
|
10403
10716
|
result.gates = evaluateAutoHandoffRunGates({
|
|
10404
10717
|
policy: result.policy,
|
|
10405
10718
|
dryRun: false,
|
package/lib/commands/scene.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const zlib = require('zlib');
|
|
3
3
|
const crypto = require('crypto');
|
|
4
|
+
const { spawnSync } = require('child_process');
|
|
4
5
|
const fs = require('fs-extra');
|
|
5
6
|
const chalk = require('chalk');
|
|
6
7
|
const yaml = require('js-yaml');
|
|
@@ -60,6 +61,9 @@ const SCENE_PACKAGE_KINDS = new Set([
|
|
|
60
61
|
const SCENE_PACKAGE_RISK_LEVELS = new Set(['low', 'medium', 'high', 'critical']);
|
|
61
62
|
const SCENE_PACKAGE_TEMPLATE_API_VERSION = 'kse.scene.template/v0.1';
|
|
62
63
|
const SCENE_PACKAGE_TEMPLATE_DEFAULT_DIR = '.kiro/templates/scene-packages';
|
|
64
|
+
const SCENE_MOQUI_BASELINE_DEFAULT_MATCH = '(moqui|erp)';
|
|
65
|
+
const SCENE_MOQUI_BASELINE_DEFAULT_MIN_SCORE = 70;
|
|
66
|
+
const SCENE_MOQUI_BASELINE_DEFAULT_MIN_VALID_RATE = 100;
|
|
63
67
|
const SCENE_PACKAGE_BATCH_DEFAULT_ONTOLOGY_MIN_AVERAGE_SCORE = 70;
|
|
64
68
|
const SCENE_PACKAGE_BATCH_DEFAULT_ONTOLOGY_MIN_VALID_RATE = 100;
|
|
65
69
|
const SCENE_PACKAGE_GATE_API_VERSION = 'kse.scene.package-gate/v0.1';
|
|
@@ -536,6 +540,23 @@ function registerSceneCommands(program) {
|
|
|
536
540
|
await runSceneTemplateRenderCommand(options);
|
|
537
541
|
});
|
|
538
542
|
|
|
543
|
+
sceneCmd
|
|
544
|
+
.command('moqui-baseline')
|
|
545
|
+
.description('Generate Moqui template baseline scorecard from scene package library')
|
|
546
|
+
.option('--template-dir <path>', 'Template root directory', SCENE_PACKAGE_TEMPLATE_DEFAULT_DIR)
|
|
547
|
+
.option('--out <path>', 'JSON report output path', '.kiro/reports/moqui-template-baseline.json')
|
|
548
|
+
.option('--markdown-out <path>', 'Markdown report output path', '.kiro/reports/moqui-template-baseline.md')
|
|
549
|
+
.option('--match <regex>', 'Template selector regex', SCENE_MOQUI_BASELINE_DEFAULT_MATCH)
|
|
550
|
+
.option('--include-all', 'Disable selector filter and score all templates')
|
|
551
|
+
.option('--min-score <number>', 'Baseline minimum semantic score (0-100)', String(SCENE_MOQUI_BASELINE_DEFAULT_MIN_SCORE))
|
|
552
|
+
.option('--min-valid-rate <number>', 'Baseline minimum ontology valid-rate percent (0-100)', String(SCENE_MOQUI_BASELINE_DEFAULT_MIN_VALID_RATE))
|
|
553
|
+
.option('--compare-with <path>', 'Compare with previous baseline JSON report')
|
|
554
|
+
.option('--fail-on-portfolio-fail', 'Exit non-zero when portfolio baseline gate fails')
|
|
555
|
+
.option('--json', 'Print payload as JSON')
|
|
556
|
+
.action(async (options) => {
|
|
557
|
+
await runSceneMoquiBaselineCommand(options);
|
|
558
|
+
});
|
|
559
|
+
|
|
539
560
|
sceneCmd
|
|
540
561
|
.command('instantiate')
|
|
541
562
|
.description('Instantiate scene template package with full pipeline (resolve, validate, render, manifest, log, hook)')
|
|
@@ -10960,6 +10981,48 @@ function validateSceneTemplateResolveOptions(options) {
|
|
|
10960
10981
|
return null;
|
|
10961
10982
|
}
|
|
10962
10983
|
|
|
10984
|
+
function normalizeSceneMoquiBaselineOptions(options = {}) {
|
|
10985
|
+
const minScore = Number(options.minScore);
|
|
10986
|
+
const minValidRate = Number(options.minValidRate);
|
|
10987
|
+
return {
|
|
10988
|
+
templateDir: options.templateDir ? String(options.templateDir).trim() : SCENE_PACKAGE_TEMPLATE_DEFAULT_DIR,
|
|
10989
|
+
out: options.out ? String(options.out).trim() : '.kiro/reports/moqui-template-baseline.json',
|
|
10990
|
+
markdownOut: options.markdownOut ? String(options.markdownOut).trim() : '.kiro/reports/moqui-template-baseline.md',
|
|
10991
|
+
match: options.match ? String(options.match).trim() : SCENE_MOQUI_BASELINE_DEFAULT_MATCH,
|
|
10992
|
+
includeAll: options.includeAll === true,
|
|
10993
|
+
minScore: Number.isFinite(minScore) ? minScore : SCENE_MOQUI_BASELINE_DEFAULT_MIN_SCORE,
|
|
10994
|
+
minValidRate: Number.isFinite(minValidRate) ? minValidRate : SCENE_MOQUI_BASELINE_DEFAULT_MIN_VALID_RATE,
|
|
10995
|
+
compareWith: options.compareWith ? String(options.compareWith).trim() : undefined,
|
|
10996
|
+
failOnPortfolioFail: options.failOnPortfolioFail === true,
|
|
10997
|
+
json: options.json === true
|
|
10998
|
+
};
|
|
10999
|
+
}
|
|
11000
|
+
|
|
11001
|
+
function validateSceneMoquiBaselineOptions(options) {
|
|
11002
|
+
if (!options.templateDir || typeof options.templateDir !== 'string' || options.templateDir.trim().length === 0) {
|
|
11003
|
+
return '--template-dir is required';
|
|
11004
|
+
}
|
|
11005
|
+
if (!options.out || typeof options.out !== 'string' || options.out.trim().length === 0) {
|
|
11006
|
+
return '--out is required';
|
|
11007
|
+
}
|
|
11008
|
+
if (!options.markdownOut || typeof options.markdownOut !== 'string' || options.markdownOut.trim().length === 0) {
|
|
11009
|
+
return '--markdown-out is required';
|
|
11010
|
+
}
|
|
11011
|
+
if (!options.match || typeof options.match !== 'string' || options.match.trim().length === 0) {
|
|
11012
|
+
return '--match is required';
|
|
11013
|
+
}
|
|
11014
|
+
if (!Number.isFinite(Number(options.minScore)) || Number(options.minScore) < 0 || Number(options.minScore) > 100) {
|
|
11015
|
+
return '--min-score must be a number between 0 and 100';
|
|
11016
|
+
}
|
|
11017
|
+
if (!Number.isFinite(Number(options.minValidRate)) || Number(options.minValidRate) < 0 || Number(options.minValidRate) > 100) {
|
|
11018
|
+
return '--min-valid-rate must be a number between 0 and 100';
|
|
11019
|
+
}
|
|
11020
|
+
if (options.compareWith !== undefined && (!options.compareWith || options.compareWith.length === 0)) {
|
|
11021
|
+
return '--compare-with cannot be empty';
|
|
11022
|
+
}
|
|
11023
|
+
return null;
|
|
11024
|
+
}
|
|
11025
|
+
|
|
10963
11026
|
// --- Print functions for template commands ---
|
|
10964
11027
|
|
|
10965
11028
|
function printSceneTemplateValidateSummary(options, payload, projectRoot = process.cwd()) {
|
|
@@ -11076,6 +11139,80 @@ function printSceneTemplateRenderSummary(options, payload, projectRoot = process
|
|
|
11076
11139
|
|
|
11077
11140
|
// --- Command runners for template commands ---
|
|
11078
11141
|
|
|
11142
|
+
async function runSceneMoquiBaselineCommand(rawOptions = {}, dependencies = {}) {
|
|
11143
|
+
const projectRoot = dependencies.projectRoot || process.cwd();
|
|
11144
|
+
const fileSystem = dependencies.fileSystem || fs;
|
|
11145
|
+
|
|
11146
|
+
const options = normalizeSceneMoquiBaselineOptions(rawOptions);
|
|
11147
|
+
const validationError = validateSceneMoquiBaselineOptions(options);
|
|
11148
|
+
if (validationError) {
|
|
11149
|
+
console.error(chalk.red(`Scene moqui-baseline failed: ${validationError}`));
|
|
11150
|
+
process.exitCode = 1;
|
|
11151
|
+
return null;
|
|
11152
|
+
}
|
|
11153
|
+
|
|
11154
|
+
const scriptPath = path.join(projectRoot, 'scripts', 'moqui-template-baseline-report.js');
|
|
11155
|
+
const scriptExists = await fileSystem.pathExists(scriptPath);
|
|
11156
|
+
if (!scriptExists) {
|
|
11157
|
+
console.error(chalk.red(`Scene moqui-baseline failed: script not found at ${scriptPath}`));
|
|
11158
|
+
process.exitCode = 1;
|
|
11159
|
+
return null;
|
|
11160
|
+
}
|
|
11161
|
+
|
|
11162
|
+
const args = [scriptPath];
|
|
11163
|
+
args.push('--template-dir', options.templateDir);
|
|
11164
|
+
args.push('--out', options.out);
|
|
11165
|
+
args.push('--markdown-out', options.markdownOut);
|
|
11166
|
+
args.push('--match', options.match);
|
|
11167
|
+
args.push('--min-score', String(options.minScore));
|
|
11168
|
+
args.push('--min-valid-rate', String(options.minValidRate));
|
|
11169
|
+
if (options.includeAll) {
|
|
11170
|
+
args.push('--include-all');
|
|
11171
|
+
}
|
|
11172
|
+
if (options.compareWith) {
|
|
11173
|
+
args.push('--compare-with', options.compareWith);
|
|
11174
|
+
}
|
|
11175
|
+
if (options.failOnPortfolioFail) {
|
|
11176
|
+
args.push('--fail-on-portfolio-fail');
|
|
11177
|
+
}
|
|
11178
|
+
if (options.json) {
|
|
11179
|
+
args.push('--json');
|
|
11180
|
+
}
|
|
11181
|
+
|
|
11182
|
+
const result = spawnSync(process.execPath, args, {
|
|
11183
|
+
cwd: projectRoot,
|
|
11184
|
+
encoding: 'utf8'
|
|
11185
|
+
});
|
|
11186
|
+
|
|
11187
|
+
if (typeof result.stdout === 'string' && result.stdout.length > 0) {
|
|
11188
|
+
process.stdout.write(result.stdout);
|
|
11189
|
+
}
|
|
11190
|
+
if (typeof result.stderr === 'string' && result.stderr.length > 0) {
|
|
11191
|
+
process.stderr.write(result.stderr);
|
|
11192
|
+
}
|
|
11193
|
+
|
|
11194
|
+
if (result.error) {
|
|
11195
|
+
console.error(chalk.red(`Scene moqui-baseline failed: ${result.error.message}`));
|
|
11196
|
+
process.exitCode = 1;
|
|
11197
|
+
return null;
|
|
11198
|
+
}
|
|
11199
|
+
|
|
11200
|
+
const exitCode = Number.isInteger(result.status) ? result.status : 1;
|
|
11201
|
+
if (exitCode !== 0) {
|
|
11202
|
+
process.exitCode = exitCode;
|
|
11203
|
+
}
|
|
11204
|
+
|
|
11205
|
+
if (options.json && typeof result.stdout === 'string' && result.stdout.trim().length > 0) {
|
|
11206
|
+
try {
|
|
11207
|
+
return JSON.parse(result.stdout);
|
|
11208
|
+
} catch (_error) {
|
|
11209
|
+
return null;
|
|
11210
|
+
}
|
|
11211
|
+
}
|
|
11212
|
+
|
|
11213
|
+
return null;
|
|
11214
|
+
}
|
|
11215
|
+
|
|
11079
11216
|
async function runSceneTemplateValidateCommand(rawOptions = {}, dependencies = {}) {
|
|
11080
11217
|
const projectRoot = dependencies.projectRoot || process.cwd();
|
|
11081
11218
|
const fileSystem = dependencies.fileSystem || fs;
|
|
@@ -15266,6 +15403,9 @@ module.exports = {
|
|
|
15266
15403
|
validateSceneTemplateValidateOptions,
|
|
15267
15404
|
normalizeSceneTemplateResolveOptions,
|
|
15268
15405
|
validateSceneTemplateResolveOptions,
|
|
15406
|
+
normalizeSceneMoquiBaselineOptions,
|
|
15407
|
+
validateSceneMoquiBaselineOptions,
|
|
15408
|
+
runSceneMoquiBaselineCommand,
|
|
15269
15409
|
runSceneTemplateValidateCommand,
|
|
15270
15410
|
runSceneTemplateResolveCommand,
|
|
15271
15411
|
runSceneTemplateRenderCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kiro-spec-engine",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.32",
|
|
4
4
|
"description": "kiro-spec-engine (kse) - A CLI tool and npm package for spec-driven development with AI coding assistants. NOT the Kiro IDE desktop application.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|