@absolutejs/rag 0.24.2 → 0.24.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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.24.4 — 2026-11-03
10
+
11
+ ### Fixed
12
+
13
+ - **Bind each review tool response to the exact batch pointers and cardinality, with bounded reasons and citations, instead of permitting a full-draft response.** (`createResearch`)
14
+
15
+ ## 0.24.3 — 2026-11-03
16
+
17
+ ### Fixed
18
+
19
+ - **Resume persisted review drafts by JSON pointer and value across database key reordering, preserving completed verdicts and rejecting changed identities.** (`createResearch`)
20
+
9
21
  ## 0.24.2 — 2026-11-03
10
22
 
11
23
  ### Fixed
package/changelog.json CHANGED
@@ -2,6 +2,32 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/rag",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "fixed",
9
+ "summary": "Bind each review tool response to the exact batch pointers and cardinality, with bounded reasons and citations, instead of permitting a full-draft response.",
10
+ "symbols": [
11
+ "createResearch"
12
+ ]
13
+ }
14
+ ],
15
+ "date": "2026-11-03",
16
+ "version": "0.24.4"
17
+ },
18
+ {
19
+ "changes": [
20
+ {
21
+ "kind": "fixed",
22
+ "summary": "Resume persisted review drafts by JSON pointer and value across database key reordering, preserving completed verdicts and rejecting changed identities.",
23
+ "symbols": [
24
+ "createResearch"
25
+ ]
26
+ }
27
+ ],
28
+ "date": "2026-11-03",
29
+ "version": "0.24.3"
30
+ },
5
31
  {
6
32
  "changes": [
7
33
  {
@@ -122125,6 +122125,16 @@ var ReviewSchema = Type.Object({
122125
122125
  })
122126
122126
  }), { maxItems: 256 })
122127
122127
  });
