Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
14fae82
Add W3DS Health ontologies: observation-model health data (34 schemas)
Jul 28, 2026
eafaadf
Add mobility + nutrition-intake series and WalkingHeartRateObservatio…
Jul 29, 2026
ac5f05a
meal: nutritionEstimate.method enum ai-vision|food-log (imported food…
Jul 29, 2026
a9114b0
Add HealthPhoto ontology (private image envelope; blob store is publi…
EgorPPS Jul 29, 2026
c826c81
Meal: photo by reference to HealthPhoto; estimate carries model + der…
EgorPPS Jul 29, 2026
3316e96
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
93ea25a
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
b9c9c68
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
d9e87d8
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
32005bb
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
fa8c2bc
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
debbe4a
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
0faeab5
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
a61f754
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
114b01b
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
e33e761
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
2845acd
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
e65184c
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
84f168e
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
475d1e6
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
654d798
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
90752d3
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
b6ff019
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
3643e1b
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
0818ab7
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
b76100f
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
33cf121
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
e976bf8
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
9ca2538
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
785965f
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
d4fcdd8
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
3dcd244
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
66b363f
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
58a922e
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
d6613a1
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
0d79837
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
7c62485
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
0ad4626
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
06e6ec8
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
b459830
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
c1380cf
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
f79effa
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
a6112c5
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
31d9fa2
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
bf1ef17
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
f9060b0
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
690b082
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
298e913
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
ca84c14
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
af98b4f
Add provenance.platform (machine-readable authorship) to all health o…
EgorPPS Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions services/ontology/schemas/activeEnergySeries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"schemaId": "915892f9-693b-4f4f-95e6-17f9ceeb55ff",
"title": "ActiveEnergySeries",
"description": "Raw active energy burned samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: kcal.",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "@-prefixed eName of the person this data is about"
},
"device": {
"type": [
"string",
"null"
],
"description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown"
},
Comment on lines +12 to +18

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require device to preserve the unknown-device contract.

The descriptions specify null when unknown, but omission is also valid. This makes device identity ambiguous and breaks the documented person × day × device partition.

  • services/ontology/schemas/activeEnergySeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/basalEnergySeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/cyclingDistanceSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/environmentalAudioSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/exerciseMinutesSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/flightsClimbedSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/headphoneAudioSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/heartRateSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/heartRateVariabilitySeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/oxygenSaturationSeries.json#L12-L18: add "device" to required.
  • services/ontology/schemas/respiratoryRateSeries.json#L12-L18: add "device" to required.
📍 Affects 11 files
  • services/ontology/schemas/activeEnergySeries.json#L12-L18 (this comment)
  • services/ontology/schemas/basalEnergySeries.json#L12-L18
  • services/ontology/schemas/cyclingDistanceSeries.json#L12-L18
  • services/ontology/schemas/environmentalAudioSeries.json#L12-L18
  • services/ontology/schemas/exerciseMinutesSeries.json#L12-L18
  • services/ontology/schemas/flightsClimbedSeries.json#L12-L18
  • services/ontology/schemas/headphoneAudioSeries.json#L12-L18
  • services/ontology/schemas/heartRateSeries.json#L12-L18
  • services/ontology/schemas/heartRateVariabilitySeries.json#L12-L18
  • services/ontology/schemas/oxygenSaturationSeries.json#L12-L18
  • services/ontology/schemas/respiratoryRateSeries.json#L12-L18
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/ontology/schemas/activeEnergySeries.json` around lines 12 - 18,
Require the device property in the schemas’ required lists so unknown devices
must be represented explicitly as null. Apply this change to
activeEnergySeries.json, basalEnergySeries.json, cyclingDistanceSeries.json,
environmentalAudioSeries.json, exerciseMinutesSeries.json,
flightsClimbedSeries.json, headphoneAudioSeries.json, heartRateSeries.json,
heartRateVariabilitySeries.json, oxygenSaturationSeries.json, and
respiratoryRateSeries.json at lines 12-18; preserve the existing string-or-null
device type and description in each file.

"provenance": {
"type": "object",
"description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.",
"properties": {
"source": {
"type": "string"
},
"platform": {
"type": "string",
"description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description"
},
"externalId": {
"type": "string"
},
"sourceName": {
"type": "string"
},
"deviceSignature": {
"type": "string"
}
},
"required": [
"source"
]
},
"dedupKey": {
"type": "string",
"description": "Writer's idempotency key, unique within this ontology on the vault"
},
"contentHash": {
"type": "string",
"description": "Writer-maintained md5 of the payload; recomputed on every rewrite"
},
"updatedAt": {
"type": "string"
},
"date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "local day — chunk key"
},
"utcOffset": {
"type": "string",
"pattern": "^[+-]\\d{2}:\\d{2}$"
},
"unit": {
"type": "string",
"const": "kcal"
},
"sampleType": {
"type": "string",
"const": "interval"
},
"samples": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 3
}
Comment on lines +72 to +81

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== schema snippets =="
for f in services/ontology/schemas/activeEnergySeries.json services/ontology/schemas/basalEnergySeries.json services/ontology/schemas/cyclingDistanceSeries.json services/ontology/schemas/environmentalAudioSeries.json services/ontology/schemas/exerciseMinutesSeries.json services/ontology/schemas/flightsClimbedSeries.json services/ontology/schemas/headphoneAudioSeries.json services/ontology/schemas/heartRateSeries.json services/ontology/schemas/heartRateVariabilitySeries.json services/ontology/schemas/oxygenSaturationSeries.json services/ontology/schemas/respiratoryRateSeries.json; do
  echo "--- $f"
  sed -n '55,85p' "$f"
done

echo
echo "== schema header/descriptors around samples =="
for f in services/ontology/schemas/activeEnergySeries.json services/ontology/schemas/basalEnergySeries.json services/ontology/schemas/cyclingDistanceSeries.json services/ontology/schemas/environmentalAudioSeries.json services/ontology/schemas/exerciseMinutesSeries.json services/ontology/schemas/flightsClimbedSeries.json services/ontology/schemas/headphoneAudioSeries.json services/ontology/schemas/heartRateSeries.json services/ontology/schemas/heartRateVariabilitySeries.json services/ontology/schemas/oxygenSaturationSeries.json services/ontology/schemas/respiratoryRateSeries.json; do
  echo "--- $f"
  sed -n '1,90p' "$f" | grep -n -A2 -B2 -i 'samples\|interval\|point\|series\|timestamp\|epoch\|value' || true
done

echo
echo "== references to samples or series schemas =="
rg -n 'samples|activeEnergySeries|basalEnergySeries|cyclingDistanceSeries|environmentalAudioSeries|exerciseMinutesSeries|flightsClimbedSeries|headphoneAudioSeries|heartRateSeries|heartRateVariabilitySeries|oxygenSaturationSeries|respiratoryRateSeries' services/ontology -g '!*.lock' | head -200

Repository: MetaState-Prototype-Project/prototype

Length of output: 30154


🌐 Web query:

JSON Schema draft-07 tuple validation extra items additionalItems false

💡 Result:

In JSON Schema draft-07, the "additionalItems" keyword is used to control whether an array can contain items beyond those defined in a tuple [1][2]. Tuple validation occurs when the "items" keyword is provided as an array of schemas, where each schema corresponds to an element at a specific index [2][3]. When using "items" as an array (a tuple): - The "items" keyword defines the schemas for the initial elements of the array [2][3]. - The "additionalItems" keyword defines the schema that any subsequent elements (those at indices greater than the number of schemas in the "items" array) must validate against [1][2]. - Setting "additionalItems" to false explicitly forbids any elements beyond the number of schemas defined in the "items" array [2]. For example, a schema defined as: { "$schema": "http://json-schema.org/draft-07/schema#", "items": [ { "type": "boolean" }, { "type": "number" } ], "additionalItems": false } will validate arrays like [true, 10] but will fail for arrays like [true, 10, "extra"] [2]. Note that "additionalItems" only has an effect when "items" is an array [2]. If "items" is a single schema (object form) or is omitted, "additionalItems" is ignored by the validator [2]. As of later versions of JSON Schema (starting with the 2020-12 specification), tuple validation is handled by the "prefixItems" keyword, and "additionalItems" has been replaced or restructured to clarify its behavior [4][5].

Citations:


Enforce the documented sample tuple arity.

The samples arrays are described as fixed-length tuples, but the schemas currently allow 2 or 3 numbers per sample. Use Draft-07 tuple validation with additionalItems: false: three entries for interval series ([startEpochSeconds, endEpochSeconds, value]) and two entries for point series ([epochSeconds, value]).

📍 Affects 11 files
  • services/ontology/schemas/activeEnergySeries.json#L68-L77 (this comment)
  • services/ontology/schemas/basalEnergySeries.json#L68-L77
  • services/ontology/schemas/cyclingDistanceSeries.json#L68-L77
  • services/ontology/schemas/environmentalAudioSeries.json#L68-L77
  • services/ontology/schemas/exerciseMinutesSeries.json#L68-L77
  • services/ontology/schemas/flightsClimbedSeries.json#L68-L77
  • services/ontology/schemas/headphoneAudioSeries.json#L68-L77
  • services/ontology/schemas/heartRateSeries.json#L68-L77
  • services/ontology/schemas/heartRateVariabilitySeries.json#L68-L77
  • services/ontology/schemas/oxygenSaturationSeries.json#L68-L77
  • services/ontology/schemas/respiratoryRateSeries.json#L68-L77
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/ontology/schemas/activeEnergySeries.json` around lines 68 - 77,
Update the samples item schemas in
services/ontology/schemas/activeEnergySeries.json (68-77),
services/ontology/schemas/basalEnergySeries.json (68-77),
services/ontology/schemas/cyclingDistanceSeries.json (68-77),
services/ontology/schemas/environmentalAudioSeries.json (68-77),
services/ontology/schemas/exerciseMinutesSeries.json (68-77),
services/ontology/schemas/flightsClimbedSeries.json (68-77),
services/ontology/schemas/headphoneAudioSeries.json (68-77),
services/ontology/schemas/heartRateSeries.json (68-77),
services/ontology/schemas/heartRateVariabilitySeries.json (68-77),
services/ontology/schemas/oxygenSaturationSeries.json (68-77), and
services/ontology/schemas/respiratoryRateSeries.json (68-77) to use Draft-07
tuple validation with an explicit items array and additionalItems false: require
three entries for interval series and two entries for point series, preserving
the documented numeric order and types.

},
"stats": {
"type": "object",
"description": "DERIVED from samples — preview only",
"properties": {
"min": {
"type": "number"
},
"max": {
"type": "number"
},
"avg": {
"type": "number"
},
"sum": {
"type": "number"
},
"count": {
"type": "integer"
}
},
"required": [
"count"
]
}
},
"required": [
"subject",
"provenance",
"dedupKey",
"contentHash",
"date",
"utcOffset",
"unit",
"sampleType",
"samples",
"stats"
]
}
120 changes: 120 additions & 0 deletions services/ontology/schemas/basalEnergySeries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"schemaId": "28b50f16-0db1-445b-9f45-0412e9ac3f56",
"title": "BasalEnergySeries",
"description": "Raw basal (resting) energy burned samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: kcal.",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "@-prefixed eName of the person this data is about"
},
"device": {
"type": [
"string",
"null"
],
"description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown"
},
"provenance": {
"type": "object",
"description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.",
"properties": {
"source": {
"type": "string"
},
"platform": {
"type": "string",
"description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description"
},
"externalId": {
"type": "string"
},
"sourceName": {
"type": "string"
},
"deviceSignature": {
"type": "string"
}
},
"required": [
"source"
]
},
"dedupKey": {
"type": "string",
"description": "Writer's idempotency key, unique within this ontology on the vault"
},
"contentHash": {
"type": "string",
"description": "Writer-maintained md5 of the payload; recomputed on every rewrite"
},
"updatedAt": {
"type": "string"
},
"date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "local day — chunk key"
},
"utcOffset": {
"type": "string",
"pattern": "^[+-]\\d{2}:\\d{2}$"
},
"unit": {
"type": "string",
"const": "kcal"
},
"sampleType": {
"type": "string",
"const": "interval"
},
"samples": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 3
}
},
"stats": {
"type": "object",
"description": "DERIVED from samples — preview only",
"properties": {
"min": {
"type": "number"
},
"max": {
"type": "number"
},
"avg": {
"type": "number"
},
"sum": {
"type": "number"
},
"count": {
"type": "integer"
}
},
"required": [
"count"
]
}
},
"required": [
"subject",
"provenance",
"dedupKey",
"contentHash",
"date",
"utcOffset",
"unit",
"sampleType",
"samples",
"stats"
]
}
72 changes: 72 additions & 0 deletions services/ontology/schemas/biologicalSexFact.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"schemaId": "ae1f8c24-41e6-4ec3-a128-07e423811332",
"title": "BiologicalSexFact",
"description": "A BiometricFact: one self-sufficient biometric attribute of a person — biological sex, e.g. \"male\". One envelope per (person × source). Identity fields (name, birthDate) are NOT here — they live in the shared User ontology.",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "@-prefixed eName of the person this data is about"
},
"device": {
"type": [
"string",
"null"
],
"description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown"
},
"provenance": {
"type": "object",
"description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.",
"properties": {
"source": {
"type": "string"
},
"platform": {
"type": "string",
"description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description"
},
"externalId": {
"type": "string"
},
"sourceName": {
"type": "string"
},
"deviceSignature": {
"type": "string"
}
},
"required": [
"source"
]
},
"dedupKey": {
"type": "string",
"description": "Writer's idempotency key, unique within this ontology on the vault"
},
"contentHash": {
"type": "string",
"description": "Writer-maintained md5 of the payload; recomputed on every rewrite"
},
"updatedAt": {
"type": "string"
},
"value": {
"type": [
"string",
"boolean"
]
Comment on lines +55 to +59

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject boolean biological-sex values.

true/false have no interoperable biological-sex meaning. Restrict this to a controlled string vocabulary agreed by the ontology.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/ontology/schemas/biologicalSexFact.json` around lines 51 - 55,
Update the value definition in the biological-sex fact schema to remove the
boolean type and accept only strings from the ontology’s controlled
biological-sex vocabulary. Preserve the existing schema structure while
enforcing the agreed enum values.

},
"recordedAt": {
"type": "string"
}
},
"required": [
"subject",
"provenance",
"dedupKey",
"contentHash",
"value"
]
}
76 changes: 76 additions & 0 deletions services/ontology/schemas/bloodGlucoseObservation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"schemaId": "79568be5-45b3-40ed-a96a-e5e39bc8814b",
"title": "BloodGlucoseObservation",
"description": "One spot measurement of blood glucose = one envelope. Canonical unit: mmol/L.",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "@-prefixed eName of the person this data is about"
},
"device": {
"type": [
"string",
"null"
],
"description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown"
},
"provenance": {
"type": "object",
"description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.",
"properties": {
"source": {
"type": "string"
},
"platform": {
"type": "string",
"description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description"
},
"externalId": {
"type": "string"
},
"sourceName": {
"type": "string"
},
"deviceSignature": {
"type": "string"
}
},
"required": [
"source"
]
},
"dedupKey": {
"type": "string",
"description": "Writer's idempotency key, unique within this ontology on the vault"
},
"contentHash": {
"type": "string",
"description": "Writer-maintained md5 of the payload; recomputed on every rewrite"
},
"updatedAt": {
"type": "string"
},
"value": {
"type": "number"
Comment on lines +55 to +56

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Reject impossible negative health quantities. These schemas accept negative glucose, blood pressure, durations, distances, calories, sleep totals, dimensions, and route point counts, allowing invalid records into the eVault.

  • services/ontology/schemas/bloodGlucoseObservation.json#L51-L52: require non-negative glucose values.
  • services/ontology/schemas/bloodPressureObservation.json#L51-L55: require non-negative pressure values.
  • services/ontology/schemas/dailyActivitySummary.json#L55-L71: require non-negative totals and goals.
  • services/ontology/schemas/meal.json#L79-L83,109-L125,133-L134: require positive image dimensions, non-negative nutrition values, and confidence in [0, 1].
  • services/ontology/schemas/sleepSession.json#L94-L110: require non-negative duration totals.
  • services/ontology/schemas/workout.json#L61-L77,114-L115: require non-negative workout metrics and point counts.
📍 Affects 6 files
  • services/ontology/schemas/bloodGlucoseObservation.json#L51-L52 (this comment)
  • services/ontology/schemas/bloodPressureObservation.json#L51-L55
  • services/ontology/schemas/dailyActivitySummary.json#L55-L71
  • services/ontology/schemas/meal.json#L79-L83
  • services/ontology/schemas/sleepSession.json#L94-L110
  • services/ontology/schemas/workout.json#L61-L77
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/ontology/schemas/bloodGlucoseObservation.json` around lines 51 - 52,
Update the numeric property definitions across the specified schemas: in
services/ontology/schemas/bloodGlucoseObservation.json lines 51-52 and
services/ontology/schemas/bloodPressureObservation.json lines 51-55, enforce
non-negative values; in services/ontology/schemas/dailyActivitySummary.json
lines 55-71, enforce non-negative totals and goals; in
services/ontology/schemas/meal.json lines 79-83 and 109-125, require positive
image dimensions and non-negative nutrition values, and in lines 133-134
constrain confidence to [0,1]; in services/ontology/schemas/sleepSession.json
lines 94-110, enforce non-negative duration totals; and in
services/ontology/schemas/workout.json lines 61-77 and 114-115, enforce
non-negative metrics and point counts.

},
"unit": {
"type": "string",
"const": "mmol/L"
},
"measuredAt": {
"type": "string",
"description": "ISO 8601 with offset"
}
},
"required": [
"subject",
"provenance",
"dedupKey",
"contentHash",
"value",
"unit",
"measuredAt"
]
}
Loading
Loading