@repo-os/repoos 0.5.79 → 0.5.81
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/.build-info.json +2 -2
- package/dist/.build-stamp.json +1 -1
- package/dist/commands/check.d.ts +3 -0
- package/dist/commands/check.js +150 -2
- package/dist/commands/upgrade.d.ts +89 -0
- package/dist/commands/upgrade.js +102 -13
- package/dist/core/active-task-card.js +1 -2
- package/dist/core/check-gate-bookkeeping.d.ts +25 -0
- package/dist/core/check-gate-bookkeeping.js +126 -0
- package/dist/core/config.js +20 -1
- package/dist/core/git-directory-snapshot.d.ts +2 -0
- package/dist/core/git-directory-snapshot.js +46 -0
- package/dist/core/git.d.ts +104 -0
- package/dist/core/git.js +240 -8
- package/dist/core/landable.js +1 -1
- package/dist/core/lockfile-conflict.d.ts +5 -1
- package/dist/core/lockfile-conflict.js +34 -3
- package/dist/core/review-report-sections.js +2 -1
- package/dist/core/shot-fixtures.d.ts +1 -1
- package/dist/core/shot-fixtures.js +10 -2
- package/dist/core/types.d.ts +6 -0
- package/dist/server/agents.js +7 -0
- package/dist/server/check-gate-lock.d.ts +151 -0
- package/dist/server/check-gate-lock.js +1092 -0
- package/dist/server/done.js +5 -6
- package/dist/server/engineer-remote-self-check.js +70 -5
- package/dist/server/git-worker-entry.js +14 -0
- package/dist/server/handoff-status.d.ts +7 -0
- package/dist/server/handoff-status.js +13 -0
- package/dist/server/handoff.js +331 -167
- package/dist/server/integration-orchestrator.d.ts +1 -0
- package/dist/server/integration-orchestrator.js +54 -3
- package/dist/server/review-guard.d.ts +15 -1
- package/dist/server/review-guard.js +95 -28
- package/dist/server/review-report-store.js +3 -1
- package/dist/server/review.d.ts +29 -0
- package/dist/server/review.js +117 -3
- package/dist/server/routes/release.d.ts +9 -0
- package/dist/server/routes/release.js +53 -27
- package/dist/server/routes/tasks.js +5 -1
- package/dist/server/server.js +17 -0
- package/dist/server/worktree-handoff-guard.d.ts +1 -0
- package/dist/server/worktree-handoff-guard.js +1 -0
- package/dist/ui/assets/ActivityIndicator-RQG6hvTL.js +1 -0
- package/dist/ui/assets/AgentModelControl-rddIj4UM.js +1 -0
- package/dist/ui/assets/AgentModelModal-X2BCT9-u.js +1 -0
- package/dist/ui/assets/{AgentsView-w4jAuJuM.css → AgentsView-B2_-D1yF.css} +1 -1
- package/dist/ui/assets/AgentsView-CX3N_jKt.js +2 -0
- package/dist/ui/assets/{ChatAgentModelChip-D-NQs_rJ.js → ChatAgentModelChip-9tc5FOK8.js} +1 -1
- package/dist/ui/assets/ChecksView-BbrTCFAr.js +0 -0
- package/dist/ui/assets/{ChecksView-bW4060TJ.css → ChecksView-u0VznGkb.css} +1 -1
- package/dist/ui/assets/{ClientBoardView-CrouU_aS.js → ClientBoardView-f5JZkZHB.js} +1 -1
- package/dist/ui/assets/ContextView-BDGKIDsx.js +4 -0
- package/dist/ui/assets/DashboardView-BYHeiXjK.js +1 -0
- package/dist/ui/assets/DeploymentsView--ftmbC8t.js +1 -0
- package/dist/ui/assets/DeploymentsView-CAxXPEHO.css +1 -0
- package/dist/ui/assets/DevView-BwdViVxh.css +1 -0
- package/dist/ui/assets/DevView-D_6ive6Q.js +2 -0
- package/dist/ui/assets/{DiffView-DqHxHKoZ.js → DiffView-YID6ReSi.js} +1 -1
- package/dist/ui/assets/FailedTestsList-lRPgMVk6.js +1 -0
- package/dist/ui/assets/InputsView-DQaDQNvL.js +1 -0
- package/dist/ui/assets/{LoginView-BGJKiUG7.js → LoginView-ahrsIk5c.js} +1 -1
- package/dist/ui/assets/PageSkeleton-DVEAY03M.css +1 -0
- package/dist/ui/assets/PageSkeleton-DhwoOs3z.js +1 -0
- package/dist/ui/assets/ReleasesView-BwqinG0s.css +1 -0
- package/dist/ui/assets/ReleasesView-xkXPKhX6.js +5 -0
- package/dist/ui/assets/SecretsView-Qrvy3TDZ.js +1 -0
- package/dist/ui/assets/SettingsView-BpHgh1-0.js +4 -0
- package/dist/ui/assets/StoriesView-DKng4ydw.js +1 -0
- package/dist/ui/assets/{VoiceDictate-ChpX2AA7.js → VoiceDictate-Dv1thwPa.js} +1 -1
- package/dist/ui/assets/WorkView-B8AQuKG1.js +2 -0
- package/dist/ui/assets/{WorkView-CukzI4GD.css → WorkView-yjNryVHN.css} +1 -1
- package/dist/ui/assets/{abnfDiagram-VCTEODGH-Disb99FM.js → abnfDiagram-VCTEODGH-Cq8vcaFs.js} +1 -1
- package/dist/ui/assets/activity-motion-TFy0O4bk.js +1 -0
- package/dist/ui/assets/{architectureDiagram-5GKGNRK7-C4Ds3utN.js → architectureDiagram-5GKGNRK7-CSpmSa1E.js} +1 -1
- package/dist/ui/assets/{blockDiagram-I7D4REHJ-KMObl4ZV.js → blockDiagram-I7D4REHJ-DwxmE3mt.js} +1 -1
- package/dist/ui/assets/{c4Diagram-7LVT6UL2-DG-uQF0R.js → c4Diagram-7LVT6UL2-D89vxQRS.js} +1 -1
- package/dist/ui/assets/channel-CIRCgzQL.js +1 -0
- package/dist/ui/assets/{check-setup-D1N9T5Uv.js → check-setup-CbHDLRRo.js} +1 -1
- package/dist/ui/assets/{chunk-2E4U76K2-t_xylKuL.js → chunk-2E4U76K2-DdhwTfam.js} +1 -1
- package/dist/ui/assets/{chunk-4HAMMTFA-D_tr3o0s.js → chunk-4HAMMTFA-DmJvPn6W.js} +1 -1
- package/dist/ui/assets/{chunk-75Z2AOVW-Cn05Ol--.js → chunk-75Z2AOVW-4QN5k5n3.js} +1 -1
- package/dist/ui/assets/{chunk-CLGD4ZFX-VGI4dwGH.js → chunk-CLGD4ZFX-BR-A4icR.js} +1 -1
- package/dist/ui/assets/{chunk-DU6HZSFF-DVaS82bI.js → chunk-DU6HZSFF-9xlXhgs1.js} +1 -1
- package/dist/ui/assets/{chunk-F27PBJKO-DsnLjxqh.js → chunk-F27PBJKO-BwDeV6YA.js} +1 -1
- package/dist/ui/assets/{chunk-GMAD6QVW-FzwZNrud.js → chunk-GMAD6QVW-BWRBcS1R.js} +1 -1
- package/dist/ui/assets/{chunk-GVQU2GXP-DIUs0jM7.js → chunk-GVQU2GXP-COQ3z0bS.js} +1 -1
- package/dist/ui/assets/{chunk-IMKFNOWR-DFejI9gt.js → chunk-IMKFNOWR-CR2co4I9.js} +1 -1
- package/dist/ui/assets/{chunk-L3NEJ4N5-DcuOTPx3.js → chunk-L3NEJ4N5-BGrmTM3B.js} +1 -1
- package/dist/ui/assets/{chunk-OSK3NFVY-BmeqP3ED.js → chunk-OSK3NFVY-C6Y95IFY.js} +1 -1
- package/dist/ui/assets/{chunk-P2QGCYS3-D0hqIjR0.js → chunk-P2QGCYS3-cFOeR0fs.js} +1 -1
- package/dist/ui/assets/{chunk-POPQ4Y6H-D_Utl4ZK.js → chunk-POPQ4Y6H-DVCaMA3q.js} +1 -1
- package/dist/ui/assets/{chunk-PWAF6VOD-wVDmHKEd.js → chunk-PWAF6VOD-BfP23CLu.js} +1 -1
- package/dist/ui/assets/{chunk-SHT3W25Y-B67ykPyd.js → chunk-SHT3W25Y-DsAut3fo.js} +1 -1
- package/dist/ui/assets/{chunk-SVP7TREG-BT2oOShY.js → chunk-SVP7TREG-C1IhncTC.js} +1 -1
- package/dist/ui/assets/{chunk-TICWLB2K-C2tCJB99.js → chunk-TICWLB2K-BQg61-Ax.js} +1 -1
- package/dist/ui/assets/{chunk-TLUHSLCS-qlDLvGGB.js → chunk-TLUHSLCS-iZWa-iEt.js} +2 -2
- package/dist/ui/assets/classDiagram-ZZMXUADV-DuCvGyds.js +1 -0
- package/dist/ui/assets/classDiagram-v2-VYDZK3BY-DuCvGyds.js +1 -0
- package/dist/ui/assets/{cynefinDiagram-5FMLGOSQ-CpiG49eu.js → cynefinDiagram-5FMLGOSQ-BQMw9oCu.js} +1 -1
- package/dist/ui/assets/{dagre-GXQ25YYZ-Dcdn73eC.js → dagre-GXQ25YYZ-Bwf0tGsh.js} +1 -1
- package/dist/ui/assets/{diagram-S7CK7UJ4-jP9c5cCX.js → diagram-S7CK7UJ4--07nd2Km.js} +1 -1
- package/dist/ui/assets/{diagram-UQ7AKVKN-DHbDfL6T.js → diagram-UQ7AKVKN-BnppfD3n.js} +1 -1
- package/dist/ui/assets/{diagram-VSXAHHWV-CoZM_4J1.js → diagram-VSXAHHWV-DavsZSZR.js} +1 -1
- package/dist/ui/assets/{diagram-VX7I27RA-CzPVCceM.js → diagram-VX7I27RA-vF99qObM.js} +1 -1
- package/dist/ui/assets/{diagram-Z3DM3KII-DuoafclK.js → diagram-Z3DM3KII-ByMRp7Lj.js} +1 -1
- package/dist/ui/assets/{docs-ffTClE6H.js → docs-Bib5O7zg.js} +1 -1
- package/dist/ui/assets/{ebnfDiagram-PWID7BFC-BPWWV4-c.js → ebnfDiagram-PWID7BFC-E3ksi-Se.js} +1 -1
- package/dist/ui/assets/{erDiagram-RLTQ6QDP-bJLohddH.js → erDiagram-RLTQ6QDP-CWu35TiV.js} +1 -1
- package/dist/ui/assets/flowDiagram-HODETNUW-yAw5OXM2.js +1 -0
- package/dist/ui/assets/{ganttDiagram-EL5Y4UJY-cobRq9Yt.js → ganttDiagram-EL5Y4UJY-8sEpEebL.js} +1 -1
- package/dist/ui/assets/{gitGraphDiagram-WWUBYQGX-DAmxl4i3.js → gitGraphDiagram-WWUBYQGX-DKy2-XDk.js} +1 -1
- package/dist/ui/assets/index-CgvhPdup.js +92 -0
- package/dist/ui/assets/{index-DmBFMTgK.css → index-DK2w5dcH.css} +1 -1
- package/dist/ui/assets/{infoDiagram-27XIBGKW-DNx_CGKA.js → infoDiagram-27XIBGKW-DTp08qxU.js} +1 -1
- package/dist/ui/assets/{ishikawaDiagram-5VMMS53U-DaXmR6Sp.js → ishikawaDiagram-5VMMS53U-CTFdvXq3.js} +1 -1
- package/dist/ui/assets/{journeyDiagram-3NMN7TZE-C4QlCzar.js → journeyDiagram-3NMN7TZE-B1R6Dq0O.js} +1 -1
- package/dist/ui/assets/{kanban-definition-UXKFOSKX-D3xqCUN_.js → kanban-definition-UXKFOSKX-CZ9kXxNu.js} +1 -1
- package/dist/ui/assets/{line-DunlL_G9.js → line-D9RfyImD.js} +1 -1
- package/dist/ui/assets/{mermaid-parser.core-CA01xSFj.js → mermaid-parser.core-CJbML1of.js} +1 -1
- package/dist/ui/assets/{mermaid.core-DVHzS71g.js → mermaid.core-Dp6f40i4.js} +3 -3
- package/dist/ui/assets/{mindmap-definition-YA3MSWOX-YtGK8YaO.js → mindmap-definition-YA3MSWOX-Drt3agXN.js} +1 -1
- package/dist/ui/assets/page-data-cache-D8m2QE6z.js +1 -0
- package/dist/ui/assets/{pegDiagram-XKGWAZYB-DuRsPDlR.js → pegDiagram-XKGWAZYB-BL1-4rQl.js} +1 -1
- package/dist/ui/assets/{pieDiagram-E7YTZNPT-Dn4iGsKM.js → pieDiagram-E7YTZNPT-SgLUnkSx.js} +1 -1
- package/dist/ui/assets/{quadrantDiagram-AXDQQJYC-6lORmXXf.js → quadrantDiagram-AXDQQJYC-DRceeGWZ.js} +1 -1
- package/dist/ui/assets/{railroadDiagram-O6MQD6OU-BURPK22Y.js → railroadDiagram-O6MQD6OU-DRoUlx0K.js} +1 -1
- package/dist/ui/assets/repo-BA_wQb3l.js +66 -0
- package/dist/ui/assets/{requirementDiagram-BXWQKSXE-CZ_a3p_0.js → requirementDiagram-BXWQKSXE-C5udyCAl.js} +1 -1
- package/dist/ui/assets/{sankeyDiagram-P5KCCOFB-CQucEZJG.js → sankeyDiagram-P5KCCOFB-BxDybL12.js} +1 -1
- package/dist/ui/assets/{sequenceDiagram-WJ2MYXX4-CZO174wQ.js → sequenceDiagram-WJ2MYXX4-Is4IwOMh.js} +1 -1
- package/dist/ui/assets/{stateDiagram-D77RDMKH-D7EC55pB.js → stateDiagram-D77RDMKH-DIvQUF30.js} +1 -1
- package/dist/ui/assets/stateDiagram-v2-MP3YSRHH-C2WyqlbN.js +1 -0
- package/dist/ui/assets/{swimlanes-42K2YHIH-DxNjupBG.js → swimlanes-42K2YHIH-DuHeh3aL.js} +1 -1
- package/dist/ui/assets/swimlanesDiagram-VR7AAH4N-U3yBzN3c.js +8 -0
- package/dist/ui/assets/{timeline-definition-24CTP7MA-DiFdAXnt.js → timeline-definition-24CTP7MA-BOh7-kWv.js} +1 -1
- package/dist/ui/assets/{vennDiagram-4TSXK5OY-BDrcaiqT.js → vennDiagram-4TSXK5OY-DhM7B1MC.js} +1 -1
- package/dist/ui/assets/{wardleyDiagram-VM6X3IG4-Dnfyrpi6.js → wardleyDiagram-VM6X3IG4-B5RTZ0aA.js} +1 -1
- package/dist/ui/assets/{xychartDiagram-S5SC5T6Z-BJXkTugj.js → xychartDiagram-S5SC5T6Z-CgV-_HAk.js} +1 -1
- package/dist/ui/index.html +13 -13
- package/dist/ui/sw.js +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/ActivityIndicator-BWlZfaO3.js +0 -1
- package/dist/ui/assets/AgentModelControl-BSREU0gT.js +0 -1
- package/dist/ui/assets/AgentModelModal-C43Y5aOl.js +0 -1
- package/dist/ui/assets/AgentsView-D4GwZS2W.js +0 -2
- package/dist/ui/assets/ChecksView-2QXNHf6a.js +0 -0
- package/dist/ui/assets/ContextView-DoFFH27d.js +0 -4
- package/dist/ui/assets/DashboardView-Dox7KcTb.js +0 -1
- package/dist/ui/assets/DeploymentsView-DNipdK1H.css +0 -1
- package/dist/ui/assets/DeploymentsView-YTy3nsi5.js +0 -1
- package/dist/ui/assets/DevView-CI2657c-.css +0 -1
- package/dist/ui/assets/DevView-D3Ez4Cjn.js +0 -2
- package/dist/ui/assets/FailedTestsList-BdHpguN4.js +0 -1
- package/dist/ui/assets/InputsView-gCRdN9t3.js +0 -1
- package/dist/ui/assets/PageSkeleton-BlmbGE1i.js +0 -1
- package/dist/ui/assets/PageSkeleton-CsTdMpw3.css +0 -1
- package/dist/ui/assets/ReleasesView-3yHTdc8L.css +0 -1
- package/dist/ui/assets/ReleasesView-BdzvI0tt.js +0 -5
- package/dist/ui/assets/SecretsView-BRJRWVij.js +0 -1
- package/dist/ui/assets/SettingsView-DZs8JZaD.js +0 -4
- package/dist/ui/assets/StoriesView-C7IMaSU_.js +0 -1
- package/dist/ui/assets/WorkView-yNZoM5nI.js +0 -2
- package/dist/ui/assets/channel-bpC5wser.js +0 -1
- package/dist/ui/assets/classDiagram-ZZMXUADV-BUJaNzDl.js +0 -1
- package/dist/ui/assets/classDiagram-v2-VYDZK3BY-BUJaNzDl.js +0 -1
- package/dist/ui/assets/flowDiagram-HODETNUW-BGsz_p_x.js +0 -1
- package/dist/ui/assets/index-C7euA__s.js +0 -92
- package/dist/ui/assets/page-data-cache-D5B-w9R_.js +0 -1
- package/dist/ui/assets/repo-ylBK5CI4.js +0 -62
- package/dist/ui/assets/stateDiagram-v2-MP3YSRHH-CiRUf2W9.js +0 -1
- package/dist/ui/assets/swimlanesDiagram-VR7AAH4N-D0VGDe_Q.js +0 -8
- package/dist/ui/assets/time-8KGOT2-i.js +0 -1
package/dist/.build-info.json
CHANGED
package/dist/.build-stamp.json
CHANGED
package/dist/commands/check.d.ts
CHANGED
|
@@ -316,6 +316,9 @@ export declare function testFileFilterArgs(testScript: string | undefined, files
|
|
|
316
316
|
* having verified nothing at all.
|
|
317
317
|
*/
|
|
318
318
|
export declare function changedPathsSince(repoRoot: string, ref: string): string[] | null;
|
|
319
|
+
type TrackedSourceSnapshot = Map<string, string>;
|
|
320
|
+
/** Snapshot tracked worktree changes relative to HEAD, ignoring bookkeeping roots. */
|
|
321
|
+
export declare function trackedSourceSnapshot(repoRoot: string, cfg: RepoOSConfig): Promise<TrackedSourceSnapshot | null>;
|
|
319
322
|
export interface RunPlanOptions {
|
|
320
323
|
repoRoot: string;
|
|
321
324
|
/** Child-only environment for check steps. */
|
package/dist/commands/check.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { isDocsOnlyCheck, DOCS_ONLY_SKIP_REASON } from "../core/check-docs-only.js";
|
|
2
2
|
import { buildIndex } from "../core/indexer.js";
|
|
3
|
+
import { runGit } from "../core/git.js";
|
|
4
|
+
import { gitDirectorySnapshot } from "../core/git-directory-snapshot.js";
|
|
3
5
|
import { checkSnapshot, compatibleCheckSnapshots, } from "../core/check-reuse.js";
|
|
6
|
+
import { checkGateBookkeepingPrefix, checkGateHeadDriftAllowed, } from "../core/check-gate-bookkeeping.js";
|
|
4
7
|
import { STEP_TIMING_MARKER } from "../core/check-timings.js";
|
|
5
8
|
/**
|
|
6
9
|
* `repoos check` — the definition-of-done gate.
|
|
@@ -30,7 +33,8 @@ import { STEP_TIMING_MARKER } from "../core/check-timings.js";
|
|
|
30
33
|
* agent pre-review.
|
|
31
34
|
*/
|
|
32
35
|
import { execFileSync } from "node:child_process";
|
|
33
|
-
import {
|
|
36
|
+
import { createHash } from "node:crypto";
|
|
37
|
+
import { existsSync, lstatSync, readFileSync, readlinkSync, readdirSync } from "node:fs";
|
|
34
38
|
import { cpus, totalmem } from "node:os";
|
|
35
39
|
import { isAbsolute, join, relative, sep } from "node:path";
|
|
36
40
|
import { c } from "../cli/colors.js";
|
|
@@ -47,9 +51,10 @@ import { formatFixCommand } from "../core/check-format.js";
|
|
|
47
51
|
import { writeCheckRun } from "../core/check-results-store.js";
|
|
48
52
|
import { buildProjectConsumerEnv } from "../core/project-environments.js";
|
|
49
53
|
import { extractFailedTests } from "../core/check-failure-summary.js";
|
|
50
|
-
import { resolveCheckRunAttribution, resolveCheckStoreRoot, getCheckStore, localMachineName, } from "../core/check-store.js";
|
|
54
|
+
import { resolveCheckRunAttribution, resolveCheckStoreRoot, getCheckStore, localMachineName, taskIdFromWorktreeBranch, } from "../core/check-store.js";
|
|
51
55
|
import { Logger } from "../core/logger.js";
|
|
52
56
|
import { boardRootForEngineerRemote, boardTaskAbsPath, commitWipCheckpointForRemoteGate, isManagedEngineerCheck, runEngineerRemoteSelfCheckGate, } from "../server/engineer-remote-self-check.js";
|
|
57
|
+
import { acquireCheckGateLock } from "../server/check-gate-lock.js";
|
|
53
58
|
import { createRemoteValidator } from "../server/remote-validation.js";
|
|
54
59
|
import { runRemotePreReviewGate, standaloneCliCanUseRemote, remoteValidationAlreadyAttempted, uncommittedFilesBlockingRemoteGate, shouldRunCliRemotePreReviewGate, summarizeRemoteFallbackDetail, REPOOS_REMOTE_FALLBACK_DETAIL, REPOOS_CHECK_GATE_NOTE, } from "../server/pre-review-remote-gate.js";
|
|
55
60
|
import { acquireLocalCheckSlot, SlotQueueTimeoutError } from "../core/local-gates.js";
|
|
@@ -1669,6 +1674,65 @@ export function changedPathsSince(repoRoot, ref) {
|
|
|
1669
1674
|
return null;
|
|
1670
1675
|
return [...new Set(lists.flatMap((list) => list ?? []))];
|
|
1671
1676
|
}
|
|
1677
|
+
/** Snapshot tracked worktree changes relative to HEAD, ignoring bookkeeping roots. */
|
|
1678
|
+
export async function trackedSourceSnapshot(repoRoot, cfg) {
|
|
1679
|
+
const { work, cache } = checkGateBookkeepingPrefix(cfg);
|
|
1680
|
+
const result = await runGit(repoRoot, ["ls-files", "-z", "--cached", "--others", "--exclude-standard"], 15_000);
|
|
1681
|
+
if (result.status !== 0)
|
|
1682
|
+
return null;
|
|
1683
|
+
const fields = result.stdout.split("\0");
|
|
1684
|
+
const snapshot = new Map();
|
|
1685
|
+
for (const path of fields.filter(Boolean)) {
|
|
1686
|
+
if (path.startsWith(work) || path.startsWith(cache))
|
|
1687
|
+
continue;
|
|
1688
|
+
const absolute = join(repoRoot, path);
|
|
1689
|
+
try {
|
|
1690
|
+
const stat = lstatSync(absolute);
|
|
1691
|
+
if (stat.isSymbolicLink()) {
|
|
1692
|
+
snapshot.set(path, `symlink:${readlinkSync(absolute)}`);
|
|
1693
|
+
}
|
|
1694
|
+
else if (stat.isDirectory()) {
|
|
1695
|
+
const directory = await gitDirectorySnapshot(repoRoot, path, stat.mode & 0o777);
|
|
1696
|
+
if (directory === null)
|
|
1697
|
+
return null;
|
|
1698
|
+
snapshot.set(path, directory);
|
|
1699
|
+
}
|
|
1700
|
+
else if (stat.isFile()) {
|
|
1701
|
+
const content = readFileSync(absolute);
|
|
1702
|
+
snapshot.set(path, `${stat.mode & 0o777}:${createHash("sha256").update(content).digest("hex")}`);
|
|
1703
|
+
}
|
|
1704
|
+
else {
|
|
1705
|
+
snapshot.set(path, `non-regular:${stat.mode & 0o777}:${stat.size}:${stat.mtimeMs}`);
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
catch (error) {
|
|
1709
|
+
// A tracked file deleted during the check remains in the snapshot as a
|
|
1710
|
+
// missing marker, so creation/deletion and content changes are visible.
|
|
1711
|
+
if (error.code === "ENOENT")
|
|
1712
|
+
snapshot.set(path, "<missing>");
|
|
1713
|
+
else
|
|
1714
|
+
return null;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
return snapshot;
|
|
1718
|
+
}
|
|
1719
|
+
function trackedSourceSnapshotDrift(before, after) {
|
|
1720
|
+
if (!before || !after) {
|
|
1721
|
+
return {
|
|
1722
|
+
ok: false,
|
|
1723
|
+
reason: "Could not compare tracked source files before and after the check.",
|
|
1724
|
+
paths: ["<paths unavailable>"],
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
const changedPaths = [...new Set([...before.keys(), ...after.keys()])].filter((path) => before.get(path) !== after.get(path));
|
|
1728
|
+
if (changedPaths.length === 0)
|
|
1729
|
+
return { ok: true };
|
|
1730
|
+
return {
|
|
1731
|
+
ok: false,
|
|
1732
|
+
reason: `Tracked source files changed in the working tree during the check: ${changedPaths.join(", ")}`,
|
|
1733
|
+
paths: changedPaths,
|
|
1734
|
+
};
|
|
1735
|
+
}
|
|
1672
1736
|
function planSourceLabel(plan) {
|
|
1673
1737
|
switch (plan.source) {
|
|
1674
1738
|
case "declared":
|
|
@@ -2033,6 +2097,40 @@ export async function cmdCheck(argv = []) {
|
|
|
2033
2097
|
}
|
|
2034
2098
|
}
|
|
2035
2099
|
const validationStart = await checkSnapshot(repoRoot, changedRef);
|
|
2100
|
+
// Own one task-worktree holder across remote validation and the local plan.
|
|
2101
|
+
// The managed remote helper takes a nested holder for its own operation; this
|
|
2102
|
+
// outer holder keeps bookkeeping deferred until the local half has finished.
|
|
2103
|
+
// A plain `repoos check` discovers its task from the checked-out branch and
|
|
2104
|
+
// task file, so it gets the same protection without agent environment vars.
|
|
2105
|
+
const gateTaskId = isManagedEngineerCheck(process.env)
|
|
2106
|
+
? runContext.taskId
|
|
2107
|
+
: taskIdFromWorktreeBranch(repoRoot, cfg.workDir);
|
|
2108
|
+
const checkHeadAtStartResult = await runGit(repoRoot, ["rev-parse", "HEAD"], 10_000);
|
|
2109
|
+
const checkHeadAtStart = checkHeadAtStartResult.status === 0 ? checkHeadAtStartResult.stdout.trim() : null;
|
|
2110
|
+
if (gateTaskId && !checkHeadAtStart) {
|
|
2111
|
+
throw new Error("could not read HEAD before task self-check");
|
|
2112
|
+
}
|
|
2113
|
+
let selfCheckLock = null;
|
|
2114
|
+
if (gateTaskId) {
|
|
2115
|
+
const branch = await runGit(repoRoot, ["branch", "--show-current"], 10_000);
|
|
2116
|
+
if (branch.status !== 0 || !branch.stdout.trim()) {
|
|
2117
|
+
throw new Error("could not resolve task branch for check-gate lock");
|
|
2118
|
+
}
|
|
2119
|
+
const boardRoot = boardRootForEngineerRemote(repoRoot);
|
|
2120
|
+
const gateConfig = loadConfig(boardRoot);
|
|
2121
|
+
selfCheckLock = await acquireCheckGateLock({
|
|
2122
|
+
boardRoot,
|
|
2123
|
+
cacheDir: gateConfig.cacheDir ?? ".repoos",
|
|
2124
|
+
taskId: gateTaskId,
|
|
2125
|
+
branch: branch.stdout.trim(),
|
|
2126
|
+
worktree: repoRoot,
|
|
2127
|
+
kind: "engineer-self-check",
|
|
2128
|
+
config: gateConfig,
|
|
2129
|
+
});
|
|
2130
|
+
if (!selfCheckLock.ok)
|
|
2131
|
+
throw new Error(selfCheckLock.reason);
|
|
2132
|
+
}
|
|
2133
|
+
const trackedSourceAtStart = gateTaskId ? await trackedSourceSnapshot(repoRoot, cfg) : null;
|
|
2036
2134
|
let remoteTestsPassed = false;
|
|
2037
2135
|
// The plan never runs when the remote gate fails, so the normal end-of-run
|
|
2038
2136
|
// record is never written: persist the failure for the Checks surface too,
|
|
@@ -2169,6 +2267,16 @@ export async function cmdCheck(argv = []) {
|
|
|
2169
2267
|
}
|
|
2170
2268
|
}
|
|
2171
2269
|
}
|
|
2270
|
+
catch (error) {
|
|
2271
|
+
// Remote failures can exit before the local plan's finally is reached.
|
|
2272
|
+
// Drop this holder on ordinary thrown errors; abrupt process termination
|
|
2273
|
+
// is recovered through the stale-lock path.
|
|
2274
|
+
if (selfCheckLock?.ok) {
|
|
2275
|
+
await selfCheckLock.release();
|
|
2276
|
+
selfCheckLock = null;
|
|
2277
|
+
}
|
|
2278
|
+
throw error;
|
|
2279
|
+
}
|
|
2172
2280
|
finally {
|
|
2173
2281
|
if (prevStoreRoot === undefined)
|
|
2174
2282
|
delete process.env.REPOOS_CHECK_STORE_ROOT;
|
|
@@ -2197,6 +2305,10 @@ export async function cmdCheck(argv = []) {
|
|
|
2197
2305
|
for (const holder of holders) {
|
|
2198
2306
|
console.log(c.dim(` slot ${holder.slot}: pid ${holder.pid ?? "unknown"}, ${Math.round(holder.ageMs / 1000)}s${holder.dead ? " (process exited; reclaiming)" : holder.wedged ? ` (no recent heartbeat; last seen ${Math.round(holder.heartbeatAgeMs / 1000)}s ago)` : ""}`));
|
|
2199
2307
|
}
|
|
2308
|
+
if (selfCheckLock?.ok) {
|
|
2309
|
+
await selfCheckLock.release();
|
|
2310
|
+
selfCheckLock = null;
|
|
2311
|
+
}
|
|
2200
2312
|
process.exit(1);
|
|
2201
2313
|
}
|
|
2202
2314
|
waitRecord = waits.finish();
|
|
@@ -2232,6 +2344,7 @@ export async function cmdCheck(argv = []) {
|
|
|
2232
2344
|
const completedSteps = [];
|
|
2233
2345
|
let results;
|
|
2234
2346
|
let finalProgress;
|
|
2347
|
+
let gateDriftResult = { ok: true };
|
|
2235
2348
|
try {
|
|
2236
2349
|
if (process.env.REPOOS_AGENT === "1") {
|
|
2237
2350
|
applyEngineerResourceEnv(checkEnv, cfg);
|
|
@@ -2280,6 +2393,38 @@ export async function cmdCheck(argv = []) {
|
|
|
2280
2393
|
}
|
|
2281
2394
|
},
|
|
2282
2395
|
});
|
|
2396
|
+
if (gateTaskId && checkHeadAtStart) {
|
|
2397
|
+
const endHead = await runGit(repoRoot, ["rev-parse", "HEAD"], 10_000);
|
|
2398
|
+
gateDriftResult = await checkGateHeadDriftAllowed(repoRoot, cfg, gateTaskId, checkHeadAtStart, endHead.status === 0 ? endHead.stdout.trim() : "<HEAD unavailable>");
|
|
2399
|
+
const sourceTreeDrift = trackedSourceSnapshotDrift(trackedSourceAtStart, await trackedSourceSnapshot(repoRoot, cfg));
|
|
2400
|
+
if (!sourceTreeDrift.ok) {
|
|
2401
|
+
gateDriftResult = {
|
|
2402
|
+
ok: false,
|
|
2403
|
+
reason: [!gateDriftResult.ok ? gateDriftResult.reason : "", sourceTreeDrift.reason]
|
|
2404
|
+
.filter(Boolean)
|
|
2405
|
+
.join("; "),
|
|
2406
|
+
affectingPaths: [
|
|
2407
|
+
...new Set([
|
|
2408
|
+
...(!gateDriftResult.ok ? (gateDriftResult.affectingPaths ?? []) : []),
|
|
2409
|
+
...sourceTreeDrift.paths,
|
|
2410
|
+
]),
|
|
2411
|
+
],
|
|
2412
|
+
};
|
|
2413
|
+
}
|
|
2414
|
+
if (!gateDriftResult.ok) {
|
|
2415
|
+
const result = {
|
|
2416
|
+
name: "worktree-drift",
|
|
2417
|
+
status: "failed",
|
|
2418
|
+
detail: gateDriftResult.reason,
|
|
2419
|
+
output: gateDriftResult.reason,
|
|
2420
|
+
durationMs: 0,
|
|
2421
|
+
required: true,
|
|
2422
|
+
};
|
|
2423
|
+
results.push(result);
|
|
2424
|
+
completedSteps.push({ name: result.name, status: result.status, durationMs: 0 });
|
|
2425
|
+
console.log(c.red(` ✗ ${result.name} — ${result.detail}`));
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2283
2428
|
}
|
|
2284
2429
|
catch (e) {
|
|
2285
2430
|
// The plan runner is not expected to throw, but if it does the normal
|
|
@@ -2308,6 +2453,8 @@ export async function cmdCheck(argv = []) {
|
|
|
2308
2453
|
if (process.env.REPOOS_AGENT === "1")
|
|
2309
2454
|
delete process.env.REPOOS_LOCAL_CHECK_SLOT_HELD;
|
|
2310
2455
|
releaseLocalCheck?.();
|
|
2456
|
+
if (selfCheckLock?.ok)
|
|
2457
|
+
await selfCheckLock.release();
|
|
2311
2458
|
}
|
|
2312
2459
|
// ── Summary ─────────────────────────────────────────────────────────
|
|
2313
2460
|
const gatingFailures = results.filter((r) => r.required && r.status !== "passed" && r.status !== "skipped");
|
|
@@ -2385,6 +2532,7 @@ export async function cmdCheck(argv = []) {
|
|
|
2385
2532
|
!opts.steps?.length &&
|
|
2386
2533
|
profile === (plan.defaultProfile || DEFAULT_PROFILE) &&
|
|
2387
2534
|
testsProven &&
|
|
2535
|
+
gateDriftResult.ok &&
|
|
2388
2536
|
(await compatibleCheckSnapshots(repoRoot, validationStart, validationEnd))
|
|
2389
2537
|
? validationStart
|
|
2390
2538
|
: null;
|
|
@@ -1,14 +1,92 @@
|
|
|
1
1
|
export { launcherScript } from "../core/launcher-runtime.js";
|
|
2
|
+
/**
|
|
3
|
+
* The directory containing cli/, core/, server/, ui/, .build-info.json — dist/
|
|
4
|
+
* in a source checkout, or the whole install root for a standalone install.
|
|
5
|
+
* Exported so the server's install detection starts from the same root.
|
|
6
|
+
*/
|
|
7
|
+
export declare function installRoot(): string;
|
|
8
|
+
/**
|
|
9
|
+
* The version in the install's own `.build-info.json`, or null when there is
|
|
10
|
+
* none — the same read `cmdUpgrade` uses. Exported so the server's install
|
|
11
|
+
* detection passes identical input to `upgradeInstruction` and never disagrees
|
|
12
|
+
* with the CLI on the same checkout (#1073 review).
|
|
13
|
+
*/
|
|
14
|
+
export declare function readInstallVersion(root: string): string | null;
|
|
2
15
|
export interface PackageManagerUpgrade {
|
|
3
16
|
label: string;
|
|
4
17
|
command: string;
|
|
5
18
|
}
|
|
19
|
+
/** How this RepoOS was installed, as far as `repoos upgrade` can tell (#1073). */
|
|
20
|
+
export type InstallKind = "standalone" | "source" | "package-manager";
|
|
21
|
+
/** The upgrade instruction a user should run, and how we decided it. */
|
|
22
|
+
export interface UpgradeInstruction {
|
|
23
|
+
installKind: InstallKind;
|
|
24
|
+
/** Package-manager label (e.g. "Homebrew") — only set for `package-manager`. */
|
|
25
|
+
packageManager: string | null;
|
|
26
|
+
/** The exact command/instruction, ready to copy into a terminal. */
|
|
27
|
+
command: string;
|
|
28
|
+
}
|
|
29
|
+
/** The command shown for a source checkout — the same one `repoos upgrade` prints. */
|
|
30
|
+
export declare const SOURCE_UPGRADE_COMMAND = "git pull && bun install && bun run build";
|
|
31
|
+
/**
|
|
32
|
+
* Whether `root` is a source checkout's build output rather than a standalone
|
|
33
|
+
* install (#1073 review).
|
|
34
|
+
*
|
|
35
|
+
* The version alone cannot tell them apart: `scripts/copy-assets.mjs` writes
|
|
36
|
+
* `package.json`'s version into `dist/.build-info.json` on every source build,
|
|
37
|
+
* so a built checkout looks exactly like a curl install. The reliable signal is
|
|
38
|
+
* structure: a checkout's install root is `<repo>/dist` (or `<repo>/src` for a
|
|
39
|
+
* `bun src/...` run), and its parent holds `src/` + `package.json`, or a `.git`
|
|
40
|
+
* directory. A standalone install's parent holds neither.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isSourceCheckout(root: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The prerelease channel a version belongs to (`0.6.0-beta.1` → `"beta"`), or
|
|
45
|
+
* null for a stable version. Release tags carry the channel as the prerelease
|
|
46
|
+
* identifier, so an installed channel build is how the update dialog knows to
|
|
47
|
+
* offer `repoos upgrade --channel <name>` (docs/releases.md).
|
|
48
|
+
*/
|
|
49
|
+
export declare function channelFromVersion(version: string | null): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* The install instruction for a checkout, matching `cmdUpgrade`'s own
|
|
52
|
+
* detection so the dashboard dialog and the CLI never disagree (#1073).
|
|
53
|
+
* Pure and exported: the server calls it to fill `upgradeCommand` /
|
|
54
|
+
* `installKind` on `GET /api/release/available`, and #1072 reuses it.
|
|
55
|
+
*
|
|
56
|
+
* Detection order mirrors `cmdUpgrade`:
|
|
57
|
+
* 1. a recognized package-manager path → that manager's update command;
|
|
58
|
+
* 2. a source checkout (`isSourceCheckout`) or no `.build-info.json`
|
|
59
|
+
* (`version` is null) → the source-checkout command;
|
|
60
|
+
* 3. otherwise → standalone (curl) install, with the channel form when the
|
|
61
|
+
* installed version is a prerelease.
|
|
62
|
+
*
|
|
63
|
+
* `sourceCheckout` overrides the filesystem probe for tests; production callers
|
|
64
|
+
* omit it.
|
|
65
|
+
*/
|
|
66
|
+
export declare function upgradeInstruction(input: {
|
|
67
|
+
installRoot: string;
|
|
68
|
+
version: string | null;
|
|
69
|
+
channel?: string | null;
|
|
70
|
+
sourceCheckout?: boolean;
|
|
71
|
+
}): UpgradeInstruction;
|
|
6
72
|
/**
|
|
7
73
|
* Infer the package manager from the installed package path. `root` is the
|
|
8
74
|
* compiled dist/ directory, so it keeps enough of the global-install path to
|
|
9
75
|
* distinguish Homebrew, mise, Bun, pnpm, and npm.
|
|
10
76
|
*/
|
|
11
77
|
export declare function packageManagerUpgrade(root: string): PackageManagerUpgrade | null;
|
|
78
|
+
interface ReleaseAsset {
|
|
79
|
+
name: string;
|
|
80
|
+
browser_download_url: string;
|
|
81
|
+
}
|
|
82
|
+
export interface Release {
|
|
83
|
+
tag_name: string;
|
|
84
|
+
assets: ReleaseAsset[];
|
|
85
|
+
prerelease?: boolean;
|
|
86
|
+
html_url?: string;
|
|
87
|
+
/** GitHub release body — the notes authored in the "Cut a release" modal (#0361), when set. */
|
|
88
|
+
body?: string | null;
|
|
89
|
+
}
|
|
12
90
|
/**
|
|
13
91
|
* The release notes to print after an upgrade, or null when there's nothing
|
|
14
92
|
* to show — GitHub returns `body` as `null`/absent for a release cut with an
|
|
@@ -16,4 +94,15 @@ export declare function packageManagerUpgrade(root: string): PackageManagerUpgra
|
|
|
16
94
|
* stay silent then, not print an empty line or "no notes available" filler.
|
|
17
95
|
*/
|
|
18
96
|
export declare function releaseNotesToPrint(body: string | null | undefined): string | null;
|
|
97
|
+
/**
|
|
98
|
+
* `GET /releases/latest` always excludes prereleases (GitHub's own rule, not
|
|
99
|
+
* configurable) — release.yml marks any tag with a "-" (v0.6.0-beta.1,
|
|
100
|
+
* -canary.N, -rc.N) as a prerelease, exactly so stable users never get handed
|
|
101
|
+
* one from this endpoint. A channel opt-in has to use the list endpoint
|
|
102
|
+
* instead and find its own match.
|
|
103
|
+
*
|
|
104
|
+
* Exported so the update dialog's banner (#1073) compares against exactly the
|
|
105
|
+
* release `repoos upgrade --channel <name>` would install.
|
|
106
|
+
*/
|
|
107
|
+
export declare function fetchLatestRelease(channel: string | null, signal?: AbortSignal): Promise<Release>;
|
|
19
108
|
export declare function cmdUpgrade(args: string[]): Promise<void>;
|
package/dist/commands/upgrade.js
CHANGED
|
@@ -15,11 +15,21 @@ import { c } from "../cli/colors.js";
|
|
|
15
15
|
import { launcherScript } from "../core/launcher-runtime.js";
|
|
16
16
|
export { launcherScript } from "../core/launcher-runtime.js";
|
|
17
17
|
const REPO = "repo-os/repoos";
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The directory containing cli/, core/, server/, ui/, .build-info.json — dist/
|
|
20
|
+
* in a source checkout, or the whole install root for a standalone install.
|
|
21
|
+
* Exported so the server's install detection starts from the same root.
|
|
22
|
+
*/
|
|
23
|
+
export function installRoot() {
|
|
20
24
|
return dirname(dirname(fileURLToPath(import.meta.url)));
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The version in the install's own `.build-info.json`, or null when there is
|
|
28
|
+
* none — the same read `cmdUpgrade` uses. Exported so the server's install
|
|
29
|
+
* detection passes identical input to `upgradeInstruction` and never disagrees
|
|
30
|
+
* with the CLI on the same checkout (#1073 review).
|
|
31
|
+
*/
|
|
32
|
+
export function readInstallVersion(root) {
|
|
23
33
|
try {
|
|
24
34
|
const info = JSON.parse(readFileSync(join(root, ".build-info.json"), "utf8"));
|
|
25
35
|
return info.version ?? null;
|
|
@@ -28,6 +38,78 @@ function readVersion(root) {
|
|
|
28
38
|
return null;
|
|
29
39
|
}
|
|
30
40
|
}
|
|
41
|
+
/** The command shown for a source checkout — the same one `repoos upgrade` prints. */
|
|
42
|
+
export const SOURCE_UPGRADE_COMMAND = "git pull && bun install && bun run build";
|
|
43
|
+
/**
|
|
44
|
+
* Whether `root` is a source checkout's build output rather than a standalone
|
|
45
|
+
* install (#1073 review).
|
|
46
|
+
*
|
|
47
|
+
* The version alone cannot tell them apart: `scripts/copy-assets.mjs` writes
|
|
48
|
+
* `package.json`'s version into `dist/.build-info.json` on every source build,
|
|
49
|
+
* so a built checkout looks exactly like a curl install. The reliable signal is
|
|
50
|
+
* structure: a checkout's install root is `<repo>/dist` (or `<repo>/src` for a
|
|
51
|
+
* `bun src/...` run), and its parent holds `src/` + `package.json`, or a `.git`
|
|
52
|
+
* directory. A standalone install's parent holds neither.
|
|
53
|
+
*/
|
|
54
|
+
export function isSourceCheckout(root) {
|
|
55
|
+
const parent = dirname(root);
|
|
56
|
+
try {
|
|
57
|
+
if (existsSync(join(parent, ".git")))
|
|
58
|
+
return true;
|
|
59
|
+
return existsSync(join(parent, "src")) && existsSync(join(parent, "package.json"));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The prerelease channel a version belongs to (`0.6.0-beta.1` → `"beta"`), or
|
|
67
|
+
* null for a stable version. Release tags carry the channel as the prerelease
|
|
68
|
+
* identifier, so an installed channel build is how the update dialog knows to
|
|
69
|
+
* offer `repoos upgrade --channel <name>` (docs/releases.md).
|
|
70
|
+
*/
|
|
71
|
+
export function channelFromVersion(version) {
|
|
72
|
+
if (!version)
|
|
73
|
+
return null;
|
|
74
|
+
const match = version.trim().match(/^\d+\.\d+\.\d+-([A-Za-z]+)\./);
|
|
75
|
+
return match ? match[1] : null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The install instruction for a checkout, matching `cmdUpgrade`'s own
|
|
79
|
+
* detection so the dashboard dialog and the CLI never disagree (#1073).
|
|
80
|
+
* Pure and exported: the server calls it to fill `upgradeCommand` /
|
|
81
|
+
* `installKind` on `GET /api/release/available`, and #1072 reuses it.
|
|
82
|
+
*
|
|
83
|
+
* Detection order mirrors `cmdUpgrade`:
|
|
84
|
+
* 1. a recognized package-manager path → that manager's update command;
|
|
85
|
+
* 2. a source checkout (`isSourceCheckout`) or no `.build-info.json`
|
|
86
|
+
* (`version` is null) → the source-checkout command;
|
|
87
|
+
* 3. otherwise → standalone (curl) install, with the channel form when the
|
|
88
|
+
* installed version is a prerelease.
|
|
89
|
+
*
|
|
90
|
+
* `sourceCheckout` overrides the filesystem probe for tests; production callers
|
|
91
|
+
* omit it.
|
|
92
|
+
*/
|
|
93
|
+
export function upgradeInstruction(input) {
|
|
94
|
+
const packageManager = packageManagerUpgrade(input.installRoot);
|
|
95
|
+
if (packageManager) {
|
|
96
|
+
return {
|
|
97
|
+
installKind: "package-manager",
|
|
98
|
+
packageManager: packageManager.label,
|
|
99
|
+
command: packageManager.command,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const source = input.sourceCheckout ?? isSourceCheckout(input.installRoot);
|
|
103
|
+
if (source || input.version === null) {
|
|
104
|
+
return { installKind: "source", packageManager: null, command: SOURCE_UPGRADE_COMMAND };
|
|
105
|
+
}
|
|
106
|
+
const channel = input.channel ?? null;
|
|
107
|
+
return {
|
|
108
|
+
installKind: "standalone",
|
|
109
|
+
packageManager: null,
|
|
110
|
+
command: channel ? `repoos upgrade --channel ${channel}` : "repoos upgrade",
|
|
111
|
+
};
|
|
112
|
+
}
|
|
31
113
|
/**
|
|
32
114
|
* Infer the package manager from the installed package path. `root` is the
|
|
33
115
|
* compiled dist/ directory, so it keeps enough of the global-install path to
|
|
@@ -77,16 +159,19 @@ function parseChannel(args) {
|
|
|
77
159
|
* -canary.N, -rc.N) as a prerelease, exactly so stable users never get handed
|
|
78
160
|
* one from this endpoint. A channel opt-in has to use the list endpoint
|
|
79
161
|
* instead and find its own match.
|
|
162
|
+
*
|
|
163
|
+
* Exported so the update dialog's banner (#1073) compares against exactly the
|
|
164
|
+
* release `repoos upgrade --channel <name>` would install.
|
|
80
165
|
*/
|
|
81
|
-
async function fetchLatestRelease(channel) {
|
|
166
|
+
export async function fetchLatestRelease(channel, signal) {
|
|
82
167
|
if (!channel) {
|
|
83
|
-
const res = await fetch(`https://api.github.com/repos/${REPO}/releases/latest
|
|
168
|
+
const res = await fetch(`https://api.github.com/repos/${REPO}/releases/latest`, { signal });
|
|
84
169
|
if (!res.ok)
|
|
85
170
|
throw new Error(`GitHub API returned ${res.status}`);
|
|
86
171
|
return (await res.json());
|
|
87
172
|
}
|
|
88
173
|
// Newest first by default; the first tag matching "-<channel>." wins.
|
|
89
|
-
const res = await fetch(`https://api.github.com/repos/${REPO}/releases?per_page=30
|
|
174
|
+
const res = await fetch(`https://api.github.com/repos/${REPO}/releases?per_page=30`, { signal });
|
|
90
175
|
if (!res.ok)
|
|
91
176
|
throw new Error(`GitHub API returned ${res.status}`);
|
|
92
177
|
const releases = (await res.json());
|
|
@@ -98,22 +183,26 @@ async function fetchLatestRelease(channel) {
|
|
|
98
183
|
export async function cmdUpgrade(args) {
|
|
99
184
|
const root = installRoot();
|
|
100
185
|
const channel = parseChannel(args);
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
186
|
+
const instruction = upgradeInstruction({
|
|
187
|
+
installRoot: root,
|
|
188
|
+
version: readInstallVersion(root),
|
|
189
|
+
channel,
|
|
190
|
+
});
|
|
191
|
+
if (instruction.installKind === "package-manager") {
|
|
192
|
+
console.log(c.yellow(` repoos was installed with ${instruction.packageManager}.`));
|
|
104
193
|
console.log(c.dim(" Update it with:"));
|
|
105
|
-
console.log(c.dim(` ${
|
|
194
|
+
console.log(c.dim(` ${instruction.command}`));
|
|
106
195
|
if (channel) {
|
|
107
196
|
console.log(c.dim(` --channel ${channel} only applies to standalone curl installs.`));
|
|
108
197
|
}
|
|
109
198
|
return;
|
|
110
199
|
}
|
|
111
|
-
|
|
112
|
-
if (!current) {
|
|
200
|
+
if (instruction.installKind === "source") {
|
|
113
201
|
console.log(c.yellow(" repoos appears to be running from a source checkout, not a standalone install."));
|
|
114
|
-
console.log(c.dim(
|
|
202
|
+
console.log(c.dim(` Update it with: ${instruction.command}`));
|
|
115
203
|
return;
|
|
116
204
|
}
|
|
205
|
+
const current = readInstallVersion(root);
|
|
117
206
|
console.log(c.dim(` Current version: v${current}`));
|
|
118
207
|
console.log(c.dim(channel ? ` Checking latest "${channel}" release…` : " Checking latest release…"));
|
|
119
208
|
let release;
|
|
@@ -186,9 +186,8 @@ export function resolveActiveEngineerCardHint(input) {
|
|
|
186
186
|
blocksAgentInterrupt: false,
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
const activity = input.agentSilentMs !== null ? formatCardDuration(input.agentSilentMs) : null;
|
|
190
189
|
return {
|
|
191
|
-
label:
|
|
190
|
+
label: "coding",
|
|
192
191
|
title: "Agent is making code changes — click to watch the session",
|
|
193
192
|
cls: "tc-coding",
|
|
194
193
|
blocksAgentInterrupt: false,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paths and commit chains that must not invalidate a running check gate (#1061).
|
|
3
|
+
*
|
|
4
|
+
* Bookkeeping under `work/**` and the cache dir cannot change build or test
|
|
5
|
+
* outcomes. Commits touching any other path invalidate the gate (#1061).
|
|
6
|
+
*/
|
|
7
|
+
import type { RepoOSConfig } from "./types.js";
|
|
8
|
+
export declare function checkGateBookkeepingPrefix(config: Pick<RepoOSConfig, "workDir" | "cacheDir">): {
|
|
9
|
+
work: string;
|
|
10
|
+
cache: string;
|
|
11
|
+
};
|
|
12
|
+
/** True when a path change cannot affect check results during a gate run. */
|
|
13
|
+
export declare function isCheckGateBookkeepingPath(path: string, config: Pick<RepoOSConfig, "workDir" | "cacheDir">): boolean;
|
|
14
|
+
export type CheckGateHeadDrift = {
|
|
15
|
+
ok: true;
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
reason: string;
|
|
19
|
+
affectingPaths?: string[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether `afterHead` is an acceptable drift from `beforeHead` for a gate that
|
|
23
|
+
* started at `beforeHead`. Fails closed when git cannot list changed paths.
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkGateHeadDriftAllowed(workdir: string, config: RepoOSConfig, taskId: string, beforeHead: string, afterHead: string): Promise<CheckGateHeadDrift>;
|