@forgecart/cli 2.202610141555.0 → 2.202610141948.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 (42) hide show
  1. package/dist/src/admin-api/admin-api.answer.d.ts +26 -0
  2. package/dist/src/admin-api/admin-api.answer.js +43 -0
  3. package/dist/src/admin-api/admin-api.answer.js.map +1 -0
  4. package/dist/src/admin-api/admin-api.client.d.ts +6 -4
  5. package/dist/src/admin-api/admin-api.client.js +19 -15
  6. package/dist/src/admin-api/admin-api.client.js.map +1 -1
  7. package/dist/src/admin-api/admin-api.result.d.ts +15 -9
  8. package/dist/src/admin-api/admin-api.result.js +45 -30
  9. package/dist/src/admin-api/admin-api.result.js.map +1 -1
  10. package/dist/src/authorization/cli-authorization.client.d.ts +4 -3
  11. package/dist/src/authorization/cli-authorization.client.js +18 -13
  12. package/dist/src/authorization/cli-authorization.client.js.map +1 -1
  13. package/dist/src/commands/sync.js +1 -1
  14. package/dist/src/commands/sync.js.map +1 -1
  15. package/dist/src/sync/sync-bundle-push.d.ts +15 -3
  16. package/dist/src/sync/sync-bundle-push.js +45 -2
  17. package/dist/src/sync/sync-bundle-push.js.map +1 -1
  18. package/dist/src/sync/sync-record.file.d.ts +27 -3
  19. package/dist/src/sync/sync-record.file.js +77 -25
  20. package/dist/src/sync/sync-record.file.js.map +1 -1
  21. package/dist/src/sync/sync-rejection.d.ts +24 -0
  22. package/dist/src/sync/sync-rejection.js +58 -0
  23. package/dist/src/sync/sync-rejection.js.map +1 -0
  24. package/dist/src/sync/sync-repository.d.ts +9 -1
  25. package/dist/src/sync/sync-repository.js +23 -1
  26. package/dist/src/sync/sync-repository.js.map +1 -1
  27. package/dist/src/sync/sync-round-follow.d.ts +42 -0
  28. package/dist/src/sync/sync-round-follow.js +128 -0
  29. package/dist/src/sync/sync-round-follow.js.map +1 -0
  30. package/dist/src/sync/sync-round.d.ts +49 -8
  31. package/dist/src/sync/sync-round.js +134 -27
  32. package/dist/src/sync/sync-round.js.map +1 -1
  33. package/dist/src/sync/sync.runner.d.ts +4 -2
  34. package/dist/src/sync/sync.runner.js +6 -3
  35. package/dist/src/sync/sync.runner.js.map +1 -1
  36. package/dist/src/sync/type/sync.types.d.ts +78 -2
  37. package/dist/src/sync/type/sync.types.js +31 -0
  38. package/dist/src/sync/type/sync.types.js.map +1 -1
  39. package/dist/src/sync/workspace-sync.client.d.ts +29 -6
  40. package/dist/src/sync/workspace-sync.client.js +141 -21
  41. package/dist/src/sync/workspace-sync.client.js.map +1 -1
  42. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ import { print } from '../output.js';
