006: Requirements¶
- Type: Product
- Status: Accepted
- Date: 2026-12-02
- Author(s) / Deciders: João V. Farias
- Question: What functional and non-functional requirements MUST the system satisfy, in what priority order, and with what dependencies?
Context¶
This record defines the functional and non-functional requirements baseline for winesmith. Functional requirements are grouped into nine prioritized categories with explicit dependency tracking, mapped in detail across Feature Records.
Category dependency graph¶
The Mermaid diagram below maps how higher-level execution, recipe, task, diagnostics, and shell integration categories depend on foundational configuration, runner, and prefix layers:
flowchart TD
C1["1. Config, Manifest & Lockfile"]
C2["2. Runner Provisioning"]
C3["3. Prefix Lifecycle & Isolation"]
C4["4. Execution, Headless & Paths"]
C5["5. Toolchain Recipes"]
C6["6. Hybrid Task Runner & Guards"]
C7["7. Diagnostics & CLI Ergonomics"]
C8["8. Nushell Completions & Integration"]
C9["9. Licensing, Packaging & Validation"]
C1 --> C2
C1 --> C3
C2 --> C3
C2 --> C4
C3 --> C4
C1 --> C5
C3 --> C5
C4 --> C5
C1 --> C6
C4 --> C6
C5 --> C6
C1 --> C7
C2 --> C7
C3 --> C7
C5 --> C7
C6 --> C7
C1 --> C8
C2 --> C8
C3 --> C8
C5 --> C8
C6 --> C8
C7 --> C8
C7 --> C9
C8 --> C9
Functional requirements¶
Each category lists concrete capabilities using an infinitive verb and direct object.
1. Configuration, manifest, and lockfile management¶
Category 1 has no upstream dependencies. The eight requirements below specify config loading, templating, and lockfile enforcement:
| ID | Requirement | Status |
|---|---|---|
| 1.1 | Parse winesmith.toml project manifest; |
Done |
| 1.2 | Merge layered config sources in precedence order (defaults, user config, project manifest, winesmith.local.toml, WINESMITH_* env, CLI overrides); |
Done |
| 1.3 | Validate manifest schema and emit actionable diagnostics with file location; | Done |
| 1.4 | Resolve default [windows] settings and named [targets.<name>] overrides; |
Done |
| 1.5 | Render MiniJinja template expressions and winpath(...) helpers in variables, paths, and commands; |
Done |
| 1.6 | Generate and update winesmith.lock with exact resolved URLs and SHA-256 digests; |
Done |
| 1.7 | Enforce exact lockfile resolution and checksums under --locked mode; |
Done |
| 1.8 | Verify inline sha256 digests declared in manifests or custom recipes; |
Done |
2. Wine and Proton runner provisioning¶
Category 2 depends on Category 1 and specifies how portable and local runners are located, verified, and stored:
| ID | Requirement | Status |
|---|---|---|
| 2.1 | Resolve default pinned portable Kron4ek Wine 10 stable (staging-amd64-wow64) runner when unspecified; |
Done |
| 2.2 | Download and verify portable runner archives into $XDG_CACHE_HOME/winesmith/downloads; |
Done |
| 2.3 | Extract and index installed portable runners under $XDG_DATA_HOME/winesmith/runners; |
Done |
| 2.4 | Resolve system Wine installations (wine, wine64, wineserver, winecfg) from host PATH; |
Done |
| 2.5 | Discover local Steam Proton and GE-Proton builds from standard Steam directories and libraryfolders.vdf; |
Done |
| 2.6 | Download and extract pinned ge-proton:<tag> runners when configured; |
Done |
| 2.7 | Support explicit local runner paths (proton:/path, wine:/path); |
Done |
| 2.8 | Support traditional multiarch staging-amd64 and amd64 Kron4ek builds when legacy win32 compatibility is requested; |
Done |
3. Windows prefix lifecycle and isolation¶
Category 3 depends on Categories 1 and 2 and defines prefix initialization, locking, mounts, symlinks, and drift handling:
| ID | Requirement | Status |
|---|---|---|
| 3.1 | Compute prefix directory path using hybrid scoping (shared named or spec-hashed prefixes under $XDG_DATA_HOME/winesmith/prefixes, or per-project isolated prefix); |
Done |
| 3.2 | Acquire exclusive advisory file lock before creating or mutating a prefix; | Done |
| 3.3 | Initialize Wine or Proton prefix with configured architecture (win64 or win32); |
Done |
| 3.4 | Apply target Windows version (win7, win10, or win11) via winecfg -v and registry verification; |
Done |
| 3.5 | Suppress Wine Mono, Wine Gecko, and GUI crash dialogs during prefix boot and execution; | Done |
| 3.6 | Persist prefix metadata (runner, windows, arch, installed recipes, completed hooks) in winesmith-state.json; |
Done |
| 3.7 | Detect prefix configuration drift and reconcile idempotently on setup; |
Done |
| 3.8 | Create configured Windows drive letter mounts under dosdevices/; |
Done |
| 3.9 | Create configured host-to-prefix symlinks inside drive_c; |
Done |
| 3.10 | Apply declarative DLL overrides (WINEDLLOVERRIDES) and registry entries; |
Done |
| 3.11 | Remove managed prefix directories cleanly on env rm or env prune; |
Done |
4. Command execution, headless control, and path translation¶
Category 4 depends on Categories 2 and 3 and defines isolated .cmd execution, display adapters, and path conversion:
| ID | Requirement | Status |
|---|---|---|
| 4.1 | Generate unique per-invocation .cmd wrapper scripts inside C:\winesmith\tmp\ and remove them on exit; |
Done |
| 4.2 | Inject merged Windows PATH and environment variables into every Wine invocation; |
Done |
| 4.3 | Enforce headless execution by default (display = "none"); |
Done |
| 4.4 | Wrap execution with xvfb-run -a when display = "xvfb" is requested; |
Done |
| 4.5 | Forward host DISPLAY and WAYLAND_DISPLAY when display = "host" or --gui is requested; |
Done |
| 4.6 | Translate Linux paths to Wine Z:\ or configured drive-letter paths via winpath(...); |
Done |
| 4.7 | Translate existing local path arguments in exec safely without altering Windows /flag switches; |
Done |
| 4.8 | Propagate stdin, stdout, stderr, POSIX signals, and exact Windows process exit codes; | Done |
| 4.9 | Maintain optional persistent wineserver (wineserver -p) to eliminate cold-start latency across multi-step builds; |
Done |
| 4.10 | Launch interactive Wine shell (cmd.exe with loaded environment) via winesmith shell; |
Done |
5. Toolchain recipes and dependency provisioning¶
Category 5 depends on Categories 1, 3, and 4 and defines built-in SDK installers, custom packages, and download caching:
| ID | Requirement | Status |
|---|---|---|
| 5.1 | Execute generic custom recipe primitives (download, verify SHA-256, extract .zip/.tar.xz/.tar.gz/.7z, run unattended .msi/.exe, register PATH/env, apply DLL overrides/registry, run Wine or host post_install hooks); |
Done |
| 5.2 | Provision built-in .NET SDK recipe (win-x64/win-x86, DOTNET_ROOT, shared host NUGET_PACKAGES, global dotnet tool installs, dotnet new templates); |
Done |
| 5.3 | Provision built-in Python for Windows recipe (portable NuGet Windows Python, pip bootstrap, shared PIP_CACHE_DIR, declarative packages list); |
Done |
| 5.4 | Provision built-in Inno Setup recipe (unattended installation into C:\tools\inno and ISCC.exe PATH registration); |
Done |
| 5.5 | Provision built-in NSIS recipe (portable zip extraction into C:\tools\nsis and makensis.exe PATH registration); |
Done |
| 5.6 | Execute optional winetricks verbs when declared in a manifest or recipe; |
Done |
| 5.7 | Warn on known Windows-version incompatibilities (for example, .NET 7+, Python 3.9+, or Inno Setup 7+ targeting win7); |
Done |
| 5.8 | Cache all downloaded SDK installers and archives in $XDG_CACHE_HOME/winesmith/downloads; |
Done |
6. Hybrid task runner and process guards¶
Category 6 depends on Categories 1, 4, and 5 and covers task graphs, host process checks, and matrix runs:
| ID | Requirement | Status |
|---|---|---|
| 6.1 | Execute single-step and multi-step [tasks.<name>] mixing Wine steps and Linux host steps; |
Done |
| 6.2 | Resolve and run task dependency DAGs (depends) with cycle detection; |
Done |
| 6.3 | Override task variables from CLI arguments (winesmith run build config=Release); |
Done |
| 6.4 | Evaluate forbid_running host process regex guards before starting guarded tasks; |
Done |
| 6.5 | Execute tasks across a single target (--target <name>) or full matrix (--all-targets); |
Done |
| 6.6 | Execute zero-config ad-hoc Wine commands (winesmith exec --win win7 --toolchain python@3.8.10 -- ...); |
Done |
7. Diagnostics, scaffolding, and CLI ergonomics¶
Category 7 depends on Categories 1, 2, 3, 5, and 6 and covers inspection, starter templates, and JSON output:
| ID | Requirement | Status |
|---|---|---|
| 7.1 | Audit host tools, runners, prefix integrity, Windows registry version, mounts, symlinks, and toolchains via winesmith doctor; |
Done |
| 7.2 | Support --json structured output across all query subcommands (env list, env inspect, runner list, runner detect, tasks, config, doctor); |
Done |
| 7.3 | Scaffold starter winesmith.toml templates (dotnet, python, packaging, minimal) via winesmith init; |
Done |
| 7.4 | List, inspect, and prune managed prefixes and downloaded runners via winesmith env and winesmith runner; |
Done |
| 7.5 | Print effective merged configuration and resolved paths via winesmith config; |
Done |
| 7.6 | Control diagnostic verbosity via --verbose, --quiet, and WINEDEBUG passthrough; |
Done |
8. Nushell completions and structured integration¶
Category 8 depends on Categories 1, 2, 3, 5, 6, and 7 and covers shell signatures, wrappers, and tab candidates:
| ID | Requirement | Status |
|---|---|---|
| 8.1 | Generate complete Nushell integration script via winesmith completions nu; |
Done |
| 8.2 | Emit extern --strict signatures with flag descriptions, long flags only, and enum completions for all fixed-flag subcommands; |
Done |
| 8.3 | Annotate query subcommands (env list, env inspect, runner list, runner detect, tasks, config, doctor) with @structured [--json] { from json }; |
Done |
| 8.4 | Emit def --wrapped wrappers for winesmith exec and winesmith run to forward arbitrary Windows flags, -- operands, and key=value overrides; |
Done |
| 8.5 | Expose hidden fast winesmith __complete <kind> subcommand returning JSON {value, description} candidate lists; |
Done |
| 8.6 | Bind dynamic Nushell custom completers for project tasks, task variables, targets, managed prefixes, installed runners, and built-in toolchains; | Done |
| 8.7 | Install generated script into Nushell user autoload directory (~/.config/nushell/autoload/winesmith.nu) via winesmith completions install nu; |
Done |
| 8.8 | Validate generated Nushell script syntax and completer parsing against nu in automated tests; |
Done |
9. Licensing, packaging, and end-to-end validation¶
Category 9 depends on Categories 1 through 8 and covers legal notices, test coverage, real-world validation, and user documentation:
| ID | Requirement | Status |
|---|---|---|
| 9.1 | Author LICENSE (AGPL-3.0-or-later) and COPYING.EXCEPTION (Compilation Output Exception); |
Done |
| 9.2 | Write unit tests covering config layering, path translation, template rendering, lockfile hashing, task DAG resolution, and Nushell script generation; | Done |
| 9.3 | Write integration and E2E tests verifying Wine prefix creation (win7/win10/win11), headless execution, and toolchain recipes; |
Done |
| 9.4 | Validate real-world parity by authoring a winesmith.toml for CoopCourier and running setup, build, and test end-to-end; |
Done |
| 9.5 | Document installation, TOML schema, recipes, Nushell setup, and CI usage in README.md; |
Done |
Non-functional requirements¶
Six system-wide constraints govern portability, integrity, locking, latency, headless execution, and JSON output across all subsystems:
NFR-01requires the compiledwinesmithbinary to run on 64-bit Linux distributions (x86_64-unknown-linux-gnuand staticx86_64-unknown-linux-musl) with no runtime dependency on Nushell, Python, or 32-bit multilib libraries under the default WoW64 runner.NFR-02mandates SHA-256 verification before extraction for every artifact pinned inwinesmith.lockor manifestsha256fields, deleting corrupted temporary downloads and exiting non-zero on mismatch.NFR-03prohibits concurrent corruption on shared prefixes by guarding prefix initialization with advisory file locks and isolating command wrappers via unique per-invocation.cmdfilenames.NFR-04requires hiddenwinesmith __complete <kind>calls to run locally without network requests or Wine launches within a 50 ms target on warm filesystem caches.NFR-05requires defaultdisplay = "none"runs to succeed in SSH sessions and CI containers withoutDISPLAYorWAYLAND_DISPLAY.NFR-06mandates writing valid JSON solely tostdoutand routing diagnostic status messages tostderrwhenever--jsonis enabled.
Implementation roadmap¶
Development proceeded across eight ordered phases matched to category dependencies:
| Phase | Milestone | Dependencies | Status |
|---|---|---|---|
| Phase 1 | Scaffold Rust crate, LICENSE, COPYING.EXCEPTION, CLI skeleton, and layered winesmith.toml / winesmith.lock parser with unit tests |
None | Done |
| Phase 2 | Implement Runner abstraction (kron4ek Wine 10 staging-amd64-wow64 default, SHA-256 download cache, system, proton with libraryfolders.vdf, ge-proton) |
Phase 1 | Done |
| Phase 3 | Implement Prefix lifecycle (win7/win10/win11, win64/win32, file locks, Mono/Gecko/crash suppression, winesmith-state.json, mounts, symlinks) |
Phase 1, Phase 2 | Done |
| Phase 4 | Implement Execution engine (per-invocation .cmd wrappers, headless/xvfb/host display, safe path translation, wineserver persistence, exec, shell) |
Phase 2, Phase 3 | Done |
| Phase 5 | Implement Generic custom recipe engine plus built-in .NET SDK, Python, Inno Setup, and NSIS recipes and OS mismatch warnings |
Phase 1, Phase 3, Phase 4 | Done |
| Phase 6 | Implement Hybrid Task Runner (depends DAG, Wine and Host steps, forbid_running guards, --target / --all-targets matrix, ad-hoc exec) |
Phase 1, Phase 4, Phase 5 | Done |
| Phase 7 | Implement doctor, init, env, runner, config, tasks (--json) and completions nu / completions install nu / __complete verified against nu |
Phase 1 to Phase 6 | Done |
| Phase 8 | Validate end-to-end with live Wine tests, CoopCourier/winesmith.toml (setup, build, test), and finalized README.md |
Phase 1 to Phase 7 | Done |
Legend¶
Three status labels track progress across every functional requirement and implementation phase:
- Pending marks a planned requirement or phase whose work has not started yet.
- In Development marks a requirement or phase under active implementation or testing.
- Done marks a finished requirement or phase verified against automated checks.
Alternatives¶
Tracking requirements in ad-hoc issue tickets omits dependency edges, mixes mandatory invariants with optional features, and weakens traceability across milestones.
Decision¶
Adopt the nine prioritized functional requirement categories, six non-functional constraints, and eight-phase roadmap above as the authoritative v1 specification for winesmith. Maintainers update the Status column across each table as work finishes.
Consequences¶
Positives¶
Every source module, integration test, and Feature Record maps directly to a numbered requirement ID (1.1 through 9.5) and non-functional rule (NFR-01 through NFR-06). Explicit dependencies prevent building task orchestration or shell completion features before config, runner, and prefix layers stabilize.
Negatives¶
Maintainers must update status flags across tables whenever milestones advance or requirements change.