fix(clients): resolve 2026-06-18 array-write review findings

- Client.Dotnet-030: add advise-supervisory to IsKnownGatewayCommand (was dead/unreachable, exit 2)
- Client.Go-035/036/037: usage+README list advise-supervisory; add session-id guard test; fix write2 README wording
- Client.Python-037/038: drop regressed 'scaffold' from pyproject; add advise-supervisory CLI tests
- Client.Rust-039/040: document write_array_elements/advise-supervisory in design doc; pin outer MxValue data_type==0
- Client.Java-049/050/051: sync CLIENT_VERSION to 0.1.2; add advise-supervisory test; guard negative uint32 inputs (pending windev gradle verification)

Client READMEs also updated for Server-057 add-family normalization wording.
.NET/Go/Python/Rust verified green locally; Java pending windev.
This commit is contained in:
Joseph Doherty
2026-06-18 10:58:33 -04:00
parent 85ef453d0d
commit 6c853b43af
22 changed files with 404 additions and 43 deletions
@@ -82,6 +82,53 @@ public sealed class MxGatewayClientCliTests
Assert.Equal(string.Empty, error.ToString());
}
/// <summary>
/// Client.Dotnet-030: <c>advise-supervisory</c> was present in the command
/// dispatch table but absent from <see cref="MxGatewayClientCli"/>'s
/// <c>IsKnownGatewayCommand</c> guard, so the guard intercepted it first and
/// returned exit code 2 "Unknown command" before dispatch could run. This
/// test asserts the command is recognized (exit ≠ 2, stderr contains no
/// "Unknown command") and reaches the dispatch handler (exit 0, reply written
/// to stdout).
/// </summary>
[Fact]
public async Task RunAsync_AdviseSupervisory_IsRecognizedAndReachesDispatch()
{
using var output = new StringWriter();
using var error = new StringWriter();
FakeCliClient fakeClient = new();
fakeClient.InvokeReplies.Enqueue(new MxCommandReply
{
SessionId = "session-fixture",
Kind = MxCommandKind.AdviseSupervisory,
ProtocolStatus = new ProtocolStatus { Code = ProtocolStatusCode.Ok },
});
int exitCode = await MxGatewayClientCli.RunAsync(
[
"advise-supervisory",
"--endpoint",
"http://localhost:5000",
"--api-key",
"test-api-key",
"--session-id",
"session-fixture",
"--server-handle",
"12",
"--item-handle",
"34",
"--json",
],
output,
error,
_ => fakeClient);
Assert.DoesNotContain("Unknown command", error.ToString());
Assert.Equal(0, exitCode);
Assert.Contains("MX_COMMAND_KIND_ADVISE_SUPERVISORY", output.ToString());
Assert.Equal(string.Empty, error.ToString());
}
/// <summary>Verifies that error output redacts sensitive API key values.</summary>
[Fact]
public async Task RunAsync_ErrorOutput_RedactsApiKey()