- POST /organization-records: sourcePaths must resolve (realpath) under a
registered library_root or downloader path-mapping host path; `..` and
symlink escapes rejected (400), dryRun included. Move requires an admin
session, or an API key with an automation_grant covering the entity or a
matching one-time approval (consumed on use), else 403. Manual Move from a
managed download_task with unsatisfied H&R returns 409 and opens a
decision; never silently downgraded to Copy.
- Series slot completion: total episode count is unknown while units are
provisional, so the slot is not satisfied and the subscription keeps
tracking; coverage is registered per actual file (creating provisional
episode units), and already_in_library files count as verified presence.
- POST /engine/runs/{id}/retry (admin): re-enqueue by original task name and
raw input with idempotency key retry:<id>:<n>, audited; retry button on
the run detail page.
- E7 regular series e2e, E8 AT24 tag removal / task disappearance e2e.
- All workspace members and root set to version 0.1.0; CHANGELOG.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@umt/mapping
domain ↔ contracts 的集中映射(W1 审查 B5)。只依赖 @umt/domain 与 @umt/contracts,不依赖 db / adapters。server 各模块需要在两套取值之间转换时一律走这里,不要在模块里各写一份。
db 行(snake_case)↔ contracts(camelCase)的转换不在本包;adapters 的 SiteRelease 以结构类型 SiteReleaseLike 接入(兼容性由 apps/server/test/mapping-compat.test.ts 在类型层保证)。
| 文件 | 导出 | 方向 |
|---|---|---|
download.ts |
toContractDownloadState / toDomainDownloadStatus / mergeObservedDownloadState / DOMAIN_DOWNLOAD_STATUSES |
domain paused_by_threshold/paused_by_user/error/missing_files ↔ contracts paused+PauseReason/failed/missing;业务叠加态(submitting/stalled/importing/imported)在合并观察时保留 |
evidence.ts |
toContractEvidenceLevel / toDomainConfidence / toDomainMediaType / toContractMediaKind / toDomainEntityType / toContractEntityType |
needs_confirm ↔ needs_review,manual → rule_confirmed,rejected → null;tv ↔ series/variety |
identity.ts |
toContractResolveStatus / toReleaseResolutionStatus / rankedToIdentityCreate / localIdentityCandidate |
`auto/ambiguous/no_match → resolved |
slot.ts |
toContractSlotStatus / toDomainSlotStatus / slotSpecFromRow / slotSpecToColumns / toContractSlotEvaluation |
Slot 状态;规则 JSON 列 ↔ SlotSpec;评估结果 → { decision, acceptable, rejected[] } |
release.ts |
toParsedColumns / fromParsedColumns / toContractContentType / toDomainContentType / toContractSegment / toDomainSegment |
ParsedRelease ↔ source_release.parsed + parser_version(版本不符返回 null,重解析) |
site-release.ts |
siteReleaseToSourceRelease / sourceReleaseToSiteRelease / SiteReleaseLike |
站点资源 ↔ SourceReleaseCreate / SourceRelease;downloadUrl 不入库 |
path-binding.ts |
toDomainPathBinding / toPathBindingCreate / parseTemplateVersion |
entityId/scope/season/templateVersion:number/active ↔ mediaEntityId/bindingKind/seasonNumber/templateVersion:string/status |
organize.ts |
organizePlanToRecord / organizePlanToFileResults / organizePlanToCapabilityOutput / organizationStatusFromFiles / toOrganizationAction / toOrganizeOperation / toFileRole |
OrganizePlan → organization_record / organization_file_result 草稿 / organize.plan 输出 |
规则
- 映射表一律写成
Record<一侧的联合类型, …>:domain 增删取值时 typecheck 失败;contracts 侧在test/enums.test.ts按z.enum(...).options逐个断言,新增取值时测试失败。 - 新增映射先写测试(往返、schema 合法)。输出给 contracts 的对象都用对应 zod schema 在测试里
safeParse一遍。