omnius 1.0.894 → 1.0.895

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
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 38863651 bytes
4
- sha256: 9c42f645173805b16c07b9cd1493f9562886b701a825e7e17a3b9533a83423cd
3
+ size: 38869982 bytes
4
+ sha256: caa4136d8894b599e120ee778baad82e2be5b0671c914c604e1e2a93ca8e747a
package/dist/library.js CHANGED
@@ -350078,22 +350078,86 @@ function recordToolEvidence(ledger, input) {
350078
350078
  });
350079
350079
  }
350080
350080
  function addCompletionClaims(ledger, claims) {
350081
+ const at = nowIso4();
350082
+ const assertion = {
350083
+ assertedAtIso: at,
350084
+ assertedRunId: ledger.runId,
350085
+ assertedEvidenceSequence: ledger.evidence.length
350086
+ };
350081
350087
  const byId = new Map(ledger.proposedClaims.map((claim) => [claim.id, claim]));
350082
350088
  const byMeaning = new Map(ledger.proposedClaims.map((claim) => [normalizeCompletionKey(claim.text, "claim"), claim.id]));
350089
+ const assertedMeanings = /* @__PURE__ */ new Set();
350083
350090
  for (const claim of claims) {
350084
350091
  const meaning = normalizeCompletionKey(claim.text, "claim");
350085
- if (meaning && byMeaning.has(meaning))
350092
+ if (meaning)
350093
+ assertedMeanings.add(meaning);
350094
+ const existingId = meaning ? byMeaning.get(meaning) : void 0;
350095
+ const existing = existingId ? byId.get(existingId) : void 0;
350096
+ if (existing) {
350097
+ const { supersededAtIso: _superseded, ...reasserted } = existing;
350098
+ byId.set(existing.id, { ...reasserted, ...assertion });
350086
350099
  continue;
350087
- byId.set(claim.id, claim);
350100
+ }
350101
+ byId.set(claim.id, {
350102
+ ...claim,
350103
+ recordedAtIso: claim.recordedAtIso ?? at,
350104
+ recordedRunId: claim.recordedRunId ?? ledger.runId,
350105
+ ...assertion
350106
+ });
350088
350107
  if (meaning)
350089
350108
  byMeaning.set(meaning, claim.id);
350090
350109
  }
350110
+ if (claims.some((claim) => claim.source === "task_complete_summary")) {
350111
+ for (const [id5, claim] of byId) {
350112
+ if (claim.source !== "task_complete_summary" || claim.supersededAtIso)
350113
+ continue;
350114
+ if (assertedMeanings.has(normalizeCompletionKey(claim.text, "claim")))
350115
+ continue;
350116
+ byId.set(id5, { ...claim, supersededAtIso: at });
350117
+ }
350118
+ }
350091
350119
  return {
350092
350120
  ...ledger,
350093
350121
  proposedClaims: Array.from(byId.values()),
350094
- updatedAtIso: nowIso4()
350122
+ updatedAtIso: at
350095
350123
  };
350096
350124
  }
350125
+ function isAppliedMutation(evidence) {
350126
+ return (evidence.role === "mutation" || evidence.kind === "file_change") && evidence.success !== false && evidence.receipt?.cancelled !== true;
350127
+ }
350128
+ function assessCompletionClaimCurrentness(ledger, claim) {
350129
+ if (claim.source === "derived")
350130
+ return { current: true };
350131
+ if (claim.supersededAtIso) {
350132
+ return {
350133
+ current: false,
350134
+ reason: "superseded_by_later_summary",
350135
+ endedAtIso: claim.supersededAtIso
350136
+ };
350137
+ }
350138
+ const sequence = claim.assertedEvidenceSequence;
350139
+ if (sequence !== void 0 && Number.isFinite(sequence)) {
350140
+ const hasPaths = claimPathSignals(claim).length > 0;
350141
+ for (let index = Math.max(0, sequence); index < ledger.evidence.length; index++) {
350142
+ const item = ledger.evidence[index];
350143
+ if (!isAppliedMutation(item))
350144
+ continue;
350145
+ if (hasPaths ? hasClaimPathOverlap(claim, item) : claim.status !== "supported") {
350146
+ return {
350147
+ current: false,
350148
+ reason: "artifact_revised_after_claim",
350149
+ endedAtIso: item.observedAtIso,
350150
+ supersedingEvidenceId: item.id
350151
+ };
350152
+ }
350153
+ }
350154
+ }
350155
+ const assertedRun = claim.assertedRunId ?? claim.recordedRunId;
350156
+ if (assertedRun && ledger.runId && assertedRun !== ledger.runId) {
350157
+ return { current: false, reason: "recorded_in_prior_run" };
350158
+ }
350159
+ return { current: true };
350160
+ }
350097
350161
  function claimPathSignals(claim) {
350098
350162
  const sourcePaths = (claim.sourceSignals ?? []).filter((signal) => /[/.]/.test(signal));
350099
350163
  return cleanTargetPaths([...claim.workspaceSignals, ...sourcePaths]);
@@ -360881,7 +360945,7 @@ function buildIntegrationClosure(input) {
360881
360945
  });
