Commit 95c0c48
committed
fix(inspector): round 2 — type names, session id, pech, tracing log, details
- Event::type_str() returns the real wire-side `type` for Unknown variants
(pech.ledger.appended, lifecycle.*, mcp.tool.*, ...) instead of the
static "unknown" placeholder. Events table column now reads usefully.
type_tag() preserved for the &'static str callers (events/security/
replay/plugins views).
- AppState::apply() latches session.session_id on the first event that
carries one, then locks it. ACTIVE SESSION's "Session" row stops
showing "-" the moment any wire event lands.
- pech.ledger.appended in apply_unknown now bumps pech.last_event
explicitly. The runtime stamps these events with `plugin: "mcp-client"`,
so the generic ev.plugin() refresh credits mcp-client; without the
explicit bump pech's "last seen" never ticked.
- fmt_log_size: 0 renders as "0 B" (was "-"); ladder boundaries verified
at 0 / 999 / 1024 / 1MB / 1GB. Path resolution to %LOCALAPPDATA%/
enchanter/inspector.log confirmed correct — the displayed 38 GB is
honest (real log is 40 GB on this machine; rotation is a separate bug).
- event_detail / unknown_event_detail: priority chain pulls
message → extras["message"] → extras["reason"] → type-specific synthesis
(pech.ledger.appended → cost+tokens, mcp.tool.call.requested → tool+path,
lifecycle.* → phase+elapsed, *.veto.* → policy/reason) → JSON-stringify
fallback truncated to 60 chars. Details column populated for every row.
+6 tests: type_str x2, session_id_latches, pech_ledger_last_event,
unknown_event_detail_priority_chain, event_detail_pech_typed.1 parent 6344cce commit 95c0c48
3 files changed
Lines changed: 393 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
369 | 370 | | |
370 | 371 | | |
371 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
372 | 389 | | |
373 | 390 | | |
374 | 391 | | |
| |||
759 | 776 | | |
760 | 777 | | |
761 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
762 | 797 | | |
763 | 798 | | |
764 | 799 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1142 | 1159 | | |
1143 | 1160 | | |
1144 | 1161 | | |
| |||
1626 | 1643 | | |
1627 | 1644 | | |
1628 | 1645 | | |
1629 | | - | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
1630 | 1649 | | |
1631 | 1650 | | |
1632 | 1651 | | |
1633 | | - | |
| 1652 | + | |
1634 | 1653 | | |
1635 | 1654 | | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
1636 | 1659 | | |
1637 | 1660 | | |
1638 | 1661 | | |
| 1662 | + | |
1639 | 1663 | | |
1640 | 1664 | | |
1641 | 1665 | | |
| |||
2158 | 2182 | | |
2159 | 2183 | | |
2160 | 2184 | | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
2161 | 2275 | | |
2162 | 2276 | | |
2163 | 2277 | | |
| |||
0 commit comments