feat(cli): one-shot DE parallel-router trial per install for real telemetry

HF_DE_PARALLEL_ROUTER is a producer env var with no self-serve opt-in path
for real users, so waiting for someone to manually enable it would never
produce the real-traffic telemetry (revert rate, verify-db distribution)
the router's soak plan calls for.

renderLocal now enables the experiment for free on a fresh install's CLI
renders until it actually engages once (routed or reverted — either
produces telemetry), then persists that to ~/.hyperframes/config.json and
never touches it again for that install. A render whose frame count never
crosses the router's own eligibility threshold doesn't consume the trial —
it stays available for a later render that does qualify.

Never overrides a user's own explicit HF_DE_PARALLEL_ROUTER setting, and
only engages when telemetry is enabled (no point risking the experimental
path if we can't record the resulting signal). Scoped to the in-process CLI
render path only — Docker renders don't thread perfSummary/errorDetails
back to the CLI process, so trial consumption can't be detected there.

Verified the config round-trip against a real file (fresh install ->
undefined -> write true -> persists across reread), not just the mocked
unit tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-07-09 21:40:16 -07:00
co-authored by Claude Sonnet 5
parent a355fb2f6b
commit 37b6a4e7e5
3 changed files with 192 additions and 1 deletions
+11
View File
@@ -63,6 +63,16 @@ export interface HyperframesConfig {
skillsOutdatedCount?: number;
/** How many skills were missing (not installed) at the last check. */
skillsMissingCount?: number;
/**
* True once the DE parallel-router experiment ("HF_DE_PARALLEL_ROUTER")
* has actually engaged (routed or reverted — either produces telemetry)
* on a render from this install. The CLI enables the experiment for free
* on renders from a fresh install until this fires once, then never
* touches it again — a one-shot trial to get real-traffic router
* telemetry without requiring anyone to manually opt in via env var.
* See `renderLocal`'s `maybeEnableDeParallelRouterTrial`.
*/
deParallelRouterTrialFired?: boolean;
}
const DEFAULT_CONFIG: HyperframesConfig = {
@@ -108,6 +118,7 @@ export function readConfig(): HyperframesConfig {
skillsUpdateAvailable: parsed.skillsUpdateAvailable,
skillsOutdatedCount: parsed.skillsOutdatedCount,
skillsMissingCount: parsed.skillsMissingCount,
deParallelRouterTrialFired: parsed.deParallelRouterTrialFired,
};
cachedConfig = config;