← back to Ken
Ken: reconcile-canary self-alerts to CNCP parking-lot on divergence (best-effort, never masks exit code). Installed as launchd com.steve.ken-reconcile-canary (30min + RunAtLoad) per Steve approval.
259b896b8854f906efc6cbfc49632597482f5f96 · 2026-08-03 10:24:39 -0700 · steve@designerwallcoverings.com
Files touched
M kalshi-dash/scripts/reconcile-canary.mjs
Diff
commit 259b896b8854f906efc6cbfc49632597482f5f96
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Mon Aug 3 10:24:39 2026 -0700
Ken: reconcile-canary self-alerts to CNCP parking-lot on divergence (best-effort, never masks exit code). Installed as launchd com.steve.ken-reconcile-canary (30min + RunAtLoad) per Steve approval.
---
kalshi-dash/scripts/reconcile-canary.mjs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/kalshi-dash/scripts/reconcile-canary.mjs b/kalshi-dash/scripts/reconcile-canary.mjs
index 919d674..945c1f6 100644
--- a/kalshi-dash/scripts/reconcile-canary.mjs
+++ b/kalshi-dash/scripts/reconcile-canary.mjs
@@ -47,9 +47,16 @@ try {
process.exit(0);
}
console.error('🚨 [reconcile-canary] DIVERGENCE — a credit/settle bug is back:');
- for (const c of fails) {
- console.error(` ${c.name}: ${usd(c.a)} vs ${usd(c.b)} (off by ${usd(Math.abs(c.a - c.b))}, ${(c.b !== 0 ? (c.a / c.b).toFixed(1) : '∞')}x)`);
- }
+ const lines = fails.map(c => `${c.name}: ${usd(c.a)} vs ${usd(c.b)} (off ${usd(Math.abs(c.a - c.b))}, ${(c.b !== 0 ? (c.a / c.b).toFixed(1) : '∞')}x)`);
+ for (const l of lines) console.error(' ' + l);
+ // Best-effort alert to CNCP parking-lot (local, no auth). Never let alerting failure mask the exit code.
+ try {
+ await fetch('http://127.0.0.1:3333/api/parking-lot', {
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ project: 'ken', title: 'Ken reconcile-canary DIVERGENCE (paper accounting bug back)', note: lines.join(' | ') }),
+ signal: AbortSignal.timeout(5000),
+ });
+ } catch { /* CNCP down — the log + exit 1 still carry the alert */ }
process.exit(1);
} catch (e) {
console.error('[reconcile-canary] error:', e.message);
← a33bc89 Ken (Cody gate c): add read-only reconciliation canary — ver
·
back to Ken
·
Ken: migrate live buy order to Kalshi v2 create-order (POST b2420a9 →