Work-product lifecycle & revalidation: SourceDependencyGraph, StaleSectionState, RevalidationRule, EventTrigger, ChangeImpactMap. Deterministic. DoD: a source-change event flags the affected pinned section stale and emits a reapproval route; tests green.
build_dependency_graph(brief, contract) -> SourceDependencyGraphbuilds the pinned work-product section map. Approval sections depend on approval/workflow objects, factual sections depend on document/financial sources, conflicts depend on their conflict sources, missing evidence depends on expected missing object ids, and remaining populated sections conservatively depend on all contract source dependencies.LifecycleRevalidationEngine.revalidate(contract, changed_object_id) -> list[StaleSectionState]implementscore.pipeline.RevalidationEngine.on_source_change(contract, graph, changed_object_id, source_objects=None) -> RevalidationResultreturns stale section states plus reapproval routes and a change-impact map for/revalidate.revalidate_changed_source(contracts, graphs, changed_object_id, source_objects=None)finds every pinned work product whose graph depends on the changed object and revalidates each.
WS-F is the deterministic pinned work-product revalidation engine. It answers: "A governed record was sealed against these source dependencies; this source changed; which sections are stale and which reapproval routes are needed?"
The active Acme meeting walkthrough uses a different live projection path: API-local lifecycle
events are appended, /api/lifecycle derives the current state, and /api/brief recomputes the
Decision Brief. That active meeting loop does not call /revalidate.
Use /revalidate for sealed/pinned record freshness and source-change checks. Use the lifecycle
event path for the live meeting/readiness walkthrough.
approval_source_changed: workflow/approval source changes mark dependent approval sections stale. If the source moved to a non-approved state such asNeeds Review, WS-F emits aReapprovalRouteto the relevant approver role.data_source_changed: document/financial source changes mark dependent factual sections stale for rerun and do not emit reapproval routes.version_bump: a changed source with an increased version marks dependent sections stale with a reason naming the new version.
- A brief is pinned as a
WorkProductContract. - WS-F builds and stores a
SourceDependencyGraphfor that contract. - WS-A emits a deterministic event such as
legal_needs_revieworfinancials_v2. - Integration calls
/revalidatewith the changed object id for pinned governed records. - WS-F returns stale sections, reapproval routes, and affected work-product ids.
For the Acme stale-alert demo, wf_approval moving Legal to Needs Review marks
policy_gates and required_approvals stale and routes reapproval to legal. A
doc_financials version bump marks what_changed and key_facts stale without routing.