@oss-autopilot/core 3.39.2 → 3.40.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/dist/cli-registry.js +105 -1
- package/dist/cli.bundle.cjs +146 -143
- package/dist/commands/daily.d.ts +6 -1
- package/dist/commands/daily.js +7 -2
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/scout-bridge.js +23 -1
- package/dist/commands/setup.js +2 -1
- package/dist/commands/vet-list.js +18 -1
- package/dist/commands/vet.js +7 -1
- package/dist/commands/work.d.ts +134 -0
- package/dist/commands/work.js +313 -0
- package/dist/core/config-registry.js +6 -0
- package/dist/core/daily-logic.d.ts +2 -1
- package/dist/core/daily-logic.js +12 -1
- package/dist/core/gist-state-store.js +6 -2
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/machine-id.d.ts +18 -0
- package/dist/core/machine-id.js +131 -0
- package/dist/core/paths.d.ts +8 -0
- package/dist/core/paths.js +10 -0
- package/dist/core/state-persistence.d.ts +8 -0
- package/dist/core/state-persistence.js +14 -1
- package/dist/core/state-schema.d.ts +54 -1
- package/dist/core/state-schema.js +68 -0
- package/dist/core/state.d.ts +39 -1
- package/dist/core/state.js +86 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/work-claims.d.ts +89 -0
- package/dist/core/work-claims.js +196 -0
- package/dist/formatters/json.d.ts +130 -1
- package/dist/formatters/json.js +26 -0
- package/package.json +1 -1
package/dist/cli-registry.js
CHANGED
|
@@ -48,7 +48,7 @@ export function handleCommandError(err, json) {
|
|
|
48
48
|
* verify-issue, skip-add, list-move-tier, list-mark-done,
|
|
49
49
|
* compliance-score, post, claim, config, init, setup, checkSetup,
|
|
50
50
|
* parse-issue-list, orphan-files, doctor, local-repos, move,
|
|
51
|
-
* pr-template, repo-cap, repo-vet, detect-formatters.
|
|
51
|
+
* pr-template, repo-cap, repo-vet, detect-formatters, work (claim/finish/release/list).
|
|
52
52
|
*
|
|
53
53
|
* 2. **Goldens-only**: no Zod schema exists; the command returns a TS
|
|
54
54
|
* interface and its `*.contract.test.ts` golden snapshot is the only
|
|
@@ -1278,6 +1278,110 @@ export const commands = [
|
|
|
1278
1278
|
},
|
|
1279
1279
|
// The `override`/`clear-override` command aliases were retired in #1466 —
|
|
1280
1280
|
// they wrapped `move <pr-url> attention|waiting|auto`. Use `move` directly.
|
|
1281
|
+
// ── Work claims (#1856, #1852) ───────────────────────────────────────
|
|
1282
|
+
// State only: claims live in state.json (and the Gist); no GitHub access.
|
|
1283
|
+
{
|
|
1284
|
+
name: 'work',
|
|
1285
|
+
localOnly: true,
|
|
1286
|
+
register(program) {
|
|
1287
|
+
const group = program
|
|
1288
|
+
.command('work')
|
|
1289
|
+
.description('Record which items are being worked on: background implementations and PRs under Tier 2 work (#1856, #1852)');
|
|
1290
|
+
group
|
|
1291
|
+
.command('claim <url>')
|
|
1292
|
+
.description('Claim an issue (--kind implementation, while a fix is built) or a PR (--kind pr, while this session works it)')
|
|
1293
|
+
.requiredOption('--kind <kind>', 'implementation (issue URL) or pr (PR URL)')
|
|
1294
|
+
.requiredOption('--session <name>', 'Name of the session taking the claim')
|
|
1295
|
+
.option('--branch <name>', 'Branch the implementation is on')
|
|
1296
|
+
.option('--worktree <path>', 'Checkout the implementation runs in (one running implementation per checkout)')
|
|
1297
|
+
.option('--run-id <id>', 'Remote worker run id, when the implementation runs off-machine')
|
|
1298
|
+
.option('--ttl <hours>', 'Claim lifetime in hours (default: 24 for implementation, 12 for pr)', Number)
|
|
1299
|
+
.option('--takeover', 'Replace a live claim another session holds on this item (refused without it)')
|
|
1300
|
+
.option('--json', 'Output as JSON')
|
|
1301
|
+
.action(async (url, options) => {
|
|
1302
|
+
const { WorkClaimOutputSchema } = await import('./formatters/json.js');
|
|
1303
|
+
const { runWorkClaim } = await import('./commands/work.js');
|
|
1304
|
+
const verbs = { claimed: 'Claimed', renewed: 'Renewed', 'took-over': 'Took over' };
|
|
1305
|
+
await executeAction(options, () => runWorkClaim({
|
|
1306
|
+
url,
|
|
1307
|
+
kind: options.kind,
|
|
1308
|
+
session: options.session,
|
|
1309
|
+
branch: options.branch,
|
|
1310
|
+
worktree: options.worktree,
|
|
1311
|
+
runId: options.runId,
|
|
1312
|
+
ttlHours: options.ttl,
|
|
1313
|
+
takeover: options.takeover,
|
|
1314
|
+
}), (data) => {
|
|
1315
|
+
console.log(`${verbs[data.outcome]} ${data.claim.kind} on ${data.claim.url} for session ${data.claim.session} (expires ${data.claim.expiresAt})`);
|
|
1316
|
+
if (!data.synced)
|
|
1317
|
+
console.log('Claimed locally only: other machines cannot see this claim yet.');
|
|
1318
|
+
if (data.gistSyncWarning)
|
|
1319
|
+
console.log(`Warning: ${data.gistSyncWarning}`);
|
|
1320
|
+
}, WorkClaimOutputSchema);
|
|
1321
|
+
});
|
|
1322
|
+
group
|
|
1323
|
+
.command('finish <url>')
|
|
1324
|
+
.description('Mark the implementation claim on an issue finished: its branch is ready to collect and review')
|
|
1325
|
+
.option('--session <name>', 'Refuse unless the live claim belongs to this session')
|
|
1326
|
+
.option('--json', 'Output as JSON')
|
|
1327
|
+
.action(async (url, options) => {
|
|
1328
|
+
const { WorkFinishOutputSchema } = await import('./formatters/json.js');
|
|
1329
|
+
const { runWorkFinish } = await import('./commands/work.js');
|
|
1330
|
+
await executeAction(options, () => runWorkFinish({ url, session: options.session }), (data) => {
|
|
1331
|
+
console.log(data.claim ? `Finished: ${url} (session ${data.claim.session})` : `No live claim on ${url}.`);
|
|
1332
|
+
if (data.gistSyncWarning)
|
|
1333
|
+
console.log(`Warning: ${data.gistSyncWarning}`);
|
|
1334
|
+
}, WorkFinishOutputSchema);
|
|
1335
|
+
});
|
|
1336
|
+
group
|
|
1337
|
+
.command('release [url]')
|
|
1338
|
+
.description('Drop the claim on a URL, or every claim a session holds (--session, optionally --kind)')
|
|
1339
|
+
.option('--session <name>', 'Release every claim this session holds')
|
|
1340
|
+
.option('--kind <kind>', 'With --session: only claims of this kind (implementation or pr)')
|
|
1341
|
+
.option('--json', 'Output as JSON')
|
|
1342
|
+
.action(async (url, options) => {
|
|
1343
|
+
const { WorkReleaseOutputSchema } = await import('./formatters/json.js');
|
|
1344
|
+
const { runWorkRelease } = await import('./commands/work.js');
|
|
1345
|
+
await executeAction(options, () => runWorkRelease({
|
|
1346
|
+
url,
|
|
1347
|
+
session: options.session,
|
|
1348
|
+
kind: options.kind,
|
|
1349
|
+
}), (data) => {
|
|
1350
|
+
const lines = data.released.map((u) => ' ' + u).join('\n');
|
|
1351
|
+
console.log(data.released.length === 0
|
|
1352
|
+
? 'No live claims matched; nothing released.'
|
|
1353
|
+
: `Released ${data.released.length} claim(s):\n${lines}`);
|
|
1354
|
+
if (data.gistSyncWarning)
|
|
1355
|
+
console.log(`Warning: ${data.gistSyncWarning}`);
|
|
1356
|
+
}, WorkReleaseOutputSchema);
|
|
1357
|
+
});
|
|
1358
|
+
group
|
|
1359
|
+
.command('list')
|
|
1360
|
+
.description('List live claims across sessions and machines')
|
|
1361
|
+
.option('--json', 'Output as JSON')
|
|
1362
|
+
.action(async (options) => {
|
|
1363
|
+
const { WorkListOutputSchema } = await import('./formatters/json.js');
|
|
1364
|
+
const { runWorkList } = await import('./commands/work.js');
|
|
1365
|
+
await executeAction(options, () => runWorkList(), (data) => {
|
|
1366
|
+
if (data.claims.length === 0) {
|
|
1367
|
+
console.log('No live work claims.');
|
|
1368
|
+
}
|
|
1369
|
+
else {
|
|
1370
|
+
console.log(`${data.claims.length} live work claim(s):`);
|
|
1371
|
+
for (const claim of data.claims) {
|
|
1372
|
+
const where = claim.worktree ?? claim.runId ?? '';
|
|
1373
|
+
console.log(` [${claim.kind}/${claim.status}] ${claim.url} — session ${claim.session} ${where}`.trimEnd());
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (data.expiredCount > 0)
|
|
1377
|
+
console.log(`${data.expiredCount} expired claim(s) will be pruned on the next write.`);
|
|
1378
|
+
const staleness = data.warnings ?? [];
|
|
1379
|
+
for (const warning of staleness)
|
|
1380
|
+
console.log(`Warning (may be stale): ${warning.message}`);
|
|
1381
|
+
}, WorkListOutputSchema);
|
|
1382
|
+
});
|
|
1383
|
+
},
|
|
1384
|
+
},
|
|
1281
1385
|
// ── PR Template ──────────────────────────────────────────────────────
|
|
1282
1386
|
{
|
|
1283
1387
|
name: 'pr-template',
|