Require passing verifier before implementation

This commit is contained in:
Meta Vens 2026-04-30 09:42:54 +01:00
commit cda1b26416
5 changed files with 82 additions and 12 deletions

View file

@ -35,6 +35,7 @@ The spine exists in twenty-five live paths:
- CRRC coordinator recommendation: app-server declares experimental read-only `thread/epiphany/crrc`, reuses the same pressure/freshness/watcher/reorientation mapping plus the fixed `reorient-worker` binding and result read-back helper, recognizes already accepted reorientation findings so an accepted result is not recommended for acceptance again, and returns one bounded recommendation such as continue, prepare checkpoint, launch worker, wait, review, accept, or regather manually without mutating, launching, accepting, compacting, notifying, scheduling, or silently continuing work in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:370), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4661), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4546).
- role ownership projection: app-server declares experimental read-only `thread/epiphany/roles`, reuses the same state/jobs/pressure/reorient/result/CRRC signals as the coordinator loop, and projects implementation, modeling/checkpoint, verification/review, and reorientation lanes with owner roles, status, linked jobs, authority scopes, and recommended scene actions without launching, scheduling, accepting, compacting, notifying, or mutating state in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:350), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4161), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4310).
- role specialist launch/read-back/acceptance: app-server declares experimental `thread/epiphany/roleLaunch`, read-only `thread/epiphany/roleResult`, and write-gated `thread/epiphany/roleAccept`. `roleLaunch` accepts only fixed modeling/checkpoint and verification/review role ids, builds bounded specialist payloads from authoritative Epiphany state, routes them through the existing `epiphany_launch_job` job-control seam, and emits the normal `jobLaunch` state update for `jobBindings` only. `roleResult` resolves the fixed or requested binding through the current `agent_jobs` backend and projects structured output as a reviewable finding with verdict, summary, next safe move, inspected files, frontier/evidence ids, optional modeling `statePatch`, raw result, and errors without mutation, promotion, scheduling, or hidden continuation. `roleAccept` currently accepts only completed modeling/checkpoint findings with a valid modeling-safe `statePatch`, applies it through the existing Epiphany state validator, appends audit observation/evidence, and emits `stateUpdated` with source `roleAccept`. Implementation stays owned by the main coding agent, verification output remains review-only, and reorientation stays on the CRRC-specific `reorientLaunch` / `reorientResult` / `reorientAccept` path.
- fixed-lane coordinator: app-server declares experimental read-only `thread/epiphany/coordinator`, composes role, pressure, reorient, CRRC, role result, and reorient result signals, and returns one current action without mutation. Review acceptance and implementation clearance are intentionally different: an accepted verification finding clears implementation only when the verifier verdict is `pass`; accepted `needs-evidence`, `needs-review`, or `fail` findings route back toward modeling/checkpoint strengthening before code work resumes.
- MVP operator view: `tools/epiphany_mvp_status.py` launches app-server over stdio, starts or reads one thread, gathers scene, pressure, reorient, jobs, roles, modeling/verification role results, reorient result, and CRRC responses, and renders them as text or JSON so the loop can be dogfooded without reading Rust.
- MVP dogfood runner: `tools/epiphany_mvp_dogfood.py` launches app-server over stdio, drives a bounded state/role/CRRC/reorientation loop, and writes operator-safe JSON/text artifacts plus sealed transcript diagnostics under `.epiphany-dogfood/mvp-loop` so a human can audit the run through projections and compare it against a vanilla Codex reference.
- Agent function/API telemetry: `tools/epiphany_agent_telemetry.py` mechanically parses sealed AppServerClient JSONL transcripts into operator-safe telemetry with method counts, request shape, job/status/path fields, and visible function/tool names while sealing text, turn items, raw results, and direct agent messages.
@ -1447,6 +1448,7 @@ stored Epiphany state
-> fixed modeling/checkpoint and verification/review role workers can be launched explicitly
-> fixed role worker results can be read back for review without mutation
-> reviewed modeling/checkpoint statePatch findings can be accepted explicitly to grow graph/checkpoint state
-> accepted verifier findings clear implementation only on verifier verdict pass; non-pass findings send the loop back toward modeling/checkpoint repair
-> can be consumed explicitly by one bounded reorient-worker launch surface
-> retrieval/indexing can inform future work
-> explicit distillation can draft observation/evidence patches

View file

