@oss-autopilot/core 3.25.0 → 3.25.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.
@@ -45,6 +45,14 @@ export declare const STALE_STATUSES: ReadonlySet<StalenessTier>;
45
45
  * wrong status is visible in the envelope, not just stderr.
46
46
  * @returns New PR array with overrides applied (original array is not mutated)
47
47
  */
48
+ /**
49
+ * When the PR last had activity a person can act on: a commit or a maintainer
50
+ * comment/review. GitHub's `updatedAt` also moves on invisible events (merge
51
+ * state recomputed after the base branch advances, label churn), which on a
52
+ * busy repo cleared a fresh manual override within hours (#1713). Falls back
53
+ * to `updatedAt` only when neither signal is present.
54
+ */
55
+ export declare function latestActivityAt(pr: Pick<FetchedPR, 'updatedAt' | 'latestCommitDate' | 'lastMaintainerComment'>): string;
48
56
  export declare function applyStatusOverrides(prs: FetchedPR[], state: Readonly<AgentState>, failures?: string[]): FetchedPR[];
49
57
  /**
50
58
  * Project a PR to a lightweight ShelvedPRRef for digest output.
@@ -58,6 +58,19 @@ const VALID_OVERRIDE_STATUSES = new Set(['needs_addressing', 'waiting_on_maintai
58
58
  * wrong status is visible in the envelope, not just stderr.
59
59
  * @returns New PR array with overrides applied (original array is not mutated)
60
60
  */
61
+ /**
62
+ * When the PR last had activity a person can act on: a commit or a maintainer
63
+ * comment/review. GitHub's `updatedAt` also moves on invisible events (merge
64
+ * state recomputed after the base branch advances, label churn), which on a
65
+ * busy repo cleared a fresh manual override within hours (#1713). Falls back
66
+ * to `updatedAt` only when neither signal is present.
67
+ */
68
+ export function latestActivityAt(pr) {
69
+ const candidates = [pr.latestCommitDate, pr.lastMaintainerComment?.createdAt].filter((d) => !!d);
70
+ if (candidates.length === 0)
71
+ return pr.updatedAt;
72
+ return candidates.reduce((a, b) => (a > b ? a : b));
73
+ }
61
74
  export function applyStatusOverrides(prs, state, failures) {
62
75
  const overrides = state.config.statusOverrides;
63
76
  if (!overrides || Object.keys(overrides).length === 0)
@@ -69,7 +82,7 @@ export function applyStatusOverrides(prs, state, failures) {
69
82
  stateManager.batch(() => {
70
83
  result = prs.map((pr) => {
71
84
  try {
72
- const override = stateManager.getStatusOverride(pr.url, pr.updatedAt);
85
+ const override = stateManager.getStatusOverride(pr.url, latestActivityAt(pr));
73
86
  if (!override) {
74
87
  return pr;
75
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.25.0",
3
+ "version": "3.25.1",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {