@allocator-one/rcl 4.5.31 → 4.5.33

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/index.js CHANGED
@@ -87,6 +87,7 @@ import { parseRepoName } from './evidence/target.js';
87
87
  import { text } from './evidence/format.js';
88
88
  import { loadConvergeRunState } from './converge/run-state.js';
89
89
  import { checkDismissalCitations, dismissalRequiresCitation, gitRevisionReader, reviewedRevision } from './converge/dismissal-citations.js';
90
+ import { readPendingTerminalReport } from './converge/pending-terminal-report.js';
90
91
  import { finalizeOrdinaryPendingLaunch, previewOrdinaryPendingLaunch, resumePendingLegacyLaunch } from './converge/pending-legacy-resume.js';
91
92
  import { guardedInputWithoutAsyncSeats, ordinaryPendingGuardedInput } from './converge/ordinary-pending-package.js';
92
93
  import { exportOrdinaryPendingPackage, retainOrdinaryLaunchInputs } from './converge/ordinary-pending-export.js';
@@ -1113,7 +1114,12 @@ telemetry
1113
1114
  level: runtime.level,
1114
1115
  repoManaged: runtime.repoManaged,
1115
1116
  credential: runtime.credential
1116
- ? { source: runtime.credential.source, host: credentialHost(runtime.credential) }
1117
+ ? {
1118
+ source: runtime.credential.source,
1119
+ host: credentialHost(runtime.credential),
1120
+ file: runtime.credentialOrigin?.file ?? null,
1121
+ reason: runtime.credentialOrigin?.reason ?? null,
1122
+ }
1117
1123
  : null,
1118
1124
  note: runtime.note ?? null,
1119
1125
  outbox: { dir: runtime.outbox.dir, entries, pendingLoss: loss, refusedLoss: refused },
@@ -1129,6 +1135,10 @@ telemetry
1129
1135
  console.log(status.credential
1130
1136
  ? `Credential: ${status.credential.source} → ${status.credential.host}`
1131
1137
  : `Credential: none${status.note ? ` (${status.note})` : ''}`);
1138
+ if (status.credential?.file)
1139
+ console.log(` File: ${status.credential.file}`);
1140
+ if (status.credential?.reason)
1141
+ console.log(` Why: ${status.credential.reason}`);
1132
1142
  console.log(`Outbox: ${runtime.outbox.dir} — ${entries.length} entr${entries.length === 1 ? 'y' : 'ies'}`);
1133
1143
  for (const entry of entries) {
1134
1144
  console.log(` ${entry.id} ${entry.meta.kind} spooled ${entry.meta.spooled_at} attempts ${entry.meta.attempts} ` +
@@ -2240,7 +2250,7 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
2240
2250
  throw new ReviewLaunchRefused('pending_async_missing', 'A package-bound retained async artifact is unavailable.');
2241
2251
  return [...found.values()].sort((a, b) => a.sha256.localeCompare(b.sha256));
2242
2252
  };
2243
- if (opts.previewPending && migrationPackage) {
2253
+ if (opts.previewPending && migrationPackage && !(opts.resumePending && native?.lastLaunch?.pendingResume)) {
2244
2254
  const inputSha256 = guardedInputSha256(migrationGuardedInput);
2245
2255
  const preview = await previewOrdinaryPendingLaunch({ gitCommonDir: common,
2246
2256
  target: prepared.converge.target, headSha: extra.target.headSha ?? '', baseSha: finalizationBaseSha,
@@ -2586,10 +2596,15 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
2586
2596
  process.stderr.write(`${text}\n`);
2587
2597
  },
2588
2598
  });
2589
- progress.start();
2599
+ // A host may die after retaining the terminal pair but before publishing
2600
+ // native completion. Preserve that report instead of assembling new bytes.
2601
+ const retainedPending = extra.pendingResume
2602
+ ? await readPendingTerminalReport(extra.pendingResume.journal, extra.pendingResume.launch) : undefined;
2603
+ const retainedPendingTerminal = retainedPending?.terminal;
2590
2604
  let chunkReviews;
2591
2605
  let pendingProjection;
2592
2606
  let pendingAsyncExecution;
2607
+ progress.start();
2593
2608
  try {
2594
2609
  if (extra.pendingResume) {
2595
2610
  if (!(await extra.pendingResume.journal.read()).finalized) {
@@ -2705,14 +2720,15 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
2705
2720
  // stats store must never break a review).
2706
2721
  try {
2707
2722
  const ts = new Date().toISOString();
2708
- await appendCalls([...chunkReviews, ...arrivedAsync].map((r) => ({
2709
- ts,
2710
- model: r.model,
2711
- role: r.role,
2712
- durationMs: r.durationMs,
2713
- status: r.status,
2714
- source: 'live',
2715
- })));
2723
+ if (!retainedPendingTerminal)
2724
+ await appendCalls([...chunkReviews, ...arrivedAsync].map((r) => ({
2725
+ ts,
2726
+ model: r.model,
2727
+ role: r.role,
2728
+ durationMs: r.durationMs,
2729
+ status: r.status,
2730
+ source: 'live',
2731
+ })));
2716
2732
  }
2717
2733
  catch (err) {
2718
2734
  // Stats are advisory; reviews must not fail over them — but a broken
@@ -2810,7 +2826,10 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
2810
2826
  };
2811
2827
  let result;
2812
2828
  let pendingEvidence;
2813
- if (extra.pendingResume) {
2829
+ if (retainedPendingTerminal) {
2830
+ result = JSON.parse(retainedPendingTerminal.reportBytes);
2831
+ }
2832
+ else if (extra.pendingResume) {
2814
2833
  const proof = await exportCheckpointProof(extra.pendingResume.journal);
2815
2834
  const supplementalBytes = (await extra.pendingResume.journal.readBindings())['supplemental-async'];
2816
2835
  if (supplementalBytes === undefined)
@@ -2901,11 +2920,13 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
2901
2920
  // declared digests match the files and nothing raw travels. With
2902
2921
  // telemetry off only fresh prose normalization applies. This is the fresh
2903
2922
  // producer boundary; retained reports and envelope builders never rewrite it.
2904
- const produced = normalizeGeneratedReport(result);
2905
- const delivered = runtime && runtime.level !== 'off' ? sanitizeForDelivery(produced, { parseFailures: runtime.parseFailures }) : produced;
2923
+ const produced = retainedPendingTerminal ? result : normalizeGeneratedReport(result);
2924
+ const delivered = !retainedPendingTerminal && runtime && runtime.level !== 'off'
2925
+ ? sanitizeForDelivery(produced, { parseFailures: runtime.parseFailures }) : produced;
2906
2926
  postReviewStage('rendering report artifacts');
2907
- const artifacts = renderReportArtifacts(delivered);
2908
- let pendingReviewerArtifact;
2927
+ const artifacts = { ...renderReportArtifacts(delivered),
2928
+ ...(retainedPendingTerminal ? { report_json: retainedPendingTerminal.reportBytes } : {}) };
2929
+ let pendingReviewerArtifact = retainedPending?.artifact;
2909
2930
  if (extra.pendingResume && pendingEvidence) {
2910
2931
  pendingReviewerArtifact = serializeReviewerArtifact({
2911
2932
  assembly: pendingEvidence.assembly,