122128
+ var reviewSchemaForPaths = (paths) => Type.Object({
122129
+ fields: Type.Array(Type.Object({
122130
+ ...ReviewSchema.properties.fields.items.properties,
122131
+ path: Type.Union(paths.map((path) => Type.Literal(path))),
122132
+ reason: Type.String({ maxLength: 180 }),
122133
+ citations: Type.Array(Type.Object({ passageId: Type.String() }), {
122134
+ maxItems: 4
122135
+ })
122136
+ }, { additionalProperties: false }), { minItems: paths.length, maxItems: paths.length })
122137
+ }, { additionalProperties: false });
122128
122138
  var researchLeaves = (value, maxFields = 128) => {
122129
122139
  const fields = [];
122130
122140
  const visit = (item, path, depth) => {
@@ -122688,9 +122698,17 @@ Correct the previous schema-invalid response using the validation diagnostics. T
122688
122698
  if (!continuing)
122689
122699
  result.fields = [];
122690
122700
  await persistReview(pass, continuing ? resumed.nextField : 0, false, data);
122691
- const leaves = researchLeaves(data, Number.MAX_SAFE_INTEGER);
122692
- if (continuing && (resumed.nextField > leaves.length || result.fields.length !== resumed.nextField || result.fields.some((field, index) => field.path !== leaves[index]?.path || field.value !== leaves[index]?.value)))
122693
- throw new Error("Review checkpoint fields do not match draft");
122701
+ let leaves = researchLeaves(data, Number.MAX_SAFE_INTEGER);
122702
+ if (continuing) {
122703
+ const byPath = new Map(leaves.map((field) => [field.path, field]));
122704
+ const completedPaths = new Set(result.fields.map((field) => field.path));
122705
+ if (resumed.nextField > leaves.length || result.fields.length !== resumed.nextField || completedPaths.size !== result.fields.length || result.fields.some((field) => !byPath.has(field.path) || byPath.get(field.path).value !== field.value))
122706
+ throw new Error("Review checkpoint fields do not match draft");
122707
+ leaves = [
122708
+ ...result.fields.map(({ path, value }) => ({ path, value })),
122709
+ ...leaves.filter((field) => !completedPaths.has(field.path))
122710
+ ];
122711
+ }
122694
122712
  if (!leaves.length) {
122695
122713
  result.data = data;
122696
122714
  result.status = result.limitations.length ? "partial" : "empty";
@@ -122709,7 +122727,7 @@ Correct the previous schema-invalid response using the validation diagnostics. T
122709
122727
  await persistReview(pass, offset, true, data);
122710
122728
  let reviewed;
122711
122729
  try {
122712
- reviewed = await generate("review", ReviewSchema, "Independently review EVERY JSON pointer and its value. supported requires exact quotes establishing the entire fact for the correct entity and time. A name mention or publication date is insufficient to establish employment, event date, ownership, or buying intent. Check all sources for actual factual contradictions. Complementary details from different sources are not a conflict; a price from one source and a term from another can jointly support a claim. Use conflicting only when sources make incompatible factual statements, unsupported for contradicted claims, unknown for missing support. Match the requested event period: an August release is not a September event even when published in September. Quoted wording must be verbatim; a paraphrase cannot be placed in quotation marks. Vendor claims about first/best status and performance metrics must remain explicitly attributed in the answer itself, not just in your reason. Null is unknown. Cite only supplied passage IDs; their text will be copied verbatim by the runtime. For each field, explicitly check answersQuestion (directly answers query/schema/instructions, not background or a non-answer), correctEntity, correctTime, and preservesScope. Read surrounding context and headings, not only the matching quote. A benefit/trial condition is not a program-wide rule; customer conditions are not partner conditions; eligible is not approved or automatic. Preserve exceptions, qualifiers and marketing attribution. Every check must pass for supported. A leader\u2019s education or career history does not answer who currently leads a team. Keep each reason under 25 words. Cite only the minimum passages needed to establish the entire field, at most four. Do not invent passage IDs. Read adjacent passages for conditions and exceptions, even when citing only one. Return each pointer once. Never treat this review as independent real-world verification.", {
122730
+ reviewed = await generate("review", reviewSchemaForPaths(batch.map((field) => field.path)), "Review ONLY the JSON pointers supplied in fields for this batch. The full answer schema is context, not a request to review other fields or reconstruct the extraction. Return exactly one verdict per supplied pointer and nothing else. supported requires exact quotes establishing the entire fact for the correct entity and time. A name mention or publication date is insufficient to establish employment, event date, ownership, or buying intent. Check all sources for actual factual contradictions. Complementary details from different sources are not a conflict; a price from one source and a term from another can jointly support a claim. Use conflicting only when sources make incompatible factual statements, unsupported for contradicted claims, unknown for missing support. Match the requested event period: an August release is not a September event even when published in September. Quoted wording must be verbatim; a paraphrase cannot be placed in quotation marks. Vendor claims about first/best status and performance metrics must remain explicitly attributed in the answer itself, not just in your reason. Null is unknown. Cite only supplied passage IDs; their text will be copied verbatim by the runtime. For each field, explicitly check answersQuestion (directly answers query/schema/instructions, not background or a non-answer), correctEntity, correctTime, and preservesScope. Read surrounding context and headings, not only the matching quote. A benefit/trial condition is not a program-wide rule; customer conditions are not partner conditions; eligible is not approved or automatic. Preserve exceptions, qualifiers and marketing attribution. Every check must pass for supported. A leader\u2019s education or career history does not answer who currently leads a team. Keep each reason under 25 words. Cite only the minimum passages needed to establish the entire field, at most four. Do not invent passage IDs. Read adjacent passages for conditions and exceptions, even when citing only one. Return each pointer once. Never treat this review as independent real-world verification.", {
122713
122731
  query: input.query,
122714
122732
  asOf: result.generatedAt,
122715
122733
  instructions: task.instructions,
@@ -123539,5 +123557,5 @@ export {
123539
123557
  selectResearchMonitorEvents
123540
123558
  };
123541
123559
 
123542
- //# debugId=8B8DD9C3BFAE701F64756E2164756E21
123560
+ //# debugId=1ED45F4872733D3D64756E2164756E21
123543
123561
  //# sourceMappingURL=index.js.map