Spatial proof-of-presence for autonomous robots.
IMPORTANT: This is a SEPARATE project from MnemoPay. Do not mix codebases.
npm test # Run all 221 tests
npx vitest run # Same, explicit
npx tsc --noEmit # Type check only
npm run build # Compile to dist/6 layers, each isolated with derived keys:
| Layer | Path | Purpose |
|---|---|---|
| Perception | src/perception/ | HMAC-signed frames, stereo depth |
| Memory | src/memory/ | Place cells, grid cells, Merkle-signed LTM |
| Navigation | src/navigation/ | A* + RRT* on 3D voxel grids |
| Verification | src/verification/ | SSIM/LPIPS spatial proofs → payments |
| Anti-spoofing | src/antispoofing/ | Replay, patches, depth injection, canaries |
| Gamification | src/gamification/ | Trust tiers, badges, streaks, zone mastery, fleet leaderboard |
- Every frame is HMAC-SHA256 signed at capture (timestamp + sequence in payload)
- Keys derived per subsystem:
deriveKey(masterSecret, 'frame-signing')etc. - Fail closed on any integrity violation
- Monotonic sequence numbers detect replay attacks
- Canary landmarks detect memory poisoning
- Constant-time HMAC comparison (timingSafeEqual)
CameraFrame— RGB + depth + pose + HMAC + sequenceSpatialProof— Rendered vs captured comparison with cryptographic signatureSpatialSettlement— Payment contingent on spatial verification passingGridStampAgent— Main API: see/remember/navigate/verifySpatial/settle
src/types/index.ts— All interfaces and enumssrc/utils/crypto.ts— HMAC, SHA-256, nonces, key derivationsrc/utils/math.ts— Vec3, quaternions, coordinate transforms, Gaussian functionssrc/perception/camera.ts— FrameCapture, DualCameraSystem, depth fusionsrc/memory/spatial-memory.ts— ShortTermMemory (LRU+TTL), MidTermMemory, LongTermMemory (Merkle)src/memory/place-cells.ts— PlaceCell, GridCell, PlaceCellPopulation, GridCellSystemsrc/navigation/pathfinding.ts— OccupancyGrid, aStarPath, rrtStarPathsrc/verification/spatial-proof.ts— computeSSIM, approximateLPIPS, generateSpatialProof, createSettlementsrc/antispoofing/detector.ts— ReplayDetector, AdversarialPatchDetector, CanarySystem, FrameIntegrityCheckersrc/gamification/trust-tiers.ts— TrustTierSystem (6 tiers, HMAC-signed promotion/demotion)src/gamification/badges.ts— BadgeSystem (20+ badges, 5 categories, HMAC-signed awards)src/gamification/streaks.ts— StreakSystem (daily streaks, multiplier curve, freeze system)src/gamification/zone-mastery.ts— ZoneMasterySystem (coverage × success × time scoring)src/gamification/fleet-leaderboard.ts— FleetLeaderboard (multi-fleet rankings, HMAC-signed entries)src/index.ts— createAgent() factory, re-exports everything