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:
@@ -422,6 +422,44 @@ return, revocation or project closure. Cleanup failures never restore authority;
|
||||
the records are still discarded after managed work stops. Neither connection
|
||||
disconnect nor polling silence discards an authorized task's records.
|
||||
|
||||
### Structured runtime observation and recovery
|
||||
|
||||
`studio_operation_get.value.observation` is the immutable operation-final
|
||||
observation, published after worker termination. `currentObservation` is a
|
||||
separate passive session snapshot and may describe later reset/rebuild/shutdown.
|
||||
Both retain available project/task/operation/request and session/build identity;
|
||||
native request identity remains separately correlated. A follow-up lookup MUST
|
||||
NOT execute another advance or rewrite the original frame/progress/cause.
|
||||
|
||||
Headless replies and failures include an `observation` when available. Its fields
|
||||
are `sessionId`, `buildId`, `lifecycle`, `source`, `observedAt`, `progress`,
|
||||
`lastFrame`, `captureStale`, `nativeDetails`, `context`, `unavailable` and `recovery`.
|
||||
Native snapshots in `nativeDetails` retain their own observation provenance.
|
||||
Unsigned frame identities are lossless; unknown completed progress is null.
|
||||
`unavailable` preserves failed inspection separately from the original error.
|
||||
Human diagnostics do not replace structured fault/error/media payloads.
|
||||
|
||||
Lifecycle values are `ABSENT`, `UNKNOWN`, `UNBOOTED`, `BOOTED`, `GUEST_OBSERVED`,
|
||||
`LOST` and `TERMINATED`; the last two describe process availability. Native guest
|
||||
status remains a separate observed fact. Every recovery action has preconditions
|
||||
and `automatic: false`. Available actions describe inspection, original-operation
|
||||
lookup, explicit boot after reset or explicit new-session creation after loss.
|
||||
They never authorize replay or media discard.
|
||||
|
||||
Acquire/release successes expose `control`; release failures preserve the same
|
||||
authority/cleanup facts in `error.details.control` and the native cleanup cause
|
||||
where available. Task revocation is independent of cleanup success. The
|
||||
authenticated `studio_project_context` includes current `control` and `runtime`
|
||||
without admitting work under a revoked task; unavailable connection authentication
|
||||
still requires human inspection/fresh grant. Embedded read-only contexts without
|
||||
an automation service report null observations and an explicit limitation.
|
||||
|
||||
The installed guide MUST cover reset → boot with the same buildId → intentional
|
||||
advance, explicit disposable media, known zero versus unknown progress and lost
|
||||
response lookup with the original clientRequestId. A native refusal is not success;
|
||||
RAM-only continuation or accepted commit is not proof of durable persistence.
|
||||
|
||||
|
||||
## 5. Project Knowledge DTOs
|
||||
|
||||
Neutral `ProjectKnowledge.Context` contains projectRoot/projectName, languages,
|
||||
@@ -670,3 +708,138 @@ When the capability is absent, preserve standard results, report ANALYSIS_DETAIL
|
||||
Details retain component, operation/method, queryId, applicable identity, executionBudgetMs, cleanupBudgetMs, workerTerminated and cleanup. Preserve existing authority, read-only, unsupported and parameter errors. The first failure wins; cleanup status is attached independently. The default budget is 10000+2000 ms as specified by Studio 10. This does not alter runtime deadlines.
|
||||
|
||||
Conformance: StructuredDiagnosticsIntegrationTest exercises all eight unchanged PBS sources (now corrected positives), F1-local and the file-private negative control through authenticated HTTP MCP and the real project LSP; McpTaskToolsTest controlled invalid common IR exercises RET/join through the production backend/gateway/build tool. DiagnosticAnalysisProtocolTest checks retained identity/mismatch/unavailable; LanguageFailureContractTest checks real-socket controlled faults, fallback and delayed child termination. Existing task tests retain deduplication, cross-project isolation and revocation gates.
|
||||
|
||||
## Visual checkpoint evidence tools
|
||||
|
||||
The existing authenticated project MCP endpoint MUST expose studio_evidence_persist,
|
||||
studio_evidence_import, studio_evidence_compare, studio_evidence_list,
|
||||
studio_evidence_metadata, studio_evidence_read, studio_evidence_image and
|
||||
studio_evidence_delete. Each tool MUST require the explicit projectRoot and current
|
||||
taskId. Artifact ID knowledge MUST NOT bypass authority or project scope. No extra
|
||||
server or arbitrary-path binary download route is permitted. Human-only baseline
|
||||
approval and external-path authorization MUST NOT be MCP tools.
|
||||
|
||||
Persist identifies the original operation with exactly one operationId or
|
||||
sourceClientRequestId and a distinct publication clientRequestId. Import/compare
|
||||
also require a publication clientRequestId; same parameters recover the retained
|
||||
publication, and changed parameters conflict. List MUST return at most 100 records
|
||||
per page with offset/nextOffset/total, including request identity for lost-response
|
||||
recovery. Read MUST validate offset/length and permit at most 1 MiB per call; image
|
||||
MUST return integrity-checked PNG image content directly, bounded to 32 MiB. Metadata
|
||||
MUST expose historical artifact identity separately from current staleness.
|
||||
|
||||
Compare MUST require explicit alpha compare/ignore; omitted channelLimit and
|
||||
allowedDifferentPixels default to zero. It MUST return the full shared report;
|
||||
passed/rejected/dimension_mismatch are comparison verdicts, while operational
|
||||
failures use the structured error envelope. Image/bytes and report inspection
|
||||
MUST use IDs inside this endpoint and require no agent transport/comparison scripts.
|
||||
|
||||
## Isolated test target and transcript contract
|
||||
|
||||
The installed task-scoped surface is studio_tests_targets, studio_tests_start,
|
||||
studio_tests_get, studio_tests_cancel, studio_tests_transcript and
|
||||
studio_tests_shutdown. Start takes a declared targetId, maxFrames (1..1000000),
|
||||
blockFrames (1..60), timeoutMs (1..3600000), explicit media and discardUnsaved.
|
||||
Media is memory_fresh, disposable_create or disposable_reopen; reopen requires
|
||||
the creating run's UUID. These are bounded host policies, not guest budget changes.
|
||||
|
||||
Get returns run/request/operation identity, progress, workerTerminated, case/run
|
||||
result, transcriptTotal and the transcript paging tool. It MUST NOT inline the
|
||||
whole transcript into the summary response. Transcript returns offset/nextOffset,
|
||||
total and at most 1024 original native/decoded entries. Paging and repeated
|
||||
summary queries are non-executing. runtimeRetained reports current ownership
|
||||
separately from the immutable original run's cleanup observation. Shutdown requires
|
||||
actual worker termination and explicit discardUnsaved; it preserves native refusal.
|
||||
|
||||
The existing project endpoint MUST support explicit build target selection and
|
||||
shared guest test start/query/cancel/transcript access under current task authority,
|
||||
operationId/clientRequestId deduplication and actual worker termination. Omitted
|
||||
build target MUST be production; a changed target under the same request ID MUST
|
||||
conflict. Tests MUST refuse before guest execution unless the installed provider
|
||||
negotiates protocol 1.2 log_read. Availability MUST reflect implemented advertised
|
||||
handlers, not the existence of these accepted requirements.
|
||||
|
||||
Run results MUST correlate project/task/request/operation/run/target/build/session,
|
||||
retain immutable source/configuration/dependency/asset provenance and separate
|
||||
completion, timeout, cancellation, native failure and infrastructure loss. Case
|
||||
results MUST retain passed/failed/not_run/infrastructure_failure, explicit assertions
|
||||
and original checkpoint IDs. Transcript pages MUST preserve source sequences and
|
||||
loss evidence; requery MUST NOT reapply events or execute another advance. The
|
||||
mandatory success conditions and tagged JSON envelope are defined in the PBS
|
||||
dynamic semantics and common guest-test contracts. Tests MUST use explicit fresh
|
||||
RAM or a disposable run image, never default/personal media implicitly. Delivery
|
||||
uses the shared installed provider; any additional provider correction requires
|
||||
separate scoped authorization before runtime repository writes.
|
||||
|
||||
### Structured assertion detail and host retention
|
||||
|
||||
Optional expected/actual values MUST retain independent availability flags, so an
|
||||
omitted value differs from an observed null. Native sequence/frame/timestamp,
|
||||
source/tag/application and the original event MUST remain correlated in transcript
|
||||
entries. Wall timestamps MUST NOT determine the verdict. An optional boolean
|
||||
passed on case_end/suite_end MAY explicitly reject that case/suite; it MUST NOT
|
||||
override a failed assertion. Non-boolean completion flags are invalid. Checkpoint
|
||||
artifact IDs MUST pass current project admission before inclusion as valid links.
|
||||
|
||||
The initial host accumulator retains at most 16 MiB and 100000 native records per
|
||||
run. Exceeding a host retention bound MUST report explicit infrastructure failure
|
||||
with the bound and retained position, never silently discard records or pass.
|
||||
These are host transcript bounds and do not alter firmware budgets. The installed
|
||||
isolated-tests example uses target-only helpers with complete versioned JSON
|
||||
literals and predicate booleans; it assumes no new guest string formatting ABI.
|
||||
|
||||
## Shared asset authoring contract
|
||||
|
||||
Task-scoped asset operations MUST expose catalog, revision, dependency/ownership
|
||||
and budget queries plus preview, explicit commit and retained result queries
|
||||
over the shared service. Agent requests use stable asset/artifact identities,
|
||||
explicit semantic mutations and request IDs; they do not edit registry or
|
||||
asset-manifest persistence internals. Human external-PNG authorization is not
|
||||
issued by an MCP tool. Project-contained inputs still use normal task read
|
||||
authority and byte validation.
|
||||
|
||||
Preview returns the expected revision, all proposed changed files/assets,
|
||||
before/after hashes, affected references, available producer facts, ownership
|
||||
and conflicts. Commit supplies the batch ID and expected revision. Deduplicate
|
||||
each operation by authenticated project/task/request ID and its complete
|
||||
parameters. Revoke/cross-project checks apply to queries and retries as well as
|
||||
mutations. Cancellation before commit reports no publication; after commit,
|
||||
query/retry returns applied or recovered truth.
|
||||
|
||||
Results preserve producer/code, assetRoot/path/type, missing/duplicate indices,
|
||||
affected references and available used/required/limit facts. FE and MCP MUST
|
||||
show those same values. Budgets distinguish bank content, existing assets,
|
||||
build-included assets, effective final preloads and potential dynamic residency.
|
||||
Unknown profile status and its reason are explicit. A supplied profile or
|
||||
numeric count from an untrusted request does not establish qualification.
|
||||
|
||||
The installed task-scoped tools are `studio_assets_catalog`,
|
||||
`studio_assets_artifacts`, `studio_assets_inspect`, `studio_assets_revision`,
|
||||
`studio_assets_dependencies`, `studio_assets_budget`, `studio_assets_preview`,
|
||||
`studio_assets_preview_get`, `studio_assets_commit` and `studio_assets_result`.
|
||||
Each requires current `projectRoot` and `taskId`. Catalog pagination is bounded;
|
||||
`studio_assets_artifacts` accepts an optional `batchId` to inspect replacement
|
||||
targets in a retained preview. Mutation discriminators are `create`, `register`,
|
||||
`import`, `compose_bank`, `compose_palettes`, `compose_scene`, `update_contract`
|
||||
and `build_participation`. Scene tiles name stable bank/artifact identities;
|
||||
only the canonical packer adapter resolves them to runtime glyph indices.
|
||||
External PNG grants can be issued only through human source selection.
|
||||
The catalog is extended only when shared implementation, authority, recovery,
|
||||
FE parity and qualification gates are present. The existing tool catalog
|
||||
remains authoritative during implementation.
|
||||
|
||||
### Guest producer continuity and native retention
|
||||
|
||||
Every structured guest event payload MUST include a zero-based contiguous integer
|
||||
ordinal; suite_end MUST include eventCount counting all unique events including
|
||||
itself. Retries with the same event identity/content are idempotent. Missing or
|
||||
inconsistent ordinals/final counts fail as infrastructure errors, even if native
|
||||
sequences remain contiguous. Native overflow records historical eviction; only
|
||||
unread gap or actual continuity loss causes a retention failure. Preserve the
|
||||
overflow observation separately.
|
||||
|
||||
Encoded guest messages MUST fit 256 UTF-8 bytes and stay within the unchanged
|
||||
10 messages/application/frame budget, including ordinary application logs. The
|
||||
runner drains every pending native page before another bounded advance. Native
|
||||
continuity alone cannot detect events dropped before ring insertion. No new guest
|
||||
ABI, formatting facility or increased execution/logging budget is introduced.
|
||||
|
||||
Reference in New Issue
Block a user