fixes for testing Jibo

This commit is contained in:
Jacob Dubin
2026-04-15 11:58:58 -05:00
parent e7978b437a
commit 64ef8d61a0
16 changed files with 244 additions and 23 deletions

View File

@@ -76,6 +76,7 @@ Current websocket scope is still intentionally narrow:
- `CONTEXT` capture and follow-up turn state
- `EOS` completion
- first skill vertical for joke/chat `SKILL_ACTION` playback
- repo-root live-run capture support for both `captures/http/` and `captures/websocket/`
Not yet covered:
@@ -85,3 +86,17 @@ Not yet covered:
- upstream Nimbus or broader skill lifecycle behavior
- animation / expression command families
- ESML feature parity beyond the narrow synthetic playback payloads used in the current scaffold
## Live Capture Status
The first real `.NET` robot test has confirmed:
- startup HTTP traffic reaches the `.NET` cloud
- `Notification.NewRobotToken` is in the active startup path
- `api-socket.jibo.com` connections are being accepted live
It has not yet confirmed:
- full startup parity with the successful Node run cadence
- consistent eye-open / wake completion on the robot
- the later health/log upload sequence currently seen in the working Node run

View File

@@ -278,14 +278,15 @@ public sealed class JiboCloudProtocolService(ICloudStateStore stateStore)
}
var body = envelope.TryParseBody();
var deviceId = envelope.DeviceId
?? ReadString(body, "deviceId")
?? ReadString(body, "serial_number")
?? ReadString(body, "serialNumber")
?? ReadString(body, "cpuid")
?? ReadString(body, "cpuId")
?? ReadString(body, "robotId")
?? "unknown-device";
var deviceId = !string.IsNullOrWhiteSpace(envelope.DeviceId)
? envelope.DeviceId!
: ReadString(body, "deviceId")
?? ReadString(body, "serial_number")
?? ReadString(body, "serialNumber")
?? ReadString(body, "cpuid")
?? ReadString(body, "cpuId")
?? ReadString(body, "robotId")
?? "unknown-device";
stateStore.GetOrCreateDevice(deviceId, envelope.FirmwareVersion, envelope.ApplicationVersion);

View File

@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Jibo.Cloud.Tests")]

View File

@@ -0,0 +1,42 @@
namespace Jibo.Cloud.Infrastructure.Telemetry;
internal static class CapturePathResolver
{
public static string Resolve(string configuredDirectoryPath, string currentDirectory, string appBaseDirectory)
{
if (Path.IsPathRooted(configuredDirectoryPath))
{
return Path.GetFullPath(configuredDirectoryPath);
}
var repoRoot = FindOpenJiboRepoRoot(currentDirectory) ?? FindOpenJiboRepoRoot(appBaseDirectory);
var baseDirectory = repoRoot ?? currentDirectory;
return Path.GetFullPath(configuredDirectoryPath, baseDirectory);
}
private static string? FindOpenJiboRepoRoot(string? startPath)
{
if (string.IsNullOrWhiteSpace(startPath))
{
return null;
}
var directory = new DirectoryInfo(Path.GetFullPath(startPath));
if (!directory.Exists && directory.Parent is not null)
{
directory = directory.Parent;
}
while (directory is not null)
{
if (File.Exists(Path.Combine(directory.FullName, "OpenJibo.slnx")))
{
return directory.FullName;
}
directory = directory.Parent;
}
return null;
}
}

View File

@@ -19,7 +19,10 @@ public sealed class FileProtocolTelemetrySink(
return;
}
var directory = Path.GetFullPath(options.Value.DirectoryPath, AppContext.BaseDirectory);
var directory = CapturePathResolver.Resolve(
options.Value.DirectoryPath,
Directory.GetCurrentDirectory(),
AppContext.BaseDirectory);
Directory.CreateDirectory(directory);
var filePath = Path.Combine(directory, $"{DateTimeOffset.UtcNow:yyyyMMdd}.events.ndjson");

View File

@@ -227,7 +227,10 @@ public sealed class FileWebSocketTelemetrySink(
private string GetBaseDirectory()
{
return Path.GetFullPath(options.Value.DirectoryPath, AppContext.BaseDirectory);
return CapturePathResolver.Resolve(
options.Value.DirectoryPath,
Directory.GetCurrentDirectory(),
AppContext.BaseDirectory);
}
private static string BuildFixtureName(CloudSession session, CapturedWebSocketFixtureBuilder fixture)