@semiont/gateway 0.5.32 → 0.5.33

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/openapi.json CHANGED
@@ -3972,6 +3972,24 @@
3972
3972
  "resourceId"
3973
3973
  ]
3974
3974
  },
3975
+ "DurabilityEvidence": {
3976
+ "type": "string",
3977
+ "enum": [
3978
+ "acknowledged",
3979
+ "probe-confirmed",
3980
+ "probe-refused",
3981
+ "probe-unreachable"
3982
+ ],
3983
+ "description": "How a job's annotations were established as durable — the OBSERVATION, never a conclusion drawn from it. 'acknowledged': the event log confirmed the batch (mark:commit-ok). 'probe-confirmed': the acknowledgement was lost and a later read found the batch's last annotation present — true, but a weaker claim than an ack, since it rests on the log appending a batch in order and stopping at the first failure. 'probe-refused': the read returned a failure reply; note this does NOT assert the annotations are absent, because a read that failed for its own reasons answers on the same channel. 'probe-unreachable': no answer came at all, so nothing was established either way. ABSENT means the question never arose — a job that committed no annotations. Never defaulted: a manufactured value here is a claim nobody made, in a log nobody can rewrite."
3984
+ },
3985
+ "FailureClass": {
3986
+ "type": "string",
3987
+ "enum": [
3988
+ "transient",
3989
+ "deterministic"
3990
+ ],
3991
+ "description": "Worker-side classification of a job failure, made where the error is still typed (at the gateway it is already a flattened string, and message-regex classification is the drift this exists to avoid). 'deterministic' — the same request cannot succeed on a second attempt — skips the retry budget. ABSENT means unrecognised, which is deliberately not the same claim as 'transient': only KNOWN-deterministic failures carry the class, because mis-reading a transient failure as deterministic halves reliability while the reverse costs one wasted attempt."
3992
+ },
3975
3993
  "GatheredContext": {
3976
3994
  "type": "object",
3977
3995
  "description": "Context gathered for a gather.* call — consumed by yield.* (generation) and the matcher. A shared base (graph, semanticContext, metadata, inferredRelationshipSummary) plus a discriminated `focus` that names the anchor: an annotation or a whole resource.",
@@ -4745,6 +4763,9 @@
4745
4763
  },
4746
4764
  "result": {
4747
4765
  "$ref": "#/components/schemas/JobResult"
4766
+ },
4767
+ "durability": {
4768
+ "$ref": "#/components/schemas/DurabilityEvidence"
4748
4769
  }
4749
4770
  },
4750
4771
  "required": [
@@ -4786,6 +4807,9 @@
4786
4807
  "type": "object",
4787
4808
  "additionalProperties": true,
4788
4809
  "description": "Full result object for extensibility"
4810
+ },
4811
+ "durability": {
4812
+ "$ref": "#/components/schemas/DurabilityEvidence"
4789
4813
  }
4790
4814
  },
4791
4815
  "required": [
@@ -4878,16 +4902,14 @@
4878
4902
  "description": "Entity-type units whose annotations were fully emitted before this failure (checkpointed resume). The queue records them on the retried job's metadata; a retried claim skips them so completed work is neither redone nor duplicated."
4879
4903
  },
4880
4904
  "failureClass": {
4881
- "type": "string",
4882
- "enum": [
4883
- "transient",
4884
- "deterministic"
4885
- ],
4886
- "description": "Worker-side classification of the failure, made where the error is still typed. 'deterministic' — the same request cannot succeed on a second attempt — skips the retry budget; absent or 'transient' retries as before. Only KNOWN-deterministic failures carry the class."
4905
+ "$ref": "#/components/schemas/FailureClass"
4887
4906
  },
4888
4907
  "willRetry": {
4889
4908
  "type": "boolean",
4890
4909
  "description": "Whether the queue will re-queue this job for another attempt. Computed by the worker from the SAME predicate the queue applies at failJob (one decision site, `willRetryAfter` in @semiont/jobs) using the retry budget carried on the claimed record. FALSE (or absent) means this failure is TERMINAL: a client's job-watch stream ends here. TRUE means the work continues on a fresh attempt — the failure is an event, not the end, and a stream that terminated on it would report a recovering run as a failed one (JOB-RESTART-SAFETY P5)."
4910
+ },
4911
+ "durability": {
4912
+ "$ref": "#/components/schemas/DurabilityEvidence"
4891
4913
  }
4892
4914
  },
4893
4915
  "required": [
@@ -4959,7 +4981,7 @@
4959
4981
  },
