feat(studio): deliver asset authoring and automation workflows
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.
This commit is contained in:
+10
@@ -3,6 +3,16 @@ package p.packer;
|
||||
import p.packer.messages.*;
|
||||
|
||||
public interface PackerWorkspaceService {
|
||||
/** Shared readers/writers and recoverable publication use one reentrant project lane. */
|
||||
default <T> T withProject(PackerProjectContext project, java.util.concurrent.Callable<T> work) {
|
||||
try{return work.call();}catch(RuntimeException failure){throw failure;}catch(Exception failure){throw new IllegalStateException(failure);}
|
||||
}
|
||||
default void publishWorkspaceFiles(PublishWorkspaceFilesRequest request) {
|
||||
throw new UnsupportedOperationException("Recoverable publication is not configured");
|
||||
}
|
||||
default p.packer.dtos.PackerPackPlanDTO planPackWorkspace(PackerProjectContext project) {
|
||||
throw new UnsupportedOperationException("Final pack plan is not configured");
|
||||
}
|
||||
default p.packer.dtos.PackerGlyphBankLayoutDTO getGlyphBankLayout(GetGlyphBankLayoutRequest request) {
|
||||
throw new UnsupportedOperationException("Glyph bank layout resolver is not configured");
|
||||
}
|
||||
|
||||
+6
-1
@@ -11,9 +11,14 @@ public record PackerDiagnosticDTO(
|
||||
PackerDiagnosticCategory category,
|
||||
String message,
|
||||
Path evidencePath,
|
||||
boolean blocking) {
|
||||
boolean blocking, String code, java.util.Map<String,Object> context) {
|
||||
|
||||
public PackerDiagnosticDTO(PackerDiagnosticSeverity severity,PackerDiagnosticCategory category,String message,Path evidencePath,boolean blocking) {
|
||||
this(severity,category,message,evidencePath,blocking,null,java.util.Map.of());
|
||||
}
|
||||
|
||||
public PackerDiagnosticDTO {
|
||||
context=context==null?java.util.Map.of():java.util.Collections.unmodifiableMap(new java.util.LinkedHashMap<>(context));
|
||||
Objects.requireNonNull(severity, "severity");
|
||||
Objects.requireNonNull(category, "category");
|
||||
message = Objects.requireNonNull(message, "message").trim();
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package p.packer.dtos;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/** Preload entries come from the very same emitter used to build assets.pa. */
|
||||
public record PackerPackPlanDTO(List<Bank> banks,List<Preload> preload,List<PackerDiagnosticDTO> diagnostics) {
|
||||
public PackerPackPlanDTO {banks=List.copyOf(banks);preload=List.copyOf(preload);diagnostics=List.copyOf(diagnostics);}
|
||||
public record Bank(Integer assetId,String reference,Path root,String bankType,boolean buildSelected,boolean included,long contentCount,
|
||||
Map<String,String> metadata,List<Integer> coldDependencies) {
|
||||
public Bank(Integer assetId,String reference,Path root,String bankType,boolean included,long contentCount,Map<String,String> metadata,List<Integer> coldDependencies){this(assetId,reference,root,bankType,included,included,contentCount,metadata,coldDependencies);}
|
||||
public Bank{metadata=Map.copyOf(metadata);coldDependencies=List.copyOf(coldDependencies);}
|
||||
}
|
||||
public record Preload(int assetId,int slot,String bankType){}
|
||||
}
|
||||
+3
-1
@@ -4,7 +4,9 @@ import java.util.Objects;
|
||||
|
||||
public record GetAssetDetailsRequest(
|
||||
PackerProjectContext project,
|
||||
AssetReference assetReference) {
|
||||
AssetReference assetReference,boolean initializeIdentity) {
|
||||
|
||||
public GetAssetDetailsRequest(PackerProjectContext project,AssetReference reference){this(project,reference,true);}
|
||||
|
||||
public GetAssetDetailsRequest {
|
||||
Objects.requireNonNull(project, "project");
|
||||
|
||||
+3
-1
@@ -4,12 +4,14 @@ import java.util.Objects;
|
||||
|
||||
public record ListAssetsRequest(
|
||||
PackerProjectContext project,
|
||||
boolean deepSync) {
|
||||
boolean deepSync, boolean refreshReadOnly) {
|
||||
|
||||
public ListAssetsRequest {
|
||||
Objects.requireNonNull(project, "project");
|
||||
}
|
||||
|
||||
public ListAssetsRequest(PackerProjectContext project, boolean deepSync) { this(project,deepSync,false); }
|
||||
|
||||
public ListAssetsRequest(PackerProjectContext project) {
|
||||
this(project, false);
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package p.packer.messages;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/** Consumer-qualified capacity facts, never inferred from a version family. */
|
||||
public record PackCapacityContract(String profileId,String executableSha256,Map<String,Integer> limits) {
|
||||
public PackCapacityContract {
|
||||
if(profileId==null||profileId.isBlank()||executableSha256==null||!executableSha256.matches("[0-9a-f]{64}"))throw new IllegalArgumentException("Qualified profile identity required");
|
||||
limits=Map.copyOf(limits);if(limits.isEmpty()||limits.values().stream().anyMatch(n->n<1))throw new IllegalArgumentException("Positive qualified capacities required");
|
||||
}
|
||||
}
|
||||
+7
-1
@@ -3,9 +3,15 @@ package p.packer.messages;
|
||||
import java.util.Objects;
|
||||
|
||||
public record PackWorkspaceRequest(
|
||||
PackerProjectContext project) {
|
||||
PackerProjectContext project,
|
||||
java.nio.file.Path outputDirectory, PackCapacityContract capacity) {
|
||||
public PackWorkspaceRequest(PackerProjectContext project) { this(project, null,null); }
|
||||
public PackWorkspaceRequest(PackerProjectContext project,java.nio.file.Path outputDirectory){this(project,outputDirectory,null);}
|
||||
|
||||
public PackWorkspaceRequest {
|
||||
Objects.requireNonNull(project, "project");
|
||||
outputDirectory = outputDirectory == null ? null : outputDirectory.toAbsolutePath().normalize();
|
||||
if (outputDirectory != null && !outputDirectory.startsWith(project.rootPath()))
|
||||
throw new IllegalArgumentException("Pack output must be inside the project");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -7,10 +7,13 @@ import java.util.Objects;
|
||||
public record PackWorkspaceResult(
|
||||
PackerOperationStatus status,
|
||||
String summary,
|
||||
PackerPackExecutionSummaryDTO result) {
|
||||
PackerPackExecutionSummaryDTO result, java.util.List<p.packer.dtos.PackerDiagnosticDTO> diagnostics) {
|
||||
|
||||
public PackWorkspaceResult(PackerOperationStatus status,String summary,PackerPackExecutionSummaryDTO result){this(status,summary,result,java.util.List.of());}
|
||||
|
||||
public PackWorkspaceResult {
|
||||
Objects.requireNonNull(status, "status");
|
||||
diagnostics=java.util.List.copyOf(diagnostics);
|
||||
summary = Objects.requireNonNull(summary, "summary").trim();
|
||||
Objects.requireNonNull(result, "result");
|
||||
if (summary.isBlank()) {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package p.packer.messages;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Validated candidate files published under the same project lane as asset readers. */
|
||||
public record PublishWorkspaceFilesRequest(PackerProjectContext project, String transactionId, List<Edit> edits) {
|
||||
public PublishWorkspaceFilesRequest {
|
||||
Objects.requireNonNull(project); java.util.UUID.fromString(transactionId); edits=List.copyOf(edits);
|
||||
if(edits.stream().map(Edit::path).distinct().count()!=edits.size())throw new IllegalArgumentException("Duplicate publication path");
|
||||
}
|
||||
public record Edit(String path, String beforeSha256, byte[] content) {
|
||||
public Edit {
|
||||
var relative=java.nio.file.Path.of(path);
|
||||
if(relative.isAbsolute()||relative.normalize().startsWith("..")||!relative.normalize().toString().equals(path)||path.equals(".")||path.contains("\\"))
|
||||
throw new IllegalArgumentException("Expected project-relative publication path");
|
||||
if(beforeSha256!=null&&!beforeSha256.matches("[0-9a-f]{64}"))throw new IllegalArgumentException("Expected previous SHA-256");
|
||||
if(path.startsWith(".studio/asset-transactions/"))throw new IllegalArgumentException("Cannot publish a journal as an asset");
|
||||
content=content==null?null:content.clone();
|
||||
}
|
||||
@Override public byte[] content(){return content==null?null:content.clone();}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user