Skip to content

Lint content with ProseGuard

POST
/api/writing/proseguard/lint

Run ProseGuard on content using resolved rules from all applicable scopes. This is the AUTHORITATIVE check.

LintRequest

Request to lint content using ProseGuard.

Attributes: content: The prose content to lint project_id: Project context for rule resolution document_id: Optional document context scene_id: Optional scene context character_ids: Optional character context (for dialogue/POV)

object
content
required
Content

Prose content to lint

string
>= 1 characters
projectId
required
Projectid

Project UUID for rule resolution

string
documentId
Any of:
string
sceneId
Any of:
string
characterIds
Any of:
Array<string>
categories
Any of:
Array<string>

Successful Response

ProseGuardResult

Complete result of a ProseGuard lint pass.

Contains all violations, summary statistics, and metadata for revision comparison and audit trails.

Attributes: content_hash: SHA-256 hash of linted content (first 16 chars) ruleset_hash: Hash of resolved rules + spec version (for audit trail) violations: All violations found (SORTED deterministically) error_count: Count of error-severity violations warning_count: Count of warning-severity violations info_count: Count of info-severity violations error_rule_ids: Unique rule IDs with errors (SORTED for comparison) summary: Aggregated statistics lint_timestamp: ISO timestamp of this lint pass resolved_scopes: Scopes that contributed to rule resolution unconfigured_checks: Checks that are enabled but have no rules set up

Deterministic Ordering: - violations: Sorted by (paragraph, character_start, severity, rule_category, rule_id) - error_rule_ids: Sorted lexicographically (ASCII codepoint order)

object
contentHash
required
Contenthash

SHA-256 hash of linted content (first 16 chars)

string
rulesetHash
required
Rulesethash

Hash of resolved rules + spec version (for audit trail)

string
violations
required
Violations

All violations - SORTED by (paragraph, char_start, severity, category, rule_id)

Array<object>
ProseGuardViolation

A single ProseGuard violation with full explainability.

Every violation includes enough context for the user to understand why it was flagged and how to fix it.

Attributes: rule_id: Identifier for the rule that was violated rule_category: Category of the violated rule severity: How severe this violation is location: Precise location in the content message: Human-readable description of the violation suggestion: Optional fix suggestion matched_text: The actual text that triggered the violation rule_threshold: What the rule expected (e.g., “max: 1”) resolved_from_scope: Which scope this rule came from match_mode: How the match was performed (for debugging)

object
ruleId
required
Ruleid

Rule identifier - e.g. ‘max_em_dashes_per_paragraph’

string
ruleCategory
required
Rulecategory

Category of the violated rule

string
Allowed values: structural stylistic semantic continuity aiisms temporal
severity
required
Severity

Violation severity level

string
Allowed values: error warning info
location
required
ViolationLocation

Precise location of violation

object
paragraph
required
Paragraph

0-based paragraph index

integer
sentence
Any of:
integer
characterStart
required
Characterstart

Character offset from content start (AUTHORITATIVE)

integer
characterEnd
required
Characterend

End character offset (AUTHORITATIVE)

integer
paragraphStartChar
required
Paragraphstartchar

Start offset of containing paragraph

integer
paragraphEndChar
required
Paragraphendchar

End offset of containing paragraph

integer
message
required
Message

Human-readable violation description

string
suggestion
Any of:
string
matchedText
required
Matchedtext

The actual text that triggered the violation

string
ruleThreshold
required
Rulethreshold

What the rule expected - e.g. ‘max: 1’

string
resolvedFromScope
required
Resolvedfromscope

Which scope this rule came from - e.g. ‘scene’

string
matchMode
required
Matchmode

How match was performed - ‘substring_casefold’ or ‘word_boundary_casefold’

string
timelineEventId
Any of:
string
timelineId
Any of:
string
sourceHandler
Sourcehandler

DE handler model-id that produced this violation

string
default: divinity/proseguard-scan
errorCount
required
Errorcount

Count of error-severity violations

integer
warningCount
required
Warningcount

Count of warning-severity violations

integer
infoCount
required
Infocount

Count of info-severity violations

integer
errorRuleIds
required
Errorruleids

Unique rule IDs with errors - SORTED lexicographically for comparison

Array<string>
summary
required
ProseGuardSummary

Aggregated statistics

object
totalViolations
required
Totalviolations

Total violation count

integer
byCategory
required
Bycategory

Violations by category - {structural: 2, stylistic: 1}

object
key
additional properties
integer
bySeverity
required
Byseverity

Violations by severity - {error: 1, warning: 2}

object
key
additional properties
integer
activeRules
required
ActiveRulesSummary

Rules that were actively checked during this lint pass

object
totalRulesChecked
required
Totalruleschecked

Total rules checked

integer
rules
required
Rules

Individual active rules

Array<object>
ActiveRuleDetail

One active rule that was checked during linting.

Attributes: rule_name: Machine name e.g. “max_sentence_length” description: Human description e.g. “Sentence length limit: 35 words” category: Rule category

object
ruleName
required
Rulename

Machine rule name

string
description
required
Description

Human-readable rule description

string
category
required
Category

Rule category

string
Allowed values: structural stylistic semantic continuity aiisms temporal
lintTimestamp
required
Linttimestamp

ISO timestamp of this lint pass

string
resolvedScopes
required
Resolvedscopes

Scopes that contributed - e.g. [‘scene:chapter1’, ‘project’]

Array<string>
wordCount
Wordcount

Word count of the linted content

integer
0
unconfiguredChecks
Unconfiguredchecks

Checks that are enabled but dormant due to empty configuration

Array<object>
default:
UnconfiguredCheck

A ProseGuard check that is enabled but has no rules configured.

Surfaced in lint results so the UI can guide users toward setting up checks they’re missing. Each entry represents a specific sub-check within a rule category that is dormant due to empty configuration.

Attributes: category: The rule category this check belongs to check_name: Human-readable name of the specific check reason: Why this check is dormant setup_hint: Actionable guidance for the user

object
category
required
Category

Rule category this check belongs to

string
Allowed values: structural stylistic semantic continuity aiisms temporal
checkName
required
Checkname

Human-readable check name

string
reason
required
Reason

Why this check is currently dormant

string
setupHint
required
Setuphint

Actionable guidance for configuring this check

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object