feat(server): W2-B sources, identity resolution, metadata and site workbench
- 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]>
This commit is contained in:
1 parent
829ca4f7ac
commit
a24bda952b
39 files changed
+6861
-15
No files matched your search
@@ -31,7 +31,7 @@ const pingModule: ServerModule = {
|
||||
registerTasks(registry) {
|
||||
registry.register(
|
||||
defineTask({
|
||||
name: "ingestFeed",
|
||||
name: "testPing",
|
||||
version: 1,
|
||||
inputSchema: z.object({ feedSourceId: z.string() }),
|
||||
handler: async () => "real",
|
||||
@@ -75,8 +75,8 @@ describe("ServerModule 骨架", () => {
|
||||
|
||||
it("任务注册表:模块任务优先,其余 §3.1-8 任务由空壳兜底;重复注册报错", async () => {
|
||||
const reg = buildTaskRegistry([...SERVER_MODULES, pingModule], fakeCtx);
|
||||
expect(reg.names()).toEqual([...TASK_NAMES].sort());
|
||||
const ingest = reg.latest("ingestFeed");
|
||||
expect(reg.names()).toEqual(expect.arrayContaining([...TASK_NAMES, "testPing"]));
|
||||
const ingest = reg.latest("testPing");
|
||||
expect(await ingest.handler({ input: {} } as never)).toBe("real");
|
||||
expect(() => buildTaskRegistry([pingModule, { ...pingModule, name: "dup" }], fakeCtx)).toThrow(/重复注册/);
|
||||
});
|
||||
@@ -85,6 +85,7 @@ describe("ServerModule 骨架", () => {
|
||||
const merged = Object.keys(collectOutboxRoutes([...SERVER_MODULES, pingModule], fakeCtx));
|
||||
expect(merged).toContain("test.ping");
|
||||
expect(merged).toContain("release.resolved");
|
||||
expect(merged).toEqual(expect.arrayContaining(["feed.due", "release.observed", "feed.gap_suspected"]));
|
||||
expect(() => collectOutboxRoutes([pingModule, { ...pingModule, name: "dup" }], fakeCtx)).toThrow(/重复认领/);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user