test(v1.1): fe_walk_v11 harness (89 checks, 3 staged catalogs) + polish from the walk

- app/fe_walk_v11.py: self-contained headless walk — stages rich /
  returns-only / dead-catalog Dbs, boots the scratch server on 9455
  (OPENROUTER_API_KEY unset), and verifies all ten items on the real page:
  keyboard map + guards + no-scroll, tap flow + Esc chains (deck and list
  paths), contain/blur computed styles, minimal rubric + debug toggle
  round-trip, the 0/25 -> 25/25 counter with undos, dry messaging, fresh
  pill, loud empty2 + nightly-recovery, violet bands, B1 regressions
  (flip clamps, one .topcard, no-lock storm) and the full P3 loop.
- Keyboard: ArrowDown/Backspace now no-op while a sheet is open (arrows
  work on the deck only — spec note); found by the walk.
- get_section: an empty composed section (fully drained catalog)
  recomposes on read once pool_counts shows stock again — the nightly
  import re-lights the deck without a manual forge (item 8 recovery).
This commit is contained in:
Torres
2026-11-13 14:04:11 -04:00
parent 08f945a029
commit 35138bdc22
3 changed files with 869 additions and 3 deletions

View File

@@ -501,6 +501,22 @@ def create_app(db_path, img_dir, state_dir=None):
conn, engine, size=25,
profile_version=prof['version'] if prof else None,
note='cold compose (first read)')
else:
# item 8: an empty composed section (the catalog was fully
# drained) recomposes on the read once stock exists — the
# nightly-import recovery path. Zero items + zero pool
# keeps serving the empty section (loud empty2).
n_items = conn.execute(
'SELECT COUNT(*) AS n FROM section_items'
' WHERE section_id=?', (sec['id'],)).fetchone()['n']
if n_items == 0 and any(secmod.pool_counts(conn).values()):
prof = secmod.latest_profile(conn)
engine = secmod.build_engine(conn, prof, now=utcnow())
secmod.close_section(conn, sec, utcnow(), status='closed')
sec = secmod.compose_section(
conn, engine, size=25,
profile_version=prof['version'] if prof else None,
note='refill compose (stock returned)')
return section_state(conn, sec)
finally:
conn.close()