Upstream syncs repeatedly re-introduce DocuSeal's freemium gates, delete
fork code, overwrite brand assets, and drop AGPL attribution; recovery took
~7 repair commits after the 3.0.2 sync. rebrand-check only catches surviving
DocuSeal *text*, and the REBRANDING.md post-merge checklist was manual and
not run reliably (two regressions it claims were fixed were still live).
Add bin/fork-check, a stdlib-only runner driven by config/fork_invariants.yml,
asserting: must-exist fork files/brand assets, must-not-exist placeholders /
console_redirect / lib/docuseal.rb (Zeitwerk guard), must-contain attribution
+ renamed identifiers + SDK tokens, path-scoped must-not-contain gate markers,
forbidden global markers, forbidden i18n keys, no dangling partial renders,
and PRESERVE<->ALLOW_PATTERNS consistency between rebrand-sync/rebrand-check.
Wired into CI as the 'Fork invariants' job. Allowlist the new guard + manifest
in rebrand-check and deny them in rebrand-sync so the sweep can't corrupt them.
Baseline cleanup so the new gate-absence checks pass (both documented as
removed in REBRANDING.md but live on master): remove the ENTERPRISE_PATHS
'Pro Edition' export paywall from errors_controller.rb, and the multitenant?
reminder-duration gate from _reminder_form.html.erb.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>