@ -42,9 +42,10 @@ Do not trust this file for the exact live HEAD. Always check git.
- The Aetheria dogfood run has a contamination scar. The supervising Codex session directly edited and committed target-repo work on `E:\Projects\Aetheria-Economy` instead of only driving Epiphany lanes. Treat those Aetheria commits as supervisor-seeded implementation, not clean evidence that Epiphany coordinated the work. Future dogfood must run through the GUI/coordinator/fixed role lanes with auditable artifacts unless the user explicitly authorizes an operator intervention.
- The dogfood quarantine now has a direct-thought boundary. The supervisor may read coordinator actions, role/reorient statuses, structured finding summaries, reviewed state patches, rendered status snapshots, and artifact manifests. It must not read raw worker transcripts, direct worker messages, full turn logs, or `rawResult` payloads during normal dogfood. Those artifacts are sealed for explicit forensic debugging only.
- `tools/epiphany_agent_telemetry.py` is the safe instrument panel for sealed runs. Status/coordinator/GUI/dogfood/live-specialist tools generate telemetry JSON from sealed transcripts that preserves method names, call shape, job/status/path counts, and any visible function/tool names while sealing text, direct messages, and raw results.
- Latest Aetheria supervised dogfood thread: `019ddc52-4ee8-7203-b6c0-106a9c270067` with codex-home `.epiphany-dogfood/aetheria-supervised/codex-home`. CRRC compact/reorient/reorientAccept reached Epiphany state revision 16 after rollout replay fixes, and a fresh coordinator resume cleared to `continueImplementation`.
- Latest Aetheria supervised dogfood thread: `019ddc52-4ee8-7203-b6c0-106a9c270067` with codex-home `.epiphany-dogfood/aetheria-supervised/codex-home`. CRRC compact/reorient/reorientAccept reached Epiphany state revision 16 after rollout replay fixes. Later sanity review showed the modeler and verifier were doing the right work: modeling emitted source-grounded graph/checkpoint/frontier artifacts, while verification returned `needs-evidence` and explicitly did not bless implementation.
- Coordinator policy now treats accepted verifier results as implementation clearance only when the verifier verdict is `pass`. Accepting a `needs-evidence`, `needs-review`, or `fail` verifier finding records the review but routes the loop back toward modeling/checkpoint strengthening or reorientation. The policy was tightened after a too-permissive coordinator path treated reviewed verifier output as a green light.
- The implementation lane is the current product blocker, but it is now harness-visible. The latest audited artifact is `.epiphany-dogfood/aetheria-supervised/gui-actions/continueImplementation-1777528376766401900-25000`: it shows `workspaceChanged: false`, wrote `implementation-audit.md`, applied a no-diff `thread/epiphany/update`, advanced Epiphany state to revision 17, and marked the investigation checkpoint `regather_required`. The next clean run should retry through the operator-safe coordinator lanes after the pre-compaction handoff repair, not by reading sealed worker thoughts.
- A follow-up coordinator plan at `.epiphany-dogfood/aetheria-supervised/coordinator-after-nodiff-state-20260430-plan` now returns `regatherManually` with implementation blocked, instead of continuing fake progress.
- Follow-up coordinator plans at `.epiphany-dogfood/aetheria-supervised/coordinator-after-nodiff-state-20260430-plan` and `.epiphany-dogfood/aetheria-supervised/coordinator-after-verification-verdict-policy-20260430-plan` return `regatherManually` with implementation blocked, instead of continuing fake progress.
- The GUI parses `implementation-result.json` into artifact metadata, surfaces the latest implementation diff/no-diff outcome, and pauses immediate `Continue Implementation` repeats when the newest artifact is a no-diff implementation audit.
- The repo is an Epiphany fork of Codex, not a Codex preset.
- `vendor/codex` is tracked directly, not a submodule.
@ -356,14 +357,13 @@ bounded browser-fallback controls. A live bridge probe also proved
`readModelingResult` from it.
The next real move is not more direct Aetheria implementation. The clean
supervised lane now reaches implementation, but the implementation agent is
reading and stopping without leaving a diff. The GUI surfaces that, immediate
repeat-mashing is blocked, and no-diff implementation now marks the checkpoint
`regather_required` so the coordinator returns `regatherManually` instead of
continuing. Treat this as the next product repair path: run bounded
modeling/reorientation to turn the checkpoint back into implementation-ready
guidance, then retry through the GUI/coordinator/fixed lanes and produce
artifacts that show who did what. Read only operator-safe projections; do not
supervised lane reached implementation too early because the coordinator treated
an accepted verifier finding as a green light even when the verifier verdict was
`needs-evidence`. That policy is now tightened: only an accepted verifier
`pass` clears implementation. The current Aetheria thread should therefore
start with bounded regather/modeling repair for the `regather_required`
checkpoint and verifier evidence gaps, then run verification again before any
implementation retry. Read only operator-safe projections; do not
open raw worker transcripts, direct
worker messages, or `rawResult` payloads unless the user explicitly asks for
forensic debugging. Use generated function/API telemetry for call-shape

View file

@ -44,3 +44,4 @@
{"ts": "2026-04-30T05:54:22+00:00", "type": "verification", "status": "ok", "note": "Stateful no-diff implementation handling landed and was exercised on the Aetheria dogfood thread: continueImplementation-1777528376766401900-25000 produced no tracked diff, thread/epiphany/update marked the investigation checkpoint regather_required with audit evidence, advanced Epiphany state to revision 17, and a follow-up coordinator plan returned regatherManually with implementation blocked."}
{"ts": "2026-04-30T08:18:46+00:00", "type": "implementation", "status": "ok", "note": "CRRC pre-compaction steering now creates a turn-scoped pending compact handoff after successful steer_input, and clean turn completion forces the existing compact automation even if the ordinary coordinator would continue; aborted turns clear the handoff. Focused Rust tests, coordinator smoke, and reorient-launch smoke passed."}
{"ts": "2026-04-30T08:31:23+00:00", "type": "implementation", "status": "ok", "note": "CRRC pressure now uses current context usage from last token telemetry instead of cumulative thread token spend, treats cumulative-only telemetry as unknown, and starts pre-compaction preparation at 80% of the active auto-compact/context limit. Focused pressure/coordinator tests plus pressure and coordinator smokes passed."}
{"ts": "2026-04-30T09:40:22+01:00", "type": "implementation", "status": "ok", "note": "Aetheria dogfood sanity review found the specialists were not the weak link: modeling emitted source-grounded graph/checkpoint/frontier state, and verification returned needs-evidence rather than blessing implementation. The coordinator policy was tightened so only an accepted verifier pass clears implementation; accepted non-pass verifier findings route back toward modeling/checkpoint repair or reorientation. Focused Rust coordinator tests, coordinator smoke, and an operator-safe replay now block implementation with regatherManually on the current Aetheria thread."}

View file

