@oss-autopilot/core 3.40.0 → 3.40.2
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 +10 -4
- package/dist/cli.bundle.cjs +37 -37
- package/dist/commands/dismiss.d.ts +15 -1
- package/dist/commands/dismiss.js +36 -2
- package/dist/core/state.js +26 -1
- package/package.json +1 -1
|
@@ -10,10 +10,23 @@
|
|
|
10
10
|
* lands. A review follow-up dismissed with `--head <sha>` also records the
|
|
11
11
|
* PR's head, so a push (new head) brings it back while bot, label and
|
|
12
12
|
* bystander updates do not; see `daily-reviewed-prs.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Dismissing one of the user's own open PRs is still recorded, but it does
|
|
15
|
+
* not clear the PR from Needs Attention: the actionable list is built from
|
|
16
|
+
* the open PR set without a dismiss filter (#657), and `move <pr-url>
|
|
17
|
+
* waiting` is the tool for that. The result carries a `warning` when the URL
|
|
18
|
+
* matches an open PR from the last daily digest so the user and the /oss
|
|
19
|
+
* workflow learn this (#1885).
|
|
13
20
|
*/
|
|
14
21
|
export interface DismissOutput {
|
|
15
22
|
dismissed: boolean;
|
|
16
23
|
url: string;
|
|
24
|
+
/**
|
|
25
|
+
* Set when the URL is one of the user's open PRs in the last daily digest:
|
|
26
|
+
* the dismiss was recorded but does not clear the PR from Needs Attention;
|
|
27
|
+
* `move <pr-url> waiting` does (#1885).
|
|
28
|
+
*/
|
|
29
|
+
warning?: string;
|
|
17
30
|
/** Set when the post-mutation Gist checkpoint failed; the local mutation succeeded (#1370). */
|
|
18
31
|
gistSyncWarning?: string;
|
|
19
32
|
}
|
|
@@ -39,7 +52,8 @@ export interface UndismissOutput {
|
|
|
39
52
|
* hidden until the head moves or someone comments after the dismiss.
|
|
40
53
|
* Without it, only the stamp decides, and any update to the PR can resurface it.
|
|
41
54
|
* @returns Whether the issue was newly dismissed (false if already dismissed);
|
|
42
|
-
* always true for a PR URL
|
|
55
|
+
* always true for a PR URL. Carries a `warning` when the PR is one of the
|
|
56
|
+
* user's open PRs from the last daily digest (#1885).
|
|
43
57
|
* @throws {ValidationError} If the URL is not a valid GitHub issue or PR URL,
|
|
44
58
|
* if `head` is not a full 40-hex SHA, or if `head` is given with an issue URL
|
|
45
59
|
*/
|
package/dist/commands/dismiss.js
CHANGED
|
@@ -10,11 +10,38 @@
|
|
|
10
10
|
* lands. A review follow-up dismissed with `--head <sha>` also records the
|
|
11
11
|
* PR's head, so a push (new head) brings it back while bot, label and
|
|
12
12
|
* bystander updates do not; see `daily-reviewed-prs.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Dismissing one of the user's own open PRs is still recorded, but it does
|
|
15
|
+
* not clear the PR from Needs Attention: the actionable list is built from
|
|
16
|
+
* the open PR set without a dismiss filter (#657), and `move <pr-url>
|
|
17
|
+
* waiting` is the tool for that. The result carries a `warning` when the URL
|
|
18
|
+
* matches an open PR from the last daily digest so the user and the /oss
|
|
19
|
+
* workflow learn this (#1885).
|
|
13
20
|
*/
|
|
14
21
|
import { getStateManager, maybeCheckpoint } from '../core/index.js';
|
|
15
22
|
import { ValidationError } from '../core/errors.js';
|
|
16
23
|
import { ISSUE_OR_PR_URL_PATTERN, PR_URL_PATTERN, validateCommitSha, validateGitHubUrl, validateUrl, } from './validation.js';
|
|
17
24
|
const MODULE = 'dismiss';
|
|
25
|
+
/**
|
|
26
|
+
* Warning for dismissing one of the user's open PRs (#1885). Reads the open PR
|
|
27
|
+
* set persisted by the last `daily` run; no GitHub call. Undefined when the URL
|
|
28
|
+
* is not an open PR there (merged, closed, never seen, or no digest yet), or
|
|
29
|
+
* when the PR is shelved: `daily` keeps shelved PRs in `openPRs` but out of
|
|
30
|
+
* Needs Attention, and `move <pr-url> waiting` would unshelve one.
|
|
31
|
+
*
|
|
32
|
+
* URL validation accepts any owner/repo casing while `openPRs` holds GitHub's,
|
|
33
|
+
* so the match is case-insensitive and the suggested `move` command uses the
|
|
34
|
+
* stored URL, which is the one `daily` checks against the shelf.
|
|
35
|
+
*/
|
|
36
|
+
function openPRDismissWarning(stateManager, url) {
|
|
37
|
+
const openPRs = stateManager.getState().lastDigest?.openPRs ?? [];
|
|
38
|
+
const wanted = url.toLowerCase();
|
|
39
|
+
const openPR = openPRs.find((pr) => pr.url.toLowerCase() === wanted);
|
|
40
|
+
if (!openPR || stateManager.isPRShelved(openPR.url))
|
|
41
|
+
return undefined;
|
|
42
|
+
return (`${openPR.url} is one of your open PRs. dismiss records it but does not clear the PR from Needs Attention; ` +
|
|
43
|
+
`run \`move ${openPR.url} waiting\` for that.`);
|
|
44
|
+
}
|
|
18
45
|
/**
|
|
19
46
|
* Dismiss an issue's reply notifications without posting a comment.
|
|
20
47
|
* The dismissal auto-resurfaces when new responses arrive after the dismiss timestamp.
|
|
@@ -31,7 +58,8 @@ const MODULE = 'dismiss';
|
|
|
31
58
|
* hidden until the head moves or someone comments after the dismiss.
|
|
32
59
|
* Without it, only the stamp decides, and any update to the PR can resurface it.
|
|
33
60
|
* @returns Whether the issue was newly dismissed (false if already dismissed);
|
|
34
|
-
* always true for a PR URL
|
|
61
|
+
* always true for a PR URL. Carries a `warning` when the PR is one of the
|
|
62
|
+
* user's open PRs from the last daily digest (#1885).
|
|
35
63
|
* @throws {ValidationError} If the URL is not a valid GitHub issue or PR URL,
|
|
36
64
|
* if `head` is not a full 40-hex SHA, or if `head` is given with an issue URL
|
|
37
65
|
*/
|
|
@@ -50,7 +78,13 @@ export async function runDismiss(options) {
|
|
|
50
78
|
};
|
|
51
79
|
const added = stateManager.dismissIssue(options.url, dismissedAt, dismissOptions);
|
|
52
80
|
const gistSyncWarning = await maybeCheckpoint(stateManager, MODULE, () => stateManager.dismissIssue(options.url, dismissedAt, dismissOptions));
|
|
53
|
-
|
|
81
|
+
const warning = isPR ? openPRDismissWarning(stateManager, options.url) : undefined;
|
|
82
|
+
return {
|
|
83
|
+
dismissed: added,
|
|
84
|
+
url: options.url,
|
|
85
|
+
...(warning && { warning }),
|
|
86
|
+
...(gistSyncWarning && { gistSyncWarning }),
|
|
87
|
+
};
|
|
54
88
|
}
|
|
55
89
|
/**
|
|
56
90
|
* Restore a dismissed issue to notifications.
|
package/dist/core/state.js
CHANGED
|
@@ -111,7 +111,9 @@ export async function maybeCheckpoint(stateManager, callerModule, reapply) {
|
|
|
111
111
|
async function pushOrWarn(stateManager, callerModule) {
|
|
112
112
|
if (await stateManager.checkpoint())
|
|
113
113
|
return null;
|
|
114
|
-
const msg = 'Gist checkpoint push failed after retry; the local mutation is saved
|
|
114
|
+
const msg = 'Gist checkpoint push failed after retry; the local mutation is saved but NOT synced yet. ' +
|
|
115
|
+
'A running MCP server or dashboard retries the push before its next Gist refresh; ' +
|
|
116
|
+
'a new CLI run starts from the Gist without it, so re-run the command there';
|
|
115
117
|
warn(callerModule, msg);
|
|
116
118
|
return msg;
|
|
117
119
|
}
|
|
@@ -583,6 +585,29 @@ export class StateManager {
|
|
|
583
585
|
warn(MODULE, 'Forced Gist refresh refused: local changes are not pushed yet and nothing would re-apply them');
|
|
584
586
|
return false;
|
|
585
587
|
}
|
|
588
|
+
// Push-before-pull (audit 2026-11-07 H1): a non-forced pull here would
|
|
589
|
+
// replace un-pushed changes and nothing would ever re-push them. Retry
|
|
590
|
+
// the push first. A failed push keeps them (skip the pull, retry next
|
|
591
|
+
// time); a thrown conflict means nothing can re-apply them, so the pull
|
|
592
|
+
// proceeds and the loss is surfaced below.
|
|
593
|
+
if (!options.force && this.unpushed) {
|
|
594
|
+
const isPushed = await this.checkpoint().catch((err) => {
|
|
595
|
+
warn(MODULE, `Push before Gist refresh failed: ${errorMessage(err)}`);
|
|
596
|
+
return null;
|
|
597
|
+
});
|
|
598
|
+
if (isPushed === false) {
|
|
599
|
+
this.staleness = {
|
|
600
|
+
source: 'cache',
|
|
601
|
+
reason: 'Gist refresh skipped: local changes are not pushed yet (push failed); serving local state',
|
|
602
|
+
lastSuccessfulRefresh: this.lastSuccessfulRefreshAt,
|
|
603
|
+
detectedAt: new Date().toISOString(),
|
|
604
|
+
};
|
|
605
|
+
return false;
|
|
606
|
+
}
|
|
607
|
+
// A mutation may have started while the push was in flight.
|
|
608
|
+
if (this.mutationDepth > 0)
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
586
611
|
const result = await this.gistStore.refreshFromGist(options);
|
|
587
612
|
// StateManager keeps its boolean shape (callers rely on truthy-check
|
|
588
613
|
// semantics) but consults the discriminated union internally to know
|