@oss-autopilot/core 3.42.5 → 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-pre-action.js +8 -3
- package/dist/cli-registry.js +428 -27
- package/dist/cli.bundle.cjs +212 -156
- package/dist/commands/check-integration.js +5 -1
- package/dist/commands/cleanup.d.ts +80 -0
- package/dist/commands/cleanup.js +334 -0
- package/dist/commands/comments.d.ts +14 -1
- package/dist/commands/comments.js +17 -5
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +63 -6
- package/dist/commands/daily-dismiss-filter.d.ts +7 -0
- package/dist/commands/daily-dismiss-filter.js +17 -1
- package/dist/commands/daily-ledger.d.ts +150 -0
- package/dist/commands/daily-ledger.js +248 -0
- package/dist/commands/daily-recent-prs.d.ts +26 -0
- package/dist/commands/daily-recent-prs.js +55 -0
- package/dist/commands/daily-render.d.ts +2 -1
- package/dist/commands/daily-render.js +4 -1
- package/dist/commands/daily.d.ts +5 -1
- package/dist/commands/daily.js +83 -93
- package/dist/commands/dashboard-cache.d.ts +2 -0
- package/dist/commands/dashboard-cache.js +33 -8
- package/dist/commands/dashboard-data.js +113 -69
- package/dist/commands/dashboard-gist-sync.js +3 -1
- package/dist/commands/dashboard-lifecycle.d.ts +36 -8
- package/dist/commands/dashboard-lifecycle.js +132 -39
- package/dist/commands/dashboard-process.d.ts +49 -1
- package/dist/commands/dashboard-process.js +111 -12
- package/dist/commands/dashboard-server.js +89 -23
- package/dist/commands/detect-formatters.js +1 -0
- package/dist/commands/dismiss.js +11 -7
- package/dist/commands/doctor.d.ts +15 -1
- package/dist/commands/doctor.js +66 -5
- package/dist/commands/draft.d.ts +77 -0
- package/dist/commands/draft.js +218 -0
- package/dist/commands/eval.js +1 -0
- package/dist/commands/fork-prune.d.ts +58 -0
- package/dist/commands/fork-prune.js +247 -0
- package/dist/commands/guidelines.d.ts +69 -2
- package/dist/commands/guidelines.js +158 -14
- package/dist/commands/index.d.ts +29 -4
- package/dist/commands/index.js +20 -3
- package/dist/commands/issue-thread.d.ts +46 -0
- package/dist/commands/issue-thread.js +123 -0
- package/dist/commands/ledger-backfill.d.ts +9 -0
- package/dist/commands/ledger-backfill.js +44 -1
- package/dist/commands/list-mark-done.d.ts +2 -1
- package/dist/commands/list-mark-done.js +3 -1
- package/dist/commands/list-move-tier.d.ts +2 -1
- package/dist/commands/list-move-tier.js +3 -1
- package/dist/commands/local-repos.js +10 -5
- package/dist/commands/locate-issue-list.d.ts +40 -17
- package/dist/commands/locate-issue-list.js +148 -88
- package/dist/commands/move.js +7 -1
- package/dist/commands/overnight-handoff.d.ts +17 -7
- package/dist/commands/overnight-handoff.js +36 -14
- package/dist/commands/overnight-push-prep.d.ts +14 -8
- package/dist/commands/overnight-push-prep.js +107 -35
- package/dist/commands/overnight-tool-rules.d.ts +54 -0
- package/dist/commands/overnight-tool-rules.js +217 -0
- package/dist/commands/overnight.d.ts +5 -6
- package/dist/commands/overnight.js +61 -140
- package/dist/commands/parse-list.js +7 -1
- package/dist/commands/policy.d.ts +90 -0
- package/dist/commands/policy.js +276 -0
- package/dist/commands/pr-create.d.ts +48 -0
- package/dist/commands/pr-create.js +200 -0
- package/dist/commands/pr-preflight.d.ts +69 -0
- package/dist/commands/pr-preflight.js +348 -0
- package/dist/commands/repo-vet.d.ts +9 -0
- package/dist/commands/repo-vet.js +36 -11
- package/dist/commands/scout-bridge.js +18 -8
- package/dist/commands/search.js +7 -0
- package/dist/commands/setup.d.ts +3 -3
- package/dist/commands/setup.js +160 -48
- package/dist/commands/skip-add.js +10 -1
- package/dist/commands/startup.d.ts +12 -3
- package/dist/commands/startup.js +82 -49
- package/dist/commands/state-cmd.d.ts +2 -0
- package/dist/commands/state-cmd.js +5 -1
- package/dist/commands/stats.js +1 -0
- package/dist/commands/status.js +6 -0
- package/dist/commands/strategy.js +1 -0
- package/dist/commands/validation.d.ts +5 -0
- package/dist/commands/validation.js +5 -0
- package/dist/commands/vet-list.d.ts +6 -0
- package/dist/commands/vet-list.js +26 -1
- package/dist/commands/vet.d.ts +20 -0
- package/dist/commands/vet.js +133 -2
- package/dist/commands/work.d.ts +4 -0
- package/dist/commands/work.js +34 -11
- package/dist/core/__fixtures__/prompt-injection-payloads.js +31 -0
- package/dist/core/anti-llm-policy.d.ts +3 -0
- package/dist/core/anti-llm-policy.js +3 -0
- package/dist/core/auth.js +2 -0
- package/dist/core/ci-analysis.d.ts +7 -2
- package/dist/core/ci-analysis.js +76 -21
- package/dist/core/commit-date.d.ts +45 -0
- package/dist/core/commit-date.js +45 -0
- 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 +94 -7
- package/dist/core/contributing.d.ts +2 -3
- package/dist/core/contributing.js +2 -3
- package/dist/core/daily-logic.d.ts +30 -5
- package/dist/core/daily-logic.js +68 -19
- package/dist/core/errors.d.ts +37 -3
- package/dist/core/errors.js +54 -5
- package/dist/core/fork-prune.d.ts +149 -0
- package/dist/core/fork-prune.js +333 -0
- package/dist/core/gist-health.d.ts +15 -3
- package/dist/core/gist-health.js +8 -0
- package/dist/core/gist-state-store.d.ts +24 -4
- package/dist/core/gist-state-store.js +98 -51
- package/dist/core/github-stats.d.ts +110 -16
- package/dist/core/github-stats.js +295 -110
- package/dist/core/http-cache.d.ts +0 -10
- package/dist/core/http-cache.js +0 -19
- package/dist/core/index.d.ts +13 -6
- package/dist/core/index.js +16 -6
- package/dist/core/issue-conversation.d.ts +8 -2
- package/dist/core/issue-conversation.js +31 -12
- package/dist/core/local-config.d.ts +95 -0
- package/dist/core/local-config.js +270 -0
- package/dist/core/merged-pr-notes.d.ts +2 -2
- package/dist/core/pacing.d.ts +41 -0
- package/dist/core/pacing.js +115 -0
- package/dist/core/pagination.d.ts +55 -0
- package/dist/core/pagination.js +59 -0
- package/dist/core/paths.d.ts +7 -0
- package/dist/core/paths.js +9 -0
- package/dist/core/pr-assembly.d.ts +2 -0
- package/dist/core/pr-assembly.js +6 -2
- package/dist/core/pr-graphql.d.ts +53 -4
- package/dist/core/pr-graphql.js +87 -14
- package/dist/core/pr-monitor.d.ts +35 -12
- package/dist/core/pr-monitor.js +110 -26
- package/dist/core/pr-preflight.d.ts +154 -0
- package/dist/core/pr-preflight.js +753 -0
- package/dist/core/pr-quality-rubric.d.ts +0 -6
- package/dist/core/pr-quality-rubric.js +0 -8
- package/dist/core/pr-template.d.ts +2 -0
- package/dist/core/pr-template.js +5 -1
- package/dist/core/prose-script.d.ts +72 -0
- package/dist/core/prose-script.js +223 -0
- package/dist/core/repo-policy.d.ts +111 -0
- package/dist/core/repo-policy.js +428 -0
- package/dist/core/repo-score-manager.d.ts +66 -0
- package/dist/core/repo-score-manager.js +140 -1
- package/dist/core/review-analysis.d.ts +49 -21
- package/dist/core/review-analysis.js +89 -15
- package/dist/core/reviewed-prs-fetch.js +11 -29
- package/dist/core/reviewed-prs.js +8 -15
- package/dist/core/stale-data.d.ts +78 -0
- package/dist/core/stale-data.js +153 -0
- package/dist/core/state-persistence.d.ts +62 -27
- package/dist/core/state-persistence.js +338 -119
- package/dist/core/state-schema.d.ts +152 -210
- package/dist/core/state-schema.js +232 -80
- package/dist/core/state.d.ts +81 -8
- package/dist/core/state.js +239 -46
- package/dist/core/status-determination.js +32 -12
- package/dist/core/strategy.js +3 -1
- package/dist/core/types.d.ts +22 -1
- package/dist/core/types.js +1 -0
- package/dist/core/untrusted-content.d.ts +30 -11
- package/dist/core/untrusted-content.js +95 -42
- package/dist/core/urls.d.ts +33 -0
- package/dist/core/urls.js +94 -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 +432 -10
- package/dist/formatters/json.js +156 -1
- package/package.json +6 -6
- package/dist/core/ci-enforced-tools.d.ts +0 -35
- package/dist/core/ci-enforced-tools.js +0 -109
- package/dist/core/comment-decision.d.ts +0 -79
- package/dist/core/comment-decision.js +0 -82
- package/dist/core/extraction-categories.d.ts +0 -55
- package/dist/core/extraction-categories.js +0 -108
- package/dist/core/follow-up-history.d.ts +0 -40
- package/dist/core/follow-up-history.js +0 -71
- package/dist/core/issue-effort.d.ts +0 -29
- package/dist/core/issue-effort.js +0 -47
- package/dist/core/maintainer-hints.d.ts +0 -23
- package/dist/core/maintainer-hints.js +0 -36
- package/dist/core/workflow-state.d.ts +0 -56
- package/dist/core/workflow-state.js +0 -101
- package/dist/dashboard/assets/chart-panel-DPKNBUts.js +0 -3
- package/dist/dashboard/assets/index-B25bZOYX.js +0 -55
package/dist/formatters/json.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { fenceFetchedPR } from '../core/untrusted-content.js';
|
|
7
|
-
import { WorkClaimSchema } from '../core/state-schema.js';
|
|
7
|
+
import { RepoPolicySchema, WorkClaimSchema } from '../core/state-schema.js';
|
|
8
8
|
// Process-level gist degradation warning threaded into every JSON envelope
|
|
9
9
|
// (#1433). The CLI preAction bootstrap sets it; one-shot processes never
|
|
10
10
|
// clear it (the whole invocation runs degraded or it doesn't).
|
|
@@ -49,6 +49,7 @@ export function toCompactDailyOutput(output) {
|
|
|
49
49
|
mergedPRNotes: output.mergedPRNotes,
|
|
50
50
|
reviewedPRs: output.reviewedPRs,
|
|
51
51
|
workClaims: output.workClaims,
|
|
52
|
+
pacing: output.pacing,
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
@@ -113,6 +114,7 @@ const DailyWarningPhaseSchema = z.enum([
|
|
|
113
114
|
'closed-pr-status',
|
|
114
115
|
'merged-pr-notes',
|
|
115
116
|
'reviewed-prs',
|
|
117
|
+
'issue-list',
|
|
116
118
|
]);
|
|
117
119
|
const DailyWarningSchema = z.object({
|
|
118
120
|
phase: DailyWarningPhaseSchema,
|
|
@@ -121,6 +123,18 @@ const DailyWarningSchema = z.object({
|
|
|
121
123
|
timestamp: z.string().optional(),
|
|
122
124
|
details: z.record(z.string(), z.unknown()).optional(),
|
|
123
125
|
});
|
|
126
|
+
const PacingCountSchema = z.object({
|
|
127
|
+
cap: z.number().int().positive(),
|
|
128
|
+
count: z.number().int().nonnegative(),
|
|
129
|
+
atCap: z.boolean(),
|
|
130
|
+
freesAt: z.string().nullable(),
|
|
131
|
+
});
|
|
132
|
+
/** Pacing caps and counts (#1911, core/pacing.ts); present only when a cap is set. */
|
|
133
|
+
const PacingStatusSchema = z.object({
|
|
134
|
+
prs: PacingCountSchema.optional(),
|
|
135
|
+
forks: PacingCountSchema.optional(),
|
|
136
|
+
countedAt: z.string().nullable(),
|
|
137
|
+
});
|
|
124
138
|
export const StatusOutputSchema = z.object({
|
|
125
139
|
stats: z.object({
|
|
126
140
|
mergedPRs: z.number().int().nonnegative(),
|
|
@@ -134,6 +148,7 @@ export const StatusOutputSchema = z.object({
|
|
|
134
148
|
offline: z.boolean().optional(),
|
|
135
149
|
lastUpdated: z.string().optional(),
|
|
136
150
|
warnings: z.array(DailyWarningSchema).optional(),
|
|
151
|
+
pacing: PacingStatusSchema.optional(),
|
|
137
152
|
});
|
|
138
153
|
// ── Daily output schemas (#1146) ─────────────────────────────────────
|
|
139
154
|
//
|
|
@@ -304,10 +319,18 @@ export const AttentionSummarySchema = z.object({
|
|
|
304
319
|
dormantFollowup: z.number().int().nonnegative(),
|
|
305
320
|
waiting: z.number().int().nonnegative(),
|
|
306
321
|
});
|
|
322
|
+
/** Mirrors {@link GuidelineProposalStatus} (#2041). */
|
|
323
|
+
const GuidelineProposalStatusSchema = z.object({
|
|
324
|
+
repo: z.string(),
|
|
325
|
+
proposalPath: z.string(),
|
|
326
|
+
proposalAgeDays: z.number().int().nonnegative().nullable(),
|
|
327
|
+
proposalOnThisMachine: z.boolean(),
|
|
328
|
+
});
|
|
307
329
|
/** Mirrors {@link MergedPRListUpdate} (#1463). */
|
|
308
330
|
const PendingLearningsSchema = z.object({
|
|
309
331
|
repos: z.array(z.string()),
|
|
310
332
|
prCount: z.number().int().nonnegative(),
|
|
333
|
+
proposals: z.array(GuidelineProposalStatusSchema),
|
|
311
334
|
});
|
|
312
335
|
const MergedPRListUpdateSchema = z.object({
|
|
313
336
|
prUrl: z.string(),
|
|
@@ -398,6 +421,7 @@ export const DailyOutputSchema = z.object({
|
|
|
398
421
|
mergedPRNotes: z.array(MergedPRNotesSchema).optional(),
|
|
399
422
|
reviewedPRs: z.array(ReviewedPRFollowUpSchema).optional(),
|
|
400
423
|
workClaims: z.array(WorkClaimSchema).optional(),
|
|
424
|
+
pacing: PacingStatusSchema.optional(),
|
|
401
425
|
});
|
|
402
426
|
export const CompactDailyOutputSchema = z.object({
|
|
403
427
|
digest: DailyDigestCompactSchema,
|
|
@@ -416,6 +440,7 @@ export const CompactDailyOutputSchema = z.object({
|
|
|
416
440
|
mergedPRNotes: z.array(MergedPRNotesSchema).optional(),
|
|
417
441
|
reviewedPRs: z.array(ReviewedPRFollowUpSchema).optional(),
|
|
418
442
|
workClaims: z.array(WorkClaimSchema).optional(),
|
|
443
|
+
pacing: PacingStatusSchema.optional(),
|
|
419
444
|
});
|
|
420
445
|
// ── Search output schema (#1147) ─────────────────────────────────────
|
|
421
446
|
const SearchPrioritySchema = z.enum(['merged_pr', 'preferred_org', 'starred', 'normal']);
|
|
@@ -430,6 +455,35 @@ const CandidateLinkedPRSchema = z.object({
|
|
|
430
455
|
updatedAt: z.string().optional(),
|
|
431
456
|
isStalled: z.boolean(),
|
|
432
457
|
});
|
|
458
|
+
/** Enumerated fields of a repo's contribution policy (#1953); no quoted text, so no fence. */
|
|
459
|
+
export const RepoPolicySummarySchema = RepoPolicySchema.pick({
|
|
460
|
+
aiPolicy: true,
|
|
461
|
+
cla: true,
|
|
462
|
+
prGate: true,
|
|
463
|
+
commitRules: true,
|
|
464
|
+
maxOpenAiPRs: true,
|
|
465
|
+
reviewedByUser: true,
|
|
466
|
+
});
|
|
467
|
+
/** `policy get` / `policy set` (#1953). Quoted repo text arrives in `<github-content>` fences. */
|
|
468
|
+
export const PolicyGetOutputSchema = z.object({
|
|
469
|
+
repo: z.string(),
|
|
470
|
+
policy: RepoPolicySummarySchema.extend({
|
|
471
|
+
updatedAt: z.string(),
|
|
472
|
+
blocklisted: z.boolean(),
|
|
473
|
+
disclosureText: z.string().optional(),
|
|
474
|
+
gateLabel: z.string().optional(),
|
|
475
|
+
sources: z.string().optional(),
|
|
476
|
+
}).nullable(),
|
|
477
|
+
blocklistChange: z.enum(['added', 'removed']).optional(),
|
|
478
|
+
gistSyncWarning: z.string().optional(),
|
|
479
|
+
});
|
|
480
|
+
/** `dashboard launch --json` (#2039). Mirrors `DashboardLaunchOutput` in commands/dashboard-lifecycle.ts. */
|
|
481
|
+
export const DashboardLaunchOutputSchema = z.object({
|
|
482
|
+
status: z.enum(['launched', 'already_running']),
|
|
483
|
+
url: z.string(),
|
|
484
|
+
port: z.number(),
|
|
485
|
+
logFile: z.string(),
|
|
486
|
+
});
|
|
433
487
|
const SearchCandidateSchema = z.object({
|
|
434
488
|
issue: z.object({
|
|
435
489
|
repo: z.string(),
|
|
@@ -470,6 +524,8 @@ const SearchCandidateSchema = z.object({
|
|
|
470
524
|
/** True when this candidate filled a diversity slot (#1244) — surfaced so
|
|
471
525
|
* the user can see the counterweight working, not just its absence. */
|
|
472
526
|
diversitySlot: z.boolean().optional(),
|
|
527
|
+
/** The repo's stored contribution policy (#1953), when one is recorded. */
|
|
528
|
+
policy: RepoPolicySummarySchema.optional(),
|
|
473
529
|
});
|
|
474
530
|
/** Per-repo open-PR cap status (core/repo-cap.ts). */
|
|
475
531
|
export const RepoCapStatusSchema = z.object({
|
|
@@ -483,12 +539,74 @@ export const RepoCapStatusSchema = z.object({
|
|
|
483
539
|
excluded: z.boolean(),
|
|
484
540
|
reason: z.string().optional(),
|
|
485
541
|
});
|
|
542
|
+
const PrPreflightCheckSchema = z.object({
|
|
543
|
+
id: z.string(),
|
|
544
|
+
status: z.enum(['pass', 'warn', 'fail', 'skipped']),
|
|
545
|
+
summary: z.string(),
|
|
546
|
+
details: z.record(z.string(), z.unknown()).optional(),
|
|
547
|
+
});
|
|
548
|
+
/** `pr-preflight` (#1952). A later check is one more `checks` entry, so the shape does not change. */
|
|
549
|
+
export const PrPreflightOutputSchema = z.object({
|
|
550
|
+
verdict: z.enum(['pass', 'warn', 'fail']),
|
|
551
|
+
dir: z.string(),
|
|
552
|
+
repo: z.string().nullable(),
|
|
553
|
+
issueUrl: z.string().nullable(),
|
|
554
|
+
branch: z.string().nullable(),
|
|
555
|
+
remote: z.string().nullable(),
|
|
556
|
+
base: z.string().nullable(),
|
|
557
|
+
mergeBase: z.string().nullable(),
|
|
558
|
+
ahead: z.number().int().nonnegative().nullable(),
|
|
559
|
+
behind: z.number().int().nonnegative().nullable(),
|
|
560
|
+
checks: z.array(PrPreflightCheckSchema),
|
|
561
|
+
});
|
|
562
|
+
/** `pr-create` (#2085): the PR it opened and the preflight checks it passed. */
|
|
563
|
+
export const PrCreateOutputSchema = z.object({
|
|
564
|
+
prUrl: z.string(),
|
|
565
|
+
number: z.number().int().positive(),
|
|
566
|
+
repo: z.string(),
|
|
567
|
+
base: z.string(),
|
|
568
|
+
head: z.string(),
|
|
569
|
+
draft: z.boolean(),
|
|
570
|
+
alreadyExisted: z.boolean(),
|
|
571
|
+
verdict: z.enum(['pass', 'warn', 'fail']),
|
|
572
|
+
accepted: z.array(z.string()),
|
|
573
|
+
checks: z.array(PrPreflightCheckSchema),
|
|
574
|
+
});
|
|
575
|
+
const ForkOwnBranchSchema = z.object({ name: z.string(), prStates: z.array(z.string()) });
|
|
576
|
+
const ForkStringsSchema = z.array(z.string());
|
|
577
|
+
const ForkRowSchema = z.object({
|
|
578
|
+
repo: z.string(),
|
|
579
|
+
parent: z.string().nullable(),
|
|
580
|
+
verdict: z.enum(['PRUNE', 'KEEP']),
|
|
581
|
+
branchCount: z.number().int().nonnegative(),
|
|
582
|
+
openPRsToFork: z.number().int().nonnegative(),
|
|
583
|
+
hasOpenPRFromFork: z.boolean(),
|
|
584
|
+
ownBranches: z.array(ForkOwnBranchSchema),
|
|
585
|
+
reasons: ForkStringsSchema,
|
|
586
|
+
});
|
|
587
|
+
const ForkSkipSchema = z.object({ repo: z.string(), reasons: ForkStringsSchema });
|
|
588
|
+
/** `fork-prune` (#1912): one row per fork, the set digest, and on apply what was deleted or skipped. */
|
|
589
|
+
export const ForkPruneOutputSchema = z.object({
|
|
590
|
+
mode: z.enum(['dry-run', 'apply']),
|
|
591
|
+
login: z.string(),
|
|
592
|
+
forks: z.array(ForkRowSchema),
|
|
593
|
+
prunable: z.number().int().nonnegative(),
|
|
594
|
+
kept: z.number().int().nonnegative(),
|
|
595
|
+
setDigest: z.string(),
|
|
596
|
+
applyCommand: z.string().optional(),
|
|
597
|
+
requests: z.number().int().nonnegative(),
|
|
598
|
+
deleted: ForkStringsSchema.optional(),
|
|
599
|
+
skipped: z.array(ForkSkipSchema).optional(),
|
|
600
|
+
error: z.string().optional(),
|
|
601
|
+
});
|
|
602
|
+
const PolicyBanSchema = z.object({ repo: z.string(), reviewedByUser: z.boolean() });
|
|
486
603
|
export const SearchOutputSchema = z.object({
|
|
487
604
|
candidates: z.array(SearchCandidateSchema),
|
|
488
605
|
excludedRepos: z.array(z.string()),
|
|
489
606
|
aiPolicyBlocklist: z.array(z.string()),
|
|
490
607
|
hiddenOwnPRCount: z.number().int().nonnegative(),
|
|
491
608
|
reposAtCap: z.array(z.string()),
|
|
609
|
+
policyBannedRepos: z.array(PolicyBanSchema).optional(),
|
|
492
610
|
rateLimitWarning: z.string().optional(),
|
|
493
611
|
// Skip file unreadable — search ran with an empty skip list (#1448).
|
|
494
612
|
// Optional: absent on clean runs.
|
|
@@ -592,10 +710,34 @@ export const VerifyIssueOutputSchema = z.object({
|
|
|
592
710
|
verdictReason: z.string(),
|
|
593
711
|
userLogin: z.string(),
|
|
594
712
|
});
|
|
713
|
+
// issue-thread (#1932): one issue's title, body and comments. `title`,
|
|
714
|
+
// `body` and every `comments[].body` are `<github-content>`-fenced strings.
|
|
715
|
+
const IssueThreadCommentSchema = z.object({
|
|
716
|
+
author: z.string().nullable(),
|
|
717
|
+
authorAssociation: z.string().nullable(),
|
|
718
|
+
createdAt: z.string(),
|
|
719
|
+
body: z.string(),
|
|
720
|
+
});
|
|
721
|
+
export const IssueThreadOutputSchema = z.object({
|
|
722
|
+
url: z.string(),
|
|
723
|
+
owner: z.string(),
|
|
724
|
+
repo: z.string(),
|
|
725
|
+
number: z.number().int().positive(),
|
|
726
|
+
state: z.string(),
|
|
727
|
+
title: z.string(),
|
|
728
|
+
author: z.string().nullable(),
|
|
729
|
+
authorAssociation: z.string().nullable(),
|
|
730
|
+
createdAt: z.string(),
|
|
731
|
+
body: z.string(),
|
|
732
|
+
comments: z.array(IssueThreadCommentSchema),
|
|
733
|
+
warnings: z.array(DailyWarningSchema).optional(),
|
|
734
|
+
});
|
|
595
735
|
// ── #1155: Zod coverage for remaining CLI commands ───────────────────
|
|
596
736
|
export const PostOutputSchema = z.object({
|
|
597
737
|
commentUrl: z.string(),
|
|
598
738
|
url: z.string(),
|
|
739
|
+
// Posted with --allow-script-mismatch over a script mismatch (#1909). Absent otherwise.
|
|
740
|
+
scriptMismatchWarning: z.string().optional(),
|
|
599
741
|
});
|
|
600
742
|
export const ClaimOutputSchema = z.object({
|
|
601
743
|
commentUrl: z.string(),
|
|
@@ -605,6 +747,8 @@ export const ClaimOutputSchema = z.object({
|
|
|
605
747
|
// Claim comment posted but local state save threw — claim is live but
|
|
606
748
|
// untracked (#1448). Optional: absent on clean runs.
|
|
607
749
|
stateSaveWarning: z.string().optional(),
|
|
750
|
+
// Claimed with --allow-script-mismatch over a script mismatch (#1909). Absent otherwise.
|
|
751
|
+
scriptMismatchWarning: z.string().optional(),
|
|
608
752
|
});
|
|
609
753
|
export const InitOutputSchema = z.object({
|
|
610
754
|
username: z.string(),
|
|
@@ -626,6 +770,7 @@ export const WorkFinishOutputSchema = z.object({
|
|
|
626
770
|
});
|
|
627
771
|
export const WorkReleaseOutputSchema = z.object({
|
|
628
772
|
released: z.array(z.string()),
|
|
773
|
+
recordedPR: z.string().optional(),
|
|
629
774
|
gistSyncWarning: z.string().optional(),
|
|
630
775
|
});
|
|
631
776
|
export const WorkListOutputSchema = z.object({
|
|
@@ -688,11 +833,15 @@ export const SetupOutputSchema = z.union([SetupSetOutputSchema, SetupCompleteOut
|
|
|
688
833
|
const ConfigKeyDefSchema = z.object({}).passthrough();
|
|
689
834
|
const ConfigGetOutputSchema = z.object({
|
|
690
835
|
config: z.record(z.string(), z.unknown()),
|
|
836
|
+
// Where each machine-local path shown comes from (#1950, #2010).
|
|
837
|
+
machinePathSources: z.record(z.string(), z.string()).optional(),
|
|
691
838
|
});
|
|
692
839
|
const ConfigSetOutputSchema = z.object({
|
|
693
840
|
success: z.literal(true),
|
|
694
841
|
key: z.string(),
|
|
695
842
|
value: z.string(),
|
|
843
|
+
// Setup's warnings when a setup-scoped key is set through config (#1913).
|
|
844
|
+
warnings: z.array(z.string()).optional(),
|
|
696
845
|
// Post-mutation Gist checkpoint failure (#1440). Optional: absent on clean runs.
|
|
697
846
|
gistSyncWarning: z.string().optional(),
|
|
698
847
|
});
|
|
@@ -792,6 +941,12 @@ export const RepoVetOutputSchema = z.object({
|
|
|
792
941
|
* stored score into a hard --json contract throw (#1465 review).
|
|
793
942
|
*/
|
|
794
943
|
historyScore: z.number().optional(),
|
|
944
|
+
/**
|
|
945
|
+
* The repo's contribution policy (#1953): the user's record, else what this
|
|
946
|
+
* run read from CONTRIBUTING and the PR template; the blocklist reads as a
|
|
947
|
+
* ban. Not stored (`vet` stores it). Absent when nothing is known.
|
|
948
|
+
*/
|
|
949
|
+
policy: RepoPolicySummarySchema.optional(),
|
|
795
950
|
});
|
|
796
951
|
const ComplianceCheckSchema = z.object({
|
|
797
952
|
status: z.enum(['pass', 'warn', 'fail']),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
"@octokit/plugin-throttling": "^11.0.5",
|
|
57
57
|
"@octokit/rest": "^22.0.1",
|
|
58
58
|
"@oss-scout/core": "^1.14.2",
|
|
59
|
-
"commander": "^15.
|
|
59
|
+
"commander": "^15.1.0",
|
|
60
60
|
"zod": "^4.6.7"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@types/node": "^26.
|
|
64
|
-
"@vitest/coverage-v8": "^5.
|
|
63
|
+
"@types/node": "^26.6.6",
|
|
64
|
+
"@vitest/coverage-v8": "^5.1.1",
|
|
65
65
|
"esbuild": "^0.28.2",
|
|
66
|
-
"tsx": "^4.23.
|
|
66
|
+
"tsx": "^4.23.15",
|
|
67
67
|
"typedoc": "^0.28.20",
|
|
68
68
|
"typescript": "^6.0.3",
|
|
69
|
-
"vitest": "^5.
|
|
69
|
+
"vitest": "^5.1.1"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsc",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CI-enforced tool detection (#1286).
|
|
3
|
-
*
|
|
4
|
-
* Extracted from `workflows/pre-commit-review.md` Steps 2b and 6a so
|
|
5
|
-
* the same logic isn't reimplemented twice in markdown. Callers
|
|
6
|
-
* supply pre-fetched config snippets (the workflow runs `cat` /
|
|
7
|
-
* `head` against the well-known files); this function does the
|
|
8
|
-
* structured parse.
|
|
9
|
-
*
|
|
10
|
-
* Pure typed helper — no I/O.
|
|
11
|
-
*/
|
|
12
|
-
export type CIToolName = 'lint' | 'format' | 'typecheck' | 'test' | 'build' | 'commit-format' | 'security-scan';
|
|
13
|
-
export interface CIEnforcedToolsInput {
|
|
14
|
-
/** `.pre-commit-config.yaml` contents, or null when the file is missing. */
|
|
15
|
-
preCommitConfigYaml: string | null;
|
|
16
|
-
/** Concatenated contents of `.github/workflows/*.yml` (or null when none). */
|
|
17
|
-
workflowYamls: string | null;
|
|
18
|
-
/** `Makefile` contents, or null when missing. */
|
|
19
|
-
makefile: string | null;
|
|
20
|
-
/** `package.json` contents — used to detect script names. */
|
|
21
|
-
packageJson: string | null;
|
|
22
|
-
}
|
|
23
|
-
export interface CIEnforcedTool {
|
|
24
|
-
tool: CIToolName;
|
|
25
|
-
source: 'pre-commit' | 'github-workflow' | 'makefile' | 'package-json';
|
|
26
|
-
/** Short snippet that surfaced this tool — useful for explainability. */
|
|
27
|
-
evidence: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Detect which class of tool each input source enforces. The output
|
|
31
|
-
* may contain duplicates (e.g., `test` enforced by both pre-commit
|
|
32
|
-
* and a GitHub workflow); callers can dedupe on `tool` or display
|
|
33
|
-
* each evidence pair separately.
|
|
34
|
-
*/
|
|
35
|
-
export declare function getCIEnforcedTools(input: CIEnforcedToolsInput): CIEnforcedTool[];
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CI-enforced tool detection (#1286).
|
|
3
|
-
*
|
|
4
|
-
* Extracted from `workflows/pre-commit-review.md` Steps 2b and 6a so
|
|
5
|
-
* the same logic isn't reimplemented twice in markdown. Callers
|
|
6
|
-
* supply pre-fetched config snippets (the workflow runs `cat` /
|
|
7
|
-
* `head` against the well-known files); this function does the
|
|
8
|
-
* structured parse.
|
|
9
|
-
*
|
|
10
|
-
* Pure typed helper — no I/O.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Detect which class of tool each input source enforces. The output
|
|
14
|
-
* may contain duplicates (e.g., `test` enforced by both pre-commit
|
|
15
|
-
* and a GitHub workflow); callers can dedupe on `tool` or display
|
|
16
|
-
* each evidence pair separately.
|
|
17
|
-
*/
|
|
18
|
-
export function getCIEnforcedTools(input) {
|
|
19
|
-
const out = [];
|
|
20
|
-
if (input.preCommitConfigYaml) {
|
|
21
|
-
detectFromHaystack(input.preCommitConfigYaml, 'pre-commit', out);
|
|
22
|
-
}
|
|
23
|
-
if (input.workflowYamls) {
|
|
24
|
-
detectFromHaystack(input.workflowYamls, 'github-workflow', out);
|
|
25
|
-
}
|
|
26
|
-
if (input.makefile) {
|
|
27
|
-
detectFromHaystack(input.makefile, 'makefile', out);
|
|
28
|
-
}
|
|
29
|
-
if (input.packageJson) {
|
|
30
|
-
detectScriptsFromPackageJson(input.packageJson, out);
|
|
31
|
-
}
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
function detectFromHaystack(haystack, source, out) {
|
|
35
|
-
const lower = haystack.toLowerCase();
|
|
36
|
-
const checks = [
|
|
37
|
-
{
|
|
38
|
-
tool: 'lint',
|
|
39
|
-
pattern: /\b(?:eslint|biome|ruff|flake8|rubocop|golangci-lint|clippy|pylint)\b/i,
|
|
40
|
-
evidenceFor: ['eslint', 'biome', 'ruff', 'flake8', 'rubocop', 'golangci-lint', 'clippy', 'pylint'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
tool: 'format',
|
|
44
|
-
pattern: /\b(?:prettier|biome[\s-]+format|black|gofmt|rustfmt|clang-format)\b/i,
|
|
45
|
-
evidenceFor: ['prettier', 'biome', 'black', 'gofmt', 'rustfmt', 'clang-format'],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
tool: 'typecheck',
|
|
49
|
-
pattern: /\b(?:tsc|mypy|sorbet|pyright|flow)\b/i,
|
|
50
|
-
evidenceFor: ['tsc', 'mypy', 'sorbet', 'pyright', 'flow'],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
tool: 'test',
|
|
54
|
-
pattern: /\b(?:vitest|jest|pytest|rspec|go test|cargo test|mocha)\b/i,
|
|
55
|
-
evidenceFor: ['vitest', 'jest', 'pytest', 'rspec', 'go test', 'cargo test', 'mocha'],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
// `tsc` alone (or `tsc --noEmit`) is a typecheck, not a build artifact
|
|
59
|
-
// step — keep it out of this pattern so a workflow with only
|
|
60
|
-
// `tsc --noEmit` doesn't fire BOTH `typecheck` and `build`. Real
|
|
61
|
-
// build steps that do produce artifacts (tsup, esbuild, webpack,
|
|
62
|
-
// cargo build, go build) stay here.
|
|
63
|
-
tool: 'build',
|
|
64
|
-
pattern: /\b(?:tsup|esbuild|webpack|cargo build|go build)\b/i,
|
|
65
|
-
evidenceFor: ['tsup', 'esbuild', 'webpack', 'cargo build', 'go build'],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
tool: 'commit-format',
|
|
69
|
-
pattern: /\b(?:commitlint|conventional-commits)\b/i,
|
|
70
|
-
evidenceFor: ['commitlint', 'conventional-commits'],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
tool: 'security-scan',
|
|
74
|
-
pattern: /\b(?:codeql|semgrep|trivy|gitleaks|snyk)\b/i,
|
|
75
|
-
evidenceFor: ['codeql', 'semgrep', 'trivy', 'gitleaks', 'snyk'],
|
|
76
|
-
},
|
|
77
|
-
];
|
|
78
|
-
for (const c of checks) {
|
|
79
|
-
if (c.pattern.test(lower)) {
|
|
80
|
-
const evidence = c.evidenceFor.find((e) => lower.includes(e)) ?? c.tool;
|
|
81
|
-
out.push({ tool: c.tool, source, evidence });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function detectScriptsFromPackageJson(packageJson, out) {
|
|
86
|
-
let parsed;
|
|
87
|
-
try {
|
|
88
|
-
parsed = JSON.parse(packageJson);
|
|
89
|
-
}
|
|
90
|
-
catch {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const scripts = parsed.scripts ?? {};
|
|
94
|
-
const scriptToTool = [
|
|
95
|
-
{ key: /^lint(:|$)/, tool: 'lint' },
|
|
96
|
-
{ key: /^format(:|$)/, tool: 'format' },
|
|
97
|
-
{ key: /^typecheck(:|$)|^tsc(:|$)/, tool: 'typecheck' },
|
|
98
|
-
{ key: /^test(:|$)/, tool: 'test' },
|
|
99
|
-
{ key: /^build(:|$)/, tool: 'build' },
|
|
100
|
-
];
|
|
101
|
-
for (const [name] of Object.entries(scripts)) {
|
|
102
|
-
for (const m of scriptToTool) {
|
|
103
|
-
if (m.key.test(name)) {
|
|
104
|
-
out.push({ tool: m.tool, source: 'package-json', evidence: `scripts.${name}` });
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Post-push comment decision (#1286).
|
|
3
|
-
*
|
|
4
|
-
* Centralizes the "should I draft a comment, or does the diff speak
|
|
5
|
-
* for itself?" rule that was duplicated between
|
|
6
|
-
* `workflows/pre-commit-review.md` Step 7a and `agents/pr-responder.md`
|
|
7
|
-
* Step 3.
|
|
8
|
-
*
|
|
9
|
-
* Pure typed helper — no LLM, no I/O. Callers do the upstream natural-
|
|
10
|
-
* language classification (mapping a maintainer comment to a structured
|
|
11
|
-
* `FeedbackCategory` + flags) and pass in the result. This module owns
|
|
12
|
-
* the rule that decides skip vs. draft from the structured input.
|
|
13
|
-
*
|
|
14
|
-
* Same architectural shape as #1245 (compliance-score), #1242 (repo-vet),
|
|
15
|
-
* #1243 (strategy), #1252 (pr-quality-rubric), and #1264 (issue-effort /
|
|
16
|
-
* maintainer-hints).
|
|
17
|
-
*/
|
|
18
|
-
export type FeedbackCategory = 'code_request' | 'question' | 'explanation_request' | 'style_request' | 'design_discussion' | 'approval_with_nit' | 'formatting_complaint'
|
|
19
|
-
/**
|
|
20
|
-
* A maintainer comment whose main content is thanks or praise (not a polite
|
|
21
|
-
* opener on a request); always gets a short acknowledgment (#1852).
|
|
22
|
-
*/
|
|
23
|
-
| 'appreciation';
|
|
24
|
-
export interface FeedbackClassification {
|
|
25
|
-
category: FeedbackCategory;
|
|
26
|
-
/**
|
|
27
|
-
* Whether this individual feedback item, considered in isolation,
|
|
28
|
-
* requires a drafted comment. Aggregated by `shouldDraftResponse`
|
|
29
|
-
* across the full feedback list.
|
|
30
|
-
*/
|
|
31
|
-
needsComment: boolean;
|
|
32
|
-
/** Short rationale rendered alongside the decision. */
|
|
33
|
-
reason: string;
|
|
34
|
-
}
|
|
35
|
-
export interface CommentDecisionInput {
|
|
36
|
-
/**
|
|
37
|
-
* Pre-classified feedback items in chronological order. The caller
|
|
38
|
-
* (agent or workflow) is responsible for the natural-language
|
|
39
|
-
* categorization step; this function only consumes structured input.
|
|
40
|
-
*/
|
|
41
|
-
feedback: readonly FeedbackClassification[];
|
|
42
|
-
/**
|
|
43
|
-
* True when the contributor pushed code that addresses every
|
|
44
|
-
* feedback item that requested a code change. The agent's diff
|
|
45
|
-
* inspection determines this; the function trusts the boolean.
|
|
46
|
-
*/
|
|
47
|
-
allRequestedChangesAddressed: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface CommentDecisionResult {
|
|
50
|
-
shouldDraft: boolean;
|
|
51
|
-
reason: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Decide whether the contributor should draft a comment after a push.
|
|
55
|
-
*
|
|
56
|
-
* Rule (sourced verbatim from `workflows/pre-commit-review.md` Step 7a
|
|
57
|
-
* and `agents/pr-responder.md` "Comment Decision Logic"):
|
|
58
|
-
*
|
|
59
|
-
* - Skip the comment entirely when ALL of these are true:
|
|
60
|
-
* 1. Every piece of maintainer feedback that requested code changes
|
|
61
|
-
* has a corresponding code change.
|
|
62
|
-
* 2. No question was asked and no maintainer thanks or praise is
|
|
63
|
-
* waiting for an acknowledgment.
|
|
64
|
-
* 3. Nothing was intentionally left unchanged (a "yes the maintainer
|
|
65
|
-
* asked but I did not change it" item always needs explanation).
|
|
66
|
-
* 4. The diff makes the fix self-evident — modeled here as the
|
|
67
|
-
* `allRequestedChangesAddressed` flag the caller passes in.
|
|
68
|
-
*
|
|
69
|
-
* - Draft a comment if ANY of these are true:
|
|
70
|
-
* 1. The maintainer asked a question, or thanked or praised the
|
|
71
|
-
* contributor (#1852).
|
|
72
|
-
* 2. The feedback is conceptual or design-level (the diff alone
|
|
73
|
-
* cannot answer "why").
|
|
74
|
-
* 3. Something was intentionally left unchanged (`needsComment: true`
|
|
75
|
-
* on a code-request item where the contributor disagrees).
|
|
76
|
-
* 4. Only some of multiple requested changes were addressed.
|
|
77
|
-
* 5. The contributor deviated from exactly what was asked.
|
|
78
|
-
*/
|
|
79
|
-
export declare function shouldDraftResponse(input: CommentDecisionInput): CommentDecisionResult;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Post-push comment decision (#1286).
|
|
3
|
-
*
|
|
4
|
-
* Centralizes the "should I draft a comment, or does the diff speak
|
|
5
|
-
* for itself?" rule that was duplicated between
|
|
6
|
-
* `workflows/pre-commit-review.md` Step 7a and `agents/pr-responder.md`
|
|
7
|
-
* Step 3.
|
|
8
|
-
*
|
|
9
|
-
* Pure typed helper — no LLM, no I/O. Callers do the upstream natural-
|
|
10
|
-
* language classification (mapping a maintainer comment to a structured
|
|
11
|
-
* `FeedbackCategory` + flags) and pass in the result. This module owns
|
|
12
|
-
* the rule that decides skip vs. draft from the structured input.
|
|
13
|
-
*
|
|
14
|
-
* Same architectural shape as #1245 (compliance-score), #1242 (repo-vet),
|
|
15
|
-
* #1243 (strategy), #1252 (pr-quality-rubric), and #1264 (issue-effort /
|
|
16
|
-
* maintainer-hints).
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Decide whether the contributor should draft a comment after a push.
|
|
20
|
-
*
|
|
21
|
-
* Rule (sourced verbatim from `workflows/pre-commit-review.md` Step 7a
|
|
22
|
-
* and `agents/pr-responder.md` "Comment Decision Logic"):
|
|
23
|
-
*
|
|
24
|
-
* - Skip the comment entirely when ALL of these are true:
|
|
25
|
-
* 1. Every piece of maintainer feedback that requested code changes
|
|
26
|
-
* has a corresponding code change.
|
|
27
|
-
* 2. No question was asked and no maintainer thanks or praise is
|
|
28
|
-
* waiting for an acknowledgment.
|
|
29
|
-
* 3. Nothing was intentionally left unchanged (a "yes the maintainer
|
|
30
|
-
* asked but I did not change it" item always needs explanation).
|
|
31
|
-
* 4. The diff makes the fix self-evident — modeled here as the
|
|
32
|
-
* `allRequestedChangesAddressed` flag the caller passes in.
|
|
33
|
-
*
|
|
34
|
-
* - Draft a comment if ANY of these are true:
|
|
35
|
-
* 1. The maintainer asked a question, or thanked or praised the
|
|
36
|
-
* contributor (#1852).
|
|
37
|
-
* 2. The feedback is conceptual or design-level (the diff alone
|
|
38
|
-
* cannot answer "why").
|
|
39
|
-
* 3. Something was intentionally left unchanged (`needsComment: true`
|
|
40
|
-
* on a code-request item where the contributor disagrees).
|
|
41
|
-
* 4. Only some of multiple requested changes were addressed.
|
|
42
|
-
* 5. The contributor deviated from exactly what was asked.
|
|
43
|
-
*/
|
|
44
|
-
export function shouldDraftResponse(input) {
|
|
45
|
-
if (input.feedback.length === 0) {
|
|
46
|
-
return { shouldDraft: false, reason: 'no maintainer feedback to address' };
|
|
47
|
-
}
|
|
48
|
-
// Categories that always demand a written reply, regardless of the
|
|
49
|
-
// diff. The diff cannot answer a question, carry a design decision, or
|
|
50
|
-
// acknowledge a maintainer's thanks.
|
|
51
|
-
const alwaysDraftCategories = new Set([
|
|
52
|
-
'question',
|
|
53
|
-
'explanation_request',
|
|
54
|
-
'design_discussion',
|
|
55
|
-
'appreciation',
|
|
56
|
-
]);
|
|
57
|
-
for (const item of input.feedback) {
|
|
58
|
-
if (alwaysDraftCategories.has(item.category)) {
|
|
59
|
-
return {
|
|
60
|
-
shouldDraft: true,
|
|
61
|
-
reason: `${item.category.replaceAll('_', ' ')} needs a written reply the diff cannot give`,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Caller flagged at least one item as "I'm intentionally not making
|
|
66
|
-
// this change" or "I deviated" — needs an explanation either way.
|
|
67
|
-
const intentionalGap = input.feedback.find((item) => item.needsComment);
|
|
68
|
-
if (intentionalGap) {
|
|
69
|
-
return {
|
|
70
|
-
shouldDraft: true,
|
|
71
|
-
reason: `requires written explanation: ${intentionalGap.reason}`,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Caller signaled the diff covers everything that was requested.
|
|
75
|
-
if (input.allRequestedChangesAddressed) {
|
|
76
|
-
return { shouldDraft: false, reason: 'all requested changes are visible in the diff' };
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
shouldDraft: true,
|
|
80
|
-
reason: 'not all requested changes are visible in the diff yet',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-repo extraction category configuration (#1284).
|
|
3
|
-
*
|
|
4
|
-
* The `extract-learnings` MCP prompt produces a structured markdown
|
|
5
|
-
* document organized into category sections. The default category
|
|
6
|
-
* set is sensible for typical web/library OSS work; specialized
|
|
7
|
-
* repos (security-focused, performance-critical, accessibility-
|
|
8
|
-
* forward) benefit from a tailored taxonomy.
|
|
9
|
-
*
|
|
10
|
-
* This module is the single source of truth for:
|
|
11
|
-
* - The default category list.
|
|
12
|
-
* - Validation of custom category lists (non-empty, no duplicates,
|
|
13
|
-
* reasonable string lengths).
|
|
14
|
-
* - Resolution: given a repo's optional override, produce the list
|
|
15
|
-
* of categories the prompt and the storage layer should use.
|
|
16
|
-
*
|
|
17
|
-
* Pure typed helper — no I/O. Same architectural shape as the recent
|
|
18
|
-
* #1252 / #1264 / #1286 / #1279 / #1277 extractions.
|
|
19
|
-
*
|
|
20
|
-
* Out of scope (deferred per #1284):
|
|
21
|
-
* - Wiring `categories` into the `guidelines store` / `guidelines view`
|
|
22
|
-
* shape so the override persists alongside the markdown.
|
|
23
|
-
* - Updating the `extract-learnings` MCP prompt to consume the
|
|
24
|
-
* resolved category list at run time.
|
|
25
|
-
* - Detecting repo type from signals (SECURITY.md presence, repo
|
|
26
|
-
* topics, etc.) to suggest categories.
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* The default category list used by `extract-learnings` when no
|
|
30
|
-
* per-repo override is configured. Order matters: the prompt
|
|
31
|
-
* renders sections in this order, so `Code Style` first /
|
|
32
|
-
* `Other` last is the established convention.
|
|
33
|
-
*/
|
|
34
|
-
export declare const DEFAULT_EXTRACTION_CATEGORIES: readonly string[];
|
|
35
|
-
export interface CategoryValidationResult {
|
|
36
|
-
ok: boolean;
|
|
37
|
-
/** Non-empty when ok === false. One issue per detected problem. */
|
|
38
|
-
errors: string[];
|
|
39
|
-
/** The list as a caller should persist it, with `Other` appended
|
|
40
|
-
* if the user forgot it (the prompt always needs an "everything
|
|
41
|
-
* else" bucket). Only populated when ok === true. */
|
|
42
|
-
normalized?: readonly string[];
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Validate a user-supplied category list. Returns a structured
|
|
46
|
-
* result rather than throwing — the CLI / slash-command callers
|
|
47
|
-
* surface error strings inline.
|
|
48
|
-
*/
|
|
49
|
-
export declare function validateCategories(input: readonly string[]): CategoryValidationResult;
|
|
50
|
-
/**
|
|
51
|
-
* Resolve the categories the prompt + storage layer should use for a
|
|
52
|
-
* specific extraction. Falls back to the default list when no
|
|
53
|
-
* override is supplied or when the override fails validation.
|
|
54
|
-
*/
|
|
55
|
-
export declare function resolveCategories(override: readonly string[] | undefined | null): readonly string[];
|