Files
prometeu-studio/discussion/lessons/DSC-0107-studio-agent-asset-authoring-budgets/LSN-0112-shared-asset-batches-and-qualified-residency.md
T
bquarkz 1471b427f1
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/pr-master There was a failure building this commit
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.
2026-11-11 01:21:25 +00:00

175 lines
11 KiB
Markdown

---
id: LSN-0112
ticket: studio-agent-asset-authoring-budgets
title: Shared Asset Batches and Qualified Residency
created: 2026-11-11
tags: [studio, packer, assets, automation, mcp, qualification]
---
## Original problem and consolidated decision
**Owner:** studio, asset authoring and residency inspection. Packer owns native
asset identities, canonical scene requests and final preload emission. Compiler,
JavaFX and MCP consume those contracts. This lesson consolidates accepted
DEC-0095 and PLN-0173 from DSC-0107 / AGD-0109.
The old authoring controls could compose banks, but a task needed to understand
manifest persistence. A per-bank glyph meter also could not answer whether a
cartridge exceeded the machine's bank pools. Reusing a runtime version number as
a capacity guarantee would hide executable changes.
The accepted decision requires one shared human/task service, reviewed atomic
batches, explicit incompatible-reference rebinds, complete producer facts and a
budget qualified against the actual selected installation. The user explicitly
removed sound from this wave. Glyph and scene retain the full authoring,
publication, FE/MCP and native qualification obligations. Sound packing and its
capacity profile remain deferred; no limit is inferred for it.
## Final implementation
`AssetAuthoringService` exposes catalog, stable artifacts, read-only details,
revision, ownership/dependencies, budget, PNG authorization, preview, commit and
retained results. `DefaultAssetAuthoringService` admits a local manual caller or
the current project task before considering request deduplication. The disk
adapter retains request parameters and results, so response loss is not a reason
to repeat an applied change. A revoked task cannot recover access by knowing an ID.
The adapter calls existing asset commands, metadata services, animation validation
and the canonical scene emitter on an isolated candidate. It does not implement a
second packer. Mutations cover create/register, authorized PNG import, ordered
glyph selection, explicit palettes, canonical scene composition, contract/preload
and build participation. Scene tiles name stable artifacts; the existing layout
service resolves native indices.
The actual Assets workspace keeps its navigator, selection/order controls and
Bank Capacity meter. Existing bank, palette, contract and scene Apply actions
enter the shared review flow. The inline panel shows qualified/unknown capacity,
existing/build/preload/potential counts, producer facts and ownership staleness.
A human source picker issues an opaque external PNG grant. Manual mutation is
blocked during an agent grant while inspection remains readable. The real desktop
test edits composition, chooses explicit animation rebindings and publishes
through those dialogs; it also verifies the read/mutation distinction under grant.
The ten `studio_assets_*` MCP tools are thin task-scoped projections of this same
service. The [installed authoring guide](../../../prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/resources/pbs-knowledge/examples/game/1/asset-authoring/GUIDE.md)
contains mutation recipes and recovery rules. The installed-distribution probe
checks that the guide, tool instructions, capacity catalog and hashed evidence are
available outside the checkout.
## Reviewed publication and recovery
A revision fingerprints manifests, registry, composition/metadata and asset inputs,
including required absent files. PNG request hashes additionally pin selected
source bytes; grants are project-bound and sources are revalidated at commit.
External writers are not serialized by Studio. A detected change invalidates the
preview; Studio does not promise to stop an external writer that ignores authority.
Every shared packer reader/writer enters the same reentrant project lane and
publication lock. The publisher stages immutable objects and a journal, verifies
before hashes, flushes a commit marker, and replaces files atomically while
excluding shared readers. The commit marker is the irreversible boundary:
| Interruption point | Published truth |
| --- | --- |
| Before commit marker | Prior files remain intact; prepared data is not applied. |
| After commit marker | Recovery rolls the entire batch forward before admitting a reader. |
| After publication, response lost | The retained result reports committed/recovered state. |
Cancellation is not a rollback after commit. Recovery also invalidates cached
packer snapshots. Normal cached provider reads keep their existing behavior;
authoring inspection explicitly refreshes without backfilling identities.
Draft assets can coexist with unfinished banks. A missing accepted scene request
remains a cartridge-blocking producer fact even when draft publication is allowed.
The preview identifies this distinction with `cartridgeBlocking: true`. Changed
invalid glyph compositions are still rejected; no invalid cartridge is qualified.
## Identity and explicit reference changes
Identical reimport preserves source/declaration bytes, artifact identities, order
and animation links. Append retains earlier identities and indices. New bank-local
artifact allocation is repeatable across amended previews, allowing a user to
choose a candidate replacement and then request another preview with that target.
Published identities always take precedence over new allocation.
Reorder, removal, content, size and layout changes analyze actual animation,
scene and metadata references. A preview lists each affected use and requires a
mapping covering it. Keeping the same identity across a reorder is still an
explicit rebind because the native index changed. New replacement targets are
validated against candidate geometry/content and the resulting animation document.
No silent repair is inferred from a matching filename.
Generated-output ownership is descriptive. Records retain owner, producer, input
banks, output hash and dependency input hashes. A changed or missing dependency or
output makes the record stale. Redeclaring an unchanged output cannot erase changed
input history. No query runs a generator or regenerates dependents.
## Content and residency are different budgets
| View | Meaning |
| --- | --- |
| Bank content | Glyph count and capacity derived from that bank's geometry; scene declared artifacts are not bank slots. |
| Existing | Banks discovered in the workspace. |
| Build selection | Registry participation declared by the author. |
| Effective preload | Actual final packer list, with bank identities, native slots and paths. |
| Potential dynamic | Effective pack-set banks outside the preload; a warning about possible residency. |
Logical scenes, layers and glyphs do not allocate an extra bank. Cold scene glyph
dependencies must exist in the pack set but are not implicitly preloaded. Potential
excess is not proof of simultaneous residency.
The application distributes profile
`macos-arm64-cli-0.1.0-18423f7-glyph-scene-v1`, with glyph=16 and scene=16.
Selection checks exact dispatcher, headless and desktop hashes plus every bundled
evidence hash. The dispatcher SHA-256 is
`bb245dd057bbc910053b63c55b75a573ab4e9c9a02b7c79ba89e659bea8e85c3`;
headless is `18423f798ab28bbd38c12a7ee46459f3ef3d08876cc64327952f57be041fc5df`.
Version `0.1.0` alone is insufficient. Ordinary builds do not read runtime sources.
Actual native processes accepted 16 and rejected 17 preloads for each qualified
pool. Native refusal reports `boot_failed`/`vm_panic` with an aggregate backend
error; it does not provide the precise slot facts. Studio's pre-publication
diagnostic obtains responsible slots/IDs/paths from the actual packer plan rather
than fabricating native details.
Shipper and Pack apply the same budget policy before replacing published output.
Rejected excess preserves the prior build byte-for-byte. Dropping the seventeenth
preload permits a qualified build while retaining the potential-residency warning.
An unknown installation may produce an explicitly unqualified build, but managed
headless/desktop start requires a known compatible profile. Admission verifies
complete profile identity, asset input revision, cartridge hashes and the actual
serialized `assets.pa` preload. Every headless BOOT rechecks it; changed components,
inputs or cartridge bytes require a new build.
## Qualification and common mistakes
The [verification record](evidence/verification.json) links test counts, commands,
source hashes and retained logs. Native boundary evidence, managed-build evidence
and before/after Assets screenshots are retained beside it. The bundled profile
keeps its original immutable evidence and digest; a later qualification run does
not silently replace the evidence used to select that profile.
Avoid these failures:
- Treating request IDs as authority or retrying changed parameters under one ID.
- Publishing a candidate after its revision or PNG bytes changed.
- Reporting cancellation as rollback after the durable commit marker.
- Allocating a new candidate identity on each preview amendment.
- Counting all discovered banks as simultaneous resident preloads.
- Inferring limits from a runtime version or a neighboring bank type.
- Using helper JSON counts instead of the serialized final preload at admission.
- Dropping producer paths, missing/duplicate indices or capacity facts in adapters.
- Advertising ownership metadata as an executable generation pipeline.
## Authoritative references
- [Studio Assets specification](../../../docs/specs/studio/4.%20Assets%20Workspace%20Specification.md).
- [Studio state](../../../docs/specs/studio/8.%20Project-Local%20Studio%20State%20Specification.md), [architecture](../../../docs/specs/studio/9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md), [MCP](../../../docs/specs/studio/11.%20MCP%20Tools%20and%20Project%20Knowledge%20Contract.md) and [animation](../../../docs/specs/studio/12.%20Animation%20Authoring%20Specification.md).
- [Packer identity](../../../docs/specs/packer/2.%20Workspace,%20Registry,%20and%20Asset%20Identity%20Specification.md), [declaration](../../../docs/specs/packer/3.%20Asset%20Declaration%20and%20Virtual%20Asset%20Contract%20Specification.md), [build](../../../docs/specs/packer/4.%20Build%20Artifacts%20and%20Deterministic%20Packing%20Specification.md) and [diagnostics](../../../docs/specs/packer/5.%20Diagnostics,%20Operations,%20and%20Studio%20Integration%20Specification.md).
- [Distributed profile catalog](../../../prometeu-app/src/main/resources/asset-capacity/catalog.json) and [original native qualification](evidence/native-capacity-boundaries.json).
PLN-0173 and DEC-0095 are completed workflow scaffolding; their durable contract,
implementation result and evidence are preserved here and in the specifications.
No runtime repository write, runtime build, installation replacement or commit
was performed for this delivery.