@semiont/gateway 0.5.32 → 0.5.34

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
@@ -3097,6 +3097,13 @@
3097
3097
  "type": "string",
3098
3098
  "description": "Optional correlation id echoed from the originating command. When present, the failure event can be matched back to the specific command that failed."
3099
3099
  },
3100
+ "code": {
3101
+ "type": "string",
3102
+ "enum": [
3103
+ "peer-unavailable"
3104
+ ],
3105
+ "description": "Machine-readable failure class, for consumers that must BRANCH on why a command failed rather than log it. Optional and deliberately sparse: absent means 'no class declared', and every existing failure stays that way. An enum rather than a free string so the vocabulary has an owner — an unconstrained code is a mirror with no gate, and adding one should be a deliberate spec change. `message` remains the human-readable text and is unaffected. Members: `peer-unavailable` — the channel this command was sent on has no subscriber, i.e. the service that answers it has not connected yet. Transient by nature (a peer still starting), which is what distinguishes it from a refusal: retrying is the correct response."
3106
+ },
3100
3107
  "message": {
3101
3108
  "type": "string",
3102
3109
  "description": "Human-readable error message"
@@ -3972,6 +3979,24 @@
3972
3979
  "resourceId"
3973
3980
  ]
3974
3981
  },
3982
+ "DurabilityEvidence": {
3983
+ "type": "string",
3984
+ "enum": [
3985
+ "acknowledged",
3986
+ "probe-confirmed",
3987
+ "probe-refused",
3988
+ "probe-unreachable"
3989
+ ],
3990
+ "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."
3991
+ },
3992
+ "FailureClass": {
3993
+ "type": "string",
3994
+ "enum": [
3995
+ "transient",
3996
+ "deterministic"
3997
+ ],
3998
+ "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."
3999
+ },
3975
4000
  "GatheredContext": {
3976
4001
  "type": "object",
3977
4002
  "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 +4770,9 @@
4745
4770
  },
4746
4771
  "result": {
4747
4772
  "$ref": "#/components/schemas/JobResult"
4773
+ },
4774
+ "durability": {
4775
+ "$ref": "#/components/schemas/DurabilityEvidence"
4748
4776
  }
4749
4777
  },
4750
4778
  "required": [
@@ -4786,6 +4814,9 @@
4786
4814
  "type": "object",
4787
4815
  "additionalProperties": true,
4788
4816
  "description": "Full result object for extensibility"
4817
+ },
4818
+ "durability": {
4819
+ "$ref": "#/components/schemas/DurabilityEvidence"
4789
4820
  }
4790
4821
  },
4791
4822
  "required": [
@@ -4878,16 +4909,14 @@
4878
4909
  "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
4910
  },
4880
4911
  "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."
4912
+ "$ref": "#/components/schemas/FailureClass"
4887
4913
  },
4888
4914
  "willRetry": {
4889
4915
  "type": "boolean",
4890
4916
  "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)."
4917
+ },
4918
+ "durability": {
4919
+ "$ref": "#/components/schemas/DurabilityEvidence"
4891
4920
  }
4892
4921
  },
4893
4922
  "required": [
@@ -4959,7 +4988,7 @@
4959
4988
  },
4960
4989
  "JobFailedPayload": {
4961
4990
  "type": "object",
4962
- "description": "Payload for job:failed domain event",
4991
+ "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
4992
  "properties": {
4964
4993
  "jobId": {
4965
4994
  "type": "string"
@@ -4974,8 +5003,15 @@
4974
5003
  "error": {
4975
5004
  "type": "string"
4976
5005
  },
4977
- "details": {
4978
- "type": "string"
5006
+ "failureClass": {
5007
+ "$ref": "#/components/schemas/FailureClass"
5008
+ },
5009
+ "willRetry": {
5010
+ "type": "boolean",
5011
+ "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."
5012
+ },
5013
+ "durability": {
5014
+ "$ref": "#/components/schemas/DurabilityEvidence"
4979
5015
  }
4980
5016
  },
4981
5017
  "required": [
@@ -5089,6 +5125,10 @@
5089
5125
  "type": "integer",
5090
5126
  "description": "Entities found so far (reference-annotation)"
5091
5127
  },
5128
+ "entitiesExpected": {
5129
+ "type": "integer",
5130
+ "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."
5131
+ },
5092
5132
  "entitiesEmitted": {
5093
5133
  "type": "integer",
5094
5134
  "description": "Annotations emitted so far (reference-annotation)"
@@ -5110,6 +5150,29 @@
5110
5150
  "persistedCount": {
5111
5151
  "type": "integer",
5112
5152
  "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."
5153
+ },
5154
+ "underReported": {
5155
+ "type": "object",
5156
+ "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.",
5157
+ "properties": {
5158
+ "pieces": {
5159
+ "type": "integer",
5160
+ "description": "Floor-accepted pieces in this unit."
5161
+ },
5162
+ "found": {
5163
+ "type": "integer",
5164
+ "description": "Annotations extraction did find on those pieces — every span write-time-verified."
5165
+ },
5166
+ "counted": {
5167
+ "type": "integer",
5168
+ "description": "Mentions the count calls reported across those pieces (approximate by nature)."
5169
+ }
5170
+ },
5171
+ "required": [
5172
+ "pieces",
5173
+ "found",
5174
+ "counted"
5175
+ ]
5113
5176
  }
5114
5177
  },
5115
5178
  "required": [
@@ -5434,6 +5497,10 @@
5434
5497
  "errors": {
5435
5498
  "type": "integer",
5436
5499
  "description": "Number of errors encountered"
5500
+ },
5501
+ "underReportedPieces": {
5502
+ "type": "integer",
5503
+ "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
5504
  }
5438
5505
  },
5439
5506
  "required": [
@@ -5971,7 +6038,7 @@
5971
6038
  "properties": {
5972
6039
  "persisted": {
5973
6040
  "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."
6041
+ "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
6042
  },
5976
6043
  "annotationIds": {
5977
6044
  "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.34",
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.34",
34
+ "@semiont/make-meaning": "0.5.34",
35
+ "@semiont/observability": "0.5.34",
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",