@semiont/jobs 0.6.9 → 0.6.10
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/README.md +16 -16
- package/dist/index.d.ts +117 -130
- package/dist/index.js +23 -25
- package/dist/index.js.map +1 -1
- package/dist/worker-main.js +43 -45
- package/dist/worker-main.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -9760,7 +9760,8 @@ Example format:
|
|
|
9760
9760
|
/**
|
|
9761
9761
|
* Build a prompt for detecting structural tags
|
|
9762
9762
|
*
|
|
9763
|
-
* @param content - The
|
|
9763
|
+
* @param content - The text content to analyze — a chunk sized by the
|
|
9764
|
+
* caller from derived provider limits; NEVER re-truncated here
|
|
9764
9765
|
* @param category - The specific category to detect
|
|
9765
9766
|
* @param schemaName - Human-readable schema name
|
|
9766
9767
|
* @param schemaDescription - Schema description
|
|
@@ -10188,7 +10189,7 @@ ${piece}
|
|
|
10188
10189
|
}
|
|
10189
10190
|
if (items.length * YIELD_COLLAPSE_BAND < counted) {
|
|
10190
10191
|
throw new YieldCollapseError(
|
|
10191
|
-
`Extraction found ${items.length} entities where a count call reports ~${counted} mentions (band \xD7${YIELD_COLLAPSE_BAND}) on a ${piece.length}-char chunk \u2014 silent yield collapse
|
|
10192
|
+
`Extraction found ${items.length} entities where a count call reports ~${counted} mentions (band \xD7${YIELD_COLLAPSE_BAND}) on a ${piece.length}-char chunk \u2014 silent yield collapse: deterministic \u2014 a same-size retry returns the identical under-report.`,
|
|
10192
10193
|
[...items],
|
|
10193
10194
|
{ found: items.length, counted, pieceChars: piece.length }
|
|
10194
10195
|
);
|
|
@@ -10737,9 +10738,8 @@ async function processCommentJob(content, inferenceClient, params, buildAnnotati
|
|
|
10737
10738
|
found += comments.length;
|
|
10738
10739
|
const fresh = dedupe(comments.map(
|
|
10739
10740
|
(c) => (
|
|
10740
|
-
//
|
|
10741
|
-
//
|
|
10742
|
-
// consumers that do language-aware rendering rely on them.
|
|
10741
|
+
// Format and language go on the body TextualBody: optional in the
|
|
10742
|
+
// schema, but consumers that do language-aware rendering rely on them.
|
|
10743
10743
|
buildAnnotation("commenting", c, [
|
|
10744
10744
|
{ type: "TextualBody", value: c.comment, purpose: "commenting", format: "text/plain", language: bodyLanguage }
|
|
10745
10745
|
])
|
|
@@ -10780,8 +10780,7 @@ async function processAssessmentJob(content, inferenceClient, params, buildAnnot
|
|
|
10780
10780
|
const fresh = dedupe(assessments.map(
|
|
10781
10781
|
(a) => (
|
|
10782
10782
|
// Single-object body with purpose aligned to motivation, matching the
|
|
10783
|
-
//
|
|
10784
|
-
// persisted assessments. Do not switch to an array or to
|
|
10783
|
+
// majority of persisted assessments. Do not switch to an array or to
|
|
10785
10784
|
// purpose='describing' — that loses the "this is an assessment, not
|
|
10786
10785
|
// a description" signal and breaks existing readers that access
|
|
10787
10786
|
// `body.value` directly on the object.
|
|
@@ -10849,11 +10848,11 @@ async function processReferenceJob(content, inferenceClient, params, buildAnnota
|
|
|
10849
10848
|
params.includeDescriptiveReferences ?? false,
|
|
10850
10849
|
logger,
|
|
10851
10850
|
params.sourceLanguage,
|
|
10852
|
-
// Liveness heartbeat
|
|
10853
|
-
//
|
|
10854
|
-
//
|
|
10855
|
-
//
|
|
10856
|
-
//
|
|
10851
|
+
// Liveness heartbeat: fires at chunk boundaries and every ~15 s while a
|
|
10852
|
+
// call is in flight, so a long single-chunk call is not silent. It
|
|
10853
|
+
// repeats the current position rather than inventing an advance — the
|
|
10854
|
+
// stall watchdog, janitor and client timeout need a signal, not a
|
|
10855
|
+
// monotone.
|
|
10857
10856
|
() => emitTypeProgress(entityTypeName),
|
|
10858
10857
|
(verdict) => {
|
|
10859
10858
|
underReported = {
|
|
@@ -11010,7 +11009,7 @@ async function processGenerationJob(inferenceClient, params, onProgress, logger)
|
|
|
11010
11009
|
`Unsupported outputMediaType for generation: ${outputMediaType}. Generation produces ${GENERATABLE_MEDIA_TYPES.join(" or ")}.`
|
|
11011
11010
|
);
|
|
11012
11011
|
}
|
|
11013
|
-
const title = params.title
|
|
11012
|
+
const title = params.title;
|
|
11014
11013
|
const entityTypes = (params.entityTypes ?? []).map(String);
|
|
11015
11014
|
if (outputMediaType === "application/pdf") {
|
|
11016
11015
|
onProgress(5, { code: "generating-resource" });
|
|
@@ -11289,26 +11288,25 @@ var WORKER_AWAITED_OPERATIONS = [
|
|
|
11289
11288
|
"job:claim",
|
|
11290
11289
|
"browse:resource-requested",
|
|
11291
11290
|
// Canonical geometry for a geometry-bearing detection: the consult behind
|
|
11292
|
-
// `ConsultAnchoredText
|
|
11293
|
-
//
|
|
11294
|
-
// (.plans/WORKER-ANCHORED-TEXT-CHANNEL.md); the census below now fails the
|
|
11291
|
+
// `ConsultAnchoredText`, answered by the Smelter. Without it every PDF
|
|
11292
|
+
// detection job fails at the transport probe; the census below fails the
|
|
11295
11293
|
// BUILD when this list and the declared awaits drift.
|
|
11296
11294
|
"browse:anchored-text-requested",
|
|
11297
|
-
// Durability acknowledgement for a unit's annotations
|
|
11298
|
-
//
|
|
11299
|
-
//
|
|
11300
|
-
//
|
|
11295
|
+
// Durability acknowledgement for a unit's annotations. The worker AWAITS
|
|
11296
|
+
// this one — a unit may not advance until its annotations are in the event
|
|
11297
|
+
// log — so its replies must be in the narrow channel set or every commit
|
|
11298
|
+
// fails fast with `bus.unsubscribed`.
|
|
11301
11299
|
"mark:commit",
|
|
11302
|
-
// The durability probe for a commit whose acknowledgement never routed
|
|
11303
|
-
//
|
|
11304
|
-
//
|
|
11305
|
-
//
|
|
11300
|
+
// The durability probe for a commit whose acknowledgement never routed.
|
|
11301
|
+
// SINGULAR by design: the annotation LIST channel is the multi-MB fan-out
|
|
11302
|
+
// this narrowing exists to keep out, and a rare error path is no reason to
|
|
11303
|
+
// let it in.
|
|
11306
11304
|
"browse:annotation-requested"
|
|
11307
11305
|
];
|
|
11308
11306
|
var WORKER_CONSUMED_BROADCASTS = [
|
|
11309
11307
|
// The queue announcement the claim adapter races for.
|
|
11310
11308
|
"job:queued",
|
|
11311
|
-
// Cooperative cancellation of the ACTIVE job
|
|
11309
|
+
// Cooperative cancellation of the ACTIVE job: it stops at a unit boundary.
|
|
11312
11310
|
"job:cancel-requested"
|
|
11313
11311
|
];
|
|
11314
11312
|
var WORKER_CHANNELS = [
|