components
All repositories: gitoria
2.6 KB
#!/usr/bin/env python3# (copied from gitoria .scratch/w082 for components mission 002; file filter = baseline.mjs names)# tests/same-output-modules.py <dirA> <dirB> (gitoria's modcmp.py): the browser modules of two baseline runs. A module = the component's own code + tables of the# statics it imports (each a real, client-callable function or a refusing server-only stub naming its file). A move of a# static to another file changes the tables and the source positions, not the behaviour. Checked here:# 1. the module without the import tables and with every source position masked is the same;# 2. every imported name the component's own code uses is the same kind (function / stub), a function with the same body.import os, re, sysa, b = sys.argv[1], sys.argv[2]POS = re.compile(r'[\w-]+\.hl:\d+:\d+')def parts(t):t = re.sub(r'\?v=[0-9a-f]+', '?v=H', t)kinds, own = {}, []lines = t.split('\n'); i = 0while i < len(lines):l = lines[i]m = re.match(r'\$_\d+\.(\w+)=(.*)$', l)if m:if m.group(2).startswith('()=>_55('): kinds.setdefault(m.group(1), ('stub', ''))else:body = [m.group(2)]while not lines[i].endswith('}));') and not (lines[i].endswith(';') and lines[i] is l and '=>{' not in l):i += 1; body.append(lines[i])kinds[m.group(1)] = ('fn', POS.sub('P', re.sub(r'\$_\d+', '$_N', '\n'.join(body))))i += 1; continueif re.match(r'const \$_\d+=\{\};$', l) or re.match(r'const \w+=\$_\d+\.\w+;$', l) or re.match(r'const \w+=\(\)=>_55\(2,', l):m2 = re.match(r'const (\w+)=\(\)=>_55\(2,', l)if m2: kinds[m2.group(1)] = ('plugin', '')i += 1; continueown.append(POS.sub('P', re.sub(r'\$_\d+', '$_N', l))); i += 1return kinds, '\n'.join(own)bad = 0for f in sorted(os.listdir(a)):if not (f.startswith('http__') and f.endswith('.hl')): continue # m002: the browser modules of baseline.mjsx, y = open(os.path.join(a, f)).read(), open(os.path.join(b, f)).read()if x == y: print(f, 'identical'); continuekx, ox = parts(x); ky, oy = parts(y)notes = []if ox != oy: notes.append('the component code differs')words = set(re.findall(r'\b\w+\b', ox))for n in sorted(words & (set(kx) | set(ky))):if kx.get(n) != ky.get(n): notes.append(f'{n}: {kx.get(n, ("absent",))[0]} → {ky.get(n, ("absent",))[0]}' + (' (body differs)' if kx.get(n, ('',))[0] == ky.get(n, ('',))[0] == 'fn' else ''))print(f, 'same code, same imported functions (only the tables / positions moved)' if not notes else 'DIFF: ' + '; '.join(notes))bad += len(notes)sys.exit(1 if bad else 0)
Branches
- mainmain branch
Latest commits
- 3bc905c5components #15 (mission 003) 2/2: docs (README Look, STATUS, LOG), reportmre
- 5a98d77ecomponents #15 (mission 003) 1/2: black/white base look — greys for nuances, no WorldAPI fallbacks, no decorative frames; site + icon black/white; gate 230/0mre
- 3f93d716components code order (mission 002) 4/4: docs, tests/letcount.py, tests/same-output*, reportmre
- e747cfa0components code order (mission 002) 3/4: let only where reassigned (257 dropped, 0 never-reassigned left); gate 220/0, layouts gate 73/0, same outputmre
- 172914a3components code order (mission 002) 2/4: lib/uploads.hl (demo upload storage), thin demo handlers, project.hl map; gate 220/0, same outputmre
- d29f35b1components code order (mission 002) 1/4: styles.hl -> components/styles.hl; gate 220/0, same outputmre
- 09945750components: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, http1 773de63e); gate 220/0mre
- ede4d19acomponents: Hybriel master 190aa11d (fc838894 GC correctness, #126 closure scopes, #127); gate 220/0mre
- 2bb9a935components: Hybriel master 8efba065 (re-vendor round 069: #126 memory, #48 lambda copy)mre
- e4f01768antcolony#40: mission references point to the moved missionsmre
- d32b44e2antcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
- 0fb80b57components: Hybriel master ff51cf46 (re-vendor round)mre
- 57408b6ecomponents#14: installable app (manifest, service worker, offline index), own iconmre
- 317bd09fdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- becbd59bcomponents#13: modal dialog (<dialog> based, focus wrap, backdrop/Esc/x close with reason, scroll lock, footer buttons)mre
- 367dd19adeploy.sh: never send .git or .gitignore to Byrodinmre
- 4b4dabe5State of 2026-09-27, before the move to gitoriamre