@oss-autopilot/core 3.43.0 → 3.44.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.
- package/dist/cli-registry.js +160 -6
- package/dist/cli.bundle.cjs +207 -180
- package/dist/commands/check-integration.js +4 -1
- package/dist/commands/cleanup.d.ts +6 -2
- package/dist/commands/cleanup.js +72 -7
- package/dist/commands/comments.d.ts +8 -1
- package/dist/commands/comments.js +11 -3
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +26 -1
- package/dist/commands/daily-ledger.d.ts +33 -5
- package/dist/commands/daily-ledger.js +36 -13
- package/dist/commands/daily-render.d.ts +2 -1
- package/dist/commands/daily-render.js +4 -1
- package/dist/commands/daily.d.ts +3 -0
- package/dist/commands/daily.js +25 -5
- package/dist/commands/dashboard-data.js +70 -61
- package/dist/commands/dashboard-lifecycle.d.ts +36 -8
- package/dist/commands/dashboard-lifecycle.js +131 -38
- package/dist/commands/dashboard-process.d.ts +35 -0
- package/dist/commands/dashboard-process.js +65 -5
- package/dist/commands/dismiss.js +7 -6
- package/dist/commands/doctor.js +1 -8
- package/dist/commands/fork-prune.d.ts +58 -0
- package/dist/commands/fork-prune.js +247 -0
- package/dist/commands/guidelines.d.ts +46 -1
- package/dist/commands/guidelines.js +111 -12
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.js +5 -0
- package/dist/commands/overnight-push-prep.d.ts +2 -1
- package/dist/commands/overnight-push-prep.js +3 -3
- package/dist/commands/policy.d.ts +5 -1
- package/dist/commands/policy.js +14 -1
- package/dist/commands/pr-create.d.ts +48 -0
- package/dist/commands/pr-create.js +200 -0
- package/dist/commands/pr-preflight.d.ts +28 -2
- package/dist/commands/pr-preflight.js +63 -9
- package/dist/commands/setup.js +120 -36
- package/dist/commands/startup.d.ts +7 -0
- package/dist/commands/startup.js +17 -0
- package/dist/commands/status.js +5 -0
- package/dist/commands/validation.d.ts +5 -0
- package/dist/commands/validation.js +5 -0
- package/dist/commands/vet-list.js +2 -2
- package/dist/commands/vet.d.ts +8 -0
- package/dist/commands/vet.js +15 -1
- package/dist/commands/work.d.ts +4 -0
- package/dist/commands/work.js +34 -11
- package/dist/core/commit-date.d.ts +31 -5
- package/dist/core/commit-date.js +36 -8
- package/dist/core/compliance-score.d.ts +3 -0
- package/dist/core/compliance-score.js +13 -9
- package/dist/core/config-registry.d.ts +27 -2
- package/dist/core/config-registry.js +83 -2
- package/dist/core/daily-logic.d.ts +4 -1
- package/dist/core/daily-logic.js +13 -2
- package/dist/core/fork-prune.d.ts +149 -0
- package/dist/core/fork-prune.js +333 -0
- package/dist/core/gist-state-store.js +4 -8
- package/dist/core/github-stats.d.ts +7 -1
- package/dist/core/github-stats.js +15 -15
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/local-config.js +2 -3
- package/dist/core/pacing.d.ts +41 -0
- package/dist/core/pacing.js +115 -0
- package/dist/core/pr-assembly.d.ts +2 -0
- package/dist/core/pr-graphql.d.ts +16 -1
- package/dist/core/pr-graphql.js +15 -3
- package/dist/core/pr-monitor.d.ts +6 -0
- package/dist/core/pr-monitor.js +46 -10
- package/dist/core/pr-preflight.d.ts +41 -0
- package/dist/core/pr-preflight.js +406 -17
- package/dist/core/prose-script.d.ts +72 -0
- package/dist/core/prose-script.js +223 -0
- package/dist/core/repo-policy.d.ts +8 -2
- package/dist/core/repo-policy.js +34 -6
- package/dist/core/repo-score-manager.d.ts +18 -0
- package/dist/core/repo-score-manager.js +29 -0
- package/dist/core/review-analysis.d.ts +15 -2
- package/dist/core/review-analysis.js +22 -5
- package/dist/core/stale-data.d.ts +44 -7
- package/dist/core/stale-data.js +46 -8
- package/dist/core/state-persistence.js +2 -4
- package/dist/core/state-schema.d.ts +39 -0
- package/dist/core/state-schema.js +68 -1
- package/dist/core/state.d.ts +21 -0
- package/dist/core/state.js +47 -0
- package/dist/core/status-determination.js +10 -8
- package/dist/core/untrusted-content.d.ts +3 -3
- package/dist/core/untrusted-content.js +26 -8
- package/dist/core/urls.d.ts +24 -0
- package/dist/core/urls.js +76 -0
- package/dist/dashboard/assets/chart-panel-B-nLVgzQ.js +3 -0
- package/dist/dashboard/assets/index-5IvMGokL.js +55 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/formatters/json.d.ts +171 -5
- package/dist/formatters/json.js +79 -0
- package/package.json +6 -6
- package/dist/dashboard/assets/chart-panel-C_C1lFTI.js +0 -3
- package/dist/dashboard/assets/index-B--H66Jk.js +0 -55
package/dist/cli-registry.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { errorMessage, resolveErrorCode } from './core/errors.js';
|
|
12
12
|
import { outputJson, outputJsonError, outputJsonValidated } from './formatters/json.js';
|
|
13
|
+
import { pacingLines } from './core/pacing.js';
|
|
13
14
|
/**
|
|
14
15
|
* Shared error handler for CLI action catch blocks. Exported so cli.ts can
|
|
15
16
|
* route preAction-hook rejections (corrupt Gist, missing gist scope, rate
|
|
@@ -49,15 +50,18 @@ export function handleCommandError(err, json) {
|
|
|
49
50
|
* compliance-score, post, claim, config, init, setup, checkSetup,
|
|
50
51
|
* parse-issue-list, orphan-files, doctor, local-repos, move,
|
|
51
52
|
* pr-template, repo-cap, pr-preflight, repo-vet, detect-formatters, work (claim/finish/release/list),
|
|
53
|
+
* dashboard launch,
|
|
52
54
|
* policy (get/set).
|
|
55
|
+
* `pr-create` checks its schema itself after the PR exists and only warns
|
|
56
|
+
* on a mismatch, so a drift never reports a created PR as failed (#2085).
|
|
53
57
|
*
|
|
54
58
|
* 2. **Goldens-only**: no Zod schema exists; the command returns a TS
|
|
55
59
|
* interface and its `*.contract.test.ts` golden snapshot is the only
|
|
56
60
|
* shape gate. Nothing fires at runtime if the producer drifts after
|
|
57
61
|
* the goldens were last updated.
|
|
58
62
|
* Commands: state (show/sync/unlink), vet, vet-list, ledger-backfill, eval, track, comments,
|
|
59
|
-
* startup, dismiss, undismiss, stats, policy reset, and the
|
|
60
|
-
* guidelines subcommands (list/view/store/reset/fetch-corpus/mark-extracted).
|
|
63
|
+
* startup, dismiss, undismiss, stats, policy reset, and the
|
|
64
|
+
* guidelines subcommands (list/view/store/reset/fetch-corpus/mark-extracted/mark-proposed).
|
|
61
65
|
*
|
|
62
66
|
* (`dashboard serve` is exempt: it has no `--json` mode.)
|
|
63
67
|
* (`draft path` / `draft show` have neither: their shapes are pinned by `commands/draft.test.ts`.)
|
|
@@ -199,6 +203,9 @@ export const commands = [
|
|
|
199
203
|
console.log(`Closed PRs: ${data.stats.closedPRs}`);
|
|
200
204
|
console.log(`Merge Rate: ${data.stats.mergeRate}`);
|
|
201
205
|
console.log(`Needs Response: ${data.stats.needsResponse}`);
|
|
206
|
+
const pacing = pacingLines(data.pacing ?? null);
|
|
207
|
+
for (const line of pacing)
|
|
208
|
+
console.log(`Pacing: ${line}`);
|
|
202
209
|
if (data.offline) {
|
|
203
210
|
console.log(`\nLast Updated: ${data.lastUpdated || 'Never'}`);
|
|
204
211
|
console.log('(Status reads from local state — no GitHub API calls)');
|
|
@@ -809,8 +816,13 @@ export const commands = [
|
|
|
809
816
|
.command('comments <pr-url>')
|
|
810
817
|
.description('Show all comments on a PR')
|
|
811
818
|
.option('--bots', 'Include bot comments')
|
|
819
|
+
.option('--include-own', 'Include your own comments and reviews')
|
|
812
820
|
.option('--json', 'Output as JSON')
|
|
813
|
-
.action((prUrl, options) => executeAction(options, async () => (await import('./commands/comments.js')).runComments({
|
|
821
|
+
.action((prUrl, options) => executeAction(options, async () => (await import('./commands/comments.js')).runComments({
|
|
822
|
+
prUrl,
|
|
823
|
+
showBots: options.bots,
|
|
824
|
+
includeOwn: options.includeOwn,
|
|
825
|
+
}), async (data) => {
|
|
814
826
|
const { formatRelativeTime } = await import('./core/dates.js');
|
|
815
827
|
// Bodies arrive `<github-content>`-fenced for agent consumers
|
|
816
828
|
// (#1372); unwrap for human terminal display.
|
|
@@ -870,15 +882,23 @@ export const commands = [
|
|
|
870
882
|
.option('--stdin', 'Read message from stdin')
|
|
871
883
|
.option('--body-file <path>', BODY_FILE_HELP)
|
|
872
884
|
.option('--expect-sha256 <hex>', EXPECT_SHA256_HELP)
|
|
885
|
+
.option('--allow-script-mismatch', ALLOW_SCRIPT_MISMATCH_HELP)
|
|
873
886
|
.option('--json', 'Output as JSON')
|
|
874
887
|
.action(async (url, messageParts, options) => {
|
|
875
888
|
const { PostOutputSchema } = await import('./formatters/json.js');
|
|
876
889
|
await executeAction(options, async () => {
|
|
877
890
|
const message = await readMessage(options, messageParts);
|
|
878
891
|
const { runPost } = await import('./commands/comments.js');
|
|
879
|
-
return runPost({
|
|
892
|
+
return runPost({
|
|
893
|
+
url,
|
|
894
|
+
message,
|
|
895
|
+
expectSha256: options.expectSha256,
|
|
896
|
+
allowScriptMismatch: options.allowScriptMismatch,
|
|
897
|
+
});
|
|
880
898
|
}, (data) => {
|
|
881
899
|
console.log(`Comment posted: ${data.commentUrl}`);
|
|
900
|
+
if (data.scriptMismatchWarning)
|
|
901
|
+
console.log(`Warning: ${data.scriptMismatchWarning}`);
|
|
882
902
|
}, PostOutputSchema);
|
|
883
903
|
});
|
|
884
904
|
},
|
|
@@ -892,6 +912,7 @@ export const commands = [
|
|
|
892
912
|
.description('Claim an issue by posting a comment')
|
|
893
913
|
.option('--body-file <path>', BODY_FILE_HELP)
|
|
894
914
|
.option('--expect-sha256 <hex>', EXPECT_SHA256_HELP)
|
|
915
|
+
.option('--allow-script-mismatch', ALLOW_SCRIPT_MISMATCH_HELP)
|
|
895
916
|
.option('--json', 'Output as JSON')
|
|
896
917
|
.action(async (issueUrl, messageParts, options) => {
|
|
897
918
|
const { ClaimOutputSchema } = await import('./formatters/json.js');
|
|
@@ -899,9 +920,16 @@ export const commands = [
|
|
|
899
920
|
const { runClaim } = await import('./commands/comments.js');
|
|
900
921
|
// No words and no file means the default claim message.
|
|
901
922
|
const message = (await readMessage(options, messageParts)) || undefined;
|
|
902
|
-
return runClaim({
|
|
923
|
+
return runClaim({
|
|
924
|
+
issueUrl,
|
|
925
|
+
message,
|
|
926
|
+
expectSha256: options.expectSha256,
|
|
927
|
+
allowScriptMismatch: options.allowScriptMismatch,
|
|
928
|
+
});
|
|
903
929
|
}, (data) => {
|
|
904
930
|
console.log(`Issue claimed: ${data.commentUrl}`);
|
|
931
|
+
if (data.scriptMismatchWarning)
|
|
932
|
+
console.log(`Warning: ${data.scriptMismatchWarning}`);
|
|
905
933
|
}, ClaimOutputSchema);
|
|
906
934
|
});
|
|
907
935
|
},
|
|
@@ -925,6 +953,7 @@ export const commands = [
|
|
|
925
953
|
}), (data) => {
|
|
926
954
|
if ('keys' in data) {
|
|
927
955
|
console.log('\nConfig keys\n');
|
|
956
|
+
console.log(' `config <key> <value>` sets every key below except (auto); [setup] and [both] keys also work with `setup --set key=value`.\n');
|
|
928
957
|
for (const def of data.keys) {
|
|
929
958
|
const flag = def.settableVia === 'auto' ? '(auto)' : `[${def.settableVia}]`;
|
|
930
959
|
console.log(` ${def.key.padEnd(28)} ${flag.padEnd(10)} ${def.description}`);
|
|
@@ -938,6 +967,10 @@ export const commands = [
|
|
|
938
967
|
}
|
|
939
968
|
else {
|
|
940
969
|
console.log(`Set ${data.key} to: ${data.value}`);
|
|
970
|
+
if (data.warnings) {
|
|
971
|
+
for (const w of data.warnings)
|
|
972
|
+
console.warn(w);
|
|
973
|
+
}
|
|
941
974
|
}
|
|
942
975
|
}, ConfigCommandOutputSchema);
|
|
943
976
|
});
|
|
@@ -1074,6 +1107,23 @@ export const commands = [
|
|
|
1074
1107
|
handleCommandError(err);
|
|
1075
1108
|
}
|
|
1076
1109
|
});
|
|
1110
|
+
dashboardCmd
|
|
1111
|
+
.command('launch')
|
|
1112
|
+
.description('Start the dashboard server in the background, or reuse the running one')
|
|
1113
|
+
.option('--port <port>', 'Port to try first', '3000')
|
|
1114
|
+
.option('--json', 'Output as JSON')
|
|
1115
|
+
.action(async (options) => {
|
|
1116
|
+
const port = Number(options.port);
|
|
1117
|
+
if (!Number.isSafeInteger(port) || port < 1 || port > 65_535) {
|
|
1118
|
+
handleCommandError(new Error(`Invalid port number: "${options.port}". Must be an integer between 1 and 65535.`), options.json);
|
|
1119
|
+
}
|
|
1120
|
+
const { DashboardLaunchOutputSchema } = await import('./formatters/json.js');
|
|
1121
|
+
const { runDashboardLaunch } = await import('./commands/dashboard-lifecycle.js');
|
|
1122
|
+
await executeAction(options, () => runDashboardLaunch({ port }), (data) => {
|
|
1123
|
+
const note = data.status === 'already_running' ? ' (already running)' : '';
|
|
1124
|
+
console.log(`Dashboard: ${data.url}${note}`);
|
|
1125
|
+
}, DashboardLaunchOutputSchema);
|
|
1126
|
+
});
|
|
1077
1127
|
},
|
|
1078
1128
|
},
|
|
1079
1129
|
// ── Parse Issue List ───────────────────────────────────────────────────
|
|
@@ -1402,6 +1452,7 @@ export const commands = [
|
|
|
1402
1452
|
.description('Drop the claim on a URL, or every claim a session holds (--session, optionally --kind)')
|
|
1403
1453
|
.option('--session <name>', 'Release every claim this session holds')
|
|
1404
1454
|
.option('--kind <kind>', 'With --session: only claims of this kind (implementation or pr)')
|
|
1455
|
+
.option('--pr <url>', 'Record a PR just opened, for the pacing caps (maxNewPrsPerDay, maxNewForksPerDay)')
|
|
1405
1456
|
.option('--json', 'Output as JSON')
|
|
1406
1457
|
.action(async (url, options) => {
|
|
1407
1458
|
const { WorkReleaseOutputSchema } = await import('./formatters/json.js');
|
|
@@ -1410,7 +1461,10 @@ export const commands = [
|
|
|
1410
1461
|
url,
|
|
1411
1462
|
session: options.session,
|
|
1412
1463
|
kind: options.kind,
|
|
1464
|
+
pr: options.pr,
|
|
1413
1465
|
}), (data) => {
|
|
1466
|
+
if (data.recordedPR)
|
|
1467
|
+
console.log(`Recorded new PR ${data.recordedPR} for the pacing caps.`);
|
|
1414
1468
|
const lines = data.released.map((u) => ' ' + u).join('\n');
|
|
1415
1469
|
console.log(data.released.length === 0
|
|
1416
1470
|
? 'No live claims matched; nothing released.'
|
|
@@ -1491,6 +1545,35 @@ export const commands = [
|
|
|
1491
1545
|
});
|
|
1492
1546
|
},
|
|
1493
1547
|
},
|
|
1548
|
+
// ── Fork Prune (#1912) ───────────────────────────────────────────────
|
|
1549
|
+
{
|
|
1550
|
+
name: 'fork-prune',
|
|
1551
|
+
register(program) {
|
|
1552
|
+
program
|
|
1553
|
+
.command('fork-prune')
|
|
1554
|
+
.description('List your forks that back no open PR and hold no unmerged work of yours (dry run); --apply deletes exactly the set a dry run printed')
|
|
1555
|
+
.option('--apply', 'Delete the prunable forks. Needs --expect from a dry run and the delete_repo token scope; refused when the set changed since that dry run, and each fork is re-checked right before its delete')
|
|
1556
|
+
.option('--expect <digest>', 'The setDigest a dry run printed: apply refuses unless the prunable set still matches it')
|
|
1557
|
+
.option('--json', 'Output as JSON')
|
|
1558
|
+
.action(async (options) => {
|
|
1559
|
+
const { ForkPruneOutputSchema } = await import('./formatters/json.js');
|
|
1560
|
+
const { runForkPrune, printForkPrune } = await import('./commands/fork-prune.js');
|
|
1561
|
+
const run = async () => {
|
|
1562
|
+
const data = await runForkPrune({
|
|
1563
|
+
apply: options.apply === true,
|
|
1564
|
+
expect: options.expect,
|
|
1565
|
+
// Text mode prints each delete as it happens; --json keeps the single envelope.
|
|
1566
|
+
...(!options.json && { onDeleted: (repo) => console.log(`Deleted ${repo}`) }),
|
|
1567
|
+
});
|
|
1568
|
+
// A stopped apply (a delete refused) still prints what it did, then fails the command.
|
|
1569
|
+
if (data.error)
|
|
1570
|
+
process.exitCode = 1;
|
|
1571
|
+
return data;
|
|
1572
|
+
};
|
|
1573
|
+
await executeAction(options, run, printForkPrune, ForkPruneOutputSchema);
|
|
1574
|
+
});
|
|
1575
|
+
},
|
|
1576
|
+
},
|
|
1494
1577
|
// ── PR Preflight (#1952) ─────────────────────────────────────────────
|
|
1495
1578
|
{
|
|
1496
1579
|
name: 'pr-preflight',
|
|
@@ -1504,6 +1587,11 @@ export const commands = [
|
|
|
1504
1587
|
.option('--base <branch>', 'Branch the PR will target (default: the upstream default branch)')
|
|
1505
1588
|
.option('--fetch', 'Fetch the upstream target branch first instead of reporting a stale ref')
|
|
1506
1589
|
.option('--local', 'Skip every GitHub read: local checks and numbers only')
|
|
1590
|
+
.option('--body-file <path>', 'Staged PR body (a file in the draft directory) to check for a description and the disclosure rule')
|
|
1591
|
+
.option('--title-file <path>', 'Staged PR title (a file in the draft directory) to check for a WIP marker')
|
|
1592
|
+
.option('--template-file <path>', "The repo's PR template (a file in the draft directory); body lines copied from it are not a description")
|
|
1593
|
+
.option('--draft', 'The PR will be opened as a draft, which may keep a WIP title')
|
|
1594
|
+
.option('--allow-script-mismatch', ALLOW_SCRIPT_MISMATCH_HELP)
|
|
1507
1595
|
.option('--json', 'Output as JSON')
|
|
1508
1596
|
.action(async (issue, options) => {
|
|
1509
1597
|
const { PrPreflightOutputSchema } = await import('./formatters/json.js');
|
|
@@ -1515,6 +1603,11 @@ export const commands = [
|
|
|
1515
1603
|
base: options.base,
|
|
1516
1604
|
fetch: options.fetch === true,
|
|
1517
1605
|
local: options.local === true,
|
|
1606
|
+
bodyFile: options.bodyFile,
|
|
1607
|
+
titleFile: options.titleFile,
|
|
1608
|
+
templateFile: options.templateFile,
|
|
1609
|
+
draft: options.draft === true,
|
|
1610
|
+
allowScriptMismatch: options.allowScriptMismatch === true,
|
|
1518
1611
|
});
|
|
1519
1612
|
// A caller that only sees the exit code still stops on a failed gate; the output prints in full.
|
|
1520
1613
|
if (data.verdict === 'fail')
|
|
@@ -1525,6 +1618,50 @@ export const commands = [
|
|
|
1525
1618
|
});
|
|
1526
1619
|
},
|
|
1527
1620
|
},
|
|
1621
|
+
// ── PR Create (#2085) ───────────────────────────────────────────────
|
|
1622
|
+
{
|
|
1623
|
+
name: 'pr-create',
|
|
1624
|
+
register(program) {
|
|
1625
|
+
program
|
|
1626
|
+
.command('pr-create [issue]')
|
|
1627
|
+
.description('Run the PR preflight checks on the staged title and body, then open the PR with exactly that title, body and draft value; nothing is created on a failed check')
|
|
1628
|
+
.requiredOption('--head <head>', 'The PR head: <fork-owner>:<branch>, or <branch> in the same repo')
|
|
1629
|
+
.requiredOption('--title-file <path>', 'Staged PR title (a file in the draft directory)')
|
|
1630
|
+
.requiredOption('--body-file <path>', 'Staged PR body (a file in the draft directory)')
|
|
1631
|
+
.option('--template-file <path>', "The repo's PR template (a file in the draft directory); body lines copied from it are not a description")
|
|
1632
|
+
.option('--dir <path>', 'Local clone or worktree with the head branch checked out (default: current directory)')
|
|
1633
|
+
.option('--base <branch>', 'Branch the PR will target (default: the upstream default branch)')
|
|
1634
|
+
.option('--draft', 'Open the PR as a draft, which may keep a WIP title')
|
|
1635
|
+
.option('--allow-script-mismatch', ALLOW_SCRIPT_MISMATCH_HELP)
|
|
1636
|
+
.option('--accept <keys>', 'Comma-separated <id>:<state> keys the user agreed to, as a refusal prints them in brackets (repo-cap:warn, competing-work:at-risk); a competing-work fail only by its exact verdict')
|
|
1637
|
+
.option('--json', 'Output as JSON')
|
|
1638
|
+
.action(async (issue, options) => {
|
|
1639
|
+
const { PrCreateOutputSchema } = await import('./formatters/json.js');
|
|
1640
|
+
const { runPrCreate, printPrCreate } = await import('./commands/pr-create.js');
|
|
1641
|
+
const { readDraft } = await import('./commands/draft.js');
|
|
1642
|
+
const run = async () => runPrCreate({
|
|
1643
|
+
issue,
|
|
1644
|
+
dir: options.dir,
|
|
1645
|
+
base: options.base,
|
|
1646
|
+
head: options.head,
|
|
1647
|
+
title: readDraft(options.titleFile).content,
|
|
1648
|
+
body: readDraft(options.bodyFile).content,
|
|
1649
|
+
template: options.templateFile === undefined ? undefined : readDraft(options.templateFile).content,
|
|
1650
|
+
draft: options.draft === true,
|
|
1651
|
+
allowScriptMismatch: options.allowScriptMismatch === true,
|
|
1652
|
+
accept: options.accept?.split(',').map((id) => id.trim()),
|
|
1653
|
+
});
|
|
1654
|
+
// The PR exists once run() returns, so a shape mismatch warns instead of reporting a failure.
|
|
1655
|
+
const checked = async () => {
|
|
1656
|
+
const data = await run();
|
|
1657
|
+
if (!PrCreateOutputSchema.safeParse(data).success)
|
|
1658
|
+
console.warn('Warning: pr-create output drifted from its schema');
|
|
1659
|
+
return data;
|
|
1660
|
+
};
|
|
1661
|
+
await executeAction(options, checked, printPrCreate);
|
|
1662
|
+
});
|
|
1663
|
+
},
|
|
1664
|
+
},
|
|
1528
1665
|
// ── Repo Vet (#1271) ────────────────────────────────────────────────
|
|
1529
1666
|
{
|
|
1530
1667
|
name: 'repo-vet',
|
|
@@ -1902,6 +2039,19 @@ Load it with:
|
|
|
1902
2039
|
console.log(`Marked ${data.marked} PR(s) in ${data.repo} as extracted.`);
|
|
1903
2040
|
});
|
|
1904
2041
|
});
|
|
2042
|
+
group
|
|
2043
|
+
.command('mark-proposed')
|
|
2044
|
+
.description('Record that the guideline proposal file for a repo waits for review on this machine, so other machines do not re-extract it (#2041)')
|
|
2045
|
+
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
2046
|
+
.option('--json', 'Output as JSON')
|
|
2047
|
+
.action(async (options) => {
|
|
2048
|
+
await executeAction(options, async () => {
|
|
2049
|
+
const { runMarkProposed } = await import('./commands/guidelines.js');
|
|
2050
|
+
return runMarkProposed({ repo: options.repo });
|
|
2051
|
+
}, (data) => {
|
|
2052
|
+
console.log(`Marked ${data.marked} PR(s) in ${data.repo} as proposed (${data.path}).`);
|
|
2053
|
+
});
|
|
2054
|
+
});
|
|
1905
2055
|
group
|
|
1906
2056
|
.command('reset')
|
|
1907
2057
|
.description('Tombstone the guidelines file for a repo (subsequent reads return null)')
|
|
@@ -1959,9 +2109,10 @@ Load it with:
|
|
|
1959
2109
|
.description('Record the policy you confirmed for a repo (merged over what is stored; refused when unattended)')
|
|
1960
2110
|
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
1961
2111
|
.option('--ai-policy <value>', 'allowed | disclosure-required | banned | unknown')
|
|
1962
|
-
.option('--disclosure-text <text>', 'The disclosure line the
|
|
2112
|
+
.option('--disclosure-text <text>', 'The disclosure line to put in the PR body; pr-preflight checks the body for it')
|
|
1963
2113
|
.option('--cla <value>', 'none | required | unknown')
|
|
1964
2114
|
.option('--pr-gate <value>', 'none | claim-first | maintainer-label | collaborators-only | unknown')
|
|
2115
|
+
.option('--gate-label <name>', 'The issue label a maintainer-label gate waits for; pr-preflight passes only on this exact label ("" clears)')
|
|
1965
2116
|
.option('--commit-rules <ids>', 'Comma-separated: conventional-commits, dco-signoff, no-closing-keyword-in-commit ("" clears)')
|
|
1966
2117
|
.option('--max-open-ai-prs <n>', 'Open AI-assisted PRs the repo allows at once (0 clears)', Number)
|
|
1967
2118
|
.option('--source <text>', 'Where the rule came from, e.g. a maintainer comment (stored as a short quote)')
|
|
@@ -1997,6 +2148,7 @@ Load it with:
|
|
|
1997
2148
|
];
|
|
1998
2149
|
const BODY_FILE_HELP = 'Read the message from a draft file (see `draft path`). Needs --expect-sha256; not with --stdin or positional words.';
|
|
1999
2150
|
const EXPECT_SHA256_HELP = 'Fail before doing anything unless the text hashes to this SHA-256 (from `draft show`)';
|
|
2151
|
+
const ALLOW_SCRIPT_MISMATCH_HELP = "Proceed when the text's script differs from the repo's README and CONTRIBUTING; the mismatch is reported as a warning";
|
|
2000
2152
|
/** The message for `post` / `claim`: an approved draft file, stdin (trimmed), or the positional words. */
|
|
2001
2153
|
async function readMessage(options, parts) {
|
|
2002
2154
|
if (options.bodyFile !== undefined) {
|
|
@@ -2046,6 +2198,8 @@ function printPolicy(data) {
|
|
|
2046
2198
|
console.log(` Max open AI-assisted PRs: ${policy.maxOpenAiPRs}`);
|
|
2047
2199
|
if (policy.disclosureText)
|
|
2048
2200
|
console.log(` Disclosure: ${policy.disclosureText}`);
|
|
2201
|
+
if (policy.gateLabel)
|
|
2202
|
+
console.log(` Gate label: ${policy.gateLabel}`);
|
|
2049
2203
|
if (policy.sources)
|
|
2050
2204
|
console.log(` Sources: ${policy.sources}`);
|
|
2051
2205
|
}
|