Autonomous Quality Assurance (QA) Agents in xlsxrb

This document defines the architecture, responsibilities, standard commands, and autonomous workflows of the Autonomous QA Agents Squad for xlsxrb.


1. Overview & Architectural Philosophy

xlsxrb is a pure Ruby library for reading and writing Excel spreadsheets with streaming support. Rather than introducing wrapper scripts or ad-hoc tasks, the autonomous QA agents directly leverage the repository’s native verification infrastructure to guard specific quality attributes:

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                xlsxrb Autonomous QA Squad                                              │
├────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────────────────────┤
│     Test Rigor     │    Type Safety     │  Spec Compliance   │  Memory Stability  │       Throughput & Complexity      │
│ (Mutant 100% Kill) │   (Steep & RBS)    │  (ECMA-376 SDK)    │   (O(1) Memory)    │        (O(N) & Low GC Churn)       │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────────────────────┤
│ bundle exec        │ bundle exec rake   │ bundle exec ruby   │ bundle exec rake   │ bundle exec rake test:perf         │
│ mutant:pure        │ typecheck / sig    │ test/xsd_...       │ test:perf          │ bundle exec rake benchmark:ips     │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┴────────────────────────────────────┤
│Security&Resilience │    API Contract    │ Concurrency Safety │  Visual Fidelity & Wasm Compatibility                  │
│(ReDoS/DoS/Crypto)  │(Symmetry & Round)  │(Ractor Isolation)  │  (LibreOffice Pixel VRT & ruby.wasm Playground)        │
├────────────────────┼────────────────────┼────────────────────┼─────────────────────────────────────────────────────────┤
│ bundle exec ruby   │ bundle exec rake   │ bundle exec ruby   │ bundle exec rake test:visual                            │
│ test/security_...  │ test:contract/pbt  │ test/concurrent... │ bundle exec rake doc:check                             │
└────────────────────┴────────────────────┴────────────────────┴─────────────────────────────────────────────────────────┘

2. Specialized Agents & Quality Attributes

1. Test Rigor Agent (test-rigor)

# Run mutant on all 43 pure subjects (~50s) bundle exec rake mutant:pure “‘

2. Type Safety Agent (type-safety)

# Regenerate signatures from inline annotations bundle exec rake sig

# Verify runtime type contracts dynamically TEST_WORKERS=1 bundle exec rake test:rbs “‘

3. Specification Compliance Agent (spec-compliance)

# Check gallery workbooks (streamed, built, and loaded and written again) against rules # that Excel enforces beyond the schemas, such as pivot field items and index ranges bundle exec ruby -Ilib -Itest test/contract/excel_rules_test.rb

# Run Microsoft .NET Open XML SDK E2E interoperability suite (opt-in) bundle exec rake test:e2e “‘

4. Memory Stability Agent (memory-stability)

# Run ecosystem benchmark (throughput and allocation comparison) ruby -Ilib benchmark.rb “‘

5. Throughput & Complexity Agent (throughput-performance)

# Run core hot-path microbenchmarks (benchmark-ips) bundle exec rake benchmark:ips “‘

6. Security & Resilience Agent (security-resilience)

# Run DoS, ZIP bomb, and encryption security audit suites bundle exec ruby -Ilib -Itest test/dos_protection_test.rb test/zip_bomb_test.rb test/encryption_security_audit_test.rb

# Run dependency vulnerability check bundle exec rake bundle:audit “‘

7. API Symmetry & Contract Agent (api-contract)

# Run contract test suite bundle exec rake test:contract

# Run property-based testing (PBT) suite bundle exec rake test:pbt “‘

8. Concurrency & Ractor Safety Agent (concurrency-safety)

9. Visual Fidelity & Wasm Compatibility Agent (visual-fidelity)

# Run documentation server and Wasm playground validation bundle exec rake doc:check

# Regenerate golden visual baselines after intentional rendering updates bundle exec rake visual:baseline “‘


3. Pre-Push Verification

The standard pre-push hook runs the complete verification suite without requiring any custom setup:

# Standard pre-push checks (RuboCop, Steep, RBS sync, Unit & Contract tests)
bin/pre-push

# Extended pre-push checks (including diff-scoped mutation testing)
bin/pre-push --all

