claude-code-session-manager 0.125.1 → 0.126.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/.claude-plugin/marketplace.json +1 -1
- package/dist/assets/{AgentLibrary-DjEH5SoY.js → AgentLibrary-bzeuZN4F.js} +1 -1
- package/dist/assets/{Button-B8NLivk-.js → Button-8dWfDDuQ.js} +1 -1
- package/dist/assets/{DataModel-CHiBk8m_.js → DataModel-D4ybBPZN.js} +1 -1
- package/dist/assets/{History-DttgrJO0.js → History-hsztE6yh.js} +1 -1
- package/dist/assets/{Hooks-Bvy0BH1u.js → Hooks-CRmZMQaW.js} +1 -1
- package/dist/assets/{Library-UbBOgkkP.js → Library-Czt3Bojd.js} +1 -1
- package/dist/assets/{ListDetail-xOyOpVZX.js → ListDetail-Cr6Ct_WX.js} +1 -1
- package/dist/assets/{McpServers-CoGL0ddv.js → McpServers-CeXJ2bng.js} +1 -1
- package/dist/assets/{Memory-Cise856d.js → Memory-caujO8O3.js} +1 -1
- package/dist/assets/{Panel-Cj72VO5s.js → Panel-D64i9tGz.js} +1 -1
- package/dist/assets/{Permissions-BoJ9AB-G.js → Permissions-DpWOIrvr.js} +1 -1
- package/dist/assets/{Plugins-DfT24sAZ.js → Plugins-Bd1ekP5P.js} +2 -2
- package/dist/assets/{ProvenanceBadge-ChkIslT4.js → ProvenanceBadge-B96A_uZf.js} +1 -1
- package/dist/assets/{SaveBar-RCXr0jey.js → SaveBar-D0Y2t-Ao.js} +1 -1
- package/dist/assets/{Scheduler-B70tknnx.js → Scheduler-Y5_YbNrC.js} +1 -1
- package/dist/assets/{ScopeSwitcher-p_tgO5Sa.js → ScopeSwitcher-BmWA_dP9.js} +1 -1
- package/dist/assets/{Settings-wHiAxTfI.js → Settings-Bcf65bpL.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-D_Pt35vb.js → SkillReferenceGraph-BeSNXloA.js} +1 -1
- package/dist/assets/{Skills-DUvOrgw9.js → Skills-DwnQKJVc.js} +1 -1
- package/dist/assets/{SystemPrompt-BrNIdy68.js → SystemPrompt-Dih6SCmL.js} +1 -1
- package/dist/assets/{TagLibrary-CDRatxXG.js → TagLibrary-BZ-Kp10P.js} +1 -1
- package/dist/assets/{TiptapBody-BF8PxUDj.js → TiptapBody-C2nEUmF7.js} +1 -1
- package/dist/assets/{Toggle-CQH8NGXW.js → Toggle-Dw8-zNQo.js} +1 -1
- package/dist/assets/{ViewTabs-DwnxqCVs.js → ViewTabs-CoYPKGN-.js} +1 -1
- package/dist/assets/{historyTotals-KINLTHQ4.js → historyTotals-BbKcNpV7.js} +1 -1
- package/dist/assets/{index-CfR3NU2t.js → index-DgPUERhe.js} +581 -581
- package/dist/assets/{settingsSchema-BUcHqLnt.js → settingsSchema-6doG_61l.js} +1 -1
- package/dist/assets/{skillFrontmatter-BwwkyuMD.js → skillFrontmatter-BYMYWDfb.js} +1 -1
- package/dist/assets/{useAgentsDirWatch-Coem9Wg-.js → useAgentsDirWatch-Cqabjieh.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-web/{assets/app.js → app.js} +350 -350
- package/dist-web/index.html +2 -2
- package/package.json +2 -2
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/send-feedback/SKILL.md +10 -2
- package/scripts/scheduler-mcp-server.cjs +17 -4
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +36 -2
- package/src/main/lib/epic/epicMint.cjs +6 -0
- package/src/main/lib/epic/epicWorktreeMerge.cjs +9 -1
- package/src/main/lib/feedback-remote/autoStartedSession.cjs +102 -0
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +130 -15
- package/src/main/lib/feedback-remote/remoteAssets.cjs +25 -1
- package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +13 -2
- package/src/main/lib/git/gitExec.cjs +11 -1
- package/src/main/lib/git/gitWorktree.cjs +255 -9
- package/src/main/lib/git/jobWorktree.cjs +5 -0
- package/src/main/lib/mcpToolCatalog.cjs +5 -2
- package/src/main/lib/persona-macro/macroLibrary.cjs +21 -0
- package/src/main/lib/prd/prdDeclaredPaths.cjs +29 -2
- package/src/main/lib/promptSessionSchema.cjs +6 -1
- package/src/main/lib/scheduler/landedSinceRun.cjs +13 -5
- package/src/main/lib/scheduler/rcaReport.cjs +1 -0
- package/src/main/lib/scheduler/reviewNotice.cjs +1 -0
- package/src/main/runVerify.cjs +59 -110
- package/src/main/scheduler/gitTreeGuard.cjs +51 -1
- package/src/main/scheduler/reviewLadder.cjs +11 -5
- package/src/main/scheduler.cjs +140 -22
- package/src/main/templates/PRD_AUTHORING.md +6 -2
- package/src/main/webRemote.cjs +3 -0
- package/src/preload/api.d.ts +7 -1
- /package/dist-web/{assets/app.css → app.css} +0 -0
package/src/main/runVerify.cjs
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
* verify_unavailable → 'needs_review' (unreadable log / verifier threw)
|
|
29
29
|
* no_verdict_sentinel → 'needs_review'
|
|
30
30
|
* abandoned_background_task → 'needs_review'
|
|
31
|
+
* run_commit_not_landed → 'needs_review' (PASS but transcript SHA unreachable)
|
|
32
|
+
* pass_no_commit_already_shipped → historical rows only; no longer emitted
|
|
31
33
|
*
|
|
32
34
|
* Time complexity: O(N·L) where N = log line count, L = avg content line count.
|
|
33
35
|
* The log is read once with readFileSync (700 KB typical; well within Node.js
|
|
@@ -129,8 +131,9 @@ function parseLog(logPath) {
|
|
|
129
131
|
if (obj.type === 'system' && obj.subtype === 'vcs_state_changed' && obj.kind === 'commit') {
|
|
130
132
|
transcriptCommitLanded = true;
|
|
131
133
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
const gitOpKind = obj.tool_use_result?.gitOperation?.commit?.kind;
|
|
135
|
+
if (gitOpKind === 'committed' || gitOpKind === 'cherry-picked') {
|
|
136
|
+
if (gitOpKind === 'committed') transcriptCommitLanded = true;
|
|
134
137
|
const sha = obj.tool_use_result.gitOperation.commit.sha;
|
|
135
138
|
if (typeof sha === 'string' && sha) transcriptCommitShaSet.add(sha);
|
|
136
139
|
}
|
|
@@ -478,18 +481,13 @@ function isAncestorCommit({ cwd, sha, timeoutMs = GH_CHECK_TIMEOUT_MS, execImpl
|
|
|
478
481
|
}
|
|
479
482
|
}
|
|
480
483
|
|
|
481
|
-
/**
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
* produce committedDuringRun=true (gitHead()/committedInWindow() fail closed
|
|
485
|
-
* there), so the fallback must only apply in that narrow case — never when
|
|
486
|
-
* git ancestry is actually observable.
|
|
487
|
-
*/
|
|
488
|
-
function isGitRepo(cwd) {
|
|
489
|
-
if (!cwd) return false;
|
|
484
|
+
/** True when this repo holds the commit object `sha` (bounded, never throws). */
|
|
485
|
+
function commitExistsInRepo({ cwd, sha, timeoutMs = GH_CHECK_TIMEOUT_MS, execImpl = execFileSync }) {
|
|
486
|
+
if (!sha) return false;
|
|
490
487
|
try {
|
|
491
|
-
|
|
492
|
-
|
|
488
|
+
execImpl('git', ['cat-file', '-e', `${sha}^{commit}`], {
|
|
489
|
+
cwd: cwd || process.cwd(),
|
|
490
|
+
timeout: timeoutMs,
|
|
493
491
|
encoding: 'utf8',
|
|
494
492
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
495
493
|
});
|
|
@@ -499,73 +497,37 @@ function isGitRepo(cwd) {
|
|
|
499
497
|
}
|
|
500
498
|
}
|
|
501
499
|
|
|
502
|
-
// ─── already-shipped postcondition exemption (original PRD re-runs) ─────────
|
|
503
|
-
|
|
504
|
-
const PRD_DELIVERABLE_PATH_RE = /(?:^|[`\s(])((?:src|scripts|session-manager-operations|test|tests|docs|bin)\/[A-Za-z0-9_./-]*[A-Za-z0-9_-]\.[A-Za-z0-9]+)\b/g;
|
|
505
|
-
|
|
506
|
-
// Repo-root config files a PRD can legitimately name as its only deliverable.
|
|
507
|
-
// Deliberately an exact-name allowlist, not a general root-file pattern:
|
|
508
|
-
// a loose rule would match prose mentions (README.md, queue.json) and grant
|
|
509
|
-
// false exemptions. Incident: PRD 816 named vitest.config.ts as its primary
|
|
510
|
-
// deliverable and it was silently dropped from extraction.
|
|
511
|
-
const PRD_ROOT_CONFIG_DELIVERABLES = [
|
|
512
|
-
'package.json',
|
|
513
|
-
'tsconfig.json',
|
|
514
|
-
'vitest.config.ts',
|
|
515
|
-
'vite.config.ts',
|
|
516
|
-
'playwright.config.ts',
|
|
517
|
-
'eslint.config.js',
|
|
518
|
-
'tailwind.config.js',
|
|
519
|
-
'postcss.config.js',
|
|
520
|
-
];
|
|
521
|
-
|
|
522
500
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
* `src/renderer/components/Bar.tsx`, `scripts/baz.cjs`), plus any allowlisted
|
|
526
|
-
* repo-root config filename named as a whole word (e.g. `vitest.config.ts`).
|
|
527
|
-
* Deliberately narrow: only repo-relative paths under a known source root or
|
|
528
|
-
* an exact-name root-config allowlist, no globs, no node_modules, no URLs.
|
|
529
|
-
* O(n) over the PRD body length.
|
|
501
|
+
* True when some branch/tag/remote ref holds `sha`. A git error resolves false
|
|
502
|
+
* so the run parks instead of passing.
|
|
530
503
|
*/
|
|
531
|
-
function
|
|
532
|
-
if (
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
for (const name of PRD_ROOT_CONFIG_DELIVERABLES) {
|
|
544
|
-
if (seen.has(name)) continue;
|
|
545
|
-
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
546
|
-
const re = new RegExp(`(?:^|[\`\\s(])${escaped}(?:[\`\\s)]|$)`);
|
|
547
|
-
if (re.test(prdBody)) {
|
|
548
|
-
seen.add(name);
|
|
549
|
-
out.push(name);
|
|
550
|
-
}
|
|
504
|
+
function commitOnAnyRef({ cwd, sha, timeoutMs = GH_CHECK_TIMEOUT_MS, execImpl = execFileSync }) {
|
|
505
|
+
if (!sha) return false;
|
|
506
|
+
try {
|
|
507
|
+
const out = execImpl('git', ['rev-list', '--count', sha, '--not', '--branches', '--tags', '--remotes'], {
|
|
508
|
+
cwd: cwd || process.cwd(),
|
|
509
|
+
timeout: timeoutMs,
|
|
510
|
+
encoding: 'utf8',
|
|
511
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
512
|
+
});
|
|
513
|
+
return String(out).trim() === '0';
|
|
514
|
+
} catch {
|
|
515
|
+
return false;
|
|
551
516
|
}
|
|
552
|
-
return out;
|
|
553
517
|
}
|
|
554
518
|
|
|
555
519
|
/**
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
* through to today's pass_no_commit behavior.
|
|
520
|
+
* True when `cwd` is inside a git repository. Used to gate the transcript
|
|
521
|
+
* commit-evidence fallback below: a job whose cwd is not a git repo can never
|
|
522
|
+
* produce committedDuringRun=true (gitHead()/committedInWindow() fail closed
|
|
523
|
+
* there), so the fallback must only apply in that narrow case — never when
|
|
524
|
+
* git ancestry is actually observable.
|
|
562
525
|
*/
|
|
563
|
-
function
|
|
564
|
-
if (!
|
|
526
|
+
function isGitRepo(cwd) {
|
|
527
|
+
if (!cwd) return false;
|
|
565
528
|
try {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
timeout: timeoutMs,
|
|
529
|
+
execFileSync('git', ['-C', cwd, 'rev-parse', '--git-dir'], {
|
|
530
|
+
timeout: 10_000,
|
|
569
531
|
encoding: 'utf8',
|
|
570
532
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
571
533
|
});
|
|
@@ -575,7 +537,6 @@ function allDeliverablesAlreadyTracked({ cwd, paths, execImpl = execFileSync, ti
|
|
|
575
537
|
}
|
|
576
538
|
}
|
|
577
539
|
|
|
578
|
-
|
|
579
540
|
/**
|
|
580
541
|
* Material check for a DECLARED artifact-only PRD (`deliverable: artifact` +
|
|
581
542
|
* `artifactPaths`). Returns true only when every declared path resolves inside
|
|
@@ -718,7 +679,7 @@ async function verifyRun({
|
|
|
718
679
|
}
|
|
719
680
|
|
|
720
681
|
// ── 2. Parse log ───────────────────────────────────────────────────────
|
|
721
|
-
const { events, resultEvent, error: parseError, transcriptCommitLanded } = parseLog(logPath);
|
|
682
|
+
const { events, resultEvent, error: parseError, transcriptCommitLanded, transcriptCommitShas } = parseLog(logPath);
|
|
722
683
|
|
|
723
684
|
if (parseError) {
|
|
724
685
|
return conclude('verify_unavailable', `log unreadable: ${parseError}`, 'needs_review');
|
|
@@ -848,7 +809,25 @@ async function verifyRun({
|
|
|
848
809
|
// bare PASS with no commit from one is still a strong silent-failure
|
|
849
810
|
// signal and stays covered by this check.
|
|
850
811
|
const isFixPlanJob = /^\d+-fix-/.test(queueEntry?.slug || '');
|
|
851
|
-
|
|
812
|
+
// A transcript-reported commit that is not reachable from the repo was
|
|
813
|
+
// dropped (detached HEAD, off-branch); no no-commit exemption may excuse it.
|
|
814
|
+
let unlandedTranscriptShas = [];
|
|
815
|
+
if (sentinel === 'pass' && !commitEvidence && cwdIsGitRepo) {
|
|
816
|
+
unlandedTranscriptShas = (transcriptCommitShas || [])
|
|
817
|
+
.filter((sha) => commitExistsInRepo({ cwd: queueEntry?.cwd, sha }))
|
|
818
|
+
.filter((sha) => (isMergeMainSlug(queueEntry?.slug)
|
|
819
|
+
? !commitOnAnyRef({ cwd: queueEntry?.cwd, sha })
|
|
820
|
+
: !isAncestorCommit({ cwd: queueEntry?.cwd, sha })));
|
|
821
|
+
}
|
|
822
|
+
if (unlandedTranscriptShas.length > 0) {
|
|
823
|
+
issues.push({
|
|
824
|
+
verdict: 'run_commit_not_landed',
|
|
825
|
+
reason: 'SCHEDULER_VERDICT: PASS but the transcript reports a commit that is not reachable from the repo: '
|
|
826
|
+
+ unlandedTranscriptShas.join(', '),
|
|
827
|
+
priority: 1,
|
|
828
|
+
downgradeTo: 'needs_review',
|
|
829
|
+
});
|
|
830
|
+
} else if (sentinel === 'pass' && !commitEvidence && !isFixPlanJob) {
|
|
852
831
|
// EXEMPTION: `-merge-main` PRDs (see isMergeMainSlug) can genuinely and
|
|
853
832
|
// correctly find nothing left to do when an out-of-band actor (a human,
|
|
854
833
|
// another agent, a sibling scheduler job) already merged/updated the
|
|
@@ -889,9 +868,7 @@ async function verifyRun({
|
|
|
889
868
|
// re-checked every AC item, found it all already implemented by an
|
|
890
869
|
// earlier run of this exact PRD, declined to make a no-op commit, and
|
|
891
870
|
// printed a truthful PASS" is correct, idempotent behavior — the
|
|
892
|
-
// systemic false-failure class this exemption exists to catch
|
|
893
|
-
// from the already-shipped exemption below, which looks at PRD-named
|
|
894
|
-
// file paths rather than a specific prior run's SHA).
|
|
871
|
+
// systemic false-failure class this exemption exists to catch.
|
|
895
872
|
// (Incident: 812-workbench-review-nits-cleanup, 2026-07-31 — re-fired
|
|
896
873
|
// ~24 min after its own prior run landed 00d891c; re-verified,
|
|
897
874
|
// re-ran typecheck + 17 green tests, made no new commit, printed a
|
|
@@ -913,34 +890,6 @@ async function verifyRun({
|
|
|
913
890
|
},
|
|
914
891
|
);
|
|
915
892
|
}
|
|
916
|
-
// EXEMPTION: an ORIGINAL PRD re-queued after its deliverables already
|
|
917
|
-
// landed. "I checked, the work is already committed and green, nothing
|
|
918
|
-
// to change" is a truthful PASS, not a silent no-op — the same
|
|
919
|
-
// reasoning that exempts fix-plan slugs above. Materially checked
|
|
920
|
-
// against real git state, never inferred from the transcript.
|
|
921
|
-
// (Incident: 655-needs-review-rca-feedback-hook, 2026-07-31 — verified
|
|
922
|
-
// rcaFeedbackHook.cjs shipped in e13168d, ran typecheck + 23 green
|
|
923
|
-
// tests, made no commit, printed a truthful PASS, and was parked
|
|
924
|
-
// anyway.)
|
|
925
|
-
let alreadyShipped = false;
|
|
926
|
-
if (!mergeMainVerified && !priorRunVerified) {
|
|
927
|
-
const deliverablePaths = extractPrdDeliverablePaths(prdBody);
|
|
928
|
-
if (deliverablePaths.length > 0
|
|
929
|
-
&& allDeliverablesAlreadyTracked({ cwd: queueEntry?.cwd, paths: deliverablePaths })) {
|
|
930
|
-
alreadyShipped = true;
|
|
931
|
-
return conclude(
|
|
932
|
-
'pass_no_commit_already_shipped',
|
|
933
|
-
`SCHEDULER_VERDICT: PASS with no commit, but every PRD-named deliverable path is already `
|
|
934
|
-
+ `tracked in git (${deliverablePaths.join(', ')}) — this PRD's work landed in an earlier run`,
|
|
935
|
-
null,
|
|
936
|
-
{
|
|
937
|
-
...(annotations.length ? { annotations } : {}),
|
|
938
|
-
sentinel,
|
|
939
|
-
alreadyTrackedPaths: deliverablePaths,
|
|
940
|
-
},
|
|
941
|
-
);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
893
|
// EXEMPTION: a PRD that DECLARES `deliverable: artifact` + `artifactPaths`
|
|
945
894
|
// (all deliverables live in a git-excluded dir, so "no commit" is
|
|
946
895
|
// correct). Reads the declared list from frontmatter — never scrapes
|
|
@@ -950,7 +899,7 @@ async function verifyRun({
|
|
|
950
899
|
// through to pass_no_commit below. The commit guard separately requires
|
|
951
900
|
// a clean tree for this verdict (scheduler.cjs commitGuardVerdict).
|
|
952
901
|
let artifactVerified = false;
|
|
953
|
-
if (!mergeMainVerified && !priorRunVerified
|
|
902
|
+
if (!mergeMainVerified && !priorRunVerified) {
|
|
954
903
|
let fm = null;
|
|
955
904
|
try { fm = parsePrdFile(prdFullText).frontmatter; } catch { fm = null; }
|
|
956
905
|
if (fm && fm.deliverable === 'artifact' && Array.isArray(fm.artifactPaths) && fm.artifactPaths.length > 0) {
|
|
@@ -976,7 +925,7 @@ async function verifyRun({
|
|
|
976
925
|
}
|
|
977
926
|
}
|
|
978
927
|
}
|
|
979
|
-
if (!mergeMainVerified && !priorRunVerified && !
|
|
928
|
+
if (!mergeMainVerified && !priorRunVerified && !artifactVerified) {
|
|
980
929
|
issues.push({
|
|
981
930
|
verdict: 'pass_no_commit',
|
|
982
931
|
reason: 'SCHEDULER_VERDICT: PASS but no commit landed during the run window — the run claims success but produced no code change',
|
|
@@ -1020,10 +969,10 @@ module.exports = {
|
|
|
1020
969
|
isMergeMainSlug,
|
|
1021
970
|
extractMergeMainPrNumber,
|
|
1022
971
|
checkMergeablePr,
|
|
1023
|
-
extractPrdDeliverablePaths,
|
|
1024
|
-
allDeliverablesAlreadyTracked,
|
|
1025
972
|
artifactsVerifiedOnDisk,
|
|
1026
973
|
isAncestorCommit,
|
|
974
|
+
commitExistsInRepo,
|
|
975
|
+
commitOnAnyRef,
|
|
1027
976
|
isGitRepo,
|
|
1028
977
|
hasAbandonedBackgroundTask,
|
|
1029
978
|
};
|
|
@@ -11,6 +11,7 @@ const { execFile, execFileSync } = require('node:child_process');
|
|
|
11
11
|
const gitWorktree = require('../lib/git/gitWorktree.cjs');
|
|
12
12
|
const sharedGitExec = require('../lib/git/gitExec.cjs');
|
|
13
13
|
const { resolveProjectRoot } = require('../lib/opsOwnership.cjs');
|
|
14
|
+
const { COMPLETED_EQUIVALENT_VERDICTS } = require('../lib/scheduler/terminalRunOutcome.cjs');
|
|
14
15
|
|
|
15
16
|
// Unquote a single git porcelain v1 path token. Defined once in
|
|
16
17
|
// gitWorktree.cjs (which this file already requires — the reverse would be
|
|
@@ -417,7 +418,7 @@ async function committedInWindow(cwd, startedAt, finishedAt) {
|
|
|
417
418
|
: new Date().toISOString();
|
|
418
419
|
execFile(
|
|
419
420
|
'git',
|
|
420
|
-
['-C', cwd, 'log', '--all', '--format=%H', `--since=${startedAt}`, `--until=${until}`],
|
|
421
|
+
['-C', cwd, 'log', `--exclude=${sharedGitExec.STRANDED_REF_PREFIX}*`, '--all', '--format=%H', `--since=${startedAt}`, `--until=${until}`],
|
|
421
422
|
{ timeout: 10_000, windowsHide: true },
|
|
422
423
|
(err, stdout) => { resolve(!err && String(stdout || '').trim().length > 0); },
|
|
423
424
|
);
|
|
@@ -448,6 +449,24 @@ async function computeCommittedDuringRun(cwd, headBefore, headAfter, startedAt,
|
|
|
448
449
|
return module.exports.committedInWindow(cwd, startedAt, untilIso);
|
|
449
450
|
}
|
|
450
451
|
|
|
452
|
+
/**
|
|
453
|
+
* A worktree run whose commit could not land (diverged HEAD, cancelled,
|
|
454
|
+
* integration refused) leaves pinned commits behind. Pure.
|
|
455
|
+
* @param {{worktreeHead?: {stranded?: Array<{sha: string, ref: string}>}|null, landedCommit?: string|null}} a
|
|
456
|
+
* @returns {{verdict: string, reason: string, downgradeTo: string}|null}
|
|
457
|
+
*/
|
|
458
|
+
function strandedCommitVerdict({ worktreeHead, landedCommit } = {}) {
|
|
459
|
+
if (landedCommit) return null;
|
|
460
|
+
const stranded = Array.isArray(worktreeHead?.stranded) ? worktreeHead.stranded.filter((s) => s && s.sha) : [];
|
|
461
|
+
if (stranded.length === 0) return null;
|
|
462
|
+
const list = stranded.map((s) => `${String(s.sha).slice(0, 8)} (pinned at ${s.ref || 'no pin ref'})`).join(', ');
|
|
463
|
+
return {
|
|
464
|
+
verdict: 'run_commit_not_landed',
|
|
465
|
+
reason: `run made ${stranded.length} commit(s) that did not land on the base branch: ${list}`,
|
|
466
|
+
downgradeTo: 'needs_review',
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
|
|
451
470
|
/**
|
|
452
471
|
* Which commit does this run get credit for? A worktree-isolated run shares the
|
|
453
472
|
* main checkout with concurrent jobs, so a HEAD move there may be someone else's
|
|
@@ -644,6 +663,35 @@ async function landedCommitIsAncestorOfHead(cwd, sha) {
|
|
|
644
663
|
}
|
|
645
664
|
}
|
|
646
665
|
|
|
666
|
+
/**
|
|
667
|
+
* Should spawnJob skip the commit guard for this run? Pure.
|
|
668
|
+
* Skips when the job is about to re-fire (downgradeTo pending), when the
|
|
669
|
+
* verdict is run_commit_not_landed (the stranded-commit verdict owns the row;
|
|
670
|
+
* the guard must not replace it with silent_no_op), and for completed-equivalent
|
|
671
|
+
* verdicts — EXCEPT pass_no_commit_artifact_verified (guard still runs), and
|
|
672
|
+
* except a pass_no_commit_* verdict in a worktree with newly dirty files: a
|
|
673
|
+
* worktree's dirt is attributable to the job, so it is real dropped work.
|
|
674
|
+
* Also a `clean` verdict in a worktree with dirt and no landedCommit (a
|
|
675
|
+
* fix-plan PASS whose edits would be dropped) is not skipped; with a landed
|
|
676
|
+
* commit it still skips.
|
|
677
|
+
* @param {{verifyResult?: {verdict?: string, downgradeTo?: string|null}|null, ranInWorktree?: boolean, newlyDirty?: string[]|null}} a
|
|
678
|
+
* @returns {boolean}
|
|
679
|
+
*/
|
|
680
|
+
function commitGuardSkipped({ verifyResult, ranInWorktree, newlyDirty, landedCommit } = {}) {
|
|
681
|
+
if (!verifyResult) return false;
|
|
682
|
+
if (verifyResult.downgradeTo === 'pending') return true;
|
|
683
|
+
const verdict = verifyResult.verdict;
|
|
684
|
+
if (verdict === 'run_commit_not_landed') return true;
|
|
685
|
+
if (verdict === 'pass_no_commit_artifact_verified') return false;
|
|
686
|
+
const dirty = Array.isArray(newlyDirty) && newlyDirty.length > 0;
|
|
687
|
+
// A fix-plan PASS gets verdict `clean`; in a worktree with own dirt and no
|
|
688
|
+
// landed commit its edits would be dropped, so the guard must run.
|
|
689
|
+
if (verdict === 'clean' && ranInWorktree && dirty && !landedCommit) return false;
|
|
690
|
+
if (!COMPLETED_EQUIVALENT_VERDICTS.has(verdict)) return false;
|
|
691
|
+
if (ranInWorktree && dirty && String(verdict).startsWith('pass_no_commit')) return false;
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
|
|
647
695
|
module.exports = {
|
|
648
696
|
splitRenamePorcelainField,
|
|
649
697
|
parsePorcelainEntries,
|
|
@@ -662,6 +710,7 @@ module.exports = {
|
|
|
662
710
|
committedInWindow,
|
|
663
711
|
computeCommittedDuringRun,
|
|
664
712
|
resolveRunCommitAttribution,
|
|
713
|
+
strandedCommitVerdict,
|
|
665
714
|
gitRangeCommits,
|
|
666
715
|
isBranchAlreadyIntegrated,
|
|
667
716
|
classifySigtermWithCommit,
|
|
@@ -669,4 +718,5 @@ module.exports = {
|
|
|
669
718
|
evaluateDispatchSidecarReconcile,
|
|
670
719
|
isQueueRowRegression,
|
|
671
720
|
landedCommitIsAncestorOfHead,
|
|
721
|
+
commitGuardSkipped,
|
|
672
722
|
};
|
|
@@ -94,12 +94,16 @@ function selectResumeRecoveryTarget(job) {
|
|
|
94
94
|
const MECHANICALLY_RESOLVABLE_VERDICTS = new Set(['worktree_integration_failed']);
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
* True when a retry is provably futile: a content_conflict whose base HEAD is
|
|
97
|
+
* True when a retry is provably futile: a content_conflict or hook_rejected whose base HEAD is
|
|
98
98
|
* the same as at failure time. Unknown state (no stamp, null current HEAD)
|
|
99
99
|
* is NOT futile — falls back to attempting the retry.
|
|
100
100
|
*/
|
|
101
|
+
function isHeadSensitiveFailureKind(kind) {
|
|
102
|
+
return kind === 'content_conflict' || kind === 'hook_rejected';
|
|
103
|
+
}
|
|
104
|
+
|
|
101
105
|
function isMechanicalRecoveryFutile(job, currentHeadSha) {
|
|
102
|
-
return job.integrationFailureKind
|
|
106
|
+
return isHeadSensitiveFailureKind(job.integrationFailureKind)
|
|
103
107
|
&& !!job.integrationBaseHeadSha
|
|
104
108
|
&& !!currentHeadSha
|
|
105
109
|
&& job.integrationBaseHeadSha === currentHeadSha;
|
|
@@ -161,8 +165,9 @@ function fixSlugFor(job) {
|
|
|
161
165
|
// fix-plan job flagged before that exemption shipped gets a genuinely
|
|
162
166
|
// different verdict on rescan (2026-07-12: false-positive cascade where
|
|
163
167
|
// investigation jobs correctly found "nothing to fix" but were flagged
|
|
164
|
-
// anyway). For non-fix-plan jobs the exemption never applies, so
|
|
165
|
-
//
|
|
168
|
+
// anyway). For non-fix-plan jobs the exemption never applies, so a rescan
|
|
169
|
+
// reaches the same verdict, and healRefusalReason refuses to heal a
|
|
170
|
+
// pass_no_commit row off a repo-wide commit that is not this job's own.
|
|
166
171
|
const RESCANNABLE_VERDICTS = new Set(['transcript_errors', 'verify_unavailable', 'no_verdict_sentinel', 'abandoned_background_task', 'pass_no_commit', 'pass_no_commit_already_shipped']);
|
|
167
172
|
// RESCANNABLE_VERDICTS is a HINT, not a gate: it names the verdicts whose
|
|
168
173
|
// recovery rung is a transcript re-verification (verifyRun). Every other
|
|
@@ -487,7 +492,7 @@ function isFixPlanDead(job, jobsInProject) {
|
|
|
487
492
|
// committedDuringRun repo-wide-not-per-job attribution problem) — the PRD 983
|
|
488
493
|
// incident mechanism above applies identically, so it gets the same guard
|
|
489
494
|
// rather than a carve-out that would silently reopen the same false-heal hole.
|
|
490
|
-
const NO_ATTRIBUTABLE_COMMIT_VERDICTS = new Set(['no_verdict_sentinel', 'abandoned_background_task']);
|
|
495
|
+
const NO_ATTRIBUTABLE_COMMIT_VERDICTS = new Set(['no_verdict_sentinel', 'abandoned_background_task', 'pass_no_commit']);
|
|
491
496
|
|
|
492
497
|
function healRefusalReason(job, verdict, committedDuringRun) {
|
|
493
498
|
if (!job || !verdict) return null;
|
|
@@ -1010,6 +1015,7 @@ module.exports = {
|
|
|
1010
1015
|
selectResumeRecoveryTarget,
|
|
1011
1016
|
MECHANICALLY_RESOLVABLE_VERDICTS,
|
|
1012
1017
|
isMechanicalRecoveryFutile,
|
|
1018
|
+
isHeadSensitiveFailureKind,
|
|
1013
1019
|
selectMechanicalRecoveryTarget,
|
|
1014
1020
|
isStaleSharedTreeRevertedPark,
|
|
1015
1021
|
fixSlugFor,
|