PASS default Quiz denial preserves every synthetic data record
PASS default Assignment denial
PASS ordinary Page deletion is not blocked
PASS third-party assignment-like module is out of scope
PASS explicit Quiz grant does not grant Assignment deletion
PASS explicit Assignment grant does not grant Quiz deletion
PASS grants are scoped to the activity context
PASS site administrator bypass by default
PASS old administrator lock is retired: admin always follows native flow
PASS master disable returns before course queries
PASS config.php emergency switch returns before course queries
PASS uninstalled leftover code is inert
PASS Quiz type can be disabled independently
PASS Assignment type can be disabled independently
PASS all types disabled avoids course queries
PASS anonymous or actorless custom caller is not a deletion bypass
PASS hidden activities remain protected
PASS pre-existing pending deletion is not vetoed and is never auto-unflagged
PASS legacy module callback is a zero-read no-op
PASS legacy whole-course callback is a zero-read no-op
PASS ordinary authenticated pages do not read configuration or database
PASS legacy UI module delete is rejected
PASS legacy UI edit and visibility requests remain untouched
PASS legacy UI section delete uses section ID, not number
PASS editing a section without delete remains untouched
PASS legacy UI course delete is rejected before mutation
PASS external API receives positional module IDs
PASS editor cm_delete is checked before a synthetic async queue step
PASS mixed bulk selection is checked before the first synthetic mutation
PASS editor section deletion is preflighted
PASS bulk section deletion expands every requested section
PASS course deletion API is preflighted
PASS non-destructive course editor actions have zero policy overhead
PASS unrelated external functions are not replaced
PASS permitted external function returns false to run native Moodle
PASS subsection deletion includes Quiz and nested Assignment descendants
PASS parent section deletion includes delegated descendants
PASS delegation with repeated instance IDs does not cross courses
PASS cyclic delegation terminates
PASS unknown or nonpositive IDs do not crash ordinary core validation
PASS log toggle suppresses events but not protection
PASS log failure never permits deletion
PASS diagnostics inspect registrations without mutations
PASS uninstall callback does not touch any data
PASS no role is automatically granted a destructive capability
PASS English and Arabic language keys and placeholders are aligned
PASS administrator bypass works even with unavailable plugin config
PASS emergency disable does not read unavailable configuration
PASS missing module/context in a legacy callback cannot throw
PASS queued cleanup is not re-vetoed after the approving role is revoked
PASS stale object after concurrent deletion is not used to recreate a context
PASS missing context on a live activity stops only the new request cleanly
PASS unavailable plugin config fails closed before external mutation
PASS course view with the reported stale ID performs no plugin reads
PASS approved browser request is not rechecked during later require_login
PASS approval memo is scoped to user and selection, not every deletion
PASS a separate external dispatch is checked again, even for the same IDs
PASS granting both types permits a mixed bulk request without replacement
PASS an empty compatibility callback does not depend on an actor
PASS course audit reads clean metadata without creating contexts or changing data
PASS audit tolerates a null empty-section sequence without deprecation or mutation
PASS audit identifies a missing ID still in course cache without instantiating it
PASS audit reports a dangling section sequence but never silently fixes it
PASS audit detects a missing activity instance and missing context non-destructively
PASS audit locates queued references to an already missing focus ID
PASS an unavailable cache does not break the read-only audit
PASS audit declares truncation instead of pretending a huge task scan is complete

67 isolated tests passed; 295 assertions.
This is NOT a live Moodle/SQL/browser test. See docs/TEST_REPORT.md.
