@oss-autopilot/core 3.37.0 → 3.39.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.
Files changed (78) hide show
  1. package/dist/cli-registry.js +7 -4
  2. package/dist/cli.bundle.cjs +134 -127
  3. package/dist/commands/comments.js +4 -3
  4. package/dist/commands/config.js +18 -11
  5. package/dist/commands/daily-dismiss-filter.d.ts +37 -0
  6. package/dist/commands/daily-dismiss-filter.js +80 -0
  7. package/dist/commands/daily-merged-pr-notes.d.ts +27 -0
  8. package/dist/commands/daily-merged-pr-notes.js +166 -0
  9. package/dist/commands/daily-reviewed-prs.d.ts +41 -0
  10. package/dist/commands/daily-reviewed-prs.js +270 -0
  11. package/dist/commands/daily-warnings.d.ts +28 -0
  12. package/dist/commands/daily-warnings.js +37 -0
  13. package/dist/commands/daily.d.ts +22 -1
  14. package/dist/commands/daily.js +299 -108
  15. package/dist/commands/dashboard-cache.js +9 -2
  16. package/dist/commands/dashboard-data.js +40 -20
  17. package/dist/commands/dashboard-gist-sync.d.ts +9 -1
  18. package/dist/commands/dashboard-gist-sync.js +24 -3
  19. package/dist/commands/dashboard-server.js +9 -5
  20. package/dist/commands/dismiss.d.ts +25 -5
  21. package/dist/commands/dismiss.js +40 -11
  22. package/dist/commands/guidelines.js +21 -14
  23. package/dist/commands/init.js +3 -2
  24. package/dist/commands/ledger-backfill.js +4 -3
  25. package/dist/commands/move.js +9 -6
  26. package/dist/commands/overnight-push-prep.js +5 -2
  27. package/dist/commands/overnight.js +62 -24
  28. package/dist/commands/scout-bridge.js +4 -1
  29. package/dist/commands/search.js +9 -6
  30. package/dist/commands/setup.js +7 -3
  31. package/dist/commands/validation.d.ts +11 -0
  32. package/dist/commands/validation.js +38 -0
  33. package/dist/core/checklist-analysis.js +34 -0
  34. package/dist/core/closed-pr-status.d.ts +73 -0
  35. package/dist/core/closed-pr-status.js +113 -0
  36. package/dist/core/comment-decision.d.ts +10 -3
  37. package/dist/core/comment-decision.js +13 -5
  38. package/dist/core/comment-utils.d.ts +38 -1
  39. package/dist/core/comment-utils.js +124 -1
  40. package/dist/core/concurrency.d.ts +6 -0
  41. package/dist/core/concurrency.js +13 -0
  42. package/dist/core/daily-logic.d.ts +13 -1
  43. package/dist/core/daily-logic.js +59 -2
  44. package/dist/core/engaged-issues.d.ts +93 -0
  45. package/dist/core/engaged-issues.js +183 -0
  46. package/dist/core/errors.d.ts +4 -0
  47. package/dist/core/errors.js +11 -1
  48. package/dist/core/eval-report.d.ts +9 -0
  49. package/dist/core/eval-report.js +4 -0
  50. package/dist/core/gist-state-store.d.ts +5 -2
  51. package/dist/core/gist-state-store.js +7 -4
  52. package/dist/core/github-stats.d.ts +10 -0
  53. package/dist/core/github-stats.js +35 -0
  54. package/dist/core/index.d.ts +10 -5
  55. package/dist/core/index.js +9 -4
  56. package/dist/core/issue-conversation.d.ts +83 -12
  57. package/dist/core/issue-conversation.js +306 -118
  58. package/dist/core/merged-pr-notes.d.ts +192 -0
  59. package/dist/core/merged-pr-notes.js +340 -0
  60. package/dist/core/pick-snapshot.js +1 -1
  61. package/dist/core/pr-assembly.js +3 -0
  62. package/dist/core/pr-monitor.d.ts +62 -0
  63. package/dist/core/pr-monitor.js +113 -3
  64. package/dist/core/reviewed-prs-fetch.d.ts +91 -0
  65. package/dist/core/reviewed-prs-fetch.js +271 -0
  66. package/dist/core/reviewed-prs.d.ts +244 -0
  67. package/dist/core/reviewed-prs.js +380 -0
  68. package/dist/core/state-persistence.js +8 -24
  69. package/dist/core/state-schema.d.ts +6 -0
  70. package/dist/core/state-schema.js +9 -0
  71. package/dist/core/state.d.ts +106 -11
  72. package/dist/core/state.js +246 -24
  73. package/dist/core/types.d.ts +47 -0
  74. package/dist/core/urls.d.ts +13 -0
  75. package/dist/core/urls.js +16 -0
  76. package/dist/formatters/json.d.ts +186 -1
  77. package/dist/formatters/json.js +78 -0
  78. package/package.json +1 -1
@@ -8,11 +8,11 @@ export { GistStateStore } from './gist-state-store.js';
8
8
  export { guidelinesFilename, repoFromGuidelinesFilename, GUIDELINES_FILE_PREFIX, GUIDELINES_MAX_BYTES, GuidelinesNotAvailableError, GuidelinesTooLargeError, } from './guidelines-store.js';
9
9
  export { PRMonitor, computeDisplayLabel, classifyCICheck, classifyFailingChecks, } from './pr-monitor.js';
10
10
  // Search/vetting now delegated to @oss-scout/core via commands/scout-bridge.ts
11
- export { IssueConversationMonitor } from './issue-conversation.js';
12
- export { isBotAuthor, isAcknowledgmentComment } from './comment-utils.js';
11
+ export { IssueConversationMonitor, MAX_DIRECT_ENGAGED_FETCHES, } from './issue-conversation.js';
12
+ export { isBotAuthor, isAcknowledgmentComment, isReactionOnlyComment, isQuoteReplyTo, isStatusNudge, } from './comment-utils.js';
13
13
  export { wrapUntrustedContent, fenceFetchedPR, fenceFetchedPRTitles, labelGuidelinesContent, GUIDELINES_PROVENANCE_NOTE, extractFromFence, safeExtractFromFence, UNTRUSTED_OPEN_TAG_NAME, UNTRUSTED_CLOSE_TAG, } from './untrusted-content.js';
14
14
  export { getOctokit, checkRateLimit } from './github.js';
15
- export { parseGitHubUrl, splitRepo, isOwnRepo } from './urls.js';
15
+ export { parseGitHubUrl, issueRefKey, splitRepo, isOwnRepo } from './urls.js';
16
16
  export { daysBetween, formatRelativeTime, byDateDescending } from './dates.js';
17
17
  export { getCLIVersion, getDataDir, resolveDataDir, getStatePath, getBackupDir, getCacheDir, stateFileExists, } from './paths.js';
18
18
  export { getGitHubToken, getGitHubTokenAsync, requireGitHubToken, resetGitHubTokenCache, detectGitHubUsername, } from './auth.js';
@@ -20,8 +20,13 @@ export { DEFAULT_CONCURRENCY } from './concurrency.js';
20
20
  export { OssAutopilotError, ConfigurationError, ValidationError, GistPermissionError, ConcurrencyError, GistConcurrencyError, GistFileSizeError, GIST_FILE_SIZE_REMEDY, errorMessage, getHttpStatusCode, isRateLimitError, isRateLimitOrAuthError, nonFatalCatch, resolveErrorCode, } from './errors.js';
21
21
  export { enableDebug, isDebugEnabled, debug, info, warn, timed } from './logger.js';
22
22
  export { HttpCache, getHttpCache, cachedRequest } from './http-cache.js';
