trapline 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +585 -0
  4. data/config.ru.example +21 -0
  5. data/exe/trapline +8 -0
  6. data/lib/generators/trapline/install_generator.rb +34 -0
  7. data/lib/generators/trapline/templates/initializer.rb +23 -0
  8. data/lib/tasks/trapline.rake +19 -0
  9. data/lib/trapline/cli.rb +212 -0
  10. data/lib/trapline/configuration.rb +19 -0
  11. data/lib/trapline/cve/client.rb +203 -0
  12. data/lib/trapline/cve/record.rb +160 -0
  13. data/lib/trapline/engine.rb +243 -0
  14. data/lib/trapline/generator.rb +236 -0
  15. data/lib/trapline/languages.rb +65 -0
  16. data/lib/trapline/railtie.rb +26 -0
  17. data/lib/trapline/rule.rb +165 -0
  18. data/lib/trapline/runtime.rb +148 -0
  19. data/lib/trapline/store.rb +113 -0
  20. data/lib/trapline/suite.rb +44 -0
  21. data/lib/trapline/templates/cwe/cwe-22.yml +167 -0
  22. data/lib/trapline/templates/cwe/cwe-327.yml +124 -0
  23. data/lib/trapline/templates/cwe/cwe-502.yml +123 -0
  24. data/lib/trapline/templates/cwe/cwe-601.yml +124 -0
  25. data/lib/trapline/templates/cwe/cwe-611.yml +87 -0
  26. data/lib/trapline/templates/cwe/cwe-78.yml +166 -0
  27. data/lib/trapline/templates/cwe/cwe-79.yml +164 -0
  28. data/lib/trapline/templates/cwe/cwe-798.yml +125 -0
  29. data/lib/trapline/templates/cwe/cwe-89.yml +189 -0
  30. data/lib/trapline/templates/cwe/cwe-917.yml +46 -0
  31. data/lib/trapline/templates/cwe/cwe-918.yml +166 -0
  32. data/lib/trapline/templates/cwe/cwe-94.yml +131 -0
  33. data/lib/trapline/templates.rb +261 -0
  34. data/lib/trapline/validator.rb +359 -0
  35. data/lib/trapline/version.rb +5 -0
  36. data/lib/trapline/web/app.rb +234 -0
  37. data/lib/trapline/web/assets/THIRD_PARTY_LICENSES.txt +214 -0
  38. data/lib/trapline/web/assets/app.css +399 -0
  39. data/lib/trapline/web/assets/app.js +804 -0
  40. data/lib/trapline/web/assets/codemirror.css +344 -0
  41. data/lib/trapline/web/assets/codemirror.js +13263 -0
  42. data/lib/trapline/web/assets/index.html +165 -0
  43. data/lib/trapline/web/assets/jetbrains-mono-latin-400-normal.woff2 +0 -0
  44. data/lib/trapline/web/assets/jetbrains-mono-latin-600-normal.woff2 +0 -0
  45. data/lib/trapline/web/assets/public-sans-latin-400-normal.woff2 +0 -0
  46. data/lib/trapline/web/assets/public-sans-latin-500-normal.woff2 +0 -0
  47. data/lib/trapline/web/assets/public-sans-latin-600-normal.woff2 +0 -0
  48. data/lib/trapline/web/assets/public-sans-latin-700-normal.woff2 +0 -0
  49. data/lib/trapline/web/server.rb +108 -0
  50. data/lib/trapline.rb +70 -0
  51. metadata +136 -0
