feat(miner): wire AMS's dead orb-export.js telemetry stub to a real central ingest endpoint - #5697
Conversation
…entral ingest endpoint orb-export.js already built a correctly-shaped, HMAC-anonymized batch of PR-outcome telemetry, but per its own comments never performed the network send -- AMS had zero visibility into miner-side usage/outcome trends. - New /v1/ams/ingest route + ams_signals/ams_instances tables, mirroring Orb's own self-host collector pattern (registration-gate, best-effort upsert), with an optional AMS_INGEST_TOKEN bearer gate. - orb-export.js: real fetch POST + cursor-based incremental resend avoidance (filterBatchSinceCursor/latestClosedAt), a new --send CLI flag (--enable alone still only builds+prints locally, no network I/O), and its own inline HMAC/secret-generation duplicated onto the shared #5680 engine primitive instead of a second implementation. - Ships default OFF (opt-in via --send, same as the existing --enable gate) -- this is a real privacy/product default, not decided here. Closes #5681
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 6871b07 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 04:52 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5697 +/- ##
==========================================
+ Coverage 95.02% 95.04% +0.02%
==========================================
Files 577 578 +1
Lines 45978 46060 +82
Branches 14724 14738 +14
==========================================
+ Hits 43689 43777 +88
+ Misses 1530 1524 -6
Partials 759 759
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-14 04:56:22 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
orb-export.jsalready built a correctly-shaped, HMAC-anonymized batch of PR-outcome telemetry -- but per its own comments (never contradicted until now) it never performed the network send. AMS had zero central visibility into miner-side usage/outcome trends, unlike Orb's own self-host collector.POST /v1/ams/ingestroute +ams_signals/ams_instancestables, mirroring Orb's collector pattern (registration-gate, best-effort upsert on write failure, optionalAMS_INGEST_TOKENbearer gate) -- kept as separate tables fromorb_signals/orb_instancesrather than a shared discriminator column, since AMS has nogate_verdict/reversal_flagconcept and forcing both products into one row shape would mean a pile of always-null Orb-only columns on every AMS row.orb-export.js: realfetchPOST, cursor-based incremental resend avoidance (filterBatchSinceCursor/latestClosedAt), a new--sendCLI flag (--enablealone still only builds+prints locally -- zero network I/O, so a contributor can inspect exactly what would be sent first), and its own inline HMAC/secret-generation logic replaced with the shared@loopover/engineprimitive from Extract shared telemetry-anonymization primitive into @loopover/engine #5680 instead of a second implementation.--enable --send. This is a real product/privacy default affecting every existing self-hosted AMS install, not something to silently flip on to match Orb's own opt-out posture.Test plan
npm run build --workspace @loopover/enginecleannpx tsc --noEmit --incremental falsecleannpm run db:migrations:check-- contiguous 0001..0149, no collisionsnpm run db:schema-drift:check--ams_signals/ams_instancesallowlisted as raw-SQL-only, matches migrationsnpm run miner:env-reference:check-- newGITTENSORY_MINER_AMS_COLLECTOR_URL/_TOKENdocumentednpm run test:coverage(unsharded): 829/829 test files, 16065/16065 tests passsrc/ams/ingest.tsand the new/modifiedrunOrbExportClicode paths at 100% line/branch/function coverage percoverage/lcov.info, including the DI-fallback branches (real default store/ledger/sender) via an isolated-tmp-DB test mirroring this session's established patternCloses #5681