@design-ai/cli 4.56.0 → 4.57.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.
- package/.claude-plugin/plugin.json +109 -25
- package/CHANGELOG.md +36 -0
- package/README.ko.md +9 -26
- package/README.md +10 -23
- package/cli/bin/design-ai.mjs +1 -0
- package/cli/commands/help.mjs +7 -4
- package/cli/commands/index.mjs +292 -0
- package/cli/commands/learn-help.mjs +149 -0
- package/cli/commands/learn-print-profile.mjs +373 -0
- package/cli/commands/learn-print-restore.mjs +349 -0
- package/cli/commands/learn-print-signals.mjs +453 -0
- package/cli/commands/learn.mjs +60 -1281
- package/cli/commands/pack.mjs +7 -3
- package/cli/commands/prompt.mjs +7 -3
- package/cli/commands/search.mjs +94 -1
- package/cli/lib/dispatch.mjs +3 -0
- package/cli/lib/embedding-index.mjs +199 -0
- package/cli/lib/embedding-provider.mjs +121 -0
- package/cli/lib/embedding-rerank.mjs +52 -0
- package/cli/lib/learn-args.mjs +490 -0
- package/cli/lib/learn-backup.mjs +748 -0
- package/cli/lib/learn-curation.mjs +612 -0
- package/cli/lib/learn-eval.mjs +459 -0
- package/cli/lib/learn-profile.mjs +763 -0
- package/cli/lib/learn-select.mjs +223 -0
- package/cli/lib/learn-shared.mjs +158 -0
- package/cli/lib/learn-test-support.mjs +218 -0
- package/cli/lib/learn-usage.mjs +360 -0
- package/cli/lib/learn.mjs +83 -3694
- package/cli/lib/lexical.mjs +137 -0
- package/cli/lib/local-config.mjs +110 -0
- package/cli/lib/mcp-server.mjs +13 -3
- package/cli/lib/pack.mjs +31 -4
- package/cli/lib/prompt.mjs +42 -4
- package/cli/lib/recall.mjs +193 -0
- package/cli/lib/retrieval-index.mjs +0 -0
- package/cli/lib/search-ranked.mjs +170 -0
- package/cli/lib/search.mjs +11 -1
- package/cli/lib/signals-backlog-commands.mjs +673 -0
- package/cli/lib/signals-backlog.mjs +361 -0
- package/cli/lib/signals-eval.mjs +176 -0
- package/cli/lib/signals-readiness.mjs +247 -0
- package/cli/lib/signals-registry.mjs +377 -0
- package/cli/lib/signals-render.mjs +478 -0
- package/cli/lib/signals-shared.mjs +75 -0
- package/cli/lib/signals.mjs +16 -2337
- package/cli/lib/site-bundle-handoff-expected.mjs +173 -0
- package/cli/lib/site-bundle-handoff-runbook-action-summary.mjs +332 -0
- package/cli/lib/site-bundle-handoff-runbook-human-lines.mjs +167 -0
- package/cli/lib/site-bundle-handoff-runbook-maps.mjs +238 -0
- package/cli/lib/site-bundle-handoff-runbook-next-step.mjs +278 -0
- package/cli/lib/site-bundle-handoff-runbook.mjs +44 -931
- package/cli/lib/site-test-support.mjs +68 -0
- package/cli/lib/skill-proposals-apply-commands.mjs +135 -0
- package/cli/lib/skill-proposals-apply-contract.mjs +750 -0
- package/cli/lib/skill-proposals-apply-plan.mjs +118 -0
- package/cli/lib/skill-proposals-generate.mjs +298 -0
- package/cli/lib/skill-proposals-render.mjs +532 -0
- package/cli/lib/skill-proposals-review.mjs +262 -0
- package/cli/lib/skill-proposals.mjs +15 -2046
- package/cli/lib/workspace-args.mjs +83 -0
- package/cli/lib/workspace-git.mjs +169 -0
- package/cli/lib/workspace-learning.mjs +483 -0
- package/cli/lib/workspace-repo.mjs +139 -0
- package/cli/lib/workspace-report.mjs +283 -0
- package/cli/lib/workspace-test-support.mjs +99 -0
- package/cli/lib/workspace.mjs +30 -1056
- package/docs/AI-LEARNING-PHASE2.md +215 -0
- package/docs/DISTRIBUTION.ko.md +2 -2
- package/docs/DISTRIBUTION.md +2 -2
- package/docs/NEXT-SURFACE-DECISION.md +125 -0
- package/docs/PRODUCT-READINESS.md +3 -3
- package/docs/RELEASE-GATES.ko.md +35 -0
- package/docs/RELEASE-GATES.md +234 -0
- package/docs/ROADMAP.md +53 -8
- package/docs/external-status.md +6 -8
- package/docs/inspection-20260630.md +169 -0
- package/docs/integrations/design-ai-mcp-server.md +4 -4
- package/docs/reference/ant-design.md +413 -0
- package/docs/reference/awesome-design-md.md +439 -0
- package/docs/reference/mui.md +783 -0
- package/docs/reference/shadcn-ui.md +298 -0
- package/examples/component-accordion-actions.md +5 -5
- package/examples/component-accordion-details.md +5 -5
- package/examples/component-accordion-summary.md +5 -5
- package/examples/component-accordion.md +3 -3
- package/examples/component-affix.md +1 -1
- package/examples/component-alert-dialog.md +1 -1
- package/examples/component-alert-title.md +1 -1
- package/examples/component-alert.md +3 -3
- package/examples/component-anchor.md +1 -1
- package/examples/component-app-bar.md +1 -1
- package/examples/component-aspect-ratio.md +1 -1
- package/examples/component-auto-complete.md +2 -2
- package/examples/component-avatar-group.md +5 -5
- package/examples/component-avatar.md +3 -3
- package/examples/component-back-top.md +1 -1
- package/examples/component-backdrop.md +1 -1
- package/examples/component-badge.md +3 -3
- package/examples/component-border-beam.md +3 -3
- package/examples/component-bottom-navigation.md +1 -1
- package/examples/component-box.md +1 -1
- package/examples/component-breadcrumb.md +3 -3
- package/examples/component-button-base.md +3 -3
- package/examples/component-button-group.md +2 -2
- package/examples/component-button.md +3 -3
- package/examples/component-calendar.md +2 -2
- package/examples/component-card-actions.md +1 -1
- package/examples/component-card-content.md +1 -1
- package/examples/component-card-header.md +1 -1
- package/examples/component-card-media.md +1 -1
- package/examples/component-card.md +3 -3
- package/examples/component-carousel.md +2 -2
- package/examples/component-cascader.md +1 -1
- package/examples/component-chart.md +1 -1
- package/examples/component-checkbox.md +3 -3
- package/examples/component-click-away-listener.md +1 -1
- package/examples/component-code.md +1 -1
- package/examples/component-collapsible.md +1 -1
- package/examples/component-color-picker.md +1 -1
- package/examples/component-combobox.md +1 -1
- package/examples/component-command.md +1 -1
- package/examples/component-config-provider.md +3 -3
- package/examples/component-context-menu.md +1 -1
- package/examples/component-css-baseline.md +3 -3
- package/examples/component-date-picker.md +2 -2
- package/examples/component-descriptions.md +1 -1
- package/examples/component-dialog-actions.md +1 -1
- package/examples/component-dialog-content-text.md +1 -1
- package/examples/component-dialog-content.md +1 -1
- package/examples/component-dialog-title.md +1 -1
- package/examples/component-dialog.md +2 -2
- package/examples/component-divider.md +3 -3
- package/examples/component-drawer.md +3 -3
- package/examples/component-dropdown.md +3 -3
- package/examples/component-empty.md +2 -2
- package/examples/component-fade.md +1 -1
- package/examples/component-field.md +1 -1
- package/examples/component-filled-input.md +1 -1
- package/examples/component-flex.md +1 -1
- package/examples/component-float-button.md +2 -2
- package/examples/component-form-control-label.md +1 -1
- package/examples/component-form-control.md +1 -1
- package/examples/component-form-controls.md +1 -1
- package/examples/component-form-group.md +1 -1
- package/examples/component-form-helper-text.md +1 -1
- package/examples/component-form-label.md +1 -1
- package/examples/component-form.md +2 -2
- package/examples/component-grid.md +2 -2
- package/examples/component-grow.md +1 -1
- package/examples/component-hover-card.md +1 -1
- package/examples/component-icon-button.md +1 -1
- package/examples/component-icon.md +1 -1
- package/examples/component-image-list.md +1 -1
- package/examples/component-image.md +1 -1
- package/examples/component-input-adornment.md +1 -1
- package/examples/component-input-base.md +1 -1
- package/examples/component-input-number.md +1 -1
- package/examples/component-input-otp.md +2 -2
- package/examples/component-input.md +3 -3
- package/examples/component-item.md +1 -1
- package/examples/component-label.md +1 -1
- package/examples/component-layout.md +1 -1
- package/examples/component-link.md +1 -1
- package/examples/component-list-item-avatar.md +1 -1
- package/examples/component-list-item-button.md +1 -1
- package/examples/component-list-item-icon.md +1 -1
- package/examples/component-list-item-text.md +1 -1
- package/examples/component-list-item.md +1 -1
- package/examples/component-list-subheader.md +1 -1
- package/examples/component-list.md +2 -2
- package/examples/component-masonry.md +1 -1
- package/examples/component-mentions.md +1 -1
- package/examples/component-menu-item.md +1 -1
- package/examples/component-menu-list.md +1 -1
- package/examples/component-menu.md +1 -1
- package/examples/component-menubar.md +1 -1
- package/examples/component-message.md +1 -1
- package/examples/component-mobile-stepper.md +1 -1
- package/examples/component-modal.md +5 -5
- package/examples/component-navigation-menu.md +1 -1
- package/examples/component-notification.md +1 -1
- package/examples/component-outlined-input.md +1 -1
- package/examples/component-pagination.md +3 -3
- package/examples/component-paper.md +1 -1
- package/examples/component-popconfirm.md +1 -1
- package/examples/component-popover.md +3 -3
- package/examples/component-popper.md +1 -1
- package/examples/component-progress.md +2 -2
- package/examples/component-qr-code.md +1 -1
- package/examples/component-radio.md +3 -3
- package/examples/component-rate.md +2 -2
- package/examples/component-resizable.md +1 -1
- package/examples/component-result.md +1 -1
- package/examples/component-scroll-area.md +1 -1
- package/examples/component-segmented.md +3 -3
- package/examples/component-select.md +3 -3
- package/examples/component-separator.md +1 -1
- package/examples/component-sheet.md +1 -1
- package/examples/component-sidebar.md +1 -1
- package/examples/component-skeleton.md +3 -3
- package/examples/component-slide.md +1 -1
- package/examples/component-slider.md +3 -3
- package/examples/component-snackbar-content.md +1 -1
- package/examples/component-snackbar.md +1 -1
- package/examples/component-sonner.md +1 -1
- package/examples/component-space.md +1 -1
- package/examples/component-speed-dial-action.md +1 -1
- package/examples/component-speed-dial.md +1 -1
- package/examples/component-spin.md +2 -2
- package/examples/component-spinner.md +1 -1
- package/examples/component-splitter.md +2 -2
- package/examples/component-stack.md +1 -1
- package/examples/component-statistic.md +1 -1
- package/examples/component-step-button.md +4 -4
- package/examples/component-step-connector.md +4 -4
- package/examples/component-step-content.md +1 -1
- package/examples/component-step-icon.md +1 -1
- package/examples/component-step-label.md +1 -1
- package/examples/component-step.md +2 -2
- package/examples/component-steps.md +2 -2
- package/examples/component-swipeable-drawer.md +1 -1
- package/examples/component-switch.md +3 -3
- package/examples/component-tab-scroll-button.md +5 -5
- package/examples/component-tab.md +1 -1
- package/examples/component-table-body.md +1 -1
- package/examples/component-table-cell.md +1 -1
- package/examples/component-table-container.md +1 -1
- package/examples/component-table-footer.md +1 -1
- package/examples/component-table-head.md +1 -1
- package/examples/component-table-pagination.md +1 -1
- package/examples/component-table-row.md +1 -1
- package/examples/component-table-sort-label.md +1 -1
- package/examples/component-table.md +2 -2
- package/examples/component-tabs.md +3 -3
- package/examples/component-tag-badge.md +2 -2
- package/examples/component-tag.md +1 -1
- package/examples/component-textarea-autosize.md +1 -1
- package/examples/component-textarea.md +1 -1
- package/examples/component-time-picker.md +1 -1
- package/examples/component-timeline.md +1 -1
- package/examples/component-toast.md +4 -4
- package/examples/component-toggle-button.md +1 -1
- package/examples/component-toggle.md +1 -1
- package/examples/component-toolbar.md +1 -1
- package/examples/component-tooltip.md +3 -3
- package/examples/component-tour.md +1 -1
- package/examples/component-transfer.md +1 -1
- package/examples/component-tree-select.md +1 -1
- package/examples/component-tree.md +1 -1
- package/examples/component-typography.md +2 -2
- package/examples/component-upload.md +1 -1
- package/examples/component-watermark.md +1 -1
- package/examples/component-zoom.md +1 -1
- package/knowledge/COVERAGE.md +4 -3
- package/knowledge/components/INDEX.md +202 -202
- package/knowledge/patterns/brand-references.md +72 -72
- package/package.json +1 -1
- package/tools/audit/local-ci.py +16 -1
- package/tools/audit/package-smoke.py +611 -9
- package/tools/audit/registry-smoke.py +534 -0
- package/tools/audit/release-metadata.py +47 -1
- package/tools/audit/smoke_assertions.py +915 -13
- package/tools/migrations/refs-links-to-reference-pages.py +179 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
// Human-readable output for learn signals/agent-backlog/skill-proposal results.
|
|
2
|
+
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
import { dim, header, info } from "../lib/log.mjs";
|
|
6
|
+
|
|
7
|
+
export function printLearnRecall(payload) {
|
|
8
|
+
header("design-ai learn", "Recall (read-only)");
|
|
9
|
+
info(`Query: ${payload.query || "(none)"}`);
|
|
10
|
+
info(`Corpus: ${payload.corpus.selectedCount}/${payload.corpus.candidateCount} selected`);
|
|
11
|
+
info(`Learning: ${payload.learning.selectedCount}/${payload.learning.candidateCount} selected (${payload.learning.mode})`);
|
|
12
|
+
console.log();
|
|
13
|
+
|
|
14
|
+
console.log("Corpus:");
|
|
15
|
+
if (payload.corpus.selected.length === 0) {
|
|
16
|
+
console.log(` ${dim("No corpus knowledge files matched this query.")}`);
|
|
17
|
+
} else {
|
|
18
|
+
for (const item of payload.corpus.selected) {
|
|
19
|
+
const tokens = item.matchedTokens.length > 0 ? item.matchedTokens.join(", ") : "none";
|
|
20
|
+
console.log(`- ${item.id} · ${item.score} · ${dim(tokens)}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
console.log();
|
|
24
|
+
|
|
25
|
+
console.log("Learning:");
|
|
26
|
+
if (payload.learning.selected.length === 0) {
|
|
27
|
+
console.log(` ${dim("No local learning entries matched this query.")}`);
|
|
28
|
+
} else {
|
|
29
|
+
for (const item of payload.learning.selected) {
|
|
30
|
+
const tokens = item.matchedTokens.length > 0 ? item.matchedTokens.join(", ") : "none";
|
|
31
|
+
console.log(`- ${item.id} [${item.category}] · ${item.score} · ${dim(tokens)} · ${item.text}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
console.log();
|
|
35
|
+
|
|
36
|
+
console.log("Privacy: recall is read-only and does not mutate learning.json or any file.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function printSignals(payload) {
|
|
40
|
+
header("design-ai learn", "Learning signal registry");
|
|
41
|
+
info(`File: ${payload.file}`);
|
|
42
|
+
info(`Status: ${payload.status}`);
|
|
43
|
+
info(`Signal source: ${payload.signalSource}`);
|
|
44
|
+
info(`Learning entries: ${payload.learning.count}`);
|
|
45
|
+
info(`Learning audit: ${payload.learning.auditSummary.status} (${payload.learning.auditSummary.failures} failure(s), ${payload.learning.auditSummary.warnings} warning(s))`);
|
|
46
|
+
info(`Usage events: ${payload.usage.eventCount}`);
|
|
47
|
+
info(`Eval signals: ${payload.evals.count} (${payload.evals.reports} report(s), ${payload.evals.templates} template(s))`);
|
|
48
|
+
info(`Check capture entries: ${payload.checkCapture.count}`);
|
|
49
|
+
info(`Workspace next actions: ${payload.workspace.nextActionCount}`);
|
|
50
|
+
console.log();
|
|
51
|
+
|
|
52
|
+
if (payload.evals.files.length > 0) {
|
|
53
|
+
console.log("Eval signals:");
|
|
54
|
+
for (const item of payload.evals.files) {
|
|
55
|
+
const label = path.basename(item.file);
|
|
56
|
+
const counts = item.shape === "report"
|
|
57
|
+
? ` · pass ${item.passed} / warn ${item.warned} / fail ${item.failed}`
|
|
58
|
+
: "";
|
|
59
|
+
console.log(`- ${label}: ${item.kind} ${item.shape} ${item.status} (${item.caseCount} case(s))${counts}`);
|
|
60
|
+
if (item.error) console.log(` ${dim(item.error)}`);
|
|
61
|
+
}
|
|
62
|
+
console.log();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (payload.checkCapture.latestEntries.length > 0) {
|
|
66
|
+
console.log("Recent check captures:");
|
|
67
|
+
for (const entry of payload.checkCapture.latestEntries) {
|
|
68
|
+
console.log(`- ${entry.id}: [${entry.category}] ${entry.source}`);
|
|
69
|
+
if (entry.textPreview) console.log(` ${dim(entry.textPreview)}`);
|
|
70
|
+
}
|
|
71
|
+
console.log();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log("Workspace readiness:");
|
|
75
|
+
console.log(`- branch: ${payload.workspace.git.branch || "unknown"} (${payload.workspace.git.clean ? "clean" : "dirty"})`);
|
|
76
|
+
console.log(`- repository: ${payload.workspace.repository.status || "unknown"}`);
|
|
77
|
+
console.log(`- learning usage: ${payload.workspace.learningUsage?.status || "not checked"}`);
|
|
78
|
+
console.log(`- learning eval: ${payload.workspace.learningEval?.status || "not checked"}`);
|
|
79
|
+
console.log();
|
|
80
|
+
|
|
81
|
+
if (payload.agentDevelopment?.actions?.length > 0) {
|
|
82
|
+
console.log("Agent development backlog:");
|
|
83
|
+
for (const action of payload.agentDevelopment.actions.slice(0, 6)) {
|
|
84
|
+
console.log(`- ${action.rank}. ${action.priority} ${action.category}: ${action.title}`);
|
|
85
|
+
if (action.command) console.log(` ${dim(action.command)}`);
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (payload.recommendations.length > 0) {
|
|
91
|
+
console.log("Recommendations:");
|
|
92
|
+
for (const recommendation of payload.recommendations) {
|
|
93
|
+
console.log(`- ${recommendation.level}: ${recommendation.text}`);
|
|
94
|
+
}
|
|
95
|
+
console.log();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.log("Privacy: signal registry is read-only and does not mutate learning.json.");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function printAgentBacklog(payload) {
|
|
102
|
+
header("design-ai learn", "Agent development backlog");
|
|
103
|
+
info(`File: ${payload.file}`);
|
|
104
|
+
info(`Status: ${payload.status}`);
|
|
105
|
+
info(`Signal status: ${payload.signalStatus}`);
|
|
106
|
+
info(`Signal source: ${payload.signalSource}`);
|
|
107
|
+
info(`Actions: ${payload.counts.actions}`);
|
|
108
|
+
info(`Priority: P0 ${payload.counts.p0}, P1 ${payload.counts.p1}, P2 ${payload.counts.p2}, P3 ${payload.counts.p3}`);
|
|
109
|
+
info(`Learning entries: ${payload.counts.learningEntries}`);
|
|
110
|
+
info(`Usage events: ${payload.counts.usageEvents}`);
|
|
111
|
+
info(`Eval signals: ${payload.counts.evalSignals}`);
|
|
112
|
+
info(`Check captures: ${payload.counts.checkCaptures}`);
|
|
113
|
+
console.log();
|
|
114
|
+
|
|
115
|
+
if (payload.actions.length === 0) {
|
|
116
|
+
console.log("No agent development backlog actions emitted.");
|
|
117
|
+
} else {
|
|
118
|
+
console.log("Backlog actions:");
|
|
119
|
+
for (const action of payload.actions) {
|
|
120
|
+
console.log(`- ${action.rank}. ${action.priority} ${action.category}: ${action.title}`);
|
|
121
|
+
console.log(` ${dim(action.rationale)}`);
|
|
122
|
+
if (action.command) console.log(` ${dim(action.command)}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const planSteps = Array.isArray(payload.actionPlan?.steps) ? payload.actionPlan.steps : [];
|
|
127
|
+
if (planSteps.length > 0) {
|
|
128
|
+
console.log();
|
|
129
|
+
console.log("Action plan:");
|
|
130
|
+
const safety = payload.actionPlan?.safetySummary;
|
|
131
|
+
if (safety) {
|
|
132
|
+
console.log(` ${dim(`safety summary: ${safety.readOnly || 0} read-only, ${safety.writesLocalFile || 0} writes-local-file, ${safety.mutatesLocalState || 0} mutates-local-state`)}`);
|
|
133
|
+
}
|
|
134
|
+
const queue = payload.actionPlan?.executionQueue;
|
|
135
|
+
if (queue) {
|
|
136
|
+
console.log(` ${dim(`execution queue: ${queue.previewCount || 0} preview, ${queue.fileWriteReviewCount || 0} file-write review, ${queue.mutationReviewCount || 0} mutation review`)}`);
|
|
137
|
+
const effectSummary = queue.commandEffectSummary && typeof queue.commandEffectSummary === "object" ? queue.commandEffectSummary : null;
|
|
138
|
+
if (effectSummary) {
|
|
139
|
+
console.log(` ${dim(`command effects: ${effectSummary.outputTargetCount || 0} output, ${effectSummary.profileTargetCount || 0} profile, ${effectSummary.usageTargetCount || 0} usage, ${effectSummary.mutationFlagCount || 0} mutation flags`)}`);
|
|
140
|
+
}
|
|
141
|
+
const effectReview = queue.commandEffectReview && typeof queue.commandEffectReview === "object" ? queue.commandEffectReview : null;
|
|
142
|
+
if (effectReview?.headline) {
|
|
143
|
+
console.log(` ${dim(`command effect review: ${effectReview.headline}`)}`);
|
|
144
|
+
const gatePhaseSummary = effectReview.gatePhaseSummary && typeof effectReview.gatePhaseSummary === "object" ? effectReview.gatePhaseSummary : null;
|
|
145
|
+
if (gatePhaseSummary) {
|
|
146
|
+
const phases = Array.isArray(gatePhaseSummary.phases) && gatePhaseSummary.phases.length > 0
|
|
147
|
+
? gatePhaseSummary.phases.join(", ")
|
|
148
|
+
: "none";
|
|
149
|
+
console.log(` ${dim(`command effect gate phases: ${phases} (${gatePhaseSummary.requiredCount || 0}/${gatePhaseSummary.count || 0} required)`)}`);
|
|
150
|
+
}
|
|
151
|
+
const gateRunbook = effectReview.gateRunbook && typeof effectReview.gateRunbook === "object" ? effectReview.gateRunbook : null;
|
|
152
|
+
if (gateRunbook) {
|
|
153
|
+
const countFor = (phase) => Array.isArray(gateRunbook[phase]) ? gateRunbook[phase].length : 0;
|
|
154
|
+
console.log(` ${dim(`command effect gate runbook: before ${countFor("before")}, after ${countFor("after")}, refresh ${countFor("refresh")}`)}`);
|
|
155
|
+
}
|
|
156
|
+
const gateCommands = Array.isArray(effectReview.gateCommands) ? effectReview.gateCommands : [];
|
|
157
|
+
if (gateCommands.length > 0) {
|
|
158
|
+
const gateSummary = gateCommands
|
|
159
|
+
.map((item) => `${item.phase || "gate"}: ${item.command || ""}`.trim())
|
|
160
|
+
.filter((item) => item !== "")
|
|
161
|
+
.slice(0, 3)
|
|
162
|
+
.join(" -> ");
|
|
163
|
+
console.log(` ${dim(`command effect gates: ${gateSummary}`)}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const operatorRunbook = queue.operatorRunbook && typeof queue.operatorRunbook === "object" ? queue.operatorRunbook : null;
|
|
167
|
+
if (operatorRunbook) {
|
|
168
|
+
console.log(` ${dim(`operator runbook: ${operatorRunbook.stageCount || 0} stages, ${operatorRunbook.commandCount || 0} commands, ${operatorRunbook.requiredCommandCount || 0} required`)}`);
|
|
169
|
+
if (operatorRunbook.nextCommand) {
|
|
170
|
+
console.log(` ${dim(`operator next command: ${operatorRunbook.nextStage || "unknown"}: ${operatorRunbook.nextCommand}`)}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (queue.nextActionId) console.log(` ${dim(`next action: ${queue.nextActionId}`)}`);
|
|
174
|
+
if (queue.nextCommand) console.log(` ${dim(`next command: ${queue.nextCommand}`)}`);
|
|
175
|
+
if (queue.nextCommandRunPolicy) console.log(` ${dim(`next command policy: ${queue.nextCommandRunPolicy}`)}`);
|
|
176
|
+
const ordered = Array.isArray(queue.ordered) ? queue.ordered : [];
|
|
177
|
+
if (ordered.length > 0) {
|
|
178
|
+
console.log(` ${dim(`queue order: ${ordered.slice(0, 3).map((item) => item.actionId).join(" -> ")}`)}`);
|
|
179
|
+
}
|
|
180
|
+
const commandManifest = Array.isArray(queue.commandManifest) ? queue.commandManifest : [];
|
|
181
|
+
if (commandManifest.length > 0) {
|
|
182
|
+
console.log(` ${dim(`command manifest: ${commandManifest.slice(0, 3).map((item) => {
|
|
183
|
+
const effects = item.commandEffects && typeof item.commandEffects === "object" ? item.commandEffects : {};
|
|
184
|
+
const targets = Array.isArray(effects.outputTargets) && effects.outputTargets.length > 0
|
|
185
|
+
? `:${effects.outputTargets.map((target) => target.value).join(",")}`
|
|
186
|
+
: "";
|
|
187
|
+
return `${item.actionId}:${item.runPolicy}${targets}`;
|
|
188
|
+
}).join(" -> ")}`)}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
for (const step of planSteps.slice(0, 3)) {
|
|
192
|
+
console.log(`- ${step.rank}. ${step.priority} ${step.category}: ${step.title}`);
|
|
193
|
+
if (step.command) console.log(` ${dim(step.command)}`);
|
|
194
|
+
if (step.commandSafety?.level) console.log(` ${dim(`safety: ${step.commandSafety.level}`)}`);
|
|
195
|
+
console.log(` ${dim(`requires mutation review: ${step.requiresReviewBeforeMutation ? "yes" : "no"}`)}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (payload.recommendations.length > 0) {
|
|
200
|
+
console.log();
|
|
201
|
+
console.log("Recommendations:");
|
|
202
|
+
for (const recommendation of payload.recommendations) {
|
|
203
|
+
console.log(`- ${recommendation.level}: ${recommendation.text}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log();
|
|
208
|
+
console.log("Privacy: agent backlog is read-only, local, and does not mutate learning.json or skill files.");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function printSkillProposals(payload) {
|
|
212
|
+
header("design-ai learn", "Skill evolution proposals");
|
|
213
|
+
info(`File: ${payload.file}`);
|
|
214
|
+
info(`Status: ${payload.status}`);
|
|
215
|
+
info(`Signal source: ${payload.signalSource}`);
|
|
216
|
+
info(`Signal status: ${payload.signalStatus}`);
|
|
217
|
+
info(`Min evidence: ${payload.minEvidenceCount}`);
|
|
218
|
+
info(`Check capture entries: ${payload.checkCaptureCount}`);
|
|
219
|
+
info(`Candidates: ${payload.candidateCount}`);
|
|
220
|
+
info(`Proposals: ${payload.proposalCount}`);
|
|
221
|
+
info(`Pending review: ${payload.pendingReviewCount ?? payload.proposalCount}`);
|
|
222
|
+
info(`Reviewed: ${payload.reviewedCount ?? 0}`);
|
|
223
|
+
info(`Skipped: ${payload.skippedCount}`);
|
|
224
|
+
if (payload.review?.file) {
|
|
225
|
+
info(`Review file: ${payload.review.file}`);
|
|
226
|
+
info(`Review status: ${payload.review.status} (${payload.review.matchedCount} matched, ${payload.review.staleCount} stale)`);
|
|
227
|
+
}
|
|
228
|
+
console.log();
|
|
229
|
+
|
|
230
|
+
if (payload.proposals.length === 0) {
|
|
231
|
+
console.log("No repeated check-capture groups crossed the proposal threshold.");
|
|
232
|
+
} else {
|
|
233
|
+
console.log("Proposed skill deltas:");
|
|
234
|
+
for (const proposal of payload.proposals) {
|
|
235
|
+
const routes = proposal.routeIds.length > 0 ? proposal.routeIds.join(", ") : "artifact";
|
|
236
|
+
console.log(`- ${proposal.id}: ${proposal.candidateSkillPath}`);
|
|
237
|
+
console.log(` ${dim(`${proposal.sourceIssueCount} issue(s) · ${proposal.category} · routes ${routes} · risk ${proposal.riskLevel} · review ${proposal.reviewStatus || "pending"}`)}`);
|
|
238
|
+
if (proposal.reviewDecision?.note) console.log(` Review note: ${proposal.reviewDecision.note}`);
|
|
239
|
+
console.log(` Delta: ${proposal.proposedInstructionDelta}`);
|
|
240
|
+
console.log(` Verify: ${proposal.verificationCommand}`);
|
|
241
|
+
for (const evidence of proposal.evidenceSources.slice(0, 3)) {
|
|
242
|
+
console.log(` Evidence: ${evidence.entryId} [${evidence.category}] ${evidence.source}`);
|
|
243
|
+
if (evidence.textPreview) console.log(` ${dim(evidence.textPreview)}`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (payload.skipped.length > 0) {
|
|
249
|
+
console.log();
|
|
250
|
+
console.log("Skipped groups:");
|
|
251
|
+
for (const item of payload.skipped) {
|
|
252
|
+
console.log(`- ${item.candidateSkillPath} [${item.category}]: ${item.reason}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (payload.review?.warnings?.length > 0) {
|
|
257
|
+
console.log();
|
|
258
|
+
console.log("Review file warnings:");
|
|
259
|
+
for (const warning of payload.review.warnings) {
|
|
260
|
+
console.log(`- ${warning}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (payload.recommendations.length > 0) {
|
|
265
|
+
console.log();
|
|
266
|
+
console.log("Recommendations:");
|
|
267
|
+
for (const recommendation of payload.recommendations) {
|
|
268
|
+
console.log(`- ${recommendation.level}: ${recommendation.text}`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
console.log();
|
|
273
|
+
console.log("No changes made. This command is preview-only and does not edit skill files or learning.json.");
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function printSkillProposalReviewCheck(payload) {
|
|
277
|
+
header("design-ai learn", "Skill proposal review check");
|
|
278
|
+
info(`File: ${payload.file}`);
|
|
279
|
+
info(`Status: ${payload.status}`);
|
|
280
|
+
info(`Proposal status: ${payload.proposalStatus}`);
|
|
281
|
+
info(`Signal status: ${payload.signalStatus}`);
|
|
282
|
+
info(`Review file: ${payload.reviewFile || "not configured"}`);
|
|
283
|
+
info(`Proposals: ${payload.proposalCount}`);
|
|
284
|
+
info(`Pending review: ${payload.pendingReviewCount}`);
|
|
285
|
+
info(`Reviewed: ${payload.reviewedCount}`);
|
|
286
|
+
console.log();
|
|
287
|
+
|
|
288
|
+
console.log("Checks:");
|
|
289
|
+
for (const check of payload.checks || []) {
|
|
290
|
+
console.log(`- ${check.level}: ${check.id} - ${check.message}`);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (payload.review?.warnings?.length > 0) {
|
|
294
|
+
console.log();
|
|
295
|
+
console.log("Review file warnings:");
|
|
296
|
+
for (const warning of payload.review.warnings) {
|
|
297
|
+
console.log(`- ${warning}`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (payload.recommendations.length > 0) {
|
|
302
|
+
console.log();
|
|
303
|
+
console.log("Recommendations:");
|
|
304
|
+
for (const recommendation of payload.recommendations) {
|
|
305
|
+
console.log(`- ${recommendation.level}: ${recommendation.text}`);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
console.log();
|
|
310
|
+
console.log("Privacy: review check is read-only and does not mutate learning.json or skill files.");
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function printSkillProposalApplyPlan(payload) {
|
|
314
|
+
header("design-ai learn", "Skill proposal apply plan");
|
|
315
|
+
info(`File: ${payload.file}`);
|
|
316
|
+
info(`Status: ${payload.status}`);
|
|
317
|
+
info(`Proposal status: ${payload.proposalStatus}`);
|
|
318
|
+
info(`Signal status: ${payload.signalStatus}`);
|
|
319
|
+
info(`Review file: ${payload.reviewFile || "not configured"}`);
|
|
320
|
+
info(`Accepted proposals: ${payload.acceptedCount}`);
|
|
321
|
+
info(`Pending review: ${payload.pendingReviewCount}`);
|
|
322
|
+
info(`Reviewed: ${payload.reviewedCount}`);
|
|
323
|
+
console.log();
|
|
324
|
+
|
|
325
|
+
if (!payload.tasks || payload.tasks.length === 0) {
|
|
326
|
+
console.log("No accepted skill proposals are ready for manual apply.");
|
|
327
|
+
} else {
|
|
328
|
+
console.log("Manual apply tasks:");
|
|
329
|
+
for (const task of payload.tasks) {
|
|
330
|
+
const routes = Array.isArray(task.routeIds) && task.routeIds.length > 0 ? task.routeIds.join(", ") : "artifact";
|
|
331
|
+
console.log(`- ${task.proposalId}: ${task.candidateSkillPath}`);
|
|
332
|
+
console.log(` ${dim(`${task.sourceIssueCount} issue(s) · ${task.category} · routes ${routes} · risk ${task.riskLevel}`)}`);
|
|
333
|
+
if (task.reviewDecision?.note) console.log(` Review note: ${task.reviewDecision.note}`);
|
|
334
|
+
console.log(` Delta: ${task.proposedInstructionDelta}`);
|
|
335
|
+
console.log(` Verify: ${task.verificationCommand}`);
|
|
336
|
+
for (const step of task.manualSteps || []) {
|
|
337
|
+
console.log(` Step: ${step}`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (payload.commands) {
|
|
343
|
+
console.log();
|
|
344
|
+
console.log("Follow-up commands:");
|
|
345
|
+
for (const [label, command] of Object.entries(payload.commands)) {
|
|
346
|
+
console.log(`- ${label}: ${command}`);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (payload.commandContract) {
|
|
351
|
+
const contract = payload.commandContract;
|
|
352
|
+
console.log();
|
|
353
|
+
console.log("Command contract:");
|
|
354
|
+
console.log(`- valid: ${contract.valid ? "yes" : "no"}`);
|
|
355
|
+
console.log(`- status: ${contract.status || "unknown"}`);
|
|
356
|
+
console.log(`- required keys: ${(contract.requiredKeys || []).join(", ") || "none"}`);
|
|
357
|
+
console.log(`- command count: ${contract.commandCount || 0}`);
|
|
358
|
+
console.log(`- check count: ${contract.checkCount || 0}`);
|
|
359
|
+
console.log(`- pass count: ${contract.passCount || 0}`);
|
|
360
|
+
console.log(`- warning count: ${contract.warningCount || 0}`);
|
|
361
|
+
console.log(`- review file required: ${contract.reviewFileRequired ? "yes" : "no"}`);
|
|
362
|
+
console.log(`- forbidden flags: ${(contract.forbiddenFlags || []).join(", ") || "none"}`);
|
|
363
|
+
console.log(`- failure count: ${contract.failureCount || 0}`);
|
|
364
|
+
console.log(`- failed checks: ${(contract.failedCheckIds || []).join(", ") || "none"}`);
|
|
365
|
+
console.log(`- next command key: ${contract.nextCommandKey || "none"}`);
|
|
366
|
+
console.log(`- next command policy: ${contract.nextCommandRunPolicy || "none"}`);
|
|
367
|
+
if (contract.nextCommandSafety?.level) {
|
|
368
|
+
console.log(`- next command safety: ${contract.nextCommandSafety.level}`);
|
|
369
|
+
}
|
|
370
|
+
if (contract.nextCommand) {
|
|
371
|
+
console.log(`- next command: ${contract.nextCommand}`);
|
|
372
|
+
}
|
|
373
|
+
console.log(`- command sequence count: ${contract.commandSequenceCount || 0}`);
|
|
374
|
+
console.log(`- command sequence keys: ${(contract.commandSequenceKeys || []).join(", ") || "none"}`);
|
|
375
|
+
const sequenceSummary = contract.commandSequenceSummary || {};
|
|
376
|
+
console.log(`- command sequence policy: ${sequenceSummary.runPolicy || "none"}`);
|
|
377
|
+
console.log(`- command sequence executable: ${sequenceSummary.executable ? "yes" : "no"}`);
|
|
378
|
+
console.log(`- command sequence local outputs: ${sequenceSummary.localOutputStepCount || 0}`);
|
|
379
|
+
console.log(`- command sequence mutates profile: ${sequenceSummary.mutatesProfile ? "yes" : "no"}`);
|
|
380
|
+
console.log(`- command sequence mutates review file: ${sequenceSummary.mutatesReviewFile ? "yes" : "no"}`);
|
|
381
|
+
console.log(`- command sequence mutates skill files: ${sequenceSummary.mutatesSkillFiles ? "yes" : "no"}`);
|
|
382
|
+
console.log(`- command sequence calls external AI APIs: ${sequenceSummary.callsExternalAiApis ? "yes" : "no"}`);
|
|
383
|
+
const operatorRunbook = contract.operatorRunbook || {};
|
|
384
|
+
console.log(`- operator runbook stages: ${operatorRunbook.stageCount || 0}`);
|
|
385
|
+
console.log(`- operator runbook keys: ${(operatorRunbook.stageKeys || []).join(", ") || "none"}`);
|
|
386
|
+
console.log(`- operator runbook required stages: ${operatorRunbook.requiredStageCount || 0}`);
|
|
387
|
+
console.log(`- operator runbook next stage: ${operatorRunbook.nextStageKey || "none"}`);
|
|
388
|
+
console.log(`- operator runbook next required stage: ${operatorRunbook.nextRequiredStageKey || "none"}`);
|
|
389
|
+
console.log(`- operator runbook next required command stage: ${operatorRunbook.nextRequiredCommandStageKey || "none"}`);
|
|
390
|
+
if (operatorRunbook.stageSelection?.strategy) {
|
|
391
|
+
console.log(`- operator runbook stage selection: ${operatorRunbook.stageSelection.strategy}`);
|
|
392
|
+
if (operatorRunbook.stageSelection.decision?.action) {
|
|
393
|
+
console.log(`- operator runbook decision: ${operatorRunbook.stageSelection.decision.action}`);
|
|
394
|
+
if (operatorRunbook.stageSelection.decision.safety?.level) {
|
|
395
|
+
console.log(`- operator runbook decision safety: ${operatorRunbook.stageSelection.decision.safety.level}`);
|
|
396
|
+
}
|
|
397
|
+
if (Array.isArray(operatorRunbook.stageSelection.decision.commands)) {
|
|
398
|
+
console.log(`- operator runbook decision commands: ${operatorRunbook.stageSelection.decision.commands.map((command) => command.key).join(", ") || "none"}`);
|
|
399
|
+
}
|
|
400
|
+
if (operatorRunbook.stageSelection.decision.nextCommandKey) {
|
|
401
|
+
console.log(`- operator runbook decision next command: ${operatorRunbook.stageSelection.decision.nextCommandKey}`);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (operatorRunbook.stageSelection.nextStage?.key) {
|
|
405
|
+
const nextStageLabel = operatorRunbook.stageSelection.nextStage.required ? "required" : "optional";
|
|
406
|
+
console.log(`- operator runbook selected stage: ${operatorRunbook.stageSelection.nextStage.key} (${nextStageLabel}, ${operatorRunbook.stageSelection.nextStage.kind})`);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (Array.isArray(contract.commandSequence) && contract.commandSequence.length > 0) {
|
|
410
|
+
console.log("Command sequence:");
|
|
411
|
+
for (const item of contract.commandSequence) {
|
|
412
|
+
const safetyLevel = item.safety?.level || "unknown";
|
|
413
|
+
console.log(`- ${item.step}. ${item.key}: ${item.runPolicy || "unknown"} / ${safetyLevel}`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (Array.isArray(operatorRunbook.stages) && operatorRunbook.stages.length > 0) {
|
|
417
|
+
console.log("Operator runbook:");
|
|
418
|
+
for (const stage of operatorRunbook.stages) {
|
|
419
|
+
const required = stage.required ? "required" : "optional";
|
|
420
|
+
const commandKeys = Array.isArray(stage.commandKeys) && stage.commandKeys.length > 0
|
|
421
|
+
? stage.commandKeys.join(", ")
|
|
422
|
+
: "manual";
|
|
423
|
+
console.log(`- ${stage.step}. ${stage.key}: ${required} / ${stage.kind || "unknown"} / ${commandKeys}`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (contract.nextAction) {
|
|
427
|
+
console.log(`- next action: ${contract.nextAction}`);
|
|
428
|
+
}
|
|
429
|
+
if (Array.isArray(contract.missingCommandKeys) && contract.missingCommandKeys.length > 0) {
|
|
430
|
+
console.log(`- missing command keys: ${contract.missingCommandKeys.join(", ")}`);
|
|
431
|
+
}
|
|
432
|
+
if (Array.isArray(contract.unexpectedCommandKeys) && contract.unexpectedCommandKeys.length > 0) {
|
|
433
|
+
console.log(`- unexpected command keys: ${contract.unexpectedCommandKeys.join(", ")}`);
|
|
434
|
+
}
|
|
435
|
+
if (Array.isArray(contract.failedChecks) && contract.failedChecks.length > 0) {
|
|
436
|
+
console.log("Failed command checks:");
|
|
437
|
+
for (const check of contract.failedChecks) {
|
|
438
|
+
console.log(`- ${check.id}: ${check.message}`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (payload.recommendations.length > 0) {
|
|
444
|
+
console.log();
|
|
445
|
+
console.log("Recommendations:");
|
|
446
|
+
for (const recommendation of payload.recommendations) {
|
|
447
|
+
console.log(`- ${recommendation.level}: ${recommendation.text}`);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
console.log();
|
|
452
|
+
console.log("Privacy: apply plan is read-only and does not mutate learning.json, review files, or skill files.");
|
|
453
|
+
}
|