@magnusekdahl/parallix 1.3.1 → 1.3.2
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 +4 -2
- package/config/integration-pipelines.json +5 -0
- package/docs/adr/0048-fail-closed-harness-defense-against-agent-hallucinations.md +161 -0
- package/docs/adr/index.md +2 -0
- package/docs/authority-reference.md +8 -5
- package/lib/agents/agents.js +3 -1
- package/lib/agents/agents.ts +3 -1
- package/lib/agents/claude.js +3 -1
- package/lib/agents/claude.ts +3 -1
- package/lib/agents/codex.js +3 -1
- package/lib/agents/codex.ts +3 -1
- package/lib/agents/opencode.js +5 -3
- package/lib/agents/opencode.ts +5 -3
- package/lib/commands/active.js +21 -3
- package/lib/commands/active.ts +7 -2
- package/lib/commands/config.js +6 -1
- package/lib/commands/config.ts +6 -1
- package/lib/commands/coverage-gate.js +19 -1
- package/lib/commands/coverage-gate.ts +6 -1
- package/lib/commands/diff.js +6 -1
- package/lib/commands/diff.ts +6 -1
- package/lib/commands/draft.js +31 -1
- package/lib/commands/draft.ts +6 -1
- package/lib/commands/handoff.js +12 -1
- package/lib/commands/handoff.ts +6 -1
- package/lib/commands/integrate.js +103 -27
- package/lib/commands/integrate.ts +67 -31
- package/lib/commands/mission-start.js +12 -3
- package/lib/commands/mission-start.ts +7 -2
- package/lib/commands/rebase.js +10 -2
- package/lib/commands/rebase.ts +6 -2
- package/lib/commands/repair-handoff.js +13 -3
- package/lib/commands/repair-handoff.ts +7 -2
- package/lib/commands/resolve-conflict.js +8 -2
- package/lib/commands/resolve-conflict.ts +7 -2
- package/lib/commands/review.js +6 -1
- package/lib/commands/review.ts +6 -1
- package/lib/commands/setup-review.js +8 -3
- package/lib/commands/setup-review.ts +8 -3
- package/lib/commands/setup.js +8 -2
- package/lib/commands/setup.ts +7 -2
- package/lib/commands/stats-backfill.js +14 -3
- package/lib/commands/stats-backfill.ts +7 -2
- package/lib/commands/stats.js +33 -1
- package/lib/commands/stats.ts +7 -2
- package/lib/commands/status.js +8 -1
- package/lib/commands/status.ts +6 -1
- package/lib/commands/verify.js +11 -2
- package/lib/commands/verify.ts +7 -2
- package/lib/core/gitignore.js +9 -1
- package/lib/core/gitignore.ts +6 -1
- package/lib/core/persistent-data-migration.js +4 -2
- package/lib/core/persistent-data-migration.ts +4 -2
- package/lib/index.js +36 -36
- package/lib/index.ts +18 -18
- package/lib/review/review-loop.js +12 -7
- package/lib/review/review-loop.ts +10 -7
- package/lib/review/review.js +51 -1
- package/lib/review/review.ts +6 -1
- package/lib/tools/setup-review.js +7 -4
- package/lib/tools/setup-review.ts +2 -2
- package/package.json +1 -1
- package/px.js +26 -14
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupReviewCommand = setupReviewCommand;
|
|
4
|
+
const setup_review_js_1 = require("../tools/setup-review.js");
|
|
3
5
|
/**
|
|
4
6
|
* Workflow command entry point for `setup-review`.
|
|
5
7
|
* Delegates to the Forgejo bootstrap tool (tools/setup-review.js).
|
|
@@ -8,6 +10,9 @@ const setupReviewModule = require("../tools/setup-review.js");
|
|
|
8
10
|
*/
|
|
9
11
|
/** @param {string[]} args @param {{[key: string]: any}} [options] */
|
|
10
12
|
async function setupReviewCommand(args, options) {
|
|
11
|
-
await
|
|
13
|
+
await (0, setup_review_js_1.setupReview)(args, options);
|
|
14
|
+
}
|
|
15
|
+
exports.default = setupReviewCommand;
|
|
16
|
+
if (typeof module !== 'undefined') {
|
|
17
|
+
module.exports = setupReviewCommand;
|
|
12
18
|
}
|
|
13
|
-
module.exports = setupReviewCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { setupReview } from '../tools/setup-review.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Workflow command entry point for `setup-review`.
|
|
@@ -8,7 +8,12 @@ import setupReviewModule = require('../tools/setup-review.js');
|
|
|
8
8
|
*/
|
|
9
9
|
/** @param {string[]} args @param {{[key: string]: any}} [options] */
|
|
10
10
|
async function setupReviewCommand(args: string[], options?: {[key: string]: any}) {
|
|
11
|
-
await
|
|
11
|
+
await setupReview(args, options);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export default setupReviewCommand;
|
|
15
|
+
export { setupReviewCommand };
|
|
16
|
+
|
|
17
|
+
// CJS compat: ensure require() returns the function directly
|
|
18
|
+
declare const module: { exports: any } | undefined;
|
|
19
|
+
if (typeof module !== 'undefined') { module.exports = setupReviewCommand; }
|
package/lib/commands/setup.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupWizard = void 0;
|
|
4
|
+
const setup_review_js_1 = require("../tools/setup-review.js");
|
|
5
|
+
Object.defineProperty(exports, "setupWizard", { enumerable: true, get: function () { return setup_review_js_1.setupWizard; } });
|
|
6
|
+
exports.default = setup_review_js_1.setupWizard;
|
|
7
|
+
if (typeof module !== 'undefined') {
|
|
8
|
+
module.exports = setup_review_js_1.setupWizard;
|
|
9
|
+
}
|
package/lib/commands/setup.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import { setupWizard } from '../tools/setup-review.js';
|
|
2
|
+
export default setupWizard;
|
|
3
|
+
export { setupWizard };
|
|
4
|
+
|
|
5
|
+
// CJS compat: ensure require() returns the function directly
|
|
6
|
+
declare const module: { exports: any } | undefined;
|
|
7
|
+
if (typeof module !== 'undefined') { module.exports = setupWizard; }
|
|
@@ -32,15 +32,23 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.statsBackfill = statsBackfill;
|
|
40
|
+
exports.collectHistoricalStatsBackfill = collectHistoricalStatsBackfill;
|
|
41
|
+
exports.inferHistoricalClassificationFromMissionDoc = inferHistoricalClassificationFromMissionDoc;
|
|
42
|
+
exports.extractDateOnly = extractDateOnly;
|
|
35
43
|
const fs = __importStar(require("node:fs"));
|
|
36
44
|
const path = __importStar(require("node:path"));
|
|
37
45
|
const fmt = __importStar(require("../core/fmt.js"));
|
|
38
|
-
const
|
|
46
|
+
const stats_js_1 = __importDefault(require("./stats.js"));
|
|
39
47
|
const git_js_1 = require("../core/git.js");
|
|
40
48
|
const backlog_js_1 = require("../tools/backlog.js");
|
|
41
49
|
const mission_utils_js_1 = require("../core/mission-utils.js");
|
|
42
50
|
function getStats() {
|
|
43
|
-
return
|
|
51
|
+
return stats_js_1.default;
|
|
44
52
|
}
|
|
45
53
|
function hasCheckpointFiles(missionDir) {
|
|
46
54
|
if (!missionDir || !fs.existsSync(missionDir)) {
|
|
@@ -434,4 +442,7 @@ function statsBackfill(args, options = {}) {
|
|
|
434
442
|
statsBackfill.collectHistoricalStatsBackfill = collectHistoricalStatsBackfill;
|
|
435
443
|
statsBackfill.inferHistoricalClassificationFromMissionDoc = inferHistoricalClassificationFromMissionDoc;
|
|
436
444
|
statsBackfill.extractDateOnly = extractDateOnly;
|
|
437
|
-
|
|
445
|
+
exports.default = statsBackfill;
|
|
446
|
+
if (typeof module !== 'undefined') {
|
|
447
|
+
module.exports = statsBackfill;
|
|
448
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as fs from 'node:fs';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
|
|
4
4
|
import * as fmt from '../core/fmt.js';
|
|
5
|
-
import stats
|
|
5
|
+
import stats from './stats.js';
|
|
6
6
|
import { git } from '../core/git.js';
|
|
7
7
|
import {
|
|
8
8
|
getTaskFrontmatterValue,
|
|
@@ -415,4 +415,9 @@ function statsBackfill(args: string[], options: BackfillOptions = {}) {
|
|
|
415
415
|
(statsBackfill as any).collectHistoricalStatsBackfill = collectHistoricalStatsBackfill;
|
|
416
416
|
(statsBackfill as any).inferHistoricalClassificationFromMissionDoc = inferHistoricalClassificationFromMissionDoc;
|
|
417
417
|
(statsBackfill as any).extractDateOnly = extractDateOnly;
|
|
418
|
-
export
|
|
418
|
+
export default statsBackfill;
|
|
419
|
+
export { statsBackfill, collectHistoricalStatsBackfill, inferHistoricalClassificationFromMissionDoc, extractDateOnly };
|
|
420
|
+
|
|
421
|
+
// CJS compat: ensure require() returns the function directly
|
|
422
|
+
declare const module: { exports: any } | undefined;
|
|
423
|
+
if (typeof module !== 'undefined') { module.exports = statsBackfill; }
|
package/lib/commands/stats.js
CHANGED
|
@@ -34,6 +34,32 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
36
|
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.USAGE_NUMBERS = exports.LEGACY_HEADERS = exports.STATS_HEADERS = void 0;
|
|
39
|
+
exports.stats = stats;
|
|
40
|
+
exports.resolveRepoStatsCsvPath = resolveRepoStatsCsvPath;
|
|
41
|
+
exports.resolveStatsRepoName = resolveStatsRepoName;
|
|
42
|
+
exports.resolveStatsFilePath = resolveStatsFilePath;
|
|
43
|
+
exports.resolveStatsCsvPath = resolveStatsCsvPath;
|
|
44
|
+
exports.resolveStatsPath = resolveStatsPath;
|
|
45
|
+
exports.recordIntegrationStats = recordIntegrationStats;
|
|
46
|
+
exports.renderWeeklyStatsReport = renderWeeklyStatsReport;
|
|
47
|
+
exports.renderMissionPhaseReport = renderMissionPhaseReport;
|
|
48
|
+
exports.renderRangeStatsReport = renderRangeStatsReport;
|
|
49
|
+
exports.buildWeeklyWindows = buildWeeklyWindows;
|
|
50
|
+
exports.resolveMissionClassification = resolveMissionClassification;
|
|
51
|
+
exports.deriveImplementerAndFixRounds = deriveImplementerAndFixRounds;
|
|
52
|
+
exports.upsertStatsRow = upsertStatsRow;
|
|
53
|
+
exports.loadStatsCsv = loadStatsCsv;
|
|
54
|
+
exports.saveStatsCsv = saveStatsCsv;
|
|
55
|
+
exports.normalizeStatsRow = normalizeStatsRow;
|
|
56
|
+
exports.canonicalizeStatsRow = canonicalizeStatsRow;
|
|
57
|
+
exports.recordStageStats = recordStageStats;
|
|
58
|
+
exports.accumulateStageStats = accumulateStageStats;
|
|
59
|
+
exports.recordActiveStats = recordActiveStats;
|
|
60
|
+
exports.recordReviewStats = recordReviewStats;
|
|
61
|
+
exports.telemetryToStatsFields = telemetryToStatsFields;
|
|
62
|
+
exports.formatDateOnly = formatDateOnly;
|
|
37
63
|
const fs = __importStar(require("node:fs"));
|
|
38
64
|
const path = __importStar(require("node:path"));
|
|
39
65
|
const fmt = __importStar(require("../core/fmt.js"));
|
|
@@ -49,6 +75,7 @@ const storage = __importStar(require("../core/storage.js"));
|
|
|
49
75
|
// The original 5-column schema. Retained for backward-compatible CSV detection
|
|
50
76
|
// and one-time header migration of legacy stats files (task-1251).
|
|
51
77
|
const LEGACY_HEADERS = ['date', 'mission', 'classification', 'implementer', 'pr_fix_rounds'];
|
|
78
|
+
exports.LEGACY_HEADERS = LEGACY_HEADERS;
|
|
52
79
|
// Extended 21-column telemetry schema (task-1314 + task-1251). Legacy 5-column rows are
|
|
53
80
|
// migrated in-memory on load: the legacy columns are preserved and the new
|
|
54
81
|
// columns default to '' (text) or '0' (numeric). On the next write the file
|
|
@@ -60,12 +87,14 @@ const STATS_HEADERS = [
|
|
|
60
87
|
'tool_calls', 'openai_usage_before', 'openai_usage_after',
|
|
61
88
|
'openai_usage_delta', 'duration_minutes', 'cost_usd'
|
|
62
89
|
];
|
|
90
|
+
exports.STATS_HEADERS = STATS_HEADERS;
|
|
63
91
|
// Columns coerced to non-negative integers on canonicalization.
|
|
64
92
|
const USAGE_NUMBERS = new Set([
|
|
65
93
|
'pr_fix_rounds', 'input_tokens', 'output_tokens', 'cached_tokens',
|
|
66
94
|
'context_tokens', 'tool_calls', 'openai_usage_before', 'openai_usage_after',
|
|
67
95
|
'openai_usage_delta', 'duration_minutes'
|
|
68
96
|
]);
|
|
97
|
+
exports.USAGE_NUMBERS = USAGE_NUMBERS;
|
|
69
98
|
const VALID_CLASSIFICATIONS = new Set(['ai_sdlc', 'user_value', 'unknown']);
|
|
70
99
|
const SHIPPED_STATS_CSV_PATH = path.join(__dirname, '..', 'data', 'stats.seed.csv');
|
|
71
100
|
function getStorage() {
|
|
@@ -1903,6 +1932,10 @@ function stats(args, options = {}) {
|
|
|
1903
1932
|
log(report);
|
|
1904
1933
|
}
|
|
1905
1934
|
}
|
|
1935
|
+
exports.default = stats;
|
|
1936
|
+
if (typeof module !== 'undefined') {
|
|
1937
|
+
module.exports = stats;
|
|
1938
|
+
}
|
|
1906
1939
|
stats.STATS_HEADERS = STATS_HEADERS;
|
|
1907
1940
|
stats.STATS_CSV_PATH = resolveRepoStatsCsvPath();
|
|
1908
1941
|
stats.LEGACY_STATS_CSV_PATH = resolveRepoStatsCsvPath();
|
|
@@ -1954,4 +1987,3 @@ stats._internals = {
|
|
|
1954
1987
|
colorMissionCounts,
|
|
1955
1988
|
printStatsUsage,
|
|
1956
1989
|
};
|
|
1957
|
-
module.exports = stats;
|
package/lib/commands/stats.ts
CHANGED
|
@@ -2132,7 +2132,12 @@ function stats(args: string[], options: {log?: Function, error?: Function, exit?
|
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
2134
|
|
|
2135
|
-
export
|
|
2135
|
+
export default stats;
|
|
2136
|
+
export { stats, STATS_HEADERS, resolveRepoStatsCsvPath, resolveStatsRepoName, resolveStatsFilePath, resolveStatsCsvPath, resolveStatsPath, recordIntegrationStats, renderWeeklyStatsReport, renderMissionPhaseReport, renderRangeStatsReport, buildWeeklyWindows, resolveMissionClassification, deriveImplementerAndFixRounds, upsertStatsRow, loadStatsCsv, saveStatsCsv, normalizeStatsRow, canonicalizeStatsRow, recordStageStats, accumulateStageStats, recordActiveStats, recordReviewStats, telemetryToStatsFields, formatDateOnly, LEGACY_HEADERS, USAGE_NUMBERS };
|
|
2137
|
+
|
|
2138
|
+
// CJS compat: ensure require() returns the function directly
|
|
2139
|
+
declare const module: { exports: any } | undefined;
|
|
2140
|
+
if (typeof module !== 'undefined') { module.exports = stats; }
|
|
2136
2141
|
(stats as any).STATS_HEADERS = STATS_HEADERS;
|
|
2137
2142
|
(stats as any).STATS_CSV_PATH = resolveRepoStatsCsvPath();
|
|
2138
2143
|
(stats as any).LEGACY_STATS_CSV_PATH = resolveRepoStatsCsvPath();
|
|
@@ -2183,4 +2188,4 @@ export = stats;
|
|
|
2183
2188
|
colorAverageFixRounds,
|
|
2184
2189
|
colorMissionCounts,
|
|
2185
2190
|
printStatsUsage,
|
|
2186
|
-
};
|
|
2191
|
+
};
|
package/lib/commands/status.js
CHANGED
|
@@ -32,6 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.status = status;
|
|
37
|
+
exports.parseWorktreeList = parseWorktreeList;
|
|
38
|
+
exports.findStaleMissionWorktrees = findStaleMissionWorktrees;
|
|
35
39
|
const git_js_1 = require("../core/git.js");
|
|
36
40
|
const backlog_js_1 = require("../tools/backlog.js");
|
|
37
41
|
const mission_utils_js_1 = require("../core/mission-utils.js");
|
|
@@ -236,4 +240,7 @@ function status(args, opts) {
|
|
|
236
240
|
}
|
|
237
241
|
status.parseWorktreeList = parseWorktreeList;
|
|
238
242
|
status.findStaleMissionWorktrees = findStaleMissionWorktrees;
|
|
239
|
-
|
|
243
|
+
exports.default = status;
|
|
244
|
+
if (typeof module !== 'undefined') {
|
|
245
|
+
module.exports = status;
|
|
246
|
+
}
|
package/lib/commands/status.ts
CHANGED
|
@@ -216,4 +216,9 @@ function status(args: string[], opts: {exit?: Function, log?: Function, inferSlu
|
|
|
216
216
|
|
|
217
217
|
(status as any).parseWorktreeList = parseWorktreeList;
|
|
218
218
|
(status as any).findStaleMissionWorktrees = findStaleMissionWorktrees;
|
|
219
|
-
export
|
|
219
|
+
export default status;
|
|
220
|
+
export { status, parseWorktreeList, findStaleMissionWorktrees };
|
|
221
|
+
|
|
222
|
+
// CJS compat: ensure require() returns the function directly
|
|
223
|
+
declare const module: { exports: any } | undefined;
|
|
224
|
+
if (typeof module !== 'undefined') { module.exports = status; }
|
package/lib/commands/verify.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.verify = void 0;
|
|
7
|
+
const verification_js_1 = __importDefault(require("../core/verification.js"));
|
|
8
|
+
exports.verify = verification_js_1.default;
|
|
9
|
+
exports.default = verification_js_1.default;
|
|
10
|
+
if (typeof module !== 'undefined') {
|
|
11
|
+
module.exports = verification_js_1.default;
|
|
12
|
+
}
|
package/lib/commands/verify.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import verify
|
|
2
|
-
export
|
|
1
|
+
import verify from '../core/verification.js';
|
|
2
|
+
export default verify;
|
|
3
|
+
export { verify };
|
|
4
|
+
|
|
5
|
+
// CJS compat: ensure require() returns the function directly
|
|
6
|
+
declare const module: { exports: any } | undefined;
|
|
7
|
+
if (typeof module !== 'undefined') { module.exports = verify; }
|
package/lib/core/gitignore.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WORKFLOW_ENTRIES = void 0;
|
|
7
|
+
exports.ensureWorkflowGitignore = ensureWorkflowGitignore;
|
|
8
|
+
exports.ensureWorkflowGitignoreFn = ensureWorkflowGitignore;
|
|
5
9
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
6
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
7
11
|
const WORKFLOW_ENTRIES = [
|
|
@@ -13,6 +17,7 @@ const WORKFLOW_ENTRIES = [
|
|
|
13
17
|
'workflow/config/agents.local.json',
|
|
14
18
|
'agents.local.json',
|
|
15
19
|
];
|
|
20
|
+
exports.WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
16
21
|
function ensureWorkflowGitignore(rootDir, options = {}) {
|
|
17
22
|
const { existsSyncFn = node_fs_1.default.existsSync, lstatSyncFn = node_fs_1.default.lstatSync, readFileSyncFn = node_fs_1.default.readFileSync, writeFileSyncFn = node_fs_1.default.writeFileSync, logFn = () => { }, } = options;
|
|
18
23
|
const gitignorePath = node_path_1.default.join(rootDir, '.gitignore');
|
|
@@ -62,4 +67,7 @@ function ensureWorkflowGitignore(rootDir, options = {}) {
|
|
|
62
67
|
}
|
|
63
68
|
ensureWorkflowGitignore.WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
64
69
|
ensureWorkflowGitignore.ensureWorkflowGitignore = ensureWorkflowGitignore;
|
|
65
|
-
|
|
70
|
+
exports.default = ensureWorkflowGitignore;
|
|
71
|
+
if (typeof module !== 'undefined') {
|
|
72
|
+
module.exports = ensureWorkflowGitignore;
|
|
73
|
+
}
|
package/lib/core/gitignore.ts
CHANGED
|
@@ -100,4 +100,9 @@ function ensureWorkflowGitignore(rootDir: string, options: EnsureOptions = {}):
|
|
|
100
100
|
(ensureWorkflowGitignore as EnsureWorkflowGitignoreFn).WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
101
101
|
(ensureWorkflowGitignore as EnsureWorkflowGitignoreFn).ensureWorkflowGitignore = ensureWorkflowGitignore as EnsureWorkflowGitignoreFn;
|
|
102
102
|
|
|
103
|
-
export
|
|
103
|
+
export default ensureWorkflowGitignore;
|
|
104
|
+
export { ensureWorkflowGitignore, WORKFLOW_ENTRIES, ensureWorkflowGitignore as ensureWorkflowGitignoreFn };
|
|
105
|
+
|
|
106
|
+
// CJS compat: ensure require() returns the function directly
|
|
107
|
+
declare const module: { exports: any } | undefined;
|
|
108
|
+
if (typeof module !== 'undefined') { module.exports = ensureWorkflowGitignore; }
|
|
@@ -42,12 +42,14 @@ exports.migrateAgentBlocklists = migrateAgentBlocklists;
|
|
|
42
42
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
43
43
|
const node_path_1 = __importDefault(require("node:path"));
|
|
44
44
|
const storage = __importStar(require("./storage.js"));
|
|
45
|
+
const node_module_1 = require("node:module");
|
|
46
|
+
const _require = (0, node_module_1.createRequire)(__filename);
|
|
45
47
|
/** Cached stats module — loaded lazily to break circular dependency with `../commands/stats.js`. */
|
|
46
48
|
let _stats = null;
|
|
47
49
|
/** Lazily load the stats module to break the circular dependency. */
|
|
48
50
|
function getStats() {
|
|
49
51
|
if (!_stats) {
|
|
50
|
-
_stats =
|
|
52
|
+
_stats = _require('../commands/stats.js');
|
|
51
53
|
}
|
|
52
54
|
return _stats;
|
|
53
55
|
}
|
|
@@ -182,7 +184,7 @@ function migrateStats(options = {}) {
|
|
|
182
184
|
const opts = options;
|
|
183
185
|
const sourcePaths = (opts.sourcePaths || [opts.sourcePath].filter(Boolean));
|
|
184
186
|
const destinationPath = opts.destinationPath || storage.resolveStatsPath({ ensureDir: true });
|
|
185
|
-
const sourceRows = sourcePaths.
|
|
187
|
+
const sourceRows = sourcePaths.map((sourcePath) => readStatsRows(sourcePath, {})).flat();
|
|
186
188
|
// Fresh-install guard: when no source file exists or all sources are empty,
|
|
187
189
|
// there is no telemetry to import. Returning early prevents writing a
|
|
188
190
|
// header-only destination file that would masquerade as valid stats.
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import * as storage from './storage.js';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
const _require = createRequire(__filename);
|
|
4
6
|
|
|
5
7
|
/** Cached stats module — loaded lazily to break circular dependency with `../commands/stats.js`. */
|
|
6
8
|
let _stats: any = null;
|
|
7
9
|
|
|
8
10
|
/** Lazily load the stats module to break the circular dependency. */
|
|
9
11
|
function getStats(): any {
|
|
10
|
-
if (!_stats) {_stats =
|
|
12
|
+
if (!_stats) {_stats = _require('../commands/stats.js');}
|
|
11
13
|
return _stats;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -145,7 +147,7 @@ function migrateStats(options: { sourcePaths?: string[]; sourcePath?: string; de
|
|
|
145
147
|
const opts = options;
|
|
146
148
|
const sourcePaths = (opts.sourcePaths || [opts.sourcePath].filter(Boolean)) as string[];
|
|
147
149
|
const destinationPath = opts.destinationPath || storage.resolveStatsPath({ ensureDir: true });
|
|
148
|
-
const sourceRows = sourcePaths.
|
|
150
|
+
const sourceRows = sourcePaths.map((sourcePath: string) => readStatsRows(sourcePath, {})).flat();
|
|
149
151
|
|
|
150
152
|
// Fresh-install guard: when no source file exists or all sources are empty,
|
|
151
153
|
// there is no telemetry to import. Returning early prevents writing a
|
package/lib/index.js
CHANGED
|
@@ -63,46 +63,46 @@ const limitHitMod = __importStar(require("./agents/limit-hit.js"));
|
|
|
63
63
|
const mistralMod = __importStar(require("./agents/mistral.js"));
|
|
64
64
|
const opencodeMod = __importStar(require("./agents/opencode.js"));
|
|
65
65
|
// commands/ — mixed export styles
|
|
66
|
-
const
|
|
67
|
-
exports.active =
|
|
66
|
+
const active_js_1 = __importDefault(require("./commands/active.js"));
|
|
67
|
+
exports.active = active_js_1.default;
|
|
68
68
|
const checkpoint_js_1 = __importDefault(require("./commands/checkpoint.js"));
|
|
69
69
|
exports.checkpoint = checkpoint_js_1.default;
|
|
70
|
-
const
|
|
71
|
-
exports.config =
|
|
72
|
-
const
|
|
73
|
-
exports.coverageGate =
|
|
74
|
-
const
|
|
75
|
-
exports.diff =
|
|
76
|
-
const
|
|
77
|
-
exports.draft =
|
|
78
|
-
const
|
|
79
|
-
exports.handoff =
|
|
80
|
-
const
|
|
81
|
-
exports.integrate =
|
|
82
|
-
const
|
|
83
|
-
exports.missionStart =
|
|
84
|
-
const
|
|
85
|
-
exports.rebase =
|
|
86
|
-
const
|
|
87
|
-
exports.repairHandoff =
|
|
88
|
-
const
|
|
89
|
-
exports.resolveConflict =
|
|
90
|
-
const
|
|
91
|
-
exports.setup =
|
|
92
|
-
const
|
|
93
|
-
exports.stats =
|
|
94
|
-
const
|
|
95
|
-
exports.statsBackfill =
|
|
96
|
-
const
|
|
97
|
-
exports.status =
|
|
98
|
-
const
|
|
99
|
-
exports.verify =
|
|
70
|
+
const config_js_1 = __importDefault(require("./commands/config.js"));
|
|
71
|
+
exports.config = config_js_1.default;
|
|
72
|
+
const coverage_gate_js_1 = __importDefault(require("./commands/coverage-gate.js"));
|
|
73
|
+
exports.coverageGate = coverage_gate_js_1.default;
|
|
74
|
+
const diff_js_1 = __importDefault(require("./commands/diff.js"));
|
|
75
|
+
exports.diff = diff_js_1.default;
|
|
76
|
+
const draft_js_1 = __importDefault(require("./commands/draft.js"));
|
|
77
|
+
exports.draft = draft_js_1.default;
|
|
78
|
+
const handoff_js_1 = __importDefault(require("./commands/handoff.js"));
|
|
79
|
+
exports.handoff = handoff_js_1.default;
|
|
80
|
+
const integrate_js_1 = __importDefault(require("./commands/integrate.js"));
|
|
81
|
+
exports.integrate = integrate_js_1.default;
|
|
82
|
+
const mission_start_js_1 = __importDefault(require("./commands/mission-start.js"));
|
|
83
|
+
exports.missionStart = mission_start_js_1.default;
|
|
84
|
+
const rebase_js_1 = __importDefault(require("./commands/rebase.js"));
|
|
85
|
+
exports.rebase = rebase_js_1.default;
|
|
86
|
+
const repair_handoff_js_1 = __importDefault(require("./commands/repair-handoff.js"));
|
|
87
|
+
exports.repairHandoff = repair_handoff_js_1.default;
|
|
88
|
+
const resolve_conflict_js_1 = __importDefault(require("./commands/resolve-conflict.js"));
|
|
89
|
+
exports.resolveConflict = resolve_conflict_js_1.default;
|
|
90
|
+
const setup_js_1 = __importDefault(require("./commands/setup.js"));
|
|
91
|
+
exports.setup = setup_js_1.default;
|
|
92
|
+
const stats_js_1 = __importDefault(require("./commands/stats.js"));
|
|
93
|
+
exports.stats = stats_js_1.default;
|
|
94
|
+
const stats_backfill_js_1 = __importDefault(require("./commands/stats-backfill.js"));
|
|
95
|
+
exports.statsBackfill = stats_backfill_js_1.default;
|
|
96
|
+
const status_js_1 = __importDefault(require("./commands/status.js"));
|
|
97
|
+
exports.status = status_js_1.default;
|
|
98
|
+
const verify_js_1 = __importDefault(require("./commands/verify.js"));
|
|
99
|
+
exports.verify = verify_js_1.default;
|
|
100
100
|
// core/ — mixed export styles
|
|
101
101
|
const fmtMod = __importStar(require("./core/fmt.js"));
|
|
102
102
|
exports.fmt = fmtMod;
|
|
103
103
|
const gitMod = __importStar(require("./core/git.js"));
|
|
104
|
-
const
|
|
105
|
-
exports.gitignore =
|
|
104
|
+
const gitignore_js_1 = __importDefault(require("./core/gitignore.js"));
|
|
105
|
+
exports.gitignore = gitignore_js_1.default;
|
|
106
106
|
const missionUtilsMod = __importStar(require("./core/mission-utils.js"));
|
|
107
107
|
const persistentDataMigrationMod = __importStar(require("./core/persistent-data-migration.js"));
|
|
108
108
|
const productConfigMod = __importStar(require("./core/product-config.js"));
|
|
@@ -112,8 +112,8 @@ const stateMapMod = __importStar(require("./core/state-map.js"));
|
|
|
112
112
|
const storageMod = __importStar(require("./core/storage.js"));
|
|
113
113
|
const verificationMod = __importStar(require("./core/verification.js"));
|
|
114
114
|
// review/ — mixed export styles
|
|
115
|
-
const
|
|
116
|
-
exports.review =
|
|
115
|
+
const review_js_1 = __importDefault(require("./review/review.js"));
|
|
116
|
+
exports.review = review_js_1.default;
|
|
117
117
|
const reviewArtifactsMod = __importStar(require("./review/review-artifacts.js"));
|
|
118
118
|
const reviewCommandsMod = __importStar(require("./review/review-commands.js"));
|
|
119
119
|
const reviewEventsMod = __importStar(require("./review/review-events.js"));
|
package/lib/index.ts
CHANGED
|
@@ -26,28 +26,28 @@ import * as mistralMod from './agents/mistral.js';
|
|
|
26
26
|
import * as opencodeMod from './agents/opencode.js';
|
|
27
27
|
|
|
28
28
|
// commands/ — mixed export styles
|
|
29
|
-
import active
|
|
29
|
+
import active from './commands/active.js';
|
|
30
30
|
import checkpoint from './commands/checkpoint.js';
|
|
31
|
-
import config
|
|
32
|
-
import coverageGate
|
|
33
|
-
import diff
|
|
34
|
-
import draft
|
|
35
|
-
import handoff
|
|
36
|
-
import integrate
|
|
37
|
-
import missionStart
|
|
38
|
-
import rebase
|
|
39
|
-
import repairHandoff
|
|
40
|
-
import resolveConflict
|
|
41
|
-
import setup
|
|
42
|
-
import stats
|
|
43
|
-
import statsBackfill
|
|
44
|
-
import status
|
|
45
|
-
import verify
|
|
31
|
+
import config from './commands/config.js';
|
|
32
|
+
import coverageGate from './commands/coverage-gate.js';
|
|
33
|
+
import diff from './commands/diff.js';
|
|
34
|
+
import draft from './commands/draft.js';
|
|
35
|
+
import handoff from './commands/handoff.js';
|
|
36
|
+
import integrate from './commands/integrate.js';
|
|
37
|
+
import missionStart from './commands/mission-start.js';
|
|
38
|
+
import rebase from './commands/rebase.js';
|
|
39
|
+
import repairHandoff from './commands/repair-handoff.js';
|
|
40
|
+
import resolveConflict from './commands/resolve-conflict.js';
|
|
41
|
+
import setup from './commands/setup.js';
|
|
42
|
+
import stats from './commands/stats.js';
|
|
43
|
+
import statsBackfill from './commands/stats-backfill.js';
|
|
44
|
+
import status from './commands/status.js';
|
|
45
|
+
import verify from './commands/verify.js';
|
|
46
46
|
|
|
47
47
|
// core/ — mixed export styles
|
|
48
48
|
import * as fmtMod from './core/fmt.js';
|
|
49
49
|
import * as gitMod from './core/git.js';
|
|
50
|
-
import gitignore
|
|
50
|
+
import gitignore from './core/gitignore.js';
|
|
51
51
|
import * as missionUtilsMod from './core/mission-utils.js';
|
|
52
52
|
import * as persistentDataMigrationMod from './core/persistent-data-migration.js';
|
|
53
53
|
import * as productConfigMod from './core/product-config.js';
|
|
@@ -58,7 +58,7 @@ import * as storageMod from './core/storage.js';
|
|
|
58
58
|
import * as verificationMod from './core/verification.js';
|
|
59
59
|
|
|
60
60
|
// review/ — mixed export styles
|
|
61
|
-
import review
|
|
61
|
+
import review from './review/review.js';
|
|
62
62
|
import * as reviewArtifactsMod from './review/review-artifacts.js';
|
|
63
63
|
import * as reviewCommandsMod from './review/review-commands.js';
|
|
64
64
|
import * as reviewEventsMod from './review/review-events.js';
|
|
@@ -66,17 +66,17 @@ const review_artifacts_js_1 = require("./review-artifacts.js");
|
|
|
66
66
|
const stage_telemetry_js_1 = require("../agents/stage-telemetry.js");
|
|
67
67
|
/** Lazily loaded stats module — loaded on first use to avoid circular dependency. */
|
|
68
68
|
let _stats = null;
|
|
69
|
-
|
|
69
|
+
function getStats() {
|
|
70
70
|
if (!_stats) {
|
|
71
|
-
_stats =
|
|
71
|
+
_stats = _require('../commands/stats.js');
|
|
72
72
|
}
|
|
73
73
|
return _stats;
|
|
74
74
|
}
|
|
75
75
|
/** Lazily loaded handoff module. */
|
|
76
76
|
let _handoff = null;
|
|
77
|
-
|
|
77
|
+
function getHandoff() {
|
|
78
78
|
if (!_handoff) {
|
|
79
|
-
_handoff =
|
|
79
|
+
_handoff = _require('../commands/handoff.js');
|
|
80
80
|
}
|
|
81
81
|
return _handoff;
|
|
82
82
|
}
|
|
@@ -143,7 +143,10 @@ function recordStageStatsSafe(kind, opts) {
|
|
|
143
143
|
})) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
try {
|
|
147
|
+
getStats().accumulateStageStats({ stage, slug, rootDir, implementer, reviewer, telemetry, durationMinutes, model });
|
|
148
|
+
}
|
|
149
|
+
catch { /* best-effort */ }
|
|
147
150
|
}
|
|
148
151
|
catch (err) {
|
|
149
152
|
log?.(fmt.status('WARN', `Could not record ${kind} stats for ${slug}: ${err.message}`));
|
|
@@ -161,9 +164,11 @@ function strictlyLaterIso(earlierIso, nowMs = Date.now()) {
|
|
|
161
164
|
// ============================================================================
|
|
162
165
|
// Pre-review Setup Functions
|
|
163
166
|
// ============================================================================
|
|
167
|
+
const node_module_1 = require("node:module");
|
|
168
|
+
const _require = (0, node_module_1.createRequire)(__filename);
|
|
164
169
|
function maybeUpdateGraphifyBeforeReview(rootDir, { commandRunner = git_js_1.run, log = fmt.log.plain } = {}) {
|
|
165
170
|
// Lazy require to break circular dependency with core/mission-utils
|
|
166
|
-
const { updateGraphifyKnowledgeGraph } =
|
|
171
|
+
const { updateGraphifyKnowledgeGraph } = _require('../core/mission-utils.js');
|
|
167
172
|
return updateGraphifyKnowledgeGraph({
|
|
168
173
|
rootDir,
|
|
169
174
|
commandRunner,
|
|
@@ -262,7 +267,7 @@ async function startReviewLoop(slug, opts = {}) {
|
|
|
262
267
|
}
|
|
263
268
|
const taskResolution = resolveTaskFileFn(slug, worktree);
|
|
264
269
|
if (!dryRun) {
|
|
265
|
-
maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
270
|
+
await maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
266
271
|
}
|
|
267
272
|
// --reset: clear persisted state before starting
|
|
268
273
|
if (reset) {
|
|
@@ -24,18 +24,18 @@ import { resolveStageTelemetry } from '../agents/stage-telemetry.js';
|
|
|
24
24
|
|
|
25
25
|
/** Lazily loaded stats module — loaded on first use to avoid circular dependency. */
|
|
26
26
|
let _stats: any = null;
|
|
27
|
-
|
|
27
|
+
function getStats(): any {
|
|
28
28
|
if (!_stats) {
|
|
29
|
-
_stats =
|
|
29
|
+
_stats = _require('../commands/stats.js');
|
|
30
30
|
}
|
|
31
31
|
return _stats as any;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** Lazily loaded handoff module. */
|
|
35
35
|
let _handoff: any = null;
|
|
36
|
-
|
|
36
|
+
function getHandoff(): any {
|
|
37
37
|
if (!_handoff) {
|
|
38
|
-
_handoff =
|
|
38
|
+
_handoff = _require('../commands/handoff.js');
|
|
39
39
|
}
|
|
40
40
|
return _handoff as any;
|
|
41
41
|
}
|
|
@@ -123,7 +123,7 @@ export function recordStageStatsSafe(
|
|
|
123
123
|
})) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
getStats().
|
|
126
|
+
try { getStats().accumulateStageStats({ stage, slug, rootDir, implementer, reviewer, telemetry, durationMinutes, model }); } catch { /* best-effort */ }
|
|
127
127
|
} catch (err: unknown) {
|
|
128
128
|
log?.(fmt.status('WARN', `Could not record ${kind} stats for ${slug}: ${(err as Error).message}`));
|
|
129
129
|
}
|
|
@@ -144,12 +144,15 @@ function strictlyLaterIso(earlierIso: string, nowMs = Date.now()): string {
|
|
|
144
144
|
// Pre-review Setup Functions
|
|
145
145
|
// ============================================================================
|
|
146
146
|
|
|
147
|
+
import { createRequire } from 'node:module';
|
|
148
|
+
const _require = createRequire(__filename);
|
|
149
|
+
|
|
147
150
|
export function maybeUpdateGraphifyBeforeReview(
|
|
148
151
|
rootDir: string,
|
|
149
152
|
{ commandRunner = run, log = fmt.log.plain }: { commandRunner?: typeof run; log?: (msg: string) => void } = {}
|
|
150
153
|
): unknown {
|
|
151
154
|
// Lazy require to break circular dependency with core/mission-utils
|
|
152
|
-
const { updateGraphifyKnowledgeGraph } =
|
|
155
|
+
const { updateGraphifyKnowledgeGraph } = _require('../core/mission-utils.js');
|
|
153
156
|
return updateGraphifyKnowledgeGraph({
|
|
154
157
|
rootDir,
|
|
155
158
|
commandRunner,
|
|
@@ -400,7 +403,7 @@ export async function startReviewLoop(slug: string, opts: {
|
|
|
400
403
|
const taskResolution = resolveTaskFileFn(slug, worktree);
|
|
401
404
|
|
|
402
405
|
if (!dryRun) {
|
|
403
|
-
maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
406
|
+
await maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
404
407
|
}
|
|
405
408
|
|
|
406
409
|
// --reset: clear persisted state before starting
|