feat(studio): deliver asset authoring and automation workflows
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/pr-master There was a failure building this commit

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:
2026-11-11 01:21:25 +00:00
parent b351f2e582
commit 1471b427f1
325 changed files with 61179 additions and 323 deletions
@@ -0,0 +1,196 @@
---
id: LSN-0110
ticket: studio-visual-regression-artifacts
title: Original Checkpoints and Reviewed Visual Evidence
created: 2026-11-10
tags: [studio, automation, evidence, mcp, javafx]
---
## Problem and consolidated decision
**Owner:** studio, visual automation evidence. This lesson consolidates accepted
DEC-0093 and completed PLN-0171 from DSC-0105 / AGD-0107. It builds on the
[immutable lifecycle observation contract](../DSC-0110-studio-headless-lifecycle-observability/LSN-0109-immutable-runtime-observations-and-control-return.md).
A canonical advance already retained its own PNG and frame identity. Consumers
still needed scripts to transport, persist and compare that image, and a later
capture could accidentally replace the checkpoint under investigation. The
decision delivered the complete single-checkpoint flow through shared services:
persist the original operation result, import an authorized reference, compare,
inspect expected/actual/diff, and review a baseline explicitly as a human.
No sequence runner, extra server, automatic baseline promotion, resizing or
perceptual oracle was added. All eleven decision rules were implemented. No runtime
repository files were written and no commits were created.
## Result and evidence
**450 tests passed**, with zero failures, errors or skips, across API, Core,
JavaFX, application, architecture, desktop, installed runtime/media, MCP/desktop
and installed knowledge. [Qualification](evidence/qualification.json) retains
commands, suites/cases and source/report hashes. [Native checkpoints and raw
measurements](evidence/native-checkpoints-and-measurements.json) preserve the
actual results; [runtime provenance](evidence/runtime-provenance.json) identifies
the executed installation. The [inspector screenshot](evidence/inspector.png)
shows a deliberate one-pixel rejection, original coordinates and reviewed revision.
Independent hand-constructed RGBA fixtures cover exact pass, known failure, alpha,
transparent RGB, tolerance edges, half-open ROI, overlapping masks, empty regions,
dimension mismatch, bounds and diff. An installed native checkpoint additionally
proves persistence from the original operation across later frames, rebuild,
release and project reopen, with a deliberate one-pixel derived difference.
The derived image is not labeled an independent oracle.
The Zelda pilot uses a disposable copy and explicit memory_fresh media. Saved port
screen/HUD/scroll images retain their paths/hashes and external provenance. All
three contextual comparisons rejected; that is a retained comparison result,
not an operational failure or a claim of an independent NES oracle. Input checkpoint
labels identify the reference context and do not assert that every game transition
was reached. No comparison changed a baseline.
## Preserve the original, then compare
`DefaultEvidenceTools.persist` resolves a terminated operation and copies exactly
`TrackedOperation.runtimeResult().capture()`. There is no advance or native CAPTURE
call. The service retains project, task, operation/client-request, build, session,
logical frame and frameId provenance when available. Frame counters normalize to
lossless uint64-compatible values after storage round trips.
Publication request identity is separate from the original advance request:
```json
{
"projectRoot": "/project",
"taskId": "current-task",
"clientRequestId": "persist-checkpoint-1",
"sourceClientRequestId": "advance-checkpoint-1"
}
```
Repeating the same publication request and parameters returns the same immutable
publication. Changed parameters conflict. The parameter fingerprint includes the
authorized import selection and actual bytes without exposing grant tokens as
plain metadata. Lost responses can be recovered by publication request lookup
through list, including after a fresh task is acquired; guest work is not replayed.
An artifact has an opaque ID, SHA-256 of original bytes, byte size, MIME, dimensions
and immutable provenance. Current staleness is a separate view computed against
the live project capture. Rebuild or reset never rewrites historical identity.
## Publication is one atomic directory move
The application `FileEvidenceStore` owns `.studio/evidence/`. Each immutable
publication contains PNG objects and its record/report/revision. Staging writes
and file flushes precede an atomic directory move; only complete publication
directories are visible. Orphan staging is cleaned under the store lock and never
advertised as evidence. Published data survives process/project closure.
The default quota is 512 MiB, configurable through
`prometeu.evidence.quotaBytes`. Admission counts object and record bytes under a
shared JVM monitor and filesystem lock, so concurrent publishers cannot both
consume the same remaining space. Refusal reports used/required/limit and leaves
previous publications untouched. Nothing is evicted. Explicit deletion checks
report and baseline references before removing a publication.
Bounded reads validate ID, project namespace, range and integrity. A read is at
most 1 MiB; a whole PNG image is bounded to 32 MiB and decoded images to 16,777,216
pixels. Neither ID knowledge nor a local path grants project authority.
## Reference authorization is observed, not asserted by the caller
File import admits a canonical project path or an exact project-bound human
selection grant. Symlinks cannot bypass that rule. The adapter returns the
verified canonical path and whether human authorization actually matched;
supplying an arbitrary grant string cannot manufacture human-selected provenance.
Imported references have external origin and no invented runtime/frame identity.
Import does not review a baseline. The inspector asks for explicit confirmation
and the service acquires the existing human manual lease. The revision records
previous/new identity and reference origin, checks the expected previous revision,
and remains immutable. Agent grants disable human mutation while inspection stays
available. The MCP catalogue contains no baseline-approval or external-path-grant
operation. Failed, invalid or cancelled comparisons cannot trigger promotion.
## Deterministic pixels and explainable rejection
The PNG adapter expands original samples to neutral RGBA8 without gamma/profile or
perceptual correction. Core performs comparison without AWT/ImageIO/JavaFX types.
JavaFX uses the same neutral pixels for exact channel inspection; display zoom is
presentation only and does not alter comparison coordinates.
ROI and masks use original top-left coordinates and half-open rectangles. Invalid
bounds are rejected rather than clipped. Overlapping masks exclude their union
once inside the ROI; a region with no compared pixels is invalid. Explicit alpha
compare/ignore determines whether alpha participates, while RGB always does,
including at alpha zero.
Exact defaults allow zero channel error and zero differing pixels. A tolerant
comparison declares channelLimit 0..255 and allowedDifferentPixels. A pixel differs
when a compared channel exceeds the channel limit; maximumChannelError retains the
observed error before tolerance. BoundingBox is null without differing pixels.
Dimension mismatch returns its own rejection verdict without resize. Invalid
parameters, decoding, storage or authority failures are operational errors.
Reports retain normalized parameters, original expected/actual byte hashes,
verdict, compared/different counts, maximum error, bounds and all three artifact
IDs. Diff images preserve original dimensions: transparent black is excluded,
opaque green is compared within tolerance, and opaque red/yellow is different.
## Shared service, existing adapters
Task mutations use the existing project operation executor; human mutations use
the existing manual lease. Worker termination, revoke/reclaim and document handoff
remain authoritative. Already published evidence survives cancellation. Revoked
tasks are denied; a fresh authorized task can read same-project history. The local
bound human inspector remains read-only during an agent grant.
Eight studio_evidence tools add persist/import/compare/list/metadata/read/image/
delete to the existing authenticated MCP endpoint. Image results carry direct PNG
content; bytes and metadata use IDs and bounded reads. HTTP tests verify missing
credentials, cross-project denial and revoked-task denial. The real JavaFX test
verifies exact pixel display, report parity with MCP, explicit baseline confirmation
and disabled mutation during a grant.
## Measure the actual tradeoff
The same three Zelda checkpoints were exercised through the former image-download
and external-comparison path and the new publication/report path:
| Measured adapter work | Former path | Evidence path |
| --- | ---: | ---: |
| MCP calls | 3 | 9 |
| Serialized response bytes | 187334 | 23766 |
| PNG bytes transferred for metrics | 106825 | 0 |
| External comparison scripts executed | 1 | 0 |
Three guest advance requests were shared by both paths. Build/advance/polling and
optional later image inspection are outside these adapter counts. The former
script compared full images; the new HUD case declared an ROI, so its pixel counts
are not presented as identical workloads. These raw observations show fewer
transported bytes and no external comparison script at the cost of more explicit
service calls; they are not a universal performance percentage.
## Acceptance coverage and pitfalls
D1–D3 are covered by original-checkpoint publication, request recovery and immutable
identity; D4–D5 by atomic storage, reference checks and concurrent quota tests;
D6–D7 by scoped HTTP/ID access and canonical reference admission; D8–D10 by the
independent pixel fixtures and complete native reports; D11 by the desktop/MCP
parity and human baseline-review gate. Installed guide/catalog examples ship in
the packaged distribution and pass its knowledge probe.
- Never recapture to reconstruct the outcome of an earlier advance.
- Do not change historical frame identity when current state becomes stale.
- Treat import and baseline approval as separate actions with different authority.
- Preserve valid publications on quota refusal, cancellation and interrupted staging.
- Do not hide dimension mismatch, empty regions or unknown authority as a pass.
- Count mask overlaps once, compare transparent RGB, and keep diff coordinates.
- Keep reference provenance and oracle independence explicit, especially for port
captures compared with their own earlier renders.
The durable contracts are [Studio 8](../../../docs/specs/studio/8.%20Project-Local%20Studio%20State%20Specification.md),
[Studio 9](../../../docs/specs/studio/9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md),
[Studio 10](../../../docs/specs/studio/10.%20DEV%20and%20Automation%20Specification.md)
and [Studio 11](../../../docs/specs/studio/11.%20MCP%20Tools%20and%20Project%20Knowledge%20Contract.md).
Completed DEC-0093/PLN-0171 scaffolding is removed by CLI housekeeping. Isolated
guest targets (DSC-0106) can reference these artifacts without adding another runner.
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@@ -0,0 +1,242 @@
[
{
"artifact": {
"id": "fcd32b20-d94f-4004-add0-1f79961555ea",
"publicationId": "c13a092f-cb79-4f4c-b50e-932fce2b40c5",
"sha256": "14a709ea09b203d8b82d70a5bf88f5965b19d9d2a2e880f2c47880ad1a4b261c",
"byteSize": 4441,
"mime": "image/png",
"width": 480,
"height": 270,
"provenance": {
"origin": "runtime",
"projectRoot": "/private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-15045912050876628691",
"taskId": "8e5d6df6-cb25-4483-b59c-511241108692",
"operationId": "9e5289ad-5d79-45c3-996f-b6ead5c4429c",
"clientRequestId": "evidence-frame",
"buildId": "f1e9c2ff-507c-442c-a606-159ad8665e4a",
"sessionId": "58c5f2db00f1213cb608d1b42e991128",
"logicalFrameIndex": 1,
"frameId": 0
}
},
"kind": "native-checkpoint",
"report": {
"id": "7e266ef3-e070-4810-a7a1-217642c51e26",
"expectedId": "a61d8eb7-c483-46f2-90ad-2c6b39eb4bd6",
"actualId": "fcd32b20-d94f-4004-add0-1f79961555ea",
"diffId": "fba1fe1b-efad-4053-aabb-f389d59c6352",
"expectedSha256": "16a8fd97c2ad794c91a21e5fa85a4330752d7484b9e77802bd17d1f94d973b2a",
"actualSha256": "14a709ea09b203d8b82d70a5bf88f5965b19d9d2a2e880f2c47880ad1a4b261c",
"parameters": {
"roi": {
"x": 0,
"y": 0,
"width": 480,
"height": 270
},
"masks": [],
"alpha": "compare",
"channelLimit": 0,
"allowedDifferentPixels": 0
},
"verdict": "rejected",
"comparedPixels": 129600,
"differentPixels": 1,
"maximumChannelError": 1,
"boundingBox": {
"x": 0,
"y": 0,
"width": 1,
"height": 1
}
},
"nativeAdvanceRequests": 2,
"persistenceExtraAdvanceOrCaptureRequests": 0
},
{
"measurement": {
"basis": "Actual local MCP adapter dispatches and serialized response bytes, excluding shared build/advance/asynchronous polling. Both comparison paths use the same three retained guest checkpoints. Legacy full-image exact metrics differ from the explicit HUD ROI by design.",
"before": {
"externalScriptOutput": "0,52060\n1,41204\n2,41661\n",
"mcpCalls": 3,
"wireResponseBytes": 187334,
"imagePngBytes": 106825,
"externalComparisonScripts": 1
},
"sharedGuestAdvanceRequests": 3,
"after": {
"wireResponseBytes": 23766,
"imageTransferBytesForMetrics": 0,
"mcpCalls": 9,
"externalComparisonScripts": 0
}
},
"results": [
{
"actual": {
"id": "28e02f3b-e662-4678-a1d6-f19b15eda099",
"publicationId": "b9d9aa10-3916-4ccd-8b03-fffef00ffa2f",
"sha256": "e23baf9e4cd8a89c71d2bad3a85c77dfd63245f1a4c2496ebf442b3a54050014",
"byteSize": 72639,
"mime": "image/png",
"width": 480,
"height": 270,
"provenance": {
"origin": "runtime",
"projectRoot": "/private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-11090026284816755065/zelda-pilot",
"taskId": "9c66df98-dc79-4cc4-8ca7-48d77220da25",
"operationId": "010e401e-7100-406a-a0d8-7f7e9dce3232",
"clientRequestId": "zelda-screen",
"buildId": "5b089dae-610c-4b08-b738-08bd8330edb1",
"sessionId": "4950d43d1ebd67198c604414fd9e54a9",
"logicalFrameIndex": 1,
"frameId": 0
}
},
"case": "screen",
"referencePath": "extracted/inventory_screen/validation/production_start.png",
"report": {
"id": "5e9b4beb-ff1d-4dfc-8033-0a8aef75d6e8",
"expectedId": "fefe408f-a673-408f-a9fb-bf8650a05f6a",
"actualId": "28e02f3b-e662-4678-a1d6-f19b15eda099",
"diffId": "1b8460d3-4103-4da6-a7bc-9887db7a969f",
"expectedSha256": "63db0e3fb60fb6c3c425a153f6bccea45d058c71ad268b736171212fd4a422c5",
"actualSha256": "e23baf9e4cd8a89c71d2bad3a85c77dfd63245f1a4c2496ebf442b3a54050014",
"parameters": {
"roi": {
"x": 0,
"y": 0,
"width": 480,
"height": 270
},
"masks": [],
"alpha": "compare",
"channelLimit": 0,
"allowedDifferentPixels": 0
},
"verdict": "rejected",
"comparedPixels": 129600,
"differentPixels": 52060,
"maximumChannelError": 252,
"boundingBox": {
"x": 112,
"y": 15,
"width": 256,
"height": 240
}
}
},
{
"actual": {
"id": "fc49883c-bf0e-4849-a7f5-64afc431b39f",
"publicationId": "a9caf7e1-9f2e-4cf9-b7b7-221fa137992d",
"sha256": "7b388522e326588a9cc4352a332be834b1face87e39adf925762b5181f9a5e75",
"byteSize": 17093,
"mime": "image/png",
"width": 480,
"height": 270,
"provenance": {
"origin": "runtime",
"projectRoot": "/private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-11090026284816755065/zelda-pilot",
"taskId": "9c66df98-dc79-4cc4-8ca7-48d77220da25",
"operationId": "19254d0b-b57e-4fab-884a-80668acbf3e8",
"clientRequestId": "zelda-hud",
"buildId": "5b089dae-610c-4b08-b738-08bd8330edb1",
"sessionId": "4950d43d1ebd67198c604414fd9e54a9",
"logicalFrameIndex": 77,
"frameId": 76
}
},
"case": "hud",
"referencePath": "extracted/hud/runtime_initial.png",
"report": {
"id": "d2525d55-b754-4395-85c9-c1cb901d6781",
"expectedId": "daab1e0e-ebae-4f4c-b95a-de97ae11d1b7",
"actualId": "fc49883c-bf0e-4849-a7f5-64afc431b39f",
"diffId": "bd79f7d4-dfbf-453d-af54-8922102d1242",
"expectedSha256": "cc6d60a56ed562f7690dd136be16c87de82efb596580f982c3270cf25b1422d5",
"actualSha256": "7b388522e326588a9cc4352a332be834b1face87e39adf925762b5181f9a5e75",
"parameters": {
"roi": {
"x": 112,
"y": 15,
"width": 256,
"height": 56
},
"masks": [],
"alpha": "compare",
"channelLimit": 0,
"allowedDifferentPixels": 0
},
"verdict": "rejected",
"comparedPixels": 14336,
"differentPixels": 3097,
"maximumChannelError": 252,
"boundingBox": {
"x": 128,
"y": 39,
"width": 214,
"height": 32
}
}
},
{
"actual": {
"id": "020f0737-7dfc-4460-b45f-9bcf9be4f118",
"publicationId": "59a36c95-ad2a-4a2c-bd48-51acb45bd33c",
"sha256": "7b388522e326588a9cc4352a332be834b1face87e39adf925762b5181f9a5e75",
"byteSize": 17093,
"mime": "image/png",
"width": 480,
"height": 270,
"provenance": {
"origin": "runtime",
"projectRoot": "/private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-11090026284816755065/zelda-pilot",
"taskId": "9c66df98-dc79-4cc4-8ca7-48d77220da25",
"operationId": "dc0e2d87-3c1f-435b-9886-b88a61f79c40",
"clientRequestId": "zelda-scroll",
"buildId": "5b089dae-610c-4b08-b738-08bd8330edb1",
"sessionId": "4950d43d1ebd67198c604414fd9e54a9",
"logicalFrameIndex": 197,
"frameId": 196
}
},
"case": "scroll",
"referencePath": "extracted/bomb_wall/validation/scroll_north_mid.png",
"report": {
"id": "d84acc24-bfc2-4ca9-a2d8-187e93d64858",
"expectedId": "d464d492-f2ba-4ada-8b7f-d42650533c2b",
"actualId": "020f0737-7dfc-4460-b45f-9bcf9be4f118",
"diffId": "0ac00cd9-8a32-4275-b365-d4bca17be5cb",
"expectedSha256": "1772078d532af7782d5d1b5f2e7b19af949f774fc7cf2f56e5b1c1dea25b7696",
"actualSha256": "7b388522e326588a9cc4352a332be834b1face87e39adf925762b5181f9a5e75",
"parameters": {
"roi": {
"x": 0,
"y": 0,
"width": 480,
"height": 270
},
"masks": [],
"alpha": "compare",
"channelLimit": 0,
"allowedDifferentPixels": 0
},
"verdict": "rejected",
"comparedPixels": 129600,
"differentPixels": 41661,
"maximumChannelError": 252,
"boundingBox": {
"x": 0,
"y": 0,
"width": 368,
"height": 255
}
}
}
],
"limitations": "Saved port captures are contextual references, not an independent NES oracle; screen/HUD/scroll reference labels identify their provenance. Current checkpoints are observations and mismatch is retained as a comparison result.",
"kind": "zelda-pilot"
}
]
@@ -0,0 +1,40 @@
{
"runtimeVersion": "0.1.0",
"protocolVersion": {
"major": 1,
"minor": 1
},
"capabilities": [
"boot",
"reset",
"set_input",
"clear_input",
"advance",
"capture",
"get_state",
"get_fault",
"cancel",
"shutdown",
"memcard",
"memcard_mount",
"memcard_unmount",
"get_memcard_state",
"memcard_reconcile",
"memcard_continue_in_memory"
],
"limits": {
"callTimeoutMs": 60000,
"handshakeTimeoutMs": 5000,
"maxCommandBytes": 65536,
"maxFrames": 600,
"maxResponseBytes": 33554432,
"shutdownTimeoutMs": 5000
},
"installation": "/Users/niltonconstantino/personal/workspace.personal/intrepid/prometeu/runtime/dist-staging/stable/prometeu-cli-aarch64-apple-darwin",
"executables": {
"prometeu": "182e4d9a4d32201c8ad892a11c297de7059dcc0a837660bdd173be44808b9906",
"prometeu-headless": "7703190f63844d91fa125ba3a322b5e771db79a282b3cfbb3480eef76422b6ef",
"prometeu-runtime": "0e8e692395cedea799b6d555b416e40536dcabf3a98a2061327d2010c478e446"
},
"probe": "hello followed by shutdown; no initialize/boot/guest execution or media access"
}