<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aiman Malib</title>
    <description>The latest articles on DEV Community by Aiman Malib (@aimanmalib).</description>
    <link>https://dev.to/aimanmalib</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4223739%2F7edfd61b-88d5-4fec-83a7-15b6b5747950.jpg</url>
      <title>DEV Community: Aiman Malib</title>
      <link>https://dev.to/aimanmalib</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aimanmalib"/>
    <language>en</language>
    <item>
      <title>Amazon Bedrock Guardrails on Malaysian ID numbers: what it catches, and where a regex stops</title>
      <dc:creator>Aiman Malib</dc:creator>
      <pubDate>Mon, 23 Nov 2026 11:54:40 +0000</pubDate>
      <link>https://dev.to/aimanmalib/amazon-bedrock-guardrails-on-malaysian-id-numbers-what-it-catches-and-where-a-regex-stops-1b65</link>
      <guid>https://dev.to/aimanmalib/amazon-bedrock-guardrails-on-malaysian-id-numbers-what-it-catches-and-where-a-regex-stops-1b65</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; I ran Amazon Bedrock Guardrails' sensitive-information filter over 1,000 synthetic Malaysian documents from MyPII-Bench.&lt;br&gt;
Guardrails has no built-in type for the MyKad (national ID) or SSM company numbers, so I added three custom regexes written from the&lt;br&gt;
official formats. On cleanly formatted MyKad numbers it caught all 67 of 67. It caught none of the 165 noisy ones: OCR slips like&lt;br&gt;
&lt;code&gt;l&lt;/code&gt; for &lt;code&gt;1&lt;/code&gt;, and numbers split across a line. A one-line change to the separator brought the line-split cases from 0/70 to 70/70 and&lt;br&gt;
added one false positive. One configuration detail matters more than any regex: with &lt;code&gt;action&lt;/code&gt; alone, the filter did not run on&lt;br&gt;
&lt;code&gt;source=INPUT&lt;/code&gt; at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Malaysian text carries identifiers that global PII detectors don't know: the 12-digit MyKad (&lt;code&gt;YYMMDD-PB-####&lt;/code&gt;, where PB is one of&lt;br&gt;
86 place-of-birth codes), 12-digit SSM company registration numbers, and Malaysian phone formats. If you put Guardrails in front of&lt;br&gt;
a model that sees Malaysian customer data, you need to know which of these it will mask.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ApplyGuardrail&lt;/code&gt; with &lt;code&gt;source=INPUT&lt;/code&gt; and &lt;code&gt;outputScope=FULL&lt;/code&gt;, region &lt;code&gt;ap-southeast-2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Built-in PII types: &lt;code&gt;PHONE&lt;/code&gt;, &lt;code&gt;EMAIL&lt;/code&gt;, &lt;code&gt;NAME&lt;/code&gt;, &lt;code&gt;ADDRESS&lt;/code&gt;, &lt;code&gt;AGE&lt;/code&gt;, &lt;code&gt;CREDIT_DEBIT_CARD_NUMBER&lt;/code&gt; (action &lt;code&gt;ANONYMIZE&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Custom regexes, written from documented formats and frozen before the run: MyKad with all 86 JPN place-of-birth codes,
SSM 12-digit (year + entity code 01–06), and the old SSM form (&lt;code&gt;123456-X&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Benchmark: &lt;code&gt;ujian4&lt;/code&gt; split of MyPII-Bench, 1,000 synthetic documents in Malay, English and Manglish, labelled for three entities.
The split is deliberately hard: it includes OCR noise inside numbers, numbers broken by a newline, East Malaysian landlines, and
MyKad-shaped numbers in non-ID contexts (member or account numbers) that are labelled &lt;em&gt;not&lt;/em&gt; PII.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Two things that tripped me up (useful even if you skip the numbers)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set &lt;code&gt;inputEnabled&lt;/code&gt; and &lt;code&gt;inputAction&lt;/code&gt; explicitly.&lt;/strong&gt; My first guardrail version listed each entity with &lt;code&gt;action: ANONYMIZE&lt;/code&gt; only.
&lt;code&gt;ApplyGuardrail&lt;/code&gt; with &lt;code&gt;source=INPUT&lt;/code&gt; then returned &lt;code&gt;action: NONE&lt;/code&gt; and zero sensitive-information units, while the same text with
&lt;code&gt;source=OUTPUT&lt;/code&gt; was masked. Adding &lt;code&gt;inputEnabled: true, inputAction: "ANONYMIZE"&lt;/code&gt; (and the output pair) on every entity and regex fixed it.
If your input-side masking seems to do nothing, check this first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New accounts created through the console's Projects flow restrict regions.&lt;/strong&gt; &lt;code&gt;CreateGuardrail&lt;/code&gt; was denied by a service control
policy outside the project's selected region (I hit it in &lt;code&gt;ap-southeast-1&lt;/code&gt;), while &lt;code&gt;ApplyGuardrail&lt;/code&gt; itself was allowed. The error says
"explicit deny in a service control policy", which looks like a permissions bug but is a region choice.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Results (exact-match F1)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;All entities&lt;/th&gt;
&lt;th&gt;MyKad&lt;/th&gt;
&lt;th&gt;Phone&lt;/th&gt;
&lt;th&gt;SSM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Guardrails, frozen regexes&lt;/td&gt;
&lt;td&gt;0.470&lt;/td&gt;
&lt;td&gt;0.245&lt;/td&gt;
&lt;td&gt;0.595 (0.803 partial-overlap)&lt;/td&gt;
&lt;td&gt;0.509&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guardrails, tolerant separator (exploratory)&lt;/td&gt;
&lt;td&gt;0.528&lt;/td&gt;
&lt;td&gt;0.444&lt;/td&gt;
&lt;td&gt;0.595&lt;/td&gt;
&lt;td&gt;0.509&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MyPII 1.1.0 (my detector)&lt;/td&gt;
&lt;td&gt;0.980&lt;/td&gt;
&lt;td&gt;0.941&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The headline row is misleading on its own. The breakdown is the useful part:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MyKad by surface form.&lt;/strong&gt; Dashed, spaced and plain 12-digit forms: 67/67 caught. OCR letter slips: 0/95. Split across a line:
0/70 with the frozen regex, 70/70 after changing the separator from &lt;code&gt;[- ]?&lt;/code&gt; to &lt;code&gt;[-\s]{0,4}&lt;/code&gt;, at the cost of
one extra false positive. I did not try to handle OCR slips,
because that would be tuning to a test set I had already seen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;False positives.&lt;/strong&gt; Most MyKad false positives (131 of 247) are MyKad-shaped numbers in non-ID contexts, such as a member number.
A context-free regex cannot tell them apart. The benchmark counts them as errors; for privacy, masking them is a defensible choice.
Other false positives were invoice and reference numbers that happen to match the SSM format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone.&lt;/strong&gt; 115 of the phone "false positives" overlap a real phone number with different span boundaries, which is why
partial-overlap F1 is 0.803. The built-in &lt;code&gt;PHONE&lt;/code&gt; type also labelled 18 MyKad numbers as phone numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not scored.&lt;/strong&gt; Guardrails also found names (823), card numbers (23) and addresses (7). The benchmark doesn't label those, so this is
not an overall quality comparison.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd do as a builder
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add custom regexes for MyKad and SSM; Guardrails won't catch them otherwise. Use a whitespace-tolerant separator.&lt;/li&gt;
&lt;li&gt;Set the input-side fields explicitly and test with &lt;code&gt;source=INPUT&lt;/code&gt; before you rely on it.&lt;/li&gt;
&lt;li&gt;If you need OCR-robust or context-aware detection (member numbers vs ID numbers), a regex in Guardrails won't get you there; put a
Malaysia-specific recogniser in front of it, or accept masking the lookalikes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits and disclosure
&lt;/h2&gt;

&lt;p&gt;I built MyPII-Bench, its hard categories, and MyPII, the detector in the last row, so the benchmark plays to MyPII's strengths. The&lt;br&gt;
test templates were written by a different model family, but the categories are mine. The data is synthetic. Each guardrail ran&lt;br&gt;
once, and AWS does not version its detectors, so results may change. All test splits were already opened before this comparison, so&lt;br&gt;
it is descriptive, registered in the benchmark's pre-registration file before each run, with the exploratory variant labelled as such.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce
&lt;/h2&gt;

&lt;p&gt;Code, the exact guardrail definitions, and the raw Guardrails responses are in the MyPII repository (&lt;code&gt;docs/BANDINGAN-BEDROCK.md&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;hasil/cache/bedrock/&lt;/code&gt;, &lt;code&gt;scripts/bedrock_guardrail_cipta.py&lt;/code&gt;, &lt;code&gt;scripts/bedrock_pecahan.py&lt;/code&gt;). Re-scoring needs no AWS account; re-running&lt;br&gt;
needs about 1,000 Guardrails text units per guardrail. Repository: &lt;a href="https://github.com/sasateguh/mypii" rel="noopener noreferrer"&gt;https://github.com/sasateguh/mypii&lt;/a&gt; (results: &lt;a href="https://github.com/sasateguh/mypii/blob/main/docs/BANDINGAN-BEDROCK.md" rel="noopener noreferrer"&gt;docs/BANDINGAN-BEDROCK.md&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>aws</category>
      <category>privacy</category>
      <category>security</category>
      <category>malaysia</category>
    </item>
    <item>
      <title>Degup: a three-minute webcam game that checks if you can feel your own heartbeat</title>
      <dc:creator>Aiman Malib</dc:creator>
      <pubDate>Mon, 23 Nov 2026 07:36:02 +0000</pubDate>
      <link>https://dev.to/aimanmalib/degup-a-three-minute-webcam-game-that-checks-if-you-can-feel-your-own-heartbeat-4fpi</link>
      <guid>https://dev.to/aimanmalib/degup-a-three-minute-webcam-game-that-checks-if-you-can-feel-your-own-heartbeat-4fpi</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Try to tap in time with your own heartbeat, without touching your pulse. I tried for 40 seconds. The app's answer for that round was "No score": the camera saw 41 beats, I tapped 33, and the reading was too weak to judge. That is the run in the video below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Degup&lt;/strong&gt; is a desktop game for adults that runs this check with a normal webcam. "Degup" is the Malay word for a heartbeat. The Presage SmartSpectra SDK reads my pulse and my breathing from the camera. The game asks me to tap whenever I feel a beat, then shows my taps next to the beats the camera saw.&lt;/p&gt;

&lt;p&gt;One round takes about three minutes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scene&lt;/th&gt;
&lt;th&gt;What you do&lt;/th&gt;
&lt;th&gt;What the live signal does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;See&lt;/strong&gt; (30 s)&lt;/td&gt;
&lt;td&gt;Watch a lamp on the screen&lt;/td&gt;
&lt;td&gt;The lamp pulses once for every beat found in the SDK's pulse waveform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Feel&lt;/strong&gt; (40 s)&lt;/td&gt;
&lt;td&gt;The lamp goes dark. Press Space each time you feel a beat&lt;/td&gt;
&lt;td&gt;Each tap is placed inside its beat cycle and the pattern is scored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Bend&lt;/strong&gt; (60 s)&lt;/td&gt;
&lt;td&gt;Breathe in for 4 seconds and out for 6&lt;/td&gt;
&lt;td&gt;A live chart draws the gap between beats and shades it by your breath&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The result is one card: the sync score, beats seen, taps, how many milliseconds the heart slowed on each out-breath, and the average pulse. You can save the card as a PNG on your own computer. Nothing is uploaded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foftb0kc6p5yw3xj2eo31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foftb0kc6p5yw3xj2eo31.png" alt="The reveal screen: my taps drawn under the beats the camera saw" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Degup is a body-awareness game. It is not a health test, and every result screen says so.&lt;/p&gt;

&lt;p&gt;The app is in English and Bahasa Melayu. Every string lives in two language files with the same keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/xMVvHVXct-Y" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The video is one full run of the app, made in two steps. I filmed my face on my phone for three minutes: sitting still, then tapping the table each time I felt a beat, then breathing in for four seconds and out for six. Degup then read that recording as its camera, through the real SmartSpectra SDK in real time, and my taps were replayed from the tapping sounds in the recording. The run was made on a Linux server with no GPU and recorded with the app's own recorder. The camera preview in the corner is me. Every number on screen is the SDK's output on that recording: 41 beats seen, 33 taps, and no sync score, because the reading was too weak for most of the round.&lt;/p&gt;

&lt;p&gt;Three things you will see, so I will say them first. The pulse number starts near 100 and settles around 83 during See. During Feel the hint "The camera is too slow" shows a few times, because the server without a GPU could not always keep 30 frames per second. And the Data panel is not opened in this run. There is no narration and no editing. I have not yet recorded a clean session with a live webcam.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/aimanmalib/degup" rel="noopener noreferrer"&gt;github.com/aimanmalib/degup&lt;/a&gt;&lt;/strong&gt; (MIT)&lt;/p&gt;

&lt;p&gt;You can try the full game without a camera or an API key. It runs on a built-in synthetic signal, and every screen is labelled "Simulation". You need Git and Node.js 22.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/aimanmalib/degup.git &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; degup &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm ci &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;DEGUP_SUMBER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sim npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;aimanmalib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;degup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;degup&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;ci&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;DEGUP_SUMBER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"sim"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is also a replay mode with one example file. It holds numbers only, no images, and is labelled as a replay.&lt;/p&gt;

&lt;p&gt;You can also try the Simulation in a browser with nothing to install: &lt;a href="https://aimanmalib.github.io/degup/sim/" rel="noopener noreferrer"&gt;aimanmalib.github.io/degup/sim&lt;/a&gt;. It is the same game code on a simulated signal, and every screen says so.&lt;/p&gt;

&lt;p&gt;The commit history starts on 8 November and shows the build step by step.&lt;/p&gt;

&lt;p&gt;For live mode, get a free key at &lt;a href="https://physiology.presagetech.com/auth/register" rel="noopener noreferrer"&gt;physiology.presagetech.com&lt;/a&gt;, run &lt;code&gt;npm start&lt;/code&gt;, open &lt;strong&gt;Settings&lt;/strong&gt;, paste the key and save. The README has the full steps, the Linux sandbox note and the limits.&lt;/p&gt;

&lt;p&gt;Where to look:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/aimanmalib/degup/blob/main/src/sumber/live.ts" rel="noopener noreferrer"&gt;&lt;code&gt;src/sumber/live.ts&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;SDK setup: metric groups, telemetry off, one &lt;code&gt;metrics&lt;/code&gt; listener, error mapping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/aimanmalib/degup/blob/main/src/core/beats.ts" rel="noopener noreferrer"&gt;&lt;code&gt;src/core/beats.ts&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Beat detection on the raw waveform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/aimanmalib/degup/blob/main/src/core/score.ts" rel="noopener noreferrer"&gt;&lt;code&gt;src/core/score.ts&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Sync score and the band rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/aimanmalib/degup/blob/main/src/core/rsa.ts" rel="noopener noreferrer"&gt;&lt;code&gt;src/core/rsa.ts&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Breath and beat-gap maths for Bend&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/aimanmalib/degup/blob/main/lang/en.json" rel="noopener noreferrer"&gt;&lt;code&gt;lang/en.json&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The consent text, word for word&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The repo has 222 unit tests and 25 Electron tests that drive the built app. On my Linux host 23 of the Electron tests run and 2 are skipped.&lt;/p&gt;

&lt;p&gt;Variable names and code comments are in Malay, the working language of my studio. The README has a code map and a short glossary for reviewers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;Degup asks the SDK for two metric groups, cardio and breathing. It asks for nothing about the face.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Live Presage signal&lt;/th&gt;
&lt;th&gt;What Degup does with it, in real time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cardio.arterialPressureTrace&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Finds each heartbeat. Drives the lamp in See, the scoring in Feel and the beat gaps in Bend&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cardio.pulseRate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The number beside the lamp. Also a self-check: if my own beat count drifts more than 10% from it, those beats are marked noisy and not scored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;breathing.upperTrace&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shades the Bend chart with my real breath when the trace is steady&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;breathing.rate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;With the pulse rate, gives "about N beats per breath" on the result card&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;confidence&lt;/code&gt; and &lt;code&gt;stable&lt;/code&gt; on each sample&lt;/td&gt;
&lt;td&gt;Weak seconds are shaded on the timeline and left out of the score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;validationStatus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If the face is lost, out of position or joined by a second face for more than 1.5 seconds, the game pauses and says what to fix. Movement and light only show a hint, because weak seconds are already left out of the score&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Finding single beats.&lt;/strong&gt; The SDK gives a pulse rate, but a game about feeling one beat needs the moment of each beat. So Degup looks for them in the raw waveform. It removes slow drift with a one-second moving average, low-pass filters at 3 Hz, picks peaks above an adaptive threshold, and ignores anything within 330 ms of the last beat. On synthetic signals from 55 to 95 beats per minute the tests require at least 95% of beats found and a median timing error under 40 ms. On my own face, on the still first minute of the phone video, it found 58 beats in 43 seconds of waveform, where the SDK's pulse samples predict 65.7. That misses my own threshold, and the measurements file says so.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scoring a feeling.&lt;/strong&gt; The score rewards consistency, not speed. Each tap gets a position inside its beat cycle. If the taps land at the same position again and again, the score is high. If they are spread around the cycle, it is low. The score is the mean resultant length of those positions times 100. A steady lag does not cost points. Cameras add delay and so do fingers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What a tapper who feels nothing scores.&lt;/strong&gt; A steady rhythm can fool a score like this, so I measured that on the simulator. In 2,000 simulated rounds, taps at random gaps reached "Some sense" or better in 0.9% of rounds. A steady rhythm at exactly the simulated pulse rate reached "Some sense" or better in 14.6% and "In tune" in 3.5%. The bands are set from those numbers. A round with fewer than 20 taps, or taps that cover less than 30 seconds, gets "Too few taps to tell" and no band. The simulated pulse wanders by a few beats per minute, and that is what throws a steady rhythm off most of the time. The table and the command to repeat it are in &lt;a href="https://github.com/aimanmalib/degup/blob/main/docs/MEASUREMENTS.md" rel="noopener noreferrer"&gt;&lt;code&gt;docs/MEASUREMENTS.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One clock.&lt;/strong&gt; SDK samples carry timestamps in microseconds since the Unix epoch. Taps are stamped on the same clock. The score does not depend on how fast the video pipeline is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breath bends the beat.&lt;/strong&gt; In Bend the lamp becomes a breathing guide. The chart shows each gap between beats in milliseconds, shaded by breath in and breath out. In the run in the video the card shows 357 ms of slowing on each out-breath, from a reading that was weak for part of the round, so I would not lean on that number. The textbook name for this is respiratory sinus arrhythmia, and most hearts do it. The game shows it and makes no judgement about it.&lt;/p&gt;

&lt;p&gt;The integration follows the official &lt;code&gt;electron-quickstart&lt;/code&gt; sample. The renderer owns the camera and hands the stream to the SDK.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/sumber/live.ts, trimmed, names translated from Malay&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SmartSpectraSDK&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;requestedMetrics&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cardioMetrics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;breathingMetrics&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;enableTelemetry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;enableAccumulatedOutput&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useMediaStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cameraStream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"metrics"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;decodeMetrics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// exactly one listener&lt;/span&gt;
&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"validationStatus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tUs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;showHint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tUs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"insight"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insight&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                 &lt;span class="c1"&gt;// counted, never read&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What the SDK taught me
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;Metrics&lt;/code&gt; message has no &lt;code&gt;pulse&lt;/code&gt; field in 3.4.0.&lt;/strong&gt; The proto defines a &lt;code&gt;Pulse&lt;/code&gt; message with a pulse-respiration quotient, and my first build read it. The simulator produced it, so every test passed. A pre-submission review caught it by reading the generated types inside the package. Degup now divides the SDK's pulse rate by its breathing rate, and a test builds a real &lt;code&gt;Metrics&lt;/code&gt; object from the package so the shape cannot drift again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Insights fire on their own.&lt;/strong&gt; With cardio and breathing both requested, the SDK sends vitals snapshots to Presage for LLM Insights without being asked. The first goes out when the pulse rate settles. More follow as the breathing rate and heart rate variability settle, and then one goes out every 60 seconds. Turning telemetry off does not stop them. Degup never calls &lt;code&gt;requestInsight&lt;/code&gt;, but it cannot switch the automatic ones off. So it tells the player before the camera starts, and a Data panel counts every Insight that comes back. In the first-minute test on my phone video, one automatic Insight came back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No face, no data.&lt;/strong&gt; In a 20-second test file that shows only a test pattern, the SDK reported &lt;code&gt;kNoFaceFound&lt;/code&gt; 118 times and sent no metrics and no Insights. Degup pauses on that code and says "No face in view".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The renderer frame loop is the frame-rate budget.&lt;/strong&gt; In 3.4.0 the SDK's renderer loop draws every camera frame to a canvas, reads it back as full RGBA and posts it to the main process, all on the renderer's main thread. On a machine with no GPU a CPU profile showed &lt;code&gt;drawImage&lt;/code&gt;, &lt;code&gt;getImageData&lt;/code&gt; and &lt;code&gt;postMessage&lt;/code&gt; taking most of that thread, and only about 21 frames per second reached the SDK. The result was validation code 11 (&lt;code&gt;kFrameRateTooLow&lt;/code&gt;) after five seconds and SDK error 8 about five seconds later. Degup now scales frames down before the SDK sees them and keeps their timestamps (&lt;code&gt;sdk.bingkai_sdk&lt;/code&gt; in the config). With that and reduced motion, the same machine finished a full round.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The SDK wants close to 30 frames per second, and the error message does not say so.&lt;/strong&gt; When I fed it 15 frames per second on purpose, error 8 ("SmartSpectra processing failed") came within 10 seconds. I spent a day changing machines before I read the frame path and measured it. Setting &lt;code&gt;SMARTSPECTRA_DIAGNOSTICS=1&lt;/code&gt; makes the main process log how many frames it received, and that was the fastest way to see the real rate.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;I am entering &lt;strong&gt;Most Creative or Delightful Use&lt;/strong&gt; and &lt;strong&gt;Best Thoughtful Real-World Use&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most Creative or Delightful Use.&lt;/strong&gt; Most camera-vitals demos show you your numbers. Degup hides them and asks what you feel first. The idea comes from lab work on interoception, the sense of your own body from the inside. Researchers test it with tapping tasks such as the Phase Adjustment Task (&lt;a href="https://doi.org/10.1016/j.biopsycho.2021.108171" rel="noopener noreferrer"&gt;Plans et al., 2021&lt;/a&gt;), which need a sensor on the body. Here the laptop camera is the sensor. Degup is inspired by that work and is not a validated version of it. The moment the game is built around is the reveal, when your taps appear under the beats and you find out whether you were feeling or guessing.&lt;/p&gt;

&lt;p&gt;Three other entries ask a related question, and all three are worth a look. &lt;a href="https://dev.to/itxashancode/body-radar-a-game-where-you-guess-your-breath-and-pulse-before-the-camera-does-31lb"&gt;Body Radar&lt;/a&gt; asks you to guess a rate before the camera shows it. &lt;a href="https://dev.to/soumyadeepdey/feltbeat-count-your-own-heartbeats-while-a-webcam-keeps-the-real-number-to-itself-553b"&gt;Feltbeat&lt;/a&gt; asks you to count the beats you feel. &lt;a href="https://dev.to/samarth_kumble_a91ad88634/practical-a-webcam-physiology-lab-that-grades-itself-against-a-wrist-count-3adp"&gt;Practical&lt;/a&gt; runs that count as a classroom experiment and checks the camera against a wrist count. Degup asks for the timing of each beat. Its first commit is from 8 November.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use.&lt;/strong&gt; Degup is a game, so I am not claiming it fixes a problem in someone's day. The part I think carries over to real products is how it asks for the camera and what it admits. The consent screen names what the SDK sends out, including the automatic Insights. The Data panel counts what happened in this session, not what a policy says should happen. A weak reading is shown as weak, and a round with too little data gets no score. The whole app works in two languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consent.&lt;/strong&gt; The camera stays off until the player has seen seven plain points and ticked "I am 18 or older". "Not now" leaves the camera off. While the camera is on, the top bar says "Camera on" with a button to turn it off, and Esc turns it off at once. One person in the frame. Nothing runs in the background.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What is measured.&lt;/strong&gt; Pulse rate, pulse waveform, breathing rate and breathing waveform. The SDK's cardio group also computes heart rate variability; Degup does not show it. Degup does not request face metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where video goes.&lt;/strong&gt; Frames go from the camera into the SDK on the same computer. Presage's SDK privacy policy (3 November 2026, section 3.1) says images and video are processed on the device and are not sent to Presage. Degup does not save or send frames. The optional demo recorder saves a video of the app window, with the camera preview in it, to the local Videos folder, and only when you press Record demo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What the SDK sends to Presage.&lt;/strong&gt; API key and device checks, model downloads, and usage records such as session times and counts (sections 4.3 and 4.4). It also sends derived measurements automatically during each session, namely heart rate, breathing rate and heart rate variability, with a session identifier, so that Presage can generate AI Insights (section 4.2). Presage generates Insights using Anthropic (section 7.1). Developers and end users cannot turn this off at present (section 7.4). Degup sends no prompt text, never requests an Insight, and does not read the Insights that come back. It only counts them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDK telemetry.&lt;/strong&gt; Off (&lt;code&gt;enableTelemetry: false&lt;/code&gt;). The policy says this does not turn off authentication, model delivery or Insights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retention at Presage.&lt;/strong&gt; Insights requests and responses are kept while the developer account behind the API key is active, and deleted within 60 days after that account closes (section 10.1). In Degup you use your own free key, so that account is yours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What Degup stores.&lt;/strong&gt; Two small local files: your settings (language, camera, sound) and your API key, encrypted with Electron &lt;code&gt;safeStorage&lt;/code&gt;. It keeps no scores. A result card is saved only when you press Save, and a demo video only when you press Record demo. "Delete all Degup data" in Settings removes the settings and the key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI services.&lt;/strong&gt; Degup itself calls no AI model. The only AI involved is Presage's automatic Insights described above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limits of use.&lt;/strong&gt; Degup is not a medical device. It does not diagnose, treat or monitor any condition, and it is not for medical decisions. Presage states that SDK measurements are for general wellness and are not FDA cleared.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Agent Session
&lt;/h2&gt;

&lt;p&gt;I did not embed a session. The build ran as many Claude Code sessions on my own server, and the transcripts carry that server's private setup.&lt;/p&gt;

&lt;p&gt;Here is how the work was split. Degup was built with Claude Code. Claude agents, working under my standing project rules, wrote the spec, the code, the tests and the first draft of this post. A separate Claude session reviewed the work before I submitted. I approved the look of the app and filmed my face and my taps on my phone. A Claude session made the demo recording from that phone video on a server, checked the numbers in this post against the session files, and published the post and the video at my instruction.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
      <category>electron</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
