Reformat DMA — Democratic Malice Assessment Section Reformatter
Last updated: November 20, 2026
Deterministic script that converts old-format DMA sections (blockquote-wrapped tables) to the new readable sub-section format (### Scored Action N headings with labeled fields). No LLM required — pure parsing and reassembly. Use when applying the June 2026 DMA format update to existing accountability profiles before republishing.
When to Use
- After the DMA output format was updated (June 2026) and you need to bring existing
published profiles into compliance with the new template
- When an editor asks to “fix the DMA formatting” on one or more profiles
- As part of a bulk republish cycle where all accountability profiles are being refreshed
- When the Publish Compose GUI shows a profile with the old blockquote-table DMA and
you want to reformat it before publishing
When NOT to Use
- For profiles that already use the new
### Scored Action Nformat (the script
auto-detects and skips these)
- When a profile’s DMA content needs to be re-evaluated (use
malice-evaluatorinstead) - For creating new DMA sections from scratch (use
malice-evaluator)
Workflow
1. Preview (always start here)
python scripts/reformat_dma.py --dry-run
Shows which files have old-format DMA sections and would be reformatted. Reports any parsing errors without modifying files.
2. Preview a single profile
python scripts/reformat_dma.py --dry-run --only john-eastman-profile
3. Review the diff (optional)
python scripts/reformat_dma.py --dry-run --only john-eastman-profile --diff
Shows unified diff of what would change. The diff flag works with both --dry-run and --apply.
4. Apply
python scripts/reformat_dma.py --apply
Or via Makefile:
make reformat-dma
Reformats all old-style DMA sections in place. Writes backups to .dma-backup/ before modifying (unless --no-backup is passed).
5. Publish
After reformatting, publish the updated profiles through the normal pipeline:
python scripts/ca_publish.py --apply --category accountability
What the Script Does
For Format A profiles (scored DMA with table):
- Strips blockquote
>prefixes - Parses header fields (designation, action count, highest DMS, categories)
- Parses each table row into structured data using anchor-column matching
(handles embedded pipes safely)
- Emits
### Scored Action N: [title]sub-sections with labeled fields
(Category, DMS, Action, Key Evidence, Ideology vs. Malice Determination)
- Emits
### What Is NOT Scored,### Assessment Basis,### Legal Disclaimer
as navigable sub-sections
For Format B profiles (no designation):
- Strips blockquote
>prefixes - Emits
## Democratic Malice Assessmentheading withDesignation: None - Converts blockquote paragraphs to regular paragraph text
Safety Guarantees
- Only modifies the DMA section — all other content in the file is untouched
- Backups written to
.dma-backup/before any modification - Files that fail parsing are reported but not modified
- Profiles already in the new format are auto-detected and skipped
- Frontmatter is preserved in canonical field order
Flags Reference
| Flag | Effect |
|---|---|
--dry-run |
Preview only, no modifications |
--apply |
Reformat files in place |
--only SLUG |
Process only files matching this slug |
--diff |
Show unified diff for each changed file |
--no-backup |
Skip writing backups to .dma-backup/ |
Related
malice-evaluatorskill — creates new DMA sections (uses the new format natively).cursor/rules/patriot-malice-evaluator.mdc— triggers DMA creation on profile updatesscripts/ca_publish.py— publishes reformatted profiles to WordPress
