Skip to main content

ArtificeDraft

Precision Copy-Editing & Journal Style Compliance for Academic Historians

Part of the Artifice Suite โ€” Local-First, Model-Agnostic Software Harnesses for Humanities Research.


๐Ÿ›๏ธ Philosophy: The Software Harness vs. The Chatbot

ArtificeDraft is an editorial software harness built for academic manuscripts (.docx). It is engineered around Joseph Weizenbaumโ€™s anti-ELIZA principle: software should handle deterministic computing tasks, and AI models should be invoked strictly as structured text transformation engines.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ArtificeDraft Harness โ”‚ โ”‚ โ”‚ โ”‚ 1. Extracts OpenXML paragraph trees & footnote registers โ”‚ โ”‚ 2. Validates archival citations, footnote gaps, & foreign phrases โ”‚ โ”‚ 3. Formats structured prompts via packages/model-harness โ”‚ โ”‚ 4. Re-injects model diffs as native Word Track Changes (<w:ins>/<w:del>)โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  1. No Ghostwriting or Chat Loops: ArtificeDraft never "chats" with you about your writing or rewrites whole passages unprompted. It ingests a .docx manuscript, applies a target journal style guide, and outputs explicit, granular revisions.
  2. Authorship & Veto Power: The author retains absolute control over the text. Revisions are injected directly into Microsoft Word's OpenXML structure as native track changes (<w:ins> insertions and <w:del> deletions) rather than destructive text overwrites.
  3. Local-First & Private: Unpublished historical research and archival findings never leave your machine to train cloud models. Run entirely offline using local open-weights models via Ollama or LM Studio, or optionally route through cloud providers using your own API keys.
  4. Editorial Visual Identity: Built using The New Masses Design System (packages/shared-ui)โ€”a warm, paper-and-ink interface inspired by 1930s radical editorial design and Soviet Constructivism.

โœจ Key Capabilities

1. Multi-Model Pipeline & Journal Style Guides

Processes paragraphs in contextual batches while preserving formatting, bold/italic styles, and footnote anchors.

  • Supported Providers: Ollama (local default), OpenAI, Anthropic via packages/model-harness.
  • Chicago Manual of Style (17th ed.) โ€” Notes-Bibliography system, Title Case headings, serial comma, date and abbreviation standards.
  • MLA (9th ed.) โ€” Parenthetical citations, Works Cited formatting, sentence-case titles.
  • APA (7th ed.) โ€” Author-date citations, Reference List formatting, DOI validation.
  • Custom Style Guides: Create or import custom JSON rulesets into packages/model-harness/style_guides/.

2. Specialized Historian Advisories

Beyond basic grammar and typos, ArtificeDraft executes deterministic Python checks against domain-specific historical research conventions:

  • Citation & Footnote Checker: Detects footnote numbering gaps, orphaned markers/bodies, duplicate markers, and deprecation warnings for Latin abbreviations (ibid., op. cit., loc. cit.).
  • Archival Reference Validator: Inspects archival citations for missing repository names, collection titles, box/folder numbers, and date ranges.
  • Date Standardizer: Identifies ambiguous M/D/Y formats and normalizes date strings to match journal preferences.
  • Foreign Phrase Inspector: Checks italicization and consistency of Latin and foreign terms (et al. vs and others, sic, in situ).
  • Proper Noun Consistency: Scans cross-document spelling variants of historical figures, placenames, and archival repositories.

3. Native Track Changes & Review Engine

  • Direct OpenXML Injection: Revisions are written directly to Word XML as native revision elements (<w:ins> red insertions and <w:del> blue deletions).
  • Interactive Review Mode (Web UI): Side-by-side card review powered by packages/shared-ui. Approve, reject, or edit individual changes before generating the final file.
  • Statistical Changelogs: Generates change summaries tracking edit rates, word count deltas, estimated page counts, and categorized breakdowns (grammar, spelling, clarity, style).

๐ŸŽจ Design System (packages/shared-ui)