@@ -0,0 +1,214 @@
1
+ Third-party assets bundled with Trapline
2
+
3
+ == CodeMirror 5.65.16 (MIT) ==
4
+ MIT License
5
+
6
+ Copyright (C) 2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+ == Public Sans (SIL Open Font License 1.1) via @fontsource/public-sans ==
27
+ Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) PublicSans-Italic[wght].ttf: Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)
28
+
29
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
30
+ This license is copied below, and is also available with a FAQ at:
31
+ http://scripts.sil.org/OFL
32
+
33
+
34
+ -----------------------------------------------------------
35
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
36
+ -----------------------------------------------------------
37
+
38
+ PREAMBLE
39
+ The goals of the Open Font License (OFL) are to stimulate worldwide
40
+ development of collaborative font projects, to support the font creation
41
+ efforts of academic and linguistic communities, and to provide a free and
42
+ open framework in which fonts may be shared and improved in partnership
43
+ with others.
44
+
45
+ The OFL allows the licensed fonts to be used, studied, modified and
46
+ redistributed freely as long as they are not sold by themselves. The
47
+ fonts, including any derivative works, can be bundled, embedded,
48
+ redistributed and/or sold with any software provided that any reserved
49
+ names are not used by derivative works. The fonts and derivatives,
50
+ however, cannot be released under any other type of license. The
51
+ requirement for fonts to remain under this license does not apply
52
+ to any document created using the fonts or their derivatives.
53
+
54
+ DEFINITIONS
55
+ "Font Software" refers to the set of files released by the Copyright
56
+ Holder(s) under this license and clearly marked as such. This may
57
+ include source files, build scripts and documentation.
58
+
59
+ "Reserved Font Name" refers to any names specified as such after the
60
+ copyright statement(s).
61
+
62
+ "Original Version" refers to the collection of Font Software components as
63
+ distributed by the Copyright Holder(s).
64
+
65
+ "Modified Version" refers to any derivative made by adding to, deleting,
66
+ or substituting -- in part or in whole -- any of the components of the
67
+ Original Version, by changing formats or by porting the Font Software to a
68
+ new environment.
69
+
70
+ "Author" refers to any designer, engineer, programmer, technical
71
+ writer or other person who contributed to the Font Software.
72
+
73
+ PERMISSION & CONDITIONS
74
+ Permission is hereby granted, free of charge, to any person obtaining
75
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
76
+ redistribute, and sell modified and unmodified copies of the Font
77
+ Software, subject to the following conditions:
78
+
79
+ 1) Neither the Font Software nor any of its individual components,
80
+ in Original or Modified Versions, may be sold by itself.
81
+
82
+ 2) Original or Modified Versions of the Font Software may be bundled,
83
+ redistributed and/or sold with any software, provided that each copy
84
+ contains the above copyright notice and this license. These can be
85
+ included either as stand-alone text files, human-readable headers or
86
+ in the appropriate machine-readable metadata fields within text or
87
+ binary files as long as those fields can be easily viewed by the user.
88
+
89
+ 3) No Modified Version of the Font Software may use the Reserved Font
90
+ Name(s) unless explicit written permission is granted by the corresponding
91
+ Copyright Holder. This restriction only applies to the primary font name as
92
+ presented to the users.
93
+
94
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
95
+ Software shall not be used to promote, endorse or advertise any
96
+ Modified Version, except to acknowledge the contribution(s) of the
97
+ Copyright Holder(s) and the Author(s) or with their explicit written
98
+ permission.
99
+
100
+ 5) The Font Software, modified or unmodified, in part or in whole,
101
+ must be distributed entirely under this license, and must not be
102
+ distributed under any other license. The requirement for fonts to
103
+ remain under this license does not apply to any document created
104
+ using the Font Software.
105
+
106
+ TERMINATION
107
+ This license becomes null and void if any of the above conditions are
108
+ not met.
109
+
110
+ DISCLAIMER
111
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
112
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
113
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
114
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
115
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
116
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
117
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
118
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
119
+ OTHER DEALINGS IN THE FONT SOFTWARE.
120
+
121
+ == JetBrains Mono (SIL Open Font License 1.1) via @fontsource/jetbrains-mono ==
122
+ Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
123
+
124
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
125
+ This license is copied below, and is also available with a FAQ at:
126
+ http://scripts.sil.org/OFL
127
+
128
+
129
+ -----------------------------------------------------------
130
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
131
+ -----------------------------------------------------------
132
+
133
+ PREAMBLE
134
+ The goals of the Open Font License (OFL) are to stimulate worldwide
135
+ development of collaborative font projects, to support the font creation
136
+ efforts of academic and linguistic communities, and to provide a free and
137
+ open framework in which fonts may be shared and improved in partnership
138
+ with others.
139
+
140
+ The OFL allows the licensed fonts to be used, studied, modified and
141
+ redistributed freely as long as they are not sold by themselves. The
142
+ fonts, including any derivative works, can be bundled, embedded,
143
+ redistributed and/or sold with any software provided that any reserved
144
+ names are not used by derivative works. The fonts and derivatives,
145
+ however, cannot be released under any other type of license. The
146
+ requirement for fonts to remain under this license does not apply
147
+ to any document created using the fonts or their derivatives.
148
+
149
+ DEFINITIONS
150
+ "Font Software" refers to the set of files released by the Copyright
151
+ Holder(s) under this license and clearly marked as such. This may
152
+ include source files, build scripts and documentation.
153
+
154
+ "Reserved Font Name" refers to any names specified as such after the
155
+ copyright statement(s).
156
+
157
+ "Original Version" refers to the collection of Font Software components as
158
+ distributed by the Copyright Holder(s).
159
+
160
+ "Modified Version" refers to any derivative made by adding to, deleting,
161
+ or substituting -- in part or in whole -- any of the components of the
162
+ Original Version, by changing formats or by porting the Font Software to a
163
+ new environment.
164
+
165
+ "Author" refers to any designer, engineer, programmer, technical
166
+ writer or other person who contributed to the Font Software.
167
+
168
+ PERMISSION & CONDITIONS
169
+ Permission is hereby granted, free of charge, to any person obtaining
170
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
171
+ redistribute, and sell modified and unmodified copies of the Font
172
+ Software, subject to the following conditions:
173
+
174
+ 1) Neither the Font Software nor any of its individual components,
175
+ in Original or Modified Versions, may be sold by itself.
176
+
177
+ 2) Original or Modified Versions of the Font Software may be bundled,
178
+ redistributed and/or sold with any software, provided that each copy
179
+ contains the above copyright notice and this license. These can be
180
+ included either as stand-alone text files, human-readable headers or
181
+ in the appropriate machine-readable metadata fields within text or
182
+ binary files as long as those fields can be easily viewed by the user.
183
+
184
+ 3) No Modified Version of the Font Software may use the Reserved Font
185
+ Name(s) unless explicit written permission is granted by the corresponding
186
+ Copyright Holder. This restriction only applies to the primary font name as
187
+ presented to the users.
188
+
189
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
190
+ Software shall not be used to promote, endorse or advertise any
191
+ Modified Version, except to acknowledge the contribution(s) of the
192
+ Copyright Holder(s) and the Author(s) or with their explicit written
193
+ permission.
194
+
195
+ 5) The Font Software, modified or unmodified, in part or in whole,
196
+ must be distributed entirely under this license, and must not be
197
+ distributed under any other license. The requirement for fonts to
198
+ remain under this license does not apply to any document created
199
+ using the Font Software.
200
+
201
+ TERMINATION
202
+ This license becomes null and void if any of the above conditions are
203
+ not met.
204
+
205
+ DISCLAIMER
206
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
207
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
208
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
209
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
210
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
211
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
212
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
213
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
214
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,399 @@
1
+ @font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("public-sans-latin-400-normal.woff2") format("woff2"); }
2
+ @font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("public-sans-latin-500-normal.woff2") format("woff2"); }
3
+ @font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("public-sans-latin-600-normal.woff2") format("woff2"); }
4
+ @font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("public-sans-latin-700-normal.woff2") format("woff2"); }
5
+ @font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
6
+ @font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("jetbrains-mono-latin-600-normal.woff2") format("woff2"); }
7
+
8
+ :root {
9
+ --ink: #1c2733;
10
+ --ink-2: #4a5a6b;
11
+ --ink-3: #7b8a99;
12
+ --paper: #eef1f4;
13
+ --sheet: #fbfcfd;
14
+ --line: #d3dae1;
15
+ --line-2: #e3e8ed;
16
+ --blue: #2f5c8f;
17
+ --blue-wash: #e2ebf5;
18
+ --marker: #f2b33d;
19
+ --marker-wash: #fde8b3;
20
+ --pass: #2f7d5b;
21
+ --pass-wash: #dcefe5;
22
+ --fail: #b4372f;
23
+ --fail-wash: #f6dfdc;
24
+ --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
25
+ --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
26
+ --r-sm: 4px;
27
+ --r-md: 7px;
28
+ }
29
+
30
+ * { box-sizing: border-box; }
31
+ html, body { height: 100%; }
32
+ body {
33
+ margin: 0;
34
+ font: 400 14px/1.45 var(--sans);
35
+ color: var(--ink);
36
+ background: var(--paper);
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+ code, .CodeMirror, .fallback, .rl-id, .doc-name, .res-code { font-variant-ligatures: none; }
41
+ code { font-family: var(--mono); font-size: 0.92em; }
42
+ h2, h3 { margin: 0; }
43
+ .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
44
+
45
+ button, select, input, textarea { font: inherit; color: inherit; }
46
+ button {
47
+ border: 1px solid var(--line);
48
+ background: var(--sheet);
49
+ padding: 6px 12px;
50
+ border-radius: var(--r-sm);
51
+ cursor: pointer;
52
+ font-weight: 500;
53
+ }
54
+ button:hover { border-color: var(--ink-3); }
55
+ button:disabled { opacity: 0.5; cursor: default; }
56
+ button.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
57
+ button.primary:hover { background: #2c3a49; }
58
+ button.accent { background: var(--blue-wash); border-color: #b9cde3; color: var(--blue); }
59
+ button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
60
+ button.ghost:hover { background: var(--line-2); }
61
+ button.danger { color: var(--fail); }
62
+ :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
63
+ input, select, textarea {
64
+ border: 1px solid var(--line);
65
+ background: #fff;
66
+ border-radius: var(--r-sm);
67
+ padding: 5px 8px;
68
+ min-width: 0;
69
+ }
70
+ textarea { resize: vertical; }
71
+ label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
72
+ label > input, label > select, label > textarea { font-size: 13.5px; color: var(--ink); font-weight: 400; }
73
+
74
+ .top {
75
+ display: flex;
76
+ align-items: center;
77
+ gap: 20px;
78
+ padding: 10px 18px;
79
+ background: var(--sheet);
80
+ border-bottom: 1px solid var(--line);
81
+ }
82
+ .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
83
+ .brand svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
84
+ .brand rect { fill: var(--marker); stroke: none; }
85
+ .doc { flex: 1; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
86
+ .doc-name { font-family: var(--mono); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
87
+ .doc-state { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
88
+ .doc-state.dirty { color: #8a5a00; }
89
+ .top-actions { display: flex; align-items: center; gap: 6px; }
90
+ .engine { font-size: 12.5px; color: var(--ink-3); margin-right: 8px; white-space: nowrap; }
91
+ .engine.missing { color: var(--fail); }
92
+
93
+ .layout { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
94
+ .side {
95
+ border-right: 1px solid var(--line);
96
+ padding: 14px;
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 12px;
100
+ min-height: 0;
101
+ }
102
+ .side-actions { display: grid; gap: 6px; }
103
+ .search input { width: 100%; }
104
+ .rule-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
105
+ .rule-list li + li { border-top: 1px solid var(--line-2); }
106
+ .rule-list button {
107
+ display: block;
108
+ width: 100%;
109
+ text-align: left;
110
+ border: 0;
111
+ border-radius: var(--r-sm);
112
+ background: transparent;
113
+ padding: 8px 8px;
114
+ }
115
+ .rule-list button:hover { background: var(--line-2); }
116
+ .rule-list button[aria-current="true"] { background: var(--sheet); box-shadow: inset 3px 0 0 var(--ink); }
117
+ .rl-id { display: block; font-family: var(--mono); font-size: 12.5px; font-weight: 600; word-break: break-all; }
118
+ .rl-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
119
+ .rl-sev { font-weight: 600; }
120
+ .sev-ERROR, .sev-CRITICAL, .sev-HIGH { color: var(--fail); }
121
+ .sev-WARNING, .sev-MEDIUM { color: #8a5a00; }
122
+ .sev-LOW, .sev-INFO { color: var(--ink-3); }
123
+ .rl-err { color: var(--fail); }
124
+ .rule-list .empty { padding: 8px; color: var(--ink-3); font-size: 13px; }
125
+ .rules-path { margin: 0; font-size: 11.5px; color: var(--ink-3); word-break: break-all; }
126
+
127
+ .work { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; min-width: 0; }
128
+ .pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 14px 16px 16px; gap: 10px; }
129
+ .pane + .pane { border-left: 1px solid var(--line); }
130
+ .pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
131
+ .pane-head h2 { font-size: 14px; font-weight: 600; }
132
+ .hint { color: var(--ink-3); font-weight: 400; margin-left: 4px; }
133
+ .mode { font-size: 12.5px; color: var(--ink-2); }
134
+ .test-controls { display: flex; align-items: center; gap: 8px; }
135
+ .auto { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; white-space: nowrap; }
136
+
137
+ .editor {
138
+ flex: 1;
139
+ min-height: 160px;
140
+ border: 1px solid var(--line);
141
+ border-radius: var(--r-md);
142
+ background: #fff;
143
+ overflow: hidden;
144
+ position: relative;
145
+ }
146
+ .editor .CodeMirror, .editor textarea.fallback {
147
+ position: absolute;
148
+ inset: 0;
149
+ height: 100%;
150
+ width: 100%;
151
+ font-family: var(--mono);
152
+ font-size: 13px;
153
+ line-height: 1.55;
154
+ }
155
+ .editor textarea.fallback { border: 0; padding: 10px; resize: none; white-space: pre; tab-size: 2; }
156
+ .CodeMirror { color: var(--ink); }
157
+ .CodeMirror-gutters { background: #f6f8fa; border-right: 1px solid var(--line-2); }
158
+ .CodeMirror-linenumber { color: #a3afbb; }
159
+ .CodeMirror-cursor { border-left: 2px solid var(--ink); }
160
+ .CodeMirror-selected { background: var(--blue-wash) !important; }
161
+ .cm-s-default .cm-atom { color: var(--blue); }
162
+ .cm-s-default .cm-string { color: #23704f; }
163
+ .cm-s-default .cm-keyword { color: #7a3e9d; }
164
+ .cm-s-default .cm-comment { color: #8292a2; font-style: italic; }
165
+ .cm-s-default .cm-variable-2, .cm-s-default .cm-def { color: #2b5a8c; }
166
+ .cm-s-default .cm-meta { color: var(--ink-2); }
167
+
168
+ .hl-finding {
169
+ background: linear-gradient(180deg, transparent 12%, var(--marker-wash) 12%, var(--marker-wash) 88%, transparent 88%);
170
+ }
171
+ .hl-finding-line { background: #fff7e2; }
172
+ .hl-flash { animation: flash 0.9s ease-out 1; }
173
+ @keyframes flash { from { background: var(--marker); } }
174
+ .ann-gutter { width: 22px; }
175
+ .ann {
176
+ display: inline-flex;
177
+ width: 16px;
178
+ height: 16px;
179
+ margin-top: 2px;
180
+ margin-left: 3px;
181
+ border-radius: 50%;
182
+ align-items: center;
183
+ justify-content: center;
184
+ font: 700 10px/1 var(--sans);
185
+ color: #fff;
186
+ cursor: default;
187
+ }
188
+ .ann-pass { background: var(--pass); }
189
+ .ann-fail { background: var(--fail); }
190
+ .ann-todo { background: var(--ink-3); }
191
+ .ann-hit { background: var(--marker); color: var(--ink); }
192
+ .ann-badge { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 7px; border-radius: 999px; font-family: var(--sans); font-size: 11.5px; font-weight: 600; line-height: 1.55; cursor: text; user-select: none; }
193
+ .ann-badge-pass { color: var(--pass); background: var(--pass-wash); }
194
+ .ann-badge-fail { color: var(--fail); background: var(--fail-wash); }
195
+ .ann-badge-todo { color: var(--ink-3); background: var(--paper); }
196
+ .ann-badge-ids { font-family: var(--mono); font-weight: 400; }
197
+ .err-line { background: var(--fail-wash); }
198
+
199
+ .details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sheet); }
200
+ .details summary {
201
+ display: flex;
202
+ align-items: baseline;
203
+ gap: 10px;
204
+ padding: 8px 12px;
205
+ cursor: pointer;
206
+ font-weight: 600;
207
+ font-size: 13.5px;
208
+ list-style: none;
209
+ }
210
+ .details summary::-webkit-details-marker { display: none; }
211
+ .details summary::before { content: "▸"; color: var(--ink-3); font-size: 11px; transition: transform 0.15s; }
212
+ .details[open] summary::before { transform: rotate(90deg); }
213
+ .details-summary { font-weight: 400; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
214
+ .fields {
215
+ display: grid;
216
+ grid-template-columns: 2fr 1fr 1.2fr;
217
+ gap: 10px 12px;
218
+ padding: 4px 12px 12px;
219
+ }
220
+ .f-msg, .f-refs { grid-column: 1 / -1; }
221
+ .f-cwe { grid-column: span 1; }
222
+
223
+ .issues { max-height: 132px; overflow: auto; display: grid; gap: 4px; }
224
+ .issue {
225
+ display: grid;
226
+ grid-template-columns: auto 1fr;
227
+ gap: 8px;
228
+ align-items: baseline;
229
+ font-size: 12.5px;
230
+ padding: 5px 8px;
231
+ border-radius: var(--r-sm);
232
+ background: var(--sheet);
233
+ border: 1px solid var(--line-2);
234
+ }
235
+ .issue b { font-weight: 600; }
236
+ .issue-error { border-color: #ecc3be; background: var(--fail-wash); }
237
+ .issue-warning { border-color: #f0d79e; background: #fdf4dc; }
238
+ .issue-info { color: var(--ink-2); }
239
+ .issue-path { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
240
+ .issues .ok { font-size: 12.5px; color: var(--pass); margin: 0; }
241
+
242
+ .results { max-height: 40%; min-height: 96px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
243
+ .results { transition: opacity 120ms ease; }
244
+ .results:empty, .run-status:empty { display: none; }
245
+ .run-status { transition: opacity 120ms ease; flex-shrink: 0; }
246
+ .results.running, .run-status.running { opacity: 0.45; pointer-events: none; }
247
+ .run-status.fresh .status-card { animation: fresh 600ms ease-out; }
248
+ @keyframes fresh { from { transform: translateY(-3px); box-shadow: 0 4px 14px rgba(20, 30, 40, 0.14); } to { transform: none; box-shadow: none; } }
249
+ @media (prefers-reduced-motion: reduce) { .run-status.fresh .status-card { animation: none; } }
250
+
251
+ .status-card {
252
+ display: flex; align-items: center; gap: 12px;
253
+ padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px;
254
+ border-radius: var(--r-md); background: #fff; flex-shrink: 0;
255
+ }
256
+ .status-icon {
257
+ flex: none; width: 26px; height: 26px; border-radius: 50%;
258
+ display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
259
+ background: var(--ink-3);
260
+ }
261
+ .status-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
262
+ .status-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
263
+ .status-sub { font-size: 12.5px; color: var(--ink-3); }
264
+ .status-pass { border-color: #b7dcc8; border-left-color: var(--pass); background: var(--pass-wash); }
265
+ .status-pass .status-icon { background: var(--pass); }
266
+ .status-pass .status-title { color: var(--pass); }
267
+ .status-fail { border-color: #ecc3be; border-left-color: var(--fail); background: var(--fail-wash); }
268
+ .status-fail .status-icon { background: var(--fail); }
269
+ .status-fail .status-title { color: var(--fail); }
270
+ .status-fail .status-sub { color: var(--ink-2); white-space: pre-wrap; }
271
+ .status-info { border-left-color: var(--blue); }
272
+ .status-info .status-icon { background: var(--blue); font-family: Georgia, serif; font-style: italic; }
273
+ .results .empty { color: var(--ink-3); margin: 6px 0; font-size: 13px; max-width: 60ch; }
274
+ .res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
275
+ .res-list li { display: flex; align-items: center; gap: 6px; border-radius: var(--r-sm); }
276
+ .res-list li:hover { background: var(--line-2); }
277
+ .res-list li .res-main {
278
+ display: grid;
279
+ grid-template-columns: 22px 64px 1fr;
280
+ gap: 6px;
281
+ flex: 1;
282
+ min-width: 0;
283
+ text-align: left;
284
+ align-items: baseline;
285
+ border: 0;
286
+ background: transparent;
287
+ padding: 4px 6px;
288
+ font-size: 13px;
289
+ font-weight: 400;
290
+ }
291
+ .res-acts { display: flex; gap: 4px; flex: none; padding-right: 4px; }
292
+ .res-act {
293
+ font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: var(--r-sm);
294
+ border: 1px solid var(--line); background: #fff; color: var(--ink-2); white-space: nowrap;
295
+ }
296
+ .res-act:hover { border-color: var(--ink-3); color: var(--ink); }
297
+ .res-act.pass { color: var(--pass); border-color: #b7dcc8; }
298
+ .res-act.pass:hover { background: var(--pass-wash); }
299
+ .res-act.fail { color: var(--fail); border-color: #ecc3be; }
300
+ .res-act.fail:hover { background: var(--fail-wash); }
301
+ .res-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); padding: 0 4px; }
302
+ .pane-test .CodeMirror-gutters, .pane-test .CodeMirror-gutter-wrapper { cursor: pointer; }
303
+ .pane-test .CodeMirror-gutter-wrapper:hover .CodeMirror-linenumber { color: var(--ink); font-weight: 600; }
304
+ .res-line { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
305
+ .res-code { font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
306
+ .res-reason { display: block; font-family: var(--sans); color: var(--fail); font-size: 12px; white-space: normal; }
307
+ .engine-error { font-size: 12.5px; color: var(--fail); background: var(--fail-wash); padding: 8px 10px; border-radius: var(--r-sm); margin: 0; white-space: pre-wrap; font-family: var(--mono); }
308
+
309
+ .dlg {
310
+ border: 1px solid var(--line);
311
+ border-radius: 10px;
312
+ padding: 20px 22px;
313
+ width: min(480px, 94vw);
314
+ background: var(--sheet);
315
+ color: var(--ink);
316
+ box-shadow: 0 18px 50px rgba(28, 39, 51, 0.22);
317
+ }
318
+ .dlg-wide { width: min(820px, 96vw); max-height: 92vh; }
319
+ .dlg-wide[open] { display: flex; flex-direction: column; overflow: hidden; }
320
+ .dlg-wide .dlg-actions { flex: none; border-top: 1px solid var(--line-2); padding-top: 14px; }
321
+ .dlg::backdrop { background: rgba(28, 39, 51, 0.35); }
322
+ .dlg h3 { font-size: 17px; margin-bottom: 6px; letter-spacing: -0.01em; }
323
+ .dlg-lead { color: var(--ink-2); margin: 0 0 14px; font-size: 13.5px; max-width: 65ch; }
324
+ .dlg form { display: grid; gap: 12px; }
325
+ .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
326
+ .row .grow { flex: 1; min-width: 200px; }
327
+ .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
328
+ .kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
329
+ .kind {
330
+ flex-direction: row;
331
+ align-items: center;
332
+ gap: 10px;
333
+ padding: 9px 12px;
334
+ border: 1px solid var(--line);
335
+ border-radius: var(--r-md);
336
+ background: #fff;
337
+ font-size: 13.5px;
338
+ color: var(--ink);
339
+ cursor: pointer;
340
+ }
341
+ .kind:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
342
+ .manual { border-top: 1px solid var(--line-2); padding-top: 10px; }
343
+ .manual summary { cursor: pointer; color: var(--blue); font-size: 13px; }
344
+ .manual-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; align-items: end; }
345
+ .manual-grid .span { grid-column: 1 / -1; }
346
+ .manual-grid button { grid-column: 1 / -1; justify-self: start; }
347
+
348
+ .cve-result { margin-top: 16px; display: grid; gap: 14px; overflow: auto; flex: 1; min-height: 0; align-content: start; }
349
+ .cve-head { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
350
+ .cve-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
351
+ .cve-id { font-family: var(--mono); font-weight: 600; }
352
+ .cve-sev { font-size: 12px; font-weight: 700; }
353
+ .cve-desc { margin: 0; color: var(--ink-2); font-size: 13px; max-width: 75ch; }
354
+ .cve-facts { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
355
+ .cve-notes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
356
+ .cands { display: grid; gap: 6px; }
357
+ .cand { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; color: var(--ink); }
358
+ .cand:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
359
+ .cand input { margin-top: 3px; }
360
+ .cand-title { font-size: 13.5px; font-weight: 600; }
361
+ .cand-notes { margin: 3px 0 0; padding-left: 16px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
362
+ .cve-error { color: var(--fail); background: var(--fail-wash); padding: 10px 12px; border-radius: var(--r-sm); margin: 0; font-size: 13px; }
363
+ .loading { color: var(--ink-3); font-size: 13px; }
364
+
365
+ .toast {
366
+ position: fixed;
367
+ top: 66px;
368
+ left: 50%;
369
+ transform: translateX(-50%);
370
+ background: var(--ink);
371
+ color: #fff;
372
+ padding: 9px 16px;
373
+ border-radius: var(--r-md);
374
+ font-size: 13.5px;
375
+ box-shadow: 0 8px 24px rgba(28, 39, 51, 0.25);
376
+ z-index: 10;
377
+ }
378
+ .toast.error { background: var(--fail); }
379
+ .toast.success { background: var(--pass); }
380
+
381
+ @media (max-width: 1100px) {
382
+ .work { grid-template-columns: 1fr; overflow: auto; }
383
+ .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
384
+ .pane { min-height: 520px; }
385
+ }
386
+ @media (max-width: 760px) {
387
+ .layout { grid-template-columns: 1fr; }
388
+ .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
389
+ .top { flex-wrap: wrap; gap: 8px 14px; }
390
+ .doc { order: 3; flex-basis: 100%; }
391
+ .top-actions { margin-left: auto; }
392
+ .engine { display: none; }
393
+ .fields { grid-template-columns: 1fr 1fr; }
394
+ .manual-grid { grid-template-columns: 1fr 1fr; }
395
+ .test-controls { flex-wrap: wrap; }
396
+ }
397
+ @media (prefers-reduced-motion: reduce) {
398
+ * { animation: none !important; transition: none !important; }
399
+ }