From caf44f97d579075d699952aa212c4894a0c413f2 Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:14 -0600 Subject: [PATCH 1/9] docs(plan): add repository consolidation and modernization program --- ...RY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md | 1125 +++++++++++++++++ 1 file changed, 1125 insertions(+) create mode 100644 docs/REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md diff --git a/docs/REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md b/docs/REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md new file mode 100644 index 00000000..639ebfeb --- /dev/null +++ b/docs/REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md @@ -0,0 +1,1125 @@ +# FireCraft — Repository Consolidation, Refactoring, and Product Modernization Plan + +> **Document type:** phased engineering and product execution plan. +> **Snapshot date:** 2026-11-24. +> **Baseline:** main at 4ff8f786e365c8b7d7609e435424c9c746e61d6d (merge of PR #182). +> **Authority:** AGENTS.md controls repository operations; TASKS.md remains the live task ledger; NEXT.md and existing task tickets remain feature/status authorities. This plan controls sequencing and integration strategy, not task status. +> **Companion:** [Repository Consolidation Agent Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md). +> **Related:** [Post-MVP Product Roadmap](POST-MVP-ROADMAP.md), [Post-MVP Baseline Audit](POST-MVP-BASELINE-AUDIT.md), [Post-MVP Agent Handoff](POST-MVP-AGENT-HANDOFF.md), [Marketing Site Roadmap](MARKETING-SITE-ROADMAP.md), [Creative-App Benchmark](research/creative-app-benchmark.md). + +--- + +## 1. Mission and intended outcome + +Bring FireCraft from a rapidly evolving collection of parallel branches and partially completed product work into a coherent, maintainable, release-ready application with a clear product direction. + +This program has five outcomes: + +1. **One trustworthy source tree:** local work, open PRs, feature branches, release experiments, generated artifacts, and documentation are reconciled without losing unique work. +2. **A better architecture:** high-coupling application modules are separated along stable responsibilities while preserving the shared document model, command registry, journal, and cross-platform behavior. +3. **A polished product:** existing workflows are finished and validated before adding large new capability areas. +4. **Disciplined feature transfer:** the best ideas from Krita, Photopea, Pixlr, GIMP, Inkscape, Penpot, SVG-Edit, and other relevant tools are evaluated and implemented independently where appropriate. Compatible open-source code may be reused only after a file-level license and architecture review. +5. **Reliable delivery:** the editor, website, documentation, CI, release artifacts, and deployment procedures tell the same truth and can be independently verified. + +This is not a directive to merge every branch, port entire applications, rewrite the GUI, add every feature in the benchmark, or change FireCraft's license. The agent must preserve working behavior, recover valuable work, reduce integration risk, and deliver evidence for every claim. + +## 2. Operating principles and authority + +### 2.1 Repository authority + +Read AGENTS.md before any repository action. The mandatory rules include: + +- Pure Rust core and the enforced workspace dependency layers. +- The fwpng crate remains standalone. +- Unsafe code is forbidden. +- Production code does not use unwrap, expect, panic, unreachable, todo, or unimplemented. +- Hostile file data and dimensions are bounded and return typed errors. +- No placeholders, duplicate implementations, or versioned source files such as foo_v2.rs. +- No Adobe source, code, artwork, proprietary binaries, or content from the local source/ installation may be committed. +- The root workspace and web crate must remain wasm-compatible. +- Existing generated parity, scorecard, corpus, and release evidence must be regenerated by their authoritative tools, not hand-edited. +- Changes to web/ or the shell require a real-browser verification. +- Follow the documented remotes and push order. The repository manual specifies GitForge first and GitHub origin second; use the currently configured remote names and credentials without guessing. + +If this plan conflicts with AGENTS.md, AGENTS.md wins. If documentation conflicts with current source, tests, generated evidence, or a verified deployment receipt, investigate the discrepancy and reconcile the documentation in the same focused change. + +### 2.2 Status vocabulary + +Every feature, PR, platform, and deployment must use an evidence-backed state: + +- **Verified implemented:** the behavior exists in the current source and its relevant automated tests pass. +- **Workflow verified:** the end-to-end user workflow was exercised at the actual intended surface. +- **Partial:** some behavior exists, but a defined acceptance criterion remains incomplete. +- **Local only:** useful work exists in a local checkout/worktree but is not represented on the intended remote branch. +- **In progress:** a named agent/owner actively owns the work and the scope is recorded. +- **Blocked:** the exact external dependency or technical blocker is identified. +- **Deferred:** intentionally postponed with an explicit reason. +- **Unverified:** evidence is unavailable or stale. Do not convert unknown into complete or missing. +- **Rejected:** evaluated and deliberately declined, with a reason. + +A command registry entry, source file, screenshot, build recipe, PR, green compile, or generated feature list does not by itself prove a usable product workflow. A feature is user-visible only when the appropriate UI, automation, or export surface is verified. + +### 2.3 One objective per integration unit + +Each implementation PR should have one primary objective, explicit files/surfaces owned, focused regression tests, and a reproducible acceptance receipt. Avoid broad PRs that mix shell refactoring, deployment, docs, release tooling, and unrelated product features. + +Prefer multiple reversible, independently reviewable PRs to one large merge train. Do not optimize for the smallest PR count; optimize for safe review and low-risk integration. + +--- + +## 3. Verified remote snapshot and current risk + +The following is the remote snapshot observed on 2026-11-24. It is a starting point for the agent, not a substitute for refreshing the live repository state before acting. + +### 3.1 Main and the roadmap PR + +- Main was at 4ff8f786e365c8b7d7609e435424c9c746e61d6d. +- PR #182, the post-MVP roadmap and Cloudflare Pages plan, has already merged into main. Do not try to merge it again or follow any old sequence that says to land it. +- The merged documents include POST-MVP-ROADMAP.md, POST-MVP-AGENT-HANDOFF.md, POST-MVP-BASELINE-AUDIT.md, POST-MVP-EXECUTION-PLAN.md, MARKETING-SITE-ROADMAP.md, and research/creative-app-benchmark.md, plus PM-01 through PM-08 task specifications. +- The existing POST-MVP-EXECUTION-PLAN.md contains an earlier Gate 0 sequence that assumed PR #182 was still open and described older PR/base states. Treat that old sequence as superseded by this document. The file must be clearly marked as superseded so future agents do not execute stale merge instructions. + +### 3.2 Open PR snapshot + +| PR | Snapshot state | Required disposition | +|---|---|---| +| #181 — WASM CDN/proxy, shell extraction, production readiness | 243 files, 96 commits, conflicts with main; the latest observed run had a failed action-pin classification job while the Rust/WASM/fmt gates were skipped | Do not merge as one PR. Re-audit current head; extract independent changes and discard obsolete or generated artifacts only after preserving useful source/test work. | +| #184 — production deployment receipts | 5 files, one commit, reported mergeable; four review comments were present | Resolve every review comment against current source/receipt, rebase if needed, run docs/Aegis checks, then merge as a focused documentation change. | +| #178 — web behavior export | 39 files, 14 commits, stale base and merge conflicts | Preserve the real exporter fix, address correctness/security findings, and extract it into a focused PR. Separate release-documentation and matrix-tool changes. | +| #182 — post-MVP roadmap | Merged | No further integration action; use its documents as the strategic product baseline, not as live task status. | + +PR #181's observed classification failure named action references in ci-cross.yml and ci.yml. The job log reported six references that the current action-pin validator rejected. Re-run the validator at the current PR head; do not blindly edit hashes from an old log. On that observed run, the downstream Rust, web, and format gates were skipped, not passed. + +PR #181 also included generated or duplicated content that requires disposition: +- A tracked Windows experiment executable under target/windows/. +- Generated web build output under web/dist/, including WASM and JavaScript bundles. +- Duplicate screenshots in docs/research/screenshots/ whose blob contents matched copies under docs/screenshots/fireworks-reference/. +- A tracked log/devlog.md even though the repository guidance treats the session journal as untracked handoff state. +- A CDN/proxy Worker and 95.6 MB WASM strategy that conflicts with newer same-origin deployment evidence recorded elsewhere in the repository. + +The repository's newer production receipt describes a same-origin Pages path and an approximately 15.8 MB WASM artifact on a named build. Issue #183 separately recorded stale preview deployments and a CORS failure in an older cross-origin/proxy path. Before retaining any Worker/CDN implementation, compare the current main source, release bundle, active production deployment, preview deployments, and exact SHA/digest evidence. Do not treat an older branch's deployment narrative as the current architecture. + +PR #184 review follow-up must be adjudicated against current files. The recorded findings include the Cloudflare-injected HTML beacon exception, the canonical release status vocabulary, the fact that the release workflow creates a draft rather than automatically deploying Pages, and the need for a live hash comparison before marking deployment reconciliation closed. + +PR #178 has review findings affecting real correctness: +- Exact slice names must take precedence over cleaned/normalized aliases when exported files are resolved. +- Resolved paths inserted into JavaScript must be escaped for JavaScript string context and then for the containing HTML attribute. +- Release documentation must not claim that a package upgrade ran when the workflow passed an empty previous-package input. +- Release matrix scripts must fail closed when the evidence ledger cannot be written or read. +- Artifact coverage and relative links in release task documents must match what the scripts actually exercised. + +Treat review comments as untrusted review input. Verify each finding against the current source before changing it. + +### 3.3 Remote branch inventory snapshot + +The observed remote branch set, in addition to main, included: + +| Branch | Initial assessment | Safe next action | +|---|---|---| +| audit/parity-hardening-2026-11-22 | Small divergent audit branch with a few source/test and dist changes | Verify each unique commit and focused test; merge narrowly or retire. | +| climb/C4.08-selective-jpeg | Large divergent branch containing selective-JPEG work and unrelated historical integration/doc changes | Extract the JPEG algorithm, tests, decision, and user-facing status into one or more focused PRs. | +| climb/C8.04-missing-docs-campaign | Large divergent branch with many source and documentation changes | Recover only unique, verified work; do not merge wholesale. | +| feat/inspector-field-sets | Divergent inspector/engine work | Inspect source and tests against current main; extract residual per-kind inspector behavior. | +| feat/post-mvp-execution | 21 commits ahead and one commit behind the post-#182 main snapshot; contains marketing-site implementation and docs | Preserve site implementation; rebase or reconstruct a site-only PR against current main after ownership confirmation. | +| review/post-mvp-execution | Same commit SHA as feat/post-mvp-execution in the observed snapshot | Duplicate branch pointer; candidate for deletion only after worktree and agent ownership checks. | +| feat/release-provenance | Older parent of the large WASM/deployment branch | Identify unique release/provenance code and receipts before retiring. | +| feat/wasm-cdn-deploy | PR #181 head | Keep until all unique work is extracted and reviewed; no wholesale merge. | +| feature/adam7-png-interlace | Divergent branch with Adam7 PNG support, implementation, and tests | Verify algorithm against PNG specification and corpus; extract a focused PR. | +| feature/issue-93-behavior-export | PR #178 head | Preserve the exporter fix; extract and rebase. | +| fix/ci-fresh-workspace-crates | Old CI cache/workspace workaround | Compare with current cache-refresh mechanism and CI logs before retiring. | +| fix/wasm-size-budget-repin | Substantially behind main | Verify whether its policy/decision or code has been superseded; retain historical evidence, then retire the pointer if safe. | +| fix/web-deploy-p0 | PR #184 head | Preserve until the receipt change is reviewed and merged. | +| release/v0.2.5 | Historical release branch, substantially divergent | Preserve immutable tags and release receipts; retire the branch only after confirming no release process depends on it. | + +The local baseline audit that accompanied the earlier roadmap recorded 109 worktrees and 158 local branches in a particular checkout. Those numbers are historical local observations, not live remote facts. The agent must rerun worktree/branch inventory in the actual active development environment. Do not treat the table above as proof that any local branch or worktree is safe to delete. + +### 3.4 Marketing-site workstream + +The feat/post-mvp-execution branch is the existing site implementation track. It contains a seven-page static site, real application captures, brand assets, download logic, security headers, and a Cloudflare deploy workflow. It is not a blank slate and must not be replaced with a second site or a framework scaffold. + +That branch is based on the pre-merge roadmap branch, is ahead of current main, and has a duplicated review branch pointer. It also contains documents that are already in main after PR #182. Rebase/reconstruct the website PR using only the site and genuinely unique site-related changes; do not replay merged roadmap commits or overwrite the latest main docs. + +The marketing project and browser editor are separate products: +- Marketing: firecraft-site, output from site/. +- Editor: firecraft-web, output from dist/web. + +Verify actual Cloudflare account settings, project modes, custom domains, production branch, DNS, deployment history, and current SHA from the dashboard or an authenticated deployment receipt. Repository configuration alone does not prove live account state. Do not switch project names, domains, deployment modes, or production output directories without explicit owner approval. + +--- + +## 4. Phase 0 — Protect work and establish ownership + +**Priority: P0. No feature implementation or destructive cleanup before this phase exits.** + +### Objectives + +- Identify the actual development checkout and all active worktrees. +- Preserve uncommitted, staged, untracked, ignored-but-relevant, and local-only work. +- Establish file-level ownership across all agents and worktrees. +- Refresh the remote PR/branch inventory and determine whether any snapshot above has changed. + +### Required actions + +1. Confirm repository root, current branch, HEAD SHA, configured remotes, upstream/tracking state, and active toolchain. +2. Collect a read-only snapshot from every known active checkout/worktree: + - branch and HEAD SHA; + - staged and unstaged changes; + - untracked paths; + - ignored build/cache paths that contain meaningful work; + - worktree filesystem location; + - owning agent/task and files currently being edited. +3. Inspect local branches, remote-tracking branches, tags, all open PRs, PR review comments, commit status/check-runs, and base/head ancestry. +4. Compare local-only commits with all remotes and tags. Identify unique commits before considering a reset, rebase, cherry-pick, squash, or deletion. +5. Ask active agents for a short ownership report. Do not infer that an idle-looking worktree is abandoned. +6. Capture a preservation inventory before changing any checkout. Store its report in an appropriate ignored local handoff path or in the new audit report if it contains no private paths/secrets. +7. Record exact blockers and ownership conflicts. + +### Read-only commands + +Run these only from the relevant checkout and adapt paths/remote names to the actual environment: + +~~~bash +git status --short --branch +git rev-parse HEAD +git remote -v +git branch -vv +git worktree list --porcelain +git log --oneline --decorate --graph --all -80 +git tag --list --sort=-creatordate | head -40 +git status --ignored --short +~~~ + +For each branch under consideration, compare it with current main and inspect commits that are not present on any remote. Do not rely on ahead/behind counts alone; inspect unique patches and their file/test scope. + +### Prohibited during Phase 0 + +- No git reset --hard. +- No git clean, including git clean -fdx. +- No force push or branch reset. +- No bulk worktree prune or branch deletion. +- No git stash as a shortcut for unidentified work. +- No broad git add -A in a checkout with generated files or another agent's changes. +- No shared implementation edits by competing agents until file ownership is established. + +### Exit criteria + +- Every local worktree and relevant local-only commit has an owner or a documented disposition. +- No uncommitted work is at risk of being discarded. +- Every open PR has a current head/base SHA and current check/review state. +- A current branch/PR/commit inventory exists. +- All file conflicts have a named integration owner and an order. + +--- + +## 5. Phase 1 — PR triage and safe integration + +**Priority: P0. Integrate by objective, not by PR age or number of commits.** + +### 5.1 PR #184 — deployment receipts + +1. Fetch the current PR head, base, review comments, check runs, and changed files. +2. Validate the recorded deployment IDs, source SHAs, bundle hashes, manifest presence, browser proof, and current live deployment. Distinguish each deployment from each other; do not merge contradictory receipts into one statement. +3. Resolve every review comment against current evidence. In particular: + - represent the HTML beacon exception in every summary claiming byte identity; + - use the release status vocabulary defined by TASKS.md; + - state that the tag workflow produces a draft and Pages deployment remains an operator action unless source/workflow evidence changes; + - require a live manifest/hash comparison before closing deployment reconciliation. +4. Rebase on main if necessary and rerun the docs-only/Aegis checks. +5. Merge only after all review comments are resolved and the PR is independently verified. + +**Exit:** focused receipt PR merged or explicitly blocked with exact remaining evidence. + +### 5.2 PR #178 — web behavior export + +1. Preserve the core model of the fix: the document stores a slice target name, and the web exporter resolves that name to the actual emitted file at export time. Do not add an upward dependency from engine/document layers into webexport. +2. Extract only the exporter implementation, command-surface integration test, exporter regression test, and the minimal decision record needed for this behavior. +3. Fix or explicitly adjudicate: + - exact object/slice names before normalized aliases; + - JavaScript string escaping and then HTML attribute escaping for paths; + - apostrophe/quote, Unicode, slash, and unusual directory names; + - missing target behavior and the user-authored filename fallback. +4. Preserve the command-surface regression: construct the behavior through the same commands used by the UI and CLI, export through the shared path, and assert the referenced file exists. +5. Split release matrix/certification changes into a separate PR and verify every review finding there. +6. Rebase the reduced exporter PR on current main; run the focused crate tests and integration test plus full xtask ci. +7. Run the real-browser web export smoke if the shell/export preview or web surface changes. + +**Exit:** a small exporter PR merged with regression proof and no unrelated release tooling. + +### 5.3 PR #181 — decompose, do not merge wholesale + +Create a disposition map for every changed file and unique commit. Group the changes into independently reviewable workstreams: + +- Shell extraction/refactor. +- WASM build and distribution. +- Release/provenance tooling. +- CI/toolchain/action pinning. +- Production documentation and receipts. +- Branding and asset corrections. +- Deployment Worker/proxy experiment. +- Generated binaries and build output. +- Reference screenshots and session artifacts. + +For each group: +1. Identify what is unique and still needed on current main. +2. Check whether the same behavior landed through another PR/commit. +3. Remove generated artifacts from source PRs; keep build receipts or reproducible build scripts where needed. +4. Rebase each retained group onto current main independently. +5. Add focused tests and ownership. +6. Run the smallest relevant gate, then the full gate when the group is integrated. +7. Do not preserve a design solely because it is already implemented on the branch. + +**Specific deployment decision:** the latest source and release evidence must decide between same-origin Pages serving and an external CDN/proxy. A proxy that served an obsolete 95.6 MB build is not a win over a measured current same-origin bundle. Keep Worker code only if a documented requirement exists, a reproducible benchmark shows benefit, and CORS/cache/security/fallback behavior is tested. + +**Specific CI decision:** re-run the current action-pin validator against the current branch head. Fix the validator's actual reported references and ensure the validation self-test passes. Do not disable the pin rule or weaken its allowlist. + +**Exit:** every useful change from #181 has an owner and a separate PR/ticket, and every removed artifact has been proven generated, duplicated, obsolete, or inappropriate for source control. + +### 5.4 PR #182 + +Already merged. Update old documents that still say it is open, pending, or needs to be merged. Do not reopen or recreate its work. + +--- + +## 6. Phase 2 — Recover feature branches and consolidate the repository + +**Priority: P0/P1. Do not delete branches until the unique-work ledger is complete.** + +### 6.1 Feature recovery order + +Evaluate each branch independently against current main: + +1. feature/adam7-png-interlace — PNG Adam7 implementation, decoder/encoder paths, round-trip tests, and its decision record. +2. climb/C4.08-selective-jpeg — selective-JPEG encoding behavior, mask/quality interaction, and Optimize panel tests; separate unrelated branch history. +3. feat/inspector-field-sets — per-kind inspector fields, command dispatch, and object model tests. +4. climb/C8.04-missing-docs-campaign — list each unique source/test/doc contribution; split by objective and preserve no longer-valid historical text as history rather than current state. +5. audit/parity-hardening-2026-11-22 — verify exact changed tests and dist behavior. +6. fix/ci-fresh-workspace-crates — compare with current scripts/ci_refresh_stale_crates.sh and the CI cache-freshness mitigation; preserve the best tested implementation, not both. +7. fix/wasm-size-budget-repin — identify whether its size policy/decision is already superseded by current budget and generated evidence. +8. feat/release-provenance — recover unique provenance, SBOM, checksums, and manifest improvements not already present in the PR #181 decomposition. +9. fix/web-deploy-p0 — close after #184 is merged and deployment receipts are reconciled. +10. release/v0.2.5 — preserve tags and release history; retire the branch only after proving no release workflow or operator depends on it. + +For each candidate use a branch ledger with: branch, HEAD, merge-base, unique commit list, changed paths, unique behavioral value, overlap, tests, owner, active worktree, PR/ticket, and disposition. Valid dispositions are KEEP, EXTRACT, MERGE, ARCHIVE, or DELETE AFTER OWNER CHECK. + +### 6.2 Reconstruct, do not replay stale history + +When a branch is far behind or diverged, do not blindly merge its tip. Create a fresh branch from current main and recover only the intended commits/files. Prefer cherry-picking a small set of exact commits when their ancestry is clean. Otherwise apply a reviewed patch or manually port the behavior. Preserve author attribution and decision history. + +After each extraction, prove that the target PR contains only its declared objective. Compare its changed paths to other open PRs before requesting review. + +### 6.3 Duplicate marketing branches + +The observed feat/post-mvp-execution and review/post-mvp-execution branches pointed at the same SHA. Confirm this again. + +- Determine which worktree/agent owns site/. +- Keep one canonical site branch. +- Rebase or reconstruct the site implementation against current main, because the branch is based on the pre-PR-182 roadmap commit. +- Exclude documents that have already merged through #182 unless they contain new, unique site facts. +- Retain the duplicate branch only if an active worktree or agent explicitly owns it; otherwise delete the duplicate pointer after preserving the canonical branch. +- The website must be an independently reviewable PR, not bundled with editor refactoring. + +### 6.4 Branch and worktree deletion gates + +Delete a remote/local branch or remove a worktree only after all are true: + +- No active agent or worktree owns it. +- No unmerged commit is unique to it. +- All valuable source/tests/docs were merged or extracted. +- The branch has no open PR, release, tag, deployment, or CI dependency. +- The current remote has been fetched and exact SHA rechecked. +- The owner-approved cleanup list names the branch/worktree and the evidence for deletion. + +Do not use a target branch-count as the goal. The goal is zero lost work, a small set of active branches, and no duplicate working copies that obscure ownership. + +### Exit criteria + +- A unique-work inventory exists for every remote and local branch. +- Feature work has been extracted into focused PRs with tests. +- No active agent loses its working tree. +- The duplicate post-MVP branch pointer is resolved. +- Every branch marked for deletion has an evidence-backed disposition. +- All required open PRs are merged, narrowed, or explicitly blocked. + +--- + +## 7. Phase 3 — Repository hygiene and structure cleanup + +**Priority: P1. Perform after Phase 0 and as each extracted PR lands; finish before large-scale refactoring.** + +### 7.1 Generated and binary artifacts + +Inventory all tracked binary and generated paths, then classify each as: + +- Canonical user-facing asset. +- Test fixture intentionally tracked. +- Reference image intentionally tracked with provenance. +- Generated output that belongs in CI artifacts or release assets. +- Local-only runtime/build output. +- Duplicate asset. + +Specific candidates from the observed PR #181 tree: +- target/windows/firecraft-experiment.exe. +- web/dist generated JS/WASM/EXE. +- duplicate copies of reference screenshots under docs/research/screenshots and docs/screenshots/fireworks-reference. +- tracked log/devlog.md. +- any generated artifact that is already represented by a source manifest, script, or release receipt. + +Do not delete assets based on their extension alone. Check references, provenance, licensing, hash equality, packaging consumers, and test fixtures. Preserve one canonical copy where exact duplicates exist and update every reference. + +### 7.2 Ignore and local-state policy + +- Preserve the repository's existing /target, /dist, web/dist, fuzz/target, .wrangler, .cargo, .claude/scratch, /log, and /plan conventions. +- Add ignore patterns for node_modules, Playwright output, screenshots, or test results only after confirming the tools actually create them and the patterns cannot hide required source/test assets. +- Keep session journals untracked as AGENTS.md requires. +- Do not commit environment files, account IDs, Cloudflare tokens, signing material, private local references, dumps, or personal data. +- Never solve noisy status output by broad clean/reset operations. + +### 7.3 Asset and license consolidation + +- Maintain one canonical approved FireCraft brand master and document all generated/resized derivatives. +- Check that README/site/favicon/application icons reference valid assets and that image files have the correct binary signature and dimensions. +- Maintain docs/ATTRIBUTION.md as the authoritative attribution ledger. +- Record upstream URL, exact commit/version, file path, SPDX expression, copyright holder, changes made, transitive license implications, and required notice for every reused code or shipped asset. +- Separate Adobe-derived reference captures from original FireCraft screenshots and verify the repo's rules for their storage/distribution. +- Do not copy external app logos, screenshots, brush packs, fonts, or presets merely because the app is open source. Each asset has its own license. + +### 7.4 Documentation and generated-output hygiene + +Respect existing document roles: + +| File | Authority | +|---|---| +| AGENTS.md | Mandatory repository and agent operating contract | +| TASKS.md | Single live task/status ledger | +| NEXT.md | Active phase and feature acceptance detail | +| HANDOFF.md | Current operational build/test/release runbook | +| PROGRESS.md | Dated evidence snapshot | +| FEATURES.md | User-visible implemented features and limitations | +| CS6-PARITY.md | User-visible parity status with evidence | +| POST-MVP-ROADMAP.md | Strategic product direction | +| POST-MVP-BASELINE-AUDIT.md | Dated source-backed baseline | +| This plan | Integration/refactor/product sequencing | +| Task ticket | One objective, acceptance criteria, tests, owner, stopping conditions | + +Do not create another live task board. Where the same fact is repeated, link to the authority and keep dated snapshots clearly dated. + +Actions: +- Fix broken relative links and stale path names. +- Remove old instructions that reference merged PR #182 or older base SHAs. +- Mark historical plans as historical/superseded rather than silently deleting them. +- Regenerate parity, reachability, scorecard, corpus, coverage, and release outputs with their tools. +- Reconcile README and the public website only with features verified on current main/release. +- Ensure every screenshot and performance claim identifies the source build/SHA/date. +- Keep docs/research and docs/decisions distinct: observations/benchmarks are research; durable architectural choices are decisions. + +### 7.5 Dependency and workspace audit + +For every dependency change: +- Check exact crate version, license expression, dependency tree, active maintenance, Rust MSRV, transitive native/C dependencies, wasm32 compatibility, security advisories, compile time, binary size, and feature flags. +- Remove unused or duplicated dependencies only after proving no target or feature path relies on them. +- Avoid adding a large GUI/renderer framework to solve a localized capability problem. +- Keep the workspace layering gate and fwpng standalone rule intact. +- Do not bundle optional AI/cloud clients into the core editing crates. + +### Exit criteria + +- No generated build outputs or experimental executables are committed in source PRs. +- Duplicate assets are resolved with a verified canonical path. +- Attribution and license inventories are complete for new material. +- Documentation links and generated evidence are reconciled. +- Ignored local data and required tracked fixtures remain correctly separated. +- Dependency changes are justified and pass all platform/wasm/layer checks. + +--- + +## 8. Phase 4 — Structural refactoring and code health + +**Priority: P1. Refactor after integration, one boundary at a time. Refactoring must not change behavior.** + +### 8.1 Establish the baseline first + +Before each refactor: +1. Identify production code versus tests/static data. +2. Capture file/line metrics, public/private symbol inventory, module dependency graph, test inventory, and existing coverage. +3. Run focused unit, integration, UI, corpus, and browser tests for the affected surface. +4. Identify the module's real responsibility and its data ownership. +5. Write a short design note if the extraction changes visibility or the module graph. + +Do not refactor based solely on line count. Preserve small diffs and prove behavior equivalence. + +### 8.2 Priority refactor candidates + +| Priority | Area | Why | Proposed direction | +|---|---|---|---| +| R1 | crates/app/src/shell/panels.rs | Roughly 4,600 production lines in the observed main snapshot; panel families and builders are concentrated | Split by responsibility into panel modules while preserving Shell command dispatch and read-only view semantics. | +| R2 | crates/app/src/shell/mod.rs | Large mixed shell implementation and a substantial nested test module | Extract tests first; then move cohesive responsibilities to existing/new sibling modules. | +| R3 | crates/app/src/editor.rs | Large Editor implementation combining tool/gesture domains | Split pointer/gesture, selection/transforms, vector interaction, bitmap interaction, text interaction, and viewport logic where boundaries are real. | +| R4 | xtask/src/dist.rs | Large build/release module | Separate native/web artifacts, manifest, SBOM/provenance, verification, and smoke orchestration. | +| R5 | crates/app/src/menus.rs | Large file but much is declarative menu data and tests | Separate tests and schema/data only if it improves ownership; do not mistake data volume for complex production logic. | +| R6 | crates/app/src/shell/panels_web.rs | Web-specific panel surface | Keep browser-only behavior isolated; reuse shared command and model interfaces, not duplicate panel business logic. | + +These rankings are initial hypotheses. Re-measure on the exact main SHA after PR integration and update the ordering. + +### 8.3 Panel module split + +A candidate structure, subject to actual symbol ownership: + +- panels/properties.rs +- panels/layers.rs +- panels/pages_states.rs +- panels/history.rs +- panels/styles_resources.rs +- panels/fill_stroke.rs +- panels/help.rs +- panels/shared.rs + +The split must: +- Keep panel rendering read-only with respect to document state. +- Route all edits through Editor::apply / the shared command registry. +- Preserve undo/redo, journal replay, CLI/script parity, and command reachability. +- Avoid making individual panels own document mutations. +- Avoid duplicated implementations for desktop and web. +- Preserve the egui_kittest or existing UI test baseline. +- Keep visibility narrow; do not make internal helpers pub only to simplify extraction. + +Extract one family at a time and run focused tests after each family. Do not rename/split 20 files in a single PR. + +### 8.4 Shell test extraction + +The observed shell/mod.rs snapshot had its test module beginning around line 3,538. Verify the current boundary first. Move tests into a child tests module/file without losing access to private items. This is a low-risk mechanical extraction if tests remain equivalent. + +Keep snapshots and fixtures colocated with the behavior they verify, and do not create multiple competing UI test harnesses. + +### 8.5 Editor decomposition + +Use clear ownership: +- Pointer events and gesture lifecycle. +- Tool-specific interaction state. +- Selection and transform constraints. +- Bitmap selection/painting/retouch. +- Vector path/node interaction. +- Text interaction. +- Viewport transform and canvas navigation. + +The Editor remains the domain-level interaction coordinator, but each submodule should own coherent state transitions or calculations. Do not create a generic plugin framework as part of this refactor. + +### 8.6 xtask release pipeline decomposition + +Keep the existing command behavior stable while extracting: +- build orchestration; +- artifact layout and staging; +- SHA256 manifest validation; +- SBOM and provenance generation; +- platform package checks; +- browser smoke and evidence receipts. + +The CLI should remain thin, deterministic, and diagnosable. Every stage should fail closed on missing output, unreadable evidence, malformed manifests, or stale source. Add self-tests for failure modes. + +### 8.7 Refactor acceptance + +A refactor PR is complete only when: +- Public command/document behavior is unchanged unless separately approved. +- No new duplicate algorithm or second source of truth exists. +- Existing tests still pass and focused tests cover the new module boundary. +- Generated parity/reachability/corpus/coverage outputs do not regress. +- Browser workflows pass if shell/web code changed. +- File-size/coupling metrics improved for the intended responsibility, not merely moved around. +- The diff remains reviewable and the module boundaries are documented. + +--- + +## 9. Phase 5 — Finish and polish existing FireCraft workflows + +**Priority: P0/P1. Prefer completing the current editor over expanding scope.** + +Before adding competitive features, audit the actual workflow from input to visible result, undo/history, save/reopen, export, and automation. A command that cannot be reached by a user is not a polished feature. + +### 9.1 Required workflow audit + +Use FEATURES.md, CS6-PARITY.md, TASKS.md, NEXT.md, and the current issue tracker to create a matrix for: + +- New document, open, import, save, save as, autosave, crash recovery, external file changes, and recovery UI. +- Selection, multi-selection, group/subselect, transforms, align/distribute, snap/guides/grid, crop, and canvas resize. +- Vector paths, node editing, primitives, fills, strokes, gradients, boolean operations, effects, and text. +- Bitmap import, painting, selections, masks, retouching, filters, image transforms, and compositing. +- Pages, states, layers, symbols, shared layers, 9-slice, animation, and onion skin. +- Slices, hotspots, behaviors, web preview, and HTML/CSS export. +- Optimize/export preview, raster/vector/PSD import/export, batch paths, and format-loss reporting. +- CLI, scripting, browser bridge, MCP, history/journal, and automation. +- Preferences, shortcuts, command discovery, help, panel docking, theme, accessibility, and responsive workspaces. + +For each workflow record: +- User goal and exact steps. +- Expected visible result. +- Document state before/after. +- Undo/redo result. +- Save/reopen result. +- Export artifact and fidelity. +- UI/CLI/script parity where applicable. +- Tests and evidence. +- Known limitation or refusal. +- Status and next task. + +### 9.2 UI polish acceptance + +Every high-frequency editing flow should be checked for: +- Clear selected/hover/disabled/loading/error/empty states. +- Correct keyboard shortcuts and no conflicts. +- Predictable focus and keyboard operation. +- Undo/redo with clear action boundaries. +- Non-destructive preview when a change is expensive or lossy. +- Consistent panel behavior and layout persistence. +- Canvas feedback while dragging/painting and after command completion. +- Correct behavior at high DPI and browser/native viewport sizes. +- Tooltips, labels, discoverable command equivalents, and clear refusal/error copy. +- Accessibility names/roles/keyboard routes for controls. +- Visual consistency with the approved FireCraft identity. +- No hidden dead controls or misleading menu rows. + +Do not change a feature from partial to complete until the UI workflow and output are verified. + +### 9.3 Triage existing issues + +GitHub's open issue count and old issue bodies are not authoritative if they refer to a merged PR or outdated implementation. For every open issue: +1. Compare current issue state to current main. +2. Check PR history and task-ticket history. +3. Verify acceptance criteria against source and tests. +4. Close completed issues with exact evidence. +5. Rewrite partially completed issues to contain only remaining work. +6. Split issues that combine multiple independent outcomes. +7. Mark deferred work explicitly; do not leave misleading "in flight" descriptions. +8. Ensure every current code task has one task ticket and one issue where the project uses issue tracking. +9. Do not close an issue solely because a command or file exists. + +The current task ledger remains the main execution authority. Reconcile issue statuses to it; do not create a duplicate tracker. + +### Exit criteria + +- All major workflows have a status and evidence matrix. +- High-frequency workflows are usable end-to-end and have automated regressions. +- Remaining parity/product gaps have precise scope and an owner. +- Open issues no longer describe merged work as pending or completed work as missing. +- Feature documentation is aligned with actual release surfaces. + +--- + +## 10. Phase 6 — Competitive feature adoption and code-reuse program + +**Priority: P1 research, P2/P3 implementation unless it closes a proven current gap.** + +### 10.1 The rule: learn broadly, reuse selectively + +"Extract features" means identify the user problem and successful behavior, then build a FireCraft-native solution that fits the existing document model and engine. It does not mean copy another application's UI, artwork, assets, or code without permission. + +Code reuse is allowed only when: +- the exact source repository, commit, file path, copyright notice, and SPDX/license text are recorded; +- all file-level and transitive licenses are compatible with the project's distribution model; +- dependency tree, native libraries, wasm support, security, MSRV, maintenance, compile-time, and binary-size costs are accepted; +- the code fits FireCraft's Rust/document/command architecture without a second application runtime; +- tests prove correctness and no source provenance is ambiguous; +- docs/ATTRIBUTION.md is updated in the same change; +- the project owner approves any copyleft, dual-license, trademark, or project-license change before integration. + +The repository currently states Apache-2.0 as its source license. Maintaining that single-license posture is the default. Do not silently bring GPL code into the application, and do not assume a whole application shares the license of a permissively licensed file found inside it. + +### 10.2 Product research candidates + +| Reference | Study for | Code policy and integration posture | +|---|---|---| +| Krita | Brush dynamics, pressure/tilt, tablet diagnostics, popup palette, resource browser, canvas-only mode, symmetry, painting assistants, soft proofing | Krita's application is GPL-3.0. Use its public behavior/docs as a design reference. Some files may carry different licenses; only assess a specific file if its own license and dependencies are verified. No broad source transplant. | +| GIMP / GEGL / babl | Raster selection, transform/warp, filters, color conversion, pixel operations, tile-based image pipeline, non-destructive operation architecture | GIMP is GPLv3 or later. Do not copy GIMP/GEGL code into the Apache-2.0 application without an explicit licensing decision. Study public architecture and identify independently usable libraries only after their own licenses are inspected. | +| Inkscape / lib2geom | Node editing, path operations, snapping, SVG semantics, SVG filters, vector UX, precision controls | Inkscape is GPL-licensed; lib2geom needs its own current license review. Use workflow/format behavior as reference; no blind application-code port. | +| Photopea | Smart Objects, Smart Filters, adjustment layers, PSD/PSB compatibility, channels, browser editing, scripting and host messaging | Proprietary. API access is not a source license. Use published docs and observable behavior as a benchmark; no copying, decompiling, scraping, or required runtime dependency. | +| Pixlr | Guided quick actions, photo cleanup, background/object removal, selection UX, one-click export, optional AI operations | Proprietary. Study public features/workflows; do not copy source, assets, branding, text, or protected UI. Do not automate/scrape the service. | +| Penpot | Components, variants, design tokens, multi-page design, prototyping, inspection/handoff, collaborative design concepts | Repository metadata identifies MPL-2.0. Treat source reuse as a file-level copyleft decision; do not vendor code without a license and architecture review. | +| SVG-Edit | Browser SVG workflows, path editing, shape tools, selection and SVG serialization | The SVG-Edit repository identifies MIT. Potential source candidate only for specific, useful, self-contained routines after exact commit/file/dependency review. The JavaScript application is not a drop-in replacement for the Rust engine. | +| Photoshop / Affinity / Figma / Canva and similar products | Interaction patterns, discoverability, non-destructive editing, export UX, workflow expectations | Product-behavior references only unless a public, licensed API or separately licensed library exists. No proprietary code/assets. | + +Primary license/product references: +- Krita license: https://krita.org/en/about/license/ +- Krita source: https://github.com/KDE/krita +- GIMP license FAQ: https://www.gimp.org/docs/userfaq.html +- GIMP development/source map: https://developer.gimp.org/core/setup/git/ +- Inkscape license: https://inkscape.org/about/license/ +- Penpot repository/package license metadata: https://github.com/penpot/penpot +- SVG-Edit repository and MIT license: https://github.com/SVG-Edit/svgedit/ +- Photopea API (integration contract only, not source rights): https://www.photopea.com/api/ +- Pixlr license and services agreement: https://pixlr.com/license-and-services-agreement/ + +License URLs are starting references, not permission to reuse a specific file. Recheck at the exact upstream commit before using code. If a repository has file-level licenses, use the file's own notice plus the repository's license/third-party inventory. + +### 10.3 Feature-transfer workflow + +For each candidate feature: +1. Write the user problem, not the competitor product name. +2. Record the best source references, observed workflow, version/date, and limitations. +3. Search current FireCraft source, task board, issues, branches, and PRs for existing work. +4. Mark the candidate as existing, polish, extend, new, defer, or reject. +5. Create a capability comparison: expected UX, engine support, document-model change, rendering cost, CLI/script/MCP behavior, platform support, and export semantics. +6. Complete a license/provenance review before any code reuse. +7. Write an ADR before document-format changes, plugin/service boundaries, or new persistent semantics. +8. Build a small proof-of-concept against the current architecture. +9. Add unit, property, corpus, UI, browser, and performance tests at the layer where the risk exists. +10. Ship one coherent user workflow, documentation, and a truthful feature status. + +### 10.4 Feature clusters and priority + +#### A. Professional brush and stylus workflows + +- Pressure-aware brush size/opacity, spacing, hardness, angle, rotation, and smoothing. +- Tablet diagnostics displaying the actual pressure, tilt, barrel-button, eraser, and pointer events received. +- User-configurable pressure curves and device profiles. +- Brush preset library with search, categories, favorites, tags, previews, import/export, and missing-resource handling. +- Popup palette for commonly used colors, brushes, recent tools, canvas rotation/zoom/mirroring, and workspace actions. +- Tablet-oriented workspace with larger hit targets, collapsible panels, and explicit pen/touch behavior. + +Prove native and web input independently. Do not claim stylus support based on mouse input or an API type existing in source. + +#### B. Non-destructive editing and Smart Assets + +Evaluate a distinct Smart Asset model: +- Embedded source content for portability. +- Optional linked sources with missing/relink state. +- Multiple independent instances referring to one source. +- Independent transforms for placed instances. +- Edit-source workflow with clear shared-instance semantics. +- Non-destructive adjustment/filter stacks with reorder, disable/enable, parameter edit, mask, and preview. +- Defined export behavior for unsupported or flattened features. + +Do not conflate Smart Assets with design Components. Smart Assets model source content and non-destructive placement; Components model reusable design structures and behavior. This is a document-model and file-compatibility decision. Write an ADR and migration plan before adding persistent nodes/fields. + +#### C. Quick Actions and guided workflows + +Build discoverable actions over existing engine commands: +- Crop, resize, rotate, straighten, convert, and fit to target dimensions. +- Levels, curves, exposure/brightness/contrast, hue/saturation, and color balance. +- Heal, clone, blur, sharpen, denoise, and background isolation only when engine reliability is adequate. +- Export selected layer, selection, page, state, asset, or sprite with an explicit preset. + +Every action must call the same engine/command path used elsewhere, support undo, preview or confirmation for destructive operations, cancel safely, and expose advanced controls for expert use. Do not create a second editor engine for quick actions. + +#### D. Color management and print-quality workflows + +- ICC profile awareness and explicit import/export conversion. +- Display rendering intent and black-point compensation. +- Soft proofing and out-of-gamut warnings. +- RGB/CMYK/Lab distinctions and export conversion warnings. +- Print dimensions, DPI, and bleed only after the color pipeline is defined. + +Do not add a profile picker without a coherent color pipeline and test profiles. Complete the color-management ADR and dependency review first. + +#### E. Vector and typography depth + +- Bézier node ergonomics, path operations, snapping, guides, assistants, precision constraints. +- Better SVG import/export fidelity with a formal capability matrix. +- Text shaping, font discovery/management, variable-font behavior, and missing-font handling. +- SVG filter and mask semantics. +- Clear warnings when round-tripping external formats loses information. + +Do not promise complete SVG/PSD/AI compatibility from a filename extension or a single sample file. + +#### F. Resource and design-system management + +- Unified searchable resource manager for brushes, swatches, gradients, styles, symbols, patterns, and reusable assets. +- Tags, favorites, dependency/usage graph, preview, import/export, missing-resource handling, and safe replace/delete. +- Named color palettes and semantic/design tokens. +- Component variants and shared design structures after a page/artboard/component ADR. + +#### G. Animation and interactive design + +- Preserve and polish the existing states/timeline/GIF workflow. +- Evaluate tweening, onion skin, preview controls, frame export, and sprite atlas. +- Prototype simple hotspots/transitions/interactions without making the core editor depend on a hosted collaboration service. +- Use existing slice/hotspot concepts and web export pipeline where possible. + +#### H. AI-assisted operations + +Later and optional: +- Subject/background segmentation, generative fill/expand, upscaling, layer extraction, and prompt-assisted edits. +- Local provider adapters and remote providers must be separate implementations. +- Require explicit user initiation, clear local-vs-remote disclosure, cost/provider disclosure, preview, cancellation, and failure recovery. +- Never upload document pixels by default. +- Core open/edit/save/export must work without AI or network access. + +### 10.5 Rust/library reuse candidates + +In addition to application references, evaluate small-purpose libraries rather than importing an entire GUI framework. Build a shortlist for vector tessellation, SVG parsing/rendering, raster formats, font shaping, image operations, color management, and geometry. + +For each candidate verify: +- exact current crate license and third-party notice; +- dependency and native-code tree; +- wasm32 support and feature flags; +- compile time and final binary/WASM size; +- API stability and maintenance; +- fuzzing/security state; +- overlap with existing FireCraft modules; +- whether it replaces code or creates duplicate parallel logic. + +Prefer pure-Rust and permissively licensed dependencies where technically sound. Avoid adding multiple overlapping image/geometry libraries. No library is approved merely because it is popular or has an attractive top-level SPDX badge. + +### Exit criteria + +- Every adopted idea has a defined user benefit and an existing-code gap check. +- Every reused line/library/asset has verified provenance and a compatible license decision. +- New document semantics have an ADR and migration/corpus coverage. +- Features are delivered through existing command/document/undo/export architecture. +- Browser/native behavior and performance are measured. +- Feature claims remain bounded by tested capabilities. + +--- + +## 11. Phase 7 — Reliability, interoperability, performance, and security + +**Priority: P0/P1. Run across every phase; do not postpone data-loss risks.** + +### 11.1 Data integrity + +- Audit save paths for atomic-write guarantees, backup/previous generation, and interrupted-save behavior. +- Add fault injection for disk full, permission error, process termination, corrupt recovery data, and external modification. +- Verify autosave/recovery behavior across desktop and browser storage. +- Give users a clear recovery decision rather than silently overwriting files. +- Test large documents and hostile dimensions/metadata. +- Preserve unknown file-format nodes/chunks where current format guarantees require it. + +This work aligns with PM-01. Reuse that ticket rather than creating a duplicate. + +### 11.2 Format capability and fidelity + +Build one source of truth for: +- decode/open support; +- editable subset; +- save/round-trip support; +- layers/masks/text/path/effect/profile preservation; +- flattening/substitution behavior; +- known-loss warnings; +- unsupported and unsafe constructs. + +The GUI, CLI, documentation, and pre-export warning path must consume the same capability contract. Add a representative corpus for each format and test expected preservation/loss. Do not advertise unsupported formats. This aligns with PM-03 and existing release/format tickets. + +### 11.3 Performance budgets + +Measure by exact SHA, host, toolchain, build profile, input document, and warm/cold conditions: +- startup and first interactive paint; +- open/import/save/export; +- large canvas and high object count; +- filters and masks; +- memory peak and steady-state use; +- CPU/GPU rendering; +- UI responsiveness during editing; +- WASM download/compile/startup; +- bundle size and cache hit behavior. + +Separate desktop, browser, and CLI measurements. Record the workload and method; do not compare non-equivalent builds. Introduce rising-only floors only after stable repeated measurements. + +This aligns with PM-02. + +### 11.4 Security and privacy + +- Fuzz every new parser/decoder/serialization boundary. +- Bound all input-driven allocations and recursion. +- Ensure document files cannot trigger arbitrary network access or filesystem traversal. +- Audit script host and MCP access for root scoping, explicit permissions, and confirmation for destructive/write actions. +- Keep credentials out of tracked files and browser code. +- Keep third-party analytics, font, image, and AI calls disabled unless specifically approved and disclosed. +- Add safe error handling and recovery around plugin/automation/worker interfaces. + +Do not expand MCP write scope until the permissions/transaction design is approved. + +### 11.5 Verification policy + +Use focused gates during development and the full required gate before merge: + +~~~bash +cargo fmt --all +cargo run -p xtask -- layers +cargo run -p xtask -- wasm +cargo run -p xtask -- corpus +cargo run -p xtask -- parity +cargo run -p xtask -- scorecard +cargo run -p xtask -- ci +~~~ + +Read AGENTS.md and the current HANDOFF.md before running. The list above is a planning reference; use the exact currently supported command syntax and only run commands permitted by the repository rules. Do not replace the prescribed gate with cargo test --workspace. Run focused crate/integration tests in addition to xtask ci. + +For any shell/web change: +- build the production-like web distribution using the prescribed xtask command; +- serve the exact dist/web output locally; +- execute the documented Playwright bridge workflow; +- verify open/import/draw/edit/undo/save/download and error cases relevant to the change; +- check page errors, network/CORS, Wasm MIME, and manifest/digest; +- capture the exact build SHA and test receipt. + +For any deployment or release change: +- test the release bundle, not an arbitrary developer build; +- validate manifest syntax and digest shape before comparing files; +- check every served asset and content type; +- distinguish injected HTML changes from executable asset changes; +- record deployment ID, project, branch, SHA, asset hashes, browser proof, and rollback target. + +--- + +## 12. Phase 8 — Marketing website as a separate application in the same repository + +**Priority: P1. This can run in parallel with editor work only after site ownership is clear.** + +Use the implementation on feat/post-mvp-execution. Do not create a second website. + +### Work sequence + +1. Verify the canonical site branch and worktree owner. +2. Reconstruct a site-only PR against current main, excluding already-merged roadmap docs. +3. Review all new page copy against current source/tests/releases and the existing FEATURES/CS6-PARITY documents. +4. Preserve real, build-stamped screenshots and approved brand assets; separate product captures from mockups and Adobe reference material. +5. Validate the release API consumer: strict HTTPS host allowlist, DOM-safe rendering, stable/prerelease policy, missing assets, rate limits, malformed payloads, API outage fallback, and correct asset labels. +6. Add direct routes/pages only when useful; maintain a static site, no unnecessary client framework or backend. +7. Verify semantic markup, keyboard navigation, reduced motion, contrast, screen-reader labels, responsive layout, direct route refresh, link integrity, metadata, sitemap, robots, security headers, CSP, caching, and image optimization. +8. Implement a real preview workflow rather than claiming the production-only workflow generates previews. +9. Verify the actual Cloudflare Pages project and deployment mode. Keep firecraft-site and firecraft-web completely separate. +10. Deploy a preview and capture a browser/accessibility/performance receipt. +11. Obtain explicit approval before production deployment, custom-domain changes, DNS changes, or production project setting changes. +12. Update public links only after the live URL and deployed SHA are independently verified. + +### Deployment boundaries + +- Marketing site: site/ to firecraft-site. +- Editor: dist/web to firecraft-web. +- The release workflow currently stages artifacts and creates a draft; its Pages deploy step is commented out in the observed main workflow. Do not describe it as automatic production deployment. +- Do not add credentials, analytics, tracking, or user-data collection to the site by default. +- The marketing project must not build from or overwrite the editor output, and editor deployment changes must not rewrite marketing configuration. + +Follow MARKETING-SITE-ROADMAP.md and PM-08. Do not create additional site tickets until the site audit has deduplicated existing tasks. + +### Exit criteria + +- One canonical site branch/PR; no duplicate implementation. +- Every public feature/platform/format claim has evidence. +- Download URLs are actual published assets. +- Responsive/accessibility/performance checks are recorded. +- Preview deploy works independently of editor build. +- Production deployment has owner approval and a deployment receipt. + +--- + +## 13. Phase 9 — Release, platform, and deployment readiness + +**Priority: P0/P1. Reuse the existing release campaign and per-artifact tickets.** + +Do not invent a new release matrix. Reconcile T27, docs/release/ARTIFACT-MATRIX.md, docs/release/EXECUTION-BOARD.md, and per-task tickets against actual build/install/launch evidence. + +- A recipe is not an artifact. +- A successful build is not an install. +- An install is not a launch. +- A launch is not a workflow smoke. +- A published asset is not certified unless the campaign's certification requirements are met. +- No platform may be advertised as supported without platform-native build and install/launch evidence. +- Signing/notarization claims require real signing identities and receipts. +- Keep draft releases separate from published releases. +- Verify SBOM schema and contents, checksums, source provenance, manifest, and release bundle. +- Make a production Pages deployment a separate explicit operator action unless the release workflow is deliberately changed and reviewed. +- Record the exact main tag/commit and compare the live editor JS/WASM/manifest against release bytes. +- Keep the current same-origin strategy unless fresh evidence justifies a new distribution architecture. + +### Exit criteria + +- The release artifact matrix and execution board agree. +- Every advertised platform has the right level of evidence. +- Release archive and live site digests are reconciled. +- Draft and production workflows are distinct and fail closed. +- No platform, compatibility, or performance claim exceeds the recorded evidence. + +--- + +## 14. Phase 10 — Operating model and long-term maintenance + +Create a small set of durable rules that prevents the same integration debt returning: + +- One active worktree per owned task by default. +- Every worktree has a branch, owner, issue/ticket, and objective. +- No agent edits files owned by another active lane without coordination. +- Every feature PR lists source surfaces, tests, user workflow, docs, and status-ledger change. +- Every new third-party dependency/resource includes license/provenance review. +- Every persistent document-model change includes migration and unknown-field preservation tests. +- Every shell/web change includes a real-browser receipt. +- Every performance claim includes a reproducible benchmark record. +- Every release/deploy action includes a SHA/digest receipt. +- Every issue/task has one status owner and one authoritative acceptance criterion. +- Close stale branches/worktrees only through the deletion gate. +- Record session closeout per AGENTS.md; keep log/devlog.md untracked. + +### Periodic audits + +- Weekly or per release: branches, worktrees, open PRs, stale issue bodies, failed CI runs. +- Each release: dependencies/security advisories, attribution/license state, artifact matrix, website downloads, deployment digest. +- Each major UI milestone: screenshot regression, keyboard/a11y, native/web parity, and docs accuracy. +- Each new file-format or resource feature: corpus, fuzz anchor, unknown-node preservation, migration behavior. + +--- + +## 15. Phase sequencing, parallelism, and priority + +| Phase | Work | Entry gate | Exit proof | +|---|---|---|---| +| 0 | Protect local work and establish ownership | Immediate | Ownership inventory; no unidentified changes | +| 1 | Refresh PR/branch inventory and triage | Phase 0 | Current PR decision ledger and review disposition | +| 2 | Extract/rebase/merge PR and branch work | Phase 1 | Unique feature work integrated through focused PRs | +| 3 | Repository hygiene and documentation consolidation | Integration batches | No inappropriate generated artifacts; docs/index/attribution reconciled | +| 4 | Structural refactoring | Stable source baseline | Smaller cohesive modules with unchanged behavior and full tests | +| 5 | Finish/polish current workflows; issue reconciliation | Stable integration baseline | User workflow matrix and closed/re-scoped stale tickets | +| 6 | Competitive feature research and implementation | Gap matrix and license review | One end-to-end feature at a time with ADR/tests/docs | +| 7 | Reliability, format, performance, security | Runs continuously; PM tickets | Measured budgets, data-integrity and format receipts | +| 8 | Marketing site | Site ownership verified | Independently tested preview and approved production receipt | +| 9 | Release/platform certification | Feature baseline and T27 reconciliation | Certified evidence only for actually proven targets | +| 10 | Governance and maintenance | Rolling | No orphaned work, reproducible integration process | + +### Safe parallel lanes + +Parallel work is allowed only after Phase 0 has assigned file ownership. + +Potential disjoint lanes: +- Site-only implementation under site/ and its workflow/docs, independent from Rust editor code. +- A focused IO format capability registry in crates/io, if not shared with another active branch. +- Release evidence reconciliation in docs/release, scripts, and xtask, provided it does not overlap an active release PR. +- Isolated engine crate work only when its dependencies and tests are disjoint. + +Do not concurrently assign two agents to: +- crates/app/src/shell/mod.rs or panels.rs; +- crates/app/src/editor.rs; +- docs/TASKS.md, NEXT.md, HANDOFF.md, PROGRESS.md; +- Cargo.toml/Cargo.lock and CI workflows; +- shared document serialization/model files; +- release workflow and manifest scripts. + +The integration owner controls shared ledgers, merges, and branch cleanup. Feature agents work in separate worktrees and report their SHA/PR. + +--- + +## 16. Required task decomposition and naming + +Use existing issues and tickets first. Do not create duplicates. + +Suggested parent workstreams for any genuinely new tickets: + +- INT-01 — local worktree and branch preservation audit. +- INT-02 — open PR triage and merge/extraction. +- INT-03 — unique feature-branch recovery. +- CLEAN-01 — generated artifact and duplicate asset cleanup. +- CLEAN-02 — documentation/link/ledger reconciliation. +- ARCH-01 — shell/panel decomposition. +- ARCH-02 — Editor interaction decomposition. +- ARCH-03 — xtask/release decomposition. +- UX-01 — existing workflow and UI polish audit. +- UX-02 — issue tracker reconciliation. +- BENCH-01 — competitor and library feature-transfer matrix. +- BENCH-02 — licensing/provenance gate and code-reuse shortlist. +- CREATIVE-01 — brush/stylus/resource manager. +- CREATIVE-02 — non-destructive Smart Assets/Filters. +- CREATIVE-03 — quick actions and guided workflows. +- COLOR-01 — color-management pipeline and soft proofing. +- SITE-01 — existing marketing-site implementation and independent Pages deployment. +- REL-01 — data integrity/save/recovery. +- IO-01 — format capability and fidelity. +- PERF-01 — measured performance and size budgets. +- RELEASE-01 — release/platform evidence reconciliation. + +These are proposed parent identifiers, not permission to duplicate PM-01 through PM-08, T27, Phase 22 issues, existing task tickets, or existing CI/deployment issues. During Phase 0/1, map each ID to an existing issue/ticket or reuse its identifier. Only create a ticket when the outcome is demonstrably missing. Keep parent workstreams in planning docs; keep TASKS.md the live ledger. + +Each ticket must define: objective, user problem, current evidence, scope, non-goals, files/surfaces, owner, dependencies, architecture/security/license concerns, implementation steps, regression tests, platform/wasm implications, UI/UX acceptance, documentation/status updates, stopping conditions, rollback, and definition of done. + +--- + +## 17. Global acceptance criteria + +The consolidation/modernization program is complete only when: + +### Source and integration +- No active worktree or local-only commit is lost. +- Every open PR is merged, narrowed, or explicitly blocked with owner and next action. +- Every unique branch change has a recorded disposition. +- No duplicate branch/worktree creates ambiguity about file ownership. +- Generated binaries and build output do not leak into source PRs. +- No branch is deleted without proving its unique work is preserved. + +### Code quality and architecture +- Workspace layering and fwpng standalone constraints pass. +- No duplicate implementation or second command authority is introduced. +- Shell, editor, and xtask modules have clear responsibilities and tests. +- Hostile inputs remain bounded and return typed errors. +- Existing save/load/undo/export workflows remain compatible. +- Refactors have measurable benefits and preserve observable behavior. + +### Product and UX +- Core user workflows are exercised end-to-end. +- Partial/missing features are labeled honestly. +- Keyboard, accessibility, panel state, responsive layout, and error handling are reviewed. +- Feature adoption from other apps fits the existing engine and document architecture. + +### Reuse, licensing, and provenance +- No proprietary app code/assets are copied. +- No GPL/copyleft code is merged into the Apache-2.0 project without an explicit owner-approved licensing decision and legal review. +- Every reused code/resource has file-level provenance, exact license, dependencies, and notices. +- All feature work is original or reuse-authorized and attributed. + +### Tests and delivery +- The prescribed full xtask ci gate passes on final integration SHAs. +- Browser smoke passes for shell/web changes. +- Corpus, fuzz, parity, reachability, and generated evidence do not regress. +- Site preview and production deployments are verified separately. +- Platform and release claims are evidence-backed. + +### Project management +- TASKS.md is the single live task ledger. +- NEXT.md, PROGRESS.md, HANDOFF.md, FEATURES.md, CS6-PARITY.md, issues, and website content agree on current status. +- No stale issue claims that merged work is still in flight. +- Each session ends with branch/SHA, evidence, open blockers, and a clear next ticket. + +--- + +## 18. Stop conditions and escalation + +Stop and report rather than guessing when: +- A local worktree contains unidentified or uncommitted owner/agent work. +- A branch or PR has changes not attributable to a current owner. +- A deletion could remove a unique commit, release tag, deployment record, or test fixture. +- Two PRs alter the same source/ledger and merge order is unresolved. +- An upstream license is absent, ambiguous, file-level, or incompatible with the intended distribution posture. +- A proposed copied code path is GPL/copyleft and no owner-approved license decision exists. +- A format/document-model change would discard unknown data or lacks a migration plan. +- A production deploy would change project settings, domain, DNS, or output path without owner authorization. +- CI results are skipped, stale, cancelled, or from a different SHA. +- A feature cannot be validated on its intended surface or the required hardware/device is unavailable. +- An AI/cloud operation would transmit user artwork without explicit consent and clear disclosure. +- A test failure is being hidden by weakening a gate or changing a golden/coverage/parity floor without evidence. + +Escalation reports must include: exact SHA, command/URL, evidence, impact, attempted safe options, and the one decision needed from the owner. + +--- + +## 19. First execution cycle + +The next agent's first cycle is deliberately narrow: + +1. Read AGENTS.md and this plan. +2. Rerun Phase 0 in the actual development environment. +3. Refresh PR and branch states from GitHub and configured remotes. +4. Produce a current integration ledger with owners, file scopes, unique commits, CI and review state. +5. Resolve the disposition of #181, #184, #178, feat/post-mvp-execution, and the feature branches. +6. Do not begin new creative features or destructive cleanup until the owner can review the integration ledger. +7. Present the proposed integration order and identify the first safe PR. +8. Once approved by the repository's normal process, execute one focused integration unit at a time and update TASKS.md/tickets in the same change. + +The first implementation target is not automatically #181, the website, the brush engine, or a refactor. It is whichever small, well-owned, non-overlapping change the Phase 0/1 evidence identifies as safest and highest leverage. + +--- + +## 20. Source references and research + +- [AGENTS.md](../AGENTS.md) — authoritative operating rules. +- [TASKS.md](TASKS.md) — live task status. +- [NEXT.md](NEXT.md) — current phase and parity criteria. +- [HANDOFF.md](HANDOFF.md) — current build/test/release operations. +- [POST-MVP-ROADMAP.md](POST-MVP-ROADMAP.md) — product scope. +- [POST-MVP-BASELINE-AUDIT.md](POST-MVP-BASELINE-AUDIT.md) — dated code-backed baseline; refresh it after integration. +- [POST-MVP-AGENT-HANDOFF.md](POST-MVP-AGENT-HANDOFF.md) — post-MVP audit contract. +- [POST-MVP-EXECUTION-PLAN.md](POST-MVP-EXECUTION-PLAN.md) — superseded older execution plan; directs agents here. +- [MARKETING-SITE-ROADMAP.md](MARKETING-SITE-ROADMAP.md) — public site scope and deployment gates. +- [research/creative-app-benchmark.md](research/creative-app-benchmark.md) — feature transfer and source licensing research. +- [tasks/](tasks/) and [release/EXECUTION-BOARD.md](release/EXECUTION-BOARD.md) — current task acceptance and release work. From 78b854c11261f1fc2faf6fb88c140d1f62db8bbd Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:16 -0600 Subject: [PATCH 2/9] docs(handoff): add phased consolidation agent instructions --- docs/REPOSITORY-CONSOLIDATION-HANDOFF.md | 219 +++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 docs/REPOSITORY-CONSOLIDATION-HANDOFF.md diff --git a/docs/REPOSITORY-CONSOLIDATION-HANDOFF.md b/docs/REPOSITORY-CONSOLIDATION-HANDOFF.md new file mode 100644 index 00000000..2ebba5ca --- /dev/null +++ b/docs/REPOSITORY-CONSOLIDATION-HANDOFF.md @@ -0,0 +1,219 @@ +# FireCraft — Repository Consolidation Agent Handoff + +> **Read this first after AGENTS.md.** +> **Master plan:** [REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md). +> **Snapshot baseline:** main 4ff8f786e365c8b7d7609e435424c9c746e61d6d, 2026-11-24. Refresh before action. +> **This handoff authorizes audit and planning first; it does not authorize destructive cleanup, license changes, production deploys, or blind merges.** + +## Mission + +Consolidate FireCraft's branches, PRs, local development work, code structure, feature backlog, and release process. Recover valuable work, remove true duplication and generated debris, refactor high-coupling modules safely, polish existing workflows, and then adopt high-value creative features from other products where they fit the project. + +The expected result is one coherent, tested application and an understandable repository—not an indiscriminate merge of every branch or a port of entire competitor applications. + +## Mandatory operating contract + +1. Follow AGENTS.md. It is the operating authority. +2. Start from current main, then refresh every remote, branch, PR, issue, check run, and local worktree. Do not use this document's snapshot as live truth. +3. Preserve all staged, unstaged, untracked, ignored-but-relevant, and local-only work. +4. Identify every active agent/worktree and assign file ownership before shared edits. +5. No hard reset, clean, force push, bulk branch delete, or bulk worktree prune during the initial audit. +6. No broad git add -A when generated or other-agent files may exist. +7. One objective per PR; split cross-cutting PRs by behavior and verification boundary. +8. Never merge a PR whose checks are skipped/stale and represent that as passed. +9. Keep Apache-2.0 as the default project licensing posture. Do not copy GPL/proprietary code into FireCraft without explicit licensing approval and legal review. +10. Do not copy Adobe code, binaries, artwork, source, or local reference-install data. +11. Keep the same document model and command registry as the authority for GUI, CLI, scripting, browser, and MCP. +12. Any web/shell change receives real-browser verification. Any data-model/file-format change receives migration, corpus, unknown-field preservation, and fuzz coverage. +13. Production deployment, DNS, domain changes, Cloudflare project mode changes, or publication need explicit owner approval. +14. TASKS.md remains the single live task ledger. Do not create another board. + +## Phase-by-phase execution + +### Phase 0 — Freeze, preserve, and inventory + +- Record repo root, current branch/HEAD, remotes, status, ignored files, local branches, tags, and worktrees. +- Ask each active agent for branch, SHA, worktree, dirty files, files owned, and next commit. +- Inventory local-only commits and compare them with every remote. +- Refresh open PRs, base/head SHAs, changed files, review comments, and CI/check status. +- Record branch ancestry and changed-file overlap. +- Mark anything uncertain UNVERIFIED. +- Stop before code changes if ownership or preservation is unresolved. + +**Required output:** current baseline/integration inventory with exact SHAs and owner/disposition for every active worktree and branch. + +### Phase 1 — PR triage and integration plan + +Refresh these items from current GitHub state: + +- **#182:** already merged in the observed snapshot. Do not repeat the old merge instruction. +- **#184:** five-file deployment receipt PR; resolve review comments (HTML beacon checksum exception, status vocabulary, manual Pages deploy fact, live hash comparison), verify evidence, then merge if still clean. +- **#178:** preserve the slice-behavior export fix, but extract it from the release-doc and release-tooling changes. Fix exact-name priority and safe JS/HTML path encoding; rebase and run focused tests. +- **#181:** 243-file/96-commit mixed PR in the observed snapshot with conflicts and a failed action-pin gate. Decompose into focused PRs; remove generated output; reassess the obsolete CDN/proxy design against same-origin release evidence. Do not merge wholesale. +- **feat/post-mvp-execution:** contains the marketing site implementation. Preserve the site work, but reconstruct a site-only PR on current main, excluding documents already merged in #182. +- **review/post-mvp-execution:** duplicate SHA with feat/post-mvp-execution in the observed snapshot. Check worktree ownership before retiring it. + +Create a PR decision matrix with objective, unique changes, overlap, current checks, review findings, tests, owner, and disposition. + +**Required output:** a small ordered integration queue. Do not create feature tickets until the current PRs/branches have been reconciled. + +### Phase 2 — Recover unique feature work and consolidate branches + +Audit Adam7 PNG, selective JPEG, inspector field sets, parity hardening, missing-docs campaign, release provenance, CI cache workaround, WASM budget, and historical release branch. + +For each branch: +- list unique commits and files; +- verify whether the implementation/test/decision already exists on main; +- identify any local worktree/active owner; +- extract only the useful patch; +- create one focused PR per concern; +- preserve attribution, tests, and decision history; +- delete the branch only after the deletion gate in the master plan passes. + +Do not chase a target branch count. The goal is zero lost work and one active branch per owned task. + +### Phase 3 — Repository hygiene + +Audit and safely classify: +- target/windows experiment binaries; +- web/dist generated JS/WASM/EXE; +- tracked session log files; +- duplicate screenshots and images; +- broken references to old asset names; +- invalid PNGs, stale or duplicated logo exports; +- local caches, node_modules, test-results, Playwright output; +- generated docs and reports; +- unused/duplicated Cargo dependencies; +- docs that describe merged PRs as still open. + +Remove only what is proven generated, duplicated, obsolete, or inappropriate for source control. Check references, hashes, manifests, provenance, and packaging consumers first. Keep canonical assets and required test fixtures. + +### Phase 4 — Structural code refactor + +Do not start by splitting every large file. Re-measure current production/test boundaries and preserve behavior. + +Priority candidates: +1. panels.rs: split by panel responsibility (properties, layers, pages/states, history, styles/resources, fill/stroke, help/shared). +2. shell/mod.rs: extract tests first, then move coherent responsibilities to modules. +3. editor.rs: split pointer/gesture, selection/transforms, vector interaction, bitmap interaction, text interaction, and viewport logic. +4. xtask/src/dist.rs: split native/web assembly, manifests, SBOM/provenance, verification, and smoke orchestration. +5. menus.rs: separate tests or declarative data only if ownership improves; much of its size is static menu data. +6. panels_web.rs: keep platform-specific UI isolated while reusing shared engine/command semantics. + +Use small PRs. Preserve visibility and layering rules. Never create duplicated editing logic or direct document mutation paths in UI panels. + +### Phase 5 — Finish and polish existing features + +Audit end-to-end workflows across document open/save/recovery, vector/bitmap editing, text, masks, effects, pages/states/layers, symbols, slices/hotspots, export, CLI, scripting, browser bridge, and MCP. + +For each workflow record: +- exact user steps and expected visible result; +- undo/redo behavior; +- save/reopen behavior; +- export output and known fidelity limits; +- relevant tests and browser/native evidence; +- status and outstanding work. + +Reconcile open issues with current main and the task ledger. Close genuinely complete issues with proof; rewrite partial issues to contain only remaining work; never close based solely on a source symbol or PR existing. + +### Phase 6 — Competitor feature research and selective reuse + +Benchmark feature/workflow ideas from: +- Krita: brush engines, stylus/pressure/tilt, tablet diagnostics, popup palette, resource browser, soft proofing. +- GIMP/GEGL/babl: raster selection/transform, filter operations, tiled raster architecture, color conversion. +- Inkscape/lib2geom: vector node editing, path operations, snapping, SVG fidelity. +- Photopea: Smart Objects, Smart Filters, adjustment layers, broad PSD workflows, scripting and host messaging. +- Pixlr: quick actions, guided image editing, subject/background operations, optional AI. +- Penpot: components, design tokens, prototyping, handoff and collaborative design concepts. +- SVG-Edit: browser SVG interaction and path editing. + +Use behavior/docs as product research. Reuse source code only after exact file-level license, dependency, wasm/platform, security, maintenance, and architecture review: +- Krita and GIMP are GPL; do not transplant GPL-covered application code into the Apache-2.0 project without an explicit project licensing decision and legal review. +- Inkscape is GPL; its code is not an Apache-compatible default source. +- Penpot's repository metadata identifies MPL-2.0; file-level obligations require explicit review. +- SVG-Edit identifies MIT; individual reusable routines may be candidates after commit/file/dependency inspection and attribution. +- Photopea and Pixlr are proprietary; no code/assets/copying/decompiling/scraping. Their public APIs do not license their internal implementation. +- Third-party files/assets/fonts/brush packs carry their own licenses; never infer them from the application's license. + +For each adopted feature: write a user problem, compare current FireCraft support, define UX/engine/doc-model/performance needs, write ADR if persistent semantics change, implement one end-to-end workflow, test, document, and update attribution. + +### Phase 7 — Reliability, format, performance, security + +Reuse PM-01 through PM-08 and existing tickets. Prioritize: +- atomic saves and recovery fault injection; +- format capability registry and explicit loss warnings; +- representative import/export corpus; +- performance measurements by SHA/host/profile/document; +- wasm size/startup measurement; +- bounded hostile-input handling and fuzz anchors; +- MCP/script permissions and data access; +- keyboard/accessibility and browser parity. + +Do not change budgets or generated floors without understanding and recording the new measurement basis. + +### Phase 8 — Marketing website + +Keep the existing static site implementation. Rebase/reconstruct from feat/post-mvp-execution into a focused site PR. Verify: +- real screenshots and product claim matrix; +- release metadata allowlist/fallback and actual published download assets; +- desktop/tablet/mobile UI and accessibility; +- SEO, sitemap, robots, CSP/headers/cache; +- Pages project separation and preview deploy; +- current project mode/domain/output from actual Cloudflare configuration. + +Marketing site is site/ → firecraft-site. Editor is dist/web → firecraft-web. Never repoint one to the other. Production deployment and DNS changes are owner-gated. + +### Phase 9 — Release and platform evidence + +Reconcile existing T27 tickets, artifact matrix, execution board, and release receipts. A build recipe is not a verified artifact; an artifact is not an install; an install is not a successful launch. Publish platform support only with native build/install/launch/smoke evidence. Verify release hashes against the live editor deployment and keep draft release creation separate from production publication. + +### Phase 10 — Closeout and maintenance + +Before each session ends: +- update TASKS.md and its ticket; +- regenerate applicable scorecard/parity/corpus evidence; +- update PROGRESS/HANDOFF as required; +- record the exact SHA and test/browser receipts; +- identify open blockers and next owner; +- ensure log/devlog.md stays untracked; +- push in AGENTS.md remote order. + +## Initial command checklist + +Run in each relevant worktree. Do not run destructive commands during initial inventory. + +~~~bash +git status --short --branch +git rev-parse HEAD +git remote -v +git branch -vv +git worktree list --porcelain +git log --oneline --decorate --graph --all -80 +git status --ignored --short +~~~ + +Before commits use current AGENTS.md commands. At the observed baseline, the canonical full gate is: + +~~~bash +cargo fmt --all +cargo run -p xtask -- ci +~~~ + +Use focused crate tests as appropriate. Do not use cargo test --workspace as a shortcut. For any shell/web change, execute the real-browser workflow in HANDOFF.md §6.2 against the exact built dist/web. Do not claim that a skipped check passed. + +## Required deliverables before feature work starts + +1. Current branch/PR/worktree/agent ownership inventory. +2. PR-by-PR disposition matrix and integration order. +3. Unique branch commit recovery table. +4. Repository artifact/asset/attribution cleanup report. +5. File-level architecture/refactor map with tests and dependencies. +6. Updated issue/task deduplication map. +7. Feature-transfer/license matrix for the selected competitor ideas. +8. A small first execution batch with owners, files, acceptance tests, and stopping conditions. + +## Agent stop conditions + +Stop and report if local/agent ownership is unclear, any unique work could be lost, a PR has skipped/stale validation, a proposed code source has an unclear or incompatible license, a document-format change could discard unknown data, a deployment would change production configuration without owner approval, or a feature cannot be verified on its target platform. + +Do not start speculative feature implementation, mass cleanup, mass branch deletion, broad module rewrites, or license changes before the eight deliverables above exist and have been reviewed. From 39812ca323ce8fa67b174ffc8db7344dd0b70bdf Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:19 -0600 Subject: [PATCH 3/9] docs(research): expand competitor and code reuse benchmark --- docs/research/creative-app-benchmark.md | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/docs/research/creative-app-benchmark.md b/docs/research/creative-app-benchmark.md index 7bded48d..082624cd 100644 --- a/docs/research/creative-app-benchmark.md +++ b/docs/research/creative-app-benchmark.md @@ -195,3 +195,72 @@ This table is a prioritization proposal only. The baseline audit determines whet 4. For any new architecture or document-format semantics, write an ADR/spike before broad implementation. 5. Implement a small end-to-end workflow with evidence before adding more engine variants or format labels. 6. Update this benchmark when a source behavior, license, or strategic recommendation changes. + + +## 10. Additional application references and source-reuse candidates + +The benchmark is intentionally broader than the initial Krita/Photopea/Pixlr comparison. These additional products illuminate gaps across raster editing, vector editing, interface design, and browser SVG workflows. + +### 10.1 GIMP and GEGL + +**Study:** selections, transforms, masks, filters, channel operations, layer workflows, tiled image processing, color conversion, and the separation between image operations and the application UI. + +**FireCraft opportunities:** audit whether existing raster, compose, filter, selection, and tile abstractions cover the same user outcomes. Use GIMP/GEGL/babl as architectural research, not as a mandate to replace FireCraft's renderer or document model. + +**License boundary:** GIMP is distributed under GPL version 3 or later. Do not port GPL-covered code into the Apache-2.0 FireCraft application without an explicit owner decision to change the licensing posture and legal review. Inspect GEGL and babl licenses independently; do not assume they inherit GIMP's top-level license or are automatically compatible. + +References: +- [GIMP license FAQ](https://www.gimp.org/docs/userfaq.html) +- [GIMP source/development map](https://developer.gimp.org/core/setup/git/) + +### 10.2 Inkscape and lib2geom + +**Study:** precision vector editing, node and handle workflows, snapping, path operations, SVG object semantics, filters, gradients, markers, and vector export fidelity. + +**FireCraft opportunities:** improve path/node manipulation, SVG round-trip tests, snapping and guides, boolean operations, and precision-oriented UI. Compare current vector engine and SVG importer/exporter before adding libraries. + +**License boundary:** Inkscape is GPL-licensed. Treat its application code as behavioral/architectural reference only unless a separate licensing decision permits reuse. lib2geom is a separate project and must have its own current license, commit, dependency, maintenance, and portability review before any source or binding is considered. + +References: +- [Inkscape licensing](https://inkscape.org/about/license/) +- [Inkscape source repository pointer](https://github.com/inkscape/inkscape) + +### 10.3 Penpot + +**Study:** reusable components, variants, design tokens, page and component navigation, prototyping, inspector/handoff surfaces, and the distinction between a design file and its reusable system assets. + +**FireCraft opportunities:** inform a component/variant architecture and developer handoff flow, but retain FireCraft's own document model, command registry, and local-first file behavior. Component/variant work requires an ADR and a migration strategy before adding persistent nodes. + +**License boundary:** the Penpot repository's package metadata identifies MPL-2.0. MPL obligations apply at the covered-file level. Do not copy files or modules without reviewing exact notices, modifications, dependency licenses, redistribution requirements, and how the material will coexist with FireCraft's Apache-2.0 source distribution. + +Reference: +- [Penpot repository](https://github.com/penpot/penpot) + +### 10.4 SVG-Edit + +**Study:** browser-native SVG selection, path editing, transform handles, shape creation, style controls, and serialization behavior. + +**FireCraft opportunities:** use it as a possible code/algorithm candidate for narrow self-contained SVG routines only if they solve a proven gap and fit the Rust engine. Its JavaScript browser editor is not a replacement for FireCraft's shared native/WASM command engine. + +**License boundary:** the SVG-Edit repository identifies MIT. Reuse still requires checking the exact commit, file-level copyright/headers, bundled dependencies, test data, and required notices. Record the reused material in docs/ATTRIBUTION.md. + +References: +- [SVG-Edit repository](https://github.com/SVG-Edit/svgedit/) +- [SVG-Edit MIT license file](https://github.com/SVG-Edit/svgedit/blob/master/LICENSE-MIT.txt) + +### 10.5 Proprietary design and image editors + +Use Photoshop, Affinity Photo/Designer, Figma, Canva, and similar products for workflow comparisons only unless a clearly licensed public SDK or API is intentionally integrated. Do not copy source, artwork, brand assets, product copy, proprietary UI assets, or protected implementation details. Treat API access, file compatibility, and permission to reuse code as separate questions. + +### 10.6 Reuse decision table + +| Source type | Default decision | +|---|---| +| MIT/BSD/ISC/Apache-2.0 individual library | Candidate after exact license, dependency, security, wasm, MSRV, performance, and attribution checks. | +| MPL-2.0 file/module | Requires file-level obligations and explicit license review before use. | +| GPL/AGPL application code | Do not incorporate into the Apache-2.0 application by default; require owner-approved licensing strategy and legal review. | +| Proprietary product or service | Feature/workflow reference only; no source/assets/copy/automation/scraping/decompilation. | +| Public API or SDK | Evaluate terms, data flow, persistence, cost, availability, and privacy separately; API access is not source-code permission. | +| Generated model output or sample resources | Verify ownership, provenance, usage rights, and whether the asset can legally ship with FireCraft. | + +**Source references checked:** 2026-11-24. License claims are triage guidance only. The exact source revision and file-level notices must be reviewed at the time of reuse; this document is not legal advice. From 2c1194604197fc1a2842ffc817ec99c3a78113fd Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:46 -0600 Subject: [PATCH 4/9] docs(plan): mark earlier post-MVP execution sequence superseded --- docs/POST-MVP-EXECUTION-PLAN.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/POST-MVP-EXECUTION-PLAN.md b/docs/POST-MVP-EXECUTION-PLAN.md index 4737e63e..64b9a025 100644 --- a/docs/POST-MVP-EXECUTION-PLAN.md +++ b/docs/POST-MVP-EXECUTION-PLAN.md @@ -1,3 +1,11 @@ +> [!WARNING] +> **SUPERSEDED — DO NOT EXECUTE THIS GATE 0 SEQUENCE.** +> This file was written against the pre-merge 2026-11-23 state and includes stale instructions such as merging PR #182 and integrating older PR/base SHAs. PR #182 merged into main on 2026-11-24. +> The current authoritative integration/refactor sequence is [REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md), with direct agent instructions in [REPOSITORY-CONSOLIDATION-HANDOFF.md](REPOSITORY-CONSOLIDATION-HANDOFF.md). +> Keep the content below only as a historical proposal; refresh any useful evidence before reuse. TASKS.md remains the live task ledger. + +--- + # FireCraft — Post-MVP Execution Plan > **Document type:** execution plan derived from From 91bea1dbf5d420939fb36214fffa96d56c13853d Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:49 -0600 Subject: [PATCH 5/9] docs(handoff): link current consolidation and modernization sequence --- docs/POST-MVP-AGENT-HANDOFF.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/POST-MVP-AGENT-HANDOFF.md b/docs/POST-MVP-AGENT-HANDOFF.md index a4c01788..cd6588cb 100644 --- a/docs/POST-MVP-AGENT-HANDOFF.md +++ b/docs/POST-MVP-AGENT-HANDOFF.md @@ -4,6 +4,10 @@ > **Read first:** [AGENTS.md](../AGENTS.md), [TASKS.md](TASKS.md), [NEXT.md](NEXT.md), [HANDOFF.md](HANDOFF.md), [PROGRESS.md](PROGRESS.md), [CS6-PARITY.md](CS6-PARITY.md), [FEATURES.md](FEATURES.md), and [POST-MVP-ROADMAP.md](POST-MVP-ROADMAP.md), [MARKETING-SITE-ROADMAP.md](MARKETING-SITE-ROADMAP.md), and [research/creative-app-benchmark.md](research/creative-app-benchmark.md). > **This is not authorization to start implementation immediately.** The first deliverable is a verified baseline and a deduplicated task plan. +> **Current integration order:** begin with [Repository Consolidation Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md) and its [master plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md). These documents supersede the older Gate 0 merge sequence in [POST-MVP-EXECUTION-PLAN.md](POST-MVP-EXECUTION-PLAN.md), which predates the merge of PR #182. Do not merge #182 again. +> +> The consolidation handoff covers the active PRs/branches, local work preservation, repository cleanup, module refactoring, feature transfer/licensing, workflow polish, the marketing-site branch, and release verification. The post-MVP audit/ticket conversion in this document remains relevant after the integration baseline is established. + --- ## 1. Mission From 17ea22d7f18235a980b5af8b19c9c4fcd017d743 Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:52 -0600 Subject: [PATCH 6/9] docs(index): add repository consolidation plan and handoff --- docs/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index ed4ee188..711d281a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,10 +24,12 @@ This page is the documentation map. Start with the overview that matches your go ### I want to understand the post-MVP product direction 1. [Post-MVP Product and Engineering Roadmap](POST-MVP-ROADMAP.md): detailed product vision, feature specifications, dependencies, priorities, architecture constraints, and acceptance criteria. -2. [Post-MVP Agent Handoff](POST-MVP-AGENT-HANDOFF.md): mandatory repository audit, local-work reconciliation, task conversion, and execution rules for the next implementation agent. +2. [Repository Consolidation Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md): direct phased instructions for branch/PR consolidation, local-work preservation, cleanup, refactoring, feature transfer, and release gates. +3. [Repository Consolidation and Modernization Plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md): master execution sequence spanning integration, code health, competitive feature adoption, marketing site, reliability, and release readiness. +4. [Post-MVP Agent Handoff](POST-MVP-AGENT-HANDOFF.md): post-integration baseline audit, task conversion, and execution rules for the next implementation agent. 3. [Marketing Site Roadmap](MARKETING-SITE-ROADMAP.md): site content, responsive UX, release downloads, privacy, SEO, accessibility, Cloudflare Pages deployment, and launch acceptance gates. 4. [Post-MVP Baseline Audit](POST-MVP-BASELINE-AUDIT.md): source-backed status of every roadmap workstream, including SITE-01, and the reconciliation of local work that is not yet merged. -5. [Post-MVP Execution Plan](POST-MVP-EXECUTION-PLAN.md): the merge-safe Gate 0 sequence, the Wave 1 and Track M ticket rosters, verification plan, and next-agent handoff. +5. [Post-MVP Execution Plan](POST-MVP-EXECUTION-PLAN.md): historical proposal, superseded by the repository consolidation plan. ### I want to research product direction @@ -49,7 +51,7 @@ This page is the documentation map. Start with the overview that matches your go | Current state | [PROGRESS](PROGRESS.md), [TASKS](TASKS.md), [NEXT](NEXT.md), [CS6-PARITY](CS6-PARITY.md) | What is true now and what comes next | | Engineering | [HANDOFF](HANDOFF.md), [PLANNING](PLANNING.md), [TOOLCHAINS](TOOLCHAINS.md), [RELEASING](RELEASING.md) | Building, architecture, and release work | | Evidence | [decisions](decisions/), [research](research/), [generated parity and scorecard](planning/generated/) | Specific technical claims and their basis | -| Product direction | [Post-MVP roadmap](POST-MVP-ROADMAP.md), [baseline audit](POST-MVP-BASELINE-AUDIT.md), [execution plan](POST-MVP-EXECUTION-PLAN.md), [agent handoff](POST-MVP-AGENT-HANDOFF.md), [marketing site roadmap](MARKETING-SITE-ROADMAP.md) | Strategic scope, verified per-workstream status, public website plan, and the gated ticket sequence; not live task status | +| Product direction | [Post-MVP roadmap](POST-MVP-ROADMAP.md), [baseline audit](POST-MVP-BASELINE-AUDIT.md), [repository consolidation plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md), [consolidation handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md), [agent handoff](POST-MVP-AGENT-HANDOFF.md), [marketing site roadmap](MARKETING-SITE-ROADMAP.md) | Product direction, dated baseline, current integration/refactor sequence, post-integration task conversion, and website scope; not live task status | | Research | [creative app benchmark](research/creative-app-benchmark.md) | Feature-transfer research and licensing constraints for external creative-app references | | History | [SESSIONS](SESSIONS.md), [HISTORY](HISTORY.md), [closed milestones](planning/firecraft/), [release notes](releases/) | How the project arrived here; not live task status | From 3c8ee0d7277377d68765df34c1e5fed2f683e336 Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:18:55 -0600 Subject: [PATCH 7/9] docs(readme): add consolidation plan and agent handoff --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cdf1179..3399b4e5 100644 --- a/README.md +++ b/README.md @@ -156,8 +156,10 @@ The GUI and automation interfaces are intended to drive the same engine commands | [Gaps](docs/GAPS.md) | Historical audit of what was missing (2026-10-21); current work is on the [task board](docs/TASKS.md) | | [Doc index](docs/README.md) | The full documentation map | | [Releasing](docs/RELEASING.md) | Artifact build and deployment procedures | +| [Repository consolidation plan](docs/REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md) | Phased branch/PR cleanup, refactoring, feature transfer, UX polish, reliability, and release plan | +| [Repository consolidation handoff](docs/REPOSITORY-CONSOLIDATION-HANDOFF.md) | Direct execution instructions and first-run checklist for the integration agent | | [Marketing site roadmap](docs/MARKETING-SITE-ROADMAP.md) | Public website scope, Cloudflare Pages deployment, and launch gates | -| [Creative-app benchmark](docs/research/creative-app-benchmark.md) | Product patterns from Krita, Photopea, and Pixlr, with licensing boundaries | +| [Creative-app benchmark](docs/research/creative-app-benchmark.md) | Product patterns and code-reuse boundaries for Krita, GIMP, Inkscape, Photopea, Pixlr, Penpot, and SVG-Edit | | [Progress](docs/PROGRESS.md) | Session-level status and historical progress | | [Planning](docs/PLANNING.md) | Product plan, file-format notes, and architecture | | [Handoff](docs/HANDOFF.md) | Engineering handoff and agent runbook | From 4c60f0762154016a7f6569c176ff64dfcd3ddbcd Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:19:39 -0600 Subject: [PATCH 8/9] docs(index): fix post-MVP navigation ordering and benchmark scope --- docs/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 711d281a..863f17bc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -27,13 +27,13 @@ This page is the documentation map. Start with the overview that matches your go 2. [Repository Consolidation Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md): direct phased instructions for branch/PR consolidation, local-work preservation, cleanup, refactoring, feature transfer, and release gates. 3. [Repository Consolidation and Modernization Plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md): master execution sequence spanning integration, code health, competitive feature adoption, marketing site, reliability, and release readiness. 4. [Post-MVP Agent Handoff](POST-MVP-AGENT-HANDOFF.md): post-integration baseline audit, task conversion, and execution rules for the next implementation agent. -3. [Marketing Site Roadmap](MARKETING-SITE-ROADMAP.md): site content, responsive UX, release downloads, privacy, SEO, accessibility, Cloudflare Pages deployment, and launch acceptance gates. -4. [Post-MVP Baseline Audit](POST-MVP-BASELINE-AUDIT.md): source-backed status of every roadmap workstream, including SITE-01, and the reconciliation of local work that is not yet merged. -5. [Post-MVP Execution Plan](POST-MVP-EXECUTION-PLAN.md): historical proposal, superseded by the repository consolidation plan. +5. [Marketing Site Roadmap](MARKETING-SITE-ROADMAP.md): site content, responsive UX, release downloads, privacy, SEO, accessibility, Cloudflare Pages deployment, and launch acceptance gates. +6. [Post-MVP Baseline Audit](POST-MVP-BASELINE-AUDIT.md): dated source-backed status of every roadmap workstream, including SITE-01. Refresh it after integration. +7. [Post-MVP Execution Plan](POST-MVP-EXECUTION-PLAN.md): historical proposal, superseded by the repository consolidation plan. ### I want to research product direction -1. [Creative-app benchmark](research/creative-app-benchmark.md): transferable ideas from Krita, Photopea, and Pixlr, plus licensing and clean-room limits. +1. [Creative-app benchmark](research/creative-app-benchmark.md): transferable ideas and code-reuse boundaries for Krita, GIMP, Inkscape, Photopea, Pixlr, Penpot, and SVG-Edit. ### I want to contribute or use an AI agent From f220e064cbb26e23d88faf4830d36c109989c031 Mon Sep 17 00:00:00 2001 From: AliasFox Date: Tue, 24 Nov 2026 12:19:42 -0600 Subject: [PATCH 9/9] docs(handoff): prioritize consolidation instructions in post-MVP handoff --- docs/POST-MVP-AGENT-HANDOFF.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/POST-MVP-AGENT-HANDOFF.md b/docs/POST-MVP-AGENT-HANDOFF.md index cd6588cb..9b4a642b 100644 --- a/docs/POST-MVP-AGENT-HANDOFF.md +++ b/docs/POST-MVP-AGENT-HANDOFF.md @@ -1,7 +1,7 @@ # FireCraft — Post-MVP Agent Handoff and Execution Contract > **Purpose:** instructions for the AI/coding agent that begins post-MVP planning after the current FireCraft development work is complete. -> **Read first:** [AGENTS.md](../AGENTS.md), [TASKS.md](TASKS.md), [NEXT.md](NEXT.md), [HANDOFF.md](HANDOFF.md), [PROGRESS.md](PROGRESS.md), [CS6-PARITY.md](CS6-PARITY.md), [FEATURES.md](FEATURES.md), and [POST-MVP-ROADMAP.md](POST-MVP-ROADMAP.md), [MARKETING-SITE-ROADMAP.md](MARKETING-SITE-ROADMAP.md), and [research/creative-app-benchmark.md](research/creative-app-benchmark.md). +> **Read first:** [AGENTS.md](../AGENTS.md), [Repository Consolidation Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md), [Repository Consolidation Plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md), [TASKS.md](TASKS.md), [NEXT.md](NEXT.md), [HANDOFF.md](HANDOFF.md), [PROGRESS.md](PROGRESS.md), [CS6-PARITY.md](CS6-PARITY.md), [FEATURES.md](FEATURES.md), [POST-MVP-ROADMAP.md](POST-MVP-ROADMAP.md), [MARKETING-SITE-ROADMAP.md](MARKETING-SITE-ROADMAP.md), and [research/creative-app-benchmark.md](research/creative-app-benchmark.md). > **This is not authorization to start implementation immediately.** The first deliverable is a verified baseline and a deduplicated task plan. > **Current integration order:** begin with [Repository Consolidation Handoff](REPOSITORY-CONSOLIDATION-HANDOFF.md) and its [master plan](REPOSITORY-CONSOLIDATION-AND-MODERNIZATION-PLAN.md). These documents supersede the older Gate 0 merge sequence in [POST-MVP-EXECUTION-PLAN.md](POST-MVP-EXECUTION-PLAN.md), which predates the merge of PR #182. Do not merge #182 again.