4960
4982
  "JobFailedPayload": {
4961
4983
  "type": "object",
4962
- "description": "Payload for job:failed domain event",
4984
+ "description": "Payload for the job:failed domain event — a permanent fact of the resource, not operational state. It carries the judgments the worker COMPUTED, not just its message: at the log they are otherwise unrecoverable, the only remaining witness being a flattened English string.",
4963
4985
  "properties": {
4964
4986
  "jobId": {
4965
4987
  "type": "string"
@@ -4974,8 +4996,15 @@
4974
4996
  "error": {
4975
4997
  "type": "string"
4976
4998
  },
4977
- "details": {
4978
- "type": "string"
4999
+ "failureClass": {
5000
+ "$ref": "#/components/schemas/FailureClass"
5001
+ },
5002
+ "willRetry": {
5003
+ "type": "boolean",
5004
+ "description": "Whether the worker computed that the queue would re-queue this job (same predicate the queue applies, `willRetryAfter`). Absent means the worker stated nothing. Without it a reader of the log cannot tell a run recovering across several job:failed events from that many dead jobs."
5005
+ },
5006
+ "durability": {
5007
+ "$ref": "#/components/schemas/DurabilityEvidence"
4979
5008
  }
4980
5009
  },
4981
5010
  "required": [
@@ -5089,6 +5118,10 @@
5089
5118
  "type": "integer",
5090
5119
  "description": "Entities found so far (reference-annotation)"
5091
5120
  },
5121
+ "entitiesExpected": {
5122
+ "type": "integer",
5123
+ "description": "Cumulative mentions the count-verifier priced across the pieces accepted so far — the denominator for a real progress bar (found of ~expected). Approximate by nature (the count saturates on very large pieces) and monotonically growing within a run. ABSENT when the provider does not verify detection yield, or before any piece has been priced: no claim, never zero."
5124
+ },
5092
5125
  "entitiesEmitted": {
5093
5126
  "type": "integer",
5094
5127
  "description": "Annotations emitted so far (reference-annotation)"
@@ -5110,6 +5143,29 @@
5110
5143
  "persistedCount": {
5111
5144
  "type": "integer",
5112
5145
  "description": "Annotations actually persisted for it — post-dedupe and post-durability-acknowledgement, so it counts what the event log holds, not what the model proposed. Beside foundCount this is the per-unit yield the sizing work is judged by. Present on flows whose units persist as they complete (reference-annotation); the tagging flow reports the same fact as byCategory on its result, because its annotations are built after the per-category loop."
5146
+ },
5147
+ "underReported": {
5148
+ "type": "object",
5149
+ "description": "Present only when pieces of this unit were accepted at the subdivision floor while a count call said more was present. The unit completed, but incompletely — this carries the EVIDENCE (found vs counted, over how many pieces), never a judgment against any expected yield. Absent means complete: genuinely absent, not defaulted.",
5150
+ "properties": {
5151
+ "pieces": {
5152
+ "type": "integer",
5153
+ "description": "Floor-accepted pieces in this unit."
5154
+ },
5155
+ "found": {
5156
+ "type": "integer",
5157
+ "description": "Annotations extraction did find on those pieces — every span write-time-verified."
5158
+ },
5159
+ "counted": {
5160
+ "type": "integer",
5161
+ "description": "Mentions the count calls reported across those pieces (approximate by nature)."
5162
+ }
5163
+ },
5164
+ "required": [
5165
+ "pieces",
5166
+ "found",
5167
+ "counted"
5168
+ ]
5113
5169
  }
5114
5170
  },
5115
5171
  "required": [
@@ -5434,6 +5490,10 @@
5434
5490
  "errors": {
5435
5491
  "type": "integer",
5436
5492
  "description": "Number of errors encountered"
5493
+ },
5494
+ "underReportedPieces": {
5495
+ "type": "integer",
5496
+ "description": "Total floor-accepted under-reported pieces across the job's units. Absent means none — the per-unit evidence rides the terminal progress frame's completedItems; this keeps the result self-describing without the progress stream."
5437
5497
  }
5438
5498
  },
5439
5499
  "required": [
@@ -5971,7 +6031,7 @@
5971
6031
  "properties": {
5972
6032
  "persisted": {
5973
6033
  "type": "integer",
5974
- "description": "Annotations this commit appended to the event log. Equals the batch size on success a retry re-appends what already landed rather than counting it out, because the annotation fold is idempotent by id and the log is append-only. Not a dedupe count."
6034
+ "description": "Annotations the command named that are durable in the event log. Equals the batch size on success, on a first commit and on a retry alike — the commit appends only what the resource does not already hold, so a wholly-redundant retry has still succeeded and says so. Not an append tally: a caller must never have to read a 0 as 'all good'."
5975
6035
  },
5976
6036
  "annotationIds": {
5977
6037
  "type": "array",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semiont/gateway",
3
- "version": "0.5.32",
3
+ "version": "0.5.33",
4
4
  "type": "module",
5
5
  "description": "Semiont gateway server - pre-built for npm consumption",
6
6
  "main": "dist/index.js",
@@ -30,13 +30,13 @@
30
30
  "@hono/swagger-ui": "^0.6.1",
31
31
  "@prisma/adapter-pg": "^7.10.0",
32
32
  "@prisma/client": "^7.10.0",
33
- "@semiont/core": "0.5.32",
34
- "@semiont/make-meaning": "0.5.32",
35
- "@semiont/observability": "0.5.32",
33
+ "@semiont/core": "0.5.33",
34
+ "@semiont/make-meaning": "0.5.33",
35
+ "@semiont/observability": "0.5.33",
36
36
  "ajv": "^8.20.0",
37
37
  "ajv-formats": "^3.0.1",
38
38
  "argon2": "^0.45.1",
39
- "hono": "^4.13.5",
39
+ "hono": "^4.13.7",
40
40
  "jsonwebtoken": "^9.0.2",
41
41
  "prisma": "^7.10.0",
42
42
  "winston": "^3.19.0",