Contributing¶
Firefly Weave is an alpha Python project built on PyFly, with an Angular Studio
in studio/ and a Tauri desktop shell in desktop/. Read the
documentation index, architecture, and
source documentation and attribution policy
before changing public contracts or runtime behavior.
Use Python 3.12+ and the locked dependencies. The Makefile is the source of truth for current checks. From the repository root:
# Install locked tooling and rebuild Weave from this checkout.
uv sync --locked --no-editable --reinstall-package firefly-weave --all-extras --group dev --group docs
# Run the complete local gate against the current installed package.
make check
The check targets reinstall Weave so a cached wheel cannot hide source edits,
and they keep dependencies locked. make check runs, in order: strict source
inventory and header checks, documentation link and SVG checks, a strict MkDocs
site build, Ruff lint and format checks, strict mypy, unit and contract tests,
and release package preparation with installed-artifact verification.
Expected: the last line is All requested checks passed. A failing stage stops
the run, which then prints Stage <name> failed., the node id of each failing
test from pytest's short summary (never its output), and
Checks failed; inspect private evidence.; each stage's log and a checks.json
summary are in a new build/checks-… directory.
For a focused change, first run
its relevant suite; the integrated delivery must still pass the full gate. Do not
update lock or upstream framework provenance casually to resolve an unrelated
failure.
Studio and desktop changes need their own checks. Python-only contributors do
not need Node.js. Use Node 24 LTS; CI pins 24.15.0. Check node --version
before installing dependencies so local builds and browser tests use the same
major version as CI. If you change studio/, run the same steps as the Studio CI
job. Many unit and browser tests run Weave's Python code, including the real
Studio host, from the repository's .venv, so run the uv sync command above
first.
# Install the locked Studio dependencies.
cd studio && npm ci
# Type-check, check formatting, run unit tests, and build the production bundle.
npm run check && npm run format:check && npm test && npm run build
# Install the Chromium build Playwright uses, then run the browser tests.
# On Linux, add --with-deps to also install the system libraries Chromium needs.
npx playwright install chromium && npm run test:browser
CI runs functional browser tests first, then measures canvas performance with one worker and no retries. This keeps another test's browser from consuming the measured frame budget. To reproduce that sequence locally:
# Run from studio/. Exclude only the two tagged timing measurements.
npm run test:browser -- --grep-invert @performance
# Keep the same timing limits, and preserve the functional test output.
npm run test:browser -- --grep @performance --workers=1 --retries=0 --output=test-results/performance
Avoid other browser or build workloads while measuring. A shared machine can
still introduce timing noise; inspect a failure before drawing a performance
conclusion. For an individual functional suite, the existing command still
accepts its path: npm run test:browser -- tests/browser/designer-forms.spec.ts.
Expected: each command exits without errors. make studio-check runs npm ci,
the type check, unit tests, and browser tests in one step; it skips the format
check and the production build, and it does not install Chromium. For the
desktop shell, follow build from source.
A first documentation change¶
How to read this diagram: Follow the four numbered steps from top to bottom for every documentation change. A green link check is only step 3; whether the commands work and the page reads clearly needs steps 1 and 4.
Choose the guide for the user's task and read its linked source/example before editing. Explain the prerequisite IDs, ordered steps, expected result, and where to inspect a failure. Keep lookup tables in reference pages and link to a runnable guide rather than repeat its entire deployment procedure.
Follow the writing conventions in build and maintain the documentation website, which also shows how to preview the site. From the repository root, run:
# Check links, heading anchors, reachable pages, and diagram structure.
python3 scripts/check_docs.py
# Check license headers and the source inventory.
python3 scripts/source_coverage.py --strict
# Build the website; any warning fails the build.
make docs
Expected: the first command prints a JSON report with an empty errors list, the
second ends with 0 issues, and the build ends with Documentation built in ….
A successful check does not execute a documented command. Run new offline examples
with the matching project environment and inspect rendered Markdown separately.
Provider setup examples must distinguish locally checked contracts from live
account or delivery verification. Preserve historical changelog facts and existing
Apache/Foundation headers.
Backend and end-to-end checks¶
make check-integration and make check-e2e require explicitly configured owned
PostgreSQL, identity, broker and/or container resources appropriate to their tests.
For example, the integration suite fails at once unless WEAVE_TEST_DATABASE_URL
points to a test database you own. make check-release includes all gates, runs
only on an owned release environment with its Docker context and secrets set,
and must fail when a required dependency is absent. Inspect fixture
prerequisites and use distinct resources/evidence paths; do not run against
production or reset retained services to make tests pass.
Run the PostgreSQL integration suite¶
The integration fixtures give every test its own database on the server named by
WEAVE_TEST_DATABASE_URL:
- A test that needs the current schema clones a template database,
weave_b1_template_<hash>. The first test of a run finds that template, or builds it by running the migrations when it is missing. Its name is a hash of the migration files, the code that runs them and the Alembic version, so changing a migration builds a new template. The template stays on the server between runs and holds no test data. - A build drops other templates only when nobody is connected to them and no run has used them for 6 hours, so checkouts with different migrations can share one server.
- A test about migrations themselves (the
empty_settingsandfresh_migration_settingsfixtures) starts from an empty database and runs the real migrations. - When a test ends, the databases and login roles it created are dropped. Set
WEAVE_TEST_KEEP_DATABASES=1to keep them for inspection. SettingWEAVE_TEST_RESOURCE_MANIFESTto a file path records each one in that file and keeps them too.
Run the suite on four parallel workers (pytest-xdist). Workers share the template, which an advisory lock lets only one of them build:
--dist loadfile keeps each test file on one worker, so a file's module fixture
(the Kafka broker, for example) starts once. Without -n the suite runs serially.
Turning off durability on the test server is optional: with cloned and dropped
databases it made no measurable difference. If you try it, pass
-c fsync=off -c synchronous_commit=off -c full_page_writes=off only to a
throwaway server; an unclean stop can corrupt its data, so never to a server
whose data you keep, such as the Compose development stack.
Local runtime setup explains provisioning. End-to-end fixtures exercise installed wheels, admitted images, identities and external-effect receivers; they are acceptance tooling rather than the introductory compiler quickstart. Do not copy another checkout's private env files or immutable image IDs. Keep failures and corrected reruns distinguishable.
Acceptance journeys¶
Acceptance journeys prove the product against real services: a Docker platform
from weave platform up, its real Keycloak, the Acme API fixture and the real
Studio host. The acceptance guide explains the
stages, the evidence, and how to enable a journey step when the capability it needs lands.
Review and hygiene¶
Preserve canonical wire names, diagnostic codes, revision/idempotency semantics, scoped authority and pure-import boundaries. Add focused regression tests for changed behavior and document public contracts and non-obvious invariants. Every new first-party source file follows the existing Apache/Author/SPDX policy; strict JSON and immutable fixtures use the exact licensing inventory mechanism.
Keep credentials, .env files, .superpowers, .secrets, .local, dependency
directories, local databases, logs and disposable builds/renders out of publication.
Review actual package and public-tree inventories rather than relying only on
ignore rules. Requested editable SVG diagrams are source deliverables. Follow the
visual assets guide; regenerate Firefly artwork, never redraw it.
Report security concerns through the security policy, not an issue containing credentials or exploit details. Contribution does not imply a response SLA, stable API guarantee or production support commitment.