Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for cgm-evidence-gate

1. What does the Skill do? It checks whether glucose-sensor exports on the NAS are complete and free of conflicting duplicates, then releases the 14-day window or refuses it, with the reason.

2. Target user and problem A person with diabetes who exports continuous glucose monitor (CGM) data before a clinic review. Duplicate uploads and sensor gaps can change the numbers. In one study of 2,038 patients, 528 had duplication errors in their CGM data.

3. Proposed solution Before anyone trusts a CGM summary, the Skill checks that the window holds enough readings (international consensus: 70% of 14 days) and no conflicting duplicates. Otherwise it refuses and lists the files, timestamps and gaps behind it.

4. Core User Flow The user names the folder, window end date, time zone and recording interval. The Skill fingerprints files, counts readings in unique ones, and returns release or refuse with a ledger. Saving a note needs approval.

5. Difference from existing tools It checks before any summary and is built to refuse. It never asks an agent to calculate glucose metrics, because language models are unreliable at wearable arithmetic. It counts, then points to the device's own report.

6. NAS capabilities, by step

  • Step 1, ug-filesystem (file-agent): find CSVs, read size and time, SHA-256 hash to flag exact duplicates.
  • Step 2, ug-document reconcile (document-agent): count filled recording-interval slots of automatic readings, flag slots holding two values, and gaps.
  • Step 3: the Skill applies the gate rules.
  • Step 4, ug-knowledge save-text (knowledge-agent): save the ledger after approval.

7. Technical approach One SKILL.md delegates to three registered experts in fixed order; each step gets only verified results from the one before. The gate rules sit in references/gate-rules.md, each with its source, signed by a physician. Release needs positive evidence: any missing field, unread file, truncation, second sensor, missing time offset across a clock change, or instruction-like text in a file means refuse. File contents are treated as data. The only write is the approved note, with files anonymised. No diagnosis or dose advice.

8. Development status

  • Done: SKILL.md, rules reference, UGREEN's static check (v0.7.3, no errors or warnings). Rules stress-tested on 14 seeded synthetic cases: raw-timestamp counting wrongly released 3; slot counting got all 14 right.
  • Not done: any run on a NAS.
  • Pending NAS validation: whether ug-document reconcile counts rows exactly, and the export's recording interval.

9. Validation plan All tests use seeded synthetic exports with known answers; counts must match exactly.

  • Same export imported twice: decision and coverage unchanged, second file listed as duplicate.
  • Five of 14 days removed from a complete export: refuse, gap named.
  • Edge: same data re-exported one hour later: refuse, slots listed.

10. Known limitations

  • Counting accuracy of the document agent is not yet measured.
  • One sensor per folder, CSV only, at most 60 files; exports need a record-type column.
  • A release means complete data, not an accurate sensor or good control.

Third-party material: none bundled. Sources cited in references/gate-rules.md: International Consensus on Time in Range (Diabetes Care 2019, doi:10.2337/dci19-0028); CGM metrics for clinical trials (Lancet Diabetes Endocrinol 2023, doi:10.1016/S2213-8587(22)00319-9). Duplication figure: CGM data-quality algorithm study (J Diabetes Sci Technol, doi:10.1177/19322968251319801).

Built With

  • markdown
  • ug-document
  • ug-filesystem
  • ug-knowledge
  • ugos
  • uliya-skill
Share this project:

Updates

Submission history