sibyl-system 1.3.3 → 1.3.4

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/cli.js CHANGED
@@ -801,6 +801,11 @@ function conclude(result) {
801
801
  }
802
802
  return { conclusion: "NEEDS_HUMAN", confidence: 0 };
803
803
  }
804
+ function voiceIndependence(record2) {
805
+ const ind = record2.independence;
806
+ if (ind === void 0) return "MISSING-PRE-W1 \u2014 this record predates convener capture; never treat as independent";
807
+ return ind.status === "INDEPENDENT" ? "INDEPENDENT" : `${ind.status} \u2014 ${ind.evidence}`;
808
+ }
804
809
  function buildVoice(result) {
805
810
  const { record: record2, judge, terminal, gaps } = result;
806
811
  const { conclusion, confidence } = conclude(result);
@@ -819,6 +824,7 @@ function buildVoice(result) {
819
824
  open_charges: judge?.charges.length ?? 0,
820
825
  dissent_sealed_in: sealed,
821
826
  terminal,
827
+ independence: voiceIndependence(record2),
822
828
  run_id: record2.runId,
823
829
  serial: record2.serial,
824
830
  spotcheck: spotcheckCommand(record2.runDir)
@@ -828,6 +834,7 @@ function renderVoice(voice) {
828
834
  const lines = [
829
835
  `SIBYL \u2014 ONE CONCLUSION, ONE VOICE [${voice.label}]`,
830
836
  `conclusion: ${voice.conclusion} confidence: ${String(voice.confidence)} terminal: ${voice.terminal}`,
837
+ `independence: ${voice.independence}`,
831
838
  `run: ${voice.run_id} (serial ${String(voice.serial)}) open charges: ${String(voice.open_charges)}`,
832
839
  `honesty: ${voice.honesty} (until C-09/C-14 containment rulings \u2014 see docs/isolation-laws.md)`,
833
840
  "rationale:",
@@ -20379,8 +20386,17 @@ async function resolveRun(flags) {
20379
20386
  let launchIndependence;
20380
20387
  try {
20381
20388
  const lc = JSON.parse(await readFile6(join7(runDir, "launch-context.json"), "utf8"));
20382
- if (isIndependenceShape(lc["independence"])) launchIndependence = lc["independence"];
20389
+ launchIndependence = isIndependenceShape(lc["independence"]) ? lc["independence"] : {
20390
+ status: "UNVERIFIABLE",
20391
+ convenerChain: [],
20392
+ evidence: "launch-context staged but its independence leg is malformed \u2014 not trusted; this review carries no independence anchor"
20393
+ };
20383
20394
  } catch {
20395
+ launchIndependence = {
20396
+ status: "UNVERIFIABLE",
20397
+ convenerChain: [],
20398
+ evidence: "bare CLI launch: no convener session staged; the drafting-chain read was impossible by construction"
20399
+ };
20384
20400
  }
20385
20401
  let targetPath = targetRaw;
20386
20402
  if (targetRaw !== "-") {
package/dist/index.js CHANGED
@@ -31844,7 +31844,7 @@ async function salvageAfterPromptTimeout(client, directory, sessionID, graceMs,
31844
31844
  }
31845
31845
  return null;
31846
31846
  }
31847
- async function runPersona(opts) {
31847
+ async function runPersonaAttempt(opts, attempt) {
31848
31848
  const { client, directory, persona, model, inputText, parentID } = opts;
31849
31849
  const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS2;
31850
31850
  const t0 = Date.now();
@@ -31863,7 +31863,7 @@ async function runPersona(opts) {
31863
31863
  const created = await withTimeout(
31864
31864
  client.session.create({
31865
31865
  body: {
31866
- title: `sibyl:${persona.agent ?? "persona"}`,
31866
+ title: `sibyl:${persona.agent ?? "persona"}${attempt === 1 ? "" : ` r${String(attempt)}`}`,
31867
31867
  ...parentID !== void 0 && parentID.length > 0 && { parentID }
31868
31868
  },
31869
31869
  query: { directory }
@@ -31908,9 +31908,9 @@ async function runPersona(opts) {
31908
31908
  graceMs,
31909
31909
  opts.salvagePollMs ?? DEFAULT_SALVAGE_POLL_MS
31910
31910
  );
31911
- if (!outcome) return fail(promptFailure);
31911
+ if (!outcome) return { ...fail(promptFailure), retryable: true };
31912
31912
  if (outcome.kind === "error") {
31913
- return fail(`${promptFailure}; salvage read failed: ${outcome.error}`);
31913
+ return { ...fail(`${promptFailure}; salvage read failed: ${outcome.error}`), retryable: true };
31914
31914
  }
31915
31915
  return {
31916
31916
  text: outcome.text,
@@ -31922,7 +31922,10 @@ async function runPersona(opts) {
31922
31922
  salvageExtraMs: Date.now() - raceExpiredAt
31923
31923
  };
31924
31924
  }
31925
- if (prompted.error) return fail(describeError2(prompted.error));
31925
+ if (prompted.error) {
31926
+ const channel = describeError2(prompted.error);
31927
+ return SALVAGE_ELIGIBLE_PROMPT_FAILURE.test(channel) ? { ...fail(channel), retryable: true } : fail(channel);
31928
+ }
31926
31929
  if (!prompted.data) return fail("session.prompt: response missing data payload");
31927
31930
  const info = prompted.data.info;
31928
31931
  if (info?.error) return fail(describeError2(info.error));
@@ -31937,9 +31940,18 @@ async function runPersona(opts) {
31937
31940
  }
31938
31941
  return { text, ok: true, latencyMs: Date.now() - t0, sessionID, modelApplied };
31939
31942
  } catch (e) {
31940
- return fail(e instanceof Error ? e.message : describeError2(e));
31943
+ const thrown = e instanceof Error ? e.message : describeError2(e);
31944
+ return SALVAGE_ELIGIBLE_PROMPT_FAILURE.test(thrown) ? { ...fail(thrown), retryable: true } : fail(thrown);
31941
31945
  }
31942
31946
  }
31947
+ async function runPersona(opts) {
31948
+ const first = await runPersonaAttempt(opts, 1);
31949
+ if (first.ok || first.retryable !== true) return first;
31950
+ const second = await runPersonaAttempt(opts, 2);
31951
+ if (second.ok) return { ...second, retried: true };
31952
+ const { retryable: _dropped, ...settled } = second;
31953
+ return { ...settled, retried: true, error: `${second.error} (one transport retry spent; first death: ${first.error})` };
31954
+ }
31943
31955
 
31944
31956
  // src/independence.ts
31945
31957
  var MAX_CHAIN_DEPTH = 16;
@@ -32676,6 +32688,7 @@ function formatRunLine(record3) {
32676
32688
 
32677
32689
  // src/tools/consult.ts
32678
32690
  var CONSULT_TOOL_NAME = "sibyl_consult";
32691
+ var BALLOT_BUDGET_LINES = 25;
32679
32692
  function buildConsultInput(goal, artifactText) {
32680
32693
  return `Audit the artifact below against the stated goal and cast your verdict.
32681
32694
 
@@ -32683,7 +32696,9 @@ GOAL:
32683
32696
  ${goal}
32684
32697
 
32685
32698
  ARTIFACT:
32686
- ${artifactText}`;
32699
+ ${artifactText}
32700
+
32701
+ BALLOT BUDGET (hard): total output at most ${String(BALLOT_BUDGET_LINES)} lines; one line per reason and per must-fix; no headings, no blank lines, no code blocks. The cap binds every seat alike \u2014 it is a transport protection, not a depth limit.`;
32687
32702
  }
32688
32703
  var REPLY_HEADER = "<!-- SIBYL consult voter reply (plan task 8). Full raw session text below; parse/repair metadata at the end. -->\n";
32689
32704
  function renderReply(voter, text, meta3) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sibyl-system",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Sibyl-System: democratic-centralism review chamber (one conclusion, one voice) + fail-closed council voting + dynamic swarm plugin for OpenCode",