File size: 21,979 Bytes
f55a8c1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | """Reference workflow (v5 merge).
Static stage files are the revised reference deliverables. Each dynamic stage consumes the actual preceding
versions in working/checkpoints/ and, at T11, the actual Zero Bank clarification note. Where the actual
predecessor matches the reference values, the reference deliverable is kept unchanged; otherwise the
dependent figures are re-derived from the actual predecessor.
"""
from pathlib import Path
import os,re,shutil,tempfile,subprocess
import fitz,openpyxl
from docx import Document
from reportlab.platypus import SimpleDocTemplate,Paragraph,Spacer
from reportlab.lib.styles import getSampleStyleSheet
from xml.sax.saxutils import escape
W=Path(os.environ.get('DELIVERBENCH_ORACLE_WORKSPACE','/workspace'));S=Path(__file__).parent;H=W/'working/checkpoints';C=W/'working/current';C.mkdir(parents=True,exist_ok=True)
stage=(W/'.checkpoints/deliverbench_current_step').read_text().strip();ref=S/'reference/working/checkpoints'/stage
for p in ref.iterdir() if ref.exists() else []:
if p.is_file():shutil.copyfile(p,C/p.name)
QUESTIONS=W/'source/E05/Zero_Bank_lender_questions_2026-07-22.md'
def need(ok,msg):
if not ok:raise RuntimeError('Reference lineage check failed: '+msg)
def text(p):
if not p.is_file():return ''
if p.suffix=='.pdf':
with fitz.open(p) as d:return '\n'.join(page.get_text() for page in d)
if p.suffix=='.docx':
d=Document(p);return '\n'.join([x.text for x in d.paragraphs]+[' | '.join(c.text for c in r.cells) for t in d.tables for r in t.rows])
if p.suffix=='.pptx':
from pptx import Presentation
d=Presentation(p);out=[]
for slide in d.slides:
for s in slide.shapes:
if s.has_text_frame:out.append(s.text)
if getattr(s,'has_table',False) and s.has_table:out+=[' | '.join(c.text for c in r.cells) for r in s.table.rows]
return '\n'.join(out)
return p.read_text()
def pdf_append(p,title,sections):
with tempfile.TemporaryDirectory() as td:
tmp=Path(td)/'note.pdf';styles=getSampleStyleSheet();story=[Paragraph(escape(title),styles['Heading1'])]
for h,s in sections:
story+=[Paragraph(escape(h),styles['Heading2'])]
for para in s.splitlines():story+=[Paragraph(escape(para),styles['BodyText']),Spacer(1,5)]
SimpleDocTemplate(str(tmp)).build(story)
original=fitz.open(p);extra=fitz.open(tmp);original.insert_pdf(extra);extra.close();out=Path(td)/'combined.pdf';original.save(out);original.close();shutil.copyfile(out,p)
def recalc(p):
if not shutil.which('soffice'):raise RuntimeError('LibreOffice is required; run this Oracle through the supplied Harbor Docker environment')
with tempfile.TemporaryDirectory() as td:
subprocess.run(['soffice','-env:UserInstallation=file://'+td+'/profile','--headless','--convert-to','xlsx','--outdir',td,str(p)],check=True,stdout=subprocess.DEVNULL,timeout=180)
q=Path(td)/p.name
if not q.exists():raise RuntimeError('Reference model recalculation did not produce a file')
shutil.copyfile(q,p)
def number(s):
x=re.search(r'-?\d[\d,]*(?:\.\d+)?',s);return float(x.group().replace(',','')) if x else 0
def terms():
p=H/'T07/platform_refinancing_term_sheet_v5.docx';need(p.is_file(),'v5 term sheet missing')
d=Document(p);rows={r.cells[0].text:[c.text for c in r.cells[1:]] for t in d.tables for r in t.rows}
return rows,text(p)
# Term-sheet rows feeding the model's Refinancing Cases tab (row numbers of the v4 model).
CASE_ROWS={'Total quantum':6,'Senior spread':7,'Senior tenor':9,'Annual senior amortisation':10,'Positive ECF sweep':11,'Arrangement fee':12,'Senior principal':30,'Preferred principal':31}
def case_inputs():
rows,termtext=terms();out={}
for label,r in CASE_ROWS.items():
need(label in rows,'v5 term sheet has no row '+label)
out[r]=[number(v)/(10000 if 'bps' in v else 100 if '%' in v else 1) for v in rows[label][:3]]
m=re.search(r'Base rate:\s*([\d.]+)%',termtext);need(m,'v5 term sheet has no base rate')
return out,float(m.group(1))/100
def model_matches(book,inputs,base):
tab=book['Refinancing Cases']
same=all(abs((tab.cell(r,c).value or 0)-v)<1e-9 for r,vals in inputs.items() for c,v in enumerate(vals,2))
return same and abs((book['Assumptions']['B38'].value or 0)-base)<1e-9
def apply_inputs(book,inputs,base):
tab=book['Refinancing Cases']
for r,vals in inputs.items():
for c,v in enumerate(vals,2):tab.cell(r,c,v)
book['Assumptions']['B38']=base
for c in range(2,5):tab.cell(8,c,'=Assumptions!$B$38')
if stage=='T05':
qoe=text(H/'T01/QoE_report_Alpha_FY2025_final.pdf');tax=text(H/'T04/tax_structuring_memo_v3.docx')
need('438,914' in qoe and '446,499' in qoe,'QoE platform EBITDA bases not found');need('25.4872' in tax,'separated tax scenario rate not found')
for name in ['T02/environmental_and_permitting_summary.pdf','T02/insurance_program_summary.docx','T03/technical_dd_beta_portfolio.docx','T03/metro_fiber_network_condition_report.pdf']:need(text(H/name).strip(),name+' unreadable')
need('438,914' in text(C/'lender_presentation_June2026.pptx'),'presentation does not carry the QoE basis')
if stage=='T06':need('7,585' in text(H/'T05/lender_presentation_June2026.pptx'),'June presentation unreadable')
if stage=='T07':need(text(H/'T06/IC_prereading_pack_v6.pptx').strip(),'pre-read v6 unreadable')
if stage=='T08':
p=C/'Alpha_Platform_Model_v4.xlsx';inputs,base=case_inputs();b=openpyxl.load_workbook(p)
if not model_matches(b,inputs,base):apply_inputs(b,inputs,base);b.save(p);recalc(p)
if stage=='T09':
core=openpyxl.load_workbook(H/'T08/Alpha_Platform_Model_v4.xlsx');inputs={r:[core['Refinancing Cases'].cell(r,c).value for c in (2,3,4)] for r in CASE_ROWS.values()};base=core['Assumptions']['B38'].value
for name,case in [('Platform_Model_v4 BaseSpread.xlsx',1),('Platform_Model_v4 CasePreferred.xlsx',2)]:
p=C/name;b=openpyxl.load_workbook(p)
if not model_matches(b,inputs,base):
shutil.copyfile(H/'T08/Alpha_Platform_Model_v4.xlsx',p);b=openpyxl.load_workbook(p);b['Refinancing Cases']['B17']=case;b['Assumptions']['B5']='2026-07-17';b.save(p);recalc(p)
log=C/'model_change_log.md';log.write_text(log.read_text()+f'\n- {name}: rebuilt from the issued v4 core model with the case selector set to {case}; inputs follow the v4 core model.\n')
if stage=='T10':
b=openpyxl.load_workbook(H/'T09/Platform_Model_v4 BaseSpread.xlsx',data_only=True);size=b['Refinancing Cases']['B6'].value
need(size and f'{size/1000:,.0f}' in text(C/'invitation letter.docx'),'invitation does not carry the BaseSpread facility size')
# Responses to the Zero Bank clarification note: one prepared disposition for each review check.
FEEDBACK={
'Please identify the earnings basis used for repayment and leverage, reconcile material differences and explain any unresolved limits before reliance.':'earnings_basis',
'Please provide the evidence supporting the stated diligence or insurance status, or revise the status and identify the outstanding condition and responsible workstream.':'diligence_closure',
'Please explain how the identified remedial work is reflected in capital expenditure and repayment analysis, including unpriced work and the evidence needed to resolve it.':'capex_basis',
'Please distinguish the platform cash-tax convention from the separated Metro Fiber analysis and explain the support and limits of the rate used.':'tax_scope',
'Please reconcile the invitation with the current indicative terms, identify any authorised change and correct or flag the affected current documents.':'terms_conflict',
'Please distinguish proposals, credit decisions and execution conditions from actual signing, security completion and funding; identify the evidence for any claimed completed step.':'authority',
'Please confirm how restricted cash is treated in net debt and in the cash available for debt service, and correct any current leverage or liquidity figure that is inconsistent with the indicative net-debt definition.':'restricted_cash',
'Please explain how the Case 2 senior and preferred amounts relate to the stated total facility, state whether that reading has been agreed or remains an assumption to be confirmed, and correct any affected current figures.':'case2_reading',
'Please reconcile the expiry of the indicative terms with the proposed commitment and signing timetable, and identify how the gap will be addressed before the terms lapse.':'expiry_signing',
}
DISPOSITION={
'earnings_basis':('Earnings basis','Current conclusion: repayment and leverage figures use FY2025 platform adjusted EBITDA of 446,499 on the management/model basis; the Perrindale QoE final report supports 438,914. The 7,585 difference is the Interconnect uplift (139,469 versus 131,884) and is not reconciled; 446,499 is not a QoE-verified or lender-accepted metric, and 438,914 remains the conservative lender reference. FY2027 senior net leverage in the Case 1 BaseSpread model is 5.16x on the model basis. Owner: Alpha finance with Perrindale. Evidence required: Interconnect reconciliation. Consequence: covenant sizing and leverage remain qualified for the commitment papers. To carry into the signing documents: the BaseSpread model and assumptions memorandum should keep both bases and the unreconciled 7,585, and the commitment draft should not describe EBITDA as verified.'),
'diligence_closure':('Diligence and insurance status','Current conclusion: no supplied document closes these items. Environmental and permitting conditions remain open: 17 FCC renewals and 8 pending applications, SPCC plans for 25 Beta sites, Tier II confirmations for 11 Beta sites, and Section 106 tribal consultation in Texas and New Mexico. The 2026/27 insurance programme bind and inception is recorded as Pending in the diligence evidence register; no binder or policy schedule is supplied. A planned renewal or remedy date is not evidence of closure. Owner: Alpha EHS and facilities, insurance broker and counsel. Evidence required: FCC grants, completed SPCC plans, Tier II filings, consultation close-out and a written binder with inception confirmation. Consequence: these remain conditions to the commitment papers and signing. To carry into the signing documents: the commitment draft should list them as outstanding conditions.'),
'capex_basis':('Remedial capital expenditure','Current conclusion: the three Beta structural repair estimates in the diligence evidence register total USD262,200 in US dollars, not thousands (MS-0417 USD86,400; MS-0562 USD54,200; MS-0289 USD121,600), and are not offset against routine maintenance. Metro Fiber remedial work has no repair price in the supplied register; it is not treated as zero and no amount is invented. Owner: technical adviser and Alpha operations. Evidence required: scoped cost estimates, timing and approvals. Consequence: repayment analysis carries the unpriced work as a disclosed exposure. To carry into the signing documents: the assumptions memorandum should keep the unpriced exposure as an open limitation.'),
'tax_scope':('Tax rate scope','Current conclusion: platform cash tax uses a simplified 21.0% federal-rate proxy, which is not a verified full effective tax burden. The 25.49% (25.4872%) combined rate in tax memorandum v3 applies only to the separated Metro Fiber scenario and is not a platform cash-tax rate. Owner: transaction tax advisers. Evidence required: validated platform cash-tax forecast, including state taxes and the interest limitation. Consequence: the 21.0% proxy remains a disclosed simplification. To carry into the signing documents: the BaseSpread model and memorandum should keep the 21.0% platform proxy and the Metro-only scope of 25.49%.'),
'terms_conflict':('Current indicative terms','Current conclusion: the current indicative terms are those of term sheet v5 dated 8 July 2026, read with the 7 July feedback register and the 1 July rate notice. Case 1 / Case 2 / Case 3: total facility 2,650,000 / 2,950,000 / 3,400,000; senior spread 325 / 350 / 375 bps over the 3.35% base rate reset on 1 July 2026; tenor 7 years; annual amortisation 1.00% / 1.00% / 1.25%; excess cash flow sweep 50% / 50% / 75%. As at 22 July, following the preferred withdrawal, Case 1 is the current execution basis. The 13 July invitation remains a dated three-case record and is not reissued. Owner: Zero Bank and Alpha treasury with counsel. Evidence required: a written amendment to v5 agreed by Zero Bank and Alpha for any change; none has been supplied. Consequence: the commitment papers are prepared on the v5 Case 1 terms. To carry into the signing documents: the commitment draft and BaseSpread model should carry the v5 Case 1 terms; the sign page should keep the invitation as a dated record and refer to v5 for current terms.'),
'authority':('Status of commitments','Current conclusion: as at 22 July 2026 there is no financing commitment, signing, release of existing security or funding. Final orders of 2,415,000 are order-book status, not signed or binding commitments or allocations, and 235,000 remains uncovered. Owner: Zero Bank and counsel. Evidence required: credit approvals, executed documents, lien releases and funds flow. Consequence: proposals and conditions remain open until evidenced. To carry into the signing documents: the sign page and commitment draft should remain unsigned drafts that record no completed step.'),
'restricted_cash':('Restricted cash','Current conclusion: covenant net debt offsets unrestricted cash only. At 31 December 2025, borrowings 2,318,640 plus finance leases 186,420 less unrestricted cash 142,380 gives 2,362,680. Restricted cash of 58,900 supports restoration bonds, letters of credit and environmental escrows; it is not deducted and is not treated as available for debt service. The 2,303,780 presentation that also deducts restricted cash is not a covenant figure; on the v5 definition at closing, Case 1 pro forma net debt is 2,650,000 plus 186,420 less 142,380, or 2,694,040 (6.03x FY2025 platform adjusted EBITDA of 446,499). Owner: Alpha finance. Evidence required: the closing cash account schedule separating restricted balances. Consequence: leverage is reported without any restricted-cash offset and remains above 4.50x. To carry into the signing documents: the BaseSpread model and memorandum should use 2,362,680 as covenant-basis net debt without offsetting restricted cash.'),
'case2_reading':('Case 2 amounts','Current conclusion: whether the 500,000 preferred tranche sits within the 2,950,000 Case 2 total has not been confirmed. The 13 July invitation used the inclusive reading (senior 2,450,000 plus preferred 500,000) as a working assumption; the additive reading would be senior 2,950,000 plus preferred 500,000. Neither reading is an agreed term. Lauterbach withdrew the preferred tranche on 17 July and the engagement terminated on 20 July; as at 22 July the current execution basis is Case 1, so no Case 2 figure carries into the commitment papers. Owner: Zero Bank and Alpha. Evidence required: written confirmation of the Case 2 structure if Case 2 is revived. Consequence: no Case 2 amount is relied on while Case 1 is the execution basis. To carry into the signing documents: the commitment draft should be prepared on Case 1 only, with the sign page keeping the three-case invitation as a dated record.'),
'expiry_signing':('Expiry of indicative terms','Current conclusion: the v5 indication expires on 30 September 2026, before the 15 October 2026 target signing; the current indicative terms do not cover that signing date. Owner: Zero Bank and counsel. Action: complete the commitment papers and signing before 30 September 2026, or obtain a written extension before that date. Evidence required: executed commitment papers and signing documents dated on or before 30 September 2026, or Zero Bank\'s written extension of the v5 indication. Consequence: without the extension the 15 October signing cannot rely on the current indicative terms. To carry into the signing documents: the commitment draft should record this expiry and the need for completion or written extension.'),
}
LIMITATIONS=[
'Platform cash tax: the model applies a simplified 21.0% federal statutory-rate cash-tax proxy. It is not a verified full effective tax burden; state taxes, the interest limitation, loss carry-forwards and timing differences are not modelled. The 25.49% (25.4872%) combined rate in tax structuring memorandum v3 applies only to the separated Metro Fiber scenario and is not used as a platform cash-tax rate.',
'Remedial capital expenditure: the three Beta structural repair estimates in the 19 May 2026 diligence evidence register total USD262,200 in US dollars, not thousands (MS-0417 USD86,400; MS-0562 USD54,200; MS-0289 USD121,600). They are not modelled as a separate cash-flow line: at about USD0.26 million they are immaterial against the model capital expenditure (FY2025 segment capex of 115,401 in USD thousands), and they are disclosed here as an identified exposure rather than offset against routine maintenance. Metro Fiber remedial work, including 27 splice enclosures warranting replacement, has no supplied cost estimate. It is not priced in the model and is not treated as zero; it remains an open limitation until the technical adviser and Alpha network operations provide scoped estimates, after which the capital expenditure covenant headroom should be re-tested.',
]
DOC_NAMES={'lender_presentation_June2026.pptx':'June lender presentation','invitation letter.docx':'13 July invitation','platform_refinancing_term_sheet_v5.docx':'term sheet v5'}
def lender_points():
body=QUESTIONS.read_text() if QUESTIONS.is_file() else ''
points=[]
for m in re.finditer(r'^(R-\d{2}): (.+?)\n\((.*?)\)\s*$',body,re.M):
docs=sorted({v for k,v in DOC_NAMES.items() if k in m.group(3)}) or ['circulated package']
points.append((m.group(1),FEEDBACK.get(m.group(2).strip()),', '.join(docs)))
return body,points
if stage=='T11':
body,points=lender_points();need(body.strip(),'Zero Bank clarification note not released')
sections=[]
if not points:
sections.append(('Clarification points','Zero Bank’s 22 July lender review raised no specific additional clarification point on the June presentation, the 13 July invitation or the v5 indicative terms. This is not lender approval or a credit decision: the existing conditions and the lenders’ credit decisions remain unchanged, and the actions above remain open.'))
for ident,check,docs in points:
need(check in DISPOSITION,'unrecognised clarification point '+ident)
title,disposition=DISPOSITION[check]
sections.append((f'{ident} — {title} ({docs})',disposition))
if points:sections.append(('Effect on this update','Answering these points is not lender approval or completion of any condition. The responses do not change the v5 indicative terms; where a point concerns the 13 July invitation, that invitation remains a dated record and the current position is stated in this update.'))
pdf_append(C/'lender_syndication_update.pdf','Zero Bank clarification points of 22 July 2026 — responses',sections)
if stage=='T12':need(text(H/'T11/lender_syndication_update.pdf').strip(),'syndication update unreadable')
if stage=='T13':
need('13 July 2026' in text(H/'T10/invitation letter.docx') and '13 July 2026' in text(C/'invitation letter sign page.docx'),'sign page does not preserve the dated invitation')
rows,termtext=terms();p=C/'letter_of_commitment_draft.docx';d=Document(p)
new={'Facility size':f'USD ${number(rows["Total quantum"][0])*1000:,.0f}','Credit spread':rows['Senior spread'][0].replace('bps','basis points')+' over the base rate','Tenor':rows['Senior tenor'][0],'Arrangement fee':rows['Arrangement fee'][0]+' of the committed quantum'}
changed=False
for t in d.tables:
for row in t.rows:
label=row.cells[0].text
if label in new and row.cells[1].text!=new[label]:row.cells[1].text=new[label];changed=True
if label=='Scheduled amortisation' and not row.cells[1].text.startswith(rows['Annual senior amortisation'][0]):row.cells[1].text=rows['Annual senior amortisation'][0]+' per annum of ORIGINAL senior principal, in equal quarterly instalments; remaining balance at final maturity.';changed=True
if label=='Excess cash flow sweep' and not row.cells[1].text.startswith(rows['Positive ECF sweep'][0]):row.cells[1].text=rows['Positive ECF sweep'][0]+' of positive excess cash flow under the agreed definition; direct order of maturity unless otherwise agreed.';changed=True
if changed:d.save(p)
for st,name in [('T09','Platform_Model_v4 BaseSpread.xlsx'),('T09','model_assumptions_memo_v2.docx'),('T11','lender_syndication_update.pdf'),('T12','football_field_summary.pptx')]:shutil.copyfile(H/st/name,C/name)
memo=C/'model_assumptions_memo_v2.docx';d=Document(memo);d.add_heading('Diligence limitations carried into the signing handover (21 August 2026)',1)
for para in LIMITATIONS:d.add_paragraph(para)
d.save(memo)
body,points=lender_points()
if points:
memo=C/'model_assumptions_memo_v2.docx';d=Document(memo);d.add_heading('Lender clarification points carried into the signing handover (21 August 2026)',1)
d.add_paragraph('Zero Bank’s 22 July clarification points and their disposition are set out in the 22 July syndication update. Their effect on this memorandum at 21 August 2026:')
for ident,check,docs in points:
title,disposition=DISPOSITION[check];d.add_paragraph(f'{ident} ({title}): {disposition}')
d.add_paragraph('The current execution basis is all-debt Case 1 under the 14 August 2026 signing instruction. As at 21 August 2026 there is still no financing commitment, signing, release of existing security or funding, and Final orders of 2,415,000 are not binding commitments. The BaseSpread workbook remains the disclosed model and is not an executed funding record; the points above are not closed by this handover.')
d.save(memo)
final=W/'deliverables/final';final.mkdir(parents=True,exist_ok=True)
for p in C.iterdir():
if p.is_file():shutil.copyfile(p,final/p.name)
print('oracle:',stage,'preceding versions consumed')
|