skillgauntlet 1.2.0 → 1.3.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/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -28,7 +28,7 @@ can be compared.
28
28
  - [Codex probe](step0/data/2026-10-28_codex_probe/BATCH.md): facts only, no trigger rate (see
29
29
  "Hosts and models").
30
30
  - [Static layer](step0/data/2026-10-28_all_haiku/static/SUMMARY.md): all 18 skills, no model calls.
31
- - [Leaderboard](LEADERBOARD.md): the maintainer's batches and community submissions in one generated page, one table per host.
31
+ - [Leaderboard](https://skillgauntlet.github.io/SkillGauntlet/): the maintainer's batches and community submissions in one generated page, one table per host. It is rebuilt from the data on `main` every time a submission is merged.
32
32
 
33
33
  ## Usage
34
34
 
@@ -123,9 +123,23 @@ command. Results stay on your machine until you run it; nothing is uploaded auto
123
123
  4. Sign the [CLA](CLA.md) when the bot asks (once). CI then comments on the pull request with a pass, or with
124
124
  exactly what is missing.
125
125
 
126
+ **Passing submissions are merged automatically**, usually within a few minutes, and appear on the
127
+ [leaderboard](https://skillgauntlet.github.io/SkillGauntlet/) as a *community single sample*. A bot re-checks your files from scratch (it does not trust the
128
+ result shown on your own pull request) and merges only when everything holds: exactly one new submission folder with
129
+ the four files, the format and hashes check out, the CLA is signed, and the account is in good standing.
130
+
131
+ **When it goes to manual review.** The pull request gets a `needs-review` label and a comment listing why, and a
132
+ maintainer looks at it. This happens when it changes anything besides one new submission folder, fails a check, is
133
+ over the size limits, comes from an account younger than 30 days or one whose submission was refused in the last 24
134
+ hours, exceeds 5 automatic merges per account per day, or arrives before the CLA is signed (sign it and ask a
135
+ maintainer to re-run the check). Maintainers' own pull requests skip the account-age and recent-refusal rules.
136
+
137
+ The very first pull request from a new account still needs a maintainer to click "Approve and run" on its workflow
138
+ run, a GitHub rule for first-time fork contributors; the automatic merge starts after that.
139
+
126
140
  A merged submission is a **community single sample**. It becomes **confirmed** when another independent
127
141
  submission, or a maintainer run, lands on the same grade for the same skill version, host and model.
128
- Disagreeing results are kept side by side. See [`LEADERBOARD.md`](LEADERBOARD.md) for the current rows and what
142
+ Disagreeing results are kept side by side. See the [leaderboard](https://skillgauntlet.github.io/SkillGauntlet/) for the current rows and what
129
143
  each tag means, and [CONTRIBUTING.md](CONTRIBUTING.md#submitting-results) for the details, including what CI
130
144
  checks and what it cannot.
131
145
 
@@ -10,20 +10,22 @@ import { findSkills, resolveSpec, skillNameOf } from '../lib/discover.js';
10
10
  import { installedSkills } from '../lib/installed.js';
11
11
  import { probeActivation } from '../lib/codex.js';
12
12
  import { fingerprint, cacheFileFor, readCachedQueries, writeCachedQueries } from '../lib/queries.js';
13
- import { openRun, querySetHash, readRun, validRecords } from '../lib/runs.js';
13
+ import { openRun, querySetHash, readRun, readAnswers, validRecords } from '../lib/runs.js';
14
14
  import { DEPTHS, minutesFor } from '../lib/depth.js';
15
15
  import { ask, choose, select, confirm, say, closeUi, hasTerminal, setBack, Back } from '../lib/ui.js';
16
- import { hostModels } from '../lib/models.js';
16
+ import { hostModels, unknownModel } from '../lib/models.js';
17
17
  import { browseDir } from '../lib/browse.js';
18
18
  import { withTicker } from '../lib/ticker.js';
19
19
  import { renderResult, bar } from '../lib/chart.js';
20
20
  import { setLang, detectLang, errorText, t } from '../lib/i18n.js';
21
- import { resolveBin, backend, backendFor, isDeepseekModel, HOSTS, checkModel, draftQueries, draftQuality, runTrial, requireHost, pingHost, setHostBin, binInstalled } from '../lib/trial.js';
21
+ import { resolveBin, backend, backendFor, usesOwnDeepseek, setNativeModels, HOSTS, checkModel, draftQueries, draftQuality, runTrial, requireHost, pingHost, setHostBin, binInstalled } from '../lib/trial.js';
22
22
  import { HOST_CLI, searchHost, installCommand, installHost } from '../lib/findhost.js';
23
23
  import { runGain } from '../lib/gain.js';
24
24
  import { ERROR_STREAK_STOP, executeTrials, finishRun, resumeRun } from '../lib/execute.js';
25
25
  import { cmdSubmit } from '../lib/submit.js';
26
26
  import { gitFacts } from '../lib/submission.js';
27
+ import { checkForUpdate, declineUpdate, currentVersion, isCheckout } from '../lib/update.js';
28
+ import { spawnSync as runSync, execSync } from 'node:child_process';
27
29
 
28
30
  function relLabel(root, dir) {
29
31
  const rel = path.relative(root, dir).replace(/\\/g, '/');
@@ -117,9 +119,19 @@ const waitText = (label, extra = {}) => ({ label, elapsed: t('waitElapsed'), abo
117
119
  // Asking a host CLI for its models takes a few seconds (CodeBuddy about three), so it shows a wait line and is
118
120
  // remembered for the rest of the run.
119
121
  const modelCache = new Map();
122
+
123
+ // A typed model the host does not list: say so now, while nothing has been spent, and ask again.
124
+ function notListed(model, known, label) {
125
+ const list = unknownModel(model, known);
126
+ if (!list) return false;
127
+ say(`\n${t('modelUnknown', { model, host: label, list: list.slice(0, 8).join(', ') })}`);
128
+ return true;
129
+ }
120
130
  function modelsOf(host, label) {
121
131
  if (!modelCache.has(host)) {
122
- modelCache.set(host, withTicker(waitText(t('waitModels', { host: label }), { slowAfter: 600 }), () => hostModels(host, resolveBin(host))));
132
+ const list = withTicker(waitText(t('waitModels', { host: label }), { slowAfter: 600 }), () => hostModels(host, resolveBin(host)));
133
+ setNativeModels(host, list);
134
+ modelCache.set(host, list);
123
135
  }
124
136
  return modelCache.get(host);
125
137
  }
@@ -205,7 +217,7 @@ async function runTriggerLayer({ skillDir, skillName, depth, model, host = 'clau
205
217
  if (outcome.stopped) reportStopped(outcome.stopped, run.dir, model);
206
218
  else if (result?.incomplete) reportIncomplete(result.incomplete, run.dir, model);
207
219
  else finishedRuns.push(run.dir);
208
- return result && { ...result, runDir: run.dir };
220
+ return result && { ...result, runDir: run.dir, queries: qs.queries };
209
221
  } catch (err) {
210
222
  run.close(null, { interrupted: true });
211
223
  throw err;
@@ -366,6 +378,40 @@ async function pickAmong(found, root) {
366
378
  return [{ name: path.basename(dir), dir, root }];
367
379
  }
368
380
 
381
+ // Before the questions: is there a newer published version? The user chooses; if the update cannot be fetched or
382
+ // does not run, the session carries on with the version that is already running.
383
+ async function offerUpdate() {
384
+ if (!hasTerminal() || (isCheckout() && !process.env.SG_FORCE_UPDATE_CHECK)) return; // a checkout is not nagged unless asked
385
+ const found = await checkForUpdate();
386
+ if (!found) return;
387
+ say(`\n${t('updateAvail', found)}`);
388
+ const pick = await choose(t('updateQ'), [
389
+ { label: t('updateNow'), value: 'now' },
390
+ { label: t('updateSkip'), value: 'skip' },
391
+ ], 1);
392
+ if (pick !== 'now') {
393
+ declineUpdate(found.latest);
394
+ return;
395
+ }
396
+ const spec = `skillgauntlet@${found.latest}`;
397
+ const env = { ...process.env, SG_NO_UPDATE_CHECK: '1' };
398
+ try {
399
+ // fetch it first and check it answers as the version asked for, so a failed download never costs the session
400
+ const said = withTicker(waitText(t('updating', found), { slowAfter: 600 }), () => execSync(`npx -y ${spec} --version`, { encoding: 'utf8', timeout: 180000, windowsHide: true, env, stdio: ['ignore', 'pipe', 'pipe'] }));
401
+ if (String(said).trim() !== found.latest) throw new Error(`it reported ${String(said).trim() || 'nothing'}`);
402
+ } catch (err) {
403
+ // npm's own words when it gave any ("... is not in this registry"), else the error's first line
404
+ const lines = String(err.stderr || err.message).split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
405
+ const why = (lines.find((l) => /no matching version|not in this registry|404/i.test(l)) || lines.find((l) => /error|ERR/.test(l)) || lines[0] || 'unknown')
406
+ .replace(/^npm error\s*(notarget\s*)?/i, '').replace(/[.。]+$/, '');
407
+ say(t('updateFailed', { why: why.slice(0, 160), current: found.current }));
408
+ return;
409
+ }
410
+ closeUi();
411
+ const r = runSync(`npx -y ${spec}`, process.argv.slice(2), { stdio: 'inherit', env, shell: true });
412
+ process.exit(r.status ?? 0);
413
+ }
414
+
369
415
  async function interactive() {
370
416
  const langChoice = await select(`${t('langTitle')}`, [
371
417
  { label: t('langZh'), value: 'zh' },
@@ -373,6 +419,7 @@ async function interactive() {
373
419
  { label: t('langJa'), value: 'ja' },
374
420
  ], 0);
375
421
  setLang(langChoice);
422
+ await offerUpdate();
376
423
 
377
424
  say('');
378
425
  say(t('title'));
@@ -386,10 +433,11 @@ async function interactive() {
386
433
  const S = { targets: [], host: null, depth: null, model: null, wantProbe: false };
387
434
 
388
435
  const sourceStep = async () => {
436
+ say(`\n${t('sourceNote')}`);
389
437
  const source = await choose(t('sourceQ'), [
390
438
  { label: t('srcInstalled'), hint: t('srcInstalledHint'), value: 'installed' },
391
439
  { label: t('srcPath'), value: 'path' },
392
- { label: t('srcRepo'), hint: 'owner/repo', value: 'repo' },
440
+ { label: t('srcRepo'), hint: t('srcRepoHint'), value: 'repo' },
393
441
  ], 1);
394
442
 
395
443
  let targets = [];
@@ -445,8 +493,8 @@ async function interactive() {
445
493
  S.depth = DEPTHS[depthId];
446
494
 
447
495
  const provider = await choose(t('providerQ'), [
448
- { label: t('provClaude'), hint: t('provClaudeHint'), value: 'claude' },
449
- { label: t('provDeepseek'), hint: t('provDeepseekHint'), value: 'deepseek' },
496
+ { label: t('provClaude'), value: 'claude' },
497
+ { label: t('provDeepseek'), value: 'deepseek' },
450
498
  { label: t('provManual'), value: 'manual' },
451
499
  ], 1);
452
500
 
@@ -493,7 +541,8 @@ async function interactive() {
493
541
  ], 1);
494
542
  S.depth = DEPTHS[depthId];
495
543
  S.model = await pickModel(modelsOf('codebuddy', 'CodeBuddy'));
496
- if (isDeepseekModel(S.model) && !process.env.DEEPSEEK_API_KEY) {
544
+ if (notListed(S.model, modelsOf('codebuddy', 'CodeBuddy'), 'CodeBuddy')) return AGAIN;
545
+ if (usesOwnDeepseek('codebuddy', S.model) && !process.env.DEEPSEEK_API_KEY) {
497
546
  say(`\n${t('needDeepseekKey')}`);
498
547
  return END;
499
548
  }
@@ -501,7 +550,8 @@ async function interactive() {
501
550
  } else {
502
551
  say(`\n${t('codexNote')}`);
503
552
  S.model = await pickModel(modelsOf('codex', 'Codex'));
504
- if (isDeepseekModel(S.model) && !process.env.DEEPSEEK_API_KEY) {
553
+ if (notListed(S.model, modelsOf('codex', 'Codex'), 'Codex')) return AGAIN;
554
+ if (usesOwnDeepseek('codex', S.model) && !process.env.DEEPSEEK_API_KEY) {
505
555
  say(`\n${t('needDeepseekKey')}`);
506
556
  return END;
507
557
  }
@@ -580,10 +630,11 @@ async function interactive() {
580
630
  archiveProbe({ skillDir: target.dir, skillName: target.name, model, probe });
581
631
  }
582
632
 
583
- const md = `${staticMarkdown(result)}${trialSection(trial)}${gainSection(gain)}${probeSection(probe)}`;
584
- const out = writeOut(target.dir, target.name, md, sc);
585
633
  let records = null;
586
- if (trial?.runDir) { try { records = validRecords(readRun(trial.runDir).records); } catch { /* the chart then shows the totals only */ } }
634
+ if (trial?.runDir) { try { records = validRecords(readRun(trial.runDir).records); } catch { /* the report then shows the totals only */ } }
635
+ const answers = trial?.runDir ? readAnswers(trial.runDir) : null;
636
+ const md = `${staticMarkdown(result)}${trialSection(trial, records, answers)}${gainSection(gain)}${probeSection(probe)}`;
637
+ const out = writeOut(target.dir, target.name, md, sc);
587
638
  outcomes.push({ name: target.name, result, trial, records, gain, probe, reportPath: path.join(out, `${target.name}.md`) });
588
639
  // The run stopped on a failure streak (usage limit, dead token): the next skill would fail the same way.
589
640
  if ((host === 'claude' || host === 'codebuddy' || host === 'codewhale') && process.exitCode === 3) break;
@@ -596,7 +647,8 @@ async function interactive() {
596
647
  let explained = false;
597
648
  const submittable = finishedRuns.filter(canSubmit);
598
649
  if (finishedRuns.length && !submittable.length) {
599
- say(`\n${t('noSubmitNoSource')}`);
650
+ const manual = finishedRuns.map((d) => `npx skillgauntlet submit "${d}" --repo https://github.com/owner/repo --commit <sha> [--subdir path]`).join('\n ');
651
+ say(`\n${t('noSubmitNoSource', { cmd: manual })}`);
600
652
  explained = true;
601
653
  } else if (submittable.length && process.exitCode !== 3) {
602
654
  if (hasTerminal() && await confirm(t('contributeQ', { n: submittable.length }), false)) {
@@ -645,6 +697,10 @@ async function main() {
645
697
  say(t('usage'));
646
698
  return;
647
699
  }
700
+ if (args.includes('--version') || args.includes('-v')) {
701
+ say(currentVersion() || 'unknown');
702
+ return;
703
+ }
648
704
  if (args[0] === 'static') {
649
705
  await cmdStatic(args[1] || '.', args.includes('--json'));
650
706
  return;