@promptdriven/runtime-client 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptdriven/runtime-client",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "PDD Runtime Client (@promptdriven/runtime-client)",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
@@ -498,7 +498,7 @@ async function readBaselineReport(context, plan, identity) {
498
498
  try { saved = await read(join(folder,'batch.json')); }
499
499
  catch { partial=true;warn('Some saved Check batches are unreadable or corrupt.');continue; }
500
500
  if (diagnosticBatch(saved)) continue;
501
- if (saved?.intent !== 'check' && (Object.hasOwn(saved ?? {},'intent') || !Array.isArray(saved?.rows) || !saved.rows.every(row=>isObject(row) && validSavedCheck(row)))) continue;
501
+ if (saved?.intent !== 'check' && (Object.hasOwn(saved ?? {},'intent') || !Array.isArray(saved?.rows) || !saved.rows.every(row=>isObject(row) && validSavedCheck(row, { allowServerDefault: false })))) continue;
502
502
  if (saved.version !== 1 || saved.batch !== name || !Array.isArray(saved.rows) || typeof saved.root !== 'string') {
503
503
  partial=true;warn('Some saved Check batches have invalid original identity.');continue;
504
504
  }
@@ -577,7 +577,7 @@ async function readBaselineReport(context, plan, identity) {
577
577
  const ownSnapshots = snapshots.filter(story=>Array.isArray(story?.tests) && story.tests.includes(row.test));
578
578
  const snapshot = ownSnapshots[0];
579
579
  const sent = row.request_ids.length > 0;
580
- if (sent && !validSavedCheck(row)) { inconsistent();continue; }
580
+ if (sent && !validSavedCheck(row, { allowServerDefault: saved.intent === 'check' })) { inconsistent();continue; }
581
581
  const originalFootprint = originalSource?.stories?.find(story=>story.tests?.includes(row.test));
582
582
  const duplicate = saved.rows.filter(other=>other?.test === row.test).length !== 1;
583
583
  const storyName = typeof row.story === 'string' ? row.story : null;
@@ -738,7 +738,7 @@ async function readSavedStoryEvidence({ root, comparisonRoot = root, withTests =
738
738
  const legacy = !Object.hasOwn(batch, 'intent');
739
739
  if (batch.intent !== 'check') {
740
740
  if (!legacy) continue;
741
- if (!batch.rows.every(row => isObject(row) && validSavedCheck(row))) { legacyHint(); continue; }
741
+ if (!batch.rows.every(row => isObject(row) && validSavedCheck(row, { allowServerDefault: false }))) { legacyHint(); continue; }
742
742
  }
743
743
  const valid = batch.rows.every(row => isObject(row) && relativeFile(row.test) && relativeFile(row.story) && Array.isArray(row.request_ids));
744
744
  if (!valid) { warning(path, Error('invalid Story identity')); continue; }
@@ -5595,7 +5595,7 @@ async function recoverRestarts(context) {
5595
5595
  lintDiagnostics(context, lint, context.rows);
5596
5596
  const selected = [];
5597
5597
  for (const row of admitted) {
5598
- if (context.interrupted || rowExpired(context, row) || !validSavedCheck(row)) continue;
5598
+ if (context.interrupted || rowExpired(context, row) || !validSavedCheck(row, { allowServerDefault: context.intent === 'check' })) continue;
5599
5599
  const transient = drops.includes(row);
5600
5600
  const decision = evaluateCheckBudget({
5601
5601
  max_total_calls: context.maxTotalCalls ?? null,
@@ -306,8 +306,8 @@ function discoverTests(root, files, strict = false,workspace=loadRuntimeWorkspac
306
306
 
307
307
  const refusal = (code, section, message, extra = {}) => ({ code, section, message, ...extra });
308
308
  // The PDD interpreter's whole-number range today: prompt_runtime/program_scenario.py (_validate_scenario_integers)
309
- // for test values and prompt_runtime/graph_runtime_protocol.py for schema bounds. Change it only with the interpreter.
310
- const INTERPRETER_INTEGERS = { min: -(2n ** 53n - 1n), max: 2n ** 53n - 1n, text: '-9007199254740991 through 9007199254740991' };
309
+ // for test values and prompt_runtime/graph_runtime_protocol.py for schema bounds (signed 4096-bit exact integers).
310
+ const INTERPRETER_INTEGERS = { min: -(2n ** 4096n - 1n), max: 2n ** 4096n - 1n, text: 'signed 4096-bit exact integers (-(2^4096-1) through 2^4096-1)' };
311
311
  const outsideInterpreter = value => typeof value === 'bigint' && (value < INTERPRETER_INTEGERS.min || value > INTERPRETER_INTEGERS.max);
312
312
  // The interpreter's section of a test value: keys joined by ".", indexes as [N] (steps[10].input.seconds).
313
313
  const interpreterSection = path => path.reduce((text, part) => typeof part === 'number' ? `${text}[${part}]` : text ? `${text}.${part}` : String(part), '');