23
- export { CRITICAL_STATUSES, applyStatusOverrides, computeRepoSignals, computeLedgerRepoSignals, groupPRsByRepo, assessCapacity, collectActionableIssues, computeActionMenu, toShelvedPRRef, buildStarFilter, firstMaintainerResponseFromDigest, lastReviewStateFromDigest, formatActionHint, formatBriefSummary, formatSummary, printDigest, } from './daily-logic.js';
23
+ export { CRITICAL_STATUSES, applyStatusOverrides, computeRepoSignals, computeLedgerRepoSignals, groupPRsByRepo, assessCapacity, collectActionableIssues, computeActionMenu, isCoveredByDismiss, toShelvedPRRef, buildStarFilter, firstMaintainerResponseFromDigest, lastReviewStateFromDigest, formatActionHint, formatBriefSummary, formatSummary, printDigest, } from './daily-logic.js';
24
+ export { collectEngagedIssues, toIssueEngagement, LEDGER_LINK_MAX_AGE_DAYS, } from './engaged-issues.js';
24
25
  export { computeContributionStats } from './stats.js';
26
+ export { selectClosedPRStatusCandidates, toClosedPRStatusUpdate, CLOSED_PR_STATUS_WINDOW_DAYS, } from './closed-pr-status.js';
27
+ export { collectMergedPRNotes, groupThanksOnlyAcknowledgments, isThanksOnlyNote, latestNoteAt, omitAcknowledgedViaCarrier, scanMergedPR, MERGED_PR_NOTES_PRE_MERGE_GRACE_MS, } from './merged-pr-notes.js';
28
+ export { scanReviewedPR, REVIEWED_PR_MAX_COMMITS, REVIEWED_PR_MAX_QUESTIONS, } from './reviewed-prs.js';
29
+ export { REVIEWED_PR_SEARCH_MAX_PAGES, } from './reviewed-prs-fetch.js';
25
30
  export { fetchPRTemplate } from './pr-template.js';
26
31
  export { classifyLinkedPR, isLinkedPRStalled, STALLED_PR_THRESHOLD_DAYS, } from './linked-pr-classification.js';
27
32
  export { classifyIssueAvailability, fetchIssueVerification, verifyIssuesBatch, MAX_VERIFY_CONCURRENCY, RULED_OUT_VERDICTS, } from './issue-verification.js';
@@ -1,29 +1,100 @@
1
1
  /**
2
- * Issue Conversation Monitor — tracks issues the user has commented on
3
- * and detects maintainer responses that need attention.
2
+ * Issue Conversation Monitor — tracks issues the user has commented on or is
3
+ * working on, and detects replies that need attention.
4
4
  *
5
5
  * Follows the same pattern as PRMonitor: stateless fetch from GitHub,
6
6
  * bounded concurrency via worker pool, bot/acknowledgment filtering.
7
+ *
8
+ * Two reply rules apply (#1862):
9
+ * - On an issue the user only commented on in passing, a reply counts when
10
+ * it is directed at the user: from a maintainer (OWNER / MEMBER /
11
+ * COLLABORATOR), @mentions the user, or quotes the user's comment (#343).
12
+ * - On an engaged issue (claimed, or linked from one of the user's PRs; see
13
+ * `collectEngagedIssues`), any substantive non-bot comment after the
14
+ * user's last word counts, and so does anything directed at the user even
15
+ * when short (a maintainer's "any update?"). Short thanks and "+1" /
16
+ * emoji-only reactions do not, except that a bare status request on a
17
+ * claimed issue is addressed to the claimant and counts. Engaged issues
18
+ * the comment search does not return (the user never commented, or not
19
+ * within the window) are fetched directly, up to
20
+ * {@link MAX_DIRECT_ENGAGED_FETCHES} per run.
7
21
  */
8
22
  import type { CommentedIssue } from './types.js';
