Non-Functional Requirements — protracker2-agent-assist

ID: PT2AA-NFR-001 .. PT2AA-NFR-007
Related Vision: docs/vision.md (functional spec: .kiro/specs/libpt2-core-wrapper/)


Coverage Table (ISO/IEC 25010:2023)

Quality Area / Constraint Status Notes
Functional suitability Open Functional spec for libpt2-core-wrapper exists; functional spec for agent/pattern/UI layer not yet created
Performance efficiency Covered Real-time audio rendering, transport latency, non-blocking writes (PT2AA-NFR-005)
Compatibility Covered Target platform: macOS (PT2AA-NFR-007)
Interaction capability Covered Usage documentation / Wiki (PT2AA-NFR-004)
Reliability Covered Error propagation, crash survival, state integrity (PT2AA-NFR-006)
Security Covered Basic repository security rules (PT2AA-NFR-003)
Maintainability Covered (targets pending user decision) Automated CI build (PT2AA-NFR-001), branch rules (PT2AA-NFR-002)
Flexibility (portability) Covered CMake build, macOS target platform
Safety Not relevant —
Operations (CI/CD & Docs) Covered GitHub Actions workflow, branch protection, Wiki

Priorities


Requirements

PT2AA-NFR-001 — Automated CI Build on Check-In

Feature: Automated CI build on check-in
  Scenario: Developer pushes code or opens a pull request
    Given the repository contains a valid CMake configuration
    When a commit is pushed or a pull request is opened
    Then GitHub Actions SHALL run the CMake build on macOS (required) and Ubuntu (non-blocking)
    And report a pass or fail check status on the commit

PT2AA-NFR-002 — Branch Protection Rules

Feature: Branch protection on default branch
  Scenario: Merging changes into the default branch
    Given branch protection rules are enabled on the default branch
    When a developer attempts to merge a pull request
    Then the repository SHALL require the CI build check to pass before merging

PT2AA-NFR-003 — Basic Security Rules

Feature: Basic repository security rules
  Scenario: Preventing leaked secrets in commits
    Given the repository settings page is open
    Then secret scanning, push protection and Dependabot alerts SHALL show as enabled

PT2AA-NFR-004 — Usage Wiki / Documentation

Feature: Usage documentation in Wiki
  Scenario: New user or contributor reads the Wiki
    Given the project Wiki is published
    When a user opens the Wiki home page
    Then it SHALL describe how to build, configure, and use the application

PT2AA-NFR-005 — Performance Efficiency

Feature: Real-time audio performance
  Scenario: Rendering audio within real-time budget
    Given the Audio Engine is initialized with a sample rate of 44100 Hz
    When the Host Client requests 4410 frames (0.1 seconds of audio)
    Then the render call SHALL complete in less than 0.1 seconds of wall-clock time
  Scenario: Transport command effect
    Given the Audio Engine is playing a module
    When the Host Client sends a stop command
    Then the next render call that starts after the command returns SHALL produce silence
  Scenario: Concurrent pattern writes
    Given the Host Client is calling render at 44100 Hz
    When pattern cell writes are made from another thread
    Then the render call duration SHALL increase by no more than 100 microseconds

PT2AA-NFR-006 — Reliability

Feature: Crash survival and state integrity
  Scenario: Corrupt module file
    Given the Audio Engine has a valid module loaded
    When the Host Client loads a corrupt or truncated module file
    Then the Core Wrapper SHALL return an error status
    And the previously loaded module SHALL remain intact and playable
  Scenario: Delayed render calls
    Given the Audio Engine is playing
    When the Host Client delays or skips render calls
    Then the Core Wrapper SHALL NOT crash
    And the next render call SHALL render correctly
  Scenario: Sample load failure isolation
    Given multiple samples are loaded
    When one sample file fails to load
    Then the Core Wrapper SHALL return an error for that sample
    And all other loaded samples SHALL remain unaffected

PT2AA-NFR-007 — Compatibility

Feature: macOS target platform
  Scenario: Building on macOS
    Given the repository is cloned on macOS
    When the developer runs the CMake build
    Then the build SHALL succeed and produce a runnable binary
  Scenario: Linux build as bonus
    Given the CI workflow includes an Ubuntu build
    When the CI runs on push or pull request
    Then the Linux build MAY pass but is not a release requirement

Constraints

USER DECISIONS

Each item has a proposed default, matching its inline label.

Req Decision Proposed default
NFR-001 CI duration target ≤ 10 minutes
NFR-002 Branch rules 0 approvals, passing macOS CI check
NFR-006 Library owns an audio device? No; host pulls frames through render