amicus 2.0.0 → 2.2.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.
@@ -1,15 +1,13 @@
1
- // src/utils/result-schema.js
2
1
  'use strict';
3
2
 
4
3
  /**
5
4
  * @module result-schema
6
5
  * Versioned, machine-parseable result documents for `--json` output (F4).
7
- *
8
- * Stability contract: fields are only ADDED within a SCHEMA_VERSION;
9
- * any rename/removal bumps SCHEMA_VERSION.
6
+ * Stability contract: fields are only ADDED within a SCHEMA_VERSION; any
7
+ * rename/removal bumps SCHEMA_VERSION (defined in ./result-schema-version.js,
8
+ * split out so ./abort-result.js can depend on it without a circular require).
10
9
  */
11
-
12
- const SCHEMA_VERSION = 2;
10
+ const { SCHEMA_VERSION } = require('./result-schema-version');
13
11
 
14
12
  /** Leg/run statuses that count as terminal for wave aggregation. */
15
13
  const TERMINAL_STATUSES = ['complete', 'error', 'timeout', 'aborted', 'crashed', 'idle-timeout'];
@@ -159,8 +157,7 @@ function buildWaveResult({ waveId, legs = [], promptMeta = null, createdAt = nul
159
157
  * @param {string} project - Project dir
160
158
  * @param {string} taskId
161
159
  * @returns {object} run document
162
- * @throws {Error} if the session does not exist
163
- * @throws {Error} if metadata.json is missing or corrupt
160
+ * @throws {Error} if the session does not exist or metadata.json is missing/corrupt
164
161
  */
165
162
  function buildRunResultFromSession(project, taskId) {
166
163
  const fs = require('fs');
@@ -189,8 +186,7 @@ function buildRunResultFromSession(project, taskId) {
189
186
  * @param {string} project
190
187
  * @param {string} waveId
191
188
  * @returns {object} wave document
192
- * @throws {Error} if the wave session does not exist
193
- * @throws {Error} if metadata.json is missing or corrupt
189
+ * @throws {Error} if the wave session does not exist or metadata.json is missing/corrupt
194
190
  */
195
191
  function buildWaveResultFromSession(project, waveId) {
196
192
  const fs = require('fs');
@@ -283,6 +279,9 @@ function buildDoctorDoc({ version, timestamp, checks }) {
283
279
  };
284
280
  }
285
281
 
282
+ // buildAbortResult lives in ./abort-result.js (size-gate split); re-exported below.
283
+ const { buildAbortResult } = require('./abort-result');
284
+
286
285
  module.exports = {
287
286
  SCHEMA_VERSION,
288
287
  TERMINAL_STATUSES,
@@ -297,4 +296,5 @@ module.exports = {
297
296
  buildCatalogDoc,
298
297
  buildAuditDoc,
299
298
  buildDoctorDoc,
299
+ buildAbortResult,
300
300
  };