- The token is passed on as the app wrote it (trimmed): craft-control's
server compares exactly and accepts any CONTROL_TOKEN of 32+ chars.
The token file is checked as a regular file before it is opened (a
FIFO would block the open).
- Allow Agent Control off counts as not allowed on the CLI's side too.
- A window route is dropped once no app accepts agents.
- A headless session with the app's agent folders ends when the person
stops letting agents in.
- The launch timeout is capped and the deadline computed without
overflow; the poll interval is kept between 1 ms and 1 s.
- The connect error names the app's window; the guide says to remove
the connection file on quit and that one process per settings folder
accepts agents; the AppImage mount is compared after resolving links.
- Tests for each, and a wider margin in the queued-start test.
- Calls queued behind a start that failed get its error instead of
starting the app again; a later call retries.
- The started process is reaped on a thread of its own.
- APPIMAGE counts only when the CLI runs from that image's mount.
- The guide names allow_agent_control as part of the listen condition.
- A watcher thread that can't start leaves agents off.
- The watcher test waits for the thread to end instead of a fixed sleep.
The ArtCraft Launcher's switch (AgentSwitch, mcp_flag, launcher_allows),
the agent settings, the connection file (agent-connection.json) and the
<id>-cli mcp side that finds the open window (Live: window while the app
accepts agents, otherwise headless or the closed-app choice; launcher
starts the app beside the CLI), behind the new feature agents. No UI
toolkit and no async runtime. Same formats as craft_automation::agents
on next, which can re-export these once the branches meet.
* image-codecs: wrap a clipboard DIB as a BMP (#778)
Add bmp_probe::dib_to_bmp (prepend the 14-byte file header, pixel offset
from the header with saturating arithmetic, try_reserve for the output)
and bmp_probe::dib_layout (V4/V5 alpha-mask BI_RGB becomes BI_BITFIELDS,
mask copy after the header). Both are ported from WordCraft's
crates/geom/src/picture.rs so it can drop its local copies. Tests compare
byte-for-byte with the originals over crafted DIBs and every prefix, and
decode wrapped results.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* image-codecs: fix DIB offsets for V2/V3 bitfields and ambiguous mask copies (#778)
- dib_to_bmp no longer adds 12 appended-mask bytes to the pixel offset for 52- and
56-byte BI_BITFIELDS headers, which carry their masks inside the header; the
decoder reads the pixels at bfOffBits, so the offset was 12 bytes too far.
- dib_layout treats 12 bytes after the header that equal the masks as an existing
copy only when more bytes follow than the pixels need, so an exact-length DIB
whose pixels equal the masks gets its copy inserted.
- dib_layout reserves the 12 bytes before changing compression or masks, so a
failed reservation returns the DIB unchanged; the mask bytes are a [u8; 12]
array, not a heap copy.
The differential tests against the WordCraft originals now exclude exactly the
52/56-byte bitfields offset and the exact-length payload cases, and assert the new
behaviour for them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* craft-mcp-server: options for apps that report argument errors as tool results (#778)
Add `Options` (default = today's behaviour) and `Server::with_options`:
- `website_url`: sent as `serverInfo.websiteUrl` at `initialize`.
- `tool_errors_as_results`: a `tools/call` whose arguments fail the schema check, or whose tool
is unknown, returns a tool result with `isError: true` and the message as text, not -32602.
- `strict_request_ids`: a request id that is not a string or number gets -32600 with a null id.
`Info` is unchanged, so existing struct-literal callers still compile. Tests cover each option on
and off, and hostile input with all options on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-mcp-server: strict request ids also apply to the missing-method error (#778)
With strict_request_ids, a message without `method` echoed an object, array or
bool id in its -32600 reply. It now answers with a null id for any id that is
not a string or number, as the later strict check does. Valid ids, absent ids
and incoming responses behave as before.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
png_probe::pixel_model reads width, height, bit depth, colour type and tRNS
presence from IHDR and the chunk headers before IDAT without inflating iCCP;
PixelModel::bytes_per_pixel and has_alpha give a caller's pixel size and alpha.
webp_probe::has_alpha reads the VP8X alpha flag, the VP8L alpha_is_used bit,
and treats plain VP8 as opaque. Differential tests compare against WordCraft's
png_chunks as an oracle.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A conservative pre-decode coefficient budget for hostile JPEG headers: the
larger of JpegInfo::held_coefficients and a whole-picture estimate over every
progressive frame header (SOF2/6/10/14, any precision, sampling clamped to
1..=4), with the costliest frame charged at the first frame's size when the
header can't be followed. held_coefficients is unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Extract PhotoCraft guide framing from 2aa88b0956; leave rounding and document ordering with callers. Add fixed-byte and hostile-prefix coverage.
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Adapt PhotoCraft parse_guides from 16941f7198, retaining signed-position semantics from 1a54384d80. Allocation-free framing preserves complete-prefix recovery.
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
* cms: keep black-only CMYK black-only across CMYK to CMYK transforms
Opt-in BlackPreserving: a colour with exactly zero C, M and Y converts to
exactly (0, 0, 0, K'), K' matching the source K-only L* in the destination
(both ramps sampled at construction with the transform's intent and BPC).
Transform itself is unchanged.
Adapted from icccer (MIT, same author) black_preserve.rs at 08ca16ab.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* cms: map black past the destination maximum to exactly K = 1 between samples
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* cms: README says the K-ramp check is sampled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: KenM76 <KenM76>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* cms: Coated FOGRA39 separates like the reference application
Coated FOGRA39 gave a saturated blue about 97 % magenta instead of about
75 %, a mid grey about 30 % black instead of about 20 %, and Saturation
reused the Perceptual table.
- GamutMapping::Oklab (opt-in, CmykParams::mapping): out-of-gamut colours
take the closest colour the printer reaches in Oklab, lightness and hue
weighted above chroma and more so the further outside the colour is;
black is generated from the clipped colour. Perceptual and saturation
map the v4 perceptual reference black onto the device black for
neutrals; perceptual compresses Oklab chroma, saturation gets its own
table.
- CmykParams::gcr_linear: a linear part of the black generation curve.
- Legacy (the default) keeps the Photocraft profile's tables: its
generator output is byte-identical to main's.
- The FOGRA39 built-in is regenerated with the new mapping and curve.
For storytold/photocraft#14267.
* cms: Oklab round-trip test tolerates the published matrices' precision
* cms: FOGRA39 keeps in-gamut round trips within the existing limits
The first version broke in_gamut_lab_round_trips (max 7.7 ΔE00): dark
colours got too little black to be reached, and clipped nodes next to
light tints and dark colours differed from their in-gamut neighbours, so
interpolation spoiled colours between them.
- Black generation is a curve of points (CmykParams::gcr_curve) instead
of a linear term: red, mid grey and dark colours each get the black
the reference and the round trip need.
- The clip keeps the plain separation when that is closer, tries the
separation's black as well, and blends to the separation near paper
white (L* 85 to 95).
* prepress: follow the Coated FOGRA39 round trip the new profile gives
---------
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
* zip: retain legacy Zstandard method compatibility
Ported from Craft Anything 29badae7c9280fdf4c24795927bf3a91f51694c6, including the bounded-reader regression. Firmware scanner policy remains app-owned.
* Record source of legacy ZIP Zstandard compatibility
* Document both ZIP Zstandard method identifiers
---------
Co-authored-by: RRFZ <247457381+Plastic-time@users.noreply.github.com>
* sourcemap: Craft Anything
Port parser/model/lookup core from Craft Anything f64ae3bf3c8863a982af1304e06de20653803968. Annotation and data URL helpers stay app-owned.
* sourcemap: Format parsers refuse or flag input they used to half-read (#652)
Port parser/model/lookup core from Craft Anything 15de36614b2d1039ed68bffcc36e0e92053b3f12. Annotation and data URL helpers stay app-owned.
* sourcemap: Keep source lookups inside their declared index map section (R3.12) (#1130)
Port parser/model/lookup core from Craft Anything a205f1d1571cbce001c546f4753943a569d7a7fe. Annotation and data URL helpers stay app-owned.
* sourcemap: Decode source map position deltas within the format's 32-bit range (R3.12) (#1133)
Port parser/model/lookup core from Craft Anything f5aad102b048cb6f01a8a7b90dcf2d7a7a395567. Annotation and data URL helpers stay app-owned.
* sourcemap: Look up source mappings without scanning every segment on a generated line (R3.12) (#1139)
Port parser/model/lookup core from Craft Anything 1fab01712915e744ea042154ff81013a19c9bfc5. Annotation and data URL helpers stay app-owned.
* sourcemap: Preserve source map URL roots when joining relative sources (R3.12) (#1332)
Port parser/model/lookup core from Craft Anything 7fd244005da7a37a6389ac09643fb759420f72a2. Annotation and data URL helpers stay app-owned.
* sourcemap: Bound generated source-map lines across inline sections (R3.12) (#1533)
Port parser/model/lookup core from Craft Anything 68ba5239a85c7f6e842c2a7a9c0254f125eaa917. Annotation and data URL helpers stay app-owned.
* sourcemap: Reject source map mappings with missing source or name entries (R3.12) (#1526)
Port parser/model/lookup core from Craft Anything 0ba60eb4e24d1c280db93304ee53a79393f41610. Annotation and data URL helpers stay app-owned.
* sourcemap: Apply source map root prefixes before interpreting source paths (R3.12) (#1680)
Port parser/model/lookup core from Craft Anything 500a09a217b9a6ce03b2c93035167ce983a83897. Annotation and data URL helpers stay app-owned.
* sourcemap: Bound expanded source-map source lists before building them (R3.12) (#1689)
Port parser/model/lookup core from Craft Anything 22c44d01d271c49187104802459085f273f855f0. Annotation and data URL helpers stay app-owned.
* sourcemap: Refuse source maps with more entries than the parser keeps (R3.12) (#1703)
Port parser/model/lookup core from Craft Anything ba83da2bc567611d0c8aef124c2c3d1ba03ade58. Annotation and data URL helpers stay app-owned.
* sourcemap: Count source-map sections, check skipped values and keep refused maps' sources uncertain (R3.12) (#1705)
Port parser/model/lookup core from Craft Anything ab79ec87a4da58d8965b6d4f95b751464ba6e999. Annotation and data URL helpers stay app-owned.
* sourcemap: Keep the sources of a source map refused for bad mappings or section offsets (R3.12) (#1717)
Port parser/model/lookup core from Craft Anything 12aad97757d692e8dbc8af03ceb60c6b44f53339. Annotation and data URL helpers stay app-owned.
* sourcemap: Mark sources of unread external source-map sections uncertain (R3.12) (#1767) (#1767)
Port parser/model/lookup core from Craft Anything d56fa23860f1fd20249fb945e94fdf3fcfc83a2d. Annotation and data URL helpers stay app-owned.
* sourcemap: List sources from the section maps of an indexed source map (R3.12)
Port parser/model/lookup core from Craft Anything 0b1a643944e119bc4d580de94b287ab257ab91c5. Annotation and data URL helpers stay app-owned.
* sourcemap: retain entry_budgets regression coverage
Port crates/formats/tests/sourcemap_entry_budgets.rs from Craft Anything, latest source change 12aad97757d692e8dbc8af03ceb60c6b44f53339. Only crate imports adapted.
* sourcemap: retain external_sections regression coverage
Port crates/formats/tests/sourcemap_external_sections.rs from Craft Anything, latest source change d56fa23860f1fd20249fb945e94fdf3fcfc83a2d. Only crate imports adapted.
* sourcemap: retain inventory_budgets regression coverage
Port crates/formats/tests/sourcemap_inventory_budgets.rs from Craft Anything, latest source change 22c44d01d271c49187104802459085f273f855f0. Only crate imports adapted.
* sourcemap: retain line_budgets regression coverage
Port crates/formats/tests/sourcemap_line_budgets.rs from Craft Anything, latest source change 68ba5239a85c7f6e842c2a7a9c0254f125eaa917. Only crate imports adapted.
* sourcemap: retain root_prefix regression coverage
Port crates/formats/tests/sourcemap_root_prefix.rs from Craft Anything, latest source change 500a09a217b9a6ce03b2c93035167ce983a83897. Only crate imports adapted.
* sourcemap: retain section_columns regression coverage
Port crates/formats/tests/sourcemap_section_columns.rs from Craft Anything, latest source change 15de36614b2d1039ed68bffcc36e0e92053b3f12. Only crate imports adapted.
* Expose bounded Source Map v3 core with retained regression tests
---------
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: BFlat <bombayapirat@gmail.com>
Co-authored-by: Afloat <ShuffleMonkey@163.com>
Co-authored-by: RRFZ <247457381+Plastic-time@users.noreply.github.com>
Co-authored-by: Nicolas Bohn <dev@nicolasbohn.de>
Co-authored-by: Alex Joaquim Pereira <alexpereira1781@gmail.com>
Pushes to main cancel the Workspace run they supersede, as pull requests
already do; the newest push's run tests everything before it. On 16 Nov main
had 144 pushes, each a three-OS run that could not be cancelled, which is much
of what fills the org's macOS runners. Release tags, manual runs and a new
scheduled run every 6 hours keep a group of their own and always finish, and the
scheduled run saves the caches (the gate already saves on scheduled runs of the
default branch). scripts/test-workspace-concurrency.py checks the new policy.
The per-crate workflows, which no longer save caches, cancel superseded runs on
every branch, main included.
workspace.yml passes select-os to the gate: a pull request runs the macOS and
Windows legs when a changed file is in a crate with platform cfg code or in a
crate that depends on one, is part of the build setup (workflows, Cargo.lock,
the root Cargo.toml, toolchain, .cargo, .config), or lies outside the crates
and is not documentation. 37 of 177 crates have platform code and 57 are
affected with their dependents; 39 of the last 80 merged pull requests would
have run Linux only, without the macOS queue. The full-ci label runs every leg
from the next push or manual run. Pushes to main run every leg.
workspace.yml moves fmt, both clippy runs and the workflow script checks into
the gate's lint-command, so each OS gets a lint (<os>) leg running beside its
gate (<os>) leg. Clippy (about 6 min on Linux and 11 on Windows) no longer runs
before the test build. scripts/test-workspace-tests.py checks both blocks.
The gate restores .test-inputs/photocraft/corpus before its setup, keyed on
scripts/ci-test-inputs.sh (which holds the PhotoCraft pin), and the setup uses a
restored corpus as it is. A hit skips the PhotoCraft checkout and its xtask
build: 2:17 of Windows setup, about 1:00 on Linux and macOS. Uses
craft-common-actions' new cache-paths, cache-key and cache-key-files inputs.
The Workspace gate already runs fmt, both clippy runs and the tests of every
crate on Linux, Windows and macOS. The per-crate workflows drop those steps and
keep their own checks: wasm32 builds and tests, no-default and single-feature
clippy and tests, cross-target clippy, docs, release and sample tests,
--ignored tests, ffmpeg oracle tests, the Language-data proofing builds, the PDF
Unicode fixtures, read-only contract and vendored backends. All of them run on
Linux. docpath.yml, print.yml, i18n.yml and ui.yml had no check of their own and
are removed.
They also stop caching dependencies: about 25 rust-cache entries no longer
compete with the gate's for the repository's 10 GB, which the gate's main run
missed on every OS. The data caches (Opus vectors, CRW samples) stay.
CARGO_PROFILE_DEV_DEBUG=0 on Windows, as PhotoCraft's Windows legs do: writing
PDBs for every test binary is a large part of the Windows build. The gate
writes windows-env after its dev-debug default, so the Linux and macOS legs keep
line-tables-only.
Every Workspace leg runs nextest with --all-features and the doctests with
cargo test --doc. The default-feature test run is gone: it added exactly four
tests, all in craft-image-codecs and craft-text (feature-off behaviour), so
those two crates run their tests with default features as well. The
default-feature compile stays covered by the first clippy run.
The resource groups from craft-libs#2058's audit move into the ci profile with
platform = 'cfg(unix)', so Linux and macOS share one profile and Windows keeps
the groups it already passes with. No separate example build: nextest builds
examples as cargo test does, and clippy --all-targets checks them.
scripts/test-workspace-tests.py follows the single command set.
craft-testkit's hostile hammer reads CRAFT_HOSTILE_DIVISOR=N: the unmodified
seed, every N-th truncation and 1/N of the rounds. hostile::divisor() gives the
same value to sweeps written without the hammer; craft-image-codecs' TIFF zoo
and malformed-header sweeps use it, with a different offset per input so the
inputs together still reach every position. Proptests without their own case
count read proptest's PROPTEST_CASES.
The Workspace gate and the media, audio, video and PDF workflows set
CRAFT_HOSTILE_DIVISOR=8 and PROPTEST_CASES=64. The longest of these tests
(craft-media's MXF hostile input, 1,310 s on Windows; craft-pdf's crypt
proptests, up to 257 s; the image-codecs sweeps, 140-162 s) drop to about an
eighth or a quarter. nightly.yml runs the whole workspace on Linux without
either variable, so every case still runs once a day.
The gate's test-input setup moves to scripts/ci-test-inputs.sh, shared by both
workflows; it uses a corpus that is already present.
* har: preserve source reader history
Port Craft Anything crates/formats/src/har.rs from f64ae3bf3c8863a982af1304e06de20653803968.
* har: preserve source reader history
Port Craft Anything crates/formats/src/har.rs from cb0bb9d8fa4536ba44ef2c86f5ed759b879cc2d3.
* Expose shared HAR reader with explicit input admission
---------
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: BFlat <bombayapirat@gmail.com>
* tar: port old GNU sparse extension traversal from Craft Anything
Source: storytold/craft-anything#1973, 8ea2ec66a1bc80f0420f3695baac877a0cb9b9a5. Retains non-extractable sparse member kind and regression tests.
* tar: preserve GNU CRC symlink checksum compatibility
Source: storytold/craft-anything#1984, b226a475f7dce9710e3af7a069386fe7a9720df7; preserves nonzero checks and regular-file checksum validation.
* tar: apply valid PAX sizes before legacy member size fields
Source: storytold/craft-anything#2007, d29465c20b0d570ea4973be512a0cb4e212bb60f; metadata records still retain their own framing.
* Record provenance of current TAR and CPIO compatibility fixes
---------
Co-authored-by: RRFZ <247457381+Plastic-time@users.noreply.github.com>