"""Integrated professional-extension bridge. Standard library only.""" from math import isclose def money(amount: float) -> str: """Format dollars with commas and parentheses.""" number = f"{abs(amount):,.0f}" return "$(" + number + ")" if amount < 0 else "$" + number ending_aoci = 48_000.0 - 30_000.0 transaction_gain = 200_000.0 * (1.11 - 1.08) translated_net_income = 780_000.0 - 700_000.0 translated_ending_re = 190_000.0 + translated_net_income - 20_000.0 cta = 1_420_000.0 - 610_000.0 - 500_000.0 - translated_ending_re goodwill = (650_000.0 + 150_000.0 + 120_000.0) - (1_200_000.0 - 350_000.0) consolidated_assets = 4_000_000.0 + 1_200_000.0 - 800_000.0 - 60_000.0 + 100_000.0 duplicate_facts = 1 rows = [ ("Ending AOCI", ending_aoci), ("Year 5 transaction gain", transaction_gain), ("Translation adjustment", cta), ("Goodwill", goodwill), ("Consolidated assets", consolidated_assets), ] print("Cedar Trail — professional-extension release bridge") for label, amount in rows: print(f"{label:<34} {money(amount):>14}") print(f"{'Complete-key XBRL duplicates':<34} {duplicate_facts:>14,d}") expected = [18_000, 6_000, 60_000, 70_000, 4_440_000] controls_pass = all( isclose(actual, wanted, abs_tol=0.01) for (_, actual), wanted in zip(rows, expected, strict=True) ) print("\nMechanical controls:", "PASS" if controls_pass else "FAIL") print("Release boundary: scope, valuation, designation, currency, control,") print("tag-selection, disclosure, and authorization assertions remain separate.")