Skip to content

feat(mcp): headless MCP tools: verification, layout, offscreen UI, render views and a robust control channel - #859

Closed
eliasx45 wants to merge 33 commits into
storytold:mainfrom
eliasx45:upstream/agents-control-robustness
Closed

eliasx45 wants to merge 33 commits into
storytold:mainfrom
eliasx45:upstream/agents-control-robustness

Conversation

@eliasx45

Copy link
Copy Markdown
Contributor

The first of three PRs that make EffectCraft easier for AI agents to drive and check. This one
covers the MCP server's tools and the control channel; the next two build on it.

What

CI for contributors and agents

  • cargo xtask ci --affected [--base REV] [--dry-run]: the CI gates (fmt, clippy, tests via nextest
    when installed, doctests, layers, assets, wasm) for only the packages a change can affect: changed
    files map to their package and to packages that read them through ../ paths, expanded to reverse
    dependents. Workspace-wide inputs (root Cargo.toml, Cargo.lock, .cargo/, xtask/, toolchain,
    clippy.toml) fall back to the full CI.
  • [profile.ci] (release without LTO, 16 codegen units): xtask ci builds clippy and tests with it
    instead of --release. Three wall-clock asserts (engine memory tick, GPU OpenGL decline, script
    socket) keep their intent with bounds that survive a loaded machine.

Verification

  • MCP structured results: for clients that negotiate 2025-06-18 or later, JSON tool results also
    come as structuredContent, and the tools with a stable shape declare an outputSchema.
  • Repro scripts: journal.export writes the session's command journal as a JSON-lines replay script;
    effectcraft-cli replay SCRIPT.jsonl [--keep-going] replays one headless. tests/repros/*.jsonl
    are replayed by a host test, so a crash fix can ship its repro as a file.
  • render.snapshot / render.compare (MCP render_snapshot / render_compare, CLI
    effectcraft-cli compare A B): keep a rendered frame and compare frames, image files or renders of
    now: max / mean difference, PSNR, SSIM, changed pixels, pass/fail, a diff heatmap; region and
    diffBounds.

Layout and long calls

  • layer.bounds / MCP get_layout: where layers are on screen at a time without rendering (visible
    and why not, comp-space bounds, corners, centre, on-screen fraction, optional drawn-pixel bounds and
    overlaps), after parenting and the active camera.
  • Progress and cancellation: renders, analyses (tracking, warp stabilizer, camera tracker, roto
    propagate, content fill, scene detection, footage checks), jobs.wait and scripts run as
    background jobs while the server keeps reading; notifications/progress, notifications/cancelled,
    ping served meanwhile. A second render while one runs is still refused at once.

Offscreen UI, resources and prompts

  • effectcraft-cli mcp --ui: the full app runs offscreen (egui_kittest + wgpu, no window), so
    screenshot and the ui_* tools work headless; automation gains a ControlTransport trait and
    stays free of egui (the ui-egui offscreen feature carries the offscreen app). The snapshot
    example reuses it; mcp --ui --autosave.
  • Resource templates (comp/{comp}, layer/{comp}/{layer}, frame/{comp}/{time} as a PNG blob,
    command/{id}), prompts (title_card, lower_third, port_ae_script, check_against_reference,
    animate_layer), resource subscriptions and logging notifications.
  • audio.analyze / MCP analyze_audio: peak, true peak, RMS, integrated LUFS, clipping, silences
    and an optional waveform image.
  • Duplicate tool aliases stay callable but leave tools/list (mcp --all-tools lists them);
    render_preview takes path and inline.

Render views

  • render.frame and the MCP render tools take region, layer (one layer solo in place), item
    (a footage or solid item on its own) and overlays (bounds, anchors, motion paths, safe margins,
    grid, with each layer's comp-space bounds in the reply).
  • render.contactSheet / MCP render_frames: several labelled frames on one PNG (optionally an
    animated GIF).

Control channel robustness

  • Stable layer ids for agents ("#n" is the stack index, a bare number is a layer id), per-client
    undo bookkeeping, a document revision, and Layer Style Cancel that keeps other clients' edits.
  • A request that times out before the UI thread starts it is cancelled and never runs; a top-level
    requestId answers retries from a reply cache (MCP _meta.requestId), so a retried call never
    runs twice; events.subscribe streams project.changed / selection.changed; a busy control port
    is reported; ui.screenshot takes max_side; app.revision; --bridge / --control without a
    port use EFFECTCRAFT_CONTROL_PORT (else 9877).
  • Agent-friendly errors: clamped values come back as warnings, errors name the argument and suggest
    a fix, index and enum parameters have typed schemas, catalogues have a cheap brief mode, and
    mutations return what they changed.

Why

Agents need machine-readable results and a way to prove what an edit changed (snapshot → edit →
compare); an agent checking a layout should not have to render and eyeball a frame; a long render
should not freeze the MCP session; agents could only see the UI with a desktop app running; and
agents retry on timeouts and act on stale indices, so retries must be safe, references stable and
mistakes self-explaining. Bug reports get a replayable script instead of prose, and per-change CI
no longer takes as long as a release build.

How tested

  • rustfmt --check and cargo check of the affected crates on this branch.
  • On the top of the three-PR series (this branch plus the next two): cargo clippy --all-targets -- -D warnings for automation, engine, cli, ui-egui, effectcraft, host, export, effects, project,
    raster, script, gpu and xtask: clean. cargo test: automation 77/77, cli (unit 3/3, cli 18/18,
    mcp tests), engine lib 596 passed (2 ignored), raster, host (including tests/repros) and xtask
    pass.
  • Not run: the ui-egui integration tests (--test ui) and the full cargo xtask ci (the runner
    had no GPU and 4 cores).

Cherry-picked with -x trailers and adapted to current main: new modules are declared by hand in
lib.rs / commands/mod.rs.

0Elias71 and others added 30 commits October 11, 2026 10:27
cargo xtask ci --affected [--base REV] [--dry-run] runs fmt, clippy, tests (nextest + doctests when available), layers, assets (only on asset changes) and wasm (only for affected L0-L4/web crates) for the packages a change can affect: changed files map to the owning package and to packages whose sources read them via ../ paths, expanded to reverse dependents. Workspace-wide inputs (root Cargo.toml, Cargo.lock, .cargo/, xtask/, toolchain, clippy.toml) fall back to full CI. Documented in docs/testing.md, AGENTS.md and CLAUDE.md.

(cherry picked from commit f3ca84f)

(cherry picked from commit 8a2cdcadf447eafa57ab14016beae4420f002af0)
- [profile.ci] (release without LTO, 16 codegen units); `xtask ci` runs clippy
  and tests with --profile ci instead of --release.
- Wall-clock asserts in engine memory_tick, gpu OpenGL decline and script
  socket tests keep their intent with bounds that survive a loaded machine.
- docs/testing.md and CONTRIBUTING.md mention the profile.

(cherry picked from commit b45c8a3)

(cherry picked from commit fa1ea6a107c4c1936cde89b518a05adc73f2b4b0)
… 2025-06-18+ clients

JSON tool results also come as structuredContent (always an object: arrays as {items},
scalars as {value}, image replies as their metadata) to sessions that negotiated 2025-06-18
or modern per-request clients; the text block stays for older clients. get_state,
doc_inspect, render_preview/render_frame, undo, redo, history, command_batch, batch and
save_project declare an outputSchema. The server now tracks the negotiated revision.
doc_inspect also carries project.autosave with --autosave.

(cherry picked from commit 5efa103)

(cherry picked from commit 780f497c9049ac06cc16a558c7c024adec20dbdb)
Bug reports become replay scripts and crash regression tests become data files:
- engine::replay: a JSON-lines repro format (start line, command steps with
  expect_error, expect queries with JSON pointer + equals, expect_no_error),
  a never-panicking runner that reports per-step ok/error and the first failure,
  and journal export (from the last project open; saves left out; size-capped).
- journal.export {path?} and help.exportRepro {path?} (not journaled).
- Crash capture: when the last-resort guard catches a panic in the outermost
  command, the journal plus that command is saved to Repros/crash-*.jsonl in the
  settings store (newest 20 kept) and the error names the file.
- Commands run by a journaled command (script steps) are no longer journaled twice.
- effectcraft-cli replay SCRIPT.jsonl [--json] [--keep-going]: exits 1 on a failed
  step, unmet expectation or panic.
- crates/host/tests/repros.rs replays every tests/repros/*.jsonl; three samples
  from past crash fixes (zero frame rate, Layer Settings with no selection,
  New Comp from Selection with hostile overlap).
- Docs: docs/agents.md "Repro scripts"; AGENTS.md: crash fix regression test =
  a .jsonl in tests/repros.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

(cherry picked from commit c38509d)

(cherry picked from commit e55b56dbf76716adfcbfe4cc773df19a74edc419)
Agents can verify visual work by looking: render.snapshot keeps named frames in the session (16 max, byte-capped, oldest evicted); render.compare compares snapshots, PNG/JPEG files or frames rendered now and returns max/mean abs diff, PSNR, SSIM, changed pixels, pass, and an amplified diff heatmap (diff_path / diff_inline). Pure metrics + area resampler in effectcraft-raster::compare (wasm-safe). MCP tools render_snapshot / render_compare (heatmap inline as image content when something changed), CLI 'effectcraft-cli compare a.png b.png' (exit 1 on fail). Same aspect ratio at different sizes compares at the smaller size; different aspect ratios are an error. Docs: agents.md, control-protocol.md, mcp.md.

(cherry picked from commit edf4fb7)

(cherry picked from commit 0dd6d651b5cbd7707965f0cc3b64e217caf993b1)
layer.bounds (MCP get_layout): per layer at a comp time, whether it is drawn
and why not, its comp-space bounds, corners, centre and anchor after
transform, parenting and the active camera (3D), the on-screen fraction,
the sourceRectAtTime rect, optional drawn-pixel bounds (effects included)
and pairwise overlaps. effectcraft_engine::layout::layer_geometry is the
canonical engine function.

(cherry picked from commit 1875e47)

(cherry picked from commit 74c8b41c5304e76593f88c4659fcf4b470869281)
Over MCP (headless and bridged), blocking commands with an engine background job
(renderQueue.render, track.analyze/track.mask, warp/camera/roto analyses with
wait: true, contentFill.generate, layer.sceneEditDetection, footage.check,
jobs.wait) run on their job from one table (long_job.rs SPECS), watched through
jobs.list / renderQueue.list: notifications/progress for a progressToken,
notifications/cancelled cancels the job, ping and other requests are served
meanwhile. Headless run_script runs on a worker thread and stops on cancel or
its timeout (default 300 s) via a new Session::script_interrupt checked by the
boa runtime between bytecode batches and in object-model calls; an open undo
group is rolled back.

Co-Authored-By: Claude <noreply@anthropic.com>

(cherry picked from commit bac1736)

(cherry picked from commit 1431bbd2a3986b3eb9b723f5df341a6e301a8950)
(cherry picked from commit f351119a72c8d0aff92367b4e15af10080b09ce7)
effectcraft-cli mcp --ui runs the full EffectcraftApp offscreen (egui_kittest + wgpu) on a UI
thread of its own and routes every tool through control-channel requests, so screenshot (with
panel/id crops), ui_*, control and render work with no window, no focus stealing and several
instances side by side. The automation crate gains a ControlTransport trait (BridgeClient is one;
the CLI's offscreen transport another) and stays free of egui. ui-egui's offscreen module sits
behind the new `offscreen` feature; the CLI's `ui` feature (default) enables it.

(cherry picked from commit 32d57d3)

(cherry picked from commit 48503c4bbe9ec6fdd6f97f0ffe7055898bec432c)
resources/templates/list offers effectcraft://comp/{comp}, layer/{comp}/{layer} (?flat=true),
frame/{comp}/{time} (?max_side=N, PNG as a base64 blob) and command/{id}; resources/read
serves them through get_comp, get_layer, render_preview and describe_command. Segments are
percent-decoded after splitting; unknown kinds/comps/layers/commands are -32002 and malformed
URIs (segment count, escapes, time, query keys) -32602, never a panic.

(cherry picked from commit 03e7466)

(cherry picked from commit a5fc324aec452bb1f67086e99cf5a187425657b2)
…gainst_reference, animate_layer

prompts/list and prompts/get serve workflow recipes with arguments; each is one user message
spelling out the tool flow by canonical tool name (command_run, add_keyframe, add_effect,
run_script, render_preview, render_compare), the layer-time vs comp-time pitfall and rendering
to check. Missing/unknown/non-string arguments and unknown prompts are -32602. The prompts
capability is declared; prompt titles only for 2025-06-18+.

(cherry picked from commit a0895b3)

(cherry picked from commit ab85dbeb6aa9b9f7e533f9cacf7eeffad1597220)
audio.analyze (MCP analyze_audio): mixes the comp's audio (the mix preview and
export play, or one layer alone) at 48 kHz over [start, end) and returns
sample peak, a 4x-oversampled true-peak estimate, RMS, integrated loudness
(ITU-R BS.1770-4 K-weighting with absolute and relative gating), maximum
momentary and short-term loudness, clipped samples, silent ranges and
per-channel stats, plus optional min/max waveform columns (a PNG via path,
or an inline image from the MCP tool). Comps without audio report
hasAudio: false.

(cherry picked from commit e738d3b)

(cherry picked from commit a7a6e38fdde0decefe96d978ae352d4620cac10c)
resources/subscribe / unsubscribe (subscribe: true): after any request that changes the
project revision (new project.summary.revision; edits, undo, redo, never queries), every
subscribed document/comp/layer/frame URI gets notifications/resources/updated. Bridge mode
polls project.summary once per request while something is subscribed.
logging (logging/setLevel, default warning): notifications/message for new expression
errors after an edit (expr.errors, reported once), missing footage after open_project
(headless), failed --autosave checkpoints and session toasts (headless; Backend::exec now
keeps toasts, bounded). Requests queue notifications in a small outbox (notify.rs) that serve
and the long-render loop write after each reply; take_notifications() for embedders.

(cherry picked from commit 6c2989b)

(cherry picked from commit 8df25f32f9179404a53f8f85e63bfb07b1c1c4ea)
…d inline

list_commands, execute_command, get_project and render_frame duplicate command_list,
command_run, doc_inspect and render_preview (the core names in docs/mcp.md). They are left
out of tools/list but stay callable with their own arguments; effectcraft-cli mcp
--all-tools lists them too, described as aliases. render_preview gains render_frame's path
and inline (now annotated as a file writer). Tool descriptions, error hints, the server
instructions and docs/agents.md / docs/mcp.md use the canonical names.

(cherry picked from commit 4bc7d33)

(cherry picked from commit f7fcf591d337371523c9f29dd06b876dc448f1f9)
(cherry picked from commit 514e185800b11e509cdbbe2fefa7931c86d9598d)
render.frame is now an engine command (and the control method delegates to it, so the
MCP bridge matches headless): region [x, y, w, h] renders one comp rectangle at full
resolution through the renderer's region of interest; layer renders one layer solo;
item renders a footage or solid item on its own; overlays draws layer bounds (tagged
returns each drawn layer's comp-space bounds. render_frame / render_preview take the
new arguments.

(cherry picked from commit 586fd05)

(cherry picked from commit f8512a6759d4780aed124b9edbb299add375c6be)
render.contactSheet renders several frames (times, or count spread evenly over the
work area / start..end, capped at 64) onto one PNG, each cell labelled with its time
and frame number in the bundled UI font; it takes render.frame's layer, item, region,
overlays and transparent, sizes the sheet to max_side (default 1600) with a grid close
to 16:10, and can also write an animated GIF. The render_frames MCP tool wraps it
(headless and bridged).

(cherry picked from commit 04366ff)

(cherry picked from commit f1cc33907029d721813f82fd0cae0b93a45a17e0)
…uct)

(cherry picked from commit 8a7511bd3b7216dfa3c829eb137af926f0da6dff)
render.compare / render_compare take region: [x, y, w, h] (compared-frame pixels, clipped,
empty/outside/non-finite rejected) restricting metrics and heatmap, and return diffBounds
(box of the pixels over the threshold, or null). raster::compare gains crop and
CompareStats::diff_bounds. outputSchema for render_snapshot and render_compare, validated in
the structured-content test.

(cherry picked from commit ee40731)

(cherry picked from commit c6c2e5168660a45aec7f231e52cde777d199da8a)
(cherry picked from commit 5fcee187490577079c8e7fef30cd5a0b940f3577)
…e Cancel keeps other edits

- A number in a layer/effect/mask/tracker/animator reference is an id only; the silent
  fallback to a 1-based stack position is gone ("#n" stays positional). Unknown ids
  error with a hint to use "#n".
- Ids are allocated monotonically across undo/redo (Session.id_floor), so an id an agent
  saw is never reused for another object.
- Execute params expectRevision and client (parsed and stripped in Session::execute, so
  control channel, MCP and batch get them): a stale revision refuses to run; undo steps
  are tagged with the client, edit.undo {client} only undoes that client's own last step,
  edit.history.list shows each state's client.
- project.summary and editor.state include the document revision.
- Layer Style dialog Cancel restores only the target layer's styles when other drivers
  edited the project meanwhile (full rollback only when nothing else changed).

(cherry picked from commit 3689d9d)

(cherry picked from commit ca31843da3b1f50d78c4c6fe4801a05477bb304e)
…FFECTCRAFT_CONTROL_PORT, screenshot max_side

- Control server: a request that times out before the UI thread starts it is cancelled and never
  runs (reply says NOT run, notRun: true); top-level requestId answers retries from a 128-entry
  per-server reply cache; events.subscribe streams project.changed / selection.changed (<=10/s).
- A busy control port is an error shown in the status bar and on stderr; the bound port is printed.
- ui.screenshot: max_side (default 1600, 0 = full) and compressed PNG; app.revision method.
- MCP: resources.subscribe for effectcraft://document with notifications/resources/updated;
  _meta.requestId / request_id idempotent tool calls; bridge sends requestId so its resend is safe.
- effectcraft-cli: --bridge / --control without a port use EFFECTCRAFT_CONTROL_PORT, else 9877.

(cherry picked from commit d73e26b)

(cherry picked from commit d15fc75117806f8b5d0287c237152411954a78cd)
… brief discovery, useful mutation results

- prop.set / prop.addKey report clamped or reshaped values as `warnings` (value behaviour unchanged);
  engine.batch, set_property, add_keyframe and add_effect surface them
- popups accept option names; bad values list the choices; unknown paths name the failing level,
  the closest ids and the valid ids there; unknown commands / effects / tool args suggest the closest
- add_effect errors name the `values` key instead of the batch step
- params_schema infers integer/array/boolean/number types; index params documented 0/1-based;
  effect.list exposes slider ranges and popup options
- command.list / effect.list (command_list, list_commands, list_effects) gain `brief`
- effect.reorder, layer.setText and layer.addMask return what changed

(cherry picked from commit 214e1fa)

(cherry picked from commit eb527866a4761fccd1ae9cdfb45a826f47d1b52d)
- crates/ui-egui/examples/snapshot.rs runs effectcraft_ui_egui::offscreen (same CLI: --out,
  --size, --scale, --settle, --demo/--empty, --step/--script, snap and pointer steps); the
  crate dev-depends on itself with the offscreen feature so the example builds as before.
- ui.move takes down/up/button (press-and-hold drags in steps; the snapshot pointer step).
- OffscreenUi::on_session queues code on the app's session on the UI thread; prefs() reports
  the session's settings. ControlTransport gains session_prefs/on_session; Backend::with_session.
- McpServer::with_autosave works for the offscreen app: same MCP Auto-Save folder and rules,
  checkpoints run on the UI thread before each reply and at EOF. CLI accepts mcp --ui --autosave.
- Docs: agents.md, mcp.md, testing.md, control-protocol.md; test mcp_ui autosave (skips without GPU).

(cherry picked from commit 4b38615)

(cherry picked from commit c2ef548b50a18c8ad30646692308ff85fe64923b)
…ivate/var)

(cherry picked from commit 593d4db)

(cherry picked from commit e4640a8fd3fc9460b3fba152cab18cd147c39d0a)
…r id since AO2)

(cherry picked from commit cb9d6a2, crates/engine/src/commands/render_compare.rs only)

(cherry picked from commit 674f9f98036ed78230806f9b9cda1a343f84bcaf)
…" hint with its children and the layer.tree hint (storytold#263); suggest test reads effect.list's {value, label} options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAHHERF9trzfV2uSdYVBc6

(cherry picked from commit 6df5bb2)

(cherry picked from commit 16101bc642344409e49b4aa8f7751ff220808219)
- docs/agents.md: the list_commands alias row lists `brief` (agents_doc_tools_table_is_current).
- render_snapshot_and_compare_tools addresses the box as "#1": a number is a layer id since AO2.
- xtask ci / ci --affected: cargo test and nextest run with --no-fail-fast, so one run lists every
  failing crate instead of stopping at the first.
Checked: cargo test -p effectcraft-automation --lib (62 pass), cargo test -p xtask, clippy.

(cherry picked from commit 55b32f6)

(cherry picked from commit b6ffa52664ca5a92691f4c5b4c72a68890e78f3b)
(cherry picked from commit 9d7c0c0)

(cherry picked from commit 64e468bcd54a7b9151e02983b519e0faf3e0291f)
(cherry picked from commit 61b76c65813cbe6ce7399e89b8227aaec20d449c)
eliasx45 pushed a commit to eliasx45/effectcraft that referenced this pull request Oct 11, 2026
eliasx45 pushed a commit to eliasx45/effectcraft that referenced this pull request Oct 12, 2026
…trol-robustness

# Conflicts:
#	apps/effectcraft/src/control_server.rs
#	crates/automation/src/tools.rs
#	crates/engine/src/commands/batch.rs
#	crates/engine/src/commands/mod.rs
#	crates/script/src/runtime.rs
#	crates/script/src/ui.rs
#	crates/ui-egui/src/control.rs
#	docs/agents.md
…am/main

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMnX8KooFZRPByLioEuyso
@echelon

echelon commented Oct 13, 2026

Copy link
Copy Markdown
Member

Thank you for this, @eliasx45!

Thanks for the MCP work. We're holding it for the maintainers: it's 11k lines ("first of three"), and it changes project policy, relaxing the commit gate in AGENTS.md/CLAUDE.md to --affected, adding a new CI profile and loosening timing asserts by up to 10×. It also makes a bare number mean an id rather than a stack position, which breaks existing clients. Fixes needed in any case: the new commands that write files (journal.export, render.compare diff_path, render.contactSheet, the audio.analyze waveform) must be added to WRITES in confine.rs, with a test. Splitting it into smaller PRs would help a lot.

If you are not on our Discord yet, please join us: https://discord.gg/artcraft

Review on storytold#859: journal.export, help.exportRepro, file.exportTimeline, render.frame,
render.contactSheet (path, gif), render.compare (diff_path) and audio.analyze (path) were not
in WRITES, so their output paths were only checked as reads (and relative ones not at all).
They are now write-checked; render.compare's inputs (a.path / b.path) stay read-checked. Test:
confinement_covers_every_command_that_writes_a_file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d65YdNxQmjRkbXRtP2NwH
@eliasx45

Copy link
Copy Markdown
Contributor Author

Thanks, and sorry for the size again. I've split this into focused PRs, each on current main:

The dependent ones will be opened once their base is merged, so each diff stays small. Closing this one in favour of the split.

@eliasx45 eliasx45 closed this Oct 13, 2026
eliasx45 added a commit to eliasx45/effectcraft that referenced this pull request Oct 13, 2026
eliasx45 pushed a commit to eliasx45/effectcraft that referenced this pull request Oct 13, 2026
… file.exportTimeline

Review on storytold#859 (split into this PR): their output paths were only read-checked (relative ones
not at all). Test: confinement_covers_every_command_that_writes_a_file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d65YdNxQmjRkbXRtP2NwH
eliasx45 pushed a commit to eliasx45/effectcraft that referenced this pull request Oct 13, 2026
Review on storytold#859 (split into this PR): their output paths were only read-checked (relative ones
not at all). Test: confinement_covers_every_command_that_writes_a_file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d65YdNxQmjRkbXRtP2NwH
FredApps added a commit that referenced this pull request Nov 10, 2026
* AG4: xtask ci --affected

cargo xtask ci --affected [--base REV] [--dry-run] runs fmt, clippy, tests (nextest + doctests when available), layers, assets (only on asset changes) and wasm (only for affected L0-L4/web crates) for the packages a change can affect: changed files map to the owning package and to packages whose sources read them via ../ paths, expanded to reverse dependents. Workspace-wide inputs (root Cargo.toml, Cargo.lock, .cargo/, xtask/, toolchain, clippy.toml) fall back to full CI. Documented in docs/testing.md, AGENTS.md and CLAUDE.md.

(cherry picked from commit f3ca84f)

(cherry picked from commit 8a2cdcadf447eafa57ab14016beae4420f002af0)
(cherry picked from commit d8a4301)

(cherry picked from commit 36402c61ac2f7e29ecd76a6cfc89365cc2572e0a)

* AO1: fast CI profile, looser timing tests

- [profile.ci] (release without LTO, 16 codegen units); `xtask ci` runs clippy
  and tests with --profile ci instead of --release.
- Wall-clock asserts in engine memory_tick, gpu OpenGL decline and script
  socket tests keep their intent with bounds that survive a loaded machine.
- docs/testing.md and CONTRIBUTING.md mention the profile.

(cherry picked from commit b45c8a3)

(cherry picked from commit fa1ea6a107c4c1936cde89b518a05adc73f2b4b0)
(cherry picked from commit e5d5ed8)

(cherry picked from commit d2c67660c70764f9c56880a642ad7f0d004a7f92)

* AG6: journal replay repros

Bug reports become replay scripts and crash regression tests become data files:
- engine::replay: a JSON-lines repro format (start line, command steps with
  expect_error, expect queries with JSON pointer + equals, expect_no_error),
  a never-panicking runner that reports per-step ok/error and the first failure,
  and journal export (from the last project open; saves left out; size-capped).
- journal.export {path?} and help.exportRepro {path?} (not journaled).
- Crash capture: when the last-resort guard catches a panic in the outermost
  command, the journal plus that command is saved to Repros/crash-*.jsonl in the
  settings store (newest 20 kept) and the error names the file.
- Commands run by a journaled command (script steps) are no longer journaled twice.
- effectcraft-cli replay SCRIPT.jsonl [--json] [--keep-going]: exits 1 on a failed
  step, unmet expectation or panic.
- crates/host/tests/repros.rs replays every tests/repros/*.jsonl; three samples
  from past crash fixes (zero frame rate, Layer Settings with no selection,
  New Comp from Selection with hostile overlap).
- Docs: docs/agents.md "Repro scripts"; AGENTS.md: crash fix regression test =
  a .jsonl in tests/repros.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

(cherry picked from commit c38509d)

(cherry picked from commit e55b56dbf76716adfcbfe4cc773df19a74edc419)
(cherry picked from commit 96a6385)

(cherry picked from commit c59351ab3bd697f0868e41230dd883960d94a540)

* xtask: ci and ci --affected run cargo test and nextest with --no-fail-fast

One run now lists every failing crate instead of stopping at the first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qXL3GPNnY9BSFF2XoU2Yu

(cherry picked from commit e46c7debe738eca62b35bf7392ab77637f6a33ae)

* Agents: confinement write-checks journal.export, help.exportRepro and file.exportTimeline

Review on #859 (split into this PR): their output paths were only read-checked (relative ones
not at all). Test: confinement_covers_every_command_that_writes_a_file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d65YdNxQmjRkbXRtP2NwH

* #1224: handle bin-only CI targets and BOM repros without weakening timing tests

* #1224: run the full gate when nextest policy changes

---------

Co-authored-by: Elias <hakifx91@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants