# Revision7 offline staging-review contract - #3967

Status: LOCAL REVIEW CANDIDATE ONLY. Root selected accepted64d4ab1d as the local
integration-review candidate containing accepted2957base316174719085440548a6df255e35b3b3faaa8379.
The revision7 descendant adds final qualification and a shared-workflow handoff
correction. No parent branch/base is moved; no merge, push, PR, publication,
staging/production deploy, activation, live migration, client access or send is
performed or authorized by this packet. Whole card remains open.

## Material correction and proof boundary

Prepared outputs deliberately refuse legacy editing/copying. The prior newsletter
lists also hid preview/test/send, and the shared selector's legacy numeric-version
filter could omit the new format on MariaDB. A focused regression reproduced the
missing preview link. Supported immutable identities now expose read/test/send
while keeping edit/copy unavailable. Both legacy/v2 selectors use one scoped query:
existing legacy versions remain eligible, supported format+output identity is
included, unknown/incomplete identities are excluded. Before additive identity
columns exist, the scope uses the old legacy-only predicate. Company/archive/type
filters remain at their existing call sites; authorization/consumption checks
still own final access. Turning authoring off retains these saved-output readers.

## Actual local upgrade qualification

NewsletterEditorLegacyFixture is a representative synthetic subset derived from
actual repository legacy Preview/Lifecycle fixtures, the2015 newsletter migration,
model/style/render/role/company/media contracts and shared-form queries. It seeds
own/foreign/archived/older-version legacy newsletters with real legacy text JSON,
media bytes and actual permission-role rows. It is NOT a production dump, sanitized
customer template, complete historical schema/FK inventory or whole-database migration.
Only the three actual editor migrations run, in order, from no editor tables and
no newsletter identity columns:

1. database/migrations/2026_10_16_140000_create_newsletter_editor_drafts.php
2. database/migrations/2026_10_16_170000_create_newsletter_editor_copies.php
3. database/migrations/2026_10_16_220000_create_newsletter_editor_outputs.php

Explicit opt-in NewsletterEditorUpgradeTest uses only a NEW nonce-owned
nuhet_editor_3967_r7_<16hex> on the previously qualified local root/empty canonical
socket, exact same-host identity and no administrative selected schema. Exclusive
creation/receipt, all aliases/PDO identity guards, InnoDB, scratch disks/logs and
exact drop/absence follow revision6's pattern. No accounts/grants/services/secrets
or other schemas/customer data are queried. Actual old row/column snapshots match
through upgrade; actual new columns/indexes are recorded from its exact schema.
MariaDB may report SQL NULL default as the literal metadata string NULL, handled
explicitly. No destructive full historical migration or schema-down is executed.

Before/after the upgrade, real legacy HTML preview and captured test-handler
bodies compare exactly. The legacy handler changes mail.driver to mail; fixture
mail.transport remains array and the actual effective ArrayTransport is asserted
at setup and MessageSending with exact synthetic sender/destination. This is
captured mail only. Opt-in save/prepare uses the real compiler/adapter; after
flag-off, prepared preview/shared reader and anonymous owned image remain exact.
Output migration down is intentionally no-op and retains those readers/assets.
Draft/copy down methods are destructive and are not a supported rollback path.

## Native ordinary entry qualification and inherited limits

Owned detached316 and64-before worktrees use their actual route/view/source and
source-matching ordinary assets; baseline316 is built locally with its actual Mix
pipeline. They are independent of all parent previews/DB/worktrees. An independent review found
that the first vendor symlink resolved optimized Composer App/helper paths to the
candidate. Those mixed-source baseline receipts are historical and withdrawn as
exact316 proof. Both baselines now use physical copies of the same locked vendor
dependencies, with explicit per-request App class and helper origin checks; only
the corrected isolated receipts qualify the comparison. New canonical
legacy fixtures are shared by baseline/candidate and all data/files live in exact
owned disposable SQLite directories with all live PDO aliases verified. The
explicit loopback router uses real file cookies/session/CSRF/middleware/roles but
synthetic local session bootstrap, NOT production credentials/login qualification.
Self-signed loopback HTTPS is not staging/production TLS proof. All non-loopback
browser requests are blocked; no customer/external client is accessed.

Actual populated legacy/v2 lists, canonical legacy editor GET/JSON/HTML, all-off
entry absence, ordinary opt-in new entry/keyboard save/prepare and shared output
read/send-form selection are observed where the native receipt says passed.
Shared sendout page is opened and selected; no sendout form submission, worker,
real SMTP or external recipient delivery is allowed. Prior accepted actual guarded
MIME/final-consumer evidence is reused only while still bound to unchanged paths.
Foreign-company/opt-out data remains isolated; the phone boundary remains saved
status/preview and ordinary shared-page responsiveness, not full phone authoring.

Known inherited limits MUST stay visible:
- Legacy /newsletter/{id}/parse/desktop/text calls with() on a renderer string and
  returns500 in the owned accepted316 baseline and candidate. Core legacy text
  rendering is separately compared, but the HTTP endpoint is NOT claimed working.
  No unrelated legacy-controller rewrite is included.
