ma-agents 3.13.2 → 3.14.1
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/README.md +3 -3
- package/lib/agents.js +9 -2
- package/lib/bmad-cache/bmb/.claude-plugin/marketplace.json +3 -3
- package/lib/bmad-cache/bmb/_git_preserved/index +0 -0
- package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-b388526edf307cf56f8e65673466cff074105abf.idx +0 -0
- package/lib/bmad-cache/bmb/_git_preserved/objects/pack/{pack-8f8b045fef5af6911495cf3b2a89f1ed75e120f7.pack → pack-b388526edf307cf56f8e65673466cff074105abf.pack} +0 -0
- package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-b388526edf307cf56f8e65673466cff074105abf.rev +0 -0
- package/lib/bmad-cache/bmb/_git_preserved/packed-refs +1 -1
- package/lib/bmad-cache/bmb/_git_preserved/refs/heads/main +1 -1
- package/lib/bmad-cache/bmb/_git_preserved/shallow +1 -1
- package/lib/bmad-cache/bmb/package-lock.json +2 -2
- package/lib/bmad-cache/bmb/package.json +1 -1
- package/lib/bmad-cache/bmb/samples/bmad-agent-code-coach/scripts/wake.py +78 -0
- package/lib/bmad-cache/bmb/samples/bmad-agent-creative-muse/scripts/wake.py +78 -0
- package/lib/bmad-cache/bmb/samples/bmad-agent-sentinel/scripts/wake.py +78 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/assets/customize-template.toml +3 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/assets/init-sanctum-template.py +11 -5
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/assets/report-shell.html +1073 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/assets/wake-template.py +78 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/customize.toml +48 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/count_tokens.py +78 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/prepass.py +258 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/process-template.py +20 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/render_report.py +387 -0
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/assets/adapter-claude-code.json +9 -0
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/aggregate_benchmark.py +236 -0
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/memlog.py +197 -0
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/run_evals.py +513 -390
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/run_triggers.py +347 -251
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/tests/test_env_isolation.py +79 -0
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/tests/test_trigger_detection.py +123 -0
- package/lib/bmad-cache/bmb/skills/bmad-module-builder/scripts/tests/test-validate-module.py +82 -4
- package/lib/bmad-cache/bmb/skills/bmad-module-builder/scripts/validate-module.py +55 -11
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/assets/customize-template.toml +3 -5
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/assets/report-shell.html +860 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/customize.toml +59 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/count_tokens.py +77 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/init_skill.py +132 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/prepass-prompt-metrics.py +186 -221
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/quick_validate.py +117 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/render_report.py +387 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py +46 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/tests/test_count_tokens.py +180 -0
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/tests/test_render_report.py +171 -0
- package/lib/bmad-cache/cache-manifest.json +4 -4
- package/lib/bmad-customize/bmm-qa.customize.yaml +3 -3
- package/lib/bmad-extension/.claude-plugin/marketplace.json.template +3 -2
- package/lib/bmad-extension/skills/bmad-dev-epic/SKILL.md +101 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/bmad-skill-manifest.yaml +3 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/checklist.md +44 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/customize.toml +54 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/references/story-pipeline.md +112 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-01-intake.md +59 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-02-plan-waves.md +56 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-03-epic-branch.md +35 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-04-run-waves.md +49 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-05-epic-adversarial.md +31 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-06-release.md +57 -0
- package/lib/bmad-extension/skills/bmad-dev-epic/steps/step-07-report.md +40 -0
- package/lib/bmad-extension/skills/ma-agent-sqa/SKILL.md +3 -3
- package/lib/bmad-extension/skills/ma-agent-sqa/bmad-skill-manifest.yaml +1 -1
- package/lib/bmad-extension/skills/module-help.csv +2 -1
- package/lib/bmad-extension/skills/module.yaml +1 -1
- package/lib/bmad-extension/skills/sqa-audit/SKILL.md +2 -2
- package/lib/bmad-extension/skills/sqa-ieee12207/SKILL.md +3 -3
- package/lib/bmad-extension/skills/sqa-requirements-quality/SKILL.md +2 -2
- package/lib/bmad-extension-plugin/.claude-plugin/marketplace.json +4 -3
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/SKILL.md +101 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/bmad-skill-manifest.yaml +3 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/checklist.md +44 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/customize.toml +54 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/references/story-pipeline.md +112 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-01-intake.md +59 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-02-plan-waves.md +56 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-03-epic-branch.md +35 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-04-run-waves.md +49 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-05-epic-adversarial.md +31 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-06-release.md +57 -0
- package/lib/bmad-extension-plugin/skills/bmad-dev-epic/steps/step-07-report.md +40 -0
- package/lib/bmad-extension-plugin/skills/ma-agent-sqa/SKILL.md +3 -3
- package/lib/bmad-extension-plugin/skills/ma-agent-sqa/bmad-skill-manifest.yaml +1 -1
- package/lib/bmad-extension-plugin/skills/module-help.csv +2 -1
- package/lib/bmad-extension-plugin/skills/module.yaml +1 -1
- package/lib/bmad-extension-plugin/skills/sqa-audit/SKILL.md +2 -2
- package/lib/bmad-extension-plugin/skills/sqa-ieee12207/SKILL.md +3 -3
- package/lib/bmad-extension-plugin/skills/sqa-requirements-quality/SKILL.md +2 -2
- package/lib/bmad.js +6 -1
- package/package.json +3 -3
- package/lib/.bmad-extension-plugin.build-22612-1782454014750/.claude-plugin/marketplace.json +0 -109
- package/lib/.bmad-extension-plugin.build-22612-1782454014750/skills/module-help.csv +0 -62
- package/lib/.bmad-extension-plugin.build-22612-1782454014750/skills/module.yaml +0 -20
- package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-8f8b045fef5af6911495cf3b2a89f1ed75e120f7.idx +0 -0
- package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-8f8b045fef5af6911495cf3b2a89f1ed75e120f7.rev +0 -0
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/references/sample-init-sanctum.py +0 -274
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/generate-html-report.py +0 -534
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/prepass-execution-deps.py +0 -337
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/prepass-prompt-metrics.py +0 -425
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/prepass-sanctum-architecture.py +0 -385
- package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/prepass-structure-capabilities.py +0 -482
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/assets/Dockerfile +0 -29
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/docker_setup.py +0 -115
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/generate_report.py +0 -184
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/pty_runner.py +0 -171
- package/lib/bmad-cache/bmb/skills/bmad-eval-runner/scripts/utils.py +0 -260
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/extract-report-json.py +0 -287
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/generate-html-report.py +0 -588
- package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/prepass-execution-deps.py +0 -288
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Skill Analysis Report</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0f1b2d;
|
|
10
|
+
--panel: #16263d;
|
|
11
|
+
--panel-2: #1d3250;
|
|
12
|
+
--ink: #e9eef6;
|
|
13
|
+
--ink-dim: #9fb0c7;
|
|
14
|
+
--line: #294366;
|
|
15
|
+
--accent: #b66d46;
|
|
16
|
+
--accent-ink: #f4d9c8;
|
|
17
|
+
--critical: #e05656;
|
|
18
|
+
--high: #e0904a;
|
|
19
|
+
--medium: #d8c24a;
|
|
20
|
+
--low: #5aa0d0;
|
|
21
|
+
--ok: #4caf72;
|
|
22
|
+
}
|
|
23
|
+
* { box-sizing: border-box; }
|
|
24
|
+
body {
|
|
25
|
+
margin: 0;
|
|
26
|
+
background: var(--bg);
|
|
27
|
+
color: var(--ink);
|
|
28
|
+
font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
29
|
+
}
|
|
30
|
+
.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 80px; }
|
|
31
|
+
header h1 { font-size: 22px; margin: 0 0 4px; }
|
|
32
|
+
header .meta { color: var(--ink-dim); font-size: 13px; }
|
|
33
|
+
header .meta b { color: var(--ink); font-weight: 600; }
|
|
34
|
+
|
|
35
|
+
.banner {
|
|
36
|
+
display: none;
|
|
37
|
+
background: #3a1414;
|
|
38
|
+
border: 1px solid var(--critical);
|
|
39
|
+
color: #ffd9d9;
|
|
40
|
+
padding: 14px 16px;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
margin: 16px 0;
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
}
|
|
47
|
+
.banner.show { display: block; }
|
|
48
|
+
|
|
49
|
+
.overview {
|
|
50
|
+
background: var(--panel);
|
|
51
|
+
border: 1px solid var(--line);
|
|
52
|
+
border-radius: 10px;
|
|
53
|
+
padding: 18px;
|
|
54
|
+
margin: 18px 0;
|
|
55
|
+
}
|
|
56
|
+
.grade {
|
|
57
|
+
font-size: 34px;
|
|
58
|
+
font-weight: 800;
|
|
59
|
+
margin: 0 0 8px;
|
|
60
|
+
text-transform: capitalize;
|
|
61
|
+
}
|
|
62
|
+
.grade.g-excellent { color: var(--ok); }
|
|
63
|
+
.grade.g-good { color: var(--low); }
|
|
64
|
+
.grade.g-fair { color: var(--medium); }
|
|
65
|
+
.grade.g-poor { color: var(--critical); }
|
|
66
|
+
.verdict { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
|
|
67
|
+
.summary { color: var(--ink-dim); margin: 0 0 14px; }
|
|
68
|
+
.counts { display: flex; flex-wrap: wrap; gap: 10px; }
|
|
69
|
+
.pill {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
padding: 6px 12px;
|
|
74
|
+
border-radius: 999px;
|
|
75
|
+
background: var(--panel-2);
|
|
76
|
+
border: 1px solid var(--line);
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
}
|
|
79
|
+
.pill .dot { width: 10px; height: 10px; border-radius: 50%; }
|
|
80
|
+
.pill .n { font-weight: 700; }
|
|
81
|
+
.dot.critical { background: var(--critical); }
|
|
82
|
+
.dot.high { background: var(--high); }
|
|
83
|
+
.dot.medium { background: var(--medium); }
|
|
84
|
+
.dot.low { background: var(--low); }
|
|
85
|
+
|
|
86
|
+
/* Generic synthesis/agent-block panel */
|
|
87
|
+
.block {
|
|
88
|
+
background: var(--panel);
|
|
89
|
+
border: 1px solid var(--line);
|
|
90
|
+
border-radius: 10px;
|
|
91
|
+
padding: 18px;
|
|
92
|
+
margin: 18px 0;
|
|
93
|
+
}
|
|
94
|
+
.block > h2 {
|
|
95
|
+
font-size: 13px;
|
|
96
|
+
text-transform: uppercase;
|
|
97
|
+
letter-spacing: 0.06em;
|
|
98
|
+
color: var(--ink-dim);
|
|
99
|
+
margin: 0 0 12px;
|
|
100
|
+
}
|
|
101
|
+
.block .mono, .block code {
|
|
102
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
103
|
+
font-size: 13px;
|
|
104
|
+
background: var(--panel-2);
|
|
105
|
+
padding: 1px 5px;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
}
|
|
108
|
+
.kv { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; }
|
|
109
|
+
.kv dt { color: var(--ink-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
110
|
+
.kv dd { margin: 0; }
|
|
111
|
+
|
|
112
|
+
/* Themes */
|
|
113
|
+
.theme { padding: 12px 0; border-top: 1px solid var(--line); }
|
|
114
|
+
.theme:first-of-type { border-top: none; padding-top: 0; }
|
|
115
|
+
.theme .t-head { display: flex; align-items: center; gap: 10px; }
|
|
116
|
+
.theme .t-title { font-weight: 600; flex: 1 1 auto; min-width: 0; }
|
|
117
|
+
.theme .t-cause { color: var(--ink-dim); margin-top: 4px; }
|
|
118
|
+
.theme .t-action { margin-top: 4px; }
|
|
119
|
+
.theme .t-findings { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--line); }
|
|
120
|
+
.theme .t-finding { font-size: 13px; color: var(--ink-dim); padding: 2px 0; }
|
|
121
|
+
|
|
122
|
+
/* Strengths */
|
|
123
|
+
.strength-list { margin: 0; padding-left: 20px; }
|
|
124
|
+
.strength-list li { padding: 2px 0; }
|
|
125
|
+
|
|
126
|
+
/* Recommendations */
|
|
127
|
+
.rec { padding: 8px 0; border-top: 1px solid var(--line); }
|
|
128
|
+
.rec:first-of-type { border-top: none; padding-top: 0; }
|
|
129
|
+
.rec .rank { font-weight: 700; color: var(--accent-ink); margin-right: 8px; }
|
|
130
|
+
.rec .resolves { color: var(--ink-dim); font-size: 12px; margin-left: 8px; }
|
|
131
|
+
|
|
132
|
+
/* Experience journeys */
|
|
133
|
+
.block .journey { padding: 8px 0; border-top: 1px solid var(--line); }
|
|
134
|
+
.block .journey:first-of-type { border-top: none; padding-top: 0; }
|
|
135
|
+
.block .journey .j-name { font-weight: 600; }
|
|
136
|
+
.block .journey .j-steps { color: var(--ink-dim); margin-top: 2px; }
|
|
137
|
+
|
|
138
|
+
.toolbar {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 12px;
|
|
142
|
+
margin: 18px 0 10px;
|
|
143
|
+
flex-wrap: wrap;
|
|
144
|
+
}
|
|
145
|
+
.toolbar .sel-count { color: var(--ink-dim); font-size: 13px; }
|
|
146
|
+
button {
|
|
147
|
+
font: inherit;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
border-radius: 8px;
|
|
150
|
+
border: 1px solid var(--line);
|
|
151
|
+
background: var(--panel-2);
|
|
152
|
+
color: var(--ink);
|
|
153
|
+
padding: 8px 14px;
|
|
154
|
+
}
|
|
155
|
+
button.primary {
|
|
156
|
+
background: var(--accent);
|
|
157
|
+
border-color: var(--accent);
|
|
158
|
+
color: #1a0e07;
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
}
|
|
161
|
+
button:disabled { opacity: 0.5; cursor: default; }
|
|
162
|
+
button.link {
|
|
163
|
+
background: none;
|
|
164
|
+
border: none;
|
|
165
|
+
color: var(--accent-ink);
|
|
166
|
+
padding: 4px 6px;
|
|
167
|
+
font-size: 13px;
|
|
168
|
+
}
|
|
169
|
+
button.small { padding: 5px 10px; font-size: 13px; flex: 0 0 auto; }
|
|
170
|
+
|
|
171
|
+
.no-findings {
|
|
172
|
+
background: var(--panel);
|
|
173
|
+
border: 1px dashed var(--line);
|
|
174
|
+
border-radius: 10px;
|
|
175
|
+
padding: 28px;
|
|
176
|
+
text-align: center;
|
|
177
|
+
color: var(--ink-dim);
|
|
178
|
+
}
|
|
179
|
+
.no-findings .big { font-size: 18px; color: var(--ok); margin-bottom: 6px; }
|
|
180
|
+
|
|
181
|
+
.group { margin: 18px 0; }
|
|
182
|
+
.group > h2 {
|
|
183
|
+
font-size: 13px;
|
|
184
|
+
text-transform: uppercase;
|
|
185
|
+
letter-spacing: 0.06em;
|
|
186
|
+
color: var(--ink-dim);
|
|
187
|
+
margin: 0 0 8px;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
gap: 8px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.finding {
|
|
194
|
+
background: var(--panel);
|
|
195
|
+
border: 1px solid var(--line);
|
|
196
|
+
border-left: 4px solid var(--line);
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
margin: 8px 0;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
}
|
|
201
|
+
.finding.sev-critical { border-left-color: var(--critical); }
|
|
202
|
+
.finding.sev-high { border-left-color: var(--high); }
|
|
203
|
+
.finding.sev-medium { border-left-color: var(--medium); }
|
|
204
|
+
.finding.sev-low { border-left-color: var(--low); }
|
|
205
|
+
|
|
206
|
+
.finding .row {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: 12px;
|
|
210
|
+
padding: 12px 14px;
|
|
211
|
+
}
|
|
212
|
+
.finding .row .chk { width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; }
|
|
213
|
+
.finding .row .head { flex: 1 1 auto; cursor: pointer; min-width: 0; }
|
|
214
|
+
.finding .row .title { font-weight: 600; }
|
|
215
|
+
.finding .row .sub { color: var(--ink-dim); font-size: 12px; margin-top: 2px; }
|
|
216
|
+
.finding .tag {
|
|
217
|
+
flex: 0 0 auto;
|
|
218
|
+
font-size: 11px;
|
|
219
|
+
text-transform: uppercase;
|
|
220
|
+
letter-spacing: 0.04em;
|
|
221
|
+
padding: 3px 8px;
|
|
222
|
+
border-radius: 6px;
|
|
223
|
+
background: var(--panel-2);
|
|
224
|
+
border: 1px solid var(--line);
|
|
225
|
+
color: var(--ink-dim);
|
|
226
|
+
}
|
|
227
|
+
.finding .caret { flex: 0 0 auto; color: var(--ink-dim); transition: transform 0.15s; cursor: pointer; }
|
|
228
|
+
.finding.open .caret { transform: rotate(90deg); }
|
|
229
|
+
|
|
230
|
+
.finding .body {
|
|
231
|
+
display: none;
|
|
232
|
+
padding: 0 14px 14px 42px;
|
|
233
|
+
border-top: 1px solid var(--line);
|
|
234
|
+
}
|
|
235
|
+
.finding.open .body { display: block; }
|
|
236
|
+
.finding .body dl { margin: 12px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; }
|
|
237
|
+
.finding .body dt { color: var(--ink-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
238
|
+
.finding .body dd { margin: 0; }
|
|
239
|
+
.finding .body code, .finding .body .mono {
|
|
240
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
241
|
+
font-size: 13px;
|
|
242
|
+
background: var(--panel-2);
|
|
243
|
+
padding: 1px 5px;
|
|
244
|
+
border-radius: 4px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.toast {
|
|
248
|
+
position: fixed;
|
|
249
|
+
left: 50%;
|
|
250
|
+
bottom: 28px;
|
|
251
|
+
transform: translateX(-50%);
|
|
252
|
+
background: var(--ok);
|
|
253
|
+
color: #06160c;
|
|
254
|
+
padding: 10px 18px;
|
|
255
|
+
border-radius: 8px;
|
|
256
|
+
font-weight: 600;
|
|
257
|
+
opacity: 0;
|
|
258
|
+
transition: opacity 0.2s;
|
|
259
|
+
pointer-events: none;
|
|
260
|
+
}
|
|
261
|
+
.toast.show { opacity: 1; }
|
|
262
|
+
|
|
263
|
+
.fallback-area { margin-top: 12px; display: none; }
|
|
264
|
+
.fallback-area.show { display: block; }
|
|
265
|
+
.fallback-area textarea {
|
|
266
|
+
width: 100%;
|
|
267
|
+
min-height: 160px;
|
|
268
|
+
background: var(--panel-2);
|
|
269
|
+
color: var(--ink);
|
|
270
|
+
border: 1px solid var(--line);
|
|
271
|
+
border-radius: 8px;
|
|
272
|
+
padding: 10px;
|
|
273
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
274
|
+
font-size: 13px;
|
|
275
|
+
}
|
|
276
|
+
</style>
|
|
277
|
+
</head>
|
|
278
|
+
<body>
|
|
279
|
+
<div class="wrap">
|
|
280
|
+
<header>
|
|
281
|
+
<h1>Skill Analysis Report</h1>
|
|
282
|
+
<div class="meta">
|
|
283
|
+
<span>Subject: <b id="m-subject">—</b></span> ·
|
|
284
|
+
<span>Generated: <b id="m-generated">—</b></span> ·
|
|
285
|
+
<span>Schema: <b id="m-schema">—</b></span>
|
|
286
|
+
</div>
|
|
287
|
+
</header>
|
|
288
|
+
|
|
289
|
+
<div id="parse-banner" class="banner"></div>
|
|
290
|
+
|
|
291
|
+
<section id="overview" class="overview" hidden>
|
|
292
|
+
<div id="grade" class="grade" hidden></div>
|
|
293
|
+
<p id="verdict" class="verdict"></p>
|
|
294
|
+
<p id="summary-text" class="summary" hidden></p>
|
|
295
|
+
<div id="counts" class="counts"></div>
|
|
296
|
+
</section>
|
|
297
|
+
|
|
298
|
+
<!-- Synthesis layer (themes, strengths, recommendations). Hidden when absent. -->
|
|
299
|
+
<section id="themes" class="block" hidden></section>
|
|
300
|
+
<section id="strengths" class="block" hidden></section>
|
|
301
|
+
<section id="recommendations" class="block" hidden></section>
|
|
302
|
+
|
|
303
|
+
<!-- Experience: journeys plus headless (experience). Hidden when absent. -->
|
|
304
|
+
<section id="experience" class="block" hidden></section>
|
|
305
|
+
|
|
306
|
+
<div id="toolbar" class="toolbar" hidden>
|
|
307
|
+
<button id="btn-copy" class="primary" disabled>Copy selected as paste-back prompt</button>
|
|
308
|
+
<span id="sel-count" class="sel-count">0 selected</span>
|
|
309
|
+
<button id="btn-select-all" class="link">Select all</button>
|
|
310
|
+
<button id="btn-clear" class="link">Clear</button>
|
|
311
|
+
<button id="btn-expand-all" class="link">Expand all</button>
|
|
312
|
+
<button id="btn-collapse-all" class="link">Collapse all</button>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
<div id="fallback" class="fallback-area">
|
|
316
|
+
<p class="sel-count">Clipboard was unavailable. Copy the text below manually:</p>
|
|
317
|
+
<textarea id="fallback-text" readonly></textarea>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<div id="findings-root"></div>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
<div id="toast" class="toast">Copied</div>
|
|
324
|
+
|
|
325
|
+
<!-- scripts/render_report.py replaces the contents of this island per run.
|
|
326
|
+
The placeholder below is intentionally unusable: the shell refuses to
|
|
327
|
+
render it, so a failed injection can never look like real findings. -->
|
|
328
|
+
<script type="application/json" id="report-data">
|
|
329
|
+
{
|
|
330
|
+
"schema_version": 2,
|
|
331
|
+
"subject": "__PLACEHOLDER__",
|
|
332
|
+
"generated": "",
|
|
333
|
+
"verdict": "",
|
|
334
|
+
"findings": []
|
|
335
|
+
}
|
|
336
|
+
</script>
|
|
337
|
+
|
|
338
|
+
<script>
|
|
339
|
+
(function () {
|
|
340
|
+
"use strict";
|
|
341
|
+
|
|
342
|
+
var SEVERITIES = ["critical", "high", "medium", "low"];
|
|
343
|
+
var SEV_LABEL = { critical: "Critical", high: "High", medium: "Medium", low: "Low" };
|
|
344
|
+
var GRADES = ["excellent", "good", "fair", "poor"];
|
|
345
|
+
var PLACEHOLDER_SUBJECT = "__PLACEHOLDER__";
|
|
346
|
+
|
|
347
|
+
var els = {
|
|
348
|
+
banner: document.getElementById("parse-banner"),
|
|
349
|
+
overview: document.getElementById("overview"),
|
|
350
|
+
grade: document.getElementById("grade"),
|
|
351
|
+
verdict: document.getElementById("verdict"),
|
|
352
|
+
summaryText: document.getElementById("summary-text"),
|
|
353
|
+
counts: document.getElementById("counts"),
|
|
354
|
+
themes: document.getElementById("themes"),
|
|
355
|
+
strengths: document.getElementById("strengths"),
|
|
356
|
+
recommendations: document.getElementById("recommendations"),
|
|
357
|
+
experience: document.getElementById("experience"),
|
|
358
|
+
toolbar: document.getElementById("toolbar"),
|
|
359
|
+
root: document.getElementById("findings-root"),
|
|
360
|
+
subject: document.getElementById("m-subject"),
|
|
361
|
+
generated: document.getElementById("m-generated"),
|
|
362
|
+
schema: document.getElementById("m-schema"),
|
|
363
|
+
selCount: document.getElementById("sel-count"),
|
|
364
|
+
btnCopy: document.getElementById("btn-copy"),
|
|
365
|
+
btnSelectAll: document.getElementById("btn-select-all"),
|
|
366
|
+
btnClear: document.getElementById("btn-clear"),
|
|
367
|
+
btnExpandAll: document.getElementById("btn-expand-all"),
|
|
368
|
+
btnCollapseAll: document.getElementById("btn-collapse-all"),
|
|
369
|
+
fallback: document.getElementById("fallback"),
|
|
370
|
+
fallbackText: document.getElementById("fallback-text"),
|
|
371
|
+
toast: document.getElementById("toast")
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
var selected = Object.create(null);
|
|
375
|
+
var findings = [];
|
|
376
|
+
var findingsById = Object.create(null);
|
|
377
|
+
var subjectPath = "";
|
|
378
|
+
var standards = null;
|
|
379
|
+
|
|
380
|
+
function showBanner(message) {
|
|
381
|
+
els.banner.textContent = message;
|
|
382
|
+
els.banner.classList.add("show");
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function esc(value) {
|
|
386
|
+
var s = value == null ? "" : String(value);
|
|
387
|
+
return s.replace(/[&<>"']/g, function (c) {
|
|
388
|
+
return { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c];
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Normalize an arbitrary parsed object against schema_version 2, supplying
|
|
393
|
+
// defaults so a partial or future island still renders. Unknown fields are
|
|
394
|
+
// ignored, not fatal. Severity counts are always derived from the findings
|
|
395
|
+
// array, never read from the island, so they cannot disagree with it. The
|
|
396
|
+
// synthesis blocks (grade, summary, themes, strengths, recommendations) and
|
|
397
|
+
// the experience block are OPTIONAL: each normalizes to an empty value that
|
|
398
|
+
// renders nothing rather than an empty panel or an error.
|
|
399
|
+
function normalize(raw) {
|
|
400
|
+
var obj = raw && typeof raw === "object" ? raw : {};
|
|
401
|
+
var rawFindings = Array.isArray(obj.findings) ? obj.findings : [];
|
|
402
|
+
|
|
403
|
+
var norm = {
|
|
404
|
+
schema_version: typeof obj.schema_version === "number" ? obj.schema_version : 2,
|
|
405
|
+
subject: obj.subject != null ? String(obj.subject) : "(unspecified)",
|
|
406
|
+
generated: obj.generated != null ? String(obj.generated) : "(unspecified)",
|
|
407
|
+
verdict: obj.verdict != null ? String(obj.verdict) : "(no verdict supplied)",
|
|
408
|
+
grade: GRADES.indexOf(String(obj.grade || "").toLowerCase()) >= 0
|
|
409
|
+
? String(obj.grade).toLowerCase() : "",
|
|
410
|
+
summary: typeof obj.summary === "string" ? obj.summary : "",
|
|
411
|
+
standards: (obj.standards && typeof obj.standards === "object") ? {
|
|
412
|
+
canon: obj.standards.canon != null ? String(obj.standards.canon) : "",
|
|
413
|
+
principles: obj.standards.principles != null ? String(obj.standards.principles) : "",
|
|
414
|
+
scripts: obj.standards.scripts != null ? String(obj.standards.scripts) : ""
|
|
415
|
+
} : null,
|
|
416
|
+
themes: normalizeThemes(obj.themes),
|
|
417
|
+
strengths: normalizeStrengths(obj.strengths),
|
|
418
|
+
recommendations: normalizeRecommendations(obj.recommendations),
|
|
419
|
+
experience: normalizeExperience(obj.experience),
|
|
420
|
+
counts: { critical: 0, high: 0, medium: 0, low: 0 },
|
|
421
|
+
findings: []
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
rawFindings.forEach(function (f, i) {
|
|
425
|
+
if (!f || typeof f !== "object") { return; }
|
|
426
|
+
var sev = SEVERITIES.indexOf(f.severity) >= 0 ? f.severity : "low";
|
|
427
|
+
norm.findings.push({
|
|
428
|
+
id: f.id != null ? String(f.id) : "finding-" + (i + 1),
|
|
429
|
+
lens: f.lens != null ? String(f.lens) : "(unknown)",
|
|
430
|
+
severity: sev,
|
|
431
|
+
title: f.title != null ? String(f.title) : "(untitled finding)",
|
|
432
|
+
location: f.location != null ? String(f.location) : "",
|
|
433
|
+
evidence: f.evidence != null ? String(f.evidence) : "",
|
|
434
|
+
recommendation: f.recommendation != null ? String(f.recommendation) : "",
|
|
435
|
+
proposed_smallest: f.proposed_smallest != null ? String(f.proposed_smallest) : "",
|
|
436
|
+
predicted_delta: f.predicted_delta != null ? String(f.predicted_delta) : ""
|
|
437
|
+
});
|
|
438
|
+
norm.counts[sev] += 1;
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
return norm;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function normalizeThemes(raw) {
|
|
445
|
+
if (!Array.isArray(raw)) { return []; }
|
|
446
|
+
var list = [];
|
|
447
|
+
raw.forEach(function (t) {
|
|
448
|
+
if (!t || typeof t !== "object") { return; }
|
|
449
|
+
var ids = [];
|
|
450
|
+
if (Array.isArray(t.finding_ids)) {
|
|
451
|
+
t.finding_ids.forEach(function (id) { if (id != null) { ids.push(String(id)); } });
|
|
452
|
+
}
|
|
453
|
+
var title = t.title != null ? String(t.title) : "";
|
|
454
|
+
if (!title && !ids.length) { return; }
|
|
455
|
+
list.push({
|
|
456
|
+
title: title || "(untitled theme)",
|
|
457
|
+
root_cause: t.root_cause != null ? String(t.root_cause) : "",
|
|
458
|
+
action: t.action != null ? String(t.action) : "",
|
|
459
|
+
finding_ids: ids
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
return list;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function normalizeStrengths(raw) {
|
|
466
|
+
if (!Array.isArray(raw)) { return []; }
|
|
467
|
+
var list = [];
|
|
468
|
+
raw.forEach(function (s) {
|
|
469
|
+
if (typeof s === "string" && s) { list.push(s); }
|
|
470
|
+
else if (s && typeof s === "object" && s.title) {
|
|
471
|
+
list.push(String(s.title) + (s.detail ? " — " + String(s.detail) : ""));
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
return list;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function normalizeRecommendations(raw) {
|
|
478
|
+
if (!Array.isArray(raw)) { return []; }
|
|
479
|
+
var list = [];
|
|
480
|
+
raw.forEach(function (r, i) {
|
|
481
|
+
if (!r || typeof r !== "object") { return; }
|
|
482
|
+
var action = r.action != null ? String(r.action) : "";
|
|
483
|
+
if (!action) { return; }
|
|
484
|
+
var resolves = "";
|
|
485
|
+
if (Array.isArray(r.resolves)) { resolves = r.resolves.map(String).join(", "); }
|
|
486
|
+
else if (typeof r.resolves === "number") { resolves = r.resolves + " findings"; }
|
|
487
|
+
else if (r.resolves != null) { resolves = String(r.resolves); }
|
|
488
|
+
list.push({
|
|
489
|
+
rank: typeof r.rank === "number" ? r.rank : i + 1,
|
|
490
|
+
action: action,
|
|
491
|
+
resolves: resolves
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
list.sort(function (a, b) { return a.rank - b.rank; });
|
|
495
|
+
return list;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// Optional experience block: journeys plus a headless note. Returns null when
|
|
499
|
+
// neither is usable.
|
|
500
|
+
function normalizeExperience(raw) {
|
|
501
|
+
if (!raw || typeof raw !== "object") { return null; }
|
|
502
|
+
var journeys = [];
|
|
503
|
+
if (Array.isArray(raw.journeys)) {
|
|
504
|
+
raw.journeys.forEach(function (j) {
|
|
505
|
+
if (!j || typeof j !== "object") { return; }
|
|
506
|
+
var name = j.name != null ? String(j.name) : "";
|
|
507
|
+
var steps = j.steps != null ? String(j.steps) : "";
|
|
508
|
+
if (!name && !steps) { return; }
|
|
509
|
+
journeys.push({ name: name, steps: steps });
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
var headless = raw.headless != null ? String(raw.headless) : "";
|
|
513
|
+
if (!journeys.length && !headless) { return null; }
|
|
514
|
+
return { journeys: journeys, headless: headless };
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function renderOverview(data) {
|
|
518
|
+
els.subject.textContent = data.subject;
|
|
519
|
+
els.generated.textContent = data.generated;
|
|
520
|
+
els.schema.textContent = String(data.schema_version);
|
|
521
|
+
els.verdict.textContent = data.verdict;
|
|
522
|
+
|
|
523
|
+
if (data.grade) {
|
|
524
|
+
els.grade.textContent = data.grade;
|
|
525
|
+
els.grade.className = "grade g-" + data.grade;
|
|
526
|
+
els.grade.hidden = false;
|
|
527
|
+
}
|
|
528
|
+
if (data.summary) {
|
|
529
|
+
els.summaryText.textContent = data.summary;
|
|
530
|
+
els.summaryText.hidden = false;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
els.counts.innerHTML = "";
|
|
534
|
+
SEVERITIES.forEach(function (s) {
|
|
535
|
+
var pill = document.createElement("span");
|
|
536
|
+
pill.className = "pill";
|
|
537
|
+
pill.innerHTML =
|
|
538
|
+
'<span class="dot ' + s + '"></span>' +
|
|
539
|
+
'<span class="lbl">' + SEV_LABEL[s] + '</span>' +
|
|
540
|
+
'<span class="n">' + data.counts[s] + "</span>";
|
|
541
|
+
els.counts.appendChild(pill);
|
|
542
|
+
});
|
|
543
|
+
els.overview.hidden = false;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Every copied fix prompt opens by anchoring the fixing session to the same
|
|
547
|
+
// standards that produced the findings, so the fix is held to the bar too.
|
|
548
|
+
function standardsPreamble() {
|
|
549
|
+
if (!standards || !standards.canon) { return []; }
|
|
550
|
+
var bar = standards.canon + (standards.principles ? " and " + standards.principles : "");
|
|
551
|
+
var lines = [
|
|
552
|
+
"Hold " + bar + " as the bar for every line you change — a fix that adds ceremony is a new finding, not a fix."
|
|
553
|
+
];
|
|
554
|
+
if (standards.scripts) {
|
|
555
|
+
lines.push("If the fix adds or changes scripts, follow " + standards.scripts + ".");
|
|
556
|
+
}
|
|
557
|
+
lines.push("");
|
|
558
|
+
return lines;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function composeThemePrompt(theme, resolved) {
|
|
562
|
+
var lines = standardsPreamble();
|
|
563
|
+
lines.push("Fix the following theme in " + subjectPath + ": " + theme.title);
|
|
564
|
+
lines.push("");
|
|
565
|
+
if (theme.root_cause) { lines.push("Root cause: " + theme.root_cause); }
|
|
566
|
+
if (theme.action) { lines.push("Fix: " + theme.action); }
|
|
567
|
+
if (resolved.length) {
|
|
568
|
+
lines.push("");
|
|
569
|
+
lines.push("Findings to address:");
|
|
570
|
+
resolved.forEach(function (f, i) {
|
|
571
|
+
lines.push((i + 1) + ". " + f.title);
|
|
572
|
+
if (f.location) { lines.push(" Location: " + f.location); }
|
|
573
|
+
if (f.evidence) { lines.push(" Evidence: " + f.evidence); }
|
|
574
|
+
if (f.recommendation) { lines.push(" Recommendation: " + f.recommendation); }
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
return lines.join("\n") + "\n";
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function renderThemes(themes) {
|
|
581
|
+
if (!themes.length) { els.themes.hidden = true; return; }
|
|
582
|
+
els.themes.innerHTML = "<h2>Themes</h2>";
|
|
583
|
+
themes.forEach(function (t) {
|
|
584
|
+
var resolved = t.finding_ids
|
|
585
|
+
.map(function (id) { return findingsById[id]; })
|
|
586
|
+
.filter(function (f) { return !!f; });
|
|
587
|
+
var items = resolved.map(function (f) {
|
|
588
|
+
return '<div class="t-finding"><span class="mono">' + esc(f.id) + "</span> " +
|
|
589
|
+
esc(f.title) +
|
|
590
|
+
(f.location ? ' · <span class="mono">' + esc(f.location) + "</span>" : "") +
|
|
591
|
+
"</div>";
|
|
592
|
+
}).join("");
|
|
593
|
+
|
|
594
|
+
var node = document.createElement("div");
|
|
595
|
+
node.className = "theme";
|
|
596
|
+
node.innerHTML =
|
|
597
|
+
'<div class="t-head"><span class="t-title">' + esc(t.title) + "</span>" +
|
|
598
|
+
'<button class="small t-fix">Fix This Theme</button></div>' +
|
|
599
|
+
(t.root_cause ? '<div class="t-cause">Root cause: ' + esc(t.root_cause) + "</div>" : "") +
|
|
600
|
+
(t.action ? '<div class="t-action"><b>Fix:</b> ' + esc(t.action) + "</div>" : "") +
|
|
601
|
+
(items ? '<div class="t-findings">' + items + "</div>" : "");
|
|
602
|
+
node.querySelector(".t-fix").addEventListener("click", function () {
|
|
603
|
+
copyText(composeThemePrompt(t, resolved));
|
|
604
|
+
});
|
|
605
|
+
els.themes.appendChild(node);
|
|
606
|
+
});
|
|
607
|
+
els.themes.hidden = false;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function renderStrengths(list) {
|
|
611
|
+
if (!list.length) { els.strengths.hidden = true; return; }
|
|
612
|
+
els.strengths.innerHTML =
|
|
613
|
+
"<h2>Strengths</h2><ul class=\"strength-list\">" +
|
|
614
|
+
list.map(function (s) { return "<li>" + esc(s) + "</li>"; }).join("") +
|
|
615
|
+
"</ul>";
|
|
616
|
+
els.strengths.hidden = false;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function renderRecommendations(recs) {
|
|
620
|
+
if (!recs.length) { els.recommendations.hidden = true; return; }
|
|
621
|
+
var html = "<h2>Recommendations</h2>";
|
|
622
|
+
recs.forEach(function (r) {
|
|
623
|
+
html += '<div class="rec"><span class="rank">#' + esc(String(r.rank)) + "</span>" +
|
|
624
|
+
esc(r.action) +
|
|
625
|
+
(r.resolves ? '<span class="resolves">resolves: ' + esc(r.resolves) + "</span>" : "") +
|
|
626
|
+
"</div>";
|
|
627
|
+
});
|
|
628
|
+
els.recommendations.innerHTML = html;
|
|
629
|
+
els.recommendations.hidden = false;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function renderExperience(exp) {
|
|
633
|
+
if (!exp) { els.experience.hidden = true; return; }
|
|
634
|
+
var html = "<h2>Experience</h2>";
|
|
635
|
+
if (exp.journeys.length) {
|
|
636
|
+
html += exp.journeys.map(function (j) {
|
|
637
|
+
return '<div class="journey">' +
|
|
638
|
+
'<div class="j-name">' + esc(j.name || "(unnamed journey)") + "</div>" +
|
|
639
|
+
(j.steps ? '<div class="j-steps">' + esc(j.steps) + "</div>" : "") +
|
|
640
|
+
"</div>";
|
|
641
|
+
}).join("");
|
|
642
|
+
}
|
|
643
|
+
if (exp.headless) {
|
|
644
|
+
html += '<dl class="kv" style="margin-top:12px"><dt>Headless</dt><dd>' +
|
|
645
|
+
esc(exp.headless) + "</dd></dl>";
|
|
646
|
+
}
|
|
647
|
+
els.experience.innerHTML = html;
|
|
648
|
+
els.experience.hidden = false;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
function renderNoFindings() {
|
|
652
|
+
els.root.innerHTML =
|
|
653
|
+
'<div class="no-findings">' +
|
|
654
|
+
'<div class="big">No findings</div>' +
|
|
655
|
+
"<div>The scanners returned a clean pass for this subject.</div>" +
|
|
656
|
+
"</div>";
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function findingNode(f) {
|
|
660
|
+
var node = document.createElement("div");
|
|
661
|
+
node.className = "finding sev-" + f.severity;
|
|
662
|
+
node.setAttribute("data-id", f.id);
|
|
663
|
+
|
|
664
|
+
var sub =
|
|
665
|
+
esc(f.lens) +
|
|
666
|
+
(f.location ? ' · <span class="mono">' + esc(f.location) + "</span>" : "");
|
|
667
|
+
|
|
668
|
+
var rows =
|
|
669
|
+
"<dt>Lens</dt><dd>" + esc(f.lens) + "</dd>" +
|
|
670
|
+
(f.location ? "<dt>Location</dt><dd><code>" + esc(f.location) + "</code></dd>" : "") +
|
|
671
|
+
(f.evidence ? "<dt>Evidence</dt><dd>" + esc(f.evidence) + "</dd>" : "") +
|
|
672
|
+
(f.recommendation ? "<dt>Recommendation</dt><dd>" + esc(f.recommendation) + "</dd>" : "") +
|
|
673
|
+
(f.proposed_smallest ? "<dt>Proposed smallest</dt><dd>" + esc(f.proposed_smallest) + "</dd>" : "") +
|
|
674
|
+
(f.predicted_delta ? "<dt>Predicted delta</dt><dd>" + esc(f.predicted_delta) + "</dd>" : "");
|
|
675
|
+
|
|
676
|
+
node.innerHTML =
|
|
677
|
+
'<div class="row">' +
|
|
678
|
+
'<input type="checkbox" class="chk" aria-label="Select finding">' +
|
|
679
|
+
'<div class="head">' +
|
|
680
|
+
'<div class="title">' + esc(f.title) + "</div>" +
|
|
681
|
+
'<div class="sub">' + sub + "</div>" +
|
|
682
|
+
"</div>" +
|
|
683
|
+
'<span class="tag">' + SEV_LABEL[f.severity] + "</span>" +
|
|
684
|
+
'<span class="caret">▸</span>' +
|
|
685
|
+
"</div>" +
|
|
686
|
+
'<div class="body"><dl>' + rows + "</dl></div>";
|
|
687
|
+
|
|
688
|
+
var chk = node.querySelector(".chk");
|
|
689
|
+
chk.checked = !!selected[f.id];
|
|
690
|
+
chk.addEventListener("change", function () {
|
|
691
|
+
if (chk.checked) { selected[f.id] = true; } else { delete selected[f.id]; }
|
|
692
|
+
updateSelection();
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
var head = node.querySelector(".head");
|
|
696
|
+
var caret = node.querySelector(".caret");
|
|
697
|
+
function toggle() { node.classList.toggle("open"); }
|
|
698
|
+
head.addEventListener("click", toggle);
|
|
699
|
+
caret.addEventListener("click", toggle);
|
|
700
|
+
|
|
701
|
+
return node;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function renderFindings(list) {
|
|
705
|
+
els.root.innerHTML = "";
|
|
706
|
+
if (list.length === 0) {
|
|
707
|
+
renderNoFindings();
|
|
708
|
+
els.toolbar.hidden = true;
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
els.toolbar.hidden = false;
|
|
712
|
+
|
|
713
|
+
SEVERITIES.forEach(function (sev) {
|
|
714
|
+
var group = list.filter(function (f) { return f.severity === sev; });
|
|
715
|
+
if (group.length === 0) { return; }
|
|
716
|
+
var wrap = document.createElement("div");
|
|
717
|
+
wrap.className = "group";
|
|
718
|
+
var h = document.createElement("h2");
|
|
719
|
+
h.innerHTML = '<span class="dot ' + sev + '"></span>' + SEV_LABEL[sev] + " (" + group.length + ")";
|
|
720
|
+
wrap.appendChild(h);
|
|
721
|
+
group.forEach(function (f) { wrap.appendChild(findingNode(f)); });
|
|
722
|
+
els.root.appendChild(wrap);
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
function updateSelection() {
|
|
727
|
+
var n = Object.keys(selected).length;
|
|
728
|
+
els.selCount.textContent = n + " selected";
|
|
729
|
+
els.btnCopy.disabled = n === 0;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
function composePrompt() {
|
|
733
|
+
var picked = findings.filter(function (f) { return selected[f.id]; });
|
|
734
|
+
if (picked.length === 0) { return ""; }
|
|
735
|
+
var lines = standardsPreamble();
|
|
736
|
+
lines.push("Fix the following issues in " + subjectPath + ":");
|
|
737
|
+
lines.push("");
|
|
738
|
+
picked.forEach(function (f, i) {
|
|
739
|
+
lines.push((i + 1) + ". " + f.title);
|
|
740
|
+
if (f.location) { lines.push(" Location: " + f.location); }
|
|
741
|
+
if (f.evidence) { lines.push(" Evidence: " + f.evidence); }
|
|
742
|
+
if (f.recommendation) { lines.push(" Recommendation: " + f.recommendation); }
|
|
743
|
+
if (f.proposed_smallest) { lines.push(" Proposed smallest: " + f.proposed_smallest); }
|
|
744
|
+
lines.push("");
|
|
745
|
+
});
|
|
746
|
+
return lines.join("\n").replace(/\n+$/, "\n");
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function showToast(text) {
|
|
750
|
+
els.toast.textContent = text;
|
|
751
|
+
els.toast.classList.add("show");
|
|
752
|
+
setTimeout(function () { els.toast.classList.remove("show"); }, 1600);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
function fallbackCopy(text) {
|
|
756
|
+
els.fallbackText.value = text;
|
|
757
|
+
els.fallback.classList.add("show");
|
|
758
|
+
els.fallbackText.focus();
|
|
759
|
+
els.fallbackText.select();
|
|
760
|
+
try {
|
|
761
|
+
var ok = document.execCommand && document.execCommand("copy");
|
|
762
|
+
if (ok) {
|
|
763
|
+
showToast("Copied");
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
} catch (e) { /* fall through to manual */ }
|
|
767
|
+
showToast("Copy the text shown below");
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
function copyText(text) {
|
|
771
|
+
if (!text) { return; }
|
|
772
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
773
|
+
navigator.clipboard.writeText(text).then(
|
|
774
|
+
function () { showToast("Copied"); },
|
|
775
|
+
function () { fallbackCopy(text); }
|
|
776
|
+
);
|
|
777
|
+
} else {
|
|
778
|
+
fallbackCopy(text);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function doCopy() {
|
|
783
|
+
copyText(composePrompt());
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function wireToolbar() {
|
|
787
|
+
els.btnCopy.addEventListener("click", doCopy);
|
|
788
|
+
els.btnSelectAll.addEventListener("click", function () {
|
|
789
|
+
findings.forEach(function (f) { selected[f.id] = true; });
|
|
790
|
+
document.querySelectorAll(".finding .chk").forEach(function (c) { c.checked = true; });
|
|
791
|
+
updateSelection();
|
|
792
|
+
});
|
|
793
|
+
els.btnClear.addEventListener("click", function () {
|
|
794
|
+
selected = Object.create(null);
|
|
795
|
+
document.querySelectorAll(".finding .chk").forEach(function (c) { c.checked = false; });
|
|
796
|
+
els.fallback.classList.remove("show");
|
|
797
|
+
updateSelection();
|
|
798
|
+
});
|
|
799
|
+
els.btnExpandAll.addEventListener("click", function () {
|
|
800
|
+
document.querySelectorAll(".finding").forEach(function (n) { n.classList.add("open"); });
|
|
801
|
+
});
|
|
802
|
+
els.btnCollapseAll.addEventListener("click", function () {
|
|
803
|
+
document.querySelectorAll(".finding").forEach(function (n) { n.classList.remove("open"); });
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function init() {
|
|
808
|
+
var island = document.getElementById("report-data");
|
|
809
|
+
var parsed;
|
|
810
|
+
try {
|
|
811
|
+
if (!island) { throw new Error("report-data island element not found"); }
|
|
812
|
+
parsed = JSON.parse(island.textContent);
|
|
813
|
+
} catch (err) {
|
|
814
|
+
showBanner(
|
|
815
|
+
"Could not parse the report data island.\n\n" +
|
|
816
|
+
"Error: " + (err && err.message ? err.message : String(err)) + "\n\n" +
|
|
817
|
+
"The findings could not be rendered. The JSON inside the " +
|
|
818
|
+
'report-data island (the application/json script tag) is malformed.'
|
|
819
|
+
);
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
var data = normalize(parsed);
|
|
824
|
+
|
|
825
|
+
if (data.subject === PLACEHOLDER_SUBJECT) {
|
|
826
|
+
els.subject.textContent = data.subject;
|
|
827
|
+
showBanner(
|
|
828
|
+
"This is the unfilled report shell.\n\n" +
|
|
829
|
+
"The report-data island still carries the placeholder subject, so " +
|
|
830
|
+
"there are no findings here. Generate a real report with " +
|
|
831
|
+
"scripts/render_report.py."
|
|
832
|
+
);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
findings = data.findings;
|
|
837
|
+
subjectPath = data.subject;
|
|
838
|
+
standards = data.standards;
|
|
839
|
+
findingsById = Object.create(null);
|
|
840
|
+
findings.forEach(function (f) { findingsById[f.id] = f; });
|
|
841
|
+
|
|
842
|
+
renderOverview(data);
|
|
843
|
+
renderThemes(data.themes);
|
|
844
|
+
renderStrengths(data.strengths);
|
|
845
|
+
renderRecommendations(data.recommendations);
|
|
846
|
+
renderExperience(data.experience);
|
|
847
|
+
renderFindings(findings);
|
|
848
|
+
wireToolbar();
|
|
849
|
+
updateSelection();
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
if (document.readyState === "loading") {
|
|
853
|
+
document.addEventListener("DOMContentLoaded", init);
|
|
854
|
+
} else {
|
|
855
|
+
init();
|
|
856
|
+
}
|
|
857
|
+
})();
|
|
858
|
+
</script>
|
|
859
|
+
</body>
|
|
860
|
+
</html>
|