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>
This commit is contained in:
@@ -93,7 +93,23 @@ function resetForTests() {
|
||||
hits.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Session 60 (night2/F, 5.4) — read-only usage for the Settings meter.
|
||||
* Reports the SAME rolling-24h window the limiter enforces, from the same
|
||||
* store — the meter can never disagree with the gate. Infinity limit →
|
||||
* { unlimited: true }.
|
||||
*/
|
||||
function scanUsage(req) {
|
||||
const tier = req.user?.tier || 'free';
|
||||
const limit = getScanLimit(tier);
|
||||
if (limit === Infinity) return { tier, unlimited: true, used: null, limit: null };
|
||||
const ts = hits.get(clientKey(req));
|
||||
const used = ts ? pruneOlderThan(ts, Date.now() - WINDOW_MS) : 0;
|
||||
return { tier, unlimited: false, used, limit, remaining: Math.max(0, limit - used) };
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
scanLimit,
|
||||
scanUsage,
|
||||
__internals: { hits, clientKey, resetForTests, WINDOW_MS, MAX_TRACKED },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user