validate_marks
Dry-run your marks input to catch translation blanks, alignment issues, and token errors before creating a chapter. Returns all validation problems at once.
Instructions
Dry-run a /from-marks ingest without TTS or DB persistence. Runs
the full pipeline (sentence translate + awesome-align + per-token gloss
structural validation) and returns every issue found, at once.
Use this BEFORE every create_chapter_from_marks call. Catches:
blank Gemini translations, EU↔EU alignment coverage below threshold
(70%), CJK token failures, missing target languages, bad alignment
ranges, empty tokens. Cheap and idempotent.
Returns the cwbe ValidationResult (top-level ok, issues[], stats).
Each issue has at least kind, message, and a markIndex (null for
whole-batch issues).
Issue kind values worth recognising at decision time:
BLANK_TRANSLATION → Gemini returned empty for that target.
SOURCE_COVERAGE / TARGET_COVERAGE → awesome-align below 70% (EU) or 40% (CJK).
context.coverageandcontext.minimumare percent.MISSING_LANGUAGES → some target langs absent.
EMPTY_TOKENS → cwseg produced no tokens (degenerate input).
Args:
language: Source language code (EN | FR | ES | DE | IT | PT | ZH | JA | KO).
level: B1 | B2.
marks: Pre-split sentence list in the source language. No blanks.
tokens_per_mark: Optional pre-segmented source tokens, one list per
mark. Validate is permissive (it's the exploratory step) — pass
them once you have agent glosses ready so validate sees what
/from-marks will see. Omit on a first pass to inspect cwseg's
tokens via /segment instead.
token_glosses: Same shape as on create_chapter_from_marks. Pass
the exact list you intend to send to /from-marks so the validator
judges what would actually ship. Without overrides, validate
reports issues on Gemini cells that overrides would replace —
false positives for the caller-supplied flow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes | ||
| level | Yes | ||
| marks | Yes | ||
| tokens_per_mark | No | ||
| token_glosses | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |