fix(contracts): add release.resolved event consumed across W2-B/W2-C
Plan §5 has W2-B emit and W2-C consume `release.resolved`, but EventType / EVENT_PAYLOADS lacked it, so the two parallel subtasks would each invent a payload. Minimal payload: sourceReleaseId, observationId, mediaEntityId, contentUnitIds, evidenceLevel (contracts EvidenceLevel). Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
31729f2bac
commit
931081459e
1 file changed
+13
@@ -1,6 +1,7 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { AgentRunStatus, DecisionKind, DecisionStatus, Severity } from "./agent.ts";
|
import { AgentRunStatus, DecisionKind, DecisionStatus, Severity } from "./agent.ts";
|
||||||
import { Id, NonNegInt, Timestamp } from "./common.ts";
|
import { Id, NonNegInt, Timestamp } from "./common.ts";
|
||||||
|
import { EvidenceLevel } from "./identity.ts";
|
||||||
import { DownloadStatus, PauseReason, TaskKind, TaskStatus } from "./execution.ts";
|
import { DownloadStatus, PauseReason, TaskKind, TaskStatus } from "./execution.ts";
|
||||||
import { OrganizationStatus } from "./organization.ts";
|
import { OrganizationStatus } from "./organization.ts";
|
||||||
import { FeedHealth } from "./sources.ts";
|
import { FeedHealth } from "./sources.ts";
|
||||||
@@ -41,6 +42,8 @@ export const EventType = {
|
|||||||
feedFetched: "feed.fetched",
|
feedFetched: "feed.fetched",
|
||||||
feedHealthChanged: "feed.health_changed",
|
feedHealthChanged: "feed.health_changed",
|
||||||
|
|
||||||
|
releaseResolved: "release.resolved",
|
||||||
|
|
||||||
decisionCreated: "decision.created",
|
decisionCreated: "decision.created",
|
||||||
decisionUpdated: "decision.updated",
|
decisionUpdated: "decision.updated",
|
||||||
} as const;
|
} as const;
|
||||||
@@ -136,6 +139,15 @@ export const FeedHealthChangedPayload = z.object({
|
|||||||
reason: z.string().nullable(),
|
reason: z.string().nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 来源发布已识别到本地作品(W2-B 发出,W2-C 的 evaluateAcquisition 消费);歧义/无匹配走 decision.created */
|
||||||
|
export const ReleaseResolvedPayload = z.object({
|
||||||
|
sourceReleaseId: Id,
|
||||||
|
observationId: Id.nullable(),
|
||||||
|
mediaEntityId: Id,
|
||||||
|
contentUnitIds: z.array(Id),
|
||||||
|
evidenceLevel: EvidenceLevel,
|
||||||
|
});
|
||||||
|
|
||||||
export const DecisionCreatedPayload = z.object({
|
export const DecisionCreatedPayload = z.object({
|
||||||
decisionId: Id,
|
decisionId: Id,
|
||||||
kind: DecisionKind,
|
kind: DecisionKind,
|
||||||
@@ -163,6 +175,7 @@ export const EVENT_PAYLOADS = {
|
|||||||
"agent.tool_call": AgentToolCallPayload,
|
"agent.tool_call": AgentToolCallPayload,
|
||||||
"feed.fetched": FeedFetchedPayload,
|
"feed.fetched": FeedFetchedPayload,
|
||||||
"feed.health_changed": FeedHealthChangedPayload,
|
"feed.health_changed": FeedHealthChangedPayload,
|
||||||
|
"release.resolved": ReleaseResolvedPayload,
|
||||||
"decision.created": DecisionCreatedPayload,
|
"decision.created": DecisionCreatedPayload,
|
||||||
"decision.updated": DecisionUpdatedPayload,
|
"decision.updated": DecisionUpdatedPayload,
|
||||||
} as const satisfies Record<EventType, z.ZodType>;
|
} as const satisfies Record<EventType, z.ZodType>;
|
||||||
|
|||||||
Reference in new issue
Block a user