Add shared human/task asset batches with reviewed atomic publication, explicit reference rebinds, ownership inspection and qualified glyph/scene budgets. Expose the same authoring and capacity results through Assets and MCP. Deliver isolated guest test targets, retained visual evidence and immutable runtime lifecycle/control observations. Preserve provider qualification and installed authoring examples alongside the completed discussion lessons. Close AGD-106 coordination and the delivered discussion workflows through housekeeping, updating lesson references and preserving qualification limits. Sound remains outside the asset delivery wave. Validation: 579 module tests and 31 additional desktop, process and installed checks passed; native glyph/scene 16/17 boundaries qualified. Discussion validation passed after housekeeping.
36 lines
1.6 KiB
Java
36 lines
1.6 KiB
Java
package p.studio.api.diagnostic;
|
|
|
|
import java.util.Objects;
|
|
import java.util.Map;
|
|
import java.util.LinkedHashMap;
|
|
import p.studio.api.values.ValueMaps;
|
|
import p.studio.api.diagnostic.DiagnosticValues;
|
|
|
|
public record StudioDiagnostic(String code, DiagnosticSeverity severity, String message, Map<String, Object> details) {
|
|
public StudioDiagnostic(String code, DiagnosticSeverity severity, String message) { this(code, severity, message, Map.of()); }
|
|
public StudioDiagnostic {
|
|
Objects.requireNonNull(code, "code");
|
|
Objects.requireNonNull(severity, "severity");
|
|
Objects.requireNonNull(message, "message");
|
|
if (code.isBlank()) {
|
|
throw new IllegalArgumentException("code must not be blank");
|
|
}
|
|
var complete = new LinkedHashMap<>(DiagnosticValues.issue(code, severity.name(), message));
|
|
if (details != null) complete.putAll(details);
|
|
if (!(complete.get("issueId") instanceof String identity) || identity.isBlank())
|
|
complete.put("issueId", java.util.UUID.randomUUID().toString());
|
|
details = ValueMaps.object(complete);
|
|
}
|
|
|
|
public static StudioDiagnostic fromMap(Map<String, Object> value) {
|
|
return new StudioDiagnostic((String) value.get("code"), DiagnosticSeverity.valueOf((String) value.get("severity")),
|
|
(String) value.get("message"), value);
|
|
}
|
|
|
|
public Map<String, Object> toMap() {
|
|
var value = new LinkedHashMap<>(details);
|
|
value.put("code", code); value.put("severity", severity.name()); value.put("message", message);
|
|
return ValueMaps.object(value);
|
|
}
|
|
}
|