Surface environment readiness in GUI
This commit is contained in:
parent
a0d798c5f8
commit
664f2c2598
9 changed files with 271 additions and 23 deletions
|
|
@ -144,6 +144,43 @@
|
|||
}
|
||||
},
|
||||
"artifacts": [
|
||||
{
|
||||
"name": "runtime/unity-inspect-sample",
|
||||
"path": "E:\\Projects\\EpiphanyAgent\\.epiphany-gui\\runtime\\unity-inspect-sample",
|
||||
"files": [
|
||||
"unity-bridge-inspection.md",
|
||||
"unity-bridge-summary.json"
|
||||
],
|
||||
"summaryPath": "E:\\Projects\\EpiphanyAgent\\.epiphany-gui\\runtime\\unity-inspect-sample\\unity-bridge-summary.json",
|
||||
"runtimeAudit": {
|
||||
"resultPath": "E:\\Projects\\EpiphanyAgent\\.epiphany-gui\\runtime\\unity-inspect-sample\\unity-bridge-summary.json",
|
||||
"status": "missingEditor",
|
||||
"projectPath": "E:\\Projects\\Aetheria-Economy",
|
||||
"projectVersion": "6000.1.10f1",
|
||||
"note": "Project pins Unity 6000.1.10f1, but no exact editor was found.",
|
||||
"editorBridge": {
|
||||
"exists": true,
|
||||
"path": "E:\\Projects\\Aetheria-Economy\\Assets\\Editor\\Epiphany\\EpiphanyEditorBridge.cs",
|
||||
"relativePath": "Assets/Editor/Epiphany/EpiphanyEditorBridge.cs",
|
||||
"executeMethod": "GameCult.Epiphany.Unity.EpiphanyEditorBridge.RunProbe"
|
||||
},
|
||||
"installedEditors": [
|
||||
{
|
||||
"version": "6000.4.2f1",
|
||||
"editorPath": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe"
|
||||
}
|
||||
],
|
||||
"candidatePaths": [
|
||||
"C:\\Program Files\\Unity\\Hub\\Editor\\6000.1.10f1\\Editor\\Unity.exe",
|
||||
"C:\\Program Files (x86)\\Unity\\Hub\\Editor\\6000.1.10f1\\Editor\\Unity.exe"
|
||||
],
|
||||
"searchRoots": [
|
||||
"C:\\Program Files\\Unity\\Hub\\Editor",
|
||||
"C:\\Program Files (x86)\\Unity\\Hub\\Editor"
|
||||
]
|
||||
},
|
||||
"modifiedMillis": 1777475848000
|
||||
},
|
||||
{
|
||||
"name": "mvp-loop-selfdogfood-vanilla2-20260429",
|
||||
"path": "E:\\Projects\\EpiphanyAgent\\.epiphany-dogfood\\mvp-loop-selfdogfood-vanilla2-20260429",
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ async function smokeViewport(browser, viewport, screenshotPath) {
|
|||
await page.goto(url, { waitUntil: "networkidle" });
|
||||
await page.getByRole("heading", { name: "Operator Console" }).waitFor();
|
||||
await page.getByText("prepareCheckpoint").waitFor();
|
||||
await page.getByRole("heading", { name: "Environment" }).waitFor();
|
||||
await page.getByText("Unity Editor").waitFor();
|
||||
await page.getByText("Rider").waitFor();
|
||||
await page.getByText("Role Lanes").waitFor();
|
||||
await page.getByText("Artifact Bundles").waitFor();
|
||||
await page.getByRole("button", { name: "Prepare Checkpoint" }).waitFor();
|
||||
|
|
|
|||
|
|
@ -51,8 +51,30 @@ struct ImplementationAudit {
|
|||
struct RuntimeAudit {
|
||||
result_path: String,
|
||||
status: String,
|
||||
project_path: Option<String>,
|
||||
project_version: Option<String>,
|
||||
editor_path: Option<String>,
|
||||
note: Option<String>,
|
||||
editor_bridge: Option<EditorBridgeAudit>,
|
||||
installed_editors: Vec<InstalledUnityEditor>,
|
||||
candidate_paths: Vec<String>,
|
||||
search_roots: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct EditorBridgeAudit {
|
||||
exists: bool,
|
||||
path: Option<String>,
|
||||
relative_path: Option<String>,
|
||||
execute_method: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct InstalledUnityEditor {
|
||||
version: Option<String>,
|
||||
editor_path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
|
|
@ -448,22 +470,70 @@ fn read_runtime_audit(root: &Path) -> Option<RuntimeAudit> {
|
|||
let text = fs::read_to_string(&result_path).ok()?;
|
||||
let value: Value = serde_json::from_str(&text).ok()?;
|
||||
let status = value.get("status").and_then(Value::as_str)?.to_string();
|
||||
let project_version = value
|
||||
.get("projectVersion")
|
||||
.and_then(Value::as_str)
|
||||
.map(ToString::to_string);
|
||||
let editor_path = value
|
||||
.get("editorPath")
|
||||
.and_then(Value::as_str)
|
||||
.map(ToString::to_string);
|
||||
Some(RuntimeAudit {
|
||||
result_path: result_path.display().to_string(),
|
||||
status,
|
||||
project_version,
|
||||
editor_path,
|
||||
project_path: json_optional_string(&value, "projectPath"),
|
||||
project_version: json_optional_string(&value, "projectVersion"),
|
||||
editor_path: json_optional_string(&value, "editorPath"),
|
||||
note: json_optional_string(&value, "note"),
|
||||
editor_bridge: read_editor_bridge(&value),
|
||||
installed_editors: read_installed_editors(&value),
|
||||
candidate_paths: read_string_array(&value, "candidatePaths"),
|
||||
search_roots: read_string_array(&value, "searchRoots"),
|
||||
})
|
||||
}
|
||||
|
||||
fn json_optional_string(value: &Value, key: &str) -> Option<String> {
|
||||
value
|
||||
.get(key)
|
||||
.and_then(Value::as_str)
|
||||
.map(ToString::to_string)
|
||||
}
|
||||
|
||||
fn read_string_array(value: &Value, key: &str) -> Vec<String> {
|
||||
value
|
||||
.get(key)
|
||||
.and_then(Value::as_array)
|
||||
.map(|items| {
|
||||
items
|
||||
.iter()
|
||||
.filter_map(Value::as_str)
|
||||
.map(ToString::to_string)
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn read_editor_bridge(value: &Value) -> Option<EditorBridgeAudit> {
|
||||
let bridge = value.get("editorBridge")?;
|
||||
Some(EditorBridgeAudit {
|
||||
exists: bridge
|
||||
.get("exists")
|
||||
.and_then(Value::as_bool)
|
||||
.unwrap_or(false),
|
||||
path: json_optional_string(bridge, "path"),
|
||||
relative_path: json_optional_string(bridge, "relativePath"),
|
||||
execute_method: json_optional_string(bridge, "executeMethod"),
|
||||
})
|
||||
}
|
||||
|
||||
fn read_installed_editors(value: &Value) -> Vec<InstalledUnityEditor> {
|
||||
value
|
||||
.get("installedEditors")
|
||||
.and_then(Value::as_array)
|
||||
.map(|items| {
|
||||
items
|
||||
.iter()
|
||||
.map(|item| InstalledUnityEditor {
|
||||
version: json_optional_string(item, "version"),
|
||||
editor_path: json_optional_string(item, "editorPath"),
|
||||
})
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn existing_path(root: &Path, name: &str) -> Option<String> {
|
||||
let path = root.join(name);
|
||||
path.exists().then(|| path.display().to_string())
|
||||
|
|
|
|||
|
|
@ -269,6 +269,11 @@ export function App() {
|
|||
const canAcceptVerification = text(roleResults?.verification?.status).toLowerCase() === "completed";
|
||||
const canAcceptReorient = text(reorientResult?.status).toLowerCase() === "completed";
|
||||
const canContinueImplementation = text(coordinator.action).toLowerCase() === "continueimplementation";
|
||||
const unityBridge = latestRuntimeAudit?.editorBridge;
|
||||
const installedEditors = latestRuntimeAudit?.installedEditors ?? [];
|
||||
const candidatePaths = latestRuntimeAudit?.candidatePaths ?? [];
|
||||
const searchRoots = latestRuntimeAudit?.searchRoots ?? [];
|
||||
const unityBridgeReady = latestRuntimeAudit?.status === "ready" && unityBridge?.exists === true;
|
||||
|
||||
return (
|
||||
<main className="shell">
|
||||
|
|
@ -393,6 +398,58 @@ export function App() {
|
|||
</section>
|
||||
)}
|
||||
|
||||
<section className="sectionBand">
|
||||
<SectionHeader title="Environment" icon={<Database size={18} />} />
|
||||
<div className="environmentGrid">
|
||||
<article className="environmentCard">
|
||||
<div className="cardTopline">
|
||||
<h3>Unity Editor</h3>
|
||||
<Pill tone={unityBridgeReady ? "ok" : statusClass(latestRuntimeAudit?.status)}>
|
||||
{unityBridgeReady ? "bridge ready" : text(latestRuntimeAudit?.status, "unknown")}
|
||||
</Pill>
|
||||
</div>
|
||||
<dl className="facts environmentFacts">
|
||||
<div><dt>Project</dt><dd>{text(latestRuntimeAudit?.projectVersion)}</dd></div>
|
||||
<div><dt>Editor</dt><dd>{text(latestRuntimeAudit?.editorPath, "missing")}</dd></div>
|
||||
<div><dt>Package</dt><dd>{unityBridge?.exists ? "present" : "missing"}</dd></div>
|
||||
<div><dt>Method</dt><dd>{text(unityBridge?.executeMethod)}</dd></div>
|
||||
</dl>
|
||||
{latestRuntimeAudit?.note && <p className="environmentNote">{latestRuntimeAudit.note}</p>}
|
||||
<PathList title="Installed" items={installedEditors.map((editor) => `${text(editor.version)} ${text(editor.editorPath)}`)} />
|
||||
<PathList title="Candidates" items={candidatePaths} />
|
||||
</article>
|
||||
|
||||
<article className="environmentCard">
|
||||
<div className="cardTopline">
|
||||
<h3>Rider</h3>
|
||||
<Pill tone="neutral">pending</Pill>
|
||||
</div>
|
||||
<dl className="facts environmentFacts">
|
||||
<div><dt>Workspace</dt><dd>{text(request.cwd ?? snapshot?.repoRoot)}</dd></div>
|
||||
<div><dt>Plugin</dt><dd>not wired</dd></div>
|
||||
<div><dt>Diagnostics</dt><dd>pending</dd></div>
|
||||
<div><dt>Diff view</dt><dd>pending</dd></div>
|
||||
</dl>
|
||||
<p className="environmentNote">Bridge pending.</p>
|
||||
</article>
|
||||
|
||||
<article className="environmentCard">
|
||||
<div className="cardTopline">
|
||||
<h3>Artifacts</h3>
|
||||
<Pill tone={latestRuntimeArtifact ? "ok" : "neutral"}>{latestRuntimeArtifact ? "available" : "none"}</Pill>
|
||||
</div>
|
||||
<dl className="facts environmentFacts">
|
||||
<div><dt>Runtime bundle</dt><dd>{text(latestRuntimeArtifact?.name)}</dd></div>
|
||||
<div><dt>Files</dt><dd>{text(latestRuntimeArtifact?.files.length)}</dd></div>
|
||||
<div><dt>Summary</dt><dd>{text(latestRuntimeArtifact?.summaryPath)}</dd></div>
|
||||
<div><dt>Project path</dt><dd>{text(latestRuntimeAudit?.projectPath)}</dd></div>
|
||||
</dl>
|
||||
<PathList title="Search roots" items={searchRoots} />
|
||||
<code title={latestRuntimeArtifact?.path}>{text(latestRuntimeArtifact?.path)}</code>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="statusGrid" aria-label="Coordinator summary">
|
||||
<Panel title="Recommendation" icon={<ClipboardCheck size={18} />}>
|
||||
<div className={`actionBanner ${statusClass(coordinator.action ?? crrc.action)}`}>
|
||||
|
|
@ -558,6 +615,19 @@ function ArtifactOutcome({ artifact }: { artifact: ArtifactBundle }) {
|
|||
);
|
||||
}
|
||||
|
||||
function PathList({ title, items }: { title: string; items: string[] }) {
|
||||
if (!items.length) return null;
|
||||
return (
|
||||
<div className="pathList">
|
||||
<strong>{title}</strong>
|
||||
{items.slice(0, 4).map((item) => (
|
||||
<code key={item} title={item}>{item}</code>
|
||||
))}
|
||||
{items.length > 4 && <span>{items.length - 4} more</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function EmptyState({ label }: { label: string }) {
|
||||
return <p className="emptyState">{label}</p>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,10 @@ input {
|
|||
padding: 12px;
|
||||
}
|
||||
|
||||
.notice span {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.dangerNotice {
|
||||
border-color: #d9b1a4;
|
||||
color: #6b2418;
|
||||
|
|
@ -185,9 +189,12 @@ input {
|
|||
}
|
||||
|
||||
.notice code {
|
||||
display: inline;
|
||||
max-width: min(620px, 70vw);
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: bottom;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.statusGrid {
|
||||
|
|
@ -304,6 +311,48 @@ dd {
|
|||
gap: 12px;
|
||||
}
|
||||
|
||||
.environmentGrid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr) minmax(300px, 0.9fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.environmentCard {
|
||||
min-width: 0;
|
||||
border: 1px solid #d9ded5;
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.environmentFacts {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.environmentNote {
|
||||
margin-top: 10px;
|
||||
color: #3e493f;
|
||||
font-size: 0.88rem;
|
||||
line-height: 1.42;
|
||||
}
|
||||
|
||||
.pathList {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.pathList strong {
|
||||
color: #667168;
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.pathList span {
|
||||
color: #667168;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.laneCard,
|
||||
.findingCard,
|
||||
.jobRow {
|
||||
|
|
@ -418,6 +467,10 @@ code {
|
|||
.cardGrid {
|
||||
grid-template-columns: repeat(2, minmax(180px, 1fr));
|
||||
}
|
||||
|
||||
.environmentGrid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
|
|
|
|||
|
|
@ -44,8 +44,22 @@ export interface ArtifactBundle {
|
|||
runtimeAudit?: {
|
||||
resultPath: string;
|
||||
status: string;
|
||||
projectPath?: string;
|
||||
projectVersion?: string;
|
||||
editorPath?: string;
|
||||
note?: string;
|
||||
editorBridge?: {
|
||||
exists: boolean;
|
||||
path?: string;
|
||||
relativePath?: string;
|
||||
executeMethod?: string;
|
||||
};
|
||||
installedEditors?: Array<{
|
||||
version?: string;
|
||||
editorPath?: string;
|
||||
}>;
|
||||
candidatePaths?: string[];
|
||||
searchRoots?: string[];
|
||||
};
|
||||
modifiedMillis?: number;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue