[object Object]

← back to Domain Sniper

inspect: --summary flag for one-line YOLO status

e3b60dec8a62320c6ead7452b207c090f12a2450 · 2026-05-12 19:09:46 -0700 · steve

23 datapoints in the chart now scroll past a screenful. Added --summary
(or -s) flag that prints just the headline: cumulative sniped/total +
last-datapoint snapshot, colored green when 0 / red when >0. Default
behaviour (full ASCII chart) unchanged.

Useful for the YOLO loop's standing 'are we snipe-free' check that
otherwise needs a tail | grep cumulative.

Files touched

Diff

commit e3b60dec8a62320c6ead7452b207c090f12a2450
Author: steve <steve@designerwallcoverings.com>
Date:   Tue May 12 19:09:46 2026 -0700

    inspect: --summary flag for one-line YOLO status
    
    23 datapoints in the chart now scroll past a screenful. Added --summary
    (or -s) flag that prints just the headline: cumulative sniped/total +
    last-datapoint snapshot, colored green when 0 / red when >0. Default
    behaviour (full ASCII chart) unchanged.
    
    Useful for the YOLO loop's standing 'are we snipe-free' check that
    otherwise needs a tail | grep cumulative.
---
 inspect.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/inspect.js b/inspect.js
index c764047..e222a37 100755
--- a/inspect.js
+++ b/inspect.js
@@ -12,6 +12,7 @@ const path = require('path');
 
 const FILE = path.join(__dirname, 'data', 'honeypot-spotcheck.jsonl');
 const lines = fs.readFileSync(FILE, 'utf8').split('\n').filter(Boolean);
+const summaryOnly = process.argv.includes('--summary') || process.argv.includes('-s');
 
 const rows = []; // {elapsedH, snipes, total, label}
 
@@ -34,13 +35,22 @@ for (const [phase, b] of Object.entries(legacy)) {
 }
 rows.sort((a, b) => a.elapsedH - b.elapsedH);
 
+let cumSniped = 0, cumTotal = 0;
+for (const r of rows) { cumSniped += r.snipes; cumTotal += r.total; }
+const last = rows[rows.length - 1];
+
+if (summaryOnly) {
+  const tag = cumSniped > 0 ? '\x1b[31m' : '\x1b[32m';
+  const end = '\x1b[0m';
+  console.log(`  ${tag}${cumSniped}/${cumTotal}${end} sniped across ${rows.length} datapoints  |  last ${last ? `${last.elapsedH.toFixed(2)}h ${last.snipes}/${last.total} (${last.label})` : 'n/a'}`);
+  process.exit(0);
+}
+
 console.log(`\n  honeypot snipe-timing curve  (${rows.length} datapoints, ${lines.length} raw rows)`);
 console.log(`  ` + '-'.repeat(78));
 console.log(`  elapsed   snipes/total   rate   label                          chart`);
 console.log(`  ` + '-'.repeat(78));
-let cumSniped = 0, cumTotal = 0;
 for (const r of rows) {
-  cumSniped += r.snipes; cumTotal += r.total;
   const rate = r.total ? `${Math.round((100 * r.snipes) / r.total)}%` : 'n/a';
   const bar = '█'.repeat(r.snipes) + '·'.repeat(Math.max(0, r.total - r.snipes));
   const tag = r.snipes > 0 ? '\x1b[31m' : '';

← 6cf9621 spotcheck: extract reusable DoH-only honeypot sampler + 5.46  ·  back to Domain Sniper  ·  readme: ambient-drift baseline result — zero registrations o 1006f91 →