23
+ import { type EngagedIssue } from './engaged-issues.js';
24
+ /**
25
+ * Most engaged issues fetched directly per run when the comment search
26
+ * misses them (#1862). Each costs one issue lookup plus its comment pages,
27
+ * all ETag-cached, so a quiet day is mostly 304s; the cap bounds a first run
28
+ * for a user with many open claims. Strongest engagements come first, so
29
+ * the open-PR and claim issues are the ones kept.
30
+ */
31
+ export declare const MAX_DIRECT_ENGAGED_FETCHES = 25;
32
+ export interface FetchCommentedIssuesOptions {
33
+ /** Window for the comment search, in days (default 30). */
34
+ maxDays?: number;
35
+ /** The user's engaged issues (#1862); see `collectEngagedIssues`. */
36
+ engaged?: ReadonlyMap<string, EngagedIssue>;
37
+ }
38
+ export interface FetchCommentedIssuesResult {
39
+ issues: CommentedIssue[];
40
+ failures: Array<{
41
+ issueUrl: string;
42
+ error: string;
43
+ }>;
44
+ /**
45
+ * Non-fatal notices for the run's warning channel: the direct-fetch cap,
46
+ * a claimed or open-PR issue that is gone, a comment thread too long to
47
+ * read to the end, an engagement time that does not parse.
48
+ */
49
+ warnings: string[];
50
+ }
9
51
  export declare class IssueConversationMonitor {
10
52
  private octokit;
11
53
  private stateManager;
12
54
  constructor(githubToken: string);
13
55
  /**
14
- * Fetch issues the user has commented on and determine conversation state.
15
- * Filters out: user-authored issues, user-owned repos, excluded repos/orgs,
16
- * AI policy blocklisted repos, already-tracked issues, and pull requests.
56
+ * Whether the configured user commented on `issueUrl` at or after `since`
57
+ * (#1863). Backs the closed-PR status nudge: once the user has told the
58
+ * linked issue what happened, the nudge drops out. GitHub's `since` filter
59
+ * keys on `updated_at`, so an old comment edited after the close would
60
+ * come back too; `created_at` is re-checked to count only new comments.
61
+ *
62
+ * @throws {ConfigurationError} If no GitHub username is configured
63
+ * @throws {ValidationError} If `issueUrl` is not a GitHub issue URL
17
64
  */
18
- fetchCommentedIssues(maxDays?: number): Promise<{
19
- issues: CommentedIssue[];
20
- failures: Array<{
21
- issueUrl: string;
22
- error: string;
23
- }>;
24
- }>;
65
+ hasUserCommentSince(issueUrl: string, since: string): Promise<boolean>;
66
+ /**
67
+ * Fetch issues the user has commented on or is engaged in and determine
68
+ * conversation state. Filters out: user-authored issues, user-owned repos,
69
+ * excluded repos/orgs, AI policy blocklisted repos, and pull requests.
70
+ * Engaged issues (#1862) are scanned under the wider reply rule and
71
+ * fetched directly when the comment search misses them.
72
+ */
73
+ fetchCommentedIssues(options?: FetchCommentedIssuesOptions): Promise<FetchCommentedIssuesResult>;
74
+ /** Repo-level exclusions shared by the search results and the direct fetches. */
75
+ private isRepoAllowed;
76
+ /**
77
+ * Look up an engaged issue the comment search did not return (#1862).
78
+ * Returns undefined, with a debug line, when the number is a pull request,
79
+ * the issue is closed, the user authored it, or nothing on it changed
80
+ * since the later of the search window's start and the engagement step.
81
+ * The window keeps this path consistent with the commenter search (a
82
+ * reply older than `maxDays` is not surfaced either way); the engagement
83
+ * step tightens it because only comments after that step can be replies
84
+ * to the user, so an issue untouched since then has nothing to report.
85
+ * ETag-cached like the comment pages. Errors propagate to the worker.
86
+ */
87
+ private fetchEngagedIssue;
25
88
  /**
26
89
  * Analyze a single issue's comment thread to determine conversation status.
90
+ * Returns null when there is nothing to report: the user never commented
91
+ * on a non-engaged issue (the search said otherwise), or an engaged issue
92
+ * the user never commented on has no reply yet (nothing to wait for).
27
93
  */
28
94
  private analyzeIssueConversation;
95
+ /**
96
+ * All comments on the issue, oldest first, with deleted-account comments
97
+ * dropped. `truncated` is set when the pagination cap cut the thread short.
98
+ */
99
+ private fetchTimeline;
29
100
  }