Skip to content

chore: add fast-check dev dependency for property-based testing - #120

Merged
Bonobo791 merged 1 commit into
mainfrom
pbt-fast-check
Aug 6, 2026
Merged

chore: add fast-check dev dependency for property-based testing#120
Bonobo791 merged 1 commit into
mainfrom
pbt-fast-check

Conversation

@Bonobo791

@Bonobo791 Bonobo791 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Installs fast-check@^4.9.0 as a dev-only dependency — the maintainer approval the fast-check-testing skill's adoption gate required before any code imports it. No source changes; nothing at runtime imports it.

This unblocks property-based testing batches per the skill's references/moderaty-context.md property catalog (I1–I13 mapped to properties: tenant isolation, idempotent ingest, dry-run no-durable-writes, crypto round-trips, …).

Changes

  • package.json / package-lock.json: fast-check devDependency (4.9.0). The @fast-check/vitest connector is deliberately NOT installed — plain fc.assert in vitest tests is the house style.
  • AGENTS.md: approved-deps gate updated (fast-check added to the dev list with its conditions).
  • .agents/skills-src/fast-check-testing/references/moderaty-context.md: adoption-gate note updated to match (installed copy of the skill will be re-synced after merge, per the edit-source-then-re-copy convention).

Verification

  • Scratch property suite (written, run, removed — not committed): fast-check runs under the repo's vitest config, and decrypt(encrypt(x)) === x held for generated strings (maxLength 1000) against the real crypto.ts.
  • npm run check: 0 errors, 0 warnings
  • npm run test: 949/949 green
  • npm run build: clean (adapter-netlify)

CodeAnt-AI Description

Add approved property-based testing support for the development workflow

What Changed

  • Adds fast-check 4.9.0 as a development-only dependency for generating broad test cases
  • Documents fast-check as approved for tests while keeping the separate Vitest connector out of the project
  • Updates testing guidance to use fast-check directly with the existing test runner

Impact

✅ Broader automated test coverage
✅ Safer validation of edge cases
✅ No new runtime dependency

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Maintainer-approved dev-only dep (fast-check 4.9.0) enabling the
fast-check-testing skill's PBT layer — no runtime code imports it.

- AGENTS.md approved-deps gate updated (fast-check dev; the
  @fast-check/vitest connector stays optional/unapproved).
- fast-check-testing skill's moderaty-context adoption note updated to
  match.
- Verified with a scratch property suite (not committed): fast-check runs
  under the repo vitest config, and a crypto round-trip property
  (decrypt(encrypt(x)) === x over generated strings) passes against the
  real crypto.ts.
@cla-bot cla-bot Bot added the cla-signed label Aug 6, 2026
@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR a12ce74 Aug 06, 2026 · 10:59 11:05

@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for moderaty ready!

Name Link
🔨 Latest commit a12ce74
🔍 Latest deploy log https://app.netlify.com/projects/moderaty/deploys/6a7469141e56520008e20a41
😎 Deploy Preview https://deploy-preview-120--moderaty.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 72
Accessibility: 97
Best Practices: 100
SEO: 100
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Bonobo791, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bca95efc-cbf2-4338-9a05-1190099fe28f

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca6627 and a12ce74.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .agents/skills-src/fast-check-testing/references/moderaty-context.md
  • AGENTS.md
  • package.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 6, 2026
@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR approves and installs fast-check as a development-only dependency, enabling future property-based tests without changing runtime behavior. The verification flow confirms it works with the existing test suite.

sequenceDiagram
    participant Maintainer
    participant Project
    participant Test Suite

    Maintainer->>Project: Approve fast-check for development use
    Project->>Project: Install fast-check
    Test Suite->>Project: Load property-testing support
    Test Suite->>Test Suite: Verify crypto round-trip property
Loading

Generated by CodeAnt AI

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add fast-check as approved dev dependency for property-based testing

⚙️ Configuration changes 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Add fast-check as a dev-only dependency to enable property-based testing.
• Record maintainer approval and usage constraints (no @fast-check/vitest; use plain fc.assert).
• Align the fast-check-testing skill reference docs with the repo’s dependency gate.
Diagram

graph TD
  A["package.json"] --> B["Dev deps"] --> C["fast-check"] --> D["Vitest tests"]
  A --> E["package-lock.json"] --> C
  F["AGENTS.md"] --> B
  G["PBT skill docs"] --> B
