gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8b3cbdda8b3cbddaTracker: status, TR7 fix livemre8b3cbdda/tools/lambda-audit.py

1.8 KB

  1. # tools/lambda-audit.py <app dir> (mission 070, hybriel#48): every lambda that CHANGES a parameter without & (field/list
  2. # writes, or a local alias `x = p` / `let x = p` — mission 028: a plain declaration copies like `let`) — since 8efba065 it changes a COPY; check that each caller uses the returned value.
  3. import re,sys,glob,os
  4. os.chdir(sys.argv[1])
  5. files=[f for f in glob.glob('*.hl')+glob.glob('lib/*.hl')+glob.glob('components/*.hl')+glob.glob('tools/*.hl')+glob.glob('tests/*.hl')+glob.glob('shared/*.hl')]
  6. lam=re.compile(r'(?:^|[\s,(=])(?:static\s+)?([A-Za-z_]\w*)?\s*=?\s*\(([^()]*)\)\s*=>\s*\{')
  7. tot=0
  8. for f in sorted(files):
  9. src=open(f,encoding='utf-8').read()
  10. for m in re.finditer(r'\(([^()]*)\)\s*=>\s*\{',src):
  11. params=[p.strip() for p in m.group(1).split(',') if p.strip()]
  12. i=m.end(); depth=1
  13. while depth and i<len(src):
  14. c=src[i]
  15. if c=='{':depth+=1
  16. elif c=='}':depth-=1
  17. i+=1
  18. body=src[m.end():i-1]
  19. line=src.count('\n',0,m.start())+1
  20. tot+=1
  21. for p in params:
  22. if p.startswith('&'): continue
  23. p=p.split('=')[0].strip()
  24. if not re.match(r'^\w+$',p): continue
  25. hits=[]
  26. for pat,kind in [(r'\b%s(?:\.\w+|\[[^\]]*\])+\s*=(?!=)'%p,'field-assign'),(r'\b%s(?:\.\w+|\[[^\]]*\])*\.(push|pop|shift|unshift|splice|sort|reverse)\('%p,'list-mutate'),(r'^\s*(?:let\s+)?(\w+)\s*=\s*%s\s*$'%p,'alias')]:
  27. for h in re.finditer(pat,body,re.M):
  28. hits.append(kind+': '+body[max(0,h.start()-0):h.end()+20].split('\n')[0].strip())
  29. if hits:
  30. name=src[max(0,m.start()-60):m.start()].split('\n')[-1].strip()
  31. print(f'{f}:{line} [{name} ({",".join(params)})] param {p}:', ' | '.join(hits[:4]))
  32. print('lambdas scanned:',tot, file=sys.stderr)

Branches

Latest commits

  • 8b3cbddaTracker: status, TR7 fix livemre
  • ec30162aTracker: TR7 fix livemre
  • 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
  • 3e164b63Tracker: status after CL1mre
  • 9d686bb3Tracker: CL1 reviewedmre
  • b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
  • 298785f2Tracker: CL1 startedmre
  • 36b22710Tracker: port slot, CL1 briefmre
  • a401190fTracker: GO for the crash loopmre
  • e195d372Tracker: token pathsmre
  • 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
  • 8dd423f7README: login.js stays by caramboleyo's explicit rulemre
  • d8df1493tracker: standby service on port 45018 and a gap-free hand-over in deploy.sh step 4mre
  • 36dd1686ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • ff9b838etracker: the Ended status pill uses the same red as layouts (pill danger); gate updatedmre
  • 40d9719eTP2: LOG line and report for the tracker pillsmre
  • ab3f2ba5tracker: status, genres, TMDB/IMDb/TVDB/TVmaze links and list kinds use the theme's pill; dense season list with the season check centred on its title line; gates for bothmre
  • 521061d6tracker header on phones: signed in, the brand fits whole at 360 and 390 px (tighter gaps and side paddings, slightly smaller brand, narrow screens and signed in only); mobile gate checks itmre
  • 18114a53tracker: franchises gate waits for the signed-out selector instead of the removed Log in buttonmre
  • 08561d73ident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre