# Editor operational qualification - LOCAL revision6

Base: accepted cc272b51. The only new executable code is focused tests and an explicit opt-in integration fixture.
Application, renderer, UI, generated build, delivery and retention code are
unchanged. All-off legacy behavior and accepted Sv/En/native/MIME evidence remain
bound to the previous exact source/build maps. No visual churn or suite replay
is required for unchanged application bytes.

## Actual interrupted operation and explicit recovery

NewsletterEditorOperationalTest uses all configured PDO aliases validated as
SQLite in-memory, exact task-worktree fake disk roots and the real
CompanyDataPurger -> CompanyPurgePreflight -> CompanyRetention lease ->
OutputRetention path. It does not run the cleanup scheduler or mail worker.

A SQL-execution callback injects a PDOException with concurrency code40001 AFTER
actual delivery unlink AND the real asset-row DELETE, before the subsequent output-row DELETE. The injection asserts the asset row is actually absent inside the transaction and the output still exists. This is deterministic
fault injection, not an actual MySQL deadlock/process crash. It proves the actual
retention wrapper makes one attempt, rolls back DB state (including source,
history, copy intent, output and company), releases its lease/transaction and
retains original purge eligibility. Deleted filesystem bytes do not roll back.
The test explicitly inspects this state and disarms the fault before making one
new operator retry, which completes the existing purger. Foreign company/user
rows and file bytes are preserved. No automatic ambiguous mutation replay occurs.

A separate orphan failure is injected after the first actual staged unlink and
before the next reference check. The transaction/lock releases, all rows/copy
intent stay unchanged and the committed handle survives both failed-prepare
reconciliation and an explicitly retried orphan sweep. Unknown filenames and
actual symlinks are rejected in preflight before any destructive purger callback.
This does not qualify arbitrary process termination, storage outage or MySQL race.

For a real operator retry after a failed permanent purge:
1. Keep that company unavailable and stop the affected operation; do not restore
   the account or automatically replay a timed-out/unknown mutation.
2. Inspect the exact original company ID, transaction outcome, retained clock,
   eligibility, ownership, referenced outputs/assets and actual filesystem state.
   Files already unlinked cannot be recovered by database rollback. Preserve the
   failure receipt; do not invent successful delivery-asset recovery.
3. Refuse unknown entries, symlinks, foreign references or uncertain ownership;
   resolve those concrete conditions under separate authority as required.
4. Only after the outcome and scope are known, explicitly invoke the existing
   leased purge once under its existing switch/strictly-after12-calendar-month
   eligibility. A prior expired recovery or exhausted allowance is not renewed.
5. Verify final DB/file absence and unrelated-company sentinels. Reconcile any
   other storage/statistics effects separately; this test does not qualify all
   legacy filesystem/statistics failure positions.
This is an operational contract, not a new production command or authorization.

## Exact file bound and pilot preflight