@ -95,6 +95,7 @@ accepted_design:
- `thread/epiphany/crrc` is the first bounded CRRC coordinator recommendation surface: it composes pressure, the reorientation verdict, fixed reorient-worker binding/result status, finding read-back, and available actions into one read-only recommendation without launching, accepting, compacting, scheduling, or mutating state.
- A narrow auditable coordinator is likely central to the MVP because implementation, modeling/checkpoint, verification/review, and CRRC automation depend on each other's signals. CRRC itself is harness workflow automation, not a specialist-agent role: it watches pressure/continuity, ensures persistence, triggers compaction/rehydration/reorientation when needed, and may launch a bounded reorient-worker specialist when semantic regathering is required.
- `thread/epiphany/coordinator` is the first harness-native fixed-lane coordinator surface: it composes roles, pressure, reorient, CRRC, roleResult, and reorientResult into a read-only action recommendation with target role, source signals, review requirements, automation eligibility, reason, and current lane summaries without mutating state or launching work.
- Coordinator implementation clearance is stricter than review acceptance: an accepted verification/review finding only clears the implementation lane when its verdict is `pass`; accepted `needs-evidence`, `needs-review`, or `fail` findings send the loop back toward modeling/checkpoint strengthening or reorientation instead of treating the review as a green light.
- `tools/epiphany_mvp_coordinator.py` is the first auditable coordinator runner: it drives the fixed single-user lanes through app-server APIs, may auto-launch modeling, verification, or reorient-worker jobs, keeps semantic findings review-gated by default, and writes coordinator summaries, JSONL steps, rendered snapshots, transcript, stderr, and final next-action artifacts.
- Limited native CRRC automation is now wired only at turn-complete safe boundaries: it can submit a compact operation when the read-only coordinator recommends `compactRehydrateReorient` or when a successful pre-compaction checkpoint intervention left a pending compact handoff for the completed turn, and it can launch the fixed `reorient-worker` when the coordinator recommends `launchReorientWorker`. It does not auto-launch modeling or verification, auto-accept findings, promote evidence, edit implementation code, or continue after reviewable semantic results.
- Pre-compaction checkpoint intervention is now wired at token-count boundaries: when a loaded Epiphany thread crosses the existing `shouldPrepareCompaction` pressure threshold during an active turn, the harness steers the active agent once for that turn with a bounded CRRC directive to bank scratch/checkpoint/map/evidence before compaction/reorientation. A successful steer marks a turn-scoped pending compact handoff consumed at clean turn completion; this is still steering plus compaction handoff, not semantic acceptance, broad scheduling, or automatic implementation continuation.
@ -180,5 +181,5 @@ rejected_paths:
reason: persistent state that accumulates every local truth becomes memory cruft and weakens rehydration
current_status:
summary: Phase 1 durable state through the Phase 6 GUI/coordinator/specialist/CRRC MVP surfaces are landed. Aetheria dogfood first exposed a supervisor contamination scar, so the quarantine now keeps the supervisor on operator-safe projections and sealed transcripts. The clean supervised pass proved the CRRC compact/reorient/reorientAccept lane can reach state revision 16 and clear to `continueImplementation`; the follow-up implementation pass produced no tracked Aetheria diff, wrote audit artifacts, marked the investigation checkpoint `regather_required`, advanced state to revision 17, and caused the coordinator to block implementation with `regatherManually` instead of fake progress. A follow-up harness repair now turns successful CRRC pre-compaction steering into a pending compact handoff consumed at clean turn completion, and the pressure gauge now ignores cumulative token spend in favor of current context usage with an 80% prep threshold.
next_action: Retry Aetheria dogfood from the operator-safe coordinator lanes after the pre-compaction handoff and pressure-gauge repairs. Start with a bounded regather/modeling repair for the `regather_required` checkpoint, then retry implementation through the GUI/coordinator path and require either a tracked Aetheria diff or an explicit reviewable failure artifact. Do not inspect raw worker transcripts or `rawResult` payloads unless the user explicitly requests forensic debugging.
summary: Phase 1 durable state through the Phase 6 GUI/coordinator/specialist/CRRC MVP surfaces are landed. Aetheria dogfood first exposed a supervisor contamination scar, so the quarantine now keeps the supervisor on operator-safe projections and sealed transcripts. The clean supervised pass proved the CRRC compact/reorient/reorientAccept lane can reach state revision 16, and later operator-safe review showed the modeler and verifier behaved correctly: modeling grew source-grounded graph/checkpoint/frontier state while verification returned `needs-evidence`, not a pass. The coordinator was too permissive, so it now treats only an accepted verifier `pass` as implementation clearance; accepted non-pass verifier findings route back toward modeling/checkpoint repair or reorientation. The follow-up implementation pass still produced no tracked Aetheria diff, wrote audit artifacts, marked the investigation checkpoint `regather_required`, advanced state to revision 17, and current coordinator replay blocks implementation with `regatherManually` instead of fake progress.
next_action: Retry Aetheria dogfood from the operator-safe coordinator lanes. Start with bounded regather/modeling repair for the `regather_required` checkpoint and verifier `needs-evidence` finding, then rerun verification; only retry implementation after a passing verifier result or an explicit reviewable failure artifact says the lane is still blocked. Do not inspect raw worker transcripts or `rawResult` payloads unless the user explicitly requests forensic debugging.

View file

