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>)โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- No Ghostwriting or Chat Loops: ArtificeDraft never "chats" with you about your writing or rewrites whole passages unprompted. It ingests a
.docxmanuscript, applies a target journal style guide, and outputs explicit, granular revisions. - 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. - 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.
- 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.vsand 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!
- Custom Style Guides (
packages/model-harness/style_guides/): Add a new.jsonfile defining rules for heading cases, citation preferences, date standards, and serial commas for specific academic journals. - 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). - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb176b57a69a11c63e25b80b440d95626b46eeb245d81a47cb0e8d541d310fb3
|
|
| MD5 |
4c14cc1de39e944f7b8a89dc6b749130
|
|
| BLAKE2b-256 |
46c32dcaca3769d3ab45c743fae71e6feebe860568121799770d9b1392e36816
|
Provenance
The following attestation bundles were made for artifice_draft-0.1.0.tar.gz:
Publisher:
publish.yml on Muggwoffin/artifice-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
artifice_draft-0.1.0.tar.gz -
Subject digest:
bb176b57a69a11c63e25b80b440d95626b46eeb245d81a47cb0e8d541d310fb3 - Sigstore transparency entry: 2357325130
- Sigstore integration time:
-
Permalink:
Muggwoffin/artifice-suite@332bea1bbfdd1325c34e542c0a5f2c1e55db6032 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Muggwoffin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@332bea1bbfdd1325c34e542c0a5f2c1e55db6032 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4823b44dc44ce954a3d7dd2c32fb3ed5a6281383ee01a57eef61572ca74fe38e
|
|
| MD5 |
5ef21afd1f902855c3731d4f7509420b
|
|
| BLAKE2b-256 |
5910df3dcde65e1a7ca9a88c4d1fce659380e8fe9ec4422189a93bb36a46d789
|
Provenance
The following attestation bundles were made for artifice_draft-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Muggwoffin/artifice-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
artifice_draft-0.1.0-py3-none-any.whl -
Subject digest:
4823b44dc44ce954a3d7dd2c32fb3ed5a6281383ee01a57eef61572ca74fe38e - Sigstore transparency entry: 2357325204
- Sigstore integration time:
-
Permalink:
Muggwoffin/artifice-suite@332bea1bbfdd1325c34e542c0a5f2c1e55db6032 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Muggwoffin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@332bea1bbfdd1325c34e542c0a5f2c1e55db6032 -
Trigger Event:
workflow_dispatch
-
Statement type: