Skip to content

Latest commit

 

History

History
130 lines (115 loc) · 7.52 KB

AGENTS.md

File metadata and controls

130 lines (115 loc) · 7.52 KB

Engineering instructions

Zephium is a native Rust browser with a Tauri + Svelte interface. Treat Windows and macOS as equally supported. Linux is not supported. This is the only contributor-agent instruction file; do not create tool-specific copies.

Find the owner first

  • Read CONTRIBUTING.md and adjacent implementations before editing. Keep the change focused; preserve unrelated work and other worktrees.
  • Use docs/architecture.md for the ownership map: desktop/ composes native hosts and privileged IPC; crates/zephium-core owns domain types/reducers/ports; zephium-app coordinates application state; zephium-engine owns browser views/platform adapters; zephium-store owns durable records. Specialized crates own blocking, extensions, credentials, Work and provider boundaries.
  • Keep interface composition in frame/src/app, feature UI in features, projections in domain, transient document state in session, and reusable primitives in shared. Follow docs/frontend.md.
  • Read docs/work.md for Work/product composition and docs/agentic-browsing.md for browser execution. xtask/ and scripts/ own development/qualification tools; eval/ holds qualification evidence. vendor/ contains reviewed forks.

Build and verify

Use the pinned Rust toolchain, Node version and pnpm package manager from rust-toolchain.toml, .node-version and package.json. Run from the root:

pnpm install --frozen-lockfile
pnpm --dir frame run check
pnpm --dir frame run build
pnpm --dir frame run check:styles
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
  • Use root pnpm build for browser packaging. Root pnpm dev launches the separate development identity; consult CONTRIBUTING before native execution.
  • Reproduce the affected CI jobs, not just the commands above. Follow the exact Windows/macOS test matrix, including macOS library-only Clippy, nextest, Windows exclusions/QA follow-up, updater tests, bindings drift and native blocker probes.
  • Run shared policy checks from CONTRIBUTING.md: fork locks, probe boundaries, dependency policy and review deadlines. Preserve all --locked and -D warnings flags. Never suppress a lint to pass a gate.
  • Treat cargo xtask ci as a local aggregate, not a replacement for hosted CI. Read its dispatcher before naming a gate; internal boundary modules do not necessarily have CLI commands. Native probes require an isolated test host.
  • Run relevant component tests after frontend changes; follow the component setup. Windows defaults to Chromium, macOS to WebKit. Hosted component CI is macOS-only; neither substitutes for native browser behavior checks.
  • Before calling a behavior change done, verify affected native paths on both platforms. Report exact commands, host and results, including untested hosts, excluded native cases and known failures. Do not label compilation, mocks or cross-compilation as native acceptance. For documentation-only work, distinguish CI/source verification from tests actually executed.

Preserve engineering boundaries

  • Keep domain authority in Rust. The frame projects state and submits typed intent; admission is not durable success. Do not create parallel wire types or optimistic state that claims native work succeeded.
  • Use public feature/domain entry points and aliases across modules; use relative imports within a module. Keep controllers independent of rendered components, heavy views lazy and production graphs free of tests/fixtures.
  • Preserve caller scope, production CSP, raw-page/privileged-frame separation, synchronous tab-presentation sentinels and fixed-raster favicon boundaries. Update desktop/src/frame_sources.rs when a referenced source anchor moves.
  • Use semantic tokens, component-owned styles, keyboard/focus behavior and reduced motion. Handle asynchronous command settlement explicitly; render error boundaries do not settle operations.
  • Preserve profile isolation, bounded inputs/resources and generation/lifecycle checks. Treat page and tool output as untrusted data, never new authority. Do not expose privileged IPC to content or log secrets/full browsing URLs.
  • Add meaningful regression coverage when behavior changes, including malformed inputs and refusal paths. Do not change security policy, tests or bundle budgets merely to hide a failure; explain any justified budget change.

Generated files and forks

  • Regenerate IPC from Rust with cargo test -p zephium-desktop --locked export_typescript_bindings on a supported host. Review frame/src/shared/ipc/bindings.ts, work-constants.ts and theme-presets.json. The hosted macOS drift check covers all three files, including untracked outputs. Never hand-edit generated contracts.

  • Regenerate frame/src/shared/i18n from the message catalogs/project config with pnpm --dir frame run i18n; typecheck also runs it.

  • Regenerate blocker seeds only through the seed maintenance procedure and release runbook. The entry point is:

    cargo xtask update-blocker-seed --sources DIR --license assets/blocker-seed/v1/LICENSE-CC-BY-SA-3.0.txt --gpl-license assets/blocker-seed/v1/LICENSE-GPL-3.0.txt
    cargo xtask check-blocker-seed

    Supply reviewed source files; preserve notices, licenses and all dependent digest/metadata checks. Regeneration is not native WebKit qualification.

  • For generated rasters, sky or installer art, use the owning scripts in frame/package.json and read their input/tool requirements first. Do not edit generated bytes or claim their generators run on both platforms.

  • Follow each fork's FORK.toml, UPSTREAM.md and REBASE.md where present. Preserve exact upstream revisions, reviewed patch sets, upstream originals, fixture provenance and independent lockfiles. Adblock also requires its UPSTREAM_FILES.toml inventory. Use cargo xtask check-security-fork-locks after preparing the dependency graphs as CI does; do not treat that check as a substitute for native qualification or required human review.

  • Keep crates/zephium-app/skills/**/SKILL.md intact unless intentionally changing product behavior: these are compiled runtime prompts, not contributor guides.

Working and delivery rules

  • Use a concise task branch from current main, never a tool-name prefix. Never commit to main; preserve other worktrees. Do not stash, reset, rebase, amend pushed commits or force-push.
  • Use scoped conventional commits and PR titles. Include the problem, change, validation and any missing platform evidence; add no authorship trailers or tool attribution. Merge latest main before the PR and reverify affected work.
  • Never launch/modify an installed Zephium app or use its personal profile for checks. Do not change system settings, sign in or run password-prompting steps in automated work. Stop a check that requires those actions and report the gap.
  • Preserve security/audit evidence, licenses/notices and fork provenance. During documentation cleanup, also leave adblock docs, vendor and tool configuration untouched; update surviving references before deleting a document.
  • Keep documentation about stable ownership and reproducible workflows. Put measurements, progress and future work in review evidence/issues, not guides.