Implement closed-loop workspace follow-ups

This commit is contained in:
2026-07-15 23:48:12 +04:00
parent 3a48ecd24f
commit ed7efb6072
51 changed files with 702 additions and 54 deletions
+2
View File
@@ -27,6 +27,8 @@ CORREX kernel team. This is the most cross-cutting module in the codebase — ch
- **SILENT FAILURE TRAP**: After adding any `EventPayload` subclass, immediately add it to `Serialization.kt` `eventModule` block. Run `./gradlew check` to verify. Tests may pass without it but runtime replay will fail silently.
- `AnyMapSerializer` — custom serializer for `Map<String, Any?>`; use it for dynamic payloads, don't roll another.
- Event classes are `@Serializable data class` with no mutable state. No methods beyond data accessors.
- `RunBranchPushedEvent` records an optional server Git transport push only after it succeeds; its branch/base/head SHAs are observations, not values replay recalculates.
- `RepoMapEntry.descriptor` is a bounded source-purpose observation recorded with the repo map and used when constructing semantic L3 embeddings.
- Do not add domain logic to events. They are records, not actors.
- `EgressAllowlistProjection` — special projection kept in this module because it is used by both `core:toolintent` and `core:events` consumers; it is a shared cross-cutting projection.
@@ -16,6 +16,8 @@ data class ContractAssertionResult(
/** Evaluator that produced the verdict: FS / TEXT / COMPILER / AST. */
val evaluator: String,
val passed: Boolean,
/** True when this assertion is intentionally deferred to another authoritative gate. */
val skipped: Boolean = false,
/** Concrete reason the assertion failed (or a confirmation when it passed). Kept bounded. */
val evidence: String,
)
@@ -36,6 +36,19 @@ data class WorkflowFailedEvent(
val retryExhausted: Boolean,
) : EventPayload
/**
* Observation recorded only after the optional server Git transport has pushed a terminal run
* branch. This keeps the reviewable branch reference replayable without re-running Git.
*/
@Serializable
@SerialName("RunBranchPushed")
data class RunBranchPushedEvent(
val sessionId: SessionId,
val branch: String,
val baseSha: String,
val headSha: String,
) : EventPayload
/**
* Records that the operator approved access to a specific path OUTSIDE the workspace root
* (a `file_read`/`list_dir` target). The intent plane raises PROMPT_USER for any out-of-workspace
@@ -11,6 +11,8 @@ data class RepoMapEntry(
val path: String,
val score: Double,
val symbols: List<String> = emptyList(),
/** Bounded deterministic source-purpose text used for semantic repo retrieval. */
val descriptor: String = "",
)
/**
@@ -89,6 +89,7 @@ import com.correx.core.events.events.WorkflowCompletedEvent
import com.correx.core.events.events.WorkflowFailedEvent
import com.correx.core.events.events.WorkflowProposedEvent
import com.correx.core.events.events.WorkflowStartedEvent
import com.correx.core.events.events.RunBranchPushedEvent
import com.correx.core.events.events.TaskCreatedEvent
import com.correx.core.events.events.TaskClaimedEvent
import com.correx.core.events.events.TaskReleasedEvent
@@ -151,6 +152,7 @@ val eventModule = SerializersModule {
subclass(OrchestrationResumedEvent::class)
subclass(OrchestrationPausedEvent::class)
subclass(WorkflowStartedEvent::class)
subclass(RunBranchPushedEvent::class)
subclass(WorkflowFailedEvent::class)
subclass(WorkflowCompletedEvent::class)
subclass(RetryAttemptedEvent::class)