Skip to content

Feature/ak 009 retention redaction idempotency validation#11

Merged
y-aithnini merged 6 commits intodevelopfrom
feature/AK-009-retention-redaction-idempotency-validation
Mar 27, 2026
Merged

Feature/ak 009 retention redaction idempotency validation#11
y-aithnini merged 6 commits intodevelopfrom
feature/AK-009-retention-redaction-idempotency-validation

Conversation

@y-aithnini
Copy link
Copy Markdown
Contributor

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

Copilot AI review requested due to automatic review settings March 26, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR evolves AuditKit from a template into a feature-focused auditing package by adding runtime option validation and extending the core audit flow with redaction, idempotency, retention behavior, event streaming hooks, and cursor-based pagination, along with new tooling for benchmarks and mutation testing.

Changes:

  • Add advanced AuditService behaviors (PII redaction, idempotency checks, retention cleanup, observer/publisher hooks) and cursor pagination types/APIs.
  • Extend repository adapters (MongoDB + in-memory) to support cursor pagination, archival handling, and idempotency-key filtering.
  • Add developer tooling: Vitest benchmarks, Stryker mutation testing config, and CI matrix expansion (Node 20/22, Ubuntu/Windows).

Reviewed changes

Copilot reviewed 32 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.config.ts Configures Vitest bench discovery for the new benchmark suite.
tsconfig.json Adds Node types and includes benchmarks in compilation.
tsconfig.eslint.json Ensures ESLint type-aware linting includes benchmarks.
stryker.config.json Introduces mutation testing configuration for core/infra/nest targets.
src/nest/providers.ts Validates module options at provider creation; wires retention archive handler and runtime options into providers.
src/nest/options.validation.ts Adds centralized runtime validation + mapping of module options to AuditService runtime options.
src/nest/module.ts Validates options during module registration and async wiring; injects runtime options into AuditService.
src/nest/module.spec.ts Adds tests asserting invalid module options throw early.
src/nest/interfaces.ts Expands module options with redaction/idempotency/retention/observer/event streaming contracts.
src/infra/repositories/mongodb/mongo-audit.repository.ts Adds cursor pagination, archival support, and idempotencyKey filtering in Mongo adapter.
src/infra/repositories/mongodb/audit-log.schema.ts Adds idempotencyKey field to the Mongo schema.
src/infra/repositories/in-memory/in-memory-audit.repository.ts Adds cursor pagination + archival support and idempotencyKey filtering for in-memory adapter.
src/infra/repositories/cursor.util.ts Adds base64url cursor encode/decode helpers.
src/infra/providers/index.ts Re-exports new infra events provider module.
src/infra/providers/events/index.ts Exports the default EventEmitter-based publisher adapter.
src/infra/providers/events/event-emitter-audit-event.publisher.ts Adds in-process EventEmitter event publisher implementation.
src/core/types.ts Adds cursor pagination types and idempotencyKey to AuditLog + filters.
src/core/ports/index.ts Re-exports new observer and event publisher ports.
src/core/ports/audit-repository.port.ts Extends repository contract with optional cursor pagination method.
src/core/ports/audit-observer.port.ts Introduces observer port for observability hooks.
src/core/ports/audit-event-publisher.port.ts Introduces event publisher port and event type constants.
src/core/index.ts Re-exports new cursor pagination types and ports from the public core surface.
src/core/dtos/query-audit-logs.dto.ts Adds idempotencyKey filter to query DTO schema.
src/core/dtos/create-audit-log.dto.ts Adds idempotencyKey to create DTO schema with validation.
src/core/dtos/audit-log-response.dto.ts Adds idempotencyKey to response DTO schema.
src/core/audit.service.ts Implements redaction, idempotency, retention-on-write, observer notifications, event publishing, and cursor pagination API.
src/core/audit.service.spec.ts Adds test coverage for redaction/idempotency/retention/cursor pagination and observer/publisher hooks.
package.json Adds mutation and bench scripts; adds Stryker + Vitest dev deps.
package-lock.json Locks new dev dependencies (Stryker, Vitest, transitive updates).
docs/RELEASE.md Documents local quality gates and optional checks.
docs/ARCHITECTURE.md Updates architecture documentation to reflect ports/adapters and data flow.
benchmarks/audit-service.bench.ts Adds benchmark suite for core service operations.
README.md Replaces template README with package-specific documentation and examples.
.github/workflows/pr-validation.yml Expands CI to OS/Node version matrix.

Copilot AI review requested due to automatic review settings March 26, 2026 17:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@sonarqubecloud
Copy link
Copy Markdown

