Fix dogfood vanilla comparison artifacts

This commit is contained in:
Meta Vens 2026-04-29 15:37:41 +01:00
commit 05bb46d792
5 changed files with 172 additions and 16 deletions

View file

@ -80,7 +80,7 @@ The landed machine now has:
- read-only Phase 6 role ownership through `thread/epiphany/roles`, projecting implementation, modeling/checkpoint, verification/review, and reorientation lanes from typed state plus jobs/CRRC/result signals
- explicit Phase 6 role launch/read-back through `thread/epiphany/roleLaunch` and read-only `thread/epiphany/roleResult`, limited to fixed modeling/checkpoint and verification/review templates over the existing job-control seam
- first Phase 6 dogfood operator view through `tools/epiphany_mvp_status.py`
- first auditable Phase 6 dogfood runner through `tools/epiphany_mvp_dogfood.py`, producing local status snapshots, raw app-server transcript, final status artifacts, vanilla-reference output, and comparison notes
- first auditable Phase 6 dogfood runner through `tools/epiphany_mvp_dogfood.py`, producing local status snapshots, raw app-server transcript, final status artifacts, truthful vanilla-reference output, and comparison notes
- first auditable Phase 6 fixed-lane coordinator runner through `tools/epiphany_mvp_coordinator.py`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, and final next-action artifacts while keeping semantic findings review-gated by default
- first auditable Phase 6 live-specialist runner through `tools/epiphany_mvp_live_specialist.py`, proving `roleLaunch -> agent_jobs worker -> report_agent_job_result -> roleResult` without manual backend completion
- live Phase 6 reorientation app-server smoke coverage in `tools/epiphany_phase6_reorient_smoke.py`
@ -218,7 +218,11 @@ pre-compaction checkpoint intervention is now also landed: token-count pressure
events steer active loaded Epiphany turns once at the `shouldPrepareCompaction`
threshold so working context can be banked before compaction. The next MVP
question is sharper: dogfood the coordinator/status/pre-compaction loop and fix
only concrete blockers.
only concrete blockers. The latest self-dogfood pass found one: the dogfood
runner's manifest promised vanilla/comparison artifacts that were not actually
written. The runner now always writes the prompt, reference status, comparison,
and manifest honestly, and an explicit `--run-vanilla-reference` pass can spend
a real vanilla Codex turn and persist its transcript for comparison.
## Phase 6 Direction
@ -226,7 +230,7 @@ Phase 6 should grow observable harness state outward from the typed spine.
Useful candidates:
1. Put the fixed-lane coordinator and pre-compaction checkpoint loop in front of a human operator through status/artifact review, then fix concrete usability blockers.
1. Keep dogfood execution agent-run and auditable, then put the fixed-lane coordinator and pre-compaction checkpoint loop in front of the user through the smallest local GUI/operator view over the same status/artifact surfaces.
2. Keep accepted worker findings review-gated; do not convert acceptance into automatic promotion of arbitrary worker output.
3. Keep pre-compaction intervention narrow: steer once at `shouldPrepareCompaction`, then let explicit checkpointing, compact/resume/reorient, and review gates do their jobs.

View file

@ -33,7 +33,7 @@ Do not trust this file for the exact live HEAD. Always check git.
- `tools/epiphany_mvp_coordinator.py` is the first auditable fixed-lane coordinator runner. It starts or reads a thread through app-server, follows the harness-native coordinator action, can auto-launch modeling, verification, or reorient-worker jobs, keeps semantic findings review-gated by default, and writes summary, steps, rendered snapshots, transcript, stderr, and final next-action artifacts under `.epiphany-dogfood/coordinator` or a caller-provided artifact directory.
- Native CRRC automation is now landed only at turn-complete safe boundaries. It may submit `Op::Compact` for coordinator-approved `compactRehydrateReorient`, and it may launch the fixed `reorient-worker` for coordinator-approved `launchReorientWorker`. It does not auto-launch modeling/verification, accept findings, promote evidence, edit implementation code, or keep going after reviewable semantic output.
- Pre-compaction checkpoint intervention is now landed. On token-count events for loaded Epiphany threads, when pressure reaches the existing `shouldPrepareCompaction` threshold, the harness steers the active turn once with a CRRC checkpoint directive so the agent banks working context before compaction/reorientation. This is still bounded steering, not automatic semantic acceptance, a broad scheduler, or implementation continuation.
- `tools/epiphany_mvp_dogfood.py` is the first auditable dogfood runner. It drives a bounded state/role/CRRC/reorientation loop and writes local artifacts under `.epiphany-dogfood/mvp-loop`, including raw app-server transcript, rendered snapshots, final status, vanilla-reference prompt/output, and comparison notes.
- `tools/epiphany_mvp_dogfood.py` is the first auditable dogfood runner. It drives a bounded state/role/CRRC/reorientation loop and writes local artifacts under `.epiphany-dogfood/mvp-loop`, including raw app-server transcript, rendered snapshots, final status, vanilla-reference prompt/output, and comparison notes. The runner now writes truthful vanilla/comparison artifacts whether the optional vanilla reference is skipped, fails, or completes.
- `tools/epiphany_mvp_live_specialist.py` is the first auditable live-specialist runner. It launches a real role specialist through `thread/epiphany/roleLaunch`, lets the spawned worker report through `report_agent_job_result`, reads it back through `thread/epiphany/roleResult`, and writes local artifacts under `.epiphany-dogfood/live-specialist`.
- Internal `agent_job:` workers now get the reporting tool independent of the user-facing CSV spawn feature, and ephemeral worker sessions can initialize the sqlite state runtime on demand so specialist reports land in the shared backend.
- Durable in-flight investigation checkpointing is now landed in authoritative typed state, writable through `thread/epiphany/update` or accepted `thread/epiphany/promote`, rendered into the prompt, and reflected through scene/context.
@ -280,10 +280,13 @@ still explicit even though read-only job ownership/progress reflection now has a
real runtime seam, the thin launcher boundary is landed, and one explicit
reorient-guided launch surface can consume the verdict on purpose.
The first auditable dogfood pass has run. It exercised the landed MVP loop,
produced `.epiphany-dogfood/mvp-loop` artifacts, ran a read-only Vanilla Codex
reference, and fixed the concrete blocker where CRRC recommended accepting the
same reorientation result again after `reorientAccept`.
The latest auditable MVP dogfood pass has run. It exercised the landed MVP loop,
produced `.epiphany-dogfood/mvp-loop-selfdogfood-vanilla2-20260429` artifacts,
ran a real Vanilla Codex reference through app-server with a persisted
transcript, and fixed the concrete blocker where the runner's manifest claimed
vanilla/comparison artifacts that did not exist. Comparison artifacts are now
honest: they record skipped, failed, or completed vanilla-reference state
instead of pretending the receipt drawer is full.
The first live-specialist pass has also run. It produced
`.epiphany-dogfood/live-specialist` artifacts and proved the real worker path:
@ -296,8 +299,9 @@ intervention is now wired. Limited safe-boundary CRRC execution still handles
compact and fixed reorient-worker launch actions after a turn ends; the
token-count hook now handles the earlier danger zone by steering active loaded
turns once when `shouldPrepareCompaction` is reached. The next real move is
dogfooding the coordinator/status/pre-compaction loop on real local work and
fixing concrete MVP blockers. CRRC is not a specialist-agent persona; the
continued agent-run dogfooding, then the smallest local GUI/operator view over
the same status and artifact surfaces so the user does not have to operate the
machine from a terminal. CRRC is not a specialist-agent persona; the
reorient-worker it may launch is the specialist. Do not turn the coordinator
into a broad hidden dispatcher, arbitrary marketplace, alternate job backend,
automatic semantic acceptance path, or GUI-as-source-of-truth.

View file

@ -63,3 +63,4 @@
{"ts": "2026-04-28T18:56:47+01:00", "type": "implementation", "status": "ok", "note": "Landed limited native CRRC automation at turn-complete safe boundaries. It reuses the read-only coordinator policy and only auto-runs compactRehydrateReorient via Op::Compact or launchReorientWorker via the fixed reorient-worker job binding; modeling, verification, semantic acceptance, evidence promotion, implementation edits, and hidden continuation remain review-gated or manual. Focused coordinator automation assertions, job-progress event handling, coordinator smoke, status smoke, role smoke, and reorient-launch smoke passed."}
{"ts": "2026-04-29T02:35:26+01:00", "type": "design", "status": "ok", "note": "Corrected the CRRC MVP target: turn-complete-only automation is insufficient because compaction can lose learned but unexternalized working context. The next CRRC slice should detect rising pressure before the hard cliff, interrupt or steer the active agent into a bounded persistence/checkpoint pass, then compact/resume/reorient after scratch/checkpoint/map/evidence are banked as needed."}
{"ts": "2026-04-29T15:15:06+01:00", "type": "implementation", "status": "ok", "note": "Landed the smallest pre-compaction checkpoint intervention: TokenCount handling maps pressure through the existing gauge and, for loaded Epiphany threads at shouldPrepareCompaction, steers the active turn once with a bounded CRRC directive to bank checkpoint/scratch/map/evidence before compaction or reorientation. It does not mutate state directly, accept findings, launch arbitrary specialists, or continue implementation. Focused app-server tests plus coordinator/status/reorient/role smokes passed; a stale scene expected-actions assertion was corrected to include the already-landed coordinator action."}
{"ts": "2026-04-29T14:35:07+00:00", "type": "implementation", "status": "ok", "note": "Self-dogfood exposed an artifact-honesty blocker in tools/epiphany_mvp_dogfood.py: the manifest listed vanilla comparison artifacts that were not written. The runner now writes truthful vanilla-reference and comparison artifacts for skipped, failed, or completed reference runs; an explicit --run-vanilla-reference pass completed with a persisted vanilla transcript under .epiphany-dogfood/mvp-loop-selfdogfood-vanilla2-20260429."}

