Commit Graph
3693 Commits
Author SHA1 Message Date
Dylan M. Taylor b6020ec2fc Merge pull request #2032 from r31lin/fix/preview-reader-non-zip
document-bundle: turn a non-zip file away after four bytes in read_preview_from
2026-11-18 00:00:13 -05:00
FredApps baa619f016 Merge pull request #2120 from FredApps/ci/full-validation-778
ci: add opt-in uncapped three-platform full validation
2026-11-18 11:06:55 +07:00
William Dunn ec65838487 craft-suite-account: provider-neutral suite account list and keychain token store (#665)
* craft-suite-account: the suite account list and keychain token store

Carries crates/suite-account over from the cut-down craft-libs#160 branch. This follows RFC-0025 (storytold/craft-contrib#35).

service.rs is removed. It was the CollabCraft device-flow client. Its Service, Flow, Identity, Polled and SignedOut types went with it. Store::sign_out is also gone. The provider adapter now owns ending a session at the deployment. Store::discard and Store::forget cover the local half that stays here.

Every remaining CollabCraft-specific word is reworded to a provider-neutral description. The one serde alias and the one test fixture name that spelled the old provider out are gone too.

Adds a generation field to Account, per RFC-0025's cross-app lifecycle guarantees. A sign-in bumps it. Store::update_token refuses a write made against a stale generation. A fuller tombstone for the removal case is left as a TODO referencing the RFC, documented on Accounts::remove.

Also drops one unused restrict() function found while verifying clippy -D warnings on Linux. It was pre-existing dead code. The unix write path already sets the file mode at creation.

* craft-suite-account: lock list mutations, make generations monotonic across removal

Fixes the three review gates on PR #665 (rev 2e9c84f).

Every mutation of accounts.json now goes through an OS-level file lock. The
lock is a sibling .lock file taken with std::fs::File::try_lock and a
bounded retry, matching the mechanism craft-ai-integrations' store already
uses for the same problem. Two processes each completing 100 sign-ins into
one folder used to leave 101 rows on file. Both the real two-process and
two-thread conformance tests now land all 200 rows.

A removed account now leaves a tombstone holding its last generation. A
re-add continues past that tombstone. It never restarts at 0.

update_token checks the generation twice. The first check runs before the
keychain is touched at all. An already-stale caller never overwrites a
newer token. The second check runs under the lock, after the keychain
write. It catches a removal that landed in the window that write opened. A
tombstoned account answers StaleGeneration. It never answers Unknown. The
second check also removes the token it just wrote, under the same lock,
when the account turns out to be gone. A refresh racing a discard can then
resurrect neither the row nor the keychain entry. discard itself now
removes the keychain entry inside the same lock hold as the list write.

The module docs now name the chosen keychain-versus-list write order for
each operation. They also name the state a crash in that window leaves
behind for the next reader to repair, per RFC-0025 guarantee 1. A new test
simulates the window update_token opens between its keychain write and its
generation commit.

The conformance tests are adapted from the maintainer's review-reproduction
gist for this crate. Forget racing a refresh is the one gist case left out.
forget is deliberately generation-agnostic and local, per RFC-0025
guarantee 4. That fix would be a separate, broader change than these three
gates.

* craft-suite-account: close the review gaps CodeRabbit found in the rebase

Six fixes. Generation bumps in sign_in, update_token and remove_with_tombstone
now use checked_add. A bump at the maximum refuses with GenerationExhausted.
It never wraps back to a small number a stale caller could pass again.
accounts::write now refuses a list that would serialize
past MAX_BYTES before touching disk. An oversized display name can then
never brick the list for every later reader. NewAccount.linked now persists
onto Account. It used to be silently dropped at sign_in. update_token's
stale-write cleanup now only removes a keychain token that still matches the
token it wrote itself. A concurrent sign-in's token for the same handle
survives that cleanup now. Store::forget and Store::has_token now return
Error::Isolated before touching the keychain, matching every other mutator.
migrate::adopt re-reads the legacy file right before deleting it and skips
the delete when something rewrote it since. The read buffers are wrapped in
Zeroizing too. A parsed-but-unused token copy no longer outlives the one
Secret already covers.

Three findings were not valid against this code and are not changed. The
torn-state window CodeRabbit flagged in update_token's generation commit is
the same crash recovery the module docs already describe. The existing
torn-state test already exercises it. Forcing the keychain write under the
same lock as two concurrent sign-ins for one handle would reintroduce the
cross-process deadlock the lock module exists to avoid. A failed discard
already reports its own error. A refresh that re-establishes a full session
afterward is recovery. It is never a silent mismatch.

* craft-suite-account: apply cargo fmt to the review-gap fixes

cargo fmt wraps the long struct literals and assert calls the previous
commit added. The content is unchanged.

* craft-suite-account: factor the race test's join-handle type out

clippy::type_complexity flagged the four-deep generic on handle_slot in the
stale-refresh-vs-re-sign-in test. A type alias clears it without changing
the test.

* craft-suite-account: flush before the rename, re-check the token under the lock

Two review findings. The temporary file is now flushed with sync_all before the rename, keeping the crash story the doc tells. A discard racing a sign-in could delete the token the sign-in had just written and the sign-in still reported Ok. The lock closure re-checks the keychain right before committing the row and writes the token again when something else changed it.

* craft-suite-account: sync the parent directory after the rename

The temp-file flush persists the bytes. The rename changes a directory entry with its own durability on Linux. Power loss after write returned could otherwise resurrect the older list and lose a tombstone a discard already reported written. A sync failure now reports an error, never success. Unix only, since directories do not open for sync elsewhere.

* craft-suite-account: keep activation out of refresh, require an explicit format marker, stop logging paths

Three fixes. update_token no longer calls Accounts::put for its row commit.
That call always makes the written row active. Refreshing an account in
the background used to silently steal the selection from whatever account
the person had actually picked. A new Accounts::refresh_in_place replaces
the row without touching active. put stays exactly as it was for sign_in
and set_active, the two calls meant to change it.

Accounts::format no longer carries #[serde(default)]. Every other field
still does. A missing format key used to default through Accounts's own
Default impl. That impl answers FORMAT. A file that never declared a
format therefore read as exactly the one format this build understands.
read now also rejects any parsed format that is not exactly FORMAT. The
old check only rejected a newer one; format 0 passed it the same way a
missing key did.

accounts::read's error messages now name only the file, never the full
path. Store::shared logs a read failure at warn. The path sits under the
user's profile folder.

restrict on Windows stays a no-op. Its comment now states the guarantee's
real scope. The default per-user config folder gives it. A portable
install or an ARTCRAFT_SUITE_DIR override does not. A real fix needs the
Win32 authorization API. Every binding for it is an unsafe fn. This
workspace forbids unsafe_code outright. That part of the finding is
refused in part. Closing it for real needs a maintainer-approved exception
for this one call site, or a vetted dependency wrapping that API safely.
Either is a decision for its own PR.

* craft-suite-account: move update_token's keychain write inside the lock

skylartaylor's finding. update_token used to write the keychain, then take
the list lock. A newer sign-in, or a discard followed by a re-add, could
land for the same handle in between. The second check under the lock
already answered StaleGeneration in that case, but the earlier write had
already landed over the newer session's token. shared() then served the
new session's row with the stale refresh's bytes. Deleting the stale token
on its own was never going to fix this; that still loses the newer
session, it only changes which bytes go missing.

The keychain write now happens only inside the lock, in the second
generation check's own success arm, immediately before the row commits.
The first, unlocked check still exists, purely to reject an already-stale
caller before it ever takes the lock; it writes nothing. Every losing
path, a newer sign-in, a discard, a discard followed by a re-add, now
answers with an error having never touched the keychain at all. There is
nothing stale left in it to clean up or weigh against a winner's own
token. Store::remove_token_if_still is gone. Its two call sites in the
losing branches never write a token to begin with now. Nothing is left
for it to conditionally remove.

This keeps the lock discipline the module docs describe: the write is
conditional on the row commit going ahead, the same shape as discard's own
keychain call inside its lock hold and sign_in's existing re-check, never
an unconditional call made regardless.

Two deterministic tests reproduce both orderings skylartaylor named, each
proving the fix against the pre-fix code before passing against the fix:
a_refresh_racing_a_newer_sign_in_for_the_same_handle_never_overwrites_its_token
and a_refresh_racing_a_discard_and_re_add_for_the_same_handle_never_overwrites_its_token.
Both hold the real accounts lock on a background thread standing in for
the winning operation. They release it only after the refresh's own
unlocked first check has had the chance to read the pre-race state. Both
then assert shared() serves the winning session's own token afterward.

The crate's own pre-existing hook-based race tests could no longer reach
the window they were built for, since that window no longer has a
keychain call in it to hook. tests/review_repro.rs's two Hooked-based
tests are rewritten onto real threads racing on a Barrier instead, the
same device the file's own two-thread sign-in test already uses. The lock
makes their outcomes hold for either ordering now. A hook could only ever
force one. The now-unused Hooked harness is removed along with them.
src/tests.rs's own matching hook-based test is replaced outright by the
two new ones above. That covers its ground and the newly found gap
together.

* craft-suite-account: pin the race tests' second-check window

skylartaylor's review note on PR 665: the two update_token race tests in
src/tests.rs send their release signal and then immediately call
update_token, so the competing sign-in or discard-and-re-add can finish
before the refresh's first, unlocked check ever runs. A pre-fix build
could then pass the same assertions by rejecting early at that first
check, never reaching the second, locked one the tests are named for.

Adds race_hook, a test-only pause point inside update_token between its
two checks. A test arms it, starts the refresh, waits for the refresh to
signal that its first check has read the pre-race generation, runs the
competing operation to completion, then releases the refresh into its
second check. Both race tests are rewritten onto this instead of holding
the real accounts lock on a background thread, which left the same gap
skylartaylor found: the lock never blocked the refresh's unlocked first
read, only its second, locked one.

* craft-suite-account: make the race test hook per store instead of process wide

CI runs this crate's suite with the default, parallel test runner. The
hook update_token pauses on between its two generation checks lived
behind one process wide slot, so when the Workspace gate's parallel run
landed both race tests at the same time, one test's release on that
slot answered the other test's pause: the pinned ordering collapsed,
the refresh ran ahead of the competing write, its second check legitimately
matched, and update_token returned Ok where the test expected
StaleGeneration. Reproduced on the lab build host with the crate's
default threaded test run; failed on the first attempt, matching the
CI failure exactly.

The hook now lives on the Store instance, one per store, armed only on
the exact store a given test built. A concurrent test's own store keeps
its own hook, so there is nothing left for two tests to cross no matter
how the runner schedules them. Checked the rest of the suite for the
same kind of shared state: every other test builds its own tempdir and
its own in-memory keychain, and the two-process test spawns its own
child with --test-threads=1 for that child's own run, so none of them
depend on the parent suite running single threaded.
2026-11-17 21:56:16 -06:00
Dylan M. Taylor 71579152ff Separate strict native preview sniffing from generic ZIP compatibility 2026-11-17 22:46:28 -05:00
FredApps 7d06803a32 fix(doc-binary): use canonical MD4 BLIP identifiers (#2153) 2026-11-18 10:41:59 +07:00
batistalucasv c0edd96888 craft-html, craft-flow: preserve table structure, colgroup widths and vertical merges (#1785) (#1802)
* craft-html, craft-flow: preserve table structure, colgroup widths and vertical merges (#1785)

* craft-html: address CodeRabbit review feedback on vmerge and colgroups (#1785)

* craft-html: precompute grid column offsets in table export

* craft-html: preserve fully covered rows during table import (#1785)

* craft-html: resolve merge conflict artifacts and unclosed delimiter in tests (#1785)

* craft-flow, craft-html: validate matching spans on vmerge and preserve leading grid columns (#1785)
2026-11-17 21:31:10 -06:00
FredApps a3784a72ed test(ci): keep full gate source out of shell harness 2026-11-18 03:16:31 +01:00
FredApps c52dc70c6c Merge pull request #2083 from FredApps/test/mxf-hostile-scheduling-778
test(media): schedule MXF hostile seeds independently
2026-11-18 09:15:30 +07:00
FredApps 7b8c1eccea Merge pull request #2041 from Terra854/codex/svg-integrity-hooks-review21
Share checked SVG image validation and DOM reuse
2026-11-18 09:15:11 +07:00
Dylan M. Taylor 8cbe36c113 Merge pull request #2070 from storytold/feat/evm-inspection
Share read-only EVM bytecode and compiler metadata inspection
2026-11-17 20:42:58 -05:00
Dylan M. Taylor 17f1b5d20f Keep uncertain EVM fallback and jump payability unknown 2026-11-17 19:45:22 -05:00
FredApps 29ce80e136 ci: register full validation in generated actions lockfile 2026-11-18 01:44:16 +01:00
Dylan M. Taylor a784f2e716 Merge main while retaining EVM and XFDF provenance 2026-11-17 19:41:50 -05:00
FredApps 373d0e1683 test(ci): use Git Bash explicitly on Windows 2026-11-18 00:07:54 +01:00
aiongg d6b5b16bbb Merge pull request #2113 from aiongg/ci-speed-b
ci: lint leg, cached corpora, platform legs only when needed, superseded main runs cancelled
2026-11-17 17:57:30 -05:00
FredApps 6589b3c83e ci: add opt-in uncapped three-platform full validation 2026-11-17 23:51:18 +01:00
Dylan M. TaylorandBrandon Thomas e5f00f5bf6 Extract bounded XFDF field-value reader (#2056)
* Extract bounded XFDF field-value reader

* Record retained XFDF source contributor provenance

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-11-17 23:47:23 +01:00
Dylan M. Taylor 5cd16f2b9a Merge pull request #2107 from storytold/cutover/vectordrawable-depth
vectordrawable: bounded depth option and iterative XML writer
2026-11-17 17:43:09 -05:00
Dylan M. Taylor 2e686d9668 Merge pull request #2110 from storytold/dot/jpeg-tokenless-20261117
jpeg: tokenless two-pass encoding with MCU-row scratch
2026-11-17 17:41:57 -05:00
aiongg 019d54bfff ci(jpeg): the uncached wasm check gets a 20-minute limit 2026-11-17 22:07:49 +00:00
Dylan M. Taylor 65e38419d7 testkit: share the sampled-damage corpus with WASM and Java class 2026-11-17 16:44:09 -05:00
Dylan M. Taylor dfdc68c46b Merge pull request #2093 from storytold/dot/psd-guides-v1-20261117
psd: share legacy Grid and Guides record framing
2026-11-17 16:35:45 -05:00
aiongg 1e446ebe05 Merge pull request #2092 from aiongg/ci-speed-a
ci: faster Workspace gate: nextest everywhere, one test feature set, fuzz caps with a nightly full run, per-crate workflows without duplicates
2026-11-17 16:28:16 -05:00
Dylan M. Taylor 6cf64e21b4 Merge upstream main into review-2070 2026-11-17 16:14:19 -05:00
d118983bf9 Extract Java class reader and JVM opcode decoder (#2048)
* Port Java class source: Craft Anything

Source: storytold/craft-anything@f64ae3bf3c

* Port Java class source: Find class usage in multidimensional object arrays (R0.5) (#437)

Source: storytold/craft-anything@ffe15c9165

* Port Java class source: More format parsers keep to their declared lengths and refuse impossible values (#722)

Source: storytold/craft-anything@b9ca099903

* Port Java class source: Address the parser review findings from #722 (#766)

Source: storytold/craft-anything@eab6a0f01b

* Port Java class source: Read JVM method parameters containing parentheses in class names (R3.12) (#1342)

Source: storytold/craft-anything@fb4c437fe6

* Port Java class source: Reject Java constants that exceed the constant-pool slots (R3.12) (#1373)

Source: storytold/craft-anything@1c4f233f08

* Port Java class source: Validate JVM switch tables before allocating decoded pairs (R3.12) (#1503)

Source: storytold/craft-anything@b40c56ef5c

* Port Java class source: Reuse constant-pool names while reading Java attributes (R3.12) (#1549)

Source: storytold/craft-anything@76fcdaadb7

* Port Java class source: Trace JVM bootstrap dependencies at their bytecode use sites (R3.12) (#1648)

Source: storytold/craft-anything@c5e524dd08

* Port Java class source: Reject impossible JVM array allocation operands (R3.12) (#1675)

Source: storytold/craft-anything@f04d7456e0

* Port Java class source: Report truncated Java class attribute tables (R3.12)

Source: storytold/craft-anything@420552ff74

* Expose neutral Java class API and retain checked reader and synthetic fixtures

* Retain Java regression: java_array_operands

Source: storytold/craft-anything@f04d7456e0

* Retain Java regression: java_attribute_names

Source: storytold/craft-anything@76fcdaadb7

* Retain Java regression: java_constant_pool_slots

Source: storytold/craft-anything@1c4f233f08

* Retain Java regression: java_invoke_operands

Source: storytold/craft-anything@eab6a0f01b

* Retain Java regression: java_linkage_references

Source: storytold/craft-anything@c5e524dd08

* Retain Java regression: java_truncated_attributes

Source: storytold/craft-anything@420552ff74

* Retain Java regression: java_wide_opcodes

Source: storytold/craft-anything@b9ca099903

* Register Java class reader and retain source regression coverage

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.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>
2026-11-17 16:13:18 -05:00
Dylan M. Taylor 971e8ad8f8 jpeg: add tokenless two-pass baseline encoding 2026-11-17 16:00:45 -05:00
Terra854 6815dd6b7c Find JPEG sampling headers after marker padding 2026-11-18 04:58:02 +08:00
Dylan M. Taylor 0ac2de5255 Deduplicate JUMP destination resolution in the payability walkers 2026-11-17 15:49:47 -05:00
Dylan M. Taylor 1d5255e07f vectordrawable: bound configurable XML depth with iterative writing 2026-11-17 15:48:26 -05:00
Terra854 6413cbb806 Guard SVG JPEG validation on panic-abort builds 2026-11-18 04:34:32 +08:00
Terra854 408ab93329 Preserve SVG siblings and share embedded-image validation 2026-11-18 04:01:51 +08:00
Dylan M. Taylor 8d5c939e20 psd: use fixed-size guide chunks for strict clippy 2026-11-17 14:46:32 -05:00
Martin BallandClaude Sonnet 5.5 93dac78c93 craft-image-codecs: wrap a clipboard DIB as a BMP (dib_to_bmp, dib_layout) (#2062)
* 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>
2026-11-17 14:45:56 -05:00
Martin BallandClaude Sonnet 5.5 3e82d1719c craft-mcp-server: options for apps that report argument errors as tool results (#2061)
* 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>
2026-11-17 14:45:52 -05:00
Dylan M. Taylor deda581e53 Merge remote-tracking branch 'upstream/main' into review-2070
# Conflicts:
#	Cargo.toml
2026-11-17 14:29:26 -05:00
Martin BallandClaude Opus 5.5 1928693fbb image-codecs: header-only PNG pixel model and WebP alpha probes (#778) (#2064)
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>
2026-11-17 14:27:53 -05:00
Martin BallandClaude Opus 5.5 ea02182945 image-codecs: add jpeg_worst_case_coefficients (#778) (#2063)
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>
2026-11-17 14:27:49 -05:00
aionggandDylan M. Taylor d55beb8f61 psd: share legacy guide header and record encoding
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>
2026-11-17 14:23:06 -05:00
Brandon ThomasandDylan M. Taylor e1d883e444 psd: share legacy guide record prefix decoding
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>
2026-11-17 14:23:06 -05:00
7107fb8daf cms: keep black-only CMYK black-only across CMYK → CMYK transforms (#2029)
* 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>
2026-11-17 14:14:51 -05:00
Khawar Zamman WaniandDylan M. Taylor 872e001552 cms: Coated FOGRA39 separates like the reference application (#2028)
* 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>
2026-11-17 14:14:36 -05:00
Dylan M. TaylorandRRFZ fb1d7f3681 zip: preserve legacy Zstandard method 20 in lenient reads (#2015)
* 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>
2026-11-17 14:14:21 -05:00
5039e49ab6 Add shared WebAssembly inspection and validation reports (#2044)
* wasm: Craft Anything

Port Craft Anything f64ae3bf3c8863a982af1304e06de20653803968.

* wasm: Compare WebAssembly exported tag parameter types (R0.5) (#441)

Port Craft Anything fa4aae2e79198ece843a876512172bfb10d902e3.

* wasm: Count all local declaration groups in a WebAssembly function (R3.12) (#1125)

Port Craft Anything ad4d57d4ae5993e157a280b4237a0aa8a7a7fdb7.

* wasm: Read WebAssembly debug URLs as length-prefixed UTF-8 names (R3.12) (#1126)

Port Craft Anything 07a5f8686f63bff6d0efe19af56bf129e0fee9f7.

* wasm: Compare WebAssembly body counts with all declared functions (R3.12) (#1129)

Port Craft Anything 58402ab226ce1a417d250e789dce9a0613158567.

* wasm: Bound WebAssembly metadata across repeated custom sections (R3.12) (#1390)

Port Craft Anything 37ec5557f07eff39050b0bd448a4a52d155d130e.

* wasm: Bound WebAssembly strings expanded through type and name references (R3.12) (#1540)

Port Craft Anything ada52c6cce7979c386460e80e69c95cf4b82dbda.

* wasm: Report top-level WebAssembly component sections (R3.12)

Port Craft Anything 7d60ac9f896fc91cb623bd1666c4424e6ce944f9.

* wasm: retain component_layout regression tests

Source crates/formats/tests/wasm_component_layout.rs at 7d60ac9f896fc91cb623bd1666c4424e6ce944f9; imports adapted only.

* wasm: retain custom_inventory_budget regression tests

Source crates/formats/tests/wasm_custom_inventory_budget.rs at 37ec5557f07eff39050b0bd448a4a52d155d130e; imports adapted only.

* wasm: retain reference_bytes regression tests

Source crates/formats/tests/wasm_reference_bytes.rs at ada52c6cce7979c386460e80e69c95cf4b82dbda; imports adapted only.

* Expose shared WebAssembly inspection and retained hostile-input tests

* Split WASM section inspection and reuse regression encoders

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
Co-authored-by: Afloat <ShuffleMonkey@163.com>
Co-authored-by: RRFZ <247457381+Plastic-time@users.noreply.github.com>
2026-11-17 14:13:51 -05:00
dcda149a8a Add bounded Source Map v3 parser and lookup core (#2037)
* 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>
2026-11-17 14:13:02 -05:00
Dylan M. Taylor 99e3367691 Merge current main preserving PCAP and EVM workspace registrations 2026-11-17 14:10:25 -05:00
Dylan M. Taylor 17329ac50a Recognize extended metadata maps and track duplicate selector dispatch 2026-11-17 14:09:45 -05:00
aiongg c0421c7fc6 ci: cancel superseded main runs; a scheduled full run saves the caches
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.
2026-11-17 19:09:20 +00:00
aiongg a1398a3b61 ci: macOS and Windows legs on a pull request only when it can change them
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.
2026-11-17 19:09:20 +00:00
aiongg 9bd6416966 ci: clippy and fmt on a lint leg beside each test 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.
2026-11-17 19:09:20 +00:00
aiongg 688c5beba2 ci: cache the PhotoCraft test corpora
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.
2026-11-17 19:09:20 +00:00