2
+ import { SyncPushRoundPhase, SyncPushRoundState, SyncPushRoundStepStatus, } from './type/sync.types.js';
3
+ /** How long the follow waits between two reads of a running round — the cadence of the asking, never a bound. */
4
+ const ROUND_READ_INTERVAL_MS = 1000;
5
+ /** Milliseconds in a second — a step that took longer prints in seconds. */
6
+ const MS_PER_SECOND = 1000;
7
+ /** The width a progress line's label is padded to, as the plan's lines are. */
8
+ const LINE_LABEL_WIDTH = 10;
9
+ /** A commit id in print: its first twelve digits. */
10
+ const SHORT_SHA_LENGTH = 12;
11
+ /** The words a step prints by, phase by phase; a phase a later admin API added prints by its own name. */
12
+ const PHASE_LABELS = new Map([
13
+ [SyncPushRoundPhase.BUNDLE_ASSEMBLED, 'bundle assembly'],
14
+ [SyncPushRoundPhase.IMPORT, 'import'],
15
+ [SyncPushRoundPhase.COMPILE_GATE, 'compile gate'],
16
+ [SyncPushRoundPhase.DEPENDENCY_INSTALL, 'dependency install'],
17
+ [SyncPushRoundPhase.DEV_SERVER_RESTART, 'dev-server restart'],
18
+ [SyncPushRoundPhase.RUNTIME_SETTLE, 'runtime settle'],
19
+ [SyncPushRoundPhase.SEO_GATE, 'SEO gate'],
20
+ [SyncPushRoundPhase.APPLY, 'apply or restore'],
21
+ [SyncPushRoundPhase.ENV_MERGE, 'env merge'],
22
+ ]);
23
+ /**
24
+ * Follows a push's round to its verdict (factory task 2481): the push answered
25
+ * the round at once, and the workspace lands it on its own time — so the follow
26
+ * reads the round every {@link ROUND_READ_INTERVAL_MS}, each read its own
27
+ * exchange under `--timeout`, until it ended. Every step prints a line as it
28
+ * starts and another as it ends, with the time it took — a step the round
29
+ * skipped prints as skipped — in the order the round went through them, and
30
+ * then the verdict. A refusal the round ended on is the read's own error,
31
+ * exactly as the push would have answered it.
32
+ */
33
+ export class SyncRoundFollow {
34
+ client;
35
+ interrupt;
36
+ /**
37
+ * @param client the admin API the round is read from.
38
+ * @param interrupt ends the follow — the wait and the read in flight — when the run is interrupted.
39
+ */
40
+ constructor(client, interrupt) {
41
+ this.client = client;
42
+ this.interrupt = interrupt;
43
+ }
44
+ /** Follow `round`, as the push answered it, to its verdict. */
45
+ async verdictOf(round) {
46
+ const printed = new Map();
47
+ let current = round;
48
+ this.printSteps(current, printed);
49
+ while (current.state === SyncPushRoundState.RUNNING) {
50
+ await this.pause();
51
+ current = await this.client.round(current.id);
52
+ this.printSteps(current, printed);
53
+ }
54
+ return this.verdictPrinted(current);
55
+ }
56
+ /** Follow the round `roundId` a run cut off before its verdict left behind. */
57
+ async verdictOfRecorded(roundId) {
58
+ return this.verdictOf(await this.client.round(roundId));
59
+ }
60
+ /** Print every step whose standing changed since it last printed. */
61
+ printSteps(round, printed) {
62
+ for (const step of round.steps) {
63
+ if (printed.get(step.phase) === step.status)
64
+ continue;
65
+ printed.set(step.phase, step.status);
66
+ print(this.line('round', `${this.labelOf(step.phase)} ${this.standing(step)}`));
67
+ }
68
+ }
69
+ /** How a step stands, in words: started, ended with the time it took, or skipped. */
70
+ standing(step) {
71
+ if (step.status === SyncPushRoundStepStatus.STARTED)
72
+ return 'started';
73
+ if (step.status === SyncPushRoundStepStatus.SKIPPED)
74
+ return 'skipped';
75
+ if (step.elapsedMs === null)
76
+ return 'ended';
77
+ return `ended in ${this.elapsed(step.elapsedMs)}`;
78
+ }
79
+ /** The verdict an ended round carries, printed — an ended round without one is the admin API's broken contract. */
80
+ verdictPrinted(round) {
81
+ if (round.verdict === null) {
82
+ throw new Error(`The admin API ended the push's round ${round.id} without its verdict.`);
83
+ }
84
+ print(this.line('round', `verdict: ${this.verdictWords(round.verdict)}`));
85
+ return round.verdict;
86
+ }
87
+ /** What the round ended on, in words: the tree landed — on the serving commit it left, when it carried one — or rejected. */
88
+ verdictWords(verdict) {
89
+ if (!verdict.accepted)
90
+ return 'rejected — the workspace did not take the push';
91
+ if (verdict.servingSha === null)
92
+ return 'landed';
93
+ return `landed on serving ${verdict.servingSha.slice(0, SHORT_SHA_LENGTH)}`;
94
+ }
95
+ /** `ms` as a person reads it: milliseconds under a second, seconds to one decimal from there. */
96
+ elapsed(ms) {
97
+ if (ms < MS_PER_SECOND)
98
+ return `${String(ms)} ms`;
99
+ return `${(ms / MS_PER_SECOND).toFixed(1)} s`;
100
+ }
101
+ labelOf(phase) {
102
+ return PHASE_LABELS.get(phase) ?? phase.toLowerCase().replaceAll('_', ' ');
103
+ }
104
+ line(label, text) {
105
+ return ` ${label.padEnd(LINE_LABEL_WIDTH)} ${text}`;
106
+ }
107
+ /**
108
+ * Wait one read's interval. An interrupt ends the wait at once, and the read
109
+ * after it, given the same interrupt, ends the follow as interrupted.
110
+ */
111
+ async pause() {
112
+ const interrupt = this.interrupt;
113
+ if (interrupt.aborted)
114
+ return;
115
+ await new Promise((resolve) => {
116
+ const timer = setTimeout(() => {
117
+ interrupt.removeEventListener('abort', onInterrupt);
118
+ resolve();
119
+ }, ROUND_READ_INTERVAL_MS);
120
+ function onInterrupt() {
121
+ clearTimeout(timer);
122
+ resolve();
123
+ }
124
+ interrupt.addEventListener('abort', onInterrupt, { once: true });
125
+ });
126
+ }
127
+ }
128
+ //# sourceMappingURL=sync-round-follow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-round-follow.js","sourceRoot":"","sources":["../../../src/sync/sync-round-follow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,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K,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,IAAI,EAAE,CAAC;IACvD,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,KAAK;QACjB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,SAAS,CAAC,OAAO;YAAE,OAAO;QAC9B,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAClC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;gBACpD,OAAO,EAAE,CAAC;YACZ,CAAC,EAAE,sBAAsB,CAAC,CAAC;YAC3B,SAAS,WAAW;gBAClB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -4,6 +4,7 @@ import { type SyncDivergenceSelection } from './sync-divergence.js';
4
4
  import type { SyncEnvChannel } from './sync-env-channel.js';