View file

@ -95,7 +95,7 @@ accepted_design:
- `thread/epiphany/reorientResult` is the first bounded read-back surface for that worker: it reads the fixed or requested reorient-worker binding through the current `agent_jobs` backend and projects completed output as a reviewable finding without mutation, promotion, scheduling, or hidden continuation.
- `thread/epiphany/reorientAccept` is the first explicit acceptance write for completed reorient-worker findings: it appends accepted observation/evidence records, can optionally update scratch and investigation checkpoint state, and emits `stateUpdated` with source `reorientAccept` without accepting pending work or launching follow-up work.
- After `thread/epiphany/reorientAccept`, CRRC recognizes the accepted reorientation finding and does not recommend accepting the same completed result again.
- `tools/epiphany_mvp_dogfood.py` is the auditable MVP dogfood runner: it drives state, role launch/result, CRRC drift, reorient launch/result/accept, rendered status snapshots, and raw app-server transcript into a local artifact bundle for comparison against a vanilla Codex reference.
- `tools/epiphany_mvp_dogfood.py` is the auditable MVP dogfood runner: it drives state, role launch/result, CRRC drift, reorient launch/result/accept, rendered status snapshots, and raw app-server transcript into a local artifact bundle, and it now writes truthful comparison artifacts whether the optional vanilla Codex reference is skipped, fails, or completes.
- `tools/epiphany_mvp_live_specialist.py` is the auditable live-specialist MVP runner: it launches a real modeling/checkpoint or verification/review specialist through `thread/epiphany/roleLaunch`, lets the spawned worker report through `report_agent_job_result`, reads the finding back through `thread/epiphany/roleResult`, and writes transcript/status artifacts without manually completing backend rows.
- Internal `agent_job:` workers expose `report_agent_job_result` even when the user-facing CSV spawn feature is disabled, and ephemeral worker sessions can initialize the sqlite state runtime on demand so role specialists can report into the shared `agent_jobs` backend.
- Epiphany safety doctrine is to separate cognition from actuation, keep authority explicit, make interruption sacred, stage capability release, and treat operator misuse as a normal design input rather than a rude hypothetical.
@ -161,5 +161,5 @@ rejected_paths:
reason: persistent state that accumulates every local truth becomes memory cruft and weakens rehydration
current_status:
summary: Phase 1 durable state, Phase 2 prompt integration, Phase 3 typed read, Phase 4 retrieval/indexing, Phase 5 update/distill/propose/promote/read/notification, and Phase 6 read-only scene, jobs, roles, freshness, targeted context, pressure, reorient, CRRC, coordinator, reorient launch/result/accept, explicit modeling/checkpoint and verification/review role launch/result templates, MVP status, dogfood runner, coordinator runner, live specialist runner, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention are landed. Native CRRC can now steer an active loaded Epiphany turn once when token pressure reaches `shouldPrepareCompaction`, asking the agent to bank working context before compaction; turn-complete automation can still compact or launch the fixed reorient-worker when the coordinator says it can auto-run. Implementation remains main-agent work; CRRC remains workflow automation, not a specialist persona.
next_action: Dogfood the coordinator/status/pre-compaction loop on real local work and fix only concrete blockers that prevent a usable single-user MVP. Keep semantic acceptance review-gated, and do not build a broad ambient dispatcher, GUI-as-source-of-truth, arbitrary specialist marketplace, or alternate job backend for the MVP.
summary: Phase 1 durable state, Phase 2 prompt integration, Phase 3 typed read, Phase 4 retrieval/indexing, Phase 5 update/distill/propose/promote/read/notification, and Phase 6 read-only scene, jobs, roles, freshness, targeted context, pressure, reorient, CRRC, coordinator, reorient launch/result/accept, explicit modeling/checkpoint and verification/review role launch/result templates, MVP status, dogfood runner, coordinator runner, live specialist runner, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention are landed. Native CRRC can steer active loaded Epiphany turns once at `shouldPrepareCompaction`; turn-complete automation can still compact or launch the fixed reorient-worker when the coordinator says it can auto-run. The latest self-dogfood pass exposed and fixed an artifact-honesty blocker in the MVP dogfood runner: comparison and vanilla-reference artifacts are now actually written and the optional real vanilla run produces a persisted read-back transcript. Implementation remains main-agent work; CRRC remains workflow automation, not a specialist persona.
next_action: Continue dogfooding the coordinator/status/pre-compaction loop through auditable artifacts that the agent runs for the user, then turn the same artifact/status surfaces into the smallest local GUI/operator view. Keep semantic acceptance review-gated, and do not build a broad ambient dispatcher, GUI-as-source-of-truth, arbitrary specialist marketplace, or alternate job backend for the MVP.