@y-aithnini y-aithnini merged commit 49ac99c into develop Mar 27, 2026
5 checks passed
@y-aithnini y-aithnini deleted the feature/AK-009-retention-redaction-idempotency-validation branch March 27, 2026 07:40
Zaiidmo added a commit that referenced this pull request Mar 29, 2026
* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
y-aithnini added a commit that referenced this pull request Apr 2, 2026
* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
y-aithnini added a commit that referenced this pull request Apr 2, 2026
* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* Develop (#12)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
y-aithnini added a commit that referenced this pull request Apr 2, 2026
* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* Develop (#12)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
y-aithnini added a commit that referenced this pull request Apr 2, 2026
* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------



* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
y-aithnini added a commit that referenced this pull request Apr 2, 2026
* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------



* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Zaiidmo added a commit that referenced this pull request Apr 6, 2026
* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* ops (ci): standardize publish validation and dependabot across all packages

- Replace git tag --list strategy with package.json-driven tag validation
  in all 16 publish workflows; use git rev-parse to verify the exact tag
  exists rather than guessing the latest repo-wide tag
- Update error guidance to reflect feat/** → develop → master flow
- Standardize dependabot to npm-only, grouped, monthly cadence across
  all 16 packages; remove github-actions ecosystem updates
- Add missing dependabot.yml to AuthKit-UI, ChartKit-UI, HealthKit,
  HooksKit, paymentkit, StorageKit

* security: added CODEOWNER file for branches security

* ops: updated relese check workflow

* chore(ops): updated dependabot team name

* Feature/ak 009 retention redaction idempotency validation (#21)

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Feature/ak 009 retention redaction idempotency validation (#23)

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* Develop (#12)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>

* Feature/ak 009 retention redaction idempotency validation (#25)

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

* Develop (#12)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: release v0.1.0

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>

* Develop (#12) (#27)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------



* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Develop (#12) (#28)

* doc: added github-copilot instructions file

* ref develop

* chore: standardize package configuration (jest, eslint, tsconfig, env)

* chore: add standardized CI/CD workflows (pr-validation, release-check, publish)

* fix: add ts-node dev dependency for jest.config.ts

* chore: add .npmignore, dependabot, and npm audit to release workflow

* docs: add standardized instruction files structure

- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories

* refactor: move instruction files to .github/instructions/

- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization

* fix: update publish workflow to handle squash merges from develop to master

* ops: update dependabot PR limits

* Feature/ak 001 core domain types (#3)

* core domain types

* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* Potential fix for pull request finding



* chore: apply prettier formatting to all files

* fix: resolve TypeScript errors in error classes (exactOptionalPropertyTypes)

* style: apply prettier formatting to all files

---------



* core audit service implementation (#4)

* core audit service implementation

* fix quality issues

* fixed security risks for sonarQube

* more security issues fixed

* suppressed warnings

* implemented adapter (#5)

* implemented utility providers (#6)

* implemented nestjs module (#7)

* Feature/ak 006 comprehensive testing (#8)

* implemented unit testing

* fix: resolve most test failures - 92% pass rate

* test: skip failing MongoDB and module tests temporarily - will fix in separate task

* fix: resolve SonarQube code quality warnings - use default params, Object.hasOwn(), and concise regex

* fix: resolve all SonarQube code quality warnings

- Use default parameters in inline mock (nanoid-id-generator.spec.ts)
- Remove unnecessary type assertions (mongo-audit.repository.spec.ts)
- Simplify Date copying - remove unnecessary .getTime() call
- Add descriptive comments to empty test class
- Replace TODO comments with actionable tracking comments

* fix: resolve SonarQube code duplication by removing MongoDB test implementation

Removed 485 lines of duplicated test code from mongo-audit.repository.spec.ts
- Was: 521 lines with 31.8% duplication (199 lines, 36 blocks)
- Now: 34 lines with 0% duplication
- Left minimal placeholder for AK-007 implementation
- Removed unused import to fix ESLint error
- All tests still pass (177 passing, 27 skipped)

The duplicated test patterns will be properly implemented with correct
Mongoose Model mocking in task AK-007.

* fix: suppress Math.random() security hotspots in test mocks with NOSONAR

Added comprehensive documentation and NOSONAR comments to acknowledge
SonarQube security hotspots for Math.random() usage:

- __mocks__/nanoid.ts: Added security note explaining why Math.random()
  is acceptable for test-only code
- nanoid-id-generator.spec.ts: Added NOSONAR comments to inline mock

Justification:
- Code is ONLY used in Jest tests, never in production
- Test IDs don't require cryptographic security
- Real nanoid library (used in production) uses crypto.randomBytes()
- This is a false positive for test code

SonarQube Security Hotspots: Reviewed and accepted as safe

* fixed mongodb repository tests results (#9)

* fixed mongodb repository tests results

* reduced code duplication

* implemented remaining test fixes (#10)

* Feature/ak 009 retention redaction idempotency validation (#11)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* Feature/ak 009 retention redaction idempotency validation (#13)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* Feature/ak 009 retention redaction idempotency validation (#14)

* feat: add retention redaction idempotency and config validation

* fix: use compatible ignoreDeprecations value

* feat: add cursor pagination, OTel observer hooks, mutation testing, and benchmarks

* feat: add event streaming, docs updates, and CI compatibility matrix

* style: enforce LF line endings and add .gitattributes

* fix: resolve SonarCloud quality gate failures and warnings

* fix: update @nestjs/common to 11.1.17 to patch file-type CVEs

* refactor: remove MongoDB adapter, add custom repository config

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* 0.0.1

* fix: resolve deps, peer deps, and Zod v4 breaking changes

- Replace eslint-plugin-import with eslint-plugin-import-x (ESLint 10 compat)
- Add @eslint/js as explicit devDependency
- Update tsconfig ignoreDeprecations to 6.0 for TypeScript 6
- Fix z.record() calls to include explicit key type (Zod v4)
- Replace z.string().ip() with z.ipv4()/z.ipv6() (Zod v4)
- Rename errorMap to error in nativeEnum options (Zod v4)

* chore(ops): updated release check trigger

* fix(ci): add rollup Linux native binaries as optionalDependencies

* ops: updated release check strategy

* test(dtos): covering new code for sonar Gate

* ops: Updated release check workflow-s trigger

* chore(tests): added more coverage to the dtos spec

---------

Co-authored-by: y-aithnini <y.aithnini@ciscod.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants