docs: generate each subsystem's cordis surface into its own page; delete the flat catalogs
Rebuild of the region machinery (PR3) on the post-#904 Typert projection: renderPageRegion/renderInheritedPage live in dsh-typert-generator beside the projection; scripts/gen-cordis-catalog.ts owns the curated SERVICE_PAGE / EVENT_SCOPE_PAGE / SERVICE_WALK_EXEMPTIONS / LINK_MAP partition (fail-loud in both directions, with the independent Context-merge scan backstopping the projection's blind spot), spliceRegion, and the guarded pair auto-record. docs/cordis-catalog/ is deleted: the flat events/services catalogs dissolve into per-page regions and docs/cordis-catalog/core moves to docs/cordis-api/ with the inherited tier as its own generated page. The partition absorbs the post-regrouping surface: ctx.typert → invariants.md, ctx.directoryPicker → workspace.md, skills/* events → skills.md, and the four launcher-provided tui accessor values join the named exemptions.
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
parseTranslationMarkdown,
|
||||
parseTranslationPairingCliArgs,
|
||||
parseTranslationPairingManifest,
|
||||
partitionGeneratedRegions,
|
||||
isTranslationScopeFile,
|
||||
TRANSLATION_SCOPE_GLOB_EXCLUDES,
|
||||
translationStructureDiff,
|
||||
@@ -227,6 +228,27 @@ for (const source of [...pairAnchors].sort()) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Generated regions are language-invariant: the exact same generator output
|
||||
// (markers included) must appear in both sides, in the same order. The
|
||||
// structural signature below compares the region content again as part of
|
||||
// the whole document; this dedicated check exists to name the divergence
|
||||
// precisely and to reject a region grammar violation on either side.
|
||||
let sourceRegions: { regions: string[]; stripped: string }
|
||||
let zhRegions: { regions: string[]; stripped: string }
|
||||
try {
|
||||
sourceRegions = partitionGeneratedRegions(sourceContent.toString('utf8'))
|
||||
zhRegions = partitionGeneratedRegions(zhContent.toString('utf8'))
|
||||
} catch (error) {
|
||||
errors.push(`${source} ↔ ${zh}: ${error instanceof Error ? error.message : String(error)}`)
|
||||
state.set(source, 'out-of-sync')
|
||||
continue
|
||||
}
|
||||
if (sourceRegions.regions.length !== zhRegions.regions.length
|
||||
|| sourceRegions.regions.some((region, index) => region !== zhRegions.regions[index])) {
|
||||
errors.push(`${source} ↔ ${zh}: generated regions differ between the pair — regenerate (the generator writes both sides byte-identically)`)
|
||||
state.set(source, 'out-of-sync')
|
||||
}
|
||||
|
||||
const sourceTree = parseTranslationMarkdown(sourceContent.toString('utf8'))
|
||||
const zhTree = parseTranslationMarkdown(zhContent.toString('utf8'))
|
||||
if (!linksTo(zhTree, basename(source))) {
|
||||
|
||||
Reference in New Issue
Block a user