Files
vyndr/src/routes/user.js
T
builtbykev f110bd63f1 Session F (night2): Phase 5 — records + dossier
5.1 Archetype defined on-page: one line from the archetype library under
    ARCHETYPE DNA (BOMBER — elite raw power…); expander keeps the long form.
5.2 VYNDR-on-team live: getModelAggregate team scope (migration-020 column)
    + /api/ledger/model?team= + ModelRecord mounted on the Team Hub header.
5.3 WNBA/NBA profile parity: minutes-based usage (+MIN season cell) when
    the feed carries minutes — absent beats invented.
5.4 Settings read meter: real rolling-24h usage from the SAME store the
    limiter enforces (GET /api/user/scan-meter + proxy). Metered tiers see
    'X of N reads today' + bar; unlimited tiers see nothing. Corrects the
    stale '5 scans / month' copy.
5.5 Per-tier calibration on the MODEL tab: A+/A/B/C chips with hit% at
    n>=20 PER TIER, 'building (n/20)' below — the separation between tiers
    is the proof the grades mean something.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 01:05:29 -04:00

28 lines
838 B
JavaScript

'use strict';
/**
* /api/user — per-user utility reads (Session 60, night2/F).
*
* GET /scan-meter (auth) — the Settings read meter: real usage from the
* SAME rolling-24h store the scan limiter enforces. Metered tiers get
* { used, limit, remaining }; unlimited tiers get { unlimited: true }
* (the UI hides the meter).
*/
const express = require('express');
const { requireAuth } = require('../middleware/auth');
const { scanUsage } = require('../middleware/scanLimit');
const router = express.Router();
router.get('/scan-meter', requireAuth, (req, res) => {
try {
return res.json(scanUsage(req));
} catch (err) {
console.error('[user/scan-meter]', err.message);
return res.status(200).json({ tier: req.user?.tier || 'free', unlimited: false, used: null, limit: null });
}
});
module.exports = router;