- Legacy editor/layout references public Angular/jQuery/CDN resources. With the
  local-only network guard, inherited Angular/jQuery bootstrap errors prevent
  full legacy JavaScript editing qualification. Real populated page/JSON/HTML
  route proof does not replace that missing JS proof. Exact baseline/candidate
  errors and ordinary local asset statuses are retained; no silent CDN injection
  or alternate desktop/browser/client surface is used.

## Offline package contents and custody

The task scratch rev7/staging-candidate package contains exact316-to-final commit
list, binary diff, changed files, source file hashes/copy, generated editor/ordinary
asset manifests, source/dependency/license provenance and bound prior/new evidence
index. A Git bundle, when included, is offline with explicit316 prerequisite; it
is verified locally and does not publish or select another base. Runtime vendor/
node_modules, credentials, databases, local session/TLS keys, customer data and
machine-private configuration are excluded. Ownership/cleanup stays with pane
p_0ddf8d43ba8a until root consumers release. Baseline and source worktrees are kept.

## Proposed deployment/activation order - requires separate authority

1. Root chooses an exact staging host/tenant and release commit/approved target;
   verify current upstream/integration, clean artifact hashes, supported PHP/Node,
   installed extensions/process execution, database identity/schema/FKs/size and
   actual permission roles. Current local SQL assumptions cannot authorize a live
   migration or service change. Take the target's approved backups/restore plan.
2. Pin/install the locked renderer dependencies and the reproducible SDK source
   build with tracked Swedish patch, exact upstream provenance/integrity/license
   in tools/newsletter-editor/upstream.json and license files. Preserve English
   and current key/interpolation parity. No paid license/new provider/account or
   external source publication is authorized. Verify origin and process runtime.
3. Keep BOTH editor gates OFF, with no opted-in companies. Current
   config/newsletter_editor.php uses STATIC enabled=false/company_ids=[]; there
   are no documented NEWSLETTER_EDITOR_* environment switches. Do not pretend an
   .env edit activates it. Any host-specific config overlay/config-cache rebuild
   must be explicit in the later approved staging plan and preserve defaults.
4. Under separately approved target DB authority, preflight existing schema and
   apply ONLY the three additive migrations in order using the target's supported
   migration runner/bookkeeping. Stop on any partial/table/column/index conflict;
   inspect actual state, never blindly rerun or migrate:rollback. This packet's
   direct local up() calls are not production migration-runner qualification.
5. Deploy compatible reader/format guards/consumers and ordinary/editor assets
   before any prepared newsletter exists. Reconcile every long-running consumer's
   exact code/config under later operational authority. No runtime/service restart
   or shared config change is performed now.
6. Set the target's canonical APP_URL to the separately approved externally
   reachable HTTPS origin; qualify its certificate/host, exact persistent local
   newsletter disk/root, read/write ownership, canonical non-symlink paths,
   opaque anonymous raster routes and DB/file retention. The current disk derives
   from config/filesystems.php, not a new storage provider. No loopback/private
   cookie URL may enter a real test message. Library originals remain untouched.
7. Only after Jonathan selects pilot/phone boundary and the target/input gates,
   root may approve an explicit company allowlist+enabled config change. Recheck
   actor/role/tenant/current-saved-revision, fixed format identity, actual selected
   shared workflow, immutable media, no-send test boundaries and all-off/unselected
   companies. Approve exact content/recipients/access/count separately before any
   real mail or client work.

## Stop/rollback and retention conditions

Stop before activation on missing migration/schema/index, unknown media path,
origin/storage/permissions mismatch, invalid/unreviewed build or locale, role or
foreign access failure, legacy/new output divergence, missing shared selection,
unsupported tokens/templates/clients or unresolved ownership/ambiguous mutation.
After uncertain prepare acknowledgement, preserve possible committed references
and use explicit known-outcome reconciliation; never automatically replay writes.

Supported authoring rollback: set
newsletter_editor.enabled=false (or remove only the approved opted-in company IDs)
under later config-change authority. Retain ALL compatible readers, consumers,
format identities, new schema, newsletter rows and immutable delivery files for
already-prepared output. Do not deploy an old binary that interprets new content
as legacy JSON. Do not call draft/copy down or remove output/schema/assets.
Existing company marking retains data; permanent purge still uses the existing
strictly-after12-calendar-month clock/lease and1000-entry bound. At1001 or unknown
entries/symlinks stop before destructive callbacks. Explicit retry only after
actual outcome/file/DB/ownership inspection; reference operational-3967 contract.
No new retention duration or filesystem/statistics catastrophe guarantee exists.

## Remaining whole-card inputs and decisions

Three actual source IDs/links with sanitized COMPLETE representative standard,
social and video-fallback content; staging host/origin/tenant/storage authority;
owner-controlled inboxes/installed named client availability and approved access;
exact output hashes, sender/recipients/content/window/send-count/cleanup approval;
Jonathan's final phone/pilot choice; target deployment/migration/config/release
approval and production schema/storage/ordinary legacyJS qualification. Root has
already requested the user inputs. No duplicate question or new phase is launched.
The complete10-client/120-observation proposal is newsletter-editor-client-matrix-3967.md; all rows
remain unexecuted. A LOCAL packet cannot complete the whole card.