5
5
  import type { SyncRecordFile } from './sync-record.file.js';
6
6
  import type { SyncRepository } from './sync-repository.js';
7
+ import type { SyncRoundFollow } from './sync-round-follow.js';
7
8
  import { type SyncRoundEnd, type SyncRoundOptions } from './type/sync.types.js';
8
9
  import type { WorkspaceSyncClient } from './workspace-sync.client.js';
9
10
  /**
@@ -22,19 +23,41 @@ import type { WorkspaceSyncClient } from './workspace-sync.client.js';
22
23
  * merge; an abort or an unanswered selection ends the run on exit 4. The
23
24
  * merchant lines of every env file travel with the tree, file for file; the
24
25
  * platform's keys never do.
26
+ *
27
+ * A push lands as a ROUND the run follows to its verdict (factory task 2481):
28
+ * the push answers at once, and the round is recorded until it ended. A run
29
+ * cut off while it followed — Ctrl-C, a lost network — leaves it recorded, and
30
+ * the next run follows that round to its verdict before anything else, and
31
+ * pushes nothing until it ended.
25
32
  */
26
33
  export declare class SyncRound {
27
34
  private readonly options;
28
35
  private readonly credentials;
29
36
  private readonly client;
30
37
  private readonly bundlePush;
38
+ private readonly follow;
31
39
  private readonly repository;
32
40
  private readonly records;
33
41
  private readonly envChannel;
34
42
  private readonly selection;
35
- constructor(options: SyncRoundOptions, credentials: CliCredentials, client: WorkspaceSyncClient, bundlePush: SyncBundlePush, repository: SyncRepository, records: SyncRecordFile, envChannel: SyncEnvChannel, selection: SyncDivergenceSelection);
36
- /** Run the round; a board that moves under its push is read again, a bounded number of times. */
43
+ constructor(options: SyncRoundOptions, credentials: CliCredentials, client: WorkspaceSyncClient, bundlePush: SyncBundlePush, follow: SyncRoundFollow, repository: SyncRepository, records: SyncRecordFile, envChannel: SyncEnvChannel, selection: SyncDivergenceSelection);
44
+ /**
45
+ * Run the round — the one a cut-off run left first, when there is one; a
46
+ * board that moves under its push is read again, a bounded number of times.
47
+ */
37
48
  run(): Promise<SyncRoundEnd>;
49
+ /**
50
+ * The round a run cut off before its verdict left on this channel, followed
51
+ * to its end before anything is pushed: its landing recorded as the push's
52
+ * would have been, or its rejection on exit 1. Null when there is none — or
53
+ * under `--dry-run`, which follows nothing — and when it ended landing
54
+ * nothing a run can stand on: the run then syncs afresh.
55
+ */
56
+ private resumed;
57
+ /** The pending round's verdict — null, its ending printed, when it ended landing nothing a run can stand on. */
58
+ private resumedVerdict;
59
+ /** How a round ended landing nothing a run can stand on, in words — undefined for any other failure. */
60
+ private unsettledEnding;
38
61
  private attempt;
39
62
  /** Decide, print the plan once, and move what it says. */
40
63
  private settle;
@@ -48,8 +71,9 @@ export declare class SyncRound {
48
71
  /**
49
72
  * Push the laptop's tree onto the serving tip — or over it, when local
50
73
  * overrides workspace — as ONE commit in ONE bundle, with the env lines
51
- * changed in each file. A tree the gates reject ends the run on exit 1 with
52
- * their diagnostics; a board that moved before the push landed is read again.
74
+ * changed in each file, and follow the round it lands as to its verdict. A
75
+ * tree the gates reject ends the run on exit 1 with their diagnostics; a
76
+ * board that moved before the push landed is read again.
53
77
  */
54
78
  private land;
55
79
  /** Both sides changed: the selection decides which tree wins, or the run stops with nothing moved. */
@@ -62,6 +86,8 @@ export declare class SyncRound {
62
86
  * that leaves the machine. Nothing moves on either side.
63
87
  */
64
88
  private dryRun;
89
+ /** `--dry-run` names the round a cut-off run left, which the next run follows before it pushes. */
90
+ private printPendingRound;
65
91
  private dryVerdict;
66
92
  /** The plan, printed once per round before anything moves. */
67
93
  private printPlan;
@@ -85,11 +111,26 @@ export declare class SyncRound {
85
111
  private pulledBundle;
86
112
  /** The commit a push landed, held locally so the next round compares against it. */
87
113
  private holdLanded;
88
- /** The push, or null when the board moved past the commit it was cut on before it landed. */
114
+ /**
115
+ * The verdict of the push of `bundle` — its tree's top-level entries
116
+ * `contents` — cut on `cutOn`, or null when the board moved past that commit
117
+ * before the push landed.
118
+ */
89
119
  private sendPush;
90
- /** A push the workspace did not take: exit 1, with what refused it. */
91
- private rejection;
92
- /** The env lines a round in sync sends alone — none for a run that never pushes. */
120
+ /**
121
+ * Follow the round a push answered to its verdict. A round still running is
122
+ * recorded first — the commit its push was cut on and the env digests the
123
+ * record takes once it landed — so a run cut off while it follows leaves it
124
+ * for the next run.
125
+ */
126
+ private roundVerdict;
127
+ /**
128
+ * Follow a recorded round to its end. Its record goes once the round ended —
129
+ * on its verdict, or on the refusal a read of it answers — and stays when
130
+ * the run is cut off before then.
131
+ */
132
+ private followRecorded;
133
+ /** The env lines a round in sync sends alone, following the round they land as — none for a run that never pushes. */
93
134
  private sendEnvAlone;
94
135
  /** The env files a push carries: those with a line changed since it last travelled. */
95
136
  private carried;
@@ -1,12 +1,25 @@
1
1
  import { AdminApiRefusal } from '../admin-api/admin-api-refusal.error.js';
2
- import { CliExitLadder, CliRefusal } from '../exit-ladder.js';
3
2
  import { print } from '../output.js';
4
3
  import { SYNC_DIVERGED_CODE, SyncDivergedRefusal, } from './sync-divergence.js';
5
- import { SyncDivergenceChoice, SyncVerdict, } from './type/sync.types.js';
4
+ import { SyncRejection } from './sync-rejection.js';
5
+ import { SyncDivergenceChoice, SyncPushRoundState, SyncVerdict, } from './type/sync.types.js';
6
6
  /** How many times one round reads both sides when the board moves under its push, before it stops on the divergence. */
7
7
  const ROUND_ATTEMPTS = 3;
8
8
  /** The code the admin API answers a delta the pod cannot cut with: the whole board is pulled instead. */
9
9
  const SYNC_FAILED_CODE = 'WORKSPACE_SYNC_FAILED';
10
+ /**
11
+ * How a round a cut-off run left can end without landing anything a run can
12
+ * stand on, by the code a read of it answers — after which the run syncs
13
+ * afresh: the workspace no longer knows the round, or the board moved past the
14
+ * commit its push was cut on.
15
+ */
16
+ const UNSETTLED_ROUND_ENDINGS = new Map([
17
+ [
18
+ 'ENTITY_NOT_FOUND',
19
+ 'is no round the workspace knows any more — it ended over an hour ago, or was lost with the admin API instance that ran it',
20
+ ],
21
+ [SYNC_DIVERGED_CODE, 'ended without landing: the workspace moved before it landed'],
22
+ ]);
10
23
  /** A commit id in print: its first twelve digits. */
11
24
  const SHORT_SHA_LENGTH = 12;
12
25
  /** How many changed paths a divergence lists per side before it counts the rest. */
@@ -29,28 +42,42 @@ const PLAN_LABEL_WIDTH = 10;
29
42
  * merge; an abort or an unanswered selection ends the run on exit 4. The
30
43
  * merchant lines of every env file travel with the tree, file for file; the
31
44
  * platform's keys never do.
45
+ *
46
+ * A push lands as a ROUND the run follows to its verdict (factory task 2481):
47
+ * the push answers at once, and the round is recorded until it ended. A run
48
+ * cut off while it followed — Ctrl-C, a lost network — leaves it recorded, and
49
+ * the next run follows that round to its verdict before anything else, and
50
+ * pushes nothing until it ended.
32
51
  */
33
52
  export class SyncRound {
34
53
  options;
35
54
  credentials;
36
55
  client;
37
56
  bundlePush;
57
+ follow;
38
58
  repository;
39
59
  records;
40
60
  envChannel;
41
61
  selection;
42
- constructor(options, credentials, client, bundlePush, repository, records, envChannel, selection) {
62
+ constructor(options, credentials, client, bundlePush, follow, repository, records, envChannel, selection) {
43
63
  this.options = options;
44
64
  this.credentials = credentials;
45
65
  this.client = client;
46
66
  this.bundlePush = bundlePush;
67
+ this.follow = follow;
47
68
  this.repository = repository;
48
69
  this.records = records;
49
70
  this.envChannel = envChannel;
50
71
  this.selection = selection;
51
72
  }
52
- /** Run the round; a board that moves under its push is read again, a bounded number of times. */
73
+ /**
74
+ * Run the round — the one a cut-off run left first, when there is one; a
75
+ * board that moves under its push is read again, a bounded number of times.
76
+ */
53
77
  async run() {
78
+ const resumed = await this.resumed();
79
+ if (resumed !== null)
80
+ return resumed;
54
81
  let attempt = await this.attempt();
55
82
  for (let tries = 1; tries < ROUND_ATTEMPTS && attempt.kind === 'moved'; tries += 1) {
56
83
  print(' the workspace moved while the push landed: reading both sides again');
@@ -62,6 +89,50 @@ export class SyncRound {
62
89
  `${SYNC_DIVERGED_CODE} — the workspace kept moving while the push landed; nothing landed. Re-run to settle it.`,
63
90
  ], attempt.point);
64
91
  }
92
+ /**
93
+ * The round a run cut off before its verdict left on this channel, followed
94
+ * to its end before anything is pushed: its landing recorded as the push's
95
+ * would have been, or its rejection on exit 1. Null when there is none — or
96
+ * under `--dry-run`, which follows nothing — and when it ended landing
97
+ * nothing a run can stand on: the run then syncs afresh.
98
+ */
99
+ async resumed() {
100
+ const pending = await this.records.readPendingRound();
101
+ if (pending === null || this.options.dryRun)
102
+ return null;
103
+ print(`forgecart sync ${this.options.storefront}`);
104
+ print(` round following round ${pending.roundId}, which a run cut off before its verdict left on the workspace — nothing is pushed until it ends`);
105
+ const verdict = await this.resumedVerdict(pending);
106
+ if (verdict === null)
107
+ return null;
108
+ if (!verdict.accepted)
109
+ throw new SyncRejection(verdict).refusal();
110
+ await this.repository.prepare();
111
+ const landed = await this.holdLanded(verdict.servingSha, pending.cutOn);
112
+ await this.record(landed, pending.env);
113
+ const summary = `the round a cut-off run left landed: serving is ${this.short(landed)}; ${String(this.mergedKeys(verdict))} env key(s) merged into the workspace`;
114
+ print(summary);
115
+ return { localTree: await this.repository.travellingTree(landed), servingSha: landed, summary };
116
+ }
117
+ /** The pending round's verdict — null, its ending printed, when it ended landing nothing a run can stand on. */
118
+ async resumedVerdict(pending) {
119
+ try {
120
+ return await this.followRecorded(() => this.follow.verdictOfRecorded(pending.roundId));
121
+ }
122
+ catch (error) {
123
+ const ending = this.unsettledEnding(error);
124
+ if (ending === undefined)
125
+ throw error;
126
+ print(` round round ${pending.roundId} ${ending}: syncing afresh`);
127
+ return null;
128
+ }
129
+ }
130
+ /** How a round ended landing nothing a run can stand on, in words — undefined for any other failure. */
131
+ unsettledEnding(error) {
132
+ if (!(error instanceof AdminApiRefusal))
133
+ return undefined;
134
+ return UNSETTLED_ROUND_ENDINGS.get(error.code);
135
+ }
65
136
  async attempt() {
66
137
  print(`forgecart sync ${this.options.storefront}`);
67
138
  const state = await this.client.state();
@@ -101,7 +172,7 @@ export class SyncRound {
101
172
  }
102
173
  /** The two trees agree: record where they stand, and send the env lines the laptop changed. */
103
174
  async inSync(view) {
104
- const env = await this.sendEnvAlone(view.record);
175
+ const env = await this.sendEnvAlone(view);
105
176
  await this.record(view.serving.sha, env.digests);
106
177
  const summary = `in sync at serving ${this.short(view.serving.sha)}; ${String(env.merged)} env key(s) merged into the workspace`;
107
178
  print(summary);
@@ -129,20 +200,22 @@ export class SyncRound {
129
200
  /**
130
201
  * Push the laptop's tree onto the serving tip — or over it, when local
131
202
  * overrides workspace — as ONE commit in ONE bundle, with the env lines
132
- * changed in each file. A tree the gates reject ends the run on exit 1 with
133
- * their diagnostics; a board that moved before the push landed is read again.
203
+ * changed in each file, and follow the round it lands as to its verdict. A
204
+ * tree the gates reject ends the run on exit 1 with their diagnostics; a
205
+ * board that moved before the push landed is read again.
134
206
  */
135
207
  async land(view) {
136
208
  const sent = await this.repository.changes(view.serving.tree, view.local);
137
209
  const outgoing = await this.envChannel.outgoing(view.record?.env ?? null);
138
210
  const commit = await this.repository.pushCommit(view.local, view.serving.sha);
139
211
  const bundle = await this.repository.pushBundle(commit, view.serving.sha);
140
- const result = await this.sendPush(bundle, this.carried(outgoing));
212
+ const contents = await this.repository.topLevelSizes(view.local);
213
+ const result = await this.sendPush(bundle, contents, this.carried(outgoing), view.serving.sha, outgoing.digests);
141
214
  if (result === null) {
142
215
  return { kind: 'moved', point: { localTree: view.local, servingSha: view.serving.sha } };
143
216
  }
144
217
  if (!result.accepted)
145
- throw this.rejection(result);
218
+ throw new SyncRejection(result).refusal();
146
219
  const landed = await this.holdLanded(result.servingSha, view.serving.sha);
147
220
  await this.record(landed, outgoing.digests);
148
221
  const summary = `pushed ${String(sent.length)} path(s): serving is ${this.short(landed)}; ${String(this.mergedKeys(result))} env key(s) merged into the workspace`;
@@ -180,6 +253,7 @@ export class SyncRound {
180
253
  print(` local ${String(changes.length)} path(s) changed since the last sync`);
181
254
  print(` workspace ${moved ? 'moved' : 'unchanged'} since the last sync`);
182
255
  this.printEnvFiles(outgoing.files, 'a push would send', 'no env file on this laptop');
256
+ await this.printPendingRound();
183
257
  print(` plan ${this.dryVerdict(changes.length > 0, moved, state.servingSha)}`);
184
258
  print(' paths a push would send:');
185
259
  for (const change of changes)
@@ -188,6 +262,13 @@ export class SyncRound {
188
262
  print(summary);
189
263
  return { localTree: local, servingSha: record?.servingSha ?? state.servingSha, summary };
190
264
  }
265
+ /** `--dry-run` names the round a cut-off run left, which the next run follows before it pushes. */
266
+ async printPendingRound() {
267
+ const pending = await this.records.readPendingRound();
268
+ if (pending === null)
269
+ return;
270
+ print(` round ${pending.roundId}, left by a run cut off before its verdict: a run follows it before it pushes`);
271
+ }
191
272
  dryVerdict(localChanged, moved, servingSha) {
192
273
  if (localChanged && moved) {
193
274
  return 'diverged unless both sides changed alike: a run asks which tree wins';
@@ -310,10 +391,15 @@ export class SyncRound {
310
391
  await this.repository.fetchBundle(bundle.bytes);
311
392
  return (await this.repository.hasCommit(landed)) ? landed : cutOn;
312
393
  }
313
- /** The push, or null when the board moved past the commit it was cut on before it landed. */
314
- async sendPush(bundle, envFiles) {
394
+ /**
395
+ * The verdict of the push of `bundle` — its tree's top-level entries
396
+ * `contents` — cut on `cutOn`, or null when the board moved past that commit
397
+ * before the push landed.
398
+ */
399
+ async sendPush(bundle, contents, envFiles, cutOn, env) {
315
400
  try {
316
- return await this.bundlePush.send(bundle, envFiles);
401
+ const round = await this.bundlePush.send(bundle, contents, envFiles);
402
+ return await this.roundVerdict(round, cutOn, env);
317
403
  }
318
404
  catch (error) {
319
405
  if (error instanceof AdminApiRefusal && error.code === SYNC_DIVERGED_CODE)
@@ -321,25 +407,46 @@ export class SyncRound {
321
407
  throw error;
322
408
  }
323
409
  }
324
- /** A push the workspace did not take: exit 1, with what refused it. */
325
- rejection(result) {
326
- const indented = (text) => text.split('\n').map((line) => ` ${line}`);
327
- return new CliRefusal(CliExitLadder.error, [
328
- `the workspace did not take the push; serving stays at ${this.short(result.servingSha ?? '')}, and this laptop's tree as it is:`,
329
- ...result.gateMessages.flatMap(indented),
330
- ...(result.runtimeError === null ? [] : indented(`runtime: ${result.runtimeError}`)),
331
- ...result.seoFindings.flatMap((finding) => indented(`seo: ${finding}`)),
332
- ]);
333
- }
334
- /** The env lines a round in sync sends alone — none for a run that never pushes. */
335
- async sendEnvAlone(record) {
410
+ /**
411
+ * Follow the round a push answered to its verdict. A round still running is
412
+ * recorded first — the commit its push was cut on and the env digests the
413
+ * record takes once it landed — so a run cut off while it follows leaves it
414
+ * for the next run.
415
+ */
416
+ async roundVerdict(round, cutOn, env) {
417
+ if (round.state === SyncPushRoundState.ENDED)
418
+ return this.follow.verdictOf(round);
419
+ await this.records.writePendingRound(round.id, cutOn, env);
420
+ return this.followRecorded(() => this.follow.verdictOf(round));
421
+ }
422
+ /**
423
+ * Follow a recorded round to its end. Its record goes once the round ended —
424
+ * on its verdict, or on the refusal a read of it answers — and stays when
425
+ * the run is cut off before then.
426
+ */
427
+ async followRecorded(follow) {
428
+ try {
429
+ const verdict = await follow();
430
+ await this.records.clearPendingRound();
431
+ return verdict;
432
+ }
433
+ catch (error) {
434
+ if (error instanceof AdminApiRefusal)
435
+ await this.records.clearPendingRound();
436
+ throw error;
437
+ }
438
+ }
439
+ /** The env lines a round in sync sends alone, following the round they land as — none for a run that never pushes. */
440
+ async sendEnvAlone(view) {
441
+ const recorded = view.record?.env ?? null;
336
442
  if (this.options.pullOnly)
337
- return { merged: 0, digests: record?.env ?? {} };
338
- const outgoing = await this.envChannel.outgoing(record?.env ?? null);
443
+ return { merged: 0, digests: recorded ?? {} };
444
+ const outgoing = await this.envChannel.outgoing(recorded);
339
445
  const carried = this.carried(outgoing);
340
446
  if (carried.length === 0)
341
447
  return { merged: 0, digests: outgoing.digests };
342
- const result = await this.client.push(null, carried);
448
+ const round = await this.client.push(null, carried);
449
+ const result = await this.roundVerdict(round, view.serving.sha, outgoing.digests);
343
450
  return { merged: this.mergedKeys(result), digests: outgoing.digests };
344
451
  }
345
452
  /** The env files a push carries: those with a line changed since it last travelled. */
@@ -1 +1 @@
1
- {"version":3,"file":"sync-round.js","sourceRoot":"","sources":["../../../src/sync/sync-round.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,oBAAoB,EACpB,WAAW,GAgBZ,MAAM,sBAAsB,CAAC;AAG9B,wHAAwH;AACxH,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,yGAAyG;AACzG,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD,qDAAqD;AACrD,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,oFAAoF;AACpF,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,+GAA+G;AAC/G,MAAM,gBAAgB,GAAG,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C5C,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,gFAAgF;IACxE,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,GAA6B;QACpE,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC1C,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAEO,OAAO,CAAC,GAAiB;QAC/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;IAClC,CAAC;IAEO,QAAQ,CAAC,MAAyB;QACxC,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,cAAc,CAAC;QAC3C,OAAO,kBAAkB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3D,CAAC;IAEO,KAAK,CAAC,GAAW;QACvB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -2,8 +2,10 @@ import type { CliAuthorizationPolicy } from '../authorization/type/cli-authoriza
2
2
  import type { SyncOptions } from './type/sync.types.js';
3
3
  /**
4
4
  * The longest one exchange with the admin API may take, in seconds, when the
5
- * run is given no `--timeout`: five minutes — a push's landing runs the
6
- * workspace's gates.
5
+ * run is given no `--timeout`: five minutes — a part of up to 8 MiB on a slow
6
+ * link. No exchange waits on a push's landing: the push answers the round it
7
+ * lands as, and every read of the round is an exchange of its own (factory
8
+ * task 2481).
7
9
  */
8
10
  export declare const SYNC_EXCHANGE_TIMEOUT_SECONDS = 300;
9
11
  /**
@@ -8,13 +8,16 @@ import { SyncDivergenceSelection } from './sync-divergence.js';
8
8
  import { SyncEnvChannel } from './sync-env-channel.js';
9
9
  import { SyncRecordFile } from './sync-record.file.js';
10
10
  import { SyncRepository } from './sync-repository.js';
11
+ import { SyncRoundFollow } from './sync-round-follow.js';
11
12
  import { SyncRound } from './sync-round.js';
12
13
  import { SyncWatch } from './sync-watch.js';
13
14
  import { WorkspaceSyncClient } from './workspace-sync.client.js';
14
15
  /**
15
16
  * The longest one exchange with the admin API may take, in seconds, when the
16
- * run is given no `--timeout`: five minutes — a push's landing runs the
17
- * workspace's gates.
17
+ * run is given no `--timeout`: five minutes — a part of up to 8 MiB on a slow
18
+ * link. No exchange waits on a push's landing: the push answers the round it
19
+ * lands as, and every read of the round is an exchange of its own (factory
20
+ * task 2481).
18
21
  */
19
22
  export const SYNC_EXCHANGE_TIMEOUT_SECONDS = 300;
20
23
  /**
@@ -100,7 +103,7 @@ export class SyncRunner {
100
103
  const pullOnly = this.options.pull === true;
101
104
  const client = new WorkspaceSyncClient(new AdminApiClient(credentials, this.options.timeout), interrupt);
102
105
  const repository = new SyncRepository(storefront);
103
- const round = new SyncRound({ storefront: this.displayName(), pullOnly, dryRun: this.options.dryRun === true }, credentials, client, new SyncBundlePush(client), repository, new SyncRecordFile(storefront, credentials.channelToken), new SyncEnvChannel(storefront), new SyncDivergenceSelection(new QuestionPromptAdapter(this.options), pullOnly));
106
+ const round = new SyncRound({ storefront: this.displayName(), pullOnly, dryRun: this.options.dryRun === true }, credentials, client, new SyncBundlePush(client), new SyncRoundFollow(client, interrupt), repository, new SyncRecordFile(storefront, credentials.channelToken), new SyncEnvChannel(storefront), new SyncDivergenceSelection(new QuestionPromptAdapter(this.options), pullOnly));
104
107
  return { client, repository, round };
105
108
  }
106
109
  /** The storefront as the merchant named it. */