All visual elements in ArtificeDraft adhere to The New Masses Design System:

  • Palette: Warm cream paper (#f6f3ea), deep warm black ink (#1b1813), Esperanto green accents (#2f7d45), and antique gold highlights (#bf9b30). Zero pure blacks or cold grays.
  • Typography: Playfair Display (Display/Headings), Libre Baskerville (Body text), and Archivo (UI Labels/Buttons).
  • Surface Depth: Paper-like diffused shadows (shadow-paper) and hard-offset tactile button interactions.

๐Ÿ“‚ Monorepo Architecture

ArtificeDraft is located at apps/artifice-draft within the Artifice Suite monorepo and shares core dependencies with partner applications:

artifice-suite/
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ artifice-draft/
โ”‚       โ”œโ”€โ”€ pyproject.toml
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ””โ”€โ”€ artifice_draft/
โ”‚       โ”‚       โ”œโ”€โ”€ models.py           # Shared data structures and enums
โ”‚       โ”‚       โ”œโ”€โ”€ doc_parser.py       # .docx paragraph extraction and OpenXML parsing
โ”‚       โ”‚       โ”œโ”€โ”€ doc_writer.py       # OpenXML track changes injector (<w:ins>/<w:del>)
โ”‚       โ”‚       โ”œโ”€โ”€ _track_changes.py   # Low-level XML revision element injection
โ”‚       โ”‚       โ”œโ”€โ”€ _diff.py            # Word-level diff calculation for web review
โ”‚       โ”‚       โ”œโ”€โ”€ citation_checker.py # Footnote & citation validation
โ”‚       โ”‚       โ”œโ”€โ”€ date_standardizer.py# Date format normalization
โ”‚       โ”‚       โ”œโ”€โ”€ foreign_phrases.py  # Latin/foreign phrase italicization & consistency
โ”‚       โ”‚       โ”œโ”€โ”€ archival_refs.py    # Archival reference validation
โ”‚       โ”‚       โ”œโ”€โ”€ consistency.py      # Cross-document proper noun consistency
โ”‚       โ”‚       โ”œโ”€โ”€ changelog.py        # Statistical change summary generation
โ”‚       โ”‚       โ”œโ”€โ”€ cli.py              # `artifice-draft` entry point (GUI / headless)
โ”‚       โ”‚       โ””โ”€โ”€ web/                # FastAPI server, runtime adapter, & static assets
โ”‚       โ”œโ”€โ”€ tests/                  # Pytest suite
โ”‚       โ””โ”€โ”€ README.md
โ””โ”€โ”€ packages/
    โ”œโ”€โ”€ shared-ui/                  # The New Masses CSS design tokens
    โ””โ”€โ”€ model-harness/              # Shared BYOM connector config (Ollama/LM Studio/OpenAI)

๐Ÿš€ Setup & Installation

Ensure Python 3.11+ is installed. From the monorepo root:

# Install shared packages and app in editable mode
pip install -e packages/core-types -e packages/model-harness -e packages/shared-ui -e apps/artifice-draft

Configure Local LLM (Default)

Make sure Ollama is running locally with your target model (e.g., gemma4:12b or deepseek-coder):

ollama pull gemma4:12b
ollama serve

macOS & Apple Silicon Notes

  • Run Ollama natively on macOS to utilize Apple Silicon Metal GPU acceleration.
  • When running in Docker containers, configure environment variables to reach host Ollama via http://host.docker.internal:11434.

๐Ÿ–ฅ๏ธ Usage & Interfaces

1. Web Application (Recommended)

Launches the FastAPI backend with The New Masses interactive review cards:

python -m artifice_draft.web --browser

2. CLI / Headless Mode

Batch process manuscripts directly from the command line:

python -m artifice_draft.cli \
  --input manuscript.docx \
  --output manuscript_edited.docx \
  --style chicago-17 \
  --provider ollama \
  --model gemma4:12b

โš™๏ธ Configuration

Configure via environment variables or a local .env file:

Variable Default Description
LLM_PROVIDER ollama LLM provider: ollama, openai, anthropic
OLLAMA_MODEL gemma4:12b Model name used by local Ollama server
OLLAMA_URL http://localhost:11434 Ollama API base URL
OPENAI_API_KEY โ€” API key when using OpenAI provider
ANTHROPIC_API_KEY โ€” API key when using Anthropic provider

๐Ÿ› ๏ธ Open-Source Extension Points

We welcome contributions from historians, editors, and software developers!

  1. Custom Style Guides (packages/model-harness/style_guides/): Add a new .json file defining rules for heading cases, citation preferences, date standards, and serial commas for specific academic journals.
  2. Domain Advisories (apps/artifice-draft/src/artifice_draft/): Implement new deterministic Python validators for historical sub-fields (e.g., medieval date converters, diplomatic transcription checkers).
  3. OpenXML Writers (apps/artifice-draft/src/artifice_draft/doc_writer.py): Enhance Word XML parsing for complex multi-column tables, figure captions, or margin comment threads.

๐Ÿงช Testing

Run the full pytest suite covering document parsing, OpenXML track changes injection, and historian advisories:

pytest apps/artifice-draft/tests/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artifice_draft-0.1.0.tar.gz (115.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

artifice_draft-0.1.0-py3-none-any.whl (108.8 kB view details)

Uploaded Python 3

File details

Details for the file artifice_draft-0.1.0.tar.gz.

File metadata

  • Download URL: artifice_draft-0.1.0.tar.gz
  • Upload date:
  • Size: 115.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for artifice_draft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb176b57a69a11c63e25b80b440d95626b46eeb245d81a47cb0e8d541d310fb3
MD5 4c14cc1de39e944f7b8a89dc6b749130
BLAKE2b-256 46c32dcaca3769d3ab45c743fae71e6feebe860568121799770d9b1392e36816

See more details on using hashes here.

Provenance

The following attestation bundles were made for artifice_draft-0.1.0.tar.gz:

Publisher: publish.yml on Muggwoffin/artifice-suite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file artifice_draft-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: artifice_draft-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 108.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for artifice_draft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4823b44dc44ce954a3d7dd2c32fb3ed5a6281383ee01a57eef61572ca74fe38e
MD5 5ef21afd1f902855c3731d4f7509420b
BLAKE2b-256 5910df3dcde65e1a7ca9a88c4d1fce659380e8fe9ec4422189a93bb36a46d789

See more details on using hashes here.

Provenance

The following attestation bundles were made for artifice_draft-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Muggwoffin/artifice-suite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page