Credibility pass over the Green Man generator

Turn audit.py into a run() function and drop audit_run.py, which only
existed to import it quietly. Remove unused parameters, keys, helpers
and imports from draw.py, manifest.py and stl_build.py, and the source
file names in stl_build.FILES that pointed at nothing. Keep the brow
strip's taper and knob positions in geom.py only. Correct comments and
docstrings that disagreed with the code, and the README's claim about
counts.

The page changes only in markup: no stray spaces in class attributes,
and three CSS declarations that did nothing are gone. Guide HTML,
templates and print files are byte-identical apart from that.

Credibility pass over a7c04e5..HEAD; the next one can scope from here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Eric WagonerandClaude Fable 5.2 committed 2026-11-10 19:14:03 -05:00
1 parent b86153a9fd
commit f2bb87caeb
15 files changed
+148 -151

No files matched your search

+7 -7
View File
@@ -3,24 +3,24 @@ import json
from collections import Counter, OrderedDict
import geom as G, manifest as M, draw as D
from geom import TOP
from paths import WORK
IMG = 'img/'
from paths import WORK
REPORT = json.load(open(WORK / 'stl_report.json'))
ML = M.make_list()
STEPKEYS = list(M.STEPS)
ASSEMBLY = [k for k in STEPKEYS if not M.STEPS[k].get('prep')]
def photo(name, cap, cls=''): return f'<figure class="photo {cls}"><img src="{IMG}{name}.jpg" alt="{cap}"><figcaption>{cap}</figcaption></figure>'
def fig(svg, cap='', cls=''): return f'<figure class="fig {cls}">{svg}' + (f'<figcaption>{cap}</figcaption>' if cap else '') + '</figure>'
def ul(items, cls=''): return f'<ul class="{cls}">' + ''.join(f'<li>{i}</li>' for i in items) + '</ul>'
def photo(name, cap, cls=''): return f'<figure class="{("photo " + cls).strip()}"><img src="{IMG}{name}.jpg" alt="{cap}"><figcaption>{cap}</figcaption></figure>'
def fig(svg, cap='', cls=''): return f'<figure class="{("fig " + cls).strip()}">{svg}' + (f'<figcaption>{cap}</figcaption>' if cap else '') + '</figure>'
def ul(items): return '<ul>' + ''.join(f'<li>{i}</li>' for i in items) + '</ul>'
def ol(items): return '<ol>' + ''.join(f'<li>{i}</li>' for i in items) + '</ol>'
def table(head, rows, cls='data'): return f'<table class="{cls}"><thead><tr>' + ''.join(f'<th>{h}</th>' for h in head) + '</tr></thead><tbody>' + ''.join('<tr>' + ''.join(f'<td>{c}</td>' for c in r) + '</tr>' for r in rows) + '</tbody></table>'
PLACE = {'strap': 'strap', 'back': 'crown, outer (on the back)', 'centre': 'crown, centre (on the front)', 'front': 'crown, front row', 'cheeks': 'cheeks', 'nose': 'nose', 'tendrils': 'tendril ends',
'clusters': 'temple clusters', 'hang': 'hanging beside the cheeks', 'twigs': 'in the crown, between the leaf rows', 'strip': 'front of the band', 'knot': 'centre of the band'}
def where(pid):
c = Counter(p['step'] for p in M.PLACEMENTS if p['part'] == pid for _ in range(p.get('count', 1)))
c = Counter(p['step'] for p in M.PLACEMENTS if p['part'] == pid for _ in range(p['count']))
if pid == 'BASE': return 'everything is glued to it'
if pid == 'PATCH': return 'back of the band, one behind each strap slit'
if pid == 'SPIRAL': return f'{c["tendrils"]} on the lower cheek tabs, 2 per side'
@@ -203,7 +203,7 @@ SHORT = {'L': ('large leaf', 'large leaves'), 'M': ('medium leaf', 'medium leave
def qty(k, n): return f'{n} {SHORT[k][0 if n == 1 else 1]}'
def step_counts(key):
c = Counter()
for p in M.step_placements(key): c[p['part']] += p.get('count', 1)
for p in M.step_placements(key): c[p['part']] += p['count']
return OrderedDict((k, n) for k, n in c.items() if n)
def step_parts(key): return ''.join(f'<span class="chip">{qty(k, n)}</span>' for k, n in step_counts(key).items())
def piles():
@@ -281,7 +281,7 @@ def construction():
'Snap off the brims. Sand every flat back with 120 grit until it is dull, then wipe with alcohol. Contact cement will not hold on glossy PLA.',
'<b>Form the brow strip.</b> Warm it from the back on the gun’s low setting, moving constantly, until it starts to sag (10 to 15 seconds). Lay it on the curved band, press from the centre outward with a gloved hand, and hold for 30 seconds. Bend in stages; forcing the ends cold will crack it. Do not glue it yet.',
'<b>Dry-fit everything</b> against the front-view drawing in “How it goes together”: strip, knot, acorns over the strap, a few leaves held in place. A part that does not fit your base is much cheaper to notice now.'])}</section>''')
H.append('<section><h2>Stage F · Assembly</h2><p>' + f'{len(ASSEMBLY)} steps' + ', about two hours. Hot glue goes on leaf stems, so every blade can still be lifted to reach behind it. The brow strip and acorns are pressed on first, while the mask can still lie flat. The crown is built up after that, starting with the large leaves. Work with glasses within reach; several checks need them.</p>'
H.append(f'<section><h2>Stage F · Assembly</h2><p>{len(ASSEMBLY)} steps, about two hours. Hot glue goes on leaf stems, so every blade can still be lifted to reach behind it. The brow strip and acorns are pressed on first, while the mask can still lie flat. The crown is built up after that, starting with the large leaves. Work with glasses within reach; several checks need them.</p>'
+ ''.join(step_block(k, i+1) for i, k in enumerate(ASSEMBLY)) + '</section>')
H.append(f'''<section class="keep"><h2>Final fit</h2><div class="cols"><div>{ul([
'Put it on, then your glasses. Walk around, look down, shake your head.',