View file

@ -24,6 +24,7 @@ from epiphany_phase6_role_smoke import complete_role_backend_job
DEFAULT_ARTIFACT_DIR = ROOT / ".epiphany-dogfood" / "mvp-loop"
DEFAULT_VANILLA_CODEX_HOME = Path.home() / ".codex"
def reset_artifact_dir(path: Path) -> None:
@ -46,6 +47,144 @@ def write_text(path: Path, value: str) -> None:
path.write_text(value, encoding="utf-8")
def latest_agent_message(thread_read: dict[str, Any]) -> str:
turns = thread_read.get("thread", {}).get("turns", [])
if not isinstance(turns, list):
return ""
for turn in reversed(turns):
items = turn.get("items", []) if isinstance(turn, dict) else []
if not isinstance(items, list):
continue
for item in reversed(items):
if isinstance(item, dict) and item.get("type") == "agentMessage":
text = item.get("text")
if isinstance(text, str):
return text
return ""
def vanilla_reference_prompt(workspace: Path) -> str:
return f"""You are a vanilla Codex reference agent with no Epiphany typed-state surfaces.
Inspect the bounded smoke workspace at:
{workspace}
Task:
- Decide whether it is safe to resume from this checkpoint:
- checkpoint id: ix-reorient-1
- focus: Verify src/reorient_target.rs before broad edits.
- expected symbol: reorient_target at lines 1-3.
- Return a concise review with:
- files inspected
- whether the checkpoint still matches the source
- the next safe move
Do not edit files.
"""
def write_reference_not_run(artifact_dir: Path, reason: str, prompt: str) -> dict[str, Any]:
write_text(artifact_dir / "vanilla-reference-prompt.md", prompt)
write_text(
artifact_dir / "vanilla-reference.md",
f"Vanilla reference was not executed.\n\nReason: {reason}\n",
)
comparison = (
"# Dogfood Comparison\n\n"
"Epiphany artifacts were produced for the MVP loop.\n\n"
f"Vanilla reference: not executed. {reason}\n"
)
write_text(artifact_dir / "comparison.md", comparison)
return {
"status": "notRun",
"reason": reason,
"promptPath": "vanilla-reference-prompt.md",
"responsePath": "vanilla-reference.md",
"comparisonPath": "comparison.md",
}
def run_vanilla_reference(args: argparse.Namespace, artifact_dir: Path, workspace: Path) -> dict[str, Any]:
prompt = vanilla_reference_prompt(workspace)
write_text(artifact_dir / "vanilla-reference-prompt.md", prompt)
if not args.run_vanilla_reference:
return write_reference_not_run(
artifact_dir,
"Pass --run-vanilla-reference to spend a real vanilla Codex turn.",
prompt,
)
codex_home = args.vanilla_codex_home.resolve()
transcript_path = artifact_dir / "vanilla-reference-transcript.jsonl"
stderr_path = artifact_dir / "vanilla-reference.stderr.log"
try:
with AppServerClient(args.app_server.resolve(), codex_home, transcript_path, stderr_path) as client:
client.send(
"initialize",
{
"clientInfo": {
"name": "epiphany-mvp-vanilla-reference",
"title": "Epiphany MVP Vanilla Reference",
"version": "0.1.0",
},
"capabilities": {"experimentalApi": True},
},
)
client.send("initialized", expect_response=False)
started = client.send("thread/start", {"cwd": str(workspace), "ephemeral": False})
assert started is not None
thread_id = started["thread"]["id"]
turn = client.send(
"turn/start",
{
"threadId": thread_id,
"input": [{"type": "text", "text": prompt, "textElements": []}],
},
)
assert turn is not None
client.wait_for_notification("turn/completed", timeout=args.vanilla_timeout_seconds)
read = client.send("thread/read", {"threadId": thread_id, "includeTurns": True})
assert read is not None
response = latest_agent_message(read)
except Exception as exc:
write_text(artifact_dir / "vanilla-reference.md", f"Vanilla reference failed: {exc}\n")
write_text(
artifact_dir / "comparison.md",
"# Dogfood Comparison\n\n"
"Epiphany artifacts were produced for the MVP loop.\n\n"
f"Vanilla reference failed: {exc}\n",
)
return {
"status": "failed",
"error": str(exc),
"promptPath": "vanilla-reference-prompt.md",
"responsePath": "vanilla-reference.md",
"comparisonPath": "comparison.md",
"transcriptPath": "vanilla-reference-transcript.jsonl",
"stderrPath": "vanilla-reference.stderr.log",
}
write_text(artifact_dir / "vanilla-reference.md", response)
write_text(
artifact_dir / "comparison.md",
"# Dogfood Comparison\n\n"
"Epiphany run produced typed state, role-lane findings, CRRC drift detection, reorient acceptance, rendered snapshots, and JSON-RPC transcript artifacts.\n\n"
"Vanilla reference produced a single untyped review turn over the same bounded workspace.\n\n"
"Primary product signal: Epiphany makes lane ownership, checkpoint state, drift, and review gates inspectable as structured artifacts. Vanilla Codex can still solve the tiny source question, but it does not produce durable typed role/CRRC state unless the operator asks for it manually.\n",
)
return {
"status": "completed",
"threadId": thread_id,
"turnId": turn.get("turnId") or turn.get("turn_id"),
"promptPath": "vanilla-reference-prompt.md",
"responsePath": "vanilla-reference.md",
"comparisonPath": "comparison.md",
"transcriptPath": "vanilla-reference-transcript.jsonl",
"stderrPath": "vanilla-reference.stderr.log",
}
def snapshot(
client: AppServerClient,
*,
@ -215,6 +354,8 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]:
final_read = client.send("thread/read", {"threadId": thread_id, "includeTurns": False})
assert final_read is not None
reference = run_vanilla_reference(args, artifact_dir, workspace)
summary = {
"objective": "Dogfood the Epiphany MVP loop on a bounded continuity/role-separation task.",
"artifactDir": str(artifact_dir),
@ -244,6 +385,7 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]:
"payload": reorient_payload,
},
"finalRecommendation": final_status["crrc"]["recommendation"],
"vanillaReference": reference,
"artifactManifest": [
"epiphany-dogfood-summary.json",
"epiphany-final-status.json",
@ -253,11 +395,13 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]:
"epiphany-server.stderr.log",
"vanilla-reference-prompt.md",
"vanilla-reference.md",
"vanilla-reference.stdout.log",
"vanilla-reference.stderr.log",
"comparison.md",
],
}
if reference.get("transcriptPath"):
summary["artifactManifest"].append(str(reference["transcriptPath"]))
if reference.get("stderrPath"):
summary["artifactManifest"].append(str(reference["stderrPath"]))
write_json(artifact_dir / "epiphany-snapshots.json", snapshots)
write_json(artifact_dir / "epiphany-final-status.json", final_status)
@ -272,7 +416,7 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]:
"transcript contains JSON-RPC request/response audit trail",
"stderr captures app-server diagnostics",
"snapshots preserve rendered and raw status at each dogfood checkpoint",
"vanilla reference and comparison files are added after the control agent run",
"comparison.md states whether the optional vanilla reference actually ran",
],
},
)
@ -285,6 +429,9 @@ def main() -> int:
)
parser.add_argument("--app-server", type=Path, default=DEFAULT_APP_SERVER)
parser.add_argument("--artifact-dir", type=Path, default=DEFAULT_ARTIFACT_DIR)
parser.add_argument("--run-vanilla-reference", action="store_true")
parser.add_argument("--vanilla-codex-home", type=Path, default=DEFAULT_VANILLA_CODEX_HOME)
parser.add_argument("--vanilla-timeout-seconds", type=float, default=240.0)
args = parser.parse_args()
result = run_dogfood(args)
print(json.dumps(result, indent=2, ensure_ascii=False))