kiro-spec-engine 1.47.31 → 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`).
|
|
@@ -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:
|
|
@@ -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/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": {
|