Event Model

Foundry's event model defines the vocabulary of immutable facts that flow through the system. Events carry payloads describing what occurred but have no opinion about what should happen next — task blocks make those decisions.

Authoritative Source

The canonical event type definitions live in foundry-core/src/event.rs (EventType enum). The implementation roadmap for completing all task blocks and workflows is in IMPLEMENTATION_PLAN.md at the project root.

Event Categories

Run Lifecycle

EventEmitterPurpose
maintenance_run_startedOrchestrator / manualBegins a per-project maintenance chain
maintenance_run_completedOrchestrator (fan-in)All projects finished; carries aggregate results

Per-Project: Iterate / Maintain

EventEmitterPurpose
project_validation_completedValidateProjectPre-flight check (dir, branch, gates)
project_iteration_completedRouteGateResultOne structural improvement attempted
project_maintenance_completedRouteGateResultDependencies updated, gates verified
project_changes_committedCommitAndPushGit commit created
project_changes_pushedCommitAndPushPushed to remote

Per-Project: Release Audit

EventEmitterPurpose
release_tag_auditedAuditReleaseTagLatest tag scanned for vulnerabilities
main_branch_auditedAuditMainBranchMain branch checked for same vulnerability
release_requestedAudit chainIntent to cut a patch release
release_completedCutReleaseTag pushed

Vulnerability Remediation

EventEmitterPurpose
vulnerability_detectedExternal / nightly auditEntry point for remediation workflow
remediation_startedRemediateVulnerabilityFix attempt underway
remediation_completedRemediateVulnerabilityFix attempt finished (success or failure)

Distribution Pipeline

EventEmitterPurpose
release_pipeline_completedWatchPipelineGitHub Actions finished building and publishing
local_install_completedInstallLocallyTool reinstalled on local machine

Event Structure

Every event has:

  • id — Deterministic SHA256 hash of (type + project + occurred_at + payload)
  • event_type — One of the EventType enum variants
  • project — Which project this event relates to
  • occurred_at / recorded_at — When it happened vs. when it was logged
  • throttle — Propagated through the chain to control downstream behaviour
  • payload — Event-type-specific JSON data

Payload Conventions

Downstream blocks read payload fields to make routing decisions (self-filtering). The engine routes by event type only — it cannot inspect payloads.

FieldUsed ByValues
vulnerableAuditMainBranchtrue/false — whether the tag has known CVEs
dirtyRemediateVulnerability, CutReleasetrue/false — whether main still has the vulnerability
cveAll vulnerability blocksCVE identifier string
statusDownstream blocks"ok"/"error" — validation and completion status
has_changesCommitAndPushWhether there are uncommitted changes to persist