- Sites / accounts / feeds: registry view (/site-definitions), site CRUD with
enable/disable (history stays queryable, marked site_disabled), accounts and
feed URLs stored as secrets (only secret_ref / redacted urlDisplay exposed),
feed enable/disable/reset/fetch; one shared rate limiter + adapter per site.
- Tasks: ingestFeed (FeedFetchState/FeedCursor on feed_source, observation
feed+guid upsert with digest-change updates, source_release site+id
aggregation across feeds, auth failure -> account invalid + decision, no
retry, gap -> feed.gap_suspected -> budgeted backfill snapshot),
resolveObservation (parseRelease -> local recall via title_alias pg_trgm +
accepted identities -> TMDB -> resolveIdentity; auto binds entity /
provisional units / identities / aliases, otherwise identity_candidate pool
with evidence version and bounded review backoff; manual lock respected),
refreshMetadata (metadata_field + field_override, user locks win, paths
untouched), snapshotSite (site_snapshot coverage records).
- Events: feed.due, feed.gap_suspected, release.observed (self-consumed),
release.resolved, decision.created/updated; scheduler in worker start().
- Identity API: entity detail with redirects, manual mapping correction with
identity_revision, merge with identity_redirect, pool list/assign/dismiss/
retry, content unit numbering lock, aliases, external identities.
- Decisions: list/summary (by entity and kind)/detail/resolve; identity
options executed directly.
- Workbench: /sites/{id}/releases (snapshot first, coalesced live search with
backoff, origin + freshness) and /sites/{id}/releases/{rid} (volatile field
recheck times, refresh keeps data on failure).
- Capabilities: catalog.lookup, release.search, release.inspect,
identity.resolve.
- Migrations 0018-0020: site.adapter api, source_release.resolution_locked,
site_snapshot, identity_candidate, resolution_attempt, identity_redirect,
metadata_field, field_override.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@umt/contracts
所有 API、SSE 事件与能力(capability)输入输出的唯一定义(zod 4 schema + 推导出的 TS 类型)。web 与 server 共用,任何一端都不得手写重复 DTO;新增接口先在这里加 schema,再由 server 用 @hono/zod-openapi 生成 OpenAPI。
| 文件 | 内容 |
|---|---|
common.ts |
Id、Timestamp、DateOnly、JsonObject、游标分页、错误码、响应信封、ApiScope、ActorType |
content.ts / identity.ts / assets.ts / sources.ts / policy.ts / execution.ts / agent.ts / ops.ts / organization.ts / instances.ts |
每张表的 Row schema(camelCase、日期为 ISO 字符串)+ XxxCreate / XxxUpdate 输入 |
organization.ts |
另含公开整理记录合同:PublicOrganizationRecord、OrganizationChangesQuery/Response(change_seq 游标)、OrganizeRequest |
settings.ts |
GlobalSettings、DEFAULT_SETTINGS、GlobalSettingsUpdate、mergeSettings() |
capability.ts / capabilities-io.ts |
CapabilityDescriptor、首批 14 个能力 ID 与目录、各能力 Input/Output schema、CAPABILITY_IO |
events.ts |
SSE 信封、EventType、EVENT_PAYLOADS、TypedEvent 判别联合 |
api.ts |
Api 端点表(method/path/scope/params/query/body/response)、buildPath()、listEndpoints() |
约定:
- Row schema 与
packages/db/src/types.ts的列一一对应(test/db-sync.test.ts校验);只在 DB 存在的列(密文、key_hash、change_xid)不对外。 - 凭证类输入(
credential、url、plaintext、apiKey)只写不回显。 - schema 不用
.default()做可部分更新对象的缺省(zod 4 在 partial 里仍会填默认值);缺省值放常量。