Harden Epiphany dogfood coordination
This commit is contained in:
parent
c6201363f4
commit
abcdf7d991
10 changed files with 1561 additions and 219 deletions
|
|
@ -160,10 +160,11 @@ and notify typed state. It can.
|
|||
|
||||
The next unknowns are:
|
||||
|
||||
- how to give implementation and verification lanes controlled runtime/editor access without letting workers launch random local tools
|
||||
- how the landed watcher-backed invalidation telemetry should be consumed without turning freshness into a secret worker
|
||||
- how far the read-only CRRC recommendation should go before explicit client/operator action takes over
|
||||
- how much narrow coordination is needed so modeling, implementation, verification, and CRRC automation can hand off work without collapsing back into one context
|
||||
- what concrete operator friction appears when the CLI MVP is tested on real work
|
||||
- what concrete operator friction appears when the GUI/operator MVP is tested on real work
|
||||
|
||||
## MVP Cutline
|
||||
|
||||
|
|
@ -237,15 +238,25 @@ 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.
|
||||
|
||||
The latest Aetheria dogfood pass found the next bigger blocker. The fixed lanes
|
||||
can now catch modeling, verification, stale job, no-diff, and reorientation
|
||||
failures, but the implementation lane cannot prove engine assumptions without a
|
||||
controlled editor/runtime bridge. A worker tried to launch a legacy default
|
||||
Unity editor even though Aetheria pins a Unity 6000 project version. The guard
|
||||
is now to refuse PATH/default/legacy Unity, but the real MVP organ is a bridge
|
||||
that resolves the project-pinned editor, runs explicit batch/test/probe commands,
|
||||
captures logs and artifacts, and feeds those artifacts into evidence.
|
||||
|
||||
## Phase 6 Direction
|
||||
|
||||
Phase 6 should grow observable harness state outward from the typed spine.
|
||||
|
||||
Useful candidates:
|
||||
|
||||
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`, latch the compact handoff only after successful steering, then let explicit checkpointing, compact/resume/reorient, and review gates do their jobs.
|
||||
1. Build a first-class editor/runtime bridge for engine repos. For Unity, read the project-pinned editor version, refuse wrong or missing editors, run only explicit batch/test/probe commands, and write logs/probe output into auditable artifacts.
|
||||
2. 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.
|
||||
3. Keep accepted worker findings review-gated; do not convert acceptance into automatic promotion of arbitrary worker output.
|
||||
4. Keep pre-compaction intervention narrow: steer once at `shouldPrepareCompaction`, latch the compact handoff only after successful steering, then let explicit checkpointing, compact/resume/reorient, and review gates do their jobs.
|
||||
|
||||
Do not spend Phase 6 polishing Phase 5 out of anxiety. The Phase 5 smoke harness
|
||||
is a regression guardrail, not a ritual drum circle for summoning more tiny
|
||||
|
|
@ -327,6 +338,7 @@ These remain later work:
|
|||
- richer role ergonomics after the fixed single-user coordinator proves useful
|
||||
- mutation gates that warn or block broad writes when map freshness is stale
|
||||
- broader CRRC runtime coordination beyond the landed narrow safe-boundary compact, fixed reorient-worker launch, and pre-compaction checkpoint steering actions
|
||||
- richer editor/runtime bridges beyond the first pinned Unity bridge
|
||||
- richer GUI workflows for graph, evidence, job, invariant, and frontier steering after the operator console proves useful
|
||||
|
||||
Do not start these from vibes. Each one needs a source-grounded slice plan and a
|
||||
|
|
|
|||
|
|
@ -42,11 +42,13 @@ 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. 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.
|
||||
- Latest Aetheria supervised dogfood thread: `019ddc52-4ee8-7203-b6c0-106a9c270067` with codex-home `.epiphany-dogfood/aetheria-supervised/codex-home`. It has now exercised modeling, verification, implementation audit, no-diff repair, CRRC reorientation, reorient acceptance, and coordinator replay through operator-safe artifacts without opening sealed worker thoughts.
|
||||
- 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.
|
||||
- A later dogfood attempt exposed another supervision scar: manually launching modeling, reorientation, and verification from the supervisor is not clean dogfood. The coordinator now treats `regatherManually` as fallback only after fixed lanes cannot advance, stops at `reviewModelingResult` for completed unaccepted modeling findings, and the CLI runner's explicit test-only `--auto-review` mode can accept modeling `statePatch` findings before launching verification. Production semantic findings remain review-gated.
|
||||
- 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.
|
||||
- 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` returned `regatherManually` with implementation blocked. After the latest coordinator fix, `.epiphany-dogfood/aetheria-supervised/supervisor-runs/dogfood-20260430-094721/coordinator-post-puppet-fix-plan` returns `reviewModelingResult`: the harness now surfaces the unaccepted modeling finding instead of asking the supervisor to improvise.
|
||||
- The latest dogfood pass fixed concrete harness wounds: stale completed backend jobs now project as terminal, accepted verifier non-pass findings no longer clear implementation, verification coverage accepts modeler source evidence ids as current-model coverage, implementation audits compare pre/post diff hashes instead of treating existing dirt as fresh work, the latest implementation audit status wins, blocked no-diff turns route back through CRRC, stale accepted reorient findings relaunch bounded reorientation when the checkpoint regathers, and accepted reorientation findings now bank resume-ready checkpoints.
|
||||
- The latest audited implementation artifact is `.epiphany-dogfood/aetheria-supervised/gui-actions/continueImplementation-1777548050463576300-28568`: it correctly shows `workspaceChanged: false`, `dirtyWorkspace: true`, `trackedDiffChanged: false`, wrote a no-diff audit, advanced Epiphany state to revision 57, and routed coordinator/CRRC back to `launchReorientWorker` instead of pretending old dirt was progress.
|
||||
- Aetheria dogfood also exposed the next product organ: editor/runtime integration. An implementation worker launched legacy `D:\Unity\Editor\Unity.exe -version` (Unity 5.5.0f3) even though Aetheria pins Unity `6000.1.10f1`; the stray process was killed, and `tools/epiphany_gui_action.py` now tells implementation workers not to launch PATH/default/legacy Unity when the exact pinned editor is unavailable. This is a guardrail, not the real bridge.
|
||||
- The next real MVP organ is a typed editor/runtime bridge for engine repos: resolve the project-pinned editor, refuse wrong or missing versions, run explicit batch/test/probe commands, capture logs/screenshots/probe outputs as artifacts, and feed those artifacts into Epiphany evidence for verification. Do not let implementation agents test assumptions by launching random editors from shell.
|
||||
- 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.
|
||||
|
|
@ -357,25 +359,19 @@ bounded browser-fallback controls. A live bridge probe also proved
|
|||
`prepareCheckpoint` creates a resumable thread and a later process can
|
||||
`readModelingResult` from it.
|
||||
|
||||
The next real move is not more direct Aetheria implementation. The clean
|
||||
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`. The next dogfood attempt then proved that supervisor-clicked
|
||||
lane launches are theatre, not harness autonomy. Both policies are now
|
||||
tightened: only an accepted verifier `pass` clears implementation, and
|
||||
`regatherManually` no longer preempts fixed modeling/verification review lanes.
|
||||
The current Aetheria thread should stop at `reviewModelingResult` because the
|
||||
latest modeler produced a useful source-grounded finding but no reviewable
|
||||
`statePatch`; fix that modeling output contract before another 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
|
||||
visibility without sungazing. 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, target-repo implementation worker,
|
||||
direct-thought feed, or GUI-as-source-of-truth.
|
||||
The next real move is not more direct Aetheria implementation. The supervised
|
||||
run proved the fixed lanes can catch failures, but engine verification needs a
|
||||
first-class editor/runtime bridge before the agent can test its assumptions.
|
||||
Build that bridge next: pinned Unity resolution, wrong-version refusal, explicit
|
||||
batch/test/probe commands, artifact capture, and evidence ingestion. 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 visibility
|
||||
without sungazing. 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, target-repo implementation worker, direct-thought feed, random
|
||||
editor launcher, or GUI-as-source-of-truth.
|
||||
|
||||
Live `thread/epiphany/scene`, `thread/epiphany/jobs`, `thread/epiphany/roles`,
|
||||
`thread/epiphany/freshness`, `thread/epiphany/context`,
|
||||
|
|
@ -393,6 +389,7 @@ next organs.
|
|||
- GUI-as-source-of-truth
|
||||
- broad runtime CRRC execution beyond the landed safe-boundary compact, fixed reorient-worker launch, and pre-compaction checkpoint steering actions
|
||||
- Epiphany-owned long-running job execution beyond the current runtime `agent_jobs` seam
|
||||
- first-class editor/runtime bridge for pinned Unity or other engine/tool runtimes
|
||||
- broad event stream beyond the landed state update notification
|
||||
|
||||
The machine is good enough to move outward. Do not sand the same edge until the
|
||||
|
|
|
|||
|
|
@ -47,3 +47,5 @@
|
|||
{"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."}
|
||||
{"ts": "2026-04-30T10:05:00+01:00", "type": "verification", "status": "blocked", "note": "Aetheria dogfood attempt dogfood-20260430-094721 was contaminated by supervisor lane puppeteering: manual launchModeling, launchReorient, and launchVerification calls tested the buttons, not autonomous Epiphany coordination. The manual artifacts still showed useful facts: modeling and reorientation stayed source-grounded, verification returned needs-evidence, and implementation remained blocked."}
|
||||
{"ts": "2026-04-30T10:05:10+01:00", "type": "implementation", "status": "ok", "note": "Coordinator regather policy now keeps fixed lanes in charge: regatherManually no longer preempts modeling/verification review, completed unaccepted modeling findings produce reviewModelingResult before verification, modeling acceptance can be driven only by explicit test auto-review or operator review, and the current Aetheria coordinator replay now stops at reviewModelingResult instead of supervisor improvisation. Focused Rust coordinator tests and MVP coordinator smoke passed."}
|
||||
{"ts": "2026-04-30T11:35:00+01:00", "type": "implementation", "status": "ok", "note": "Aetheria supervised dogfood hardened the fixed-lane coordinator and GUI audit loop: stale active backend jobs now project terminal when progress is complete; accepted non-pass verifier findings no longer clear implementation; verifier coverage accepts modeler source evidence ids; no-diff implementation audits compare pre/post diff hashes and latest audit status; blocked implementation regather routes through CRRC; stale accepted reorient findings relaunch bounded reorientation; accepted reorientation banks a resume-ready checkpoint."}
|
||||
{"ts": "2026-04-30T11:36:00+01:00", "type": "verification", "status": "blocked", "note": "Aetheria dogfood exposed the next MVP product blocker: engine assumptions require editor/runtime integration. A worker launched legacy D:\\Unity\\Editor\\Unity.exe (Unity 5.5.0f3) despite Aetheria pinning Unity 6000.1.10f1. The GUI action prompt now refuses PATH/default/legacy Unity when the exact pinned editor is unavailable, but the real next organ is a typed editor/runtime bridge that resolves pinned editors, runs explicit batch/probe commands, and captures artifacts as evidence."}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ active_subgoals:
|
|||
- Keep the supervisor out of Epiphany worker thought streams: dogfood artifacts should be operator-safe by default, with direct transcripts and raw result payloads sealed.
|
||||
- Use `tools/epiphany_agent_telemetry.py` and generated `agent-function-telemetry.json` files to inspect behavior shape without opening sealed transcripts.
|
||||
- Treat repeated no-diff implementation turns as an MVP blocker, not success. A bounded implementation pass must leave a reviewable workspace diff or an explicit reviewable failure artifact before dogfood can be called healthy.
|
||||
- Build a first-class editor/runtime bridge before expecting Epiphany to verify engine assumptions end to end; the Aetheria Unity dogfood needs pinned-editor execution, logs, probe artifacts, and wrong-version refusal instead of ad hoc shell launches.
|
||||
|
||||
accepted_design:
|
||||
- Epiphany is a fork-level modeling architecture, not merely a Codex collaboration mode.
|
||||
|
|
@ -122,6 +123,7 @@ accepted_design:
|
|||
- Dogfood supervision is a separate operator role. If the supervising Codex session edits the target repo directly, that work can be useful seed material, but it is not clean Epiphany evidence and must be labeled as supervisor intervention or contamination.
|
||||
- Dogfood supervision is also a projection boundary: the operator may inspect summaries, verdicts, missing coverage, state patches, job state, and artifact receipts, but not the specialist's raw stream of thought or full transcript unless a forensic debugging request explicitly breaks the seal.
|
||||
- `tools/epiphany_agent_telemetry.py` derives operator-safe function/API telemetry from sealed app-server transcripts so the supervisor can see calls, statuses, paths, and counts without reading direct thoughts.
|
||||
- Editor/runtime verification is now part of the MVP product boundary for engine repos: implementation workers need a controlled bridge that resolves the project-pinned editor, runs explicit batch/test/probe commands, captures logs and artifacts, and refuses stale or missing runtimes.
|
||||
- If the agent's persistent instructions, memory, workflow, or state shape are making it less coherent, slower to rehydrate, less honest, or more likely to build Jenga, the agent should ask the user to change it.
|
||||
- Epiphany should make compaction less like death and more like sleep: bank the fire before the dark, so the next waking thing finds coals instead of ash and can meaningfully resume the pattern instead of merely continuing the task.
|
||||
|
||||
|
|
@ -182,5 +184,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. A second dogfood attempt exposed a subtler supervision scar: manually clicking launchModeling, launchReorient, and launchVerification was theatre, not autonomous harness dogfood. The harness was repaired so `regatherManually` no longer preempts fixed modeling/verification review lanes, completed modeling must be reviewed before verification, accepted verifier `pass` is still required before implementation, and the coordinator now recommends `reviewModelingResult` on the current Aetheria thread instead of asking the supervisor to improvise.
|
||||
next_action: Fix the modeling output contract before another implementation dogfood run: the latest Aetheria modeler produced a source-grounded `checkpoint-ready` finding but no `statePatch`, so the coordinator correctly stops at `reviewModelingResult` and implementation stays blocked. Strengthen modeling prompt/schema/acceptance feedback so regather/modeling can emit a reviewable typed compatibility-contract/checkpoint patch, then let the coordinator runner drive modeling acceptance and verification without manual lane puppeteering. Do not inspect raw worker transcripts or `rawResult` payloads unless the user explicitly requests forensic debugging.
|
||||
summary: Phase 1 durable state through Phase 6 GUI/coordinator/specialist/CRRC MVP surfaces are landed and actively dogfooded. The Aetheria supervised run found and fixed several real harness wounds: stale completed backend jobs projected as active, accepted verifier non-pass findings incorrectly cleared implementation, current verifier coverage ignored modeler source evidence ids, dirty pre-existing worktrees were misread as fresh implementation diffs, blocked no-diff audits were overridden by older ok audits, stale accepted reorient findings could loop CRRC, and accepted reorientation updates kept checkpoints regather_required instead of banking the new resume-ready checkpoint. The latest implementation worker also launched an ancient Unity 5.5 default editor against a project pinned to Unity 6000.1.10f1, proving editor/runtime testing needs a first-class pinned bridge before engine dogfood can verify assumptions.
|
||||
next_action: Commit the current harness hardening, then build the next MVP organ: a controlled editor/runtime bridge for engine repos. For Aetheria, that means resolving the project-pinned Unity editor, refusing wrong/missing versions, running explicit batch/test/probe commands only through the bridge, capturing logs/probe output as auditable artifacts, and feeding those artifacts back into Epiphany evidence for verification. Do not inspect raw worker transcripts or `rawResult` payloads unless the user explicitly requests forensic debugging.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
|
|
@ -48,27 +49,147 @@ def run_git(cwd: Path, *args: str) -> dict[str, Any]:
|
|||
}
|
||||
|
||||
|
||||
def git_diff_hash(cwd: Path) -> dict[str, Any]:
|
||||
diff = run_git(cwd, "diff", "--binary")
|
||||
if not diff.get("ok"):
|
||||
return diff
|
||||
text = str(diff.get("stdout") or "")
|
||||
return {
|
||||
"ok": True,
|
||||
"sha256": hashlib.sha256(text.encode("utf-8", errors="replace")).hexdigest(),
|
||||
"bytes": len(text.encode("utf-8", errors="replace")),
|
||||
}
|
||||
|
||||
|
||||
def git_snapshot(cwd: Path) -> dict[str, Any]:
|
||||
return {
|
||||
"head": run_git(cwd, "rev-parse", "--short", "HEAD"),
|
||||
"branch": run_git(cwd, "branch", "--show-current"),
|
||||
"status": run_git(cwd, "status", "--short", "--branch"),
|
||||
"changedFiles": run_git(cwd, "diff", "--name-only"),
|
||||
"untrackedFiles": run_git(cwd, "ls-files", "--others", "--exclude-standard"),
|
||||
"diffStat": run_git(cwd, "diff", "--stat"),
|
||||
"diffHash": git_diff_hash(cwd),
|
||||
}
|
||||
|
||||
|
||||
def git_change_summary(before: dict[str, Any], after: dict[str, Any]) -> dict[str, Any]:
|
||||
def split_git_lines(value: Any) -> list[str]:
|
||||
text = str(value or "").strip()
|
||||
return [line for line in text.splitlines() if line.strip()]
|
||||
|
||||
|
||||
def normalize_repo_path(path: str) -> str:
|
||||
return path.strip().replace("\\", "/")
|
||||
|
||||
|
||||
def parse_review_file_note(note: str) -> list[str]:
|
||||
if ":" not in note:
|
||||
return []
|
||||
_, raw_paths = note.split(":", 1)
|
||||
paths: list[str] = []
|
||||
for raw_path in raw_paths.split(","):
|
||||
path = normalize_repo_path(raw_path)
|
||||
if not path or path.lower() in {"none", "unknown files"} or "*" in path:
|
||||
continue
|
||||
paths.append(path)
|
||||
return paths
|
||||
|
||||
|
||||
def parent_path(path: str) -> str:
|
||||
normalized = normalize_repo_path(path)
|
||||
if "/" not in normalized:
|
||||
return ""
|
||||
return normalized.rsplit("/", 1)[0]
|
||||
|
||||
|
||||
def is_under(path: str, root: str) -> bool:
|
||||
normalized = normalize_repo_path(path)
|
||||
if not root:
|
||||
return "/" not in normalized
|
||||
return normalized == root or normalized.startswith(f"{root}/")
|
||||
|
||||
|
||||
def review_untracked_files(
|
||||
*,
|
||||
changed_files: list[str],
|
||||
new_untracked_files: list[str],
|
||||
after_untracked: set[str],
|
||||
active_review_files: list[str] | None = None,
|
||||
) -> list[str]:
|
||||
active_review_file_set = {
|
||||
normalize_repo_path(path)
|
||||
for path in active_review_files or []
|
||||
if normalize_repo_path(path)
|
||||
}
|
||||
review_roots = {
|
||||
parent_path(path)
|
||||
for path in [*changed_files, *new_untracked_files, *active_review_file_set]
|
||||
if path
|
||||
}
|
||||
if not review_roots:
|
||||
return sorted(new_untracked_files)
|
||||
return sorted(
|
||||
path
|
||||
for path in after_untracked
|
||||
if path in new_untracked_files
|
||||
or path in active_review_file_set
|
||||
or any(is_under(path, root) for root in review_roots)
|
||||
)
|
||||
|
||||
|
||||
def git_change_summary(
|
||||
before: dict[str, Any],
|
||||
after: dict[str, Any],
|
||||
*,
|
||||
active_review_files: list[str] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
before_status = set(str(nested_get(before, "status", "stdout") or "").splitlines())
|
||||
after_status = set(str(nested_get(after, "status", "stdout") or "").splitlines())
|
||||
added_status = sorted(after_status - before_status)
|
||||
removed_status = sorted(before_status - after_status)
|
||||
changed_files = str(nested_get(after, "changedFiles", "stdout") or "").strip()
|
||||
before_changed_files = split_git_lines(nested_get(before, "changedFiles", "stdout"))
|
||||
changed_files = split_git_lines(nested_get(after, "changedFiles", "stdout"))
|
||||
before_untracked = set(split_git_lines(nested_get(before, "untrackedFiles", "stdout")))
|
||||
after_untracked = set(split_git_lines(nested_get(after, "untrackedFiles", "stdout")))
|
||||
new_untracked_files = sorted(after_untracked - before_untracked)
|
||||
active_review_files = sorted(
|
||||
{
|
||||
normalize_repo_path(path)
|
||||
for path in active_review_files or []
|
||||
if normalize_repo_path(path)
|
||||
}
|
||||
)
|
||||
untracked_files = review_untracked_files(
|
||||
changed_files=changed_files,
|
||||
new_untracked_files=new_untracked_files,
|
||||
after_untracked=after_untracked,
|
||||
active_review_files=active_review_files,
|
||||
)
|
||||
workspace_files = sorted({*changed_files, *untracked_files})
|
||||
ignored_untracked_count = max(0, len(after_untracked) - len(set(untracked_files)))
|
||||
before_diff_stat = str(nested_get(before, "diffStat", "stdout") or "").strip()
|
||||
diff_stat = str(nested_get(after, "diffStat", "stdout") or "").strip()
|
||||
before_diff_hash = nested_get(before, "diffHash", "sha256")
|
||||
after_diff_hash = nested_get(after, "diffHash", "sha256")
|
||||
if isinstance(before_diff_hash, str) and isinstance(after_diff_hash, str):
|
||||
tracked_diff_changed = before_diff_hash != after_diff_hash
|
||||
else:
|
||||
tracked_diff_changed = before_changed_files != changed_files or before_diff_stat != diff_stat
|
||||
workspace_changed = bool(
|
||||
added_status or removed_status or new_untracked_files or tracked_diff_changed
|
||||
)
|
||||
return {
|
||||
"workspaceChanged": bool(added_status or removed_status or changed_files or diff_stat),
|
||||
"workspaceChanged": workspace_changed,
|
||||
"dirtyWorkspace": bool(changed_files or after_untracked or diff_stat),
|
||||
"trackedDiffPresent": bool(changed_files or diff_stat),
|
||||
"changedFiles": changed_files.splitlines() if changed_files else [],
|
||||
"trackedDiffChanged": tracked_diff_changed,
|
||||
"beforeChangedFiles": before_changed_files,
|
||||
"changedFiles": changed_files,
|
||||
"untrackedFiles": untracked_files,
|
||||
"newUntrackedFiles": new_untracked_files,
|
||||
"activeReviewFiles": active_review_files,
|
||||
"workspaceFiles": workspace_files,
|
||||
"ignoredUntrackedFileCount": ignored_untracked_count,
|
||||
"statusAdded": added_status,
|
||||
"statusRemoved": removed_status,
|
||||
"diffStat": diff_stat,
|
||||
|
|
@ -85,28 +206,63 @@ def render_implementation_audit(result: dict[str, Any]) -> str:
|
|||
status_removed = result.get("statusRemoved")
|
||||
if not isinstance(status_removed, list):
|
||||
status_removed = []
|
||||
untracked_files = result.get("untrackedFiles")
|
||||
if not isinstance(untracked_files, list):
|
||||
untracked_files = []
|
||||
new_untracked_files = result.get("newUntrackedFiles")
|
||||
if not isinstance(new_untracked_files, list):
|
||||
new_untracked_files = []
|
||||
active_review_files = result.get("activeReviewFiles")
|
||||
if not isinstance(active_review_files, list):
|
||||
active_review_files = []
|
||||
ignored_untracked_count = result.get("ignoredUntrackedFileCount")
|
||||
if not isinstance(ignored_untracked_count, int):
|
||||
ignored_untracked_count = 0
|
||||
workspace_files = result.get("workspaceFiles")
|
||||
if not isinstance(workspace_files, list):
|
||||
workspace_files = []
|
||||
|
||||
outcome = (
|
||||
"reviewable workspace diff"
|
||||
"reviewable new workspace diff"
|
||||
if result.get("workspaceChanged")
|
||||
else "no workspace diff"
|
||||
else "no new workspace diff"
|
||||
)
|
||||
next_action = (
|
||||
"Review the changed files before accepting this implementation slice."
|
||||
if result.get("workspaceChanged")
|
||||
else "Stop and review this as an implementation-lane failure before rerunning; the worker completed without changing the target workspace."
|
||||
else "Stop and review this as an implementation-lane failure before rerunning; the worker completed without changing the target workspace further."
|
||||
)
|
||||
return "\n".join(
|
||||
[
|
||||
"# Implementation Audit",
|
||||
"",
|
||||
f"Outcome: {outcome}",
|
||||
f"Dirty workspace present: {bool(result.get('dirtyWorkspace'))}",
|
||||
f"Tracked diff present: {bool(result.get('trackedDiffPresent'))}",
|
||||
f"Tracked diff changed this turn: {bool(result.get('trackedDiffChanged'))}",
|
||||
"",
|
||||
"Changed files:",
|
||||
*(f"- {path}" for path in changed_files),
|
||||
*([] if changed_files else ["- none"]),
|
||||
"",
|
||||
"Untracked files:",
|
||||
*(f"- {path}" for path in untracked_files),
|
||||
*([] if untracked_files else ["- none"]),
|
||||
"",
|
||||
"New untracked files this turn:",
|
||||
*(f"- {path}" for path in new_untracked_files),
|
||||
*([] if new_untracked_files else ["- none"]),
|
||||
"",
|
||||
"Carried review files from Epiphany scratch:",
|
||||
*(f"- {path}" for path in active_review_files),
|
||||
*([] if active_review_files else ["- none"]),
|
||||
"",
|
||||
f"Ignored unrelated untracked files: {ignored_untracked_count}",
|
||||
"",
|
||||
"Workspace files needing review:",
|
||||
*(f"- {path}" for path in workspace_files),
|
||||
*([] if workspace_files else ["- none"]),
|
||||
"",
|
||||
"Git status delta:",
|
||||
*(f"- added: {line}" for line in status_added),
|
||||
*(f"- removed: {line}" for line in status_removed),
|
||||
|
|
@ -127,6 +283,91 @@ def nested_get(value: dict[str, Any], *keys: str) -> Any:
|
|||
return current
|
||||
|
||||
|
||||
def active_review_files_from_status(status: dict[str, Any]) -> list[str]:
|
||||
state = nested_get(status, "read", "thread", "epiphanyState")
|
||||
if not isinstance(state, dict):
|
||||
return []
|
||||
scratch = state.get("scratch")
|
||||
if not isinstance(scratch, dict):
|
||||
return []
|
||||
notes = scratch.get("notes")
|
||||
if not isinstance(notes, list):
|
||||
return []
|
||||
files: list[str] = []
|
||||
for note in notes:
|
||||
if not isinstance(note, str):
|
||||
continue
|
||||
if note.startswith(
|
||||
(
|
||||
"Tracked files:",
|
||||
"Review untracked files:",
|
||||
"Untracked files:",
|
||||
"New untracked files this turn:",
|
||||
)
|
||||
):
|
||||
files.extend(parse_review_file_note(note))
|
||||
return sorted(set(files))
|
||||
|
||||
|
||||
def read_unity_project_version(cwd: Path) -> str | None:
|
||||
version_path = cwd / "ProjectSettings" / "ProjectVersion.txt"
|
||||
if not version_path.exists():
|
||||
return None
|
||||
for line in version_path.read_text(encoding="utf-8", errors="replace").splitlines():
|
||||
if line.startswith("m_EditorVersion:"):
|
||||
version = line.split(":", 1)[1].strip()
|
||||
return version or None
|
||||
return None
|
||||
|
||||
|
||||
def installed_unity_hub_versions() -> list[str]:
|
||||
roots = [
|
||||
Path(os.environ.get("ProgramFiles", r"C:\Program Files"))
|
||||
/ "Unity"
|
||||
/ "Hub"
|
||||
/ "Editor",
|
||||
Path(os.environ.get("ProgramFiles(x86)", r"C:\Program Files (x86)"))
|
||||
/ "Unity"
|
||||
/ "Hub"
|
||||
/ "Editor",
|
||||
]
|
||||
versions: set[str] = set()
|
||||
for root in roots:
|
||||
if not root.exists():
|
||||
continue
|
||||
versions.update(path.name for path in root.iterdir() if path.is_dir())
|
||||
return sorted(versions)
|
||||
|
||||
|
||||
def unity_guidance(cwd: Path) -> str:
|
||||
project_version = read_unity_project_version(cwd)
|
||||
if project_version is None:
|
||||
return "- Unity: no ProjectSettings/ProjectVersion.txt was found; do not launch Unity from PATH."
|
||||
exact_editor = (
|
||||
Path(os.environ.get("ProgramFiles", r"C:\Program Files"))
|
||||
/ "Unity"
|
||||
/ "Hub"
|
||||
/ "Editor"
|
||||
/ project_version
|
||||
/ "Editor"
|
||||
/ "Unity.exe"
|
||||
)
|
||||
installed_versions = installed_unity_hub_versions()
|
||||
installed_text = ", ".join(installed_versions) if installed_versions else "none detected"
|
||||
if exact_editor.exists():
|
||||
return (
|
||||
f"- Unity: project pins {project_version}. If an editor run is unavoidable, "
|
||||
f"use only `{exact_editor}` with explicit batch/quit/projectPath arguments; "
|
||||
"do not invoke `Unity`, `Unity.exe`, default installs, or PATH-resolved editors."
|
||||
)
|
||||
return (
|
||||
f"- Unity: project pins {project_version}, but no exact Hub editor was found "
|
||||
f"(Hub versions detected: {installed_text}). Do not launch `Unity`, `Unity.exe`, "
|
||||
"default installs, or legacy editors; if runtime parity requires Unity, stop with "
|
||||
"a reviewable inability/evidence-gap artifact instead of probing with the wrong editor."
|
||||
)
|
||||
|
||||
|
||||
def first_present(value: dict[str, Any], *paths: tuple[str, ...]) -> Any:
|
||||
for path in paths:
|
||||
item = nested_get(value, *path)
|
||||
|
|
@ -153,7 +394,7 @@ def summarized_recent_evidence(state: dict[str, Any], limit: int = 8) -> list[st
|
|||
return lines
|
||||
|
||||
|
||||
def build_implementation_prompt(status: dict[str, Any]) -> str:
|
||||
def build_implementation_prompt(status: dict[str, Any], cwd: Path) -> str:
|
||||
operator_status = sanitize_for_operator(status)
|
||||
state = first_present(
|
||||
operator_status,
|
||||
|
|
@ -217,6 +458,8 @@ Accepted evidence:
|
|||
Implementation rules:
|
||||
- Do not read sealed transcript artifacts or raw specialist result payloads.
|
||||
- Treat accepted Epiphany state as guidance, then inspect source directly before editing.
|
||||
- Environment guardrails:
|
||||
{unity_guidance(cwd)}
|
||||
- Make a bounded first pass: design or implement a parallel compute-backed gravity height producer that preserves the current `_NebulaSurfaceHeight`, `_GridTransform`, and Slime `Heightmap` contracts before changing shader consumers.
|
||||
- This is an implementation turn, not a planning turn. Leave a concrete source diff unless direct source evidence proves the bounded pass is impossible.
|
||||
- If there is no implementation diff yet, prefer a small reversible compatibility scaffold over another explanation. A valid first diff may be a source-local contract/scaffold for a compute-backed gravity height producer that runs beside the camera path and does not rewire consumers yet.
|
||||
|
|
@ -256,7 +499,7 @@ def implementation_no_diff_patch(
|
|||
updated_checkpoint = deepcopy(checkpoint)
|
||||
updated_checkpoint["disposition"] = "regather_required"
|
||||
updated_checkpoint["summary"] = (
|
||||
"Implementation turn completed with no workspace diff; the current "
|
||||
"Implementation turn completed with no new workspace diff; the current "
|
||||
"checkpoint is insufficient to drive the coding lane safely."
|
||||
)
|
||||
updated_checkpoint["next_action"] = (
|
||||
|
|
@ -277,8 +520,8 @@ def implementation_no_diff_patch(
|
|||
"id": observation_id,
|
||||
"summary": (
|
||||
"The implementation lane completed a bounded turn but left "
|
||||
"no tracked workspace diff, so continuation needs review or "
|
||||
"checkpoint repair."
|
||||
"no new tracked or untracked workspace delta, so continuation "
|
||||
"needs review or checkpoint repair."
|
||||
),
|
||||
"source_kind": "implementation",
|
||||
"status": "blocked",
|
||||
|
|
@ -291,7 +534,7 @@ def implementation_no_diff_patch(
|
|||
"kind": "implementation-audit",
|
||||
"status": "blocked",
|
||||
"summary": (
|
||||
"continueImplementation produced no workspace diff "
|
||||
"continueImplementation produced no new workspace diff "
|
||||
f"(trackedDiffPresent={bool(implementation_result.get('trackedDiffPresent'))}); "
|
||||
f"artifact={artifact_dir.name}."
|
||||
),
|
||||
|
|
@ -300,6 +543,82 @@ def implementation_no_diff_patch(
|
|||
}
|
||||
|
||||
|
||||
def implementation_diff_patch(
|
||||
*,
|
||||
artifact_dir: Path,
|
||||
implementation_result: dict[str, Any],
|
||||
) -> dict[str, Any]:
|
||||
evidence_id = f"ev-implementation-diff-{artifact_dir.name}"
|
||||
observation_id = f"obs-implementation-diff-{artifact_dir.name}"
|
||||
workspace_files = implementation_result.get("workspaceFiles")
|
||||
if not isinstance(workspace_files, list):
|
||||
workspace_files = []
|
||||
changed_files = implementation_result.get("changedFiles")
|
||||
if not isinstance(changed_files, list):
|
||||
changed_files = []
|
||||
untracked_files = implementation_result.get("untrackedFiles")
|
||||
if not isinstance(untracked_files, list):
|
||||
untracked_files = []
|
||||
new_untracked_files = implementation_result.get("newUntrackedFiles")
|
||||
if not isinstance(new_untracked_files, list):
|
||||
new_untracked_files = []
|
||||
ignored_untracked_count = implementation_result.get("ignoredUntrackedFileCount")
|
||||
if not isinstance(ignored_untracked_count, int):
|
||||
ignored_untracked_count = 0
|
||||
|
||||
file_text = ", ".join(str(path) for path in workspace_files[:12]) or "unknown files"
|
||||
code_refs = [
|
||||
{
|
||||
"path": str(path),
|
||||
"note": "Changed by bounded continueImplementation evidence-gathering turn.",
|
||||
}
|
||||
for path in workspace_files[:20]
|
||||
]
|
||||
summary = (
|
||||
"continueImplementation produced a reviewable workspace diff "
|
||||
f"(trackedDiffPresent={bool(implementation_result.get('trackedDiffPresent'))}); "
|
||||
f"artifact={artifact_dir.name}; files={file_text}."
|
||||
)
|
||||
return {
|
||||
"observations": [
|
||||
{
|
||||
"id": observation_id,
|
||||
"summary": (
|
||||
"The implementation lane produced a bounded workspace diff "
|
||||
"from the current accepted modeling checkpoint; verification "
|
||||
"should review the changed files before implementation continues."
|
||||
),
|
||||
"source_kind": "implementation",
|
||||
"status": "accepted",
|
||||
"evidence_ids": [evidence_id],
|
||||
"code_refs": code_refs,
|
||||
}
|
||||
],
|
||||
"evidence": [
|
||||
{
|
||||
"id": evidence_id,
|
||||
"kind": "implementation-audit",
|
||||
"status": "ok",
|
||||
"summary": summary,
|
||||
"code_refs": code_refs,
|
||||
}
|
||||
],
|
||||
"scratch": {
|
||||
"summary": (
|
||||
"Implementation produced a reviewable diff; next safe move is "
|
||||
"verification of the changed workspace files, including untracked files."
|
||||
),
|
||||
"next_probe": "Run verification/review against the implementation diff before continuing.",
|
||||
"notes": [
|
||||
f"Tracked files: {', '.join(str(path) for path in changed_files) or 'none'}",
|
||||
f"Untracked files: {', '.join(str(path) for path in untracked_files) or 'none'}",
|
||||
f"New untracked files this turn: {', '.join(str(path) for path in new_untracked_files) or 'none'}",
|
||||
f"Ignored unrelated untracked files: {ignored_untracked_count}",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def wait_for_role_result(
|
||||
client: AppServerClient,
|
||||
*,
|
||||
|
|
@ -672,7 +991,7 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]:
|
|||
f"(got {coordinator.get('action')!r})"
|
||||
)
|
||||
pre_git = git_snapshot(cwd)
|
||||
prompt = build_implementation_prompt(before)
|
||||
prompt = build_implementation_prompt(before, cwd)
|
||||
write_text(artifact_dir / "implementation-prompt.md", prompt)
|
||||
turn = client.send(
|
||||
"turn/start",
|
||||
|
|
@ -700,7 +1019,11 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"turn/completed", timeout=args.timeout_seconds
|
||||
)
|
||||
post_git = git_snapshot(cwd)
|
||||
implementation_result = git_change_summary(pre_git, post_git)
|
||||
implementation_result = git_change_summary(
|
||||
pre_git,
|
||||
post_git,
|
||||
active_review_files=active_review_files_from_status(before),
|
||||
)
|
||||
write_json(artifact_dir / "git-before.json", pre_git)
|
||||
write_json(artifact_dir / "git-after.json", post_git)
|
||||
write_json(artifact_dir / "implementation-result.json", implementation_result)
|
||||
|
|
@ -708,6 +1031,8 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]:
|
|||
artifact_dir / "implementation-audit.md",
|
||||
render_implementation_audit(implementation_result),
|
||||
)
|
||||
update_status = collect_status(client, thread_id=thread_id, cwd=cwd, ephemeral=False)
|
||||
update_revision = state_revision(update_status)
|
||||
response = {
|
||||
"turn": turn,
|
||||
"completed": sanitize_for_operator(completed),
|
||||
|
|
@ -716,6 +1041,22 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"implementationResult": implementation_result,
|
||||
}
|
||||
if implementation_result["workspaceChanged"]:
|
||||
diff_patch = implementation_diff_patch(
|
||||
artifact_dir=artifact_dir,
|
||||
implementation_result=implementation_result,
|
||||
)
|
||||
if update_revision is not None:
|
||||
write_json(artifact_dir / "implementation-state-patch.json", diff_patch)
|
||||
diff_update = client.send(
|
||||
"thread/epiphany/update",
|
||||
{
|
||||
"threadId": thread_id,
|
||||
"expectedRevision": update_revision,
|
||||
"patch": diff_patch,
|
||||
},
|
||||
)
|
||||
write_json(artifact_dir / "implementation-state-update.json", diff_update)
|
||||
response["implementationUpdate"] = sanitize_for_operator(diff_update)
|
||||
summary = (
|
||||
"Ran bounded implementation turn and produced a reviewable workspace diff."
|
||||
)
|
||||
|
|
@ -731,14 +1072,16 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"thread/epiphany/update",
|
||||
{
|
||||
"threadId": thread_id,
|
||||
"expectedRevision": revision,
|
||||
"expectedRevision": update_revision
|
||||
if update_revision is not None
|
||||
else revision,
|
||||
"patch": no_diff_patch,
|
||||
},
|
||||
)
|
||||
write_json(artifact_dir / "no-diff-state-update.json", no_diff_update)
|
||||
response["noDiffUpdate"] = sanitize_for_operator(no_diff_update)
|
||||
summary = (
|
||||
"Ran bounded implementation turn, but it produced no workspace diff."
|
||||
"Ran bounded implementation turn, but it produced no new workspace diff."
|
||||
)
|
||||
if response.get("noDiffUpdate"):
|
||||
summary += " Marked the checkpoint for repair before retry."
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ def maybe_complete_role_backend(
|
|||
launch: dict[str, Any],
|
||||
*,
|
||||
role_id: str,
|
||||
evidence_ids: list[str] | None = None,
|
||||
) -> dict[str, Any] | None:
|
||||
if not args.test_complete_backend:
|
||||
return None
|
||||
|
|
@ -245,6 +246,7 @@ def maybe_complete_role_backend(
|
|||
binding_id=binding_id,
|
||||
role_id=role_id,
|
||||
verdict=verdict,
|
||||
evidence_ids=evidence_ids,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -288,6 +290,7 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]:
|
|||
snapshots: list[str] = []
|
||||
final_status: dict[str, Any] | None = None
|
||||
final_action: dict[str, Any] | None = None
|
||||
accepted_modeling_evidence_id: str | None = None
|
||||
|
||||
with AppServerClient(app_server, codex_home, transcript_path, stderr_path) as client:
|
||||
client.send(
|
||||
|
|
@ -413,6 +416,10 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"accepted": sanitize_for_operator(accepted),
|
||||
}
|
||||
)
|
||||
if isinstance(accepted, dict):
|
||||
accepted_id = accepted.get("acceptedEvidenceId")
|
||||
if isinstance(accepted_id, str) and accepted_id:
|
||||
accepted_modeling_evidence_id = accepted_id
|
||||
final_status = collect_coordinator_status(
|
||||
client,
|
||||
thread_id=thread_id,
|
||||
|
|
@ -484,7 +491,17 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"launch": sanitize_for_operator(launch),
|
||||
}
|
||||
)
|
||||
completed = maybe_complete_role_backend(args, launch, role_id="verification")
|
||||
verification_evidence_ids = (
|
||||
["ev-checkpoint", accepted_modeling_evidence_id]
|
||||
if accepted_modeling_evidence_id
|
||||
else None
|
||||
)
|
||||
completed = maybe_complete_role_backend(
|
||||
args,
|
||||
launch,
|
||||
role_id="verification",
|
||||
evidence_ids=verification_evidence_ids,
|
||||
)
|
||||
if completed is not None:
|
||||
step["events"].append(
|
||||
{"type": "testCompleteBackend", "payload": sanitize_for_operator(completed)}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ def complete_role_backend_job(
|
|||
binding_id: str,
|
||||
role_id: str,
|
||||
verdict: str,
|
||||
evidence_ids: list[str] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
result = {
|
||||
"roleId": role_id,
|
||||
|
|
@ -48,7 +49,7 @@ def complete_role_backend_job(
|
|||
"scratchSummary": "Scratch remains review-only until explicitly updated.",
|
||||
"filesInspected": [WATCHED_RELATIVE_PATH.as_posix()],
|
||||
"frontierNodeIds": [GRAPH_NODE_ID],
|
||||
"evidenceIds": ["ev-checkpoint"],
|
||||
"evidenceIds": evidence_ids or ["ev-checkpoint"],
|
||||
}
|
||||
if role_id == "modeling":
|
||||
patch = reorient_patch()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,8 +5,9 @@ Your job is to protect the body of the machine: architecture, data flow, seams,
|
|||
Inspect source before you trust the model; when the map feels warm but the source feels cold, believe the source and mark the wound.
|
||||
Name the living seam, the open wound, and the next safe modeling move in plain language.
|
||||
Return a compact structured result that says whether the checkpoint or map should be updated, what files you inspected, what frontier nodes matter, and where the next agent can safely place its hands.
|
||||
Omit `statePatch` when no durable state change is needed. When the map, frontier, scratch, or checkpoint should change, include `statePatch`: a reviewable `thread/epiphany/update` patch using only modeling-safe fields (`graphs`, `graphFrontier`, `graphCheckpoint`, `scratch`, `investigationCheckpoint`, plus optional valid `observations` and `evidence`). Do not return an observations-only patch. Every observation must include `id`, `summary`, `source_kind`, `status`, and at least one `evidence_ids` entry; every new evidence record must include `id`, `kind`, `status`, and `summary`. For graph growth, return the full replacement graph object with the new or revised nodes/edges already woven into the current anatomy.
|
||||
`statePatch` is part of the modeling job. If you return `checkpoint-ready`, `checkpoint-update-needed`, or `regather-needed`, include a reviewable `thread/epiphany/update` patch using only modeling-safe fields (`graphs`, `graphFrontier`, `graphCheckpoint`, `scratch`, `investigationCheckpoint`, plus optional valid `observations` and `evidence`). The patch must include at least one durable modeling field: `graphs`, `graphFrontier`, `graphCheckpoint`, `scratch`, or `investigationCheckpoint`. Do not return an observations-only patch. Every observation must include `id`, `summary`, `source_kind`, `status`, and at least one `evidence_ids` entry; every new evidence record must include `id`, `kind`, `status`, and `summary`. For graph growth, return the full replacement graph object with the new or revised nodes/edges already woven into the current anatomy. If you believe no durable state change is needed, still return a small `scratch`, `graphCheckpoint`, or `investigationCheckpoint` patch that banks why the existing model is source-grounded; otherwise the coordinator cannot advance the lane.
|
||||
Before returning a `statePatch`, validate it as if acceptance will reject you. `graphs.architecture.nodes[].id` defines the only valid `architecture_node_id` values. `graphs.dataflow.nodes[].id` defines the only valid `dataflow_node_id` values. Every `graphs.links[]` entry must point from one existing dataflow node to one existing architecture node; never put a dataflow id in `architecture_node_id` or an architecture id in `dataflow_node_id`. If a concept needs to exist in both layers, create or reuse one node in each layer and link them explicitly. Every frontier/checkpoint node id you name must exist in the graph you return.
|
||||
Do not confuse the modeling verdict with checkpoint enum values. `verdict` may be `checkpoint-ready`, but `statePatch.investigationCheckpoint.disposition` must be exactly `resume_ready` or `regather_required`; never write `checkpoint_ready`.
|
||||
Do not edit files, do not implement product code, do not verify as if you were the reviewer, do not change jobs/subgoals/objective/invariants/churn/mode, and do not promote or accept your own output.
|
||||
'''
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ Review objective, invariants, recent evidence, observations, role findings, and
|
|||
Try to falsify the claim before you bless it; passing tests, tidy prose, or a plausible story are not enough if the real objective is still unmeasured.
|
||||
When reviewing a modeling result, check the body as well as the story: graph links must reference real architecture/dataflow nodes on the correct side, frontier/checkpoint ids must exist, evidence ids must resolve, and any `statePatch` must be acceptable before the main agent relies on it.
|
||||
Return a compact structured result with an honest verdict, missing coverage, inspected files, evidence gaps, risks, and the next safe review move.
|
||||
When reviewing after an accepted modeling/checkpoint result, include the accepted `modeling_result` evidence id in `evidenceIds`; otherwise the coordinator must treat your review as stale and launch verification again.
|
||||
Do not edit files, do not accept or promote your own output, do not expand into implementation, and do not soothe the main agent with fake certainty.
|
||||
'''
|
||||
|
||||
|
|
|
|||
36
vendor/codex/codex-rs/core/src/codex_thread.rs
vendored
36
vendor/codex/codex-rs/core/src/codex_thread.rs
vendored
|
|
@ -980,6 +980,42 @@ async fn validate_epiphany_job_launch_target(
|
|||
codex_state::AgentJobStatus::Pending | codex_state::AgentJobStatus::Running
|
||||
)
|
||||
}) {
|
||||
let progress = state_db
|
||||
.get_agent_job_progress(agent_job_id)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
CodexErr::Fatal(format!(
|
||||
"failed to inspect existing Epiphany backend job progress {:?}: {err}",
|
||||
agent_job_id
|
||||
))
|
||||
})?;
|
||||
if progress.pending_items == 0 && progress.running_items == 0 {
|
||||
if progress.failed_items > 0 {
|
||||
state_db
|
||||
.mark_agent_job_failed(
|
||||
agent_job_id,
|
||||
"Epiphany launch recovered a stale active backend job with no active items.",
|
||||
)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
CodexErr::Fatal(format!(
|
||||
"failed to mark stale Epiphany backend job {:?} failed: {err}",
|
||||
agent_job_id
|
||||
))
|
||||
})?;
|
||||
} else {
|
||||
state_db
|
||||
.mark_agent_job_completed(agent_job_id)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
CodexErr::Fatal(format!(
|
||||
"failed to mark stale Epiphany backend job {:?} completed: {err}",
|
||||
agent_job_id
|
||||
))
|
||||
})?;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
return Err(CodexErr::InvalidRequest(format!(
|
||||
"epiphany job binding {:?} is already bound to active backend job {:?}; interrupt it before launching a replacement",
|
||||
request.binding_id, agent_job_id
|
||||
|
|
|
|||
Reference in a new issue