diff --git a/README.md b/README.md index 17c245c..79df4ff 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ After Effects の **スクリプト/エクステンション開発そのもの ## 現在の状態 -`packages/ae-devtools-cli`(`@ido-bata/ae-devtools-cli@0.7.0`)として CLI + JSX toolchain + +`packages/ae-devtools-cli`(`@ido-bata/ae-devtools-cli@0.8.0`)として CLI + JSX toolchain + capability catalog + conformance gate が shipped 済み(fake-level 検証 + macOS arm64 / AE 26.5 の verified-real-host 証跡あり。Windows・配布・ 実 editor 受入は未検証)。shipped 済みの範囲を超えて **未確定 / 未検証** のままの領域: diff --git a/packages/ae-devtools-cli/README.md b/packages/ae-devtools-cli/README.md index 6d36848..0f2c56d 100644 --- a/packages/ae-devtools-cli/README.md +++ b/packages/ae-devtools-cli/README.md @@ -12,11 +12,21 @@ fake-level evidence として記録され、real-host 検証済みとは表示 ```sh npm install @ido-bata/ae-devtools-cli # registry latest -npm install @ido-bata/ae-devtools-cli@0.7.0 # this release, once published +npm install @ido-bata/ae-devtools-cli@0.8.0 # this release, once published # tarball / local checkout からも可: -npm install ./ae-devtools-cli-0.7.0.tgz +npm install ./ae-devtools-cli-0.8.0.tgz ``` +### Migrating to 0.8.0 + +- The `@ido-bata/ae-a8n` pin moves to `0.6.0`, which publishes the GUI + supervision contract (`ae.supervisionState()`, `AfterEffects.rebuild()`, + `startDetachedSupervisor()`, `ae-a8n supervise status|watch`, durable + `supervision.json`, `A8N_VERSION`). Consumers keep reading the durable + `ae-a8n.supervision/v1` state file — it remains the cross-version / + attached-session contract — but the public API is now available on the + pinned dependency (#408–#410 consumer integration). + ### Migrating to 0.7.0 - The `@ido-bata/ae-a8n` pin is `0.5.0`, which ships `AfterEffects.attach`. @@ -53,7 +63,7 @@ npm install ./ae-devtools-cli-0.7.0.tgz satisfying the capability contract** (#102 handshake exports + #103/#105 fixes). ae-a8n `<=0.1.0-alpha.2` predates them and is refused up front (`AE_A8N_CONTRACT_UNSUPPORTED`; check `ae-devtools doctor` → - `aeA8n.contractOk`). The pin is `@ido-bata/ae-a8n@0.5.0`; override + `aeA8n.contractOk`). The pin is `@ido-bata/ae-a8n@0.6.0`; override with `--ae-a8n-root `. The `fake` session is unaffected. @@ -114,7 +124,7 @@ ae-devtools execute --session a8n --ae-a8n-root --co 解決される ae-a8n が必要 contract(#102 handshake export。#103/#105 修正を祖先に持つ)を満たさない場合は launch 前に `AE_A8N_CONTRACT_UNSUPPORTED` で refuse される — `ae-devtools doctor` -の `aeA8n.contractOk` で事前確認できる。npm pin は `@ido-bata/ae-a8n@0.5.0` +の `aeA8n.contractOk` で事前確認できる。npm pin は `@ido-bata/ae-a8n@0.6.0` で contract を満たす。`<=0.1.0-alpha.2` を 解決した場合は launch 前に refuse される。別 build を使う場合は `--ae-a8n-root ` で override できる。 @@ -136,7 +146,7 @@ AE / GUI 不要で consumer 環境でも動く。 `observe` / `recover` / `verify-exit` は real-host 前提: - ae-a8n #109(GUI 観測)/#111(GUI lease + dialog class)の export を - 含む ae-a8n が必要。npm pin の `@ido-bata/ae-a8n@0.5.0` はこれらを + 含む ae-a8n が必要。npm pin の `@ido-bata/ae-a8n@0.6.0` はこれらを 同梱するため `--ae-a8n-root` なしで解決される。古い ae-a8n を 使う場合のみ `--ae-a8n-root ` を指定する。 - `recover` は devtools-cli の run marker diff --git a/packages/ae-devtools-cli/a8n-transport/supervision.mjs b/packages/ae-devtools-cli/a8n-transport/supervision.mjs new file mode 100644 index 0000000..153f4e2 --- /dev/null +++ b/packages/ae-devtools-cli/a8n-transport/supervision.mjs @@ -0,0 +1,523 @@ +/** + * supervision.mjs — ae-a8n GUI-supervision contract consumer (Issue #408, + * Epic #407; ae-a8n specs/gui-supervision/spec.md, schema + * `ae-a8n.supervision/v1`). + * + * This module is the ONE place ae-devtools reads the durable supervision + * state ae-a8n's monitor publishes. Consumers (recovery-orchestrator, + * dev-loop, devtools-cli, MCP, VSCode) NEVER implement their own GUI + * probing, dialog pressing or recovery policy — they read this contract + * and map it onto their own verdict/surface vocabulary. + * + * Read path (spec §Durable shared state, US6): + * + * /supervision.json — the state document, atomic-published + * /monitor.lease.json — the monitor lease record + * + * `sessionDir` is the ae-a8n session root (`slice.sessionRoot` for a8n + * sessions). The durable FILE is the contract, not the npm export + * surface: this module deliberately implements the documented decode / + * health re-evaluation rules itself so reads keep working for attached + * sessions, post-mortem session dirs, and `--ae-a8n-root` builds that + * predate or postdate any single npm pin. The pinned + * `@ido-bata/ae-a8n@0.6.0` DOES export the public supervision API + * (`supervisionReport`, `readSupervisionState`, `decodeSupervisionDoc`, + * `evaluateObservationHealth`, `waitForSupervisionPhase`, + * `ae.supervisionState()`); `supportsSupervisionApi(mod)` reports + * whether a resolved build offers it. The local decoder is a + * line-for-line port of ae-a8n `state.ts` — same validation, same + * bounded-wait invariant — and `waitForSupervisionPhase` here adds a + * phase-deadline bound the ae-a8n helper does not have, so it is not a + * drop-in replacement. + * + * Honesty rules (mirroring ae-a8n state.ts): + * + * - absent / corrupt / future-version state is `unavailable`, never a + * fabricated healthy report; + * - the stored `observationHealth` is re-evaluated against the monitor + * heartbeat clock at read time — a stale heartbeat is `monitor-lost` + * regardless of what the document claims; + * - `monitor-lost` / `degraded` / `unavailable` health is NEVER folded + * into "healthy" by the verdict mapping below. + */ +import { existsSync, readFileSync } from "node:fs"; +import { join } from "node:path"; + +export const SUPERVISION_SCHEMA_VERSION = "ae-a8n.supervision/v1"; +export const SUPERVISION_STATE_FILE = "supervision.json"; +export const MONITOR_LEASE_FILE = "monitor.lease.json"; +export const MONITOR_LEASE_SCHEMA_VERSION = "ae-a8n.monitor-lease/v1"; +export const DEFAULT_MONITOR_TTL_MS = 30 * 1000; + +export const SUPERVISION_PHASES = Object.freeze([ + "running", + "blocked", + "recovering", + "resumed", + "needs-human", + "quarantined", +]); + +export const OBSERVATION_HEALTHS = Object.freeze(["ok", "degraded", "monitor-lost", "unavailable"]); + +const PHASES = new Set(SUPERVISION_PHASES); +const HEALTHS = new Set(OBSERVATION_HEALTHS); +const HOST_STATES = new Set([ + "none", + "process-gone", + "not-responding", + "busy-suspected", + "gui-session-lost", + "unknown", +]); +const TIERS = new Set(["auto-safe", "human-required", "report-only", "unknown"]); +const PENDING_STATES = new Set(["in-flight", "timed-out", "unknown"]); + +export function supervisionStatePath(sessionDir) { + return join(sessionDir, SUPERVISION_STATE_FILE); +} + +export function monitorLeasePath(sessionDir) { + return join(sessionDir, MONITOR_LEASE_FILE); +} + +function isRecord(v) { + return typeof v === "object" && v !== null && !Array.isArray(v); +} + +function isSupervisionWindow(v) { + return ( + isRecord(v) && + typeof v.title === "string" && + typeof v.role === "string" && + typeof v.blocking === "boolean" && + typeof v.tier === "string" && + TIERS.has(v.tier) + ); +} + +function isPendingRequest(v) { + return ( + isRecord(v) && + typeof v.id === "string" && + typeof v.method === "string" && + typeof v.since === "string" && + typeof v.state === "string" && + PENDING_STATES.has(v.state) + ); +} + +function isMonitorRecord(v) { + return ( + isRecord(v) && + typeof v.ownerId === "string" && + typeof v.pid === "number" && + typeof v.acquiredAt === "string" && + typeof v.heartbeatAt === "string" + ); +} + +function isBlockingInfo(v) { + if (v === null) return true; + return ( + isRecord(v) && + typeof v.host === "string" && + HOST_STATES.has(v.host) && + typeof v.detail === "string" && + Array.isArray(v.windows) && + v.windows.every(isSupervisionWindow) + ); +} + +/** + * Validate a parsed supervision document. Returns the doc or null — a + * document that fails validation is corrupt, never partially trusted. + * Mirrors ae-a8n `decodeSupervisionDoc` including the bounded-wait + * invariant: blocked/recovering/needs-human/quarantined MUST carry a + * deadline, so supervision waits are bounded by contract. + */ +export function decodeSupervisionDoc(value) { + if (!isRecord(value)) return null; + if (value.schemaVersion !== SUPERVISION_SCHEMA_VERSION) return null; + if (typeof value.phase !== "string" || !PHASES.has(value.phase)) return null; + if (typeof value.observationHealth !== "string" || !HEALTHS.has(value.observationHealth)) return null; + if (typeof value.enteredAt !== "string" || typeof value.updatedAt !== "string") return null; + if (value.deadline !== null && typeof value.deadline !== "string") return null; + if (value.sessionId !== null && typeof value.sessionId !== "string") return null; + if (!isBlockingInfo(value.blocking)) return null; + if (!Array.isArray(value.pendingRequests) || !value.pendingRequests.every(isPendingRequest)) return null; + if (value.monitor !== null && !isMonitorRecord(value.monitor)) return null; + if (!Array.isArray(value.evidence) || !value.evidence.every((e) => typeof e === "string")) return null; + if (!Array.isArray(value.history)) return null; + const phase = value.phase; + if ( + (phase === "blocked" || phase === "recovering" || phase === "needs-human" || phase === "quarantined") && + value.deadline === null + ) { + return null; + } + return value; +} + +/** + * Read and validate the state document. Never throws for bad content. + * @returns {{kind:"state",doc:object}|{kind:"absent"}|{kind:"corrupt",detail:string}} + */ +export function readSupervisionState(sessionDir) { + const path = supervisionStatePath(sessionDir); + let text; + try { + text = readFileSync(path, "utf-8"); + } catch (error) { + return error?.code === "ENOENT" + ? { kind: "absent" } + : { kind: "corrupt", detail: `state file exists but cannot be read: ${path}` }; + } + let parsed; + try { + parsed = JSON.parse(text); + } catch { + return { kind: "corrupt", detail: `state file is not valid JSON: ${path}` }; + } + const doc = decodeSupervisionDoc(parsed); + if (doc === null) { + return { kind: "corrupt", detail: `state file failed schema validation: ${path}` }; + } + return { kind: "state", doc }; +} + +/** + * Re-evaluate observation health at read time. The stored value is the + * monitor's last claim; the heartbeat clock is the truth. Ported from + * ae-a8n `evaluateObservationHealth` — same TTL default, same rules. + */ +export function evaluateObservationHealth(doc, now = new Date(), monitorTtlMs = DEFAULT_MONITOR_TTL_MS) { + if (doc.monitor === null) { + return { + health: doc.observationHealth === "ok" ? "unavailable" : doc.observationHealth, + detail: doc.observationHealth === "ok" ? "no monitor is recorded" : null, + }; + } + const heartbeatAt = Date.parse(doc.monitor.heartbeatAt); + if (Number.isNaN(heartbeatAt)) { + return { health: "monitor-lost", detail: "the recorded monitor heartbeat is unreadable" }; + } + if (now.getTime() - heartbeatAt > monitorTtlMs) { + return { + health: "monitor-lost", + detail: + `the monitor heartbeat is stale (last beat ${doc.monitor.heartbeatAt}, ` + + `ttl ${monitorTtlMs}ms); the target's current GUI state is unknown`, + }; + } + return { health: doc.observationHealth, detail: null }; +} + +/** + * Build the supervision report for a session directory — the same shape + * ae-a8n `supervisionReport()` returns (`ae-a8n.supervision/v1` report). + * `status:"unavailable"` is an honest answer, never an empty success. + */ +export function supervisionReport(sessionDir, options = {}) { + const now = options.now ?? new Date(); + const readAt = now.toISOString(); + const result = readSupervisionState(sessionDir); + if (result.kind === "absent") { + return { + status: "unavailable", + source: "absent", + reason: + "no supervision state exists for this session directory; " + + "either supervision never ran or the session dir is wrong", + readAt, + }; + } + if (result.kind === "corrupt") { + return { status: "unavailable", source: "corrupt", reason: result.detail, readAt }; + } + const evaluated = evaluateObservationHealth(result.doc, now, options.monitorTtlMs); + return { + status: "observed", + source: "state", + doc: result.doc, + health: evaluated.health, + healthDetail: evaluated.detail, + readAt, + }; +} + +/** + * Read the monitor lease record (`monitor.lease.json`) for evidence. + * Loose validation: the lease is informational for consumers — the + * authoritative liveness signal is the heartbeat inside the state doc. + * @returns {{kind:"lease",lease:object}|{kind:"absent"}|{kind:"corrupt",detail:string}} + */ +export function readMonitorLease(sessionDir) { + const path = monitorLeasePath(sessionDir); + if (!existsSync(path)) return { kind: "absent" }; + let parsed; + try { + parsed = JSON.parse(readFileSync(path, "utf-8")); + } catch { + return { kind: "corrupt", detail: `monitor lease file is not valid JSON: ${path}` }; + } + if (!isRecord(parsed) || parsed.schemaVersion !== MONITOR_LEASE_SCHEMA_VERSION) { + return { kind: "corrupt", detail: `monitor lease failed schema validation: ${path}` }; + } + return { kind: "lease", lease: parsed }; +} + +// ------------------------------------------------------------ assessment + +/** + * Compact, surface-safe snapshot of a supervision report for embedding + * in evidence/diagnostics payloads. Keeps the honesty axes (status, + * source, phase, health) and the structured human request; drops only + * fields consumers never act on (full history, raw evidence refs stay). + * Returns null for a null/undefined report. + */ +export function supervisionSnapshot(report) { + if (report === null || report === undefined || typeof report !== "object") return null; + if (report.status !== "observed") { + return { + status: "unavailable", + source: report.source ?? null, + reason: typeof report.reason === "string" ? report.reason : null, + readAt: report.readAt ?? null, + }; + } + const doc = report.doc; + return { + status: "observed", + source: report.source ?? "state", + schemaVersion: doc.schemaVersion ?? SUPERVISION_SCHEMA_VERSION, + phase: doc.phase ?? null, + health: report.health ?? doc.observationHealth ?? null, + healthDetail: report.healthDetail ?? null, + blocking: doc.blocking ?? null, + pendingRequests: Array.isArray(doc.pendingRequests) ? doc.pendingRequests : [], + deadline: doc.deadline ?? null, + enteredAt: doc.enteredAt ?? null, + updatedAt: doc.updatedAt ?? null, + monitor: doc.monitor ?? null, + needsHuman: needsHumanInfo(report), + readAt: report.readAt ?? null, + }; +} + +/** + * Structured human-escalation payload (spec US4): what is blocking, why + * automation stopped, the choices the human has, and how to resume. + * Returns null unless the phase actually requires a human + * (`needs-human` or `quarantined`). + * + * `options` lists the button labels the blocking windows expose — they + * are the measured choices a human may take, not automation permissions. + * `requiredAction` and `resumePath` are guidance text; consumers must + * surface them verbatim rather than re-deriving policy. + */ +export function needsHumanInfo(report) { + if (report === null || report === undefined || report.status !== "observed") return null; + const doc = report.doc; + if (doc.phase !== "needs-human" && doc.phase !== "quarantined") return null; + const blocking = doc.blocking ?? null; + const windows = (blocking?.windows ?? []).filter((w) => w.blocking === true); + const dialogs = windows.map((w) => ({ + title: w.title ?? "", + role: w.role ?? "", + subrole: w.subrole ?? null, + tier: w.tier ?? "unknown", + dialogClass: w.dialogClass ?? null, + code: w.code ?? null, + buttons: Array.isArray(w.buttons) ? [...w.buttons] : [], + texts: Array.isArray(w.texts) ? [...w.texts] : [], + })); + const options = [...new Set(dialogs.flatMap((d) => d.buttons))]; + const what = + dialogs.length > 0 + ? dialogs.map((d) => (d.title !== "" ? d.title : `${d.role}${d.dialogClass ? ` (${d.dialogClass})` : ""}`)).join(", ") + : (blocking?.detail ?? `supervision phase '${doc.phase}'`); + return { + phase: doc.phase, + reason: blocking?.detail ?? `After Effects supervision is '${doc.phase}'`, + host: blocking?.host ?? null, + dialogs, + options, + requiredAction: + doc.phase === "quarantined" + ? "Inspect the After Effects window and resolve the blocking state manually; automation will not press unmeasured dialogs." + : "A human decision is required in the After Effects window; automation is paused, not failed.", + resumePath: + "Resolve the dialog/state in After Effects, then re-read supervision status " + + "(ae-devtools supervision status / ae-a8n supervise status) — the session resumes when the monitor observes recovery.", + deadline: doc.deadline ?? null, + enteredAt: doc.enteredAt ?? null, + evidence: Array.isArray(doc.evidence) ? [...doc.evidence] : [], + readAt: report.readAt ?? null, + }; +} + +// ------------------------------------------------------------ verdict mapping + +/** + * Supervision health/phase → recovery-orchestrator verdict escalation + * (Issue #408). Returns one of: + * + * "unknown" — observation cannot be trusted (corrupt state, + * monitor-lost, unavailable health). NEVER clean. + * "quarantined" — phase quarantined or needs-human: a structured + * stop; a human must act. needsHumanInfo() carries + * the dialog/reason/options/resume detail. + * "await-original" — phase blocked/recovering: the affected request + * may still complete; wait within the phase + * deadline, never resend. + * null — no escalation (running/resumed with ok/degraded + * health, or no supervision state at all — "absent" + * is honest non-applicability, not a verdict). + * + * `degraded` health deliberately does NOT escalate: the monitor still + * reports, so the phase is evidence — but it is recorded on the + * snapshot and must never be read as "healthy" by callers. + */ +export function supervisionEscalation(report) { + if (report === null || report === undefined || typeof report !== "object") return null; + if (report.status !== "observed") { + // Corrupt state cannot be classified — unknown, never clean. + // "absent" means supervision never ran for this session dir: honest + // non-applicability, not a failure and not a healthy claim. + return report.source === "corrupt" ? "unknown" : null; + } + const health = report.health ?? report.doc?.observationHealth ?? null; + if (health === "monitor-lost" || health === "unavailable") return "unknown"; + const phase = report.doc?.phase ?? null; + if (phase === "quarantined" || phase === "needs-human") return "quarantined"; + if (phase === "blocked" || phase === "recovering") return "await-original"; + return null; +} + +/** + * Whether a supervision report forbids a "clean" verdict: observation + * health is not ok, or the phase still records an unresolved blocking + * state. Used by verify-exit style acceptance where "clean" asserts the + * GUI is provably unobstructed. + */ +export function supervisionBlocksClean(report) { + if (report === null || report === undefined || report.status !== "observed") { + // Absent supervision cannot disprove cleanliness either way — the + // caller's other evidence channels decide. Corrupt state, however, + // means the GUI state is unclassifiable: not clean. + return report?.source === "corrupt"; + } + const health = report.health ?? report.doc?.observationHealth ?? null; + if (health !== "ok") return true; + const phase = report.doc?.phase ?? null; + return phase !== "running" && phase !== "resumed"; +} + +/** + * Pick the stricter of an existing verdict and a supervision escalation. + * Ordering (most severe first): unknown > quarantined > refused > + * residue > await-original > clean/crash-*. Supervision can only ever + * escalate — it never downgrades a verdict the recovery path earned. + */ +const VERDICT_SEVERITY = { + unknown: 60, + quarantined: 50, + "crash-suspect": 45, + "crash-verified": 40, + "crash-unconfirmed": 35, + residue: 30, + refused: 20, + "await-original": 10, + clean: 0, +}; + +export function stricterVerdict(base, escalation) { + if (escalation === null || escalation === undefined) return base; + const a = VERDICT_SEVERITY[base] ?? 0; + const b = VERDICT_SEVERITY[escalation] ?? 0; + return b > a ? escalation : base; +} + +// ------------------------------------------------------------ session wiring + +/** + * The session directory a devtools session's supervision state lives + * in. `slice` is the raw openSliceSession/openAttachedSliceSession + * result (a8n-transport/session-open.mjs keeps it internal); the + * stripped session may also carry `sessionRoot` directly. + */ +export function sessionDirFor(session) { + const root = session?.slice?.sessionRoot ?? session?.sessionRoot ?? null; + return typeof root === "string" && root.length > 0 ? root : null; +} + +/** + * Read the supervision report for an open dev-loop session. Returns + * null when the session has no ae-a8n session root (fake sessions) — + * callers treat null as "supervision not applicable", which is honest: + * a fake host has no GUI to supervise. + * + * Read-only by construction: this only reads files ae-a8n's monitor + * published. It never starts a monitor, never takes a lease, never + * touches After Effects — safe for attached sessions (Issue #410). + */ +export function supervisionForSession(session, options = {}) { + const dir = sessionDirFor(session); + if (dir === null) return null; + return supervisionReport(dir, options); +} + +/** + * Whether a resolved ae-a8n module exports the supervision API + * (`supervisionReport` et al., ae-a8n #287). Informational only — the + * durable-file reader above works regardless; this tells consumers + * which read path a given ae-a8n build offers. + */ +export function supportsSupervisionApi(mod) { + return ( + mod !== null && + typeof mod === "object" && + typeof mod.supervisionReport === "function" + ); +} + +/** + * Bounded wait for a supervision phase transition (Issue #408: + * "eliminate indefinite waits"). Polls the durable state file — never + * AE — until `phases` includes the current phase, `timeoutMs` elapses, + * or the document's own phase `deadline` passes, whichever is first. + * The wait is ALWAYS bounded: a missing deadline does not extend it. + * + * @returns {Promise<{timedOut:boolean, deadlineExceeded:boolean, report:object}>} + */ +export async function waitForSupervisionPhase(sessionDir, { + phases = null, + timeoutMs = 10_000, + intervalMs = 250, + now = () => new Date(), + sleep = (ms) => new Promise((r) => setTimeout(r, ms)), +} = {}) { + const started = now().getTime(); + const cap = Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : 10_000; + const poll = Number.isFinite(intervalMs) && intervalMs > 0 ? intervalMs : 250; + const wanted = Array.isArray(phases) ? new Set(phases) : null; + let last = supervisionReport(sessionDir, { now: now() }); + for (;;) { + const phase = last.status === "observed" ? last.doc.phase : null; + if (wanted === null || (phase !== null && wanted.has(phase))) { + return { timedOut: false, deadlineExceeded: false, report: last }; + } + const elapsed = now().getTime() - started; + // The phase deadline bounds the wait even when timeoutMs is larger. + const docDeadline = last.status === "observed" && typeof last.doc.deadline === "string" + ? Date.parse(last.doc.deadline) + : null; + const deadlineExceeded = docDeadline !== null && !Number.isNaN(docDeadline) && now().getTime() >= docDeadline; + if (elapsed >= cap || deadlineExceeded) { + return { timedOut: elapsed >= cap && !deadlineExceeded, deadlineExceeded, report: last }; + } + await sleep(Math.min(poll, cap - elapsed)); + last = supervisionReport(sessionDir, { now: now() }); + } +} diff --git a/packages/ae-devtools-cli/a8n-transport/tests/supervision.test.mjs b/packages/ae-devtools-cli/a8n-transport/tests/supervision.test.mjs new file mode 100644 index 0000000..d51b8e8 --- /dev/null +++ b/packages/ae-devtools-cli/a8n-transport/tests/supervision.test.mjs @@ -0,0 +1,281 @@ +/** + * supervision.test.mjs — ae-a8n supervision contract consumer tests + * (Issue #408). Fake level only: durable state files are written into + * temp dirs; no After Effects, no monitor, no GUI is involved. + */ +import assert from "node:assert/strict"; +import { mkdtempSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { test } from "node:test"; + +import { + SUPERVISION_SCHEMA_VERSION, + SUPERVISION_STATE_FILE, + decodeSupervisionDoc, + evaluateObservationHealth, + needsHumanInfo, + readMonitorLease, + readSupervisionState, + supervisionBlocksClean, + supervisionEscalation, + supervisionReport, + supervisionSnapshot, + stricterVerdict, + supervisionStatePath, + waitForSupervisionPhase, +} from "../supervision.mjs"; + +function tmp() { + return mkdtempSync(join(tmpdir(), "ae-sup-")); +} + +const NOW = new Date("2026-11-20T12:00:00.000Z"); + +function doc(overrides = {}) { + return { + schemaVersion: SUPERVISION_SCHEMA_VERSION, + sessionId: "sess-1", + phase: "running", + observationHealth: "ok", + blocking: null, + pendingRequests: [], + enteredAt: "2026-11-20T11:59:00.000Z", + deadline: null, + evidence: [], + monitor: { + ownerId: "mon-1", + pid: 1234, + pidStart: null, + acquiredAt: "2026-11-20T11:58:00.000Z", + heartbeatAt: "2026-11-20T11:59:59.000Z", + }, + history: [], + updatedAt: "2026-11-20T11:59:59.000Z", + ...overrides, + }; +} + +function writeState(dir, value) { + writeFileSync(supervisionStatePath(dir), typeof value === "string" ? value : `${JSON.stringify(value, null, 2)}\n`); +} + +// ------------------------------------------------------------ decode + +test("decodeSupervisionDoc accepts a valid running doc", () => { + assert.equal(decodeSupervisionDoc(doc()) !== null, true); +}); + +test("decodeSupervisionDoc rejects wrong schema version (future/corrupt)", () => { + assert.equal(decodeSupervisionDoc(doc({ schemaVersion: "ae-a8n.supervision/v2" })), null); + assert.equal(decodeSupervisionDoc(doc({ schemaVersion: "other/v9" })), null); +}); + +test("decodeSupervisionDoc enforces the bounded-wait invariant", () => { + // Non-running phases MUST carry a deadline — a doc without one is corrupt. + assert.equal(decodeSupervisionDoc(doc({ phase: "blocked", deadline: null })), null); + assert.equal( + decodeSupervisionDoc(doc({ phase: "needs-human", deadline: "2026-11-20T12:05:00.000Z" })) !== null, + true, + ); +}); + +test("decodeSupervisionDoc rejects malformed windows/pending/monitor", () => { + assert.equal(decodeSupervisionDoc(doc({ blocking: { host: "bogus", detail: "x", windows: [] } })), null); + assert.equal(decodeSupervisionDoc(doc({ pendingRequests: [{ id: 1 }] })), null); + assert.equal(decodeSupervisionDoc(doc({ monitor: { ownerId: "x" } })), null); +}); + +// ------------------------------------------------------------ read/report + +test("readSupervisionState: absent vs corrupt vs state", () => { + const dir = tmp(); + assert.deepEqual(readSupervisionState(dir), { kind: "absent" }); + writeState(dir, "{not json"); + assert.equal(readSupervisionState(dir).kind, "corrupt"); + writeState(dir, doc()); + assert.equal(readSupervisionState(dir).kind, "state"); +}); + +test("supervisionReport: absent is unavailable, never healthy", () => { + const r = supervisionReport(tmp(), { now: NOW }); + assert.equal(r.status, "unavailable"); + assert.equal(r.source, "absent"); +}); + +test("supervisionReport: corrupt is unavailable", () => { + const dir = tmp(); + writeState(dir, "garbage"); + const r = supervisionReport(dir, { now: NOW }); + assert.equal(r.status, "unavailable"); + assert.equal(r.source, "corrupt"); +}); + +test("evaluateObservationHealth: stale heartbeat is monitor-lost even when doc claims ok", () => { + const d = doc({ + monitor: { ownerId: "m", pid: 1, pidStart: null, acquiredAt: "x", heartbeatAt: "2026-11-20T11:00:00.000Z" }, + }); + const r = evaluateObservationHealth(d, NOW, 30_000); + assert.equal(r.health, "monitor-lost"); +}); + +test("evaluateObservationHealth: no monitor recorded downgrades stored ok to unavailable", () => { + const r = evaluateObservationHealth(doc({ monitor: null }), NOW); + assert.equal(r.health, "unavailable"); +}); + +test("evaluateObservationHealth: fresh heartbeat preserves stored degraded", () => { + const d = doc({ observationHealth: "degraded" }); + const r = evaluateObservationHealth(d, NOW, 30_000); + assert.equal(r.health, "degraded"); +}); + +test("readMonitorLease: absent/corrupt/lease", () => { + const dir = tmp(); + assert.equal(readMonitorLease(dir).kind, "absent"); + writeFileSync(join(dir, "monitor.lease.json"), "{}"); + assert.equal(readMonitorLease(dir).kind, "corrupt"); + writeFileSync( + join(dir, "monitor.lease.json"), + JSON.stringify({ schemaVersion: "ae-a8n.monitor-lease/v1", ownerId: "m", pid: 1, acquiredAt: "x", heartbeatAt: "y" }), + ); + assert.equal(readMonitorLease(dir).kind, "lease"); +}); + +// ------------------------------------------------------------ snapshot + needs-human + +test("supervisionSnapshot carries phase/health/needsHuman and stays honest on unavailable", () => { + const dir = tmp(); + const absent = supervisionReport(dir, { now: NOW }); + const snap = supervisionSnapshot(absent); + assert.equal(snap.status, "unavailable"); + assert.equal(snap.needsHuman ?? null, null); + + writeState(dir, doc({ + phase: "needs-human", + deadline: "2026-11-20T12:10:00.000Z", + blocking: { + host: "none", + detail: "sign-in dialog is up", + windows: [{ + title: "Sign In", role: "AXDialog", subrole: null, blocking: true, + tier: "human-required", dialogClass: "sign-in", code: "A8N-AUTH-001", + texts: ["Please sign in"], buttons: ["Cancel", "Sign In"], + }], + }, + })); + const report = supervisionReport(dir, { now: NOW }); + const s2 = supervisionSnapshot(report); + assert.equal(s2.phase, "needs-human"); + assert.equal(s2.health, "ok"); + assert.equal(s2.needsHuman.phase, "needs-human"); + assert.deepEqual(s2.needsHuman.options.sort(), ["Cancel", "Sign In"]); + assert.match(s2.needsHuman.resumePath, /supervision status/); +}); + +test("needsHumanInfo is null for non-human phases", () => { + const dir = tmp(); + writeState(dir, doc({ phase: "blocked", deadline: "2026-11-20T12:05:00.000Z" })); + assert.equal(needsHumanInfo(supervisionReport(dir, { now: NOW })), null); +}); + +// ------------------------------------------------------------ verdict mapping + +test("supervisionEscalation: corrupt → unknown, absent → null", () => { + const dir = tmp(); + assert.equal(supervisionEscalation(supervisionReport(dir, { now: NOW })), null); + writeState(dir, "junk"); + assert.equal(supervisionEscalation(supervisionReport(dir, { now: NOW })), "unknown"); +}); + +test("supervisionEscalation: monitor-lost/unavailable health → unknown regardless of phase", () => { + const dir = tmp(); + writeState(dir, doc({ + phase: "running", + monitor: { ownerId: "m", pid: 1, pidStart: null, acquiredAt: "x", heartbeatAt: "2026-11-20T10:00:00.000Z" }, + })); + assert.equal(supervisionEscalation(supervisionReport(dir, { now: NOW })), "unknown"); +}); + +test("supervisionEscalation: phase mapping", () => { + const cases = [ + ["quarantined", "quarantined"], + ["needs-human", "quarantined"], + ["blocked", "await-original"], + ["recovering", "await-original"], + ["running", null], + ["resumed", null], + ]; + for (const [phase, expected] of cases) { + const dir = tmp(); + writeState(dir, doc({ + phase, + deadline: phase === "running" || phase === "resumed" ? null : "2026-11-20T12:05:00.000Z", + })); + assert.equal(supervisionEscalation(supervisionReport(dir, { now: NOW })), expected, phase); + } +}); + +test("supervisionEscalation: degraded health does not escalate but is not clean", () => { + const dir = tmp(); + writeState(dir, doc({ observationHealth: "degraded" })); + const report = supervisionReport(dir, { now: NOW }); + assert.equal(report.health, "degraded"); + assert.equal(supervisionEscalation(report), null); + assert.equal(supervisionBlocksClean(report), true); +}); + +test("supervisionBlocksClean: ok+running passes; ok+blocked fails", () => { + const dir = tmp(); + writeState(dir, doc()); + assert.equal(supervisionBlocksClean(supervisionReport(dir, { now: NOW })), false); + writeState(dir, doc({ phase: "blocked", deadline: "2026-11-20T12:05:00.000Z" })); + assert.equal(supervisionBlocksClean(supervisionReport(dir, { now: NOW })), true); +}); + +test("stricterVerdict only escalates", () => { + assert.equal(stricterVerdict("await-original", "quarantined"), "quarantined"); + assert.equal(stricterVerdict("quarantined", "await-original"), "quarantined"); + assert.equal(stricterVerdict("clean", "unknown"), "unknown"); + assert.equal(stricterVerdict("unknown", null), "unknown"); + assert.equal(stricterVerdict("await-original", null), "await-original"); +}); + +// ------------------------------------------------------------ bounded wait + +test("waitForSupervisionPhase returns immediately on matching phase", async () => { + const dir = tmp(); + writeState(dir, doc({ phase: "blocked", deadline: "2026-11-20T12:05:00.000Z" })); + const r = await waitForSupervisionPhase(dir, { + phases: ["blocked"], timeoutMs: 50, now: () => NOW, + }); + assert.equal(r.timedOut, false); + assert.equal(r.report.doc.phase, "blocked"); +}); + +test("waitForSupervisionPhase real-clock bound: times out on running phase", async () => { + const dir = tmp(); + writeState(dir, doc()); + const started = Date.now(); + const r = await waitForSupervisionPhase(dir, { + phases: ["blocked"], timeoutMs: 120, intervalMs: 30, + }); + assert.equal(r.timedOut, true); + assert.ok(Date.now() - started < 2_000, "wait stayed bounded"); +}); + +test("waitForSupervisionPhase honours the phase deadline over a larger timeout", async () => { + const dir = tmp(); + // deadline already in the past relative to real now + writeState(dir, doc({ + phase: "needs-human", + deadline: new Date(Date.now() - 1_000).toISOString(), + blocking: { host: "none", detail: "x", windows: [] }, + })); + // phases excludes needs-human → must wait, but deadline already passed → deadlineExceeded + const r = await waitForSupervisionPhase(dir, { + phases: ["resumed"], timeoutMs: 60_000, intervalMs: 50, + }); + assert.equal(r.deadlineExceeded, true); + assert.equal(r.timedOut, false); +}); diff --git a/packages/ae-devtools-cli/dev-loop/failure-record.mjs b/packages/ae-devtools-cli/dev-loop/failure-record.mjs index f3cdb06..15f076a 100644 --- a/packages/ae-devtools-cli/dev-loop/failure-record.mjs +++ b/packages/ae-devtools-cli/dev-loop/failure-record.mjs @@ -50,12 +50,17 @@ function pinSession(pin) { * session — { kind, pin? } session descriptor; kind drives the * evidence label, pin feeds the record's session block * requestId — dispatch request id when the caller has one + * supervision— optional ae-a8n supervision snapshot + * (dev-loop/supervision.mjs supervisionSnapshotForSession, + * Issue #408): attached verbatim as record.supervision so + * every surface reports the same phase/health/needs-human + * state. Additive — absent supervision changes nothing. * collectors — { fromAeError, fromTransportOutcome } from * diagnostics/collectors.mjs (injected, see header) * @returns {object|null} canonical diagnostics record, or null when * the result is not failure-shaped */ -export function recordFromExecuteResult({ result, outcome, session, requestId, collectors } = {}) { +export function recordFromExecuteResult({ result, outcome, session, requestId, supervision, collectors } = {}) { const state = failureOutcome(result, outcome); if (state === null) return null; if ( @@ -103,6 +108,15 @@ export function recordFromExecuteResult({ result, outcome, session, requestId, c ); } + // Additive supervision snapshot (Issue #408): the durable + // ae-a8n.supervision/v1 state observed for this session — phase, + // observation health and the structured needs-human request. The + // diagnostics schema allows forward-compatible fields; consumers + // that predate supervision simply ignore it. + if (supervision !== null && supervision !== undefined && typeof supervision === "object") { + record.supervision = supervision; + } + // Evidence label honesty: "fake" only for fake sessions; "real-host" // only when the failure was actually observed through the host / // transport on an owned AE session (a wire outcome or a host error diff --git a/packages/ae-devtools-cli/dev-loop/session-open.mjs b/packages/ae-devtools-cli/dev-loop/session-open.mjs index ea2030d..4facc26 100644 --- a/packages/ae-devtools-cli/dev-loop/session-open.mjs +++ b/packages/ae-devtools-cli/dev-loop/session-open.mjs @@ -86,6 +86,10 @@ export async function openSession(kind = "fake", options = {}) { runner: s.runner, pin: s.pin, close: () => s.close(), + // ae-a8n session root — the directory the durable supervision + // contract (supervision.json) lives in. Read-only consumers use + // it; it grants no mutation authority (Issue #408/#410). + sessionRoot: typeof s.sessionRoot === "string" ? s.sessionRoot : null, meta: { aeVersion: s.info?.version ?? null, ownership: s.ownership?.kind ?? null, @@ -136,6 +140,8 @@ export async function openSession(kind = "fake", options = {}) { runner: s.runner, pin: s.pin, close: () => s.close(), + // ae-a8n session root — see a8n-attached above (Issue #408). + sessionRoot: typeof s.sessionRoot === "string" ? s.sessionRoot : null, meta: { aeVersion: s.info?.version ?? null, ownership: s.ownership?.kind ?? null, diff --git a/packages/ae-devtools-cli/dev-loop/supervision.mjs b/packages/ae-devtools-cli/dev-loop/supervision.mjs new file mode 100644 index 0000000..ec390f6 --- /dev/null +++ b/packages/ae-devtools-cli/dev-loop/supervision.mjs @@ -0,0 +1,229 @@ +/** + * supervision.mjs — dev-loop supervision snapshot helpers (Issue #408, + * Epic #407). + * + * dev-loop surfaces (CLI, MCP, VSCode) never implement GUI probing, + * dialog pressing or recovery policy. They consume the ae-a8n durable + * supervision contract through a8n-transport/supervision.mjs and attach + * an honest snapshot to evidence/diagnostics payloads: + * + * - the snapshot records phase + observation health + the structured + * needs-human request (dialog, reason, options, resume path); + * - monitor-lost/degraded/unavailable health is recorded verbatim — + * never folded into "healthy"; + * - waits on supervision are ALWAYS bounded (waitForSupervisionPhase + * honours both the caller's timeout and the phase's own deadline); + * - attached sessions get the same read-only view — this module only + * reads files, it never takes a lease or mutates the host. + */ +import { + supervisionForSession, + supervisionReport, + supervisionSnapshot, + supervisionStatePath, + sessionDirFor, + waitForSupervisionPhase, +} from "../a8n-transport/supervision.mjs"; + +export { + supervisionForSession, + supervisionSnapshot, + supervisionStatePath, + waitForSupervisionPhase, + sessionDirFor, +}; + +/** Phases that mean "supervision has something to report". */ +export const BLOCKING_SUPERVISION_PHASES = Object.freeze([ + "blocked", + "recovering", + "needs-human", + "quarantined", +]); + +/** + * Read the supervision report for an open dev-loop session and return + * the compact snapshot used in evidence/diagnostics payloads. Returns + * null for sessions without an ae-a8n session root (fake) — honest + * non-applicability, not a fabricated state. + */ +export function supervisionSnapshotForSession(session, options = {}) { + const report = supervisionForSession(session, options); + return report === null ? null : supervisionSnapshot(report); +} + +/** + * Read the supervision snapshot for an explicit ae-a8n session + * directory (Issue #409): the same durable contract the session-bound + * path uses, for surfaces that name the dir directly (CLI + * `--session-root`, MCP `ae_supervision.sessionRoot`). Read-only — + * never opens a session, never touches AE. + */ +export function supervisionSnapshotForDir(sessionDir, options = {}) { + if (typeof sessionDir !== "string" || sessionDir.length === 0) return null; + return supervisionSnapshot(supervisionReport(sessionDir, options)); +} + +/** + * Bounded wait on an explicit session dir (Issue #409): same contract + * as awaitSupervisionClassification but dir-addressed, for surfaces + * that never opened a session. + * @returns {Promise<{timedOut:boolean, deadlineExceeded:boolean, + * snapshot:object|null}>} + */ +export async function awaitSupervisionPhaseForDir(sessionDir, { + timeoutMs = 5_000, + intervalMs = 250, + phases = BLOCKING_SUPERVISION_PHASES, +} = {}) { + if (typeof sessionDir !== "string" || sessionDir.length === 0) { + return { timedOut: false, deadlineExceeded: false, snapshot: null }; + } + const outcome = await waitForSupervisionPhase(sessionDir, { + phases, + timeoutMs, + intervalMs, + }); + return { + timedOut: outcome.timedOut, + deadlineExceeded: outcome.deadlineExceeded, + snapshot: supervisionSnapshot(outcome.report), + }; +} + +// ------------------------------------------------------------ attached sessions (Issue #410) + +/** + * Whether a session is an explicit-attached session (Issue #366 + * contract): kind a8n-attached, or a session whose policy declares the + * attached/read-only mode. Owned-disposable sessions are NOT attached — + * they keep their own lifecycle and need no target re-validation to + * read their own supervision state. + */ +export function isAttachedSession(session) { + if (session === null || typeof session !== "object") return false; + if (session.kind === "a8n-attached") return true; + const policy = session.policy; + return ( + policy !== null && typeof policy === "object" && + (policy.mode === "attached" || policy.readOnly === true) + ); +} + +/** + * Honest "cannot prove the target" snapshot for attached sessions whose + * identity guard fails or is absent. Deliberately NOT the durable + * report: after a session change / PID reuse / second instance the + * state file may describe a DIFFERENT After Effects, and serving it + * as current would be a false green. Fail closed — unavailable. + */ +function guardUnavailableSnapshot(reason, code = null) { + return { + status: "unavailable", + source: "target-guard", + code, + reason, + readAt: new Date().toISOString(), + }; +} + +/** + * Re-validate an attached session's target identity through the SAME + * `targetGuard` runOperation invokes before mutating dispatches + * (a8n-transport/attached-session.mjs revalidateTarget: census, + * pid/start-stamp, version, project — fail closed on ambiguity). The + * guard itself performs only ae-a8n attested reads; it never mutates. + * + * @returns {Promise<{ok:boolean, code:string|null, detail:string|null}>} + * ok:true for non-attached sessions (guard not required) and for + * attached sessions whose guard passes; ok:false with the guard's + * own code/detail otherwise. Never throws. + */ +export async function attachedTargetGuardVerdict(session) { + if (!isAttachedSession(session)) return { ok: true, code: null, detail: null }; + if (typeof session?.targetGuard !== "function") { + return { + ok: false, + code: "ATTACHED_TARGET_UNGUARDED", + detail: "attached session carries no targetGuard — supervision state cannot be tied to a proven AE instance", + }; + } + try { + const verdict = await session.targetGuard(); + if (verdict !== null && typeof verdict === "object" && verdict.ok === true) { + return { ok: true, code: null, detail: null }; + } + return { + ok: false, + code: typeof verdict?.code === "string" ? verdict.code : "ATTACHED_TARGET_UNVERIFIED", + detail: typeof verdict?.detail === "string" ? verdict.detail : "attached target re-validation did not attest the session", + }; + } catch (error) { + return { + ok: false, + code: "ATTACHED_TARGET_UNVERIFIED", + detail: `attached target re-validation threw: ${String(error?.message ?? error)}`, + }; + } +} + +/** + * Guarded supervision snapshot for any dev-loop session (Issue #410). + * + * - fake / no ae-a8n root → null (honest non-applicability) + * - owned a8n session → the durable report, unguarded (the session + * owns its AE; its own lifecycle bounds staleness) + * - attached session → the target identity is re-validated FIRST; + * a failed/missing guard yields an honest `unavailable` + * (source "target-guard") snapshot instead of a possibly-stale + * report. Reading never promotes ownership and never mutates. + * + * @returns {Promise} supervisionSnapshot() shape, or null + */ +export async function guardedSupervisionSnapshot(session, options = {}) { + const dir = sessionDirFor(session); + if (dir === null) return null; + if (isAttachedSession(session)) { + const verdict = await attachedTargetGuardVerdict(session); + if (!verdict.ok) { + return guardUnavailableSnapshot( + `attached target re-validation failed (${verdict.code}): ${verdict.detail} — ` + + "the durable supervision state may describe a different After Effects instance", + verdict.code, + ); + } + } + return supervisionSnapshot(supervisionReport(dir, options)); +} + +/** + * Bounded wait for supervision to classify a blocking state after a + * dispatch ended UNKNOWN (the modal-dialog case supervision exists + * for). Polls the durable state file only — never AE — until the phase + * reaches one of `phases`, `timeoutMs` elapses, or the document's own + * phase deadline passes, whichever comes first. There is no unbounded + * wait path: a phase without a deadline simply cannot extend the wait. + * + * @returns {Promise<{timedOut:boolean, deadlineExceeded:boolean, + * snapshot:object|null}>} + */ +export async function awaitSupervisionClassification(session, { + timeoutMs = 5_000, + intervalMs = 250, + phases = BLOCKING_SUPERVISION_PHASES, +} = {}) { + const root = session?.slice?.sessionRoot ?? session?.sessionRoot ?? null; + if (typeof root !== "string" || root.length === 0) { + return { timedOut: false, deadlineExceeded: false, snapshot: null }; + } + const outcome = await waitForSupervisionPhase(root, { + phases, + timeoutMs, + intervalMs, + }); + return { + timedOut: outcome.timedOut, + deadlineExceeded: outcome.deadlineExceeded, + snapshot: supervisionSnapshot(outcome.report), + }; +} diff --git a/packages/ae-devtools-cli/dev-loop/tests/supervision.test.mjs b/packages/ae-devtools-cli/dev-loop/tests/supervision.test.mjs new file mode 100644 index 0000000..5925da8 --- /dev/null +++ b/packages/ae-devtools-cli/dev-loop/tests/supervision.test.mjs @@ -0,0 +1,218 @@ +/** + * supervision.test.mjs — dev-loop supervision snapshot tests + * (Issue #408). Fake level only: durable ae-a8n.supervision/v1 files in + * temp dirs; no AE, no monitor, no GUI. + */ +import assert from "node:assert/strict"; +import { mkdtempSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { test } from "node:test"; + +import { + supervisionSnapshotForSession, + awaitSupervisionClassification, + isAttachedSession, + attachedTargetGuardVerdict, + guardedSupervisionSnapshot, +} from "../supervision.mjs"; +import { supervisionStatePath } from "../../a8n-transport/supervision.mjs"; +import { recordFromExecuteResult } from "../failure-record.mjs"; + +function tmp() { + return mkdtempSync(join(tmpdir(), "ae-dl-sup-")); +} + +function writeDoc(dir, overrides = {}) { + const doc = { + schemaVersion: "ae-a8n.supervision/v1", + sessionId: "s1", + phase: "running", + observationHealth: "ok", + blocking: null, + pendingRequests: [], + enteredAt: new Date().toISOString(), + deadline: null, + evidence: [], + monitor: { + ownerId: "m", pid: 1, pidStart: null, + acquiredAt: new Date().toISOString(), heartbeatAt: new Date().toISOString(), + }, + history: [], + updatedAt: new Date().toISOString(), + ...overrides, + }; + writeFileSync(supervisionStatePath(dir), `${JSON.stringify(doc, null, 2)}\n`); + return doc; +} + +test("supervisionSnapshotForSession: null for sessions without an ae-a8n root", () => { + assert.equal(supervisionSnapshotForSession({ kind: "fake" }), null); + assert.equal(supervisionSnapshotForSession(null), null); +}); + +test("supervisionSnapshotForSession reads sessionRoot and slice.sessionRoot", () => { + const dir = tmp(); + writeDoc(dir); + const snap = supervisionSnapshotForSession({ kind: "a8n", sessionRoot: dir }); + assert.equal(snap.status, "observed"); + assert.equal(snap.phase, "running"); + assert.equal(snap.health, "ok"); + const snap2 = supervisionSnapshotForSession({ kind: "a8n-attached", slice: { sessionRoot: dir } }); + assert.equal(snap2.phase, "running"); +}); + +test("supervisionSnapshotForSession: absent state is unavailable, corrupt is unavailable — never healthy", () => { + const absent = supervisionSnapshotForSession({ sessionRoot: tmp() }); + assert.equal(absent.status, "unavailable"); + assert.equal(absent.source, "absent"); + const dir = tmp(); + writeFileSync(supervisionStatePath(dir), "not json"); + const corrupt = supervisionSnapshotForSession({ sessionRoot: dir }); + assert.equal(corrupt.status, "unavailable"); + assert.equal(corrupt.source, "corrupt"); +}); + +test("awaitSupervisionClassification: bounded wait returns blocking phase or times out", async () => { + const dir = tmp(); + writeDoc(dir, { + phase: "blocked", + deadline: new Date(Date.now() + 60_000).toISOString(), + blocking: { host: "busy-suspected", detail: "AE busy", windows: [] }, + }); + const hit = await awaitSupervisionClassification({ sessionRoot: dir }, { timeoutMs: 2_000 }); + assert.equal(hit.timedOut, false); + assert.equal(hit.snapshot.phase, "blocked"); + + // running phase never classifies → bounded timeout, not a hang + const dir2 = tmp(); + writeDoc(dir2); + const started = Date.now(); + const miss = await awaitSupervisionClassification({ sessionRoot: dir2 }, { timeoutMs: 150, intervalMs: 30 }); + assert.equal(miss.timedOut, true); + assert.ok(Date.now() - started < 2_000); +}); + +test("awaitSupervisionClassification: no session root returns immediately", async () => { + const r = await awaitSupervisionClassification({ kind: "fake" }, { timeoutMs: 60_000 }); + assert.equal(r.snapshot, null); + assert.equal(r.timedOut, false); +}); + +// ------------------------------------------------ attached sessions (Issue #410) +// Read-only report access for explicit-attached sessions: the durable +// report is served ONLY while the session's target identity +// re-validates. Session change / PID reuse / second instance / +// missing guard all fail closed — never a possibly-stale report. + +function attachedSession(dir, { guard, policy } = {}) { + return { + kind: "a8n-attached", + evidenceLevel: "verified on real host (attach to a running AE)", + sessionRoot: dir, + policy: policy ?? { readOnly: true, mode: "attached", mutation: { allowedOps: [] } }, + targetGuard: guard ?? (async () => ({ ok: true })), + runner: { call: async () => { throw new Error("runner must never be invoked by supervision reads"); } }, + pin: null, + close: async () => {}, + }; +} + +test("isAttachedSession: kind and policy shapes, owned sessions excluded", () => { + assert.equal(isAttachedSession(attachedSession(tmp())), true); + assert.equal(isAttachedSession({ kind: "a8n", policy: null }), false); + assert.equal(isAttachedSession({ kind: "fake", policy: { readOnly: true } }), true); + assert.equal(isAttachedSession(null), false); +}); + +test("guardedSupervisionSnapshot: attached + passing guard serves the report", async () => { + const dir = tmp(); + writeDoc(dir, { phase: "blocked", deadline: new Date(Date.now() + 60_000).toISOString() }); + const snap = await guardedSupervisionSnapshot(attachedSession(dir)); + assert.equal(snap.status, "observed"); + assert.equal(snap.phase, "blocked"); +}); + +test("guardedSupervisionSnapshot: failing guard fails closed — stale report never served", async () => { + const dir = tmp(); + writeDoc(dir, { phase: "needs-human", deadline: new Date(Date.now() + 60_000).toISOString() }); + const snap = await guardedSupervisionSnapshot(attachedSession(dir, { + guard: async () => ({ ok: false, code: "ATTACHED_TARGET_CHANGED", detail: "pid changed 111 -> 222" }), + })); + assert.equal(snap.status, "unavailable"); + assert.equal(snap.source, "target-guard"); + assert.equal(snap.code, "ATTACHED_TARGET_CHANGED"); + assert.match(snap.reason, /pid changed/); + // The durable phase must NOT leak through a failed guard. + assert.equal(snap.phase ?? null, null); +}); + +test("guardedSupervisionSnapshot: attached session without targetGuard fails closed", async () => { + const dir = tmp(); + writeDoc(dir); + const s = attachedSession(dir); + s.targetGuard = null; + const snap = await guardedSupervisionSnapshot(s); + assert.equal(snap.status, "unavailable"); + assert.equal(snap.code, "ATTACHED_TARGET_UNGUARDED"); +}); + +test("guardedSupervisionSnapshot: owned a8n session reads unguarded; fake is null", async () => { + const dir = tmp(); + writeDoc(dir); + const owned = { kind: "a8n", sessionRoot: dir, policy: null, targetGuard: null }; + const snap = await guardedSupervisionSnapshot(owned); + assert.equal(snap.status, "observed"); + assert.equal(snap.phase, "running"); + assert.equal(await guardedSupervisionSnapshot({ kind: "fake" }), null); +}); + +test("attachedTargetGuardVerdict: non-attached is trivially ok; throwing guard is honest", async () => { + assert.deepEqual(await attachedTargetGuardVerdict({ kind: "a8n" }), { ok: true, code: null, detail: null }); + const s = attachedSession(tmp(), { guard: async () => { throw new Error("census boom"); } }); + const v = await attachedTargetGuardVerdict(s); + assert.equal(v.ok, false); + assert.equal(v.code, "ATTACHED_TARGET_UNVERIFIED"); + assert.match(v.detail, /census boom/); +}); + +test("recordFromExecuteResult attaches supervision snapshot additively", () => { + const dir = tmp(); + writeDoc(dir, { + phase: "needs-human", + deadline: new Date(Date.now() + 60_000).toISOString(), + blocking: { + host: "none", detail: "license expired", + windows: [{ + title: "License", role: "AXWindow", subrole: "AXDialog", blocking: true, + tier: "human-required", dialogClass: "license", code: "X", + texts: [], buttons: ["OK"], + }], + }, + }); + const supervision = supervisionSnapshotForSession({ sessionRoot: dir }); + const record = recordFromExecuteResult({ + result: { status: "FAILED", error: { code: "E_TIMEOUT", message: "timed out" } }, + outcome: "FAILED", + session: { kind: "a8n-attached", pin: null }, + supervision, + collectors: { + fromAeError: () => ({ kind: "transport-outcome", severity: "error" }), + fromTransportOutcome: () => ({ kind: "transport-outcome", severity: "error" }), + }, + }); + assert.ok(record !== null); + assert.equal(record.supervision.phase, "needs-human"); + assert.equal(record.supervision.needsHuman.reason, "license expired"); + // Without supervision the record shape is unchanged. + const plain = recordFromExecuteResult({ + result: { status: "FAILED", error: { code: "E_TIMEOUT", message: "timed out" } }, + outcome: "FAILED", + session: { kind: "a8n-attached", pin: null }, + collectors: { + fromAeError: () => ({ kind: "transport-outcome", severity: "error" }), + fromTransportOutcome: () => ({ kind: "transport-outcome", severity: "error" }), + }, + }); + assert.equal("supervision" in plain, false); +}); diff --git a/packages/ae-devtools-cli/devtools-cli/cli.mjs b/packages/ae-devtools-cli/devtools-cli/cli.mjs index ae44ddc..9ee6496 100644 --- a/packages/ae-devtools-cli/devtools-cli/cli.mjs +++ b/packages/ae-devtools-cli/devtools-cli/cli.mjs @@ -19,10 +19,14 @@ * [--consent grant|deny] [--out ] * [--close-timeout-ms ] * node cli.mjs verify [--read-op ] [--args ''] [same session flags] + * [--supervision-wait-ms ] * node cli.mjs runs — list run-guard markers (residue detection) * node cli.mjs reap [--confirm] — recover a stale owned leftover * node cli.mjs diagnose * [--map-dir d] [--jsx p] [--jsx-map p] [--bundle-map p] + * node cli.mjs supervision [--session-root | --workdir | + * --run-id ] [--wait-ms ] [--wait-phases ] + * — read-only ae-a8n supervision status (Issue #409) * * Failure diagnostics (Issue #103): a failed/refused execute or verify * adds an additive `diagnostics` block to the evidence record — @@ -32,6 +36,24 @@ * marker) and reports fresh resolution. Both are read-only; neither * adds a dispatch path. * + * Supervision (Issue #408): a8n/a8n-attached sessions expose the ae-a8n + * session root; the durable `ae-a8n.supervision/v1` state is read + * (never written, never probed) into `evidence.supervision` and the + * diagnostics block. For UNKNOWN outcomes only, `--supervision-wait-ms` + * (default 5000, 0 disables) gives the monitor a BOUNDED window — also + * capped by the phase's own deadline — to classify a blocking state + * before the evidence is recorded. monitor-lost/degraded/unavailable + * health is reported verbatim, never as healthy. + * + * Supervision status (Issue #409): `supervision` reads the SAME durable + * `ae-a8n.supervision/v1` report every other surface consumes — CLI, + * MCP `ae_supervision`, VSCode. It never opens a session, never + * dispatches, never probes the GUI: the session directory is named + * explicitly (--session-root), derived from a run workdir + * (--workdir → /a8n-session), or recovered from a surviving + * run marker (--run-id). Attached sessions get the identical read-only + * view — reading the report grants no ownership and no mutation. + * * Sessions: * fake — codec-faithful vm host (FAKE/MOCK evidence only) * a8n — owned AE session via a8n-transport (Issue #49); requires that @@ -81,6 +103,12 @@ import { closeSessionWithTimeout, parseCloseTimeoutMs } from "../dev-loop/sessio import { beginRun, markSession, endRun, listRuns, reapRun, recordRequestEvent, noteSessionProcess, processStartStamp, attachEvidence, RUNS_DIR, ATTESTATION_SOURCE } from "./session-guard.mjs"; import { buildFailureDiagnostics, runDiagnose } from "./diagnostics.mjs"; import { failureOutcome, normalizedOutcome, isUnknownOutcome } from "../dev-loop/outcomes.mjs"; +import { awaitSupervisionClassification, guardedSupervisionSnapshot, attachedTargetGuardVerdict } from "../dev-loop/supervision.mjs"; +import { + supervisionReport, + supervisionSnapshot, + waitForSupervisionPhase, +} from "../a8n-transport/supervision.mjs"; import { aeDevtoolsSourceRef } from "./real-run-kit.mjs"; import { createConsentAudit } from "../trusted-execution/consent-audit.mjs"; @@ -311,6 +339,66 @@ async function main() { emit(payload); return code; } + case "supervision": { + // Read-only ae-a8n supervision status (Issue #409). Resolves the + // session dir WITHOUT opening a session: explicit --session-root + // wins, --workdir maps to the canonical /a8n-session + // layout, --run-id recovers the workdir from a surviving run + // marker. --wait-ms/--wait-phases give the monitor a BOUNDED + // window (also capped by the phase deadline) to reach a phase — + // there is no unbounded wait path. + let supDir = null; + let resolvedFrom = null; + if (typeof flags["session-root"] === "string" && flags["session-root"].length > 0) { + supDir = flags["session-root"]; + resolvedFrom = "session-root"; + } else if (typeof flags.workdir === "string" && flags.workdir.length > 0) { + supDir = join(flags.workdir, "a8n-session"); + resolvedFrom = "workdir"; + } else if (typeof flags["run-id"] === "string" && flags["run-id"].length > 0) { + const runs = await listRuns({ dir: RUNS_DIR }); + const marker = runs.find((r) => r.runId === flags["run-id"]) ?? null; + const workdir = marker?.session?.workdir; + if (typeof workdir === "string" && workdir.length > 0) { + supDir = join(workdir, "a8n-session"); + resolvedFrom = "run-marker"; + } + } + if (supDir === null) { + emit({ + schema: "ae-devtools.cli.error/v1", + code: "USAGE", + message: "supervision requires --session-root , --workdir , or --run-id ", + }); + return 2; + } + const waitMsRaw = flags["wait-ms"]; + const waitMs = waitMsRaw === undefined ? 0 : (waitMsRaw === "0" ? 0 : positiveMsFlag(waitMsRaw) ?? 0); + const phases = typeof flags["wait-phases"] === "string" && flags["wait-phases"].length > 0 + ? flags["wait-phases"].split(",").map((s) => s.trim()).filter((s) => s.length > 0) + : null; + let report; + let wait = null; + if (waitMs > 0 && phases !== null) { + const outcome = await waitForSupervisionPhase(supDir, { phases, timeoutMs: waitMs }); + report = outcome.report; + wait = { timeoutMs: waitMs, timedOut: outcome.timedOut, deadlineExceeded: outcome.deadlineExceeded }; + } else { + report = supervisionReport(supDir); + } + const snapshot = supervisionSnapshot(report); + emit({ + schema: "ae-devtools.cli.supervision/v1", + resolvedFrom, + sessionDir: supDir, + supervision: snapshot, + ...(wait !== null ? { wait } : {}), + evidenceLevel: "read-only durable state — no session opened, nothing dispatched", + }); + // Exit nonzero only when the report itself is unavailable — + // needs-human/blocked are observed states, not command failures. + return snapshot?.status === "observed" ? 0 : 1; + } case "discover": { emit({ schema: DEVLOOP_SCHEMA, evidenceLevel: "registry metadata — no dispatch", ...discover({ domain: flags.domain ?? null }) }); return 0; @@ -462,6 +550,43 @@ async function main() { : await verify({ ...shared, readOpId: flags["read-op"] ?? "read.projectSummary", readArgs: args }); evidence.result = result; evidence.outcome = normalizedOutcome(result); + // Durable supervision snapshot (Issue #408/#410): read-only + // consume of the ae-a8n supervision contract for a8n sessions. + // Attached sessions are served only while their target identity + // re-validates (session change / PID reuse fails closed). For + // UNKNOWN outcomes the monitor gets a BOUNDED window (flag or + // 5s default, 0 disables; also capped by the phase deadline) to + // classify a blocking state — there is no unbounded wait path. + let supervisionSnap = await guardedSupervisionSnapshot(state.session); + if (isUnknownOutcome(result) && state.session?.sessionRoot) { + const rawWait = flags["supervision-wait-ms"]; + const waitMs = rawWait === undefined + ? 5_000 + : (rawWait === "0" ? 0 : positiveMsFlag(rawWait) ?? 0); + if (waitMs > 0) { + const waited = await awaitSupervisionClassification(state.session, { timeoutMs: waitMs }); + // Re-validate the attached target after the wait — a guard + // failure discards the snapshot rather than serving state + // that may describe a different AE instance. + const afterGuard = await attachedTargetGuardVerdict(state.session); + if (waited.snapshot !== null && afterGuard.ok) supervisionSnap = waited.snapshot; + else if (!afterGuard.ok) { + supervisionSnap = { + status: "unavailable", + source: "target-guard", + code: afterGuard.code, + reason: `attached target re-validation failed after wait (${afterGuard.code}): ${afterGuard.detail}`, + readAt: new Date().toISOString(), + }; + } + evidence.supervisionWait = { + timeoutMs: waitMs, + timedOut: waited.timedOut, + deadlineExceeded: waited.deadlineExceeded, + }; + } + } + if (supervisionSnap !== null) evidence.supervision = supervisionSnap; // Additive failure diagnostics (Issue #103): a unified // ae-devtools.diagnostics/v1 record plus sourcemap resolution. // Completed runs carry no block; failures always do — an @@ -477,6 +602,7 @@ async function main() { outcome: failState, session: state.session, requestId, + supervision: supervisionSnap, mapDir: typeof flags["map-dir"] === "string" ? flags["map-dir"] : undefined, }); } @@ -554,7 +680,7 @@ async function main() { return code; } default: - process.stderr.write("usage: cli.mjs ...\n"); + process.stderr.write("usage: cli.mjs ...\n"); return 2; } } diff --git a/packages/ae-devtools-cli/devtools-cli/diagnostics.mjs b/packages/ae-devtools-cli/devtools-cli/diagnostics.mjs index 5ddb65c..b963f86 100644 --- a/packages/ae-devtools-cli/devtools-cli/diagnostics.mjs +++ b/packages/ae-devtools-cli/devtools-cli/diagnostics.mjs @@ -69,7 +69,7 @@ export function loadDiagnosticsLibs() { * status "error" — the two are distinct so consumers can tell "module * not installed" from "module ran but failed". */ -export async function buildFailureDiagnostics({ result, outcome, session, requestId, mapDir } = {}) { +export async function buildFailureDiagnostics({ result, outcome, session, requestId, supervision, mapDir } = {}) { const block = { schema: DIAGNOSTICS_BLOCK_SCHEMA, status: "ok", @@ -77,6 +77,10 @@ export async function buildFailureDiagnostics({ result, outcome, session, reques records: [], resolutions: [], mapDir: typeof mapDir === "string" ? mapDir : null, + // Additive supervision snapshot (Issue #408): the durable + // ae-a8n.supervision/v1 state for the session — same block every + // surface reports; absent when the session has no supervision. + ...(supervision !== null && supervision !== undefined ? { supervision } : {}), }; const libs = await loadDiagnosticsLibs(); if (libs.error) { @@ -89,7 +93,7 @@ export async function buildFailureDiagnostics({ result, outcome, session, reques // includes the evidence-label honesty rule, so no post-hoc fixup // is needed here. const record = recordFromExecuteResult({ - result, outcome, session, requestId, + result, outcome, session, requestId, supervision, collectors: libs.collectors, }); if (record !== null) { diff --git a/packages/ae-devtools-cli/devtools-cli/tests/run.mjs b/packages/ae-devtools-cli/devtools-cli/tests/run.mjs index 4330c9b..7bfe30d 100644 --- a/packages/ae-devtools-cli/devtools-cli/tests/run.mjs +++ b/packages/ae-devtools-cli/devtools-cli/tests/run.mjs @@ -3,7 +3,7 @@ */ import assert from "node:assert/strict"; import { execFileSync, spawn } from "node:child_process"; -import { mkdtempSync, rmSync, existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; +import { mkdtempSync, mkdirSync, rmSync, existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; @@ -991,4 +991,103 @@ t("diagnose refuses marker-lookup traversal ids", () => { assert.ok(r.body.notes.some((n) => n.includes("no such file or run marker")), JSON.stringify(r.body.notes)); }); +// ------------------------------------------------ supervision status (Issue #409) +// Fake level only: durable ae-a8n.supervision/v1 files in temp dirs. +// The CLI supervision command reads files — no session, no AE. + +function writeSupDoc(dir, overrides = {}) { + const doc = { + schemaVersion: "ae-a8n.supervision/v1", + sessionId: "s1", + phase: "running", + observationHealth: "ok", + blocking: null, + pendingRequests: [], + enteredAt: new Date().toISOString(), + deadline: null, + evidence: [], + monitor: { + ownerId: "m", pid: 1, pidStart: null, + acquiredAt: new Date().toISOString(), heartbeatAt: new Date().toISOString(), + }, + history: [], + updatedAt: new Date().toISOString(), + ...overrides, + }; + writeFileSync(join(dir, "supervision.json"), `${JSON.stringify(doc, null, 2)}\n`); +} + +t("supervision --session-root reports the durable report, needs-human verbatim", () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-cli-")); + writeSupDoc(dir, { + phase: "needs-human", + deadline: new Date(Date.now() + 60_000).toISOString(), + blocking: { + host: "none", detail: "sign-in required", + windows: [{ + title: "Sign In", role: "AXWindow", subrole: "AXDialog", blocking: true, + tier: "human-required", dialogClass: "sign-in", code: "X", + texts: [], buttons: ["Cancel", "Sign In"], + }], + }, + }); + const r = run(["supervision", "--session-root", dir]); + assert.equal(r.code, 0); + assert.equal(r.body.schema, "ae-devtools.cli.supervision/v1"); + assert.equal(r.body.resolvedFrom, "session-root"); + assert.equal(r.body.supervision.status, "observed"); + assert.equal(r.body.supervision.phase, "needs-human"); + assert.equal(r.body.supervision.needsHuman.reason, "sign-in required"); + assert.deepEqual(r.body.supervision.needsHuman.options.sort(), ["Cancel", "Sign In"]); + assert.match(r.body.supervision.needsHuman.resumePath, /supervision status/); + rmSync(dir, { recursive: true, force: true }); +}); + +t("supervision --workdir derives /a8n-session; absent state is unavailable", () => { + const workdir = mkdtempSync(join(tmpdir(), "ae-sup-wd-")); + const sessionDir = join(workdir, "a8n-session"); + mkdirSync(sessionDir, { recursive: true }); + const absent = run(["supervision", "--workdir", workdir]); + assert.equal(absent.code, 1); + assert.equal(absent.body.resolvedFrom, "workdir"); + assert.equal(absent.body.supervision.status, "unavailable"); + assert.equal(absent.body.supervision.source, "absent"); + writeSupDoc(sessionDir); + const observed = run(["supervision", "--workdir", workdir]); + assert.equal(observed.code, 0); + assert.equal(observed.body.supervision.phase, "running"); + rmSync(workdir, { recursive: true, force: true }); +}); + +t("supervision without a resolvable dir is a usage error", () => { + const r = run(["supervision"]); + assert.equal(r.code, 2); + assert.equal(r.body.code, "USAGE"); +}); + +t("supervision absent/corrupt state exits 1, never reports healthy", () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-none-")); + const absent = run(["supervision", "--session-root", dir]); + assert.equal(absent.code, 1); + assert.equal(absent.body.supervision.status, "unavailable"); + assert.equal(absent.body.supervision.source, "absent"); + writeFileSync(join(dir, "supervision.json"), "not json"); + const corrupt = run(["supervision", "--session-root", dir]); + assert.equal(corrupt.code, 1); + assert.equal(corrupt.body.supervision.source, "corrupt"); + rmSync(dir, { recursive: true, force: true }); +}); + +t("supervision --wait-ms is bounded: running phase times out honestly", () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-wait-")); + writeSupDoc(dir); + const started = Date.now(); + const r = run(["supervision", "--session-root", dir, "--wait-ms", "200", "--wait-phases", "blocked,needs-human"]); + assert.equal(r.code, 0); + assert.equal(r.body.wait.timedOut, true); + assert.equal(r.body.supervision.phase, "running"); + assert.ok(Date.now() - started < 10_000); + rmSync(dir, { recursive: true, force: true }); +}); + await finish("tests passed"); diff --git a/packages/ae-devtools-cli/docs/adoption.md b/packages/ae-devtools-cli/docs/adoption.md index 3fac2a4..cc964f9 100644 --- a/packages/ae-devtools-cli/docs/adoption.md +++ b/packages/ae-devtools-cli/docs/adoption.md @@ -21,7 +21,7 @@ npm install --save-dev @ido-bata/ae-devtools-cli `--session a8n` は owned AE session を `@ido-bata/ae-a8n` 経由で使う。 この経路が要求する ae-a8n contract(capability handshake export = ae-a8n#102。#103 extension prelude / #105 LaunchServices 修正を祖先に持つ)を -満たすのは ae-a8n `release-0-2-0` 以降。npm pin は `@ido-bata/ae-a8n@0.5.0` +満たすのは ae-a8n `release-0-2-0` 以降。npm pin は `@ido-bata/ae-a8n@0.6.0` で、これを満たす。`<=0.1.0-alpha.2` を 解決した場合のみ contract gate が launch 前に refuse する。 @@ -173,7 +173,7 @@ tarball install して実行: 必要とする ae-a8n surface(`readGuiSession` / `listAppInstances` / `censusRunnerInSession` / `windowServerCensus` / `MacGuiRecovery` / `MacHostRecovery` / GUI lease 関連 export)は、公開版 - `@ido-bata/ae-a8n@0.5.0` が全て ship しているため、pinned + `@ido-bata/ae-a8n@0.6.0` が全て ship しているため、pinned dependency のまま動作する。`--ae-a8n-root` は別 build / 開発版の ae-a8n を指したい場合の override であり必須ではない。コマンド別に 必要 export が検証され、欠落時は `AE_A8N_SURFACE_MISSING` で diff --git a/packages/ae-devtools-cli/mcp-server/tests/server.test.mjs b/packages/ae-devtools-cli/mcp-server/tests/server.test.mjs index 845c81b..82ea3ec 100644 --- a/packages/ae-devtools-cli/mcp-server/tests/server.test.mjs +++ b/packages/ae-devtools-cli/mcp-server/tests/server.test.mjs @@ -18,7 +18,7 @@ import { createServer, SERVER_NAME } from "../server.mjs"; import { loadTrustedCodec, createJsxRunner } from "../../trusted-execution/runner.mjs"; import { openFakeSession } from "../../devtools-cli/fake-session.mjs"; import { reapRun } from "../../devtools-cli/session-guard.mjs"; -import { mkdtempSync, readdirSync, readFileSync, rmSync, existsSync } from "node:fs"; +import { mkdtempSync, readdirSync, readFileSync, rmSync, existsSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; const HERE = dirname(fileURLToPath(import.meta.url)); @@ -133,7 +133,7 @@ test("tools/list exposes the dev-loop tools including ae_session", async () => { const c = makeClient(); const res = await c.request("tools/list"); const names = res.result.tools.map((t) => t.name).sort(); - assert.deepEqual(names, ["ae_discover", "ae_execute", "ae_inspect", "ae_session", "ae_verify"]); + assert.deepEqual(names, ["ae_discover", "ae_execute", "ae_inspect", "ae_session", "ae_supervision", "ae_verify"]); for (const t of res.result.tools) { assert.equal(t.inputSchema.type, "object"); assert.ok(t.description.length > 0); @@ -252,6 +252,223 @@ test("ae_session reports failed state after a rejected session open", async () = await c.server.close(); }); +// ------------------------------------------------ supervision (Issue #409) +// Fake level only: durable ae-a8n.supervision/v1 files in temp dirs. +// No AE, no monitor, no GUI — the tool reads files, nothing else. + +function writeSupervisionDoc(dir, overrides = {}) { + const doc = { + schemaVersion: "ae-a8n.supervision/v1", + sessionId: "s1", + phase: "running", + observationHealth: "ok", + blocking: null, + pendingRequests: [], + enteredAt: new Date().toISOString(), + deadline: null, + evidence: [], + monitor: { + ownerId: "m", pid: 1, pidStart: null, + acquiredAt: new Date().toISOString(), heartbeatAt: new Date().toISOString(), + }, + history: [], + updatedAt: new Date().toISOString(), + ...overrides, + }; + writeFileSync(join(dir, "supervision.json"), `${JSON.stringify(doc, null, 2)}\n`); + return doc; +} + +test("ae_supervision reads an explicit sessionRoot — same snapshot shape as every surface", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-mcp-")); + writeSupervisionDoc(dir, { + phase: "needs-human", + deadline: new Date(Date.now() + 60_000).toISOString(), + blocking: { + host: "none", detail: "license dialog is up", + windows: [{ + title: "License", role: "AXWindow", subrole: "AXDialog", blocking: true, + tier: "human-required", dialogClass: "license", code: "X", + texts: [], buttons: ["OK"], + }], + }, + }); + const { factory, calls } = countingSessionFactory(); + const c = makeClient({ sessionFactory: factory }); + const { payload, isError } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: { sessionRoot: dir }, + })); + assert.equal(isError, false); + assert.equal(calls.count, 0, "ae_supervision must never open a session"); + assert.equal(payload.resolvedFrom, "sessionRoot"); + assert.equal(payload.supervision.status, "observed"); + assert.equal(payload.supervision.phase, "needs-human"); + // Structured needs-human detail rides every surface verbatim. + assert.equal(payload.supervision.needsHuman.reason, "license dialog is up"); + assert.deepEqual(payload.supervision.needsHuman.options, ["OK"]); + assert.match(payload.supervision.needsHuman.resumePath, /supervision status/); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + +test("ae_supervision without session or sessionRoot reports honest unavailable", async () => { + const { factory, calls } = countingSessionFactory(); + const c = makeClient({ sessionFactory: factory }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: {}, + })); + assert.equal(payload.supervision.status, "unavailable"); + assert.match(payload.supervision.reason, /no sessionRoot/); + assert.equal(calls.count, 0); + await c.server.close(); +}); + +test("ae_supervision uses the open session's root; fake session has none", async () => { + const c = makeClient(); + await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "read.projectSummary", consent: "grant" }, + }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: {}, + })); + assert.equal(payload.resolvedFrom, "open-session"); + // fake sessions have no ae-a8n session root — honest unavailable, + // never a fabricated running state. + assert.equal(payload.supervision.status, "unavailable"); + await c.server.close(); +}); + +test("ae_session carries the supervision snapshot when a session with a root is open", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-sess-")); + writeSupervisionDoc(dir, { phase: "blocked", deadline: new Date(Date.now() + 60_000).toISOString() }); + const s = fakeA8nSession(); + s.sessionRoot = dir; + const c = makeClient({ sessionFactory: async () => s }); + await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "read.projectSummary", consent: "grant" }, + }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_session", arguments: {}, + })); + assert.equal(payload.supervision.phase, "blocked"); + assert.equal(payload.supervision.health, "ok"); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + +// ------------------------------------------------ attached supervision (Issue #410) +// Read-only report access for explicit-attached sessions, fail-closed on +// target-identity drift. Fake level only: session objects are shaped +// like the stripped a8n-attached session; the guard is a stub — the +// real revalidateTarget census/pid/project checks are covered by +// a8n-transport/tests/attached-session.test.mjs. + +function fakeAttachedSession(dir, { guard } = {}) { + // Codec-faithful fake host underneath: read dispatches complete so the + // session can be opened; mutating ops are refused by session policy + // BEFORE the runner is ever invoked. + const base = openFakeSession(); + return { + kind: "a8n-attached", + evidenceLevel: "verified on real host (attach to a running AE)", + sessionRoot: dir, + policy: { readOnly: true, mode: "attached", mutation: { allowedOps: [] } }, + targetGuard: guard ?? (async () => ({ ok: true })), + runner: base.runner, + pin: base.pin, + meta: { aeVersion: "26.5-fake", ownership: "attached", attached: true }, + close: async () => {}, + }; +} + +test("ae_supervision on attached session: passing guard serves report, no dispatch", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-att-")); + writeSupervisionDoc(dir, { phase: "running" }); + const s = fakeAttachedSession(dir); + const c = makeClient({ sessionFactory: async () => s }); + // Open the session first via a read dispatch. + await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "read.projectSummary", consent: "grant" }, + }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: {}, + })); + assert.equal(payload.resolvedFrom, "open-session"); + assert.equal(payload.supervision.status, "observed"); + assert.equal(payload.supervision.phase, "running"); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + +test("ae_supervision on attached session: failed target guard fails closed", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-att-fail-")); + writeSupervisionDoc(dir, { phase: "needs-human", deadline: new Date(Date.now() + 60_000).toISOString() }); + const s = fakeAttachedSession(dir, { + guard: async () => ({ ok: false, code: "ATTACHED_TARGET_AMBIGUOUS", detail: "2 AE processes match" }), + }); + const c = makeClient({ sessionFactory: async () => s }); + await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "read.projectSummary", consent: "grant" }, + }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: {}, + })); + assert.equal(payload.supervision.status, "unavailable"); + assert.equal(payload.supervision.source, "target-guard"); + assert.equal(payload.supervision.code, "ATTACHED_TARGET_AMBIGUOUS"); + // The durable phase must not leak through a failed guard. + assert.equal(payload.supervision.phase ?? null, null); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + +test("ae_supervision on attached session without targetGuard fails closed", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-att-noguard-")); + writeSupervisionDoc(dir); + const s = fakeAttachedSession(dir); + s.targetGuard = null; + const c = makeClient({ sessionFactory: async () => s }); + await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "read.projectSummary", consent: "grant" }, + }); + const { payload } = toolPayload(await c.request("tools/call", { + name: "ae_supervision", arguments: {}, + })); + assert.equal(payload.supervision.status, "unavailable"); + assert.equal(payload.supervision.code, "ATTACHED_TARGET_UNGUARDED"); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + +test("attached read-only session: mutating op refused before dispatch, supervision rides diagnostics", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-att-mut-")); + writeSupervisionDoc(dir, { + phase: "needs-human", + deadline: new Date(Date.now() + 60_000).toISOString(), + blocking: { host: "none", detail: "modal needs a human", windows: [] }, + }); + const s = fakeAttachedSession(dir); + const c = makeClient({ sessionFactory: async () => s }); + const { payload, isError } = toolPayload(await c.request("tools/call", { + name: "ae_execute", + arguments: { opId: "item.addComp", args: { name: "x" }, consent: "grant" }, + })); + assert.equal(isError, true); + assert.equal(payload.result.status, "refused"); + assert.equal(payload.result.reason, "READ_ONLY_SESSION"); + // The refusal never reached the runner — supervision still reports + // the human-required state as structured diagnostics. + assert.equal(payload.diagnostics.supervision.phase, "needs-human"); + assert.equal(payload.diagnostics.supervision.needsHuman.reason, "modal needs a human"); + rmSync(dir, { recursive: true, force: true }); + await c.server.close(); +}); + test("ae_execute without consent is refused BEFORE any session opens (default deny)", async () => { const { factory, calls } = countingSessionFactory(); const c = makeClient({ sessionFactory: factory }); @@ -643,7 +860,7 @@ test("spawned server over real stdio: initialize → tools → execute → verif child.stdin.write(JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized" }) + "\n"); const list = await request("tools/list"); - assert.equal(list.result.tools.length, 5); + assert.equal(list.result.tools.length, 6); const ex = await request("tools/call", { name: "ae_execute", diff --git a/packages/ae-devtools-cli/mcp-server/tools.mjs b/packages/ae-devtools-cli/mcp-server/tools.mjs index 5065295..81cfa5b 100644 --- a/packages/ae-devtools-cli/mcp-server/tools.mjs +++ b/packages/ae-devtools-cli/mcp-server/tools.mjs @@ -30,6 +30,13 @@ import { discover, inspect, execute, verify, sessionStatus, DEVLOOP_SCHEMA } from "../dev-loop/devloop.mjs"; import { failureOutcome, normalizedOutcome, isUnknownOutcome } from "../dev-loop/outcomes.mjs"; import { recordFromExecuteResult } from "../dev-loop/failure-record.mjs"; +import { + supervisionSnapshotForDir, + awaitSupervisionPhaseForDir, + guardedSupervisionSnapshot, + attachedTargetGuardVerdict, +} from "../dev-loop/supervision.mjs"; +import { sessionDirFor } from "../a8n-transport/supervision.mjs"; export const MCP_SCHEMA = "ae-devtools.mcp/v1"; @@ -97,6 +104,20 @@ export const TOOLS = [ "Report session/API metadata: configured session kind, whether a session is open/opening/failed/closed in this server process, and the evidence level of an open session. Metadata only — never opens a session and never dispatches.", inputSchema: { ...OBJECT, properties: {}, additionalProperties: false }, }, + { + name: "ae_supervision", + description: + "Read the ae-a8n GUI-supervision status for a session (ae-a8n.supervision/v1 durable report): phase, observation health, pending requests, and the structured needs-human request (blocking dialog, reason, options, required action, resume path) when a human must act. Read-only — never opens a session, never dispatches, never probes the GUI. Pass sessionRoot to read a specific ae-a8n session dir; otherwise the already-open session's supervision state is reported. monitor-lost/degraded/unavailable health is reported verbatim, never as healthy.", + inputSchema: { + ...OBJECT, + properties: { + sessionRoot: { ...STRING, description: "ae-a8n session directory holding supervision.json (optional; defaults to the open session's root)" }, + waitMs: { type: "number", description: "Optional bounded wait (ms) for the phase to reach waitPhases; also capped by the phase deadline. 0/absent = single read." }, + waitPhases: { type: "array", items: { ...STRING }, description: "Phases to wait for when waitMs is set (default: blocked/recovering/needs-human/quarantined)" }, + }, + additionalProperties: false, + }, + }, ]; const TOOL_NAMES = new Set(TOOLS.map((t) => t.name)); @@ -148,14 +169,25 @@ async function failureDiagnostics({ result, session, requestId }) { if (state === null) return null; try { const collectors = await diagnosticsCollectors(); + // Durable supervision snapshot (Issue #408/#410): read-only consume + // of the ae-a8n supervision contract; attached sessions get the same + // view behind the target-identity guard — this never mutates. + const supervision = await guardedSupervisionSnapshot(session); const record = recordFromExecuteResult({ result, outcome: state, session: { kind: session.kind, pin: session.pin }, requestId, + supervision, collectors, }); - return record === null ? null : { status: "ok", records: [record] }; + return record === null + ? null + : { + status: "ok", + records: [record], + ...(supervision !== null ? { supervision } : {}), + }; } catch (e) { return { status: "unavailable", reason: String(e?.message ?? e), records: [] }; } @@ -313,18 +345,102 @@ export async function callTool(name, args = {}, ctx = {}) { } case "ae_session": { const peek = typeof ctx.peekSession === "function" ? ctx.peekSession() : {}; + const openSession = peek.session ?? null; + // Additive supervision snapshot (Issue #409/#410): when a session + // is already open its durable ae-a8n supervision state rides + // along — the same report ae_supervision returns, behind the + // attached-target guard. Absent when no session is open or the + // session has no ae-a8n root (fake). Read-only. + const sup = openSession !== null ? await guardedSupervisionSnapshot(openSession) : null; return toolResult({ schema: MCP_SCHEMA, evidenceLevel: "metadata only — this call never opens a session", ...sessionStatus({ - session: peek.session ?? null, + session: openSession, sessionKind: ctx.sessionKind ?? null, opening: peek.opening === true, failed: peek.failed === true, }), + ...(sup !== null ? { supervision: sup } : {}), api: { mcp: MCP_SCHEMA, devLoop: DEVLOOP_SCHEMA }, }); } + case "ae_supervision": { + // Read-only durable supervision status (Issue #409). Resolution: + // explicit args.sessionRoot wins; otherwise the ALREADY-OPEN + // session's root is used — this tool never opens a session, so a + // closed server reports an honest unavailable, not a fabricated + // state. Attached sessions get the identical read-only view. + const peek = typeof ctx.peekSession === "function" ? ctx.peekSession() : {}; + const openSession = peek.session ?? null; + const explicitRoot = typeof args.sessionRoot === "string" && args.sessionRoot.length > 0 + ? args.sessionRoot + : null; + const dir = explicitRoot ?? (openSession !== null ? sessionDirFor(openSession) : null); + const waitMs = Number.isFinite(Number(args.waitMs)) && Number(args.waitMs) > 0 + ? Number(args.waitMs) + : 0; + const phases = Array.isArray(args.waitPhases) + ? args.waitPhases.filter((p) => typeof p === "string" && p.length > 0) + : null; + let snapshot = null; + let wait = null; + if (dir !== null) { + // Attached sessions (Issue #410): the durable state file is only + // served while the session's target identity re-validates — + // checked before AND after any bounded wait, so a session + // change / PID reuse / second instance mid-wait fails closed. + const guardCheck = async () => + openSession !== null && explicitRoot === null + ? attachedTargetGuardVerdict(openSession) + : { ok: true, code: null, detail: null }; + const before = await guardCheck(); + if (!before.ok) { + snapshot = { + status: "unavailable", + source: "target-guard", + code: before.code, + reason: `attached target re-validation failed (${before.code}): ${before.detail} — the durable supervision state may describe a different After Effects instance`, + readAt: new Date().toISOString(), + }; + } else if (waitMs > 0) { + const outcome = await awaitSupervisionPhaseForDir(dir, { + timeoutMs: waitMs, + phases: phases !== null && phases.length > 0 ? phases : undefined, + }); + const after = await guardCheck(); + snapshot = after.ok ? outcome.snapshot : { + status: "unavailable", + source: "target-guard", + code: after.code, + reason: `attached target re-validation failed after wait (${after.code}): ${after.detail}`, + readAt: new Date().toISOString(), + }; + wait = { timeoutMs: waitMs, timedOut: outcome.timedOut, deadlineExceeded: outcome.deadlineExceeded }; + } else if (openSession !== null && explicitRoot === null) { + // Session-bound read goes through the guarded snapshot so the + // report is only served for a proven attached target. + snapshot = await guardedSupervisionSnapshot(openSession); + } else { + snapshot = supervisionSnapshotForDir(dir); + } + } + return toolResult({ + schema: MCP_SCHEMA, + evidenceLevel: "read-only durable state — no session opened, nothing dispatched", + resolvedFrom: explicitRoot !== null ? "sessionRoot" : openSession !== null ? "open-session" : null, + ...(openSession !== null ? { session: sessionBlock(openSession) } : {}), + supervision: snapshot ?? { + status: "unavailable", + source: null, + reason: explicitRoot === null && openSession === null + ? "no session is open in this server and no sessionRoot was given; pass sessionRoot to read a specific ae-a8n session dir" + : "the resolved session has no ae-a8n supervision state", + readAt: new Date().toISOString(), + }, + ...(wait !== null ? { wait } : {}), + }); + } default: return toolResult({ schema: MCP_SCHEMA, error: `unhandled tool '${name}'` }, true); } diff --git a/packages/ae-devtools-cli/package-lock.json b/packages/ae-devtools-cli/package-lock.json index 8266bd5..6e4efbd 100644 --- a/packages/ae-devtools-cli/package-lock.json +++ b/packages/ae-devtools-cli/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ido-bata/ae-devtools-cli", - "version": "0.7.0", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ido-bata/ae-devtools-cli", - "version": "0.7.0", + "version": "0.8.0", "license": "MIT", "dependencies": { - "@ido-bata/ae-a8n": "0.5.0", + "@ido-bata/ae-a8n": "0.6.0", "acorn": "^8.19.0", "esbuild": "0.28.2", "jsonc-parser": "^3.3.1", @@ -445,9 +445,9 @@ } }, "node_modules/@ido-bata/ae-a8n": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@ido-bata/ae-a8n/-/ae-a8n-0.5.0.tgz", - "integrity": "sha512-/ZtxGdSqvwedt3g0MKN3OZJsROeV+wGNLEMsVqqarWdy7RZxtDAi3fDNrLNNI+Gv7tCQKUCMosp4/JINOTbuxw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@ido-bata/ae-a8n/-/ae-a8n-0.6.0.tgz", + "integrity": "sha512-Xvum7zWGDAjTyqkgajPJqCA6Hx9v83v2atFUplo7GvAD0nmjcEoft79vvQo/3VJji/6DvoJuVrEjumiTyciE+w==", "license": "MIT", "dependencies": { "acorn": "^8.18.0" diff --git a/packages/ae-devtools-cli/package.json b/packages/ae-devtools-cli/package.json index 3246566..531751c 100644 --- a/packages/ae-devtools-cli/package.json +++ b/packages/ae-devtools-cli/package.json @@ -1,6 +1,6 @@ { "name": "@ido-bata/ae-devtools-cli", - "version": "0.7.0", + "version": "0.8.0", "description": "Developer CLI, JSX/TypeScript toolchain, MCP server and extension devkits for After Effects scripting/extension/native development", "type": "module", "engines": { @@ -60,7 +60,7 @@ "check:syntax": "node scripts/check-syntax.mjs" }, "dependencies": { - "@ido-bata/ae-a8n": "0.5.0", + "@ido-bata/ae-a8n": "0.6.0", "acorn": "^8.19.0", "esbuild": "0.28.2", "typescript": "5.9.3", diff --git a/packages/ae-devtools-cli/recovery-orchestrator/cli.mjs b/packages/ae-devtools-cli/recovery-orchestrator/cli.mjs index fa26aaa..fe74bc9 100644 --- a/packages/ae-devtools-cli/recovery-orchestrator/cli.mjs +++ b/packages/ae-devtools-cli/recovery-orchestrator/cli.mjs @@ -19,6 +19,15 @@ * [--reports-dir d]... [--sentry-dir d]... * [--ae-a8n-root ] * + * Supervision (Issue #408): observe/recover/verify-exit accept + * --session-root naming the ae-a8n session directory that holds + * the durable `ae-a8n.supervision/v1` state (supervision.json + + * monitor.lease.json). `recover` also derives it from the run marker's + * recorded workdir when the flag is absent. The report is consumed + * read-only — this CLI never starts a monitor and never presses a + * dialog; a monitor-lost/degraded/needs-human state escalates the + * verdict instead of being read as healthy. + * * Authorization model: * * observe — read-only. Needs only a resolvable GUI session. Never @@ -58,6 +67,7 @@ import { verifyHostExit, } from "./orchestrator.mjs"; import { resolveAeA8n } from "../a8n-transport/ae-a8n-resolve.mjs"; +import { supervisionReport } from "../a8n-transport/supervision.mjs"; import { RUNS_DIR, RUN_ID_RE, @@ -237,6 +247,25 @@ function guiLeaseState(a8n, session) { } } +/** + * Resolve the ae-a8n session directory holding durable supervision + * state (Issue #408). Explicit --session-root wins; `recover` falls + * back to the run marker's recorded workdir (session.mjs lays the + * session root out as /a8n-session). Returns null when no + * directory can be proven — supervision then reads as absent, never + * as healthy. + */ +function supervisionDirFor(flags, marker = null) { + if (typeof flags["session-root"] === "string" && flags["session-root"].length > 0) { + return flags["session-root"]; + } + const workdir = marker?.session?.workdir; + if (typeof workdir === "string" && workdir.length > 0) { + return join(workdir, "a8n-session"); + } + return null; +} + function targetFromFlags(flags) { const target = {}; if (Number.isFinite(Number(flags.pid))) target.pid = Number(flags.pid); @@ -334,6 +363,12 @@ async function main() { const allowConsole = flags["allow-console"] === true; const shotDir = typeof flags["shot-dir"] === "string" ? flags["shot-dir"] : undefined; const timeoutMs = Number.isFinite(Number(flags["timeout-ms"])) ? Number(flags["timeout-ms"]) : 30_000; + // Durable supervision state for this run's session (Issue #408): + // read before AND after the attempt inside runTimeoutRecovery; the + // report can only escalate the verdict (needs-human → quarantined, + // monitor-lost → unknown), never downgrade it. + const supDir = supervisionDirFor(flags, loaded.marker); + const readSupervision = supDir === null ? null : () => supervisionReport(supDir); const gui = new a8n.MacGuiRecovery({ session, pid, screenshotDir: shotDir, allowConsoleSession: allowConsole }); const recovery = new a8n.MacHostRecovery({ @@ -346,6 +381,7 @@ async function main() { recovery, gui, requestId, method, timeoutMs, ownerId: auth.ownerId, screenshotDir: shotDir, + readSupervision, }); // Evidence, not authorization: the ae-a8n GUI lease state before the // attempt. MacHostRecovery.attempt acquires the lease itself; this @@ -366,7 +402,14 @@ async function main() { if (cmd === "observe") { const gui = new a8n.MacGuiRecovery({ session, pid, screenshotDir: shotDir, allowConsoleSession: allowConsole }); const state = observeScreen({ gui, screenshotDir: shotDir, requestId: "observe" }); - emit({ schema: "ae-devtools.recovery-orchestrator.observe/v1", ...state }); + // Additive supervision snapshot when --session-root names the + // session dir (Issue #408); absent otherwise — never fabricated. + const supDir = supervisionDirFor(flags); + emit({ + schema: "ae-devtools.recovery-orchestrator.observe/v1", + ...state, + ...(supDir !== null ? { supervision: supervisionReport(supDir) } : {}), + }); return state.ok ? 0 : 1; } @@ -384,6 +427,7 @@ async function main() { } } const expectation = flags.expectation === "crash" ? "crash" : "exit"; + const supDir = supervisionDirFor(flags); const result = verifyHostExit({ pid, pidAlive, @@ -402,6 +446,10 @@ async function main() { since: typeof flags.since === "string" ? flags.since : null, reportsDirs: multi["reports-dir"].length ? multi["reports-dir"] : undefined, sentryDirs: multi["sentry-dir"].length ? multi["sentry-dir"] : undefined, + // Durable supervision report when --session-root names the session + // dir (Issue #408): recorded on the result and gating "clean" — + // monitor-lost/degraded is never a clean bill. + supervision: supDir !== null ? supervisionReport(supDir) : null, }); emit(result); return result.verdict === "clean" || result.verdict === "crash-verified" ? 0 : 1; diff --git a/packages/ae-devtools-cli/recovery-orchestrator/diagnostics.mjs b/packages/ae-devtools-cli/recovery-orchestrator/diagnostics.mjs index f2e17a1..2ca9583 100644 --- a/packages/ae-devtools-cli/recovery-orchestrator/diagnostics.mjs +++ b/packages/ae-devtools-cli/recovery-orchestrator/diagnostics.mjs @@ -84,6 +84,29 @@ function base(ctx, kind, severity, message, outcome) { }); } +/** + * Additive supervision suffix for record messages (Issue #408): when a + * result carries the durable supervision snapshot, the phase + health + + * needs-human detail ride the message so diagnostics consumers see the + * same state every other surface reports. Absent supervision adds + * nothing — the record contract is unchanged. + */ +function supervisionSuffix(result) { + const s = result?.supervision; + // timeout-recovery nests {before, after}; exit-verification carries the + // snapshot directly on result.supervision. + const sup = s !== null && typeof s === "object" && ("before" in s || "after" in s) + ? (s.after ?? s.before ?? null) + : s; + if (sup === null || sup === undefined || typeof sup !== "object") return ""; + const parts = [`supervision=${sup.phase ?? sup.status ?? "?"}`]; + if (sup.health) parts.push(`health=${sup.health}`); + if (sup.needsHuman) { + parts.push(`needs-human: ${sup.needsHuman.reason ?? "human action required"}`); + } + return ` [${parts.join("; ")}]`; +} + /** * exit-verification result → diagnostics record(s). Always exactly one * record: every verdict is either a finding or an explicit acceptance. @@ -99,7 +122,7 @@ export function exitVerificationToDiagnostics(result, ctx = {}) { ctx, VERDICT_KIND[verdict], VERDICT_SEVERITY[verdict], - `exit-verification ${verdict} (expectation ${result.expectation ?? "?"}, pid ${result.pid ?? "?"}): ${reasons || "no reasons recorded"}`, + `exit-verification ${verdict} (expectation ${result.expectation ?? "?"}, pid ${result.pid ?? "?"}): ${reasons || "no reasons recorded"}${supervisionSuffix(result)}`, verdict, ), ]; @@ -121,7 +144,7 @@ export function timeoutRecoveryToDiagnostics(result, ctx = {}) { ctx, "transport-outcome", VERDICT_SEVERITY[verdict], - `timeout-recovery ${verdict} for ${result.method ?? "?"} (request ${result.requestId ?? "?"}): ${detail || "no outcome detail"} — original request is never resent`, + `timeout-recovery ${verdict} for ${result.method ?? "?"} (request ${result.requestId ?? "?"}): ${detail || "no outcome detail"} — original request is never resent${supervisionSuffix(result)}`, verdict, ), ]; diff --git a/packages/ae-devtools-cli/recovery-orchestrator/orchestrator.mjs b/packages/ae-devtools-cli/recovery-orchestrator/orchestrator.mjs index dbbb0e9..0bef1fd 100644 --- a/packages/ae-devtools-cli/recovery-orchestrator/orchestrator.mjs +++ b/packages/ae-devtools-cli/recovery-orchestrator/orchestrator.mjs @@ -45,6 +45,12 @@ import { copyFileSync, mkdirSync, readdirSync, readFileSync, statSync, writeFile import { join } from "node:path"; import { ATTESTATION_SOURCE, GUARD_SCHEMA, latestRequestEvent } from "../devtools-cli/session-guard.mjs"; +import { + supervisionEscalation, + supervisionSnapshot, + stricterVerdict, + supervisionBlocksClean, +} from "../a8n-transport/supervision.mjs"; export const SCHEMA = "ae-devtools.recovery-orchestrator/v2"; export { ATTESTATION_SOURCE, GUARD_SCHEMA }; @@ -647,6 +653,23 @@ export function authorizeRecovery({ marker, requestId, method, probes }) { * `recovery` is ae-a8n's HostRecovery (MacHostRecovery in production). * The original request is NEVER resent — the driver waits for its result. * `ownerId` comes from the verified run proof, not from a flag. + * + * `readSupervision` (Issue #408) is an optional injected reader for the + * ae-a8n durable supervision report (`ae-a8n.supervision/v1`, + * a8n-transport/supervision.mjs). When supplied it is called once BEFORE + * and once AFTER the recovery attempt; both snapshots are recorded on the + * result and the AFTER report (falling back to BEFORE) may ESCALATE the + * verdict — never downgrade it: + * + * - health monitor-lost/unavailable or corrupt state → "unknown" + * (a dead monitor is never read as a healthy target) + * - phase needs-human/quarantined → "quarantined" with the structured + * human request (dialog, reason, options, resume path) attached + * - phase blocked/recovering → "await-original" (bounded wait; the + * phase deadline is recorded, never an indefinite wait) + * + * The orchestrator still never presses a dialog itself and never + * implements GUI probing — supervision is consumed, not re-owned. */ export async function runTimeoutRecovery({ recovery, @@ -656,7 +679,10 @@ export async function runTimeoutRecovery({ timeoutMs, ownerId, screenshotDir, + readSupervision = null, }) { + const supervisionBefore = + typeof readSupervision === "function" ? await readSupervision().catch(() => null) : null; const before = observeScreen({ gui, screenshotDir, requestId }); let outcome; try { @@ -669,6 +695,15 @@ export async function runTimeoutRecovery({ }; } const after = observeScreen({ gui, screenshotDir, requestId: `${requestId}-post` }); + const supervisionAfter = + typeof readSupervision === "function" ? await readSupervision().catch(() => null) : null; + // The freshest trustworthy supervision report decides escalation; + // BEFORE is the fallback when AFTER could not be read. + const supervisionReport = supervisionAfter ?? supervisionBefore; + const verdict = stricterVerdict( + verdictForRecovery(outcome), + supervisionEscalation(supervisionReport), + ); return { schema: SCHEMA, kind: "timeout-recovery", @@ -685,7 +720,11 @@ export async function runTimeoutRecovery({ screenshotPath: outcome.screenshotPath ?? null, }, after, - verdict: verdictForRecovery(outcome), + supervision: { + before: supervisionSnapshot(supervisionBefore), + after: supervisionSnapshot(supervisionAfter), + }, + verdict, rules: [ "the timed-out request is never resent — its result may still arrive", "a quarantined or refused state is reported, never retried", @@ -727,6 +766,13 @@ function verdictForRecovery(outcome) { * (ae-a8n `censusRunnerInSession`); `session` records whether uid/asid * were confirmed. An unconfirmed session degrades the census channel to * unavailable → unknown, never clean. + * + * `supervision` (Issue #408) is an optional ae-a8n SupervisionReport read + * from the session's durable state (a8n-transport/supervision.mjs). It is + * recorded on the result as `supervision`, and it GATES the "clean" + * verdict: degraded/monitor-lost/unavailable observation health or a + * still-blocking phase means the GUI state is not provably unobstructed, + * so "clean" degrades to "unknown" — monitor-lost is never healthy. */ export function verifyHostExit({ pid, @@ -740,6 +786,7 @@ export function verifyHostExit({ collectEvidence = collectCrashEvidence, reportsDirs, sentryDirs, + supervision = null, }) { const result = { schema: SCHEMA, @@ -754,6 +801,10 @@ export function verifyHostExit({ }, verdict: "unknown", reasons: [], + // Additive supervision snapshot (Issue #408): the durable + // ae-a8n.supervision/v1 report for the session dir, or null when no + // report was supplied. Recorded on EVERY outcome, not only clean. + supervision: supervisionSnapshot(supervision), }; result.channels.windows.pidAttribution = session?.pidAttribution ?? null; @@ -867,6 +918,20 @@ export function verifyHostExit({ result.reasons.push("process gone, census clean, evidence collected, no correlated crash reports"); } } + // Supervision gate (Issue #408): "clean" asserts the GUI is provably + // unobstructed — that claim requires ok observation health AND a + // running/resumed phase. monitor-lost/degraded/unavailable health or + // a still-blocking phase degrades clean to unknown; it is never read + // as healthy. Other verdicts already carry their own honesty and are + // not rewritten here. + if (result.verdict === "clean" && supervisionBlocksClean(supervision)) { + result.verdict = "unknown"; + result.reasons.push( + "supervision observation does not prove a clean GUI state " + + `(health=${supervision?.health ?? supervision?.doc?.observationHealth ?? "?"}, ` + + `phase=${supervision?.doc?.phase ?? "?"}) — monitor-lost/degraded is never clean`, + ); + } return result; } diff --git a/packages/ae-devtools-cli/recovery-orchestrator/tests/run.mjs b/packages/ae-devtools-cli/recovery-orchestrator/tests/run.mjs index 3bc31e5..66f6955 100644 --- a/packages/ae-devtools-cli/recovery-orchestrator/tests/run.mjs +++ b/packages/ae-devtools-cli/recovery-orchestrator/tests/run.mjs @@ -985,6 +985,178 @@ t("crashEvidenceToDiagnostics: incomplete collection -> warning, empty complete assert.deepEqual(empty, []); }); +// ------------------------------------------------ supervision verdicts (Issue #408) +// Fake level only: supervision reports are built as plain objects matching +// the ae-a8n.supervision/v1 contract consumed by a8n-transport/supervision.mjs. +// No AE, no monitor, no GUI. + +function supDoc(overrides = {}) { + return { + schemaVersion: "ae-a8n.supervision/v1", + sessionId: "sess-1", + phase: "running", + observationHealth: "ok", + blocking: null, + pendingRequests: [], + enteredAt: "2026-11-20T11:59:00.000Z", + deadline: null, + evidence: [], + monitor: { + ownerId: "mon-1", pid: 1, pidStart: null, + acquiredAt: "2026-11-20T11:58:00.000Z", heartbeatAt: new Date().toISOString(), + }, + history: [], + updatedAt: new Date().toISOString(), + ...overrides, + }; +} + +function supReport(docOverrides = {}, reportOverrides = {}) { + const doc = supDoc(docOverrides); + return { + status: "observed", + source: "state", + doc, + health: doc.observationHealth, + healthDetail: null, + readAt: new Date().toISOString(), + ...reportOverrides, + }; +} + +await at("runTimeoutRecovery: needs-human supervision escalates to quarantined with structured detail", async () => { + const report = supReport({ + phase: "needs-human", + deadline: "2026-11-20T12:10:00.000Z", + blocking: { + host: "none", + detail: "sign-in dialog is up", + windows: [{ + title: "Sign In", role: "AXWindow", subrole: "AXDialog", blocking: true, + tier: "human-required", dialogClass: "sign-in", code: "A8N-AUTH-001", + texts: ["Please sign in"], buttons: ["Cancel", "Sign In"], + }], + }, + }); + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: true, outcome: "dismissed", evidence: "pressed OK" }), + gui: fakeGui({ windows: [win("x")] }), + requestId: "req-1", method: "app.info", timeoutMs: 1000, + ownerId: "run:run-test-1", + readSupervision: async () => report, + }); + // Recovery claimed dismissed → await-original, but supervision says a + // human must act: escalation wins, never downgrade. + assert.equal(r.verdict, "quarantined"); + assert.equal(r.supervision.after.phase, "needs-human"); + assert.equal(r.supervision.after.needsHuman.phase, "needs-human"); + assert.deepEqual(r.supervision.after.needsHuman.options.sort(), ["Cancel", "Sign In"]); + assert.match(r.supervision.after.needsHuman.resumePath, /supervision status/); + assert.match(r.supervision.after.needsHuman.requiredAction, /human/i); +}); + +await at("runTimeoutRecovery: monitor-lost/unavailable health escalates to unknown, never clean", async () => { + for (const health of ["monitor-lost", "unavailable"]) { + const report = supReport({ phase: "running" }, { health }); + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: true, outcome: "dismissed" }), + gui: fakeGui({}), requestId: "r", method: "m", timeoutMs: 1, ownerId: "o", + readSupervision: async () => report, + }); + assert.equal(r.verdict, "unknown", `${health} must not be read as recovered`); + assert.equal(r.supervision.after.health, health); + } +}); + +await at("runTimeoutRecovery: blocked phase maps to await-original within deadline", async () => { + const report = supReport({ phase: "blocked", deadline: "2026-11-20T12:05:00.000Z" }); + // Base verdict await-original (recovered) + supervision blocked → + // still await-original: the request may complete inside the deadline. + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: true, outcome: "dismissed" }), + gui: fakeGui({}), requestId: "r", method: "m", timeoutMs: 1, ownerId: "o", + readSupervision: async () => report, + }); + assert.equal(r.verdict, "await-original"); + assert.equal(r.supervision.after.phase, "blocked"); + assert.equal(r.supervision.after.deadline, "2026-11-20T12:05:00.000Z"); +}); + +await at("runTimeoutRecovery: blocked supervision never downgrades an unknown verdict", async () => { + const report = supReport({ phase: "blocked", deadline: "2026-11-20T12:05:00.000Z" }); + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: false, outcome: "still-blocked", evidence: "dialog remains" }), + gui: fakeGui({}), requestId: "r", method: "m", timeoutMs: 1, ownerId: "o", + readSupervision: async () => report, + }); + assert.equal(r.verdict, "unknown"); +}); + +await at("runTimeoutRecovery: corrupt supervision state escalates to unknown", async () => { + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: true, outcome: "dismissed" }), + gui: fakeGui({}), requestId: "r", method: "m", timeoutMs: 1, ownerId: "o", + readSupervision: async () => ({ status: "unavailable", source: "corrupt", reason: "bad json", readAt: new Date().toISOString() }), + }); + assert.equal(r.verdict, "unknown"); +}); + +await at("runTimeoutRecovery: absent supervision does not change the verdict", async () => { + const r = await runTimeoutRecovery({ + recovery: fakeRecovery({ recovered: true, outcome: "dismissed" }), + gui: fakeGui({}), requestId: "r", method: "m", timeoutMs: 1, ownerId: "o", + readSupervision: async () => null, + }); + assert.equal(r.verdict, "await-original"); + assert.equal(r.supervision.after, null); +}); + +t("verifyHostExit: degraded/monitor-lost supervision never allows clean", () => { + const base = { + pid: 4242, pidAlive: () => false, census: CENSUS_CLEAN, session: SESSION_OK, + evidenceDir: tmp(), collectEvidence: fakeEvidence({}), expectation: "exit", + }; + for (const [doc, health] of [ + [{ phase: "running" }, "degraded"], + [{ phase: "running" }, "monitor-lost"], + [{ phase: "blocked", deadline: "2999-01-01T00:00:00.000Z" }, "ok"], + ]) { + const r = verifyHostExit({ ...base, supervision: supReport(doc, { health }) }); + assert.equal(r.verdict, "unknown", `health=${health} phase=${doc.phase}`); + assert.equal(r.supervision.status, "observed"); + } + // ok + running stays clean — the gate only blocks untrustworthy observation. + const clean = verifyHostExit({ ...base, supervision: supReport() }); + assert.equal(clean.verdict, "clean"); +}); + +t("verifyHostExit: corrupt supervision state is unknown, not clean", () => { + const r = verifyHostExit({ + pid: 4242, pidAlive: () => false, census: CENSUS_CLEAN, session: SESSION_OK, + evidenceDir: tmp(), collectEvidence: fakeEvidence({}), expectation: "exit", + supervision: { status: "unavailable", source: "corrupt", reason: "bad json", readAt: new Date().toISOString() }, + }); + assert.equal(r.verdict, "unknown"); +}); + +t("supervision diagnostics suffix carries phase/health/needs-human", () => { + const report = supReport({ + phase: "needs-human", + deadline: "2026-11-20T12:10:00.000Z", + blocking: { host: "none", detail: "license dialog", windows: [] }, + }); + const r = verifyHostExit({ + pid: 4242, pidAlive: () => false, census: CENSUS_CLEAN, session: SESSION_OK, + evidenceDir: tmp(), collectEvidence: fakeEvidence({}), expectation: "exit", + supervision: report, + }); + assert.equal(r.verdict, "unknown"); // needs-human blocks clean + const [rec] = exitVerificationToDiagnostics(r, {}); + assert.match(rec.message, /supervision=needs-human/); + assert.match(rec.message, /needs-human: license dialog/); + validateDiagnosticsRecord(rec); +}); + t("diagnostics converters refuse unknown verdicts instead of guessing", () => { assert.throws(() => exitVerificationToDiagnostics({ verdict: "looks-fine", reasons: [] }, {}), /unknown verdict/); assert.throws(() => recoveryActionFor("looks-fine"), /unknown verdict/); diff --git a/packages/ae-devtools-cli/scripts/consumer-smoke.mjs b/packages/ae-devtools-cli/scripts/consumer-smoke.mjs index b1b2303..1171e5f 100644 --- a/packages/ae-devtools-cli/scripts/consumer-smoke.mjs +++ b/packages/ae-devtools-cli/scripts/consumer-smoke.mjs @@ -258,7 +258,7 @@ try { const list = await request("tools/list"); const names = (list.result?.tools ?? []).map((t) => t.name).sort(); - assertNode.deepEqual(names, ["ae_discover", "ae_execute", "ae_inspect", "ae_session", "ae_verify"], "tools/list mismatch"); + assertNode.deepEqual(names, ["ae_discover", "ae_execute", "ae_inspect", "ae_session", "ae_supervision", "ae_verify"], "tools/list mismatch"); // Consent default deny still holds through the packaged bin: an // ae_execute without consent must be refused before any session. diff --git a/packages/ae-devtools-cli/vscode-extension/controller.mjs b/packages/ae-devtools-cli/vscode-extension/controller.mjs index 9c7f324..93ee7cd 100644 --- a/packages/ae-devtools-cli/vscode-extension/controller.mjs +++ b/packages/ae-devtools-cli/vscode-extension/controller.mjs @@ -199,6 +199,18 @@ export function createController(options = {}) { return tool("ae_session", {}); }, + /** + * ae-a8n GUI-supervision status (Issue #409): the same durable + * ae-a8n.supervision/v1 report the CLI `supervision` command and + * MCP `ae_supervision` return — phase, observation health, and the + * structured needs-human request. Read-only: never opens a session, + * never dispatches, never probes the GUI; attached sessions get the + * identical view with no ownership or mutation grant. + */ + supervision(args = {}) { + return tool("ae_supervision", args); + }, + /** Op schema/metadata — never executes, never opens a session. */ inspect(opId) { return tool("ae_inspect", { opId }); diff --git a/packages/ae-devtools-cli/vscode-extension/extension.mjs b/packages/ae-devtools-cli/vscode-extension/extension.mjs index 3986a73..62d6ae6 100644 --- a/packages/ae-devtools-cli/vscode-extension/extension.mjs +++ b/packages/ae-devtools-cli/vscode-extension/extension.mjs @@ -179,6 +179,7 @@ export async function activate(context) { reg("ae-devtools.discover", () => controller.discover()); reg("ae-devtools.sessionStatus", () => controller.sessionStatus()); + reg("ae-devtools.supervision", () => controller.supervision()); reg("ae-devtools.inspect", async () => { const opId = await promptOpId(); if (!opId) return { schema: "ae-devtools.vscode-extension/v1", status: "cancelled", detail: "no operation id entered" }; diff --git a/packages/ae-devtools-cli/vscode-extension/package.json b/packages/ae-devtools-cli/vscode-extension/package.json index 6636f7a..10f696b 100644 --- a/packages/ae-devtools-cli/vscode-extension/package.json +++ b/packages/ae-devtools-cli/vscode-extension/package.json @@ -18,6 +18,7 @@ "onCommand:ae-devtools.execute", "onCommand:ae-devtools.verify", "onCommand:ae-devtools.sessionStatus", + "onCommand:ae-devtools.supervision", "onCommand:ae-devtools.debug.setup", "onCommand:ae-devtools.debug.attach" ], @@ -48,6 +49,11 @@ "title": "AE DevTools: Session Status", "category": "AE DevTools" }, + { + "command": "ae-devtools.supervision", + "title": "AE DevTools: Supervision Status", + "category": "AE DevTools" + }, { "command": "ae-devtools.debug.setup", "title": "AE DevTools: Debug Setup (launch.json)", diff --git a/packages/ae-devtools-cli/vscode-extension/tests/controller.test.mjs b/packages/ae-devtools-cli/vscode-extension/tests/controller.test.mjs index 6225776..5330eac 100644 --- a/packages/ae-devtools-cli/vscode-extension/tests/controller.test.mjs +++ b/packages/ae-devtools-cli/vscode-extension/tests/controller.test.mjs @@ -8,7 +8,7 @@ */ import test from "node:test"; import assert from "node:assert/strict"; -import { mkdtempSync, readdirSync, readFileSync, rmSync, existsSync } from "node:fs"; +import { mkdtempSync, readdirSync, readFileSync, rmSync, existsSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; @@ -74,6 +74,38 @@ test("sessionStatus reports closed then open state without dispatching itself (C assert.equal(spy.calls.length, 1); }); +test("supervision reports the durable ae-a8n report read-only (Issue #409)", async () => { + const dir = mkdtempSync(join(tmpdir(), "ae-sup-vsc-")); + writeFileSync(join(dir, "supervision.json"), `${JSON.stringify({ + schemaVersion: "ae-a8n.supervision/v1", + sessionId: "s1", phase: "needs-human", observationHealth: "ok", + blocking: { host: "none", detail: "modal up", windows: [] }, + pendingRequests: [], + enteredAt: new Date().toISOString(), + deadline: new Date(Date.now() + 60_000).toISOString(), + evidence: [], + monitor: { ownerId: "m", pid: 1, pidStart: null, acquiredAt: new Date().toISOString(), heartbeatAt: new Date().toISOString() }, + history: [], updatedAt: new Date().toISOString(), + }, null, 2)}\n`); + const spy = factorySpy(); + const c = createController({ sessionFactory: spy.factory, ui: recordingUi() }); + const res = await c.supervision({ sessionRoot: dir }); + assert.equal(res.schema, EXTENSION_SCHEMA); + assert.equal(res.command, "ae_supervision"); + assert.equal(res.supervision.phase, "needs-human"); + assert.equal(res.supervision.needsHuman.reason, "modal up"); + assert.equal(spy.calls.length, 0, "supervision must never open a session"); + rmSync(dir, { recursive: true, force: true }); +}); + +test("supervision without session or sessionRoot is honest unavailable", async () => { + const spy = factorySpy(); + const c = createController({ sessionFactory: spy.factory, ui: recordingUi() }); + const res = await c.supervision(); + assert.equal(res.supervision.status, "unavailable"); + assert.equal(spy.calls.length, 0); +}); + test("inspect returns op metadata; unknown op is a typed result, never executes", async () => { const spy = factorySpy(); const c = createController({ sessionFactory: spy.factory, ui: recordingUi() }); diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-Disposable.aep b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-Disposable.aep new file mode 100644 index 0000000..9d9a81a Binary files /dev/null and b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-Disposable.aep differ diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-MCP-Disposable.aep b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-MCP-Disposable.aep new file mode 100644 index 0000000..707d75b Binary files /dev/null and b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/Conformance-MCP-Disposable.aep differ diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/a8n-host-ext.js b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/a8n-host-ext.js new file mode 100644 index 0000000..2173b22 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/a8n-host-ext.js @@ -0,0 +1,1711 @@ +/* ae-a8n-extensions {"contract":1,"methods":["aeDevtools.trustedEval","aeDevtools.evalProgram"],"registration":"4e39bf8055917b6e731938d97e50ba096ad89778ca4fb3aef107611d61276ab6"} */ +function __a8nRegisterExtensions() { + var context = this.__a8n; + if (context === undefined || context === null) { + throw new Error("extensions were declared without an __a8n host context"); + } + context.extensions = context.extensions || {}; + context.extensionsRegistration = "4e39bf8055917b6e731938d97e50ba096ad89778ca4fb3aef107611d61276ab6"; + context.extensions["aeDevtools.trustedEval"] = (function (params) { + var requestId = ""; + var source = ""; + if (params !== null && params !== undefined) { + if (params.requestId !== undefined && params.requestId !== null) { + requestId = String(params.requestId); + } + if (params.source !== undefined && params.source !== null) { + source = String(params.source); + } + } + + // Same codec the host protocol uses, loaded the same way a8n-host.js + // loads it: $.evalFile returns the file's completion value, and the file + // sits beside the generated host script ($.fileName's directory). + var codec = null; + try { + codec = $.evalFile(new File($.fileName).parent.fsName + "/a8n-json.js"); + } catch (codecError) { + codec = null; + } + if (codec === null || typeof codec.stringify !== "function") { + codec = null; + } + + // Exactly one evaluation, always as a program. A previous revision + // retried SyntaxError failures wrapped as a function body — but a + // SyntaxError can also be thrown at RUNTIME by the evaluated code + // itself (inner eval/new Function/RegExp), after partial side effects, + // so the retry could execute the source twice. There is no retry: + // parse failure and runtime failure are both reported, and callers + // that need function-body semantics wrap the source themselves. + var value; + var evalError = null; + var didThrow = false; + // Scope separation: the program must not reach this method's + // bookkeeping (didThrow/evalError/value/requestId/...). A direct + // eval here shares THIS function's variable environment, and any + // function nested inside it still resolves names through this + // scope — so the eval is delegated to the sibling method + // aeDevtools.evalProgram, whose lexical scope chain never includes + // this method's locals. Exactly one evaluation, always as a + // program; there is no retry (see above). + var runner = null; + try { + runner = __a8n.extensions["aeDevtools.evalProgram"]; + } catch (lookupError) { + runner = null; + } + if (typeof runner !== "function") { + return { + requestId: requestId, + ok: false, + evalError: { name: "EvalError", message: "aeDevtools.evalProgram runner unavailable", line: null, file: null } + }; + } + try { + value = runner({ source: source }); + } catch (firstError) { + didThrow = true; + evalError = firstError; + } + // didThrow (not evalError !== null) is the failure signal: a source + // that throws null or undefined leaves evalError nullish and must + // still classify as a failed evaluation, never as success. + if (didThrow) { + var name = "EvalError"; + var message = evalError === null ? "thrown null" + : evalError === undefined ? "thrown undefined" + : "unknown eval failure"; + var line = null; + var file = null; + if (evalError !== null && evalError !== undefined) { + try { if (evalError.name !== undefined) name = String(evalError.name); } catch (e1) {} + try { if (evalError.message !== undefined) message = String(evalError.message); } catch (e2) {} + try { if (evalError.line !== undefined) line = evalError.line; } catch (e3) {} + try { if (evalError.file !== undefined) file = String(evalError.file); } catch (e4) {} + } + return { + requestId: requestId, + ok: false, + evalError: { name: name, message: message, line: line, file: file } + }; + } + + // Result marshalling. Primitives pass through; objects/arrays are only + // JSON-serialized when the codec accepts them — an AE object graph is + // never handed to the serializer speculatively (hang/overflow risk), it + // degrades to text instead. undefined becomes null so the reply shape is + // stable. + var valueType = typeof value; + var resultJson = null; + var valueText = null; + var serialized = false; + if (value === undefined || value === null) { + serialized = true; + } else if (valueType === "string" || valueType === "number" || + valueType === "boolean") { + if (codec !== null) { + try { resultJson = codec.stringify(value); serialized = true; } catch (e5) {} + } + if (!serialized) { + try { valueText = String(value); } catch (e6) { valueText = null; } + serialized = valueText !== null; + } + } else if (codec !== null) { + // Objects and arrays: attempt codec serialization inside try/catch. + // ExtendScript objects expose few own enumerable properties, so this + // resolves quickly in practice; a stack overflow throws and is caught. + try { + resultJson = codec.stringify(value); + serialized = true; + } catch (e7) { + serialized = false; + } + } + if (!serialized) { + try { valueText = String(value); } catch (e8) { valueText = null; } + } + return { + requestId: requestId, + ok: true, + resultJson: serialized && resultJson !== null ? resultJson : null, + valueText: valueText, + valueType: valueType + }; +}); + context.extensions["aeDevtools.evalProgram"] = (function (params) { + return eval(String(params.source)); +}); +} +__a8nRegisterExtensions(); +/*! + * a8n-host.js — the part of ae-a8n that actually runs inside After Effects. + * + * Contract with the driver: the generated bootstrap sets a global `__a8n` + * with the request and result paths, then evals this file. This script reads + * the request, dispatches to a method, and publishes the result by rename. + * + * The identical file is evaluated against the in-repo fake host during tests — + * only the peer supplying `app` differs. Keep it that way: any logic that + * needs to differ per-peer belongs in the peer, not here. + * + * ES3 only. ExtendScript has no `let`/`const`, no arrow functions, no `JSON`, + * no `String.prototype.trim`, and no `Error.captureStackTrace`. + */ + +(function () { + // ---------------------------------------------------------------- codec -- + + function loadJson() { + // Always the bundled codec. AE's engine has no `JSON` of its own; one that + // is present was put there by another extension (observed on 26.5x89: a + // Babel-built polyfill, present once startup finished and absent on a cold + // start), so preferring it made the host behave differently cold and warm. + // + // The codec comes back as `$.evalFile`'s completion value. Looking it up + // on the global object does not work: called from inside a function, a + // real AE keeps the included file's `var`s in that function's scope. + var codec = $.evalFile(new File($.fileName).parent.fsName + "/a8n-json.js"); + if ( + codec === undefined || + codec === null || + typeof codec.parse !== "function" || + typeof codec.stringify !== "function" + ) { + throw new Error("a8n-json.js did not produce a JSON codec"); + } + return codec; + } + + // ------------------------------------------------------------------ fs --- + + function readTextFile(path) { + var file = new File(path); + file.encoding = "UTF-8"; + if (!file.exists) { + throw new Error("request file not found: " + path); + } + if (!file.open("r")) { + throw new Error("cannot open request file: " + path); + } + var text = file.read(); + file.close(); + return text; + } + + function writeTextFile(path, text) { + var file = new File(path); + file.encoding = "UTF-8"; + // ExtendScript cannot create intermediate directories, and the driver + // already created them. Opening for write truncates. + if (!file.open("w")) { + throw new Error("cannot open result file for writing: " + path); + } + // ExtendScript can report an I/O failure with false instead of throwing. + // Never rename a staging file unless both the write and the close succeed. + var wrote = false; + var closed = false; + try { + wrote = file.write(text) !== false; + } finally { + closed = file.close() !== false; + } + if (!wrote || !closed) { + throw new Error("cannot finish writing result file: " + path); + } + } + + function parentOf(path) { + var file = new File(path); + return file.parent.fsName; + } + + // -------------------------------------------------------------- errors --- + + function toErrorPayload(error) { + var payload = { + name: "Error", + message: "unknown host error" + }; + if (error === null || typeof error !== "object") { + payload.message = String(error); + return payload; + } + if (error.name !== undefined && error.name !== null) { + payload.name = String(error.name); + } + if (error.message !== undefined && error.message !== null) { + payload.message = String(error.message); + } else { + payload.message = String(error); + } + if (error.line !== undefined && typeof error.line === "number") { + payload.line = error.line; + } + // AE raises errors carrying `errorNumber` (e.g. 5023 for a missing effect). + if (error.errorNumber !== undefined && typeof error.errorNumber === "number") { + payload.aeError = error.errorNumber; + } + // Set by the host's own typed errors (NoValueError) for the API to branch on. + if (typeof error.kind === "string") { + payload.kind = error.kind; + } + if (error.matchName !== undefined && error.matchName !== null) { + payload.message = payload.message + " (matchName: " + String(error.matchName) + ")"; + } + return payload; + } + + // ------------------------------------------------------------- helpers --- + + // ExtendScript's Object.prototype has members a plain `object[key]` finds + // (functions named "+", "-", "*", "/", `toSource`, `watch`, ... observed on + // AE 26.5x89), so a key that came from a request is looked up as own only. + function has(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); + } + + function requireParam(params, name) { + if (params === null || params === undefined || !has(params, name) || params[name] === undefined) { + throw new Error("missing required parameter: " + name); + } + return params[name]; + } + + function optionalParam(params, name, fallback) { + if (params === null || params === undefined || !has(params, name) || params[name] === undefined) { + return fallback; + } + return params[name]; + } + + function getProject() { + if (app.project === null || app.project === undefined) { + throw new Error("no project is open"); + } + return app.project; + } + + function findComp(name) { + // A real Project has no lookup by name (`itemByName` is undefined on AE + // 26.5x89), so walk the items. Names are not unique in AE; the first + // composition with the name wins, and a non-composition item that shares + // it is skipped. + var project = getProject(); + var sawOther = false; + for (var i = 1; i <= project.numItems; i++) { + var item = project.item(i); + if (item.name === name) { + if (item instanceof CompItem) { + return item; + } + sawOther = true; + } + } + if (sawOther) { + throw new Error("item is not a composition: " + name); + } + var missing = new Error("composition not found: " + name); + // The API turns exactly this into EntityNotFoundError; anything else a + // lookup raises is reported as itself. + missing.name = "NotFoundError"; + throw missing; + } + + function findLayer(comp, name) { + var layer = comp.layer(name); + if (layer === null || layer === undefined) { + throw new Error("layer not found in '" + comp.name + "': " + name); + } + return layer; + } + + function effectParade(layer) { + var parade = layer.property("ADBE Effect Parade"); + if (parade === null || parade === undefined) { + throw new Error("layer has no effect parade: " + layer.name); + } + return parade; + } + + /** + * Effects are addressed by match name internally, but callers know display + * names. Try the given identifier as a match name first (the documented, + * locale-independent path), then fall back to scanning by display name. + */ + function findEffect(layer, identifier) { + var parade = effectParade(layer); + var byName = parade.property(identifier); + if (byName !== null && byName !== undefined) { + return byName; + } + var count = parade.numProperties; + for (var i = 1; i <= count; i++) { + var candidate = parade.property(i); + if (candidate.name === identifier || candidate.matchName === identifier) { + return candidate; + } + } + return null; + } + + function applyEffect(layer, identifier) { + var parade = effectParade(layer); + var existing = findEffect(layer, identifier); + if (existing !== null && existing !== undefined) { + return { effect: existing, created: false }; + } + try { + // Match-name form: the deterministic path for third-party plugins. + var created = parade.addProperty(identifier); + if (created === null || created === undefined) { + throw new Error("addProperty returned nothing for: " + identifier); + } + return { effect: created, created: true }; + } catch (matchNameError) { + // Display-name form: some plugins register under their menu label. + var byLabel = parade.addProperty(identifier); + if (byLabel === null || byLabel === undefined) { + throw matchNameError; + } + return { effect: byLabel, created: true }; + } + } + + function findParameter(effect, identifier) { + var byName = effect.property(identifier); + if (byName !== null && byName !== undefined) { + return byName; + } + var count = effect.numProperties; + for (var i = 1; i <= count; i++) { + var candidate = effect.property(i); + if (candidate.name === identifier || candidate.matchName === identifier) { + return candidate; + } + } + return null; + } + + // PropertyValueType member names, in Adobe's order. Looked up on the live + // enum, so the numbers come from the host, not from here. + var VALUE_TYPE_NAMES = [ + "NO_VALUE", "ThreeD_SPATIAL", "ThreeD", "TwoD_SPATIAL", "TwoD", "OneD", + "COLOR", "CUSTOM_VALUE", "MARKER", "LAYER_INDEX", "MASK_INDEX", "SHAPE", + "TEXT_DOCUMENT" + ]; + + function valueTypeName(property) { + var type = property.propertyValueType; + for (var i = 0; i < VALUE_TYPE_NAMES.length; i++) { + // Constant keys, not request data: a plain lookup is safe here, and + // AE's enums are host objects that need not report own properties. + var member = PropertyValueType[VALUE_TYPE_NAMES[i]]; + if (member !== undefined && member === type) { + return VALUE_TYPE_NAMES[i]; + } + } + return String(type); + } + + /** + * The value shapes this API carries, by value type: `min`/`max` array + * lengths that `setValue` accepts on AE 26.5x89, or 0/0 for a single + * number. ThreeD takes 2 (z becomes 0) and COLOR 3 (alpha becomes 1). + * Anything else (MARKER, SHAPE, TEXT_DOCUMENT) is not carried. + */ + function valueShape(name) { + if (name === "OneD" || name === "LAYER_INDEX" || name === "MASK_INDEX") { + return { min: 0, max: 0, text: "a number" }; + } + if (name === "TwoD" || name === "TwoD_SPATIAL") { + return { min: 2, max: 2, text: "an array of 2 numbers" }; + } + if (name === "ThreeD" || name === "ThreeD_SPATIAL") { + return { min: 2, max: 3, text: "an array of 2 or 3 numbers" }; + } + if (name === "COLOR") { + return { min: 3, max: 4, text: "an array of 3 or 4 numbers" }; + } + return null; + } + + /** + * Whether a script can read this property's value, without reading it. + * On AE 26.5x89 reading `value` throws for PropertyValueType.NO_VALUE + * (e.g. ADBE Tint-0004, ADBE Ramp-0008) and CUSTOM_VALUE (Levels' + * histogram, Curves), and a group (Compositing Options) has no value. + * Value types this API does not carry count as "custom-value". + */ + function propertyKind(property) { + if (property.propertyType !== PropertyType.PROPERTY) { + return "group"; + } + var name = valueTypeName(property); + if (name === "NO_VALUE") { + return "no-value"; + } + return valueShape(name) === null ? "custom-value" : "value"; + } + + function describeProperty(property) { + var kind = propertyKind(property); + var out = { name: property.name, kind: kind }; + if (property.matchName !== undefined && property.matchName !== null) { + out.matchName = property.matchName; + } + if (kind !== "group") { + out.valueType = valueTypeName(property); + } + if (kind === "value") { + out.value = property.value; + } + return out; + } + + function isFiniteNumber(value) { + return typeof value === "number" && isFinite(value); + } + + // Not `instanceof Array`: request values come from the codec, which may run + // in another realm (as a8n-json.js notes for its own check). + function isArray(value) { + return Object.prototype.toString.call(value) === "[object Array]"; + } + + /** + * Refuses, before touching the property, a write it cannot take: a + * property without a value (NoValueError), or a value of the wrong shape + * for its type (ValueShapeError). AE itself would coerce some of these + * (observed: `[]` written to a OneD property becomes 0). + */ + function requireWritableValue(property, value) { + var kind = propertyKind(property); + var error; + if (kind !== "value") { + error = new Error( + "property has no value to write (" + kind + "): " + property.matchName + ); + error.name = "NoValueError"; + error.kind = kind; + throw error; + } + var name = valueTypeName(property); + var shape = valueShape(name); + var fits; + if (shape.max === 0) { + fits = isFiniteNumber(value); + } else { + fits = isArray(value) && value.length >= shape.min && value.length <= shape.max; + for (var i = 0; fits && i < value.length; i++) { + fits = isFiniteNumber(value[i]); + } + } + if (!fits) { + error = new Error( + property.matchName + " (" + name + ") takes " + shape.text + ); + error.name = "ValueShapeError"; + error.kind = name; + throw error; + } + } + + function zeroPad(value, width) { + var text = String(value); + while (text.length < width) { + text = "0" + text; + } + return text; + } + + // ------------------------------------------------------------- methods --- + + var methods = {}; + + methods["app.info"] = function () { + var info = { version: String(app.version) }; + // AE exposes the build as `app.buildNumber`; `app.build` is undefined on a + // real host (observed on 26.5x89). An absent value is left out rather than + // reported as the string "undefined". + try { + var build = app.buildNumber; + if (build !== undefined && build !== null && String(build) !== "") { + info.build = String(build); + } + } catch (e) { + // build is not guaranteed; version alone is enough for a readiness probe. + } + return info; + }; + + /** + * Refuses when the open project has unsaved changes, unless the caller + * explicitly allowed discarding them. Named, so the driver can tell a + * decision the caller must make from a failure. + */ + function guardUnsavedChanges(params, action) { + var project = app.project; + if (project === null || project === undefined || !project.dirty) { + return false; + } + if (optionalParam(params, "discardUnsavedChanges", false) !== true) { + var refused = new Error("the open project has unsaved changes; " + action + " would discard them"); + refused.name = "UnsavedChangesError"; + throw refused; + } + return true; + } + + /** + * Shows a modal dialog in After Effects and waits until it is closed. + * + * The dialog is native, not scripted: it is the one case an ExtendScript + * call cannot get out of on its own. It exists so the GUI fallback — the + * path that closes a dialog for a host that stopped answering — can be + * exercised against a dialog whose appearance and dismissal are known. + * + * `alert` blocks the script, so the result is written only after the + * dialog has been closed. A caller that gave up on the call must not send + * it again; the request is still running inside After Effects. + */ + methods["ui.alert"] = function (params) { + var message = String(requireParam(params, "message")); + // The GUI fallback may only press a window it has measured. Its one known + // class requires a static text beginning "ae-a8n:", so the marker is put + // on here, whatever the caller passed: a dialog this method raises has to + // be closable by the fallback it exists for. + var text = /^\s*ae-a8n:/.test(message) ? message : "ae-a8n: " + message; + alert(text); + return { dismissed: true, message: text }; + }; + + methods["app.quit"] = function (params) { + if (guardUnsavedChanges(params, "quitting")) { + // Closed first, untitled or not: a dirty project would otherwise put a + // save prompt in front of the quit. + app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); + } + app.quit(); + return { quitting: true }; + }; + + methods["project.open"] = function (params) { + var path = String(requireParam(params, "path")); + var file = new File(path); + if (!file.exists) { + throw new Error("project file not found: " + path); + } + // Opening replaces the open project; with unsaved changes AE would put a + // save prompt in front of the script, and the changes may be someone + // else's work. + if (guardUnsavedChanges(params, "opening another project")) { + app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); + } + var opened = app.open(file); + // app.open answers with the Project it opened; the path is on + // project.file. An absent file (an untitled project) reports null. + var openedFile = opened === null || opened === undefined ? null : opened.file; + var openedPath = openedFile === null || openedFile === undefined + ? null + : openedFile.fsName || openedFile.name; + return { file: openedPath === null || openedPath === undefined ? null : String(openedPath) }; + }; + + methods["project.close"] = function (params) { + var save = optionalParam(params, "save", false); + if (save !== true) { + guardUnsavedChanges(params, "closing without saving"); + } + var closed = getProject().close( + save ? CloseOptions.SAVE_CHANGES : CloseOptions.DO_NOT_SAVE_CHANGES + ); + if (closed === false) { + var cancelled = new Error("project close was cancelled"); + cancelled.name = "ProjectCloseCancelled"; + throw cancelled; + } + return { closed: true }; + }; + + methods["project.info"] = function () { + var project = getProject(); + return { + file: project.file === null ? null : String(project.file.fsName), + name: project.file === null ? null : String(project.file.name), + itemCount: project.numItems + }; + }; + + methods["project.comps"] = function () { + var project = getProject(); + var out = []; + for (var i = 1; i <= project.numItems; i++) { + var item = project.item(i); + if (item instanceof CompItem) { + out.push({ + name: item.name, + width: item.width, + height: item.height, + duration: item.duration, + frameRate: item.frameRate, + layerCount: item.numLayers + }); + } + } + return out; + }; + + methods["comp.info"] = function (params) { + return compInfo(findComp(String(requireParam(params, "name")))); + }; + + methods["comp.layers"] = function (params) { + var comp = findComp(String(requireParam(params, "name"))); + var out = []; + for (var i = 1; i <= comp.numLayers; i++) { + out.push(layerInfo(comp.layer(i))); + } + return out; + }; + + methods["comp.layer"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + return layerInfo(layer); + }; + + methods["layer.effects"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + var parade = effectParade(layer); + var out = []; + for (var i = 1; i <= parade.numProperties; i++) { + out.push({ name: parade.property(i).name, matchName: parade.property(i).matchName }); + } + return out; + }; + + methods["layer.applyEffect"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + var identifier = String(requireParam(params, "effect")); + var result = applyEffect(layer, identifier); + return { + name: result.effect.name, + matchName: result.effect.matchName, + created: result.created + }; + }; + + methods["effect.parameters"] = function (params) { + var effect = resolveEffect(params); + var out = []; + for (var i = 1; i <= effect.numProperties; i++) { + out.push(describeProperty(effect.property(i))); + } + return out; + }; + + methods["effect.getParameter"] = function (params) { + var effect = resolveEffect(params); + var property = requireProperty(effect, String(requireParam(params, "parameter"))); + return describeProperty(property); + }; + + methods["effect.setParameter"] = function (params) { + var effect = resolveEffect(params); + var property = requireProperty(effect, String(requireParam(params, "parameter"))); + var value = requireParam(params, "value"); + requireWritableValue(property, value); + property.setValue(value); + return describeProperty(property); + }; + + function resolveEffect(params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + var effect = findEffect(layer, String(requireParam(params, "effect"))); + if (effect === null || effect === undefined) { + throw new Error("effect not found on layer '" + layer.name + "': " + params.effect); + } + return effect; + } + + function requireProperty(effect, identifier) { + var property = findParameter(effect, identifier); + if (property === null || property === undefined) { + var missing = new Error("parameter not found on effect '" + effect.name + "': " + identifier); + // Named and kinded like findComp's NotFoundError, so the API turns + // exactly this into EntityNotFoundError(kind: "parameter"); the kind + // keeps a missing composition inside the same call distinct. + missing.name = "NotFoundError"; + missing.kind = "parameter"; + throw missing; + } + return property; + } + + methods["comp.renderFrame"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var frame = Number(requireParam(params, "frame")); + var outputDir = String(requireParam(params, "outputDir")); + var namePrefix = String(optionalParam(params, "prefix", comp.name)); + + var folder = new Folder(outputDir); + if (!folder.exists && !folder.create()) { + throw new Error("cannot create output directory: " + outputDir); + } + var target = new File(folder.fsName + "/" + namePrefix + "." + zeroPad(frame, 5) + ".png"); + if (target.exists) { + target.remove(); + } + + // `saveFrameToPng`, not the render queue: a localised AE has no output + // module template named "PNG Sequence" (ja 26.5x89 lists none) and an + // output module's "Format" is read-only to setSettings, so the queue + // cannot be told to write PNG. `saveFrameToPng` renders at the viewer's + // resolution, so full resolution is forced for the frame and restored. + var previousResolution = comp.resolutionFactor; + comp.resolutionFactor = [1, 1]; + try { + var pending = comp.saveFrameToPng(frame * comp.frameDuration, target); + // It returns before the file is written (observed: 0 bytes at first); + // `wait()` blocks until it is, and throws if it failed. + try { + pending.wait(); + } catch (waitError) { + var cause = pending._exception !== undefined && pending._exception !== null + ? String(pending._exception) + : String(waitError.message); + throw new Error("frame " + frame + " of '" + comp.name + "' was not rendered: " + cause); + } + } finally { + comp.resolutionFactor = previousResolution; + } + + var size = readPngSize(target); + return { + path: String(target.fsName), + frame: frame, + width: size.width, + height: size.height + }; + }; + + /** Width and height from a PNG's IHDR: what was written, not what was asked for. */ + function readPngSize(file) { + if (!file.exists) { + throw new Error("rendered frame is missing: " + file.fsName); + } + file.encoding = "BINARY"; + if (!file.open("r")) { + throw new Error("cannot open rendered frame: " + file.fsName); + } + var head = file.read(24); + file.close(); + if (head.length < 24 || head.substring(12, 16) !== "IHDR") { + throw new Error("rendered frame is not a PNG: " + file.fsName); + } + function u32(offset) { + return head.charCodeAt(offset) * 16777216 + + head.charCodeAt(offset + 1) * 65536 + + head.charCodeAt(offset + 2) * 256 + + head.charCodeAt(offset + 3); + } + return { width: u32(16), height: u32(20) }; + } + + + // -------------------------------------------------- scene construction --- + + function layerType(layer) { + // Most specific first: a ShapeLayer and a TextLayer are also AVLayers. + if (typeof TextLayer !== "undefined" && layer instanceof TextLayer) { + return "text"; + } + if (typeof ShapeLayer !== "undefined" && layer instanceof ShapeLayer) { + return "shape"; + } + if (typeof AVLayer !== "undefined" && layer instanceof AVLayer) { + return "av"; + } + return "other"; + } + + function layerInfo(layer) { + return { + id: layer.id, + name: layer.name, + index: layer.index, + enabled: layer.enabled, + selected: layer.selected, + type: layerType(layer) + }; + } + + function compInfo(comp) { + return { + name: comp.name, + width: comp.width, + height: comp.height, + duration: comp.duration, + frameRate: comp.frameRate, + layerCount: comp.numLayers + }; + } + + function requireNumber(params, name, min) { + var value = requireParam(params, name); + if (!isFiniteNumber(value) || value < min) { + throw new Error(name + " must be a number >= " + min); + } + return value; + } + + function requireNumbers(value, name, length) { + if (!isArray(value) || value.length !== length) { + throw new Error(name + " must be an array of " + length + " numbers"); + } + for (var i = 0; i < value.length; i++) { + if (!isFiniteNumber(value[i])) { + throw new Error(name + " must be an array of " + length + " numbers"); + } + } + return value; + } + + methods["project.createComp"] = function (params) { + var project = getProject(); + var name = String(requireParam(params, "name")); + // Comps are addressed by name, so a second comp with the name could never + // be reached; refuse instead of creating it. + for (var i = 1; i <= project.numItems; i++) { + if (project.item(i).name === name) { + throw new Error("an item named '" + name + "' already exists"); + } + } + var comp = project.items.addComp( + name, + requireNumber(params, "width", 4), + requireNumber(params, "height", 4), + optionalParam(params, "pixelAspect", 1), + requireNumber(params, "duration", 0.001), + requireNumber(params, "frameRate", 1) + ); + return compInfo(comp); + }; + + methods["comp.openInViewer"] = function (params) { + var comp = findComp(String(requireParam(params, "name"))); + comp.openInViewer(); + return { name: comp.name, active: app.project.activeItem === comp }; + }; + + methods["comp.addText"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var text = String(requireParam(params, "text")); + // Reject every invalid optional value before creating a layer: a failed + // request must not leave an orphan text layer in the user's project. + var name = optionalParam(params, "name", null); + var font = optionalParam(params, "font", null); + var fontSize = optionalParam(params, "fontSize", null); + var fillColor = optionalParam(params, "fillColor", null); + var position = optionalParam(params, "position", null); + if (fontSize !== null) { + fontSize = requireNumber(params, "fontSize", 1); + } + if (fillColor !== null) { + fillColor = requireNumbers(fillColor, "fillColor", 3); + } + if (position !== null) { + position = requireNumbers(position, "position", 2); + } + + var layer = comp.layers.addText(text); + if (name !== null) { + layer.name = String(name); + } + var source = layer.property("ADBE Text Properties").property("ADBE Text Document"); + var doc = source.value; + if (font !== null) { + doc.font = String(font); + } + if (fontSize !== null) { + doc.fontSize = fontSize; + } + if (fillColor !== null) { + doc.applyFill = true; + doc.fillColor = fillColor; + } + doc.applyStroke = false; + source.setValue(doc); + if (position !== null) { + layer.property("ADBE Transform Group").property("ADBE Position") + .setValue(position); + } + var applied = source.value; + var info = layerInfo(layer); + // What AE settled on, not what was asked for: an unknown font falls back. + info.font = String(applied.font); + info.fontSize = applied.fontSize; + return info; + }; + + methods["comp.selectLayers"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var names = requireParam(params, "layers"); + if (!isArray(names)) { + throw new Error("layers must be an array of layer names"); + } + var wanted = []; + for (var i = 0; i < names.length; i++) { + wanted.push(findLayer(comp, String(names[i]))); + } + // Exactly the named layers: deselect everything else first. + for (var j = 1; j <= comp.numLayers; j++) { + comp.layer(j).selected = false; + } + for (var k = 0; k < wanted.length; k++) { + wanted[k].selected = true; + } + var selected = []; + for (var n = 1; n <= comp.numLayers; n++) { + if (comp.layer(n).selected) { + selected.push(comp.layer(n).name); + } + } + return { selected: selected }; + }; + + methods["layer.setEnabled"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + var enabled = requireParam(params, "enabled"); + if (enabled !== true && enabled !== false) { + throw new Error("enabled must be a boolean"); + } + layer.enabled = enabled; + return layerInfo(layer); + }; + + methods["layer.transform"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + var group = layer.property("ADBE Transform Group"); + return { + anchorPoint: group.property("ADBE Anchor Point").value, + position: group.property("ADBE Position").value, + scale: group.property("ADBE Scale").value, + rotation: group.property("ADBE Rotate Z").value, + opacity: group.property("ADBE Opacity").value + }; + }; + + function collectShapePaths(group, groups, out) { + for (var i = 1; i <= group.numProperties; i++) { + var child = group.property(i); + if (child.matchName === "ADBE Vector Group") { + var nested = groups.slice(0); + nested.push(child.name); + collectShapePaths(child.property("ADBE Vectors Group"), nested, out); + } else if (child.matchName === "ADBE Vector Shape - Group") { + var shape = child.property("ADBE Vector Shape").value; + out.push({ + groups: groups, + name: child.name, + closed: shape.closed, + vertices: shape.vertices, + inTangents: shape.inTangents, + outTangents: shape.outTangents + }); + } + } + } + + methods["layer.shapePaths"] = function (params) { + var comp = findComp(String(requireParam(params, "comp"))); + var layer = findLayer(comp, String(requireParam(params, "layer"))); + if (layerType(layer) !== "shape") { + throw new Error("not a shape layer: " + layer.name); + } + var out = []; + collectShapePaths(layer.property("ADBE Root Vectors Group"), [], out); + return out; + }; + + // ------------------------------------------------------- menu commands --- + + methods["app.setEnvironment"] = function (params) { + var variables = requireParam(params, "variables"); + var names = []; + for (var key in variables) { + if (has(variables, key)) { + // Process-scoped: the variable lives in this AE process only and is + // gone when it exits. Nothing is persisted to preferences. + $.setenv(key, String(variables[key])); + names.push(key); + } + } + return { names: names }; + }; + + methods["menu.find"] = function (params) { + var name = String(requireParam(params, "name")); + var id = app.findMenuCommandId(name); + if (!isFiniteNumber(id) || id <= 0) { + var missing = new Error("menu command not found: " + name); + missing.name = "NotFoundError"; + throw missing; + } + return { id: id, name: name }; + }; + + function sceneSnapshot() { + var project = app.project; + var active = project === null || project === undefined ? null : project.activeItem; + var snapshot = { + itemCount: project === null || project === undefined ? 0 : project.numItems, + comp: null, + layers: [] + }; + if (active !== null && active !== undefined && active instanceof CompItem) { + snapshot.comp = active.name; + for (var i = 1; i <= active.numLayers; i++) { + snapshot.layers.push(layerInfo(active.layer(i))); + } + } + return snapshot; + } + + methods["menu.execute"] = function (params) { + var id = requireParam(params, "id"); + if (!isFiniteNumber(id) || id <= 0 || Math.floor(id) !== id) { + throw new Error("menu command id must be a positive integer"); + } + var before = sceneSnapshot(); + var started = new Date().getTime(); + // Synchronous on AE 26.5x89, including commands an AEGP plugin registers: + // the plugin's command hook has returned when this does. + app.executeCommand(id); + var durationMs = new Date().getTime() - started; + return { + id: id, + durationMs: durationMs, + before: before, + after: sceneSnapshot() + }; + }; + + // ----------------------------------------------------------- dispatch --- + + /** + * Which sessions this engine has answered, by id. A plain object of booleans: + * the engine outlives every script, so nothing from After Effects (no item, + * comp or layer) may be kept here, or a later project switch invalidates it. + */ + function sessionStore() { + var store = $.global.__a8nSessions; + if (store === undefined || store === null) { + store = {}; + $.global.__a8nSessions = store; + } + return store; + } + + /** Refuses before doing anything when the request requires a session this engine never answered. */ + function checkSession(request) { + var session = request.session; + if (session === undefined || session === null || session.require !== true) { + return; + } + if (sessionStore()[String(session.id)] !== true) { + var mismatch = new Error( + "this After Effects instance did not answer the probe of this session, so " + String(request.method) + " was not run" + ); + mismatch.name = "SessionMismatch"; + throw mismatch; + } + } + + function rememberSession(request) { + var session = request.session; + if (session !== undefined && session !== null && session.adopt === true) { + sessionStore()[String(session.id)] = true; + } + } + + function extensionTable() { + var context = this.__a8n; + if (context === undefined || context === null || context.extensions === undefined) { + return {}; + } + return context.extensions; + } + + /** + * The extension method names actually registered in this After Effects, + * sorted. Read once at dispatcher activation: the table does not grow + * afterwards, so the heartbeat reports a fixed set (#146). + */ + function registeredExtensionNames() { + var table = extensionTable(); + var names = []; + for (var key in table) { + if (has(table, key) && typeof table[key] === "function") { + names.push(key); + } + } + names.sort(); + return names; + } + + /** + * A shallow copy of the registered extension functions, taken once at + * dispatcher activation. Dispatch resolves against this snapshot so the + * set the heartbeat reports is the set that actually answers (#146). + */ + function snapshotExtensionFunctions() { + var table = extensionTable(); + var copy = {}; + for (var key in table) { + if (has(table, key) && typeof table[key] === "function") { + copy[key] = table[key]; + } + } + return copy; + } + + /** + * The registration fingerprint the build prelude left on `__a8n`, or null + * when the running script was not built by `ae-a8n extension build`. It is + * copied into the heartbeat verbatim — the host never recomputes it. + */ + function extensionRegistration() { + var context = this.__a8n; + if (context === undefined || context === null) { + return null; + } + var value = context.extensionsRegistration; + return typeof value === "string" && value.length > 0 ? value : null; + } + + function dispatch(request, extensionOverride) { + if (request === null || typeof request !== "object") { + throw new Error("request envelope is not an object"); + } + // Extension methods are registered before this file loads and live in + // their own table: a built-in name always wins, because the build refuses + // a collision but the table must still not be able to replace one. + // + // Statements, not one nested conditional: measured on AE 26.5x89, + // ExtendScript evaluates `a ? x : b ? y : undefined` with the second test + // deciding the whole expression, so a name found in `methods` returned + // `extensions[name]` — undefined — and every call failed with "unknown + // method". An explicitly grouped conditional and plain `if` both evaluate + // correctly; this form is also correct in Node, so the fake host agrees. + // `extensionOverride` is the dispatcher path's activation-time snapshot + // (#146): the heartbeat reports that fixed set, so dispatch must resolve + // against the same fixed set — a later mutation of `__a8n.extensions` + // cannot widen what the dispatcher answers for. + var extensions = extensionOverride === undefined ? extensionTable() : extensionOverride; + var method; + if (has(methods, request.method)) { + method = methods[request.method]; + } else if (has(extensions, request.method)) { + method = extensions[request.method]; + } else { + method = undefined; + } + if (method === undefined) { + throw new Error("unknown method: " + String(request.method)); + } + if (typeof method !== "function") { + throw new Error("the method " + String(request.method) + " is not a function"); + } + checkSession(request); + var result = method(request.params); + rememberSession(request); + return result; + } + + function main() { + var codec = loadJson(); + var context = this.__a8n; + if (context === undefined || context === null) { + throw new Error("a8n host invoked without a __a8n context"); + } + + var started = new Date().getTime(); + var request; + var envelope; + + try { + request = codec.parse(readTextFile(context.request)); + var result = dispatch(request); + envelope = { + v: request.v, + id: request.id, + ok: true, + durationMs: new Date().getTime() - started, + result: result === undefined ? null : result + }; + } catch (error) { + var id = "unknown"; + if (request !== undefined && request !== null && request.id !== undefined) { + id = String(request.id); + } + envelope = { + v: 1, + id: id, + ok: false, + durationMs: new Date().getTime() - started, + error: toErrorPayload(error) + }; + } + + // Publish by rename so the driver never reads a partial envelope. A + // rename on the same directory is atomic; a direct write is not, and the + // driver can only tell the difference by refusing to read a half-written + // file. So the atomic path is worth retrying before giving it up — on + // Windows a transient handle (antivirus, AE itself) is the usual cause. + publishResult(String(context.result), codec.stringify(envelope)); + } + + var PUBLISH_ATTEMPTS = 3; + var PUBLISH_RETRY_MS = 50; + + /** The last path segment, taken from the string so nothing is URI-encoded. */ + function fileNameOf(path) { + var slash = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")); + return slash < 0 ? path : path.substring(slash + 1); + } + + /** + * Publishes `text` at `resultPath` and says how: "rename" or "direct". + * + * "rename": the result appeared whole, by renaming a fully written staging + * file in the same directory. A reader can never observe part of it. + * + * "direct": every rename failed and the result was written in place. A + * reader *can* observe a partial file; the driver re-reads until the + * envelope parses, so this costs latency, not correctness. + * + * Either way no staging file is left behind. + */ + function publishResult(resultPath, text) { + var staging = resultPath + ".part"; + writeTextFile(staging, text); + var finalFile = new File(resultPath); + // ExtendScript's `File.rename` takes a new *name* and keeps the file in + // its directory; given a full path it returns false (observed on AE + // 26.5x89). Passing a path would make every publication non-atomic. + var finalName = fileNameOf(resultPath); + + for (var attempt = 0; attempt < PUBLISH_ATTEMPTS; attempt++) { + var stagingFile = new File(staging); + // ExtendScript's rename refuses an existing destination. + if (finalFile.exists) { + finalFile.remove(); + } + if (stagingFile.rename(finalName)) { + return "rename"; + } + if (attempt + 1 < PUBLISH_ATTEMPTS) { + $.sleep(PUBLISH_RETRY_MS); + } + } + + // Every atomic attempt failed. Write anyway rather than lose a computed + // result, then drop the staging copy so it does not accumulate. + var leftover = new File(staging); + try { + writeTextFile(resultPath, text); + } catch (directWriteError) { + // A write that reported failure must not leave a readable envelope + // behind: the driver accepts any parseable result at resultPath, so a + // complete ok:true left by a failed close would be read as success. + var partial = new File(resultPath); + if (partial.exists) { + partial.remove(); + } + if (leftover.exists) { + leftover.remove(); + } + throw directWriteError; + } + if (leftover.exists) { + leftover.remove(); + } + return "direct"; + } + + // -------------------------------------------------------- dispatcher --- + // + // Opt-in in-AE transport (#127). Instead of answering one request file per + // script run, this mode keeps an `app.scheduleTask` polling a private + // channel directory and answers the *same* named operations from the same + // `methods` table — there is no second dispatch table and no eval of + // caller-supplied code. + // + // Activation is deliberate and human: File > Scripts > Run Script File on + // the generated `activate.jsx`, or a per-user `Scripts/Startup` entry the + // user installed. This file never installs itself, never opens a socket, + // and never quits After Effects. + // + // Channel contract (mirrors the one-shot path): + // /inbox/.request.json claimed by rename before it runs + // /outbox/.result.json published by rename + // /state.json heartbeat the Node side reads + // A request that cannot be answered still gets a failure envelope when it + // can be published; when it cannot, the caller reports UNKNOWN and never + // resends — a claimed request is never replayed. + + var DISPATCHER_POLL_MS = 250; + var DISPATCHER_MIN_POLL_MS = 50; + var DISPATCHER_MAX_POLL_MS = 5000; + /** Heartbeat refresh cadence, in ticks. */ + var DISPATCHER_STATE_EVERY = 8; + /** Outbox results older than this are deleted; they are deliveries nobody read. */ + var DISPATCHER_RESULT_MAX_AGE_MS = 60 * 60 * 1000; + + function dispatcherRefusal(reason) { + var error = new Error("request refused: " + reason); + error.name = "RequestRefusedError"; + return error; + } + + function dispatcherPaths(root) { + var base = String(root); + while (base.length > 1 && base.substring(base.length - 1) === "/") { + base = base.substring(0, base.length - 1); + } + return { + root: base, + inbox: base + "/inbox", + outbox: base + "/outbox", + state: base + "/state.json" + }; + } + + /** + * Validates a claimed request and runs it through the same `dispatch` the + * one-shot path uses. Throws — the caller turns that into a failure + * envelope — for anything that is not a live, authorized, named operation. + */ + function runDispatcherRequest(state, claimed, id) { + var started = new Date().getTime(); + var request; + try { + request = state.codec.parse(readTextFile(claimed.fsName)); + } catch (parseFailure) { + throw dispatcherRefusal("the request is not valid JSON"); + } + if (request === null || typeof request !== "object" || request.v !== 1) { + throw dispatcherRefusal("unsupported request envelope"); + } + if (String(request.id) !== id) { + // The id in the envelope must be the id in the file name: a mismatch + // means the file was not addressed to this request slot. + throw dispatcherRefusal("request id does not match its file name"); + } + if (request.token !== state.token) { + throw dispatcherRefusal("request token does not match this channel"); + } + // Defence in depth for the pre-claim filter in dispatcherTick: a request + // that names a different dispatcher instance must never run here, even + // if it was claimed before the filter could see it. + if (typeof request.target === "string" && request.target !== state.instance) { + throw dispatcherRefusal("request targets a different dispatcher instance"); + } + if (typeof request.method !== "string" || request.method.length === 0) { + throw dispatcherRefusal("request names no method"); + } + if (typeof request.timeoutMs !== "number" || !isFinite(request.timeoutMs)) { + throw dispatcherRefusal("request carries no usable deadline"); + } + var now = new Date().getTime(); + if (now > claimed.modified.getTime() + request.timeoutMs) { + // The caller's deadline already passed while the request waited + // unclaimed (AE busy, dispatcher not yet active). Refuse it: running + // it now would execute work nobody is still waiting for. + var stale = new Error("request expired before the dispatcher claimed it"); + stale.name = "StaleRequestError"; + throw stale; + } + var result = dispatch(request, state.extensionFunctions); + return { + v: request.v, + id: id, + ok: true, + durationMs: new Date().getTime() - started, + result: result === undefined ? null : result + }; + } + + function writeDispatcherState(state) { + var report = { + v: 1, + token: state.token, + instance: state.instance, + aeVersion: String(app.version), + activatedAt: state.activatedAt, + lastTick: new Date().getTime(), + pollMs: state.pollMs, + // The per-delivery nonce a `ae.activateDispatcher()` script carried + // (#276). Null for a human activation; the Node side requires it to + // match its own delivery before reporting activation success. + activationNonce: state.activationNonce === undefined ? null : state.activationNonce, + // The extension set this dispatcher actually registered (#146). + // Captured once at activation into `state`; the table cannot change + // afterwards, so the heartbeat keeps reporting the fixed set — not a + // claim that the staged file matches. + extensionMethods: state.extensionMethods, + extensionsRegistration: state.extensionsRegistration + }; + try { + publishResult(state.paths.state, state.codec.stringify(report)); + } catch (stateError) { + // A heartbeat that cannot be written is not worth a modal dialog; the + // Node side reads a stale file as "not answering" and says so. + } + } + + /** Removes outbox results too old for any caller to still be waiting on. */ + function sweepDispatcherOutbox(state) { + var outbox = new Folder(state.paths.outbox); + if (!outbox.exists) { + return; + } + var horizon = new Date().getTime() - DISPATCHER_RESULT_MAX_AGE_MS; + var files = outbox.getFiles("*.result.json"); + for (var i = 0; i < files.length; i++) { + var file = files[i]; + if (file instanceof File && file.modified.getTime() < horizon) { + file.remove(); + } + } + } + + function dispatcherTick(state) { + try { + var inbox = new Folder(state.paths.inbox); + if (!inbox.exists) { + return; + } + var files = inbox.getFiles("*.request.json"); + files.sort(function (a, b) { + if (a.name < b.name) { + return -1; + } + if (a.name > b.name) { + return 1; + } + return 0; + }); + // One request per tick: the channel contract is strictly serial, so a + // long operation can never overlap the next claim. Files that are not + // dispatcher requests (other writers, stale names) are skipped, never + // allowed to stall the queue. + for (var i = 0; i < files.length; i++) { + var file = files[i]; + if (!(file instanceof File)) { + continue; + } + var match = /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.request\.json$/.exec(file.name); + if (match === null) { + continue; + } + var id = match[1]; + // Target binding (#145): a request that names a dispatcher instance + // is claimed only by that instance. Two After Effects can share one + // channel; without this check the first poller would run — or refuse + // — work addressed to the other. The file is left in place for the + // dispatcher it names; an unreadable file falls through to the + // claim path, which reports it as a refusal. + try { + var peek = state.codec.parse(readTextFile(file.fsName)); + if ( + peek !== null && + typeof peek === "object" && + typeof peek.target === "string" && + peek.target !== state.instance + ) { + continue; + } + } catch (peekError) { + // Malformed JSON is the claim path's refusal to report, not ours. + } + // Claim before running: a host restart cannot replay a claimed + // operation, and a second dispatcher cannot take the same file. + if (!file.rename(id + ".claimed")) { + continue; + } + var claimed = new File(inbox.fsName + "/" + id + ".claimed"); + var began = new Date().getTime(); + var reply; + try { + reply = runDispatcherRequest(state, claimed, id); + } catch (failure) { + reply = { + v: 1, + id: id, + ok: false, + durationMs: new Date().getTime() - began, + error: toErrorPayload(failure) + }; + } + try { + publishResult( + state.paths.outbox + "/" + id + ".result.json", + state.codec.stringify(reply) + ); + } catch (publishError) { + // The caller times out UNKNOWN; do not retry a claimed request. + } + claimed.remove(); + break; + } + state.ticks += 1; + if (state.ticks % DISPATCHER_STATE_EVERY === 0) { + writeDispatcherState(state); + sweepDispatcherOutbox(state); + } + } catch (tickError) { + // A scheduled task must never raise a modal dialog while the user + // works. With no state update the Node side reports UNKNOWN. + } + } + + function startDispatcher(config) { + var runningState = $.global.__a8nDispatcherState; + if ($.global.__a8nDispatcherTask !== undefined) { + // A dispatcher is already running in this After Effects. A freshly + // generated activation script carries a new per-delivery nonce: + // recording it re-proves that THIS delivery reached this instance, + // without starting a second dispatcher. Re-running the identical + // script (same nonce) or a human activate.jsx (no nonce) is still + // refused, exactly as before. + var deliveredNonce = + config !== null && + typeof config === "object" && + typeof config.nonce === "string" && + /^[a-f0-9]{32}$/.test(config.nonce) + ? config.nonce + : null; + if ( + runningState !== undefined && + runningState !== null && + deliveredNonce !== null && + deliveredNonce !== runningState.activationNonce + ) { + runningState.activationNonce = deliveredNonce; + writeDispatcherState(runningState); + return; + } + throw new Error( + "ae-a8n dispatcher is already active in this After Effects; " + + "refusing a second dispatcher" + ); + } + var codec = loadJson(); + var root = new Folder(String(config.root)); + // ExtendScript's Folder has no `isDirectory` (observed on AE 26.5 — the + // fake Folder models one, which is why only the real host tripped this). + // `exists` plus the inbox/outbox checks below are the real contract: a + // plain file at the root fails there with a clearer error anyway. + if (!root.exists) { + throw new Error("ae-a8n dispatcher: channel root is not a directory: " + String(config.root)); + } + var paths = dispatcherPaths(root.fsName); + var inbox = new Folder(paths.inbox); + var outbox = new Folder(paths.outbox); + if (!inbox.exists || !outbox.exists) { + throw new Error("ae-a8n dispatcher: channel folders are missing; prepare the channel first"); + } + var token = String(config.token); + if (!/^[a-f0-9]{64}$/.test(token)) { + throw new Error("ae-a8n dispatcher: channel token is malformed"); + } + var pollMs = config.pollMs; + if (typeof pollMs !== "number" || !isFinite(pollMs)) { + pollMs = DISPATCHER_POLL_MS; + } + if (pollMs < DISPATCHER_MIN_POLL_MS) { + pollMs = DISPATCHER_MIN_POLL_MS; + } + if (pollMs > DISPATCHER_MAX_POLL_MS) { + pollMs = DISPATCHER_MAX_POLL_MS; + } + if (typeof app.scheduleTask !== "function") { + throw new Error("ae-a8n dispatcher: this After Effects has no app.scheduleTask"); + } + var state = { + codec: codec, + paths: paths, + token: token, + pollMs: pollMs, + instance: + "i" + + new Date().getTime().toString(16) + + Math.floor(Math.random() * 0xffffff).toString(16), + activatedAt: new Date().getTime(), + ticks: 0, + // Fixed here, once: whatever `__a8n.extensions` holds right now is + // what this dispatcher will answer for its whole life. A host script + // built without the extension prelude leaves both empty/null. + extensionMethods: registeredExtensionNames(), + extensionsRegistration: extensionRegistration(), + // The function snapshot dispatch actually resolves against (#146): + // the heartbeat's names and this table are captured together, so a + // later mutation of `__a8n.extensions` cannot widen the answer set. + extensionFunctions: snapshotExtensionFunctions(), + // The nonce this activation script carried, if any (#276). A later + // re-delivery with a fresh nonce replaces it (see the guard above), + // which is how `ae.activateDispatcher()` proves each call reached + // this instance. + activationNonce: + typeof config.nonce === "string" && /^[a-f0-9]{32}$/.test(config.nonce) + ? config.nonce + : null + }; + // Kept on the global so a re-delivered activation script can re-prove + // delivery against the running dispatcher instead of starting a + // second one. + $.global.__a8nDispatcherState = state; + var tick = function () { + dispatcherTick(state); + }; + // The scheduled string names the global, so the function must be there + // before the first fire — pollMs later at the earliest. + $.global.__a8nDispatcherTick = tick; + $.global.__a8nDispatcherTask = app.scheduleTask( + "$.global.__a8nDispatcherTick()", + pollMs, + true + ); + writeDispatcherState(state); + } + + // The branch check must run inside a named function called plainly, not + // at the IIFE's top level: on real ExtendScript `this` inside + // `(function(){})()` is the function itself, not the global object + // (observed on AE 26.5/27.0 — the fake vm runtime cannot reproduce this). + // Inside a named function `this` is the global object, the same contract + // `main()` and the extension prelude already rely on. Evaluating + // `this.__a8n` here would always miss and silently fall into `main()`. + function boot() { + var __a8nEntry = this.__a8n; + if ( + __a8nEntry !== undefined && + __a8nEntry !== null && + __a8nEntry.dispatcher !== undefined && + __a8nEntry.dispatcher !== null + ) { + startDispatcher(__a8nEntry.dispatcher); + } else { + main(); + } + } + boot(); +})(); diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/ae-a8n-0.6.0.tgz b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/ae-a8n-0.6.0.tgz new file mode 100644 index 0000000..90b5cb5 Binary files /dev/null and b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/ae-a8n-0.6.0.tgz differ diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-doctor.json b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-doctor.json new file mode 100644 index 0000000..3a93e62 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-doctor.json @@ -0,0 +1,316 @@ +{ + "schema": "ae-devtools.cli.doctor/v1", + "node": "v24.22.1", + "platform": "darwin/arm64", + "devloopSchema": "ae-devtools.dev-loop/v1", + "aeA8n": { + "resolvable": true, + "source": "npm:@ido-bata/ae-a8n", + "version": "0.6.0", + "contractOk": true, + "missing": [], + "checks": [ + { + "id": "negotiation.compatible", + "ok": true + }, + { + "id": "negotiation.client-older-minor", + "ok": true + }, + { + "id": "negotiation.incompatible-major", + "ok": true + }, + { + "id": "negotiation.unsupported-minor", + "ok": true + }, + { + "id": "negotiation.malformed-schema", + "ok": true + }, + { + "id": "negotiation.requested-capability-compatible", + "ok": true + }, + { + "id": "negotiation.unknown-capability", + "ok": true + }, + { + "id": "negotiation.capability-unassessed", + "ok": true + }, + { + "id": "negotiation.missing-permission", + "ok": true + }, + { + "id": "dispatch.pass-owned", + "ok": true + }, + { + "id": "dispatch.pass-explicitly-attached", + "ok": true + }, + { + "id": "dispatch.refuse-unknown-ownership", + "ok": true + }, + { + "id": "dispatch.refuse-contradictory-claim", + "ok": true + }, + { + "id": "dispatch.refuse-unverified", + "ok": true + }, + { + "id": "dispatch.refuse-not-implemented", + "ok": true + }, + { + "id": "dispatch.refuse-no-execution-path", + "ok": true + }, + { + "id": "dispatch.refuse-missing-permission", + "ok": true + }, + { + "id": "dispatch.refuse-no-permission-declared", + "ok": true + }, + { + "id": "dispatch.refuse-unknown-capability", + "ok": true + }, + { + "id": "dispatch.refuse-unassessed", + "ok": true + }, + { + "id": "dispatch.refuse-malformed", + "ok": true + } + ], + "required": "ae-a8n capability handshake (ae-a8n#102), which post-dates the ae-a8n#103 extension-prelude and ae-a8n#105 LaunchServices fixes" + }, + "aeInstalls": [ + "/Applications/Adobe After Effects 2026", + "/Applications/Adobe After Effects 2027" + ], + "a8nTransportPresent": true, + "runsDir": "/var/folders/1l/fmlzfnk57zndv1pxwwkw6xrc0000gn/T/ae-devtools-cli-runs", + "runs": [ + { + "runId": "run-2026-11-20T12-13-19-501Z-16437323", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T12-13-28-112Z-0c18551d", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T12-24-42-140Z-a7f95a54", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-05-42-702Z-0751884c", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-09-23-878Z-26656cd6", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-09-27-848Z-bd51d081", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-09-34-676Z-c35c8151", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-10-17-411Z-7978b47b", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-10-50-445Z-e549e3a8", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-12-08-740Z-5e49a39f", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T15-13-14-138Z-657e6ce0", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T16-37-11-846Z-0d05a36c", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T16-37-13-037Z-a30e1123", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T16-55-08-444Z-b8fd131f", + "status": "open", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "NO_A8N_ATTESTATION", + "ownership": "owned" + }, + { + "runId": "run-2026-11-20T17-23-01-561Z-8a0af1d7", + "status": "open-failed", + "sessionKind": "a8n-attached", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T18-40-53-034Z-60c06fe2", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T21-25-55-073Z-eacc0e31", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T21-31-23-157Z-bed75858", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T22-18-44-996Z-2f43a20d", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T23-16-26-082Z-cf8f01bd", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-20T23-26-50-651Z-2ba1e0d1", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-21T05-40-28-253Z-71219dde", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + }, + { + "runId": "run-2026-11-21T06-08-36-771Z-cb67acd3", + "status": "open-failed", + "sessionKind": "a8n", + "runnerAlive": false, + "reapable": false, + "reapBlockReason": "OWNERSHIP_NOT_OWNED", + "ownership": null + } + ], + "evidenceLevel": "environment probe only — no AE was contacted" +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-project-open.json b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-project-open.json new file mode 100644 index 0000000..1349e9d --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/cli-project-open.json @@ -0,0 +1,72 @@ +{ + "schema": "ae-devtools.cli.run/v1", + "runId": "run-2026-11-23T15-41-08-304Z-d5218fe3", + "command": "execute", + "sourceSha": "7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2", + "sourceDirty": false, + "opId": "project.open", + "requestId": "req-run-2026-11-23T15-41-08-304Z-d5218fe3-project.open", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "at": "2026-11-23T15:41:16.174Z", + "result": { + "requestId": "req-run-2026-11-23T15-41-08-304Z-d5218fe3-project.open", + "operationId": "project.open", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "project": "/tmp/run-032/real/Conformance-Disposable.aep" + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.open", + "mutating": true, + "destructive": true + }, + "outcome": "COMPLETED", + "supervision": { + "status": "observed", + "source": "state", + "schemaVersion": "ae-a8n.supervision/v1", + "phase": "running", + "health": "degraded", + "healthDetail": null, + "blocking": null, + "pendingRequests": [ + { + "id": "66bcc74e-b43d-4820-8a0f-0ce6879eb52d", + "method": "aeDevtools.trustedEval", + "since": "2026-11-23T15:41:16.486Z", + "state": "in-flight", + "transport": "script-invocation" + } + ], + "deadline": null, + "enteredAt": "2026-11-23T15:41:13.131Z", + "updatedAt": "2026-11-23T15:41:18.603Z", + "monitor": { + "ownerId": "ae-a8n-session", + "pid": 52698, + "pidStart": null, + "acquiredAt": "2026-11-23T15:41:13.128Z", + "heartbeatAt": "2026-11-23T15:41:17.345Z" + }, + "needsHuman": null, + "readAt": "2026-11-23T15:41:18.607Z" + }, + "evidenceFile": "/tmp/run-032/evidence/cli-project-open.json", + "cleanup": { + "attempted": true, + "ok": true, + "error": null, + "quit": null + } +} \ No newline at end of file diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-mcp-real-run.mjs b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-mcp-real-run.mjs new file mode 100644 index 0000000..afc33cf --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-mcp-real-run.mjs @@ -0,0 +1,281 @@ +#!/usr/bin/env node +/** + * mcp-real-run.mjs — Issue #177 REAL-AE conformance run, MCP stdio lane. + * + * node packages/ae-devtools-cli/conformance/mcp-real-run.mjs \ + * --session a8n \ + * --install-dir "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app" \ + * --fixture --out + * + * Drives mcp-server/server.mjs over stdio (NDJSON) against an OWNED AE + * session and records every frame. Same disposable-project contract as + * conformance/real-run.mjs: + * + * ae_discover → ae_verify (pre-state read-back) → + * ae_execute project.new (confirmDestructive) → + * ae_execute project.save → + * ae_execute item.addComp → ae_verify (read-back shows the comp) → + * ae_execute item.remove (confirmDestructive) → ae_verify (empty) + * + * The project is saved to --fixture before any mutation, so the open + * project IS the disposable fixture; after item.remove the project is + * back at its saved state and session close (unsavedChanges:"refuse") + * must quit cleanly — a refusal is recorded, never counted as pass. + * + * --fixture may be a directory (a Conformance-MCP-Disposable.aep is + * created inside it) or a direct .aep path. + * + * Replay: the archived harness-*.mjs copies under evidence/ resolve + * their imports (mcp-server/server.mjs, devtools-cli/*.mjs) against the + * repository checkout — replay requires the tree at the run's recorded + * sourceSha, not the evidence directory alone. + */ +import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +import { arg } from "../devtools-cli/argv.mjs"; +import { spawnMcpStdio, withTimeout, isCleanServerShutdown } from "../devtools-cli/real-run-kit.mjs"; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const CLI = join(HERE, ".."); + +const session = arg("--session") ?? "a8n"; +const fixtureArg = arg("--fixture"); +if (!fixtureArg) { + console.error("usage: mcp-real-run.mjs --fixture [--session a8n] [--install-dir ] [--out ]"); + process.exit(2); +} +const fixturePath = statSync(fixtureArg, { throwIfNoEntry: false })?.isDirectory() + ? join(fixtureArg, "Conformance-MCP-Disposable.aep") + : fixtureArg; +mkdirSync(dirname(fixturePath), { recursive: true }); + +const OUT = arg("--out") ?? join(process.cwd(), `mcp-conformance-${Date.now()}.jsonl`); +const log = []; +const rec = (o) => { + log.push({ t: new Date().toISOString(), ...o }); + writeFileSync(OUT, JSON.stringify(log, null, 2)); +}; + +const serverArgs = ["mcp-server/server.mjs", "--session", session]; +const installDir = arg("--install-dir"); +if (installDir) serverArgs.push("--install-dir", installDir); + +// NDJSON stdio client harness shared with mcp-server/real-run.mjs +// (Issue #197). +// A recorded `fatal` is a failed conformance run — exit nonzero so +// callers/CI cannot read it as success (same contract as +// mcp-server/real-run.mjs, Issue #234). The JSONL remains the +// verdict record either way. +let fatal = false; +const { child, send, notify, call } = spawnMcpStdio({ + scriptArgs: serverArgs, + cwd: CLI, + onRecord: rec, + onStderr: (d) => rec({ stderr: d.slice(0, 800) }), +}); + +const COMP_NAME = "MCP Conformance Comp"; +const results = {}; +const recordToolResult = (tag, msg) => { + const text = msg?.result?.content?.[0]?.text; + let parsed = null; + try { parsed = text ? JSON.parse(text) : null; } catch { /* keep raw */ } + results[tag] = { + isError: msg?.result?.isError === true || msg?.error !== undefined, + outcome: parsed?.outcome ?? parsed?.status ?? null, + session: parsed?.session ?? null, + result: parsed?.result ?? parsed ?? null, + }; + rec({ stepResult: tag, ...results[tag] }); +}; + +try { + rec({ step: "initialize", argv: serverArgs, fixturePath }); + const init = await withTimeout( + send("initialize", { + protocolVersion: "2024-11-05", + capabilities: {}, + clientInfo: { name: "ae-devtools-conformance", version: "0" }, + }), + 30000, + "init", + ); + notify("notifications/initialized"); + rec({ step: "initialized", serverInfo: init?.result?.serverInfo ?? null }); + + rec({ step: "ae_discover" }); + recordToolResult("ae_discover", await withTimeout(call("ae_discover", {}), 60000, "discover")); + + // Pre-state read-back: whatever project AE restored is observed, + // never mutated — project.new replaces it only if it is clean. When + // this read does not COMPLETE, the pre-mutation project identity is + // unknown and mutation must not proceed (same fail-closed rule as + // real-run.mjs's identity gate). + rec({ step: "ae_verify.pre-state" }); + recordToolResult("ae_verify.pre", await withTimeout(call("ae_verify", { consent: "grant" }), 300000, "verify-pre")); + const preRead = results["ae_verify.pre"]; + if (!preRead || preRead.isError || preRead.outcome !== "COMPLETED") { + throw new Error( + `pre-mutation identity read-back did not complete (isError=${preRead?.isError === true}, outcome=${preRead?.outcome ?? "missing"}); refusing to mutate`, + ); + } + + rec({ step: "ae_execute.project.new (launches owned AE)" }); + recordToolResult("project.new", await withTimeout( + call("ae_execute", { opId: "project.new", args: {}, consent: "grant", confirmDestructive: true }), + 300000, + "project.new", + )); + // A failed project.new/project.save leaves the pre-mutation project + // identity unverified — every later step would mutate an unknown + // project. Fail closed before the first content mutation. + const gateMutation = (tag) => { + const r = results[tag]; + if (!r || r.isError || r.outcome !== "COMPLETED") { + throw new Error( + `${tag} did not complete (isError=${r?.isError === true}, outcome=${r?.outcome ?? "missing"}); refusing to mutate`, + ); + } + }; + gateMutation("project.new"); + + rec({ step: "ae_execute.project.save" }); + recordToolResult("project.save", await withTimeout( + call("ae_execute", { opId: "project.save", args: { path: fixturePath }, consent: "grant" }), + 120000, + "project.save", + )); + gateMutation("project.save"); + + rec({ step: "ae_execute.item.addComp" }); + recordToolResult("item.addComp", await withTimeout( + call("ae_execute", { + opId: "item.addComp", + args: { name: COMP_NAME, width: 1920, height: 1080, pixelAspect: 1, duration: 5, frameRate: 30 }, + consent: "grant", + }), + 120000, + "addComp", + )); + + rec({ step: "ae_verify.readback" }); + recordToolResult("ae_verify.readback", await withTimeout(call("ae_verify", { consent: "grant" }), 120000, "verify")); + + rec({ step: "ae_execute.item.remove" }); + recordToolResult("item.remove", await withTimeout( + call("ae_execute", { + opId: "item.remove", + args: { name: COMP_NAME, type: "CompItem" }, + consent: "grant", + confirmDestructive: true, + }), + 120000, + "item.remove", + )); + + rec({ step: "ae_verify.final" }); + recordToolResult("ae_verify.final", await withTimeout(call("ae_verify", { consent: "grant" }), 120000, "verify-final")); + + // item.remove leaves AE's dirty flag set even though content matches + // the saved fixture — re-save so session close can quit cleanly. + rec({ step: "ae_execute.project.save.resave" }); + recordToolResult("project.save.resave", await withTimeout( + call("ae_execute", { opId: "project.save", args: { path: fixturePath }, consent: "grant" }), + 120000, + "project.save.resave", + )); +} catch (e) { + fatal = true; + rec({ fatal: String(e?.message ?? e) }); +} finally { + // SIGTERM runs the server's shutdown path: session.close() + // (unsavedChanges:"refuse") — a clean disposable project quits; a + // refusal is recorded on stderr, never hidden. Success requires a + // CONFIRMED exit — a still-running child after SIGKILL is a failed + // run, not a pass. + child.kill("SIGTERM"); + await new Promise((r) => setTimeout(r, 15000)); + let shutdownConfirmed = child.exitCode !== null || child.signalCode !== null; + let forcedKill = false; + if (!shutdownConfirmed) { + try { child.kill("SIGKILL"); forcedKill = true; } catch {} + await new Promise((r) => setTimeout(r, 3000)); + shutdownConfirmed = child.exitCode !== null || child.signalCode !== null; + } + // Clean shutdown means the server's OWN shutdown path completed: + // SIGTERM → shutdown(143) → session.close() → process.exit(143). + // Merely stopping is not proof — an exit code of 1 (e.g. an + // unhandled rejection during close) or death by signal means + // session.close() never confirmed the owned AE session closed + // (Issue #384). exitCode/signalCode are recorded either way. + const exitCode = child.exitCode; + const signalCode = child.signalCode; + const cleanShutdown = isCleanServerShutdown({ + shutdownConfirmed, forcedKill, exitCode, signalCode, + }); + rec({ + step: "server.stopped", fixturePath, shutdownConfirmed, cleanShutdown, + forcedKill, exitCode, signalCode, results, + }); + if (!cleanShutdown) { + fatal = true; + rec({ + fatal: !shutdownConfirmed + ? "MCP server child did not exit after SIGTERM+SIGKILL" + : forcedKill + ? "MCP server child required SIGKILL — unclean shutdown" + : `MCP server shutdown exit was not the clean SIGTERM path (exitCode=${exitCode} signalCode=${signalCode})`, + }); + } + + // Verdict: a recorded isError or a non-COMPLETED outcome is a failed + // conformance run — never a pass. Read-back lanes must also show the + // expected disposable-project state (comp present after addComp, + // absent after item.remove), not just a COMPLETED write outcome. + const failures = []; + const expectCompleted = [ + "ae_verify.pre", "project.new", "project.save", "item.addComp", + "ae_verify.readback", "item.remove", "ae_verify.final", + "project.save.resave", + ]; + for (const tag of expectCompleted) { + const r = results[tag]; + if (!r) { failures.push(`${tag}: missing result`); continue; } + if (r.isError) failures.push(`${tag}: isError=true`); + if (r.outcome !== "COMPLETED") failures.push(`${tag}: outcome=${r.outcome ?? "null"}`); + } + const discover = results.ae_discover; + if (!discover || discover.isError) failures.push("ae_discover: missing or isError"); + const itemsOf = (tag) => { + const r = results[tag]; + const payload = r?.result?.result ?? r?.result ?? null; + return Array.isArray(payload?.items) ? payload.items : null; + }; + const readbackItems = itemsOf("ae_verify.readback"); + if (readbackItems === null || + !readbackItems.some((i) => i && i.name === COMP_NAME)) { + failures.push("ae_verify.readback: comp not observed in project items"); + } + const finalItems = itemsOf("ae_verify.final"); + // The fixture was created EMPTY: a correct run must leave zero items. + // Checking only for COMP_NAME's absence would pass a project still + // holding unrelated leftovers (e.g. a stray "Other Comp"). + if (finalItems === null) { + failures.push("ae_verify.final: items unreadable after item.remove"); + } else if (finalItems.length !== 0) { + failures.push(`ae_verify.final: ${finalItems.length} item(s) remain (expected empty fixture)`); + } + // Verdict and exit status must share ONE failure state: an unconfirmed + // or SIGKILL-forced shutdown recorded above is a failed run, never a + // "pass" verdict with a nonzero exit. + if (!cleanShutdown) failures.push("server.stopped: shutdown was not a confirmed clean exit"); + if (failures.length > 0) { + fatal = true; + rec({ verdict: "fail", failures }); + } else { + rec({ verdict: "pass" }); + } + process.exit(fatal ? 1 : 0); +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-real-run.mjs b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-real-run.mjs new file mode 100644 index 0000000..6c1f475 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/harness-real-run.mjs @@ -0,0 +1,579 @@ +#!/usr/bin/env node +/** + * real-run.mjs — Issue #177 minimal REAL-AE conformance run. + * + * node packages/ae-devtools-cli/conformance/real-run.mjs \ + * --install-dir "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app" \ + * --workdir --out + * + * ONE owned AE session (registry @ido-bata/ae-a8n — never --ae-a8n-root) + * drives every lane so the disposable-project guarantee covers all of + * them: + * + * 0. provenance — sourceSha, ae-a8n source/version, AE install, + * generated host script copied out before close + * 1. identity — eval read of app.version / project.file / + * numItems / project.dirty BEFORE any mutation; + * dirty===true aborts (never discard user changes) + * 2. disposable — project.new → project.save(/fixture.aep) + * → identity re-read must show file==fixture and + * numItems==0, otherwise the run fails closed + * 3. cli-path — registry ops via dev-loop runOperation (the same + * dispatch path devtools-cli execute uses): + * read.projectSummary → item.addComp → + * read.projectSummary (read-back) → ae.undo → + * read.projectSummary → item.addComp#2 → + * item.remove → read.projectSummary + * 4. jsx lane — jsx-toolchain buildFile(ok.ts) dispatch + + * $.global read-back; runtime-error.ts dispatch → + * FAILED → sourcemap → TS source line + * 5. a8n slice — runVerticalSlice + assertSliceOutcomes (the + * Issue #49 read-only consent/transport scenario) + * 6. timeout — $.sleep dispatch under a short-deadline runner + * must classify UNKNOWN and never resend + * 7. close — session.close({unsavedChanges:"refuse"}) must + * quit:true; the project is provably back at its + * saved state, so a refusal is a FAILED run, not + * a pass. Main-AE process must be gone afterwards. + * + * Consent is a LOCAL POLICY (approve-all for this harness), identical + * in strength to a8n-transport/scenario.mjs — it exercises gate + * mechanics, not authenticated authorization (ae-a8n #97–#99). + */ +import { createHash } from "node:crypto"; +import { + copyFileSync, + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + writeFileSync, +} from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; + +import { openRealRunSession } from "../dev-loop/real-run-session.mjs"; +import { runVerticalSlice, assertSliceOutcomes } from "../a8n-transport/scenario.mjs"; +import { createJsxRunner } from "../trusted-execution/runner.mjs"; +import { runOperation } from "../scripting-adapters/execute.mjs"; +import { buildFile } from "../jsx-toolchain/src/build.mjs"; +import { lookup } from "../jsx-toolchain/src/sourcemap.mjs"; +import { arg } from "../devtools-cli/argv.mjs"; +import { isMainEntry } from "../devtools-cli/is-main-entry.mjs"; +import { + MAIN_EXE, + aeProcessSnapshot, + createEvalDispatch, + gitHeadAndDirty, + isCleanTimeoutProbe, +} from "../devtools-cli/real-run-kit.mjs"; + +const HERE = dirname(new URL(import.meta.url).pathname); +const FIXTURES = join(HERE, "..", "jsx-toolchain", "fixtures"); + +const EVAL_OP = "op.a8n-transport.eval"; +const PROJECT_IDENTITY_PRE = "conformance-pre-disposable"; + +function sha256File(path) { + return createHash("sha256").update(readFileSync(path)).digest("hex"); +} + +export async function main() { + const installDir = arg("--install-dir"); + const out = arg("--out") ?? join(process.cwd(), `conformance-run-${Date.now()}.json`); + const workdir = arg("--workdir") ?? mkdtempSync(join(tmpdir(), "ae-conformance-")); + const fixturePath = join(workdir, "Conformance-Disposable.aep"); + const hostScriptCopy = join(workdir, "a8n-host-ext.js"); + const processFragment = installDir ?? "Adobe After Effects"; + const startedAt = new Date().toISOString(); + + const evidence = { + schema: "ae-devtools.conformance-run/v1", + issue: 177, + startedAt, + platform: `${process.platform}/${process.arch}`, + node: process.version, + installDir: installDir ?? null, + workdir, + fixturePath, + git: await gitHeadAndDirty(HERE), + consentModel: "local approve-all policy (gate mechanics only; not authenticated authorization)", + aeProcessesBeforeLaunch: await aeProcessSnapshot(processFragment), + steps: [], + ok: true, + }; + const step = (name, data = {}) => { + evidence.steps.push({ name, at: new Date().toISOString(), ...data }); + console.log(`${data.ok === false ? "FAIL" : "ok"} ${name}`); + if (data.ok === false) evidence.ok = false; + }; + + let session = null; + let guard = null; + const opResults = {}; + const evalResults = {}; + try { + // Canonical session open + run-guard marker (Issue #252): a killed + // driver leaves an attested, reap/recover-visible residue record. + // The raw slice handle stays available as `session` for internals. + const opened = await openRealRunSession({ + surface: "conformance-real-run", + argv: process.argv.slice(2), + sessionOptions: { + ...(installDir !== undefined ? { installDir } : {}), + workdir: join(workdir, "session"), + }, + }); + guard = opened.guard; + session = opened.slice; + step("session.launch", { + ok: true, + aeVersion: session.info?.version ?? null, + aeBuild: session.info?.build ?? null, + ownership: session.ownership?.kind ?? null, + aeA8nSource: session.aeA8nSource, + aeA8nHead: session.aeA8nHead, + }); + // Keep the generated host script + trace: session.close() deletes + // the session workdir, so copy them out first. + const wsHostScript = join(workdir, "session", "a8n-host-ext.js"); + if (existsSync(wsHostScript)) { + copyFileSync(wsHostScript, hostScriptCopy); + evidence.hostScriptSha256 = sha256File(hostScriptCopy); + evidence.hostScriptCopy = hostScriptCopy; + } + + // ---- eval dispatch helper (consent scope bound to exact source) ---- + // Shared wrapper (Issue #197): the consent scope and the runScript + // args shape are hashed together inside runner.mjs, so one builder + // keeps them from drifting. projectIdentity is read lazily — it is + // re-bound after project.new/project.save below. + let projectIdentity = PROJECT_IDENTITY_PRE; + const evalDispatchRaw = createEvalDispatch({ + runner: session.runner, + pin: session.pin, + projectIdentity: () => projectIdentity, + operationId: EVAL_OP, + scriptProvenance: "conformance-run", + }); + const evalDispatch = async (label, source) => { + const r = await evalDispatchRaw(source, `conf-eval-${label}-${Date.now().toString(36)}`); + evalResults[label] = r; + return r; + }; + + // ---- op dispatch helper (dev-loop runOperation = CLI path) ---- + const opSeq = { n: 0 }; + const op = async (opId, args = {}, extra = {}) => { + const label = `${opId}#${++opSeq.n}`; + const r = await runOperation({ + opId, + args, + runner: session.runner, + pin: session.pin, + projectIdentity, + consentProvider: async () => ({ approved: true }), + trustedScriptOptIn: true, + scriptProvenance: "conformance-run", + requestId: `conf-op-${label}-${Date.now().toString(36)}`, + ...extra, + }); + opResults[label] = r; + return r; + }; + + const IDENTITY_SOURCE = + "(function(){var f=app.project.file;var d=(typeof app.project.dirty===\"boolean\")?String(app.project.dirty):\"unsupported\";" + + // The file path is percent-encoded: a raw fsName may itself + // contain "|" or look like a "V:/N:/D:" field, which would make + // the delimiter parse ambiguous. encodeURIComponent output can + // never contain the "|" separator. + "return \"V:\"+String(app.version)+\"|F:\"+(f?encodeURIComponent(f.fsName):\"\")+\"|N:\"+String(app.project.numItems)+\"|D:\"+d;})()"; + const parseIdentity = (result) => { + const s = typeof result === "string" ? result : ""; + const get = (k) => { + const m = s.match(new RegExp(`${k}:([^|]*)`)); + return m ? m[1] : null; + }; + const rawFile = get("F"); + let file = null; + if (rawFile !== null) { + try { file = rawFile === "" ? "" : decodeURIComponent(rawFile); } + catch { file = null; } // undecodable path -> fail closed downstream + } + return { version: get("V"), file, items: get("N"), dirty: get("D"), raw: s }; + }; + + // ---- 1. project identity BEFORE any mutation ---- + const id1 = await evalDispatch("identity.before", IDENTITY_SOURCE); + const before = parseIdentity(id1.result); + // The disposable gate below is only as safe as this read: when the + // identity probe did not COMPLETE, before.* fields are null and the + // gate cannot prove the restored project is untouched — proceeding + // to project.new could destroy user state. Fail closed instead. + const identityReadOk = id1.outcome === "COMPLETED" && before.file !== null; + step("identity.before", { + ok: identityReadOk, + outcome: id1.outcome, + project: before, + }); + evidence.projectBefore = before; + if (!identityReadOk) { + throw new Error( + `project identity read did not complete (outcome=${id1.outcome}); refusing to proceed toward mutation`, + ); + } + + // ---- 2. disposable project gate ---- + // app.newProject() prompts to save when the current project was + // edited (Adobe Scripting Guide). dirty===true means the restored + // project carries unsaved state — abort rather than risk a modal or + // a discard. dirty unsupported is tolerated ONLY for an untouched + // untitled empty project (file=="" && items=="0"): nothing user-owned + // can be lost there. + const disposableDecision = + before.dirty === "true" + ? { proceed: false, reason: "restored project reports unsaved changes (dirty=true); refusing to touch it" } + : before.dirty === "unsupported" && !(before.file === "" && before.items === "0") + ? { proceed: false, reason: "project.dirty unsupported and project is not an empty untitled project; cannot prove safe" } + : { proceed: true, reason: `dirty=${before.dirty}, file='${before.file}', items=${before.items}` }; + step("disposable.gate", { ok: disposableDecision.proceed, decision: disposableDecision }); + evidence.disposableDecision = disposableDecision; + if (!disposableDecision.proceed) { + throw new Error(`disposable gate refused: ${disposableDecision.reason}`); + } + + // The dirty/file/items read above and the app.newProject() mutation + // below are separate dispatches — project state could in principle + // change in between. True atomicity is impossible without a + // host-side precondition inside the op itself, so re-read identity + // immediately before mutating and require it UNCHANGED; any drift + // aborts fail-closed. (Owned session: no user input can intervene, + // this guards harness/AE-side state transitions only.) + const idRecheck = await evalDispatch("identity.recheck", IDENTITY_SOURCE); + const recheck = parseIdentity(idRecheck.result); + const unchanged = + idRecheck.outcome === "COMPLETED" && + recheck.file === before.file && + recheck.items === before.items && + recheck.dirty === before.dirty; + step("identity.recheck", { + ok: unchanged, + outcome: idRecheck.outcome, + project: recheck, + }); + evidence.projectRecheck = recheck; + if (!unchanged) { + throw new Error( + `project identity changed between gate and mutation (before file='${before.file}' items=${before.items} dirty=${before.dirty}; recheck file='${recheck.file}' items=${recheck.items} dirty=${recheck.dirty}); refusing to mutate`, + ); + } + + const rNew = await op("project.new", {}, { confirmDestructive: true }); + step("op.project.new", { + ok: rNew.outcome === "COMPLETED", + outcome: rNew.outcome, + status: rNew.status ?? null, + result: rNew.result ?? null, + }); + if (rNew.outcome !== "COMPLETED") { + throw new Error(`project.new did not complete: ${JSON.stringify(rNew).slice(0, 400)}`); + } + + const rSave = await op("project.save", { path: fixturePath }); + step("op.project.save", { + ok: rSave.outcome === "COMPLETED", + outcome: rSave.outcome, + result: rSave.result ?? null, + fixturePath, + }); + if (rSave.outcome !== "COMPLETED") { + throw new Error(`project.save did not complete: ${JSON.stringify(rSave).slice(0, 400)}`); + } + + projectIdentity = `conformance-fixture:${fixturePath}`; + const id2 = await evalDispatch("identity.fixture", IDENTITY_SOURCE); + const fixtureIdent = parseIdentity(id2.result); + const disposableOk = + id2.outcome === "COMPLETED" && + fixtureIdent.file === fixturePath && + fixtureIdent.items === "0"; + step("identity.fixture", { + ok: disposableOk, + outcome: id2.outcome, + project: fixtureIdent, + expectedFile: fixturePath, + }); + evidence.projectFixture = fixtureIdent; + if (!disposableOk) { + throw new Error( + `disposable project not confirmed: file='${fixtureIdent.file}' items=${fixtureIdent.items} (expected '${fixturePath}' / 0)`, + ); + } + evidence.fixtureSha256 = existsSync(fixturePath) ? sha256File(fixturePath) : null; + + // ---- 3. cli-path registry ops (dev-loop runOperation) ---- + const baseline = await op("read.projectSummary"); + step("op.read.projectSummary.baseline", { + ok: baseline.outcome === "COMPLETED", + outcome: baseline.outcome, + result: baseline.result ?? null, + }); + + const add1 = await op("item.addComp", { + name: "Conformance QA Comp", + width: 320, height: 240, pixelAspect: 1, duration: 5, frameRate: 30, + }); + step("op.item.addComp", { + ok: add1.outcome === "COMPLETED", + outcome: add1.outcome, + result: add1.result ?? null, + }); + + const verify1 = await op("read.projectSummary"); + const verify1Items = verify1.result?.items ?? null; + const sawComp = Array.isArray(verify1Items) && + verify1Items.some((i) => i && i.name === "Conformance QA Comp"); + step("op.read.projectSummary.readback", { + ok: verify1.outcome === "COMPLETED" && sawComp === true, + outcome: verify1.outcome, + sawComp, + items: verify1Items, + }); + + // undo dimension: Edit > Undo must remove exactly the comp we added. + let undoOutcome = null; + try { + const u = await session.ae.undo(); + undoOutcome = { ok: true, result: u ?? null }; + } catch (error) { + undoOutcome = { ok: false, error: error instanceof Error ? error.message : String(error) }; + } + const afterUndo = await op("read.projectSummary"); + const undoClean = + afterUndo.outcome === "COMPLETED" && + Array.isArray(afterUndo.result?.items) && + afterUndo.result.items.length === 0; + step("ae.undo", { + ok: undoOutcome.ok === true && undoClean, + undo: undoOutcome, + outcome: afterUndo.outcome, + itemsAfter: afterUndo.result?.items ?? null, + }); + evidence.undo = { call: undoOutcome, readbackEmpty: undoClean }; + + // item.remove claim: second comp added then removed by name+type. + const add2 = await op("item.addComp", { + name: "Conformance Temp Comp", + width: 64, height: 64, pixelAspect: 1, duration: 1, frameRate: 30, + }); + step("op.item.addComp.second", { + ok: add2.outcome === "COMPLETED", + outcome: add2.outcome, + result: add2.result ?? null, + }); + const rem = await op("item.remove", { name: "Conformance Temp Comp", type: "CompItem" }, { confirmDestructive: true }); + step("op.item.remove", { + ok: rem.outcome === "COMPLETED", + outcome: rem.outcome, + result: rem.result ?? null, + }); + const finalSummary = await op("read.projectSummary"); + const finalClean = + finalSummary.outcome === "COMPLETED" && + Array.isArray(finalSummary.result?.items) && + finalSummary.result.items.length === 0; + step("op.read.projectSummary.final", { + ok: finalClean, + outcome: finalSummary.outcome, + items: finalSummary.result?.items ?? null, + }); + // Content is back at the saved state but AE's dirty flag stays set + // once the project was edited — re-save so close({unsavedChanges: + // "refuse"}) can quit. The fixture is disposable, so this is safe. + const rResave = await op("project.save", { path: fixturePath }); + step("op.project.save.resave", { + ok: rResave.outcome === "COMPLETED", + outcome: rResave.outcome, + result: rResave.result ?? null, + }); + evidence.projectOps = { + baseline: baseline.result ?? null, + addComp: add1.result ?? null, + readbackSawComp: sawComp, + undo: evidence.undo, + addComp2: add2.result ?? null, + remove: rem.result ?? null, + finalItems: finalSummary.result?.items ?? null, + }; + + // ---- 4. jsx toolchain lane ---- + const okBuild = buildFile(join(FIXTURES, "ok.ts")); + step("jsx.build.ok", { ok: okBuild.status === "ok", status: okBuild.status }); + if (okBuild.status === "ok") { + // Same consent-bound eval dispatch as the identity probes above — + // the shared wrapper (Issue #197) replaced the hand-built copy. + const jsxDispatch = evalDispatchRaw; + const j1 = await jsxDispatch(okBuild.output, `conf-jsx-ok-${Date.now().toString(36)}`); + step("jsx.dispatch.ok", { ok: j1.outcome === "COMPLETED", outcome: j1.outcome }); + const j2 = await jsxDispatch('"" + $.global.__toolchainProbe', `conf-jsx-read-${Date.now().toString(36)}`); + step("jsx.verify.global-write", { + ok: j2.outcome === "COMPLETED" && typeof j2.result === "string" && j2.result.includes("hello ae"), + observed: j2.result ?? null, + outcome: j2.outcome, + }); + + const badBuild = buildFile(join(FIXTURES, "runtime-error.ts")); + step("jsx.build.runtime-error", { ok: badBuild.status === "ok", status: badBuild.status }); + if (badBuild.status === "ok") { + const j3 = await jsxDispatch(badBuild.output, `conf-jsx-bad-${Date.now().toString(36)}`); + const hostLine = j3.error?.line ?? null; + const mapped = hostLine != null ? lookup(badBuild.map, hostLine, 1e9) : null; + step("jsx.dispatch.runtime-error", { + ok: j3.outcome === "FAILED", + outcome: j3.outcome, + hostError: j3.error?.message ?? null, + hostErrorName: j3.error?.name ?? null, + hostLine, + }); + step("jsx.sourcemap.to-source", { + ok: mapped != null && mapped.line === 3 && /runtime-error\.ts$/.test(mapped.source ?? ""), + mapped, + }); + evidence.jsx = { + okBuild: { status: okBuild.status, jsxBytes: okBuild.output?.length ?? 0 }, + dispatchOk: j1.outcome, + globalWrite: j2.result ?? null, + runtimeError: { + outcome: j3.outcome, + hostErrorName: j3.error?.name ?? null, + hostLine, + mapped, + }, + }; + } + } + + // ---- 5. a8n transport slice (Issue #49 scenario) ---- + const { steps: sliceSteps } = await runVerticalSlice({ + runner: session.runner, + pin: session.pin, + sendCount: session.transport.sendCount, + }); + evidence.sliceSteps = sliceSteps; + evidence.sliceViolations = assertSliceOutcomes(sliceSteps); + step("a8n.slice", { + ok: Array.isArray(evidence.sliceViolations) && evidence.sliceViolations.length === 0, + violations: evidence.sliceViolations, + outcomes: sliceSteps.map((s) => `${s.label}:${s.outcome}`), + }); + + // ---- 6. timeout dimension: deadline must yield UNKNOWN, no resend ---- + const shortRunner = createJsxRunner({ transport: session.transport, deadlineMs: 800 }); + const timeoutDispatch = createEvalDispatch({ + runner: shortRunner, + pin: session.pin, + projectIdentity: () => projectIdentity, + operationId: EVAL_OP, + scriptProvenance: "conformance-run", + }); + const t0 = Date.now(); + const timeoutRequestId = `conf-timeout-${Date.now().toString(36)}`; + // Exactly-one-send check (Issue #384): an UNKNOWN outcome alone does + // not prove the runner did not resend. No other probe dispatches in + // this window, so the transport send-count delta across the probe + + // late-completion wait must be exactly 1. + const sendsBeforeTimeout = session.transport.sendCount(); + const timeoutResult = await timeoutDispatch('$.sleep(2000); "slept"', timeoutRequestId); + // Let the sleeping host script finish before close. + await new Promise((r) => setTimeout(r, 2500)); + const sendsAfterTimeout = session.transport.sendCount(); + const timeoutSendDelta = sendsAfterTimeout - sendsBeforeTimeout; + + evidence.timeoutProbe = { + outcome: timeoutResult.outcome, + contractOutcome: timeoutResult.contractOutcome ?? null, + retry: timeoutResult.retry ?? null, + elapsedMs: Date.now() - t0, + quarantined: shortRunner.isQuarantined(timeoutRequestId), + sendsBefore: sendsBeforeTimeout, + sendsAfter: sendsAfterTimeout, + sendDelta: timeoutSendDelta, + }; + step("timeout.probe", { + ok: isCleanTimeoutProbe({ outcome: timeoutResult.outcome, sendDelta: timeoutSendDelta }), + ...evidence.timeoutProbe, + }); + + evidence.transportSends = session.transport.sendCount(); + evidence.opResultSummary = Object.fromEntries( + Object.entries(opResults).map(([k, v]) => [k, v.outcome ?? v.status ?? null]), + ); + evidence.evidenceLevel = "verified on real host"; + } catch (error) { + evidence.fatal = { + name: error instanceof Error ? error.name : "Error", + message: error instanceof Error ? error.message : String(error), + }; + step("fatal", { ok: false, message: evidence.fatal.message }); + evidence.ok = false; + } finally { + if (session) { + // Preserve the ae-a8n trace before close() removes the workdir. + try { + if (typeof session.tracePath === "string" && existsSync(session.tracePath)) { + const traceCopy = join(workdir, "trace.jsonl"); + copyFileSync(session.tracePath, traceCopy); + evidence.traceCopy = traceCopy; + evidence.traceSha256 = sha256File(traceCopy); + } + } catch { /* trace preservation is best-effort */ } + try { + await session.close(); + evidence.close = { quit: true }; + step("session.close", { ok: true }); + } catch (error) { + evidence.close = { + quit: false, + error: error instanceof Error ? error.message : String(error), + }; + step("session.close", { ok: false, message: evidence.close.error }); + evidence.ok = false; + } + // Settle the run marker with the CLI contract: "closed" removes + // it, "close-failed" keeps it as residue (Issue #252). + if (guard !== null) { + guard.end(evidence.close.quit === true ? "closed" : "close-failed"); + } + const after = await aeProcessSnapshot(processFragment); + evidence.aeProcessesAfterClose = after; + // aeProcessSnapshot returns {error} when `ps` itself fails — that + // is NOT proof of shutdown. An unverifiable snapshot must fail + // the run closed, never silently pass the quarantine check. + if (!Array.isArray(after)) { + evidence.sessionQuarantined = true; + evidence.quarantineReason = `AE process snapshot failed (${after?.error ?? "unknown"}); cannot prove session shutdown`; + evidence.ok = false; + } else { + const mainLeft = after.filter((p) => MAIN_EXE.test(p.args ?? "")); + if (mainLeft.length > 0) { + evidence.sessionQuarantined = true; + evidence.quarantineReason = `main AE process(es) survived close(): ${mainLeft.map((p) => p.pid).join(", ")}`; + evidence.ok = false; + } + } + } + evidence.finishedAt = new Date().toISOString(); + mkdirSync(dirname(out), { recursive: true }); + writeFileSync(out, JSON.stringify(evidence, null, 2) + "\n", "utf8"); + console.log(`evidence written: ${out}`); + } + if (evidence.ok === false) process.exitCode = 1; +} + +if (isMainEntry(import.meta.url)) { + main().catch((error) => { + console.error(`conformance real-run failed: ${error instanceof Error ? error.message : String(error)}`); + process.exitCode = 1; + }); +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/mcp-stdio.jsonl b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/mcp-stdio.jsonl new file mode 100644 index 0000000..acac8f8 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/mcp-stdio.jsonl @@ -0,0 +1,3291 @@ +[ + { + "t": "2026-11-23T15:40:29.440Z", + "step": "initialize", + "argv": [ + "mcp-server/server.mjs", + "--session", + "a8n", + "--install-dir", + "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app" + ], + "fixturePath": "/tmp/run-032/real/Conformance-MCP-Disposable.aep" + }, + { + "t": "2026-11-23T15:40:29.632Z", + "stderr": "mcp-server: ae-devtools-mcp@0.8.0 schema=ae-devtools.mcp/v1 session=a8n (stdio NDJSON; fake session = fake/mock evidence only)\n" + }, + { + "t": "2026-11-23T15:40:29.634Z", + "rx": { + "jsonrpc": "2.0", + "id": 1, + "result": { + "protocolVersion": "2024-11-05", + "capabilities": { + "tools": { + "listChanged": false + } + }, + "serverInfo": { + "name": "ae-devtools-mcp", + "version": "0.8.0" + }, + "instructions": "ae-devtools dev-loop tools. ae_execute/ae_verify require arguments.consent:\"grant\"; destructive ops need confirmDestructive:true, render ops confirmRender:true. Default session is the codec-faithful fake host — results are fake/mock evidence, not real AE." + } + } + }, + { + "t": "2026-11-23T15:40:29.634Z", + "step": "initialized", + "serverInfo": { + "name": "ae-devtools-mcp", + "version": "0.8.0" + } + }, + { + "t": "2026-11-23T15:40:29.635Z", + "step": "ae_discover" + }, + { + "t": "2026-11-23T15:40:29.639Z", + "rx": { + "jsonrpc": "2.0", + "id": 2, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.dev-loop/v1\",\n \"evidenceLevel\": \"registry metadata — no dispatch\",\n \"operationCount\": 97,\n \"evidence\": {\n \"implemented\": 97,\n \"automatedTest\": 97,\n \"fakeMockVerified\": 97,\n \"realHostVerified\": 0,\n \"level\": \"fake/mock only\"\n },\n \"operations\": [\n {\n \"id\": \"project.new\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": true,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 1\n },\n {\n \"id\": \"project.open\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": true,\n \"requiresConfirm\": null,\n \"args\": [\n \"path\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"project.save\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"path\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"project.close\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": true,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 1\n },\n {\n \"id\": \"item.addComp\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"width\",\n \"height\",\n \"pixelAspect\",\n \"duration\",\n \"frameRate\",\n \"parentFolder\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"item.addFolder\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"parentFolder\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"item.remove\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": true,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"type\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"item.setParentFolder\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"type\",\n \"parentFolder\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"item.setSelected\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"type\",\n \"selected\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"comp.addNullLayer\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"layer.setTransformPosition\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"x\",\n \"y\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.reorder\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"to\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.setParent\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"parentName\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"layer.duplicate\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"read.projectSummary\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 10\n },\n {\n \"id\": \"read.projectTree\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 10\n },\n {\n \"id\": \"read.itemById\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"id\"\n ],\n \"memberCount\": 6\n },\n {\n \"id\": \"anim.setValue\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"value\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"anim.setKeyframe\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"keyIndex\",\n \"value\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"anim.setValueAtTime\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"time\",\n \"value\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"anim.setExpression\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"expression\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"effect.add\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"effectMatchName\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"render.queueComp\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"render.renderQueued\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": \"render\",\n \"args\": [],\n \"memberCount\": 1\n },\n {\n \"id\": \"read.compLayers\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 15\n },\n {\n \"id\": \"read.layerDetail\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 12\n },\n {\n \"id\": \"read.propertyValue\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"read.keyframes\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"read.renderQueueStatus\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 11\n },\n {\n \"id\": \"read.itemDetail\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 10\n },\n {\n \"id\": \"item.import\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"path\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"comp.duplicate\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"item.setLabel\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"type\",\n \"label\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.setTiming\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"startTime\",\n \"stretch\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.setState\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"solo\",\n \"shy\",\n \"locked\",\n \"label\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"anim.removeKeyframe\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"keyIndex\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"read.valueAtTime\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"time\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"render.setTimeSpan\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"timeSpanStart\",\n \"timeSpanDuration\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"render.removeFromQueue\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"layer.setAvState\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"audioEnabled\",\n \"threeDLayer\",\n \"motionBlur\",\n \"guideLayer\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"read.propertyDetail\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\"\n ],\n \"memberCount\": 12\n },\n {\n \"id\": \"anim.setExpressionEnabled\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"enabled\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"render.getOutputSettings\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 6\n },\n {\n \"id\": \"render.setOutputSetting\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"setting\",\n \"value\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"render.listTemplates\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"render.applyTemplate\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"templateName\"\n ],\n \"memberCount\": 9\n },\n {\n \"id\": \"render.saveTemplate\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"templateName\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"render.listOutputModules\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 10\n },\n {\n \"id\": \"render.addOutputModule\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"render.applyOutputModuleTemplate\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"moduleIndex\",\n \"templateName\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"render.saveOutputModuleTemplate\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"moduleIndex\",\n \"templateName\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"render.setOutputModuleOptions\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"moduleIndex\",\n \"file\",\n \"includeSourceXMP\",\n \"postRenderAction\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"item.setComment\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"type\",\n \"comment\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"comp.setResolutionFactor\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"resolutionFactor\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.addSolid\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\",\n \"width\",\n \"height\",\n \"pixelAspect\",\n \"color\",\n \"duration\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"layer.addText\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\",\n \"text\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"layer.addCamera\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\",\n \"centerPoint\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"layer.addLight\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\",\n \"centerPoint\"\n ],\n \"memberCount\": 1\n },\n {\n \"id\": \"text.setText\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"text\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"text.setStyle\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"font\",\n \"fontSize\",\n \"justification\",\n \"fillColor\",\n \"tracking\",\n \"leading\"\n ],\n \"memberCount\": 8\n },\n {\n \"id\": \"text.readStyle\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 9\n },\n {\n \"id\": \"layer.addBoxText\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\",\n \"width\",\n \"height\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"text.setPaint\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"applyFill\",\n \"applyStroke\",\n \"strokeColor\",\n \"strokeWidth\",\n \"strokeOverFill\",\n \"autoLeading\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"text.setBoxMetrics\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"boxTextSize\",\n \"boxTextPos\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"text.setCharAttributes\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"baselineShift\",\n \"horizontalScale\",\n \"verticalScale\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"text.readDocument\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 31\n },\n {\n \"id\": \"layer.setLayerFlags\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"adjustmentLayer\",\n \"preserveTransparency\",\n \"collapseTransformation\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"layer.setInOutPoint\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"inPoint\",\n \"outPoint\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"read.footageDetail\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 15\n },\n {\n \"id\": \"item.setProxy\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"path\"\n ],\n \"memberCount\": 6\n },\n {\n \"id\": \"item.setProxyWithSequence\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"path\",\n \"forceAlphabetical\"\n ],\n \"memberCount\": 6\n },\n {\n \"id\": \"item.setProxyWithSolid\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"color\",\n \"solidName\",\n \"width\",\n \"height\",\n \"pixelAspect\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"item.setProxyWithPlaceholder\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"placeholderName\",\n \"width\",\n \"height\",\n \"frameRate\",\n \"duration\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"item.setProxyToNone\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"item.setUseProxy\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"useProxy\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"read.itemProxy\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 7\n },\n {\n \"id\": \"read.projectSettings\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 6\n },\n {\n \"id\": \"pref.get\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"section\",\n \"key\",\n \"type\",\n \"default\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"pref.set\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"section\",\n \"key\",\n \"type\",\n \"value\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"pref.delete\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": true,\n \"requiresConfirm\": null,\n \"args\": [\n \"section\",\n \"key\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"pref.saveToDisk\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 1\n },\n {\n \"id\": \"read.appInfo\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [],\n \"memberCount\": 6\n },\n {\n \"id\": \"anim.setInterpolation\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"keyIndex\",\n \"inType\",\n \"outType\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"anim.setTemporalEase\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"propertyPath\",\n \"keyIndex\",\n \"inEase\",\n \"outEase\"\n ],\n \"memberCount\": 4\n },\n {\n \"id\": \"layer.setTrackMatte\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"matteLayerName\",\n \"matteType\"\n ],\n \"memberCount\": 5\n },\n {\n \"id\": \"layer.setTimeRemap\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"enabled\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"comp.setSettings\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\",\n \"bgColor\",\n \"displayStartTime\",\n \"displayStartFrame\",\n \"shutterAngle\",\n \"shutterPhase\",\n \"motionBlur\",\n \"frameBlending\",\n \"draft3d\",\n \"hideShyLayers\",\n \"preserveNestedFrameRate\",\n \"dropFrame\"\n ],\n \"memberCount\": 11\n },\n {\n \"id\": \"read.compSettings\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"name\"\n ],\n \"memberCount\": 12\n },\n {\n \"id\": \"layer.replaceSource\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"footageName\",\n \"fixExpressions\"\n ],\n \"memberCount\": 2\n },\n {\n \"id\": \"render.duplicateQueueItem\",\n \"domain\": \"animation-effects-render\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"marker.setLayerMarker\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"time\",\n \"comment\",\n \"chapter\",\n \"url\",\n \"frameTarget\",\n \"cuePointName\",\n \"duration\",\n \"eventCuePoint\",\n \"params\"\n ],\n \"memberCount\": 15\n },\n {\n \"id\": \"marker.setCompMarker\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"time\",\n \"comment\",\n \"chapter\",\n \"url\",\n \"frameTarget\",\n \"cuePointName\",\n \"duration\",\n \"eventCuePoint\",\n \"params\"\n ],\n \"memberCount\": 15\n },\n {\n \"id\": \"marker.readLayerMarkers\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 12\n },\n {\n \"id\": \"marker.readCompMarkers\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\"\n ],\n \"memberCount\": 12\n },\n {\n \"id\": \"layer.addShape\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"name\"\n ],\n \"memberCount\": 3\n },\n {\n \"id\": \"shape.readContents\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": false,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\"\n ],\n \"memberCount\": 8\n },\n {\n \"id\": \"shape.addPath\",\n \"domain\": \"project-items-comps-layers\",\n \"mutating\": true,\n \"destructive\": false,\n \"requiresConfirm\": null,\n \"args\": [\n \"compName\",\n \"layerName\",\n \"vertices\",\n \"inTangents\",\n \"outTangents\",\n \"closed\"\n ],\n \"memberCount\": 13\n }\n ]\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:29.641Z", + "stepResult": "ae_discover", + "isError": false, + "outcome": null, + "session": null, + "result": { + "schema": "ae-devtools.dev-loop/v1", + "evidenceLevel": "registry metadata — no dispatch", + "operationCount": 97, + "evidence": { + "implemented": 97, + "automatedTest": 97, + "fakeMockVerified": 97, + "realHostVerified": 0, + "level": "fake/mock only" + }, + "operations": [ + { + "id": "project.new", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "project.open", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 1 + }, + { + "id": "project.save", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 1 + }, + { + "id": "project.close", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "item.addComp", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "width", + "height", + "pixelAspect", + "duration", + "frameRate", + "parentFolder" + ], + "memberCount": 3 + }, + { + "id": "item.addFolder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "parentFolder" + ], + "memberCount": 3 + }, + { + "id": "item.remove", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "name", + "type" + ], + "memberCount": 1 + }, + { + "id": "item.setParentFolder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "parentFolder" + ], + "memberCount": 4 + }, + { + "id": "item.setSelected", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "selected" + ], + "memberCount": 4 + }, + { + "id": "comp.addNullLayer", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 1 + }, + { + "id": "layer.setTransformPosition", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "x", + "y" + ], + "memberCount": 2 + }, + { + "id": "layer.reorder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "to" + ], + "memberCount": 2 + }, + { + "id": "layer.setParent", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "parentName" + ], + "memberCount": 1 + }, + { + "id": "layer.duplicate", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 1 + }, + { + "id": "read.projectSummary", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 10 + }, + { + "id": "read.projectTree", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 10 + }, + { + "id": "read.itemById", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "id" + ], + "memberCount": 6 + }, + { + "id": "anim.setValue", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setKeyframe", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setValueAtTime", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "time", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setExpression", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "expression" + ], + "memberCount": 4 + }, + { + "id": "effect.add", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "effectMatchName" + ], + "memberCount": 2 + }, + { + "id": "render.queueComp", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 2 + }, + { + "id": "render.renderQueued", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": "render", + "args": [], + "memberCount": 1 + }, + { + "id": "read.compLayers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 15 + }, + { + "id": "read.layerDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 12 + }, + { + "id": "read.propertyValue", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 4 + }, + { + "id": "read.keyframes", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 4 + }, + { + "id": "read.renderQueueStatus", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 11 + }, + { + "id": "read.itemDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 10 + }, + { + "id": "item.import", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 2 + }, + { + "id": "comp.duplicate", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 3 + }, + { + "id": "item.setLabel", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "label" + ], + "memberCount": 2 + }, + { + "id": "layer.setTiming", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "startTime", + "stretch" + ], + "memberCount": 2 + }, + { + "id": "layer.setState", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "solo", + "shy", + "locked", + "label" + ], + "memberCount": 4 + }, + { + "id": "anim.removeKeyframe", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex" + ], + "memberCount": 2 + }, + { + "id": "read.valueAtTime", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "time" + ], + "memberCount": 3 + }, + { + "id": "render.setTimeSpan", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "timeSpanStart", + "timeSpanDuration" + ], + "memberCount": 5 + }, + { + "id": "render.removeFromQueue", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 4 + }, + { + "id": "layer.setAvState", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "audioEnabled", + "threeDLayer", + "motionBlur", + "guideLayer" + ], + "memberCount": 4 + }, + { + "id": "read.propertyDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 12 + }, + { + "id": "anim.setExpressionEnabled", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "enabled" + ], + "memberCount": 3 + }, + { + "id": "render.getOutputSettings", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 6 + }, + { + "id": "render.setOutputSetting", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "setting", + "value" + ], + "memberCount": 5 + }, + { + "id": "render.listTemplates", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 4 + }, + { + "id": "render.applyTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "templateName" + ], + "memberCount": 9 + }, + { + "id": "render.saveTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "templateName" + ], + "memberCount": 5 + }, + { + "id": "render.listOutputModules", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 10 + }, + { + "id": "render.addOutputModule", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 7 + }, + { + "id": "render.applyOutputModuleTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "templateName" + ], + "memberCount": 7 + }, + { + "id": "render.saveOutputModuleTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "templateName" + ], + "memberCount": 7 + }, + { + "id": "render.setOutputModuleOptions", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "file", + "includeSourceXMP", + "postRenderAction" + ], + "memberCount": 7 + }, + { + "id": "item.setComment", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "comment" + ], + "memberCount": 2 + }, + { + "id": "comp.setResolutionFactor", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "resolutionFactor" + ], + "memberCount": 2 + }, + { + "id": "layer.addSolid", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "width", + "height", + "pixelAspect", + "color", + "duration" + ], + "memberCount": 1 + }, + { + "id": "layer.addText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "text" + ], + "memberCount": 2 + }, + { + "id": "layer.addCamera", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "centerPoint" + ], + "memberCount": 1 + }, + { + "id": "layer.addLight", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "centerPoint" + ], + "memberCount": 1 + }, + { + "id": "text.setText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "text" + ], + "memberCount": 2 + }, + { + "id": "text.setStyle", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "font", + "fontSize", + "justification", + "fillColor", + "tracking", + "leading" + ], + "memberCount": 8 + }, + { + "id": "text.readStyle", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 9 + }, + { + "id": "layer.addBoxText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "width", + "height" + ], + "memberCount": 5 + }, + { + "id": "text.setPaint", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "applyFill", + "applyStroke", + "strokeColor", + "strokeWidth", + "strokeOverFill", + "autoLeading" + ], + "memberCount": 7 + }, + { + "id": "text.setBoxMetrics", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "boxTextSize", + "boxTextPos" + ], + "memberCount": 4 + }, + { + "id": "text.setCharAttributes", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "baselineShift", + "horizontalScale", + "verticalScale" + ], + "memberCount": 4 + }, + { + "id": "text.readDocument", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 31 + }, + { + "id": "layer.setLayerFlags", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "adjustmentLayer", + "preserveTransparency", + "collapseTransformation" + ], + "memberCount": 4 + }, + { + "id": "layer.setInOutPoint", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "inPoint", + "outPoint" + ], + "memberCount": 2 + }, + { + "id": "read.footageDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 15 + }, + { + "id": "item.setProxy", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "path" + ], + "memberCount": 6 + }, + { + "id": "item.setProxyWithSequence", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "path", + "forceAlphabetical" + ], + "memberCount": 6 + }, + { + "id": "item.setProxyWithSolid", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "color", + "solidName", + "width", + "height", + "pixelAspect" + ], + "memberCount": 4 + }, + { + "id": "item.setProxyWithPlaceholder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "placeholderName", + "width", + "height", + "frameRate", + "duration" + ], + "memberCount": 3 + }, + { + "id": "item.setProxyToNone", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 3 + }, + { + "id": "item.setUseProxy", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "useProxy" + ], + "memberCount": 2 + }, + { + "id": "read.itemProxy", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 7 + }, + { + "id": "read.projectSettings", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 6 + }, + { + "id": "pref.get", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "section", + "key", + "type", + "default" + ], + "memberCount": 5 + }, + { + "id": "pref.set", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "section", + "key", + "type", + "value" + ], + "memberCount": 4 + }, + { + "id": "pref.delete", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "section", + "key" + ], + "memberCount": 2 + }, + { + "id": "pref.saveToDisk", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "read.appInfo", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 6 + }, + { + "id": "anim.setInterpolation", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "inType", + "outType" + ], + "memberCount": 5 + }, + { + "id": "anim.setTemporalEase", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "inEase", + "outEase" + ], + "memberCount": 4 + }, + { + "id": "layer.setTrackMatte", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "matteLayerName", + "matteType" + ], + "memberCount": 5 + }, + { + "id": "layer.setTimeRemap", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "enabled" + ], + "memberCount": 2 + }, + { + "id": "comp.setSettings", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "bgColor", + "displayStartTime", + "displayStartFrame", + "shutterAngle", + "shutterPhase", + "motionBlur", + "frameBlending", + "draft3d", + "hideShyLayers", + "preserveNestedFrameRate", + "dropFrame" + ], + "memberCount": 11 + }, + { + "id": "read.compSettings", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 12 + }, + { + "id": "layer.replaceSource", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "footageName", + "fixExpressions" + ], + "memberCount": 2 + }, + { + "id": "render.duplicateQueueItem", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 3 + }, + { + "id": "marker.setLayerMarker", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "time", + "comment", + "chapter", + "url", + "frameTarget", + "cuePointName", + "duration", + "eventCuePoint", + "params" + ], + "memberCount": 15 + }, + { + "id": "marker.setCompMarker", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "time", + "comment", + "chapter", + "url", + "frameTarget", + "cuePointName", + "duration", + "eventCuePoint", + "params" + ], + "memberCount": 15 + }, + { + "id": "marker.readLayerMarkers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 12 + }, + { + "id": "marker.readCompMarkers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 12 + }, + { + "id": "layer.addShape", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name" + ], + "memberCount": 3 + }, + { + "id": "shape.readContents", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 8 + }, + { + "id": "shape.addPath", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "vertices", + "inTangents", + "outTangents", + "closed" + ], + "memberCount": 13 + } + ] + } + }, + { + "t": "2026-11-23T15:40:29.643Z", + "step": "ae_verify.pre-state" + }, + { + "t": "2026-11-23T15:40:38.072Z", + "rx": { + "jsonrpc": "2.0", + "id": 3, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-1\",\n \"operationId\": \"read.projectSummary\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true,\n \"count\": 0,\n \"numItems\": 0,\n \"items\": [],\n \"activeItem\": null,\n \"selection\": []\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"read.projectSummary\",\n \"mutating\": false,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:38.075Z", + "stepResult": "ae_verify.pre", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-1", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + { + "t": "2026-11-23T15:40:38.076Z", + "step": "ae_execute.project.new (launches owned AE)" + }, + { + "t": "2026-11-23T15:40:38.787Z", + "rx": { + "jsonrpc": "2.0", + "id": 4, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-2\",\n \"operationId\": \"project.new\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"project.new\",\n \"mutating\": true,\n \"destructive\": true\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:38.792Z", + "stepResult": "project.new", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-2", + "operationId": "project.new", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.new", + "mutating": true, + "destructive": true + } + }, + { + "t": "2026-11-23T15:40:38.796Z", + "step": "ae_execute.project.save" + }, + { + "t": "2026-11-23T15:40:40.454Z", + "rx": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-3\",\n \"operationId\": \"project.save\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"project.save\",\n \"mutating\": true,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:40.456Z", + "stepResult": "project.save", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-3", + "operationId": "project.save", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.save", + "mutating": true, + "destructive": false + } + }, + { + "t": "2026-11-23T15:40:40.457Z", + "step": "ae_execute.item.addComp" + }, + { + "t": "2026-11-23T15:40:41.156Z", + "rx": { + "jsonrpc": "2.0", + "id": 6, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-4\",\n \"operationId\": \"item.addComp\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true,\n \"id\": 1,\n \"name\": \"MCP Conformance Comp\",\n \"parent\": null\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"item.addComp\",\n \"mutating\": true,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:41.157Z", + "stepResult": "item.addComp", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-4", + "operationId": "item.addComp", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "id": 1, + "name": "MCP Conformance Comp", + "parent": null + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "item.addComp", + "mutating": true, + "destructive": false + } + }, + { + "t": "2026-11-23T15:40:41.158Z", + "step": "ae_verify.readback" + }, + { + "t": "2026-11-23T15:40:41.780Z", + "rx": { + "jsonrpc": "2.0", + "id": 7, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-5\",\n \"operationId\": \"read.projectSummary\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true,\n \"count\": 1,\n \"numItems\": 1,\n \"items\": [\n {\n \"name\": \"MCP Conformance Comp\",\n \"typeName\": \"コンポジション\",\n \"id\": 1,\n \"selected\": false,\n \"parent\": null\n }\n ],\n \"activeItem\": null,\n \"selection\": []\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"read.projectSummary\",\n \"mutating\": false,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:41.784Z", + "stepResult": "ae_verify.readback", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-5", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 1, + "numItems": 1, + "items": [ + { + "name": "MCP Conformance Comp", + "typeName": "コンポジション", + "id": 1, + "selected": false, + "parent": null + } + ], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + { + "t": "2026-11-23T15:40:41.785Z", + "step": "ae_execute.item.remove" + }, + { + "t": "2026-11-23T15:40:43.823Z", + "rx": { + "jsonrpc": "2.0", + "id": 8, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-6\",\n \"operationId\": \"item.remove\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true,\n \"removed\": \"MCP Conformance Comp\"\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"item.remove\",\n \"mutating\": true,\n \"destructive\": true\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:43.825Z", + "stepResult": "item.remove", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-6", + "operationId": "item.remove", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "removed": "MCP Conformance Comp" + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "item.remove", + "mutating": true, + "destructive": true + } + }, + { + "t": "2026-11-23T15:40:43.825Z", + "step": "ae_verify.final" + }, + { + "t": "2026-11-23T15:40:44.438Z", + "rx": { + "jsonrpc": "2.0", + "id": 9, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-7\",\n \"operationId\": \"read.projectSummary\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true,\n \"count\": 0,\n \"numItems\": 0,\n \"items\": [],\n \"activeItem\": null,\n \"selection\": []\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"read.projectSummary\",\n \"mutating\": false,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:44.440Z", + "stepResult": "ae_verify.final", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-7", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + { + "t": "2026-11-23T15:40:44.441Z", + "step": "ae_execute.project.save.resave" + }, + { + "t": "2026-11-23T15:40:45.049Z", + "rx": { + "jsonrpc": "2.0", + "id": 10, + "result": { + "content": [ + { + "type": "text", + "text": "{\n \"schema\": \"ae-devtools.mcp/v1\",\n \"session\": {\n \"aeVersion\": \"26.5.3x9\",\n \"ownership\": \"owned\",\n \"aeA8nHead\": \"0.6.0\",\n \"kind\": \"a8n\",\n \"evidenceLevel\": \"verified on real host (macOS)\",\n \"policy\": null\n },\n \"outcome\": \"COMPLETED\",\n \"result\": {\n \"requestId\": \"req-mcp-8\",\n \"operationId\": \"project.save\",\n \"outcome\": \"COMPLETED\",\n \"requestState\": \"ACKED\",\n \"mayHaveMutated\": true,\n \"result\": {\n \"ok\": true\n },\n \"contractOutcome\": \"completed\",\n \"retry\": \"quarantine\",\n \"opId\": \"project.save\",\n \"mutating\": true,\n \"destructive\": false\n }\n}" + } + ] + } + } + }, + { + "t": "2026-11-23T15:40:45.051Z", + "stepResult": "project.save.resave", + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-8", + "operationId": "project.save", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.save", + "mutating": true, + "destructive": false + } + }, + { + "t": "2026-11-23T15:41:00.055Z", + "step": "server.stopped", + "fixturePath": "/tmp/run-032/real/Conformance-MCP-Disposable.aep", + "shutdownConfirmed": true, + "cleanShutdown": true, + "forcedKill": false, + "exitCode": 143, + "signalCode": null, + "results": { + "ae_discover": { + "isError": false, + "outcome": null, + "session": null, + "result": { + "schema": "ae-devtools.dev-loop/v1", + "evidenceLevel": "registry metadata — no dispatch", + "operationCount": 97, + "evidence": { + "implemented": 97, + "automatedTest": 97, + "fakeMockVerified": 97, + "realHostVerified": 0, + "level": "fake/mock only" + }, + "operations": [ + { + "id": "project.new", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "project.open", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 1 + }, + { + "id": "project.save", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 1 + }, + { + "id": "project.close", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "item.addComp", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "width", + "height", + "pixelAspect", + "duration", + "frameRate", + "parentFolder" + ], + "memberCount": 3 + }, + { + "id": "item.addFolder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "parentFolder" + ], + "memberCount": 3 + }, + { + "id": "item.remove", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "name", + "type" + ], + "memberCount": 1 + }, + { + "id": "item.setParentFolder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "parentFolder" + ], + "memberCount": 4 + }, + { + "id": "item.setSelected", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "selected" + ], + "memberCount": 4 + }, + { + "id": "comp.addNullLayer", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 1 + }, + { + "id": "layer.setTransformPosition", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "x", + "y" + ], + "memberCount": 2 + }, + { + "id": "layer.reorder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "to" + ], + "memberCount": 2 + }, + { + "id": "layer.setParent", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "parentName" + ], + "memberCount": 1 + }, + { + "id": "layer.duplicate", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 1 + }, + { + "id": "read.projectSummary", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 10 + }, + { + "id": "read.projectTree", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 10 + }, + { + "id": "read.itemById", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "id" + ], + "memberCount": 6 + }, + { + "id": "anim.setValue", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setKeyframe", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setValueAtTime", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "time", + "value" + ], + "memberCount": 1 + }, + { + "id": "anim.setExpression", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "expression" + ], + "memberCount": 4 + }, + { + "id": "effect.add", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "effectMatchName" + ], + "memberCount": 2 + }, + { + "id": "render.queueComp", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 2 + }, + { + "id": "render.renderQueued", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": "render", + "args": [], + "memberCount": 1 + }, + { + "id": "read.compLayers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 15 + }, + { + "id": "read.layerDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 12 + }, + { + "id": "read.propertyValue", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 4 + }, + { + "id": "read.keyframes", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 4 + }, + { + "id": "read.renderQueueStatus", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 11 + }, + { + "id": "read.itemDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 10 + }, + { + "id": "item.import", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "path" + ], + "memberCount": 2 + }, + { + "id": "comp.duplicate", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 3 + }, + { + "id": "item.setLabel", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "label" + ], + "memberCount": 2 + }, + { + "id": "layer.setTiming", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "startTime", + "stretch" + ], + "memberCount": 2 + }, + { + "id": "layer.setState", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "solo", + "shy", + "locked", + "label" + ], + "memberCount": 4 + }, + { + "id": "anim.removeKeyframe", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex" + ], + "memberCount": 2 + }, + { + "id": "read.valueAtTime", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "time" + ], + "memberCount": 3 + }, + { + "id": "render.setTimeSpan", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "timeSpanStart", + "timeSpanDuration" + ], + "memberCount": 5 + }, + { + "id": "render.removeFromQueue", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 4 + }, + { + "id": "layer.setAvState", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "audioEnabled", + "threeDLayer", + "motionBlur", + "guideLayer" + ], + "memberCount": 4 + }, + { + "id": "read.propertyDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath" + ], + "memberCount": 12 + }, + { + "id": "anim.setExpressionEnabled", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "enabled" + ], + "memberCount": 3 + }, + { + "id": "render.getOutputSettings", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 6 + }, + { + "id": "render.setOutputSetting", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "setting", + "value" + ], + "memberCount": 5 + }, + { + "id": "render.listTemplates", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 4 + }, + { + "id": "render.applyTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "templateName" + ], + "memberCount": 9 + }, + { + "id": "render.saveTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "templateName" + ], + "memberCount": 5 + }, + { + "id": "render.listOutputModules", + "domain": "animation-effects-render", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 10 + }, + { + "id": "render.addOutputModule", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 7 + }, + { + "id": "render.applyOutputModuleTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "templateName" + ], + "memberCount": 7 + }, + { + "id": "render.saveOutputModuleTemplate", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "templateName" + ], + "memberCount": 7 + }, + { + "id": "render.setOutputModuleOptions", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "moduleIndex", + "file", + "includeSourceXMP", + "postRenderAction" + ], + "memberCount": 7 + }, + { + "id": "item.setComment", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "type", + "comment" + ], + "memberCount": 2 + }, + { + "id": "comp.setResolutionFactor", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "resolutionFactor" + ], + "memberCount": 2 + }, + { + "id": "layer.addSolid", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "width", + "height", + "pixelAspect", + "color", + "duration" + ], + "memberCount": 1 + }, + { + "id": "layer.addText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "text" + ], + "memberCount": 2 + }, + { + "id": "layer.addCamera", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "centerPoint" + ], + "memberCount": 1 + }, + { + "id": "layer.addLight", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "centerPoint" + ], + "memberCount": 1 + }, + { + "id": "text.setText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "text" + ], + "memberCount": 2 + }, + { + "id": "text.setStyle", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "font", + "fontSize", + "justification", + "fillColor", + "tracking", + "leading" + ], + "memberCount": 8 + }, + { + "id": "text.readStyle", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 9 + }, + { + "id": "layer.addBoxText", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name", + "width", + "height" + ], + "memberCount": 5 + }, + { + "id": "text.setPaint", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "applyFill", + "applyStroke", + "strokeColor", + "strokeWidth", + "strokeOverFill", + "autoLeading" + ], + "memberCount": 7 + }, + { + "id": "text.setBoxMetrics", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "boxTextSize", + "boxTextPos" + ], + "memberCount": 4 + }, + { + "id": "text.setCharAttributes", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "baselineShift", + "horizontalScale", + "verticalScale" + ], + "memberCount": 4 + }, + { + "id": "text.readDocument", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 31 + }, + { + "id": "layer.setLayerFlags", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "adjustmentLayer", + "preserveTransparency", + "collapseTransformation" + ], + "memberCount": 4 + }, + { + "id": "layer.setInOutPoint", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "inPoint", + "outPoint" + ], + "memberCount": 2 + }, + { + "id": "read.footageDetail", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 15 + }, + { + "id": "item.setProxy", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "path" + ], + "memberCount": 6 + }, + { + "id": "item.setProxyWithSequence", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "path", + "forceAlphabetical" + ], + "memberCount": 6 + }, + { + "id": "item.setProxyWithSolid", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "color", + "solidName", + "width", + "height", + "pixelAspect" + ], + "memberCount": 4 + }, + { + "id": "item.setProxyWithPlaceholder", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "placeholderName", + "width", + "height", + "frameRate", + "duration" + ], + "memberCount": 3 + }, + { + "id": "item.setProxyToNone", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 3 + }, + { + "id": "item.setUseProxy", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "useProxy" + ], + "memberCount": 2 + }, + { + "id": "read.itemProxy", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 7 + }, + { + "id": "read.projectSettings", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 6 + }, + { + "id": "pref.get", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "section", + "key", + "type", + "default" + ], + "memberCount": 5 + }, + { + "id": "pref.set", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "section", + "key", + "type", + "value" + ], + "memberCount": 4 + }, + { + "id": "pref.delete", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": true, + "requiresConfirm": null, + "args": [ + "section", + "key" + ], + "memberCount": 2 + }, + { + "id": "pref.saveToDisk", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 1 + }, + { + "id": "read.appInfo", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [], + "memberCount": 6 + }, + { + "id": "anim.setInterpolation", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "inType", + "outType" + ], + "memberCount": 5 + }, + { + "id": "anim.setTemporalEase", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "propertyPath", + "keyIndex", + "inEase", + "outEase" + ], + "memberCount": 4 + }, + { + "id": "layer.setTrackMatte", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "matteLayerName", + "matteType" + ], + "memberCount": 5 + }, + { + "id": "layer.setTimeRemap", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "enabled" + ], + "memberCount": 2 + }, + { + "id": "comp.setSettings", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name", + "bgColor", + "displayStartTime", + "displayStartFrame", + "shutterAngle", + "shutterPhase", + "motionBlur", + "frameBlending", + "draft3d", + "hideShyLayers", + "preserveNestedFrameRate", + "dropFrame" + ], + "memberCount": 11 + }, + { + "id": "read.compSettings", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "name" + ], + "memberCount": 12 + }, + { + "id": "layer.replaceSource", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "footageName", + "fixExpressions" + ], + "memberCount": 2 + }, + { + "id": "render.duplicateQueueItem", + "domain": "animation-effects-render", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 3 + }, + { + "id": "marker.setLayerMarker", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "time", + "comment", + "chapter", + "url", + "frameTarget", + "cuePointName", + "duration", + "eventCuePoint", + "params" + ], + "memberCount": 15 + }, + { + "id": "marker.setCompMarker", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "time", + "comment", + "chapter", + "url", + "frameTarget", + "cuePointName", + "duration", + "eventCuePoint", + "params" + ], + "memberCount": 15 + }, + { + "id": "marker.readLayerMarkers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 12 + }, + { + "id": "marker.readCompMarkers", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName" + ], + "memberCount": 12 + }, + { + "id": "layer.addShape", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "name" + ], + "memberCount": 3 + }, + { + "id": "shape.readContents", + "domain": "project-items-comps-layers", + "mutating": false, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName" + ], + "memberCount": 8 + }, + { + "id": "shape.addPath", + "domain": "project-items-comps-layers", + "mutating": true, + "destructive": false, + "requiresConfirm": null, + "args": [ + "compName", + "layerName", + "vertices", + "inTangents", + "outTangents", + "closed" + ], + "memberCount": 13 + } + ] + } + }, + "ae_verify.pre": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-1", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + "project.new": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-2", + "operationId": "project.new", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.new", + "mutating": true, + "destructive": true + } + }, + "project.save": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-3", + "operationId": "project.save", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.save", + "mutating": true, + "destructive": false + } + }, + "item.addComp": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-4", + "operationId": "item.addComp", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "id": 1, + "name": "MCP Conformance Comp", + "parent": null + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "item.addComp", + "mutating": true, + "destructive": false + } + }, + "ae_verify.readback": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-5", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 1, + "numItems": 1, + "items": [ + { + "name": "MCP Conformance Comp", + "typeName": "コンポジション", + "id": 1, + "selected": false, + "parent": null + } + ], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + "item.remove": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-6", + "operationId": "item.remove", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "removed": "MCP Conformance Comp" + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "item.remove", + "mutating": true, + "destructive": true + } + }, + "ae_verify.final": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-7", + "operationId": "read.projectSummary", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "read.projectSummary", + "mutating": false, + "destructive": false + } + }, + "project.save.resave": { + "isError": false, + "outcome": "COMPLETED", + "session": { + "aeVersion": "26.5.3x9", + "ownership": "owned", + "aeA8nHead": "0.6.0", + "kind": "a8n", + "evidenceLevel": "verified on real host (macOS)", + "policy": null + }, + "result": { + "requestId": "req-mcp-8", + "operationId": "project.save", + "outcome": "COMPLETED", + "requestState": "ACKED", + "mayHaveMutated": true, + "result": { + "ok": true + }, + "contractOutcome": "completed", + "retry": "quarantine", + "opId": "project.save", + "mutating": true, + "destructive": false + } + } + } + }, + { + "t": "2026-11-23T15:41:00.058Z", + "verdict": "pass" + } +] \ No newline at end of file diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/provenance.json b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/provenance.json new file mode 100644 index 0000000..ff5cf26 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/provenance.json @@ -0,0 +1,51 @@ +{ + "schema": "ae-devtools.conformance-provenance/v1", + "recordedAt": "2026-11-23T15:42:00.000Z", + "git": { + "head": "7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2", + "dirty": false, + "note": "lanes executed at 7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2 on release-0-8-0 (v0.8.0 release candidate, PR #419 head); the worktree was clean during all lanes — evidence artifacts were staged under /tmp/run-032 and copied into this directory only after every lane completed. sourceDirty:false in cli-project-open.json and session-a8n-jsx.json git blocks for the same reason." + }, + "aeA8n": { + "name": "@ido-bata/ae-a8n", + "version": "0.6.0", + "distTag": "pinned-dependency", + "distTagsAtRun": { + "latest": "0.3.0", + "next": "0.6.0" + }, + "tarball": "https://registry.npmjs.org/@ido-bata/ae-a8n/-/ae-a8n-0.6.0.tgz", + "fileCount": 246 + }, + "aeDevtools": { + "package": "ae-devtools-cli", + "sourceSha": "7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2", + "invocation": "node conformance/real-run.mjs + node conformance/mcp-real-run.mjs + node devtools-cli/cli.mjs (execute project.open/doctor)" + }, + "host": { + "installDir": "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app", + "aeVersion": "26.5.3x9", + "aeBuild": "9", + "os": "macOS 27.2.1", + "arch": "arm64", + "node": "v24.22.1" + }, + "fixtures": { + "primary": "Conformance-Disposable.aep", + "mcp": "Conformance-MCP-Disposable.aep", + "note": "both created fresh inside owned sessions via project.new + project.save" + }, + "artifactHashes": { + "Conformance-Disposable.aep": "841ba6887b049a930face4c8762c4ceaf427e2e55b3528807392c0e6bd0b0c03", + "Conformance-MCP-Disposable.aep": "b68679168ba7f502bc0a09da079d2f5f89d61496cd4f2db9a5084d8c8289566c", + "a8n-host-ext.js": "e03a15e7105ac32ff836f513eb2d54592119b01a3d5806ae40b7117ce132bc29", + "ae-a8n-0.6.0.tgz": "87a494c62a0e8d167eab4400adb9e2ee90894112d8beb0d552a851d17bf195be", + "cli-doctor.json": "c5a73d8feba6b02588d817acf01ecdbf9503f7d4d0f2278b68dc55147b7478ad", + "cli-project-open.json": "16ddb153b271e7430fe0001694ee7134ecaab02d44f42ec22cb3379f35eb04ec", + "harness-mcp-real-run.mjs": "3422d44f83d5eac66be5f1f3a16ca0df24fb57a6236791d9ea710f55fef8441e", + "harness-real-run.mjs": "2f02ffd3bd01791c880b45f543e2f97d82e5d6a30b0c2684e980e429980dd00d", + "mcp-stdio.jsonl": "39f5643fce12798ea590cbba1b4c23cd39c120ff721742b673f722c09b079383", + "session-a8n-jsx.json": "060bb50ec79e665ecd9d817f62d65d3682cdc598b6e40e9b1a1e6a1cc4f59771", + "trace.jsonl": "6ad059a609094800e2c416c7f30523e9e5e7b417d3eeb03cfc7f855b231eb4f7" + } +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/record.json b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/record.json new file mode 100644 index 0000000..52173c9 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/record.json @@ -0,0 +1,61 @@ +{ + "schema": "ae-devtools.conformance-record/v1", + "recordVersion": 1, + "capabilityIds": [ + "ae.scripting.app.newProject", + "ae.scripting.app.open", + "ae.scripting.Project.save", + "ae.scripting.ItemCollection.addComp", + "ae.scripting.Item.remove", + "ae.scripting.Project.activeItem", + "ae.scripting.Item.name", + "ae.scripting.Item.id", + "ae.scripting.Item.typeName" + ], + "platform": { + "os": "darwin", + "osVersion": "27.2.1", + "arch": "arm64" + }, + "aeVersion": { + "version": "26.5.3x9", + "build": "9" + }, + "sdkBuild": null, + "sdkBuildStatus": "not-applicable", + "verification": "verified-real-host", + "result": "PASS", + "catalogBinding": { + "kind": "real-host", + "ref": "packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032", + "platform": "darwin" + }, + "sourceSha": "7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2", + "runId": "run-2026-11-23-ae2026-a8n-032", + "artifactHashes": { + "Conformance-Disposable.aep": "841ba6887b049a930face4c8762c4ceaf427e2e55b3528807392c0e6bd0b0c03", + "Conformance-MCP-Disposable.aep": "b68679168ba7f502bc0a09da079d2f5f89d61496cd4f2db9a5084d8c8289566c", + "a8n-host-ext.js": "e03a15e7105ac32ff836f513eb2d54592119b01a3d5806ae40b7117ce132bc29", + "ae-a8n-0.6.0.tgz": "87a494c62a0e8d167eab4400adb9e2ee90894112d8beb0d552a851d17bf195be", + "cli-doctor.json": "c5a73d8feba6b02588d817acf01ecdbf9503f7d4d0f2278b68dc55147b7478ad", + "cli-project-open.json": "16ddb153b271e7430fe0001694ee7134ecaab02d44f42ec22cb3379f35eb04ec", + "harness-mcp-real-run.mjs": "3422d44f83d5eac66be5f1f3a16ca0df24fb57a6236791d9ea710f55fef8441e", + "harness-real-run.mjs": "2f02ffd3bd01791c880b45f543e2f97d82e5d6a30b0c2684e980e429980dd00d", + "mcp-stdio.jsonl": "39f5643fce12798ea590cbba1b4c23cd39c120ff721742b673f722c09b079383", + "session-a8n-jsx.json": "060bb50ec79e665ecd9d817f62d65d3682cdc598b6e40e9b1a1e6a1cc4f59771", + "trace.jsonl": "6ad059a609094800e2c416c7f30523e9e5e7b417d3eeb03cfc7f855b231eb4f7" + }, + "environment": { + "disposableProject": true, + "sideEffects": "none-observed", + "sessionRef": "owned ae-a8n sessions only: conformance/real-run.mjs, conformance/mcp-real-run.mjs, devtools-cli execute project.open; each launched its own AE 2026 instance (installDir-pinned) and closed with unsavedChanges=refuse after restoring saved state; no pre-existing AE instance or user project was touched. All lanes ran clean on the first attempt — no first-launch dialog or leftover owned instance was encountered. No other After Effects install (including AE 2027) was contacted." + }, + "dimensions": { + "script": "PASS", + "transport": "PASS", + "ownership": "PASS", + "timeout": "PASS", + "undo": "PASS" + }, + "recordedAt": "2026-11-23T15:42:00.000Z" +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/session-a8n-jsx.json b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/session-a8n-jsx.json new file mode 100644 index 0000000..a0e9717 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/session-a8n-jsx.json @@ -0,0 +1,571 @@ +{ + "schema": "ae-devtools.conformance-run/v1", + "issue": 177, + "startedAt": "2026-11-23T15:39:48.792Z", + "platform": "darwin/arm64", + "node": "v24.22.1", + "installDir": "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app", + "workdir": "/tmp/run-032/real", + "fixturePath": "/tmp/run-032/real/Conformance-Disposable.aep", + "git": { + "head": "7f43db33e521eb2bd7d0d0ebccae87a8b3d6b8c2", + "dirty": false + }, + "consentModel": "local approve-all policy (gate mechanics only; not authenticated authorization)", + "aeProcessesBeforeLaunch": [ + { + "pid": 22649, + "args": "bash -c cd /Users/rebui/work/ae-devtools/packages/ae-devtools-cli && node conformance/real-run.mjs --install-dir \"/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app\" --workdir /tmp/run-032/real --out /tmp/run-032/evidence/session-a8n-jsx.json 2>&1" + }, + { + "pid": 22664, + "args": "node conformance/real-run.mjs --install-dir /Applications/Adobe After Effects 2026/Adobe After Effects 2026.app --workdir /tmp/run-032/real --out /tmp/run-032/evidence/session-a8n-jsx.json" + } + ], + "steps": [ + { + "name": "session.launch", + "at": "2026-11-23T15:39:57.592Z", + "ok": true, + "aeVersion": "26.5.3x9", + "aeBuild": "9", + "ownership": "owned", + "aeA8nSource": "npm:@ido-bata/ae-a8n", + "aeA8nHead": "0.6.0" + }, + { + "name": "identity.before", + "at": "2026-11-23T15:39:58.222Z", + "ok": true, + "outcome": "COMPLETED", + "project": { + "version": "26.5.3x9", + "file": "", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:|N:0|D:false" + } + }, + { + "name": "disposable.gate", + "at": "2026-11-23T15:39:58.222Z", + "ok": true, + "decision": { + "proceed": true, + "reason": "dirty=false, file='', items=0" + } + }, + { + "name": "identity.recheck", + "at": "2026-11-23T15:39:58.749Z", + "ok": true, + "outcome": "COMPLETED", + "project": { + "version": "26.5.3x9", + "file": "", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:|N:0|D:false" + } + }, + { + "name": "op.project.new", + "at": "2026-11-23T15:40:00.272Z", + "ok": true, + "outcome": "COMPLETED", + "status": null, + "result": { + "ok": true + } + }, + { + "name": "op.project.save", + "at": "2026-11-23T15:40:00.893Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true + }, + "fixturePath": "/tmp/run-032/real/Conformance-Disposable.aep" + }, + { + "name": "identity.fixture", + "at": "2026-11-23T15:40:01.434Z", + "ok": true, + "outcome": "COMPLETED", + "project": { + "version": "26.5.3x9", + "file": "/tmp/run-032/real/Conformance-Disposable.aep", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:%2Ftmp%2Frun-032%2Freal%2FConformance-Disposable.aep|N:0|D:false" + }, + "expectedFile": "/tmp/run-032/real/Conformance-Disposable.aep" + }, + { + "name": "op.read.projectSummary.baseline", + "at": "2026-11-23T15:40:02.029Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + } + }, + { + "name": "op.item.addComp", + "at": "2026-11-23T15:40:03.593Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true, + "id": 1, + "name": "Conformance QA Comp", + "parent": null + } + }, + { + "name": "op.read.projectSummary.readback", + "at": "2026-11-23T15:40:04.313Z", + "ok": true, + "outcome": "COMPLETED", + "sawComp": true, + "items": [ + { + "name": "Conformance QA Comp", + "typeName": "コンポジション", + "id": 1, + "selected": false, + "parent": null + } + ] + }, + { + "name": "ae.undo", + "at": "2026-11-23T15:40:05.429Z", + "ok": true, + "undo": { + "ok": true, + "result": { + "id": 16, + "durationMs": 8, + "before": { + "itemCount": 1, + "comp": null, + "layers": [] + }, + "after": { + "itemCount": 0, + "comp": null, + "layers": [] + }, + "name": "Undo", + "added": [], + "removed": [] + } + }, + "outcome": "COMPLETED", + "itemsAfter": [] + }, + { + "name": "op.item.addComp.second", + "at": "2026-11-23T15:40:06.937Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true, + "id": 13, + "name": "Conformance Temp Comp", + "parent": null + } + }, + { + "name": "op.item.remove", + "at": "2026-11-23T15:40:07.537Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true, + "removed": "Conformance Temp Comp" + } + }, + { + "name": "op.read.projectSummary.final", + "at": "2026-11-23T15:40:08.108Z", + "ok": true, + "outcome": "COMPLETED", + "items": [] + }, + { + "name": "op.project.save.resave", + "at": "2026-11-23T15:40:08.749Z", + "ok": true, + "outcome": "COMPLETED", + "result": { + "ok": true + } + }, + { + "name": "jsx.build.ok", + "at": "2026-11-23T15:40:08.831Z", + "ok": true, + "status": "ok" + }, + { + "name": "jsx.dispatch.ok", + "at": "2026-11-23T15:40:10.278Z", + "ok": true, + "outcome": "COMPLETED" + }, + { + "name": "jsx.verify.global-write", + "at": "2026-11-23T15:40:10.835Z", + "ok": true, + "observed": "hello ae 26.5.3x9", + "outcome": "COMPLETED" + }, + { + "name": "jsx.build.runtime-error", + "at": "2026-11-23T15:40:10.842Z", + "ok": true, + "status": "ok" + }, + { + "name": "jsx.dispatch.runtime-error", + "at": "2026-11-23T15:40:11.397Z", + "ok": true, + "outcome": "FAILED", + "hostError": "__toolchainUndeclaredIdentifierは未定義です。", + "hostErrorName": "ReferenceError", + "hostLine": 3 + }, + { + "name": "jsx.sourcemap.to-source", + "at": "2026-11-23T15:40:11.397Z", + "ok": true, + "mapped": { + "source": "runtime-error.ts", + "line": 3, + "column": 48, + "name": null, + "content": "// Deliberate runtime fault for real-host sourcemap verification.\nfunction boom(): void {\n var missing = __toolchainUndeclaredIdentifier;\n $.global.__toolchainBoom = missing;\n}\nboom();\n" + } + }, + { + "name": "a8n.slice", + "at": "2026-11-23T15:40:16.797Z", + "ok": true, + "violations": [], + "outcomes": [ + "connect.state:COMPLETED", + "project.state:COMPLETED", + "error.capture:FAILED", + "fix.rerun:COMPLETED", + "verify.counter.1:COMPLETED", + "verify.counter.2:COMPLETED", + "consent.tampered:BLOCKED", + "consent.denied:REFUSED-BEFORE-SEND" + ] + }, + { + "name": "timeout.probe", + "at": "2026-11-23T15:40:20.114Z", + "ok": true, + "outcome": "UNKNOWN", + "contractOutcome": "unknown", + "retry": "quarantine", + "elapsedMs": 3314, + "quarantined": true, + "sendsBefore": 22, + "sendsAfter": 23, + "sendDelta": 1 + }, + { + "name": "session.close", + "at": "2026-11-23T15:40:21.108Z", + "ok": true + } + ], + "ok": true, + "hostScriptSha256": "e03a15e7105ac32ff836f513eb2d54592119b01a3d5806ae40b7117ce132bc29", + "hostScriptCopy": "/tmp/run-032/real/a8n-host-ext.js", + "projectBefore": { + "version": "26.5.3x9", + "file": "", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:|N:0|D:false" + }, + "disposableDecision": { + "proceed": true, + "reason": "dirty=false, file='', items=0" + }, + "projectRecheck": { + "version": "26.5.3x9", + "file": "", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:|N:0|D:false" + }, + "projectFixture": { + "version": "26.5.3x9", + "file": "/tmp/run-032/real/Conformance-Disposable.aep", + "items": "0", + "dirty": "false", + "raw": "V:26.5.3x9|F:%2Ftmp%2Frun-032%2Freal%2FConformance-Disposable.aep|N:0|D:false" + }, + "fixtureSha256": "d2799b2c2ef86cfbc4f5b096e01c5d4d7e64d087e5528bf167fedca20110af8c", + "undo": { + "call": { + "ok": true, + "result": { + "id": 16, + "durationMs": 8, + "before": { + "itemCount": 1, + "comp": null, + "layers": [] + }, + "after": { + "itemCount": 0, + "comp": null, + "layers": [] + }, + "name": "Undo", + "added": [], + "removed": [] + } + }, + "readbackEmpty": true + }, + "projectOps": { + "baseline": { + "ok": true, + "count": 0, + "numItems": 0, + "items": [], + "activeItem": null, + "selection": [] + }, + "addComp": { + "ok": true, + "id": 1, + "name": "Conformance QA Comp", + "parent": null + }, + "readbackSawComp": true, + "undo": { + "call": { + "ok": true, + "result": { + "id": 16, + "durationMs": 8, + "before": { + "itemCount": 1, + "comp": null, + "layers": [] + }, + "after": { + "itemCount": 0, + "comp": null, + "layers": [] + }, + "name": "Undo", + "added": [], + "removed": [] + } + }, + "readbackEmpty": true + }, + "addComp2": { + "ok": true, + "id": 13, + "name": "Conformance Temp Comp", + "parent": null + }, + "remove": { + "ok": true, + "removed": "Conformance Temp Comp" + }, + "finalItems": [] + }, + "jsx": { + "okBuild": { + "status": "ok", + "jsxBytes": 185 + }, + "dispatchOk": "COMPLETED", + "globalWrite": "hello ae 26.5.3x9", + "runtimeError": { + "outcome": "FAILED", + "hostErrorName": "ReferenceError", + "hostLine": 3, + "mapped": { + "source": "runtime-error.ts", + "line": 3, + "column": 48, + "name": null, + "content": "// Deliberate runtime fault for real-host sourcemap verification.\nfunction boom(): void {\n var missing = __toolchainUndeclaredIdentifier;\n $.global.__toolchainBoom = missing;\n}\nboom();\n" + } + } + }, + "sliceSteps": [ + { + "label": "connect.state", + "source": "String(app.version)", + "outcome": "COMPLETED", + "contractOutcome": "completed", + "requestState": "ACKED", + "result": "26.5.3x9", + "error": null, + "refusal": null, + "sendsBefore": 16, + "sendsAfter": 17 + }, + { + "label": "project.state", + "source": "String(app.project.numItems)", + "outcome": "COMPLETED", + "contractOutcome": "completed", + "requestState": "ACKED", + "result": "0", + "error": null, + "refusal": null, + "sendsBefore": 17, + "sendsAfter": 18 + }, + { + "label": "error.capture", + "source": "__a8nSliceUndeclaredIdentifier;", + "outcome": "FAILED", + "contractOutcome": "failed", + "requestState": "ACKED", + "result": null, + "error": { + "name": "ReferenceError", + "message": "__a8nSliceUndeclaredIdentifierは未定義です。", + "line": 1, + "hostReported": true + }, + "refusal": null, + "sendsBefore": 18, + "sendsAfter": 19 + }, + { + "label": "fix.rerun", + "source": "String(app.project.numItems + 0)", + "outcome": "COMPLETED", + "contractOutcome": "completed", + "requestState": "ACKED", + "result": "0", + "error": null, + "refusal": null, + "sendsBefore": 19, + "sendsAfter": 20 + }, + { + "label": "verify.counter.1", + "source": "$.global.__a8nSliceCounter = (typeof $.global.__a8nSliceCounter === 'undefined' ? 0 : $.global.__a8nSliceCounter) + 1; String($.global.__a8nSliceCounter);", + "outcome": "COMPLETED", + "contractOutcome": "completed", + "requestState": "ACKED", + "result": "1", + "error": null, + "refusal": null, + "sendsBefore": 20, + "sendsAfter": 21 + }, + { + "label": "verify.counter.2", + "source": "$.global.__a8nSliceCounter = (typeof $.global.__a8nSliceCounter === 'undefined' ? 0 : $.global.__a8nSliceCounter) + 1; String($.global.__a8nSliceCounter);", + "outcome": "COMPLETED", + "contractOutcome": "completed", + "requestState": "ACKED", + "result": "2", + "error": null, + "refusal": null, + "sendsBefore": 21, + "sendsAfter": 22 + }, + { + "label": "consent.tampered", + "source": "String(app.version)", + "outcome": "BLOCKED", + "contractOutcome": "not-sent", + "requestState": "NOT_SENT", + "result": null, + "error": null, + "refusal": { + "code": "CONSENT_SCOPE_MISMATCH", + "message": "consent scope does not match this dispatch (session/operation/args/project)" + }, + "sendsBefore": 22, + "sendsAfter": 22 + }, + { + "label": "consent.denied", + "source": "__DENY__ String(app.version)", + "outcome": "REFUSED-BEFORE-SEND", + "reason": "policy denied: source carries __DENY__ marker", + "sendsBefore": 22, + "sendsAfter": 22 + } + ], + "sliceViolations": [], + "timeoutProbe": { + "outcome": "UNKNOWN", + "contractOutcome": "unknown", + "retry": "quarantine", + "elapsedMs": 3314, + "quarantined": true, + "sendsBefore": 22, + "sendsAfter": 23, + "sendDelta": 1 + }, + "transportSends": 23, + "opResultSummary": { + "project.new#1": "COMPLETED", + "project.save#2": "COMPLETED", + "read.projectSummary#3": "COMPLETED", + "item.addComp#4": "COMPLETED", + "read.projectSummary#5": "COMPLETED", + "read.projectSummary#6": "COMPLETED", + "item.addComp#7": "COMPLETED", + "item.remove#8": "COMPLETED", + "read.projectSummary#9": "COMPLETED", + "project.save#10": "COMPLETED" + }, + "evidenceLevel": "verified on real host", + "traceCopy": "/tmp/run-032/real/trace.jsonl", + "traceSha256": "6ad059a609094800e2c416c7f30523e9e5e7b417d3eeb03cfc7f855b231eb4f7", + "close": { + "quit": true + }, + "aeProcessesAfterClose": [ + { + "pid": 22649, + "args": "bash -c cd /Users/rebui/work/ae-devtools/packages/ae-devtools-cli && node conformance/real-run.mjs --install-dir \"/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app\" --workdir /tmp/run-032/real --out /tmp/run-032/evidence/session-a8n-jsx.json 2>&1" + }, + { + "pid": 22664, + "args": "node conformance/real-run.mjs --install-dir /Applications/Adobe After Effects 2026/Adobe After Effects 2026.app --workdir /tmp/run-032/real --out /tmp/run-032/evidence/session-a8n-jsx.json" + }, + { + "pid": 24020, + "args": "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app/Contents/MacOS/crashpad_handler --no-rate-limit --database=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db --metrics-dir=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db --attachment=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db/94b94e6f-205a-4dec-50e6-8a4d7c73d505.run/__sentry-event --attachment=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db/94b94e6f-205a-4dec-50e6-8a4d7c73d505.run/__sentry-breadcrumb1 --attachment=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db/94b94e6f-205a-4dec-50e6-8a4d7c73d505.run/__sentry-breadcrumb2 --crash-reporter=/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app/Contents/AdobeCrashReport.app --crash-envelope=/Users/rebui/Library/Caches/Adobe/After Effects/26.0/SentryIO-db/external/af47edbc-9fde-4a8b-6321-d5216704dae6.envelope --report-id=af47edbc-9fde-4a8b-6321-d5216704dae6 --handshake-fd=5" + }, + { + "pid": 24025, + "args": "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app/Contents/MacOS/dynamiclinkmanager --rogue" + }, + { + "pid": 24026, + "args": "/Applications/Adobe After Effects 2026/Adobe After Effects 2026.app/Contents/TeamProjectsLocalHub.app/Contents/MacOS/TeamProjectsLocalHub" + } + ], + "finishedAt": "2026-11-23T15:40:21.230Z" +} diff --git a/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/trace.jsonl b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/trace.jsonl new file mode 100644 index 0000000..85d0172 --- /dev/null +++ b/packages/capability-catalog/evidence/conformance/run-2026-11-23-ae2026-a8n-032/trace.jsonl @@ -0,0 +1,30 @@ +{"seq":0,"ts":"2026-11-23T15:39:55.188Z","op":"session.probe","status":"ok","durationMs":5152,"args":{"method":"app.info"},"result":{"version":"26.5.3x9","build":"9"}} +{"seq":1,"ts":"2026-11-23T15:39:55.560Z","op":"session.launch","status":"ok","durationMs":5882,"args":{"transport":"script-invocation"},"result":{"version":"26.5.3x9","build":"9","ownership":{"kind":"owned","evidence":"pid 23458 is still the only instance"}}} +{"seq":2,"ts":"2026-11-23T15:39:55.774Z","op":"session.authorization","status":"ok","durationMs":0,"result":{"ownership":"owned","granted":["extensionMethods","hostEnvironment","menuCommands"]}} +{"seq":3,"ts":"2026-11-23T15:39:55.837Z","op":"supervision.transition","status":"ok","durationMs":0,"result":{"from":"init","to":"running","reason":"supervision started","enteredAt":"2026-11-23T15:39:55.836Z"}} +{"seq":4,"ts":"2026-11-23T15:39:58.218Z","op":"extension.call","status":"ok","durationMs":394,"args":{"method":"aeDevtools.trustedEval","source":"(function(){var f=app.project.file;var d=(typeof app.project.dirty===\"boolean\")?String(app.project.dirty):\"unsupported\";return \"V:\"+String(app.version)+\"|F:\"+(f?encodeURIComponent(f.fsName):\"\")+\"|N:\"+String(app.project.numItems)+\"|D:\"+d;})()","requestId":"conf-eval-identity.before-mwtfma09"},"result":{"requestId":"conf-eval-identity.before-mwtfma09","ok":true,"resultJson":"\"V:26.5.3x9|F:|N:0|D:false\"","valueText":null,"valueType":"string"}} +{"seq":5,"ts":"2026-11-23T15:39:58.747Z","op":"extension.call","status":"ok","durationMs":381,"args":{"method":"aeDevtools.trustedEval","source":"(function(){var f=app.project.file;var d=(typeof app.project.dirty===\"boolean\")?String(app.project.dirty):\"unsupported\";return \"V:\"+String(app.version)+\"|F:\"+(f?encodeURIComponent(f.fsName):\"\")+\"|N:\"+String(app.project.numItems)+\"|D:\"+d;})()","requestId":"conf-eval-identity.recheck-mwtfmaha"},"result":{"requestId":"conf-eval-identity.recheck-mwtfmaha","ok":true,"resultJson":"\"V:26.5.3x9|F:|N:0|D:false\"","valueText":null,"valueType":"string"}} +{"seq":6,"ts":"2026-11-23T15:40:00.270Z","op":"extension.call","status":"ok","durationMs":1349,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9431)","requestId":"conf-op-project.new#1-mwtfmavx"},"result":{"requestId":"conf-op-project.new#1-mwtfmavx","ok":true,"resultJson":"\"{\\\"ok\\\":true}\"","valueText":null,"valueType":"string"}} +{"seq":7,"ts":"2026-11-23T15:40:00.892Z","op":"extension.call","status":"ok","durationMs":447,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9489)","requestId":"conf-op-project.save#2-mwtfmc28"},"result":{"requestId":"conf-op-project.save#2-mwtfmc28","ok":true,"resultJson":"\"{\\\"ok\\\":true}\"","valueText":null,"valueType":"string"}} +{"seq":8,"ts":"2026-11-23T15:40:01.431Z","op":"extension.call","status":"ok","durationMs":396,"args":{"method":"aeDevtools.trustedEval","source":"(function(){var f=app.project.file;var d=(typeof app.project.dirty===\"boolean\")?String(app.project.dirty):\"unsupported\";return \"V:\"+String(app.version)+\"|F:\"+(f?encodeURIComponent(f.fsName):\"\")+\"|N:\"+String(app.project.numItems)+\"|D:\"+d;})()","requestId":"conf-eval-identity.fixture-mwtfmcjh"},"result":{"requestId":"conf-eval-identity.fixture-mwtfmcjh","ok":true,"resultJson":"\"V:26.5.3x9|F:%2Ftmp%2Frun-032%2Freal%2FConformance-Disposable.aep|N:0|D:false\"","valueText":null,"valueType":"string"}} +{"seq":9,"ts":"2026-11-23T15:40:02.028Z","op":"extension.call","status":"ok","durationMs":436,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+10130)","requestId":"conf-op-read.projectSummary#3-mwtfmcyj"},"result":{"requestId":"conf-op-read.projectSummary#3-mwtfmcyj","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"count\\\":0,\\\"numItems\\\":0,\\\"items\\\":[],\\\"activeItem\\\":null,\\\"selection\\\":[]}\"","valueText":null,"valueType":"string"}} +{"seq":10,"ts":"2026-11-23T15:40:03.592Z","op":"extension.call","status":"ok","durationMs":1404,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9673)","requestId":"conf-op-item.addComp#4-mwtfmdf1"},"result":{"requestId":"conf-op-item.addComp#4-mwtfmdf1","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"id\\\":1,\\\"name\\\":\\\"Conformance QA Comp\\\",\\\"parent\\\":null}\"","valueText":null,"valueType":"string"}} +{"seq":11,"ts":"2026-11-23T15:40:04.304Z","op":"extension.call","status":"ok","durationMs":563,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+10130)","requestId":"conf-op-read.projectSummary#5-mwtfmemh"},"result":{"requestId":"conf-op-read.projectSummary#5-mwtfmemh","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"count\\\":1,\\\"numItems\\\":1,\\\"items\\\":[{\\\"name\\\":\\\"Conformance QA Comp\\\",\\\"typeName\\\":\\\"コンポジション\\\",\\\"id\\\":1,\\\"selected\\\":false,\\\"parent\\\":null}],\\\"activeItem\\\":null,\\\"selection\\\":[]}\"","valueText":null,"valueType":"string"}} +{"seq":12,"ts":"2026-11-23T15:40:04.878Z","op":"menu.execute","status":"ok","durationMs":401,"args":{"method":"menu.execute","id":16},"result":{"id":16,"durationMs":8,"before":"{...}","after":"{...}"}} +{"seq":13,"ts":"2026-11-23T15:40:04.878Z","op":"menu.execute.scene","status":"ok","durationMs":0,"args":{"id":16,"name":"Undo"},"result":{"comp":null,"itemsBefore":1,"itemsAfter":0,"layersBefore":[],"layersAfter":[],"added":[],"removed":[]}} +{"seq":14,"ts":"2026-11-23T15:40:05.428Z","op":"extension.call","status":"ok","durationMs":418,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+10130)","requestId":"conf-op-read.projectSummary#6-mwtfmfm6"},"result":{"requestId":"conf-op-read.projectSummary#6-mwtfmfm6","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"count\\\":0,\\\"numItems\\\":0,\\\"items\\\":[],\\\"activeItem\\\":null,\\\"selection\\\":[]}\"","valueText":null,"valueType":"string"}} +{"seq":15,"ts":"2026-11-23T15:40:06.936Z","op":"extension.call","status":"ok","durationMs":1348,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9673)","requestId":"conf-op-item.addComp#7-mwtfmg1h"},"result":{"requestId":"conf-op-item.addComp#7-mwtfmg1h","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"id\\\":13,\\\"name\\\":\\\"Conformance Temp Comp\\\",\\\"parent\\\":null}\"","valueText":null,"valueType":"string"}} +{"seq":16,"ts":"2026-11-23T15:40:07.534Z","op":"extension.call","status":"ok","durationMs":428,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9520)","requestId":"conf-op-item.remove#8-mwtfmh7d"},"result":{"requestId":"conf-op-item.remove#8-mwtfmh7d","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"removed\\\":\\\"Conformance Temp Comp\\\"}\"","valueText":null,"valueType":"string"}} +{"seq":17,"ts":"2026-11-23T15:40:08.106Z","op":"extension.call","status":"ok","durationMs":428,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+10130)","requestId":"conf-op-read.projectSummary#9-mwtfmho1"},"result":{"requestId":"conf-op-read.projectSummary#9-mwtfmho1","ok":true,"resultJson":"\"{\\\"ok\\\":true,\\\"count\\\":0,\\\"numItems\\\":0,\\\"items\\\":[],\\\"activeItem\\\":null,\\\"selection\\\":[]}\"","valueText":null,"valueType":"string"}} +{"seq":18,"ts":"2026-11-23T15:40:08.748Z","op":"extension.call","status":"ok","durationMs":482,"args":{"method":"aeDevtools.trustedEval","source":"(function(){\n\nfunction __adp_fail(msg) { throw new Error(\"adapter: \" + msg); }\nfunction __adp_items() { return app.project.items; }\n// Type discrimination uses instanceof (locale-independent). typeName\n// is localized and must NOT be used for branching (PR #46 review).\nfunction __adp_typeMatch(it, ctor) {\n if (ctor === null) return true;\n try { return it instanceof ctor; } catch (e) { return false; }\n}\nfunction __adp_findInColl(coll, name, ctor, scope) {\n var found = null;\n var sawName = false;\n for (v…(+9489)","requestId":"conf-op-project.save#10-mwtfmi3w"},"result":{"requestId":"conf-op-project.save#10-mwtfmi3w","ok":true,"resultJson":"\"{\\\"ok\\\":true}\"","valueText":null,"valueType":"string"}} +{"seq":19,"ts":"2026-11-23T15:40:10.277Z","op":"extension.call","status":"ok","durationMs":1311,"args":{"method":"aeDevtools.trustedEval","source":"// Minimal valid ExtendScript-bound script.\nfunction greet() {\n return \"hello ae \" + app.version;\n}\nvar msg = greet();\n$.global.__toolchainProbe = msg;\n//# sourceMappingURL=ok.js.map","requestId":"conf-jsx-ok-mwtfminz"},"result":{"requestId":"conf-jsx-ok-mwtfminz","ok":true,"resultJson":"\"hello ae 26.5.3x9\"","valueText":null,"valueType":"string"}} +{"seq":20,"ts":"2026-11-23T15:40:10.833Z","op":"extension.call","status":"ok","durationMs":401,"args":{"method":"aeDevtools.trustedEval","source":"\"\" + $.global.__toolchainProbe","requestId":"conf-jsx-read-mwtfmjs6"},"result":{"requestId":"conf-jsx-read-mwtfmjs6","ok":true,"resultJson":"\"hello ae 26.5.3x9\"","valueText":null,"valueType":"string"}} +{"seq":21,"ts":"2026-11-23T15:40:11.395Z","op":"extension.call","status":"ok","durationMs":388,"args":{"method":"aeDevtools.trustedEval","source":"// Deliberate runtime fault for real-host sourcemap verification.\nfunction boom() {\n var missing = __toolchainUndeclaredIdentifier;\n $.global.__toolchainBoom = missing;\n}\nboom();\n//# sourceMappingURL=runtime-error.js.map","requestId":"conf-jsx-bad-mwtfmk7u"},"result":{"requestId":"conf-jsx-bad-mwtfmk7u","ok":false,"evalError":"{...}"}} +{"seq":22,"ts":"2026-11-23T15:40:11.920Z","op":"extension.call","status":"ok","durationMs":367,"args":{"method":"aeDevtools.trustedEval","source":"String(app.version)","requestId":"req-0ab53b6f600bf6ec"},"result":{"requestId":"req-0ab53b6f600bf6ec","ok":true,"resultJson":"\"26.5.3x9\"","valueText":null,"valueType":"string"}} +{"seq":23,"ts":"2026-11-23T15:40:13.558Z","op":"extension.call","status":"ok","durationMs":1490,"args":{"method":"aeDevtools.trustedEval","source":"String(app.project.numItems)","requestId":"req-dd87cfc4197cd0bf"},"result":{"requestId":"req-dd87cfc4197cd0bf","ok":true,"resultJson":"\"0\"","valueText":null,"valueType":"string"}} +{"seq":24,"ts":"2026-11-23T15:40:14.063Z","op":"extension.call","status":"ok","durationMs":382,"args":{"method":"aeDevtools.trustedEval","source":"__a8nSliceUndeclaredIdentifier;","requestId":"req-6f89a0bed5f1bda8"},"result":{"requestId":"req-6f89a0bed5f1bda8","ok":false,"evalError":"{...}"}} +{"seq":25,"ts":"2026-11-23T15:40:14.625Z","op":"extension.call","status":"ok","durationMs":399,"args":{"method":"aeDevtools.trustedEval","source":"String(app.project.numItems + 0)","requestId":"req-ac440e32e5150527"},"result":{"requestId":"req-ac440e32e5150527","ok":true,"resultJson":"\"0\"","valueText":null,"valueType":"string"}} +{"seq":26,"ts":"2026-11-23T15:40:15.120Z","op":"extension.call","status":"ok","durationMs":355,"args":{"method":"aeDevtools.trustedEval","source":"$.global.__a8nSliceCounter = (typeof $.global.__a8nSliceCounter === 'undefined' ? 0 : $.global.__a8nSliceCounter) + 1; String($.global.__a8nSliceCounter);","requestId":"req-9e112f7041089992"},"result":{"requestId":"req-9e112f7041089992","ok":true,"resultJson":"\"1\"","valueText":null,"valueType":"string"}} +{"seq":27,"ts":"2026-11-23T15:40:16.795Z","op":"extension.call","status":"ok","durationMs":1515,"args":{"method":"aeDevtools.trustedEval","source":"$.global.__a8nSliceCounter = (typeof $.global.__a8nSliceCounter === 'undefined' ? 0 : $.global.__a8nSliceCounter) + 1; String($.global.__a8nSliceCounter);","requestId":"req-cd6d126ea8c75b9b"},"result":{"requestId":"req-cd6d126ea8c75b9b","ok":true,"resultJson":"\"2\"","valueText":null,"valueType":"string"}} +{"seq":28,"ts":"2026-11-23T15:40:18.042Z","op":"supervision.health","status":"ok","durationMs":0,"result":{"from":"unobserved","to":"degraded","phase":"running"}} +{"seq":29,"ts":"2026-11-23T15:40:20.113Z","op":"extension.call","status":"ok","durationMs":3158,"args":{"method":"aeDevtools.trustedEval","source":"$.sleep(2000); \"slept\"","requestId":"conf-timeout-mwtfmotc"},"result":{"requestId":"conf-timeout-mwtfmotc","ok":true,"resultJson":"\"slept\"","valueText":null,"valueType":"string"}} diff --git a/packages/capability-catalog/release-scope.json b/packages/capability-catalog/release-scope.json index d8e0e33..6ae6a9e 100644 --- a/packages/capability-catalog/release-scope.json +++ b/packages/capability-catalog/release-scope.json @@ -1,6 +1,6 @@ { "schema": "ae-devtools.release-scope/v1", - "release": "0.7.0", + "release": "0.8.0", "supportedRelease": { "state": "recorded", "releases": ["26.5"],