Stage 6b structural validator — validate and import the generated translation from Stage 6a, verify 1:1 alignment with Greek, and prepare for downstream stages. Does not generate translations or align existing witnesses.
Validate and import the generated translation from Stage 6a.
This skill is the Stage 6b owner — the second half of Stage 6.
Its input is the generated translation from translation-synthesis (Stage 6a). Its job is:
This skill has two modes:
Fast path (/versify try-witness): Attempt to versify a versification-candidate witness directly. This is reference-based matching only — no DP alignment, no range alignment, no structural modification. The witness either maps 1:1 to Greek segments as-is, or it fails.
Standard path (/versify run): Validate and import the generated translation from Stage 6a. This is the original behavior.
This skill does NOT:
versification-candidateThe fast path is strictly opt-in via Stage 5 classification. It succeeds or fails cleanly — there is no partial-match fallback.
Verse-aligned editions: !nix-shell -p sqlite --run "sqlite3 data/editions.db \"SELECT code FROM editions WHERE code LIKE '%-verse-%' OR urn LIKE '%generated%'\"" 2>/dev/null
Generated edition segments: !nix-shell -p sqlite --run "sqlite3 data/editions.db \"SELECT e.code, COUNT(s.id) FROM editions e JOIN segments s ON s.edition_id=e.id WHERE e.urn LIKE '%generated%' GROUP BY e.code\"" 2>/dev/null
/versify try-witness [work] — Attempt to versify a versification-candidate witness directly (fast path)/versify run [work] — Validate and import the generated translation from Stage 6a/versify validate [work] — Re-validate an already-imported generated translation/versify status [work] — Summarize validation state, coverage, and blockersTarget: $ARGUMENTS
Before running /versify run, these must be complete:
$LYCEUM_TEXTS_DIR/<slug>/versification/segments array with reference and translation fieldsreviews array (even if all verdicts are "pass")If Stage 6a is incomplete, this skill should report the gap and direct to /translation-synthesis run <work>.
/versify try-witnessAttempt to versify a versification-candidate witness directly, without generating a new translation.
This is the Stage 6 fast path. The orchestrator calls this BEFORE /translation-synthesis run. If it succeeds, Stage 6a generation is skipped entirely.
versification-candidateLoad witness catalog
cat $LYCEUM_TEXTS_DIR/<slug>/sources/english_candidates.json
Find all witnesses with "versification-candidate" in their roles array.
For each candidate (in catalog order):
a. Load witness text from witnesses/<file>
b. Parse references using the witness format field (same import logic as Path A in translation-witness)
c. Match references to Greek segments:
1.1 matches Greek 1.1.1, 1.1.2, 1.1.3)d. Compute metrics:
greek_segment_count: total Greek segmentswitness_segment_count: total parsed witness segmentsmatched_segments: Greek segments with a witness matchcoverage: matched_segments / greek_segment_countempty_segments: matched segments where witness text is empty/whitespacee. Apply pass criteria:
abs(witness - greek) / greek <= 0.10)On success (first candidate that passes):
{base}-versified-eng1 (e.g., perry-versified-eng1). Never reuse the witness URN.generated_edition_urn in manifest to the versified URN (keep english_edition_urn as the witness URN)edition_urn in english_versified.json to match # Stage 6 Fast Path: Witness Versification
## Result: SUCCESS
## Witness used
- ID: asv-1901
- Title: American Standard Version (1901)
- Coverage: 100% (7957/7957 segments)
- Empty segments: 0
- Import: versified-witness edition created
## Metrics
- Greek segments: 7957
- Witness segments: 7956 (1 parent-prefix expansion)
- Matched: 7957/7957 (100%)
## Next steps
- Stage 6a (translation-synthesis) SKIPPED
- Proceed to Stage 7 (transliteration) or Stage 8 (interlinear)
# Stage 6 Fast Path: Witness Versification
## Result: FAILED — falling back to Stage 6a generation
## Candidates attempted
### asv-1901
- Coverage: 94.2% (7496/7957 segments)
- Reason: coverage below 100% — 461 Greek segments unmatched
- Missing references: 1.1.2, 1.1.3, ... (reference mismatch in sub-segments)
## Next steps
- Proceed to /translation-synthesis run [work]
/versify runValidate and import the generated translation.
Structural alignment
Per-book isolation
Coverage metrics
Review status
# Import generated translation to DB
python3 scripts/generate_translation.py --text <text_key> --import-only
Or via direct SQL for custom workflows:
-- Check if generated edition exists
SELECT id, urn FROM editions WHERE urn LIKE '%generated%';
-- Verify segment count matches Greek
SELECT
(SELECT COUNT(*) FROM segments WHERE edition_id = <greek_id>) as greek_count,
(SELECT COUNT(*) FROM segments WHERE edition_id = <generated_id>) as generated_count;
After successful validation and import:
qa/alignment-report.md updated with validation results/versify validateRe-validate an already-imported generated translation without re-importing.
/versify statusReport current state.
These scripts exist for maintaining older texts that used legacy alignment modes. They are not used for new work.
| Script | Text | Mode | Notes |
|---|---|---|---|
scripts/versify_meditations.py | Meditations | DP | Legacy: explicit Book 1 map + DP |
scripts/versify_homer.py | Iliad/Odyssey | range | Legacy: range fallback |
Important: Do not extend these scripts or use their patterns for new texts. All new texts go through translation-synthesis (Stage 6a) then versify (Stage 6b).
Deleted legacy scripts: versify_john.py and versify_aesop.py were removed; existing data for these texts uses the fast path (Stage 6 witness versification).
The validation report should include:
# Stage 6b Validation Report
## Work
- Slug: <slug>
- Greek edition: <edition_id>
- Generated edition URN: <urn>
## Coverage
- Greek segments: N
- Generated segments: N
- Match: ✓ / ✗
## Structural checks
- [x] 1:1 reference alignment
- [x] No cross-chapter contamination
- [x] No empty translations
- [x] No duplicate references
## Review summary
- Chapters reviewed: N
- Pass verdicts: N
- Fail verdicts: N
- Total issues logged: N
## Import status
- Edition imported: ✓ / ✗
- Edition ID: <id>
## Blockers
- (none) or (list)
## Next steps
- Ready for Stage 8 (interlinear) or Stage 9 (reader-reliability)
This skill validates and imports only the generated translation from Stage 6a. It does not:
PD witness translations (gathered in Stage 5) remain structurally unmodified:
versification-candidate witness may be versified via /versify try-witness, but ONLY through direct reference matching — the witness either already maps 1:1, or the attempt failsWhen the witness fast-path produces a versified edition, it must use a distinct URN that differs from the original witness URN. The pattern is {base}-versified-eng1 (e.g., perry-versified-eng1 not perry-eng1). This is critical because:
generated_edition_urn field in manifest.json must reflect the versified URN, while english_edition_urn stays as the witness URNedition_urn field in english_versified.json must match generated_edition_urnNever set generated_edition_urn equal to english_edition_urn when a versified edition is produced.
CRITICAL: Do NOT manually set english_edition_urn or generated_edition_urn in manifest.json.
The import script (Stage 10) auto-generates these URNs with the "versified" convention that the reader requires:
"versified", "verse", or "gen-eng" in the English edition URN to enable row viewWhat happens at Stage 10:
<work_urn>.workspace-versified-eng1If you manually set URNs:
scripts/import_workspace.go will warnLeave english_edition_urn and generated_edition_urn blank in manifest.json.
Only versified (generated) translations may render in row view. This is because:
If a text lacks a versified generated translation, row view is unavailable for that text.
Pre-2026-03-16 texts with verse-aligned witness editions are grandfathered:
These existing verse-aligned witnesses remain functional. New texts may get a versified witness edition ONLY through the fast path (/versify try-witness) when Stage 5 classifies a witness as versification-candidate and automated versification succeeds. All other new texts must go through Stage 6a generation.
Because the generated translation is structure-preserving by construction:
When processing NT or OT texts:
3.16a and 3.16b are valid if the base edition uses them.This skill follows the Stage 6b contract.
qa/alignment-report.md with validation resultsAfter successful Stage 6b:
After completing this stage, run the automated verification script:
bash scripts/verify_stage_6b.sh "${SLUG}"
Exit codes: 0=PASS (advance), 1=FAIL (block), 2=WARN (advance with notes). The orchestrator runs this automatically; when executing manually, check the output for [FAIL] or [WARN] lines.
| File | Purpose |
|---|---|
scripts/generate_translation.py | Stage 6a generation + optional import |
$LYCEUM_TEXTS_DIR/<slug>/versification/ | Generated translation chapter files |
qa/alignment-report.md | Validation report |
.pi/skills/translation-synthesis/SKILL.md | Stage 6a (generation) |
.pi/skills/translation-witness/SKILL.md | Stage 5 (witness collection) |
docs/text-pipeline-master-plan-2026-03-13.md | Pipeline architecture |
| File | Purpose |
|---|---|
scripts/versify_meditations.py | Legacy Meditations DP alignment |
scripts/versify_homer.py | Legacy Homer range fallback |
| (deleted) | Legacy batch helper |
generated_edition_urnqa/alignment-report.mdOn failure (no candidate passes):