diff --git a/src/Gjallar/Program.cs b/src/Gjallar/Program.cs index e89a225..a73cbb9 100644 --- a/src/Gjallar/Program.cs +++ b/src/Gjallar/Program.cs @@ -73,6 +73,8 @@ internal sealed class GjallarRenderer : IDisposable private int latestComposedProviders; private string lastReceiveStatus = "starting"; private string lastReceiveError = ""; + private string lastProviderFetchError = ""; + private string lastProviderFetchUri = ""; private SceneCache? sceneCache; private FrameTimings lastTimings; @@ -232,7 +234,9 @@ internal sealed class GjallarRenderer : IDisposable try { using var socket = new ClientWebSocket(); - await socket.ConnectAsync(ProviderDeckUri(provider), token).ConfigureAwait(false); + var uri = ProviderDeckUri(provider); + lastProviderFetchUri = uri.ToString(); + await socket.ConnectAsync(uri, token).ConfigureAwait(false); var bytes = await ReadTextFrameAsync(socket, token).ConfigureAwait(false); using var state = JsonDocument.Parse(bytes); if (!state.RootElement.TryGetProperty("surface", out var surface) || @@ -241,10 +245,12 @@ internal sealed class GjallarRenderer : IDisposable return null; } + lastProviderFetchError = ""; return new ProviderFrame(provider, state.RootElement.Clone(), root.Clone()); } - catch when (!token.IsCancellationRequested) + catch (Exception error) when (!token.IsCancellationRequested) { + lastProviderFetchError = $"{provider.Id}: {error.GetType().Name}: {error.Message}"; return ProviderFrame.Unavailable(provider); } } @@ -259,7 +265,7 @@ internal sealed class GjallarRenderer : IDisposable endpoint = $"/eve/deck/{Uri.EscapeDataString(provider.Id)}"; } - if (Uri.TryCreate(endpoint, UriKind.Absolute, out var absolute)) + if (!endpoint.StartsWith("/", StringComparison.Ordinal) && Uri.TryCreate(endpoint, UriKind.Absolute, out var absolute)) { return absolute.Scheme is "http" or "https" ? new Uri(endpoint.Replace("http://", "ws://", StringComparison.OrdinalIgnoreCase).Replace("https://", "wss://", StringComparison.OrdinalIgnoreCase)) @@ -267,12 +273,8 @@ internal sealed class GjallarRenderer : IDisposable } var baseUri = new Uri(config.Url); - var builder = new UriBuilder(baseUri) - { - Path = endpoint.StartsWith("/", StringComparison.Ordinal) ? endpoint : $"/{endpoint}", - Query = "", - }; - return builder.Uri; + var normalizedEndpoint = endpoint.StartsWith("/", StringComparison.Ordinal) ? endpoint : $"/{endpoint}"; + return new Uri($"{baseUri.Scheme}://{baseUri.Authority}{normalizedEndpoint}"); } private static async Task ReadTextFrameAsync(ClientWebSocket socket, CancellationToken token) @@ -536,6 +538,8 @@ internal sealed class GjallarRenderer : IDisposable { status = lastReceiveStatus, error = lastReceiveError, + providerFetchError = lastProviderFetchError, + providerFetchUri = lastProviderFetchUri, catalogProviders = latestCatalogProviders, composedProviders = latestComposedProviders, stateBytes = Volatile.Read(ref latestStateJson)?.Length ?? 0, diff --git a/state/gjallar-state.md b/state/gjallar-state.md index c12eb4a..ba7dfa9 100644 --- a/state/gjallar-state.md +++ b/state/gjallar-state.md @@ -1,6 +1,6 @@ # Gjallar State -Last updated: 2026-06-05 +Last updated: 2026-06-06 ## Identity @@ -143,6 +143,18 @@ Source: `https://en.wikipedia.org/wiki/Linux_framebuffer` and text pressure. - `FrameDocument` draws text, panels, gutters, marquee, and fills. - `FramebufferDevice` maps or writes the Linux framebuffer. +- 2026-06-06 live fix: rooted provider endpoints such as `/eve/deck/bifrost` + must be resolved against the configured Odin deck authority before opening a + provider stream. In .NET, `Uri.TryCreate(..., UriKind.Absolute, ...)` can + interpret rooted paths as `file://` URIs, which made Gjallar render the + unavailable pane while the provider surface was actually reachable. +- Provider fetch diagnostics now publish `providerFetchUri` and + `providerFetchError` in `/var/log/gjallar.status` so transport failures are + visible at the layer that produces the framebuffer symptom. +- Transport debt remains explicit: the live Nightwing body still consumes the + compatibility Eve deck bridge. The target input organ is native CultNet / + CultMesh typed state over the real GameCult transport, not a web-shaped + provider fetch loop. This is enough to run, but not enough to be proud forever. The next architectural cut is to extract explicit model types: