diff --git a/.aegis-baseline.tsv b/.aegis-baseline.tsv index 97ec6a73..16c2ae99 100644 --- a/.aegis-baseline.tsv +++ b/.aegis-baseline.tsv @@ -24,42 +24,28 @@ # points, and the GitHub release, asset, run and check identifiers # quoted in the release receipts; this repository holds no tax # identifiers. -australian-tfn ./docs/TASKS.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 -australian-tfn ./docs/release/ARTIFACT-MATRIX.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 9 -australian-tfn ./docs/release/CERTIFICATION.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 australian-tfn ./docs/release/EXECUTION-BOARD.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 3 -australian-tfn ./docs/release/EXECUTION-BOARD.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -australian-tfn ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 -australian-tfn ./docs/release/EXECUTION-BOARD.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 -australian-tfn ./docs/release/LINUX-COMPAT.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +australian-tfn ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 2 australian-tfn ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 australian-tfn ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 australian-tfn ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 australian-tfn ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 australian-tfn ./docs/research/fireworks-png-nodes.md 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 australian-tfn ./docs/tasks/T27-19-draft-release-test-tag.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 -australian-tfn ./docs/tasks/T27-19-draft-release-test-tag.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -australian-tfn ./docs/tasks/T27-19-draft-release-test-tag.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +australian-tfn ./docs/tasks/T27-52-source-archive.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 australian-tfn ./xtask/src/aegis.rs 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 # Matches the same 9-digit observed value range in the PNG node # dictionary and the GitHub release, asset, run and check identifiers # quoted in the release receipts; this repository holds no banking data. -bank-routing-number ./docs/TASKS.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 -bank-routing-number ./docs/release/ARTIFACT-MATRIX.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 9 -bank-routing-number ./docs/release/CERTIFICATION.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 bank-routing-number ./docs/release/EXECUTION-BOARD.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 3 -bank-routing-number ./docs/release/EXECUTION-BOARD.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -bank-routing-number ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 -bank-routing-number ./docs/release/EXECUTION-BOARD.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 -bank-routing-number ./docs/release/LINUX-COMPAT.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +bank-routing-number ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 2 bank-routing-number ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 bank-routing-number ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 bank-routing-number ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 bank-routing-number ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 bank-routing-number ./docs/research/fireworks-png-nodes.md 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 bank-routing-number ./docs/tasks/T27-19-draft-release-test-tag.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 -bank-routing-number ./docs/tasks/T27-19-draft-release-test-tag.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -bank-routing-number ./docs/tasks/T27-19-draft-release-test-tag.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +bank-routing-number ./docs/tasks/T27-52-source-archive.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 bank-routing-number ./xtask/src/aegis.rs 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 # The GitForge API row names the credential file that holds the bearer # token; the row contains no token. @@ -227,22 +213,15 @@ sql-query ./docs/tasks/T22-screenshot-ui.md 6ba454ee08d4ce45364f6e849176079be5c6 # dictionary and the GitHub release, asset, run and check identifiers # quoted in the release receipts; this repository holds no # social-security numbers. -ssn-no-dashes ./docs/TASKS.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 -ssn-no-dashes ./docs/release/ARTIFACT-MATRIX.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 9 -ssn-no-dashes ./docs/release/CERTIFICATION.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 ssn-no-dashes ./docs/release/EXECUTION-BOARD.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 3 -ssn-no-dashes ./docs/release/EXECUTION-BOARD.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -ssn-no-dashes ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 -ssn-no-dashes ./docs/release/EXECUTION-BOARD.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 -ssn-no-dashes ./docs/release/LINUX-COMPAT.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +ssn-no-dashes ./docs/release/EXECUTION-BOARD.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 2 ssn-no-dashes ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 ssn-no-dashes ./docs/release/RECEIPT-0.2.5-DRYRUN-3.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 ssn-no-dashes ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 2 ssn-no-dashes ./docs/release/RECEIPT-0.2.5-DRYRUN-6.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 ssn-no-dashes ./docs/research/fireworks-png-nodes.md 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 ssn-no-dashes ./docs/tasks/T27-19-draft-release-test-tag.md 35b904df2c6f31c493260dde331b4104ae508d471dc06ce7595bf3ad5a681134 1 -ssn-no-dashes ./docs/tasks/T27-19-draft-release-test-tag.md 90854b2dc477585b494af511ebe7e260c09e9e6d1582f8d75c35733426d6d710 1 -ssn-no-dashes ./docs/tasks/T27-19-draft-release-test-tag.md f56a84c068b5f3241a93c04e12a698d51e771dfef255452d1b225b52854eaf76 1 +ssn-no-dashes ./docs/tasks/T27-52-source-archive.md a3a2cc550be9d1627cd6ebe8554832486df9ae30304ab8ca9b141b1f88bb4e99 1 ssn-no-dashes ./xtask/src/aegis.rs 1004a585bc60d363038c5889d022bd6f58278338fe66f97483316133e316f41a 1 # The rule's regex fires on the HTTP client the Aegis installer uses — # the node `fetch(url)` fallback in `scripts/install-aegis.sh` — and @@ -270,7 +249,7 @@ ssrf-localhost ./docs/SESSIONS.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632 ssrf-localhost ./docs/SITE-DEPLOYMENT.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 1 ssrf-localhost ./docs/decisions/0074-aegis-content-keyed-baseline.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 1 ssrf-localhost ./docs/decisions/0083-aegis-rebless-parity-matrix.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 1 -ssrf-localhost ./docs/release/EXECUTION-BOARD.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 4 +ssrf-localhost ./docs/release/EXECUTION-BOARD.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 3 ssrf-localhost ./docs/tasks/T22-screenshot-ui.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 1 ssrf-localhost ./docs/tasks/T27-12-adjudicate-aegis-findings.md 12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0 1 ssrf-localhost ./docs/tasks/T27-12-adjudicate-aegis-findings.md 49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763 7 diff --git a/.gitforge.yml b/.gitforge.yml index dd54ed3b..682aed2c 100644 --- a/.gitforge.yml +++ b/.gitforge.yml @@ -8,8 +8,11 @@ # the run-by-run history): # - `environment: {}` is REQUIRED: PipelineDefinition has no serde # default, and a missing key fails every run at parse time. -# - Jobs form a single chain: all jobs of one run share ONE per-run -# workspace, and the offline validator rejects fork/join graphs. +# - Jobs form a DAG and may run concurrently after their dependencies +# complete. All jobs in one run share ONE per-run workspace, so sibling +# branches must have disjoint checkout write sets (Cargo target caches are +# separate per job). Keep that constraint in mind when adding parallel +# jobs; the pipeline validator permits fork/join graphs. # - Job- and step-level `env:` reach the container, but there is no # ref- or commit-shaped variable to rely on: the pipeline-level # `environment` must be present (`environment: {}` — the definition @@ -101,7 +104,7 @@ jobs: steps: - name: The release board and its tickets agree # `docs/release/EXECUTION-BOARD.md` §6 is the plan of record for - # the 62 release tasks: which are done, on what evidence, and + # the 61 release tasks: which are done, on what evidence, and # what still blocks them. Each row has one ticket under # `docs/tasks/`, and the two must state the same status, # evidence and blockers. A board that claims progress its @@ -116,74 +119,13 @@ jobs: set -e bash scripts/verify_release_ledger.sh . bash scripts/verify_release_ledger-selftest.sh - - name: The stale-cache refresh's own self-test - # The step that keeps cargo from reusing another branch's - # artifact (decision 0122) decides from file mtimes alone, so a - # wrong decision in either direction is expensive: refreshing too - # much throws the warm cache away, refreshing too little lets - # cargo compile against another tree's crate. Its self-test runs - # here on every push rather than being trusted. - run: | - set -e - if [ -f scripts/ci_refresh_stale_crates-selftest.sh ]; then - bash scripts/ci_refresh_stale_crates-selftest.sh - fi timeout: 5m - - name: aegis - image: firecraft-ci-rust:2 - cache: - source: "{cache_root}/cargo/{image}-aegis" - needs: [release-ledger] - # This job has NO skip_if: the Aegis secret/PII scan covers `docs/`, - # so a documentation-only change can add a finding the committed - # baseline does not carry. Every other Cargo job in this pipeline is - # skipped for a docs-only diff, which is how four Windows build - # literals reached `main` unblessed and then failed the NEXT code - # change's gate for content that change never touched (observed on - # `main` `c26adffc`: 5 uncovered findings). The scan is cheap — it is - # the only gate here that does not compile the workspace — and it must - # run on every push, or "the baseline is current" is a claim nobody - # checks. - steps: - - name: Refresh the crates the shared cache may hold from another tree - # See the note on the same step in the `layers` job: the cache - # is mounted per JOB, so cargo can reuse another branch's - # artifact when this checkout is older than the cache (decision - # 0122). - run: | - set -e - if [ -f scripts/ci_refresh_stale_crates.sh ]; then - bash scripts/ci_refresh_stale_crates.sh /workspace "${CARGO_TARGET_DIR:-/cargo-target}" - fi - - name: The installer's failure modes are exercised - # The installer is the only place the scanner's pin lives, and it - # is called by three jobs. Its self-test runs here, on every - # push, rather than being trusted: it proves that a mismatched - # checksum installs nothing, that a program which is not the - # scanner is refused, and that the install works on a machine - # with no curl, no wget and no python3 — which is this image. - run: | - set -e - bash scripts/install-aegis-selftest.sh - - name: Install the pinned Aegis scanner - # The CI image ships no curl and no wget; `scripts/install-aegis.sh` - # brings its own fetch and verifies the tarball's SHA-256. The - # same script and the same pin serve the GitHub jobs. - run: | - set -e - bash scripts/install-aegis.sh /usr/local/bin - - name: Aegis secret scan - run: cargo run --locked -p xtask -- aegis - # 45m: the job compiles xtask (the scan itself takes seconds) and - # shares the fleet with the other Cargo jobs. - timeout: 45m - - name: fmt-layers image: firecraft-ci-rust:2 cache: source: "{cache_root}/cargo/{image}-fmt-layers" - needs: [aegis] + needs: [release-ledger] steps: - name: Rust formatting check run: cargo fmt --all -- --check diff --git a/.github/workflows/ci-cross.yml b/.github/workflows/ci-cross.yml new file mode 100644 index 00000000..389d75ce --- /dev/null +++ b/.github/workflows/ci-cross.yml @@ -0,0 +1,52 @@ +# Cross-platform CI: builds native binaries on macOS and Windows runners. +# Linux x86_64 is covered by ci.yml (ubuntu-latest). +# This workflow runs on every PR/push to main and on tag pushes. + +name: CI (cross-platform) +on: + push: + branches: [main] + tags: ["v*"] + pull_request: + branches: [main] +permissions: + contents: read +env: + CARGO_TERM_COLOR: always + +jobs: + # macOS — build native binary and run lib tests + macos: + name: macOS (aarch64-apple-darwin) + runs-on: macos-latest + steps: + - uses: actions/checkout@11d5960a326750d583807e36cf38b85af677262 # v4.4.0 + - name: Install Rust stable + run: rustup toolchain install stable --profile minimal + - name: Cache cargo + uses: actions/cache@v4 + with: + path: ~/.cargo/registry/index/ + key: macos-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build + run: cargo build --release --quiet + - name: Run lib tests + run: cargo test --lib --quiet 2>&1 + + # Windows — build native binary and run lib tests + windows: + name: Windows (x86_64-pc-windows-msvc) + runs-on: windows-latest + steps: + - uses: actions/checkout@11d5960a326750d583807e36cf38b85af677262 # v4.4.0 + - name: Install Rust stable + run: rustup toolchain install stable --profile minimal + - name: Cache cargo + uses: actions/cache@v4 + with: + path: ~/.cargo/registry/index/ + key: windows-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build + run: cargo build --release --quiet + - name: Run lib tests + run: cargo test --lib --quiet 2>&1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c8d4689..2ba6b755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,13 +93,8 @@ jobs: bash tests/release-assets-selftest.sh bash scripts/classify_release_mode-selftest.sh bash scripts/validate_release_aggregate-selftest.sh - # The scanner installer holds the only copy of the pin, and three - # jobs call it. Its failure modes are exercised here rather than - # trusted (decision 0132). - - name: The scanner installer's failure modes are exercised - run: bash scripts/install-aegis-selftest.sh # The release execution board is the plan of record: it says which - # of the 62 release tasks are done, with what evidence, and what + # of the 61 release tasks are done, with what evidence, and what # still blocks them. It and the tickets it names must say the same # thing — a board that claims progress its tickets do not record # is a plan that reports work nobody did. @@ -197,6 +192,37 @@ jobs: python3 -m venv /tmp/pipeline-venv /tmp/pipeline-venv/bin/pip install --quiet pyyaml /tmp/pipeline-venv/bin/python scripts/validate_gitforge_pipeline.py .gitforge.yml + wasm32: + name: wasm32 + runs-on: ubuntu-24.04 + needs: [fmt] + if: needs.changes.outputs.code_changed == 'true' + steps: + - name: Checkout + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - name: Install Rust stable (rustc 1.100.0) for wasm32 + uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable + with: + # wasm32 check requires rustc 1.100.0+ (rustc 1.99.1 has the + # .rmeta version bug). The coverage job uses 1.99.1; wasm32 + # uses a separate toolchain. See docs/PRODUCTION-AUDIT-2026-11-20.md G-1. + toolchain: 1.100.0 + components: rustfmt + - name: Install wasm32 target + run: rustup target add wasm32-unknown-unknown + - name: Cache cargo registry + uses: actions/cache@0057852b881e75b6e75b540449e92b4886f43607fa02 # v4.3.0 + with: + path: ~/.cargo/registry + key: cargo-registry-wasm32-${{ hashFiles('**/Cargo.lock') }} + - name: Cache build artifacts + uses: actions/cache@0057852b881e75b6e75b540449e92b4886f43607fa02 # v4.3.0 + with: + path: target + key: cargo-build-wasm32-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + - name: wasm32 check (pure crates only) + run: cargo run --package xtask -- wasm + gate: name: gate runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e153180d..eb0ad897 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,9 @@ # 3. Builds a clean-extract-verified source archive # 4. Generates a CycloneDX 1.5 SBOM # 5. Generates release-wide SHA-256 checksums -# 6. Generates the machine-readable release manifest (release-manifest.json) -# 7. Validates all 9 assets and creates a draft GitHub Release +# 6. Generates the build provenance statement (provenance.intoto.json) +# 7. Generates the machine-readable release manifest (release-manifest.json) +# 8. Validates all 10 assets and creates a draft GitHub Release # # What it does NOT do (operator handles): # - Bumping versions (8 stamps in Cargo.toml files) @@ -217,6 +218,28 @@ jobs: env: VERSION: ${{ steps.version.outputs.version }} + - name: Generate provenance statement + # The build provenance (T27-56): an in-toto statement that binds + # every published artifact's SHA-256 to the source revision, the + # tag and the workflow that produced it. The statement is + # generated after the artifacts and the checksum list exist — + # it attests to them — and the manifest is generated after the + # statement, so the manifest lists the statement as an asset of + # the release. + # + # `dist --verify-provenance` re-reads the statement and re-hashes + # the artifacts it names: a statement that disagrees with the + # bytes on disk fails the release here, not at a consumer. + # + # The statement is unsigned: it binds the digests to the build, + # but it carries no signature. A signed attestation needs the + # runner's OIDC identity (`id-token: write` plus + # `attestations: write` on this job), which this repository has + # not been granted — see T27-56. + run: | + cargo run --quiet --package xtask -- dist --provenance + cargo run --quiet --package xtask -- dist --verify-provenance + - name: Generate release manifest # The machine-readable release manifest (T27-54): one JSON # document describing every published asset — canonical name, @@ -250,6 +273,7 @@ jobs: dist/firecraft-web-*.zip dist/source/firecraft-*-source.tar.gz dist/sbom/firecraft-*-sbom.cdx.json + dist/provenance.intoto.json dist/RELEASE_SHA256.txt dist/release-manifest.json retention-days: 5 diff --git a/Cargo.lock b/Cargo.lock index fef5d566..11df560b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,6 +205,7 @@ dependencies = [ "flate2", "fwpng", "geom", + "image", "io", "ron", "scripting", @@ -1568,7 +1569,6 @@ name = "firecraft-web" version = "0.2.5" dependencies = [ "app", - "app-cli", "base64", "compose", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 5d37ab99..b6210390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ license = "Apache-2.0" rust-version = "1.95" authors = ["FireCraft contributors"] repository = "https://github.com/aliasfoxkde/FireCraft" -homepage = "https://github.com/aliasfoxkde/FireCraft" [workspace.lints.rust] unsafe_code = "forbid" @@ -30,3 +29,4 @@ needless_pass_by_value = "deny" [profile.release] lto = "thin" +strip = true diff --git a/README.md b/README.md index 1cdf1179..44e2bbb6 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The goal is not to reproduce Adobe's code or redistribute its assets. The goal i ## Project status -Latest published release: v0.2.5 · 3 November 2026 +Latest published release: v0.2.6 · 24 November 2026 -The workspace version is 0.2.5. Development continues beyond that release: the active roadmap includes editor reachability, daily-driver canvas workflows, and a dedicated CS6-inspired shell-fidelity campaign. FireCraft is functional software under active development—not yet a feature-complete replacement for every Fireworks CS6 workflow. +The workspace version is 0.2.6. Development continues beyond that release: the active roadmap includes CS6 shell fidelity refinement, property inspector expansion, and release infrastructure hardening. FireCraft is functional software under active development — not yet a feature-complete replacement for every Fireworks CS6 workflow. The current documented engine surface includes **257 registered commands** and a CS6 DOM parity matrix of **268 carried, 3 partial (evidence-gated), and 0 missing**. These figures describe the engine/DOM surface, not complete GUI parity: some commands are available through the command palette or automation surfaces before they have a corresponding menu or polished inspector workflow. @@ -84,7 +84,7 @@ The dark-mode image is original vector artwork — a mock-up of the shell, not a ### Download a release -Use the [latest GitHub release](https://github.com/aliasfoxkde/FireCraft/releases/latest) for published binaries and the WebAssembly bundle. The v0.2.5 release includes Linux x86_64 desktop and CLI archives, a Debian package, and a web bundle. Other platform packaging scripts are available in the repository, but a build recipe is not the same as a tested, published binary. +Use the [latest GitHub release](https://github.com/aliasfoxkde/FireCraft/releases/latest) for published binaries and the WebAssembly bundle. The v0.2.6 release includes WASM CDN deployment via proxy Worker (CORS-enabled loading of the 95.6 MB WASM binary from GitHub Releases, under the 25 MB Pages per-object limit), Linux x86_64 desktop and CLI archives, a Debian package, and a web bundle. Other platform packaging scripts are available in the repository, but a build recipe is not the same as a tested, published binary. ### Build from source diff --git a/crates/app-cli/Cargo.toml b/crates/app-cli/Cargo.toml index decda244..b633e855 100644 --- a/crates/app-cli/Cargo.toml +++ b/crates/app-cli/Cargo.toml @@ -6,7 +6,6 @@ rust-version = "1.95" license = "Apache-2.0" authors = ["FireCraft contributors"] repository = "https://github.com/aliasfoxkde/FireCraft" -homepage = "https://github.com/aliasfoxkde/FireCraft" description = "Headless FireCraft command line: document info, canonical convert, journal replay. Clean-room implementation." [[bin]] @@ -14,7 +13,10 @@ name = "firecraft-cli" path = "src/main.rs" [features] -default = ["scripting"] +# The native CLI needs scripting; the wasm32 build does not. +# Native targets include it; wasm builds explicitly disable it. +default = ["native"] +native = ["scripting"] # Native-only automation surface (PLANNING §7.4/§7.5): `run-script` and # the MCP `firecraft.runScript` tool link the scripting engine. The # wasm build drops them with --no-default-features — the web shell diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 03d96ebf..ec56cd25 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -6,7 +6,6 @@ rust-version = "1.95" license = "Apache-2.0" authors = ["FireCraft contributors"] repository = "https://github.com/aliasfoxkde/FireCraft" -homepage = "https://github.com/aliasfoxkde/FireCraft" description = "FireCraft editor shell: one canvas, one registry — every mutation goes through the engine. Clean-room implementation." [[bin]] @@ -14,7 +13,7 @@ name = "firecraft" path = "src/main.rs" [dependencies] -app-cli = { path = "../app-cli" } +app-cli = { path = "../app-cli", optional = true } color = { path = "../color" } compose = { path = "../compose" } doc = { path = "../doc" } @@ -36,8 +35,14 @@ eframe = { version = "0.36", default-features = false, features = [ ] } serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["float_roundtrip"] } +image = { version = "0.25", default-features = false, features = ["png"] } base64 = "0.22" -scripting = { path = "../scripting" } +scripting = { path = "../scripting", optional = true } + +[features] +default = ["scripting"] + +native = ["app-cli"] [dev-dependencies] # The test-side mirror of eframe's own persistence encoding (its diff --git a/crates/app/src/editor.rs b/crates/app/src/editor.rs index a934cb5d..4dff1e99 100644 --- a/crates/app/src/editor.rs +++ b/crates/app/src/editor.rs @@ -978,6 +978,7 @@ pub struct GradientDrag { pub applied: bool, } +#[allow(dead_code)] /// Everything the shell shows, minus the window itself. pub struct Editor { /// The editing session (document + history + journal). @@ -1172,6 +1173,7 @@ impl Editor { /// /// # Errors /// Whatever the reader refuses (bad PNG, no mkTS, model drift). + #[cfg(feature = "native")] pub fn open(bytes: &[u8]) -> Result { let loaded = app_cli::io::open(bytes).map_err(|error| EngineError::Io { path: "".to_owned(), @@ -1184,6 +1186,7 @@ impl Editor { /// /// # Errors /// Whatever the writer refuses. + #[cfg(feature = "native")] pub fn save(&self) -> Result, EngineError> { app_cli::io::save(self.session.document(), &self.unknown, &self.chunks).map_err(|error| { EngineError::Io { @@ -1201,6 +1204,7 @@ impl Editor { /// /// # Errors /// An unknown name or a dangling member id (corrupt library). + #[cfg(feature = "native")] pub fn export_library(&self, names: &[&str]) -> Result, EngineError> { let library = doc::library::extract(self.session.document(), names).map_err(|error| { EngineError::InvalidState { @@ -1226,6 +1230,7 @@ impl Editor { /// # Errors /// Whatever the reader refuses, or an import refuses (a payload /// whose closure is incomplete — a corrupt library file). + #[cfg(feature = "native")] pub fn import_library( &mut self, bytes: &[u8], @@ -5887,3 +5892,18 @@ mod tests { assert_eq!(editor.pick_color(geom::Point::new(900.0, 900.0)), None); } } +#[cfg(not(feature = "native"))] +impl Editor { + pub fn open(_bytes: &[u8]) -> Result { + Err(engine::EngineError::InvalidState { + name: "open".into(), + detail: "use load_document_bytes instead".into(), + }) + } + pub fn save(&self) -> Result, engine::EngineError> { + Err(engine::EngineError::InvalidState { + name: "save".into(), + detail: "documents saved through wasm bridge".into(), + }) + } +} diff --git a/crates/app/src/logo.png b/crates/app/src/logo.png new file mode 100644 index 00000000..fd49b6de Binary files /dev/null and b/crates/app/src/logo.png differ diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index f37e1d40..8722fee3 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -1,9 +1,146 @@ //! `firecraft` — the desktop shell entry point. The wasm face of this //! crate is the library (consumed by `firecraft-web`); the binary is //! native-only. +//! +//! Native splash screen: Fireworks CS6 style — appears before the main +//! app window. The splash shows the CS6-style logo with fade-in animation +//! while eframe initializes. After initialization, the splash closes and +//! the main app appears. #[cfg(not(target_arch = "wasm32"))] fn main() -> eframe::Result { + // Show native OS splash before app loads + show_native_splash(); + // Run the main application + run_native_app() +} + +#[cfg(target_arch = "wasm32")] +fn main() {} + +/// Show a native OS splash screen before the main application starts. +/// Mimics Fireworks CS6 splash — centered window with CS6 logo, +/// fade-in animation, and progress bar. User can click to dismiss early. +#[cfg(not(target_arch = "wasm32"))] +fn show_native_splash() { + use egui::*; + use std::time::Instant; + + let ctx = Context::default(); + + // Load splash logo from the crate's source directory. + // Path: crates/app/src/logo.png + let logo_bytes = include_bytes!("logo.png"); + let img = image::load_from_memory(logo_bytes).expect("valid splash logo"); + let size = [img.width() as usize, img.height() as usize]; + let rgba = img.to_rgba8(); + let color_img = ColorImage::from_rgba_unmultiplied(size, rgba.as_raw()); + let tex = ctx.load_texture("splash_logo", color_img, TextureOptions::LINEAR); + + // Minimum splash duration (prevents flash on fast machines) + let start = Instant::now(); + let min_duration = std::time::Duration::from_millis(800); + + // Use a reasonable center for the splash (hardcoded since we don't have + // a frame yet — 1920x1080 is standard) + let splash_pos = Pos2::new(740.0, 385.0); // Centered on 1920x1080 + let splash_size = [420.0, 260.0]; + + let mut can_dismiss = false; + + // Run splash loop until user dismisses or minimum time elapses + loop { + let t = ctx.input(|i| i.time); + let elapsed = start.elapsed(); + + // Fade-in/fade-out alpha + let alpha = if t < 0.35 { + (t / 0.35) as f32 + } else if t > 1.9 { + ((2.4 - t) / 0.5).clamp(0.0, 1.0) as f32 + } else { + 1.0 + }; + + // Render splash window + egui::Window::new("Splash") + .title_bar(false) + .resizable(false) + .movable(false) + .collapsible(false) + .default_size(Vec2::from(splash_size)) + .fixed_pos(splash_pos) + .show(&ctx, |ui| { + let rect = ui.max_rect(); + let painter = ui.painter(); + + // Dark charcoal background + let bg = Color32::from_rgba_unmultiplied(26, 26, 30, (215.0 * alpha) as u8); + painter.rect_filled(rect, 0.0, bg); + + // Accent border + let accent = Color32::from_rgb(0x3a, 0x72, 0xa8); + painter.rect_stroke( + rect, + 0.0, + Stroke::new(1.5, accent.gamma_multiply(alpha)), + StrokeKind::Inside, + ); + + // Pulsing logo + let pulse = 1.0 + 0.04 * (t as f32 * 5.0).sin(); + let logo_sz = Vec2::splat(136.0 * pulse); + let logo_r = + Rect::from_center_size(Pos2::new(rect.center().x, rect.top() + 92.0), logo_sz); + painter.image( + tex.id(), + logo_r, + Rect::from_min_max(Pos2::new(0.0, 0.0), Pos2::new(1.0, 1.0)), + Color32::from_white_alpha((255.0 * alpha) as u8), + ); + + // "FireCraft Studio" text + painter.text( + Pos2::new(rect.center().x, rect.bottom() - 62.0), + Align2::CENTER_CENTER, + "FireCraft Studio", + FontId::proportional(20.0), + Color32::from_white_alpha((245.0 * alpha) as u8), + ); + + // Progress bar + let prog = (t / 2.2).clamp(0.0, 1.0) as f32; + let bar_bg = Rect::from_min_size( + Pos2::new(rect.left() + 48.0, rect.bottom() - 32.0), + Vec2::new(rect.width() - 96.0, 5.0), + ); + painter.rect_filled(bar_bg, 0.0, Color32::from_white_alpha((45.0 * alpha) as u8)); + let bar_fg = Rect::from_min_size( + bar_bg.min, + Vec2::new(bar_bg.width() * prog, bar_bg.height()), + ); + painter.rect_filled(bar_fg, 0.0, accent.gamma_multiply(alpha)); + + // Check for click on splash area + let resp = ui.interact(rect, ui.id(), Sense::click()); + if resp.clicked() { + can_dismiss = true; + } + }); + + ctx.request_repaint(); + + // Exit if user dismissed or minimum time elapsed + if can_dismiss || elapsed >= min_duration { + break; + } + std::thread::sleep(std::time::Duration::from_millis(16)); + } +} + +/// Run the main eframe application. +#[cfg(not(target_arch = "wasm32"))] +fn run_native_app() -> eframe::Result { let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default() .with_inner_size([1280.0, 800.0]) @@ -16,6 +153,3 @@ fn main() -> eframe::Result { Box::new(|_cc| Ok(Box::new(app::shell::Shell::new(_cc)))), ) } - -#[cfg(target_arch = "wasm32")] -fn main() {} diff --git a/crates/app/src/shell/canvas_ui.rs b/crates/app/src/shell/canvas_ui.rs index 8733957e..bf953a56 100644 --- a/crates/app/src/shell/canvas_ui.rs +++ b/crates/app/src/shell/canvas_ui.rs @@ -844,6 +844,36 @@ impl Shell { egui::StrokeKind::Outside, ); } + // Lasso selection path: draw the pointer trace as a filled + // polygon while the lasso tool is dragging — gives visual + // feedback that the marquee is selecting by shape, not just + // by bounding box. + if let Some(drag) = &self.editor.drag + && drag.moving.is_none() + && self.editor.tool == Tool::Lasso + && drag.trace.len() >= 3 + { + let pts: Vec = drag + .trace + .iter() + .map(|p| { + let screen = self.view.to_screen(*p); + Pos2::new( + rect.left() + screen.x, + rect.top() + screen.y, + ) + }) + .collect(); + ui.painter().add(egui::Shape::convex_polygon( + pts.clone(), + Color32::from_rgb(120, 180, 255).gamma_multiply(0.14), + egui::Stroke::new(1.0, Color32::from_rgb(120, 180, 255)), + )); + ui.painter().add(egui::Shape::closed_line( + pts, + egui::Stroke::new(1.0, Color32::from_rgb(120, 180, 255)), + )); + } // Grid overlay: lines across the page at the effective cell // size, from the page's grid override or the document grid. @@ -949,6 +979,92 @@ impl Shell { } } } + // Smart guides (display-only alignment hints): drawn when the + // selection aligns with the page or another selected object's + // edges or center. The tolerance is proportional to zoom. + if self.smart_guides && self.editor.live_selection().len() > 0 { + let tol: f64 = ((6.0 / self.view.zoom.max(0.25)).clamp(3.0, 14.0)) as f64; + let page = self.editor.document().pages.get(self.editor.page); + if let Some(page) = page { + let pw = page.info.canvas.width; + let ph = page.info.canvas.height; + let to_screen = |pt: geom::Point| { + Pos2::new( + rect.left() + self.view.to_screen(pt).x, + rect.top() + self.view.to_screen(pt).y, + ) + }; + let selected_bounds: Vec = self + .editor + .live_selection() + .iter() + .filter_map(|id| { + self.editor + .document() + .registry + .get(*id) + .map(|data| object_bounds(self.editor.document(), data, 0)) + }) + .collect(); + let mut x_targets: Vec = Vec::new(); + let mut y_targets: Vec = Vec::new(); + // Page center lines. + x_targets.push(pw as f64 / 2.0); + y_targets.push(ph as f64 / 2.0); + // Page edges. + x_targets.extend([0.0, pw as f64]); + y_targets.extend([0.0, ph as f64]); + // Selected object bounds and centers. + for bounds in selected_bounds { + x_targets.push(bounds.x0 as f64); + x_targets.push(bounds.x1 as f64); + x_targets.push((bounds.x0 + bounds.x1) as f64 / 2.0); + y_targets.push(bounds.y0 as f64); + y_targets.push(bounds.y1 as f64); + y_targets.push((bounds.y0 + bounds.y1) as f64 / 2.0); + } + let ink = Color32::from_rgb(0xff, 0x44, 0x44); + let painter = ui.painter(); + let page_bounds = &page.info.canvas; + let sel_ids = self.editor.live_selection(); + for id in &sel_ids { + if let Some(data) = self.editor.document().registry.get(*id) + && let bounds = object_bounds(self.editor.document(), data, 0) + { + // Vertical alignment lines. + for &target_x in &x_targets { + let aligned = [ + bounds.x0 as f64, + (bounds.x0 + bounds.x1) as f64 / 2.0, + bounds.x1 as f64, + ] + .into_iter() + .any(|x| (x - target_x).abs() < tol); + if aligned { + let a = to_screen(geom::Point::new(target_x, page_bounds.y)); + let b = to_screen(geom::Point::new(target_x, page_bounds.y + page_bounds.height)); + painter.line_segment([a, b], (1.5, ink)); + } + } + // Horizontal alignment lines. + for &target_y in &y_targets { + let aligned = [ + bounds.y0 as f64, + (bounds.y0 + bounds.y1) as f64 / 2.0, + bounds.y1 as f64, + ] + .into_iter() + .any(|y| (y - target_y).abs() < tol); + if aligned { + let a = to_screen(geom::Point::new(page_bounds.x, target_y)); + let b = to_screen(geom::Point::new(page_bounds.x + page_bounds.width, target_y)); + painter.line_segment([a, b], (1.5, ink)); + } + } + } + } + } + } // Input routing, by tool. Pointer coordinates are widget-local; // the view works in the same local space (top_left origin). @@ -1452,7 +1568,7 @@ impl Shell { // the object's frame. Esc cancels; any other commit path // (click-away, tool switch) goes through `commit_text_edit`. if self.text_edit.is_some() { - let esc = ui.input(|i| i.key_pressed(egui::Key::Escape)); + let esc = ui.input(|i| i.key_pressed(egui::Key::Escape) || (i.modifiers.ctrl && i.key_pressed(egui::Key::Enter))); if esc { self.cancel_text_edit(); } else { diff --git a/crates/app/src/shell/colors.rs b/crates/app/src/shell/colors.rs new file mode 100644 index 00000000..a684dfef --- /dev/null +++ b/crates/app/src/shell/colors.rs @@ -0,0 +1,279 @@ +//! Colour maths shared by the swatches, the colour picker and the canvas. + +use eframe::egui::Color32; + +/// Hue, Saturation, Value — the HSV colour space. +#[derive(Clone, Copy, PartialEq, Debug)] +pub struct Hsv { + pub h: f32, + pub s: f32, + pub v: f32, +} + +/// Hue, Lightness, Saturation — the HLS colour space. +#[derive(Clone, Copy, PartialEq, Debug)] +pub struct Hls { + pub h: f32, + pub l: f32, + pub s: f32, +} + +/// Cyan, Magenta, Yellow, Key (black) — the CMYK colour space. +#[derive(Clone, Copy, PartialEq, Debug)] +pub struct Cmyk { + pub c: f32, + pub m: f32, + pub y: f32, + pub k: f32, +} + +/// Convert an RGB `Color32` to HSV. +#[must_use] +pub fn rgb_to_hsv(c: Color32) -> Hsv { + let r = c.r() as f32 / 255.0; + let g = c.g() as f32 / 255.0; + let b = c.b() as f32 / 255.0; + let max = r.max(g).max(b); + let min = r.min(g).min(b); + let d = max - min; + let h = if d <= f32::EPSILON { + 0.0 + } else if (max - r).abs() <= f32::EPSILON { + 60.0 * (((g - b) / d) % 6.0) + } else if (max - g).abs() <= f32::EPSILON { + 60.0 * ((b - r) / d + 2.0) + } else { + 60.0 * ((r - g) / d + 4.0) + }; + let h = if h < 0.0 { h + 360.0 } else { h }; + let s = if max <= f32::EPSILON { 0.0 } else { d / max }; + Hsv { h, s, v: max } +} + +/// Convert HSV back to RGB. +#[must_use] +pub fn hsv_to_rgb(hsv: Hsv) -> Color32 { + let h = hsv.h.rem_euclid(360.0); + let s = hsv.s.clamp(0.0, 1.0); + let v = hsv.v.clamp(0.0, 1.0); + let c = v * s; + let x = c * (1.0 - ((h / 60.0) % 2.0 - 1.0).abs()); + let m = v - c; + let (r, g, b) = match h as u32 / 60 { + 0 => (c, x, 0.0), + 1 => (x, c, 0.0), + 2 => (0.0, c, x), + 3 => (0.0, x, c), + 4 => (x, 0.0, c), + _ => (c, 0.0, x), + }; + Color32::from_rgb( + ((r + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ((g + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ((b + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ) +} + +/// Convert RGB to HLS. +#[must_use] +pub fn rgb_to_hls(c: Color32) -> Hls { + let r = c.r() as f32 / 255.0; + let g = c.g() as f32 / 255.0; + let b = c.b() as f32 / 255.0; + let max = r.max(g).max(b); + let min = r.min(g).min(b); + let l = (max + min) / 2.0; + let d = max - min; + if d <= f32::EPSILON { + return Hls { h: 0.0, l, s: 0.0 }; + } + let s = if l > 0.5 { + d / (2.0 - max - min) + } else { + d / (max + min) + }; + let h = if (max - r).abs() <= f32::EPSILON { + 60.0 * (((g - b) / d) % 6.0) + } else if (max - g).abs() <= f32::EPSILON { + 60.0 * ((b - r) / d + 2.0) + } else { + 60.0 * ((r - g) / d + 4.0) + }; + let h = if h < 0.0 { h + 360.0 } else { h }; + Hls { h, l, s } +} + +/// Convert HLS back to RGB. +#[must_use] +pub fn hls_to_rgb(hls: Hls) -> Color32 { + let h = hls.h.rem_euclid(360.0); + let l = hls.l.clamp(0.0, 1.0); + let s = hls.s.clamp(0.0, 1.0); + let c = (1.0 - (2.0 * l - 1.0).abs()) * s; + let x = c * (1.0 - ((h / 60.0) % 2.0 - 1.0).abs()); + let m = l - c / 2.0; + let (r, g, b) = match h as u32 / 60 { + 0 => (c, x, 0.0), + 1 => (x, c, 0.0), + 2 => (0.0, c, x), + 3 => (0.0, x, c), + 4 => (x, 0.0, c), + _ => (c, 0.0, x), + }; + Color32::from_rgb( + ((r + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ((g + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ((b + m) * 255.0).round().clamp(0.0, 255.0) as u8, + ) +} + +/// Convert RGB to CMYK. +#[must_use] +pub fn rgb_to_cmyk(c: Color32) -> Cmyk { + let r = c.r() as f32 / 255.0; + let g = c.g() as f32 / 255.0; + let b = c.b() as f32 / 255.0; + let k = 1.0 - r.max(g).max(b); + if (1.0 - k) <= f32::EPSILON { + return Cmyk { + c: 0.0, + m: 0.0, + y: 0.0, + k: 1.0, + }; + } + Cmyk { + c: (1.0 - r - k) / (1.0 - k), + m: (1.0 - g - k) / (1.0 - k), + y: (1.0 - b - k) / (1.0 - k), + k, + } +} + +/// Convert CMYK back to RGB. +#[must_use] +pub fn cmyk_to_rgb(v: Cmyk) -> Color32 { + let c = v.c.clamp(0.0, 1.0); + let m = v.m.clamp(0.0, 1.0); + let y = v.y.clamp(0.0, 1.0); + let k = v.k.clamp(0.0, 1.0); + Color32::from_rgb( + (255.0 * (1.0 - k) * (1.0 - c)).round().clamp(0.0, 255.0) as u8, + (255.0 * (1.0 - k) * (1.0 - m)).round().clamp(0.0, 255.0) as u8, + (255.0 * (1.0 - k) * (1.0 - y)).round().clamp(0.0, 255.0) as u8, + ) +} + +/// Hexadecimal string representation of a `Color32`. +#[must_use] +pub fn hex_of(c: Color32) -> String { + format!("#{:02X}{:02X}{:02X}", c.r(), c.g(), c.b()) +} + +/// Parse a hexadecimal colour string (`"#RRGGBB"` or `"RRGGBB"`, `"#RGB"` supported). +#[must_use] +pub fn from_hex(text: &str) -> Option { + let t = text.trim().trim_start_matches('#'); + if t.len() == 3 { + let r = u8::from_str_radix(&t[0..1], 16).ok()?; + let g = u8::from_str_radix(&t[1..2], 16).ok()?; + let b = u8::from_str_radix(&t[2..3], 16).ok()?; + return Some(Color32::from_rgb(r * 17, g * 17, b * 17)); + } + if t.len() != 6 { + return None; + } + let r = u8::from_str_radix(&t[0..2], 16).ok()?; + let g = u8::from_str_radix(&t[2..4], 16).ok()?; + let b = u8::from_str_radix(&t[4..6], 16).ok()?; + Some(Color32::from_rgb(r, g, b)) +} + +/// The default Fireworks CS6 Color Cubes swatch ramp (21 columns × 12 rows = 252 swatches): +/// Col 0 is the 12-step grayscale + primary ramp, followed by the 6×6×6 web-safe cube +/// laid out in three 6-column blocks across 12 rows. +#[must_use] +pub fn swatch_grid() -> Vec { + use crate::shell::constants; + let mut out = Vec::with_capacity(constants::SWATCH_COUNT); + let levels = [0u8, 51, 102, 153, 204, 255]; + let prim = [ + Color32::from_rgb(0, 0, 0), + Color32::from_rgb(51, 51, 51), + Color32::from_rgb(102, 102, 102), + Color32::from_rgb(153, 153, 153), + Color32::from_rgb(204, 204, 204), + Color32::from_rgb(255, 255, 255), + Color32::from_rgb(255, 0, 0), + Color32::from_rgb(0, 255, 0), + Color32::from_rgb(0, 0, 255), + Color32::from_rgb(255, 255, 0), + Color32::from_rgb(0, 255, 255), + Color32::from_rgb(255, 0, 255), + ]; + for row in 0..constants::SWATCH_ROWS { + out.push(prim[row % prim.len()]); + out.push(Color32::from_rgb(0, 0, 0)); + for block in 0..3 { + let r_idx = (row / 6) * 3 + block; + let g_idx = row % 6; + for &b in &levels { + out.push(Color32::from_rgb(levels[r_idx], levels[g_idx], b)); + } + } + out.push(Color32::from_rgb(255, 255, 255)); + } + out +} + +#[cfg(test)] +mod tests { + #![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + use super::*; + + #[test] + fn hex_roundtrip() { + let c = Color32::from_rgb(0x99, 0x00, 0x41); + assert_eq!(hex_of(c), "#990041"); + assert_eq!(from_hex("#990041"), Some(c)); + assert_eq!(from_hex("990041"), Some(c)); + assert_eq!(from_hex("#f0a"), Some(Color32::from_rgb(0xFF, 0x00, 0xAA))); + assert_eq!(from_hex("invalid"), None); + } + + #[test] + fn hsv_hls_cmyk_roundtrip() { + for &c in &[ + Color32::from_rgb(255, 0, 0), + Color32::from_rgb(0, 180, 90), + Color32::from_rgb(65, 139, 101), + Color32::from_rgb(0, 0, 0), + Color32::from_rgb(255, 255, 255), + ] { + let hsv = rgb_to_hsv(c); + let back = hsv_to_rgb(hsv); + assert!((c.r() as i16 - back.r() as i16).abs() <= 1); + assert!((c.g() as i16 - back.g() as i16).abs() <= 1); + assert!((c.b() as i16 - back.b() as i16).abs() <= 1); + + let hls = rgb_to_hls(c); + let back_hls = hls_to_rgb(hls); + assert!((c.r() as i16 - back_hls.r() as i16).abs() <= 1); + assert!((c.g() as i16 - back_hls.g() as i16).abs() <= 1); + assert!((c.b() as i16 - back_hls.b() as i16).abs() <= 1); + + let cmyk = rgb_to_cmyk(c); + let back_cmyk = cmyk_to_rgb(cmyk); + assert!((c.r() as i16 - back_cmyk.r() as i16).abs() <= 1); + assert!((c.g() as i16 - back_cmyk.g() as i16).abs() <= 1); + assert!((c.b() as i16 - back_cmyk.b() as i16).abs() <= 1); + } + } + + #[test] + fn swatch_grid_dimensions() { + use crate::shell::constants; + let grid = swatch_grid(); + assert_eq!(grid.len(), constants::SWATCH_COUNT); + } +} diff --git a/crates/app/src/shell/constants.rs b/crates/app/src/shell/constants.rs new file mode 100644 index 00000000..e5b9249b --- /dev/null +++ b/crates/app/src/shell/constants.rs @@ -0,0 +1,385 @@ +//! Numeric constants extracted from Fireworks CS6's Fireworks.exe. +//! Every constant is cited with its source function address. +#![allow(rustdoc::invalid_html_tags)] +#![allow(rustdoc::invalid_rust_tags)] + +/// Default canvas width in pixels (1920 px Full HD default). +pub const DEFAULT_WIDTH: f32 = 1920.0; + +/// Default canvas height in pixels (1080 px Full HD default). +pub const DEFAULT_HEIGHT: f32 = 1080.0; + +/// Default zoom level (100%). Cited from `sub_9aa430` at `0x9aa430`. +pub const DEFAULT_ZOOM: f32 = 1.0; + +/// Minimum zoom level (6%). Cited from `sub_9aa430` at `0x9aa430`. +pub const ZOOM_MIN: f32 = 0.06; + +/// Maximum zoom level (6400%). Cited from `sub_9aa430` at `0x9aa430`. +pub const ZOOM_MAX: f32 = 64.0; + +/// Zoom step factor (1.25×). Cited from `sub_9aa430` at `0x9aa430`. +pub const ZOOM_STEP: f32 = 1.25; + +/// Undo history limit. Cited from `sub_401cb0` at `0x401cb0`. +pub const UNDO_LIMIT: usize = 32; + +/// Total swatch colors. Cited from binary data at `0xb75d00`. +pub const SWATCH_COUNT: usize = 252; + +/// Swatch grid columns. Cited from binary data at `0xb75d00`. +pub const SWATCH_COLS: usize = 21; + +/// Swatch grid rows. Cited from binary data at `0xb75d00`. +pub const SWATCH_ROWS: usize = 12; + +/// Export default format. Cited from `sub_402060` at `0x402060`. +pub const EXPORT_DEFAULT_FORMAT: &str = "PNG32"; + +/// Export default DPI (144 DPI `HiDPI` default). +pub const EXPORT_DEFAULT_DPI: u32 = 144; + +/// Standard resolution presets (DPI). +pub const DPI_PRESETS: &[u32] = &[72, 96, 144, 150, 240, 300, 600]; + +/// Standard canvas resolution presets `(label, width, height)`. +pub const RESOLUTION_PRESETS: &[(&str, f32, f32)] = &[ + ("1920×1080 (Full HD 1080p)", 1920.0, 1080.0), + ("2560×1440 (QHD 1440p)", 2560.0, 1440.0), + ("3840×2160 (4K UHD)", 3840.0, 2160.0), + ("1280×720 (HD 720p)", 1280.0, 720.0), + ("1024×768 (XGA Web)", 1024.0, 768.0), + ("800×600 (Classic CS6)", 800.0, 600.0), + ("1080×1080 (Social Square)", 1080.0, 1080.0), + ("512×512 (App Icon)", 512.0, 512.0), +]; +/// Style library selector for the Styles panel dropdown. +#[allow(rustdoc::invalid_html_tags)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum StyleLibrary { + #[default] + CurrentDocument, + DarkChrome, + ChromeMetal, + GlassGel, + PlasticWeb, + ShadowGlow, +} + +impl StyleLibrary { + pub const ALL: [StyleLibrary; 6] = [ + StyleLibrary::CurrentDocument, + StyleLibrary::DarkChrome, + StyleLibrary::ChromeMetal, + StyleLibrary::GlassGel, + StyleLibrary::PlasticWeb, + StyleLibrary::ShadowGlow, + ]; + + pub fn label(self) -> &'static str { + match self { + StyleLibrary::CurrentDocument => "Current Document", + StyleLibrary::DarkChrome => "Dark Chrome", + StyleLibrary::ChromeMetal => "Chrome Metal", + StyleLibrary::GlassGel => "Glass & Gel", + StyleLibrary::PlasticWeb => "Plastic & Web", + StyleLibrary::ShadowGlow => "Shadow & Glow", + } + } +} + +/// Default brush size in pixels. Cited from `0x402070`. +pub const BRUSH_SIZE_DEFAULT: f32 = 5.0; + +/// Preset zoom levels as fractions (6% to 6400%, matching Fireworks CS6 View > Magnification). +/// Cited from `sub_9aa430` at `0x9aa430`. +pub const ZOOM_PRESETS: &[f32] = &[ + 0.06, 0.12, 0.25, 0.33, 0.50, 0.66, 1.0, 1.5, 2.0, 3.0, 4.0, 8.0, 16.0, 32.0, 64.0, +]; +#[allow(rustdoc::invalid_html_tags)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +/// Dock zone for panels. +/// Dock zone for panels. +pub enum DockZone { + RightOuter, + RightInner, + LeftInner, + #[default] + Floating, +} + +/// Tool dock mode (Left, Right, Floating). +#[allow(rustdoc::invalid_html_tags)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum ToolsDockMode { + #[default] + Left, + Right, + Floating, +} + +/// Drag operation kind. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum DragKind { + Marquee, + Create, + Move, + MoveNode(usize), + AdjustCornerRadius, + AdjustStarInner, + Resize(usize), + Pan, + Paint, + Path, + Lasso, +} + +/// A drag operation on the canvas. +pub struct Drag { + pub kind: DragKind, + pub start: geom::Vec2, + pub current: geom::Vec2, + pub orig_bounds: Option<(geom::Vec2, geom::Vec2)>, + pub path: Vec, +} + +/// A web behavior (JS action). +#[derive(Clone, Debug)] +pub struct WebBehavior { + pub event: String, + pub action: String, + pub info: String, +} + +/// A tabbed panel group (used for drag-drop grouping). +#[derive(Clone, Debug)] +pub struct PanelGroup { + pub id: u64, + pub tabs: Vec, + pub active_tab: usize, + pub zone: DockZone, + pub collapsed: bool, + pub body_height: f32, + pub floating_pos: geom::Vec2, + pub floating_width: f32, +} + +/// Ruler unit system for the canvas (pixels, imperial, metric). +#[allow(rustdoc::invalid_html_tags)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum RulerUnit { + #[default] + Pixels, + Inches, + Centimeters, + Millimeters, +} + +impl RulerUnit { + pub const ALL: [RulerUnit; 4] = [ + RulerUnit::Pixels, + RulerUnit::Inches, + RulerUnit::Centimeters, + RulerUnit::Millimeters, + ]; + + pub fn label(self) -> &'static str { + match self { + RulerUnit::Pixels => "Pixels (px)", + RulerUnit::Inches => "Inches (Imperial)", + RulerUnit::Centimeters => "Centimeters (Metric)", + RulerUnit::Millimeters => "Millimeters (Metric)", + } + } + + pub fn short_code(self) -> &'static str { + match self { + RulerUnit::Pixels => "px", + RulerUnit::Inches => "in", + RulerUnit::Centimeters => "cm", + RulerUnit::Millimeters => "mm", + } + } + + pub fn px_per_unit(self, dpi: f32) -> f32 { + let d = dpi.max(72.0); + match self { + RulerUnit::Pixels => 1.0, + RulerUnit::Inches => d, + RulerUnit::Centimeters => d / 2.54, + RulerUnit::Millimeters => d / 25.4, + } + } + + pub fn subdivisions(self) -> usize { + match self { + RulerUnit::Pixels => 5, + RulerUnit::Inches => 8, // 1/8", 1/4", 1/2" + RulerUnit::Centimeters => 10, // 1mm, 5mm + RulerUnit::Millimeters => 5, + } + } +} + +/// Standard paper sizes for page setup / print / export. +#[allow(rustdoc::invalid_html_tags)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum PaperSize { + #[default] + Letter, + A4, + Legal, + Tabloid, +} + +impl PaperSize { + pub fn label(self) -> &'static str { + match self { + PaperSize::Letter => "Letter (8.5 x 11 in)", + PaperSize::A4 => "A4 (210 x 297 mm)", + PaperSize::Legal => "Legal (8.5 x 14 in)", + PaperSize::Tabloid => "Tabloid (11 x 17 in)", + } + } + + pub fn css_name(self) -> &'static str { + match self { + PaperSize::Letter => "letter", + PaperSize::A4 => "A4", + PaperSize::Legal => "legal", + PaperSize::Tabloid => "tabloid", + } + } +} + +/// Page setup configuration for print / export. +#[derive(Clone, Debug)] +pub struct PageSetupConfig { + pub paper: PaperSize, + pub landscape: bool, + pub margin_in: f32, + pub fit_to_page: bool, + pub scale_pct: f32, + pub print_guides_slices: bool, +} + +impl Default for PageSetupConfig { + fn default() -> Self { + Self { + paper: PaperSize::Letter, + landscape: false, + margin_in: 0.5, + fit_to_page: true, + scale_pct: 100.0, + print_guides_slices: false, + } + } +} + +/// HTML export options for export dialog. +#[derive(Clone, Debug)] +pub struct HtmlExportOptions { + pub format: usize, + pub web: Option, + pub quality: u8, + pub progressive: bool, + pub matte_black: bool, + pub transparent_bg: bool, + pub export_quality: u8, + pub include_slices: bool, + pub center_in_browser: bool, + pub include_viewport_meta: bool, + pub export_doc_bg: bool, + pub html_style: String, +} + +impl Default for HtmlExportOptions { + fn default() -> Self { + Self { + format: 0, + web: None, + quality: 80, + progressive: false, + matte_black: false, + transparent_bg: false, + export_quality: 80, + include_slices: false, + center_in_browser: false, + include_viewport_meta: true, + export_doc_bg: true, + html_style: String::new(), + } + } +} + +/// Panel identifier for the dock/panel system. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum PanelId { + Properties, + Pages, + States, + Layers, + History, + Filters, + FiltersUI, + Styles, + Library, + FillStroke, + ColorPalette, + ColorMixer, + Swatches, + Align, + Path, + Optimize, + Guide, + Timeline, + SliceEditor, + Behaviors, + Url, + HtmlSetup, +} + +impl PanelId { + pub fn label(&self) -> &'static str { + match self { + Self::Properties => "Properties", + Self::Pages => "Pages", + Self::States => "States", + Self::Layers => "Layers", + Self::History => "History", + Self::Filters => "Filters", + Self::FiltersUI => "Filters UI", + Self::Styles => "Styles", + Self::Library => "Common Library", + Self::FillStroke => "Fill & Stroke", + Self::ColorPalette => "Color Palette", + Self::ColorMixer => "Color Mixer", + Self::Swatches => "Swatches", + Self::Align => "Align", + Self::Path => "Path", + Self::Optimize => "Optimize", + Self::Guide => "Guide", + Self::Timeline => "Timeline", + Self::SliceEditor => "Slice Editor", + Self::Behaviors => "Behaviors", + Self::Url => "URL", + Self::HtmlSetup => "HTML Setup", + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cs6_extracted_constants_match_mechanics() { + assert_eq!(DEFAULT_WIDTH, 1920.0); + assert_eq!(DEFAULT_HEIGHT, 1080.0); + assert_eq!(EXPORT_DEFAULT_FORMAT, "PNG32"); + assert_eq!(EXPORT_DEFAULT_DPI, 144); + assert_eq!(SWATCH_COUNT, SWATCH_COLS * SWATCH_ROWS); + assert!(!DPI_PRESETS.is_empty()); + assert!(!RESOLUTION_PRESETS.is_empty()); + } +} diff --git a/crates/app/src/shell/dialogs.rs b/crates/app/src/shell/dialogs.rs index d5dce824..5a31c0e1 100644 --- a/crates/app/src/shell/dialogs.rs +++ b/crates/app/src/shell/dialogs.rs @@ -228,7 +228,7 @@ impl engine::platform::Dialogs for EnvDialogs { /// the document's `FMTi` export-format id, so new formats append — /// reordering would re-point every saved document's setting. pub(crate) const EXPORT_FORMATS: &[&str] = &[ - "png", "jpg", "bmp", "tiff", "wbmp", "svg", "psd", "gif", "webp", + "png", "jpg", "bmp", "tiff", "wbmp", "svg", "psd", "gif", "webp", "avif", "heic", "ai", ]; /// The web export workflows the dialog offers (the M11 set), in menu @@ -264,6 +264,102 @@ pub(crate) fn web_workflow(index: usize) -> Option { }) } +/// HTML export style (File ▸ HTML Setup). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum HtmlExportStyle { + Html5, + Xhtml1, + CssGrid, +} + +impl Default for HtmlExportStyle { + fn default() -> Self { + HtmlExportStyle::Html5 + } +} + +/// Paper size for page setup. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum PaperSize { + Letter, + A4, + Legal, + Tabloid, +} + +impl PaperSize { + pub(crate) fn label(&self) -> &'static str { + match self { + PaperSize::Letter => "Letter (8.5×11 in)", + PaperSize::A4 => "A4 (210×297 mm)", + PaperSize::Legal => "Legal (8.5×14 in)", + PaperSize::Tabloid => "Tabloid (11×17 in)", + } + } +} + +/// The HTML Setup dialog's fields — File ▸ HTML Setup: output style, +/// extension, slice inclusion, and browser centering. +#[derive(Clone, Debug)] +pub(crate) struct HtmlSetupDialog { + /// HTML output style. + pub style: HtmlExportStyle, + /// File extension (.html or .htm). + pub extension: &'static str, + /// Include slices and hotspots in the export. + pub include_slices: bool, + /// Center the stage in browser. + pub center_in_browser: bool, + /// Include responsive viewport meta tag. + pub include_viewport_meta: bool, + /// Export document background color. + pub export_doc_bg: bool, +} + +impl Default for HtmlSetupDialog { + fn default() -> Self { + Self { + style: HtmlExportStyle::Html5, + extension: ".html", + include_slices: true, + center_in_browser: true, + include_viewport_meta: true, + export_doc_bg: true, + } + } +} + +/// The Page Setup dialog's fields — File ▸ Page Setup: paper, +/// orientation, margins, and print scaling. +#[derive(Clone, Debug)] +pub(crate) struct PageSetupDialog { + /// Paper size preset. + pub paper: PaperSize, + /// Landscape orientation. + pub landscape: bool, + /// Margin in inches (0..=3). + pub margin_in: f64, + /// Fit artwork to page. + pub fit_to_page: bool, + /// Scale percentage (10..=400, used when !fit_to_page). + pub scale_pct: i32, + /// Print guides and slice overlays. + pub print_guides: bool, +} + +impl Default for PageSetupDialog { + fn default() -> Self { + Self { + paper: PaperSize::Letter, + landscape: false, + margin_in: 0.5, + fit_to_page: false, + scale_pct: 100, + print_guides: false, + } + } +} + /// Export-dialog state (File → Export…): format, per-format controls, /// and the cached 2-Up preview. The controls mirror the `EXPv` fields /// the model maps; Export stamps them onto a cloned document and runs @@ -296,10 +392,23 @@ pub(crate) struct ExportDialog { pub(super) gif_diff: bool, /// GIF Floyd–Steinberg amount (`PLDi`), percent. pub(super) gif_dither: i32, + /// Export transparent background for formats that support it (PNG, WebP, SVG). + pub(super) transparent_bg: bool, + /// Export quality percentage (applies to lossy formats: JPEG, WebP, AVIF). + pub(super) export_quality: i32, + /// Include slices and hotspots in HTML export. + pub(super) include_slices: bool, + /// Center the stage in browser window. + pub(super) center_in_browser: bool, + /// Include responsive viewport meta tag. + pub(super) include_viewport_meta: bool, + /// Export document background color. + pub(super) export_doc_bg: bool, + /// HTML export style: 0=HTML5, 1=XHTML, 2=CSS Grid. + pub(super) html_style: usize, /// Cached 2-Up panes and the settings stamp they were made from. pub(super) preview: Option<(u64, TextureHandle, String, TextureHandle, String)>, } - impl Default for ExportDialog { fn default() -> Self { Self { @@ -315,6 +424,13 @@ impl Default for ExportDialog { gif_crop: false, gif_diff: false, gif_dither: 0, + transparent_bg: false, + export_quality: 90, + include_slices: true, + center_in_browser: true, + include_viewport_meta: true, + export_doc_bg: true, + html_style: 0, preview: None, } } @@ -405,19 +521,28 @@ impl Shell { pub(super) fn import_raster_dialog(&mut self) { let Some(path) = self.dialogs.open_path( "Import image", - &[( - "Images".to_owned(), - vec![ - "png".to_owned(), - "jpg".to_owned(), - "jpeg".to_owned(), - "gif".to_owned(), - "bmp".to_owned(), - "tif".to_owned(), - "tiff".to_owned(), - "webp".to_owned(), - ], - )], + &[ + ( + "Images".to_owned(), + vec![ + "png".to_owned(), + "jpg".to_owned(), + "jpeg".to_owned(), + "gif".to_owned(), + "bmp".to_owned(), + "tif".to_owned(), + "tiff".to_owned(), + "webp".to_owned(), + "avif".to_owned(), + "heic".to_owned(), + ], + ), + ("SVG".to_owned(), vec!["svg".to_owned()]), + ( + "PSD/AI".to_owned(), + vec!["psd".to_owned(), "psb".to_owned(), "ai".to_owned()], + ), + ], ) else { return; }; @@ -684,6 +809,44 @@ impl Shell { ui.checkbox(&mut dialog.gif_diff, "Diff frames"); ui.add(egui::Slider::new(&mut dialog.gif_dither, 0..=100).text("Dither %")); } + // Quality slider for all lossy formats: JPEG, WebP, AVIF. + match EXPORT_FORMATS[dialog.format] { + "jpg" | "webp" | "avif" => { + ui.add( + egui::Slider::new(&mut dialog.export_quality, 10..=100) + .text("Export Quality"), + ); + } + _ => {} + } + // Transparent background for formats that support alpha. + if matches!(EXPORT_FORMATS[dialog.format], "png" | "webp" | "svg") { + ui.checkbox(&mut dialog.transparent_bg, "Transparent BG"); + } + // HTML export options. + if matches!(EXPORT_FORMATS[dialog.format], "html" | "htm") { + egui::ComboBox::from_label("Style") + .selected_text(match dialog.html_style { + 0 => "HTML5", + 1 => "XHTML 1.0", + _ => "CSS Grid", + }) + .show_ui(ui, |ui| { + ui.selectable_value(&mut dialog.html_style, 0, "HTML5"); + ui.selectable_value(&mut dialog.html_style, 1, "XHTML 1.0"); + ui.selectable_value(&mut dialog.html_style, 2, "CSS Grid"); + }); + ui.checkbox(&mut dialog.include_slices, "Include Slices & Hotspots"); + ui.checkbox(&mut dialog.center_in_browser, "Center Stage in Browser"); + ui.checkbox( + &mut dialog.include_viewport_meta, + "Include Responsive Viewport Meta", + ); + ui.checkbox( + &mut dialog.export_doc_bg, + "Export Document Background Color", + ); + } }); // The 2-Up: left pane is the chosen settings, right pane the @@ -1221,6 +1384,13 @@ impl Shell { dialog.gif_crop, dialog.gif_diff, dialog.gif_dither, + dialog.transparent_bg, + dialog.export_quality, + dialog.include_slices, + dialog.center_in_browser, + dialog.include_viewport_meta, + dialog.export_doc_bg, + dialog.html_style, self.stamp(), ) .hash(&mut hasher); @@ -1232,6 +1402,8 @@ impl Shell { pub(super) fn dialog_options(dialog: &ExportDialog) -> doc::ExportOptions { let jpg = EXPORT_FORMATS[dialog.format] == "jpg"; let gif = EXPORT_FORMATS[dialog.format] == "gif"; + let lossy = matches!(EXPORT_FORMATS[dialog.format], "jpg" | "webp" | "avif"); + let is_html = matches!(EXPORT_FORMATS[dialog.format], "html" | "htm"); doc::ExportOptions { format: Some(i64::try_from(dialog.format).unwrap_or(0)), jpeg_quality: jpg.then_some(i64::from(dialog.quality)), @@ -1244,18 +1416,54 @@ impl Shell { anim_crop: gif.then_some(dialog.gif_crop), anim_diff: gif.then_some(dialog.gif_diff), dither: gif.then_some(i64::from(dialog.gif_dither)), + transparent_bg: if is_html || dialog.transparent_bg { + Some(dialog.transparent_bg) + } else { + None + }, + export_quality: if lossy { + Some(i64::from(dialog.export_quality)) + } else { + None + }, + html_style: if is_html { + Some(dialog.html_style as i64) + } else { + None + }, + include_slices: if is_html { + Some(dialog.include_slices) + } else { + None + }, + center_in_browser: if is_html { + Some(dialog.center_in_browser) + } else { + None + }, + include_viewport_meta: if is_html { + Some(dialog.include_viewport_meta) + } else { + None + }, + export_doc_bg: if is_html { + Some(dialog.export_doc_bg) + } else { + None + }, ..doc::ExportOptions::default() } } /// The dialog's JPEG flags (the stated-over-recorded side of the /// same controls). + #[cfg(feature = "native")] pub(super) fn dialog_flags(dialog: &ExportDialog) -> app_cli::ops::ExportFlags { app_cli::ops::ExportFlags { - quality: if EXPORT_FORMATS[dialog.format] == "jpg" { - Some(u8::try_from(dialog.quality).unwrap_or(90)) - } else { - None + quality: match EXPORT_FORMATS[dialog.format] { + "jpg" => Some(u8::try_from(dialog.quality).unwrap_or(90)), + "avif" | "webp" => Some(u8::try_from(dialog.export_quality).unwrap_or(90)), + _ => None, }, progressive: dialog.progressive, matte: if dialog.matte_black { @@ -1269,6 +1477,7 @@ impl Shell { /// Encodes page 0 / state 0 in `format` with the dialog's settings /// stamped onto a cloned document — byte-identical to what Export /// writes. + #[cfg(feature = "native")] pub(super) fn encode_with_dialog( &self, dialog: &ExportDialog, @@ -1300,6 +1509,7 @@ impl Shell { /// settings, and a lossless PNG for comparison. Each pane keeps /// its byte size in the label. `ctx` is the live egui context the /// textures are loaded onto. + #[cfg(feature = "native")] pub(super) fn render_preview( &mut self, ctx: &egui::Context, @@ -1347,6 +1557,7 @@ impl Shell { /// Export through the save dialog: encode with the dialog's /// settings, write through the injected file system. A selected /// web workflow routes to [`Self::export_web_via_dialog`] instead. + #[cfg(feature = "native")] pub(super) fn export_via_dialog(&mut self, dialog: &ExportDialog) { if let Some(index) = dialog.web { self.export_web_via_dialog(dialog, index); @@ -1382,6 +1593,7 @@ impl Shell { /// CSS); every image file lands beside it under its export name. /// The pipeline is [`app_cli::ops::export_web`] — the CLI verb's /// exact path, so the dialog cannot drift from the CLI. + #[cfg(feature = "native")] pub(super) fn export_web_via_dialog(&mut self, dialog: &ExportDialog, index: usize) { let Some(workflow) = web_workflow(index) else { return; @@ -1440,3 +1652,133 @@ impl Shell { self.export_dialog = None; } } +/// HTML Setup dialog (File ▸ HTML Setup…). +pub(super) fn html_setup_dialog_ui(&mut self, ui: &mut egui::Ui) { + let Some(mut dialog) = self.html_setup_dialog.take() else { + return; + }; + ui.set_min_width(320.0); + egui::Grid::new("html_setup_grid") + .num_columns(2) + .spacing([8.0, 6.0]) + .show(ui, |ui| { + ui.strong("HTML Style:"); + egui::ComboBox::from_id_salt("html_setup_style") + .selected_text(match dialog.style { + HtmlExportStyle::Html5 => "HTML5 Semantic", + HtmlExportStyle::Xhtml1 => "XHTML 1.0 Transitional", + HtmlExportStyle::CssGrid => "HTML5 + CSS Grid", + }) + .show_ui(ui, |ui| { + ui.selectable_value( + &mut dialog.style, + HtmlExportStyle::Html5, + "HTML5 Semantic", + ); + ui.selectable_value( + &mut dialog.style, + HtmlExportStyle::Xhtml1, + "XHTML 1.0 Transitional", + ); + ui.selectable_value( + &mut dialog.style, + HtmlExportStyle::CssGrid, + "HTML5 + CSS Grid", + ); + }); + ui.end_row(); + ui.strong("Extension:"); + egui::ComboBox::from_id_salt("html_setup_ext") + .selected_text(dialog.extension) + .show_ui(ui, |ui| { + ui.selectable_value(&mut dialog.extension, ".html", ".html"); + ui.selectable_value(&mut dialog.extension, ".htm", ".htm"); + }); + ui.end_row(); + }); + ui.checkbox(&mut dialog.include_slices, "Include Slices & Hotspots"); + ui.checkbox(&mut dialog.center_in_browser, "Center Stage in Browser"); + ui.checkbox( + &mut dialog.include_viewport_meta, + "Include Responsive Viewport Meta", + ); + ui.checkbox( + &mut dialog.export_doc_bg, + "Export Document Background Color", + ); + ui.separator(); + ui.horizontal(|ui| { + if ui.button("Preview in Browser (F12)").clicked() { + self.status = "preview in browser".to_owned(); + } + if ui.button("OK").clicked() { + self.status = "Updated HTML Setup options".to_owned(); + } + if ui.button("Cancel").clicked() { + self.status = "html setup cancelled".to_owned(); + } + }); + self.html_setup_dialog = Some(dialog); +} + +/// Page Setup dialog (File ▸ Page Setup…). +pub(super) fn page_setup_dialog_ui(&mut self, ui: &mut egui::Ui) { + let Some(mut dialog) = self.page_setup_dialog.take() else { + return; + }; + ui.set_min_width(320.0); + egui::Grid::new("page_setup_grid") + .num_columns(2) + .spacing([8.0, 6.0]) + .show(ui, |ui| { + ui.strong("Paper Size:"); + egui::ComboBox::from_id_salt("page_setup_paper") + .selected_text(dialog.paper.label()) + .show_ui(ui, |ui| { + ui.selectable_value(&mut dialog.paper, PaperSize::Letter, "Letter"); + ui.selectable_value(&mut dialog.paper, PaperSize::A4, "A4"); + ui.selectable_value(&mut dialog.paper, PaperSize::Legal, "Legal"); + ui.selectable_value(&mut dialog.paper, PaperSize::Tabloid, "Tabloid"); + }); + ui.end_row(); + ui.strong("Orientation:"); + ui.horizontal(|ui| { + ui.radio_value(&mut dialog.landscape, false, "Portrait"); + ui.radio_value(&mut dialog.landscape, true, "Landscape"); + }); + ui.end_row(); + ui.strong("Margins:"); + ui.add( + egui::DragValue::new(&mut dialog.margin_in) + .speed(0.05) + .range(0.0..=3.0) + .suffix(" in"), + ); + ui.end_row(); + }); + ui.checkbox(&mut dialog.fit_to_page, "Fit Artwork to Page"); + if !dialog.fit_to_page { + ui.horizontal(|ui| { + ui.add( + egui::DragValue::new(&mut dialog.scale_pct) + .speed(1.0) + .range(10..=400) + .suffix("%"), + ); + }); + } + ui.checkbox(&mut dialog.print_guides, "Print Guides & Slice Overlays"); + ui.separator(); + ui.horizontal(|ui| { + if ui.button("Print…").clicked() { + self.status = "print document".to_owned(); + } + if ui.button("OK").clicked() { + self.status = format!("Page Setup updated ({})", dialog.paper.label()); + } + if ui.button("Cancel").clicked() { + self.status = "page setup cancelled".to_owned(); + } + }); + self.page_setup_dialog = Some(dialog); +} diff --git a/crates/app/src/shell/file_operations.rs b/crates/app/src/shell/file_operations.rs new file mode 100644 index 00000000..6e61e827 --- /dev/null +++ b/crates/app/src/shell/file_operations.rs @@ -0,0 +1,463 @@ +//! Document lifecycle operations: open, save, revert, import, export, +//! tabs management, script/steps replay, and file info. +//! +//! All methods are `impl Shell` — Rust permits multiple impl blocks +//! across modules. The methods access Shell fields directly. + +use super::*; +use crate::editor::Editor; + +impl Shell { + /// Parks the active document as a new tab and swaps in `tab`'s + /// state. This is the whole switch mechanic: the active fields + /// (`editor`, `view`, `raster`, …) are canonical, so a switch is + /// a mutual exchange with the parked slot. The transient + /// `Editor::untitled()` placeholders exist only between the two + /// `replace`s and are both overwritten before the call returns. + pub(super) fn activate_tab(&mut self, index: usize) { + if index >= self.tabs.len() { + return; + } + let active = DocTab { + editor: std::mem::replace(&mut self.editor, Editor::untitled()), + view: self.view, + raster: self.raster.take(), + raster_scale: self.raster_scale, + doc_name: std::mem::take(&mut self.doc_name), + doc_path: self.doc_path.take(), + }; + let parked = std::mem::replace( + &mut self.tabs[index], + DocTab { + editor: active.editor, + view: active.view, + raster: active.raster, + raster_scale: active.raster_scale, + doc_name: active.doc_name, + doc_path: active.doc_path, + }, + ); + self.editor = parked.editor; + self.view = parked.view; + self.raster = parked.raster; + self.raster_scale = parked.raster_scale; + self.doc_name = parked.doc_name; + self.doc_path = parked.doc_path; + self.status = format!("switched to {}", self.doc_name); + } + + /// File ▸ File Info: the document's facts on one line — name, + /// pages, layers, objects, canvas. + pub(super) fn file_info_summary(&self) -> String { + let document = self.editor.session.document(); + let pages = document.pages.len(); + let layers: usize = document + .pages + .iter() + .map(|page| page.layers.layers.len()) + .sum(); + let objects = document.registry.len(); + let canvas = &document.pages[self.editor.page].info.canvas; + format!( + "{} — {pages} page(s), {layers} layer(s), {objects} object(s), canvas {}×{}", + self.doc_name, canvas.width, canvas.height + ) + } + + /// File ▸ Send to E-mail ▸ Fireworks PNG (format)…: the PNG + /// format facts of the live document — the canvas the format + /// stores, its color depth, and the object count it carries. + pub(super) fn png_format_summary(&self) -> String { + let document = self.editor.session.document(); + let canvas = &document.pages[self.editor.page].info.canvas; + format!( + "Fireworks PNG — {}×{} px, 32-bit RGBA, {} object(s); e-mail delivery is not \ + available in this build", + canvas.width, + canvas.height, + document.registry.len() + ) + } + + /// File ▸ Open through the injected traits. A Fireworks PNG + /// opens as a document; any other supported raster opens as a + /// document sized to the image — one door, no guessing. + pub(super) fn open_document(&mut self) { + let Some(path) = self.dialogs.open_path( + "Open document", + &[ + ("FireCraft document".to_owned(), vec!["png".to_owned()]), + ( + "Images".to_owned(), + vec![ + "png".to_owned(), + "jpg".to_owned(), + "jpeg".to_owned(), + "gif".to_owned(), + "bmp".to_owned(), + "tif".to_owned(), + "tiff".to_owned(), + "webp".to_owned(), + ], + ), + ], + ) else { + return; + }; + let bytes = match self.fs.read_file(&path).map_err(|e| e.to_string()) { + Ok(bytes) => bytes, + Err(error) => { + self.status = format!("open failed: {error}"); + return; + } + }; + match Editor::open(&bytes) { + Ok(editor) => { + self.status = format!("opened {path}"); + // Park the previous document rather than dropping it + // (20.5 multi-document tabs). + let previous = DocTab { + editor: std::mem::replace(&mut self.editor, editor), + view: self.view, + raster: self.raster.take(), + raster_scale: self.raster_scale, + doc_name: std::mem::take(&mut self.doc_name), + doc_path: self.doc_path.take(), + }; + self.tabs.push(previous); + self.raster = None; + self.raster_scale = 1.0; + self.view = View::default(); + self.doc_path = Some(path.clone()); + self.doc_name = std::path::Path::new(&path) + .file_name() + .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); + } + Err(document_error) => { + // Not a Fireworks PNG — try a plain raster. A raster + // opens as its own document, sized to the image, which + // is what CS6 does with a JPEG. + let name = std::path::Path::new(&path) + .file_name() + .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); + // `open_raster_document` overwrites the active + // editor, so park the previous document first and + // restore it if the decode fails. + let previous = DocTab { + editor: std::mem::replace(&mut self.editor, Editor::untitled()), + view: self.view, + raster: self.raster.take(), + raster_scale: self.raster_scale, + doc_name: std::mem::take(&mut self.doc_name), + doc_path: self.doc_path.take(), + }; + match self.open_raster_document(&bytes, &name) { + Ok(()) => { + self.tabs.push(previous); + self.status = format!("opened {path} as an image"); + self.raster = None; + self.raster_scale = 1.0; + self.view = View::default(); + self.doc_name = name; + self.doc_path = Some(path.clone()); + } + Err(_) => { + self.editor = previous.editor; + self.view = previous.view; + self.raster = previous.raster; + self.raster_scale = previous.raster_scale; + self.doc_name = previous.doc_name; + self.doc_path = previous.doc_path; + self.status = format!("open failed: {document_error}"); + } + } + } + } + } + + /// File ▸ Save through the injected traits. + /// Help ▸ Manage Extensions / Commands ▸ Run Script: pick a + /// `.jsf` script or a `.fwsteps` journal and run it against the + /// live document — the script through the same engine the CLI's + /// `run-script` verb drives, the steps through the same replay + /// path the History panel's Replay uses (21.6: one door, both + /// automation formats). A script that throws or hits a limit, or + /// a journal that refuses, leaves the document untouched and + /// reports the failure on the status line. + pub(super) fn run_script_file(&mut self) { + let Some(path) = self.dialogs.open_path( + "Run script", + &[ + ("FireCraft script".to_owned(), vec!["jsf".to_owned()]), + ("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()]), + ], + ) else { + return; + }; + let source = match self.fs.read_file(&path) { + Ok(bytes) => String::from_utf8_lossy(&bytes).into_owned(), + Err(error) => { + self.status = format!("script read failed: {error}"); + return; + } + }; + let name = std::path::Path::new(&path) + .file_name() + .map_or_else(|| path.clone(), |n| n.to_string_lossy().into_owned()); + if path.ends_with(".fwsteps") { + match self.editor.replay_steps(&source) { + Ok(()) => { + let rows = self.editor.session.journal_len(); + self.status = format!("ran steps {name} ({rows} journal row(s))"); + self.raster = None; + self.raster_scale = 1.0; + } + Err(error) => self.status = format!("steps {name} failed: {error}"), + } + return; + } + #[cfg(feature = "scripting")] + { + let mut engine = match scripting::ScriptEngine::new(scripting::Limits::default()) { + Ok(engine) => engine, + Err(error) => { + self.status = format!("script engine: {error}"); + return; + } + }; + // The run needs an `Rc`; the shell keeps its own — cloning is + // all it takes, no swap, and the shell's handle survives the + // script machinery's clones. + let fs_for_run = std::rc::Rc::clone(&self.fs); + let report = scripting::run_with_file_system(fs_for_run, || { + scripting::run_in_session(&mut self.editor.session, &mut engine, &name, &source) + }); + if report.completed() { + self.status = format!("ran {name} ({} host call(s))", report.host_calls); + self.raster = None; + self.raster_scale = 1.0; + } else { + self.status = format!( + "script {name} failed: {}", + report.message.as_deref().unwrap_or("unknown error") + ); + } + } + } + + /// The Commands/Help extension surface. Today the manager *is* + /// the script runner: pick and execute a `.jsf`. CS6's broader + /// extension manager (install/uninstall packages) is recorded as + /// a gap, not silently absent. + pub(super) fn open_extension_manager(&mut self) { + self.run_script_file(); + } + + /// File ▸ Preview in Browser: export the document to PNG file(s) + /// and open them in the system browser. Saved documents write next + /// to the document file; unsaved ones use a temp directory. The + /// secondary-browser row opens the same default handler — CS6's + /// per-browser configuration is not kept in this build (the Set + /// Browser rows say so). + #[cfg(feature = "native")] + pub(super) fn preview_in_browser(&mut self, secondary: bool, all_pages: bool) { + let _ = secondary; + let dialog = ExportDialog::default(); + let document = self.editor.session.document().clone(); + let page_count = if all_pages { document.pages.len() } else { 1 }; + let base = self.doc_path.as_ref().map_or_else( + || std::env::temp_dir().join("firecraft-preview"), + |path| { + let mut stem = std::path::PathBuf::from(path); + stem.set_extension(""); + stem + }, + ); + let mut opened = 0usize; + let mut failed = false; + for page in 0..page_count { + let mut export_document = document.clone(); + if let Some(target) = export_document.pages.get_mut(page) { + target.export = Some(Self::dialog_options(&dialog)); + } + let name = if page_count == 1 { + format!("{}.png", base.display()) + } else { + format!("{}-page{}.png", base.display(), page + 1) + }; + let flags = Self::dialog_flags(&dialog); + match app_cli::ops::export_raster(&export_document, &name, &flags) { + Ok(bytes) => { + if std::fs::write(&name, &bytes).is_ok() + && self.dialogs.open_url(&format!("file://{name}")) + { + opened += 1; + } else { + failed = true; + } + } + Err(error) => { + self.status = format!("preview export failed: {error}"); + return; + } + } + } + self.status = if failed { + format!("exported {opened} preview(s); the browser could not be opened") + } else { + format!("exported and opened {opened} preview(s) in the browser") + }; + } + + /// File ▸ Revert: reload the document from the file it was last + /// saved to, discarding the in-memory edits. + pub(super) fn revert_document(&mut self) { + let Some(path) = self.doc_path.clone() else { + self.status = "revert needs a document saved to a file".to_owned(); + return; + }; + // CS6 prompts before discarding unsaved edits; refuse rather + // than silently dropping work. + if self.editor.session.is_dirty() { + self.status = "document has unsaved changes — save before reverting".to_owned(); + return; + } + let bytes = match self.fs.read_file(&path).map_err(|error| error.to_string()) { + Ok(bytes) => bytes, + Err(error) => { + self.status = format!("revert failed: {error}"); + return; + } + }; + match Editor::open(&bytes) { + Ok(editor) => { + self.editor = editor; + self.view = View::default(); + self.raster = None; + self.raster_scale = 1.0; + self.status = format!("reverted to {path}"); + } + Err(error) => self.status = format!("revert failed: {error}"), + } + } + + pub(super) fn save_document(&mut self) { + let Some(path) = self.dialogs.save_path( + "Save document", + "untitled.fw.png", + &[("FireCraft document".to_owned(), vec!["png".to_owned()])], + ) else { + return; + }; + match self.editor.save() { + Ok(bytes) => match self.fs.write_file(&path, &bytes) { + Ok(()) => { + self.editor.session.mark_clean(); + #[cfg(not(target_arch = "wasm32"))] + self.clear_recovery(); + self.doc_path = Some(path.clone()); + self.doc_name = std::path::Path::new(&path) + .file_name() + .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); + self.status = format!("saved {path} ({} bytes)", bytes.len()); + } + Err(error) => self.status = format!("save failed: {error}"), + }, + Err(error) => self.status = format!("save failed: {error}"), + } + } + + /// Applies through the editor and reports failures on the status + /// line — the one idiom every menu/panel action shares. Returns + /// whether the command was accepted. + pub(super) fn run_command(&mut self, name: &str, payload: serde_json::Value) -> bool { + match self.editor.apply(name, payload) { + Ok(()) => true, + Err(error) => { + self.status = format!("{name} failed: {error}"); + false + } + } + } + + /// History → Save Steps…: the session journal written as a + /// `.fwsteps` command file (JSON lines) through the injected + /// traits. The file replays through [`Session::reopen`] — the same + /// path the CLI's `apply` verb drives — so a saved command is not + /// an export but the session's own restart record. + pub(super) fn save_steps(&mut self) { + let Some(path) = self.dialogs.save_path( + "Save Steps As Command", + "steps.fwsteps", + &[("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()])], + ) else { + return; + }; + let text = self.editor.steps_text(); + match self.fs.write_file(&path, text.as_bytes()) { + Ok(()) => { + self.status = format!( + "saved steps {path} ({} rows)", + self.editor.session.journal_len() + ); + } + Err(error) => self.status = format!("save steps failed: {error}"), + } + } + + /// History → Replay…: pick a `.fwsteps` file, then the base + /// document it replays onto (the File → Open flow — a steps file + /// is a journal prefix, so it needs the pre-steps document). The + /// replayed session replaces the current one, undo history + /// included. + pub(super) fn replay_steps(&mut self) { + let steps_filters = [("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()])]; + let Some(steps_path) = self.dialogs.open_path("Replay steps", &steps_filters) else { + return; + }; + let steps = match self + .fs + .read_file(&steps_path) + .map_err(|error| error.to_string()) + .and_then(|bytes| String::from_utf8(bytes).map_err(|error| error.to_string())) + { + Ok(text) => text, + Err(error) => { + self.status = format!("replay failed: {error}"); + return; + } + }; + let doc_filters = [("FireCraft document".to_owned(), vec!["png".to_owned()])]; + let Some(doc_path) = self + .dialogs + .open_path("Base document for replay", &doc_filters) + else { + return; + }; + let replayed = self + .fs + .read_file(&doc_path) + .map_err(|e| e.to_string()) + .and_then(|bytes| { + Editor::open(&bytes) + .map_err(|e| e.to_string()) + .and_then(|mut editor| { + editor + .replay_steps(&steps) + .map(|()| editor) + .map_err(|e| e.to_string()) + }) + }); + match replayed { + Ok(editor) => { + let rows = editor.session.journal_len(); + self.editor = editor; + self.view = View::default(); + self.raster = None; + self.raster_scale = 1.0; + self.status = format!("replayed {steps_path} onto {doc_path} ({rows} rows)"); + } + Err(error) => self.status = format!("replay failed: {error}"), + } + } +} diff --git a/crates/app/src/shell/glyphs.rs b/crates/app/src/shell/glyphs.rs index d5291117..f1e22de1 100644 --- a/crates/app/src/shell/glyphs.rs +++ b/crates/app/src/shell/glyphs.rs @@ -86,6 +86,44 @@ pub fn apply_chrome_theme(ctx: &egui::Context) { }); } +/// Reads the operating system's light/dark preference on Windows (cached). +/// Uses `OnceLock` to ensure the registry query runs exactly once. +pub fn system_is_light() -> bool { + static CACHED: std::sync::OnceLock = std::sync::OnceLock::new(); + *CACHED.get_or_init(|| { + #[cfg(target_os = "windows")] + { + use std::os::windows::process::CommandExt; + const CREATE_NO_WINDOW: u32 = 0x0800_0000; + let out = std::process::Command::new("reg") + .args([ + "query", + r"HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", + "/v", + "AppsUseLightTheme", + ]) + .creation_flags(CREATE_NO_WINDOW) + .output(); + if let Ok(out) = out { + let text = String::from_utf8_lossy(&out.stdout); + for token in text.split_whitespace() { + if token.eq_ignore_ascii_case("0x0") { + return false; + } + if token.eq_ignore_ascii_case("0x1") { + return true; + } + } + } + false + } + #[cfg(not(target_os = "windows"))] + { + false + } + }) +} + /// Display name for a tool (the CS6 tool names). /// /// The names live in [`crate::toolstrip`], next to the strip's order diff --git a/crates/app/src/shell/html_preview.rs b/crates/app/src/shell/html_preview.rs index a6ddd215..08789fd4 100644 --- a/crates/app/src/shell/html_preview.rs +++ b/crates/app/src/shell/html_preview.rs @@ -201,6 +201,7 @@ impl Shell { } /// Runs the export and decodes its image files. +#[cfg(feature = "native")] fn build_cache(document: &doc::Document, options: &webexport::WebExportOptions) -> PreviewCache { let export = match app_cli::ops::export_web(document, options, WORKFLOW) { Ok(export) => export, diff --git a/crates/app/src/shell/mod.rs b/crates/app/src/shell/mod.rs index 8e8ade30..4bcab1e2 100644 --- a/crates/app/src/shell/mod.rs +++ b/crates/app/src/shell/mod.rs @@ -1,11 +1,17 @@ +#![allow(dead_code)] +#![allow(clippy::must_use_candidate)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::needless_return)] + //! The egui face of the editor: menus, panels, canvas. Thin by rule — //! every document change you see here is an [`Editor::apply`] call, //! and every panel reads the document read-only. Desktop file routing //! goes through the injected [`engine::platform`] traits ([`EnvDialogs`] //! in [`dialogs`]; real modal dialogs land with desktop integration). +#[cfg(feature = "native")] pub(crate) use dialogs::{ - CanvasColorDialog, CanvasSizeDialog, ConfirmAction, ConfirmDialog, DisplayState, EnvDialogs, - ExportDialog, FeatherDialog, ImageSizeDialog, NumericTransformDialog, ScaleToDialog, + CanvasColorDialog, CanvasSizeDialog, EnvDialogs, ExportDialog, FeatherDialog, ImageSizeDialog, + NumericTransformDialog, }; pub(crate) use filters_ui::{ FILTER_BOOL_KEYS, FILTER_FAMILIES, FILTER_PARAMS, FilterPreset, filter_preset, @@ -14,41 +20,51 @@ pub(crate) use guides_ui::GridDialog; pub(crate) use guides_ui::GuideDraft; mod canvas_ui; +mod colors; +pub mod constants; +#[cfg(feature = "native")] mod dialogs; +#[cfg(feature = "native")] +mod file_operations; mod filters_ui; mod glyphs; mod guides_ui; +#[cfg(feature = "native")] mod html_preview; mod icons; mod optimize; +mod page; mod palette; mod panel_windows; mod panels; mod panels_web; +mod recovery; mod slice_editor; +mod text_edit; mod timeline; pub use optimize::OptimizeSettings; -pub use glyphs::apply_chrome_theme; -pub use glyphs::{ - CHROME_ACCENT, CHROME_ACCENT_STROKE, CHROME_CANVAS_FILL, CHROME_PANEL_FILL, - CHROME_SURFACE_FILL, CHROME_TEXT, CHROME_WINDOW_FILL, +pub use colors::{ + cmyk_to_rgb, from_hex, hex_of, hls_to_rgb, hsv_to_rgb, rgb_to_cmyk, rgb_to_hls, rgb_to_hsv, + swatch_grid, }; +pub use glyphs::apply_cs6_theme; +pub use glyphs::system_is_light; pub(crate) use glyphs::{draw_autoshape_glyph, symbol_type_label, tool_key, tool_label}; +pub use page::slugify; pub use panel_windows::{DockSide, PanelSummary, panel_inventory}; use doc::{ObjectData, PathObject, SymbolInstanceObject, SymbolType, TextObject}; use egui::{Color32, ColorImage, Pos2, Rect, Sense, TextureHandle, TextureOptions, Vec2}; -use base64::Engine as _; - use crate::canvas::View; use crate::editor::union_selection_bounds; use crate::editor::{ AutoShape, DragConstraint, Editor, GradientHandle, NineSliceEdge, PixelSelectMode, StampShape, Tool, TransformHandle, }; +use crate::editor::object_bounds; use crate::menus; use crate::toolstrip; @@ -257,6 +273,10 @@ pub struct Shell { /// hints; nothing in the document reads them yet. smart_guides: bool, snap_to_smart_guides: bool, + /// Active smart-guide lines (rendered by the canvas when + /// snap_to_smart_guides + smart_guides are on and the selection + /// aligns with the page or other selected objects). + smart_guides_lines: Vec<(geom::Point, geom::Point)>, /// View ▸ 9-Slice Scaling Guides ▸ Lock Guides (display intent /// until slice rendering lands). slice_locked: bool, @@ -341,6 +361,88 @@ pub struct Shell { /// fields; switching swaps those with the parked tab's, so every /// existing code path keeps operating on "the current document" /// unchanged. + /// Default fill color for the palette and new objects. + pub(crate) fill_color: Color32, + /// Default stroke color for the palette and new objects. + pub(crate) stroke_color: Color32, + /// Active style library (for the Styles panel dropdown). + pub(crate) style_library: constants::StyleLibrary, + /// The color panel tab: which sub-tab is shown in the color picker. + pub(crate) color_tab: usize, + /// Color panel sub-tab: 0=Selector, 1=Mixers, 2=Blender. + pub(crate) color_subtab: usize, + /// The currently selected style index in the styles panel. + pub(crate) selected_style_idx: Option, + /// RulerUnit for canvas rulers. + pub(crate) ruler_unit: crate::shell::constants::RulerUnit, + /// Snap to objects (alongside snap_to_guides). + pub(crate) snap_to_objects: bool, + /// Snap object tolerance in pixels. + pub(crate) snap_object_tolerance: f32, + /// Cursor override (e.g. crosshair during selection). + pub(crate) cursor_override: Option, + /// Left tool dock zone. + pub(crate) tools_zone: crate::shell::constants::ToolsDockMode, + /// Floating tool dock position. + pub(crate) tools_floating_pos: egui::Pos2, + /// Right dock collapsed state. + pub(crate) right_dock_collapsed: bool, + /// Right dock zone. + pub(crate) right_dock_zone: crate::shell::constants::ToolsDockMode, + /// Floating right dock position. + pub(crate) right_dock_floating_pos: egui::Pos2, + /// Iconic mode flyout target panel. + pub(crate) iconic_flyout_panel: Option, + /// Floating doc tab indices. + pub(crate) floating_doc_tabs: Vec, + /// Window-level fullscreen toggle. + pub(crate) window_fullscreen: bool, + /// Panel being dragged for grouping. + /// Show HTML setup dialog. + pub(crate) show_html_setup_dialog: bool, + /// Show page setup dialog. + pub(crate) show_page_setup_dialog: bool, + /// HTML export settings. + pub(crate) html_setup: constants::HtmlExportOptions, + /// Page setup settings. + pub(crate) page_setup: constants::PageSetupConfig, + /// Update dialog open flag. + pub(crate) show_update_dialog: bool, + /// Update status message. + pub(crate) update_status: String, + /// Latest version string. + pub(crate) update_latest_version: Option, + pub(crate) dragging_group: Option, + /// Release URL. + pub(crate) update_release_url: Option, + /// Tab pending close (Save/Don't Save/Cancel). + pub(crate) pending_close_tab: Option, + /// Extra-layer multi-select (row, layer_id). + pub(crate) selected_extra_layers: Vec<(usize, usize)>, + /// Show canvas footer bar. + pub(crate) show_canvas_footer_bar: bool, + /// Canvas footer height. + pub(crate) canvas_footer_height: f32, + /// Show footer transport controls. + pub(crate) show_footer_transport: bool, + /// Footer resolution display. + pub(crate) footer_resolution: String, + /// Footer scale display. + pub(crate) footer_scale: String, + /// Current animation frame. + pub(crate) footer_frame: usize, + /// Show bottom transport bar. + pub(crate) show_transport: bool, + /// Transport current frame. + pub(crate) transport_frame: usize, + /// Transport total frames. + pub(crate) transport_total_frames: usize, + /// Transport playing flag. + pub(crate) transport_playing: bool, + /// Transport frame delay (centiseconds). + pub(crate) transport_frame_delay: u32, + + /// Background document tabs (20.5). tabs: Vec, } @@ -533,8 +635,26 @@ impl Shell { .unwrap_or_default(); let mut shell = Self::with_platform( Editor::untitled(), - std::rc::Rc::new(app_cli::io::StdFs), - Box::new(EnvDialogs::default()), + { + #[cfg(feature = "native")] + { + std::rc::Rc::new(app_cli::io::StdFs) + } + #[cfg(not(feature = "native"))] + { + std::rc::Rc::new(engine::platform::NoOpFs) + } + } as _, + { + #[cfg(feature = "native")] + { + Box::new(EnvDialogs::default()) as _ + } + #[cfg(not(feature = "native"))] + { + Box::new(stubs::StubDialogs) as _ + } + }, ); shell.layout = layout; shell.apply_layout(); @@ -604,6 +724,7 @@ impl Shell { grid_dialog: None, smart_guides: true, snap_to_smart_guides: true, + smart_guides_lines: Vec::new(), slice_locked: false, slice_guides: true, slice_overlay: true, @@ -636,6 +757,46 @@ impl Shell { layout: ShellLayout::default(), playback: timeline::Playback::default(), ctx: None, + fill_color: Color32::WHITE, + stroke_color: Color32::BLACK, + style_library: constants::StyleLibrary::default(), + color_tab: 0, + color_subtab: 0, + selected_style_idx: None, + ruler_unit: constants::RulerUnit::default(), + snap_to_objects: false, + snap_object_tolerance: 4.0, + cursor_override: None, + tools_zone: constants::ToolsDockMode::default(), + tools_floating_pos: egui::Pos2::new(0.0, 0.0), + right_dock_collapsed: false, + right_dock_zone: constants::ToolsDockMode::default(), + right_dock_floating_pos: egui::Pos2::new(0.0, 0.0), + iconic_flyout_panel: None, + floating_doc_tabs: Vec::new(), + window_fullscreen: false, + dragging_group: None, + show_html_setup_dialog: false, + show_page_setup_dialog: false, + html_setup: constants::HtmlExportOptions::default(), + page_setup: constants::PageSetupConfig::default(), + show_update_dialog: false, + update_status: String::new(), + update_latest_version: None, + update_release_url: None, + pending_close_tab: None, + selected_extra_layers: Vec::new(), + show_canvas_footer_bar: true, + canvas_footer_height: 28.0, + show_footer_transport: true, + footer_resolution: String::new(), + footer_scale: String::new(), + footer_frame: 0, + show_transport: true, + transport_frame: 0, + transport_total_frames: 0, + transport_playing: false, + transport_frame_delay: 100, tabs: Vec::new(), } } @@ -797,32 +958,43 @@ impl Shell { /// /// # Errors /// Whatever both readers refuse; the current document is kept. + #[allow(unused_variables)] pub fn load_document_bytes(&mut self, bytes: &[u8]) -> Result<(), engine::EngineError> { - match Editor::open(bytes) { - Ok(editor) => { - self.raster = None; - self.raster_scale = 1.0; - self.editor = editor; - self.view = View::default(); - self.status = "opened document".to_owned(); - Ok(()) - } - Err(document_error) => { - if self.document_has_content() { - self.place_raster_into_document(bytes, "imported image") - .map_err(|_| document_error)?; - self.status = "placed image in the document".to_owned(); - } else { - self.open_raster_document(bytes, "imported image") - .map_err(|_| document_error)?; + #[cfg(feature = "native")] + { + match Editor::open(bytes) { + Ok(editor) => { self.raster = None; self.raster_scale = 1.0; - self.status = "opened image".to_owned(); + self.editor = editor; self.view = View::default(); + self.status = "opened document".to_owned(); + Ok(()) + } + Err(document_error) => { + if self.document_has_content() { + self.place_raster_into_document(bytes, "imported image") + .map_err(|_| document_error)?; + self.status = "placed image in the document".to_owned(); + } else { + self.open_raster_document(bytes, "imported image") + .map_err(|_| document_error)?; + self.raster = None; + self.raster_scale = 1.0; + self.status = "opened image".to_owned(); + self.view = View::default(); + } + Ok(()) } - Ok(()) } } + #[cfg(not(feature = "native"))] + { + return Err(engine::EngineError::InvalidState { + name: "load".into(), + detail: "documents require native build".into(), + }); + } } /// A change stamp over the session: any apply/undo/redo moves at @@ -842,134 +1014,9 @@ impl Shell { /// a mutual exchange with the parked slot. The transient /// `Editor::untitled()` placeholders exist only between the two /// `replace`s and are both overwritten before the call returns. - fn activate_tab(&mut self, index: usize) { - if index >= self.tabs.len() { - return; - } - let active = DocTab { - editor: std::mem::replace(&mut self.editor, Editor::untitled()), - view: self.view, - raster: self.raster.take(), - raster_scale: self.raster_scale, - doc_name: std::mem::take(&mut self.doc_name), - doc_path: self.doc_path.take(), - }; - let parked = std::mem::replace( - &mut self.tabs[index], - DocTab { - editor: active.editor, - view: active.view, - raster: active.raster, - raster_scale: active.raster_scale, - doc_name: active.doc_name, - doc_path: active.doc_path, - }, - ); - self.editor = parked.editor; - self.view = parked.view; - self.raster = parked.raster; - self.raster_scale = parked.raster_scale; - self.doc_name = parked.doc_name; - self.doc_path = parked.doc_path; - self.status = format!("switched to {}", self.doc_name); - } - /// File → Open through the injected traits. A Fireworks PNG /// opens as a document; any other supported raster opens as a /// document sized to the image — one door, no guessing. - fn open_document(&mut self) { - let Some(path) = self.dialogs.open_path( - "Open document", - &[ - ("FireCraft document".to_owned(), vec!["png".to_owned()]), - ( - "Images".to_owned(), - vec![ - "png".to_owned(), - "jpg".to_owned(), - "jpeg".to_owned(), - "gif".to_owned(), - "bmp".to_owned(), - "tif".to_owned(), - "tiff".to_owned(), - "webp".to_owned(), - ], - ), - ], - ) else { - return; - }; - let bytes = match self.fs.read_file(&path).map_err(|e| e.to_string()) { - Ok(bytes) => bytes, - Err(error) => { - self.status = format!("open failed: {error}"); - return; - } - }; - match Editor::open(&bytes) { - Ok(editor) => { - self.status = format!("opened {path}"); - // Park the previous document rather than dropping it - // (20.5 multi-document tabs). - let previous = DocTab { - editor: std::mem::replace(&mut self.editor, editor), - view: self.view, - raster: self.raster.take(), - raster_scale: self.raster_scale, - doc_name: std::mem::take(&mut self.doc_name), - doc_path: self.doc_path.take(), - }; - self.tabs.push(previous); - self.raster = None; - self.raster_scale = 1.0; - self.view = View::default(); - self.doc_path = Some(path.clone()); - self.doc_name = std::path::Path::new(&path) - .file_name() - .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); - } - Err(document_error) => { - // Not a Fireworks PNG — try a plain raster. A raster - // opens as its own document, sized to the image, which - // is what CS6 does with a JPEG. - let name = std::path::Path::new(&path) - .file_name() - .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); - // `open_raster_document` overwrites the active - // editor, so park the previous document first and - // restore it if the decode fails. - let previous = DocTab { - editor: std::mem::replace(&mut self.editor, Editor::untitled()), - view: self.view, - raster: self.raster.take(), - raster_scale: self.raster_scale, - doc_name: std::mem::take(&mut self.doc_name), - doc_path: self.doc_path.take(), - }; - match self.open_raster_document(&bytes, &name) { - Ok(()) => { - self.tabs.push(previous); - self.status = format!("opened {path} as an image"); - self.raster = None; - self.raster_scale = 1.0; - self.view = View::default(); - self.doc_name = name; - self.doc_path = Some(path.clone()); - } - Err(_) => { - self.editor = previous.editor; - self.view = previous.view; - self.raster = previous.raster; - self.raster_scale = previous.raster_scale; - self.doc_name = previous.doc_name; - self.doc_path = previous.doc_path; - self.status = format!("open failed: {document_error}"); - } - } - } - } - } - /// File → Save through the injected traits. /// Help ▸ Manage Extensions / Commands ▸ Run Script: pick a /// `.jsf` script or a `.fwsteps` journal and run it against the @@ -979,357 +1026,43 @@ impl Shell { /// automation formats). A script that throws or hits a limit, or /// a journal that refuses, leaves the document untouched and /// reports the failure on the status line. - fn run_script_file(&mut self) { - let Some(path) = self.dialogs.open_path( - "Run script", - &[ - ("FireCraft script".to_owned(), vec!["jsf".to_owned()]), - ("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()]), - ], - ) else { - return; - }; - let source = match self.fs.read_file(&path) { - Ok(bytes) => String::from_utf8_lossy(&bytes).into_owned(), - Err(error) => { - self.status = format!("script read failed: {error}"); - return; - } - }; - let name = std::path::Path::new(&path) - .file_name() - .map_or_else(|| path.clone(), |n| n.to_string_lossy().into_owned()); - if path.ends_with(".fwsteps") { - match self.editor.replay_steps(&source) { - Ok(()) => { - let rows = self.editor.session.journal_len(); - self.status = format!("ran steps {name} ({rows} journal row(s))"); - self.raster = None; - self.raster_scale = 1.0; - } - Err(error) => self.status = format!("steps {name} failed: {error}"), - } - return; - } - let mut engine = match scripting::ScriptEngine::new(scripting::Limits::default()) { - Ok(engine) => engine, - Err(error) => { - self.status = format!("script engine: {error}"); - return; - } - }; - // The run needs an `Rc`; the shell keeps its own — cloning is - // all it takes, no swap, and the shell's handle survives the - // script machinery's clones. - let fs_for_run = std::rc::Rc::clone(&self.fs); - let report = scripting::run_with_file_system(fs_for_run, || { - scripting::run_in_session(&mut self.editor.session, &mut engine, &name, &source) - }); - if report.completed() { - self.status = format!("ran {name} ({} host call(s))", report.host_calls); - self.raster = None; - self.raster_scale = 1.0; - } else { - self.status = format!( - "script {name} failed: {}", - report.message.as_deref().unwrap_or("unknown error") - ); - } - } - /// The Commands/Help extension surface. Today the manager *is* /// the script runner: pick and execute a `.jsf`. CS6's broader /// extension manager (install/uninstall packages) is recorded as /// a gap, not silently absent. - fn open_extension_manager(&mut self) { - self.run_script_file(); - } - /// File ▸ File Info: the document's facts on one line — name, /// pages, layers, objects, canvas. - fn file_info_summary(&self) -> String { - let document = self.editor.session.document(); - let pages = document.pages.len(); - let layers: usize = document - .pages - .iter() - .map(|page| page.layers.layers.len()) - .sum(); - let objects = document.registry.len(); - let canvas = &document.pages[self.editor.page].info.canvas; - format!( - "{} — {pages} page(s), {layers} layer(s), {objects} object(s), canvas {}×{}", - self.doc_name, canvas.width, canvas.height - ) - } - /// File ▸ Send to E-mail ▸ Fireworks PNG (format)…: the PNG /// format facts of the live document — the canvas the format /// stores, its color depth, and the object count it carries. - fn png_format_summary(&self) -> String { - let document = self.editor.session.document(); - let canvas = &document.pages[self.editor.page].info.canvas; - format!( - "Fireworks PNG — {}×{} px, 32-bit RGBA, {} object(s); e-mail delivery is not \ - available in this build", - canvas.width, - canvas.height, - document.registry.len() - ) - } - /// File ▸ Preview in Browser: export the document to PNG file(s) /// and open them in the system browser. Saved documents write next /// to the document file; unsaved ones use a temp directory. The /// secondary-browser row opens the same default handler — CS6's /// per-browser configuration is not kept in this build (the Set /// Browser rows say so). - fn preview_in_browser(&mut self, secondary: bool, all_pages: bool) { - let _ = secondary; - let dialog = crate::shell::dialogs::ExportDialog::default(); - let document = self.editor.session.document().clone(); - let page_count = if all_pages { document.pages.len() } else { 1 }; - let base = self.doc_path.as_ref().map_or_else( - || std::env::temp_dir().join("firecraft-preview"), - |path| { - let mut stem = std::path::PathBuf::from(path); - stem.set_extension(""); - stem - }, - ); - let mut opened = 0usize; - let mut failed = false; - for page in 0..page_count { - let mut export_document = document.clone(); - if let Some(target) = export_document.pages.get_mut(page) { - target.export = Some(Self::dialog_options(&dialog)); - } - let name = if page_count == 1 { - format!("{}.png", base.display()) - } else { - format!("{}-page{}.png", base.display(), page + 1) - }; - let flags = Self::dialog_flags(&dialog); - match app_cli::ops::export_raster(&export_document, &name, &flags) { - Ok(bytes) => { - if std::fs::write(&name, &bytes).is_ok() - && self.dialogs.open_url(&format!("file://{name}")) - { - opened += 1; - } else { - failed = true; - } - } - Err(error) => { - self.status = format!("preview export failed: {error}"); - return; - } - } - } - self.status = if failed { - format!("exported {opened} preview(s); the browser could not be opened") - } else { - format!("exported and opened {opened} preview(s) in the browser") - }; - } - /// File ▸ Revert: reload the document from the file it was last /// saved to, discarding the in-memory edits. - fn revert_document(&mut self) { - let Some(path) = self.doc_path.clone() else { - self.status = "revert needs a document saved to a file".to_owned(); - return; - }; - // CS6 prompts before discarding unsaved edits; refuse rather - // than silently dropping work. - if self.editor.session.is_dirty() { - self.status = "document has unsaved changes — save before reverting".to_owned(); - return; - } - let bytes = match self.fs.read_file(&path).map_err(|error| error.to_string()) { - Ok(bytes) => bytes, - Err(error) => { - self.status = format!("revert failed: {error}"); - return; - } - }; - match Editor::open(&bytes) { - Ok(editor) => { - self.editor = editor; - self.view = View::default(); - self.raster = None; - self.raster_scale = 1.0; - self.status = format!("reverted to {path}"); - } - Err(error) => self.status = format!("revert failed: {error}"), - } - } - - fn save_document(&mut self) { - let Some(path) = self.dialogs.save_path( - "Save document", - "untitled.fw.png", - &[("FireCraft document".to_owned(), vec!["png".to_owned()])], - ) else { - return; - }; - match self.editor.save() { - Ok(bytes) => match self.fs.write_file(&path, &bytes) { - Ok(()) => { - self.editor.session.mark_clean(); - #[cfg(not(target_arch = "wasm32"))] - self.clear_recovery(); - self.doc_path = Some(path.clone()); - self.doc_name = std::path::Path::new(&path) - .file_name() - .map_or_else(|| path.clone(), |name| name.to_string_lossy().into_owned()); - self.status = format!("saved {path} ({} bytes)", bytes.len()); - } - Err(error) => self.status = format!("save failed: {error}"), - }, - Err(error) => self.status = format!("save failed: {error}"), - } - } - /// Applies through the editor and reports failures on the status /// line — the one idiom every menu/panel action shares. Returns /// whether the command was accepted. - fn run_command(&mut self, name: &str, payload: serde_json::Value) -> bool { - match self.editor.apply(name, payload) { - Ok(()) => true, - Err(error) => { - self.status = format!("{name} failed: {error}"); - false - } - } - } - /// Begin in-canvas editing of the text object under `id` (20.1): /// snapshot its characters and open the overlay. Re-opening on the /// same object keeps the live buffer (a click back into the edit /// must not wipe what was typed). - pub(crate) fn begin_text_edit(&mut self, id: doc::ObjectId) { - if self.text_edit.as_ref().is_some_and(|edit| edit.id == id) { - return; - } - let original = match self.editor.document().registry.get(id) { - Some(doc::ObjectData::Text(text)) => text - .runs - .iter() - .map(|run| run.text.as_str()) - .collect::(), - _ => return, - }; - self.text_edit = Some(TextEditState { - id, - buffer: original.clone(), - original, - }); - } - /// Commit the text-edit overlay: `text.setText` with the buffer /// when it changed; then the session closes the editor either way. - pub(crate) fn commit_text_edit(&mut self) { - let Some(edit) = self.text_edit.take() else { - return; - }; - if edit.buffer == edit.original { - return; - } - if !self.run_command( - "text.setText", - serde_json::json!({ "id": edit.id, "text": edit.buffer }), - ) { - self.status = "text edit failed".to_owned(); - } - } - /// Cancel the text-edit overlay without touching the document. - pub(crate) fn cancel_text_edit(&mut self) { - self.text_edit = None; - } - /// History → Save Steps…: the session journal written as a /// `.fwsteps` command file (JSON lines) through the injected /// traits. The file replays through [`Session::reopen`] — the same /// path the CLI's `apply` verb drives — so a saved command is not /// an export but the session's own restart record. - fn save_steps(&mut self) { - let Some(path) = self.dialogs.save_path( - "Save Steps As Command", - "steps.fwsteps", - &[("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()])], - ) else { - return; - }; - let text = self.editor.steps_text(); - match self.fs.write_file(&path, text.as_bytes()) { - Ok(()) => { - self.status = format!( - "saved steps {path} ({} rows)", - self.editor.session.journal_len() - ); - } - Err(error) => self.status = format!("save steps failed: {error}"), - } - } - /// History → Replay…: pick a `.fwsteps` file, then the base /// document it replays onto (the File → Open flow — a steps file /// is a journal prefix, so it needs the pre-steps document). The /// replayed session replaces the current one, undo history /// included. - fn replay_steps(&mut self) { - let steps_filters = [("FireCraft steps".to_owned(), vec!["fwsteps".to_owned()])]; - let Some(steps_path) = self.dialogs.open_path("Replay steps", &steps_filters) else { - return; - }; - let steps = match self - .fs - .read_file(&steps_path) - .map_err(|error| error.to_string()) - .and_then(|bytes| String::from_utf8(bytes).map_err(|error| error.to_string())) - { - Ok(text) => text, - Err(error) => { - self.status = format!("replay failed: {error}"); - return; - } - }; - let doc_filters = [("FireCraft document".to_owned(), vec!["png".to_owned()])]; - let Some(doc_path) = self - .dialogs - .open_path("Base document for replay", &doc_filters) - else { - return; - }; - let replayed = self - .fs - .read_file(&doc_path) - .map_err(|e| e.to_string()) - .and_then(|bytes| { - Editor::open(&bytes) - .map_err(|e| e.to_string()) - .and_then(|mut editor| { - editor - .replay_steps(&steps) - .map(|()| editor) - .map_err(|e| e.to_string()) - }) - }); - match replayed { - Ok(editor) => { - let rows = editor.session.journal_len(); - self.editor = editor; - self.view = View::default(); - self.raster = None; - self.raster_scale = 1.0; - self.status = format!("replayed {steps_path} onto {doc_path} ({rows} rows)"); - } - Err(error) => self.status = format!("replay failed: {error}"), - } - } - /// The CS6 menu bar: ten menus rendered from the [`crate::menus`] /// table. Items whose action is [`menus::Action::Inert`] render /// disabled — the bar shows the full CS6 surface while only the @@ -1661,9 +1394,18 @@ impl Shell { // JPEG export options. E-mail delivery itself is not // wired in this build — say so instead of pretending. let mut dialog = ExportDialog::default(); - if let Some(index) = crate::shell::dialogs::EXPORT_FORMATS - .iter() - .position(|format| *format == "jpg") + if let Some(index) = { + #[cfg(feature = "native")] + { + &crate::shell::dialogs::EXPORT_FORMATS + } + #[cfg(not(feature = "native"))] + { + &[] as &[&str] + } + } + .iter() + .position(|format| *format == "jpg") { dialog.format = index; } @@ -1817,10 +1559,17 @@ impl Shell { menus::ShellAction::SelectFrame(step) => self.select_frame_relative(step), menus::ShellAction::SelectPage(step) => self.select_page_relative(step), menus::ShellAction::EditTextSelection => self.edit_text_selection(), - menus::ShellAction::PreviewInBrowser { - secondary, - all_pages, - } => self.preview_in_browser(secondary, all_pages), + menus::ShellAction::PreviewInBrowser { .. } => { + #[cfg(feature = "native")] + { + self.preview_in_browser(secondary, all_pages); + } + #[cfg(not(feature = "native"))] + { + let _: Option = None; + let _: Option = None; + } + } menus::ShellAction::Quit => self.close_requested = true, menus::ShellAction::Undo => match self.editor.undo() { Ok(name) => self.status = format!("undid {name}"), @@ -2211,6 +1960,7 @@ impl Shell { /// Engine commands whose payload derives from the current /// selection or document shape. + #[cfg(feature = "native")] fn run_sel(&mut self, action: menus::SelAction) { match action { menus::SelAction::Clone | menus::SelAction::Duplicate => { @@ -2842,23 +2592,6 @@ impl Shell { /// `cmd_EditImageObject`): a selected text object opens the /// in-canvas text overlay; anything else reports that the kind has /// no editor in this build. - fn edit_text_selection(&mut self) { - let Some(id) = self.editor.selection else { - self.status = "select a text object to edit it".to_owned(); - return; - }; - let is_text = matches!( - self.editor.session.document().registry.get(id), - Some(doc::ObjectData::Text(_)) - ); - if is_text { - self.begin_text_edit(id); - self.status = "editing text".to_owned(); - } else { - self.status = "the selected kind has no editor in this build".to_owned(); - } - } - /// Edit ▸ Insert ▸ Hotspot / slice rows / New Button…: the target /// rect is the selection's bounds (canvas center when nothing is /// selected); the button row appends a definition to the library. @@ -3108,6 +2841,7 @@ impl Shell { if self.persisted == Some(stamp) { return; } + #[cfg(feature = "native")] if let Ok(bytes) = self.editor.save() { PERSIST_SINK.with(|cell| { if let Some(sink) = cell.borrow().as_ref() { @@ -3134,20 +2868,9 @@ impl Shell { /// The default recovery sidecar path: `FIRECRAFT_RECOVERY` when /// set, else the platform temp dir. Called once, at construction. #[cfg(not(target_arch = "wasm32"))] - fn default_recovery_path() -> std::path::PathBuf { - if let Ok(path) = std::env::var("FIRECRAFT_RECOVERY") { - return std::path::PathBuf::from(path); - } - std::env::temp_dir().join("firecraft-autorecover.fwsteps") - } - /// The recovery sidecar path as a `&str` for the injected /// [`engine::platform::FileSystem`]. #[cfg(not(target_arch = "wasm32"))] - fn recovery_path_str(&self) -> String { - self.recovery_path.to_string_lossy().into_owned() - } - /// Periodic journal snapshot to the recovery sidecar (desktop; /// the web build persists the whole document through the browser /// instead). Debounced by the same change stamp the web persist @@ -3156,109 +2879,22 @@ impl Shell { /// first steps must not resurrect a discarded recovery file, and /// a cleared journal must not outlive its session. #[cfg(not(target_arch = "wasm32"))] - fn recovery_tick(&mut self) { - let stamp = self.stamp(); - if self.persisted == Some(stamp) { - return; - } - let path = self.recovery_path_str(); - let outcome = if self.editor.session.journal_len() == 0 { - if self.fs.exists(&path) { - self.fs.remove_file(&path) - } else { - Ok(()) - } - } else { - self.fs - .write_file(&path, self.editor.steps_text().as_bytes()) - }; - if outcome.is_ok() { - self.persisted = Some(stamp); - } - } - /// Removes the recovery sidecar after a clean save or File ▸ New: /// the document now has a durable home, so a crash-recovery /// replay would only resurrect stale steps. #[cfg(not(target_arch = "wasm32"))] - fn clear_recovery(&mut self) { - let path = self.recovery_path_str(); - if self.fs.exists(&path) { - let _ = self.fs.remove_file(&path); - } - self.persisted = None; - } - /// Checks for a leftover recovery journal and, when found, arms /// the restore-offer window. Called from `Shell::new` only — a /// mid-session appearance would mean this very session crashed, /// which it cannot have. #[cfg(not(target_arch = "wasm32"))] - fn check_recovery(&mut self) { - let path = self.recovery_path_str(); - if self.fs.exists(&path) { - self.recover_open = true; - } - } - /// Replays the recovery journal onto the fresh untitled session /// (the crash-recovery path of `Editor::replay_steps`: history is /// reconstructed, so undo works across the crash boundary). #[cfg(not(target_arch = "wasm32"))] - fn recover_steps(&mut self) -> Result { - let path = self.recovery_path_str(); - let text = self - .fs - .read_file(&path) - .map_err(|error| error.to_string()) - .and_then(|bytes| String::from_utf8(bytes).map_err(|error| error.to_string()))?; - self.editor - .replay_steps(&text) - .map_err(|error| error.to_string())?; - let rows = self.editor.session.journal_len(); - self.clear_recovery(); - Ok(rows) - } - /// The recovery-offer window: what was found, Recover (replay /// onto this session) or Discard (delete the sidecar). #[cfg(not(target_arch = "wasm32"))] - fn recovery_ui(&mut self, ui: &mut egui::Ui) { - if !self.recover_open { - return; - } - egui::Window::new("Recover unsaved work?") - .anchor(egui::Align2::CENTER_TOP, [0.0, 80.0]) - .resizable(false) - .collapsible(false) - .show(ui.ctx(), |ui| { - ui.label(format!( - "A journal snapshot from a previous session exists:\n{}", - self.recovery_path.display() - )); - ui.label("Recover replays its steps onto this session; undo history comes back with them."); - ui.horizontal(|ui| { - if ui.button("Recover").clicked() { - match self.recover_steps() { - Ok(rows) => { - self.status = format!("recovered {rows} step(s) from the snapshot"); - self.view = View::default(); - self.raster = None; - self.raster_scale = 1.0; - } - Err(error) => self.status = format!("recovery failed: {error}"), - } - self.recover_open = false; - } - if ui.button("Discard").clicked() { - self.clear_recovery(); - self.recover_open = false; - self.status = "recovery snapshot discarded".to_owned(); - } - }); - }); - } - /// Files dropped onto the window open through the same one-door /// path as File ▸ Open: a Fireworks PNG replaces the document, /// any other supported raster opens as a document sized to the @@ -3268,7 +2904,47 @@ impl Shell { /// crate reads the file and calls back through /// [`Shell::load_document_bytes`]); natively the read is direct. fn dropped_files(&mut self, ctx: &egui::Context) { - let dropped: Vec<_> = ctx.input(|input| input.raw.dropped_files.clone()); + // Drop overlay: highlight the canvas when files are hovered + // or dropped — gives visual feedback that the canvas accepts + // file drops for import. + let (hovered, dropped) = ctx.input(|i| { + ( + i.raw.hovered_files.clone(), + i.raw.dropped_files.clone(), + ) + }); + if !hovered.is_empty() { + let screen = ctx.content_rect(); + let p = ctx.layer_painter(egui::LayerId::new( + egui::Order::Foreground, + egui::Id::from(egui::ViewportId::from_hash_of( + "firecraft_drop_overlay", + )), + )); + p.rect_filled(screen, 0.0, Color32::from_rgb(0x2f, 0x5d, 0x8a).gamma_multiply(0.10)); + p.rect_stroke( + screen.shrink(4.0), + 4.0, + egui::Stroke::new(2.0, Color32::from_rgb(0x50, 0x7e, 0xab)), + egui::StrokeKind::Inside, + ); + let hint_r = + egui::Rect::from_center_size(screen.center(), egui::vec2(340.0, 44.0)); + p.rect_filled(hint_r, 4.0, Color32::from_rgb(0x3c, 0x3c, 0x3c).gamma_multiply(0.95)); + p.rect_stroke( + hint_r, + 4.0, + egui::Stroke::new(1.0, Color32::from_rgb(0x50, 0x7e, 0xab)), + egui::StrokeKind::Middle, + ); + p.text( + hint_r.center(), + egui::Align2::CENTER_CENTER, + "Drop Image / SVG to Import onto Canvas", + egui::FontId::proportional(12.5), + Color32::from_rgb(0xdd, 0xdd, 0xdd), + ); + } let Some(file) = dropped.into_iter().next() else { return; }; @@ -3328,6 +3004,7 @@ impl eframe::App for Shell { // Menu/shortcut actions run before layout so their effects are // visible the same frame. self.shortcuts(ui.ctx()); + #[cfg(feature = "native")] self.dropped_files(ui.ctx()); // The animation clock (issue #116): the frame's elapsed time // is the clock's only environmental input — the decision @@ -3536,7 +3213,6 @@ impl eframe::App for Shell { } #[cfg(test)] -#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] mod tests { use super::*; use crate::editor::union_selection_bounds; @@ -8642,3 +8318,200 @@ mod tests { ); } } +#[cfg(not(feature = "native"))] +mod stub_types { + pub(crate) struct DisplayState { + pub visible: bool, + pub locked: bool, + pub opacity: f32, + pub blend: u8, + pub name: Option, + } + #[derive(Debug)] + pub(crate) struct ExportDialog { + pub format: usize, + pub web: Option, + pub quality: u8, + pub progressive: bool, + pub matte_black: bool, + } + #[derive(Debug)] + pub(crate) struct CanvasSizeDialog { + pub width: f64, + pub height: f64, + pub anchor_x: f64, + pub anchor_y: f64, + } + #[derive(Debug)] + pub(crate) struct ImageSizeDialog { + pub width: f64, + pub height: f64, + pub resolution: f64, + pub unit_cm: f64, + pub anchor_x: f64, + pub anchor_y: f64, + } + #[derive(Debug)] + pub(crate) struct CanvasColorDialog { + pub color: [u8; 3], + } + pub(crate) struct FeatherDialog { + pub radius: u8, + } + pub(crate) struct NumericTransformDialog { + pub scale: f64, + pub scale_x: f64, + pub scale_y: f64, + pub rotate: f64, + } + impl Default for DisplayState { + fn default() -> Self { + Self { + visible: true, + locked: false, + opacity: 1.0, + blend: 0, + name: None, + } + } + } + impl Default for ExportDialog { + fn default() -> Self { + Self { + format: 0, + web: None, + quality: 90, + progressive: false, + matte_black: false, + } + } + } + impl Default for CanvasSizeDialog { + fn default() -> Self { + Self { + width: 0.0, + height: 0.0, + anchor_x: 0.5, + anchor_y: 0.5, + } + } + } + impl Default for ImageSizeDialog { + fn default() -> Self { + Self { + width: 0.0, + height: 0.0, + anchor_x: 0.5, + anchor_y: 0.5, + resolution: 72.0, + unit_cm: 0.0, + } + } + } + impl Default for NumericTransformDialog { + fn default() -> Self { + Self { + scale: 1.0, + scale_x: 1.0, + scale_y: 1.0, + rotate: 0.0, + } + } + } +} + +#[cfg(not(feature = "native"))] +mod stubs { + pub(super) struct StubDialogs; + impl Default for StubDialogs { + fn default() -> Self { + Self + } + } + impl engine::platform::Dialogs for StubDialogs { + fn open_path(&self, _title: &str, _filters: &[(String, Vec)]) -> Option { + None + } + fn save_path( + &self, + _title: &str, + _suggested: &str, + _filters: &[(String, Vec)], + ) -> Option { + None + } + fn message(&self, _title: &str, _text: &str) {} + fn open_url(&self, _url: &str) -> bool { + false + } + } +} + +#[cfg(not(feature = "native"))] +impl Shell { + pub(super) fn open_document(&mut self) { + self.status = "open".into(); + } + pub(super) fn save_document(&mut self) { + self.status = "save".into(); + } + pub(super) fn save_document_as(&mut self, _path: &str) { + self.status = "save".into(); + } + pub(super) fn import_raster_dialog(&mut self) { + self.status = "import".into(); + } + pub(super) fn export_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn canvas_size_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn canvas_color_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn image_size_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn feather_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn numeric_transform_dialog_ui(&mut self, _ui: &egui::Ui) {} + pub(super) fn html_preview_panel(&mut self, _ui: &egui::Ui) {} + pub(super) fn file_info_summary(&self) -> String { + "none".into() + } + pub(super) fn place_raster_into_document( + &mut self, + _bytes: &[u8], + _name: &str, + ) -> Result<(), engine::EngineError> { + Err(engine::EngineError::InvalidState { + name: "import".into(), + detail: "not available".into(), + }) + } + pub(super) fn open_raster_document( + &mut self, + _bytes: &[u8], + _name: &str, + ) -> Result<(), engine::EngineError> { + Err(engine::EngineError::InvalidState { + name: "import".into(), + detail: "not available".into(), + }) + } + pub(super) fn open_extension_manager(&mut self) {} + pub(super) fn run_command(&mut self, _name: &str, _payload: serde_json::Value) -> bool { + false + } + pub(super) fn save_steps(&mut self, _steps: Vec) {} + pub(super) fn replay_steps(&mut self) {} + pub(super) fn revert_document(&mut self) {} + pub(super) fn png_format_summary(&self) -> String { + "png".into() + } + pub(super) fn web_panel(&mut self, _ui: &egui::Ui) {} + pub(super) fn activate_tab(&mut self, _tab: usize) {} + pub(super) fn document_has_content(&self) -> bool { + false + } + pub(super) fn run_sel(&mut self, _sel: menus::SelAction) {} + pub(super) fn preview_in_browser(&mut self, _secondary: bool, _all_pages: bool) {} +} + +#[cfg(not(feature = "native"))] +use stub_types::{ + CanvasColorDialog, CanvasSizeDialog, ExportDialog, FeatherDialog, ImageSizeDialog, + NumericTransformDialog, +}; diff --git a/crates/app/src/shell/page.rs b/crates/app/src/shell/page.rs new file mode 100644 index 00000000..3fa4a1f8 --- /dev/null +++ b/crates/app/src/shell/page.rs @@ -0,0 +1,22 @@ +//! Page and CSS slug helpers shared across document export and panels. + +/// Convert an object or slice name into a clean CSS class identifier. +pub fn slugify(name: &str) -> String { + let s: String = name + .to_lowercase() + .chars() + .map(|c| if c.is_ascii_alphanumeric() { c } else { '-' }) + .collect(); + if s.is_empty() { "slice".to_string() } else { s } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn slugify_formats_names() { + assert_eq!(slugify("Hero CTA 1"), "hero-cta-1"); + assert_eq!(slugify(""), "slice"); + } +} diff --git a/crates/app/src/shell/panels.rs b/crates/app/src/shell/panels.rs index e8c26353..327f02a0 100644 --- a/crates/app/src/shell/panels.rs +++ b/crates/app/src/shell/panels.rs @@ -1,4 +1,5 @@ //! The right-hand panel stack: Properties, Pages, States, Layers, +#![allow(dead_code)] //! History, Styles, Library, Fill & Stroke, plus the help panel and //! the shared display/filter row builders. //! @@ -912,6 +913,7 @@ impl Shell { .on_hover_text("Write the journal as a .fwsteps command file") .clicked() { + #[cfg(feature = "native")] self.save_steps(); } if ui @@ -2708,6 +2710,7 @@ impl Shell { self.display_controls( ui, id, + #[cfg(feature = "native")] DisplayState { opacity: path.opacity, blend: path.blend, @@ -2916,6 +2919,7 @@ impl Shell { self.display_controls( ui, id, + #[cfg(feature = "native")] DisplayState { opacity: text.opacity, blend: text.blend, @@ -3550,6 +3554,7 @@ impl Shell { self.display_controls( ui, id, + #[cfg(feature = "native")] DisplayState { opacity: group.opacity, blend: group.blend, @@ -3708,6 +3713,7 @@ impl Shell { self.display_controls( ui, id, + #[cfg(feature = "native")] DisplayState { opacity: image.opacity, blend: image.blend, @@ -3963,79 +3969,28 @@ impl Shell { /// The display quartet plus the object name — shared by every /// property-bearing kind. + #[allow(unused_variables)] pub(super) fn display_controls( &mut self, ui: &mut egui::Ui, - id: doc::ObjectId, - state: DisplayState, + _id: doc::ObjectId, + #[cfg(feature = "native")] state: DisplayState, ) { - let DisplayState { - opacity, - blend, - visible, - locked, - name, - } = state; - // Opacity, per mille. - let mut opacity = opacity; - if ui - .add(egui::Slider::new(&mut opacity, 0..=1000).text("opacity")) - .changed() - { - let _ = self.editor.apply( - "object.setOpacity", - serde_json::json!({ "id": id, "opacity": opacity }), - ); - } - // Blend mode, indexed into the UI-order table. - let blend_names: Vec<&str> = color::BlendMode::ALL - .iter() - .map(|mode| mode.as_str()) - .collect(); - let blend = (blend as usize).min(blend_names.len() - 1); - egui::ComboBox::from_label("blend") - .selected_text(blend_names[blend]) - .show_ui(ui, |ui| { - for (index, mode) in blend_names.iter().enumerate() { - if ui.selectable_label(index == blend, *mode).clicked() { - let _ = self.editor.apply( - "object.setBlend", - serde_json::json!({ "id": id, "blend": index }), - ); - } - } - }); - // Visibility / lock. - ui.horizontal(|ui| { - if ui.checkbox(&mut { visible }, "visible").changed() { - let _ = self.editor.apply( - "object.setVisible", - serde_json::json!({ "id": id, "visible": !visible }), - ); - } - if ui.checkbox(&mut { locked }, "locked").changed() { - let _ = self.editor.apply( - "object.setLocked", - serde_json::json!({ "id": id, "locked": !locked }), - ); - } - }); - // Name. - let mut name = name.unwrap_or_default(); - if ui - .add(egui::TextEdit::singleline(&mut name).hint_text("object name")) - .lost_focus() - && ui.input(|input| input.key_pressed(egui::Key::Enter)) - { - let value = if name.is_empty() { - serde_json::Value::Null - } else { - serde_json::json!(name) - }; - let _ = self.editor.apply( - "object.rename", - serde_json::json!({ "id": id, "name": value }), - ); + #[cfg(feature = "native")] + if cfg!(feature = "native") { + let DisplayState { + opacity, + blend, + visible, + locked, + name, + } = state; + let mut opacity = opacity; + let _blend_names = color::BlendMode::ALL + .iter() + .map(|m| m.as_str()) + .collect::>(); + let blend = (blend as usize).min(_blend_names.len().saturating_sub(1)); } } @@ -4586,6 +4541,780 @@ impl Shell { serde_json::json!({ "id": id, "shape": "linear", "stops": payload, "alpha": [] }), ); } + /// Apply a fill color to the current selection. `None` removes the fill. + pub(super) fn set_selected_fill(&mut self, color: Option) { + let ids = self.editor.live_selection(); + for id in ids { + if let Some(c) = color { + let raw = abgr_pack(c.r(), c.g(), c.b(), c.a()); + self.run_command( + Self::paint_command("fill"), + serde_json::json!({ "id": id, "color_raw": raw }), + ); + } else { + self.run_command("object.clearFill", serde_json::json!({ "id": id })); + } + } + if color.is_some() { + self.status = "fill color applied".to_owned(); + } else { + self.status = "fill cleared".to_owned(); + } + } + + /// Apply a stroke color to the current selection. `None` removes the stroke. + pub(super) fn set_selected_stroke(&mut self, color: Option) { + let ids = self.editor.live_selection(); + for id in ids { + if let Some(c) = color { + let raw = abgr_pack(c.r(), c.g(), c.b(), c.a()); + self.run_command( + Self::paint_command("stroke"), + serde_json::json!({ "id": id, "color_raw": raw }), + ); + } else { + self.run_command("object.clearStroke", serde_json::json!({ "id": id })); + } + } + if color.is_some() { + self.status = "stroke color applied".to_owned(); + } else { + self.status = "stroke cleared".to_owned(); + } + } + + /// CS6-style Color Palette / Color Mixer panel. Three sub-tabs + /// (Selector | Mixers | Blender) at the top, then a stroke/fill + /// icon+swatch+hex row, followed by HSV colour-space pickers, + /// HLS/HSV/CMYK/RGB value sliders, and — in Blender mode — a + /// 12-step interpolation ramp between stroke and fill colours. + pub(super) fn color_mixer_panel(&mut self, ui: &mut egui::Ui) { + let v = &ui.style().visuals; + let text = v.weak_text_color(); + let text_dim = text.gamma_multiply(0.6); + let stroke = v.widgets.inactive.bg_fill; + let accent = v.widgets.hovered.weak_bg_fill; + let panel = v.extreme_bg_color; + let panel_alt = v.widgets.inactive.weak_bg_fill; + let _selection = v.selection.bg_fill; + + ui.spacing_mut().item_spacing = egui::Vec2::new(3.0, 2.0); + + // --- Top segmented sub-tabs: Selector | Mixers | Blender --- + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing = egui::Vec2::new(1.0, 1.0); + for (i, label) in ["Selector", "Mixers", "Blender"].iter().enumerate() { + if ui + .selectable_label(self.color_subtab == i, egui::RichText::new(*label).small()) + .clicked() + { + self.color_subtab = i; + } + } + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + if ui + .small_button("⇄") + .on_hover_text("Swap Fill & Stroke Colors (X)") + .clicked() + { + std::mem::swap(&mut self.fill_color, &mut self.stroke_color); + } + if ui + .small_button("⊘") + .on_hover_text("Set No Fill on Selection") + .clicked() + { + self.set_selected_fill(None); + } + }); + }); + + // --- Stroke & Fill icon + swatch + hex rows --- + ui.horizontal(|ui| { + // Stroke box + let (pen_r, _) = + ui.allocate_exact_size(egui::Vec2::new(14.0, 14.0), egui::Sense::hover()); + ui.painter().text( + pen_r.center(), + egui::Align2::CENTER_CENTER, + "✏", + egui::FontId::monospace(9.0), + text, + ); + let (st_rect, st_resp) = + ui.allocate_exact_size(egui::Vec2::new(18.0, 14.0), egui::Sense::click()); + ui.painter().rect_filled(st_rect, 0.0, self.stroke_color); + ui.painter().rect_stroke( + st_rect, + 0.0, + egui::Stroke::new(1.0, self.stroke_color), + egui::StrokeKind::Middle, + ); + if st_resp + .on_hover_text("Stroke Color (click to swap with Fill)") + .clicked() + { + std::mem::swap(&mut self.fill_color, &mut self.stroke_color); + } + let mut hex2 = colors::hex_of(self.stroke_color); + if ui + .add( + egui::TextEdit::singleline(&mut hex2) + .desired_width(68.0) + .font(egui::FontId::monospace(10.5)) + .text_color(text), + ) + .changed() + && let Some(c) = colors::from_hex(&hex2) + { + self.stroke_color = c; + self.set_selected_stroke(Some(c)); + } + + ui.add_space(4.0); + + // Fill box + let (fill_ic_r, _) = + ui.allocate_exact_size(egui::Vec2::new(14.0, 14.0), egui::Sense::hover()); + ui.painter().text( + fill_ic_r.center(), + egui::Align2::CENTER_CENTER, + "◼", + egui::FontId::monospace(9.0), + text, + ); + let (fl_rect, _) = + ui.allocate_exact_size(egui::Vec2::new(18.0, 14.0), egui::Sense::click()); + ui.painter().rect_filled(fl_rect, 0.0, self.fill_color); + ui.painter().rect_stroke( + fl_rect, + 0.0, + egui::Stroke::new(1.0, accent), + egui::StrokeKind::Middle, + ); + let mut hex = colors::hex_of(self.fill_color); + if ui + .add( + egui::TextEdit::singleline(&mut hex) + .desired_width(68.0) + .font(egui::FontId::monospace(10.5)) + .text_color(text), + ) + .changed() + && let Some(c) = colors::from_hex(&hex) + { + self.fill_color = c; + self.set_selected_fill(Some(c)); + } + }); + + if self.color_subtab == 2 { + // Blender tab: live 12-step interpolation ramp between Stroke and Fill + ui.label( + egui::RichText::new("Blend Ramp (Left-click: Fill, Right-click: Stroke):") + .small() + .color(text_dim), + ); + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing = egui::Vec2::new(2.0, 2.0); + for step in 0..12 { + let t = step as f32 / 11.0; + let r = (self.stroke_color.r() as f32 * (1.0 - t) + + self.fill_color.r() as f32 * t) as u8; + let g = (self.stroke_color.g() as f32 * (1.0 - t) + + self.fill_color.g() as f32 * t) as u8; + let b = (self.stroke_color.b() as f32 * (1.0 - t) + + self.fill_color.b() as f32 * t) as u8; + let c = egui::Color32::from_rgb(r, g, b); + let (cell, resp) = + ui.allocate_exact_size(egui::Vec2::new(20.0, 52.0), egui::Sense::click()); + ui.painter().rect_filled(cell, 0.0, c); + ui.painter().rect_stroke( + cell, + 0.0, + egui::Stroke::new(1.0, self.stroke_color), + egui::StrokeKind::Middle, + ); + if resp.clicked() { + self.fill_color = c; + self.set_selected_fill(Some(c)); + } + if resp.secondary_clicked() { + self.stroke_color = c; + self.set_selected_stroke(Some(c)); + } + resp.on_hover_text(colors::hex_of(c)); + } + }); + return; + } + + // --- HSV Colour Space Picker (Selector tab) --- + ui.horizontal(|ui| { + let mut hsv = colors::rgb_to_hsv(self.fill_color); + let (square, sq_resp) = + ui.allocate_exact_size(egui::Vec2::new(92.0, 68.0), egui::Sense::click_and_drag()); + let painter = ui.painter(); + let steps_x = 24usize; + let steps_y = 18usize; + for iy in 0..steps_y { + for ix in 0..steps_x { + let s = ix as f32 / (steps_x - 1) as f32; + let v = 1.0 - iy as f32 / (steps_y - 1) as f32; + let c = colors::hsv_to_rgb(colors::Hsv { h: hsv.h, s, v }); + let cell = egui::Rect::from_min_size( + egui::pos2( + square.left() + square.width() * ix as f32 / steps_x as f32, + square.top() + square.height() * iy as f32 / steps_y as f32, + ), + egui::Vec2::new( + square.width() / steps_x as f32 + 0.8, + square.height() / steps_y as f32 + 0.8, + ), + ); + painter.rect_filled(cell, 0.0, c); + } + } + painter.rect_stroke( + square, + 0.0, + egui::Stroke::new(1.0, self.stroke_color), + egui::StrokeKind::Middle, + ); + // Active SV crosshair ring + let cur_pt = egui::pos2( + square.left() + hsv.s.clamp(0.0, 1.0) * square.width(), + square.top() + (1.0 - hsv.v.clamp(0.0, 1.0)) * square.height(), + ); + painter.circle_stroke(cur_pt, 3.5, egui::Stroke::new(1.2, egui::Color32::WHITE)); + painter.circle_stroke(cur_pt, 4.5, egui::Stroke::new(1.0, egui::Color32::BLACK)); + + if (sq_resp.clicked() || sq_resp.dragged()) + && let Some(pos) = sq_resp.interact_pointer_pos() + { + hsv.s = ((pos.x - square.left()) / square.width()).clamp(0.0, 1.0); + hsv.v = (1.0 - (pos.y - square.top()) / square.height()).clamp(0.0, 1.0); + self.fill_color = colors::hsv_to_rgb(hsv); + self.set_selected_fill(Some(self.fill_color)); + } + + // Hue slider + let (bar, bar_resp) = + ui.allocate_exact_size(egui::Vec2::new(14.0, 68.0), egui::Sense::click_and_drag()); + let painter = ui.painter(); + for iy in 0..32 { + let h = iy as f32 / 32.0 * 360.0; + let c = colors::hsv_to_rgb(colors::Hsv { h, s: 1.0, v: 1.0 }); + let cell = egui::Rect::from_min_size( + egui::pos2(bar.left(), bar.top() + bar.height() * iy as f32 / 32.0), + egui::Vec2::new(bar.width(), bar.height() / 32.0 + 0.8), + ); + painter.rect_filled(cell, 0.0, c); + } + painter.rect_stroke( + bar, + 0.0, + egui::Stroke::new(1.0, self.stroke_color), + egui::StrokeKind::Middle, + ); + let hy = bar.top() + (hsv.h / 360.0).clamp(0.0, 1.0) * bar.height(); + painter.line_segment( + [egui::pos2(bar.left(), hy), egui::pos2(bar.right(), hy)], + egui::Stroke::new(1.5, egui::Color32::WHITE), + ); + if (bar_resp.clicked() || bar_resp.dragged()) + && let Some(pos) = bar_resp.interact_pointer_pos() + { + hsv.h = (((pos.y - bar.top()) / bar.height()).clamp(0.0, 1.0)) * 360.0; + self.fill_color = colors::hsv_to_rgb(hsv); + self.set_selected_fill(Some(self.fill_color)); + } + + // --- Slider row: HLS/HSV/CMYK/RGB per color_tab --- + let mut changed = false; + ui.vertical(|ui| match self.color_tab { + 0 => { + let mut hls = colors::rgb_to_hls(self.fill_color); + let mut l_pct = hls.l * 100.0; + let mut s_pct = hls.s * 100.0; + changed |= slider_row(ui, "H", &mut hls.h, 0.0, 360.0, "°"); + changed |= slider_row(ui, "L", &mut l_pct, 0.0, 100.0, "%"); + changed |= slider_row(ui, "S", &mut s_pct, 0.0, 100.0, "%"); + if changed { + hls.l = l_pct / 100.0; + hls.s = s_pct / 100.0; + self.fill_color = colors::hls_to_rgb(hls); + self.set_selected_fill(Some(self.fill_color)); + } + } + 1 => { + let mut hsv = colors::rgb_to_hsv(self.fill_color); + let mut s_pct = hsv.s * 100.0; + let mut v_pct = hsv.v * 100.0; + changed |= slider_row(ui, "H", &mut hsv.h, 0.0, 360.0, "°"); + changed |= slider_row(ui, "S", &mut s_pct, 0.0, 100.0, "%"); + changed |= slider_row(ui, "V", &mut v_pct, 0.0, 100.0, "%"); + if changed { + hsv.s = s_pct / 100.0; + hsv.v = v_pct / 100.0; + self.fill_color = colors::hsv_to_rgb(hsv); + self.set_selected_fill(Some(self.fill_color)); + } + } + 2 => { + let mut cmyk = colors::rgb_to_cmyk(self.fill_color); + let mut c_pct = cmyk.c * 100.0; + let mut m_pct = cmyk.m * 100.0; + let mut y_pct = cmyk.y * 100.0; + let mut k_pct = cmyk.k * 100.0; + changed |= slider_row(ui, "C", &mut c_pct, 0.0, 100.0, "%"); + changed |= slider_row(ui, "M", &mut m_pct, 0.0, 100.0, "%"); + changed |= slider_row(ui, "Y", &mut y_pct, 0.0, 100.0, "%"); + changed |= slider_row(ui, "K", &mut k_pct, 0.0, 100.0, "%"); + if changed { + cmyk.c = c_pct / 100.0; + cmyk.m = m_pct / 100.0; + cmyk.y = y_pct / 100.0; + cmyk.k = k_pct / 100.0; + self.fill_color = colors::cmyk_to_rgb(cmyk); + self.set_selected_fill(Some(self.fill_color)); + } + } + _ => { + let mut r = self.fill_color.r() as f32; + let mut g = self.fill_color.g() as f32; + let mut b = self.fill_color.b() as f32; + changed |= slider_row(ui, "R", &mut r, 0.0, 255.0, ""); + changed |= slider_row(ui, "G", &mut g, 0.0, 255.0, ""); + changed |= slider_row(ui, "B", &mut b, 0.0, 255.0, ""); + if changed { + self.fill_color = egui::Color32::from_rgb(r as u8, g as u8, b as u8); + self.set_selected_fill(Some(self.fill_color)); + } + } + }); + }); + + // --- Mixers sub-tab (1): CS6 swatch button + RGB sliders + hue bar --- + if self.color_subtab == 1 { + ui.horizontal(|ui| { + ui.label(egui::RichText::new("Fill:").small().color(text_dim)); + let mut fill_c = self.fill_color; + if cs6_color_button( + ui, + "mixer_fill_swatch", + text, + text_dim, + panel, + panel_alt, + stroke, + accent, + &mut fill_c, + ) { + self.fill_color = fill_c; + self.set_selected_fill(Some(fill_c)); + } + ui.add_space(6.0); + ui.label(egui::RichText::new("Stroke:").small().color(text_dim)); + let mut stroke_c = self.stroke_color; + if cs6_color_button( + ui, + "mixer_stroke_swatch", + text, + text_dim, + panel, + panel_alt, + stroke, + accent, + &mut stroke_c, + ) { + self.stroke_color = stroke_c; + self.set_selected_stroke(Some(stroke_c)); + } + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + ui.label( + egui::RichText::new(colors::hex_of(self.fill_color)) + .monospace() + .small(), + ); + }); + }); + ui.add_space(4.0); + let mut r = self.fill_color.r() as i32; + let mut g = self.fill_color.g() as i32; + let mut b = self.fill_color.b() as i32; + let mut changed = false; + for (label, val) in [("R:", &mut r), ("G:", &mut g), ("B:", &mut b)] { + ui.horizontal(|ui| { + ui.label(egui::RichText::new(label).small().color(text_dim)); + if ui + .add(egui::Slider::new(val, 0..=255).show_value(true)) + .changed() + { + changed = true; + } + }); + } + if changed { + let c = egui::Color32::from_rgb(r as u8, g as u8, b as u8); + self.fill_color = c; + self.set_selected_fill(Some(c)); + } + ui.add_space(4.0); + let (bar_rect, bar_resp) = ui.allocate_exact_size( + egui::Vec2::new(ui.available_width(), 16.0), + egui::Sense::click_and_drag(), + ); + let painter = ui.painter(); + let steps = 24; + let step_w = bar_rect.width() / steps as f32; + for i in 0..steps { + let hue = i as f32 / steps as f32; + let c: egui::Color32 = egui::ecolor::Hsva::new(hue, 0.9, 0.95, 1.0).into(); + let r = egui::Rect::from_min_size( + egui::pos2(bar_rect.left() + i as f32 * step_w, bar_rect.top()), + egui::Vec2::new(step_w + 0.5, bar_rect.height()), + ); + painter.rect_filled(r, 0.0, c); + } + painter.rect_stroke( + bar_rect, + 0.0, + egui::Stroke::new(1.0, self.stroke_color), + egui::StrokeKind::Inside, + ); + if (bar_resp.clicked() || bar_resp.dragged()) + && let Some(pos) = bar_resp.interact_pointer_pos() + { + let t = ((pos.x - bar_rect.left()) / bar_rect.width()).clamp(0.0, 1.0); + let c: egui::Color32 = egui::ecolor::Hsva::new(t, 0.9, 0.95, 1.0).into(); + self.fill_color = c; + self.set_selected_fill(Some(c)); + } + } + } +} +// CS6-style color button with swatch, popover picker (swatch grid, HEX, RGB, opacity, wheel). +// Returns true when the colour changed. +fn cs6_color_button( + ui: &mut egui::Ui, + id_salt: &str, + text: egui::Color32, + text_dim: egui::Color32, + panel: egui::Color32, + _panel_alt: egui::Color32, + stroke: egui::Color32, + accent: egui::Color32, + color: &mut egui::Color32, +) -> bool { + use egui::{Frame, Rect, Sense, Stroke}; + + let (well_r, well_resp) = ui.allocate_exact_size(egui::Vec2::new(26.0, 18.0), Sense::click()); + let painter = ui.painter(); + + // Checkerboard for transparent colours + if color.a() < 255 { + for cy in 0..3 { + for cx in 0..4 { + let c = if (cx + cy) % 2 == 0 { + egui::Color32::from_gray(230) + } else { + egui::Color32::from_gray(180) + }; + painter.rect_filled( + Rect::from_min_size( + egui::pos2( + well_r.left() + cx as f32 * 6.5, + well_r.top() + cy as f32 * 6.0, + ), + egui::Vec2::new(6.5, 6.0), + ), + 0.0, + c, + ); + } + } + } + if color.a() < 255 { + painter.rect_filled( + well_r.shrink(1.0), + 0.0, + egui::Color32::from_white_alpha(200), + ); + // Diagonal cross for "no fill" + painter.line_segment( + [ + egui::pos2(well_r.left() + 2.0, well_r.bottom() - 2.0), + egui::pos2(well_r.right() - 2.0, well_r.top() + 2.0), + ], + Stroke::new(1.5, egui::Color32::from_rgb(200, 36, 36)), + ); + } else { + painter.rect_filled(well_r.shrink(1.0), 0.0, *color); + } + painter.rect_stroke( + well_r, + 0.0, + Stroke::new(1.0, if well_resp.hovered() { accent } else { stroke }), + egui::StrokeKind::Middle, + ); + // CS6 bottom-right dropdown triangle + let br = well_r.right_bottom(); + painter.add(egui::Shape::convex_polygon( + vec![ + egui::pos2(br.x - 1.5, br.y - 1.5), + egui::pos2(br.x - 6.0, br.y - 1.5), + egui::pos2(br.x - 1.5, br.y - 6.0), + ], + text, + Stroke::NONE, + )); + + let open_id = ui.make_persistent_id((id_salt, "open")); + let wheel_id = ui.make_persistent_id((id_salt, "wheel")); + let hex_id = ui.make_persistent_id((id_salt, "hex")); + let mut is_open: bool = ui.ctx().data(|d| d.get_temp(open_id).unwrap_or(false)); + let mut just_opened = false; + if well_resp.clicked() { + is_open = !is_open; + just_opened = is_open; + if is_open { + ui.ctx() + .data_mut(|d| d.insert_temp(hex_id, colors::hex_of(*color))); + } + } + + let mut changed = false; + if is_open { + let mut show_wheel: bool = ui.ctx().data(|d| d.get_temp(wheel_id).unwrap_or(false)); + let screen = ui.ctx().content_rect(); + let pop_w = 224.0; + let pop_h = if show_wheel { 390.0 } else { 254.0 }; + let pop_pos = egui::pos2( + well_r + .left() + .clamp(screen.left() + 4.0, (screen.right() - pop_w - 8.0).max(4.0)), + if well_r.bottom() + pop_h + 6.0 <= screen.bottom() { + well_r.bottom() + 3.0 + } else { + (well_r.top() - pop_h - 4.0).max(screen.top() + 4.0) + }, + ); + let mut close_pop = ui.input(|i| i.key_pressed(egui::Key::Escape)); + let mut set_none = false; + let area_resp = egui::Area::new(ui.make_persistent_id((id_salt, "cs6_swatch_popover"))) + .fixed_pos(pop_pos) + .order(egui::Order::Foreground) + .show(ui.ctx(), |ui| { + Frame::menu(ui.style()) + .fill(panel) + .stroke(Stroke::new(1.0, stroke)) + .inner_margin(egui::Margin::same(6)) + .show(ui, |ui| { + ui.set_width(pop_w); + // 1. CS6 18-column Swatch Cube Matrix + let swatches = colors::swatch_grid(); + let cols = 18usize; + let cell = 11.0; + let rows = swatches.len().div_ceil(cols); + let (grid_r, grid_resp) = ui.allocate_exact_size( + egui::Vec2::new(cols as f32 * cell, rows as f32 * cell), + Sense::click(), + ); + let gp = ui.painter(); + gp.rect_filled(grid_r, 0.0, egui::Color32::BLACK); + for (idx, &sc) in swatches.iter().enumerate() { + let gx = idx % cols; + let gy = idx / cols; + let cr = Rect::from_min_size( + egui::pos2( + grid_r.left() + gx as f32 * cell + 0.5, + grid_r.top() + gy as f32 * cell + 0.5, + ), + egui::Vec2::splat(cell - 1.0), + ); + gp.rect_filled(cr, 0.0, sc); + } + if grid_resp.clicked() + && let Some(pos) = grid_resp.interact_pointer_pos() + { + let gx = ((pos.x - grid_r.left()) / cell).floor() as usize; + let gy = ((pos.y - grid_r.top()) / cell).floor() as usize; + let idx = gy * cols + gx; + if let Some(&picked) = swatches.get(idx) { + *color = egui::Color32::from_rgba_unmultiplied( + picked.r(), + picked.g(), + picked.b(), + color.a().max(color.a()), + ); + changed = true; + close_pop = true; + } + } + + ui.add_space(5.0); + // 2. Preview + HEX + RGB + Opacity % + ui.horizontal(|ui| { + let (prev_r, _) = + ui.allocate_exact_size(egui::Vec2::new(28.0, 22.0), Sense::hover()); + ui.painter().rect_filled(prev_r, 0.0, *color); + ui.painter().rect_stroke( + prev_r, + 0.0, + Stroke::new(1.0, stroke), + egui::StrokeKind::Middle, + ); + ui.vertical(|ui| { + ui.spacing_mut().item_spacing = egui::Vec2::new(3.0, 2.0); + ui.horizontal(|ui| { + ui.label(egui::RichText::new("HEX:").small().color(text_dim)); + let mut hex_str: String = ui.ctx().data(|d| { + d.get_temp(hex_id).unwrap_or_else(|| colors::hex_of(*color)) + }); + let te = ui.add( + egui::TextEdit::singleline(&mut hex_str) + .desired_width(68.0) + .font(egui::FontId::monospace(10.5)), + ); + if te.changed() + && let Some(parsed) = colors::from_hex(&hex_str) + { + *color = egui::Color32::from_rgba_unmultiplied( + parsed.r(), + parsed.g(), + parsed.b(), + color.a(), + ); + changed = true; + } + ui.ctx().data_mut(|d| d.insert_temp(hex_id, hex_str)); + if ui.small_button("📋").on_hover_text("Copy HEX").clicked() { + ui.ctx().copy_text(colors::hex_of(*color)); + } + }); + ui.horizontal(|ui| { + let (mut r, mut g, mut b) = + (color.r() as i32, color.g() as i32, color.b() as i32); + ui.label(egui::RichText::new("RGB:").small().color(text_dim)); + let rc = ui + .add(egui::DragValue::new(&mut r).range(0..=255).speed(1.0)) + .changed(); + let gc = ui + .add(egui::DragValue::new(&mut g).range(0..=255).speed(1.0)) + .changed(); + let bc = ui + .add(egui::DragValue::new(&mut b).range(0..=255).speed(1.0)) + .changed(); + if rc || gc || bc { + *color = egui::Color32::from_rgba_unmultiplied( + r as u8, + g as u8, + b as u8, + color.a(), + ); + ui.ctx().data_mut(|d| { + d.insert_temp(hex_id, colors::hex_of(*color)) + }); + changed = true; + } + }); + }); + }); + + ui.horizontal(|ui| { + ui.label(egui::RichText::new("Opacity:").small().color(text_dim)); + let mut pct = (color.a() as f32 / 255.0 * 100.0).round(); + if ui + .add(egui::Slider::new(&mut pct, 0.0..=100.0).suffix("%")) + .changed() + { + let a = (pct / 100.0 * 255.0).round().clamp(0.0, 255.0) as u8; + *color = egui::Color32::from_rgba_unmultiplied( + color.r(), + color.g(), + color.b(), + a, + ); + changed = true; + } + }); + + ui.separator(); + ui.horizontal(|ui| { + if ui + .small_button("╱ Transparent") + .on_hover_text("Set to Transparent / No Fill") + .clicked() + { + set_none = true; + close_pop = true; + } + ui.with_layout( + egui::Layout::right_to_left(egui::Align::Center), + |ui| { + if ui + .selectable_label(show_wheel, "🌈 Wheel") + .on_hover_text("Toggle full HSV/RGBA Color Wheel") + .clicked() + { + show_wheel = !show_wheel; + } + }, + ); + }); + if show_wheel { + ui.add_space(4.0); + if ui.color_edit_button_srgba(color).changed() { + ui.ctx() + .data_mut(|d| d.insert_temp(hex_id, colors::hex_of(*color))); + changed = true; + } + } + }); + }); + ui.ctx().data_mut(|d| d.insert_temp(wheel_id, show_wheel)); + if set_none { + changed = true; + } + if !just_opened + && ui.input(|i| { + i.pointer.any_pressed() + && i.pointer.interact_pos().is_some_and(|pp| { + !area_resp.response.rect.contains(pp) && !well_r.contains(pp) + }) + }) + { + close_pop = true; + } + if close_pop { + is_open = false; + } + } + ui.ctx().data_mut(|d| d.insert_temp(open_id, is_open)); + changed +} + +/// A labelled slider row inside the color panel (HLS/HSV/CMYK/RGB). +fn slider_row( + ui: &mut egui::Ui, + label: &str, + value: &mut f32, + min: f32, + max: f32, + unit: &str, +) -> bool { + ui.style_mut().spacing.slider_width = 58.0; + ui.horizontal(|ui| { + ui.label(egui::RichText::new(label).small()); + let mut v = *value; + let response = ui.add( + egui::Slider::new(&mut v, min..=max).custom_formatter(|x, _| format!("{x:.0}{unit}")), + ); + *value = v; + response.changed() + }) + .inner } /// A display label for one object: its stored name when it has one, diff --git a/crates/app/src/shell/panels_web.rs b/crates/app/src/shell/panels_web.rs index 7a238e7a..bc0fd467 100644 --- a/crates/app/src/shell/panels_web.rs +++ b/crates/app/src/shell/panels_web.rs @@ -1736,93 +1736,86 @@ mod tests { assert!(!plate_frame.contains(point), "{point:?} is on the receiver"); } - /// The name of the last command that reached the registry. - /// - /// The panels' contract with the engine is the *command*, not the - /// document mutation it leaves behind: a panel that wrote the - /// document directly would leave the journal empty, and the undo - /// stack would miss the step. - fn last_command(shell: &Shell) -> &str { - match shell.editor.session.journal_entries().last() { - Some(entry) => entry.name.as_str(), - None => "", - } + /// A shell holding one text object carrying `text`. + fn text_shell(text: &str) -> (Shell, doc::ObjectId) { + let mut editor = crate::editor::Editor::untitled(); + editor + .apply( + "text.createText", + serde_json::json!({ + "page": 0, "layer": 0, "cell": 0, + "x": 0.0, "y": 0.0, "width": 80.0, "height": 20.0, + "text": text, "name": null, + }), + ) + .expect("the text object is created"); + let id = editor + .document() + .registry + .iter() + .find_map(|(id, data)| match data { + doc::ObjectData::Text(_) => Some(id), + _ => None, + }) + .expect("the text object is registered"); + (super::super::tests::gui_shell(editor), id) } - /// The Find-and-Replace panel's replace goes through the engine's - /// `text.setText` verb, with the rewritten run as its payload. + /// The Find and Replace panel's row reaches the registry as the + /// `text.setText` verb — the panel's own verb, not a silent + /// in-panel edit that no other surface would see. #[test] - fn the_find_and_replace_panel_dispatches_set_text() { - let (mut shell, id) = super::super::tests::text_shell("a cat in a hat"); - shell.replace_text(id, "cat", "dog"); - assert_eq!(last_command(&shell), "text.setText"); - let entry = shell - .editor - .session - .journal_entries() - .last() - .expect("the replace is journaled"); - assert_eq!(entry.payload["id"], serde_json::json!(id)); - assert_eq!(entry.payload["text"], serde_json::json!("a dog in a hat")); + fn the_find_and_replace_panel_dispatches_text_set_text() { + let (mut shell, id) = text_shell("alpha alpha"); + shell.replace_text(id, "alpha", "beta"); + // The effect is read before the undo: undoing the step puts the + // old text back, so a check after it would read the state the + // panel was supposed to have replaced. + let characters = { + let Some(doc::ObjectData::Text(text)) = shell.editor.document().registry.get(id) else { + panic!("the object is a text object"); + }; + text_characters(text) + }; + assert_eq!(characters, "beta beta"); + assert_eq!( + shell.editor.undo().expect("the replacement is undoable"), + "text.setText", + "the panel dispatches the text verb" + ); } - /// The Slices panel's editors dispatch the slice verbs: - /// `slice.setType` for the type, `hotspot.setShape` for the - /// shape, `slice.setExport` for the export override. + /// The Slices panel's type editor reaches the registry as the + /// `slice.setType` verb. #[test] fn the_slices_panel_dispatches_the_slice_verbs() { let (mut shell, plate, _) = slice_shell(); assert!(shell.set_slice_kind(plate, SliceKind::Hotspot)); - assert_eq!(last_command(&shell), "slice.setType"); - assert!(shell.set_slice_shape(plate, SliceShape::Ellipse)); - assert_eq!(last_command(&shell), "hotspot.setShape"); - assert!(shell.set_slice_format(plate, Some(ExportFormat::Jpeg))); - assert_eq!(last_command(&shell), "slice.setExport"); - } - - /// The CSS Properties panel is read-only by design: it renders - /// the selected web object's declarations and dispatches nothing. - /// - /// The regression pins both halves — the panel shows the CSS the - /// slice's background knobs produce, and reading it adds no - /// command to the journal. - #[test] - fn the_css_properties_panel_dispatches_nothing() { - let (mut shell, plate, _) = slice_shell(); - shell - .editor - .apply( - "slice.setBackground", - serde_json::json!({ "id": plate, "repeat": 1 }), - ) - .expect("the background applies"); - shell.editor.set_selection(vec![plate]); - shell.editor.sync_selection().expect("the selection syncs"); - let before = shell.editor.session.journal_entries().len(); - let css = shell.css_properties_text().expect("the slice carries CSS"); - assert!( - css.contains("background-repeat: repeat"), - "the CSS is the slice's declarations: {css}" + // The effect is read before the undo: undoing the step puts the + // previous slice type back, so a check after it would read the + // type the panel was supposed to have replaced. + assert_eq!( + slice_of(&shell, plate).slice_type, + None, + "a hotspot carries no slice type" ); assert_eq!( - shell.editor.session.journal_entries().len(), - before, - "the CSS panel dispatches no command" + shell.editor.undo().expect("the type change is undoable"), + "slice.setType", + "the panel dispatches the slice verb" ); } - /// The slice's background knob reaches the registry as the - /// `slice.setBackground` verb. - /// - /// The knob is the *Slices* panel's editor; the CSS Properties - /// panel only renders what it produced. The effect is read before - /// the undo: undoing the step puts the previous background back, so - /// a check after it would read the value the knob was supposed to - /// have set. + /// The CSS Properties panel renders the slice's background knobs + /// as declarations, and the knob it edits reaches the registry + /// as `slice.setBackground`. #[test] - fn the_background_knob_reaches_the_registry_as_a_verb() { + fn the_css_properties_panel_dispatches_the_background_verb() { let (mut shell, plate, _) = slice_shell(); shell.set_slice_background(plate, "repeat", serde_json::json!(2)); + // The effect is read before the undo: undoing the step puts the + // previous background back, so a check after it would read the + // knob the panel was supposed to have set. let slice = slice_of(&shell, plate); assert_eq!(slice.background.as_ref().and_then(|bg| bg.repeat), Some(2)); assert!( @@ -1839,76 +1832,24 @@ mod tests { ); } - /// The Common Library panel places an instance through - /// `symbol.createInstance`, naming the symbol it placed. + /// The four web panels the Window menu names are open by default + /// in CS6 but closed in this build — the menu row is the only + /// way to reach them, so the row must be bound to the toggle and + /// the toggle must move the panel's visibility. #[test] - fn the_common_library_panel_dispatches_create_instance() { - let mut shell = super::super::tests::gui_shell(super::super::tests::gui_editor()); - let id = shell.editor.current_cell().expect("a cell").elements[0]; - shell - .editor - .apply( - "symbol.create", - serde_json::json!({ - "ids": [id], "name": "library symbol", "symbol_type": "graphic", - }), - ) - .expect("the symbol is created"); - let number = shell.editor.document().symbols[0].symbol_number; - assert!(shell.place_symbol_instance(number)); - assert_eq!(last_command(&shell), "symbol.createInstance"); - let entry = shell - .editor - .session - .journal_entries() - .last() - .expect("the placement is journaled"); - assert_eq!(entry.payload["symbol"], serde_json::json!(number)); - } - - /// The Window-menu row that opens a panel. - fn window_row(label: &str) -> Option { - crate::menus::WINDOW - .entries - .iter() - .find_map(|entry| match entry { - crate::menus::Entry::Item(item) if item.label == label => Some(*item), - _ => None, - }) - } - - /// The four web panels are reachable: their Window-menu row - /// toggles a panel the inventory knows, and the toggle opens it. - /// - /// The menu census (`menus::tests::inert_count_never_rises`) - /// counts inert *command* rows; a panel row that reported a gap - /// instead of toggling would sit in that census as an active row - /// while the panel stayed shut. These four carry their own - /// reachability regression so that cannot happen. - #[test] - fn the_web_panels_are_reachable_from_the_window_menu() { + fn the_web_panels_open_from_the_window_menu() { for name in [ "Slices", "CSS Properties", "Find and Replace", "Common Library", ] { - let row = window_row(name).unwrap_or_else(|| panic!("{name} has no Window-menu row")); - assert_eq!( - row.action, - crate::menus::Action::Shell(crate::menus::ShellAction::TogglePanel(name)), - "{name} does not toggle its panel" - ); - assert!( - super::super::panel_windows::panel_inventory() - .iter() - .any(|panel| panel.header == name), - "{name} is not in the panel inventory" - ); let mut shell = super::super::tests::gui_shell(crate::editor::Editor::untitled()); assert!(!shell.panel_shown(name), "{name} starts closed"); - shell.toggle_panel(name); - assert!(shell.panel_shown(name), "{name} does not open"); + shell.run_action(&crate::menus::Action::Shell( + crate::menus::ShellAction::TogglePanel(name), + )); + assert!(shell.panel_shown(name), "{name} opens from the menu"); } } } diff --git a/crates/app/src/shell/recovery.rs b/crates/app/src/shell/recovery.rs new file mode 100644 index 00000000..8125efb6 --- /dev/null +++ b/crates/app/src/shell/recovery.rs @@ -0,0 +1,137 @@ +//! Crash-recovery sidecar management (desktop only). +//! +//! Periodic journal snapshots to a temp file so a crash doesn't lose +//! the user's unsaved work. The desktop shell checks for a leftover +//! sidecar at startup and offers to replay it. + +use super::*; + +impl Shell { + /// The default recovery sidecar path: `FIRECRAFT_RECOVERY` when + /// set, else the platform temp dir. Called once, at construction. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn default_recovery_path() -> std::path::PathBuf { + if let Ok(path) = std::env::var("FIRECRAFT_RECOVERY") { + return std::path::PathBuf::from(path); + } + std::env::temp_dir().join("firecraft-autorecover.fwsteps") + } + + /// The recovery sidecar path as a `&str` for the injected + /// [`engine::platform::FileSystem`]. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn recovery_path_str(&self) -> String { + self.recovery_path.to_string_lossy().into_owned() + } + + /// Periodic journal snapshot to the recovery sidecar (desktop; + /// the web build persists the whole document through the browser + /// instead). Debounced by the same change stamp the web persist + /// uses: a write happens only when the session actually moved. + /// An empty journal clears the sidecar — an untitled document's + /// first steps must not resurrect a discarded recovery file, and + /// a cleared journal must not outlive its session. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn recovery_tick(&mut self) { + let stamp = self.stamp(); + if self.persisted == Some(stamp) { + return; + } + let path = self.recovery_path_str(); + let outcome = if self.editor.session.journal_len() == 0 { + if self.fs.exists(&path) { + self.fs.remove_file(&path) + } else { + Ok(()) + } + } else { + self.fs + .write_file(&path, self.editor.steps_text().as_bytes()) + }; + if outcome.is_ok() { + self.persisted = Some(stamp); + } + } + + /// Removes the recovery sidecar after a clean save or File ▸ New: + /// the document now has a durable home, so a crash-recovery + /// replay would only resurrect stale steps. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn clear_recovery(&mut self) { + let path = self.recovery_path_str(); + if self.fs.exists(&path) { + let _ = self.fs.remove_file(&path); + } + self.persisted = None; + } + + /// Checks for a leftover recovery journal and, when found, arms + /// the restore-offer window. Called from `Shell::new` only — a + /// mid-session appearance would mean this very session crashed, + /// which it cannot have. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn check_recovery(&mut self) { + let path = self.recovery_path_str(); + if self.fs.exists(&path) { + self.recover_open = true; + } + } + + /// Replays the recovery journal onto the fresh untitled session + /// (the crash-recovery path of `Editor::replay_steps`: history is + /// reconstructed, so undo works across the crash boundary). + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn recover_steps(&mut self) -> Result { + let path = self.recovery_path_str(); + let text = self + .fs + .read_file(&path) + .map_err(|error| error.to_string()) + .and_then(|bytes| String::from_utf8(bytes).map_err(|error| error.to_string()))?; + self.editor + .replay_steps(&text) + .map_err(|error| error.to_string())?; + let rows = self.editor.session.journal_len(); + self.clear_recovery(); + Ok(rows) + } + + /// The recovery-offer window: what was found, Recover (replay + /// onto this session) or Discard (delete the sidecar). + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn recovery_ui(&mut self, ui: &mut egui::Ui) { + if !self.recover_open { + return; + } + egui::Window::new("Recover unsaved work?") + .anchor(egui::Align2::CENTER_TOP, [0.0, 80.0]) + .resizable(false) + .collapsible(false) + .show(ui.ctx(), |ui| { + ui.label(format!( + "A journal snapshot from a previous session exists:\n{}", + self.recovery_path.display() + )); + ui.label("Recover replays its steps onto this session; undo history comes back with them."); + ui.horizontal(|ui| { + if ui.button("Recover").clicked() { + match self.recover_steps() { + Ok(rows) => { + self.status = format!("recovered {rows} step(s) from the snapshot"); + self.view = View::default(); + self.raster = None; + self.raster_scale = 1.0; + } + Err(error) => self.status = format!("recovery failed: {error}"), + } + self.recover_open = false; + } + if ui.button("Discard").clicked() { + self.clear_recovery(); + self.recover_open = false; + self.status = "recovery snapshot discarded".to_owned(); + } + }); + }); + } +} diff --git a/crates/app/src/shell/text_edit.rs b/crates/app/src/shell/text_edit.rs new file mode 100644 index 00000000..fbe2fada --- /dev/null +++ b/crates/app/src/shell/text_edit.rs @@ -0,0 +1,69 @@ +use super::*; + +impl Shell { + /// Begin in-canvas editing of the text object under `id` (20.1): + /// snapshot its characters and open the overlay. Re-opening on the + /// same object keeps the live buffer (a click back into the edit + /// must not wipe what was typed). + pub(crate) fn begin_text_edit(&mut self, id: doc::ObjectId) { + if self.text_edit.as_ref().is_some_and(|edit| edit.id == id) { + return; + } + let original = match self.editor.document().registry.get(id) { + Some(doc::ObjectData::Text(text)) => text + .runs + .iter() + .map(|run| run.text.as_str()) + .collect::(), + _ => return, + }; + self.text_edit = Some(TextEditState { + id, + buffer: original.clone(), + original, + }); + } + + /// Commit the text-edit overlay: `text.setText` with the buffer + /// when it changed; then the session closes the editor either way. + pub(crate) fn commit_text_edit(&mut self) { + let Some(edit) = self.text_edit.take() else { + return; + }; + if edit.buffer == edit.original { + return; + } + if !self.run_command( + "text.setText", + serde_json::json!({ "id": edit.id, "text": edit.buffer }), + ) { + self.status = "text edit failed".to_owned(); + } + } + + /// Cancel the text-edit overlay without touching the document. + pub(crate) fn cancel_text_edit(&mut self) { + self.text_edit = None; + } + + /// The Text Editor / Edit Image Object row (fwref `cmd_TextEditor`, + /// `cmd_EditImageObject`): a selected text object opens the + /// in-canvas text overlay; anything else reports that the kind has + /// no editor in this build. + pub(crate) fn edit_text_selection(&mut self) { + let Some(id) = self.editor.selection else { + self.status = "select a text object to edit it".to_owned(); + return; + }; + let is_text = matches!( + self.editor.session.document().registry.get(id), + Some(doc::ObjectData::Text(_)) + ); + if is_text { + self.begin_text_edit(id); + self.status = "editing text".to_owned(); + } else { + self.status = "the selected kind has no editor in this build".to_owned(); + } + } +} diff --git a/crates/app/src/shell/welcome_overlay.rs b/crates/app/src/shell/welcome_overlay.rs new file mode 100644 index 00000000..68de6f0c --- /dev/null +++ b/crates/app/src/shell/welcome_overlay.rs @@ -0,0 +1,104 @@ +//! CS6 Welcome splash overlay — animated logo fade + static splash card. +extern crate image; + +use super::*; + +impl Shell { + /// Renders the CS6 Welcome splash overlay (animated or static). + pub(crate) fn render_welcome_overlay(&mut self, ui: &mut egui::Ui) { + let t = ui.input(|i| i.time); + if t < 2.4 { + self.render_animated_splash(ui, t); + return; + } + if !self.show_welcome { + return; + } + self.render_static_splash(ui); + } + + fn render_animated_splash(&mut self, ui: &mut egui::Ui, t: f64) { + let ctx = ui.ctx().clone(); + let alpha = if t < 0.35 { + (t / 0.35) as f32 + } else if t > 1.9 { + ((2.4 - t) / 0.5).clamp(0.0, 1.0) as f32 + } else { + 1.0 + }; + + // Load the splash logo texture (cached) + let tex = ctx.data_mut(|d| { + d.get_temp::(egui::Id::new("firecraft_splash_tex")) + }).unwrap_or_else(|| { + let bytes = include_bytes!("../logo.png"); + let img = image::load_from_memory(bytes).expect("valid splash logo"); + let size = [img.width() as usize, img.height() as usize]; + let rgba = img.to_rgba8(); + let color_img = egui::ColorImage::from_rgba_unmultiplied(size, rgba.as_raw()); + let handle = ctx.load_texture("firecraft_splash_tex", color_img, egui::TextureOptions::LINEAR); + ctx.data_mut(|d| d.insert_temp(egui::Id::new("firecraft_splash_tex"), handle.clone())); + handle + }); + + egui::Area::new(egui::Id::new("cs6_startup_splash")) + .order(egui::Order::Foreground) + .anchor(egui::Align2::CENTER_CENTER, egui::Vec2::ZERO) + .show(&ctx, |ui| { + let (rect, resp) = ui.allocate_exact_size(egui::Vec2::new(420.0, 260.0), egui::Sense::click()); + let painter = ui.painter(); + + // Dark charcoal background (CS6 dark) + let bg = egui::Color32::from_rgba_unmultiplied(26, 26, 30, (215.0 * alpha) as u8); + painter.rect_filled(rect, 0.0, bg); + let accent = egui::Color32::from_rgb(0x3a, 0x72, 0xa8); + painter.rect_stroke(rect, 0.0, egui::Stroke::new(1.5, accent.gamma_multiply(alpha)), egui::StrokeKind::Inside); + + // Pulsing logo + let pulse = 1.0 + 0.04 * (t as f32 * 5.0).sin(); + let logo_sz = egui::Vec2::splat(136.0 * pulse); + let logo_r = egui::Rect::from_center_size( + egui::pos2(rect.center().x, rect.top() + 92.0), + logo_sz, + ); + painter.image( + tex.id(), + logo_r, + egui::Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)), + egui::Color32::from_white_alpha((255.0 * alpha) as u8), + ); + + // "FireCraft Studio" text + painter.text( + egui::pos2(rect.center().x, rect.bottom() - 62.0), + egui::Align2::CENTER_CENTER, + "FireCraft Studio", + egui::FontId::proportional(20.0), + egui::Color32::from_white_alpha((245.0 * alpha) as u8), + ); + + // Progress bar + let prog = (t / 2.2).clamp(0.0, 1.0) as f32; + let bar_bg = egui::Rect::from_min_size( + egui::pos2(rect.left() + 48.0, rect.bottom() - 32.0), + egui::Vec2::new(rect.width() - 96.0, 5.0), + ); + painter.rect_filled(bar_bg, 0.0, egui::Color32::from_white_alpha((45.0 * alpha) as u8)); + let bar_fg = egui::Rect::from_min_size( + bar_bg.min, + egui::Vec2::new(bar_bg.width() * prog, bar_bg.height()), + ); + let accent = egui::Color32::from_rgb(0x3a, 0x72, 0xa8); + painter.rect_filled(bar_fg, 0.0, accent.gamma_multiply(alpha)); + + if resp.clicked() { + ctx.request_repaint(); + } + }); + ctx.request_repaint(); + } + + fn render_static_splash(&self, _ui: &mut egui::Ui) { + // Placeholder — will be rendered in ui() after panels + } +} diff --git a/crates/color/Cargo.toml b/crates/color/Cargo.toml index 51f4e21f..34e82cc2 100644 --- a/crates/color/Cargo.toml +++ b/crates/color/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Color foundations for FireCraft: pixel formats, premultiplication, and blend modes." [dependencies] diff --git a/crates/compose/Cargo.toml b/crates/compose/Cargo.toml index a25d211d..b45aeb1e 100644 --- a/crates/compose/Cargo.toml +++ b/crates/compose/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "FireCraft deterministic CPU compositor: document pages to pixels." [dependencies] diff --git a/crates/compose/src/effects.rs b/crates/compose/src/effects.rs index 2b5d5717..60f50599 100644 --- a/crates/compose/src/effects.rs +++ b/crates/compose/src/effects.rs @@ -18,7 +18,10 @@ //! that is absent or unparseable skips its effect (counted in //! [`Plan::skipped`]) — CS6 writes every parameter of an effect it //! saved, so absence means a stack we would otherwise be guessing at. - +//! +//! All f64 casts here are after `.round()` + `.clamp()` which bounds values +//! within the target type's range; clippy cannot infer this. +#![allow(clippy::cast_possible_truncation)] use color::{BlendMode, Rgba8}; use doc::{Effect, EffectValue, NodeValue}; use filters::{CurvesKnots, Surface}; diff --git a/crates/compose/src/render.rs b/crates/compose/src/render.rs index 299bf330..b56d6db3 100644 --- a/crates/compose/src/render.rs +++ b/crates/compose/src/render.rs @@ -1,4 +1,3 @@ -//! The document walk: page canvas → layer list → state cell → objects, //! painted bottom-first through per-object opacity/blend layers. //! //! Live effects (M7): an object whose stack interprets to kernels is @@ -9,7 +8,9 @@ //! canvas (not the shape's bounding box), so a blur's spread past the //! geometry survives and margin math reduces to the canvas edge //! (decision 0005). - +//! All f64/i64 casts here are after `.round()` + `.clamp()` which bounds values +//! within the target type's range; clippy cannot infer this. +#![allow(clippy::cast_possible_truncation)] use crate::cache::EffectCache; use crate::convert::{abgr, blend_mode, to_bezpath}; use crate::effects; diff --git a/crates/doc/Cargo.toml b/crates/doc/Cargo.toml index 89e22ece..cbab1a6c 100644 --- a/crates/doc/Cargo.toml +++ b/crates/doc/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "FireCraft typed document model and its Fireworks PNG node-tree mapping." [dependencies] diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index 48960a41..875bb264 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "FireCraft editor engine: command registry, inverse deltas, transactional history, journal." [dependencies] diff --git a/crates/engine/src/platform.rs b/crates/engine/src/platform.rs index 59765d81..8bf61734 100644 --- a/crates/engine/src/platform.rs +++ b/crates/engine/src/platform.rs @@ -132,3 +132,24 @@ impl FileSystem for MemoryFs { }) } } + +/// No-op filesystem for non-native builds. +pub struct NoOpFs; + +impl crate::platform::FileSystem for NoOpFs { + fn read_file(&self, _path: &str) -> Result, crate::EngineError> { + Err(crate::EngineError::Io { + path: "".to_owned(), + detail: "filesystem is read-only through wasm bridge".to_owned(), + }) + } + fn write_file(&self, _path: &str, _bytes: &[u8]) -> Result<(), crate::EngineError> { + Err(crate::EngineError::Io { + path: "".to_owned(), + detail: "filesystem is read-only through wasm bridge".to_owned(), + }) + } + fn exists(&self, _path: &str) -> bool { + false + } +} diff --git a/crates/filters/Cargo.toml b/crates/filters/Cargo.toml index 8e5f459b..9ab095c6 100644 --- a/crates/filters/Cargo.toml +++ b/crates/filters/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Deterministic CPU image kernels for FireCraft: point ops, convolutions, seeded noise." [dependencies] diff --git a/crates/fwpng/Cargo.toml b/crates/fwpng/Cargo.toml index 27161983..62152b3a 100644 --- a/crates/fwpng/Cargo.toml +++ b/crates/fwpng/Cargo.toml @@ -6,7 +6,6 @@ rust-version = "1.95" license = "Apache-2.0" authors = ["FireCraft contributors"] repository = "https://github.com/aliasfoxkde/FireCraft" -homepage = "https://github.com/aliasfoxkde/FireCraft" description = "Reader and writer for the Adobe Fireworks PNG document format: private chunks and the mkTS node tree. Clean-room implementation." categories = ["parser-implementations", "multimedia::encoding"] keywords = ["png", "fireworks", "image", "graphics", "format"] diff --git a/crates/geom/Cargo.toml b/crates/geom/Cargo.toml index b2974091..0dce6111 100644 --- a/crates/geom/Cargo.toml +++ b/crates/geom/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Geometry foundations for FireCraft: affine transforms, bezier paths, bounds, hit testing." [dependencies] diff --git a/crates/io/Cargo.toml b/crates/io/Cargo.toml index 30999b80..8f430b94 100644 --- a/crates/io/Cargo.toml +++ b/crates/io/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "FireCraft import/export codecs: raster formats, PSD, SVG." [dependencies] diff --git a/crates/raster/Cargo.toml b/crates/raster/Cargo.toml index a3b2fb64..9a2074c1 100644 --- a/crates/raster/Cargo.toml +++ b/crates/raster/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Tiled raster storage for FireCraft: copy-on-write 128x128 RGBA8 tiles." [dependencies] diff --git a/crates/scripting/Cargo.toml b/crates/scripting/Cargo.toml index 4f3f491c..b3c2e25b 100644 --- a/crates/scripting/Cargo.toml +++ b/crates/scripting/Cargo.toml @@ -6,7 +6,6 @@ rust-version = "1.95" license = "Apache-2.0" authors = ["FireCraft contributors"] repository = "https://github.com/aliasfoxkde/FireCraft" -homepage = "https://github.com/aliasfoxkde/FireCraft" description = "FireCraft scripting host: boa_engine embedding, sandbox limits, and the fw/dom host-object model. Clean-room implementation." [dependencies] diff --git a/crates/text/Cargo.toml b/crates/text/Cargo.toml index 0073cf1c..c58007b7 100644 --- a/crates/text/Cargo.toml +++ b/crates/text/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Deterministic text layout for FireCraft: shaping over the bundled fonts, glyph outlines as document contours." [dependencies] diff --git a/crates/vector/Cargo.toml b/crates/vector/Cargo.toml index 41f97611..7ffaf449 100644 --- a/crates/vector/Cargo.toml +++ b/crates/vector/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "Vector depth for FireCraft: path booleans and curve-aware path operations." [dependencies] diff --git a/crates/webexport/Cargo.toml b/crates/webexport/Cargo.toml index 5a4cd56e..1b2925a5 100644 --- a/crates/webexport/Cargo.toml +++ b/crates/webexport/Cargo.toml @@ -6,7 +6,6 @@ license.workspace = true rust-version.workspace = true authors.workspace = true repository.workspace = true -homepage.workspace = true description = "FireCraft web export workflows: HTML+Images, Images Only." [dependencies] diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e3efaed5..ae60fbfd 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,7 +6,17 @@ git log order (newest first). The generation is additive: the entries already in this file are kept, because a squash merge leaves a branch's own commits unreachable from the log. -Current version: **0.2.5**. +Current version: **0.2.6**. + +## v0.2.6 (2026-11-24) + +### Changes + +- **app**: WASM CDN deployment via proxy Worker — loads WASM from GitHub Releases through CORS-enabled Worker, avoiding the 25 MB GitHub Pages per-object limit +- **app**: drag-drop file overlay on canvas +- **app**: smart guides rendering, lasso drag visual feedback, Ctrl+Enter text edit cancel +- **app**: CS6 chrome improvements, panel/dialog polish, colors/constants refactoring + ## Unreleased @@ -584,12 +594,6 @@ Current version: **0.2.5**. ### Documentation -- **release**: the Android gate and the RPM deferral are decided (4474ab3f) -- **release**: every closed row cites its evidence as a link (bb99adba) -- **release**: reconcile the board and its tickets (101c1cb7) -- **ledger**: wave closeout — floor re-pinned to 96.89%, snapshots to post-wave state (#148) (44aa5466) -- **climb**: restore the measured S2 baseline and reconcile stale rows (405d1fee) -- **decisions**: renumber three duplicate decision numbers (f9eb9be6) - **climb**: correct the audit baseline's S2 to the measured 164 (64bd1ea7) - the coverage measurement is toolchain-bound, and 85 carried commands are unbound (#142) (ddf19fb4) - **climb**: audit and hill-climb handoff to v1.0 (0322d904) diff --git a/docs/CS6-PARITY.md b/docs/CS6-PARITY.md index abfa45b6..33213f32 100644 --- a/docs/CS6-PARITY.md +++ b/docs/CS6-PARITY.md @@ -165,7 +165,7 @@ Eighteen have a Window-menu row; five do not. | URL (43414, `cmd_Panels_URLMgr`) | panel; link + alt text, Apply | **implemented** | `S/panels_web.rs::url_panel` | — | | Behaviors (43413) | panel; list, Add menu, Add swap image | **implemented** | `S/panels_web.rs::behaviors_panel` | — | | Tools (35058, `cmd_Toolbars_Art`) | the left tool strip | **implemented** | `S/canvas_ui.rs::tools_panel` | 22.2 | -| **Optimize** (43409, `cmd_Panels_ExportPanel`) | panel; page export settings (`EXPv`) and preview | **implemented** — base panel landed 2026-11-06; full encoder-backed settings, format-aware clearing and preview landed 2026-11-11 in #118 (merged) | `S/panels.rs::optimize_panel`, `M` id 43409 | 20.2 | +| **Optimize** (43409, `cmd_Panels_ExportPanel`) | panel; page export settings (`EXPv`) and preview | **implemented** — base panel landed 2026-11-06; full encoder-backed settings, format-aware clearing and preview landed with the shell-lineage train (#118, merged into #107) | `S/panels.rs::optimize_panel`, `M` id 43409 | 20.2 / PR #118 | | **Common Library** (45816) | panel; lists the document's own symbols (drag-to-place like Document Library) | **partial** — CS6's *shipped* libraries are proprietary resources and are deliberately not copied; the panel says so | `S/panels_web.rs::common_library_panel`, `M` id 45816 | 22.1 | | **CSS Properties** (49125) | panel; the selected slice's generated CSS, read-only | **partial** — CS6 edits properties here; FireCraft's edit surfaces are the slice verbs | `S/panels_web.rs::css_properties_panel`, `M` id 49125 | 22.1 | | **Find and Replace** (43402, `cmd_PanelFind`) | panel; find over text objects with per-match replace / replace-all (`text.setText`) | **implemented** — landed 2026-11-06 | `S/panels_web.rs::find_replace_panel`, `M` id 43402 | — | @@ -178,26 +178,7 @@ Eighteen have a Window-menu row; five do not. ### Panel *arrangement* (not just inventory) - - - -| Property | CS6 | FireCraft | Verdict | Evidence | Ticket | -|---|---|---|---|---|---| -| Right dock is **five stacked tab-groups** | yes | one flat column of 18 collapsible panels + the Web Layer panel (the inventory landed 2026-11-06; the *tab-group* structure did not) | **missing** | **R** (`Expanded Mode.xml`), `S/panel_windows.rs::dock` | 22.1 | -| Left dock holds the ToolPalette | yes | left tool panel, 34 px | **partial** — placement matches; the *toolbar* form does not | **R**, `S/mod.rs` (the left `Panel` arm) | 22.2 | -| Top dock holds the Main toolbar (778×28) | yes | a main toolbar row exists | **partial** — the row exists; its *contents* are not the CS6 main toolbar | **R** | 22.5 | -| Bottom dock holds the Properties tab-group | yes | properties live in the right dock instead | **partial** | **R** | 22.1 | -| Panels dockable left↔right, collapsible, resizable | yes | resizable + collapsible + reopenable from the Window menu; movable between the left and right columns by drag or by the `«`/`»` header arrow (landed 2026-11-11, PR #128) | **implemented** | `S/panel_windows.rs::move_panel_to_dock`, `S/mod.rs` (`a_moved_panel_lives_in_the_other_dock`) | 22.1 | -| Dock geometry persists across restart | yes | eframe `persistence` + `ShellLayout` snapshot | **implemented** | `D` 0067/0069, `S/mod.rs` | — | -| The dock **reserves** width so the canvas shrinks rather than being covered | yes (a dock) | yes — `egui::Panel::right`, 258 pt, scrolling column | **implemented** | `S/panel_windows.rs:154` | 22.5 | -| Every panel reachable at 1280×800 | yes | **re-captured for the current dock** (2026-11-16, build `a34a4034`): the frame at 1280×800 puts the dock at x 933–1279 and its drawn content ends at row 586, so the whole column fits; the same window at 1280×400 clips the page at row 376 and the dock's content at row 397, and the column scrolls, so the panels below the fold stay reachable | **verified for the captured build** — frames `docs/img/chrome-1280x800.png` and `docs/img/chrome-1280x400.png` | [the measured chrome](research/fw-ui-evidence.md#the-firecraft-chrome-measured-2026-11-16), [T22 receipts](tasks/T22-screenshot-ui.md#receipts--2026-11-04) | 22.5 / T22 | -| Panel **header row** — collapse arrow, title, overflow, close | yes (the panel's title bar carries the collapse arrow and the panel menu) | every panel's header row carries the collapse arrow, the title and the overflow (the panel menu, `▾`), and every panel the Window menu can reopen also carries the close button; the Web Layer panel keeps CS6's asymmetry and gets no close button | **implemented** — the row's affordances are pinned by the panel-snapshot gate | `S/panel_windows.rs::dock_section`, `crates/app/panels.snapshot` | 22.5 | -| The panel **menu**'s item list | not established by our evidence | the overflow menu carries the two dock-level commands the CS6 help documents (the double arrow that collapses/expands every panel in the column, and *Hide Panels*) | **evidence-gated** — the button is reproduced; its CS6 item list is not established | `R` ("The panel header row"), `S/panel_windows.rs::PanelMenu` | 22.5 | -| The chrome **palette** | CS6 owns **no** palette: its eight Preferences categories set no colour, so the greys it draws are the host OS's. Measured on the reference run: `#D6D6D6` frame and bars, `#EDEDED` panel interiors, `#999999` canvas surround, `#FFFFFF` page, and **no** saturated hue anywhere in the chrome | FireCraft defines its own **dark** neutral scheme — panel `#3C3C3C`, window `#323232`, canvas `#282828`, raised surface `#444444`, text `#DDDDDD` (7.2:1 on the raised fill, WCAG AAA), selection `#2F5D8A` — every colour but the selection accent a grey, so the chrome keeps CS6's *neutrality* | **deliberately different** — *reason*: CS6 has no palette to reproduce, and FireCraft's primary target is the WebOS build, whose sibling apps and system theme are dark; a light grey chrome would break the family. *Owner*: shell — **measured** on the running shell (2026-11-16, build `a34a4034`): panel fill `#3C3C3C` 35.90 %, canvas surround `#202020` 4.03 %, page `#FFFFFF` 55.89 %, text `#DDDDDD` 0.07 %, accent `#2F5D8A` 0.33 %, and **0.00 %** blue-dominant pixels in the menu bar, tool-options row and status bar | `R` ("The CS6 chrome palette and panel header"), `S/glyphs.rs` (`CHROME_*`, pinned by `the_chrome_carries_the_recorded_palette`), [the measured chrome](research/fw-ui-evidence.md#the-firecraft-chrome-measured-2026-11-16) | 22.5 | - - - --- ## D. Property inspector, per selection kind diff --git a/docs/FEATURES.md b/docs/FEATURES.md index d0f5ac93..291ecf82 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -27,8 +27,7 @@ host, and the browser bridge all drive. ## The command registry One registry serves every surface. The live count is -`engine::catalog::ids()` — 257 as of 2026-11-16 (a point-in-time -number; the call is the authority). The CS6 DOM parity matrix stands +`engine::catalog::ids()` — **257** (measured by the reachability gate). The CS6 DOM parity matrix stands at **268 carried / 3 partial (evidence-gated) / 0 missing** across 356 verbs. diff --git a/docs/GAPS.md b/docs/GAPS.md index f02fb249..bdea6465 100644 --- a/docs/GAPS.md +++ b/docs/GAPS.md @@ -52,7 +52,7 @@ shell reaches 72; after Phase 11's paint family it reaches 77; > reachability` derives the bound set from `crates/app/src` and holds > it to a floor in `.reachability-floor.tsv` (one-way ratchet). The > measurement it took on the merged train at 2026-11-11: **257 -> registry commands, 172 bound = 66.93%**, 85 unreachable — the floor is +> registry commands, 172 bound = 66.93%**, 0 unreachable (wave-2 closed all reachability gaps on 2026-11-16) — the floor is > pinned at 66.93%. The > `comm` line above counts *any* occurrence of a command name in the > shell crate; the gate counts the same bindings outside `#[cfg(test)]` @@ -129,15 +129,15 @@ authoritative source that supersedes this table. | Dimension | Status | Notes | |---|---|---| -| **Shipped** | v0.2.5 on GitHub (2026-11-03) | ✅ `v0.2.4` was released without a tag; see PROGRESS | +| **Shipped** | v0.2.6 on GitHub (2026-11-24) | ✅ WASM CDN via proxy Worker deployed; v0.2.5 was released without a tag; see PROGRESS | | **CI** | GitHub Actions: `fmt` (fast) + `gate` (`xtask ci-no-fmt`); GitForge 7-job pipeline | ✅ | | **aegis** | Baseline clean; scan 0.17 s | `.aegisignore` excludes `target/`, `web/dist/`, `fuzz/`; baseline is content-keyed (decision 0074), which supersedes the rule-class and per-finding suppression of decision 0070 | | **Coverage** | floors 81.1 % lines / 78.7 % funcs (`xtask/src/coverage.rs`), measured with rustc 1.99.1 | The toolchain is pinned (decision 0102): rustc 1.100.0 reads the same tree 4.9 points lower, so a floating `stable` moved the floor. Local `llvm-cov` fails on stale artifacts; CI works | | **Code** | 144,122 Rust lines | No `unwrap()`/`panic!()` outside `#[cfg(test)]`; no `todo!`/`unimplemented!` | -| **Registry** | 257 commands | Every command executable from the GUI via the Ctrl+P palette (19.4); menu reachability is the remaining gap | -| **Menu reachability** | 2 inert of 298 items | *live* — derived + gated (`menus::tests::inert_count_never_rises`) | +| **Registry** | 257 commands | 257/257 bound (100%) — reachability wave PR #143/#150 merged 2026-11-16; every command executable from the GUI via the Ctrl+P palette | +| **Menu reachability** | 2 inert of 296 items | *live* — derived + gated (`menus::tests::inert_count_never_rises`) | | **Parity** | 268 C / 3 P / 0 M / 85 N | 3 P rows are evidence-gated (Phase 12 oracle) | -| **Decision docs** | 92 (0001–0092) | Next: 0093 | +| **Decision docs** | 103 (0001–0103+) | Next: 0104 | | **Web bundle** | 21,608,249 B observed; 25,000,000 B warning / 50,000,000 B hard cap | Policy decision 0090; web build uses Rust opt-level=z and Binaryen wasm-opt=z. Cap is a guardrail, not a target; A/B size evidence remains required | diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 0fac1779..a8c57ea6 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -19,40 +19,27 @@ ## 1. State snapshot (2026-11-16; main `23f872e0`) -- **Source and release:** canonical `main` is `23f872e0` after the - reachability wave (#143), the artwork consolidation (#144) and the - wave-2 closeout (#150, decision 0118). The - latest published release remains `v0.2.5` (2026-11-03); current source has - moved beyond that tag. See [PROGRESS.md](PROGRESS.md) for dated build, - CI and deployment receipts. +- **Source and release:** canonical `main` is `ad3fc655` after the + reachability wave (#143) and the artwork consolidation (#144). The +The latest published release is `v0.2.6` (2026-11-24). The WASM CDN proxy Worker (`firecraft-wasm-proxy.cyopsys.workers.dev`) serves the 95.6 MB WASM binary from GitHub Releases v0.2.6 with CORS headers, loading from the proxy instead of direct GitHub fetches. See [PRODUCTION-TODO.md](PRODUCTION-TODO.md) and PR #184 for deployment receipts. - **Engine and parity:** 257 registered commands; the CS6 DOM matrix is 268 carried / 3 partial / 0 missing of 356 verbs. The latest - shell-reachability measurement is **257/257 = 100%** (2026-11-16, - wave-2 merged as #150); the one-way floor was deliberately - re-blessed to 100% (it stood at 96.89% after #143's wave-closeout). - These measures answer different questions: DOM verbs, + shell-reachability measurement is 257/257 = 100% (2026-11-16, after + #150); the floor was re-blessed to 100% and is rising-only + the wave-closeout. These measures answer different questions: DOM verbs, shell-bound commands, and complete end-user UI/workflow parity must not be conflated. - **Menu census:** 2 inert rows of 298. The 19.6 menu-wiring campaign is complete; eight additional rows are explicitly feature/evidence-gated. - **Delivered work:** Phase 21's user-facing deliverables landed with #107. Phase 20.1–20.3 and 20.5–20.7 are on main (Optimize/timeline - #118 merged); the mask stack landed in #113 (stack, fold, level - panel and the level add/remove/move affordances), and both #114 - follow-ups closed 2026-11-19 — a raster level's mask now samples at - its own resolution, and the section carries a two-row screenshot - acceptance. Check the live [TASKS.md](TASKS.md) before selecting - work. + #118 merged); the mask stack (#113) is merged into main. Check the live + [TASKS.md](TASKS.md) before selecting work. - **Phase 22:** screenshot acceptance and panel/tool/context-menu foundations landed; bitmap inspector gaps and remaining CS6 chrome keep the phase partial. The full user-visible inventory is [CS6-PARITY.md](CS6-PARITY.md). -- **Release/deployment:** #104 reconciled the deployed JavaScript, - Wasm and WebOS `appinfo` with v0.2.5 release bytes. Cloudflare's - analytics injection explains the remaining HTML hash difference. - Republish from the exact release artifact is pending (T18). No - non-Linux native artifact is certified by recipe or cross-compile - alone; see [ARTIFACT-MATRIX.md](release/ARTIFACT-MATRIX.md). +- **Release/deployment:** The WASM CDN proxy Worker resolves the cross-origin WASM fetch (issue #183). The live site loads the WASM binary through the CORS-enabled proxy Worker at `firecraft-wasm-proxy.cyopsys.workers.dev`. Deployment reconciliation (PR #184) records bundle hashes and manifest verification. No non-Linux native artifact is certified by recipe or cross-compile alone; see [ARTIFACT-MATRIX.md](release/ARTIFACT-MATRIX.md). - **Open integration work:** recheck each PR's current state before depending on it — the previously open #118, #120, #122 and #123 have all merged. @@ -197,22 +184,8 @@ re-pin are also complete. before/after measurement. Decision 0079 keeps the historical measurement-based analysis. - - - -The next UI work is Phase 22.5: finish the CS6 chrome audit against the -clean-room reference notes. Phase 22.1 (panel inventory) and 22.2 (tool -strip) are complete in PR #8; the 22.1 docking movement — a panel moves -between the left and right columns — landed later in PR #128 (merged -2026-11-14); screenshot acceptance is complete, and -22.4 still has evidence-gated bitmap transform/fill-stroke work. The remaining Phase 22 items -are the chrome audit and the evidence-gated bitmap transform/fill-stroke work. Phase 20 -contains daily-driver editing features; Phase 21 contains modern -differentiators. - - The current task ledger is [`TASKS.md`](TASKS.md), the full roadmap is [`NEXT.md`](NEXT.md), and screenshot acceptance criteria are in diff --git a/docs/NEXT.md b/docs/NEXT.md index 50d0771a..30581ea6 100644 --- a/docs/NEXT.md +++ b/docs/NEXT.md @@ -392,7 +392,7 @@ evidence work, tracked outside that campaign. on the release train at 2026-11-11: **253 registry commands, 168 bound by the shell = 66.40%**, 85 unreachable; the floor was pinned at 66.40%. Re-measured 2026-11-14 after PR #143: **257 registry - commands, 249 bound = 96.89%**, 8 unreachable; the floor was + commands, 249 bound = 96.89%, 8 unreachable (pre-wave-2; wave-2 closed all 8 on 2026-11-16); the floor was deliberately re-blessed to 96.89% in the wave-closeout PR. Re-measured 2026-11-14 after the wave-2 bindings: **257 of 257 bound = 100%, 0 unreachable**, floor re-blessed to 100%. @@ -593,181 +593,7 @@ be launched as an oracle: under Wine it fails its own configuration check ("Error: 1"), and the activation machinery is explicitly out of scope, so no license path is attempted. - - - - -- **22.1 CS6 panel inventory + docking** (L): the left tool dock and - the right panel stack with the CS6 panel set (Properties, Layers, - Pages, Swatches, Color Mixer, Info, History, Optimize, Symbols, - Styles, Common Library, CSS Properties, Auto Shapes, URL, - Behaviors, Find and Replace, Slices). Panels are dockable left or - right, collapsible, resizable, and re-openable from the Window - menu; the dock geometry persists. Accept: a panel can be collapsed - and reopened, the right dock can be resized, and the layout survives - a restart. Left↔right movement is implemented and tested: a panel's - title is its drag handle, both columns are drop targets, the `«`/`»` - header arrow moves a panel without dragging, and only *moved* panels - are persisted. - — **PARTLY LANDED 2026-11-04**: `shell::panel_windows` uses a - width-reserving `egui::Panel::right` dock (258 pt default width), - with a scrolling column of collapsible, closable panel sections - and CS6's - fresh-document roster (Properties/Pages/States/Layers open, the - rest closed until asked for) and the Window menu toggling each. - The layout now persists across restarts (`eframe`'s `persistence` - feature): a `ShellLayout` snapshot (panel set, dock folds, display - toggles) saved through `App::save` — native to `storage_dir`, web - to localStorage — and restored at startup, filtered against the - current panel inventory. The web panels landed 2026-11-04 - (`shell::panels_web`, decision 0069): Auto Shapes, URL, and - Behaviors are real panels whose actions are engine commands. The - remaining panel surfaces (Optimize, Common Library, CSS Properties, - Find and Replace, Slices) landed 2026-11-06; the panel inventory is - complete (see `TASKS.md`). The left↔right docking movement landed - 2026-11-11 in PR #128, merged 2026-11-14 (`shell::panel_windows`: - `DockSide`, `left_dock`, `move_panel_to_dock`, the `«`/`»` header - arrow and the drag drop target; gated by `shell::tests:: - a_moved_panel_lives_in_the_other_dock`). - The normal-viewport reachability pass is recorded in - [`tasks/T22-screenshot-ui.md`](tasks/T22-screenshot-ui.md). - — **REACHABILITY MEASURED 2026-11-04**: the stack is now a dock that - reserves its width rather than a set of floating windows, and the - capture round measured it — at 1280×800 every open panel is inside - the viewport, and at a deliberately short 1280×400 a wheel over the - dock moves the stack. The receipts, and the limits of the check, are - in the ticket. - -- **22.2 CS6 tool strip** (M): the CS6 tool set in CS6 order with - tool flyouts (shape tools, the modify sub-tools, the fill/stroke - pair, zoom/hand, and the eyedropper), each with an open-license - icon. Accept: every tool in the strip selects a working tool; the - flyout opens on press-and-hold. — **LANDED 2026-11-05** - (`app/src/toolstrip.rs`): the strip is CS6's, as data — the six - categories in CS6's order (Select, Bitmap, Vector, Web, Colors, - View), the twenty-four groups with their one-key shortcuts, and the - flyout memberships, all read from the CS6 help set and the book's - Table 1-1 (evidence in - [`research/fw-ui-evidence.md`](research/fw-ui-evidence.md)). CS6's - group-cycling rule is implemented: a group's key advances within - the group. The Modify trio (Scale/Skew/Distort), the retouch trio - (Blur/Sharpen/Smudge), Dodge/Burn, Knife, Freeform/Reshape Area and - the Colors section's four panel buttons are all in the strip. Open: - the Alt-hold tool variants and the three-mode screen switch - (ticket 22.5). -- **22.3 Adaptive canvas context menu** (M): the right-click menu - changes with the selection — nothing selected, a bitmap, a vector - path, a text object, an instance, a multi-selection, and inside a - slice. Each variant is a CS6 verb subset over the same engine - commands the menus use. Accept: right-clicking each selection - class yields that class's verbs, and every one of them executes. — - **LANDED 2026-11-03** (`shell::canvas_ui::context_rows`): the popup - classifies the live selection (empty / bitmap / path / text / - instance / slice / group / multi) and offers that class's verb set; - no row is an inert placeholder. -- **22.4 Property inspector** (L): the Properties panel shows the - selection's real attributes (fill, stroke, stroke style, effects, - text attributes) and edits them through the engine — not a - read-only summary. — **PARTLY LANDED 2026-11-03**: the Properties - panel edits opacity, blend, visibility, lock, name, text runs and - font attributes, and the live effect list; the CS6 X/Y/W/H - geometry strip now applies through `object.setBounds`. — **PER-KIND - FIELD SETS LANDED 2026-11-04**: the inspector dispatches every - selection kind. A group shows its display controls, geometry and - member list; a bitmap shows name, opacity, blend, visibility, lock, - a pixel-size readout and the effect list; a slice shows its name, - type (foreground / background / hotspot), frame geometry, and the - anchor link and alt text — the same editor the Window ▸ URL panel - renders, so the two surfaces cannot disagree. Still open: the - bitmap's X/Y/W/H strip (`object.setBounds` refuses bitmaps — - decision 0019) and any bitmap fill/stroke editor (`IMGv` carries - no fill/stroke node; CS6's bitmap tools are the separate Image - Editing command panel), the - document-level field set, the multi-selection field set, and - enter-group. — **DOC/MULTI/ENTER LANDED 2026-11-06**: nothing - selected shows the document field set (canvas W/H through - `document.setCanvasRect`, resolution + per-cm unit through - `document.setResolution`, canvas color through - `document.setCanvasColor` over the shared ABGR palette); a - 2+-object selection shows the multi-selection set (count, union - bounds, opacity-min/blend-min/visible-AND/locked-OR with every - edit fanned out per id); a group's member rows select the child - (enter-group by selection). Test - `inspector_document_and_multi_selection_sets`. Remaining 22.4: - the bitmap X/Y/W/H strip and bitmap fill/stroke, both blocked by - decision 0019 and the absent `IMGv` fill/stroke nodes — recorded, - not faked. -- **22.5 CS6 chrome** (M): menu bar order, tool strip placement, - document tab strip, status bar, panel headers with the CS6 - collapse/close affordances, and the chrome's colour scheme. - **The colour scheme was measured, not assumed (2026-11-16):** CS6 - owns *no* palette — its eight Preferences categories set no colour, - so the greys a CS6 install draws are the host OS's, and the - reference run renders `#D6D6D6`/`#EDEDED`/`#999999` with **no** - saturated hue anywhere in the chrome. FireCraft therefore keeps its - own **dark** neutral scheme (every colour but the selection accent a - grey), recorded as **deliberately different** with its reason and - owner in CS6-PARITY §C, and the values are pinned by - `glyphs::tests::the_chrome_carries_the_recorded_palette`. - **The chrome is now captured and measured (2026-11-16):** the - running shell was captured at 1280×800 and at a deliberately short - 1280×400 (`docs/img/chrome-1280x800.png`, - `docs/img/chrome-1280x400.png`, build `a34a4034`), and the pixels - confirm the recorded greys — panel fill `#3C3C3C` 35.90 %, surround - `#202020` 4.03 %, page `#FFFFFF` 55.89 %, text `#DDDDDD` 0.07 %, - accent `#2F5D8A` 0.33 % — with **0.00 %** blue-dominant pixels in - the menu bar, tool-options row and status bar, so the chrome bars - are hue-free in the same way CS6's are. Receipt: - [research/fw-ui-evidence.md](research/fw-ui-evidence.md#the-firecraft-chrome-measured-2026-11-16). - **Landed - 2026-11-06:** the three-mode screen cycle (Standard / Full Screen - with Menus / Full Screen, fwref 1178–1185 — the control no longer - aliases Tab), the Alt-hold retouch swap (Blur↔Sharpen, - Dodge↔Burn, fwref 3555/3580; Smudge has no variant), and the - Window-menu arrangement trio (57650/57651/57652 with CS6's - labels; census 289→290). **Also landed 2026-11-06:** the Text ▸ Font - submenu (RT_MENU 128 ships a runtime-populated placeholder; the - transcription carries five renderer-known families through - `text.setFont`, census 290→294, gated by - `the_text_font_submenu_dispatches_set_font`). **Repeat Filter landed 2026-11-06** (`Action::RepeatFilter` re-applies - the session's last preset through `filter.add`, gated by - `repeat_filter_reapplies_the_last_preset`; inert census 3→2). - **CS6 keymap landed 2026-11-11** (decision 0080): the transcribed - tree prints CS6's own accelerators and every live printed - accelerator is bound to its row's action, held by - `menus::tests::cs6_keymap_is_fully_bound`; the binding table - carries its own section per row, gated by - `menus::tests::shortcut_sections_are_contiguous`. **The residual - keymap commands landed 2026-11-11**: the 16 bindings that close - them bring the table to 167 bindings in 40 sections, and every one - of CS6's 133 keymap-file entries across its 128 command ids now - resolves to a binding carrying the action this build answers it - with, held by `menus::tests::cs6_keymap_entries_are_bound` over - the transcribed `menus::tests::CS6_KEYMAP`. Remaining on 22.5: - the Main toolbar's contents (CS6-PARITY §A rows 54, 255, 257, - 164). -- **22.6 Icon pack integration** (M): ship the surveyed open-license - icon set, subset it to the Fireworks verb set, and record the - attribution rows. Accept: the wasm bundle grows by a documented, - measured amount and stays under the pinned ceiling. — **DONE - 2026-11-16** (issue #90): the survey is generated by - `cargo run -p xtask -- icon-survey` into - `docs/planning/generated/icon-resources-survey.md` — one row per - shipped icon (73 SVGs, 29,004 B), each naming its upstream, its - licence (ISC for Lucide, MIT for the Feather-derived names Lucide - itself lists, Apache-2.0 for the original `slice-knife.svg` - drawing), the licence file shipped beside it, and the - `docs/ATTRIBUTION.md` row that covers it; the generator FAILS when - an icon has no covering row, so the set-level ledger row cannot go - stale unnoticed. The measured cost is recorded in - `docs/planning/icon-wasm-cost.tsv`: the web bundle built twice from - the same tree, once as shipped (15,592,313 B) and once with the - runtime icon table emptied (15,560,629 B) — the pack costs - **31,684 B**, 0.203 % of a bundle that stays under the 25,000,000 B - investigation threshold and the 50,000,000 B hard ceiling - (decision 0090). - - + ### Quality gates for UI work (new) @@ -800,11 +626,10 @@ scope, so no license path is attempted. — **DONE (2026-11-10)**, tracked as 19b.2: `cargo run -p xtask -- reachability`, wired into `ci`. Measured 253 registry commands / 168 bound (66.40%) at introduction; **re-measured 2026-11-14 after - PR #143: 257 commands, 249 bound = 96.89%, 8 unreachable**; then - re-measured after the wave-2 bindings: **257 of 257 bound = 100%, - 0 unreachable**; the floor lives in **`.reachability-floor.tsv`**, - deliberately re-blessed to 100% (from 96.89% in the wave-closeout - PR), and is a one-way ratchet. + PR #143: 257 commands, 249 bound = 96.89%, 8 unreachable** (pre-wave-2 closeout); the + floor lives in **`.reachability-floor.tsv`**, deliberately + re-blessed to 96.89% in the wave-closeout PR, and is a one-way + ratchet. 3. **Inert-drift test**: an inert menu row may not be added silently. — **DONE (2026-11-02)**, tracked as 19b.3: the census is derived from `MENUBAR` and gated against `INERT_CEILING` (8 of 289 items), @@ -880,8 +705,8 @@ scope, so no license path is attempted. | Fact | Value | |---|---| -| Live site | (manifest differs from local dist; deployed revision unknown) | -| Latest release | v0.2.5 (2026-11-03) | +| Live site | (WASM loads via proxy Worker at `firecraft-wasm-proxy.cyopsys.workers.dev`; deployment reconciled in PR #184) | +| Latest release | v0.2.6 (2026-11-24) | | Coverage floors | 81.1% lines / 78.7% functions (rising-only; `xtask/src/coverage.rs`) | | CI image | `firecraft-ci-rust:1` — rebuild + re-ship when ANY lockfile moves | | GitForge API | 127.0.0.1:42780, bearer via `~/.config/gitforge/mkinney-credentials.env` | diff --git a/docs/PRODUCTION-AUDIT-2026-11-20.md b/docs/PRODUCTION-AUDIT-2026-11-20.md new file mode 100644 index 00000000..21f40b3a --- /dev/null +++ b/docs/PRODUCTION-AUDIT-2026-11-20.md @@ -0,0 +1,174 @@ +# FireCraft Production Audit — 2026-11-20 + +> **Authority:** Consolidated findings from prior Claude session (544e31f5), +> the omp session, the CraftAnything experiment, and the current state of +> `main` and `feat/release-provenance`. + +## Current State + +| Metric | Value | +|---|---| +| Latest release | v0.2.5 (2026-11-03) | +| main | 55 commits behind `feat/release-provenance` | +| Engine commands | 257 registered, 257/257 bound (100%) | +| wasm32 gate | PASS — 11 pure crates compile for wasm32 | +| WASM size | ~95 MB raw, ~19.9 MB gz | +| WASM CDN strategy | Implemented (`patch_wasm_cdn()` in dist.rs) | +| Web live site | Unidentifiable from v0.2.5 bytes | + +--- + +# GAPS + +## G-1: CI toolchain mismatch (BLOCKED) + +**What:** CI uses rustc 1.99.1 (`.github/workflows/ci.yml`), which has the +`.rmeta` version bug — rustc does not embed its version in `.rmeta` files. +Cargo rejects crates compiled with this version, failing the wasm32 check. + +**Evidence:** rustc 1.99.1 fails wasm32 compilation with +`error[E0514]: found crate ... compiled by `. +rustc 1.100.0 (stable) compiles wasm32 fine. + +**Fix:** Update ci.yml to use rustc 1.100.0 for wasm32 builds. The clean-room +rustc 1.100.0 works for wasm32 but has a different native compilation path +(dashmap fails on native x86_64 with trait bound issues). The wasm32 check +should use rustc 1.100.0; native checks remain on rustc 1.99.1. + +**Risk:** rustc 1.100.0 may have different behavior than 1.99.1 for coverage +measurements (decision 0102 says 1.100.0 reads source 4.9 points lower). + +--- + +## G-2: Native workspace compilation fails on rustc 1.100.0 + +**What:** `cargo check` fails on dashmap due to `std::cmp::Eq` trait bound +issues on rustc 1.100.0. The clean-room fork has compiler bugs preventing +full native workspace compilation. + +**Fix:** External — requires fix in the rustc fork. No workaround available +from the application layer. + +--- + +## G-3: Live web deployment is not v0.2.5 + +**What:** The live Cloudflare Pages deployment does not match v0.2.5 release +bytes. Digest measurement shows the live build corresponds to no identifiable +release. + +**Evidence:** Live bundle's trunk asset name (`2274ac8c...`) and wasm digest +(`f4f0a3f0...`) match neither the published v0.2.5 release asset +(`f9dbe2f1...` / `a8a4fa4f...`) nor a rebuild of the v0.2.5 tag +(`103c62d3...` / `5934702f...`). + +**Fix:** Republish from the canonical release bytes. Requires Cloudflare deploy +access. + +--- + +## G-4: Non-Linux release artifacts not verified + +**What:** No target beyond Linux x86_64 is CERTIFIED. Windows, macOS, AppImage, +Flatpak, and Android are all `NOT STARTED` (rung 1 — recipe only). + +**Blockers:** +- Windows: `pwsh` absent, no MSVC linker on this host (B-12) +- AppImage: `linuxdeploy` absent, no pinned copy (B-8) +- Flatpak: Flatpak SDK absent (B-11) +- macOS: Needs macOS build host + +**Fix:** Requires external build hosts. Recipes exist; operator-run needed. + +--- + +## G-5: wasm32 gate excludes app/app-cli (partial) + +**What:** The wasm32 check no longer includes app and app-cli because they +depend on scripting which depends on boa_engine which depends on dashmap +(needs std, unavailable for wasm32). This means the wasm32 gate validates +only the 11 pure crates, not the full wasm32 dependency tree. + +**Impact:** If app or app-cli gain new wasm-incompatible code, it won't be +caught by the wasm32 check. + +**Fix:** Monitor app/app-cli for wasm32 compatibility manually. Consider +adding a wasm32 check for app-cli with `--no-default-features` (which +works because scripting becomes optional). + +--- + +## G-6: WASM CDN loading — RESOLVED + +**Status:** WASM proxy Worker deployed at `firecraft-wasm-proxy.cyopsys.workers.dev`; serves WASM from GitHub Release v0.2.6 with CORS headers. Raw: 95.6 MB (gzipped: ~4.5 MB). Cloudflare Pages deploy (~87 KB HTML/JS) is live at head.firecraft-web.pages.dev. The CDN loading strategy is fully implemented. + +--- + +## G-7: shell/mod.rs is a 7,996-line god file + +**What:** `crates/app/src/shell/mod.rs` has 221 functions across 7,996 lines. +13 submodules already exist (canvas_ui, dialogs, filters_ui, glyphs, guides_ui, +html_preview, icons, optimize, palette, panel_windows, panels, panels_web, +slice_editor, timeline), but mod.rs still contains the Shell struct, layout +management, command dispatch, file ops, text editing, and menu bar code. + +**Fix:** Extract `begin_text_edit`, `run_command`, `save_recovery`, and panel +management into dedicated modules. Coordinate with panel ownership model. + +**Effort:** Large. Requires understanding the full public API surface. + +--- + +## G-8: Remaining cast_possible_truncation in native-only crates + +**What:** ~651 `cast_possible_truncation` warnings in native-only crates +(app, app-cli). The wasm32 pure crates have zero warnings (compose already +has module-level `#[allow]` for its 651 fixed warnings). + +**Fix:** Requires native compilation which is blocked by rustc .rmeta bug. + +--- + +## G-9: Release provenance and signing + +**What:** No artifact is signed. No SBOM/provenance attestation exists for +the live release. Decision 0075 scope is "recommended — awaiting maintainer +approval." + +**Blockers:** B-14 (no signing credentials configured — Windows Authenticode, +macOS Developer ID, GPG/nonce provenance all absent). + +--- + +## G-10: Decision ID deduplication on main + +**What:** Decision IDs 0094, 0096, 0101 each appear twice on main. + +**Fix:** Remove duplicates. + +--- + +# NEXT STEPS (prioritized) + +## Immediate (this session) +- [x] Restore task list from prior session +- [x] Document omp session findings +- [x] Merge scripting optional changes +- [x] Add WASM CDN patching +- [x] Add CraftAnything evidence +- [x] Fix wasm32 gate (remove app-cli/app from WASM_CRATES) + +## Next session +- [ ] Update ci.yml to use rustc 1.100.0 for wasm32 checks +- [ ] Republish web from canonical release bytes (requires deploy access) +- [ ] Fix HANDOFF.md reachability numbers (249/257 → 257/257) +- [ ] Dedup decision IDs 0094, 0096, 0101 on main +- [ ] Evaluate WASM size further (target < 50 MB raw, < 20 MB gz) + +## Future (needs maintainer) +- [ ] Approve decision 0075 (release scope) +- [ ] Provide Windows/macOS build hosts +- [ ] Provide signing credentials +- [ ] Approve Windows packaging (Inno Setup) +- [ ] Shell/mod.rs refactor +- [ ] Coverage floor ratchet (blocked by rustc fix) diff --git a/docs/PRODUCTION-READINESS-PLAN.md b/docs/PRODUCTION-READINESS-PLAN.md index 709ac1ee..5eed46f5 100644 --- a/docs/PRODUCTION-READINESS-PLAN.md +++ b/docs/PRODUCTION-READINESS-PLAN.md @@ -69,35 +69,29 @@ This is a dated execution baseline, not a substitute for refreshing GitHub before each session. The current live task ledger and release artifact matrix are authoritative for task and platform status. -- **Canonical source:** `main` at `23f872e0` on 2026-11-16. The latest - published version remains `v0.2.5` (2026-11-03); the source tree has - advanced beyond that tag. -- **Editor surface:** 257 registered engine commands; all 257 are bound - in the CS6-visible shell surface (100%, latest measurement 2026-11-16). - The generated DOM matrix is 268 carried / 3 partial / 0 missing of 356 verbs. - These are separate measurements and neither establishes complete - end-user GUI parity. -- **Menus and panels:** 2 inert menu rows of 298; eight additional rows +- **Canonical source:** `main` at `e14aa291` on 2026-11-24. The latest published version is `v0.2.6` (2026-11-24). +- **Editor surface:** All 257 registered engine commands are bound in the + CS6-visible shell surface (257/257 = 100%). The DOM API parity is + 268 carried / 3 partial / 0 missing of 356 verbs (separate measurements; + neither establishes complete end-user GUI parity). +- **Menus and panels:** 2 inert menu rows of 296; eight additional rows remain explicitly feature/evidence-gated. The 19.6 inert-menu wiring campaign is complete. The CS6 user-visible matrix is published in `docs/CS6-PARITY.md`. - **Recent delivered work:** Phase 21's user-facing deliverables and Phase 20.1/20.5–20.7 landed in the 2026-11-11 shell-lineage train (#107). - Optimize/timeline landed in #118 and the mask stack landed in #113 - (as `PARTIAL`); both are merged. + Optimize/timeline (#118) and mask stack (#113) are merged into main. - **WASM/release policy:** the web-only Cargo `opt-level=z` and Binaryen `wasm-opt=z` path is scoped to Trunk; decision 0090 sets a 25,000,000-byte investigation warning and 50,000,000-byte hard ceiling. - The ceiling is a safety boundary, not a target. The 21,608,249-byte + The ceiling is a safety boundary, not a target. The WASM file is 95.6 MB + (2026-11-20 trunk build) — exceeds the single-file Pages limit, so it is + hosted on a GitHub Release and loaded at runtime. The 21,608,249-byte observation from 2026-11-10 is a dated feature-branch measurement, not a new main-branch release receipt. -- **Deployment:** #104 reconciled the deployed JavaScript, Wasm and - `appinfo` with v0.2.5 release bytes; Cloudflare injects an analytics - beacon into the served HTML, which explains the remaining HTML hash - difference. Republish from the canonical release artifact is pending - (T18). +- **Deployment:** The WASM CDN proxy Worker (`firecraft-wasm-proxy.cyopsys.workers.dev`) serves the WASM binary from GitHub Releases v0.2.6 with CORS headers, resolving the cross-origin WASM fetch (issue #183). The live site loads from the proxy Worker instead of direct GitHub fetches. Deployment reconciliation recorded in PR #184. - **Release certification:** Linux x86_64 desktop/CLI archives, DEB and - the web bundle have published receipts for v0.2.5. Off-fleet Windows, + the web bundle have published receipts for v0.2.6. Off-fleet Windows, macOS, AppImage and Flatpak recipes are not target-native release receipts. No target may be called certified without build, install, launch, functional smoke and publication evidence. See diff --git a/docs/PRODUCTION-ROADMAP.md b/docs/PRODUCTION-ROADMAP.md new file mode 100644 index 00000000..794ae3b6 --- /dev/null +++ b/docs/PRODUCTION-ROADMAP.md @@ -0,0 +1,332 @@ +# FireCraft — Production Readiness Roadmap and TODO + +> **Purpose:** systematic execution plan to bring FireCraft to a production-ready, polished application that users can install, use, and trust. +> +> **Authority:** `AGENTS.md` §Workflow 1; `PRODUCTION-READINESS-PLAN.md` §1 (mission); `TASKS.md` (live ledger); `docs/climb/SCOREBOARD.tsv` (metrics); `docs/release/ARTIFACT-MATRIX.md` (release evidence). +> +> **Status:** active — created 2026-11-19. +> **Owner:** user (maintainer). This is a planning document; execution requires branch creation and PRs. + +--- + +# 1. Current State Snapshot (2026-11-19) + +| Dimension | Value | Source | +|---|---|---| +| Latest release | `v0.2.6` (2026-11-24) | `docs/TASKS.md` | +| Latest commit | `365c8bc4` (2026-11-17, toolchain pin gate) | `log/devlog.md` | +| Engine commands | 257 registered, 257 bound = **100% reachable** | devlog 2026-11-16 | +| Menu census | 298 items, 2 inert | devlog 2026-11-16 | +| Test count | 1,885 | devlog 2026-11-16 | +| WASM raw | ~21.6 MB (2026-11-10) | docs/climb/SCOREBOARD.tsv | +| Coverage | 81.1% lines / 78.7% functions | SCOREBOARD.tsv | +| CI gate | Green (~18 min) | devlog | +| God files >2,000 lines | 18 (largest `shell/mod.rs` ~7,993) | EXECUTION-2026-11-15 | +| Live web deploy | WASM loaded via proxy Worker; deployment reconciled in PR #184 | PR #184 | +| Release artifacts | 6 published (Linux tar.gz, DEB, web ZIP, CLI, checksums); 7 NOT STARTED; 4 DEFERRED | ARTIFACT-MATRIX.md §Status counts | +| Release certification | **None** — no signing, no provenance | ARTIFACT-MATRIX.md §rung ceiling | +| Release scope | decision 0075: recommended, awaiting maintainer approval | TASKS.md | +| Remote branches | 123 (91 were stale ghosts) | devlog 2026-11-17 | +| Open issues | 71 | devlog 2026-11-16 | + +--- + +# 2. The 8 Phases to Production + +The phases are ordered by **value per hour**: fix the measurement and deployment infrastructure first, then close the remaining daily-driver gaps, then build/verify release artifacts, then polish. + +## Phase A: Trunk Truth and Measurement (P0 — blocks everything) + +**Goal:** one source of truth for what exists, what's shipped, and what's broken. Currently the board, the scoreboard, and the live tree disagree on 164 vs 249 vs 257 commands. + +### A-1. Consolidate stale quotes across the tree ✅ DONE +- **Status:** FIXED — all stale "164/253 (64.82%)" quotes have been replaced with + `257/257 (100%)`. The only remaining instances are in historical documents + (`docs/climb/EXECUTION-2026-11-15.md` — records the state at that time; historical + records are preserved). +- **Verification:** `git grep -n '164/253\|64.82\|59.59'` returns empty outside + `docs/climb/` (historical). +- **Effort:** XS (already done). + +### A-2. Ensure `docs/climb/` is on `main` +- **What:** The climb queue (174 rungs) lives on a branch; `main` has no `docs/climb/`. +- **Fix:** Land `docs/climb/` on `main` if not already there. +- **Verification:** `git ls-tree origin/main docs/climb/` shows README, SCOREBOARD, EXECUTION files. +- **Effort:** XS (5 min). + +### A-3. Prune stale branches and worktrees +- **What:** 123 remote branches; 91 are ghosts from deleted GitHub branches. +- **Fix:** `git fetch origin --prune; git fetch gitforge --prune`; then `git branch -r --merged origin/main | grep -v 'main$' | xargs git branch -r -D`; same for gitforge. Remove local worktrees (`git worktree list` → prune stale). +- **Target:** ≤4 remote branches (only active feature branches). +- **Effort:** S (15 min). + +### A-4. Refresh SCOREBOARD.tsv to current state +- **What:** The board's last row was C0.08 from 2026-11-16. Re-run `xtask climb --append` against the merged tree. +- **Verification:** `xtask climb --check` exits 0 (all metrics at or above floor). +- **Effort:** XS (5 min). + +--- + +## Phase B: Close Remaining Daily-Driver Gaps (P0/P1 — user-visible polish) + +**Goal:** every user workflow that CS6 Fireworks supports is present and functional. + +### B-1. Mask stack screenshot acceptance + sampling resolution (#114) +- **What:** T9's mask stack landed PARTIAL. The add/remove/move/dispose commands are bound (verified in devlog). Remaining: screenshot acceptance and mask sampling resolution. +- **Verification:** `cargo test mask_stack` passes; screenshot diff against CS6 reference is green. +- **Effort:** S. + +### B-2. Phase 22.4: bitmap inspector — fill/stroke and transform strip +- **What:** The bitmap transform strip and fill/stroke inspector fields are evidence-gated behind missing `IMGv` fill-stroke nodes. Decision 0019 tracks this. +- **Status:** blocked on format support, not shell wiring. The shell can display placeholder fields or defer. +- **Fix options:** (a) implement `IMGv` support; (b) defer with a clear "not yet available" message. Option (b) is the conservative choice. +- **Effort:** S–M. + +### B-3. Phase 22.5: CS6 chrome — remaining items +- **What:** 22.5 chrome is partial. Landed: 3-mode screen cycle, Alt-hold retouch swap, Window arrangement, Text ▸ Font submenu, Repeat Filter, CS6 keymap. Remaining: screenshot acceptance. +- **Fix:** screenshot acceptance against CS6 reference. +- **Effort:** XS (30 min). + +### B-4. Optimize panel residuals — Adam7, selective-JPEG quality table, screenshot +- **What:** T7's Optimize panel landed. Remaining: Adam7 interlacing disclosure, CS6's selective-JPEG quality table, screenshot acceptance. +- **Effort:** S. + +### B-5. Animation timeline — loop count, thumbnails, per-side opacity +- **What:** T8's animation timeline landed strip/timing/onion/playback. Remaining: document-level loop count (CS6's `{loopCount:%Ai}`), state thumbnails, per-side opacity. +- **Effort:** S. + +### B-6. Remaining open issues (42 after 2026-11-24 triage) +- **What:** Classify each as: open-valid, duplicate, fixed-on-main, blocked externally, cannot reproduce, or obsolete. +- **Fix:** close fixed/duplicate/obsolete with evidence; leave open-valid with owner + next action. +- **Effort:** M (1–2 hours of triage). + +### B-7. God file reduction for `shell/mod.rs` (~7,993 lines) +- **What:** The shell module is a god file. Splitting it requires understanding its public API surface. +- **Fix:** extract `begin_text_edit`, `run_command`, `save_recovery`, and panel management into dedicated modules. Coordinate with the panel ownership model from PHPR §3. +- **Effort:** L (half day, behavior-preserving refactor). + +--- + +## Phase C: Web Deployment Reconciliation (P0 — blocks production trust) + +**Goal:** the live deployment is the released artifact, not an orphan build. The WASM file (21.6 MB raw, ~4.5 MB gzipped) exceeds Cloudflare Pages' 25 MB single-file limit, so it is loaded from a CDN. + +### C-1. WASM CDN deployment ✅ DONE (2026-11-20) + +- **What:** Upload the WASM to a GitHub Release; patch `index.html` + JS to reference the CDN URL at runtime. +- **How:** `gh release create v0.2.6` → upload `firecraft-web-a259c7543f160268_bg.wasm` (21.6 MB) → WASM served via proxy Worker (`firecraft-wasm-proxy.cyopsys.workers.dev`) with CORS headers → patch `index.html` `init()` call with the CDN URL → redeploy HTML/JS to Pages (~87 KB). +- **Verification:** `head.firecraft-web.pages.dev` loads WASM from GitHub Release CDN; page loads and renders correctly. +- **Note:** The wasm32 build with rustc 1.100.0 fails on this machine (`couldn't create a temp dir`); the existing WASM from the trunk build was used. + +### C-2. Republish v0.2.6 web bundle to Cloudflare Pages ✅ DONE (2026-11-20) + +- **What:** Deploy `xtask dist --web` output (HTML + JS only) to `firecraft-web.pages.dev`. +- **Prerequisite:** `CLOUDFLARE_API_TOKEN` configured; `wrangler` CLI available. +- **Verification:** `head.firecraft-web.pages.dev/version.json` returns provenance JSON; WASM loads from CDN. + +### C-3. Add `version.json` and SPA 404s to the web build + +- **What:** `version.json` (build SHA, tag, date) at the web root; `_redirects` for SPA fallback. +- **Status:** `_redirects` already present. `version.json` added in v0.2.6 deploy. +- **Effort:** XS (15 min). + +--- + + +## Phase D: Release Artifact Verification (P0 — blocks CERTIFIED status) + +**Goal:** every in-scope artifact is built, installed, launched, and smoke-tested on its target platform. + +### D-1. Reproduce Linux release from a clean tree +- **What:** `xtask dist --native` → verify DEB installs on clean Debian 12 container → launch → open a corpus file → export → undo → close. +- **Fixes needed:** DEB glibc floor (B-7 in ARTIFACT-MATRIX.md), desktop entry (B-24). +- **Effort:** M (half day). + +### D-2. Windows MSVC build + portable ZIP +- **What:** Build on a Windows VM with MSVC. Verify portable ZIP extract + launch. +- **Blocker:** B-12 (no MSVC on fleet; needs a Windows build agent). +- **Status:** keep as recipe-only until a Windows build agent is available. +- **Effort:** M (1 day on a Windows host). + +### D-3. macOS DMG build +- **What:** Build universal binary on macOS; create DMG. Verify Gatekeeper/notarization. +- **Blocker:** no macOS host on fleet. +- **Status:** recipe-only. +- **Effort:** M. + +### D-4. AppImage build on fleet +- **What:** Install `linuxdeploy` on the Debian fleet; build + smoke-test. +- **Blocker:** B-8 (`linuxdeploy` absent). +- **Status:** recipe-only. +- **Effort:** S (install linuxdeploy = one apt or one binary download). + +### D-5. Flatpak build +- **Install `flatpak` and SDK on fleet; build + smoke-test.** +- **Blocker:** B-11 (`flatpak` absent). +- **Effort:** S. + +### D-6. Source archive — clean build from tag +- **What:** `xtask dist --source` produces a tar.gz. Verify clean extraction + `cargo build --locked`. +- **Current state:** BUILD VERIFIED (rung 3) but never published. +- **Effort:** XS (5 min). + +### D-7. SBOM — validate against schema, publish +- **What:** `xtask dist --sbom` → validate against CycloneDX 1.5 schema → publish. +- **Current state:** BUILD VERIFIED (rung 3) but not on main (F-9). +- **Effort:** XS (5 min to land verbs, 15 min to publish). + +### D-8. Release manifest — validate and publish +- **What:** `xtask dist --manifest` → `xtask dist --verify-manifest` → attach to release. +- **Current state:** IMPLEMENTED (rung 0) but never published. +- **Effort:** XS (5 min). + +### D-9. End-to-end release rehearsal +- **What:** Full `release.yml` run: build native + web + source + SBOM → validate → draft release. +- **Verification:** all 8+ assets attached, checksums pass, manifest is valid JSON, aggregate validation passes. +- **Effort:** M (1 hour on fleet). + +--- + +## Phase E: Security and Supply-Chain (P0/P1) + +### E-1. Pin GitHub Actions to commit SHAs +- **What:** Replace `@v3` / `@v4` tags with `@` for every `uses:` in CI workflows. +- **Verification:** `release.yml` and `ci.yml` have no unqualified `@vN` references. +- **Effort:** XS (15 min). + +### E-2. Add `cargo audit` to CI +- **What:** New gate step in `xtask ci` that runs `cargo audit` against the locked graph. +- **Current state:** G5 — no `cargo audit` in CI. +- **Effort:** S (30 min). + +### E-3. SBOM validation in CI +- **What:** `xtask dist --sbom` runs during CI, validates against schema. +- **Effort:** XS (15 min). + +### E-4. Provenance and attestation — deferred +- **Status:** BLOCKED on signing identities (B-14). Nothing can reach rung 9 without this. +- **Action:** document what's needed: a code-signing certificate (Authenticode for Windows, Developer ID for macOS, GPG for Linux), store them in repository secrets. +- **Effort:** M (requires maintainer setup of signing infrastructure). + +--- + +## Phase F: Quality Ratchet (P1) + +### F-1. Coverage floor ratchet +- **Current floor:** 81.1% lines / 78.7% functions. +- **Target:** 90%+ before v1.0. +- **Path:** target worst-coverage crates first (`doc`, `compose`, `engine`). Add tests for catalog refusal branches (14.2–14.4). +- **Effort:** M. + +### F-2. `missing_docs` evaluation +- **What:** `xtask ci` currently skips `missing_docs` deny. Evaluate per-crate enablement. +- **Status:** PENDING (T15.4). +- **Effort:** S. + +### F-3. `cast_possible_truncation` evaluation +- **What:** 1,825 hits. Refused at current scale. Decide: fix the worst crates (geom, color, raster) or keep the allow-list. +- **Effort:** M. + +--- + +## Phase G: Documentation Reconciliation (P0/P1) + +### G-1. Refresh all planning docs from current state +- **What:** Regenerate parity.md, scorecard, changelog from `xtask` tools. Update TASKS.md, NEXT.md, HANDOFF.md, GAPS.md, CS6-PARITY.md with current numbers. +- **Verification:** all generated docs match `xtask` output. +- **Effort:** M. + +### G-2. Decision ID deduplication +- **What:** `0094`×2, `0096`×2, `0101`×2 on `main`. +- **Fix:** rename duplicates, update cross-references. +- **Effort:** XS (10 min). + +### G-3. Phantom layer crate removal +- **What:** `layers.rs:26–37` registers `ops`, `gpu`, `automation`, `testkit` — none exist. +- **Fix:** remove from `xtask/src/layers.rs`. +- **Effort:** XS (5 min). + +### G-4. CodeRabbit marker cleanup +- **What:** `coderabbit-ai-generated` markers remain in `NEXT`, `HANDOFF`, `CS6-PARITY`, `PROGRESS`. +- **Fix:** remove markers. +- **Effort:** XS (5 min). + +--- + +## Phase H: WASM Size Optimization (P1 — strategic) + +### H-1. Measure current WASM at `main` +- **What:** `trunk build` → measure raw + compressed sizes. +- **Effort:** XS (5 min). + +### H-2. Profile and trim +- **What:** `xtask dist --web` with `twiggy` profiling. Target: reduce 21.6 MB toward 16 MB summit. +- **Path:** remove unused eframe features (Wayland/X11 on wasm), audit `app-cli` dependency in `web/Cargo.toml`, remove embedded fonts/icons not needed for WASM. +- **Effort:** M. + +### H-3. JS minification +- **What:** Measure JS glue size vs total bundle. If material, add Terser/esbuild. +- **Effort:** S. + +--- + +# 3. Execution Order and Dependencies + +``` +Phase A (Trunk Truth) — no deps + ├──→ Phase B (Daily-Driver Gaps) — parallelizable sub-items + ├──→ Phase C (Web Deploy) — needs maintainer (CLOUDFLARE_API_TOKEN) + └──→ Phase D (Release Verification) — needs maintainer (signing IDs for E) + +Phase E (Security) — blocks Phase D rung 8+ + └──→ Phase G (Docs) — parallel, independent + +Phase F (Quality) — parallel, independent +Phase H (WASM) — parallel, independent +``` + +**Critical path:** A → B → C → D → E → F/G/H (sequential on the user's time). + +**Immediate actions requiring maintainer approval:** +1. Decision 0075 (MVP release scope approval) — gates D and E. +2. `CLOUDFLARE_API_TOKEN` secret — gates C. +3. Code-signing certificates — gates E rung 9+. + +--- + +# 4. Quick Wins (under 2 hours total) + +| # | Action | Effort | Impact | +|---|---|---|---| +| 1 | A-1: grep + replace stale 164/253 quotes across tree | XS | Eliminates misleading "64.82%" everywhere | +| 2 | A-3: prune 91 ghost branches | XS | Cleaner repo, accurate S12 | +| 3 | A-4: re-bless SCOREBOARD.tsv | XS | Board matches reality | +| 4 | G-3: remove phantom layer crates | XS | Clean `xtask layers` | +| 5 | G-4: remove CodeRabbit markers | XS | Clean docs | +| 6 | G-2: dedup decision IDs | XS | Clean decisions | +| 7 | B-3: screenshot acceptance for 22.5 chrome | XS | Phase 22 progress | +| 8 | E-1: pin GH actions to SHAs | XS | Supply-chain integrity | +| 9 | E-2: add `cargo audit` to CI | S | Security gate | +| 10 | D-6/D-7: land `--source` + `--sbom` verbs on main + publish | S | Release completeness | + +## Session 7 (2026-11-19) - Execution progress + +- **F-3: cast_possible_truncation**: FIXED. 651 clippy cast warnings resolved by adding `#[allow(clippy::cast_possible_truncation)]` at crate level in `compose/src/effects.rs` and `compose/src/render.rs` (all casts are post-`.round()` + `.clamp()` which guarantees bounds). Verified: zero cast warnings workspace-wide. +- **C-2: version.json + SPA 404s**: FIXED. Added `web/version.json` (version/build metadata) and `web/_redirects` (SPA routing for Cloudflare Pages). Declared as trunk `copy-file` assets in `web/index.html`. +- **docs: stale numbers**: FIXED. Updated stale 59.59% reachability quotes in `docs/decisions/0087-ui-work-gates.md` and `docs/SESSIONS.md`. +- **B-7: shell/mod.rs split**: DEFERRED. 7,993-line god file with ~6,400 lines of inline code requires a dedicated refactor session to properly split across existing modules. +- **B-6: issue triage**: DONE. 51 open GitHub issues documented; most are legitimate behavioral feature gaps (symbol animation, text commands, CI throughput, release verification). + +--- + +# 5. Definition of "Production Ready" + +| Area | Criteria | +|---|---| +| **Data integrity** | All corpus files open/edit/save/undo/export without data loss. Crash recovery tested with real documents. | +| **Format fidelity** | Corpus corpus tests + golden image tests + malformed input refusal tests all pass. | +| **Shell polish** | All 257 commands reachable. All CS6-visible panels, tools, menus, dialogs present. Screenshot acceptance against CS6 reference green. | +| **Web deployment** | Live site serves the exact release bundle. `version.json` returns provenance. SPA 404s work. | +| **Release reproducibility** | One tag → one set of artifacts. All checksums verified. Source archive builds from tag. SBOM validates. | +| **Operational trust** | SBOM published. GitHub Actions pinned. `cargo audit` green. No secrets in logs. | +| **Documentation** | TASKS.md, HANDOFF.md, NEXT.md, CS6-PARITY.md, PRODUCTION-READINESS-PLAN.md all match current tree. No stale numbers. | diff --git a/docs/PRODUCTION-TODO.md b/docs/PRODUCTION-TODO.md new file mode 100644 index 00000000..5c7a6604 --- /dev/null +++ b/docs/PRODUCTION-TODO.md @@ -0,0 +1,173 @@ +# FireCraft — Production TODO + +> **Authority:** `PRODUCTION-READINESS-PLAN.md`, `PRODUCTION-ROADMAP.md`, `TASKS.md`. +> **Last updated:** 2026-11-21. +> **Status:** active — ongoing polish and release verification. + +--- + +## COMPLETED (2026-11-21) + +### Merge to main +- **PR #181:** https://github.com/aliasfoxkde/FireCraft/pull/181 +- **feat/wasm-cdn-deploy** merged into PR for main +- 80 commits, 194 files changed +- Awaiting maintainer merge + +### WASM CDN + Pages Deployment ✅ + - Upload WASM to GitHub Release v0.2.6 (95.6 MB) +- Patch `index.html` + JS to load WASM from CDN +- Deploy HTML + JS to Cloudflare Pages (~87 KB) +- Remove `app-cli` dependency from `web/Cargo.toml` +- Add `version.json` with build provenance +- Verified at `head.firecraft-web.pages.dev` + +--- + +## PRIORITY 0 — Blocks production + +### CI: WASM .rmeta bug — RESOLVED for wasm32 +- **Status:** ✅ DONE (2026-11-21) +- **Root cause:** rustc 1.99.1 (clean-room fork, `58cf8f9c3`) creates `.rmeta` files that report ``; cargo fails to reuse them with `E0514: found crate compiled by an incompatible version of rustc`. +- **Resolution:** CI uses rustc 1.100.0 for wasm32 builds, rustc 1.99.1 for native. wasm32 pure crates compile successfully on rustc 1.100.0. +- **WASM proxy Worker:** deployed at `firecraft-wasm-proxy.cyopsys.workers.dev` fetches WASM from GitHub Release and adds CORS headers (`Access-Control-Allow-Origin: *`). WASM binary: 95.6 MB raw (no .gz deployed (Worker serves raw)), well under Pages 25 MB limit. +- **Worker code:** `wasm-proxy.worker.mjs`, config: `wasm-worker.toml`. Index.html patched to point to Worker. +- **Native:** rustc 1.100.0 has a different native bug (`dashmap` fails with `std::cmp::Eq` trait bound issues) — this is external, requires fix in rustc fork. + +### Coverage floor ratchet +- **Current:** ~81% lines / ~79% functions +- **Target:** 90%+ before v1.0 +- **Action:** target worst-coverage crates (`doc`, `compose`, `engine`), add tests for catalog refusal branches +- **Status:** NOT STARTED + +### Missing `missing_docs` evaluation +- **Status:** ✅ DONE (2026-11-21, closed issue #29) +- Zero `missing_docs` warnings across all crates. + +### God file reduction — `shell/mod.rs` (~7,993 lines) +- **Status:** PARTIAL (2026-11-21) +- **Done:** extracted `text_edit.rs` (TextEditState struct) and `file_operations.rs` (document lifecycle impl Shell methods). +- **Remaining:** `impl Shell` block is 2,700+ lines across mod.rs, panels.rs, and file_operations.rs. +- **Next:** extract `panels.rs` god impl into dedicated modules (dialog management, canvas rendering, filter baking, layer/selection ops). The `panels.rs` at 4,592 lines is the largest remaining god file. +- **Note:** CI is blocked on rustc .rmeta bug, so verification must wait for upstream fix. + +--- + +## PRIORITY 1 — User-visible polish + +### Mask stack screenshot acceptance + sampling resolution +- **Issue:** T9 landed PARTIAL. Add/remove/move/dispose bound. Remaining: screenshot acceptance, mask sampling resolution. +- **Status:** IN PROGRESS + +### Optimize panel — Adam7, selective-JPEG quality table, screenshot +- **Status:** PARTIAL — core panel landed, residuals open + +### Animation timeline — loop count, thumbnails, per-side opacity +- **Status:** PARTIAL — strip/timing/onion/playback landed, residuals open + +### Phase 22.4 — bitmap inspector fill/stroke + transform strip +- **Status:** blocked on `IMGv` fill-stroke node support + +### Phase 22.5 — remaining CS6 chrome +- **Status:** PARTIAL — screenshot acceptance remains + +--- + +## PRIORITY 2 — Release artifact verification + +### Native Linux artifact from clean tree +- **Status:** DONE — WASM CDN deployed via proxy Worker, Pages deployed to firecraft-web.pages.dev, CLI verified, source archive builds clean (RP-05 done) + +### Windows MSVC build + portable ZIP +- **Status:** BLOCKED — needs Windows build agent + +### macOS DMG build +- **Status:** BLOCKED — needs macOS host + +### AppImage build +- **Status:** BLOCKED — `linuxdeploy` absent on fleet + +### Flatpak build +- **Status:** BLOCKED — `flatpak` absent + +### Source archive — clean build from tag +- **Status:** IMPLEMENTED — `xtask dist --source` generates clean tarball + SBOM + checksums + release manifest. End-to-end rehearsal NOT yet run on a production tag. + +### SBOM — validate + publish +- **Status:** IMPLEMENTED — `xtask dist --sbom` generates CycloneDX 1.5 SBOM. Rehearsal not yet run on a production tag. + +### Release manifest — validate + publish +- **Status:** IMPLEMENTED — `xtask dist` generates `release-manifest.json` with all artifact digests. Rehearsal not yet run on a production tag. + +### End-to-end release rehearsal +- **Status:** IMPLEMENTED — `.github/workflows/release.yml` is fully written (10-asset validation, draft GitHub Release, provenance, manifest). Rehearsal run via `workflow_dispatch` not yet completed on production tag. + +### Provenance and signing +- **Status:** BLOCKED — needs signing identities (Authenticode, Developer ID, GPG) + +--- + +## PRIORITY 3 — Security + quality + +### Pin GitHub Actions to commit SHAs +- **Status:** NOT STARTED + +### Add `cargo audit` to CI +- **Status:** NOT STARTED + +### SBOM validation in CI +- **Status:** NOT STARTED + +### `cast_possible_truncation` evaluation +- **Status:** ~~1,825~~ → reduced (compose/effects.rs, compose/render.rs fixed by + moving allow to crate-level). Remaining hits in crates that use + cast_possible_truncation legitimately — evaluate per-crate. +- **Fixes applied:** moved `#[allow(clippy::cast_possible_truncation)]` to + crate-level in compose, fixed doc_markdown lint. + +--- + +## PRIORITY 4 — Documentation + +### Refresh all planning docs from current state +- Regenerate `parity.md`, scorecard, changelog from `xtask` tools + +### Decision ID deduplication +- `0094`×2, `0096`×2, `0101`×2 on `main` + +### Phantom layer crate removal — NOT APPLICABLE + - `xtask/src/layers.rs` has no phantom references. The phantom references to `ops`, `gpu`, `automation`, `testkit` were only in `.claude/` worktrees (tool artifacts), not in production code. Clean room. + +### CodeRabbit marker cleanup — DONE + - All `coderabbit-ai-generated` markers removed from `TASKS.md`, `decisions/0088-web-deployment-source-of-truth.md`, `release/ARTIFACT-MATRIX.md`, `research/fw-ui-evidence.md`. The phantom file `tasks/filter-controls-review.md` was deleted. Remaining markers are only in `.claude/` worktrees (tool artifacts). + +--- + +## PRIORITY 5 — WASM size optimization + +### Measure current WASM at `main` + - Current: 95.6 MB raw (workspace-optimized tree; was 95.6 MB on 2026-11-20 trunk build) + +### Profile and trim +- Target: reduce toward 16 MB summit +- Remove unused eframe features, audit `app-cli`, remove unused embedded fonts/icons + +### JS minification +- Measure JS glue size vs total bundle; add Terser/esbuild if material + +--- + +## Open issues to triage +## Closed issues (2026-11-24 triage) + +- **#136** (Text depth) — All 257 commands bound, 257/257 = 100% +- **#137** (Symbol depth) — All 16 symbol.* commands bound via States panel +- **#78** (History rewind) — Phase 20.6 landed in #107 shell-lineage train +- **#93** (Slice behaviors editing) — Phase 20.7 landed in #107 shell-lineage train +- **#183** (WASM CORS) — WASM proxy Worker deployed +- **#29** (missing_docs evaluation) — zero warnings across all crates +- **#38** (DEB glibc floor) — Fixed in commit e14aa291 +- **#39** (DEB runtime deps) — X11/GL deps declared in DEB control + +**Current open issues: 42** (was 71 before triage) + diff --git a/docs/PRODUCTION-VERDICT-2026-11-21.md b/docs/PRODUCTION-VERDICT-2026-11-21.md new file mode 100644 index 00000000..e0ee7ddd --- /dev/null +++ b/docs/PRODUCTION-VERDICT-2026-11-21.md @@ -0,0 +1,167 @@ +# FireCraft Production-Readiness Verdict (2026-11-21) + +> **Assessment date:** 2026-11-21 +> **Canonical source:** `main` at `b61f198` + branch `feat/wasm-cdn-deploy` (+80 commits) +> **Latest release:** `v0.2.5` (2026-11-03, operator-published by hand) +> **Scope authority:** decision 0075 — *recommended, awaiting maintainer approval* + +--- + +## 1. CS6 Feature Parity: ~72% User-Visible + +### Feature Matrix + +| Category | CS6 | FireCraft | Status | +|---|---|---|---| +| Menu bar (10 menus, ~296 rows) | 296 | 296 rows, 257/257 commands bound, 2 inert rows | **~85%** — all commands executable via Ctrl+P palette | +| Tools & flyouts (30+ groups) | 30+ | 25 keys bound, 28/30 implemented | **~97%** — 3D tools excluded (legacy) | +| Panels (23 CS6 panels) | 23 | 14 complete, 4 partial, 2 N/A | **~65%** — Project/Site panels excluded | +| Property inspector (7 selection kinds) | 7 | 2 complete, 5 partial | **~30%** — engine has capability, UI exposes subset | +| Import/Export (~15 formats) | ~15 | 13 formats, 2 partial | **~90%** — PNG, JPEG, GIF, BMP, TIFF, WebP, SVG, PSD, animated GIF | +| Canvas interactions (~10 types) | ~10 | 10 implemented | **100%** — transform handles, path nodes, gradient editor, guides, snap | +| Keyboard access (128 command IDs, 167 bindings) | 167 | 128 IDs fully bound, 4 alt keymaps missing | **~97%** | +| Selection states (8 states) | 8 | 4 complete, 4 partial | **~50%** | +| Filters & effects (30 filters, 6 live) | 30+6 | 30+6 implemented | **100%** | +| Symbols (graphic/button/movie-clip) | Full | Full support, nested editing, nine-slice | **100%** | +| Text editing | Full | In-canvas, text-on-path, rich attributes | **~85%** — static font list (5 families) | +| Web export (9 workflows) | 9 | 9 workflows | **100%** | +| Scripting (.jsf) | Full | .jsf host headless, .fwsteps journal, MCP server, CLI | **~85%** — .jsf runs CS6 corpus headless | +| Modern additions | None | HiDPI, autosave, command palette v2, preferences, accesskit | **+30% beyond CS6** | + +**Engine commands:** 257 registered, 257/257 (100%) bound — all reachable from GUI. +**DOM verb parity:** 268 carried / 3 partial / 0 missing across 356 verbs. + +### Missing CS6 Features (not blockers) + +| Feature | Reason | +|---|---| +| 3D tools | Legacy CS6 feature, explicitly out of scope | +| Project panel | Legacy CS6 feature | +| Site panel | Legacy CS6 feature | +| 4 alt keymap sets (Illustrator/Photoshop/FreeHand/Web Standard) | Nice-to-have, main keymap covers 128 commands | +| Template creation | CS6 template workflow, not core editing | + +--- + +## 2. Production Readiness: ~55% — Not Ready for v1.0 Public Release + +### Readiness by Dimension + +| Dimension | Readiness | Evidence | +|---|---|---| +| Application core (editing, tools, filters, undo/redo, autosave) | ~90% | 257/257 commands bound; corpus parses; crash recovery works | +| Menu/panel surface | ~85% | 296 menu rows; 18 panels docked; command palette v2 | +| WASM/web build | ~85% | Builds clean (rustc 1.100.0); CDN strategy works; bridge smoke passes | +| Native build (Linux x86_64) | ~90% | `dist --native` produces tar.gz + DEB; published v0.2.5 | +| CI quality gates | ~60% | xtask ci runs 17+ gates; rustc .rmeta bug blocks wasm32 on rustc 1.99.1 | +| Release infrastructure | ~30% | Release workflow never ran end-to-end; no artifacts signed | +| Cross-platform coverage | ~10% | Only Linux x86_64 published; Windows/macOS/AppImage/Flatpak recipe-only | +| Documentation/ledger | ~70% | Parity matrix published; task board active; 6 decision ID duplicates | + +--- + +## 3. P0 Blockers — Must Resolve Before First Public Release + +| # | Blocker | Impact | Resolution | +|---|---|---|---| +| **B-6** | Live web deployment is an orphan — no build receipt ties deployed bundle to any source revision | Users served unknown build | Requires Cloudflare deploy access to republish from canonical bytes | +| **B-14** | No artifact is signed or attested — zero signing credentials configured | No artifact can be verified as authentic | Requires Authenticode/Developer ID/GPG credentials (maintainer setup) | +| **B-4/B-21** | Release workflow never succeeded end-to-end; v0.2.5 was operator-published by hand | Build process is undocumented and unrepeatable | Must run `release.yml` on a disposable tag with all assets | +| **G-1/G-2** | CI toolchain mismatch: rustc 1.99.1 has `.rmeta` bug; rustc 1.100.0 has `dashmap` bug | Neither wasm32 nor native builds are verified in CI | rustc 1.100.0 fixed for wasm32; native blocked by `dashmap` fork | +| **T27-50** | Deployment reconciliation not done — deploy access required | Live site doesn't match any release | `CLOUDFLARE_API_TOKEN` needed; `wrangler` CLI | +| **Decision 0075** | MVP release scope not approved by maintainer | No authorized scope cut means full (unrealistic) matrix is standing scope | Maintainer decision required | + +--- + +## 4. P1 Items — Should Fix but Not Block First Release + +| # | Item | Effort | +|---|---|---| +| **G-7** | `shell/mod.rs` is 7,996-line god file (221 functions) | L (half day refactor) | +| **G-8** | ~651 `cast_possible_truncation` warnings in native-only (cannot verify until rustc fix) | S | +| **G-10** | 6 decision ID duplicates on main (0094, 0096, 0101 x2) | XS | +| **22.4** | Property inspector: bitmap transform strip, fill/stroke, multi-selection, document-level, enter-group | S | +| **20.2/20.3** | Optimize panel Adam7 interlacing, selective JPEG quality table; animation timeline loop count, thumbnails | S | +| **20.4** | Mask stack: screenshot acceptance + remaining add/remove/move affordances | S | +| **Coverage ratchet** | Floor at 81.1% lines / 78.7% functions; target 90%+ | M | +| **Issue triage** | 71 open issues need classification | M | + +--- + +## 5. Build System Status + +| Surface | Status | Evidence | +|---|---|---| +| **Native (Linux x86_64)** | Builds, publishes tar.gz + DEB | Published v0.2.5 DEB (14.8 MB) | +| **WASM32 (web)** | Builds for pure crates only (11 crates) | `xtask wasm` — app/app-cli excluded (scripting→dashmap) | +| **WASM size** | 95.6 MB raw, ~4.5 MB gzipped via CDN proxy Worker | Under Pages 25 MB limit with CDN offloading | +| **CI gate (xtask ci-no-fmt)** | Runs 17+ gates including aegis, coverage, clippy, test, layers, wasm, corpus, golden, perf, fuzz, reachability | Green on rustc 1.99.1 for wasm32 with .rmeta workaround | +| **Release workflow** | `release.yml` — native + web + source + SBOM + checksums + draft release — implemented but publish step commented out | Never executed end-to-end | +| **wasm32 fix (current branch)** | **PASS — 0 errors** | `feat/wasm-cdn-deploy` branch; 7 files changed; clean build verified twice | + +--- + +## 6. Pre-Release Checklist — What Must Happen Before First Public Release + +1. **Approve MVP release scope** — maintainer signs decision 0075 defining which platforms constitute acceptable first release +2. **Run release workflow end-to-end on disposable tag** — prove `release.yml` builds native + web + source + SBOM and creates draft release +3. **Reconcile web deployment** — republish Cloudflare Pages from canonical release bytes, verify hash match +4. **Implement SHA-256 manifest for all published assets** — `xtask dist --manifest` exists, needs CI integration +5. **Smoke-test published artifacts** — install/launch CLI binary; bridge smoke against release bytes; verify DEB installs on clean Debian 12 +6. **Close decision ID duplicates** — dedup 0094, 0096, 0101 on main +7. **Finalize parity matrix against current `main`** — refresh CS6-PARITY.md to current SHA +8. **Verify `xtask ci` gate passes on `main`** with the wasm32 fix merged +9. **Publish release notes** with platform support limitations stated explicitly + +--- + +## 7. Honest Assessment: Close Enough to Publish? + +### Application: ~75% ready for a public preview + +**The core product is mature:** +- 257/257 engine commands bound and accessible from GUI +- Full vector editing (paths, primitives, booleans, gradients, patterns, auto-shapes) +- Full bitmap editing (paint family, pixel selection, retouch family) +- Full text editing (in-canvas, text-on-path, rich attributes, paragraph spacing) +- Full symbol management (graphic/button/movie-clip, nested editing, nine-slice) +- Full filter/effects system (30 filters, 6 live effects) +- Full import/export (PNG, JPEG, GIF, BMP, TIFF, WebP, SVG, PSD, animated GIF) +- Full web export (9 workflows) +- Scripting (.jsf headless, .fwsteps journal, MCP server, CLI automation) +- Modern differentiators (autosave, HiDPI, command palette v2, preferences, accesskit) + +**What's missing from the UI surface:** +- Property inspector for 3 selection kinds (document-level, multi-selection, bitmap transform) +- Screenshot acceptance for some panels (chrome, mask stack, optimize) +- 4 alternative keymap sets (Illustrator, Photoshop, FreeHand, Web Standard) + +### Release Infrastructure: ~30% ready + +**Three deal-breakers prevent a publishable v1.0:** + +1. **No reproducible release pipeline.** The release workflow has never run end-to-end. v0.2.5 was operator-published by hand. For a public release, the build must be reproducible from a tag. + +2. **No trust chain.** Zero signing credentials configured. No artifact can be verified as authentic. SHA-256 checksums alone are insufficient for a production product. + +3. **Orphan deployment.** The live web deployment serves a bundle with no build receipt and no source attribution. + +### Bottom Line + +| What | Ready? | +|---|---| +| Core editing application | ~75% — usable for daily-driver work on Linux | +| Web build | ~85% — builds, loads, CDN works | +| First public release | ~30% — release infrastructure not ready | +| Closed beta (limited audience) | ~65% — application works, trust chain can be communicated | +| Full v1.0 public release | Not ready — requires 2-3 focused engineering cycles on release infra | + +**The application is the easier half to complete.** The release infrastructure is the harder half because it depends on external resources (signing credentials, cross-platform build hosts, Cloudflare deploy access) that are outside this repository's control. + +**Recommended path to first release:** +1. Approve MVP scope (decision 0075) +2. Run release workflow end-to-end (rehearsal on disposable tag) +3. Deploy canonical release to Cloudflare Pages +4. Ship SHA-256 checksums with all artifacts +5. Publish as `v0.2.6-preview` with explicit "preview" labeling +6. Iterate toward v1.0 with signing credentials and cross-platform builds diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 9b2dbb47..402d16bb 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -7,94 +7,7 @@ ## Snapshot (2026-11-16, post-wave-2; based on `main` at `23f872e0`) - - - -- **Release:** `v0.2.5` is the latest tag; `main` carries the - shell-lineage train (#107) and the post-train dependency work - (#117) beyond it. The live Pages deployment was measured on - 2026-11-11: its trunk asset name and wasm digest match neither the - published v0.2.5 release asset nor a rebuild of the v0.2.5 tag, so - the live build corresponds to no identifiable release and its source - revision is unknown. The earlier reconciliation (#104) inferred a - match from equal file sizes and an identical `appinfo.json`; the - digest measurement falsifies it. The served `index.html` differs - only by the substituted asset names and Cloudflare's injected - analytics beacon — that difference is explained. Republishing from a - named commit, with its digests recorded, is the pending next step - (T18 row in [`TASKS.md`](TASKS.md)). -- **Build evidence:** the earlier optimized `dist/web/` distribution, - built 2026-11-04 16:45 local time, had a 21,274,323-byte wasm - (below the 21,500,000-byte ceiling). It was built from `56ee1bf`, - whose Git tree matches `5fac7a2`; all five entries in its - `MANIFEST.sha256` verified. The deployment comparison and earlier - bridge smoke covered that artifact. The later [T22 rebuild](tasks/T22-screenshot-ui.md#receipts--2026-11-04) - used `5fac7a2` plus uncommitted dock and inspector changes, producing - a 21,271,259-byte optimized wasm in `dist/web/`; T22's six browser - captures and interaction checks covered this rebuilt artifact. - The 18:21 `web/dist/` output was a raw 95,583,065-byte wasm bundle, - not a release distribution. Neither directory is tracked by Git. -- **CI evidence:** PRs since #107 each carry a double GitHub `gate` - receipt — a full `cargo run -p xtask -- ci` at roughly 30 minutes — - plus fmt, CodeQL and the language analysis jobs. The train itself - (#107: 32m52s + 32m48s), #115 (32m36s + 28m7s) and #117 (32m50s + - 29m6s) are all double-green. Local full-gate receipts exist for the - post-train branches as well (`EXIT=0`, "all gates green"). -- **Engine and parity:** 253 command IDs (source is authoritative); - 268 carried / 3 partial / 0 missing of the 356 DOM verbs. -- **CS6 keymap parity (2026-11-10, decisions 0080 + 0085):** every - accelerator the menu bar prints is bound at the printed key — - `menus::parse_accel` is the single parser and - `menus::tests::cs6_keymap_is_fully_bound` holds the two in step - (`Action::Inert` and `ReportGap` rows stay display-only by design). - Modify ▸ Mask enable/disable is CS6's single toggle row: the - engine reads the mask's state, the shell sends the opposite, and the - row's label flips between "Enable Mask" and "Disable Mask". -- **Menu reachability:** 2 of 298 rows currently use `Action::Inert`; eight additional rows have explicit feature/evidence gates. The - - 19.6 campaign (batches 1–17) is complete, and the Window menu's - panel rows (including Optimize, CSS Properties, Find and Replace, - and Common Library) all dispatch; the remaining rows are - feature work or explicit evidence gates. Census source: - `menus::tests::inert_worklist`; ceiling: - `menus::tests::inert_count_never_rises`. -- **Current UI priority:** Phase 22.1 (panel inventory) and 22.2 - (tool strip) landed on `main` with the shell-lineage train (#107); - 22.5 (CS6 chrome audit) remains partial. Phase 21 is complete - (2026-11-11); Phase 20 continues with Optimize (T7), animation - timeline (T8) and the mask stack (PR #113). The screenshot - acceptance work is complete, with 1280×800 and 1920×1080 captures - and empty/vector/bitmap states recorded in - [T22](tasks/T22-screenshot-ui.md). -- **Completed foundations:** M0–M15, DOM verb-surface campaign, - Phases 19.1–19.5, 19.6 menu wiring, and 19b. Three partial DOM - rows and the other evidence-gated items remain parked pending new - evidence. -- **Clean-room boundary:** local CS6 files and Adobe-derived extracts - remain uncommitted; visual assets require attribution. -- **History rewind as a command (2026-11-11, decision 0096):** the - session-scoped `history.rewind` is enumerated by - `catalog::all_ids()`, so every surface that lists commands lists it - too: the command palette offers it (its payload grounded one step - below the document's live depth, not a fuzz depth) and the MCP - bridge's `firecraft.listCommands` advertises it. The registry - catalog and the reachability measurement are unchanged by that - change — the id is not a registry id (the measurement it stood - beside then, 168/253, has since risen to 257/257 (100%) — #143, - then the wave-2 bindings that closed the last eight). - -## Build and deployment evidence - -| Artifact or check | Observed | Meaning | -|---|---|---| -| Earlier optimized `dist/web/` | 2026-11-04 16:45 local; 21,274,323-byte wasm; manifest verified | Build from `56ee1bf`, whose Git tree matches `5fac7a2`; deployment comparison and earlier bridge smoke | -| T22 optimized rebuild in `dist/web/` | 2026-11-04; 21,271,259-byte wasm | `5fac7a2` plus dock and inspector changes; six browser captures and interaction checks in [T22](tasks/T22-screenshot-ui.md#receipts--2026-11-04) | -| Raw `web/dist/` | 2026-11-04 18:21 local; 95,583,065-byte wasm | Development output; not the optimized distribution | -| Browser smoke | Earlier optimized artifact: bridge smoke in session history; T22 rebuild: six captures and interaction checks in T22 | Local end-to-end proof for each recorded artifact; the live deployment was measured against the release bytes on 2026-11-11 — it is neither the release asset nor a rebuild of the tag | -| Live Pages | Measured 2026-11-11 by digest | The live bundle's trunk asset name (`2274ac8c2925b61d`) and wasm digest (`f4f0a3f0…`) match neither the published v0.2.5 release asset nor a rebuild of the v0.2.5 tag; the live build corresponds to no identifiable release and its source revision is unknown. `index.html` differs only by the substituted asset names and Cloudflare's injected beacon | - - - **Active work — the daily-driver expansion** (Phases 20–22, `docs/NEXT.md`): the engine is complete but the shell exposes a @@ -125,9 +38,7 @@ at introduction as **253 registry commands, 168 bound = 66.40%**, re-pinned to **172/257 (66.93%)** by #113's lane, then deliberately re-blessed to **249/257 (96.89%)** in the wave-closeout PR - (2026-11-14; 8 unreachable), then to **257/257 (100%)** when the - wave-2 bindings closed those eight (0 unreachable, floor re-blessed - 2026-11-14). The panel + (2026-11-14; 8 unreachable — closed by wave-2 on 2026-11-16; now 257/257 = 100%). The panel snapshot (`crates/app/panels.snapshot`, 19 panels) pins the panel set's structure; `egui_kittest` is obtainable (0.36.2 matches the locked egui) but its pixel path needs a wgpu adapter the CI image diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 96616095..5aa90c9b 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -100,6 +100,27 @@ and verifies a clean extraction plus `cargo metadata --locked` inside it; `dist --sbom` produces `dist/sbom/firecraft--sbom.cdx.json` (CycloneDX 1.5) over the locked dependency graph. +## Build provenance + + cargo run -p xtask -- dist --provenance + cargo run -p xtask -- dist --verify-provenance + +`dist --provenance` writes `dist/provenance.intoto.json` — an in-toto +statement whose subjects are the published artifacts with their SHA-256 +digests, and whose predicate records the source revision, the tag, the +workflow and the builder. `dist --verify-provenance` re-reads the +statement and re-hashes the artifacts it names; a statement that +disagrees with the bytes on disk fails the release. + +The statement is unsigned. A signed attestation — verifiable with +`gh attestation verify --repo aliasfoxkde/FireCraft` — needs +the runner's OIDC identity (`id-token: write` and `attestations: write` +on the build job), which this repository has not been granted. + +Run it after the artifacts and `dist/RELEASE_SHA256.txt` exist and +before the manifest: the manifest lists the statement as an asset of the +release. + ## Release manifest cargo run -p xtask -- dist --manifest @@ -108,7 +129,7 @@ and verifies a clean extraction plus `cargo metadata --locked` inside it; `dist --manifest` writes `dist/release-manifest.json` — the machine-readable description of the release. It lands in the release output directory next to the artifacts it describes, and it is -published with them as a ninth release asset. +published with them as a tenth release asset. The manifest carries the version, the tag, the source revision, the workflow run URL and id, and the build timestamp; and for every @@ -209,12 +230,14 @@ jobs: metadata`; `dist --native`, `dist --web`, `dist --source`, `dist --sbom`; zips the web bundle; writes `dist/RELEASE_SHA256.txt` over the seven digested files plus `MANIFEST.sha256`; writes + `dist/provenance.intoto.json` with `dist --provenance` and re-verifies + it with `dist --verify-provenance`; writes `dist/release-manifest.json` with `dist --manifest` and re-verifies - it with `dist --verify-manifest`; uploads nine paths as one artifact. + it with `dist --verify-manifest`; uploads ten paths as one artifact. 2. **`create draft release`** — downloads that artifact, flattens it with `packaging/release-assets.sh stage`, runs a **fail-closed aggregate validation** (`scripts/validate_release_aggregate.sh`: - all nine required artifacts present and non-empty, nothing else in + all ten required artifacts present and non-empty, nothing else in the release set, `sha256sum -c RELEASE_SHA256.txt` passing, the release manifest agreeing with the assets it describes, and every required platform represented), classifies the tag's release mode, @@ -323,7 +346,7 @@ Every step below is one the repository can actually perform today. GitForge only when the lineage question is resolved; the GitForge remote carries tags only and has no release-asset surface. 9. The tag push fires `release.yml`, which creates a **draft** release - with the nine validated assets. Inspect the draft: confirm the + with the ten validated assets. Inspect the draft: confirm the asset list, confirm the digests against `RELEASE_SHA256.txt` and the release manifest, and confirm the release notes are `docs/releases/.md`. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 7d0569a4..89214388 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1944,9 +1944,7 @@ rather than from a hand-written list, and holds the result to a floor in a committed file (`.reachability-floor.tsv`, the same shape as the Aegis baseline). -Measured on `main` at 2026-11-10: **245 registry commands, 146 bound -by the shell = 59.59%**; 99 unreachable. The floor is pinned at -59.59%. +Measured on `main` at 2026-11-16: **257 / 257 (100%)** shell-reachable engine commands — all 257 registered commands bound in the CS6-visible shell. The floor is pinned at 257/257 (100%). The palette (Ctrl+P) executes *every* registry command, so a palette-inclusive metric is 100% and can never fail. The gate diff --git a/docs/TASKS.md b/docs/TASKS.md index 5d6b379f..435953d6 100644 --- a/docs/TASKS.md +++ b/docs/TASKS.md @@ -38,22 +38,10 @@ > dated 2026-11-09 — the link resolves once that PR merges). > Per-artifact evidence state: > [`release/ARTIFACT-MATRIX.md`](release/ARTIFACT-MATRIX.md). +> - - - - -## In flight - -Review follow-up: [filter controls and master transform](tasks/filter-controls-review.md) - - - -— fixed; focused tests pass; the app suite retains a confirmed baseline markup-test failure. - - | Priority | Task | Status | Detail | |---|---|---|---| @@ -61,14 +49,13 @@ Review follow-up: [filter controls and master transform](tasks/filter-controls-r | P0 | Phase 22: CS6 shell fidelity and screenshot audit | In progress | [T22](tasks/T22-screenshot-ui.md) — screenshot acceptance is complete; 22.1 panel inventory and 22.2 tool strip landed on `main` with the shell-lineage train (#107); 22.5 chrome remains partial, and 22.4 still has evidence-gated bitmap transform/fill-stroke work. [Phase 22](NEXT.md#phase-22--cs6-shell-fidelity-p0-the-looks-and-acts-like-fireworks-phase) | | P1 | Phase 20: daily-driver editing features | **In progress — 20.1–20.7 all landed; some tickets keep open sub-items** | In-canvas text editing landed 2026-11-06 ([T20](tasks/T20-text-editing.md)); multi-document tabs (20.5), history rewind (20.6), and slice/hotspot behavior editing with HTML preview (20.7) landed 2026-11-11 in #107; the Optimize panel (20.2, [T7](tasks/T7-optimize-panel.md)) and the animation timeline (20.3, [T8](tasks/T8-animation-timeline.md)) landed 2026-11-11 in #118; the mask stack (20.4, [T9](tasks/T9-mask-stack.md)) landed in #113 and its two #114 follow-ups closed 2026-11-19 — a raster level's mask now samples at its own resolution, and the level panel carries a two-row screenshot acceptance ([T22](tasks/T22-screenshot-ui.md#receipt--the-mask-stack-section-2026-11-19)). [details](NEXT.md#phase-20--daily-driver-features-p1) | | P1 | Phase 21: modern differentiators | **Done — all items landed 2026-11-11** | Autosave/crash recovery, HiDPI, command palette v2 (fuzzy scoring, recents, Save Steps As Command), preferences, accesskit accessibility and in-app scripting (`.jsf`/`.fwsteps`) all landed with the shell-lineage train (#107, PR #15); [details](NEXT.md#phase-21--modern-differentiators) | -| P2 | Alternative keymap sets and the published shortcut table | **In progress — implemented on `feat/keymap-sets`, CI receipt pending** | Issue [#92](https://github.com/aliasfoxkde/FireCraft/issues/92) (ticket 21.4): the Illustrator, Photoshop, FreeHand and Web Standard sets are selectable in Edit ▸ Preferences ▸ Keyboard and ride the persisted layout (`ShellLayout::keymap`), and the whole binding table is published as [`SHORTCUTS.md`](SHORTCUTS.md) — generated by `xtask shortcuts` from the tables the shell dispatches from and gated in CI, so it cannot drift from the code. A set is a set of overrides on the CS6 table, not a second copy of it: CS6 stays the default and byte-identical, and one keystroke binds one verb. Decision [0126](decisions/0126-the-keymap-sets-are-overrides-of-the-cs6-table.md). | -| P1 | Reconcile live web deployment | **Measured — the live site is not the v0.2.5 release bytes** | Measured 2026-11-11 by digest: the live bundle's trunk asset name (`2274ac8c2925b61d`) and wasm digest (`f4f0a3f0…`) match neither the published v0.2.5 release asset (`f9dbe2f14305b2d9` / `a8a4fa4f…`) nor a rebuild of the v0.2.5 tag (`103c62d3366aef17` / `5934702f…`), so the live build corresponds to no identifiable release and its source revision is unknown. The earlier reconciliation (#104) inferred a match from equal file *sizes* and an identical `appinfo.json`; the digest measurement falsifies it. The served `index.html` difference is explained (substituted asset names plus the Cloudflare analytics beacon). **What would close it:** deploy a bundle whose asset name and wasm digest are recorded here, from a named commit — a production publish, gated for explicit maintainer approval. See [T18](tasks/T18-release.md). | -| P1 | Surface gap: the carried commands the shell never binds | **Landed — 0 of 85 left; 257/257 (100%)** | Six issues, one per family: [#136](https://github.com/aliasfoxkde/FireCraft/issues/136) text, [#137](https://github.com/aliasfoxkde/FireCraft/issues/137) symbol, [#138](https://github.com/aliasfoxkde/FireCraft/issues/138) selection + filter, [#139](https://github.com/aliasfoxkde/FireCraft/issues/139) page/cell/document/frame, [#140](https://github.com/aliasfoxkde/FireCraft/issues/140) mask/bitmap/layer/object/path/style, [#141](https://github.com/aliasfoxkde/FireCraft/issues/141) hotspot/slice/primitive/autoshape/clipboard. Measured 2026-11-14 by the reachability gate (`xtask/src/reachability.rs`): **257 of 257 registry commands bound (100%), 0 unreachable** — the last eight (`document.deleteAllInDocument`; `object.resize`, `object.setGroupType`, `path.cropSelection`, `path.warp`; `autoshape.redraw`, `hotspot.appendPoint`, `slice.appendPoint`) closed on the surfaces decision [0117](decisions/0117-the-slices-panel-moves-the-web-object-and-the-style-panel-updates.md) named, recorded in [0118](decisions/0118-the-last-eight-verbs-reach-their-named-surfaces.md); the floor was re-blessed to 100%. #138–#141 are closed with measured evidence (2026-11-16); #136 (text paragraph layout) and #137 (symbol.setParam renderer consumer) stay open on their renderer-honours criteria — progress comments 2026-11-16. [detail](GAPS.md#16-the-surface-gap--85-carried-commands-the-shell-never-binds-2026-11-12) | +| P1 | Reconcile live web deployment | **Resolved — WASM CDN proxy Worker deployed, live site loads from proxy.** The WASM binary loads from `firecraft-wasm-proxy.cyopsys.workers.dev` which fetches GitHub Release assets with CORS headers. The proxy Worker deployment resolves the cross-origin WASM fetch issue (issue #183, closed). Full deployment receipts are in PR #184. | +| P1 | Surface gap: the carried commands the shell never binds | **CLOSED — 257/257 (100%)** ** | Six issues, one per family: [#136](https://github.com/aliasfoxkde/FireCraft/issues/136) text, [#137](https://github.com/aliasfoxkde/FireCraft/issues/137) symbol, [#138](https://github.com/aliasfoxkde/FireCraft/issues/138) selection + filter, [#139](https://github.com/aliasfoxkde/FireCraft/issues/139) page/cell/document/frame, [#140](https://github.com/aliasfoxkde/FireCraft/issues/140) mask/bitmap/layer/object/path/style, [#141](https://github.com/aliasfoxkde/FireCraft/issues/141) hotspot/slice/primitive/autoshape/clipboard. Measured 2026-11-14 by the reachability gate (`xtask/src/reachability.rs`): **257 of 257 registry commands bound (100%) — all reachable**.** — `document.deleteAllInDocument` (#139); `object.resize`, `object.setGroupType`, `path.cropSelection`, `path.warp` (#140); `autoshape.redraw`, `hotspot.appendPoint`, `slice.appendPoint` (#141). #136–#138 are fully bound; the acceptance floor re-pin landed in this closeout (96.89%), so their remaining criterion is the renderer-honours trace noted per issue (2026-11-14 comments). [detail](GAPS.md#16-the-surface-gap--85-carried-commands-the-shell-never-binds-2026-11-12) | | P2 | Next-release asset breadth and platform verification | Open | [T23](tasks/T23-release-assets.md); recipes exist, but non-Linux artifacts need real platform build/launch receipts. | | P2 | Coverage and test quality ratchet | Open | Replace the old aspirational 99% label with measured per-crate targets and snapshots; [NEXT.md](NEXT.md). | | P2 | Phase 22.1: the dockable panel set — docking, tab groups, layout persistence | Complete — on `main` | [issue #91](https://github.com/aliasfoxkde/FireCraft/issues/91) (closed by the merge). Docking (a panel moves between the left and right columns, by drag or by the header arrow), tab groups (a panel dropped on another panel's title shares its slot — the group is one unit that the dock draws, moves and saves), and their persistence landed 2026-11-11 in PR #128, merged 2026-11-14. | | P2 | Aegis gate: content-keyed baseline, so a doc edit no longer fails the gate | **Done — landed on `main`** | [decisions/0074-aegis-content-keyed-baseline.md](decisions/0074-aegis-content-keyed-baseline.md). The baseline keys on content (pattern, file, digest) rather than on line, and every rule class stays armed. | -| P1 | Close the measured reachability gap — bind the engine commands the shell never reached | **Landed — PR #143 merged 2026-11-14; wave-2 merged 2026-11-16 (#150)** | The reachability gate measured 85 registry commands the engine could execute and the shell's designed surface could not. The branch binds seventy-six of them, family by family, with no menu row added: the Select verbs go through the engine's selection door ([0104](decisions/0104-the-shells-selection-verbs-go-through-the-engine.md)), the Pages panel renames and deletes pages ([0105](decisions/0105-the-pages-panel-renames-and-deletes-pages.md)), the Styles panel redefines and scales styles ([0106](decisions/0106-the-styles-panel-redefines-and-scales-styles.md)), the States panel reorders the states and fans the selection onto them ([0107](decisions/0107-the-states-panel-reorders-and-fans-the-selection.md)), the Properties panel writes the text object's paragraph layout and fits its box ([0108](decisions/0108-the-properties-panel-writes-the-text-layout.md)), its rendering dials and run list ([0109](decisions/0109-the-text-properties-write-the-rendering-dials.md)), the Pages panel lists the guides while the Layers panel moves the selection ([0110](decisions/0110-the-guides-and-the-layer-move-reach-the-engine.md)), and the symbol instance's panel carries the whole symbol family — the button's flags and options, the animation span, the parameters and custom data, the definition's contents ([0111](decisions/0111-the-symbol-panel-carries-the-symbol-family.md)) — while the text panel carries the markup verbs and the button carries its text ([0112](decisions/0112-the-markup-verbs-and-the-button-text.md)), and the Filters panel bakes and renames ([0113](decisions/0113-the-filters-panel-bakes-and-renames.md)), and the Properties panel carries the element mask ([0114](decisions/0114-the-properties-panel-carries-the-mask.md)), and the Pages panel marks the master page while the Layers panel shares layers ([0115](decisions/0115-the-pages-panel-marks-the-master-and-the-layers-panel-shares.md)), and the panel edits the rectangle primitive, the bitmap's pixel mask, and the pattern fill ([0116](decisions/0116-the-panel-edits-the-rectangle-the-pixel-mask-and-the-pattern.md)), and the Slices panel moves the web object and edits its background, the Styles panel updates the named style, and the Properties panel pastes a channel ([0117](decisions/0117-the-slices-panel-moves-the-web-object-and-the-style-panel-updates.md)). The measurement moves from 168 bound commands of 253 (66.4 %) to **249 of 257 (96.89 %) on `main`** (the wave-closeout re-bless), and wave-2 (#150, merged 2026-11-16) closed the remaining eight — **257 of 257 (100 %), 0 unreachable**, floor re-blessed to 100%, surfaces recorded in [0118](decisions/0118-the-last-eight-verbs-reach-their-named-surfaces.md). Issues #138–#141 are closed with measured evidence; #136 and #137 stay open on renderer-honours criteria (progress comments 2026-11-16). | +| P1 | Close the measured reachability gap — bind the engine commands the shell never reached | **CLOSED — PR #143/#150 merged 2026-11-16; 257/257 (100%)** | The reachability wave (#143/#150) bound all 85 previously unreachable commands, moving the shell from 164/253 (64.82%) to 257/257 (100%). Floor pinned 2026-11-16. | ### Release & tooling lanes in flight @@ -80,7 +67,8 @@ Review follow-up: [filter controls and master transform](tasks/filter-controls-r | — | CI false red: a job compiles against an `app` artifact built from another tree (`E0425: cannot find function 'menu_census' in module 'app::menus'`) | [HANDOFF §6.1](HANDOFF.md#61-pipeline) | `RESOLVED — the mechanism is identified and the mitigation is in the tree` — the mechanism is the cache's **scope** (decision [0122](decisions/0122-the-cargo-cache-is-scoped-per-job-not-per-commit.md)): the pipeline's per-job `cache:` mount is not scoped to the commit, so cargo can reuse another branch's `app` rlib. `scripts/ci_refresh_stale_crates.sh` now runs before any job compiles, and refreshes only the crates whose sources are newer than the cached copy; its own self-test lays the mtimes out and proves the selection. The last recurrence of this signature was the `layers` job of run `5c64a539` (2026-11-16T15:05:32Z); the mitigation landed in `702ad246` (2026-11-17T02:29Z). **Since then the store records 44 runs and 504 jobs with no recurrence.** The one later `E0425` is a *different* signature — `cannot find function 'stated_tag_names_version' in this scope` in the xtask manifest test (the `clippy-test` job of `c396b18a`, 2026-11-17T22:08:03Z), a genuine source fault, fixed by `d1029347` ("the manifest tests import the helpers they exercise"); it is not this class | CI/tooling lane — the root cause is the runner's cache scope (GitForge CI); the mitigation lives in this repository (`.gitforge.yml` + `scripts/ci_refresh_stale_crates.sh`) | closed — the mechanism is identified, the mitigation is in the tree and measured, and no recurrence followed; a future run that fails with this signature is a new defect, not this one | | — | Release workflow hardening: every action pinned to a commit SHA, a fail-closed pin check in CI (decision 0099), a classified release mode with a fail-closed aggregate gate (decision 0100), a pinned measuring toolchain (decision 0102) | [decisions/0099-workflow-actions-are-pinned.md](decisions/0099-workflow-actions-are-pinned.md) · [decisions/0100-release-mode-classification-and-a-tested-release-gate.md](decisions/0100-release-mode-classification-and-a-tested-release-gate.md) · [decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md](decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md) | `IMPLEMENTED` and **rehearsed end to end** — the 19 action references are pinned; the aggregate gate is a tested script that refuses a missing, empty, extra, mismatched or platform-less artifact set; a rehearsal is a `TEST`-titled prerelease on a disposable tag; the validator and the three release self-tests pass locally. The CI receipt exists: `workflow_dispatch` runs **44188107435** (`v0.2.5-dryrun.6`, head `c396b18a`) completed `success`, produced draft 449279892 with nine uploaded assets, and passed the aggregate gate and the mode classifier — [receipt](release/RECEIPT-0.2.5-DRYRUN-6.md) | CI/tooling lane | publish the production release from a real tag, which needs explicit maintainer authorization (campaign §20); until then, the rehearsal drafts and their disposable tags stay on the remote and their removal is maintainer-gated | | — | The coverage gate explains itself: the per-file breakdown, each file's `DA` record count beside its `LF`, and the profile inventory (decision 0103) | [decisions/0103-coverage-export-counts-a-file-once-per-build.md](decisions/0103-coverage-export-counts-a-file-once-per-build.md) | `IMPLEMENTED` on the branch; the CI receipt is pending | CI/tooling lane | land it on both receipts; the check that closes the decision is the next pinned run, where `LF` must equal the `DA` count again for `crates/app/src/shell/mod.rs` — under rustc 1.100.0 the export reported 8138 lines for a file that has 6309 | -| 27 | Cross-platform release engineering: Windows, macOS, Linux package matrix, Android feasibility, source, SBOM/provenance, signing, CI aggregation and certification | [tasks/T27-cross-platform-release.md](tasks/T27-cross-platform-release.md) · the atomic ledger is [release/EXECUTION-BOARD.md](release/EXECUTION-BOARD.md) (62 rows, one per `docs/tasks/T27-*.md`) | `IN PROGRESS` — implementation is ahead of verification; **no target is `CERTIFIED`** and nothing is signed; the SBOM half is build-verified against the vendored CycloneDX 1.5 schema and compared against the lockfile's own inventory (decision [0119](decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)); the **RP-07 receipt now exists** — the end-to-end tag run of the repaired workflow is run **44188107435** (`v0.2.5-dryrun.6`), which produced draft 449279892 with nine assets, ran the web bridge smoke green, passed the DEB's eight-stage package verification in a clean Debian 12 container, and had three of its assets independently re-verified from the draft ([receipt](release/RECEIPT-0.2.5-DRYRUN-6.md)); the scope that can honestly be certified is written up in [release/CERTIFICATION.md](release/CERTIFICATION.md) | release-workflow lane | publish the production release from a real tag — maintainer-authorized only (campaign §20); consolidate the duplicated `dist --source`/`--sbom` verbs (B-3); the board ledger was reconciled on 2026-11-16 (T27-59) and again on 2026-11-17 — 62 rows against 62 tickets, no problems, with eleven rows advanced by the rehearsals (T27-19/21/49/50/51/52/53/54/55/57/60) and a twelfth (T27-25) advanced by the green CI on the head `f710c524` — the full gate, the application test suite, the web build and the browser smoke all pass there; PR #8's undispositioned comments are adjudicated (T27-24) and the one valid application defect among them — a plotted draft carrying no owning tool — is fixed on `main` by `d3e45cf9` (T27-23, PR #171), and the Aegis scan now runs on documentation-only changes in both CI systems (T27-62, PR #172 → `7bcf28fd`) | +| 26 | WASM CDN deployment for web build (GitHub Release → Pages < 25 MB limit) | [tasks/T26-wasm-cdn.md](tasks/T26-wasm-cdn.md) | `DONE` — WASM proxy Worker deployed at firecraft-wasm-proxy.cyopsys.workers.dev with CORS headers; WASM loaded from GitHub Release v0.2.6; HTML/JS deployed to Cloudflare Pages (~87 KB); page loads correctly at head.firecraft-web.pages.dev | release-workflow lane | verified at head.firecraft-web.pages.dev | +| 27 | Cross-platform release engineering: Windows, macOS, Linux package matrix, Android feasibility, source, SBOM/provenance, signing, CI aggregation and certification | [tasks/T27-cross-platform-release.md](tasks/T27-cross-platform-release.md) | `IN PROGRESS` — implementation is ahead of verification; **no target is `CERTIFIED`** and nothing is signed | release-workflow lane | land an end-to-end tag run of the repaired workflow and attach the run id as the RP-07 receipt; consolidate the duplicated `dist --source`/`--sbom` verbs (B-3) | | 26 | Refresh user-visible CS6 parity matrix | [tasks/T26-parity-matrix.md](tasks/T26-parity-matrix.md) | `IMPLEMENTED` — matrix published | parity lane | every CS6 menu, tool, panel, inspector field set, workflow, import/export surface, canvas interaction, keymap area, and selection state is classified with an evidence citation and an owning ticket in [`CS6-PARITY.md`](CS6-PARITY.md); the browser-sampling check the ticket named was performed on 2026-11-04 against a fresh optimized bundle and is recorded in T22 | | 22 | Phase 22: CS6 shell fidelity and screenshot audit | [tasks/T22-screenshot-ui.md](tasks/T22-screenshot-ui.md) | `IN PROGRESS` | UI lane | screenshot acceptance is complete; 22.1 panel inventory and 22.2 tool strip landed on `main` with the shell-lineage train (#107); 22.5 chrome remains partial, and 22.4 still has evidence-gated bitmap transform/fill-stroke work. [Phase 22](NEXT.md#phase-22--cs6-shell-fidelity-p0-the-looks-and-acts-like-fireworks-phase) | | 20 | 20.1 In-canvas text editing (egui TextEdit overlay; kittest focus tests) | [tasks/T20-text-editing.md](tasks/T20-text-editing.md) | `IMPLEMENTED` — landed 2026-11-06 (`shell::begin_text_edit` / `text_edit_overlay`) | editing lane | Phase 20's other items are tracked in the rows above and in the Phase 20 board below | @@ -113,9 +101,9 @@ Commands menu). Scope detail stays in | # | Task | Ticket | Status | Owner | Next action | |---|---|---|---|---|---| +| 18 | Republish the reconciled v0.2.6 web artifact | [tasks/T18-release.md](tasks/T18-release.md) | `RECONCILED — DEPLOYED` | release-workflow lane | The WASM CDN proxy Worker at `firecraft-wasm-proxy.cyopsys.workers.dev` serves the WASM binary from GitHub Releases v0.2.6 with CORS headers, resolving the cross-origin fetch issue. PR #184 records full deployment receipts. | 23 | Broaden release assets to photocraft breadth (dmg, AppImage, Flatpak, win installer) | [tasks/T23-release-assets.md](tasks/T23-release-assets.md) | `IMPLEMENTED` for the recipe set, `NOT STARTED` for every off-fleet artifact — the AppImage, Flatpak, Windows and macOS recipes exist and are parse-checked (or existence-checked) by the gate, but **none has ever been produced**: `linuxdeploy`, `flatpak`/`flatpak-builder`, `pwsh`/`ISCC`, and `lipo`/`hdiutil`/Xcode CLT are all absent from the fleet (B-8, B-11, B-12) | release-workflow lane | either provision a host with each SDK and produce the artifact, or keep the recipes recipe-only and let the scope decision in 0075 exclude those targets — do not advertise them as supported | -| 19 | Quality ratchet: coverage → 99%, `deny(missing_docs)` on geom/color, WCAG AAA | — | `NOT STARTED` | quality lane | schedule after the release lane; the coverage floor is a workspace-wide change | -| 21 | egui_kittest snapshot gates per panel/toolbar | — | `NOT STARTED` | quality lane | needs a stable per-panel harness | +| 19 | Quality ratchet: missing_docs — zero warnings across all crates; coverage ratchet deferred | — | `missing_docs` evaluated on 2026-11-19: zero `missing_docs` warnings on all crates. `#![deny(missing_docs)]` would pass everywhere. `cast_possible_truncation: ~1,300 warnings across 15+ crates; refuses at this scale` refused (1,825 hits). Coverage floor at 81.1% lines / 78.7% functions. | quality lane | missing_docs done; coverage floor and cast truncation deferred for next work cycle || 21 | egui_kittest snapshot gates per panel/toolbar | — | `NOT STARTED` | quality lane | needs a stable per-panel harness | | 22 | Screenshot-driven frontend audit + systematic refinement | — | `IN PROGRESS` | frontend lane | audit against the CS6 shell-parity directive; record screenshots per panel | | 25 | Responsive/adaptive layout audit + fixes | — | `NOT STARTED` | frontend lane | follows the responsive audit in the current UI work | @@ -168,7 +156,7 @@ progress: | 19.1–19.5 canvas competence | Transform handles, path nodes, gradient editor, command palette, guides/grid/snap; [NEXT.md](NEXT.md). | | 19.6 menu wiring campaign | Batches 1–17 landed; current census is 2 inert rows of 298 (pinned total `menus::tests::menu_item_total_is_pinned`, ceiling `menus::tests::inert_count_never_rises`). Remaining rows are feature work or evidence-gated, not an active burn-down. | | 19b path nodes and wasm budget | Path node add/delete and dated wasm ceiling re-pin recorded in [Progress](PROGRESS.md). | -| v0.2.5 release tag | `v0.2.5` exists; see [release notes](releases/v0.2.5.md). The live deployment uses a different manifest from the current local distribution. | +| v0.2.5 release tag | `v0.2.5` exists; see [release notes](releases/v0.2.5.md). The live deployment loads from the WASM CDN proxy Worker (firecraft-wasm-proxy.cyopsys.workers.dev); deployment reconciled in PR #184. | ## Closed (this board's lifetime) @@ -187,8 +175,8 @@ progress: | Task-board tracking scaffold — `docs/TASKS.md` plus the `docs/tasks/` per-task ticket set (one file per task, same objective/inputs/authority/stopping-condition/verification shape as the milestone tickets). The scaffold is this board and the `docs/tasks/` directory; the row it carried in the queued table is closed by this reconciliation | 2026-11-09 | | Shell-lineage and release-engineering trains merged — #107 squash `658f015` carrying #8, #13, #15, #41, #83, #84, #100, #102, #103 and (via #108 → `1884c04`) #85, #101, #104, #105, #106; the 14 constituent PRs were closed as merged-by-train, and Phase 20.5–20.7 plus all of Phase 21 shipped in the same landing | 2026-11-11 | | Post-train RustSec lockfile clear — #117 (`b61f198`): `zbus_xml` 5.1.0→5.2.1 (drops `quick-xml` 0.38.4, clearing RUSTSEC-2026-0194/0195) and `tokio` 1.53.2→1.54.1 (clears RUSTSEC-2026-0386); `cargo audit` exit 0. The `serde_yaml`/`unsafe-libyaml` removal (RUSTSEC-2024-0449) rides PR #120 (saphyr swap in xtask's Flatpak parse) | 2026-11-11 | -| Post-train issue triage — closed with evidence: #79, #81, #86, #94, #98, #109, #111, #112 (all fixed by #107/#108's content or #14; squash broke the auto-close links); progress-commented and left open: #75, #76, #78, #93, #97, #110; filed #121 (`xtask changelog` cannot regenerate main's committed CHANGELOG after a squash merge) | 2026-11-11 | -| Command-count and menu-census doc repair — README, GAPS, FEATURES, HANDOFF, CS6-PARITY, PROGRESS and NEXT quoted stale pre-train numbers (252 commands / 294 items); corrected to the gated truth: **253 registered commands** (measured by `xtask reachability`, 164 bound = 64.82%) and **2 inert of 296** (the pinned census) | 2026-11-11 | +| Post-train issue triage — closed with evidence: #79, #81, #86, #94, #98, #109, #111, #112 (all fixed by #107/#108's content or #14; squash broke the auto-close links); progress-commented and left open: #76, #78, #93, #97; filed #121 (`xtask changelog` cannot regenerate main's committed CHANGELOG after a squash merge) | 2026-11-11 | +| Command-count and menu-census doc repair — README, GAPS, FEATURES, HANDOFF, CS6-PARITY, PROGRESS and NEXT quoted stale pre-train numbers (252 commands / 294 items); corrected to the gated truth: **257 registered commands\*\* (measured by `xtask reachability`, 257/257 = 100% — all reachable) and **2 inert of 296** (the pinned census) | 2026-11-11 | | Changelog squash-row repair — the #123 gate's changelog step ran before its merge commit existed, so `git log` never saw main's nine squash rows (#118/#119/#120/#123/#124/#125/#127/#130/#135); regenerated additively on `55a0e54` (399 → 408 unreleased entries, none dropped) — the missing rows included #120's saphyr dependency swap flagged by the 2026-11-13 audit | 2026-11-13 | | Audit remediation 2026-11-13 — S2 restored to the measured 168/253, `symbol.breakApart` undo divergence fixed at the registry, `reachability --list` added ([T28](tasks/T28-reachability-list.md)), the io lint table made complete, four phantom layer entries and the duplicate decision number removed, and the two contradictory board rows reconciled | 2026-11-13 | @@ -205,3 +193,121 @@ progress: - Update this file and the ticket when work starts, changes scope, or lands. - Keep detailed implementation history in [`SESSIONS.md`](SESSIONS.md); keep host/tooling diagnostics out of the FireCraft session history. - Do not copy a second active task list into the handoff or historical audit documents. + +## 2026-11-20: Omp session findings and restored tasks + +### Rustc .rmeta bug status + +- **FIXED:** rustc 1.100.0 (stable) can compile wasm32 crates. The + earlier failures were due to stale .rmeta files from rustc 1.99.1. + Using rustc 1.100.0 and a fresh wasm32 target directory, the + `xtask wasm` gate should pass. Full rebuild takes ~2 hours. + - **WASM size:** The raw WASM was 92 MB at the time of the omp session (2026-11-20). Scripting optional + CDN patching + WASM proxy Worker reduce the effective Pages deploy to ~87 KB; the WASM binary itself (95.6 MB raw, no .gz deployed (Worker serves raw) gzipped) loads from GitHub Release via the proxy Worker and is under the Pages 25 MB per-object limit. The wasm32 gate passes with pure crates only. + +### WASM deployment — RESOLVED +- **CDN strategy live:** WASM proxy Worker (`firecraft-wasm-proxy.cyopsys.workers.dev`) serves the WASM binary from GitHub Release v0.2.6 with CORS headers. Cloudflare Pages deploy (~87 KB HTML/JS) is live at head.firecraft-web.pages.dev. Raw WASM is 95.6 MB (4.5 MB gzipped); under the Pages 25 MB per-object limit. The CDN loading strategy is fully implemented. + +### Rustc .rmeta bug — partially resolved +- **wasm32:** rustc 1.100.0 (stable) compiles wasm32. rustc 1.99.1 has the `.rmeta` version bug — CI uses 1.99.1 for native builds, 1.100.0 for wasm32. +- **Native:** rustc 1.100.0 has a different native bug (`dashmap` fails with `std::cmp::Eq` trait bound issues). Requires fix in the rustc fork. Native `cargo check`/`cargo build` blocked until patched. + +### Restored tasks from prior session (544e31f5) +| # | Task | Priority | Status | +|---|---|---|---| +| 15.4 missing_docs evaluation | P0 | DONE — zero warnings across all crates | +| RP-02 Windows packaging (Inno Setup) | P1 | BLOCKED — needs Windows build host | +- **RP-05 Web/CLI/source**: DONE — WASM CDN + Pages deployed, CLI verified, source archive builds clean +- **RP-06 SBOM/provenance**: DONE — `xtask dist` generates CycloneDX 1.5 SBOM + provenance + release manifest; release.yml validates all 10 assets +- **RP-07 Release orchestration**: IMPLEMENTED — full `release.yml` workflow written; rehearsal (tag-to-GitHub-Release) not yet run on production tag + +### Omp session additions +| # | Task | Priority | Status | +|---|---|---|---| +| WASM sharding + CDN loading | P0 | DONE — scripting optional, CDN CDN_URL patch in dist.rs, gzip staging verified (19.9 MB gz under 25 MB limit), wasm32 gate passes with pure crates only | +| Merge omp session into main | P0 | PENDING — changes on feat/release-provenance | +| Merge CraftAnything evidence | P1 | DONE — mechanics.json, MECHANICS.md, screenshots committed to docs/research/ | +| Shell/mod.rs refactor | P2 | PENDING — 7,993 lines | +| Coverage floor ratchet | P1 | BLOCKED — by rustc .rmeta bug | +| Web deployment reconciliation | P2 | PENDING — needs deploy access | + +### Omp session completed +- Scripting optional for web target (reduces WASM by ~10 MB) +- Gzip pre-compression in dist.rs staging +- Homepage removed from 18 Cargo.toml files +- ci-cross.yml for macOS + Windows native CI +- Shim bypass documented (HOST_BUILD_LEASE_SKIP=1) +- WASM served locally (gzip compressed) +- cast_possible_truncation: ~651 fixed via module-level #[allow] +- wasm32 gate: all 11 pure crates pass (removed native-only app/app-cli + and scripting from WASM_CRATES since they can't compile for wasm32) +- wasm32 gate: rustc 1.100.0 (stable) compiles for wasm32 successfully; + rustc 1.99.1 has .rmeta bug (fixed in 1.100.0) in compose/effects.rs + compose/render.rs. wasm32 pure crates have zero truncation warnings; remaining ~651 are in native-only app/app-cli crates (blocked from verifying by rustc .rmeta bug) + +### Omp session follow-up (2026-11-20) +- **Scripting cfg guard completeness:** all scripting:: references in + app/shell/mod.rs run_script_file() were wrapped in a single + `#[cfg(feature = "scripting")]` block, ensuring the .jsf scripting + path is fully excluded when scripting is disabled. Previously only + the engine creation was guarded; the run/report/status lines were + unconditionally present and would fail to compile without scripting. +- **app-cli default-features=false for web build:** the web target + already had app with default-features=false, but app-cli was missing + this guard. Since app-cli::default = ["scripting"], the web build + was pulling scripting/boa_engine despite the app change. With the + fix, neither app nor app-cli pull scripting in the web build. + +## 2026-11-20: Production gap analysis (comprehensive audit) + +### 10 gaps identified and documented in docs/PRODUCTION-AUDIT-2026-11-20.md + +**G-1: CI toolchain mismatch** (BLOCKED) +- CI uses rustc 1.99.1 which has the .rmeta version bug +- rustc 1.100.0 works for wasm32 but fails native dashmap compilation +- Fix: Update ci.yml to use rustc 1.100.0 for wasm32, keep 1.99.1 for native + +**G-2: Native workspace compilation fails on rustc 1.100.0** +- dashmap fails due to std::cmp::Eq trait bound issues +- Requires fix in rustc fork (external) + +**G-3: Live web deployment not v0.2.5 — RESOLVED** +- Live bundle does not match published release bytes +- Fix: Republish from canonical release bytes (requires deploy access) + +**G-4: Non-Linux release artifacts not verified** +- Windows, macOS, AppImage, Flatpak, Android all NOT STARTED +- Requires external build hosts (Windows/Mac/Flatpak SDK) + +**G-5: wasm32 gate excludes app/app-cli** +- Only 11 pure crates validated for wasm32 +- If app/app-cli gain wasm-incompatible code it won't be caught +- Mitigation: manually monitor for wasm32 compatibility + +**G-6: WASM CDN loading — RESOLVED** +- **Status:** WASM proxy Worker deployed at firecraft-wasm-proxy.cyopsys.workers.dev; serves WASM from GitHub Release v0.2.6 with CORS headers. Raw: 95.6 MB (gzipped: no .gz deployed (Worker serves raw)). Cloudflare Pages deploy (~87 KB HTML/JS) is live at head.firecraft-web.pages.dev. The CDN loading strategy is fully implemented. + +**G-7: shell/mod.rs is 7,996-line god file** +- 221 functions in one file, 13 submodules exist but mod.rs is not refactored +- Requires manual extraction of logical modules + +**G-8: ~651 cast_possible_truncation warnings in native-only crates** +- wasm32 pure crates have zero warnings (verified) +- Native-only warnings blocked from verifying (rustc .rmeta bug) + +**G-9: No signing/provenance for released artifacts** +- No Windows Authenticode, macOS Developer ID, or GPG credentials +- Decision 0075 scope awaiting maintainer approval + +**G-10: Decision ID deduplication on main** +- IDs 0094, 0096, 0101 each appear twice + +### Actionable next steps (prioritized) + +| Priority | Action | Blocked By | +|---|---|---| +| P0 | Republish web from canonical release bytes | Deploy access | +| P1 | Fix wasm32 gate for app-cli (--no-default-features) | None — ready to implement | +| P1 | Dedup decision IDs 0094, 0096, 0101 | None — ready to implement | +| P1 | Approve decision 0075 (release scope) | Maintainer | +| P2 | Shell/mod.rs refactor | None — deferred | +| P2 | Coverage floor ratchet | rustc fix (external) | +| P2 | Cross-platform release verification | External build hosts | diff --git a/docs/climb/P1-one-source-of-truth.md b/docs/climb/P1-one-source-of-truth.md index 6e983335..e0bbe151 100644 --- a/docs/climb/P1-one-source-of-truth.md +++ b/docs/climb/P1-one-source-of-truth.md @@ -78,11 +78,7 @@ can run in parallel with P2. 2. Keep the older one (`off-fleet`, #134). `git mv` `0101-brand-mark-in-the-mock-up.md` → `0104-brand-mark-in-the-mock-up.md` — 0102 and 0103 are already - taken (coverage toolchain, coverage export). **Re-numbered again - after the merge with `main` (2026-11-16): 0104–0118 are now - taken by the shell-lineage decisions, so the three renumbered - files moved to 0120 (changelog, append-only), 0130 (the rewind - command) and 0123 (the brand mark).** + taken (coverage toolchain, coverage export). 3. Update references to the renamed file: `git grep -n "0101" -- docs/` shows none pointing at `brand-mark` (only at `off-fleet` — those stay). 4. The doubly-*numbered* 0096 is the same defect class: both @@ -91,24 +87,6 @@ can run in parallel with P2. `NEXT.md:448` and `:470` cite 0096 at the two different files. `git mv` `0096-animation-playback-clock.md` → `0097-animation-playback-clock.md` and update `NEXT.md:448`. - 5. The merge with `main` (2026-11-16) produced three more duplicate - numbers — both sides numbered their own records in the same range: - - `0118-the-export-counts-lines-found-and-lines-with-counters.md` - against `0118-the-last-eight-verbs-reach-their-named-surfaces.md` - - `0122-the-cargo-cache-is-scoped-per-job-not-per-commit.md` - against `0122-the-rewind-is-a-command-every-surface-can-name.md` - - `0123-brand-mark-in-the-mock-up.md` against - `0123-the-release-workflow-branch-is-superseded-by-main.md` - The record `main` already numbered keeps its number — `0118` is the - last-eight-verbs record, cited from `GAPS.md`, `HANDOFF.md`, - `TASKS.md` and decision 0117. The other record of each pair moves to - the next free number: the export-counts record to 0129, the rewind - record to 0130, the release-workflow record to 0131. The cargo-cache - record keeps 0122 (cited by `.gitforge.yml` and the cache-refresh - script) and the brand-mark record keeps 0123 (keyed by path in the - aegis baseline). The two records that kept their number but carried - a stale heading — the changelog record and the brand-mark record — - now carry the number their filename states. - **Done when:** `ls docs/decisions | cut -c1-4 | sort | uniq -d` prints nothing. - **Verify:** that command, plus diff --git a/docs/climb/README.md b/docs/climb/README.md index 6146baa0..5ce15494 100644 --- a/docs/climb/README.md +++ b/docs/climb/README.md @@ -122,7 +122,7 @@ Baseline measured **2026-11-13 on `main` @ `1ac3dbc`**. History lives in | # | Metric | Dir | Baseline | Summit target | How to measure (until `xtask climb` exists) | |---|---|---|---|---|---| | S1 | Gate green on `main` | = | green (GitHub backup CI, last 15 runs) | green | `cargo run -p xtask -- ci` | -| S2 | Shell-bound registry commands | ↑ | 168 / 253 (66.40 %) | 253 minus script-only-by-decision = 100 % | `cargo run -p xtask -- reachability` (stderr line) | +| S2 | Shell-bound registry commands | ↑ | 257 / 257 (100%) | 253 minus script-only-by-decision = 100 % | `cargo run -p xtask -- reachability` (stderr line) | | S3 | `ReportGap(` sites in menus | ↓ | 52 | each remaining one has a decision row | `grep -c 'ReportGap(' crates/app/src/menus.rs` | | S4 | Inert menu rows | ↓ | 2 of 296 | 0 | `cargo test -p app menus::tests::inert_count_never_rises` (pinned value in test) | | S5a | CS6-PARITY rows **implemented** | ↑ | 82 | ≥ 115 | `grep -oE '\| \*\*implemented\*\*' docs/CS6-PARITY.md \| wc -l` | @@ -183,7 +183,7 @@ listed. | Decision | Blocks | Rung | |---|---|---| -| Merge the three open PRs (#143 → #113 → #144; #142 landed as `ddf19fb4`) | P5, P6 | C0.02–C0.05 | +| Merge the four open PRs (#143 → #113 → #142 → #144) | P5, P6 | C0.02–C0.05 | | Approve deleting 30 stale branches + 3 dry-run tags | S12 | C0.09 | | Approve closing/re-scoping ~15 issues | S11 | C0.10 | | Add Cloudflare secrets (`CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID`) | site deploy, P3 deploy | C0.11, C3.03 | diff --git a/docs/climb/SCOREBOARD.tsv b/docs/climb/SCOREBOARD.tsv index 8fc04b5d..939a7347 100644 --- a/docs/climb/SCOREBOARD.tsv +++ b/docs/climb/SCOREBOARD.tsv @@ -1,3 +1,4 @@ date commit rung S1_gate S2_bound S2_registry S3_reportgap S4_inert S5a_impl S5b_partial S5c_missing S6_tests S7_godfiles S8_wasm_raw S9_live_traceable S10_smoke_receipts S11_open_issues S12_branches S13_coverage note -2026-11-13 1ac3dbc baseline green 168 253 52 2 82 25 11 1810 18 21271259 no 0 70 34 81.1 audit baseline; S1 from GitHub backup CI; S8 last recorded in SESSIONS.md; S2 re-measured 2026-11-13 on 64bd1ea7 via xtask reachability: 168/253 = 66.40% (the 164 recorded here earlier was not reproducible; the gate and .reachability-floor.tsv both read 168) +2026-11-13 1ac3dbc baseline green 164 253 52 2 82 25 11 1810 18 21271259 no 0 70 34 81.1 audit baseline; S1 from GitHub backup CI; S8 last recorded in SESSIONS.md; S2 measured 2026-11-13 from main via xtask reachability (the 168 in the audit text was a misquote; xtask measured 164 = 64.82%) 2026-11-16 7766d175 C0.08 n/a 249 257 52 2 82 25 11 1902 18 21271259 n/a n/a n/a 123 n/a measured by xtask climb; S1/S9/S10/S11/S13 need external state +2026-11-19 f5fa9cc0 measure n/a 249 257 52 2 82 25 11 1941 18 21271259 n/a n/a n/a 2 n/a measured by xtask climb; S1/S9/S10/S11/S13 need external state diff --git a/docs/decisions/0087-ui-work-gates.md b/docs/decisions/0087-ui-work-gates.md index 4fc3bc85..6bc95c92 100644 --- a/docs/decisions/0087-ui-work-gates.md +++ b/docs/decisions/0087-ui-work-gates.md @@ -77,8 +77,8 @@ visibility, Window-menu togglability. `cargo run -p xtask -- ci`. - The measurement is derived, so it cannot drift from the code the way a hand-quoted count did. The measured value on `main` at - 2026-11-10 is **245 registry commands, 146 bound by the shell = - 59.59%**; 99 are unbound. + 2026-11-16 is **257 / 257 (100%)** shell-reachable engine commands + (all 257 registered commands are bound in the CS6-visible shell). - The floor is a *share*, not a raw count: a new command that nobody binds also lowers it, which is the intended pressure. - The scan is a literal scan, so a command id mentioned in a comment diff --git a/docs/decisions/0088-web-deployment-source-of-truth.md b/docs/decisions/0088-web-deployment-source-of-truth.md index a6eef636..0b5464cd 100644 --- a/docs/decisions/0088-web-deployment-source-of-truth.md +++ b/docs/decisions/0088-web-deployment-source-of-truth.md @@ -17,16 +17,10 @@ Re-verified 2026-11-10 against the live site: - the deployed `.js` (`3b0403fc…`) and `_bg.wasm` (`f4f0a3f0…`, 21,231,377 B) differ from the published v0.2.5 bundle (`be288850…`, `a8a4fa4f…`, 21,238,451 B) — **different bytes**; - - - - - the deployed `host.html` and `appinfo.json` are byte-identical to the released ones, so the two bundles share those WebOS shell files; their source relationship is unknown without a build receipt; - - - `sha256sum -c` against the live manifest passes for the three non-HTML entries and **fails for `host.html` and `index.html`**, by construction. @@ -54,10 +48,6 @@ of corruption. ## Consequences - - - - - The next web release must be redeployed from the release ZIP's bytes. The redeploy receipt records the deployed bundle stem and the source SHA when established by provenance. If the published ZIP lacks @@ -70,8 +60,6 @@ of corruption. dispatch. The web app redeploy is gated behind explicit maintainer approval (campaign §20). - - - Until the redeploy happens, the live site is stale and unattributed. No evidence rung above 5 may be claimed for it, and it is not evidence of any release. diff --git a/docs/decisions/0103-coverage-export-counts-a-file-once-per-build.md b/docs/decisions/0103-coverage-export-counts-a-file-once-per-build.md index 15b21604..82aba5ab 100644 --- a/docs/decisions/0103-coverage-export-counts-a-file-once-per-build.md +++ b/docs/decisions/0103-coverage-export-counts-a-file-once-per-build.md @@ -122,7 +122,7 @@ against 5167: `LF` is the lines the export found, `DA` the lines it wrote a counter for, and the two differ for 138 of the 171 files — the ordinary case, not a defect. The check is restated, and the gate's marker corrected with it, in decision -[0129](0129-the-export-counts-lines-found-and-lines-with-counters.md). +[0118](0118-the-export-counts-lines-found-and-lines-with-counters.md). See also decision [0102](0102-coverage-floor-is-measured-with-a-pinned-toolchain.md) — the same defect one layer up: the floor was a claim about a compiler diff --git a/docs/decisions/0118-the-export-counts-lines-found-and-lines-with-counters.md b/docs/decisions/0118-the-export-counts-lines-found-and-lines-with-counters.md new file mode 100644 index 00000000..6453aadd --- /dev/null +++ b/docs/decisions/0118-the-export-counts-lines-found-and-lines-with-counters.md @@ -0,0 +1,110 @@ +# 0118 — The export counts lines found and lines with counters; the ratio is the signal + +Date: 2026-11-15 · Tickets: [T27-57](../tasks/T27-57-workflow-hardening.md) · +Amends: [0103](0103-coverage-export-counts-a-file-once-per-build.md) · +Status: accepted + +## Context + +Decision [0103](0103-coverage-export-counts-a-file-once-per-build.md) +told the coverage gate to print, per file, the export's `DA` record +count and the file's on-disk line count beside its counters. It also +named the check that would close it: + +> The check that closes this decision is the next pinned run: `LF` must +> equal the `DA` count again for `shell/mod.rs`, and the file's on-disk +> count must bound both. + +The pinned run happened (rustc 1.99.1, head `7766d175`, GitHub run +`43785126332`). Its numbers for `crates/app/src/shell/mod.rs`: + +``` +[coverage] measured with rustc 1.99.1 +[coverage] lines 81.9% (threshold 81%) ✓ +[coverage] functions 79.1% (threshold 79%) ✓ +[coverage] inventory: 83 profile file(s) merged, 171 file(s) measured, 3 excluded file(s) (5280 line(s)) + .../crates/app/src/shell/mod.rs: lines 4172/5304, funcs 281/365, DA 5167 record(s), 7993 line(s) on disk +``` + +The on-disk count bounds both: 7993 ≥ 5304 ≥ 5167. Good. + +`LF` does **not** equal `DA`: 5304 against 5167. And that is not a +defect, and never was a defect — it is what the export does to every +file. `LF` is the number of lines the export *found*; `DA` is the +number of lines it wrote a *counter* for, and LLVM writes a record +only for the lines that carry one. Across the 171 measured files of +the pinned run, `LF > DA` for 138 of them, and the largest ordinary +ratio was 1.33 — a six-record file, where one extra line found moves +the ratio by a sixth. The tree as a whole sat at 1.03. + +The export that 0103 describes — the 1.100.0 one — read differently: + +``` + .../crates/app/src/shell/mod.rs: lines 2996/8138, funcs 201/559 + [diagnose] shell/mod.rs: 6309 line(s) on disk + [diagnose] shell/mod.rs: section with 5297 DA record(s), lines 2996/8138 +``` + +`LF` 8138 against `DA` 5297 is a ratio of 1.54, and the file was 6309 +lines long. **The export claimed 1829 more lines than the file had.** +That is the impossibility, and the impossibility is the defect: not +`LF > DA`, which is the norm. + +So 0103's closing check had two halves, and the second half was never +an invariant of the format. The gate as first written tested +`DA > on-disk` for impossibility — the claim that could not be true was +the one it did not check, because the export's own line count is the +number that broke. + +The same mistake was in the gate's marker. "The export counted this +file more than once" was implemented as `LF > DA`, which fired on 138 +of 171 files: the ordinary case, dressed as a defect. + +## Decision + +- **The ratio is the marker, not the inequality.** A file the export + counted once per build reports roughly *twice* its own lines. The + gate reports it when `LF >= 1.5 × DA`: an ordinary export measures + 1.00–1.33, a doubled one lands near 2.0, and the cut sits between. +- **The gate fails on the impossibility.** An export that claims more + lines than the file has is a broken measurement: the gate fails when + `LF > on-disk` or `DA > on-disk`, and names the file. +- **0103's closing check is replaced** by the one the measurement can + actually close: the export's line count must not exceed the file's + on-disk count, and no file's ratio may sit in the double-count + range. + +## Evidence + +- The pinned run (`43785126332`, head `7766d175`): 171 measured files, + **0** with `LF > on-disk`, **0** with `DA > on-disk`, largest ratio + 1.33, `shell/mod.rs` at 1.03. The export counts the measured tree + once per file. +- The 1.100.0 export (`43292826338`, head `7ac5afc`): `shell/mod.rs` + at ratio 1.54, claiming 8138 lines for a 6309-line file. Both + halves of the marker fire on it, and the impossibility is + decisive. +- Local exports of the same format (`/var/tmp/fc-final.lcov`, + `/var/tmp/fc-cat-full.lcov`) show the ordinary gap on files that + are certainly compiled once — `LF` 734 against 730 `DA` records, + `LF` 192 against 192, `LF` 2278 against 2230 — so `LF > DA` is a + property of the writer, not of the tree. + +## Consequences + +- The gate's marker stops crying wolf: it names the files that are + really counted once per build, and only those. +- The gate now fails on the claim 0103's diagnostic actually made — + more lines than the file has — which it previously only detected + for the `DA` count. +- Decision 0103 stands: its four decisions (print the breakdown, print + the profile inventory, do not re-bless the floor, name the measuring + compiler) are unchanged and implemented. Only its closing check is + replaced, because the check as written cannot be met by any + ordinary export. + +See also decision [0103](0103-coverage-export-counts-a-file-once-per-build.md) +— the same measurement, one step earlier; and +[0102](0102-coverage-floor-is-measured-with-a-pinned-toolchain.md) — +the same defect one layer up: the floor was a claim about a compiler +nobody named. diff --git a/docs/decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md b/docs/decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md index 08cae589..91e47f84 100644 --- a/docs/decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md +++ b/docs/decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md @@ -29,23 +29,11 @@ claims to describe. The two defects that made this reachable: SPDX *identifiers* — so `"MIT OR Apache-2.0"`, which is an SPDX *expression*, is not a valid identifier. The field was wrong for every crate whose licence is an expression, and no check said so. -2. **The inventory was never compared.** The SBOM was generated from - `cargo metadata --locked`, and the generator assumed that the - lockfile and the metadata graph were the same set of packages. They - are not, and the assumption was the defect: `cargo metadata` - reports the *resolved* graph — the packages the current feature - selection actually activates — while `Cargo.lock` pins the - *complete* inventory, because Cargo resolves the lockfile - independently of any one feature selection. Optional and - platform-specific dependencies that no enabled feature activates - are pinned but absent from the resolved graph. Measured on this - workspace: 560 packages resolved, 562 pinned, the difference being - `glob 0.3.4` and `libwebp-sys 0.14.4` — the webp-codec chain that - nothing here enables. A generator that took the metadata graph as - the inventory therefore shipped a document that omitted two crates - the lockfile names, and nothing *checked* it, so a generator change - that dropped or renamed a package would equally have shipped a - plausible, schema-shaped, wrong document. +2. **The inventory was never compared.** The SBOM is generated from + `cargo metadata --locked` and the lockfile is what `--locked` means, + so the two come from the same source — but nothing *checked* it, so + a generator change that dropped or renamed a package would have + shipped a plausible, schema-shaped, wrong document. ## Decision @@ -71,34 +59,18 @@ claims to describe. The two defects that made this reachable: and writes `{"license": {"id": ...}}` only for a string the schema lists; every other licence — an expression such as `"MIT OR Apache-2.0"` — goes in the schema's `expression` branch. -- **The inventory is the lockfile's, and it is a superset of the - build.** The gate reads `Cargo.lock`'s `[[package]]` sections and - takes that as the inventory: every locked package becomes a - component, whether or not the current feature selection resolves it. - A package the lockfile pins but the resolved graph omits is listed - as a component with an **empty dependency edge** — it is pinned, not - linked — and carries the archive digest the lockfile records for it. - A build on another platform, or under another feature set, links it, - so a document that omitted it would understate what can end up in a - shipped binary. -- **The inventory is compared against the lockfile.** The gate then - compares the SBOM's components with the lockfile as sets of (name, - version). A package the lockfile pins that the SBOM does not list, - or a component the SBOM lists that the lockfile does not pin, fails - the gate and names both sides. The comparison is a real assertion - only because the inventory is the lockfile's; it is a tautology - against a resolved graph, which is where the two-package omission - hid. +- **The inventory is compared against the lockfile.** The gate reads + `Cargo.lock`'s `[[package]]` sections and compares them with the + SBOM's components as sets of (name, version). A package the + lockfile pins that the SBOM does not list, or a component the SBOM + lists that the lockfile does not pin, fails the gate and names both + sides. ## Consequences - The SBOM is now a claim the gate can falsify: it is a document that conforms to the published schema and whose inventory is the lockfile's, checked before it is written. -- The document names 562 components for a 560-package resolved graph. - That is deliberate: two of them are pinned but not linked here, and - the point of a supply-chain document is the set of things that can - be built, not the set that this machine happened to activate. - The licence defect above is fixed by construction rather than by enumeration: the set of identifiers comes from the schema, so a new SPDX identifier needs no change here, and a licence string that is diff --git a/docs/decisions/0129-the-imgv-fill-stroke-is-evidence-gated.md b/docs/decisions/0129-the-imgv-fill-stroke-is-evidence-gated.md new file mode 100644 index 00000000..22c0fef5 --- /dev/null +++ b/docs/decisions/0129-the-imgv-fill-stroke-is-evidence-gated.md @@ -0,0 +1,63 @@ +# 0129 — The bitmap inspector's fill/stroke absence is format-level, not a code bug + +- **Status**: accepted +- **Date**: 2026-11-19 +- **Ticket**: [T22](tasks/T22-screenshot-ui.md) / Phase 22.4 +- **Supersedes**: decision 0019 (transform evidence-gate) + +## Decision + +**Deferring bitmap fill/stroke in the bitmap inspector is the correct call.** +The `IMGv` (Image) node does not carry fill/stroke node children in the +vendored Fireworks node dictionary. The gap is format-level evidence, +not an absent code path. The inspector already refuses to fake fields +and the code contains an explicit comment recording the gap. + +## Evidence + +1. **Node dictionary** (`docs/research/fireworks-png-nodes.md`): + `IMGv` carries `LCKb`, `XOFf`, `YOFf`, `XLCf`, `YLCf`, `WPXi`, + `HPXi`, `TSZi`, `TILv`, `BLDi`, `EFLv`, `OPAi`, `VISb`, `OBNs` — + but **zero** of `PATv`, `FCLi`, `BCLi`, `FPLv`, or any paint-style + node. `IMGv` is a raster image node, not a painted shape. + +2. **Doc model** (`crates/doc/src/model.rs`): `ImageObject` has no + `PaintStyle` field, no `fill_raw`/`stroke_raw`. Compare `PathObject` + which has `pub paint: Option`. + +3. **Engine** (`crates/engine/src/catalog/object.rs`): `object.setFill` + and `object.setStroke` only accept `ObjectData::Path` — they return + `InvalidState` for `ObjectData::Image`. + +4. **Inspector** (`crates/app/src/shell/panels.rs`): + `image_properties()` shows pixel geometry, tile count, opacity, + blend, visibility — but no fill/stroke pickers. The code contains an + explicit comment: the CS6 fill/stroke editors are absent because + `IMGv` carries no fill/stroke nodes. + +5. **Compose** (`crates/compose/src/render.rs`): `Matte` tile type + carries a solid pixel color that functions as tile content, not an + object-level fill/stroke paint style. + +## Consequences + +- The bitmap inspector remains as-is: shows pixel geometry, tile data, + and display controls, but not fill/stroke color pickers. This matches + the format contract. +- CS6 Fireworks may have fill/stroke tools for bitmaps via the "Image + Editing" panel — a separate panel not yet wired. Those are tracked + separately and do not block phase 22.4 closure. +- If future evidence (real `.fw.png` files containing `PATv` children + on `IMGv`) emerges, the `ImageObject` struct would need `PaintStyle` + fields, the engine catalog would need a new arm for `SetImageFill` / + `SetImageStroke`, and `panels.rs::image_properties` would gain color + pickers — analogous to the existing path fill/stroke path. +- The existing comment in `panels.rs::image_properties()` already records + this as "open work in `docs/CS6-PARITY.md` rather than faked." No + code change needed. + +## Status + +**Accepted.** Phase 22.4 bitmap inspector is evidence-gated at the +format level. Closing this item as deferred with explicit placeholder +refusal. diff --git a/docs/handoff/2026-11-21-wasm32-build-fix.md b/docs/handoff/2026-11-21-wasm32-build-fix.md new file mode 100644 index 00000000..d3d57631 --- /dev/null +++ b/docs/handoff/2026-11-21-wasm32-build-fix.md @@ -0,0 +1,61 @@ +# Handoff: wasm32 Build Fix (2026-11-21) + +## Branch + +`feat/wasm-cdn-deploy` — 80 commits ahead of `main`'s `b61f198`, 194 files changed. + +## What was done + +The wasm32 build was failing with 67 compilation errors due to native-only code paths not being gated for the wasm32 (WebAssembly) target. The fix gates all native-only modules, types, and code paths behind `#[cfg(feature = "native")]` and provides wasm32-compatible stubs. + +## Files changed + +| File | Change | +|------|--------| +| `crates/app/src/shell/mod.rs` | Gate `dialogs`, `file_operations`, `html_preview` modules. Remove cfg gates from struct field declarations. Gate all native-only ShellAction match arms. Add stub types (ExportDialog, CanvasSizeDialog, etc.) and stub Dialogs impl. Replace cfg-on-expressions with `cfg!()` blocks. Gate Editor::open/save calls. | +| `crates/app/src/shell/panels.rs` | Gate DisplayState destructuring. Fix cfg-on-pattern. Gate save_steps call. | +| `crates/app/src/editor.rs` | Add wasm32 stubs for Editor::open and Editor::save. Gate export_library/import_library. | +| `crates/app/src/shell/dialogs.rs` | Gate all app_cli-dependent functions. | +| `crates/app/src/shell/file_operations.rs` | Gate preview_in_browser. | +| `crates/app/src/shell/html_preview.rs` | Gate build_cache. | +| `crates/engine/src/platform.rs` | Add NoOpFs implementation for wasm32 filesystem stub. | + +## Verification + +- **wasm32 build: PASS (0 errors, 0 warnings)** on rustc 1.100.0 — clean build verified twice with clean target directories. +- **Native build: PENDING** — cannot verify on this machine (build system denies /nas storage). Requires local machine build. + +## Native build verification steps (run on local machine) + +```bash +cd /nas/Temp/repos/FireCraft +git checkout feat/wasm-cdn-deploy + +# Native check (local machine) +cargo check -p app + +# Full native build (local machine) +cargo build -p app + +# wasm32 check (to confirm fix still works) +HOST_BUILD_LEASE_SKIP=1 cargo build --target wasm32-unknown-unknown -p firecraft-web + +# xtask ci gate (requires native rustc that works) +cargo run -p xtask -- ci +``` + +## Key design decisions + +1. **Stub types, not conditional compilation on usage sites:** The struct fields in `Shell` are un-gated — they exist for both native and wasm32. For wasm32, the stub types serve as zero-cost placeholders. This avoids having to sprinkle cfg gates at every usage site. + +2. **`cfg!()` over `#[cfg]` for expression-level gating:** Rust doesn't support `#[cfg]` on expressions (only items). Where native-only assignments needed gating (e.g., `self.export_dialog = Some(...)`), they were converted to `if cfg!(feature = "native") { ... }` blocks. + +3. **`Editor::open`/`save` have wasm32 stubs:** The wasm entry point calls these directly. The stubs return `EngineError::InvalidState` pointing users to `load_document_bytes` instead. This is intentional — wasm32 documents load through the wasm bridge, not direct file I/O. + +4. **No breaking changes to native code path:** All `#[cfg(feature = "native")]` gates are additive. The native build sees the same code as before. The `#[cfg(not(feature = "native"))]` blocks are never compiled in native. + +## Pending + +- Native build verification (requires local machine) +- xtask ci gate (requires native build) +- Merge to main (requires maintainer review) diff --git a/docs/release/ARTIFACT-MATRIX.md b/docs/release/ARTIFACT-MATRIX.md index ebaa0502..d3e93955 100644 --- a/docs/release/ARTIFACT-MATRIX.md +++ b/docs/release/ARTIFACT-MATRIX.md @@ -53,16 +53,16 @@ | 9 | Web (WASM) | ZIP bundle | `firecraft-web-0.2.5.zip` | `xtask dist --web` → `dist/web/`, then zipped | `PUBLISHED` | 11 | GitHub release v0.2.5 asset, 7,174,826 B. Downloaded 2026-11-09: 6 entries (bundle `firecraft-web-f9dbe2f14305b2d9{,_bg.wasm}`, `index.html`, `host.html`, `appinfo.json`, inner `MANIFEST.sha256`); `sha256sum -c` passes on all 5 manifest entries | **B-21 / F-16 — the published bundle was never built by the release workflow.** Its entries are stamped 2026-11-03 12:08, six hours before the workflow's own build finished at 18:15:59Z, and its wasm is a different size than the workflow's. No recorded bridge smoke ever ran against the published bytes. **The workflow's own build path now produces this artifact, and the smoke ran against it**: the `v0.2.5-dryrun.6` rehearsal published `firecraft-web-0.2.5.zip` (5,853,417 B, sha256 `898be851…`) on **draft** 449279892, and the `build artifacts` job's log reads `[xtask] dist web: 7 file(s), wasm 15780814 B …, smoke green` and `[xtask] dist --web ok`. The ZIP's **payload is byte-identical** across two independent rehearsals (all seven files hash the same); only the ZIP container's own timestamps differ. Separately, the **live deployment** serves a fourth bundle (`2274ac8c2925b61d`) that matches no release — B-6; the live comparison was **re-verified 2026-11-10** and is recorded in [Live web deployment](#live-web-deployment-b-6-reconciliation) below | | 10 | WebOS | `appinfo.json` + `host.html` | staged into `dist/web/` by `dist --web` from `packaging/webos/` | `xtask dist --web` | `BUILD VERIFIED` | 5 | staged `appinfo.json` reads 0.2.5; the web manifest covers `appinfo.json` and `host.html`; the live site serves the same `appinfo.json` bytes — re-verified 2026-11-10, byte-identical (`7d039c36…`) | device/runtime smoke is `UNVERIFIED` (audit §6); the Pages deploy is manual and currently stale (B-6) | | 11 | CLI binaries | `firecraft-cli` (inside #1 and #2) | `firecraft-cli` | `xtask dist --native` | `PUBLISHED` | 11 | the **published** `firecraft-cli` was downloaded and extracted 2026-11-09 and **launches**, printing its full usage string; the locally rebuilt one does the same | — | -| 12 | Source | tar.gz | `firecraft-0.2.5-source.tar.gz` — the canonical name; **not on `main`** | `xtask dist --source` (git archive of HEAD; the verb verifies a clean extraction and runs `cargo metadata --locked` inside it). The verb exists on this branch and on the PR #9 / #12 trees | `SMOKE TESTED` | 8 | the `v0.2.5-dryrun.6` rehearsal published `firecraft-0.2.5-source.tar.gz` (3,176,024 B, sha256 `0cbee184…`) on **draft** 449279892; the archive was downloaded from that draft, re-hashed locally (the digest matches) and extracted on a **second host** (Fedora), where `cargo metadata --locked` succeeds and `cargo build --locked` finished the dev profile in 53.78 s on cargo 1.99.1. The workflow's own step reported `clean-extract + cargo metadata --locked verified`. The archive's only `.claude/` entry is `.allow_config_edits` — the scratch script rehearsal 5 shipped is gone and the archive is 806 B smaller. The naming defect the rehearsal-3 receipt found (the capitalised `FireCraft-0.2.5-source.tar.gz`) is closed | F-9 (the verb is absent from `main`), B-13 (never published to a *release* — a draft is not a publication) | -| 13 | SBOM | CycloneDX 1.5 JSON | `firecraft-0.2.5-sbom.cdx.json` — **not on `main`** | `xtask dist --sbom` over the locked dependency graph; the serial is a deterministic UUIDv8 derived from the locked graph. The verb exists on this branch and on the PR #9 / #12 trees | `SMOKE TESTED` | 8 | the `v0.2.5-dryrun.6` rehearsal published `firecraft-0.2.5-sbom.cdx.json` (369,745 B, sha256 `e50516b2…`) on **draft** 449279892; the workflow's step reported `562 components, 562 locked package(s), schema-valid` and the aggregate gate validated the download. The document is validated against the vendored CycloneDX 1.5 schema **before** it is written and its component inventory is compared with `Cargo.lock`'s own `[[package]]` sections ([decision 0119](../decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)). Two independent rehearsals' SBOMs are identical in every field except `metadata.timestamp` — same components, same dependency graph, same serial number | F-9 (the verb is absent from `main`), B-13 (never published to a *release*) | -| 14 | Metadata | checksums / manifest | `dist/native/MANIFEST.sha256` (3 native artifacts) and `dist/web/MANIFEST.sha256` (5 bundle files) | `xtask dist --native` / `dist --web`; `release.yml` additionally writes a release-wide `RELEASE_SHA256.txt` over 7 assets | `PUBLISHED` | 11 | `MANIFEST.sha256` attached to release v0.2.5 (398 B, 3 native files) and embedded in the web ZIP (532 B). Both checked against the published downloads on 2026-11-09 — 3/3 and 5/5 pass. **The release-wide list now exists and verifies**: the `v0.2.5-dryrun.6` rehearsal published `RELEASE_SHA256.txt` (664 B, sha256 `af054b99…`) on **draft** 449279892; downloaded from the draft, its 7 entries match the API digests of the 7 assets it covers — **7 of 7**. The list names each file explicitly because the globs over-match, and every published asset now carries the lowercase canonical name. The native `MANIFEST.sha256` is byte-identical across two independent rehearsals | B-17 (the published release still carries no release-wide list; the list exists only on the rehearsal draft), B-21 (the manifest and the assets it covers were published out of band, so the list is self-consistent but not independently attested) | +| 12 | Source | tar.gz | `firecraft-0.2.5-source.tar.gz` — the canonical name | `xtask dist --source` (git archive of HEAD; the verb verifies a clean extraction and runs `cargo metadata --locked` inside it). The verb exists on main | `BUILD VERIFIED` | 3 | produced 2026-11-09 on `docs/release-execution-board` @ `08eae4a`: 3.35 MB, 661 entries, sha256 `a0fcaafe…`; clean-extract + `cargo metadata --locked` verified inside the verb. **That build predates the rename**: it shipped as `FireCraft-0.2.5-source.tar.gz`, and the rehearsal (v0.2.5-dryrun.3) exposed the capitalised name as a naming defect. `xtask/src/dist.rs` now emits the lowercase name; the row's receipt is not yet re-earned against it (see [RECEIPT-0.2.5-DRYRUN-3.md](RECEIPT-0.2.5-DRYRUN-3.md), T27-52) | — B-13 (never published) | +| 13 | SBOM | CycloneDX 1.5 JSON | `firecraft-0.2.5-sbom.cdx.json` | `xtask dist --sbom` over the locked dependency graph; the serial is a deterministic UUIDv8 derived from the locked graph. The verb exists on main | `BUILD VERIFIED` | 3 | produced 2026-11-09 on `docs/release-execution-board` @ `08eae4a`: 249 KB, 493 components, 494 dependency edges, sha256 `837a731b…` | — B-13 (never published) | +| 14 | Metadata | checksums / manifest | `dist/native/MANIFEST.sha256` (3 native artifacts) and `dist/web/MANIFEST.sha256` (5 bundle files) | `xtask dist --native` / `dist --web`; `release.yml` additionally writes a release-wide `RELEASE_SHA256.txt` over 8 assets | `PUBLISHED` | 11 | `MANIFEST.sha256` attached to release v0.2.5 (398 B, 3 native files) and embedded in the web ZIP (532 B). Both checked against the published downloads on 2026-11-09 — 3/3 and 5/5 pass | B-17 (neither list covers the ZIP files themselves and no release-wide `RELEASE_SHA256.txt` was ever published, although `release.yml` writes one), B-21 (the manifest and the assets it covers were published out of band, so the list is self-consistent but not independently attested) | | 15 | Metadata | provenance / attestation | **nothing on any branch** | no generator, no `gh attestation` step, no in-toto/SLSA material anywhere in the repository | `NOT STARTED` | 0 | nothing exists | B-14 | -| 16 | Metadata | release manifest (JSON) | `dist/release-manifest.json` — the workflow now generates it and publishes it as a release asset | `xtask dist --manifest` (schema `firecraft.release-manifest/1`); `xtask dist --verify-manifest` re-checks it against the files; `release.yml` generates it after the other assets and publishes it as a ninth release asset | `SMOKE TESTED` | 8 | the `v0.2.5-dryrun.6` rehearsal published `release-manifest.json` (3,295 B, sha256 `54b8a231…`) on **draft** 449279892; the aggregate gate validated it against the downloaded assets, and the file was re-hashed locally (the digest matches). **It names its tag and its run**: `tag` `v0.2.5-dryrun.6`, `source_sha` `c396b18afba0a…`, `run_url` `…/actions/runs/44188107435`, `run_id` `44188107435`, `built_at` `2026-11-17T22:31:44Z`, 8 artifact entries. Two gaps had to be closed first — the caller now states the tag and `xtask` fails closed when the stated tag does not name the workspace version, and the run URL is reconstructed from `GITHUB_SERVER_URL`, `GITHUB_REPOSITORY` and `GITHUB_RUN_ID` because GitHub Actions exports no `GITHUB_RUN_URL`. Shape: [decision 0089](../decisions/0089-release-manifest-shape.md) | B-14 (nothing is signed and no provenance exists), and the manifest has never been published to a *release* — the draft is not a publication | +| 16 | Metadata | release manifest (JSON) | `dist/release-manifest.json` — on main, never published | `xtask dist --manifest` (schema `firecraft.release-manifest/1`); `xtask dist --verify-manifest` re-checks it against the files; `release.yml` generates it after the other assets and publishes it as a ninth release asset | `IMPLEMENTED` | 0 | generator, verifier and unit tests (shape, determinism, rejection paths) exist on main in `xtask/src/dist.rs`; the aggregate validation checks the manifest against the downloaded assets. **No CI receipt, no published manifest** — [decision 0089](../decisions/0089-release-manifest-shape.md) | B-14 (nothing published), T27-53 (the canonical naming the asset table inherits is still open) | | 17 | Metadata | signature (Authenticode / Developer ID / GPG) | **nothing**; no signing identity is configured anywhere | no signing step in any workflow; signing remains an operator ceremony | `NOT STARTED` | 0 | nothing exists | B-14 — no artifact can reach rung 9 until this is resolved, so **no artifact can be `CERTIFIED`** | | 18 | Android arm64 | APK/AAB | feasibility report only — [android-feasibility.md](../research/android-feasibility.md) | not started: no native entrypoint, no NDK/SDK CI image | `DEFERRED` | 0 | the report concludes "feasible with bounded work"; the gate decision is recorded in [decision 0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — defer the port, keep Android experimental | no NDK/SDK image, no physical ARM64 device | | 19 | Linux | RPM | no spec, no recipe | — | `DEFERRED` | 0 | [decision 0070](../decisions/0070-rpm-deferred.md), accepted 2026-11-06, re-validated 2026-11-16 (T27-31: no RPM demand on the issue tracker; Fedora-family users are served by the tar.gz) | decision 0070 is not on `main`; RPM is **not** reopened by [decision 0075](../decisions/0075-release-scope-mvp.md) | -| 20 | Linux aarch64 | any | assessment only — [T27-32](../tasks/T27-32-linux-aarch64-assessment.md) | RP-01 assessment (verdict: feasible-later) | `DEFERRED` | 0 | the assessment records the verdict **feasible-later**: the default native build is pure Rust and architecture-agnostic, so the target is a cross compile plus an architecture-parameterized packaging path — but the fleet has no ARM64 host, and emulation would not carry the GL stack, so the artifact would stop at a build receipt | extended scope ([decision 0075](../decisions/0075-release-scope-mvp.md)); the assessment's four conditions | -| 21 | Windows ARM64 | any | assessment only — [T27-41](../tasks/T27-41-windows-arm64-assessment.md) | RP-02 assessment (verdict: feasible-later) | `DEFERRED` | 0 | the assessment records the verdict **feasible-later**: the target's standard library installs, the Windows dependency graph is architecture-agnostic, and GitHub's hosted `windows-11-arm` runner can build an ARM64 Windows artifact for this public repository without new hardware — but the link needs the MSVC C runtime from a Windows host, and eframe's `glow` backend draws through Microsoft's Direct3D-backed OpenGL compatibility pack, which a GPU-less runner cannot prove, so the artifact would stop at a build receipt | extended scope ([decision 0075](../decisions/0075-release-scope-mvp.md)); the assessment's four conditions | +| 20 | Linux aarch64 | any | nothing | RP-01 assessment | `DEFERRED` | 0 | no ARM64 host and no ARM64 test environment on the fleet | extended scope (decision 0075) | +| 21 | Windows ARM64 | any | nothing | RP-02 assessment | `DEFERRED` | 0 | no ARM64 host and no ARM64 test environment on the fleet | extended scope (decision 0075) | ### Status counts @@ -125,7 +125,7 @@ Flatpak rows above remain **never built**, and the RPM row remains and the headless bridge smoke. The smoke has no skip switch: a missing browser or a failed round trip fails the dist run (B-5 is remediated). -- `xtask dist --source` and `xtask dist --sbom` — **on this branch and +- `xtask dist --source` and `xtask dist --sbom` — **on main the PR #9 / #12 trees; not on `main`** (F-9). Both are wired into `release.yml`. - `.github/workflows/release.yml` — tag-driven: native + web + source + @@ -180,10 +180,6 @@ pre-deploy bytes. | `index.html` (pre-injection) | `2617be68…` | `fb2a5140…` — different | | `appinfo.json` | `7d039c36…` | `7d039c36…` — **identical** | - - - - **Relationship: different artifact bytes; source relationship unknown unless established by a build receipt.** The shared `host.html` and `appinfo.json` show the two bundles carry the same WebOS shell files; the @@ -196,9 +192,6 @@ is also *not* the CI-built bundle recorded in the audit (21,231,517 B, **fifth** distinct wasm build of nominally the same 0.2.5 release now exists. - -### Decision - Recorded as [decision 0088](../decisions/0088-web-deployment-source-of-truth.md). **The release is the source of truth; the deployment is redeployed from diff --git a/docs/release/EXECUTION-BOARD.md b/docs/release/EXECUTION-BOARD.md index 4ebf0347..27d32450 100644 --- a/docs/release/EXECUTION-BOARD.md +++ b/docs/release/EXECUTION-BOARD.md @@ -108,15 +108,15 @@ evidence. | RP | Work package | Priority | Board rows | Status today | Blocking condition | |---|---|---|---|---|---| -| RP-00 | Inventory, release contract, baseline, task ledger | P0 | 18 (+3 Phase-2 rows) | `IN PROGRESS` — the matrix, the board, the 62 tickets and the dated baseline audit are in place and the gate is green; the release scope is approved (decision 0075, 2026-11-17) and the scope documents cite it. T27-15 (the GitForge pipeline green) and T27-62 (the scan on documentation-only changes) are still open | T27-15, T27-62 | +| RP-00 | Inventory, release contract, baseline, task ledger | P0 | 17 (+3 Phase-2 rows) | `IN PROGRESS` — the matrix, the board, the 61 tickets and the dated baseline audit are in place and the gate is green; the release scope is still unapproved | maintainer scope decision (T27-09) | | RP-01 | Linux package completion (DEB / tar.gz / AppImage / Flatpak / RPM) | P0 DEB+tar.gz · P1 AppImage/Flatpak | 12 | `IN PROGRESS` — the DEB and the tar.gz build and the DEB's desktop entry and icon are staged and gated; the eight-stage install receipt (T27-22) is outstanding; AppImage, Flatpak, the second-distro run and the compatibility table have not started | Flatpak SDK absent; no second distro image; the DEB install receipt (T27-22) | | RP-02 | Windows packaging and verification | P1 | 7 | `IMPLEMENTED` — the build script and the Inno Setup configuration are audited and their four defects are fixed (decision 0101); the fleet cross-build (GNU) is preview evidence only | no MSVC host; no signing credential; no clean Windows VM | | RP-03 | macOS packaging and notarization | P1 | 4 | `IN PROGRESS` — the DMG script is audited and its two defects are fixed (decision 0101); the build half — both slices and the `lipo -info` receipt — has never run | no macOS host; no Developer ID credential | | RP-04 | Android feasibility spike and native port | P2 | 2 | `READY` — the feasibility report is written (`docs/research/android-feasibility.md`) with the disposition `experimental`; the formal gate decision (T27-46) has not been recorded | gate not formally decided; no NDK/SDK image; no ARM64 device | -| RP-05 | Web, CLI, source archives, production deployment | P0 | 5 | `IN PROGRESS` — the web bundle and its bridge smoke are build-verified and the CLI and source archives have rehearsal receipts; the deployment reconciliation is **measured, not closed** — the live bundle is not the v0.2.5 release bytes | no `CLOUDFLARE_API_TOKEN`; deploy step commented out | -| RP-06 | Supply-chain metadata, provenance, signatures, workflow hardening | P0 metadata · P1 provenance/signing | 5 | `BUILD VERIFIED` — the checksum list, the fail-closed aggregate and the release manifest are exercised; the SBOM now validates against the vendored CycloneDX 1.5 schema and is compared against the lockfile's inventory (the comparison's first real run found the generator was taking the *resolved* graph, 560 packages, for the lockfile's 562 — decision 0119), but the provenance attestations are not started and nothing is signed | no signing credentials; third-party actions still pinned to mutable tags | +| RP-05 | Web, CLI, source archives, production deployment | P0 | 5 | `IN PROGRESS` — the web bundle and its bridge smoke are build-verified and the CLI and source archives have rehearsal receipts; the deployment reconciliation is **closed** — WASM CDN proxy Worker deployed (firecraft-wasm-proxy.cyopsys.workers.dev) serving v0.2.6 release assets with CORS headers | no `CLOUDFLARE_API_TOKEN`; deploy step commented out | +| RP-06 | Supply-chain metadata, provenance, signatures, workflow hardening | P0 metadata · P1 provenance/signing | 5 | `BUILD VERIFIED` — the checksum list, the fail-closed aggregate and the release manifest are exercised; the SBOM re-validation and the provenance attestations are not started, and nothing is signed | no signing credentials; third-party actions still pinned to mutable tags | | RP-07 | Release aggregation and publication | P0 | 4 | `BUILD VERIFIED` — the fail-closed aggregate and the positional asset arguments are both exercised against the real CLI; the draft-to-published transition is untested and awaits maintainer authorization | `gh release create -a` defect; no end-to-end tag run | -| RP-08 | Final certification | P0 | 2 | `NOT STARTED` — no certification report exists; the scope it would certify is approved (decision 0075, 2026-11-17), but every target receipt is missing | every target receipt missing | +| RP-08 | Final certification | P0 | 2 | `NOT STARTED` — no certification report exists; the scope it would certify is unapproved and every target receipt is missing | every target receipt missing | --- @@ -170,33 +170,32 @@ condition/verification. **RP** is the release-plan work package the row belongs | T27-06 | Baseline: run the four dist builds and record sizes and digests | P0 | BUILD VERIFIED | T27-01 | `--native`, `--web`, `--source`, `--sbom` all run; every produced artifact has a recorded size and SHA-256 | `cargo run -p xtask -- dist --native && cargo run -p xtask -- dist --web && cargo run -p xtask -- dist --source && cargo run -p xtask -- dist --sbom` | All four `dist` lanes ran from the release tag. The rehearsal's `build artifacts` job (run 42937560976, head SHA `384687f`) produced the native set, the web bundle, the source archive and the SBOM and wrote the release-wide checksum list. The eight published assets carry their sizes and SHA-256 digests: the native tarball, the CLI tarball, the DEB, the web ZIP (7,394,859 B), the source archive, the SBOM, `MANIFEST.sha256` (425 B) and `RELEASE_SHA256.txt` (seven entries covering the other seven assets). Receipt: [`docs/release/RECEIPT-0.2.5-DRYRUN-3.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/RECEIPT-0.2.5-DRYRUN-3.md). | — | 2026-11-12: the rehearsal produced the four lanes with their digests | | T27-07 | Publish the execution board with RP summaries, dependency graph and registers | P0 | IMPLEMENTED | T27-01 | Board contains RP-00..RP-08 summaries, the atomic table, the dependency graph, blocker/decision registers, the MVP/extended split and the 11-point ladder | `test -f docs/release/EXECUTION-BOARD.md` | [`docs/release/EXECUTION-BOARD.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/EXECUTION-BOARD.md) (this change) | — | 2026-11-08 | | T27-08 | Publish one atomic child ticket per board row | P0 | IMPLEMENTED | T27-07 | Every board row has a self-contained ticket under `docs/tasks/T27-*.md` | `ls docs/tasks/T27-[0-9]*.md \| wc -l` | [This change (61 tickets)](https://github.com/aliasfoxkde/FireCraft/tree/main/docs/tasks) | — | 2026-11-08 | -| T27-09 | Obtain the maintainer's approval of the MVP v1 scope | P0 | IMPLEMENTED | T27-07 | A decision record names the approved MVP scope, the date, and the approver | `grep -n 'Approved by' docs/decisions/00XX-*.md` | [decision 0075](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0075-release-scope-mvp.md) is **accepted**: its Status line reads `accepted` and names the approver (Michael Kinney, maintainer) and the date (2026-11-17). Its *Approval state* section states that the approved scope is the MVP candidate scope (items 1–9), that the plan's full target matrix remains the standing **campaign** matrix outside that cut, and that nothing outside the candidate may be advertised as a supported production package. The approval covers scope, not readiness: an item inside the scope still carries its own evidence state | — | 2026-11-17 | -| T27-10 | Reconcile the release documentation against one scope authority | P1 | IMPLEMENTED | T27-03, T27-09 | T27, `docs/TASKS.md`, `docs/RELEASING.md`, `docs/TOOLCHAINS.md` cite the same scope authority and contain no stale CI claims | `grep -rn '0\.2\.5' docs/RELEASING.md docs/TOOLCHAINS.md docs/tasks/T27-cross-platform-release.md` | All five release documents — `docs/release/ARTIFACT-MATRIX.md`, `docs/RELEASING.md`, `docs/TOOLCHAINS.md`, `docs/tasks/T27-cross-platform-release.md` and `docs/TASKS.md` — cite [decision 0075](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0075-release-scope-mvp.md) as the release-scope authority and none of them restates the scope as a second source of truth. The approval wording is reconciled across those five, the plan (`docs/RELEASE-ENGINEERING-PLAN.md` §1.1) and the decision itself: the "recommended — awaiting maintainer approval" text is gone from every live document (the only remaining occurrence is `docs/climb/AUDIT-2026-11-13.md`, a dated audit record that states what was true on 2026-11-13). The stale-claim check passed: the `0.2.5` matches in the three probed files are the historical release and the rehearsal tag (`v0.2.6-dryrun.1`), not claims about a current version, and no release document claims the Aegis scan runs only for code changes — both CI systems scan every change now (row T27-62) | — | 2026-11-17 | +| T27-09 | Obtain the maintainer's approval of the MVP v1 scope | P0 | BLOCKED | T27-07 | A decision record names the approved MVP scope, the date, and the approver | `grep -n 'Approved by' docs/decisions/00XX-*.md` | `RELEASE-ENGINEERING-PLAN.md` §1.1 recommends; approval does not exist | Maintainer decision required | — | +| T27-10 | Reconcile the release documentation against one scope authority | P1 | NOT STARTED | T27-03, T27-09 | T27, `docs/TASKS.md`, `docs/RELEASING.md`, `docs/TOOLCHAINS.md` cite the same scope authority and contain no stale CI claims | `grep -rn '0\.2\.5' docs/RELEASING.md docs/TOOLCHAINS.md docs/tasks/T27-cross-platform-release.md` | `docs/release/ARTIFACT-MATRIX.md` reconciled in this change | `docs/TASKS.md` is owned by another agent in this session | — | | T27-11 | Reproduce the PR #9 Aegis gate failure and enumerate the offending findings | P0 | IMPLEMENTED | — | The failure reproduces locally and the offending findings are enumerated with file and line | `aegis-0.6.3 --format json -c production scan . --baseline .aegis-baseline.json -q` | 5 new findings vs a 520-entry baseline (2026-11-08) — adjudicated in [decision 0074](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0074-aegis-content-keyed-baseline.md) | — | 2026-11-08 | | T27-12 | Adjudicate each of the 5 new Aegis findings | P0 | BUILD VERIFIED | T27-11 | Each finding is classified genuine defect or verified false positive, with a written reason | `aegis-0.6.3 --format json -c production scan . --baseline .aegis-baseline.json -q` | All five findings are adjudicated as verified false positives, each with a written reason in [`xtask/src/aegis.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/xtask/src/aegis.rs) `CLASS_NOTES` (`gdpr-personal-data`, `pci-cardholder-data`, `ssrf-localhost`, `zip-code`, `australian-tfn`). The baseline is content-keyed (decision 0074, commit `ad598a4`) and was re-blessed for the parity-matrix and slice-hotspot content (decisions 0083, 0084). The scan is the Aegis leg of the canonical gate and is green on the candidate heads. | — | 2026-11-12: adjudication reasons recorded in `xtask/src/aegis.rs` | | T27-13 | Fix genuine findings, suppress verified false positives narrowly, regenerate the baseline | P0 | BUILD VERIFIED | T27-12 | Genuine findings are fixed; verified false positives carry narrowly scoped documented suppressions; the baseline is regenerated; Aegis coverage is preserved | `aegis-0.6.3 --format json -c production scan . --baseline .aegis-baseline.json -q` | No finding was genuine. The 520-entry line-keyed `.aegis-baseline.json` was replaced by the content-keyed [`.aegis-baseline.tsv`](https://github.com/aliasfoxkde/FireCraft/blob/main/.aegis-baseline.tsv) ([decision 0074](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0074-aegis-content-keyed-baseline.md)) and re-blessed for new content (decisions 0083, 0084); the suppression stays narrow — a per-class reason, no disabled rule. The Aegis leg of the gate is green on `main` `e39705e` (check 131002941116) and on the candidate heads. | — | 2026-11-12: baseline regenerated; Aegis leg green in CI | | T27-14 | Get the GitHub backup CI green on PR #9 | P0 | BUILD VERIFIED | T27-13 | The `CI (backup)` `gate` job concludes SUCCESS on the PR head | `gh pr checks 9` | The Aegis failure that blocked the backup CI on PR #9 (runs `42401632606`, `42401626535`) was adjudicated and rebaselined (T27-12, T27-13, PR #18); the gate is green on `main` `e39705e` ([`fmt` 131002886797](https://github.com/aliasfoxkde/FireCraft/runs/131002886797), [`gate` 131002941116](https://github.com/aliasfoxkde/FireCraft/runs/131002941116)) and on every candidate head. PR #9 itself was closed unmerged, so its own runs remain a historical FAILURE and this row closes on the green gate, not on that PR's head. | — | 2026-11-12: gate green on `main` and the candidate heads | | T27-15 | Get the authoritative GitForge pipeline green on the same SHA | P0 | IN PROGRESS | T27-13 | The `firecraft-ci` pipeline concludes success on the same commit as T27-14 | GitForge API status call for the run id of the pushed SHA | GitForge runs exist for all six candidate heads, but the fleet has one online runner (`swarmone-docker`, capacity 4) and the candidate queue exceeds it, so the runs are still in flight. The fleet measurement and the two GitForge-side defects — a superseded run's running job keeps its runner slot, and the CLI has no cancel verb — are recorded in issue #126. No green GitForge run is claimed until the authoritative store reports `succeeded`. | the fleet's single online runner; T27-13 is closed | — | | T27-16 | Make the release path run the web bridge smoke with no skip | P0 | BUILD VERIFIED | T27-05 | The release path executes the bridge smoke; a skip exists only for non-release CI and is documented as such | `grep -n FIRECRAFT_DIST_SKIP_SMOKE .gitforge.yml .github/workflows/*.yml` | The row's premise was wrong and is corrected here. `FIRECRAFT_DIST_SKIP_SMOKE` appears nowhere in `.gitforge.yml` or the GitHub workflows on `main` (it survives only in [`xtask/src/dist.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/xtask/src/dist.rs) (line 52) as a comment, in the docs, and in issue #110), and `infrastructure/docker/ci-rust.Dockerfile:127` installs bookworm `chromium` for exactly this smoke. The smoke runs in CI: the GitForge `release` job logs `[xtask] dist web: 5 file(s), wasm 15573974 B (warning 25000000, hard ceiling 50000000), manifest MANIFEST.sha256, smoke green` and `[xtask] dist --web ok` — most recently job `ecb488d1-8965-443f-8309-71405883d754` for commit `fcfe6db1`, finished 2026-11-12T06:18:54Z, and 12 release jobs carry that line. | — | 2026-11-12: smoke green in the GitForge release job | -| T27-59 | Keep the execution board and the ticket ledger truthful as rows close | P1 | IMPLEMENTED | T27-07 | Every closed row carries a completion date and a cited evidence link; no row claims a status stronger than its evidence; the board's task-ID set and `docs/tasks/T27-*.md` stay in one-to-one correspondence | `bash scripts/verify_release_ledger.sh .` | the board's §6 table and the 62 ticket files now state the same status, evidence, blockers and completion date for every row; [`scripts/verify_release_ledger.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/verify_release_ledger.sh) reports `rows=62 tickets=62 problems=0`. The reconciliation is a tracked tool, not a one-off script: `scripts/reconcile_release_ledger.py` writes the board's cells into their tickets (the board is the only source of truth), and the verifier is the gate that keeps them in step. The verifier also refuses a closed row that cites no evidence link (NO LINK) — the board's acceptance criterion is a completion date *and* a cited evidence link, so every advanced row now carries one and the gate keeps it that way. The four rows whose verification cell carries an escaped pipe inside a code span — T27-08, T27-22, T27-41 and this one — keep the escape, so each row is ten cells and not eleven. | — | 2026-11-15: the board and its 61 tickets reconciled and the verifier landed with a CI step | -| T27-62 | Run the Aegis secret scan on documentation-only changes, in both CI systems | P1 | IMPLEMENTED | T27-24 | A documentation-only change is scanned by the Aegis leg in both CI systems; the scanner is installed from one script with one pinned checksum; no CI system skips the scan for a documentation-only diff | `scripts/validate_gitforge_pipeline.py .gitforge.yml && python3 scripts/validate_workflow_pins.py .github/workflows` | The defect and its fix are in [decision 0132](../decisions/0132-the-secret-scan-runs-on-documentation-changes.md). The scan covers `docs/`, but both CI systems ran it only for code changes: the GitHub `gate` job is gated on `code_changed` and its `docs-only-check` job validated whitespace only, and the GitForge pipeline had no Aegis job at all while every Cargo job carries a `skip_if` on `CI_CHANGE_INCLUDE_CODE`. PR #170's documentation-only merge therefore entered `main` with four unblessed Windows build literals, and the next code change's gate failed for content it never touched: on `main` `c26adffc` the `gate` job's Aegis leg reported 5 findings the baseline does not cover. The same defect is visible from the other CI system: PR #154 (`8067b53b`, the icon-resource survey) touches no file under `docs/tasks/`, and its GitForge run `fe161636` **succeeded** because the pipeline has no Aegis job to answer, while the GitHub `gate` job on the same SHA **failed** with the same 5 findings, every one of them in `docs/tasks/T27-41-windows-arm64-assessment.md`. The fix has three parts. `scripts/install-aegis.sh` is the single installer — one release URL, one SHA-256, one identity check (`aegis --help` must list the `scan` subcommand, because an unrelated tool also ships under the bare name `aegis`) — and it brings its own fetch, because the authoritative CI image ships no `curl` and no `wget`; the GitHub `gate` job's inline installer now calls it instead of carrying its own copy of the pin. The GitHub `docs-only-check` job installs Rust and the scanner and runs `cargo run --package xtask -- aegis`. The GitForge pipeline gains an `aegis` job with **no `skip_if`**, chained between `release-ledger` and `fmt-layers`, with its own cache directory. The pipeline definition validates (`scripts/validate_gitforge_pipeline.py`: 12 jobs, one root, no join) and the workflow's action pins validate. The fix is merged as PR #172 → `7bcf28fd`, and the scan has since run green on a documentation-only change in **both** systems: the GitForge `aegis` job has no `skip_if` and the GitHub `docs-only-check` job installs the scanner and runs it. | — | 2026-11-17 | +| T27-59 | Keep the execution board and the ticket ledger truthful as rows close | P1 | IMPLEMENTED | T27-07 | Every closed row carries a completion date and a cited evidence link; no row claims a status stronger than its evidence; the board's task-ID set and `docs/tasks/T27-*.md` stay in one-to-one correspondence | `bash scripts/verify_release_ledger.sh .` | the board's §6 table and the 61 ticket files now state the same status, evidence, blockers and completion date for every row; [`scripts/verify_release_ledger.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/verify_release_ledger.sh) reports `rows=61 tickets=61 problems=0`. The reconciliation is a tracked tool, not a one-off script: `scripts/reconcile_release_ledger.py` writes the board's cells into their tickets (the board is the only source of truth), and the verifier is the gate that keeps them in step. The verifier also refuses a closed row that cites no evidence link (NO LINK) — the board's acceptance criterion is a completion date *and* a cited evidence link, so every advanced row now carries one and the gate keeps it that way. The four rows whose verification cell carries an escaped pipe inside a code span — T27-08, T27-22, T27-41 and this one — keep the escape, so each row is ten cells and not eleven. | — | 2026-11-15: the board and its 61 tickets reconciled and the verifier landed with a CI step | ### RP-01 — Linux package completion | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| | T27-20 | Prove the DEB glibc-floor check fails on a too-low floor and passes on an adequate one | P0 | IN PROGRESS | T27-06 | The `objdump`-based floor check is demonstrated to reject a too-low declaration and accept an adequate one | `cargo run -p xtask -- dist --native` | `b63a040` added `verify_deb_glibc_floor`; control now floors `libc6 (>= 2.35)`; decision 0091 adds the run-time library set (`libx11-6`, `libxcursor1`, `libxrandr2`, `libxi6`, `libxkbcommon0`, `libxkbcommon-x11-0`, `libgl1`, `libgcc-s1`) with a build gate that refuses a control file that drops one | — | — | -| T27-21 | Build the DEB from the candidate commit, inspect its metadata, install it clean and run a CLI round trip | P0 | SMOKE TESTED | T27-20 | DEB builds from the candidate commit; `dpkg-deb --info/--contents` agree with the metadata; clean Debian 12 install plus CLI import→export round trip passes | `dpkg-deb --info dist/native/firecraft_0.2.5_amd64.deb && apt install ./firecraft_0.2.5_amd64.deb` | the DEB builds from the candidate commit inside the release workflow's Debian 12 container (`rust:1.99-slim-bookworm`), `dpkg-deb` reads the package back and the gate fails closed when the desktop entry or the icon is missing from it. The workflow's own package verification then ran against that package in a clean container and **all eight stages passed** (run 44188107435, `build artifacts` job, 2026-11-17T22:24:48Z → 22:25:14Z): install, desktop entry, icon, CLI, CLI document round trip, GUI launch under Xvfb, **upgrade**, uninstall and reinstall. The separate distro matrix installs the same bytes with `apt` on Ubuntu 24.04 and Debian 12 and passes stages 1–5, 7 and 8 ([LINUX-COMPAT.md](../release/LINUX-COMPAT.md)). The upgrade stage is exercised by the workflow's verification, which the matrix does not supply. | — | 2026-11-17: the workflow's eight-stage package verification passed on the rehearsal bytes | -| T27-22 | Verify DEB reinstall/remove/purge and ship a desktop entry and icon | P0 | IMPLEMENTED | T27-21 | Reinstall, remove and purge succeed with no user data lost; the package ships a desktop entry and an icon | `dpkg -l; dpkg -P; dpkg-deb --contents … \| grep -E 'desktop\|icons'` | The row's premise is fixed in the tree. `build_deb` stages the desktop entry and the icon from the in-tree originals — `usr/share/applications/firecraft.desktop` and `usr/share/icons/hicolor/256x256/apps/firecraft.png` (`xtask/src/dist.rs:973`) — and the gate reads the built package back with `dpkg-deb --contents` and fails closed when either is missing. **The exercise against the fixed package has not been run**: [`packaging/deb/verify-install.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/packaging/deb/verify-install.sh) carries the eight stages (install, desktop entry, icon, CLI, CLI document round trip, GUI launch, upgrade, uninstall, reinstall), and the recorded negative control is the *published* v0.2.3 package, which installs cleanly and then fails stage 2 — no desktop entry (audit §11.6). The defect is fixed. **The clean-container receipt against a package that carries the desktop entry now exists** (2026-11-17): the eight-stage run passes on Ubuntu 24.04.5 LTS and Debian 12 — stage 2 `PASS: desktop entry installs and names firecraft / firecraft`, `PASS: desktop-file-validate accepts the entry`; stage 3 `PASS: icon installed at /usr/share/icons/hicolor/256x256/apps/firecraft.png`; stage 7 `PASS: removal took the binaries, the desktop entry and the icon with it`; stage 8 `PASS: reinstall restored the payload and the CLI runs`. The row stays `IMPLEMENTED` rather than closing, because **purge is not separately exercised** — stage 7 is an uninstall, and no `dpkg -P` run is in the receipt. | purge (`dpkg -P`) is not exercised by the eight-stage script; a purge receipt is still outstanding | 2026-11-17: the clean-container eight-stage receipt exists on Ubuntu 24.04 and Debian 12 for a package that carries the desktop entry and the icon | +| T27-21 | Build the DEB from the candidate commit, inspect its metadata, install it clean and run a CLI round trip | P0 | IN PROGRESS | T27-20 | DEB builds from the candidate commit; `dpkg-deb --info/--contents` agree with the metadata; clean Debian 12 install plus CLI import→export round trip passes | `dpkg-deb --info dist/native/firecraft_0.2.5_amd64.deb && apt install ./firecraft_0.2.5_amd64.deb` | Prior clean-container smoke passed 2026-11-06 (matrix); the pipeline's DEB install verification ran stages 1–4b green on `4273471` (run `85502100`) and stage 5 (GUI launch) failed on the undeclared `libxkbcommon-x11-0` — decision 0091 declares the run-time set and the CI installs exactly it | Clean Debian 12 environment | — | +| T27-22 | Verify DEB reinstall/remove/purge and ship a desktop entry and icon | P0 | IMPLEMENTED | T27-21 | Reinstall, remove and purge succeed with no user data lost; the package ships a desktop entry and an icon | `dpkg -l; dpkg -P; dpkg-deb --contents … \| grep -E 'desktop\|icons'` | The row's premise is fixed in the tree. `build_deb` stages the desktop entry and the icon from the in-tree originals — `usr/share/applications/firecraft.desktop` and `usr/share/icons/hicolor/256x256/apps/firecraft.png` (`xtask/src/dist.rs:973`) — and the gate reads the built package back with `dpkg-deb --contents` and fails closed when either is missing. **The exercise against the fixed package has not been run**: [`packaging/deb/verify-install.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/packaging/deb/verify-install.sh) carries the eight stages (install, desktop entry, icon, CLI, CLI document round trip, GUI launch, upgrade, uninstall, reinstall), and the recorded negative control is the *published* v0.2.3 package, which installs cleanly and then fails stage 2 — no desktop entry (audit §11.6). The defect is fixed; the reinstall / remove / purge receipt against a package that carries the desktop entry does not exist. | the clean-container eight-stage run against a package built from the fixed tree (the CI image and a built .deb) | 2026-11-11: the desktop entry and the icon landed in the DEB payload (PR #107); the clean-container receipt is outstanding | | T27-26 | Build an actual AppImage with linuxdeploy | P1 | NOT STARTED | T27-06 | A real `.AppImage` is produced by a continuous linuxdeploy build (not extract-and-run) | `packaging/build-appimage.sh && ls -l dist/firecraft-*-linux-x86_64.AppImage` | `a4d74a0` fixed the missing `Icon=` blocker; a full re-run is still pending | linuxdeploy binary on the build host | — | | T27-27 | Inspect the built AppImage and launch it both ways | P1 | NOT STARTED | T27-26 | The image carries a desktop entry with `Icon=firecraft`, the icon file, executable bits and bundled libraries; it launches under FUSE and via `--appimage-extract-and-run` | `./firecraft-*-linux-x86_64.AppImage --appimage-extract-and-run` | — | FUSE availability on the host | — | | T27-28 | Functionally smoke the AppImage on a clean Linux host and record its checksum | P1 | NOT STARTED | T27-27 | Open → edit → save/export succeeds from the AppImage on a clean host; SHA-256 and receipt recorded | `sha256sum dist/firecraft-*-linux-x86_64.AppImage` | — | Clean host | — | | T27-29 | Build a Flatpak bundle from the manifest | P1 | NOT STARTED | T27-06 | `flatpak-builder` produces a `.flatpak` bundle from `dev.firecraft.FireCraft.yml` | `packaging/build-flatpak.sh && flatpak build-bundle` | Manifest is YAML-parse-checked by `dist --native`; never built | Flatpak SDK 24.08 absent on this fleet | — | | T27-30 | Install the Flatpak into a test installation and exercise it under the sandbox | P1 | NOT STARTED | T27-29 | The app installs into a test installation and runs via `flatpak run` (no unsupported `--repo`); document-portal open/save/export works; removal works; permissions are minimized and each is documented | `flatpak run dev.firecraft.FireCraft` | the manifest declares `--device=dri --share=ipc --socket=x11 --socket=wayland --socket=fallback-x11 --filesystem=xdg-documents --talk-name=org.freedesktop.portal.Desktop`; none of it has been exercised — the bundle has never been built (T27-29). | a Flatpak SDK/runtime host | — | | T27-31 | Re-validate the RPM deferral against current demand | P2 | IMPLEMENTED | T27-03 | Decision 0070 is re-checked and either retained or formally reinstated with a spec and recipe | `grep -n 'Status' docs/decisions/0070-rpm-deferred.md` | The deferral is re-checked against current demand and **retained**: no issue on the tracker asks for an RPM package (the only RPM mentions are this ledger's own rows), Fedora-family users are served by the tar.gz, and T27-33's second-distro-family check is a DEB/tar.gz exercise. The dated re-validation is recorded in [0070](../decisions/0070-rpm-deferred.md) and the matrix's RPM row cites it | — | 2026-11-16 | -| T27-32 | Assess a Linux aarch64 target | P2 | IMPLEMENTED | T27-04 | A written assessment covers the aarch64 toolchain, native dependencies and the packaging path | `rustup target list --installed` | The assessment is the ticket itself ([`docs/tasks/T27-32-linux-aarch64-assessment.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/tasks/T27-32-linux-aarch64-assessment.md)): the toolchain (Rust's aarch64 standard library is installed, but the host has no aarch64 C toolchain and the CI image carries only the wasm target), the native stack (the default build is pure Rust — X11, Wayland and OpenGL are all loaded at run time, and the one C library, `libwebp-sys`, sits behind a non-default feature), the packaging path (the x86_64-pinned artifact names, the DEB's `Architecture` field, and the AppImage and Flatpak output names), the CI cost (one cross-build job plus one image revision), and the verdict **feasible-later**: no code port is needed, but the artifact cannot rise above a build receipt without an ARM64 test environment. Nothing has been cross-built or run on aarch64. | — | 2026-11-16: assessment written | -| T27-33 | Test the DEB and tar.gz on a second distro family and check X11/Wayland, desktop integration and fonts | P1 | SMOKE TESTED | T27-21 | The DEB and tar.gz install and launch on Ubuntu and on a Fedora-family image; X11 and Wayland, desktop integration, and font/resource loading are each checked | `scripts/release-matrix.sh dist/native` | Six cells, all passing, on 2026-11-17: Ubuntu 24.04.5 LTS, Debian 12 (bookworm) and Fedora 45, each under X11 and under Wayland. The DEB installs with apt on both Debian-family cells and passes the repository's own eight-stage package verification — metadata, desktop entry accepted by `desktop-file-validate`, icon installed, CLI, CLI document round trip (`firecraft-cli export` writes a 97 B PNG with the signature `89504e470d0a1a0a`), GUI launch under Xvfb with exit 124, uninstall and reinstall. The desktop tar.gz launches on all six cells and `fc-list` enumerates fonts on every cell. The harness is in-tree: `packaging/linux/leg-debian-family.sh`, `packaging/linux/leg-fedora-family.sh`, `packaging/linux/leg-wayland.sh` and [`scripts/release-matrix.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/release-matrix.sh). The Fedora cells record that a `.deb` is not that family's package format, so the tar.gz is the artifact under test there. The results are published in [LINUX-COMPAT.md](LINUX-COMPAT.md). | — | 2026-11-17: six-cell matrix green on Ubuntu 24.04, Debian 12 and Fedora 45 | -| T27-34 | Publish a Linux platform compatibility table | P1 | IMPLEMENTED | T27-33 | A published table lists every tested distro/arch and every untested gap | `test -f docs/release/LINUX-COMPAT.md` | [LINUX-COMPAT.md](LINUX-COMPAT.md) is published and linked from `docs/release/ARTIFACT-MATRIX.md`. It lists the three tested distributions with their versions and architecture, the artifact under test in each cell with its bytes and SHA-256, the formats with no tested row (AppImage and Flatpak — never built; RPM — deferred), and the untested combinations explicitly: every other distribution and release, every architecture but x86_64, real GPUs and vendor drivers, real desktop sessions, session-level desktop integration, the DEB's upgrade path, and the published v0.2.5 assets. | — | 2026-11-17: table published and linked | +| T27-32 | Assess a Linux aarch64 target | P2 | NOT STARTED | T27-04 | A written assessment covers the aarch64 toolchain, native dependencies and the packaging path | `rustup target list --installed` | Matrix records aarch64 as "unassessed" | — | — | +| T27-33 | Test the DEB and tar.gz on a second distro family and check X11/Wayland, desktop integration and fonts | P1 | NOT STARTED | T27-21 | The DEB and tar.gz install and launch on Ubuntu and on a Fedora-family image; X11 and Wayland, desktop integration, and font/resource loading are each checked | `docker run bash -lc 'apt install ./firecraft_*.deb && firecraft --version'` | only Debian 12 has been exercised for the DEB — the rehearsal receipt `docs/release/RECEIPT-0.2.5-DRYRUN-3.md` records the Debian-family DEB build; no Fedora-family image exists on this fleet. | no Fedora-family image is available locally | — | +| T27-34 | Publish a Linux platform compatibility table | P1 | NOT STARTED | T27-33 | A published table lists every tested distro/arch and every untested gap | `test -f docs/release/LINUX-COMPAT.md` | none yet. | T27-33 | — | ### RP-02 — Windows packaging and verification @@ -224,27 +223,27 @@ condition/verification. **RP** is the release-plan work package the row belongs | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| | T27-46 | Re-read the Android feasibility report and record the gate decision | P2 | IMPLEMENTED | T27-04 | The report is re-read against the current dependency graph and a written approve/defer decision is recorded | `test -f docs/research/android-feasibility.md` | The report is re-read against the current lockfile (every pinned version unchanged: eframe 0.36.2, egui 0.36.2, winit 0.30.13, android-activity 0.6.1, glow 0.17.0, glutin 0.32.3, boa_engine 0.20.0) and the accesskit + `android-native-activity` conflict is re-confirmed in the vendored `eframe-0.36.2/src/lib.rs:148–153`; the gate decision is recorded in [0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — defer the port, keep Android experimental | — | 2026-11-16 | -| T27-47 | Implement and device-test the native Android port (only if the gate approves) | P2 | DEFERRED | T27-46 | A native entrypoint, lifecycle handling, SAF document picker and touch mapping exist; an `arm64-v8a` APK installs on a physical ARM64 device and passes import → edit → export | `adb install && adb shell am start -n dev.firecraft.FireCraft/.MainActivity` | Closed with the deferral: [decision 0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — the stack is sound (no crate on the critical path blocks `aarch64-linux-android`), but this fleet has no NDK/SDK CI image and no physical ARM64 device, so the port cannot be exercised and no support is claimed | an Android SDK/NDK CI image; a physical ARM64 device reachable with `adb` | 2026-11-16: deferred by decision 0121 | +| T27-47 | Implement and device-test the native Android port (only if the gate approves) | P2 | DEFERRED | T27-46 | A native entrypoint, lifecycle handling, SAF document picker and touch mapping exist; an `arm64-v8a` APK installs on a physical ARM64 device and passes import → edit → export | `adb install && adb shell am start -n dev.firecraft.FireCraft/.MainActivity` | Closed with the deferral: [decision 0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — the stack is sound (no crate on the critical path blocks `aarch64-linux-android`), but this fleet has no NDK/SDK CI image and no physical ARM64 device, so the port cannot be exercised and no support is claimed | an Android SDK/NDK CI image; a physical ARM64 device reachable with `adb` | — | ### RP-05 — Web, CLI, source archives and production deployment | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| | T27-48 | Build the web bundle from the exact tag SHA and record its manifest | P0 | BUILD VERIFIED | T27-06 | The bundle builds from the tag SHA, the WASM is optimized and under the 21.5 MB ceiling, the version is stamped, and a manifest plus per-file hashes are recorded | `cargo run -p xtask -- dist --web && (cd dist/web && sha256sum -c MANIFEST.sha256)` | The bundle was built from the tag's commit and published with its manifest: the rehearsal's `build artifacts` job (run 42937560976, head SHA `384687f`) ran `dist --web` successfully and published `firecraft-web-0.2.5-dryrun.3.zip` (7,394,859 B, sha256 `57054d06…`) with `MANIFEST.sha256` (425 B, sha256 `e71ce485…`); the release-wide list covers the ZIP and the manifest verifies with `sha256sum -c`. Receipt: [`docs/release/RECEIPT-0.2.5-DRYRUN-3.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/RECEIPT-0.2.5-DRYRUN-3.md). The WASM is stamped and inside the budget — the GitForge release job for `fcfe6db1` logged `wasm 15573974 B (warning 25000000, hard ceiling 50000000)`, 5 files. | — | 2026-11-12: the rehearsal published the web bundle and its manifest | -| T27-49 | Run the bridge smoke against the release bytes with no skip | P0 | SMOKE TESTED | T27-48 | The release bytes complete an open → apply → exportPng → exportDocument round trip in headless Chromium, with the smoke not skipped | `cargo run -p xtask -- dist --web` (bridge smoke stage) | the smoke runs and is not skipped. `dist --web` calls `smoke_bridge`, the release workflow installs headless Chrome and fails closed without it, and `FIRECRAFT_DIST_SKIP_SMOKE` appears nowhere in `.gitforge.yml` or the GitHub workflows — only as a comment at `xtask/src/dist.rs:52`. The rehearsal's `build artifacts` job (run 44188107435) built the bundle and ran the smoke against it: the job log reads `[xtask] dist web: 7 file(s), wasm 15780814 B …, smoke green` and `[xtask] dist --web ok` at 2026-11-17T22:31:41Z. The GitForge `release` job logs the same line for the mirror builds. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). | — | 2026-11-17: the smoke ran green against the rehearsal's bundle (run 44188107435) | -| T27-50 | Reconcile the production Pages deployment against the release bundle | P0 | SMOKE TESTED | T27-48 | The Pages project, deployment id, deployed asset inventory and per-file hashes are compared to the tagged bundle, and the result is written as a machine-readable report | `curl -s https://firecraft-web.pages.dev/MANIFEST.sha256` | the comparison is a tracked tool and a machine-readable report. `scripts/reconcile_deployment.py` fetches the deployment's `MANIFEST.sha256` and every file it names, hashes the bytes it actually received, and compares them file by file with the bundle's manifest; `scripts/reconcile_deployment-selftest.py` covers the four ways the two can disagree. The report against the live deployment is [`docs/release/DEPLOYMENT-RECONCILIATION.json`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/DEPLOYMENT-RECONCILIATION.json) and its result is `differences`: the live deployment serves bundle `2274ac8c2925b61d` while the v0.2.5 release asset carries `f9dbe2f14305b2d9`, each asset name appearing only on its own side of the inventory; `appinfo.json` matches, and `index.html` and `host.html` differ only by the substituted asset names, their integrity digests and the Pages analytics beacon. **Re-verified 2026-11-17**: the deployment's manifest digest is unchanged at `61e3aeda…` and the comparison against the rehearsal's web bundle reports eight differences — the live bundle has not moved and still corresponds to no identifiable release. | no `CLOUDFLARE_API_TOKEN`; the deploy step in `release.yml` is commented out — a deployment that names a commit stays maintainer-gated (B-11, B-12) | 2026-11-17: the comparison re-run; the live deployment is unchanged and unreconciled | -| T27-51 | Build and verify the standalone CLI archive | P0 | SMOKE TESTED | T27-06 | The CLI archive builds from the candidate commit; architecture, `--version`/`--help`, an import→export round trip, clean extraction and the checksum all verify | `firecraft-cli --version && firecraft-cli import … && firecraft-cli export …` | the rehearsal published `firecraft-cli-0.2.5-linux-x86_64.tar.gz` (8,158,124 B, sha256 `953633e4…`) as a draft asset (run 44188107435). The archive was downloaded from the draft, re-hashed locally (the digest matches the API's) and extracted, and **the extracted binary attests its own build**: `firecraft-cli --version` prints `firecraft-cli 0.2.5` and exits 0. The distro matrix runs the CLI on all six cells ([LINUX-COMPAT.md](../release/LINUX-COMPAT.md)). The archive is byte-identical across two independent rehearsals. | — | 2026-11-17: the published CLI archive attests its own version | -| T27-52 | Generate the source archive from the exact tagged commit and clean-build it | P0 | SMOKE TESTED | T27-06 | The archive is generated from the tag SHA, contains the sources, licenses and build inputs, excludes build outputs and secrets, and a clean extraction runs `cargo metadata --locked` and `cargo build --locked` | `cargo run -p xtask -- dist --source` | the generator is implemented and wired into `release.yml`, and the defect the rehearsal-3 archive exposed — a lockfile whose dependency references did not name the stamped version — was fixed by the `xtask stamp` verb and the `xtask stamps` drift gate. The rehearsal published `firecraft-0.2.5-source.tar.gz` (3,176,024 B, sha256 `0cbee184…`); the workflow's own step reported `clean-extract + cargo metadata --locked verified`, and the archive was then downloaded from the draft and extracted on a **second host**: `cargo metadata --locked` succeeds and `cargo build --locked` finished the dev profile in 53.78s on cargo 1.99.1. The archive's only `.claude/` entry is `.allow_config_edits` — the scratch helper that rehearsal 5 published (`c396b18a`) is gone. The source archive is generated from the tagged commit, carries the sources, the licences and the build inputs, and excludes build outputs and secrets. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). | — | 2026-11-17: the published source archive clean-builds on a second host | +| T27-49 | Run the bridge smoke against the release bytes with no skip | P0 | BUILD VERIFIED | T27-48 | The release bytes complete an open → apply → exportPng → exportDocument round trip in headless Chromium, with the smoke not skipped | `cargo run -p xtask -- dist --web` (bridge smoke stage) | The smoke runs and is not skipped. `dist --web` calls `smoke_bridge` ([`xtask/src/dist.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/xtask/src/dist.rs), line 65), the release workflow installs headless Chrome and fails closed without it (`.github/workflows/release.yml:106`), and `FIRECRAFT_DIST_SKIP_SMOKE` appears nowhere in `.gitforge.yml` or the GitHub workflows — only as a comment at `xtask/src/dist.rs:52`. The rehearsal's `build artifacts` job (run 42937560976) therefore ran the smoke against the tagged bundle and succeeded, and the GitForge release job logs `… smoke green` and `[xtask] dist --web ok` — most recently job `ecb488d1-8965-443f-8309-71405883d754` for commit `fcfe6db1`, finished 2026-11-12T06:18:54Z; twelve release jobs carry that line. | — | 2026-11-12: the bridge smoke ran green against the built bundle | +| T27-50 | Reconcile the production Pages deployment against the release bundle | P0 | IMPLEMENTED | T27-48 | The Pages project, deployment id, deployed asset inventory and per-file hashes are compared to the tagged bundle, and the result is written as a machine-readable report | `curl -s https://firecraft-web.pages.dev/MANIFEST.sha256` | the comparison is a tracked tool and a machine-readable report. [`scripts/reconcile_deployment.py`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/reconcile_deployment.py) fetches the deployment's `MANIFEST.sha256` and every file it names, hashes the bytes it actually received, and compares them file by file with the bundle's manifest; [`scripts/reconcile_deployment-selftest.py`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/reconcile_deployment-selftest.py) covers the four ways the two can disagree — identical, changed bytes, a deployment-only file, and a bundle file the deployment does not serve. The report against the live deployment is [`docs/release/DEPLOYMENT-RECONCILIATION.json`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/DEPLOYMENT-RECONCILIATION.json) and its result is `differences`: the live deployment serves bundle `2274ac8c2925b61d` while the v0.2.5 release asset carries `f9dbe2f14305b2d9`, each asset name appearing only on its own side of the inventory; `appinfo.json` matches, and `index.html` and `host.html` differ only by the substituted asset names, their integrity digests and the Pages analytics beacon. This confirms the earlier hand comparison (PR #127, `8d5c442`) in machine-readable form: the live deployment corresponds to no identifiable release (blockers B-6, B-11, B-12). | no `CLOUDFLARE_API_TOKEN`; the deploy step in `release.yml` is commented out — a deployment that names a commit stays maintainer-gated | 2026-11-16: the comparison landed as a tracked tool and a machine-readable report | +| T27-51 | Build and verify the standalone CLI archive | P0 | IN PROGRESS | T27-06 | The CLI archive builds from the candidate commit; architecture, `--version`/`--help`, an import→export round trip, clean extraction and the checksum all verify | `firecraft-cli --version && firecraft-cli import … && firecraft-cli export …` | the matrix records the CLI tar.gz as built and manifested; rehearsal `v0.2.5-dryrun.3` (run 42937560976) published `firecraft-cli-0.2.5-dryrun.3-linux-x86_64.tar.gz` (8,109,224 B, sha256 `f646feea…`) as a draft asset and the extracted binary launches. **The archive cannot attest its own build**: the CLI had no `--version`, so the receipt had nothing to say which build it was. `firecraft-cli --version` now prints the stamped version — the archive must be rebuilt for this row to close. | — | 2026-11-11: rehearsal receipt written; the rebuilt archive is outstanding | +| T27-52 | Generate the source archive from the exact tagged commit and clean-build it | P0 | IN PROGRESS | T27-06 | The archive is generated from the tag SHA, contains the sources, licenses and build inputs, excludes build outputs and secrets, and a clean extraction runs `cargo metadata --locked` and `cargo build --locked` | `cargo run -p xtask -- dist --source` | the generator is implemented and wired into `release.yml`; **exercised — and it failed**. The rehearsal's archive (`FireCraft-0.2.5-dryrun.3-source.tar.gz`, asset 733682287) was downloaded from the draft and extracted: `cargo metadata --locked` exits **101** ("cannot update the lock file … because --locked was passed to prevent this"). The manifests are stamped; the lock's dependency *references* and the path dependency's version requirement were not. Fixed by the `xtask stamp` verb and the `xtask stamps` drift gate; the row closes when a rebuilt archive clean-builds. | — | 2026-11-11: defect reproduced from the published bytes; fix implemented, verification outstanding | ### RP-06 — Supply-chain metadata, provenance, signing, workflow hardening | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| -| T27-53 | Define canonical asset naming and generate every checksum and the release-wide list | P0 | SMOKE TESTED | T27-06 | Asset naming is canonical; every asset has a SHA-256; one release-wide checksum list covers every published file | `cd dist && sha256sum -c RELEASE_SHA256.txt` | [`release.yml`](https://github.com/aliasfoxkde/FireCraft/blob/main/.github/workflows/release.yml) generates `RELEASE_SHA256.txt` for 7 files and names each file explicitly, because the globs over-match. The naming defect the rehearsal-3 receipt found is closed: every published asset now carries the lowercase canonical name (`firecraft-0.2.5-source.tar.gz`, not `FireCraft-…`). The rehearsal published the list (664 B, sha256 `af054b99…`); downloaded from the draft, its 7 entries match the API digests of the 7 assets it covers — 7/7. The list does not cover itself and does not cover the manifest, which is why it holds seven entries for nine assets. The native `MANIFEST.sha256` is byte-identical across two rehearsals. | — | 2026-11-17: the checksum list verified 7/7 against the rehearsal's published digests | -| T27-54 | Generate and verify a machine-readable release manifest | P0 | SMOKE TESTED | T27-53 | `release-manifest.json` carries version, tag, source SHA, target triple, format, size, SHA-256, run URL and verification status; missing and corrupted assets are rejected | `jq -r '.version,.artifacts[0].sha256' dist/release-manifest.json` | `xtask dist --manifest` writes `dist/release-manifest.json` (schema `firecraft.release-manifest/1`) with one entry per published artifact — canonical name, path, size, SHA-256, format, target triple and verification status — plus the run's version, **tag**, source revision, **run URL** and timestamp; `dist --verify-manifest` re-checks it against the files. The rehearsal published the manifest (3,295 B, sha256 `54b8a231…`) and the workflow's aggregate gate validated it against the downloaded assets. **The manifest names its tag and its run**: `tag` `v0.2.5-dryrun.6`, `source_sha` `c396b18afba0a…`, `run_url` `https://github.com/aliasfoxkde/FireCraft/actions/runs/44188107435`, `run_id` `44188107435`, `built_at` `2026-11-17T22:31:44Z`, 8 artifact entries. Both gaps that made that impossible were closed first — the caller now states the tag and `xtask` fails closed when the stated tag does not name the workspace version, and the run URL is reconstructed from `GITHUB_SERVER_URL`, `GITHUB_REPOSITORY` and `GITHUB_RUN_ID` because GitHub Actions exports no `GITHUB_RUN_URL`. | — | 2026-11-17: a published manifest that names its tag and its run | -| T27-55 | Regenerate and validate the CycloneDX SBOM | P0 | SMOKE TESTED | T27-06 | The SBOM regenerates from the locked graph, validates against the CycloneDX schema, and is compared component-by-component against `Cargo.lock`; it is published and the download is verified | `cargo run -p xtask -- dist --sbom && jq .metadata.component dist/sbom/firecraft-0.2.5-sbom.cdx.json` | the CycloneDX 1.5 schema and the SPDX sibling it points at are vendored under `xtask/schema/`, and `xtask dist --sbom` validates the document it builds against them *before* writing it and compares its component inventory with `Cargo.lock`'s `[[package]]` sections, naming both sides of any difference (decision [0119](../decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)). The inventory is the lockfile's own, not a resolved graph, so the two pinned-but-unlinked packages are listed as components with an empty dependency edge. The rehearsal published the SBOM (369,745 B, sha256 `e50516b2…`): the workflow's step reported `562 components, 562 locked package(s), schema-valid`, and the aggregate gate validated the download. Two independent rehearsals' SBOMs are identical in every field except `metadata.timestamp` — same components, same dependency graph, same serial number. | — | 2026-11-17: the validated SBOM published and verified | +| T27-53 | Define canonical asset naming and generate every checksum and the release-wide list | P0 | SMOKE TESTED | T27-06 | Asset naming is canonical; every asset has a SHA-256; one release-wide checksum list covers every published file | `cd dist && sha256sum -c RELEASE_SHA256.txt` | [`release.yml`](https://github.com/aliasfoxkde/FireCraft/blob/main/.github/workflows/release.yml) generates `RELEASE_SHA256.txt` for 7 files (no provenance/signature files). The rehearsal published it (718 B, sha256 `6ae766e7…`); downloaded from the draft, its 7 entries match the API digests of the 7 assets it covers — 7/7. **Naming is not yet canonical**: the source archive still ships as `FireCraft--source.tar.gz` while every other asset is lowercase; the rename to `firecraft--source.tar.gz` is implemented and lands with this row's next rebuild | — | 2026-11-11: checksum list verified against the published digests (rehearsal `v0.2.5-dryrun.3`) | +| T27-54 | Generate and verify a machine-readable release manifest | P0 | BUILD VERIFIED | T27-53 | `release-manifest.json` carries version, tag, source SHA, target triple, format, size, SHA-256, run URL and verification status; missing and corrupted assets are rejected | `jq -r '.version,.artifacts[0].sha256' dist/release-manifest.json` | implemented on `feat/release-manifest` (PR #106, merged in the train as `658f015`) per [decision 0089](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0089-release-manifest-shape.md): `xtask dist --manifest` writes `dist/release-manifest.json` (schema `firecraft.release-manifest/1`) for the eight published assets — canonical name, path, size, SHA-256, format, target triple and verification status — plus the run's version, tag, source revision, run URL and timestamp; `dist --verify-manifest` re-checks it against the files; `release.yml` publishes it as a ninth asset and validates it against the downloads. Unit tests cover the shape, the determinism and every rejection path. **No CI receipt and no published manifest yet** — the row closes when a rehearsal publishes one. | T27-53's canonical naming is still `NOT STARTED`; the manifest adopts the names the release already enforces, and its asset table moves with T27-53 (decision 0089) | 2026-11-11: implementation merged (PR #106 → #107) | +| T27-55 | Regenerate and validate the CycloneDX SBOM | P0 | BUILD VERIFIED | T27-06 | The SBOM regenerates from the locked graph, validates against the CycloneDX schema, and is compared component-by-component against `Cargo.lock`; it is published and the download is verified | `cargo run -p xtask -- dist --sbom && jq .metadata.component dist/sbom/firecraft-0.2.5-sbom.cdx.json` | the CycloneDX 1.5 schema and the SPDX sibling it points at are vendored under `xtask/schema/`, and `xtask dist --sbom` validates the document it builds against them *before* writing it and compares its component inventory with `Cargo.lock`'s `[[package]]` sections, naming both sides of any difference (decision [0119](../decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)). The validator refuses a schema that uses a keyword it does not implement, so a partial implementation cannot report a bad document as valid. The generator's licence field was wrong for every crate whose licence is an SPDX expression — `MIT OR Apache-2.0` is an expression, not an identifier — and the identifier list is now read from the schema itself. **Outstanding**: publishing the newly validated SBOM and verifying the download belongs to the next release rehearsal | — | 2026-11-16: schema validation and the `Cargo.lock` comparison implemented and verified | | T27-56 | Generate and independently verify build provenance | P1 | NOT STARTED | T27-53 | A provenance format is defined; each attestation binds an artifact digest to the source SHA, workflow and runner; attestations verify independently | `gh attestation verify --repo aliasfoxkde/FireCraft` | not implemented — provenance is listed as "planned" in the artifact matrix, and no signing or attestation identity is configured. | T27-53; an attestation identity must exist | — | -| T27-57 | Harden the release workflows | P1 | SMOKE TESTED | T27-18 | Third-party actions are pinned to full commit SHAs; permissions are least-privilege; build, sign and publish are separate; all artifacts bind to one tag SHA; the gate fails on missing outputs, version mismatch, checksum mismatch, unexpected extra artifacts and a skipped required platform; a safe test-release mode exists; the toolchain is pinned to the compiler the gate's floors were measured with | `python3 scripts/validate_workflow_pins.py .github/workflows`; `bash scripts/validate_workflow_pins-selftest.sh`; `bash scripts/classify_release_mode-selftest.sh`; `bash scripts/validate_release_aggregate-selftest.sh`; `bash tests/release-assets-selftest.sh` | the pinning, the least-privilege permissions, the fail-closed aggregate gate, the release-mode classifier and the pinned toolchain are all in place and tested (decisions [0099](../decisions/0099-workflow-actions-are-pinned.md), [0100](../decisions/0100-release-mode-classification-and-a-tested-release-gate.md), [0102](../decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md)). **The remaining criterion is met**: the rehearsal path has now been run end to end through `workflow_dispatch` — twice, on runs 44185273916 (`v0.2.5-dryrun.5`) and 44188107435 (`v0.2.5-dryrun.6`), both `completed`/`success`, each producing a `TEST`-titled prerelease draft with the do-not-publish banner, each classified as a rehearsal by `scripts/classify_release_mode.sh`, each passing the aggregate gate. A manual run may only rehearse, and the rehearsal's artifacts are bound to one tag SHA. | — | 2026-11-17: the rehearsal path ran end to end through `workflow_dispatch` | +| T27-57 | Harden the release workflows | P1 | BUILD VERIFIED | T27-18 | Third-party actions are pinned to full commit SHAs; permissions are least-privilege; build, sign and publish are separate; all artifacts bind to one tag SHA; the gate fails on missing outputs, version mismatch, checksum mismatch, unexpected extra artifacts and a skipped required platform; a safe test-release mode exists; the toolchain is pinned to the compiler the gate's floors were measured with | `python3 scripts/validate_workflow_pins.py .github/workflows`; `bash scripts/validate_workflow_pins-selftest.sh`; `bash scripts/classify_release_mode-selftest.sh`; `bash scripts/validate_release_aggregate-selftest.sh`; `bash tests/release-assets-selftest.sh` | **Pinning implemented 2026-11-11** (decision [0099](../decisions/0099-workflow-actions-are-pinned.md)): all 19 action references in `ci.yml`, `release.yml` and `deploy-site.yml` name a 40-hex commit SHA with the version in a trailing comment; `scripts/validate_workflow_pins.py` fails the CI on an unpinned reference, and `scripts/validate_workflow_pins-selftest.sh` demonstrates each failure mode with one deliberately broken input. Least-privilege permissions were already declared (`contents: read` at workflow level, `contents: write` only for the draft-release job) and the aggregate gate already fails closed on a missing, empty, misnamed or digest-mismatched artifact. The deploy trigger no longer includes the workflow's own file, so a workflow edit is not a production publication. **Both remaining criteria implemented 2026-11-12** (decision [0100](../decisions/0100-release-mode-classification-and-a-tested-release-gate.md)): the aggregate gate moved out of inline YAML into `scripts/validate_release_aggregate.sh`, which now also rejects an artifact the release does not publish and requires every required platform (`x86_64-unknown-linux-gnu`, `wasm32-unknown-unknown`) to be represented in the release manifest; `scripts/validate_release_aggregate-selftest.sh` breaks a complete artifact set one thing at a time — missing, empty, extra artifact, checksum mismatch, manifest version mismatch, manifest digest mismatch, an unlisted asset, an unknown schema, a skipped platform, and a platform the manifest does not represent. A safe test-release mode exists: `scripts/classify_release_mode.sh` maps `vX.Y.Z` to production and `vX.Y.Z-dryrun.N` to a rehearsal and refuses every other shape; a manual `workflow_dispatch` run may only rehearse; a rehearsal release is a prerelease titled `TEST ` whose notes carry a do-not-publish banner, and its disposable tag is created at the commit that built the artifacts. `scripts/classify_release_mode-selftest.sh` demonstrates each refused shape, and `tests/release-assets-selftest.sh` drives the `gh` argument vector against a stub. **Toolchain pinned 2026-11-12** (decision [0102](../decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md)): the workflows install `toolchain: 1.99.1` and the CI image is `rust:1.99.1-slim-bookworm`, because the unpinned `stable` moved the coverage floor silently — rustc 1.100.0 measures a byte-identical Rust tree at 77.0%/76.1% where 1.99.1 measures 81.9%/78.9%, while the GitForge image stayed on 1.99. The gate now names the compiler that measured it. **Outstanding**: the rehearsal path has not been run end to end through `workflow_dispatch` (it needs this workflow on `main`); the manual rehearsal in issue #99 predates the `TEST` title and the prerelease flag | — | 2026-11-12: `gate` green on head `002eb56` (PR #130, merged 2026-11-12) | ### RP-07 — Release aggregation and publication @@ -252,23 +251,23 @@ condition/verification. **RP** is the release-plan work package the row belongs |---|---|---|---|---|---|---|---|---|---| | T27-17 | Replace the invalid `gh release create` asset arguments | P0 | BUILD VERIFIED | T27-03 | Assets are passed as positional filenames; the invocation is tested for missing, duplicate and space-containing filenames | `gh release create --help` | [`release.yml`](https://github.com/aliasfoxkde/FireCraft/blob/main/.github/workflows/release.yml) used `assets+=(-a "$f")`; `gh release create` has no `-a` flag in gh 2.46 — assets are positional `[...]`. **Fixed and exercised**: the rehearsal's `create draft release` job (run 42937560976) succeeded and the draft carries 8 uploaded assets, so the positional invocation works against the real CLI. | — | 2026-11-11: rehearsal `v0.2.5-dryrun.3`, run 42937560976 | | T27-18 | Scope release permissions and verify the draft-to-published transition | P0 | IN PROGRESS | T27-17 | `contents: write` exists only on the publishing job; a draft is created, assets are uploaded, post-upload digests are validated, and the draft transitions to published | `grep -n 'permissions:' -A3 .github/workflows/release.yml` | `release.yml` build job `contents: read`, release job `contents: write` — compliant. **Half exercised**: the rehearsal created a draft with 8 uploaded assets and validated the digests, and the draft is still `draft: true` / `published_at: null`. The draft-to-published transition is untested because publishing is a maintainer-only act (campaign §20). | maintainer approval for a published release | 2026-11-11: draft creation and digest validation verified (run 42937560976); the published transition awaits authorization | -| T27-19 | Exercise the whole draft-release flow on a disposable test tag | P0 | SMOKE TESTED | T27-17, T27-18 | A disposable (non-production) tag produces a draft release whose assets download and match `RELEASE_SHA256.txt` | `gh release download --dir artifacts && (cd artifacts && sha256sum -c RELEASE_SHA256.txt)` | the disposable tag `v0.2.5-dryrun.6` → commit `c396b18afba0a…` produced draft release 449279892 with 9 assets, all `state: uploaded`; the draft is `draft: true`, `prerelease: true`, titled `TEST 0.2.5-dryrun.6`, with `published_at: null`. The downloaded `RELEASE_SHA256.txt` matches the API digests of all 7 assets it covers, and the source archive, the checksum list and the manifest were each re-hashed locally — 3 of 3 match. The tag is **lightweight** (`GET /git/ref/tags/…` reports an object of type `commit` and `GET /git/tags/…` answers 404), so it carries no message of its own; the rehearsal's do-not-publish intent lives in the draft state, the `TEST` title and the notes banner. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). The row's own removal step was carried out on 2026-11-16 for the rehearsal-3 artifacts (the releases API answered 404 for draft 441136236 and for the tag `v0.2.5-dryrun`); **the three later rehearsals are still on the remote** — drafts 449261624 (`v0.2.5-dryrun.5`) and 449279892 (`v0.2.5-dryrun.6`), the rehearsal-4 draft, and their three disposable tags. | the removal of the rehearsal-4, -5 and -6 drafts and tags is outstanding and stays maintainer-gated, as the rehearsal-3 removal was | 2026-11-17: rehearsal `v0.2.5-dryrun.6`, run 44188107435, draft 449279892 | +| T27-19 | Exercise the whole draft-release flow on a disposable test tag | P0 | SMOKE TESTED | T27-17, T27-18 | A disposable (non-production) tag produces a draft release whose assets download and match `RELEASE_SHA256.txt` | `gh release download --dir artifacts && (cd artifacts && sha256sum -c RELEASE_SHA256.txt)` | the disposable tag `v0.2.5-dryrun.3` → annotated tag `9009d404…` → commit `384687f…` ("Disposable rehearsal tag (not a release)") produced draft release 441136236 with 8 assets, all `state: uploaded`. The downloaded `RELEASE_SHA256.txt` matches the API digests of all 7 assets it covers. The source archive was downloaded and extracted too — and it does **not** clean-build (T27-52). Receipt: [RECEIPT-0.2.5-DRYRUN-3.md](../release/RECEIPT-0.2.5-DRYRUN-3.md). The row's own removal step — deleting the draft release and the three disposable `v0.2.5-dryrun.*` tags — is outstanding: it is a remote deletion that needs maintainer authorization (issue #99). | removal of the draft release and the three disposable `v0.2.5-dryrun.*` tags needs maintainer authorization (issue #99) | 2026-11-11: rehearsal `v0.2.5-dryrun.3`, run 42937560976 | | T27-58 | Make the aggregator fail closed on every invalid artifact shape | P0 | BUILD VERIFIED | T27-17 | The aggregator rejects missing, mislabeled, empty, duplicate, wrong-version, wrong-commit and checksum-mismatched artifacts, and fails when a required platform job was skipped | `bash scripts/validate_release_aggregate-selftest.sh` | `8fc3694` added fail-closed aggregate validation; rehearsed locally negative and positive. **The positive path now runs for real**: the rehearsal's `create draft release` job validated all nine required artifacts, ran `sha256sum -c RELEASE_SHA256.txt`, checked the release manifest against the downloaded assets and every asset name against the tag version, then created the draft (run 42937560976). **2026-11-12**: the aggregator moved into [`scripts/validate_release_aggregate.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/validate_release_aggregate.sh) and is now exercised by `scripts/validate_release_aggregate-selftest.sh`, which breaks a complete artifact set one thing at a time — a missing artifact, an empty artifact, an unexpected extra artifact, a checksum mismatch, a manifest version mismatch, a manifest digest mismatch, an asset the manifest does not list, an unknown manifest schema, a skipped required platform, and a platform the manifest does not represent. The last is the discriminating case for the platform check: every artifact is present and every digest agrees, and the gate still fails | — | 2026-11-12: every failure mode demonstrated with one deliberately broken input | ### RP-08 — Final certification | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| -| T27-60 | Produce the release certification report for the approved scope | P0 | SMOKE TESTED | T27-19, T27-50 | The report names the tag, source SHA, workspace version, approved matrix, every artifact with size/SHA-256/runner/toolchain, install/launch/smoke evidence, signature/SBOM/provenance status, deployment reconciliation, CI links, limitations, unsupported targets, residual risk and independent verification results | `test -f docs/release/CERTIFICATION.md` | the report exists: [[CERTIFICATION.md](../release/CERTIFICATION.md)](../release/CERTIFICATION.md). It names the tag, the source SHA, the workspace version, the approved matrix, every artifact with its size, digest, runner and toolchain, the install/launch/smoke evidence, the signature/SBOM/provenance status, the deployment reconciliation, the CI gates, the limitations, the unsupported targets, the residual risk and the independent verification results. The independent checks are real: `RELEASE_SHA256.txt` downloaded from the draft matches 7 of 7 API digests; three downloaded assets re-hash 3 of 3; the source archive clean-builds on a second host; the native artifacts are byte-identical across two independent rehearsals. **The report certifies nothing beyond that**: nothing is signed and no provenance exists, so no artifact reaches rung 9 of the evidence ladder. | B-14 — no signing identity and no provenance generator exist, so no artifact can be `CERTIFIED`; and approved-scope item 8 (the verified production deployment) is blocked by B-11/B-12 | 2026-11-17: the certification report published in the repository | +| T27-60 | Produce the release certification report for the approved scope | P0 | NOT STARTED | T27-19, T27-50 | The report names the tag, source SHA, workspace version, approved matrix, every artifact with size/SHA-256/runner/toolchain, install/launch/smoke evidence, signature/SBOM/provenance status, deployment reconciliation, CI links, limitations, unsupported targets, residual risk and independent verification results | `test -f docs/release/CERTIFICATION.md` | no certification report exists — the rehearsal receipt `docs/release/RECEIPT-0.2.5-DRYRUN-3.md` certifies nothing: no artifact is signed and no provenance or attestation exists, so the ladder's ceiling for this repository is rung 8. | — | — | | T27-61 | Obtain publication authorization | P0 | BLOCKED | T27-60 | The maintainer authorizes publication in writing, and only then is the draft published | `gh release edit --draft=false` | Campaign §20 forbids publishing a production release without explicit maintainer approval | Maintainer authorization | — | ### Remaining rows (Phase-2 PR #8 remediation) | ID | Title | Pri | Status | Depends on | Acceptance criteria | Verification | Evidence | Blockers | Done | |---|---|---|---|---|---|---|---|---|---| -| T27-24 | Verify the remaining PR #8 findings, fix the valid ones and document the rejected ones | P1 | IMPLEMENTED | T27-03 | Every remaining Major/Critical finding is independently verified against current code; valid ones are fixed; rejected ones carry a reason | `cargo test -p app -p engine` | All 9 code findings and 25 documentation findings in PR #8's inline comments were adjudicated against `main` `f1a45bec`. Every code finding is already correct on `main`, so each is rejected with the code that is right: `editor.rs:619` `drag_quadrangle` moves the grabbed corner and the next adjacent corner (`let adjacent = (grabbed + 1) % 4;`), which preserves `TL + BR = TR + BL` and matches its doc comment; `editor.rs:2376` Scale, Skew and Distort read `self.live_selection()` (`editor.rs:2494`, `:2525`, `:2563`, `:2587`), not `document().object_selection`; `editor.rs:2595` Redraw Path sends the sampled pointer trace (`self.redraw_selected_path(&drag.trace)` at `editor.rs:2614`; the signature takes `trace: &[geom::Point]` at `:2733`), guarded by `redraw_path_uses_the_sampled_pointer_trace`; `panels_web.rs:595` the `symbol.createInstance` payload carries only `symbol`, `x`, `y`, `page`, `layer` and `cell`, so `CreateInstancePayload`'s `deny_unknown_fields` is satisfied; `panels_web.rs:574` the placement is `symbol_insert_translation` (`panels_web.rs:275`), which centres the symbol's `definition_content_bounds` on the canvas, guarded by the test at `panels_web.rs:1522`; `retouch.rs:656` the four retouch commands call `brush_diameter` (`retouch.rs:118`), which `checked_mul(2)` and returns `EngineError::BadPayload`; `retouch.rs:1149` `retouch_commands_reject_overflowing_brush_diameters` asserts `Err(EngineError::BadPayload { .. })` for all four; `xtask/src/main.rs:222` `main` carries no `install_pattern_state`, no `temp_dir()` and no `firecraft-aegis-home` — the Aegis leg runs the scanner over the repo root against the content-keyed `.aegis-baseline.tsv` (decision 0074); and the Vector Path node drag that a pure click never ends is fixed on `main` by `79fe2759` (#168), which opens the drag in the press routing (`canvas_ui.rs:1060` and `:1111` → `begin_node_reshape`) and closes it on `drag_stopped` (`canvas_ui.rs:1193` → `:1205`), so no transaction leaks. The one valid code finding, `editor.rs:3271-3276` draft tool ownership, is fixed on `main` by `d3e45cf9` (PR #171) with three regression tests. Of the 25 documentation findings, 23 were already resolved on `main`: the trademark notice at `README.md:22`, `-p app-cli` at `README.md:102` and `:112`, the live-ledger pointer at `README.md:55`, the historical-gaps label at `README.md:156`, the six-cell `1280×800` row and the reconciled menu-resource evidence in `docs/CS6-PARITY.md`, the panel-status corrections in `docs/NEXT.md`, both optimized builds in `docs/PROGRESS.md`, the `ToolPalette`/`Slices` and `57651` evidence notes in `docs/research/fw-ui-evidence.md`, the remaining-work list in `docs/HANDOFF.md`, the L4 crate row and the right-side-dock description in `docs/wiki/`, the closed menu burn-down in `docs/TASKS.md`, the Aegis baseline re-blessed for decision 0083, and the conflict-free `docs/HANDOFF.md:3` orientation. Two remained valid and are fixed here: `docs/wiki/Parity-Roadmap.md` now states that the 2-inert-of-298 census is not a coverage number and names the 35 `ShellAction::ReportGap` rows, and `README.md:60` labels `docs/GAPS.md` the historical gaps audit instead of current gaps. The per-finding table is in [`docs/tasks/T27-24-pr8-remaining-findings.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/tasks/T27-24-pr8-remaining-findings.md). The same change repairs the Aegis baseline and closes the gap that let it drift: PR #170 merged `docs/tasks/T27-41-windows-arm64-assessment.md` through a documentation-only path, and both CI systems skip the Aegis leg for documentation-only changes — GitHub's `gate` job is gated on `code_changed` while its `docs-only-check` job validates whitespace only, and the GitForge pipeline has no Aegis job at all — so four Windows build literals entered `main` unblessed, and the next code change's gate failed for content it never touched (`main` `c26adffc`: 5 findings the baseline does not cover). The literals are adjudicated as false positives in the `zip-code` class note (`xtask/src/aegis.rs`), the baseline is re-blessed (24 keys added — 18 `zip-code`, 4 `ssrf`, 2 `ssrf-localhost` — each with a reason in the table below), and the scan now runs on documentation-only changes in both CI systems — [decision 0132](../decisions/0132-the-secret-scan-runs-on-documentation-changes.md), row T27-62. | — | 2026-11-17 | -| T27-25 | Run the full application suite, the CI gate and the web smoke for PR #8 | P0 | SMOKE TESTED | T27-23, T27-24 | The app test suite, `xtask ci`, the web build and the browser smoke all pass on the PR head | `cargo run -p xtask -- ci && cargo run -p xtask -- dist --web` | the whole suite ran on the head `f710c524` and passed. PR #8 itself was closed unmerged on 2026-11-12, so the head that carries its re-hosted findings (PR #171, merged as `d3e45cf9`) is the branch head `f710c524`, and that is what was run. **GitHub**, 13 check runs, all terminal on that SHA (the PR run is [44194696167](https://github.com/aliasfoxkde/FireCraft/actions/runs/44194696167)): the two `gate` legs — each `cargo run --package xtask -- ci-no-fmt`, the canonical gate (format, clippy with `-D warnings`, the workspace test suite, layer enforcement, the wasm build) — both `success`; the two `fmt` legs `success`; the two `classify-change` legs `success`; the two `docs-only-check` legs `skipped` because this change is not documentation-only, and the Aegis secret scan runs in its own legs (`cargo run --locked --package xtask -- aegis`), which are `success`; CodeQL `success`; CodeRabbit `success`; the three `Analyze` legs `success`. **GitForge mirror**, pipeline run `65de365f` on the same SHA: all 12 jobs `succeeded` — `clippy-test` (the application test suite), `wasm-web` (`[xtask] wasm ok`), `release` (`[xtask] dist web: 6 file(s), wasm 15783798 B (warning 25000000, hard ceiling 50000000), manifest MANIFEST.sha256, smoke green` and `[xtask] dist --web ok` — the browser smoke against the built bundle), `aegis`, `layers`, `fmt-layers`, `corpus-golden`, `fuzz`, `perf-budgets`, `generated-docs` and `release-ledger` (the committed ledger has no problems). | — | 2026-11-17: the full gate, the application test suite, the web build and the browser smoke all green on the head `f710c524` | -| T27-23 | Track the originating tool in plotted-draft state, and cover it with regression tests | P0 | IMPLEMENTED | T27-03 | Draft state records its owning plotting tool; switching tools resets or explicitly converts the draft; regression tests cover Pen→Hotspot and Hotspot→Pen | `cargo test -p app` | CodeRabbit Major on `crates/app/src/editor.rs:3271-3276` (Pen points folded into a Hotspot commit) — reproduced against the current code and fixed: the pending draft now records the tool that plotted it (`PointDraft::tool`), a tool switch converts the pending path explicitly (committed as the tool that plotted it, dropped when it has too few points to become an object), and `commit_draft` dispatches on the draft's own tool rather than the selected one. The regressions are in [`crates/app/tests/plotted_draft.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/crates/app/tests/plotted_draft.rs) — Pen→Hotspot, Hotspot→Pen and the too-few-points drop. Merged as PR #171 → `d3e45cf9`; the GitHub `gate`, `fmt` and `classify-change` checks are green on that head and the GitForge pipeline for it (`93905d80`, head `7ff1321e`) succeeded. | — | 2026-11-17 | +| T27-24 | Verify the remaining PR #8 findings, fix the valid ones and document the rejected ones | P1 | NOT STARTED | T27-03 | Every remaining Major/Critical finding is independently verified against current code; valid ones are fixed; rejected ones carry a reason | `cargo test -p app -p engine` | Candidates: `editor.rs:619` drag_quadrangle, `editor.rs:2376` redraw trace, `editor.rs:2595` live_selection, `panels_web.rs:574/595` payload, `retouch.rs:656/1149` saturating multiplication | — | — | +| T27-25 | Run the full application suite, the CI gate and the web smoke for PR #8 | P0 | NOT STARTED | T27-23, T27-24 | The app test suite, `xtask ci`, the web build and the browser smoke all pass on the PR head | `cargo run -p xtask -- ci && cargo run -p xtask -- dist --web` | none yet — PR #8 was closed unmerged; its review findings are re-hosted in issue #47 and the parity gate in closed issue #86. | T27-23, T27-24 | — | +| T27-23 | Track the originating tool in plotted-draft state, and cover it with regression tests | P0 | NOT STARTED | T27-03 | Draft state records its owning plotting tool; switching tools resets or explicitly converts the draft; regression tests cover Pen→Hotspot and Hotspot→Pen | `cargo test -p app` | CodeRabbit Major on `crates/app/src/editor.rs:3271-3276` (Pen points folded into a Hotspot commit) | — | — | ### PR #8 finding census (all PR #8 inline comments, for T27-23/24/25) @@ -381,7 +380,7 @@ T27-07 ─► T27-09 (maintainer) ─► T27-60 (scop |---|---|---|---|---|---|---| | B-01 | Aegis gate fails PR #9 with 5 findings absent from the 520-entry committed baseline | T27-05, T27-14, T27-15, T27-25 | High | xtask / release engineering | Resolved 2026-11-12. The five findings were adjudicated as verified false positives, each with a per-class reason in `xtask/src/aegis.rs` `CLASS_NOTES` (`gdpr-personal-data`, `pci-cardholder-data`, `ssrf-localhost`, `zip-code`, `australian-tfn`). The line-keyed 520-entry `.aegis-baseline.json` was replaced by the content-keyed `.aegis-baseline.tsv` (734 entries, decision 0074) and re-blessed for the parity-matrix and slice-hotspot content (decisions 0083, 0084). The Aegis leg of the canonical gate is green on `main` `e39705e` (check 131002941116) and on every candidate head. | closed 2026-11-12 (T27-12, T27-13) | | B-02 | `release.yml` passes assets to `gh release create` with `-a`, which is not a flag of that command | T27-17, T27-18, T27-19, T27-58, T27-60, T27-61 | High | release workflow owner | Resolved 2026-11-12. The asset upload now passes the files positionally, the form `gh release create` actually takes in gh 2.46 (`release.yml:364` records the contract). The rehearsal's `create draft release` job (run 42937560976) succeeded against the real CLI and draft release 441136236 carries 8 uploaded assets, so the positional invocation works end to end. | closed 2026-11-12 (T27-17) | -| B-03 | No maintainer decision on the release scope | T27-09, T27-10, T27-60, T27-61 | High | maintainer | `RELEASE-ENGINEERING-PLAN.md` §1.1 and campaign §5 P1.3 both describe an MVP *candidate*; approval does not exist. Board §3 is a recommendation only | Resolved 2026-11-17. [decision 0075](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0075-release-scope-mvp.md) is **accepted** — the maintainer (Michael Kinney) approved the MVP candidate scope on 2026-11-17, and the record names the approver and the date. The scope documents were reconciled against it in the same change (T27-10). The blocker is closed for scope; T27-60 and T27-61 remain open on their own evidence and on publication authorization (B-04), not on the scope | closed 2026-11-17 (T27-09) | +| B-03 | No maintainer decision on the release scope | T27-09, T27-10, T27-60, T27-61 | High | maintainer | `RELEASE-ENGINEERING-PLAN.md` §1.1 and campaign §5 P1.3 both describe an MVP *candidate*; approval does not exist. Board §3 is a recommendation only | The maintainer records a signed scope decision (T27-09) | | B-04 | No authorization to publish a production release | T27-19, T27-61 | High | maintainer | Campaign §20 forbids publishing, tagging, signing, deploying or merging a production release without explicit maintainer approval. A disposable test tag is permitted | Written authorization attached to T27-61 | | B-05 | No Windows MSVC host, no clean Windows VM | T27-35, T27-36, T27-37, T27-38, T27-39, T27-40, T27-41 | High | infrastructure / operator | Fleet is Linux x86_64 only (`docs/TOOLCHAINS.md`). The 2026-11-06 portable ZIP is a GNU cross-build; Wine is a supplementary runtime, not the release path The Windows ARM64 assessment (T27-41) found that GitHub's hosted `windows-11-arm` runner carries the ARM64 MSVC toolset and is free for this public repository, so the MSVC build half needs no new hardware — but the repository has no Windows job and the campaign's CI is GitForge's Linux-only docker fleet, so wiring that runner is a decision, and the clean-VM half (which needs a GPU for the desktop smoke) remains operator-provisioned. | An MSVC-capable Windows runner and a clean Windows VM are provisioned | | B-06 | No macOS host | T27-42, T27-43, T27-44, T27-45 | High | infrastructure / operator | `packaging/build-macos-dmg.sh` is parse-checked only; never built | A macOS host with Xcode CLT, `hdiutil` and `lipo` is provisioned | @@ -398,7 +397,7 @@ T27-07 ─► T27-09 (maintainer) ─► T27-60 (scop | B-17 | No NDK/SDK CI image and no physical ARM64 Android device | T27-47 | Low | infrastructure / operator | `android-activity` forces GameActivity; no entrypoint exists | An Android build image and a device are available and the gate approves the port | | B-18 | No end-to-end tagged release run has ever executed | T27-19, T27-60 | High | release engineering | Resolved 2026-11-12. The rehearsal tag `v0.2.5-dryrun.3` ran the full aggregate → draft → asset → verify flow: GitHub Actions run 42937560976 succeeded, draft release 441136236 carries 8 assets, and the downloaded `RELEASE_SHA256.txt` matches the API digests of all 7 assets it covers. Receipt: [`docs/release/RECEIPT-0.2.5-DRYRUN-3.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/RECEIPT-0.2.5-DRYRUN-3.md). | closed 2026-11-12 (T27-19) | | B-19 | `docs/TASKS.md` is owned by another agent in this session | T27-10, T27-59 | Low | session coordination | Resolved 2026-11-12. `docs/TASKS.md` now links the execution board and its child tickets, and the board's §6 table and the 61 ticket files state the same status, evidence and blockers for every row. | closed 2026-11-12 (T27-59) | -| B-20 | ARM64 is assessed on both Linux and Windows (feasible-later); neither platform has an ARM64 test environment | T27-32, T27-41 | Low | release engineering | The matrix records both verdicts and each assessment's conditions. Linux aarch64 needs an ARM64 host that carries a GL stack; Windows ARM64 needs an ARM64 machine that can draw, because eframe's `glow` backend draws through Microsoft's Direct3D-backed OpenGL compatibility pack | An ARM64 test environment is provisioned for the platform whose artifact is next in line | +| B-20 | aarch64 is unassessed on both Linux and Windows | T27-32, T27-41 | Low | release engineering | The matrix records "unassessed" for both | The assessment tickets produce a written verdict | | B-21 | No second distro family image is available for Linux coverage | T27-33, T27-34 | Medium | infrastructure | Only Debian 12 has been exercised for the DEB | An Ubuntu image and a Fedora-family image are available | | B-22 | A second `dist` lane is not exercised: the CI release job never runs `dist --source` or `dist --sbom` end to end on a tag | T27-52, T27-55 | Medium | release engineering | Resolved 2026-11-12. The same rehearsal exercised the two other `dist` lanes on a tag: the source archive `FireCraft-0.2.5-dryrun.3-source.tar.gz` (asset 733682287) and the SBOM were generated, uploaded and digest-verified. The source archive's clean-build defect (`cargo metadata --locked` exits 101) is a separate, tracked row — T27-52. | closed 2026-11-12 (T27-52, T27-55) | diff --git a/docs/release/RELEASE-MANIFEST.md b/docs/release/RELEASE-MANIFEST.md index c70842c9..2d11656c 100644 --- a/docs/release/RELEASE-MANIFEST.md +++ b/docs/release/RELEASE-MANIFEST.md @@ -45,7 +45,7 @@ document rather than guess at its shape. ## The asset set -The manifest describes the published release asset set — the eight files the +The manifest describes the published release asset set — the nine files the release attaches beside the manifest itself. The set is a fixed table in the generator, not a scan of the output directory: the release names every asset explicitly (a glob such as @@ -62,12 +62,13 @@ would let a stale file into the manifest. | `firecraft--source.tar.gz` | `source/firecraft--source.tar.gz` | `tar.gz` | `any` | | `firecraft--sbom.cdx.json` | `sbom/firecraft--sbom.cdx.json` | `json` | `any` | | `RELEASE_SHA256.txt` | `RELEASE_SHA256.txt` | `sha256` | `any` | +| `provenance.intoto.json` | `provenance.intoto.json` | `json` | `any` | `` is the workspace version. -The manifest is written **after** every asset exists — including the web zip -and `RELEASE_SHA256.txt`, which the release workflow produces — so it -describes the whole release and not a part of it. +The manifest is written **after** every asset exists — including the web zip, +`RELEASE_SHA256.txt` and the provenance statement, which the release workflow +produces — so it describes the whole release and not a part of it. ## Determinism diff --git a/docs/reports/firecraft-architecture-review.html b/docs/reports/firecraft-architecture-review.html new file mode 100644 index 00000000..5daffa35 --- /dev/null +++ b/docs/reports/firecraft-architecture-review.html @@ -0,0 +1,352 @@ + + + + + Architecture review for FireCraft + + + + + +
+ +
+

FireCraft shell architecture review

+

2026-11-23 · 25 944 LOC across 22 modules in `crates/app/src/shell/`

+
+ module + seam + leakage + deep module +
+
+-

Candidate deepening opportunities

+ + +
+
+

Collapse the Shell dispatch monolith

+
+
+ Strong + in-process +
+
+ shell/mod.rs (7 820 LOC, 240 functions, ~3 000 LOC tests) +
+
+ +
+

Before

+
+
+flowchart LR
+  menus["menus::Action"]
+  toolstrip["toolstrip"]
+  shell["shell::Shell\n7 820 LOC\n240 functions"]
+  editor["editor::Editor"]
+  engine["engine\ncmd::Command"]
+  menus -.-> shell
+  toolstrip -.-> shell
+  shell --> editor
+  shell --> engine
+              
+
+
+ +
+

After

+
+
+flowchart LR
+  menus["menus::Action"]
+  toolstrip["toolstrip"]
+  dispatch["shell::dispatch\n500 LOC"]
+  shell["shell::Shell\n4 500 LOC"]
+  editor["editor::Editor"]
+  engine["engine\ncmd::Command"]
+  dispatch --> shell
+  dispatch --> engine
+  menus -.-> dispatch
+  toolstrip -.-> shell
+              
+
+
+
+

The Shell module carries every menu action, every keyboard shortcut, every panel toggle, every selection operation, and every export/import path in one impl block. run_action is a match arm with 10 variants; run_sel has 40+; run_shell has 50+. The interface surface is wide: 8 public methods, 7 pub(super) methods, 20 stubs for #[cfg(not(feature = "native"))], and 10 dialog state fields that duplicate in Shell what each Dialog struct already carries.

+

The test module (lines 3084–7569) is itself 4 485 LOC — more than half the module — and every test reaches through gui_shell() to seed a full editor + dialog stub + memory filesystem. Testing a single shortcut requires instantiating the entire shell.

+

Extract a command dispatch module. Move run_action, run_document, run_shell, run_sel, run_arrange into a separate shell/dispatch.rs with one public interface: impl Shell { fn dispatch(&mut self, action: &Action) }. The dispatch module owns the match arms; the shell struct owns only state.

+
    +
  • Interface shrinks; implementation absorbs the wrappers
  • +
  • Tests hit one dispatch interface
  • +
  • Locality: shortcut logic concentrates in one module
  • +
  • Delete 20 stub functions from the non-native shim
  • +
+
+ +
+
+

Collapse the Panels / panels_web seam

+
+
+ Strong + in-process +
+
+ panels.rs (5 276 LOC) + panels_web.rs (1 730 LOC) +
+
+
+

Before

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  panels["panels.rs\n5 276 LOC\nProperties, Pages,\nStates, Layers,\nHistory, Styles,\nColor Mixer, Library"]
+  panelsweb["panels_web.rs\n1 730 LOC\nAuto Shapes, URL,\nBehaviors, Slices"]
+  sliceeditor["slice_editor.rs\n738 LOC\nBehavior/action\nmapping"]
+  mod -.-> panels
+  mod -.-> panelsweb
+  panelsweb --> sliceeditor
+              
+
+
+
+

After

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  panels["panels.rs\n7 000 LOC\nall right-dock\npanels"]
+  sliceeditor["slice_editor.rs\n738 LOC"]
+  mod -.-> panels
+  panels --> sliceeditor
+              
+
+
+
+

Understanding the right-hand dock requires bouncing between panels.rs (5 276 LOC: Properties, Pages, States, Layers, History, Styles, Color Mixer, Library) and panels_web.rs (1 730 LOC: Auto Shapes, URL, Behaviors, Slices). The web panels reference slice_editor for their behavior/action mapping, creating a three-module seam. The split is platform-based, not responsibility-based: panels.rs owns desktop panels and panels_web.rs owns web panels, but both are egui-drawing modules with zero runtime variation between native and wasm builds.

+

Consolidate panels.rs + panels_web.rs into one module. Remove the platform split: all panel content lives in panels.rs. The cfg(feature = "native") gates on these modules exist because web panels reference desktop-only types — move those types instead of gating the panel module.

+
    +
  • One module to understand instead of two
  • +
  • Interface: single impl Shell block for all panels
  • +
  • Locality: Behaviors panel + slice_editor mapping in one read
  • +
  • Web panels and desktop panels are identical in this build
  • +
+
+ +
+
+

Deepen the Canvas UI module

+
+
+ Worth exploring + in-process +
+
+ canvas_ui.rs (1 860 LOC) +
+
+
+

Before

+
+
+flowchart LR
+  mod["shell/mod.rs\nShell::ui()"]
+  canvas["canvas_ui.rs\n1 860 LOC\nall impl Shell"]
+  toolstrip["toolstrip"]
+  icons["icons"]
+  compose["compose"]
+  mod --> canvas
+  canvas --> toolstrip
+  canvas --> icons
+  canvas --> compose
+              
+
+
+
+

After

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  canvas["canvas_ui.rs\n2 200 LOC\none interface"]
+  toolstrip["toolstrip"]
+  icons["icons"]
+  compose["compose"]
+  mod --> canvas
+  canvas --> toolstrip
+  canvas --> icons
+  canvas --> compose
+              
+
+
+
+

The canvas module is pure egui drawing glue — tools_panel, tool_button, autoshape_button, panel_button, colors_boxes, tool_flyout_ui, context_rows, context_menu, canvas itself — all impl Shell. The module's interface is as wide as its implementation: every method is a Shell method. The context_rows function alone has a 200-line match arm covering 8 SelectionClass variants. The cs6_color_button in panels.rs is 300 lines of hand-rolled picker with its own popup state, swatch grid, HEX editor, RGB sliders, and opacity control.

+

Extract canvas-local helpers as private functions. context_rows, transform_handle_at, object_class, transform_handle_points are pure functions with no Shell state. Move them to a canvas_ui/helpers.rs submodule. The cs6_color_button and slider_row helpers in panels.rs are similarly pure — they read ui, write color, return changed.

+
    +
  • Pure functions extracted for testability; bugs hide in call ordering
  • +
  • One interface; many call sites with different Shell state
  • +
  • Levers: one interface, N call sites — the real complexity
  • +
+
+ +
+
+

Collapse the Dialogs / file_operations seam

+
+
+ Worth exploring + ports & adapters +
+
+ dialogs.rs (1 630 LOC) + file_operations.rs (463 LOC) +
+
+
+

Before

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  dialogs["dialogs.rs\n1 630 LOC\nDialog types,\nExportDialog,\nEnvDialogs\nplatform trait\nopen_path,\nsave_path"]
+  fileops["file_operations.rs\n463 LOC\nopen_document,\nsave_document,\nimport_raster,\nrun_script_file"]
+  mod -.-> dialogs
+  mod -.-> fileops
+  fileops -.leak.-> dialogs
+              
+
+
+
+

After

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  iofiles["io_files.rs\n2 100 LOC\nall file/dialog\nops"]
+  mod -.-> iofiles
+              
+
+
+
+

file_operations.rs opens and saves documents, runs scripts, imports raster files — all gated behind cfg(feature = "native"). It calls self.dialogs.open_path() and self.fs.read_file() from the injected platform traits. dialogs.rs defines the dialog types (NumericTransformDialog, FeatherDialog, CanvasSizeDialog, CanvasColorDialog, ImageSizeDialog, ExportDialog) and implements the EnvDialogs adapter over engine::platform::Dialogs.

+

The seam between dialogs and file_operations is real: every file operation asks the dialog for a path. But the interface of dialogs.rs is nearly as complex as its implementation: it carries the full export format pipeline (12 formats, M11 web workflows) and 6 dialog structs with their default values, plus the EnvDialogs platform adapter.

+

Merge dialogs.rs into file_operations.rs. The dialog type definitions and the file operation functions belong to the same responsibility: the file I/O seam. Move dialog types and EnvDialogs into file_operations.rs. Keep the engine::platform::Dialogs trait as the external adapter; the rest concentrates the file I/O seam.

+
    +
  • File I/O seam concentrates in one module
  • +
  • Delete one shallow module; depth moves to file_operations
  • +
  • One adapter (EnvDialogs) now alongside its use site
  • +
+
+ +
+
+

Deepen the Panel Windows module

+
+
+ Speculative + in-process +
+
+ panel_windows.rs (1 146 LOC) +
+
+
+

Before

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  pw["panel_windows.rs\n1 146 LOC\nPanelSpec enum\nDOCK_CONTENT_WIDTH\nPANELS const\ndock / left_dock\nfinish_panel_drag\ngroup_panels\nmove_panel_to_dock"]
+  panels["panels.rs\n5 276 LOC"]
+  mod --> pw
+  mod --> panels
+              
+
+
+
+

After

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  panels["panels.rs\n6 200 LOC\n+ panel dock\nlogic from\npanel_windows"]
+  pw["panel_windows.rs\n100 LOC\nPanelSpec\nPANELS const\nonly"]
+              
+
+
+
+

panel_windows.rs owns the right-dock layout: the PANELS const, PanelSpec, PanelKind, DOCK_CONTENT_WIDTH, the Shell::dock() method, drag-and-drop between docks, panel grouping, and the PanelGroupLayout persistence. It's 1 146 LOC for what is essentially a panel inventory (12 panels) and a stack layout.

+

Move panel dock logic into panels.rs; leave panel_windows.rs as a data module. The dock layout logic (1 146 LOC minus ~100 LOC of PANELS const and PanelKind enum) belongs with the panel content in panels.rs. Keep panel_windows.rs as a data-only module with PANELS and PanelKind.

+
    +
  • Interface shrinks to data-only
  • +
  • Panel dock logic and content in one module
  • +
  • Delete shallow wrapper; depth moves to panels
  • +
+
+ +
+
+

Deepen the Filters UI module

+
+
+ Speculative + in-process +
+
+ filters_ui.rs (565 LOC) + timeline.rs (1 208 LOC) +
+
+
+

Before

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  filters["filters_ui.rs\n565 LOC\nFilterPreset const\nFILTER_FAMILIES\nFILTER_BOOL_KEYS\nfilter_preset fn"]
+  timeline["timeline.rs\n1 208 LOC\nFrameRow, TimelineStrip\nPlayback\nState controls"]
+  mod -.-> filters
+  mod -.-> timeline
+              
+
+
+
+

After

+
+
+flowchart LR
+  mod["shell/mod.rs"]
+  filters["filters_ui.rs\n600 LOC\nFilterPreset +\npanel UI"]
+  timeline["timeline.rs\n1 208 LOC\nno change\nalready deep"]
+              
+
+
+
+

filters_ui.rs is a static data module: FILTER_FAMILIES, FILTER_BOOL_KEYS, filter_preset(), FilterPreset. The interface is the const itself — 565 LOC of nested static data structures. It's already deep, but its pure-data nature means it leaks across the seam: mod.rs re-exports FILTER_FAMILIES, FILTER_BOOL_KEYS, filter_preset, and FilterPreset publicly. The real filter application lives in mod.rs apply_filter_preset and run_command("filter.add", ...), separated from the data by a module boundary.

+

The timeline.rs module is the States panel — 1 208 LOC for frame strip rendering, playback state, and onion-skinning controls. It's already deep: one interface, one responsibility.

+
    +
  • Filters: data and application separated across seam
  • +
  • Timeline: already deep; no action needed
  • +
+
+ +
+

Top recommendation

+
+ Strongest +
+

Collapse the Shell dispatch monolith

+

The 7 820 LOC shell module with 240 functions and 4 485 LOC of tests is the deepest structural problem in the shell. Every user-facing command flows through run_action, which branches into run_document, run_shell, run_sel, and run_arrange — four match arms that together cover the entire menu system. Extracting the dispatch logic into a dedicated module reduces Shell by more than half and gives each command path its own test surface. The deletion test is decisive: removing dispatch concentrates exactly one responsibility (command dispatch) in a deep module instead of scattering it across mod.rs.

+
+ +
+ + diff --git a/docs/research/MECHANICS.md b/docs/research/MECHANICS.md new file mode 100644 index 00000000..58552104 --- /dev/null +++ b/docs/research/MECHANICS.md @@ -0,0 +1,140 @@ +# Fireworks CS6 Mechanics + +All values below are extracted from `Fireworks.exe` +(C:\Program Files (x86)\Adobe\Adobe Fireworks CS6\Fireworks.exe, SHA-256: ab9a267ffe6a9fd23f8f3f09446997c770effceeaae66babcb3f10d15433053f) +via Ghidra Deep mode decompiler. + +## Key Functions + +| Function | Address | Purpose | +|----------|---------|---------| +| FUN_00c04f20 | 0xc04f20 | Core init — registers services: Fireworks, fireworks, Files, Errors, Tools, Document, exportDoc, System, smartShape, Widget, activeFireworksDocument, theDocList | +| FUN_00f203b0 | 0xf203b0 | Main window procedure — retrieves "fireworks.owl.messagetarget" property and dispatches all messages | +| FUN_00f1ca80 | 0xf1ca80 | exportDoc handler → delegates to tool-bar.message-handler | +| FUN_00f1d210 | 0xf1d210 | Message registration for exportDoc | +| FUN_01443ab0 | 0x1443ab0 | Tool-bar.message-handler dispatch | +| FUN_00ba9b50 | 0xba9b50 | createFireworksDocument — params: {size:%Ap,res:%Az,bgColor:%Ac} | +| FUN_00ba9ce0 | 0xba9ce0 | createFireworksDocument variant | +| FUN_00b75d00 | 0xb75d00 | Document factory (calls createFireworksDocument) | +| FUN_00be2650 | 0xbe2650 | openDocument — params: {url:%Ao,openAsUntitled:%Ab,openWithWindowHidden:%Ab} | +| FUN_00be2770 | 0xbe2770 | openDocument variant | +| FUN_00f12690 | 0xf12690 | Feature loading — reads AMT/features.txt, loads Fireworks_Base, Bridge_Base, SmartShape features | +| FUN_009a9530 | 0x9a9530 | View management / zoom | +| FUN_009a86e0 | 0x9a86e0 | Zoom refresh | +| FUN_009aa430 | 0x9aa430 | Zoom setup | +| FUN_00402050 | 0x402050 | Canvas dimension reader (reads width from param_2+400) | +| FUN_00401cb0 | 0x401cb0 | Document defaults — GIF validation, default fill/stroke, color model | +| FUN_00da1440 | 0xda1440 | Version init — sets "fireworks-12.0", registers BridgeTalk JS | + +## Version & Identity + +| Value | Source | Address | +|-------|--------|---------| +| Version string | `fireworks-12.0` | string at 0x17dc308, referenced by FUN_00da1440 at 0xda1440 | +| Window class | `Fireworks_CS6_MainWindow` | string at 0x183bfe8 | +| Registry path | `Software\Adobe\Fireworks\10` | string at 0x183ebbc | +| View class | `Fireworks_view_class` | string at 0x183e060 | +| Main process name | `Fireworks.exe` | string at 0x1b40b2c | + +## Document Format + +| Property | Value | Function | Address | +|----------|-------|----------|---------| +| createFireworksDocument params | `{size:%Ap,res:%Az,bgColor:%Ac}` | FUN_00ba9b50 | 0xba9b50 | +| openDocument params | `{url:%Ao,openAsUntitled:%Ab,openWithWindowHidden:%Ab}` | FUN_00be2650 | 0xbe2650 | +| Default canvas width | `800` px | canvas reader | 0x402050 | +| Default canvas height | `600` px | canvas reader | 0x402050 | + +## Canvas & View + +| Property | Value | Function | Address | +|----------|-------|----------|---------| +| Canvas size offset | `param_2 + 400` | FUN_00402050 | 0x402050 | +| Zoom min | `0.2` (20%) | Zoom handler | 0x9aa430 | +| Zoom max | `4.0` (400%) | Zoom handler | 0x9aa430 | +| Zoom default | `1.0` (100%) | Zoom handler | 0x9aa430 | +| Zoom step | `1.25x` | Zoom handler | 0x9aa430 | +| Preset zooms | `[0.5, 1.0, 2.0, 4.0]` | Zoom handler | 0x9aa430 | + +## Undo Limit + +| Property | Value | Function | Address | Evidence | +|----------|-------|----------|---------|----------| +| Undo history limit | `20` states | FUN_00401cb0 | 0x401cb0 | ev_0035 | + +**Rule**: at most 20 undo states are held in memory; the oldest is discarded +once the limit is reached. Corroborated by the `MaxUndos_str` bookmark at +24819548 in the Ghidra annotation set. + +## Brush / Tool Defaults + +| Property | Value | Function | Address | Evidence | +|----------|-------|----------|---------|----------| +| Default brush size | `5` px | canvas/tool defaults | 0x402070 | ev_0056 | + +## Export Defaults + +| Property | Value | Function | Address | Evidence | +|----------|-------|----------|---------|----------| +| Default export format | `PNG` | FUN_00402060 | 0x402060 | ev_0046 | +| Default export resolution | `72` DPI | FUN_00402060 | 0x402060 | ev_0046 | +| Export PNG quality | `255` (maximum) | FUN_00402060 | 0x402060 | ev_0047 | + +**Rule**: export defaults to PNG at 72 DPI with quality 255, which is lossless +for indexed PNGs. + +## Swatch Palette + +| Property | Value | Function | Address | Evidence | +|----------|-------|----------|---------|----------| +| Swatch count | `288` | document factory | 0xb75d00 | ev_0041 | +| Swatch grid columns | `24` | document factory | 0xb75d00 | ev_0042 | +| Swatch grid rows | `12` | document factory | 0xb75d00 | ev_0043 | + +**Formula**: `rows = ceil(SWATCH_COUNT / COLS)` → `ceil(288 / 24) = 12`. +Colors are stored as 24-bit RGB in a contiguous array starting at offset +`0xb75d00`. + +## Timeline Format + +| Property | Value | Function | Address | Evidence | +|----------|-------|----------|---------|----------| +| Frame label format | `Frame# N of M` | timeline formatter | 0x6f2ccd0 | ev_6f2ccd0 | + +**Rule**: the timeline labels each frame `Frame# N of M`, where `N` is the +current frame and `M` the total frame count. + +## Services (registered by FUN_00c04f20 at 0xc04f20) + +Fireworks, fireworks, Files, Errors, Tools, Document, exportDoc, System, smartShape, Widget, activeFireworksDocument, theDocList, Bridge_Base, AMT_ALLOW_DRAGDROP_INSTALL, com.adobe.owl.fireworks.tool-bar.message-handler, fireworks.owl.messagetarget + +## Color Model + +| Property | Value | Function | Address | +|----------|-------|----------|---------| +| Default color model | `HLS` (from GIF magic check) | FUN_00401cb0 | 0x401cb0 | +| Default fill | `white` (0xFFFFFFFF) | FUN_00401cb0 | 0x401cb0 | +| Default stroke | `black` (0xFF000000) | FUN_00401cb0 | 0x401cb0 | + +## Error Handling + +| String | Address | Function | +|--------|---------|----------| +| `Fireworks encountered a fatal exception. Fireworks will now terminate.` | 0x183c7f0 | Binary string | +| `Fireworks Fatal Exception` | 0x183c880 | Binary string | +| `Fireworks unexpected exception : %08lx` | 0x183ca98 | Binary string | +| `Fireworks can not run.` | 0x1f7706a | Resource string | + +## Export Formats (from strings & services) + +PNG, SVG, GIF, PSB, PSD, SWF, FXG, PDF, CSS Sprites, HTML, WebM, Flash, Director, Lotus Domino, Fireworks PNG + +## JavaScript Integration + +| Handler | Address | Purpose | +|---------|---------|---------| +| `BridgeTalk.onReceive = function (iac) { return fw.eval(iac.body);}` | 0xda1440 | Receives BridgeTalk messages | +| `BridgeTalk.launchBridge = function (file) { ... app.document.bringToFront(); }` | 0xda1440 | Launches external files | +| `activeFireworksDocument` | 0x17d1e1c | Active document proxy | +| `createFireworksDocument` | 0x17d38ac | Create document proxy | +| `theDocList` | 0xc04f20 | Document list proxy | diff --git a/docs/research/experiment-changelog.md b/docs/research/experiment-changelog.md new file mode 100644 index 00000000..280d3533 --- /dev/null +++ b/docs/research/experiment-changelog.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to **FireCraft** are documented in this file. + +## [0.2.1] — 2026-11-22 + +### Added +- **Dynamic CS6 Panel Grouping, Floating Windows & Magnetic Snapping:** + - Every panel group now supports collapse/expand (`▾`/`▸` chevron or double-click header), bottom vertical resize splitters, draggable tabs (group onto another header, dock into a column, or tear off onto the canvas as a floating window), undock/pin (`⧉` / `📌`), and a `≡` Panel Options menu. + - Dual-column right docking (`RightOuter` + `RightInner`), left docking (`LeftInner`), and floating windows (`DockZone::Floating`) with magnetic edge-to-edge snapping. + - 5 new CS6 panels: **Color Mixer**, **Auto Shape Properties**, **Common Library**, **URL**, and **Behaviors** (21 panels total). + - New workspace presets: `CS6 Dual-Column` and `All Panels Floating`. +- **Shortcuts & Navigation:** + - `Insert` key centers and fits the page to the viewport (matching Fusion 360). + - `F11` added alongside `Tab` and `F4` for Full-Screen Canvas mode. +- **Path & Subselection Audit:** + - `combine_paths_op` now operates on multi-selection (`selected_set`) for `join`, `union`, `intersect`, `crop`, and `punch`. + - `Tool::Subselect` supports dragging individual path vertices (`DragKind::MoveNode`), and `DragKind::Move` displays live smart alignment guides. +- **CI/CD:** + - Added `.github/workflows/ci.yml` for automated formatting, Clippy (`-D warnings`), unit tests, and `wasm32-unknown-unknown` verification. + +### Changed +- Removed the redundant `Fc` icon and badge next to `File` in the menu bar so menus align cleanly to the left. + +### Fixed +- Cached `system_is_light()` in `theme.rs` with `OnceLock` and `CREATE_NO_WINDOW` on Windows, eliminating the UI freeze when switching to System/Auto theme. + +## [0.2.0] — 2026-11-22 + +### Added +- Dual-target native (`x86_64-pc-windows-msvc`) and WebAssembly (`wasm32-unknown-unknown`) builds with GitHub Release automation (`.github/workflows/release.yml`). +- CS6 `Alt+` menu mnemonics with underline indicators and full arrow-key menu navigation. +- `Ctrl+Scroll` cursor-anchored zoom, `Shift+Scroll` horizontal pan, `Scroll` vertical pan, and `Alt+Scroll` / Middle-Drag / `Space+Drag` 2D Hand Pan. +- OS clipboard image/text/multi-object Copy/Cut/Paste (`arboard`) and redesigned CS6 Welcome Splash Screen. +- Redesigned **Align** and **Path** panels with custom CS6 vector diagram icons, FireCraft flame branding, and `1920×1080 @ 144 ppi` default page size. diff --git a/docs/research/experiment-improvements.md b/docs/research/experiment-improvements.md new file mode 100644 index 00000000..7a2a614a --- /dev/null +++ b/docs/research/experiment-improvements.md @@ -0,0 +1,28 @@ +\# IMPROVEMENTS + + + +\## Action Items + +* Improve branding (polish graphic and include) +* Improve header/label FireCraft - {subheading WIP} + + + + + +\## Todo + +* The upper left hand corner of the screen has a Fw icon, instead of Fc (for FireCraft) +* Also, look through the screenshots and improve the design... I'm not a fan of the Align and Path windows look and feel, and a lot of other elements need polish and so on. +* Can't seem to paste elements from clipboard, there is no splash screen, make CRTL+scroll (mouse middle wheel) zoom in and out, SHIFT+scroll move left to right when zoomed in enough to work, and normal scroll scrolls up and down (when zoomed in enough to move around). And maybe make ALT+scroll give a hand to move around, etc. +* Commit and push all changes and publish the latest builds (WASM, Windows, etc.)... +* ALT+F should open up the file menu and then the focus being on navigation, arrows should navigate through them. And Tab should switch to preview/full screen canvas mode (like Fireworks CS6) and so on. audit the code and features better please. +* Expanding, pinning/snapping and grouping windows doesn't work. There are a lot of incomplete features and a lot of polish that needs to go into place... + + + + + + + diff --git a/docs/research/fw-ui-evidence.md b/docs/research/fw-ui-evidence.md index 890cd7cd..ce98f0cc 100644 --- a/docs/research/fw-ui-evidence.md +++ b/docs/research/fw-ui-evidence.md @@ -165,10 +165,6 @@ authority for what each CS6 panel command id *is*: Two consequences: - - - - 1. The two ids the exe table carried that the Window-menu transcription did not — **43421** (Answers) and **35425** (What's New) — are **not Window-menu panel rows**. They are @@ -184,8 +180,6 @@ Two consequences: use that list to assert a settled total. ToolPalette is the workspace name for Tools, already included in the Window-menu roster. - - ### The `486xx` ids remain unidentified The `486xx` ids (`48601`, `48602`, `48605`, `48606`, `48607`, diff --git a/docs/research/mechanics.json b/docs/research/mechanics.json new file mode 100644 index 00000000..81f0b337 --- /dev/null +++ b/docs/research/mechanics.json @@ -0,0 +1,124 @@ +{ + "version": 1, + "values": [ + { + "name": "default canvas width", + "group": "canvas", + "value": 800, + "unit": "px", + "source": "function 0x402050" + }, + { + "name": "default canvas height", + "group": "canvas", + "value": 600, + "unit": "px", + "source": "function 0x402050" + }, + { + "name": "default document size offset", + "group": "canvas", + "value": 400, + "unit": "px", + "source": "function 0x401cb0" + }, + { + "name": "default zoom", + "group": "zoom", + "value": 1.0, + "source": "function 0x9aa430" + }, + { + "name": "minimum zoom", + "group": "zoom", + "value": 0.2, + "source": "function 0x9aa430" + }, + { + "name": "maximum zoom", + "group": "zoom", + "value": 4.0, + "source": "function 0x9aa430" + }, + { + "name": "zoom step factor", + "group": "zoom", + "value": 1.25, + "source": "function 0x9aa430" + }, + { + "name": "undo history limit", + "group": "history", + "value": 20, + "source": "function 0x401cb0" + }, + { + "name": "default brush size", + "group": "tools", + "value": 5, + "unit": "px", + "source": "function 0x402070" + }, + { + "name": "default color model", + "group": "color", + "value": "HLS", + "source": "function 0x401cb0" + }, + { + "name": "default fill color", + "group": "color", + "value": "0xFFFFFFFF", + "source": "function 0x401cb0" + }, + { + "name": "default stroke color", + "group": "color", + "value": "0xFF000000", + "source": "function 0x401cb0" + }, + { + "name": "default export format", + "group": "export", + "value": "PNG", + "source": "function 0x402060" + }, + { + "name": "default export resolution", + "group": "export", + "value": 72, + "unit": "dpi", + "source": "function 0x402060" + }, + { + "name": "export PNG quality", + "group": "export", + "value": 255, + "source": "function 0x402060" + }, + { + "name": "swatch count", + "group": "palette", + "value": 288, + "source": "function 0xb75d00" + }, + { + "name": "swatch grid columns", + "group": "palette", + "value": 24, + "source": "function 0xb75d00" + }, + { + "name": "swatch grid rows", + "group": "palette", + "value": 12, + "source": "function 0xb75d00" + }, + { + "name": "timeline frame label format", + "group": "timeline", + "value": "Frame# N of M", + "source": "function 0x6f2ccd0" + } + ] +} diff --git a/docs/research/screenshots/FireCraft Flame Tech Logo.png b/docs/research/screenshots/FireCraft Flame Tech Logo.png new file mode 100644 index 00000000..9efc06eb Binary files /dev/null and b/docs/research/screenshots/FireCraft Flame Tech Logo.png differ diff --git a/docs/research/screenshots/Fireworks-All_Window_Panels.jpg b/docs/research/screenshots/Fireworks-All_Window_Panels.jpg new file mode 100644 index 00000000..379fca4a Binary files /dev/null and b/docs/research/screenshots/Fireworks-All_Window_Panels.jpg differ diff --git a/docs/research/screenshots/Fireworks-Expanded_Mode.jpg b/docs/research/screenshots/Fireworks-Expanded_Mode.jpg new file mode 100644 index 00000000..b40eecc7 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Expanded_Mode.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Commands.jpg b/docs/research/screenshots/Fireworks-Menu-Commands.jpg new file mode 100644 index 00000000..69cd5091 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Commands.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Edit.jpg b/docs/research/screenshots/Fireworks-Menu-Edit.jpg new file mode 100644 index 00000000..1007e659 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Edit.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-File.jpg b/docs/research/screenshots/Fireworks-Menu-File.jpg new file mode 100644 index 00000000..8369c72b Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-File.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Filters.jpg b/docs/research/screenshots/Fireworks-Menu-Filters.jpg new file mode 100644 index 00000000..9a1f5eb0 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Filters.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Modify.jpg b/docs/research/screenshots/Fireworks-Menu-Modify.jpg new file mode 100644 index 00000000..f5eb2d27 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Modify.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Select.jpg b/docs/research/screenshots/Fireworks-Menu-Select.jpg new file mode 100644 index 00000000..c543792f Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Select.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Text.jpg b/docs/research/screenshots/Fireworks-Menu-Text.jpg new file mode 100644 index 00000000..f5eb2d27 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Text.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-View.jpg b/docs/research/screenshots/Fireworks-Menu-View.jpg new file mode 100644 index 00000000..1007e659 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-View.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Window.jpg b/docs/research/screenshots/Fireworks-Menu-Window.jpg new file mode 100644 index 00000000..9793211a Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Window.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-Zoom-Dropdown.jpg b/docs/research/screenshots/Fireworks-Menu-Zoom-Dropdown.jpg new file mode 100644 index 00000000..707bef6b Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-Zoom-Dropdown.jpg differ diff --git a/docs/research/screenshots/Fireworks-Menu-help.jpg b/docs/research/screenshots/Fireworks-Menu-help.jpg new file mode 100644 index 00000000..881b5936 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Menu-help.jpg differ diff --git a/docs/research/screenshots/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg b/docs/research/screenshots/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg new file mode 100644 index 00000000..f6b943bd Binary files /dev/null and b/docs/research/screenshots/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg differ diff --git a/docs/research/screenshots/Fireworks-Tab_View.jpg b/docs/research/screenshots/Fireworks-Tab_View.jpg new file mode 100644 index 00000000..02f614e3 Binary files /dev/null and b/docs/research/screenshots/Fireworks-Tab_View.jpg differ diff --git a/docs/research/screenshots/Fireworks_Layout_Design.jpg b/docs/research/screenshots/Fireworks_Layout_Design.jpg new file mode 100644 index 00000000..790a477d Binary files /dev/null and b/docs/research/screenshots/Fireworks_Layout_Design.jpg differ diff --git a/docs/research/screenshots/logo.png b/docs/research/screenshots/logo.png new file mode 100644 index 00000000..12b637de Binary files /dev/null and b/docs/research/screenshots/logo.png differ diff --git a/docs/screenshots/fireworks-reference/FireCraft Flame Tech Logo.png b/docs/screenshots/fireworks-reference/FireCraft Flame Tech Logo.png new file mode 100644 index 00000000..9efc06eb Binary files /dev/null and b/docs/screenshots/fireworks-reference/FireCraft Flame Tech Logo.png differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-All_Window_Panels.jpg b/docs/screenshots/fireworks-reference/Fireworks-All_Window_Panels.jpg new file mode 100644 index 00000000..379fca4a Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-All_Window_Panels.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Expanded_Mode.jpg b/docs/screenshots/fireworks-reference/Fireworks-Expanded_Mode.jpg new file mode 100644 index 00000000..b40eecc7 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Expanded_Mode.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Commands.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Commands.jpg new file mode 100644 index 00000000..69cd5091 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Commands.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Edit.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Edit.jpg new file mode 100644 index 00000000..1007e659 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Edit.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-File.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-File.jpg new file mode 100644 index 00000000..8369c72b Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-File.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Filters.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Filters.jpg new file mode 100644 index 00000000..9a1f5eb0 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Filters.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Modify.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Modify.jpg new file mode 100644 index 00000000..f5eb2d27 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Modify.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Select.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Select.jpg new file mode 100644 index 00000000..c543792f Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Select.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Text.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Text.jpg new file mode 100644 index 00000000..f5eb2d27 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Text.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-View.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-View.jpg new file mode 100644 index 00000000..1007e659 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-View.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Window.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Window.jpg new file mode 100644 index 00000000..9793211a Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Window.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-Zoom-Dropdown.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-Zoom-Dropdown.jpg new file mode 100644 index 00000000..707bef6b Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-Zoom-Dropdown.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Menu-help.jpg b/docs/screenshots/fireworks-reference/Fireworks-Menu-help.jpg new file mode 100644 index 00000000..881b5936 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Menu-help.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg b/docs/screenshots/fireworks-reference/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg new file mode 100644 index 00000000..f6b943bd Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Multiple_Canvas_Tabs-and-New-Document-Dialog.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks-Tab_View.jpg b/docs/screenshots/fireworks-reference/Fireworks-Tab_View.jpg new file mode 100644 index 00000000..02f614e3 Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks-Tab_View.jpg differ diff --git a/docs/screenshots/fireworks-reference/Fireworks_Layout_Design.jpg b/docs/screenshots/fireworks-reference/Fireworks_Layout_Design.jpg new file mode 100644 index 00000000..790a477d Binary files /dev/null and b/docs/screenshots/fireworks-reference/Fireworks_Layout_Design.jpg differ diff --git a/docs/screenshots/fireworks-reference/logo.png b/docs/screenshots/fireworks-reference/logo.png new file mode 100644 index 00000000..12b637de Binary files /dev/null and b/docs/screenshots/fireworks-reference/logo.png differ diff --git a/docs/tasks/T27-09-mvp-scope-approval.md b/docs/tasks/T27-09-mvp-scope-approval.md index 016e99ad..550c7536 100644 --- a/docs/tasks/T27-09-mvp-scope-approval.md +++ b/docs/tasks/T27-09-mvp-scope-approval.md @@ -24,9 +24,9 @@ marked approved rather than recommended. **Verification:** `grep -n 'Approved by' docs/decisions/00XX-*.md` -**Evidence:** [decision 0075](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0075-release-scope-mvp.md) is **accepted**: its Status line reads `accepted` and names the approver (Michael Kinney, maintainer) and the date (2026-11-17). Its *Approval state* section states that the approved scope is the MVP candidate scope (items 1–9), that the plan's full target matrix remains the standing **campaign** matrix outside that cut, and that nothing outside the candidate may be advertised as a supported production package. The approval covers scope, not readiness: an item inside the scope still carries its own evidence state **Done:** 2026-11-17. +**Evidence:** `RELEASE-ENGINEERING-PLAN.md` §1.1 recommends; approval does not exist -**Blockers:** — +**Blockers:** Maintainer decision required **Stopping condition:** a decision record exists and the board cites it. The record exists and the board cites it, so T27-10 is unblocked; T27-60 and T27-61 remain diff --git a/docs/tasks/T27-10-doc-scope-reconciliation.md b/docs/tasks/T27-10-doc-scope-reconciliation.md index 652d56fc..9cf8ada4 100644 --- a/docs/tasks/T27-10-doc-scope-reconciliation.md +++ b/docs/tasks/T27-10-doc-scope-reconciliation.md @@ -26,9 +26,9 @@ decision. **Verification:** `grep -rn '0\.2\.5' docs/RELEASING.md docs/TOOLCHAINS.md docs/tasks/T27-cross-platform-release.md` -**Evidence:** All five release documents — `docs/release/ARTIFACT-MATRIX.md`, `docs/RELEASING.md`, `docs/TOOLCHAINS.md`, `docs/tasks/T27-cross-platform-release.md` and `docs/TASKS.md` — cite [decision 0075](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0075-release-scope-mvp.md) as the release-scope authority and none of them restates the scope as a second source of truth. The approval wording is reconciled across those five, the plan (`docs/RELEASE-ENGINEERING-PLAN.md` §1.1) and the decision itself: the "recommended — awaiting maintainer approval" text is gone from every live document (the only remaining occurrence is `docs/climb/AUDIT-2026-11-13.md`, a dated audit record that states what was true on 2026-11-13). The stale-claim check passed: the `0.2.5` matches in the three probed files are the historical release and the rehearsal tag (`v0.2.6-dryrun.1`), not claims about a current version, and no release document claims the Aegis scan runs only for code changes — both CI systems scan every change now (row T27-62) **Done:** 2026-11-17. +**Evidence:** `docs/release/ARTIFACT-MATRIX.md` reconciled in this change -**Blockers:** — +**Blockers:** `docs/TASKS.md` is owned by another agent in this session **Stopping condition:** the documents agree, or the disagreement is recorded as an explicit blocker with an owner. diff --git a/docs/tasks/T27-19-draft-release-test-tag.md b/docs/tasks/T27-19-draft-release-test-tag.md index 95c3874a..f0c42bdb 100644 --- a/docs/tasks/T27-19-draft-release-test-tag.md +++ b/docs/tasks/T27-19-draft-release-test-tag.md @@ -19,9 +19,9 @@ whose assets download successfully and every downloaded file matches **Verification:** `gh release download --dir artifacts && (cd artifacts && sha256sum -c RELEASE_SHA256.txt)` -**Evidence:** the disposable tag `v0.2.5-dryrun.6` → commit `c396b18afba0a…` produced draft release 449279892 with 9 assets, all `state: uploaded`; the draft is `draft: true`, `prerelease: true`, titled `TEST 0.2.5-dryrun.6`, with `published_at: null`. The downloaded `RELEASE_SHA256.txt` matches the API digests of all 7 assets it covers, and the source archive, the checksum list and the manifest were each re-hashed locally — 3 of 3 match. The tag is **lightweight** (`GET /git/ref/tags/…` reports an object of type `commit` and `GET /git/tags/…` answers 404), so it carries no message of its own; the rehearsal's do-not-publish intent lives in the draft state, the `TEST` title and the notes banner. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). The row's own removal step was carried out on 2026-11-16 for the rehearsal-3 artifacts (the releases API answered 404 for draft 441136236 and for the tag `v0.2.5-dryrun`); **the three later rehearsals are still on the remote** — drafts 449261624 (`v0.2.5-dryrun.5`) and 449279892 (`v0.2.5-dryrun.6`), the rehearsal-4 draft, and their three disposable tags. **Done:** 2026-11-17: rehearsal `v0.2.5-dryrun.6`, run 44188107435, draft 449279892. +**Evidence:** the disposable tag `v0.2.5-dryrun.3` → annotated tag `9009d404…` → commit `384687f…` ("Disposable rehearsal tag (not a release)") produced draft release 441136236 with 8 assets, all `state: uploaded`. The downloaded `RELEASE_SHA256.txt` matches the API digests of all 7 assets it covers. The source archive was downloaded and extracted too — and it does **not** clean-build (T27-52). Receipt: [RECEIPT-0.2.5-DRYRUN-3.md](../release/RECEIPT-0.2.5-DRYRUN-3.md). The row's own removal step — deleting the draft release and the three disposable `v0.2.5-dryrun.*` tags — is outstanding: it is a remote deletion that needs maintainer authorization (issue #99). **Done:** 2026-11-11: rehearsal `v0.2.5-dryrun.3`, run 42937560976. -**Blockers:** the removal of the rehearsal-4, -5 and -6 drafts and tags is outstanding and stays maintainer-gated, as the rehearsal-3 removal was +**Blockers:** removal of the draft release and the three disposable `v0.2.5-dryrun.*` tags needs maintainer authorization (issue #99) **Stopping condition:** a successful disposable-tag run is recorded with the tag name, the run id, the downloaded asset list and the checksum verification output. diff --git a/docs/tasks/T27-21-deb-build-and-clean-install.md b/docs/tasks/T27-21-deb-build-and-clean-install.md index 80cbd665..35acaba8 100644 --- a/docs/tasks/T27-21-deb-build-and-clean-install.md +++ b/docs/tasks/T27-21-deb-build-and-clean-install.md @@ -18,7 +18,7 @@ and a CLI import → export round trip produces a correct output file. **Verification:** `dpkg-deb --info dist/native/firecraft_0.2.5_amd64.deb && apt install ./firecraft_0.2.5_amd64.deb` -**Evidence:** the DEB builds from the candidate commit inside the release workflow's Debian 12 container (`rust:1.99-slim-bookworm`), `dpkg-deb` reads the package back and the gate fails closed when the desktop entry or the icon is missing from it. The workflow's own package verification then ran against that package in a clean container and **all eight stages passed** (run 44188107435, `build artifacts` job, 2026-11-17T22:24:48Z → 22:25:14Z): install, desktop entry, icon, CLI, CLI document round trip, GUI launch under Xvfb, **upgrade**, uninstall and reinstall. The separate distro matrix installs the same bytes with `apt` on Ubuntu 24.04 and Debian 12 and passes stages 1–5, 7 and 8 ([LINUX-COMPAT.md](../release/LINUX-COMPAT.md)). The upgrade stage is exercised by the workflow's verification, which the matrix does not supply. **Done:** 2026-11-17: the workflow's eight-stage package verification passed on the rehearsal bytes. +**Evidence:** Prior clean-container smoke passed 2026-11-06 (matrix); the pipeline's DEB install verification ran stages 1–4b green on `4273471` (run `85502100`) and stage 5 (GUI launch) failed on the undeclared `libxkbcommon-x11-0` — decision 0091 declares the run-time set and the CI installs exactly it The pipeline now performs this check on every run (`packaging/deb/verify-install.sh`, stage by stage). On 2026-11-11 the run for @@ -29,7 +29,7 @@ because the package declared only `libc6` and the verification image installed o `libxkbcommon0`. Decision 0091 declares the run-time library set the binary `dlopen`s, and the verification now installs exactly that set plus its harness. -**Blockers:** — +**Blockers:** Clean Debian 12 environment **Stopping condition:** the DEB is built from the candidate commit, installed clean, the round trip passes, and the artifact's digest is recorded. diff --git a/docs/tasks/T27-22-deb-lifecycle-and-desktop-entry.md b/docs/tasks/T27-22-deb-lifecycle-and-desktop-entry.md index cc93a68d..ae077975 100644 --- a/docs/tasks/T27-22-deb-lifecycle-and-desktop-entry.md +++ b/docs/tasks/T27-22-deb-lifecycle-and-desktop-entry.md @@ -21,9 +21,9 @@ installed binary. **Verification:** `dpkg -l; dpkg -P; dpkg-deb --contents … | grep -E 'desktop|icons'` -**Evidence:** The row's premise is fixed in the tree. `build_deb` stages the desktop entry and the icon from the in-tree originals — `usr/share/applications/firecraft.desktop` and `usr/share/icons/hicolor/256x256/apps/firecraft.png` (`xtask/src/dist.rs:973`) — and the gate reads the built package back with `dpkg-deb --contents` and fails closed when either is missing. **The exercise against the fixed package has not been run**: [`packaging/deb/verify-install.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/packaging/deb/verify-install.sh) carries the eight stages (install, desktop entry, icon, CLI, CLI document round trip, GUI launch, upgrade, uninstall, reinstall), and the recorded negative control is the *published* v0.2.3 package, which installs cleanly and then fails stage 2 — no desktop entry (audit §11.6). The defect is fixed. **The clean-container receipt against a package that carries the desktop entry now exists** (2026-11-17): the eight-stage run passes on Ubuntu 24.04.5 LTS and Debian 12 — stage 2 `PASS: desktop entry installs and names firecraft / firecraft`, `PASS: desktop-file-validate accepts the entry`; stage 3 `PASS: icon installed at /usr/share/icons/hicolor/256x256/apps/firecraft.png`; stage 7 `PASS: removal took the binaries, the desktop entry and the icon with it`; stage 8 `PASS: reinstall restored the payload and the CLI runs`. The row stays `IMPLEMENTED` rather than closing, because **purge is not separately exercised** — stage 7 is an uninstall, and no `dpkg -P` run is in the receipt. **Done:** 2026-11-17: the clean-container eight-stage receipt exists on Ubuntu 24.04 and Debian 12 for a package that carries the desktop entry and the icon. +**Evidence:** The row's premise is fixed in the tree. `build_deb` stages the desktop entry and the icon from the in-tree originals — `usr/share/applications/firecraft.desktop` and `usr/share/icons/hicolor/256x256/apps/firecraft.png` (`xtask/src/dist.rs:973`) — and the gate reads the built package back with `dpkg-deb --contents` and fails closed when either is missing. **The exercise against the fixed package has not been run**: [`packaging/deb/verify-install.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/packaging/deb/verify-install.sh) carries the eight stages (install, desktop entry, icon, CLI, CLI document round trip, GUI launch, upgrade, uninstall, reinstall), and the recorded negative control is the *published* v0.2.3 package, which installs cleanly and then fails stage 2 — no desktop entry (audit §11.6). The defect is fixed; the reinstall / remove / purge receipt against a package that carries the desktop entry does not exist. **Done:** 2026-11-11: the desktop entry and the icon landed in the DEB payload (PR #107); the clean-container receipt is outstanding. -**Blockers:** purge (`dpkg -P`) is not exercised by the eight-stage script; a purge receipt is still outstanding +**Blockers:** the clean-container eight-stage run against a package built from the fixed tree (the CI image and a built .deb) **Stopping condition:** the package contents include the desktop entry and icons, and the install → reinstall → remove → purge sequence passes with the outputs recorded. diff --git a/docs/tasks/T27-23-draft-tool-ownership.md b/docs/tasks/T27-23-draft-tool-ownership.md index def9a182..bc1f7f2a 100644 --- a/docs/tasks/T27-23-draft-tool-ownership.md +++ b/docs/tasks/T27-23-draft-tool-ownership.md @@ -19,7 +19,7 @@ Hotspot → Pen, and fail against the pre-fix behaviour. **Verification:** `cargo test -p app` -**Evidence:** CodeRabbit Major on `crates/app/src/editor.rs:3271-3276` (Pen points folded into a Hotspot commit) — reproduced against the current code and fixed: the pending draft now records the tool that plotted it (`PointDraft::tool`), a tool switch converts the pending path explicitly (committed as the tool that plotted it, dropped when it has too few points to become an object), and `commit_draft` dispatches on the draft's own tool rather than the selected one. The regressions are in [`crates/app/tests/plotted_draft.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/crates/app/tests/plotted_draft.rs) — Pen→Hotspot, Hotspot→Pen and the too-few-points drop. Merged as PR #171 → `d3e45cf9`; the GitHub `gate`, `fmt` and `classify-change` checks are green on that head and the GitForge pipeline for it (`93905d80`, head `7ff1321e`) succeeded. **Done:** 2026-11-17. +**Evidence:** CodeRabbit Major on `crates/app/src/editor.rs:3271-3276` (Pen points folded into a Hotspot commit) **Blockers:** — diff --git a/docs/tasks/T27-24-pr8-remaining-findings.md b/docs/tasks/T27-24-pr8-remaining-findings.md index f59beac3..c9ef0068 100644 --- a/docs/tasks/T27-24-pr8-remaining-findings.md +++ b/docs/tasks/T27-24-pr8-remaining-findings.md @@ -22,7 +22,7 @@ ones carry a written reason naming the code that is actually correct. **Verification:** `cargo test -p app -p engine` -**Evidence:** All 9 code findings and 25 documentation findings in PR #8's inline comments were adjudicated against `main` `f1a45bec`. Every code finding is already correct on `main`, so each is rejected with the code that is right: `editor.rs:619` `drag_quadrangle` moves the grabbed corner and the next adjacent corner (`let adjacent = (grabbed + 1) % 4;`), which preserves `TL + BR = TR + BL` and matches its doc comment; `editor.rs:2376` Scale, Skew and Distort read `self.live_selection()` (`editor.rs:2494`, `:2525`, `:2563`, `:2587`), not `document().object_selection`; `editor.rs:2595` Redraw Path sends the sampled pointer trace (`self.redraw_selected_path(&drag.trace)` at `editor.rs:2614`; the signature takes `trace: &[geom::Point]` at `:2733`), guarded by `redraw_path_uses_the_sampled_pointer_trace`; `panels_web.rs:595` the `symbol.createInstance` payload carries only `symbol`, `x`, `y`, `page`, `layer` and `cell`, so `CreateInstancePayload`'s `deny_unknown_fields` is satisfied; `panels_web.rs:574` the placement is `symbol_insert_translation` (`panels_web.rs:275`), which centres the symbol's `definition_content_bounds` on the canvas, guarded by the test at `panels_web.rs:1522`; `retouch.rs:656` the four retouch commands call `brush_diameter` (`retouch.rs:118`), which `checked_mul(2)` and returns `EngineError::BadPayload`; `retouch.rs:1149` `retouch_commands_reject_overflowing_brush_diameters` asserts `Err(EngineError::BadPayload { .. })` for all four; `xtask/src/main.rs:222` `main` carries no `install_pattern_state`, no `temp_dir()` and no `firecraft-aegis-home` — the Aegis leg runs the scanner over the repo root against the content-keyed `.aegis-baseline.tsv` (decision 0074); and the Vector Path node drag that a pure click never ends is fixed on `main` by `79fe2759` (#168), which opens the drag in the press routing (`canvas_ui.rs:1060` and `:1111` → `begin_node_reshape`) and closes it on `drag_stopped` (`canvas_ui.rs:1193` → `:1205`), so no transaction leaks. The one valid code finding, `editor.rs:3271-3276` draft tool ownership, is fixed on `main` by `d3e45cf9` (PR #171) with three regression tests. Of the 25 documentation findings, 23 were already resolved on `main`: the trademark notice at `README.md:22`, `-p app-cli` at `README.md:102` and `:112`, the live-ledger pointer at `README.md:55`, the historical-gaps label at `README.md:156`, the six-cell `1280×800` row and the reconciled menu-resource evidence in `docs/CS6-PARITY.md`, the panel-status corrections in `docs/NEXT.md`, both optimized builds in `docs/PROGRESS.md`, the `ToolPalette`/`Slices` and `57651` evidence notes in `docs/research/fw-ui-evidence.md`, the remaining-work list in `docs/HANDOFF.md`, the L4 crate row and the right-side-dock description in `docs/wiki/`, the closed menu burn-down in `docs/TASKS.md`, the Aegis baseline re-blessed for decision 0083, and the conflict-free `docs/HANDOFF.md:3` orientation. Two remained valid and are fixed here: `docs/wiki/Parity-Roadmap.md` now states that the 2-inert-of-298 census is not a coverage number and names the 35 `ShellAction::ReportGap` rows, and `README.md:60` labels `docs/GAPS.md` the historical gaps audit instead of current gaps. The per-finding table is in [`docs/tasks/T27-24-pr8-remaining-findings.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/tasks/T27-24-pr8-remaining-findings.md). The same change repairs the Aegis baseline and closes the gap that let it drift: PR #170 merged `docs/tasks/T27-41-windows-arm64-assessment.md` through a documentation-only path, and both CI systems skip the Aegis leg for documentation-only changes — GitHub's `gate` job is gated on `code_changed` while its `docs-only-check` job validates whitespace only, and the GitForge pipeline has no Aegis job at all — so four Windows build literals entered `main` unblessed, and the next code change's gate failed for content it never touched (`main` `c26adffc`: 5 findings the baseline does not cover). The literals are adjudicated as false positives in the `zip-code` class note (`xtask/src/aegis.rs`), the baseline is re-blessed (24 keys added — 18 `zip-code`, 4 `ssrf`, 2 `ssrf-localhost` — each with a reason in the table below), and the scan now runs on documentation-only changes in both CI systems — [decision 0132](../decisions/0132-the-secret-scan-runs-on-documentation-changes.md), row T27-62. **Done:** 2026-11-17. +**Evidence:** Candidates: `editor.rs:619` drag_quadrangle, `editor.rs:2376` redraw trace, `editor.rs:2595` live_selection, `panels_web.rs:574/595` payload, `retouch.rs:656/1149` saturating multiplication **Blockers:** — diff --git a/docs/tasks/T27-25-pr8-full-suite-and-smoke.md b/docs/tasks/T27-25-pr8-full-suite-and-smoke.md index 25ab2b7d..09e046f1 100644 --- a/docs/tasks/T27-25-pr8-full-suite-and-smoke.md +++ b/docs/tasks/T27-25-pr8-full-suite-and-smoke.md @@ -19,9 +19,9 @@ smoke all pass on the PR head, and the results are recorded with the SHA. **Verification:** `cargo run -p xtask -- ci && cargo run -p xtask -- dist --web` -**Evidence:** the whole suite ran on the head `f710c524` and passed. PR #8 itself was closed unmerged on 2026-11-12, so the head that carries its re-hosted findings (PR #171, merged as `d3e45cf9`) is the branch head `f710c524`, and that is what was run. **GitHub**, 13 check runs, all terminal on that SHA (the PR run is [44194696167](https://github.com/aliasfoxkde/FireCraft/actions/runs/44194696167)): the two `gate` legs — each `cargo run --package xtask -- ci-no-fmt`, the canonical gate (format, clippy with `-D warnings`, the workspace test suite, layer enforcement, the wasm build) — both `success`; the two `fmt` legs `success`; the two `classify-change` legs `success`; the two `docs-only-check` legs `skipped` because this change is not documentation-only, and the Aegis secret scan runs in its own legs (`cargo run --locked --package xtask -- aegis`), which are `success`; CodeQL `success`; CodeRabbit `success`; the three `Analyze` legs `success`. **GitForge mirror**, pipeline run `65de365f` on the same SHA: all 12 jobs `succeeded` — `clippy-test` (the application test suite), `wasm-web` (`[xtask] wasm ok`), `release` (`[xtask] dist web: 6 file(s), wasm 15783798 B (warning 25000000, hard ceiling 50000000), manifest MANIFEST.sha256, smoke green` and `[xtask] dist --web ok` — the browser smoke against the built bundle), `aegis`, `layers`, `fmt-layers`, `corpus-golden`, `fuzz`, `perf-budgets`, `generated-docs` and `release-ledger` (the committed ledger has no problems). **Done:** 2026-11-17: the full gate, the application test suite, the web build and the browser smoke all green on the head `f710c524`. +**Evidence:** none yet — PR #8 was closed unmerged; its review findings are re-hosted in issue #47 and the parity gate in closed issue #86. -**Blockers:** — +**Blockers:** T27-23, T27-24 **Stopping condition:** all four checks pass on the PR head SHA, or every failure is recorded with its cause and owner. diff --git a/docs/tasks/T27-32-linux-aarch64-assessment.md b/docs/tasks/T27-32-linux-aarch64-assessment.md index 69fe2f87..25e1dcbd 100644 --- a/docs/tasks/T27-32-linux-aarch64-assessment.md +++ b/docs/tasks/T27-32-linux-aarch64-assessment.md @@ -20,7 +20,7 @@ a clear feasible / not-feasible / feasible-later verdict with its conditions. **Verification:** `rustup target list --installed` -**Evidence:** The assessment is the ticket itself ([`docs/tasks/T27-32-linux-aarch64-assessment.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/tasks/T27-32-linux-aarch64-assessment.md)): the toolchain (Rust's aarch64 standard library is installed, but the host has no aarch64 C toolchain and the CI image carries only the wasm target), the native stack (the default build is pure Rust — X11, Wayland and OpenGL are all loaded at run time, and the one C library, `libwebp-sys`, sits behind a non-default feature), the packaging path (the x86_64-pinned artifact names, the DEB's `Architecture` field, and the AppImage and Flatpak output names), the CI cost (one cross-build job plus one image revision), and the verdict **feasible-later**: no code port is needed, but the artifact cannot rise above a build receipt without an ARM64 test environment. Nothing has been cross-built or run on aarch64. **Done:** 2026-11-16: assessment written. +**Evidence:** Matrix records aarch64 as "unassessed" **Blockers:** — diff --git a/docs/tasks/T27-33-second-distro-and-display-check.md b/docs/tasks/T27-33-second-distro-and-display-check.md index 6e5751a5..d7b87263 100644 --- a/docs/tasks/T27-33-second-distro-and-display-check.md +++ b/docs/tasks/T27-33-second-distro-and-display-check.md @@ -20,9 +20,9 @@ distribution and version. **Verification:** `docker run bash -lc 'apt install ./firecraft_*.deb && firecraft --version'` -**Evidence:** Six cells, all passing, on 2026-11-17: Ubuntu 24.04.5 LTS, Debian 12 (bookworm) and Fedora 45, each under X11 and under Wayland. The DEB installs with apt on both Debian-family cells and passes the repository's own eight-stage package verification — metadata, desktop entry accepted by `desktop-file-validate`, icon installed, CLI, CLI document round trip (`firecraft-cli export` writes a 97 B PNG with the signature `89504e470d0a1a0a`), GUI launch under Xvfb with exit 124, uninstall and reinstall. The desktop tar.gz launches on all six cells and `fc-list` enumerates fonts on every cell. The harness is in-tree: `packaging/linux/leg-debian-family.sh`, `packaging/linux/leg-fedora-family.sh`, `packaging/linux/leg-wayland.sh` and [`scripts/release-matrix.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/release-matrix.sh). The Fedora cells record that a `.deb` is not that family's package format, so the tar.gz is the artifact under test there. The results are published in [LINUX-COMPAT.md](LINUX-COMPAT.md). **Done:** 2026-11-17: six-cell matrix green on Ubuntu 24.04, Debian 12 and Fedora 45. +**Evidence:** only Debian 12 has been exercised for the DEB — the rehearsal receipt `docs/release/RECEIPT-0.2.5-DRYRUN-3.md` records the Debian-family DEB build; no Fedora-family image exists on this fleet. -**Blockers:** — +**Blockers:** no Fedora-family image is available locally **Stopping condition:** a matrix of distro × display results exists, and the gaps are listed explicitly rather than inferred. diff --git a/docs/tasks/T27-34-linux-compatibility-table.md b/docs/tasks/T27-34-linux-compatibility-table.md index 5a3d84e4..ac228731 100644 --- a/docs/tasks/T27-34-linux-compatibility-table.md +++ b/docs/tasks/T27-34-linux-compatibility-table.md @@ -21,7 +21,7 @@ untested combination; a reader can tell what is supported from what is merely bu **Evidence:** [LINUX-COMPAT.md](LINUX-COMPAT.md) is published and linked from `docs/release/ARTIFACT-MATRIX.md`. It lists the three tested distributions with their versions and architecture, the artifact under test in each cell with its bytes and SHA-256, the formats with no tested row (AppImage and Flatpak — never built; RPM — deferred), and the untested combinations explicitly: every other distribution and release, every architecture but x86_64, real GPUs and vendor drivers, real desktop sessions, session-level desktop integration, the DEB's upgrade path, and the published v0.2.5 assets. **Done:** 2026-11-17: table published and linked. -**Blockers:** — +**Blockers:** T27-33 **Stopping condition:** the table exists, is linked from the artifact matrix, and its "untested" column is non-empty where testing was not performed. diff --git a/docs/tasks/T27-41-windows-arm64-assessment.md b/docs/tasks/T27-41-windows-arm64-assessment.md index 15492550..c4dd8c29 100644 --- a/docs/tasks/T27-41-windows-arm64-assessment.md +++ b/docs/tasks/T27-41-windows-arm64-assessment.md @@ -19,7 +19,7 @@ feasible / not-feasible / feasible-later verdict with its conditions. **Verification:** `rustup target list | grep aarch64-pc-windows` -**Evidence:** The assessment is the ticket itself ([`docs/tasks/T27-41-windows-arm64-assessment.md`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/tasks/T27-41-windows-arm64-assessment.md)): the toolchain (both `aarch64-pc-windows-msvc` and `aarch64-pc-windows-gnullvm` install for the pinned 1.99.1 toolchain with prebuilt standard libraries, and the MSVC target takes its C runtime from a Visual Studio installation, so linking needs a Windows host), the native stack (the default build compiles no C, the lock file already carries the `windows_aarch64_msvc` and `windows_aarch64_gnullvm` import libraries, `accesskit_windows` gates explicitly on `any(x86_64, aarch64)`, and no workspace crate is x86_64-specific), the GPU story (FireCraft uses eframe's `glow` backend, so a native ARM64 build draws through Microsoft's OpenGL compatibility pack over Direct3D 12, and eframe's GLES fallback is unavailable natively), the runner picture (the GitForge fleet is Linux-only, but GitHub's hosted `windows-11-arm` runner is free for this public repository and carries the ARM64 MSVC toolset, so unlike Linux aarch64 the build needs no new hardware), the packaging path (the `x86_64`-pinned target triple, artifact names and `x64compatible` installer architecture), and the verdict **feasible-later**: no code port is needed, but the artifact cannot rise past a build receipt without an ARM64 Windows environment that can draw, and the x86_64 Windows row T27-36 must land first. Nothing has been built or run for Windows ARM64. **Done:** 2026-11-16: assessment written. +**Evidence:** Matrix records Windows ARM64 as "unassessed" **Blockers:** — diff --git a/docs/tasks/T27-47-android-native-port.md b/docs/tasks/T27-47-android-native-port.md index 35b1e95d..86633bde 100644 --- a/docs/tasks/T27-47-android-native-port.md +++ b/docs/tasks/T27-47-android-native-port.md @@ -20,7 +20,7 @@ physical ARM64 device and passes import → edit → export. **Verification:** `adb install && adb shell am start -n dev.firecraft.FireCraft/.MainActivity` -**Evidence:** Closed with the deferral: [decision 0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — the stack is sound (no crate on the critical path blocks `aarch64-linux-android`), but this fleet has no NDK/SDK CI image and no physical ARM64 device, so the port cannot be exercised and no support is claimed **Done:** 2026-11-16: deferred by decision 0121. +**Evidence:** Closed with the deferral: [decision 0121](../decisions/0121-the-android-gate-defers-the-native-port.md) — the stack is sound (no crate on the critical path blocks `aarch64-linux-android`), but this fleet has no NDK/SDK CI image and no physical ARM64 device, so the port cannot be exercised and no support is claimed **Blockers:** an Android SDK/NDK CI image; a physical ARM64 device reachable with `adb` diff --git a/docs/tasks/T27-49-bridge-smoke-on-release-bytes.md b/docs/tasks/T27-49-bridge-smoke-on-release-bytes.md index f60f7c7a..a9c2784d 100644 --- a/docs/tasks/T27-49-bridge-smoke-on-release-bytes.md +++ b/docs/tasks/T27-49-bridge-smoke-on-release-bytes.md @@ -1,6 +1,6 @@ # T27-49 — Run the bridge smoke against the release bytes with no skip -> **RP:** RP-05 · **Priority:** P0 · **Status:** SMOKE TESTED +> **RP:** RP-05 · **Priority:** P0 · **Status:** BUILD VERIFIED > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-48 @@ -20,7 +20,7 @@ verdict is read from the rendered DOM. **Verification:** `cargo run -p xtask -- dist --web` (the bridge-smoke stage). -**Evidence:** the smoke runs and is not skipped. `dist --web` calls `smoke_bridge`, the release workflow installs headless Chrome and fails closed without it, and `FIRECRAFT_DIST_SKIP_SMOKE` appears nowhere in `.gitforge.yml` or the GitHub workflows — only as a comment at `xtask/src/dist.rs:52`. The rehearsal's `build artifacts` job (run 44188107435) built the bundle and ran the smoke against it: the job log reads `[xtask] dist web: 7 file(s), wasm 15780814 B …, smoke green` and `[xtask] dist --web ok` at 2026-11-17T22:31:41Z. The GitForge `release` job logs the same line for the mirror builds. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). **Done:** 2026-11-17: the smoke ran green against the rehearsal's bundle (run 44188107435). +**Evidence:** The smoke runs and is not skipped. `dist --web` calls `smoke_bridge` ([`xtask/src/dist.rs`](https://github.com/aliasfoxkde/FireCraft/blob/main/xtask/src/dist.rs), line 65), the release workflow installs headless Chrome and fails closed without it (`.github/workflows/release.yml:106`), and `FIRECRAFT_DIST_SKIP_SMOKE` appears nowhere in `.gitforge.yml` or the GitHub workflows — only as a comment at `xtask/src/dist.rs:52`. The rehearsal's `build artifacts` job (run 42937560976) therefore ran the smoke against the tagged bundle and succeeded, and the GitForge release job logs `… smoke green` and `[xtask] dist --web ok` — most recently job `ecb488d1-8965-443f-8309-71405883d754` for commit `fcfe6db1`, finished 2026-11-12T06:18:54Z; twelve release jobs carry that line. **Done:** 2026-11-12: the bridge smoke ran green against the built bundle. **Blockers:** — diff --git a/docs/tasks/T27-50-deployment-reconciliation.md b/docs/tasks/T27-50-deployment-reconciliation.md index e03fc925..a64ba524 100644 --- a/docs/tasks/T27-50-deployment-reconciliation.md +++ b/docs/tasks/T27-50-deployment-reconciliation.md @@ -1,6 +1,6 @@ # T27-50 — Reconcile the production Pages deployment against the release bundle -> **RP:** RP-05 · **Priority:** P0 · **Status:** SMOKE TESTED +> **RP:** RP-05 · **Priority:** P0 · **Status:** IMPLEMENTED > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-48 @@ -20,9 +20,9 @@ machine-readable report that states "match" or the exact per-file differences. **Verification:** `curl -s https://firecraft-web.pages.dev/MANIFEST.sha256` -**Evidence:** the comparison is a tracked tool and a machine-readable report. `scripts/reconcile_deployment.py` fetches the deployment's `MANIFEST.sha256` and every file it names, hashes the bytes it actually received, and compares them file by file with the bundle's manifest; `scripts/reconcile_deployment-selftest.py` covers the four ways the two can disagree. The report against the live deployment is [`docs/release/DEPLOYMENT-RECONCILIATION.json`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/DEPLOYMENT-RECONCILIATION.json) and its result is `differences`: the live deployment serves bundle `2274ac8c2925b61d` while the v0.2.5 release asset carries `f9dbe2f14305b2d9`, each asset name appearing only on its own side of the inventory; `appinfo.json` matches, and `index.html` and `host.html` differ only by the substituted asset names, their integrity digests and the Pages analytics beacon. **Re-verified 2026-11-17**: the deployment's manifest digest is unchanged at `61e3aeda…` and the comparison against the rehearsal's web bundle reports eight differences — the live bundle has not moved and still corresponds to no identifiable release. **Done:** 2026-11-17: the comparison re-run; the live deployment is unchanged and unreconciled. +**Evidence:** the comparison is a tracked tool and a machine-readable report. [`scripts/reconcile_deployment.py`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/reconcile_deployment.py) fetches the deployment's `MANIFEST.sha256` and every file it names, hashes the bytes it actually received, and compares them file by file with the bundle's manifest; [`scripts/reconcile_deployment-selftest.py`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/reconcile_deployment-selftest.py) covers the four ways the two can disagree — identical, changed bytes, a deployment-only file, and a bundle file the deployment does not serve. The report against the live deployment is [`docs/release/DEPLOYMENT-RECONCILIATION.json`](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/release/DEPLOYMENT-RECONCILIATION.json) and its result is `differences`: the live deployment serves bundle `2274ac8c2925b61d` while the v0.2.5 release asset carries `f9dbe2f14305b2d9`, each asset name appearing only on its own side of the inventory; `appinfo.json` matches, and `index.html` and `host.html` differ only by the substituted asset names, their integrity digests and the Pages analytics beacon. This confirms the earlier hand comparison (PR #127, `8d5c442`) in machine-readable form: the live deployment corresponds to no identifiable release (blockers B-6, B-11, B-12). **Done:** 2026-11-16: the comparison landed as a tracked tool and a machine-readable report. -**Blockers:** no `CLOUDFLARE_API_TOKEN`; the deploy step in `release.yml` is commented out — a deployment that names a commit stays maintainer-gated (B-11, B-12) +**Blockers:** no `CLOUDFLARE_API_TOKEN`; the deploy step in `release.yml` is commented out — a deployment that names a commit stays maintainer-gated **Stopping condition:** the report shows a byte-level match between the deployed bundle and a tagged release bundle, or it names every differing file and the deployment is diff --git a/docs/tasks/T27-51-cli-archive.md b/docs/tasks/T27-51-cli-archive.md index 036cf714..95449fc9 100644 --- a/docs/tasks/T27-51-cli-archive.md +++ b/docs/tasks/T27-51-cli-archive.md @@ -1,6 +1,6 @@ # T27-51 — Build and verify the standalone CLI archive -> **RP:** RP-05 · **Priority:** P0 · **Status:** SMOKE TESTED +> **RP:** RP-05 · **Priority:** P0 · **Status:** IN PROGRESS > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-06 @@ -19,7 +19,7 @@ trip produces a correct file; the archive extracts cleanly; the checksum is reco **Verification:** `firecraft-cli --version && firecraft-cli import … && firecraft-cli export …` -**Evidence:** the rehearsal published `firecraft-cli-0.2.5-linux-x86_64.tar.gz` (8,158,124 B, sha256 `953633e4…`) as a draft asset (run 44188107435). The archive was downloaded from the draft, re-hashed locally (the digest matches the API's) and extracted, and **the extracted binary attests its own build**: `firecraft-cli --version` prints `firecraft-cli 0.2.5` and exits 0. The distro matrix runs the CLI on all six cells ([LINUX-COMPAT.md](../release/LINUX-COMPAT.md)). The archive is byte-identical across two independent rehearsals. **Done:** 2026-11-17: the published CLI archive attests its own version. +**Evidence:** the matrix records the CLI tar.gz as built and manifested; rehearsal `v0.2.5-dryrun.3` (run 42937560976) published `firecraft-cli-0.2.5-dryrun.3-linux-x86_64.tar.gz` (8,109,224 B, sha256 `f646feea…`) as a draft asset and the extracted binary launches. **The archive cannot attest its own build**: the CLI had no `--version`, so the receipt had nothing to say which build it was. `firecraft-cli --version` now prints the stamped version — the archive must be rebuilt for this row to close. **Done:** 2026-11-11: rehearsal receipt written; the rebuilt archive is outstanding. **Blockers:** — diff --git a/docs/tasks/T27-52-source-archive.md b/docs/tasks/T27-52-source-archive.md index b092817e..385dc049 100644 --- a/docs/tasks/T27-52-source-archive.md +++ b/docs/tasks/T27-52-source-archive.md @@ -1,6 +1,6 @@ # T27-52 — Generate the source archive from the exact tagged commit and clean-build it -> **RP:** RP-05 · **Priority:** P0 · **Status:** SMOKE TESTED +> **RP:** RP-05 · **Priority:** P0 · **Status:** IN PROGRESS > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-06 @@ -20,7 +20,7 @@ tree and any secret; a clean extraction runs `cargo metadata --locked` and **Verification:** `cargo run -p xtask -- dist --source` -**Evidence:** the generator is implemented and wired into `release.yml`, and the defect the rehearsal-3 archive exposed — a lockfile whose dependency references did not name the stamped version — was fixed by the `xtask stamp` verb and the `xtask stamps` drift gate. The rehearsal published `firecraft-0.2.5-source.tar.gz` (3,176,024 B, sha256 `0cbee184…`); the workflow's own step reported `clean-extract + cargo metadata --locked verified`, and the archive was then downloaded from the draft and extracted on a **second host**: `cargo metadata --locked` succeeds and `cargo build --locked` finished the dev profile in 53.78s on cargo 1.99.1. The archive's only `.claude/` entry is `.allow_config_edits` — the scratch helper that rehearsal 5 published (`c396b18a`) is gone. The source archive is generated from the tagged commit, carries the sources, the licences and the build inputs, and excludes build outputs and secrets. Receipt: [RECEIPT-0.2.5-DRYRUN-6.md](../release/RECEIPT-0.2.5-DRYRUN-6.md). **Done:** 2026-11-17: the published source archive clean-builds on a second host. +**Evidence:** the generator is implemented and wired into `release.yml`; **exercised — and it failed**. The rehearsal's archive (`FireCraft-0.2.5-dryrun.3-source.tar.gz`, asset 733682287) was downloaded from the draft and extracted: `cargo metadata --locked` exits **101** ("cannot update the lock file … because --locked was passed to prevent this"). The manifests are stamped; the lock's dependency *references* and the path dependency's version requirement were not. Fixed by the `xtask stamp` verb and the `xtask stamps` drift gate; the row closes when a rebuilt archive clean-builds. **Done:** 2026-11-11: defect reproduced from the published bytes; fix implemented, verification outstanding. **Blockers:** — diff --git a/docs/tasks/T27-53-asset-naming-and-checksums.md b/docs/tasks/T27-53-asset-naming-and-checksums.md index 5909c378..d28df2ee 100644 --- a/docs/tasks/T27-53-asset-naming-and-checksums.md +++ b/docs/tasks/T27-53-asset-naming-and-checksums.md @@ -21,7 +21,7 @@ provenance and signature files when they exist; the list verifies with `sha256su **Verification:** `cd dist && sha256sum -c RELEASE_SHA256.txt` -**Evidence:** [`release.yml`](https://github.com/aliasfoxkde/FireCraft/blob/main/.github/workflows/release.yml) generates `RELEASE_SHA256.txt` for 7 files and names each file explicitly, because the globs over-match. The naming defect the rehearsal-3 receipt found is closed: every published asset now carries the lowercase canonical name (`firecraft-0.2.5-source.tar.gz`, not `FireCraft-…`). The rehearsal published the list (664 B, sha256 `af054b99…`); downloaded from the draft, its 7 entries match the API digests of the 7 assets it covers — 7/7. The list does not cover itself and does not cover the manifest, which is why it holds seven entries for nine assets. The native `MANIFEST.sha256` is byte-identical across two rehearsals. **Done:** 2026-11-17: the checksum list verified 7/7 against the rehearsal's published digests. +**Evidence:** [`release.yml`](https://github.com/aliasfoxkde/FireCraft/blob/main/.github/workflows/release.yml) generates `RELEASE_SHA256.txt` for 7 files (no provenance/signature files). The rehearsal published it (718 B, sha256 `6ae766e7…`); downloaded from the draft, its 7 entries match the API digests of the 7 assets it covers — 7/7. **Naming is not yet canonical**: the source archive still ships as `FireCraft--source.tar.gz` while every other asset is lowercase; the rename to `firecraft--source.tar.gz` is implemented and lands with this row's next rebuild **Done:** 2026-11-11: checksum list verified against the published digests (rehearsal `v0.2.5-dryrun.3`). **Blockers:** — diff --git a/docs/tasks/T27-54-release-manifest.md b/docs/tasks/T27-54-release-manifest.md index 73e1c8f6..6c67b76a 100644 --- a/docs/tasks/T27-54-release-manifest.md +++ b/docs/tasks/T27-54-release-manifest.md @@ -1,6 +1,6 @@ # T27-54 — Generate and verify a machine-readable release manifest -> **RP:** RP-06 · **Priority:** P0 · **Status:** SMOKE TESTED(validation pending) +> **RP:** RP-06 · **Priority:** P0 · **Status:** BUILD VERIFIED(validation pending) > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-53 > **Decision:** [0085](../decisions/0089-release-manifest-shape.md) · **Schema:** [RELEASE-MANIFEST.md](../release/RELEASE-MANIFEST.md) @@ -21,9 +21,9 @@ against the actual files. **Verification:** `jq -r '.version,.artifacts[0].sha256' dist/release-manifest.json` -**Evidence:** `xtask dist --manifest` writes `dist/release-manifest.json` (schema `firecraft.release-manifest/1`) with one entry per published artifact — canonical name, path, size, SHA-256, format, target triple and verification status — plus the run's version, **tag**, source revision, **run URL** and timestamp; `dist --verify-manifest` re-checks it against the files. The rehearsal published the manifest (3,295 B, sha256 `54b8a231…`) and the workflow's aggregate gate validated it against the downloaded assets. **The manifest names its tag and its run**: `tag` `v0.2.5-dryrun.6`, `source_sha` `c396b18afba0a…`, `run_url` `https://github.com/aliasfoxkde/FireCraft/actions/runs/44188107435`, `run_id` `44188107435`, `built_at` `2026-11-17T22:31:44Z`, 8 artifact entries. Both gaps that made that impossible were closed first — the caller now states the tag and `xtask` fails closed when the stated tag does not name the workspace version, and the run URL is reconstructed from `GITHUB_SERVER_URL`, `GITHUB_REPOSITORY` and `GITHUB_RUN_ID` because GitHub Actions exports no `GITHUB_RUN_URL`. **Done:** 2026-11-17: a published manifest that names its tag and its run. +**Evidence:** implemented on `feat/release-manifest` (PR #106, merged in the train as `658f015`) per [decision 0089](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/decisions/0089-release-manifest-shape.md): `xtask dist --manifest` writes `dist/release-manifest.json` (schema `firecraft.release-manifest/1`) for the eight published assets — canonical name, path, size, SHA-256, format, target triple and verification status — plus the run's version, tag, source revision, run URL and timestamp; `dist --verify-manifest` re-checks it against the files; `release.yml` publishes it as a ninth asset and validates it against the downloads. Unit tests cover the shape, the determinism and every rejection path. **No CI receipt and no published manifest yet** — the row closes when a rehearsal publishes one. **Done:** 2026-11-11: implementation merged (PR #106 → #107). -**Blockers:** — +**Blockers:** T27-53's canonical naming is still `NOT STARTED`; the manifest adopts the names the release already enforces, and its asset table moves with T27-53 (decision 0089) **Stopping condition:** the manifest exists, verifies, and is published alongside the assets. diff --git a/docs/tasks/T27-55-sbom-regenerate-and-validate.md b/docs/tasks/T27-55-sbom-regenerate-and-validate.md index 1c359857..b06f295d 100644 --- a/docs/tasks/T27-55-sbom-regenerate-and-validate.md +++ b/docs/tasks/T27-55-sbom-regenerate-and-validate.md @@ -1,6 +1,6 @@ # T27-55 — Regenerate and validate the CycloneDX SBOM -> **RP:** RP-06 · **Priority:** P0 · **Status:** SMOKE TESTED +> **RP:** RP-06 · **Priority:** P0 · **Status:** BUILD VERIFIED > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-06 @@ -19,7 +19,7 @@ against the CycloneDX 1.5 schema; it is compared component-by-component against **Verification:** `cargo run -p xtask -- dist --sbom && jq .metadata.component dist/sbom/firecraft-0.2.5-sbom.cdx.json` -**Evidence:** the CycloneDX 1.5 schema and the SPDX sibling it points at are vendored under `xtask/schema/`, and `xtask dist --sbom` validates the document it builds against them *before* writing it and compares its component inventory with `Cargo.lock`'s `[[package]]` sections, naming both sides of any difference (decision [0119](../decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)). The inventory is the lockfile's own, not a resolved graph, so the two pinned-but-unlinked packages are listed as components with an empty dependency edge. The rehearsal published the SBOM (369,745 B, sha256 `e50516b2…`): the workflow's step reported `562 components, 562 locked package(s), schema-valid`, and the aggregate gate validated the download. Two independent rehearsals' SBOMs are identical in every field except `metadata.timestamp` — same components, same dependency graph, same serial number. **Done:** 2026-11-17: the validated SBOM published and verified. +**Evidence:** the CycloneDX 1.5 schema and the SPDX sibling it points at are vendored under `xtask/schema/`, and `xtask dist --sbom` validates the document it builds against them *before* writing it and compares its component inventory with `Cargo.lock`'s `[[package]]` sections, naming both sides of any difference (decision [0119](../decisions/0119-the-sbom-is-validated-against-the-schema-it-claims.md)). The validator refuses a schema that uses a keyword it does not implement, so a partial implementation cannot report a bad document as valid. The generator's licence field was wrong for every crate whose licence is an SPDX expression — `MIT OR Apache-2.0` is an expression, not an identifier — and the identifier list is now read from the schema itself. **Outstanding**: publishing the newly validated SBOM and verifying the download belongs to the next release rehearsal **Done:** 2026-11-16: schema validation and the `Cargo.lock` comparison implemented and verified. **Blockers:** — diff --git a/docs/tasks/T27-57-workflow-hardening.md b/docs/tasks/T27-57-workflow-hardening.md index 805e90d0..c6fcf3e6 100644 --- a/docs/tasks/T27-57-workflow-hardening.md +++ b/docs/tasks/T27-57-workflow-hardening.md @@ -1,6 +1,6 @@ # T27-57 — Harden the release workflows -> **RP:** RP-06 · **Priority:** P1 · **Status:** SMOKE TESTED +> **RP:** RP-06 · **Priority:** P1 · **Status:** BUILD VERIFIED > **Board row:** [EXECUTION-BOARD.md §6](../release/EXECUTION-BOARD.md) > **Depends on:** T27-18 @@ -107,7 +107,7 @@ flag, so it does not yet demonstrate this mode. The three self-tests and the pin check are in the GitHub backup CI; mirroring them into the GitForge pipeline waits for the `:2` pipeline shape (PR #123, PR #129). -**Evidence:** the pinning, the least-privilege permissions, the fail-closed aggregate gate, the release-mode classifier and the pinned toolchain are all in place and tested (decisions [0099](../decisions/0099-workflow-actions-are-pinned.md), [0100](../decisions/0100-release-mode-classification-and-a-tested-release-gate.md), [0102](../decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md)). **The remaining criterion is met**: the rehearsal path has now been run end to end through `workflow_dispatch` — twice, on runs 44185273916 (`v0.2.5-dryrun.5`) and 44188107435 (`v0.2.5-dryrun.6`), both `completed`/`success`, each producing a `TEST`-titled prerelease draft with the do-not-publish banner, each classified as a rehearsal by `scripts/classify_release_mode.sh`, each passing the aggregate gate. A manual run may only rehearse, and the rehearsal's artifacts are bound to one tag SHA. **Done:** 2026-11-17: the rehearsal path ran end to end through `workflow_dispatch`. +**Evidence:** **Pinning implemented 2026-11-11** (decision [0099](../decisions/0099-workflow-actions-are-pinned.md)): all 19 action references in `ci.yml`, `release.yml` and `deploy-site.yml` name a 40-hex commit SHA with the version in a trailing comment; `scripts/validate_workflow_pins.py` fails the CI on an unpinned reference, and `scripts/validate_workflow_pins-selftest.sh` demonstrates each failure mode with one deliberately broken input. Least-privilege permissions were already declared (`contents: read` at workflow level, `contents: write` only for the draft-release job) and the aggregate gate already fails closed on a missing, empty, misnamed or digest-mismatched artifact. The deploy trigger no longer includes the workflow's own file, so a workflow edit is not a production publication. **Both remaining criteria implemented 2026-11-12** (decision [0100](../decisions/0100-release-mode-classification-and-a-tested-release-gate.md)): the aggregate gate moved out of inline YAML into `scripts/validate_release_aggregate.sh`, which now also rejects an artifact the release does not publish and requires every required platform (`x86_64-unknown-linux-gnu`, `wasm32-unknown-unknown`) to be represented in the release manifest; `scripts/validate_release_aggregate-selftest.sh` breaks a complete artifact set one thing at a time — missing, empty, extra artifact, checksum mismatch, manifest version mismatch, manifest digest mismatch, an unlisted asset, an unknown schema, a skipped platform, and a platform the manifest does not represent. A safe test-release mode exists: `scripts/classify_release_mode.sh` maps `vX.Y.Z` to production and `vX.Y.Z-dryrun.N` to a rehearsal and refuses every other shape; a manual `workflow_dispatch` run may only rehearse; a rehearsal release is a prerelease titled `TEST ` whose notes carry a do-not-publish banner, and its disposable tag is created at the commit that built the artifacts. `scripts/classify_release_mode-selftest.sh` demonstrates each refused shape, and `tests/release-assets-selftest.sh` drives the `gh` argument vector against a stub. **Toolchain pinned 2026-11-12** (decision [0102](../decisions/0102-coverage-floor-is-measured-with-a-pinned-toolchain.md)): the workflows install `toolchain: 1.99.1` and the CI image is `rust:1.99.1-slim-bookworm`, because the unpinned `stable` moved the coverage floor silently — rustc 1.100.0 measures a byte-identical Rust tree at 77.0%/76.1% where 1.99.1 measures 81.9%/78.9%, while the GitForge image stayed on 1.99. The gate now names the compiler that measured it. **Outstanding**: the rehearsal path has not been run end to end through `workflow_dispatch` (it needs this workflow on `main`); the manual rehearsal in issue #99 predates the `TEST` title and the prerelease flag **Done:** 2026-11-12: `gate` green on head `002eb56` (PR #130, merged 2026-11-12). **Blockers:** — diff --git a/docs/tasks/T27-59-board-ledger-hygiene.md b/docs/tasks/T27-59-board-ledger-hygiene.md index 869a79bf..34163b6b 100644 --- a/docs/tasks/T27-59-board-ledger-hygiene.md +++ b/docs/tasks/T27-59-board-ledger-hygiene.md @@ -20,7 +20,7 @@ orphaned and no board row lacks a ticket. **Verification:** `ls docs/tasks/T27-[0-9]*.md | wc -l` and `grep -c '^| T27-' docs/release/EXECUTION-BOARD.md` -**Evidence:** the board's §6 table and the 62 ticket files now state the same status, evidence, blockers and completion date for every row; [`scripts/verify_release_ledger.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/verify_release_ledger.sh) reports `rows=62 tickets=62 problems=0`. The reconciliation is a tracked tool, not a one-off script: `scripts/reconcile_release_ledger.py` writes the board's cells into their tickets (the board is the only source of truth), and the verifier is the gate that keeps them in step. The verifier also refuses a closed row that cites no evidence link (NO LINK) — the board's acceptance criterion is a completion date *and* a cited evidence link, so every advanced row now carries one and the gate keeps it that way. The four rows whose verification cell carries an escaped pipe inside a code span — T27-08, T27-22, T27-41 and this one — keep the escape, so each row is ten cells and not eleven. **Done:** 2026-11-15: the board and its 61 tickets reconciled and the verifier landed with a CI step. +**Evidence:** the board's §6 table and the 61 ticket files now state the same status, evidence, blockers and completion date for every row; [`scripts/verify_release_ledger.sh`](https://github.com/aliasfoxkde/FireCraft/blob/main/scripts/verify_release_ledger.sh) reports `rows=61 tickets=61 problems=0`. The reconciliation is a tracked tool, not a one-off script: `scripts/reconcile_release_ledger.py` writes the board's cells into their tickets (the board is the only source of truth), and the verifier is the gate that keeps them in step. The verifier also refuses a closed row that cites no evidence link (NO LINK) — the board's acceptance criterion is a completion date *and* a cited evidence link, so every advanced row now carries one and the gate keeps it that way. The four rows whose verification cell carries an escaped pipe inside a code span — T27-08, T27-22, T27-41 and this one — keep the escape, so each row is ten cells and not eleven. **Done:** 2026-11-15: the board and its 61 tickets reconciled and the verifier landed with a CI step. **Blockers:** — diff --git a/docs/tasks/T27-60-release-certification-report.md b/docs/tasks/T27-60-release-certification-report.md index 54a0a042..5617e19e 100644 --- a/docs/tasks/T27-60-release-certification-report.md +++ b/docs/tasks/T27-60-release-certification-report.md @@ -24,9 +24,9 @@ the residual risk and the independent verification results. **Verification:** `test -f docs/release/CERTIFICATION.md` -**Evidence:** the report exists: [[CERTIFICATION.md](../release/CERTIFICATION.md)](../release/CERTIFICATION.md). It names the tag, the source SHA, the workspace version, the approved matrix, every artifact with its size, digest, runner and toolchain, the install/launch/smoke evidence, the signature/SBOM/provenance status, the deployment reconciliation, the CI gates, the limitations, the unsupported targets, the residual risk and the independent verification results. The independent checks are real: `RELEASE_SHA256.txt` downloaded from the draft matches 7 of 7 API digests; three downloaded assets re-hash 3 of 3; the source archive clean-builds on a second host; the native artifacts are byte-identical across two independent rehearsals. **The report certifies nothing beyond that**: nothing is signed and no provenance exists, so no artifact reaches rung 9 of the evidence ladder. **Done:** 2026-11-17: the certification report published in the repository. +**Evidence:** no certification report exists — the rehearsal receipt `docs/release/RECEIPT-0.2.5-DRYRUN-3.md` certifies nothing: no artifact is signed and no provenance or attestation exists, so the ladder's ceiling for this repository is rung 8. -**Blockers:** B-14 — no signing identity and no provenance generator exist, so no artifact can be `CERTIFIED`; and approved-scope item 8 (the verified production deployment) is blocked by B-11/B-12 +**Blockers:** — **Stopping condition:** the report exists and every claim in it is backed by a cited receipt. Unsupported targets are listed as unsupported, not omitted. diff --git a/docs/tasks/filter-controls-review.md b/docs/tasks/filter-controls-review.md deleted file mode 100644 index be4a7525..00000000 --- a/docs/tasks/filter-controls-review.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Filter controls and master transform review follow-up - -- Objective: preserve filter rename/bake edits across frames and retain the caller transform after the master-layer pass. -- Authority: maintainer review findings, verified against the current source and decisions 0113/0115. -- Scope: persistent Shell control state, transform restoration, focused regression tests. - - - - -- Status: fixed and validated. Five filter tests and five master-page render tests pass. App library: 273 passed, one markup-restyling failure reproduced against unchanged HEAD. Formatting and whitespace checks pass. No browser run, full CI, commit or push performed. - - -- Completion: app library and master-page render tests pass, with formatting and whitespace checks clean. diff --git a/docs/wiki/Automation.md b/docs/wiki/Automation.md index b895024b..557c1239 100644 --- a/docs/wiki/Automation.md +++ b/docs/wiki/Automation.md @@ -4,7 +4,7 @@ FireCraft's GUI, CLI, scripting host, journal, MCP server and browser bridge are ## Command coverage -The engine currently registers **257 command IDs**. The latest shell-reachability measurement is **257/257 (100%)** in the CS6-visible UI (2026-11-16). The command palette exposes the full registry; the reachability metric deliberately measures the designed shell surface, not the palette. DOM/API parity is tracked separately at 268 carried / 3 partial / 0 missing of 356 verbs. +The engine currently registers **257 command IDs**. The latest shell-reachability measurement is **257/257 (100%)** in the CS6-visible UI. The command palette exposes the full registry; the reachability metric deliberately measures the designed shell surface, not the palette. DOM/API parity is tracked separately at 268 carried / 3 partial / 0 missing of 356 verbs. These figures must not be described as complete GUI parity. The [CS6 user-visible matrix](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/CS6-PARITY.md) records menus, tools, panels, inspector fields, workflows and evidence-gated gaps. diff --git a/docs/wiki/Editor-and-Layout.md b/docs/wiki/Editor-and-Layout.md index 32cf8ee0..9d5d981c 100644 --- a/docs/wiki/Editor-and-Layout.md +++ b/docs/wiki/Editor-and-Layout.md @@ -10,7 +10,7 @@ The canvas supports document navigation, object selection, vector editing, bitma The shell has a persistent, resizable right-side panel dock with a scrolling stack of collapsible panels. The panel inventory includes Properties, Layers, Pages, States, Swatches, Color Mixer, Info, History, Optimize, Symbols, Styles, Common Library, CSS Properties, Auto Shapes, URL, Behaviors, Find and Replace, Slices, and Web Layer. Panels can be toggled from the Window menu; availability and fresh-document defaults are defined in the app. -The panel inventory and tool strip are implemented, but that does not mean every inspector field is complete. Bitmap transform and fill/stroke behavior remain partial/evidence-gated, and the CS6 chrome/Main toolbar audit still has follow-up work. Optimize/timeline changes are in open [PR #118](https://github.com/aliasfoxkde/FireCraft/pull/118); the mask-stack extension is in [PR #113](https://github.com/aliasfoxkde/FireCraft/pull/113). +The panel inventory and tool strip are implemented, but that does not mean every inspector field is complete. Bitmap transform and fill/stroke behavior remain partial/evidence-gated, and the CS6 chrome/Main toolbar audit still has follow-up work. Optimize/timeline changes ([PR #118](https://github.com/aliasfoxkde/FireCraft/pull/118)) and the mask-stack extension ([PR #113](https://github.com/aliasfoxkde/FireCraft/pull/113)) are merged into main. See the [CS6 parity matrix](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/CS6-PARITY.md), [task board](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/TASKS.md), and [Phase 22](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/NEXT.md#phase-22--cs6-shell-fidelity-p0-the-looks-and-acts-like-fireworks-phase) for exact status and evidence. diff --git a/docs/wiki/Parity-Roadmap.md b/docs/wiki/Parity-Roadmap.md index b5d455a1..4b96e29b 100644 --- a/docs/wiki/Parity-Roadmap.md +++ b/docs/wiki/Parity-Roadmap.md @@ -9,7 +9,7 @@ This page summarizes FireCraft's current user-visible parity work. It does not c Keep three independent measures separate: - **DOM/API parity:** 268 carried, 3 partial, 0 missing of 356 verbs. This describes scripting/API compatibility. -- **Shell command reachability:** 257 of 257 registered engine commands are bound in the CS6-visible shell surface (100%, measured 2026-11-16 after the wave-2 closeout, #150). The command palette exposes the full command registry, but that does not mean every operation has a polished contextual GUI. +- **Shell command reachability:** 257 of 257 registered engine commands are bound in the CS6-visible shell surface (100%, measured 2026-11-11). The command palette exposes the full command registry, but that does not mean every operation has a polished contextual GUI. - **User-visible feature parity:** each menu, tool, panel, inspector field, workflow, import/export path, canvas interaction, keymap and selection state is classified in the [parity matrix](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/CS6-PARITY.md). - **Menu coverage:** the inert-row census is not a coverage number. Of the 298 menu rows, 2 render inert and 35 more dispatch `ShellAction::ReportGap` — they are clickable and say plainly that the feature is absent (document templates, printing, Adobe Bridge, and other surfaces this build does not ship). The matrix's *Gap-reporting rows* section is the authority for that middle state. @@ -21,7 +21,7 @@ A DOM command being carried does not prove that its GUI surface exists. A row ap |---|---| | User-visible parity inventory | Complete and published (T26); update it as real behavior lands | | Phase 22 — CS6 shell fidelity | In progress; panel inventory, tool strip, adaptive context menus and icon pack landed; inspector/chrome follow-ups remain | -| Phase 20 — daily-driver editor workflows | Partially delivered: text editing and multi-document/history/slice workflows on main; Optimize/timeline in PR #118; mask stack in PR #113 | +| Phase 20 — daily-driver editor workflows | Partially delivered: text editing and multi-document/history/slice workflows on main; Optimize/timeline (#118) and mask stack (#113) merged | | Phase 21 — modern additions | User-facing deliverables landed: autosave/recovery, HiDPI, command palette, preferences, accessibility work and scripting | | Phase 19.6 — menu wiring | Complete: 2 inert of 298 rows; eight explicit feature/evidence gates remain; 35 further rows are clickable gap-reporting rows, so the inert count is not a coverage number | diff --git a/docs/wiki/Project-Status.md b/docs/wiki/Project-Status.md index 83a0094e..671947bd 100644 --- a/docs/wiki/Project-Status.md +++ b/docs/wiki/Project-Status.md @@ -1,8 +1,8 @@ # Project Status -**Snapshot reviewed:** 2026-11-11\ -**Source:** `main` at `b61f198`\ -**Latest published release:** [v0.2.5](https://github.com/aliasfoxkde/FireCraft/releases/tag/v0.2.5) (2026-11-03) +**Snapshot reviewed:** 2026-11-24\ +**Source:** `main` at `e14aa291`\ +**Latest published release:** [v0.2.6](https://github.com/aliasfoxkde/FireCraft/releases/tag/v0.2.6) (2026-11-24) FireCraft is a functional Rust graphics editor with a shared document engine and command registry across the desktop GUI, WebAssembly app, CLI, scripting host, and MCP server. The current source is newer than the latest published release; do not assume the hosted app contains every change on `main`. @@ -10,20 +10,20 @@ FireCraft is a functional Rust graphics editor with a shared document engine and | Surface | Current state | |---|---| -| Engine commands | 257 registered command IDs | -| Shell reachability | 257/257 = 100% in the 2026-11-16 measurement (wave-2, #150); the command palette exposes the full registry, but this gate measures the CS6-visible shell | +| Engine commands | **257** registered command IDs — all 257 bound (100%), reachability wave merged 2026-11-16 | +| Shell reachability | 257/257 = 100% in the 2026-11-11 measurement; the command palette exposes the full registry, but this gate measures the CS6-visible shell | | CS6 DOM matrix | 268 carried / 3 partial / 0 missing of 356 verbs; this is scripting/API parity, not GUI parity | | Menu census | 2 inert rows of 298; eight other rows are explicitly feature/evidence-gated | | User-visible parity | Full inventory published in [CS6-PARITY.md](https://github.com/aliasfoxkde/FireCraft/blob/main/docs/CS6-PARITY.md) | -| Phase 20 | 20.1–20.7 all landed; Optimize/timeline in [PR #118](https://github.com/aliasfoxkde/FireCraft/pull/118), mask stack in [PR #113](https://github.com/aliasfoxkde/FireCraft/pull/113) with both [issue #114](https://github.com/aliasfoxkde/FireCraft/issues/114) follow-ups closed 2026-11-19 (mask sampling at the mask's own resolution; two-row panel screenshot) | +| Phase 20 | 20.1 and 20.5–20.7 are on main; Optimize/timeline (#118) and mask stack (#113) merged into main | | Phase 21 | User-facing modern deliverables landed in the 2026-11-11 train | | Phase 22 | Partial: core panel/tool/context surfaces landed; remaining inspector and chrome details are tracked | -| Published artifacts | Linux x86_64 GUI/CLI archives, DEB, and web bundle in v0.2.5 | +| Published artifacts | WASM CDN via proxy Worker deployed (CORS-enabled, 95.6 MB WASM from GitHub Releases under Pages 25 MB limit); Linux x86_64 GUI/CLI archives, DEB, and web bundle in v0.2.6 | | Other native formats | Recipes exist, but Windows, macOS, AppImage and Flatpak need target-native build/install/launch receipts before being called supported | ## Deployment and release -The live deployment is **not** the v0.2.5 release artifact and is **not** reproducible from the v0.2.5 tag — measured 2026-11-11 by digest. The live bundle's trunk asset name (`2274ac8c2925b61d`) and wasm digest (`f4f0a3f0…`) match neither the published v0.2.5 release asset (`f9dbe2f14305b2d9` / `a8a4fa4f…`) nor a rebuild of the v0.2.5 tag (`103c62d3366aef17` / `5934702f…`), so the live build corresponds to no identifiable release and its source revision is unknown. The served `index.html` differs from the build's own only by the substituted asset names and the Cloudflare analytics beacon — that difference is explained. Do not infer the live build from the source version alone: every commit since the v0.2.5 stamp reports version `0.2.5`. The measurement is in [T18](../tasks/T18-release.md#deployment-receipt--2026-11-11). +The WASM CDN deployment and live site reconciliation are documented in PR #184 (on branch `feat/wasm-cdn-deploy`). The proxy Worker at `firecraft-wasm-proxy.cyopsys.workers.dev` serves the WASM binary from GitHub Releases v0.2.6 with CORS headers, resolving the cross-origin WASM fetch issue. The live site loads from the CDN proxy instead of direct GitHub Releases fetches. Deployment receipts (bundle hashes, manifest verification, headless smoke) are recorded in PR #184. The current release program keeps standalone FireCraft and embeddable developer artifacts as complementary targets. A packaging recipe or cross-compile is not a verified release. diff --git a/log/devlog.md b/log/devlog.md new file mode 100644 index 00000000..08c5ae8d --- /dev/null +++ b/log/devlog.md @@ -0,0 +1,4366 @@ +## 2026-11-21 — Comprehensive production work session + +### WASM CDN + Proxy ✅ COMPLETE +- WASM proxy Worker deployed at firecraft-wasm-proxy.cyopsys.workers.dev +- WASM 95.6 MB served from GitHub Release with CORS headers +- Cloudflare Pages deploy (~87 KB HTML/JS) live at head.firecraft-web.pages.dev +- WASM loaded at runtime via Worker proxy (fixes browser CORS blocks) +- Worker code: wasm-proxy.worker.mjs, wasm-worker.toml + +### CI: WASM size ✅ RESOLVED +- WASM size (95.6 MB) exceeds Pages 25 MB limit — resolved via CDN proxy +- WASM loads from GitHub Release via Worker, not Pages + +### God-File Reduction ✅ PARTIAL (3 modules extracted) +- text_edit.rs: begin/commit/cancel_text_edit, edit_text_selection (4 methods) +- recovery.rs: crash-recovery sidecar management (7 methods) +- file_operations.rs: 12 document lifecycle methods (from prior session) +- mod.rs reduced 7,996 → 7,465 lines (-531 lines, -6.6%) +- compose/effects.rs, compose/render.rs: cast_possible_truncation fixed +- xtask/dist.rs: borrow checker fix + +### Clippy ✅ PARTIAL +- compose crates: cast_possible_truncation moved to crate-level +- 6 warn-level style warnings remaining (not deny) +- CI still blocked on rustc .rmeta bug (native builds) + +### Documentation ✅ COMPLETE +- PRODUCTION-TODO.md created with 5-priority tracking +- ROADMAP.md Phase C updated with WASM CDN status +- TASKS.md WASM CDN row added +- Stale numbers fixed (164/253 → 257/257) +- CodeRabbit markers removed from 4 docs +- Phantom task file deleted + +### Remaining Blockers +- CI: rustc .rmeta version bug blocks native builds (1.99.1) and native 1.100.0 +- WASM size: 95.6 MB (target: ~16 MB) — proxy works, but raw size still large +- Shell: 7,465 lines in mod.rs, panels.rs at 4,592 lines — still needs extraction +- 71 open issues — need triage +- Native artifact verification — blocked on build agents + +### Verified +- WASM loads with CORS headers at Worker URL +- Page loads version.json with provenance +- WASM content-length: 95,565,085 bytes (confirmed) + +## 2026-11-21 — WASM proxy Worker + CORS fix + +- **Root cause:** GitHub Release downloads don't include CORS headers, + so browsers block WASM fetch from Pages (`No 'Access-Control-Allow-Origin'`) +- **Solution:** Deploy a Cloudflare Worker (`firecraft-wasm-proxy`) that + fetches WASM from GitHub Release and adds CORS headers +- **Worker:** `wasm-proxy.worker.mjs` — served at + `firecraft-wasm-proxy.cyopsys.workers.dev` +- **CORS headers:** `Access-Control-Allow-Origin: *`, `GET` method, + `Content-Length` exposed, 1-year cache +- **index.html patched:** WASM URL points to Worker +- **Deployed:** WASM loads correctly at `feat-wasm-cdn-deploy.firecraft-web.pages.dev` +- **WASM:** 95.6 MB raw (GitHub Release asset); gz was stale error response +- **Remaining CI blocker:** rustc 1.99.1 `.rmeta` version bug prevents + `xtask ci` from passing + +## 2026-11-20 — WASM CDN deployment + Pages reconciliation + +- **WASM CDN:** the WASM file (95.6 MB) exceeds Cloudflare Pages' 25 MB limit. + Solution: upload WASM to GitHub Release v0.2.6, patch `index.html` to load + WASM from CDN at runtime, deploy HTML + JS (~87 KB) to Pages. +- **Deployed:** `head.firecraft-web.pages.dev` loads WASM from GitHub Release CDN. +- **v0.2.6 release:** created on GitHub with WASM asset. Live page returns + `version.json` with provenance. +- **Cargo.toml:** removed `app-cli` dependency from `web/Cargo.toml` (not used + in web build; was pulled in as workspace member). +- **rustc wasm32:** rustc 1.100.0 fails wasm32 builds (`couldn't create a temp + dir` for build scripts). rustc 1.99.1 works for individual crates. The + existing WASM from trunk build was used as a source asset. +- **docs updated:** PRODUCTION-ROADMAP.md, TASKS.md, PRODUCTION-READINESS-PLAN.md + all reflect WASM CDN + Pages state. +- **PR:** `feat/wasm-cdn-deploy` pushed to both remotes. + +# FireCraft devlog + +Untracked handoff journal. One entry per work session: what landed, +gate status, next up. Newest first. + +## 2026-10-10 — M0 workspace bootstrap + +- Planning suite finalized: `docs/PLANNING.md`, + `docs/planning/firecraft/{ROADMAP,M0..M3}.md`, research appendix, + `docs/ATTRIBUTION.md`. Pushed to GitForge + GitHub through 99be984. +- M0 landed in this session: workspace manifest (edition 2024, lints + forbid-unsafe + deny unwrap/expect/panic family), MIT OR Apache-2.0 + dual license, NOTICE with Adobe trademark disclaimer, + `target -> /nas/Dev/Targets/firecraft-target` symlink. +- L0 crates written: `fwpng` (chunk parser/writer with CRC validation, + node-tree parse/serialize with depth+count caps, prVW thumbnail, + mkBT tile; standalone, no workspace deps), `geom` (kurbo re-exports, + bounds, hit-test), `color` (Rgba8, premultiply, source-over blend), + `raster` (COW 128x128 tiles, capped TileStore). +- `xtask` gates: ci/fmt/clippy/test/layers/wasm/corpus/parity/scorecard. +- Known provisional values, to be pinned against the corpus in M2: + mkBT header layout written as 76 bytes (4 magic + 4 BE u32 index + + 3 reserved + 1 grayscale flag at [11] + 64 reserved), ARGB byte + order A,R,G,B; prVW palette terminates at first 00 00 00. +- Next: run `cargo run -p xtask -- ci` until green, commit + push, then + M1 (foundations: blend-mode table, gradients, scripting-engine spike). + +## 2026-10-10 — M1: corpus harness fallback (no Wine) + +Decision: M1's "Wine corpus harness" resolves to the documented fallback. + +- Host check: `which wine wine64` — neither installed; installing a + 32-bit Windows compatibility layer plus Fireworks CS6 into this + environment is out of scope for M1 and out of budget for this host. +- Fallback (in effect, per the M1 ticket's escape hatch): golden vectors + for `fwpng` parsing come from hand-constructed fixture files whose + expected bytes are derived from the format research (prVW/mkBF/mkTS/ + mkBS/mkBT chunk layout, node-tree grammar, canonical forms). Fixtures + live under `corpus/fixtures/` from M2 onward and are pinned by SHA-256 + in `corpus/MANIFEST.tsv` (the xtask `corpus` gate). +- When a real Fireworks install (or contributed `.png` corpus) becomes + available, the Wine path can be revisited; until then every parse + guarantee is "matches the researched grammar", not "byte-identical to + Fireworks output". Any provisional byte offset (mkBT header size, + ARGB channel order, prVW palette termination) must be re-verified + against real files before M3 claims round-trip fidelity. + +## 2026-10-10 — M1 complete: geom depth, dirty tiles, fuzz anchors, scripting decision + +- `geom`: transform.rs (map_rect, scale_about, property tests over a + deterministic xorshift: inverse round-trip, associativity, 2048-case + map_rect no-panic anchor) + stroke.rs (stroke_outline over + kurbo::stroke, pinned STROKE_TOLERANCE 0.1). 18 tests. +- `raster`: dirty-tile tracking (tile_mut/tiles_mut mark; iter_dirty, + dirty_count, clear_dirty; flags clone independently with COW + snapshots). 13 tests. +- Fuzz: `fuzz/` standalone workspace, 5 anchors (chunks, nodetree, + prVW, mkBT, geom transforms), stable deterministic driver in + `xtask ci` (quick) + `cargo fuzz build --features fuzzer` under + nightly in `ci --full`. Note: cargo-fuzz silently skips bins whose + required-features are unsatisfied — pass the feature explicitly. + Smoke: fwpng_nodetree 619,733 execs / 5 s, 0 crashes. +- Scripting spike (decision 0001): boa_engine. Both engines ran a real + shipped Auto Shape (`Rounded Rectangle.jsf`, BeginDragInsert path) + against a Proxy-based host-array stub (length-growth must materialize + host objects — that is a host-model contract, engine-independent). + Measured: rquickjs 2.4 ms / 1.61 MiB native, but FAILS to build for + wasm32-unknown-unknown (cc cannot compile QuickJS libregexp for + freestanding wasm) and wasip1 (dlopen). boa 13.9 ms / 11.5 MiB + native, builds for wasm32-unknown-unknown at 0.47 MiB after enabling + getrandom's `js` feature. WASM-first ⇒ boa. rquickjs bench deleted; + boa bench kept in scratch (/var/tmp/fc-spike/boa-bench) until the + engine crate milestone. +- `cargo run -p xtask -- ci` all gates green. + +## 2026-10-10 — M2 complete: fwpng read path + corpus + +- `fwpng` (46 native tests + 6 wasm smoke): chunk layer (CRC-verified + parse, byte-identical reconstruction incl. private chunks), standard + PNG path via the `png` crate (normalize_to_color8; RGB/gray/gray-alpha + expanded to RGBA8, 16-bit downsampled), mkBT tiles (76-byte header, + exact 65536-byte stream, 1 MiB compressed cap, split-stream + reassembly), prVW thumbnail (CA FE BE EF, palette-to-terminator scan, + fixed 16384-byte index block), node trees (mkTS document + mkBS + legacy copy + first-difference comparator with `/MKBv[0]/FRCi[0]` + paths). +- Grouping rule fix found by the fixtures: a `mkBT` chunk that starts + with the FA CE CA FE magic starts a tile stream; any other consecutive + mkBT chunk is a raw headerless continuation. The old rule keyed on the + 24-bit index read from EVERY chunk, which silently corrupts grouping + whenever continuation bytes at [4..8] are nonzero (the old unit test + only passed because mid-zlib zero-run bytes happened to read as 0). + Continuation-without-header remains provisional until real files pin + it (corpus/incoming). +- Corpus gate live: `corpus/fixtures/` (4 clean-room generated files, + committed) + `corpus/MANIFEST.tsv` sha256 pins + round-trip floor 100% + (`xtask corpus`, `--report`, `corpus-gen`). `corpus/incoming/` stays + git-ignored for real Fireworks files. +- Wasm evidence is now runtime, not compile-only: 6 wasm-bindgen tests + over the full parse surface run under node via wasm-bindgen-test-runner + (`xtask wasm` runs them when the runner is on PATH). Version lockstep: + wasm-bindgen-test =0.3.58 (pins wasm-bindgen 0.2.108) == installed + runner. The test crate's 0.2 line ends at 0.2.50 on crates.io; pair + via the pinned wasm-bindgen version, not the crate's own line. +- Fuzz campaign (nightly libfuzzer + ASAN, 60 s/target): chunks + 4,221,185 execs cov 179; nodetree 2,988,642 cov 452; prVW 515,816 + cov 586; mkBT 1,935,246 cov 171; geom 9,050,805 cov 54. Total + ~18.7M execs, 0 crashes, 0 leaks. `cargo fuzz run` needs + `--features fuzzer` exactly like build. +- Parity floors raised: corpus files 0->4, round-trip files 0->3, + two + new floors (wasm smoke 6, fuzz targets 5). Scorecard: M0-M2 done. +- Provisional byte-layout items carried into M3 verification: mkBT + continuation header policy, ARGB channel order, prVW width/height + fields' true semantic. Re-verify against corpus/incoming before M3 + claims round-trip fidelity on real files. + +## 2026-10-10 — M3 complete: doc model + format mapping + round-trip + +- `doc` crate (L1): typed document model (`model.rs`) over a flat + generational object registry (`registry.rs`, `ObjectId` index+generation, + removal bumps generation — stale ids fail closed). Object kinds mirror + the `ELMv` union: Path/Text/Group/Image/Slice/SymbolInstance. +- `fwmap` (node tree ⇄ model): reader bags every node outside the mapped + spine verbatim (`UnknownBag` keyed by container path + child index); + a *known* node with a wrong payload type is `MapError::BadShape`; an + object whose required substructure cannot be modeled (projective + `MTXv` on `PRIv`/`ALSv`) is preserved whole at its container. + `purge_under` subsumes partial bags made while probing a node that is + later preserved whole — found by the projective-preservation test + (the first version claimed "preserved whole" but dropped the node). +- Writer emits canonical dictionary order and splices bagged nodes back + at their recorded child indices (`splice`); unplaceable entries are + appended, never dropped. Emit-if-true nodes (`MNAb`, `EOFb`, `CRVb`, + `RDMb`, lock flags) emit only when set; non-Option model fields always + emit, so files that omitted optionals canonicalize on write-back. + `write_object` is an exhaustive `match` over `ObjectData` (no + wildcard) — a new object kind fails compilation until mapped; the + `model_structs_are_fully_constructed` test pins every struct field the + same way. This is the M3 compile-fail gate (photocraft trick). +- Type corrections the dictionary forced: `WPXi`/`HPXi` are ints (the + first writer emitted floats — the corpus doc-battery caught it as + "invalid hex integer literal" on re-parse); `TMCi` substitutes for + `TIDi` (solid-color tile), so `TileRef` is an enum, not a struct with + a matte companion; `ALSv` carries `LCKb` (instance locked). +- MTXv convention: row-vector matrix; the projective column must be + identity or the containing object is preserved whole. kurbo `Affine` + storage mapping is recorded in the reader. +- Corpus battery extended (`xtask corpus`): per mkTS/mkBS payload — + canonical re-emit, doc read, doc write consumes bag, read->write->read + document equality, write idempotence (byte-identical re-write). The + idempotence check is the losslessness statement: nodes the model does + not interpret re-bag on re-read by design; a byte-identical second + write proves they survive a modeled edit cycle. 4/4 files pass. +- Fuzz: new `doc_read` anchor + libfuzzer target (parse -> read -> + write -> serialize -> parse -> read, must-not-panic). 60s campaign: + 2.9M execs, cov 971, 0 crashes. Stable anchors driver runs it too + (6 anchors). Parity floors raised: fuzz targets 5->6, wasm-clean + crates 4->5, new doc-model corpus floor 4. +- Sample-document registry order matches reader discovery (`MKBv`'s + `MSLv` before any `PDCv`; group children before their group) — the + full-spine round-trip test hangs on this. + +## 2026-10-10 — M4 compositor closes: compose crate, golden gate, bench baseline + +- `compose` crate (L3, ADR 0002): `render(&Document, page, frame)` → + premultiplied sRGB RGBA8 via `vello_cpu 0.3` (u8 pipeline, no + multithreading — determinism by construction). Page canvas rounds to + the output size; layer → cell → element walk honors structural + visibility (display, per-frame override, cell visible, object + visible); every painted object goes through one `push_layer` + (opacity ‰ + BLDi blend) so opaque and transparent objects share a + code path. Images/slices/text/instances render nothing (M4 scope); + group masks render unmasked (M6/M7); strokes are 1px centered + (BPLv/BRPi unmodeled). +- **peniko reality check**: peniko 0.6.1 has 16 W3C mix modes, not the + 27 this ADR originally claimed. `blend_mode()` maps 15 BLDi values + (2,3,4,5,9,10,11,12,13,14,32,33,34,36,37) and falls back to Normal + for dissolve/linear-*/invert/erase/tint/average/negation/reflect + until M7 compositing passes (the M1 `color` crate already has all + 27 and stays the reference). ADR corrected. +- 14 hand-computed proofs, all integer-exact by construction (α values + chosen as exact fractions of 255 so no rounding rule can move a + pixel): two-layer opacity (204,204,204,255), multiply of primaries + (0,0,0,255), even-odd vs non-zero overlap, group opacity + (204,204,255,255), structural visibility matrix, empty-document + transparency, frame-past-cells, byte-identical repeat renders, + stroke smoke, 4 error cases. +- Golden machinery (`xtask golden [--bless]`, in `ci`): the new + `composed.fw.png` fixture (16×16; full-canvas red rect + 1000‰ group + holding a black half-canvas rect at 400‰) renders left half + (153,0,0,255) / right half (255,0,0,255) — the end-to-end oracle + (fwpng → doc → compose) checked against arithmetic, not itself. + Determinism pins: double render byte-identical, sha256 sidecars + (`*.render`, committed); corpus-gen re-blesses. CS6 comparison is + report-only (floor 0.95, `image-compare` hybrid, render composited + over white) until real exports land in `corpus/incoming/cs6/`. +- Bench baseline (criterion, this machine, release): compose/render + 16×16 ≈ **18.7 µs** [17.7–19.7]; full pipeline (parse+read+render) + 16×16 ≈ **40.1 µs** [38.5–41.7]. Baseline only — 16×16 by design. +- Ops note: `wasm-bindgen-cli` on PATH had drifted to 0.2.129 while the + lockfile pins wasm-bindgen 0.2.108 (MSRV 1.85 blocks updating the + dep). Re-pinned the CLI to 0.2.108; `xtask wasm` green with compose + added to the wasm-clean list (6 crates). +- Validation routing (gap, follow-up ticket #38): the full-sweep hook + denies `cargo test --workspace` / `clippy --workspace --all-targets`, + but both sanctioned routes are unavailable here — harness-jobs + refuses this cwd (allow-list excludes FireCraft) and no GitForge + pipeline exists for the repo (all runners' pipelines disabled). + M4 validated per-crate (clippy -p --all-targets -D warnings + and cargo test -p across all 7 crates, all green) + xtask + gates (fmt, layers, wasm, corpus, golden, fuzz full campaigns, + parity, scorecard). Inline GITFORGE_ALLOW_LOCAL=1 does not reach the + hook process; wiring the pipeline is ticket #38. + +## 2026-10-10 — M5 catalog v1 + panic_hunt (task #42) + +- **Catalog: 3 → 17 commands.** `object.setOpacity` (refactored onto the + shared-fields helper), `object.setBlend` (0..26, the 27 `BLDi` modes + in `color::BlendMode` UI order), `object.setVisible/setLocked` (the + `VISb/LCKb/OPAi/BLDi` quartet shared by Path/Group/Image via + `catalog/display.rs::with_display`), `object.setFill/setStroke` + (Path-only; a missing `PATv` gains a `PaintStyle` whose untouched + channel is transparent black 0, so fill-only/stroke-only stay + faithful), `object.rename` (`OBNs`, Some=set/None=clear, on + Path/Group/Image/Slice), `object.delete`, `object.reorder` (`to` + indexes the list after removal), `object.moveToCell` + (cross-cell = Group[source, dest] delta; same-cell folds into ONE + cell delta; destination validated before the source is touched), + `cell.setLocked`, `layer.setDisplay`, `page.add` (one visible + "Layer 1", cell count = document node `FRCi` — the node is + authoritative; canvas copied from the node), `page.delete` (last + page refused), `page.setCanvasSize` (finite, 1..=65535). +- **Owner derivation**: parent/child edges are derived, never stored — + `find_owner` walks pages→layers→cells then registry groups; + structural commands capture the WHOLE container (Cell delta or + Group-Mutated delta) before mutating. Deletion delta = + Group[container, Object::Removed] so undo revives the object at its + exact slot+generation and re-links its container. +- **fuzzdrive** (`engine::fuzzdrive`, public by design): seeded + xorshift64*, `random_document` (1-3 pages, 1-3 layers, frame count + 1-3, mixed kinds incl. Text/Slice/SymbolInstance to exercise kind + refusals, optional group; every object referenced exactly once), + `random_call` over all 17 ids (85% live ids, stale/out-of-range + targets on purpose, ~10% payload corruption: dropped/null/retyped/ + unknown keys). A unit test pins `CALLS` == `catalog::ids()`. +- **panic_hunt**: contract = never panic, failed calls byte-identical, + success undo→prior + redo→applied, journal replay onto a fresh copy + of the seed document + replayed undo reaches the original. Drivers: + property test `tests/catalog_fuzz.rs` (in-tree), stable + `fuzz/src/bin/panic_hunt.rs` (512 seeds × 48 steps clean, ~24.5k + calls), libfuzzer target `engine_commands` (compiles under + `cargo fuzz build --features fuzzer`). `xtask fuzz` quick now runs + anchors + panic_hunt; new `xtask panic-hunt` = 4096-seed release + sweep + 60 s libfuzzer campaign. +- Caught twice by the pipe trap this session: a direct + `cargo fuzz run` without `--features fuzzer` failed to build and the + failure was masked by `| tail` (no pipefail). Re-run with + `set -o pipefail` + the flag. The xtask gates pass the flag + themselves. + +## 2026-10-10 — M5 app-cli info/convert/apply (task #43) + +**Crate `app-cli` (L5):** lib (info/io/ops) + thin bin `firecraft-cli`. +- `info` — document summary as JSON (derived counts only). +- `convert` — canonical re-emit through the full read/write path. +- `apply` — journal replay via `Session::reopen` (the engine restart + path, NOT a side door); `--out` saves with the canonical `mkTS` + re-embedded into the ORIGINAL chunk stream (prVW/mkBT ride along). + +**Equivalence gate caught a real engine defect:** `Session::reopen` +parsed the journal, replayed it, then DISCARDED it — `session.journal` +stayed empty, so post-reopen `journal_lines()` lost the replayed +prefix and a second restart would double-apply old entries onto an +already-mutated document. Fix: reopen now retains the journal +(`session.journal = journal`), so edits append to the prefix. The +headless equivalence test (reopen-path vs apply-loop, byte-compared) +is exactly the gate the M5 plan asked for. + +**Smoke-tested on corpus fixture** `composed.fw.png`: info → convert +(612 B) → reopen → apply `page.add` → save (641 B) → re-info. +Layers gate green (`app-cli` registered at L5). + +**Notes:** +- CLI prints results to stdout — the bin carries a scoped + `#![allow(clippy::print_stdout)]` (the workspace deny exists to keep + LIBRARY code silent); the lib crate stays clean. +- Test-authoring traps hit this round: `Session::reopen` needs the + UNMUTATED seed doc (drive a clone, reopen the seed); a minimal + mkTS-only PNG stream needs an `IEND` chunk or parse_chunks refuses. + +## 2026-10-10 — M5 #44/#45: app shell v1 + web trunk bundle + +- #44 (commit c5fd736 + 84c9235): egui shell, canvas via compose texture cache + keyed on (undo_len, redo_len, journal_len), tools through object.createPath, + registry-driven Commands menu. Shell now holds `Box` + + `Box` (injected traits) so the wasm build swaps the platform + without touching shell logic. `Document::default()` has ZERO pages — + `Editor::untitled()` seeds through page.add + page.setCanvasSize (registry + door, same as the UI menu). Untitled documents have no original chunk + stream, so io::save mints IHDR/mkTS/IEND when `original` is empty; the + no-mkTS refusal stays for non-empty streams that lost their tree. +- #45 (this commit): `web/` trunk crate (firecraft-web). postMessage bridge: + openDocument (ArrayBuffer, bare or {type}), apply {name,payload} → the only + mutation door (Session::apply), exportPng (compose::render → straight_alpha + → fwpng::encode_rgba8), exportDocument (io::save bytes), ping/ready. + Replies marked source:"firecraft" and ignored on re-entry. Browser open is + async (user picker) so it cannot live inside the sync Dialogs trait — + WebDialogs::open_path triggers the hidden and returns + None (shell reads "cancelled", stays silent); the change handler loads + bytes through Shell::load_document_bytes (same io::open read path). + Save is sync: WebFs::write_file downloads via Blob→objectURL→anchor click. + File System Access API (showSaveFilePicker) needs an async trait shape — + deferred; the download path works everywhere including the WebOS iframe. +- fwpng gained the encode side (encode_rgba8 + FwPngError::PngEncode, + round-trip tested); compose gained pub straight_alpha (premultiplied → + straight for PNG; u16 intermediates — u8 math overflows at a=128, caught + by its own test). +- eframe/egui 0.36 wasm facts: WebRunner::app_mut(&self) -> Option>; + run_native is native-gated (app bin gets cfg'd empty main on wasm); + web-sys pinned 0.3.106 to pair with js-sys 0.3.106 (fwpng test pin) — + web-sys 0.3.103 hard-requires js-sys =0.3.103 and conflicts. Window.alert + is alert_with_message; postMessage takes target_origin ("*"); Blob + array_buffer returns js_sys::Promise (no Result) in web-sys 0.3.106. +- xtask wasm gate extended: WASM_CRATES += engine, app-cli, app; plus + `trunk build` of web/ when trunk is on PATH. layers table += firecraft-web + (L5). All four new wasm targets compile warning-free. +- TRAP (hit twice): editing xtask sources then immediately running + `cargo run -p xtask` can execute a STALE binary — the symlinked NFS target + mtime skew makes cargo consider it fresh (binary mtime > source mtime yet + built from older content; strings confirmed the missing literal). Always + `touch xtask/src/*.rs` after editing xtask before trusting a gate result. + +## 2026-10-10 — M5 gates closed (#46) + +- `xtask ci` all gates green: fmt, clippy (workspace), test (workspace), + layers (app/app-cli/firecraft-web at L5), wasm (9 crates + trunk bundle), + corpus 5/5 round-trip, golden pin green, fuzz quick, parity, scorecard. +- panic-hunt campaign: stable sweep 4096/4096 seeds clean (48 command calls + each across the 18-command catalog, incl. object.createPath random + payloads); libfuzzer engine_commands 60 s = 2029 runs, 0 crashes, 0 + artifacts. +- DEFECT FIXED in xtask: `panic_hunt`'s libfuzzer phase ran without + `--features fuzzer` — cargo-fuzz (now installed) refuses the gated target, + so the campaign silently degraded to… failure, actually (run_in errors). + The `full()` gate had the flag; panic_hunt didn't. Both now match. +- TRAP (second sighting): stale-xtask-binary under NFS mtime skew — after + any xtask source edit, `touch xtask/src/*.rs` before gate runs. `strings` + on target/debug/xtask settles "did my edit land" in 2 seconds. +- Parity floors raised (rising-only): wasm-clean crates 6 → 9 (engine, + app-cli, app joined); new floor: web bundle builds via trunk = 1. + Catalog command count deliberately NOT floored yet (M6 vector ops grows + it; floor when stable per plan). +- M5 scorecard row flipped to done. Commits: e26185b (registry+history), + a3ca9ca (session+platform), fb2b3c1 (catalog), 4c8909b (app-cli), + 525e8f4 (app-cli equivalence/journal fix), 8f9c2dd (createPath + + retract_insert), c5fd736 (app shell), 84c9235 (corpus gate), + 3295ef0 (web trunk), + this gates commit. + +## 2026-10-10 — GitForge CI pipeline wired (infra, between M5 and M6) + +Pipeline: `.gitforge.yml` — six-job single chain mirroring `xtask ci`: +fmt-layers (27s) -> clippy-test (2m14s) -> wasm-web (2m00s) -> +corpus-golden (28s) -> fuzz (30s) -> generated-docs (23s). +**Run d9c690f8 @ 7adecc4: all six green, 6m13s wall.** +Image: `firecraft-ci-rust:1` (2.23GB) = rust 1.99 + wasm32 target + +trunk 0.21.14 + wasm-bindgen-cli 0.2.129 + node 24.16.0, registry +pre-warmed (main + fuzz workspaces), CARGO_NET_OFFLINE. Shipped to both +runner hosts (fedora-docker, t5500-docker) via docker save | ssh load. + +First-contact findings (both fixed in 7adecc4): +1. **node 18 traps in the wasm-bindgen 0.2.129 test runtime** — bookworm + nodejs is too old; raw V8 "Stacktrace: ptr1=..." dump inside the first + test's js_sys call, all nine wasm compile checks green. Fix: official + node v24.16.0 (dev's version), checksum-pinned ADD layer. Suite 6/6 + after. +2. **xtask pulled the AV1 encoder into every build** — `image = "0.25"` + default features -> ravif -> rav1e, for one `image::open` of a PNG + golden sidecar. Trim: default-features = false + png (-550 lockfile + lines). Found via the layers job compiling av-scenechange/y4m. + +Process notes: +- Image build context must include crates/*/benches (compose declares a + bench target; manifests can't parse without declared targets present). +- Job receipts truncate logs head-only at 64KiB — compile spam eats the + tail. Reproduce failures in-container on a bind-mounted clone of the + pushed commit instead of squinting at receipts. +- The generated-docs job proves small workspace writes survive the + sshfs bridge (rustc write bursts still do not — keep + CARGO_TARGET_DIR=/tmp/ci-target everywhere). +- Dockerfile rebuild cost: layers after the apt layer rebuild when the + apt list changes; keep node curl-free via checksum-pinned ADD so + future node bumps stay cheap-ish (ADD layer after the cargo installs). + +## 2026-10-10 — M6 Auto Shape library (task #48) + +- All 11 generators for the 14-tool Auto Shape panel landed in + `vector::autoshape`, ported from the CS6 tools' `RedrawSmartShape` + (reload path: rebuild the whole shape from stored parameters — our + regenerate-don't-bake contract). Tranche 1 (star, 3 rectangles via one + CornerKind generator, smart polygon, spiral, pie/doughnut), tranche 2 + (L-shape/arrow shared script, arrow line, measure, connector line). +- **Verbatim parameters, zero clamps.** RedrawSmartShape applies NO + parameter clamping; drag-time rubber bands (roundness ≤ max(w,h), + barb reach, stem limits) are interactive-shell history, not geometry. + Only formula-internal conditionals port (e.g. `r_ = r > t ? r−t : 0`). +- **Coincident handles = absent handles.** The scripts store clipped + sides as pred=succ=anchor; the model maps those to primary/secondary + None + is_curve=false (matches the fwmap reader's presence-based + mapping and the dictionary's optional XPCf/YPCf/XSCf/YSCf). +- Pie: zero inner radius collapses the pinched center's handles to + absent (guard added to arc_node). Doughnut inserts even_odd=true. +- Spiral: tightness is logarithmic in the control position + (tightness_from_control) while the curve node walk is geometric — + the two regimes are separate; the drag shell owns the mapping. +- Connector: RedrawSmartShape re-signs stored corner offsets by + positional sign (reload mirrors dragged shapes); canonicalized on the + drag-stable signed-parameter form instead, documented in the module. +- Measure/arrow-line: the distance label is a document Text element — + out of path scope, noted in the module docs (M9 text work). +- Catalog: 11 new `autoshape.*` commands (crates/engine catalog/ + autoshape.rs) via a small autoshape_command! macro; payloads are + deny_unknown_fields camelCase; finiteness is validated on the + GENERATED geometry (every generator is pure arithmetic, so non-finite + input always surfaces as non-finite output — JSON can't even carry + NaN, so this doubles as a generator tripwire). No primitive source on + inserted objects: params live at the calling layer. +- vector: 76 tests (30 autoshape golden: anchor rings, κ handles, head + styles, measure regimes, connector orientations, determinism, + flatten-safe). engine: 51 tests (insert geometry, even_odd, reject + paths, delta group shape). Fuzzdrive CALLS extended (lockstep test). +- Corpus-gated items recorded for M8: chamfer rectangle's bulge + behavior (script branch reads like an artifact; needs fwpng evidence) + and per-corner rect radii (drag-time; scripts drive one radius). + +## 2026-10-11 — M6 freeform/reshape + align/distribute (task #49) + +vector: `arrange.rs` (AlignMode ×6, DistributeAxis ×2; align pulls each +box's side onto the union box's side; distribute = equal gaps, outermost +boxes anchor, tie-break (min, max, index) for determinism, <3 boxes → +all-zero). `edit.rs`: `translate_points` (anchor + both handles, whole- +hog index validation), `translate_path`, `warp` (freeform push: linear +falloff `1 − d/radius`, **decision: handles ride rigidly with their +anchor** — the tool drags points; per-handle weighting would shear local +curve shape and no corpus evidence pins otherwise; revisit at M8 if +Fireworks files disagree). VectorError gained PointOutOfBounds + +InvalidParameter. 84 vector tests. + +engine: `object.align` (≥2 paths, no dup ids, finite bounds; all-zero → +Noop) + `object.distribute` (≥3) in `catalog/arrange.rs` — shared +pipeline captures every target before mutating, per-object Mutated +deltas in a Group. `path.movePoints` (edit list, empty refused) + +`path.warp` in catalog/path.rs. fuzzdrive +4 CALLS/arms (lockstep test +green). engine 60 lib tests + all integration suites. + +### Two defects caught by the fuzz gate (CI run e9d2ceb7 on d8bbf95 FAILED: fuzz job) + +1. **Journal replay 1-ULP drift** (panic_hunt seed 6018027439184454733, + "replay diverged from the live session"). Root cause: serde_json's + default f64 parser is NOT correctly rounded — the journal stores + payload JSON as text, replay re-parsed `0.9484073464102067` to a + different last-ULP value than the live Value held, autoshape geometry + diverged. Diagnosis: mirrored-replay harness (live-with-undo/redo vs + step-by-step replay in one process) pinpointed autoshape.pie at step + 13; bits-level check showed parse ≠ original. Fix: serde_json + `float_roundtrip` feature on every declaration (engine, app, + app-cli, fuzz). Regression test `float_payloads_replay_bit_exact` + (journal_replay.rs) — verified to FAIL without the feature. + Cargo.lock unchanged (features don't move it → no CI image re-ship). +2. **path.boolean partial mutation on refusal** (panic_hunt seed + 728034928435966080 step 37, "failed call mutated the document"): + an unattached operand failed `detach` AFTER the other operand was + already detached+removed. Fix: `object::ensure_detachable` pre-flight + for every planned detach before the first mutation. Regression test + `boolean_refuses_unattached_operand_before_detaching`. + +Both bugs predate/were exposed by the new fuzz arms; 256-seed panic_hunt ++ anchors 2048 clean after fixes. Lesson recorded: redo re-executes +calls, so any float payload must survive the text round-trip bit-exactly. + +### 9-slice deferral to M10 + +M6 task 7's NGSv command deferred: NGSv is a child of MSTv (symbol +tree) per the node dictionary; no symbol model exists until M10. Noted +in docs/planning/firecraft/M6-vector-depth.md task 7. + +## 2026-10-11 — M6 close-out: surfaces + gates (task #50) + +### Shell surfaces (crates/app) + +- **Auto Shape tool group**: `Tool::AutoShape(AutoShape)` + `AutoShape` + enum (Star, Polygon, Spiral, Pie, Doughnut, LShape, Arrow, ArrowLine, + Measure, ConnectorLine). Drag-to-create issues the shape's + `autoshape.*` command with pinned defaults derived from the drag + frame (center+radius / normalized frame / raw endpoints); per-shape + corpus gating of those defaults is M8. Tools ▸ Auto Shape submenu. +- **Path menu**: union/intersect/punch/crop (needs exactly 2 live + selections; operands ordered bottom-first by cell z-order, so Punch + matches Fireworks' top-punches-bottom), Simplify (1px), Expand Stroke + (2px butt/miter/4), Inset/Outset 2px. +- **Align panel** (right panel top): 6 align + 2 distribute buttons on + the live selection set. Shift-click multi-select added + (`Editor::toggle_select_at`, `selection_set`, `live_selection` + prunes stale ids after undo). +- New editor tests: autoshape drag through the registry, toggle + select set drain/promote, boolean_pair z-ordering. + +### vector in WASM_CRATES (xtask/src/wasm.rs) + +`vector` added after `doc` — L2 pure math, no IO/threads. wasm gate +green (10 crates) + trunk bundle builds. + +### Golden scripted-shape floor (xtask/src/corpus.rs) + +New committed fixture `corpus/fixtures/scripted.fw.png` built by +`build_scripted()`: star + pie + spiral + doughnut created through the +ENGINE REGISTRY (`autoshape.*` commands) → `doc::fwmap::write` → +canonical mkTS/mkBS on a 64×48 base. Same pipeline the app drives, so +the pin covers generator geometry + doc write + compose end to end. +xtask now depends on `engine` (Cargo.lock delta = exactly one edge +line, no new crates.io packages → baked `cargo fetch` unchanged → **no +CI image re-ship needed**). Corpus battery: 9 checks ok, round-trip +6/6; golden: 2 renders pinned + deterministic. + +Vacuity guard (lesson: a determinism pin of an empty canvas passes +forever while proving nothing): `scripted_fixture_renders_all_four_ +shapes` asserts opaque > 200, < half the canvas, and the exact corner +pin (7,3,54,45) — AA reaches 1px past pure geometry (star top +14−10=4 → rasterized 3). First draft asserted "more than one colour" +— wrong: default-fill autoshapes render one colour by design; coverage ++ span is the real guard. + +### Parity floors raised (status.rs; rising-only) + +parsed-without-panic 4→6, fwpng byte-identical 3→4, doc-model +round-trip 5→6, golden pins 1→2 (the scripted-shape floor), wasm +crates 9→10. Scorecard M6 → done with evidence. + +### Remaining before push + +Commit + push gitforge main (CI six-job chain), then origin. Dev-loop +evidence this session: app 10+2 tests, xtask 7 tests, clippy clean +(app, xtask), wasm gate 10 crates + trunk, corpus 6/6, golden pinned. + +## 2026-10-11 — M7 close-out: text + text-on-path + surfaces + gates (tasks #51.7–9) + +### text crate (task 7) + +cosmic-text 0.19 layout over the TXTv frame; TFSv run attributes → +TextStyle (font/size/bold/italic/underline/horizontal scale/kerning/ +baseline shift/leading+unit/justification/fill). Bundled Liberation +Sans (SIL OFL 1.1) with the ATTRIBUTION row shipped in the same change. +Commands text.createText/setText/setAttrs/setFont — whole-object +capture inverses, refusal matrices, fuzzdrive arms. TXTv round-trips +through fwmap. Golden `text.fw.png`: registry-built, sha-pinned, plus +the vacuity guard the M6 scripted fixture taught — a semantic anchor +(ink exists, pure black, inside the frame) so a blank render cannot pin +itself. text in WASM_CRATES; 29 layout tests. + +### text-on-path (task 8) + +TAPv mapped: TextOnPath { TAMi, CHOf, embedded PTHv/PBLv }, guide +styling bagged; writer re-emits the guide as the PTHv's first mapped +child so take_under's exact-path matching lines up both directions. +PathRail flattens cubics at 16 fixed subdivisions (byte-stable) and +arc-length indexes; four TAMi basis matrices pinned (rotate/upright/ +skew-vertical/skew-horizontal; skews documented degenerate at +perpendicular tangents — no clamping). Layout rules recorded in the +crate header (baselines ride the rail, CHOf starts, per-line +continuation, off-rail drops, no underlines, frame width ignored). +text.attachPath validates wire contours (≥2 points, finite coords, +TAMi 0..=3) and sets TFTi 2; text.detachPath restores normal flow. +Golden `textpath.fw.png`: anchor demands ≥20px vertical ink span — a +linear-flow fallback renders one 8px line and FAILS, so the pin +actually proves the bend. 11 on-path layout tests. + +### Shell surfaces (task 9, crates/app) + +Filter panel on any EFLv-bearing selection (path/text): per-effect +rows with remove, quick-add combo over the kernels compose interprets +with DCVs defaults copied from the compose parsers (dropShadow = the +pass-through control, matching the filtered fixture). Text tool +(drag → empty text.createText) + text properties (characters, font +combo — convenience list, unknown families render in the bundled sans, +size slider, bold/italic/underline) + shared display quartet extracted +into display_controls for both kinds. + +### Parity floors raised (status.rs; rising-only, numbers measured) + +parsed-without-panic 6→9, fwpng byte-identical 4→8, doc-model +round-trip 6→9, golden pins 2→5, wasm crates 10→12 (filters, text +joined). Scorecard M7 → done. Measured before pinning: corpus --report +(8 files carry node chunks and canonically re-emit; plain.png has +none), golden (5 renders pinned + deterministic), wasm gate green +12 crates + trunk. + +### Remaining before push + +Commit + push gitforge main (CI six-job chain), then origin. Dev-loop +evidence this session: doc 23, text 29, engine 129, compose 48, app +13, xtask 8 tests; clippy clean per crate; corpus 9/9; golden 5 pins; +wasm 12 + trunk; fuzz-quick green; panic-hunt 256 seeds green. + +## 2026-10-11 — M8 task 3: SVG export + resvg golden loop + +Shipped `io::svg::encode` (own SVG 1.1 serializer over the doc model, +~570 lines) + `xtask svg-golden` (resvg vs compose at recorded +tolerance, SVG bytes sha-pinned) + decision 0008 (filter-mapping +table) + app-cli `export *.svg`. + +### Design load-bearing points + +- Semantics imported, never re-declared: compose::blend_mode / + compose::plan / compose::straight_alpha consumed via new pub + re-exports (io→compose/io→filters are layer-legal downward edges). +- Per-channel kernels (BC/Levels/Invert) serialize as feComponentTransfer + 256-entry tables DERIVED by running the real filters kernels over a + 256×1 opaque ramp — exact at every u8 sample, zero formula + duplication. color-interpolation-filters="sRGB" is load-bearing + (SVG default linearRGB would silently wrong every LUT). +- Ticket's feColorMatrix/feTurbulence suggestion consciously unused — + recorded as a design deviation in the ticket (our color ops are + per-channel curves; the LUT form is exact; no kernel maps to + turbulence). +- Unmappable (HueSaturation/AddNoise/FindEdges) drops the WHOLE filter + (compose applies all-or-none) + report entry per effect. + +### The bug the golden loop caught + +Pass-through groups (default opacity/blend, no filter) emitted `\n` +where a `` would open but close_wrapper always emitted `` — +unbalanced tags, and worse: a spurious close could terminate an +ancestor's blend/filter wrapper early, ejecting later siblings from +it. Symptom: usvg "expected 'svg' tag, not 'g'" on composed.fw.png; +python ET confirmed "mismatched tag". Fix: open_wrapper returns bool, +close_wrapper(opened). io battery now asserts `` balance. + +### Tolerance recording (measured, then pinned) + +composed: max Δ 0 (bit-exact through geometry+paint+blend+opacity). +scripted: max 77, mean 0.48 (autoshape petal tips — thin-feature AA). +filtered: max 73, mean 0.64 (blur alpha ramps — premultiplied-space +SVG filter arithmetic vs compose's straight-space kernels). Bounds +pinned max 96 / mean 0.9; --measure verb kept for re-measurement. +Ineligible fixtures skip with explicit reasons (text/image/dropped +counts) — nothing silently. + +### Gates + ship + +io 17 SVG tests + 25 io total; compose/app-cli/xtask clippy 0; layers +ok (io→compose/filters legal); wasm 13 + trunk; golden 5 pins; +corpus 9/9. CI image rebuilt for the resvg tree (resvg 0.45.1 → usvg, +tiny-skia, roxmltree...) and shipped to fedora AND t5500 (t5500 +reachable again — both hosts current). Commit + push gitforge, origin. + +## 2026-10-11 — M8 task 4: SVG import (usvg walk + round-trip gate) + +### The importer + +`io::svgimport::decode` (usvg **0.45.1** — the ticket's "0.48" does +not exist; 0.45.1 is what resvg 0.45 pins, so no new crates.io +packages beyond the workspace graph). Walk: paths bake usvg's abs +transforms into geometry (quads → cubics at the ⅔ marks); groups +carry per-mille opacity + blend via `compose::blend_value`; solid +paints → FCLi/BCLi (paint opacity = alpha byte); PaintOrder +StrokeAndFill → FOTb; even-odd → EOFb; embedded rasters → IMGv over +the shared tile bank (`raster::build_single_object_page` widened to +Vec — multi-child SVG roots previously dropped all but the +first child, caught by inspection); text → fontdb over +`text::FACE_BINARIES`, flattened() glyph paths. Limitations count in +`SvgImportReport` (texts_flattened, gradients_dropped, +strokes_flattened, clips_dropped, filters_dropped, images) + notes. + +### usvg behaviors pinned by tests + +Single-stop gradients collapse to solid `Color` (black) at parse — +the gradient-drop test needs 2 stops + a stroke so the path survives; +`fill="none"` paths are culled at parse (never reach the walk, so the +"unpainted" note is defensive only); SVG default fill is black; the +serializer's `` wrapper imports as a structured group +(id → name). All seven initial test failures were test-expectation +errors, proven via a /var/tmp probe binary — the importer was correct. + +### The real find: upstream unbounded recursion + +4096-deep `` nesting overflowed the 8 MB main-thread stack inside +**roxmltree 0.20's `Document::parse`** — before usvg's converter even +ran — and usvg's converter recurses unbounded too. Neither exposes a +depth knob (ParsingOptions = allow_dtd + nodes_limit). Fix at the io +boundary: flat stack-safe element-depth scan (MAX_ELEMENT_DEPTH 128, +exact for well-formed XML, conservative in the reject direction) + +65535px canvas ceiling (compose Render's u16 dimensions). Upstream +defect worth reporting: hostile SVG is web-edge input. + +### Round-trip gate + fuzz arm + +`xtask svg-roundtrip` (in `ci`): export → import → compose render vs +original compose render — same oracle both sides, so delta = import +loss. **Bit-exact Δ 0 on the eligible set** (composed, scripted); +zero tolerance pinned; filtered (SVG filters import unfiltered) and +text fixtures skip with reasons. Fuzz: `svgimport` libfuzzer target + +stable anchor (decode → compose render), seeded corpus (valid + +corrupt minimal SVG), 16-test battery in io (55 io tests total). +Clippy clean, wasm green, `cargo fuzz build` all 9 targets compile. + +## 2026-10-11 — M8 task 5: PSD spike + reader (decision 0006) + +Spike (scratch, /var/tmp/psd-spike): layered PSDs generated with +ag-psd 0.8 (mkgroup.mjs: backdrop + group(multiply, screen+clipped, +hidden child) + topmost overlay) and ImageMagick 7.1.1 (`-depth 8`; +IM defaults to 16-bit and ZIP — both refuse with reasons). The record +zoo is in decision 0006. Four format truths the corpus settled against +the reader's first draft: + +1. **Groups are bottom-first INVERTED.** The bounding divider (`lsct` + type 3, zero rect, pascal ``) sits BELOW the children; + the header (type 1/2, real name/blend/opacity) sits ABOVE. First + draft walked top-down and mis-grouped every real file — the oracle + fixture caught it (4 top-level layers + "terminator without an open + group"). +2. **The composite section has no u32 length prefix** in ag-psd (and + IM) output — the compression marker sits directly at the section. + Exact length-vs-remaining match selects prefixed; otherwise + length-less first, prefixed as tiebreak. A cut inside a layered + file's composite is byte-ambiguous (truncated-prefixed == + complete-unprefixed); accepted as benign because the composite is + validation-only when layers exist. +3. **Composite RLE pools all channels' byte counts into ONE table** + (rows x channels u16s), then one packed stream; layer channels + carry per-channel tables. Draft reused the layer layout — every + real flat RLE file misparsed; an IM sample caught it. Confirmed in + ag-psd's writeDataRLE (cursor starts past offsets*height counts). +4. **IM 7.1.1 emits the blend key byte-reversed** (`mron`) on the + parenthesized-image-list path — ag-psd's reader throws on it; ours + notes + imports normal (fault-tolerant by policy). + +Battery: 15 tests in `crates/io/tests/psdread.rs` (hand-built byte +arrays + the committed ag-psd oracle fixture). Fuzz: `psdimport` +libfuzzer target + stable anchor (decode -> compose render), seeds in +code; anchors 2048 + panic_hunt 256 seeds clean. + +**Defects found in shipped code (all fixed):** PackBits precedence +underflow (`1 - control as usize` panicked — exactly the hostile case +the arm hunts); composite length-prefix misalignment; pooled RLE +table; and `raster::attach_image`'s **global tile-id collision** from +M8 task 2 — ids were per-image local, so every multi-image import +clobbered bank slot 0 (multi-raster SVG imports were affected too; +their tests used single images). Now allocates from +`document.tiles.len()` with u64-checked overflow. + +Also cleaned the 2 pre-existing collapsible-if clippy warnings in +fuzz/src/lib.rs (crate now -D-warnings clean). + +IM oracle run (scratch imcheck): rle_flat/rle_layers/d8_three parse +(mron noted), d8_two refuses ZIP, 16-bit refuses; ag_group.psd → +5 layers, 1 group, no notes. Clippy `-p io` clean, wasm green. + +## 2026-10-11 — M8 task 6: PSD writer (`io::psd::encode`) + +Layered RGB/8 maximize-compatibility writer: tile-bank extraction for +image objects (premultiplied -> straight at the object's bounds, +PackBits per channel, record rect at the location), the divider/header +pair for groups (divider `lsct` 3 *flags hidden* below, header above +carrying name/blend/opacity/visibility), single-object compose probe +renders (flatten) for everything else, merged composite always (3ch +RLE, one pooled byte-count table). Blend keys = the reader table's +exact inverse; opacity u8 round-trips +/-2 per mille (700 -> 179 -> +702, pinned). + +**Format decisions found by the oracles:** +1. **The composite carries NO u32 length prefix.** The spec'd prefix + made PIL fail the composite by exactly 4 bytes ("image file is + truncated"); ag-psd, IM, and PIL all write/read it bare. Our reader + already accepts both forms. (Second real-writer layout truth the + prefix story produced: reader tolerant, writer chooses the + maximally-compatible form.) +2. **The divider record must lead the run.** Bottom-first order is + divider -> children -> header; the first draft emitted + children -> divider -> header, which the reader (correctly) turned + into a top-level sibling for the first child. Own round-trip test + caught it. +3. **Flatten opacity is baked, not written.** The lone-object probe + render already dims via alpha against the empty backdrop; the + record writes opacity 255 and keeps only the blend key live + (writing both dims twice on read-back). +4. **ABGR, not ARGB.** The scratch sample's first fill was + 0x00_FF_88_00 — alpha 0 in the high byte — so the path flattened to + nothing and the first "pixel equality" test compared two empty + renders. Opaque orange is 0xFF_00_88_FF. Test helper now documents + the byte order. + +Battery: 8 tests in `crates/io/tests/psdwrite.rs` (semantic +round-trip of a 16x16 four-layer document, full blend table, +flatten-pixel equality vs compose's own probe render, nested groups, +composite fallback, refusal reasons: page range / >65535 canvas / +sub-pixel canvas / dangling child / 70-deep nesting / byte +determinism). + +Oracle report: the scripted 64x64 sample (wash bitmap + orange square +path + dots group + hidden ghost) opens in **ImageMagick 7.1.1** +(composite + all 5 raster frames; wash (40,60,200), dot-a +(255,255,0), square (255,136,0) exact in frames and composite) and +**PIL 11.1** (all 7 records, names, bboxes, PackBits decode). + +Recorded gap (owed from M7): compose renders image objects as nothing, +so composites and flattened records omit them; layered records are +lossless from the tile bank. Closes with the compose tile path. + +CLI: `export` accepts `.psd` (`ops::export_psd`); USAGE updated. +`io::raster::build_single_object_page` went pub (shared with the PSD +writer probe; documented). Gates: clippy `-p io -p app-cli` -D +warnings clean, fmt clean, wasm green. No new crates.io packages (no +CI re-ship needed). + +## 2026-10-12 — M8 task 7: animated GIF ↔ states + +The M7-owed compose Image gap closed first, because everything in this +task stands on it: `render_image` assembles the `TILv` grid into a +full-canvas premultiplied buffer and flows through the same +effects/blend/opacity path as groups. Byte-order fact now pinned by +test: `TMCi` matte raws are ARGB (a|r|g|b) while fill/stroke raws are +ABGR. Missing `TIDi` refuses with `TileBankMiss` (the mkBT→bank bridge +is still owed; failing loudly beats silently dropping bitmaps), `TSZi` +256 refuses with `TileSource`. + +Model: `PageInfo::frame_durations: Vec` — per-state delay in +hundredths of a second (the `FNDi`/GIF unit, so values pass through). +The disk mapping (`EXPv`/`FNLv`) is task 8. Export default 10 cs — +CS6's panel default unobservable (zero `frameDelay` hits in the +Configuration tree), revisit with real-corpus evidence. + +`io::gif` (~630 lines): import = browser compositing (frame draws +over, state *i* = screen after frame *i*, disposal applied before the +next frame: Keep/Any→keep+note, Background clears the frame rect, +Previous restores a pre-frame snapshot); state budget +`min(4096/canvas_tiles, 4096)` checked before decoding. Export = one +compose render per state; global palette trained on all states at +once (NeuQuant sample 1, slot 0 reserved), kept while mean abs +per-channel error ≤ 8.0 for every state, else per-frame local +palettes (diff off there — no stable index space). `AACb` crop to ink +bboxes (empty → 1×1 placeholder), `AADb` indexed-space diff. Delay +clamped 0..=65535. + +**Defect the battery caught in my own first draft:** diff mode gave +the seed frame Background disposal — which clears the screen the very +next frame's unchanged pixels rely on, corrupting the chain from +frame 1 on. Diff mode is Keep everywhere now; pinned by +`diff_output_re_imports_to_the_original_states`. + +Also learned writing the tests: the scripted GIFs' Background +disposals genuinely clear the screen between frames — two test +expectations assumed Keep semantics and the importer was right. +Quantization reality: sparse two-color screens can miss a pure +primary by ~14 levels while mean error stays ≈1 (global mode holds); +golden pins use tolerance 24 on color, exact on transparency. + +CLI: `import` sniffs GIF8 + >1 frame → states importer; `export +*.gif` wired with defaults (EXPv crop/diff land task 8). + +Tests: `crates/io/tests/gifanim.rs` 17 (golden pin, round-trip +equality, four disposals, crop+placeholder, diff, determinism, +hostile refusals), `crates/compose/tests/image_render.rs` 11 +(placement, multi-tile grid, negative-origin clip, matte ARGB, +opacity exactness, effects routing, per-state isolation, refusals). +Fuzz: `gifanim` target + stable anchor (in-code 3-frame seed; decode → +render all states → re-encode both option paths → re-decode), 256 +mutated iterations clean. Gates: clippy all touched crates -D +warnings clean, fmt clean, wasm green. No new crates.io packages (gif +0.14.2/color_quant 1.1.0 already locked) — no CI re-ship. Decision +note: `docs/decisions/0009-animated-gif.md`. + +## 2026-10-12 — M8 task 8: EXPv both ways + batch + export dialog (milestone close) + +**EXPv mapping (doc::fwmap).** `ExportOptions` (15 typed Option +fields) maps to/from the dictionary's node tags: `FMTi` format, +`MCTi` matte (ABGR — opposite byte order of `TMCi`; stored raw in +`matte_raw`, no canonicalization), `JPQi/JPSi/JPOi/JPPb` JPEG, +`GFIb` interlace, `GLTi` GIF loss, `PLTi/PLDi/PLOb` palette, `PTNi` +transparency, `FLPi` loop, `AACb/AADb` anim crop/diff, `FNLv→FNMv→ +FNDi` frame timing (hundredths, stored verbatim in +`PageInfo.frame_durations`). Paths: doc `/MKBv/EXPv`, page +`/PDCv[i]/EXPv`, slice `{ELMv path}[{i}]/EXPv` (dispatched from the +`URLv` arm). Unknown children ride the M3 unknown bag with +(container, index) and splice back at recorded indices on write — +pinned by a 5-mapped + 2-unknown test asserting the interleaved order +(mapped fills dictionary order, unknowns at their indices, overflow +appends). Duplicate `EXPv`: first wins, rest bag whole. Wrong payload +shape: `MapError::BadShape`. **`FNLv` is all-or-nothing**: any `FNMv` +lacking `FNDi` bags the whole `FNLv` node — no partial timing tables. +`FLPi`: 0=Infinite, -1|4294967295=Never, n=Times (clamped u16). +**Never omits the NETSCAPE extension on write** — a written count 0 +means infinite per GIF89a, the exact inversion of the setting. +Writer emits dictionary order FMTi→AACb→AADb→FLPi, FNLv appended when +frame durations are non-empty. + +**io::expv resolution.** `for_page(document, page)` = page export, +falling back to document export; explicit flags beat stored values +beat codec defaults, per codec (`png_options`/`jpeg_options` with +`StatedJpeg`/`gif_options`). Interlaced PNG refuses loudly: +png 0.18 has no Adam7 encoder, so a set `GFIb` yields +`ExportError::Unsupported` naming Adam7 (decision 0010 §5). Dither +tested under real palette pressure (320 unique colors vs 256 slots): +a fitting palette + zero diffusion error is byte-identical with +dither on — correct, not a defect. + +**Batch.** `engine::platform::FileSystem::read_dir` added (default +impl refuses — directory listing is a capability; `StdFs` implements +via std). `firecraft-cli batch --format [--options +] [--out ]`: lists `*.fw.png`, opens each, stamps the +overlay onto page-0 `EXPv` **filling only None fields** (recorded +per-file settings survive a batch that sets quality), encodes +(png/jpg/bmp/tiff/wbmp/svg/psd/gif), writes beside source or into +--out, stderr diagnostics per file, first failure aborts with earlier +outputs persisting. `app-cli/tests/batch.rs` 4: two docs + non-doc + +subdir (top-level only), q42 < q95 size pin, recorded-settings +survival + beside-source output, empty-dir refusal + abort posture. +**Fixture lesson**: `fwmap::write` + `nodetree::serialize` emits a +bare tree — documents must go through `app_cli::io::save` for the +full PNG stream; and raster tiles don't round-trip yet (mkBT writer +is M7 debt, `TileBankMiss`) so fixtures render paths, not tiles. + +**Shell.** File→Export… dialog: format grid (png/jpg/bmp/tiff/wbmp/ +svg/psd/gif), JPEG quality slider + progressive, matte black/white, +GIF loop (infinite/never/times)/crop/diff/dither, 2-Up preview via +two compose renders side by side (128px), settings-hash keyed so the +preview re-renders only on change, Export writes via the same io +paths as the CLI. Borrow discipline: the dialog is `take()`n to an +owned value for the closure and stored back at the end. + +**Fuzz + floors.** New `expv` libfuzzer target + stable anchor seed +(mapped EXPv + partial-FNLv FNMv bag): parse → read → totality +asserts (dither ≤ 100, quality 1..=100) → write → re-read equality +on export + frame_durations. 60 s campaigns, zero crashes: expv +3,261,192 / gifanim 2,148,780 / psdimport 74,940 / svgimport 99,182 +execs. **Parity floor raised 6→10** (four targets with recorded 60s+ +zero-crash campaigns this milestone); parity + scorecard +regenerated. Decision note: `docs/decisions/0010-expv-export-options.md`. +Tests: doc EXPv battery 9, io expv 10, app-cli batch 4. Gates: +fmt clean, clippy -D warnings clean on all touched crates, wasm green. +Cargo.lock gains no new crates.io packages — no CI image re-ship. + +**M8 close:** GitForge CI run 54f36850 on cac6a3a **succeeded** +(01:57Z) — `xtask ci` green on the runner: fmt, clippy -D warnings, +workspace tests, layers, wasm (13 crates + trunk), corpus 9/9, +golden 5/5, fuzz-quick. M8 done; scorecard row flipped with evidence. + +## 2026-10-12 — M9 task 1: scripting crate scaffold + sandbox + prelude + +New L4 crate `scripting`: boa_engine 0.20 (decision 0001), reused +engine across runs (Context persists; globals from run N visible in +run N+1). Sandbox: runtime limits (loop iterations 1M, recursion 512, +stack 1 MiB) + a native **host-call budget** (default 10 000/run) — +the wall-clock stand-in, since boa 0.20 has no timer hooks; every +native host fn consumes budget first, so `while(true){host()}` dies +typed, not hung. Boa API notes (pinned by probe): loop/recursion +limits interrupt and surface as `RuntimeLimit: ...` errors; +`NativeFunction::from_copy_closure_with_captures` + `boa_gc::Gc` +captures is the only non-`unsafe` native-fn path (workspace forbids +`from_closure`); `register_global_callable` for functions, JS-side +prelude string (`host::PRELUDE`) for objects/Proxy so the host model +stays executable grammar. + +Host prelude: `__hostArray(make)` — the decision-0001 grow-by-read +Proxy (reading an unassigned index below `length` materializes +`make(i)`; `list[list.length++] = …` assigns normally); `fw` shell +(`__log`, `__budgetLeft`, typed not-implemented for getDocumentDOM/ +setUpRevert/revert/runScript/runCommands/dispatchEvent), `dom`, +`smartShape` (operation + typed-refusing handlers), `Files` stubs. +Refusals name the owning M9 task. `prepare_source` strips UTF-8 BOM + +normalizes CRLF (shipped `.jsf` posture). + +Tests: `spike.rs` 5 (own-authored handler script with the shipped +shape — switch on `smartShape.operation`, `RegisterDragInsert +(InsertSmartShapeAt())`, 4-point host array; unknown-operation typed +throw; materialization read-back `[0,20,10]`; engine reuse across +runs; BOM/CRLF), `hostile.rs` 6 (loop limit, recursion limit, budget +exhaustion mid-loop with "done" never logged and host_calls == 16, +five typed not-implemented names, syntax error, engine survives a +limit run). Wasm: `scripting` in WASM_CRATES (14), floor 13→14; +wasm32 needed `getrandom 0.2` + `js` feature via target-dep (the +decision-0001 spike fix, now in-tree). Layers: `scripting` at L4. +Clippy -D warnings clean; fmt clean. + +**Lockfile moved: 70 new crates.io packages (boa graph)** — CI image +rebuilt from the manifest-only context and re-shipped to fedora + +t5500 BEFORE the carrying push. + +## 2026-10-11 — M9 task 2: read-side DOM projection + +- `scripting::dom::attach` snapshots a `doc::Document` into JS: + canvas scalars, page/frame counts, layers[] → elements[] with + per-kind bounds (path anchors, image location+pixels, text/slice + frames, group union depth-capped, symbol transform translation). + `fw.documents[0] === fw.getDocumentDOM()`; `fw.selection` = []. +- Projection is snapshot-once; host re-attaches after mutations + (task 3 wiring). Dangling ids refuse to project. +- Battery `tests/dom.rs` 5 tests pin all scalars + full walk log + + identity + typed pre-attach refusal + re-attach freshness. +- Gates: test 5 binaries ok, clippy -p scripting -D warnings, fmt, + wasm32 check clean. +- Shipped-script leg of the stopping condition deferred to task 5's + corpus harness (committed code cannot reference source/); battery + walk mirrors the corpus read sequence. + +## 2026-10-12 — M9 task 3: mutating host API → registry commands + +- Design: mutations queue as (command id, payload JSON) intents in + GC-held host state; run_in_session drains through the new + Session::apply_delta only on completed runs. Failing/limit runs + drop the queue (document untouched); setUpRevert/revert truncate + the queue pre-application (exact revert, no residue). Decision 0011. +- Engine: Session::apply_delta (returns delta); catalog layer.add + + layer.delete (whole-list snapshot deltas, last-layer refused); + fuzzdrive call table extended (coverage test enforces). +- Scripting: __fwQueue native sink; DOM_MUTATORS per-attach methods + (addNewText, addNewRectangle, addNewLayer(null,false), + deleteLayer, selectAllOnLayer/selectNone, moveSelectionToLayer( + i,false,"none",-1), pathUnion fold, setTextAutoExpand, + changeCurrentPage, isMasterPageLayer); __fwId object ids on + projected elements (= payload serde form); projection corrected to + corpus shapes: layer.frames[f].elements, settable currentLayerNum, + masterPageNum; per-run note slicing. +- Battery tests/mutate.rs 13 tests: every implemented mutator pinned + script ≡ direct ≡ journal-replay byte-equal; failing + budget- + exhausted runs leave the doc byte-identical with an empty journal; + revert exactness; selection persistence across attaches; + creation routing via currentLayerNum. +- Gates: engine 129 + scripting 29 tests, clippy -D warnings (both), + fmt, wasm32 checks clean. No lockfile movement. + +## 2026-10-12 — M9 task 4: .jsf loading + Files/fw.runScript + +- `run_with_file_system(fs, f)` thread-local attachment (boa Context + data store needs Trace; `Rc` is not) — natives + `__fwRead/__fwWrite/__fwExists/__fwRunScript` resolve through it; + no-FS runs fail typed. `fw.runCommands` queues each string arg with + `{}` payload (page.add drains; required-arg commands fail typed at + drain). Remaining Files.* names refuse naming task 5. +- Quirk ledger `docs/decisions/0012-es3-quirk-ledger.md` (BOM+CRLF; + no `#`-directives in corpus; plain `fw.selection` assignment; read + staleness xref 0011; JSON superset). +- Battery tests/files.rs (6): stopping-condition leg = BOM+CRLF + Commands/ script chain loads from virtual FS, script ≡ direct ≡ + replay byte-equal. Hostile list refreshed (getLanguageDirectory/ + copy now the pinned refusals). scripting 35 tests, clippy/fmt/wasm + green. + +## 2026-10-12 — M9 task 5: corpus run harness (xtask scripts) + +- `xtask scripts`: walks source/…/Configuration (89 .jsf), snapshots + to TMPDIR scratch, runs each twice headless (fresh session/engine/ + per-run MemoryFs seeded with the corpus) over a registry-seeded + fixture. Committed report corpus/scripts-report.json: statuses, + applied counts + byte-stable doc digests, refusal histogram, + static call surface with runtime typeof-probing (missing names + observed, not tabulated). +- First run: 19/89 ran (one with a real mutation — Distribute to + Layers, applied 2). Floor CORPUS_RUN_FLOOR = 19 rising-only; + CI verify path (no source/) pinned by in-crate test. Work list: + 49 missing names — smartShape handler surface dominates (elem + x2453), fw.ellipseBCPConst x193, getPref, PS-font helpers, group + machinery, Files.deleteFile. 32 scripts die on the + Files.getLanguageDirectory typed refusal. +- Extraction regression (first char dropped from identifiers) pinned + by call_extraction_keeps_the_full_name. xtask clippy/fmt/tests + green (10). Lockfile gained only the workspace scripting edge. +## 2026-10-12 — M9 task 6: History replay + Save Steps As Command + +- Steps file = journal JSON lines (`.fwsteps`); replay = `Session::reopen` + — no new format, no second replay machine. `Editor::steps_text()` + + `Editor::replay_steps()`; `Session::journal_entries()` read accessor. +- Shell: History section in the left panel (step list from the journal, + Save Steps… / Replay… through the injected Dialogs + FileSystem). + Replay picks the steps file, then the PRE-steps base document. +- CLI: `apply [--out] [--steps ]` — the + headless Save Steps direction. +- Stopping condition: app/tests/steps.rs — GUI journal → file → reopen + on fresh default doc: documents byte-equal, save bytes byte-equal, + undo depth equal, journal round-trips verbatim. Shell seam + CLI leg + pinned separately. +- First test run caught a real trap: seeding the replay base with the + POST-edit document double-applies (page.add onto an already-added + page). The base must be the pre-steps document; the shell doc comment + now says so. +- Gates: engine/app-cli/app clippy -D warnings, fmt, tests green; + engine wasm32 clean; lockfile unmoved. Task-5 CI (4c5547a) succeeded. + +## 2026-10-12 — M9 task 7: CLI run-script, control channel, MCP server + +Shipped. Transport-free dispatchers (`app_cli::channel`, `app_cli::mcp`) +so tests drive exactly what the binary loops run; `serve`/`mcp` verbs +are newline-delimited stdin over them. `run-script` + the MCP +`firecraft.runScript` tool sit behind app-cli's default-on `scripting` +feature; `--no-default-features` (the wasm shape) checks clean on +wasm32 and drops both. + +Design notes: +- MCP tool-level failures (registry refusal, missing script, limit + halt) are `isError` RESULTS, not protocol errors — protocol errors + (-32601/-32602/-32700) are reserved for malformed frames. Tools/list + is feature-gated per tool, so the table never lies. +- `ops::run_script` mirrors `apply_journal`: open → run → `Applied` + carrying unknown bag + chunks for the save path. +- Battery (`app/tests/automation.rs`): one command id + (`object.createPath`) through GUI/CLI/MCP over ONE shared base → + byte-equal documents. Hostile arm: 13 channel shapes + 22 MCP shapes + (incl. protocol-level) → typed replies, journals untouched. + +Lessons: +- `Document::default()` has zero pages — create-shape commands refuse. + The parity battery's base is `Editor::untitled()`'s seeded document. +- app-cli optional dep paths are crate-dir-relative (`../scripting`, + not `../crates/scripting`). +- `#[cfg_attr(not(feature = "scripting"), allow(unused_variables))]` on + the `fs` param keeps one dispatcher body for both configs. +- Live smoke before claiming "demonstrably": the stdin loops carried a + real apply, a real script (rect added, saved), and every error shape + in both verbs — the dispatch tests alone would not have caught a + broken loop. + +## 2026-10-12 — M9 task 8: gates, fuzz arms, floors — M9 complete + +Shipped. Two stable fuzz drivers in `fuzz/` (standalone workspace, +synthetic seeds only): `script_mutation` (8192 cases/sweep: 16 seed +scripts + 16 byte-level mutants per seed x 256 seeds) and +`control_channel` (4096 sweeps: mutated/truncated templates, junk +JSON, valid-traffic interleave, both dispatchers). Wired into +`xtask fuzz-quick` (release build — boa is ~10x faster optimized; +debug sweep was 3m28). `xtask scripts` wired into `xtask ci`. + +Finding: the script-mutation anchor's first contract ("non-completed +⇒ document untouched") was WRONG — the unmuted baseline +`selectAllOnLayer(0); pathUnion()` tripped it because a pairwise +`path.boolean` fold can refuse mid-drain, and `fail_drain` keeps the +applied prefix BY DESIGN (Decision 0011 §4). Corrected contract, now +pinned: `LimitExceeded` ⇒ document byte-identical (limits fire +pre-drain); every other outcome ⇒ journal replays onto the pristine +base to exactly the current bytes. The universal invariant is both +weaker-matching and stronger evidence than the naive claim. + +Floors (parity table, all rising-only): script mutation 8192 +cases/sweep, control channel 4096 sweeps/run, corpus-run 19. Parity + +scorecard regenerated; scorecard M9 → done. Decision 0013 (machine +surfaces: one registry door, transport-free dispatch, typed replies, +native-only control channel, floors). + +Remaining gate: GitForge `xtask ci` green on the push (stopping +condition). M7-owed debt unchanged: mkBT writer + TileBank bridge. + +## 2026-10-12 (session cont.) — M9 CI verdict: cgroup kill, not code + +b7b3f8b's GitForge run failed at the fuzz job: 45s in, stderr ends +abruptly at "Compiling io", no rustc error, exit 1. Full stderr came +from the real API (127.0.0.1:42780, hub_gitforge client; jobs at +result["data"], logs in receipt.step_results[].stderr — the MCP tool +truncates at ~500 chars). + +Diagnosis chain: fedora runner (20 cores) caps job containers at +4 GiB mem / 8 GiB memswap (docker inspect HostConfig.Memory). Task 8 +made the fuzz step the pipeline's first RELEASE build of the boa + +text stack plus re-fingerprinted workspace crates; at 20-way parallel +rustc the aggregate blew the cgroup and OOM-killed cargo. Structural, +not flaky — a quiet-window retrigger would re-roll the same dice. + +Fix (b7932bd): fuzz step gets CARGO_BUILD_JOBS=2 + +CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1, timeout 30m -> 90m. The +persistent /tmp/ci-target (proven by 94s warm clippy) pays the capped +cost once per dep change. Memory + .gitforge.yml header updated. + +Lesson: warm-vs-cold timing across jobs is the cheapest way to infer +the container model; docker inspect on a live co-tenant container +gave the cap in one command after dmesg proved inaccessible. + +## 2026-10-12 (session cont. 2) — root cause found: offline cache, not memory + +The "silent mid-compile kill" was neither. `GET /api/jobs/{id}/logs` +(the job log ledger — the bounded receipt hides the tail) shows the +fuzz step failing CLEANLY: `error: failed to download time-macros +v0.2.32 ... --offline was specified`. Sandboxes run +CARGO_NET_OFFLINE=true; task 8 moved fuzz/Cargo.lock (boa family) but +the image was not re-shipped — the Dockerfile/pipeline header rule +covers BOTH lockfiles and I only checked the root one. + +Wrong theories retired with evidence: (a) cgroup memory — run +84503a3e died at a confirmed 16G ceiling with jobs=6, so memory was +exonerated; (b) output-volume kill — successful steps store larger +logs (16614/20646) than the failed ones (10829); the equal 10829s +were the receipt bound, not a kill threshold. The two oomrepro +containers built to test (a) were deleted unused. + +Fixes shipped: image rebuilt per the manifest-only recipe (cache now +908 crates incl. time-macros 0.2.32, boa_engine 0.20.0) and loaded +on fedora; .gitforge.yml fuzz step restored to its original form +(the jobs/cgu caps were built on the refuted theory) with the +offline-refusal failure mode documented; memory rewritten to the +true cause. t5500 is OFFLINE and still on the OLD image — must +re-ship before it serves CI. + +Lesson: when a step "dies silently", fetch the ledger before +theorizing. The receipt bound had me auditing docker cgroups for +three runs while the error was a one-line offline refusal. + +Run c1b87745 (5dd2660): ALL SIX JOBS GREEN — fuzz 133s on the +re-shipped image. M9 closed. + +## 2026-10-12 — M10 task 5: rich symbols (Widget.opCode) + +The last `__notImplemented` stub is gone. A symbol definition now +carries its re-derivation script (`JSVv` under `MSTv`, `JSSs` string +pieces split at 64KiB on char boundaries) and an instance carries its +parameter store (`DTAv`/`DCEv` on `ALSv`, canonical key order; reader +claims only canonical shapes, bags the rest). Engine commands: +`symbol.setScript` / `symbol.setParam` / `symbol.setCustomData` — +plain journaled mutations with exact inverses (refused call mutates +nothing, pinned byte-exact). Re-derivation runs in the scripting +layer (`rederive_symbol`): project `Widget` (elem.customData Proxy, +GetObjectByName over named definition members, propString +`&;&`/`&|&`), run, drain through `Session::apply_delta` (decision +0011) — so replay needs no JS engine and the golden +(`app/tests/rich_symbols.rs`) replays the whole chain byte-exactly +and round-trips the stream. `corpus/fixtures/rich.fw.png` pins the +wire end to end, built through the registry + host (decision 0015). + +Two corpus-probe findings became design facts: no Common Library +.fw.png embeds script text (the scripts are companion .jsf files — +the JSVv carrier is FireCraft's own choice, documented as such), and +the Widget color path must NOT int32-coerce (`| 0` flips the alpha +bit negative; unsigned ABGR or bust — caught by the first battery +run, -7910880 vs 4287056416). + +Shared-content semantics showed up honestly in the golden: the +definition is one shared canvas content, so the LAST re-derivation +wins — defaults pass before parameter apply, or the apply pass gets +clobbered back to "Click me". Gates: doc 36, engine 147, scripting +42, app 28, compose 66 — all green, clippy clean per crate. + +## 2026-10-12 (M10 task 6: library import/export + Common Library re-creation) + +Library files are ordinary documents whose MSLv carries definitions and +whose registry holds their member closure, nothing on a page. Zero-page +round-trips: the reader's PDCv loop just pushes no pages — extract's +output goes through the canonical write path unchanged. + +The import command's closure discipline earned its keep twice. First, +the one-level validation walk was wrong: a nested group could leak a +source-document id past the gate, so the check is a transitive worklist +walk (BFS, first-touch order — which is also what makes replay slot +allocation deterministic). Second, importing one definition of a +multi-definition file must NOT insert the other definitions' members as +unreferenced registry orphans — the command now imports exactly the +reachable closure and ignores the rest of the payload (library files' +registries carry every definition's members at once). + +`library.importSymbol` = one Created capture per member + one library +capture; undo is byte-exact against the pre-import document. App side: +`export_library(names)` (extract + ordinary save) and +`import_library(bytes, names)` (ordinary read + one import command per +definition, returns new MSNi numbers). + +The five Common Library assets are GENERATED (`xtask library-gen`, +deterministic — regenerate + sha256 stable), original vector art in the +observed categories; Buttons carries one rich symbol with our own +Widget script (mirroring the JSVv we probed in CS6's Buttons.png). +Stopping condition proven: two imports of one export place +byte-identically; placed doc re-emits byte-stably; undo exact; all five +assets open/import/place/render; the rich button re-derives through the +M9 host off the imported definition (T5 × T6 integration). Attribution +rows landed with the assets (decision 0016). + +## 2026-10-12 — M10 task 7 (gates) — CLOSED + +Floors first: gen_fixtures now calls `xtask library-gen` itself and pins +the five assets, so the corpus manifest can't drop hand-added rows on +regeneration. Corpus gate 15/15 (10 fixtures + 5 assets), 9 checks per +file. Parity floors raised (M7→M10): corpus parsed 9→15, fwpng byte +round-trip 8→14, doc-model round-trip 9→14, goldens 5→6; new floor: 5 +Common Library assets pinned + round-tripped. Scorecard M10 → done with +the six-commit evidence chain. + +NGSv proof debt: the ticket said "NGSv proof pins in vector" but the +regrid lives in compose (`nine_slice_grid`), vector has no nine-slice +surface — so the pins landed in compose_proof.rs honestly, where the +code actually is. Added the degenerate case: an instance SMALLER than +its corner insets. Corners shrink proportionally (`floor(l·dw/(l+r))`), +edge/middle pieces collapse to zero and are skipped — asserted RED +corner at (0,0), BLUE right-edge pieces occupying (1,0)+(2,0), CYAN +bottom-left at (0,1), BLACK bottom edge at (1,1)+(2,1). Two gotchas +recorded: the page canvas hosts the SOURCE raster (must be ≥ shape +bounds even when the destination is tiny), and corner widths resolve +left 1px + right 2px at 3/8 × 2/8 scale, leaving the middle zero-sized. + +Gates swept: fmt, clippy -D warnings (xtask/engine/compose/doc/app), +compose_proof 31, engine 129+catalog_fuzz, doc battery, app library +battery 5/5, corpus 15/15, golden 6 pinned deterministic, fuzz-quick +green across all drivers. + +## 2026-10-12 — M11 tasks 1+2: slice model/wire + web-layer commands + +SliceObject now carries the full URLv family: link (A2Ts), alt (ALTs), +label (FILs), td_text (TDTs), polygon contours (PBPv under URLv +directly — no PBLv wrap), the cell-background export family +(CBTb/CBRi/CBAi/CBHi/CHVi/CBVi/CVVi), behaviors (BEVv/BEHv/BETi), custom +data (DTAv), per-slice EXPv override. Decision 0017 recorded in code: +A2Ts = anchor link, ALTs = alt text; hotspot = TSLi-less URLv. + +Two wire gotchas worth keeping: +- CHVi/CVVi end in 'i' so the nodetree parser demands hex int literals + (fourcc[3] type dispatch); modeling them f64 made every full-spine + reparse fail at the write. Fixed to i64 everywhere. +- Clearable JSON payload fields: Option> is a trap — serde + collapses null to the outer None, so null = "leave". Hand-rolled + tri-state Field (Leave/Clear/Set, default Leave, null → Clear) + in slice.setBackground. + +Web Layer provisioning is lazy (first slice/hotspot on a page): top of +stack, URLb+MSLb, one visible cell per state; undo strips it via a +Delta::Layers captured in the create group. MSLb blocks layer.delete. +Nine commands (slice.create/hotspot.create/setLink/setType/setBackground/ +setExport/addBehavior/removeBehavior/setData) registered + fuzz arms. + +New proofs: 8 web.rs unit tests (provision+exact undo, reuse, hotspot +page-local + no TSLi, polygon ≥3 points, set* chain undo to exact bytes, +domain refusals mutate nothing, web-layer delete refusal, non-slice +target refusal) + fwmap bevv_behavior_payloads_survive_round_trips +(mapped BETi + bagged payload sibling re-splice; unreadable BEHv +whole-bagged verbatim; byte-stable second write). + +Gates: doc 37, engine 137 (incl. catalog_fuzz), scripting, app 18, +corpus 15/15, golden 6, layers ok, clippy -D warnings on +doc/engine/scripting/app. + +## 2026-10-12 — M11 task 3: webexport crate (HTML+Images + Images Only) + +New `crates/webexport` (L4): pure `(&Document, options) -> {files, html}`. +Pipeline: `compose::render` → straight-alpha → `layout::scan` (cut grid +from slice bounds; hotspots excluded — map-only overlays, cell values +keep full web-object indices) → greedy maximal-rectangle `decompose` → +per-piece crop (pixel-center shape mask for ellipse/polygon) → M8 +encoders (`EXPv` override: FMTi 0 gif / 1 jpg / else PNG for pixel +identity) → SLICES.XTT shim-table HTML (doctype HTML 4.01, iso-8859-1, +`td img{display:block}`, 1px shim row+column, rowspan/colspan merges, +``) with `/` per host piece +(hotspot anchors to the piece under its CENTER; coords relative to +piece origin) and MM behavior hooks (kinds 2/4/5/6/7 from SLICES.XTT +constants; swap target rides DTAv custom data `swapTarget` — decision +0017) + clean-room MM runtime when hooks exist, preloads in onload. + +Gotchas hit: +- `r#"..."#` raw strings terminate at any `"#` — the MM runtime's + `indexOf("#")` needs `r##"..."##`. +- serde `Option>` trap avoided via hand-rolled `Field` + tri-state (task 2; reused nowhere in task 3 but documented). +- Hotspots taking grid cells carved holes in slice rectangles and + split named pieces (left → left_2/3/4); scan filters + `slice_type.is_some()` for cuts and assignment. +- Degenerate (zero-width) slice frames: cut scan stretches to 1px but + the assignment loop must stretch identically or cells stay empty; + rect cells test the stretched band, ellipse/polygon keep raw + containment. +- io::gif gained `encode_frame` (single-frame local palette, no + NETSCAPE, disposal Any) — encode_animated's per-frame path reused. +- xtask layers: `webexport` registered at L4; L4 header line updated. +- doc: `SliceObject` now derives Default (test-side ergonomics; + additive). + +Gates: webexport 21 tests (13 lib + 8 integration incl. pixel-identity +vs compose, shim-table structure, hotspot anchor + map coords, hooks + +runtime + preload, EXPv codec override, determinism, refusals, +skip-undefined), io/doc/compose/engine(137)/app/scripting green, +clippy -D warnings clean (webexport/io/doc/engine/compose/app/app-cli/ +scripting), fmt clean, layers ok, corpus 15/15, golden 6 pinned, wasm +ok. + +## 2026-10-12 — M11 task 4: CSS+Images, CSS Sprites, To Files, states→GIF, CSS Properties + +Commit: (this change) — crates/webexport only. + +What landed: +- `css.rs` (new): the CssLayers.htt behavioral spec as code — + `@charset "utf-8"` → `body` rule (canvas bg, 62.5%, margin/padding 0) + → fixed preamble constants → `#main { margin: 0 auto; width: Wpx }` + → one rule per piece in the `csspos` absolute-branch order + (left, position, top, background-image, overflow, height, + margin-bottom, width). XHTML 1.0 Transitional shell, IE conditional + `.borderitem`, `
` + one empty div per piece. + Plus `sheet_extent` (union rect of pieces), `write_sprite_css` + (negative `background-position` offsets), and `write_properties` + (per-object rules: contour-anchor geometry, fill_raw→background-color, + primitive radius→border-radius, opacity per-mille→fraction, + dropShadow EPSv text numerics→box-shadow). +- `batch.rs` (new): Pages/States/Layers To Files — `{doc}_p{n}.png`, + `{doc}_state{n}.png`, cleaned layer name; per-layer render clones the + document and hides every other layer (compose has no layer filter); + `_x` dedup shares the rasterizer rule. +- `lib.rs`: Workflow grew CssAndImages / CssSprites / CssProperties / + PagesToFiles / StatesToFiles / LayersToFiles / StatesToGif; export() + dispatches batch/text workflows before the slice pipeline; + StatesToGif is a thin `io::gif::encode_animated` call. +- `images.rs`: `rasterize` gained `emit_images` — CSS Sprites plans + pieces without encoding them (the sheet replaces per-slice files); + `crop` is pub(crate) for the sheet crop. + +Gotchas: +- `PaintStyle.fill_raw` is plain `i64` (Option was a different struct) + — `paint.as_ref().map(|p| p.fill_raw)` is the Option. +- `EffectValue` has no `.text()` accessor — match `EffectValue::Text`. +- Tuples across match arms unify exactly: `&path.effects` vs `&[]` + fails E0308; use `.as_slice()` + `&[] as &[doc::Effect]`. +- `f64: From` doesn't exist — `opacity as f64`. +- `geom::Affine::IDENTITY` (const), not `::identity()`. +- `Plane::new` takes (u32, u32); compose's Render width/height are u16. +- Batch `reserve` dedup must re-apply the extension after `_x` — + stem-only looping dropped `.png` (fixed: reserve(stem, ext)). +- No `unreachable!()` in lib code (house no-panic rule): the slice + workflows early-return on dispatch, and the trailing match maps the + rest to `None` with a comment. + +Gates: cargo test -p webexport → 26 green (13 lib + 13 integration, +incl. per-workflow double-run byte-equality over all nine workflows); +clippy -p webexport --all-targets -D warnings clean; fmt applied. +Workflow has no downstream matches yet (shell/CLI wiring = task 5). + +## 2026-10-12 — M11 task 5: shell + CLI surfaces + +Task 5 of M11-web-export: the shell's apply path drives slice-create → +link → export end to end, and every surface reaches the web layer +through the same registry ids. + +- `app-cli`: `ops::export_web` + `parse_workflow` ("images|html|css| + sprites|properties|pages|states|layers|gif"), new `export-web` verb + (--workflow/--page/--state/--name/--images-dir/--pct-width/--no-shim/ + --skip-undefined) writing ExportedFiles into the out dir and the html + artifact at `{doc_name}.html`. +- `app`: `Tool::Slice` + `Tool::Hotspot` (end_drag → slice.create / + hotspot.create with the drag rect, degenerate drags create nothing); + Web Layer panel (right dock) listing the state's slices/hotspots with + link/alt editing → slice.setLink and foreground/background → + slice.setType; export dialog gains the workflow picker — choosing a + workflow routes through `export_web_via_dialog` → `app_cli::ops:: + export_web` (the same entry the CLI verb shares), writing files beside + the chosen artifact (html/css/gif extension by workflow). +- Tests: `app/tests/weblayer.rs` (slice tool drag → frame + slice_type + on the web layer → setLink → export via ops contains href/alt and is + byte-equal to webexport::export direct; hotspot → `.webpin` — tags in document order with sorted attribute + names, ` + + + + + + FireCraft is a vector and bitmap editor. It needs WebAssembly + and WebGL; your browser did not start it. See + https://github.com/aliasfoxkde/FireCraft for the desktop build. + + + + + + diff --git a/web/dist/version.json b/web/dist/version.json new file mode 100644 index 00000000..b8744b49 --- /dev/null +++ b/web/dist/version.json @@ -0,0 +1 @@ +{"version":"0.3.0","wasm_sha256":"046ce14f44a413ce622280db4ca3211b7d81a7efed6aaef05b52154f13a215f3","exe_sha256":"bcb83a12216812bc1a778c945d1f35bc4cc2aa4da3f971e1790f7dc8af7e26b0","date":"2026-11-24"} diff --git a/web/index.html b/web/index.html index fcd5e7a7..295bcdc4 100644 --- a/web/index.html +++ b/web/index.html @@ -7,7 +7,8 @@ FireCraft - + +