feat(v1.1): item 4 — minimal rubric (gauge + %) and rubric_debug 'why' toggle

- prefs API accepts the new rubric_debug key (off|on), the only new runtime
  write in v1.1; every section_state body now carries prefs.rubric_debug.
- fillRank renders the tank gauge + rounded % by default; the breakdown
  lines, audit footer and the quiet listing-enrichment fetch run only when
  the pref is on. List rows and the card face stay rubric-free (unchanged).
- Trends 'Actions' gains a 'Why breakdown: off | on' row in the setMode
  style; updateSectionUI repaints it on every section hydrate.
This commit is contained in:
Torres
2026-11-13 13:31:21 -04:00
parent e67f8a0cda
commit ac613e680a
2 changed files with 44 additions and 17 deletions

View File

@@ -456,6 +456,7 @@ def create_app(db_path, img_dir, state_dir=None):
for r in data['items']]
data['items'] = items
data['mode'] = mode
data['prefs'] = {'rubric_debug': get_pref(conn, 'rubric_debug', 'off')}
data['can_forge'] = (mode != 'strict'
or secmod.fresh_profile_exists(conn, sec))
data['counts'] = secmod.section_counts(conn, sec)
@@ -653,7 +654,8 @@ def create_app(db_path, img_dir, state_dir=None):
def set_pref_endpoint(body: dict):
key = body.get('key')
value = body.get('value')
allowed = {'forge_mode': ('ondemand', 'strict')}
allowed = {'forge_mode': ('ondemand', 'strict'),
'rubric_debug': ('off', 'on')}
if key not in allowed or value not in allowed[key]:
raise HTTPException(status_code=400,
detail='unknown or invalid pref')