Loading
High-Level Assessment

The PR takes the minimal, policy-aligned approach: add fast-check as a dev-only dependency and explicitly document that the @fast-check/vitest connector is not approved. Alternatives (adopting the connector or choosing a different PBT library) would increase surface area and/or diverge from the stated house style without immediate benefit.

Files changed (4) +50 / -4

Documentation (2) +8 / -4
moderaty-context.mdDocument fast-check approval and Vitest usage style +4/-3

Document fast-check approval and Vitest usage style

• Updates the skill reference to reflect that 'fast-check' is now maintainer-approved as a dev-only dependency. Clarifies that '@fast-check/vitest' remains unapproved and tests should use plain 'fc.assert' APIs.

.agents/skills-src/fast-check-testing/references/moderaty-context.md

AGENTS.mdAdd fast-check to approved dev dependency gate +4/-1

Add fast-check to approved dev dependency gate

• Extends the approved-dependencies section to include 'fast-check' for property-based testing. Notes the constraint that '@fast-check/vitest' remains optional/unapproved and reiterates the plain 'fc.assert' house style.

AGENTS.md

Other (2) +42 / -0
package-lock.jsonLock fast-check and pure-rand as dev dependencies +41/-0

Lock fast-check and pure-rand as dev dependencies

• Adds 'fast-check@4.9.0' to the lockfile as a dev-only package along with its transitive dependency 'pure-rand'. Ensures deterministic installs consistent with the new devDependency.

package-lock.json

package.jsonAdd fast-check devDependency +1/-0

Add fast-check devDependency

• Adds 'fast-check@^4.9.0' to 'devDependencies' to enable property-based testing in the test suite without impacting runtime dependencies.

package.json

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least high severity)
⚠ 1 issue (≤ 0 issues of at least high severity)

Results:
1 new issue

Category Results
Security 1 high

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0 (≤ 100 complexity)
Duplication 0 (≤ 1 duplication)

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR correctly adds fast-check as a dev dependency with appropriate documentation updates. All changes are consistent and properly scoped. No defects found that block merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Unapproved fast-check devDependency 📘 Rule violation § Compliance
Description
fast-check was added to devDependencies, but it is not in the compliance-approved dependency
allowlist. This introduces an unapproved third-party package and increases supply-chain risk
relative to the stated dependency restrictions.
Code

package.json[27]

+		"fast-check": "^4.9.0",
Relevance

●● Moderate

Repo does update approved-deps list when adding new dev deps; unclear if fast-check now formally
allowlisted.

PR-#94
PR-#14

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2407799 requires that devDependencies contain only an explicitly enumerated set
of packages, and no other dependencies be added. The diff adds fast-check to devDependencies,
which is not part of that allowed list.

Rule 2407799: Restrict allowed runtime and dev dependencies in package.json
package.json[27-27]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR adds `fast-check` to `devDependencies`, but the compliance allowlist rule only permits a fixed set of runtime and dev dependencies.

## Issue Context
This repository has a compliance control that restricts which packages may appear in `dependencies`/`devDependencies`. Adding `fast-check` violates that allowlist unless the policy/rule is updated via an approved exception process.

## Fix Focus Areas
- package.json[27-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 90 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread package.json
"@sveltejs/kit": "^2.63.0",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"drizzle-kit": "^0.31.10",
"fast-check": "^4.9.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Unapproved fast-check devdependency 📘 Rule violation § Compliance

fast-check was added to devDependencies, but it is not in the compliance-approved dependency
allowlist. This introduces an unapproved third-party package and increases supply-chain risk
relative to the stated dependency restrictions.
Agent Prompt
## Issue description
The PR adds `fast-check` to `devDependencies`, but the compliance allowlist rule only permits a fixed set of runtime and dev dependencies.

## Issue Context
This repository has a compliance control that restricts which packages may appear in `dependencies`/`devDependencies`. Adding `fast-check` violates that allowlist unless the policy/rule is updated via an approved exception process.

## Fix Focus Areas
- package.json[27-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@Bonobo791
Bonobo791 merged commit 87c6563 into main Aug 6, 2026
12 of 16 checks passed
@Bonobo791
Bonobo791 deleted the pbt-fast-check branch August 6, 2026 11:03
@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: a12ce745
Scan Time: 2026-08-06 11:05:10 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED Rating S: No issues

View Full Results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant