Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

02 — Requirements

Every requirement has a stable ID so that work packages, tests and reviews can trace back to it. Priorities use MoSCoW (Must, Should, Could). “Phase” is the roadmap phase in which the requirement is first met (see 04-roadmap.md); later phases may deepen it. Verification names how we prove it.

Phases: P0 Foundations · P1 Faithful Viewer · P2 Writer · P3 Together · P4 Press · P5 Insight · P6 1.0 Parity+.

FID — Fidelity and compatibility

IDRequirementPriPhaseVerification
FID-01Import .docx, .dotx, .docm, .dotm natively in Rust: ECMA-376 Transitional and Strict, plus Microsoft extensions documented in [MS-DOCX].MP1Corpus import with zero crashes; coverage matrix
FID-02Tier A determinism: identical layout and reference-raster output on all supported platforms for a given version.MP0 proven, P1 enforcedDeterminism CI matrix
FID-03Tier B lossless round-trip: untouched content survives open/save unchanged; untouched parts byte-identical.MP1Round-trip suite, fuzzing, Word re-open check in lab
FID-04Tier C measured fidelity with scores published per release; targets per phase.MP1Fidelity Lab report
FID-05Tier D: BayanDocs-authored documents lay out identically in Word (fonts embedded when needed, conservative OOXML).MP2Lab: author in BayanDocs, measure in Word
FID-06Honor Word compatibility modes (compatibilityMode 11/12/14/15) and every compatibility setting that affects layout.MP1→P4Lab studies per mode
FID-07Font resolution per ADR-0010 with a visible font-availability status for each document.MP1Unit + UI tests
FID-08Fidelity Inspector: list features and fonts in the open document that BayanDocs does not reproduce exactly.SP2UI test against tagged corpus
FID-09Never convert a document to a newer compatibility mode without explicit user action.MP2Round-trip tests
FID-10Open and save password-encrypted Word files (MS-OFFCRYPTO Agile Encryption).MP2Interop tests with Word-encrypted samples

FMT — File formats

IDRequirementPriPhaseVerification
FMT-01Read and write .docx family; write edits with minimal changes to the original XML.MP1 read, P2 writeRound-trip + lab
FMT-02Read and write RTF, including as the rich-text clipboard format on Windows and macOS.MP2Clipboard interop tests with Word, LibreOffice, browsers
FMT-03Import legacy .doc (Word 97–2003, MS-DOC). Export is a later “could”.MP4Corpus import
FMT-04Import and export OpenDocument Text (.odt).SP4Round-trip with LibreOffice
FMT-05PDF export: basic (P1); PDF/A-2b/3b/4 and PDF/UA (P2–P4); PDF/X-4 and X-1a (P4).MP1→P4veraPDF and preflight validation in CI
FMT-06HTML import (paste) and export.M paste / S exportP2 / P4Paste interop tests
FMT-07Markdown import and export.SP2 / P4Unit tests
FMT-08Plain text import and export with encoding detection.MP2Unit tests
FMT-09EPUB 3 export.CP5epubcheck
FMT-10Images: render PNG, JPEG, GIF, BMP, TIFF, WebP, SVG, EMF, WMF, EMF+; insert them.MP1 render / P2 insertImage corpus
FMT-11Preserve unknown parts and extensions, VBA projects, custom XML parts and signatures.MP1Round-trip suite
FMT-12Open PDFs for reflow editing.CP6—

ARC — Architecture

IDRequirementPriPhaseVerification
ARC-01All document logic (model, formats, layout, rendering, editing, proofing, sync, crypto) lives in the Rust core.MP0+Architecture review
ARC-02The core builds as native libraries (Windows, macOS, Linux; x86-64 and arm64) and as wasm32.MP0CI matrix
ARC-03Shells are thin; desktop and web feature parity is guaranteed by the shared UI manifest.MP2Parity test listing commands per shell
ARC-04The desktop app works fully offline with no network dependency.MP1Offline CI job
ARC-05The web app works offline after first load (installable PWA) for local files.SP1/P2Playwright offline test
ARC-06The self-hosted server runs as one container with no required external services.MP3docker run smoke test
ARC-07The engine boundary is a versioned message protocol; sessions can be recorded and replayed on any platform.MP0/P1Replay test in CI
ARC-08The core never opens network sockets; hosts provide transport.MP0Dependency/API audit

EDT — Editing features (Word parity)

The detailed, element-level checklist is specs/coverage-matrix.md. This table fixes the phase in which each feature family must be usable.

IDFeature familyPriPhase
EDT-01Character and paragraph formatting (all w:rPr / w:pPr properties), format painter, clear and reveal formatting, change case, drop capsMP2
EDT-02Styles: apply, create, modify with impact preview, style inspector, organizer; themes; no silent auto-redefinitionMP2
EDT-03Lists: bullets, numbering, multilevel, list styles, restart/continue, heading outline numbering (legal documents)MP2
EDT-04Page setup, sections, columns, headers and footers, page numbers, line numbers, page borders, watermarks, page colorMP2
EDT-05Tables: insert, draw, structure editing, merge/split, styles, autofit, sort, formulas, text↔table conversion, header-row repeatMP2
EDT-06Pictures (crop, wrap, position, basic effects), shapes, text boxes, WordArtMP2
EDT-07Hyperlinks, bookmarks, cross-references, captionsMP2
EDT-08Fields: full parsing; evaluation of all common field types; update and lock; field-code viewMP2 (common) → P4 (all)
EDT-09Footnotes and endnotesMP2
EDT-10Track changes (all revision types, accept/reject, display modes, lock tracking) and threaded commentsMP2
EDT-11Find and replace with formatting, special characters and Word-style wildcards; Go To; select similarMP2
EDT-12AutoCorrect, AutoFormat-as-you-type (including Markdown-style shortcuts), building blocks / Quick PartsMP2
EDT-13Clipboard: paste options (keep source, merge, text only), interop with Word, LibreOffice, Google Docs, browsers, email clientsMP2
EDT-14Undo/redo with history, repeat last actionMP2
EDT-15Tables of contents, table of figures, citations and bibliography, indexes, table of authoritiesMP4 (TOC in P2)
EDT-16Equations (OMML) display (P1) and editing (P4)MP1 / P4
EDT-17Charts display (P1) and editing with embedded data (P4); SmartArt display (P1) and editing (P5)MP1 / P4–P5
EDT-18Content controls (all types), legacy form fields, XML data binding, protection for formsMP4
EDT-19Compare and combine documents (legal blackline)MP4
EDT-20Restrict editing, mark as final, document inspector (remove hidden metadata)MP4
EDT-21Digital signatures: preserve (P1), verify (P4), create (P4)MP1 / P4
EDT-22Mail merge (CSV, XLSX, ODS, JSON sources), envelopes and labelsMP4
EDT-23Views: print layout, web layout, draft, outline, read mode, focus; navigation pane with heading drag-reorder; split window; side-by-sideMP2 (outline P4)
EDT-24Templates (.dotx/.dotm), a default “Normal” template, document propertiesMP2
EDT-25Word count, document statistics, language markingMP2

COL — Collaboration and data sovereignty

IDRequirementPriPhaseVerification
COL-01Real-time co-authoring on CRDTs: no locks, guaranteed convergence.MP3Randomized multi-client convergence tests
COL-02Presence: remote cursors, selections, names, colors.MP3E2E tests
COL-03Offline editing with automatic merge on reconnect, never overwriting others’ work.MP3Partition tests
COL-04Zero-knowledge E2EE of content, titles, comments, media, history and folder structure.MP3Protocol review, external audit
COL-05Sharing with roles (owner, editor, commenter, viewer), E2EE link sharing, revocation.MP3Authorization test matrix
COL-06Multiple devices per user with cross-signed device keys and account recovery.MP3Security review
COL-07Version history: named versions, restore, compare any two versions.MP3E2E tests
COL-08Comments and suggestions (tracked changes) in real time.MP3E2E tests
COL-09Enterprise identity: OIDC single sign-on (P3), SCIM provisioning (P4), compliance escrow member (P4).M/SP3–P4Interop with Keycloak, Authentik, Entra ID
COL-10Notifications that leak no document content.SP3Review
COL-11Federation between independently hosted servers.CP6+Research
COL-12Merge two BayanDocs-edited copies of the same .docx exchanged as files, using embedded history.CP5Tests
COL-13Device control: users see all their devices (name, client application, last activity) and can revoke any; a new device must be approved from an existing trusted device; administrators can additionally require their own approval for new devices and restrict which client applications may connect (a policy for well-behaved software, not a security boundary).MP3End-to-end tests, security review
COL-14A public conformance test suite for the sync protocol lets third-party implementations verify that they do not corrupt documents.SP4Suite passes against the reference client

SEC — Security and privacy

IDRequirementPriPhaseVerification
SEC-01All untrusted input is parsed by memory-safe code.MP0+Dependency audit
SEC-02No external content is fetched or executed automatically (linked images, remote templates, INCLUDE fields, DDE, OLE activation, remote fonts); explicit per-document consent.MP1Malicious-sample suite
SEC-03Macros never auto-run; any execution is sandboxed and capability-limited.MP4/P5Sandbox tests
SEC-04No telemetry by default; crash reports opt-in and free of content.MP1Network-traffic test
SEC-05Supply-chain policy (ADR-0017) enforced in CI.MP0CI gates
SEC-06Signed releases, SBOMs and build provenance attestations.MP1Release checklist
SEC-07All parsers fuzzed in CI and continuously.MP1Fuzz dashboards
SEC-08External security audit of E2EE and server before collaboration GA; full audit before 1.0.MP3 / P6Audit reports
SEC-09Published vulnerability disclosure policy with private reporting.MP0SECURITY.md
SEC-10Web hardening: strict CSP, Trusted Types, cross-origin isolation, Subresource Integrity, no third-party runtime origins.MP1Header tests
SEC-11Locally cached collaborative documents encrypted at rest with OS-keychain-protected keys.SP3Review
SEC-12Threat model maintained per component (specs/threat-model.md).MP0+Phase-gate review
SEC-13The server and clients treat every other client as untrusted: all protocol input is authenticated, validated, limited and fuzzed, and authorization never depends on which client software is connecting.MP1 / P3Protocol fuzzing; authorization matrix run with a hostile test client

TYP / PUB — Typography, publishing and print

IDRequirementPriPhaseVerification
TYP-01OpenType shaping for all scripts; kerning, ligatures, true small caps (synthesized fallback as Word does), number forms and spacing, stylistic sets, contextual alternates.MP1 render / P4 UILab + unit tests
TYP-02Word-faithful defaults: features applied exactly when and how Word applies them.MP1Lab
TYP-03Optional enhanced typography for BayanDocs-native documents (optimal line breaking, hanging punctuation, optical margins), stored as ignorable extensions with a Word-compatibility warning.CP5Unit tests
TYP-04Automatic and manual hyphenation per language.MP2Lab
PUB-01PDF export with subset-embedded fonts, links, outline, metadata.MP1veraPDF syntax checks
PUB-02PDF/A archival output (2b, 3b, 4), validated in CI.MP2–P4veraPDF
PUB-03PDF/UA tagged output, validated in CI.MP2–P4veraPDF PDF/UA
PUB-04PDF/X-4 and X-1a with ICC output intents; ICC-based CMYK conversion with rendering intents; rich black, overprint, spot colors.MP4Preflight validation
PUB-05Bleed and slug, trim box, crop and registration marks, stored as Word-ignorable extensions.MP4Unit + visual tests
PUB-06Print preview and printing with exact layout on all desktop platforms; web printing via generated PDF.MP1Print tests
PUB-07Color management of images with embedded ICC profiles.SP4Unit tests

UI — Interface and experience

IDRequirementPriPhase
UI-01Classic mode: ribbon with a Word-familiar structure, Quick Access Toolbar, KeyTips, Word-compatible shortcuts on each platform.MP2
UI-02Ribbon and shortcut customization, with import/export of customizations.SP4
UI-03Focus mode: interface hidden until text is selected, floating selection toolbar, Markdown-style shortcuts, typewriter scrolling, optional reflowed (non-paginated) view.MP2
UI-04Panes: navigation, styles, comments, revisions, find, selection, thesaurus.MP2
UI-05Dialogs defined declaratively in the shared UI manifest and rendered by each shell.MP2
UI-06Light, dark and high-contrast themes; dark document canvas as a display transform that never changes the document.MP2
UI-07Context menus and a mini toolbar.MP2
UI-08Touch and pen on tablets and convertibles.SP4
UI-09A distinct visual identity: familiar structure, no Microsoft trademarks or trade dress.MP2

A11Y — Accessibility

IDRequirementPriPhase
A11Y-01Interfaces conform to WCAG 2.2 AA and EN 301 549; VPAT published.MP2 baseline, P6 certified
A11Y-02Screen readers can read (P1) and edit (P2) documents: NVDA, JAWS, Narrator, VoiceOver, Orca.MP1 / P2
A11Y-03Every feature operable by keyboard alone.MP2
A11Y-04Document accessibility checker (alt text, heading structure, table headers, contrast, reading order).MP4
A11Y-05Tagged PDF/UA export.MP2–P4
A11Y-06High contrast, interface scaling to 200%+, reduced motion.MP2
A11Y-07Read aloud (local text-to-speech) and dictation (local speech-to-text).SP5

I18N — Internationalization

IDRequirementPriPhase
I18N-01Full Unicode with complex-script shaping (Arabic, Hebrew, Indic, Thai, Khmer, …).MP1
I18N-02Bidirectional text; right-to-left paragraphs, sections and tables, exactly as Word lays them out.MP1 / P2
I18N-03Arabic kashida justification as Word applies it.MP2
I18N-04East Asian layout: line-breaking rules (kinsoku), character grid, auto-spacing between Asian and Latin text (P2); ruby, combined characters, two-lines-in-one, vertical text (P4).MP2 / P4
I18N-05Interface localization via Project Fluent; pseudo-locale testing; mirrored right-to-left interface.MP2
I18N-06Locale-aware fields and numbering: dates in Gregorian, Hijri, Hebrew, Japanese era and Thai calendars; ordinal and cardinal number text.MP2 / P4
I18N-07Input methods (CJK, Indic, Vietnamese, …), dead keys and emoji pickers on every platform.MP2

PRF — Proofing and language tools

IDRequirementPriPhase
PRF-01Spell checking with Hunspell-compatible dictionaries, following each run’s language tag.MP2
PRF-02Grammar and style checking: a deterministic rules engine for English first; deeper checks via local AI; other languages via plugins.SP2 / P5
PRF-03Thesaurus from openly licensed data.CP4
PRF-04Custom dictionaries, ignore lists, per-document proofing state.MP2
PRF-05Automatic language detection.SP4

AI — Local intelligence

IDRequirementPriPhase
AI-01AI features run on the user’s device by default. Content leaves the device only if the user or their administrator configures an inference endpoint they control, and the interface says so whenever that is the case.MP5
AI-02Suggestions are non-destructive annotations, never applied without the user’s action.MP5
AI-03Models under OSI-approved licenses, downloaded on demand and integrity-verified.MP5
AI-04Hardware-adaptive (CPU, GPU, NPU where available) with graceful degradation.SP5
AI-05Administrators can disable AI entirely by policy.MP5

AUT — Automation and macros

IDRequirementPriPhase
AUT-01Preserve VBA projects in .docm/.dotm untouched.MP1
AUT-02Read-only viewer for VBA source.SP4
AUT-03Sandboxed JavaScript/TypeScript automation API with capability prompts.MP5
AUT-04Assisted VBA → JavaScript translation (rules plus local AI) with a review interface.SP5
AUT-05Opt-in, sandboxed compatibility runtime for a documented subset of the Word object model.CP6
AUT-06Extensions as sandboxed WebAssembly components that run identically on desktop and web.SP5

PERF — Performance and resources

Reference hardware: a 2020-era mid-range laptop (4-core x86-64 or Apple M1, 8 GB RAM, SSD) and a current evergreen browser on it. “Typical document”: 50 pages of mixed text, tables and images.

IDBudgetPriPhase
PERF-01Desktop cold start to interactive window ≤ 1.0 s; warm start ≤ 0.4 s.MP2
PERF-02Open a typical document: first page visible ≤ 300 ms (desktop) / ≤ 800 ms (web, app already loaded); full layout ≤ 1 s.MP1
PERF-031,000-page document: first page ≤ 1 s; complete background layout ≤ 10 s; editing stays responsive throughout.MP1 / P2
PERF-04Keystroke-to-pixel latency p95 ≤ 16 ms and p99 ≤ 33 ms, for documents up to 1,000 pages.MP2
PERF-05Desktop memory ≤ 150 MB for a typical document, ≤ 500 MB for 1,000 pages (excluding memory-mapped fonts).MP2
PERF-06Web initial download ≤ 5 MB compressed excluding fonts; time to interactive ≤ 2.5 s on broadband.MP1
PERF-07A remote edit appears on collaborators’ screens ≤ 250 ms p95 within one region. A 2 vCPU / 4 GB server instance supports ≥ 1,000 concurrently active documents and ≥ 5,000 connected clients.MP3
PERF-08Budgets are enforced by CI benchmarks; regressions above 5% block merging unless explicitly accepted.MP1

REL — Reliability and data safety

IDRequirementPriPhase
REL-01Auto-recovery journal: at most 2 seconds of work lost on a crash or power loss.MP2
REL-02Atomic saves (write, flush, rename); the original file is never truncated by a failed save.MP2
REL-03Best-effort repair of damaged files, with a report of what was recovered.SP4
REL-04Server backup and restore tooling, tested.MP3
REL-05Huge or malicious files are handled within resource limits, with cancellation and clear errors.MP1

OPS — Operations and self-hosting

IDRequirementPriPhase
OPS-01One-command deployment (docker run) with safe defaults; HTTPS via reverse proxy or built-in ACME.MP3
OPS-02Configuration via environment and file; secrets via files; twelve-factor friendly.MP3
OPS-03Metrics (Prometheus / OpenTelemetry) and structured logs without content.MP3
OPS-04Upgrades apply database migrations automatically, with documented rollback.MP3
OPS-05Scale-out mode: PostgreSQL, S3-compatible storage, multiple instances.SP4
OPS-06Admin console and CLI: users, storage, quotas, policies.MP3
OPS-07Air-gapped deployments: fonts, dictionaries and AI models served locally.MP3 / P5
OPS-08The web app and the server show a “Source code” link to the exact source of the running version, which operators of modified versions can point at their own source (license compliance made easy, ADR-0003).MP1 (web) / P3 (server)
OPS-09New self-hosted servers start with registration closed (invitations or single sign-on only); opening it is an explicit administrator choice.MP3

PLT — Supported platforms

IDRequirementPriPhase
PLT-01Desktop: Windows 11 and Windows 10 22H2 (best effort after Microsoft’s end of support), x86-64 and arm64; macOS current and two previous major versions on Apple silicon (Intel while Apple and Qt support it); Linux x86-64 and arm64 via Flatpak, AppImage, .deb and .rpm.MP1
PLT-02Browsers: last two major versions of Chrome, Edge, Firefox and Safari on desktop; tablets for viewing (P1) and editing (P4).MP1 / P4
PLT-03Server: Linux containers on x86-64 and arm64.MP3