The existing scanner accepts at most1000 entries in a company's editor-delivery
leaf (scandir's two dot entries are excluded from the supported count). The test
creates1000 actual files including a committed asset and staged entries, adds a
1001st file, and proves real CompanyPurgePreflight refuses it with all file hashes,
DB rows and foreign sentinel unchanged and zero downstream progress callbacks.
Removing ONLY that synthetic extra file explicitly allows the1000-file real purge
to finish. Unknown paths and symlinks remain prohibited at every supported size.

Before a pilot/real purge, count and validate actual canonical leaf entries,
resolve referenced versus staged handles and verify tenant/row linkage under the
existing company lock. At1001 or more, STOP before mutation. No duration or limit
has changed. A reviewed bounded batching/recovery design and its interruption/
concurrency proof require a separate root assignment; manually erasing referenced
files to evade this guard is not an approved workaround.

## Conditional SQL capability and compatibility assessment

The root's subsequent exact-scope clarification authorized a NEW owned disposable
schema through the existing local root/empty-password socket pattern. The initial
NOT RUN capability gap is preserved in history; socket presence alone was not
assumed to confer ownership. Identity preflight matched this Linux host,
/run/mysqld/mysqld.sock, root@localhost, no selected administrative schema,
MariaDB10.6.22 Ubuntu22.04 and REPEATABLE-READ. No other transport/account/password,
secret/environment file, grant or service was used or changed.

NewsletterEditorMySqlTest is explicit opt-in via NUHET_EDITOR_3967_MYSQL_TEST=1.
It exclusively creates nuhet_editor_3967_r6_<random16hex> only after exact absence
and a persisted owned nonce/root/created receipt. Every app alias and child PDO
verifies exact DATABASE/socket/host/account and owned receipt before queries;
InnoDB default/existing table engines are checked before writes. Artifacts, fake
disks/logs and barriers stay inside its own K-scratch run root. Administrative
PDOs are closed before forks; app aliases are disconnected/reopened independently,
with actual distinct connection IDs, deterministic lock barriers,5-second SQL
lock waits and bounded child/barrier waits. Mail config remains ArrayTransport,
with a fail-closed MessageSending listener; no mail/queue worker is invoked.

Actual separate sessions cover:
- Same intent: one snapshot commits; a blocked contender can get real23000/1062
  uniqueness failure, then explicit known-outcome reopen returns the original.
  This proves one committed result, NOT two transparent successful acknowledgments.
- Different intents: two independent prepared outputs serialize on the saved draft.
- Real HTTP save wins before prepare: current revision2 is read after the row wait,
  stale prepare refuses409 without adding output. Two simultaneous HTTP saves
  yield one200 and one409 with exactly revisions1/2; no stale source overwrite.
- Exclusive orphan sweep waits for preparing shared company lock, then sees and
  preserves all committed asset rows/files rather than deleting staged/committed
  bytes from an in-flight transaction.
- Company marking waits for preparation; the saved output commits before the
  company becomes unavailable. A leased purge holding the company lock completes
  while a subsequent prepare waits, then that prepare refuses403; no output/draft
  or delivery file remains. Foreign company/media rows and source bytes stay exact.

Each run records SQL version/isolation, aliases, table engines, connection/PIDs,
actual result/exception, exclusive creation and exact owned schema/root cleanup.
Only the exclusively allocated schema with matching in-memory/persisted identity
is dropped and exact absence checked; every owned child is reaped and its scratch
root removed. No other schemas/accounts/grants are listed or inspected. The first
metadata SELECT used a reserved alias and failed1064 before allocation; its
query-only correction and all receipts remain visible in recovery.

This qualifies these local MariaDB/InnoDB schedules, not arbitrary SQL versions,
production MySQL/storage, catastrophic termination/power loss or distributed races.
No parent/shared database, production services or external mail were accessed.
Read-only approved GitHub preflight/API observed master
2ea8f27ebbed72f979c2bab588dc14806a1e8078 dated2026-10-15T05:40:35Z. It matches the
recorded origin/master and is an ancestor of accepted2957 target316174719085440548a6df255e35b3b3faaa8379
and editorcc272b51. At that observation,316 is67 commits ahead/0 behind and the
editor78 ahead/0 behind; there is no incoming upstream side or three-tree conflict.
The99 editor-changed files relative316 are NOT proof that the entire target is
releasable. composer.json/lock and package.json/lock are byte-identical across
upstream/316/editor; webpack.mix.js matches316/editor and differs from upstream
because of existing target changes. Exact read-only metadata/diffs/hashes are in
the task's revision6 compatibility packet. No shared refs/checkouts/targets moved,
no merge/new base selected and no current deployment state was inferred.

Whole card remains open. Representative real templates, approved external client
matrix/sends, final phone/pilot, production TLS/storage, MySQL/large interrupted
cleanup, current-target integration and release acceptance remain separate gates.