@ -4665,6 +4665,10 @@ impl CodexMessageProcessor {
.as_ref()
.is_some_and(|state| epiphany_role_finding_already_accepted(state, finding))
});
let verification_result_allows_implementation = verification_result_accepted
&& verification_finding
.as_ref()
.is_some_and(epiphany_verification_finding_allows_implementation);
let source_signals = ThreadEpiphanyCoordinatorSignals {
pressure_level: pressure.level,
@ -4683,6 +4687,7 @@ impl CodexMessageProcessor {
&roles,
&source_signals,
verification_result_accepted,
verification_result_allows_implementation,
reorient_finding_accepted,
);
let note = render_epiphany_coordinator_note(
@ -13993,6 +13998,7 @@ fn map_epiphany_coordinator(
roles: &[ThreadEpiphanyRoleLane],
signals: &ThreadEpiphanyCoordinatorSignals,
verification_result_accepted: bool,
verification_result_allows_implementation: bool,
reorient_finding_accepted: bool,
) -> EpiphanyCoordinatorDecision {
let build = |action,
@ -14095,6 +14101,20 @@ fn map_epiphany_coordinator(
);
}
if signals.verification_result_status == ThreadEpiphanyRoleResultStatus::Completed
&& verification_result_accepted
&& !verification_result_allows_implementation
{
return build(
ThreadEpiphanyCoordinatorAction::LaunchModeling,
Some(ThreadEpiphanyRoleId::Modeling),
Some(ThreadEpiphanySceneAction::RoleLaunch),
false,
true,
"The accepted verification/review finding did not pass; strengthen modeling/checkpoint evidence before implementation continues.",
);
}
if signals.modeling_result_status == ThreadEpiphanyRoleResultStatus::Completed
&& !verification_result_accepted
{
@ -14233,6 +14253,16 @@ fn epiphany_role_finding_already_accepted(
})
}
fn epiphany_verification_finding_allows_implementation(
finding: &ThreadEpiphanyRoleFinding,
) -> bool {
finding.role_id == ThreadEpiphanyRoleId::Verification
&& finding
.verdict
.as_deref()
.is_some_and(|verdict| verdict.eq_ignore_ascii_case("pass"))
}
fn map_epiphany_roles(
state: Option<&EpiphanyThreadState>,
jobs: &[ThreadEpiphanyJob],
@ -16364,6 +16394,10 @@ pub(crate) async fn maybe_run_epiphany_coordinator_automation_for_turn_boundary(
let verification_result_accepted = verification_finding
.as_ref()
.is_some_and(|finding| epiphany_role_finding_already_accepted(&state, finding));
let verification_result_allows_implementation = verification_result_accepted
&& verification_finding
.as_ref()
.is_some_and(epiphany_verification_finding_allows_implementation);
let source_signals = ThreadEpiphanyCoordinatorSignals {
pressure_level: pressure.level,
should_prepare_compaction: pressure.should_prepare_compaction,
@ -16381,6 +16415,7 @@ pub(crate) async fn maybe_run_epiphany_coordinator_automation_for_turn_boundary(
&roles,
&source_signals,
verification_result_accepted,
verification_result_allows_implementation,
reorient_finding_accepted,
);
@ -19632,6 +19667,7 @@ mod tests {
&signals,
false,
false,
false,
);
assert_eq!(
@ -19671,6 +19707,7 @@ mod tests {
&signals,
false,
false,
false,
);
assert_eq!(
@ -19712,6 +19749,7 @@ mod tests {
&[],
&signals,
false,
false,
true,
);
@ -19767,6 +19805,7 @@ mod tests {
&signals,
false,
false,
false,
);
assert_eq!(
@ -19809,6 +19848,7 @@ mod tests {
&signals,
false,
false,
false,
);
assert_eq!(
@ -19847,6 +19887,7 @@ mod tests {
&missing,
false,
false,
false,
);
assert_eq!(
launch_modeling.action,
@ -19872,6 +19913,7 @@ mod tests {
&modeling_backend_unavailable,
false,
false,
false,
);
assert_eq!(
relaunch_modeling.action,
@ -19893,6 +19935,7 @@ mod tests {
&modeling_done,
false,
false,
false,
);
assert_eq!(
launch_verification.action,
@ -19918,6 +19961,7 @@ mod tests {
&verification_done,
false,
false,
false,
);
assert_eq!(
review_verification.action,
@ -19925,6 +19969,26 @@ mod tests {
);
assert!(review_verification.requires_review);
let accepted_needs_evidence_verification = map_epiphany_coordinator(
ThreadEpiphanyReorientStateStatus::Ready,
true,
&pressure,
&recommendation,
&roles,
&verification_done,
true,
false,
false,
);
assert_eq!(
accepted_needs_evidence_verification.action,
ThreadEpiphanyCoordinatorAction::LaunchModeling
);
assert_eq!(
accepted_needs_evidence_verification.target_role,
Some(ThreadEpiphanyRoleId::Modeling)
);
let accepted_verification = map_epiphany_coordinator(
ThreadEpiphanyReorientStateStatus::Ready,
true,
@ -19933,6 +19997,7 @@ mod tests {
&roles,
&verification_done,
true,
true,
false,
);
assert_eq!(
@ -19956,6 +20021,7 @@ mod tests {
&reviewed,
false,
false,
false,
);
assert_eq!(
continue_implementation.action,