# Extended pre-push checks with full RBS runtime type validation
bin/pre-push --all --rbs

4. Instructions for Generative AI & Autonomous Coding Agents

When any LLM-powered coding assistant or autonomous agent works on this repository, adopt the specialized QA role corresponding to the modified components:

  1. Modifying pure algorithms, converters, or boundary validators:

  2. Adopt the Test Rigor role (test-rigor).

  3. Run bundle exec rake mutant:pure.

  4. Never accept surviving mutants; preserve the 100.00% kill rate.

  5. Modifying method signatures, interfaces, or public APIs:

  6. Adopt the Type Safety role (type-safety).

  7. Keep inline RBS annotations (#: (...) -> ...) updated in lib/.

  8. Regenerate signatures using bundle exec rake sig and verify zero errors with bundle exec rake typecheck.

  9. Modifying XML generation, serialization, or writer logic:

  10. Adopt the Specification Compliance role (spec-compliance).

  11. Run bundle exec ruby -Ilib -Itest test/xsd_validation_test.rb to verify ECMA-376 Part 4 XSD compliance.

  12. Run bundle exec ruby -Ilib -Itest test/contract/excel_rules_test.rb to check the rules in test/support/excel_rules.rb that Excel enforces beyond the schemas. When Excel repairs or rejects a file that passes the schema checks, add the rule it broke there.

  13. Respect schema sequencing (xs:sequence) and required OOXML attributes.

  14. Modifying row streaming, parsing loops, or memory buffers:

  15. Adopt the Memory Stability role (memory-stability).

  16. Run bundle exec rake test:perf to verify that retained memory remains flat ($O(1)$) and below the 5MB threshold.

  17. Modifying parsing loops, hot paths, or scaling performance:

  18. Adopt the Throughput & Complexity role (throughput-performance).

  19. Run bundle exec ruby -Ilib -Itest test/performance/throughput_test.rb to verify allocation bounds and linear scaling ($O(N)$).

  20. Run bundle exec rake benchmark:ips to evaluate hot-path iterations per second.

  21. Modifying regular expressions, compression, or security boundaries:

  22. Adopt the Security & Resilience role (security-resilience).

  23. Run bundle exec ruby -Ilib -Itest test/security_resilience_test.rb test/dos_protection_test.rb test/zip_bomb_test.rb test/encryption_security_audit_test.rb.

  24. Ensure regular expressions complete non-matching inputs within milliseconds without catastrophic backtracking.

  25. Adding or modifying worksheet authoring or reader APIs:

  26. Adopt the API Symmetry & Contract role (api-contract).

  27. Run bundle exec ruby -Ilib -Itest test/contract/api_symmetry_test.rb to confirm symmetry between WorksheetBuilder and StreamWriter.

  28. Run bundle exec rake test:contract and bundle exec rake test:pbt.

  29. Adding constants, class state, or concurrency logic:

  30. Adopt the Concurrency Safety role (concurrency-safety).

  31. Run bundle exec ruby -Ilib -Itest test/concurrent_test.rb to confirm that all constants remain Ractor.shareable? and parallel pipelines execute deterministically.

  32. Modifying drawing ML, chart formatting, styles, or documentation playground:

  33. Adopt the Visual Fidelity & Wasm Compatibility role (visual-fidelity).

  34. Run bundle exec rake test:visual to ensure pixel fidelity with LibreOffice Calc.

  35. Run bundle exec rake doc:check to ensure all playground presets execute cleanly.

Detailed Role Playbooks

Reference playbooks detailing analysis techniques and workflows are available at: - Test Rigor: .agents/skills/test-rigor/SKILL.md - Type Safety: .agents/skills/type-safety/SKILL.md - Specification Compliance: .agents/skills/spec-compliance/SKILL.md - Memory Stability: .agents/skills/memory-stability/SKILL.md - Throughput & Complexity: .agents/skills/throughput-performance/SKILL.md - Security & Resilience: .agents/skills/security-resilience/SKILL.md - API Symmetry & Contract: .agents/skills/api-contract/SKILL.md - Concurrency & Ractor Safety: .agents/skills/concurrency-safety/SKILL.md - Visual Fidelity & Wasm: .agents/skills/visual-fidelity/SKILL.md - Quality & Language Policies: .agents/rules/qa_agents.md