Demo / Training Coding

What Is Demo Coding?

Demo coding is a training and testing mode that uses the same coding interface as real production coding, but produces temporary artifacts that are automatically cleaned up after a defined retention period. It allows users to practice the full coding workflow without permanently affecting production data.

Who Can Access Demo Mode

There are two demo coding patterns:

  1. Admin-started demo sessions on ordinary projects — only users with the admin role can start ad hoc demo coding sessions on non-demo projects. There is no button for this; it is started by a request to POST /coding/demo.
  2. Project-declared demo/training projects — when a project has demo_training_enabled = true, any active authenticated user may enter the coder flow for that project’s forms. No project-specific coder grant is required. These appear as a dedicated DEMO-CODING shortcut on the coder dashboard.

How Demo Coding Differs from Real Coding

Aspect Real Coding Demo Coding
Allocation timeout 1 hour 15 minutes
Artifact retention Permanent (until superseded) 6 hours (admin-started) or project-configurable (demo projects)
Coder grant required Yes No (demo projects) / Admin role (ad hoc)
Counts toward output metrics Yes No
Entry route /coding/start or /coding/pick/<va_sid> vademo_start_coding

Allocation Timeout

Demo coding allocations are revoked after 15 minutes of inactivity, compared to 1 hour for real coding. If a demo session is not completed within 15 minutes, the allocation is released and the submission returns to the available pool.

Artifact Retention and Cleanup

Demo-created artifacts (Narrative Quality Assessment, Social Autopsy Analysis, and final COD) are temporary:

  • Admin-started demo sessions on ordinary projects — artifacts are retained for 6 hours after the demo coding artifact timestamps.
  • Project-declared demo/training projects — retention is configurable via demo_retention_minutes, with a default of 10 minutes.
Automatic cleanup: When the retention window expires, the system deactivates all demo-created artifacts (final COD, NQA, Social Autopsy Analysis), clears any authoritative-final pointer referencing the expired demo COD, and restores the submission to its normal non-demo workflow state. If no non-demo terminal record remains, the submission returns to ready_for_coding.

Isolation from Real Workflow

Demo coding artifacts are isolated from production workflow in the following ways:

  • Demo-coded submissions do not count toward Cumulative Forms Coded or Marked Not Codeable output metrics on the coder dashboard.
  • After cleanup, the submission no longer appears as completed in the demo user’s coder history.
  • Demo artifacts are deactivated rather than deleted, maintaining an audit trail that clearly records the cleanup reason as demo-retention expiry.

Dashboard Indicators

When demo/training projects are available, the coder dashboard shows:

  • A dedicated DEMO-CODING shortcut that preselects the first available demo/training project.
  • A plain-language warning explaining that these are training forms, the retention period, and the 15-minute allocation timeout.
  • While a demo allocation is active, the user may see Continue Pending VA Coding.

Auditability

Demo allocation creation and cleanup are fully auditable. Cleanup writes submission audit entries for each deactivated artifact, and the audit trail clearly distinguishes demo-retention expiry from ordinary coding timeout.