360882
360946
  }
360883
360947
  }
360884
- const claims = (ledger?.proposedClaims ?? []).slice(-MAX_CLAIMS);
360948
+ const claims = (ledger?.proposedClaims ?? []).filter((claim) => assessCompletionClaimCurrentness(ledger, claim).current).slice(-MAX_CLAIMS);
360885
360949
  for (const claim of claims) {
360886
360950
  const claimId = nodeId("claim", claim.id);
360887
360951
  addNode({
@@ -362559,7 +362623,7 @@ function renderReasoningSlice(slice, maxCharacters = slice.selection.maxCharacte
362559
362623
  };
362560
362624
  const renderedNodeIds = /* @__PURE__ */ new Set();
362561
362625
  for (const node of [...slice.nodes].sort((left, right) => nodePriority(left) - nodePriority(right) || left.nodeId.localeCompare(right.nodeId))) {
362562
- if (append(`- ${node.nodeId} [${node.kind}/${node.status}/${node.authority}] ${options.objectiveReference && node.kind === "objective" ? `[see ${options.objectiveReference}]` : node.label}`)) {
362626
+ if (append(`- ${node.nodeId} [${node.kind}/${node.status}/${node.authority}] ${options.objectiveReference && node.kind === "objective" ? `[see ${options.objectiveReference}]` : node.kind === "claim" && node.status === "superseded" ? "(historical assertion; see Historical claims — not a current fact)" : node.label}`)) {
362563
362627
  renderedNodeIds.add(node.nodeId);
362564
362628
  }
362565
362629
  }
@@ -362571,11 +362635,21 @@ function renderReasoningSlice(slice, maxCharacters = slice.selection.maxCharacte
362571
362635
  }
362572
362636
  append(`- ${edge.sourceNodeId} --${edge.kind}--> ${edge.targetNodeId}`);
362573
362637
  }
362638
+ const historical = slice.claims.filter(isHistoricalClaim);
362639
+ const current2 = slice.claims.filter((claim) => !isHistoricalClaim(claim));
362574
362640
  append("Claims:");
362575
- if (slice.claims.length === 0)
362641
+ if (current2.length === 0)
362576
362642
  append("- none");
362577
- for (const claim of slice.claims) {
362578
- append(`- ${claim.claimId} [${claim.status}/${claim.authority ?? "inferred"}] ${claim.statement}`);
362643
+ for (const claim of current2) {
362644
+ append(`- ${claim.claimId} [${claim.status}/${claim.authority ?? "inferred"}]${claimProvenance(claim)} ${claim.statement}`);
362645
+ }
362646
+ if (historical.length > 0) {
362647
+ append("Historical claims (superseded or revised by later evidence; retained for audit, NOT current facts — rely on current observations):");
362648
+ for (const claim of historical) {
362649
+ const reason = claimTag(claim, "currentness:") ?? "historical";
362650
+ const by = claimTag(claim, "superseded-by:");
362651
+ append(`- ${claim.claimId} [historical/${reason}${by ? ` by ${by}` : ""}]${claimProvenance(claim)} was: ${claim.statement}`);
362652
+ }
362579
362653
  }
362580
362654
  append("Conflicts:");
362581
362655
  if (slice.conflicts.length === 0)
@@ -362593,6 +362667,21 @@ function renderReasoningSlice(slice, maxCharacters = slice.selection.maxCharacte
362593
362667
  lines.push(closing);
362594
362668
  return lines.join("\n").slice(0, budget);
362595
362669
  }
362670
+ function claimTag(claim, prefix) {
362671
+ return claim.tags.find((tag) => tag.startsWith(prefix))?.slice(prefix.length);
362672
+ }
362673
+ function isHistoricalClaim(claim) {
362674
+ return claim.tags.includes("historical");
362675
+ }
362676
+ function claimProvenance(claim) {
362677
+ const parts = [
362678
+ claimTag(claim, "run:") ? `run=${claimTag(claim, "run:")}` : "",
362679
+ claim.validFrom ? `at=${claim.validFrom}` : "",
362680
+ claimTag(claim, "evidence-seq:") !== void 0 ? `evidence-seq=${claimTag(claim, "evidence-seq:")}` : "",
362681
+ claim.validTo ? `until=${claim.validTo}` : ""
362682
+ ].filter(Boolean);
362683
+ return parts.length > 0 ? ` (${parts.join(" ")})` : "";
362684
+ }
362596
362685
  function iso(value, fallback) {
362597
362686
  return value && Number.isFinite(Date.parse(value)) ? value : fallback;
362598
362687
  }
@@ -362677,8 +362766,23 @@ function todoActionContract(todo, nodeId2) {
362677
362766
  risk
362678
362767
  };
362679
362768
  }
362680
- function claimAuthority(claim) {
362681
- return claim.source === "derived" ? "inferred" : "adopted";
362769
+ function claimAuthority(claim, currentness) {
362770
+ if (claim.source === "derived" || !currentness.current)
362771
+ return "inferred";
362772
+ return claim.status === "supported" ? "adopted" : "inferred";
362773
+ }
362774
+ function validIso(value) {
362775
+ return value && Number.isFinite(Date.parse(value)) ? new Date(Date.parse(value)).toISOString() : void 0;
362776
+ }
362777
+ function claimProvenanceTags(claim, currentness) {
362778
+ const run = claim.assertedRunId ?? claim.recordedRunId;
362779
+ return [
362780
+ ...run ? [`run:${run}`.slice(0, 128)] : [],
362781
+ ...claim.assertedEvidenceSequence !== void 0 ? [`evidence-seq:${claim.assertedEvidenceSequence}`] : [],
362782
+ currentness.current ? "currentness:current" : `currentness:${currentness.reason}`,
362783
+ ...currentness.current ? [] : ["historical"],
362784
+ ...currentness.supersedingEvidenceId ? [`superseded-by:${currentness.supersedingEvidenceId}`.slice(0, 128)] : []
362785
+ ];
362682
362786
  }
362683
362787
  function evidenceRole(evidence) {
362684
362788
  if (evidence.receipt?.cancelled === true)
@@ -363579,6 +363683,11 @@ function buildWorkGraphProjectionPatch(input) {
363579
363683
  return completionClaim.evidenceIds.some((id5) => proofIds.has(id5));
363580
363684
  });
363581
363685
  const subjectNodeId = matchedTodo ? todoNodeIds.get(matchedTodo.id) ?? objectiveId : objectiveId;
363686
+ const currentness = assessCompletionClaimCurrentness(ledger, completionClaim);
363687
+ const authority = claimAuthority(completionClaim, currentness);
363688
+ const validFrom = validIso(completionClaim.assertedAtIso ?? completionClaim.recordedAtIso);
363689
+ const endedAt = currentness.current ? void 0 : validIso(currentness.endedAtIso);
363690
+ const validTo = endedAt && validFrom && Date.parse(endedAt) < Date.parse(validFrom) ? validFrom : endedAt;
363582
363691
  const claim = {
363583
363692
  schemaVersion: input.graph.schemaVersion,
363584
363693
  claimId,
@@ -363589,11 +363698,17 @@ function buildWorkGraphProjectionPatch(input) {
363589
363698
  confidence: completionClaim.status === "supported" ? 1 : 0.5,
363590
363699
  evidenceRefIds: evidenceIds,
363591
363700
  dependsOnClaimIds: [],
363592
- tags: [WORK_GRAPH_PROJECTION_ID, completionClaim.riskCategory],
363701
+ tags: [
363702
+ WORK_GRAPH_PROJECTION_ID,
363703
+ completionClaim.riskCategory,
363704
+ ...claimProvenanceTags(completionClaim, currentness)
363705
+ ],
363593
363706
  subjectNodeId,
363594
363707
  predicate: "completion_outcome",
363595
363708
  objectValue: completionClaim.attainedState,
363596
- authority: claimAuthority(completionClaim)
363709
+ ...validFrom ? { validFrom } : {},
363710
+ ...validTo ? { validTo } : {},
363711
+ authority
363597
363712
  };
363598
363713
  claims.set(claimId, claim);
363599
363714
  const claimNodeId = scopedId("claim-node", completionClaim.id);
@@ -363602,20 +363717,25 @@ function buildWorkGraphProjectionPatch(input) {
363602
363717
  nodeId: claimNodeId,
363603
363718
  kind: "claim",
363604
363719
  label: completionClaim.text.slice(0, 1e3),
363605
- status: completionClaim.status === "supported" ? "complete" : completionClaim.status === "contradicted" ? "invalid" : completionClaim.status === "blocked" ? "blocked" : "proposed",
363606
- authority: claimAuthority(completionClaim),
363720
+ status: !currentness.current ? "superseded" : completionClaim.status === "supported" ? "complete" : completionClaim.status === "contradicted" ? "invalid" : completionClaim.status === "blocked" ? "blocked" : "proposed",
363721
+ authority,
363607
363722
  parentNodeId: subjectNodeId,
363608
363723
  bindingIds: [],
363609
363724
  evidenceRefIds: evidenceIds,
363610
363725
  reference: { type: "claim", claimId },
363611
- attributes: projectedAttributes(claimAuthority(completionClaim), {
363726
+ attributes: projectedAttributes(authority, {
363612
363727
  materiality: completionClaim.materiality,
363613
363728
  riskCategory: completionClaim.riskCategory,
363614
- requiresIndependentEvidence: completionClaim.requiresIndependentEvidence
363729
+ requiresIndependentEvidence: completionClaim.requiresIndependentEvidence,
363730
+ currentness: currentness.current ? "current" : "historical",
363731
+ ...currentness.reason ? { currentnessReason: currentness.reason } : {},
363732
+ ...currentness.supersedingEvidenceId ? { supersedingEvidenceId: currentness.supersedingEvidenceId } : {},
363733
+ ...completionClaim.assertedRunId ?? completionClaim.recordedRunId ? { assertedRunId: completionClaim.assertedRunId ?? completionClaim.recordedRunId } : {},
363734
+ ...completionClaim.assertedEvidenceSequence !== void 0 ? { assertedEvidenceSequence: completionClaim.assertedEvidenceSequence } : {}
363615
363735
  })
363616
363736
  });
363617
363737
  addEdge(subjectNodeId, claimNodeId, "contains");
363618
- if (matchedTodo) {
363738
+ if (matchedTodo && currentness.current) {
363619
363739
  const proofNodes = [
363620
363740
  ...todoMutationNodeIds.get(matchedTodo.id) ?? [],
363621
363741
  ...todoArtifactNodeIds.get(matchedTodo.id) ?? []
@@ -363728,7 +363848,7 @@ function graphId(value) {
363728
363848
  const digest8 = createHash79("sha256").update(value).digest("hex").slice(0, 20);
363729
363849
  return `work-graph:${digest8}`;
363730
363850
  }
363731
- function validIso(value) {
363851
+ function validIso2(value) {
363732
363852
  return value && Number.isFinite(Date.parse(value)) ? value : (/* @__PURE__ */ new Date()).toISOString();
363733
363853
  }
363734
363854
  var OperationalWorkGraphController = class {
@@ -363753,7 +363873,7 @@ var OperationalWorkGraphController = class {
363753
363873
  graphId: options.graphId ?? graphId(options.persistenceKey),
363754
363874
  title: options.title ?? "Omnius operational work graph",
363755
363875
  revision: "revision:0",
363756
- createdAt: validIso(options.now)
363876
+ createdAt: validIso2(options.now)
363757
363877
  });
363758
363878
  if (this.persist && !restored)
363759
363879
  this.save();
@@ -365361,7 +365481,7 @@ function sha2566(value) {
365361
365481
  function normalizedPath(value) {
365362
365482
  return bounded2(value, 1e3).replace(/\\/g, "/").replace(/\/+/g, "/");
365363
365483
  }
365364
- function validIso2(value) {
365484
+ function validIso3(value) {
365365
365485
  return typeof value === "string" && Number.isFinite(Date.parse(value));
365366
365486
  }
365367
365487
  function evidenceMap(mappings) {
@@ -365396,7 +365516,7 @@ function receiptHasValidIdentity(receipt) {
365396
365516
  }
365397
365517
  if (!bounded2(receipt.cwd, 2e3))
365398
365518
  return false;
365399
- if (!validIso2(receipt.startedAtIso) || !validIso2(receipt.finishedAtIso))
365519
+ if (!validIso3(receipt.startedAtIso) || !validIso3(receipt.finishedAtIso))
365400
365520
  return false;
365401
365521
  return Date.parse(receipt.finishedAtIso) >= Date.parse(receipt.startedAtIso);
365402
365522
  }
@@ -365465,7 +365585,7 @@ function latestDelivery(requirement, mappedEvidenceIds, evidence) {
365465
365585
  entry,
365466
365586
  ordinal,
365467
365587
  receipt: normalizeCompletionDeliveryReceipt(entry.deliveryReceipt)
365468
- })).filter((item) => Boolean(item.receipt && validIso2(item.receipt.deliveredAtIso) && (!requirement.provider || item.receipt.provider === requirement.provider) && (!requirement.target || item.receipt.target === requirement.target))).sort((left, right) => Date.parse(left.receipt.deliveredAtIso) - Date.parse(right.receipt.deliveredAtIso) || left.ordinal - right.ordinal);
365588
+ })).filter((item) => Boolean(item.receipt && validIso3(item.receipt.deliveredAtIso) && (!requirement.provider || item.receipt.provider === requirement.provider) && (!requirement.target || item.receipt.target === requirement.target))).sort((left, right) => Date.parse(left.receipt.deliveredAtIso) - Date.parse(right.receipt.deliveredAtIso) || left.ordinal - right.ordinal);
365469
365589
  const selected = candidates.at(-1);
365470
365590
  if (!selected)
365471
365591
  return { status: "unverified" };
@@ -365854,7 +365974,7 @@ function validateOverrideReceipt(value) {
365854
365974
  const reason = bounded2(record9["reason"], 2e3);
365855
365975
  const persistedAtIso = bounded2(record9["persistedAtIso"], 80);
365856
365976
  const receiptId = bounded2(record9["receiptId"], 100);
365857
- if (!runId || !SHA2562.test(readinessHash) || !reason || !validIso2(persistedAtIso)) {
365977
+ if (!runId || !SHA2562.test(readinessHash) || !reason || !validIso3(persistedAtIso)) {
365858
365978
  return null;
365859
365979
  }
365860
365980
  const expected = `override-${receiptDigest({
@@ -365913,7 +366033,7 @@ function persistCompletionReadinessOverride(stateDir, input) {
365913
366033
  if (!reason)
365914
366034
  throw new TypeError("Override reason is required");
365915
366035
  const persistedAtIso = input.persistedAtIso ?? (/* @__PURE__ */ new Date()).toISOString();
365916
- if (!validIso2(persistedAtIso))
366036
+ if (!validIso3(persistedAtIso))
365917
366037
  throw new TypeError("Invalid persistedAtIso");
365918
366038
  const path7 = completionReadinessOverridePath(stateDir, runId, input.readinessHash);
365919
366039
  const existing = loadCompletionReadinessOverride(stateDir, runId, input.readinessHash);
@@ -365964,7 +366084,7 @@ function persistCompletionReadinessOverride(stateDir, input) {
365964
366084
  function reconcileCompletionReadiness(input) {
365965
366085
  const runId = requiredId(input.runId, "runId");
365966
366086
  const generatedAtIso = input.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString();
365967
- if (!validIso2(generatedAtIso))
366087
+ if (!validIso3(generatedAtIso))
365968
366088
  throw new TypeError("Invalid generatedAtIso");
365969
366089
  const requestedTerminalStatus = input.requestedTerminalStatus ?? "completed";
365970
366090
  const built = buildCompletionObligations(input);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.894",
3
+ "version": "1.0.895",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.894",
9
+ "version": "1.0.895",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.894",
3
+ "version": "1.0.895",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/library.js",