Skip to content

docs: update contribution guidlines, enforce security policies#15

Merged
jpdevhub merged 3 commits into
mainfrom
docs/guidlines-and-security
May 26, 2026
Merged

docs: update contribution guidlines, enforce security policies#15
jpdevhub merged 3 commits into
mainfrom
docs/guidlines-and-security

Conversation

@jpdevhub

@jpdevhub jpdevhub commented May 26, 2026

Copy link
Copy Markdown
Owner

Description

This PR overhauls the project's documentation and contribution workflows to ensure security, standardisation, and a better experience for open-source contributors.


Summary by cubic

Introduces a clear security policy and tightens contributor workflows. Adds SECURITY.md, updates CONTRIBUTING and templates, pins CI to backend/requirements-ci.txt, and fixes a React Hooks lint issue in ScannerPage.tsx.

  • New Features

    • Added SECURITY.md with private email reporting and response timelines.
    • Overhauled CONTRIBUTING with stricter PR/commit/branch rules, testing requirements, and rejection criteria.
    • Updated issue and PR templates to route security reports, require maintainer approval/linked issues, and add a tighter checklist.
  • Bug Fixes

    • Resolved React Hooks lint error in ScannerPage.tsx; stabilized video ref usage and cleanup to prevent stale references.

Written for commit a6da084. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Documentation

    • Added a SECURITY policy and updated CONTRIBUTING and README guidance (security reporting, PR/commit standards, testing/CI expectations).
    • Reworked issue and pull-request templates to include security warnings and clearer submission requirements.
  • Bug Fixes

    • Improved camera stream start/stop behavior in the scanner for more reliable video handling.
  • Chores

    • Added dependabot and new repo workflows (welcome & stale management), updated CI dependency handling, gitignore tweaks, and CI/requirements adjustments.

Review Change Stack

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fresh-scan-ai Ready Ready Preview, Comment May 26, 2026 7:13am

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid input: expected object, received boolean at "reviews.auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Adds a SECURITY.md, tightens contributor and PR guidance (CONTRIBUTING.md, issue/PR templates), refactors CI dependency installs and lint step, adds automation workflows (Dependabot, greetings, stale), updates repo config, and fixes a camera ref snapshot bug in ScannerPage.

Changes

Contributor Governance, Security, and CI Infrastructure

Layer / File(s) Summary
Security Policy and Issue Templates
SECURITY.md, .github/ISSUE_TEMPLATE/bug_report.yml, .github/ISSUE_TEMPLATE/feature_request.yml
Adds SECURITY.md and updates issue templates to warn against public vulnerability reports and direct reporters to private disclosure.
CONTRIBUTING.md Rework
CONTRIBUTING.md
Reorganizes contributor guide: security caution, TOC, "Before You Start", codebase entry points, and contact/security instructions.
Branch Naming and Commit Conventions
CONTRIBUTING.md (branch naming, commit conventions)
Enforces strict branch naming and Conventional Commits with an allowed type/scope mapping.
PR Template and Requirements
.github/PULL_REQUEST_TEMPLATE.md, CONTRIBUTING.md (PR requirements)
Replaces PR scaffold with ## Description, updates checklist to require lint/build/test commands, stricter no-secrets checks, and rebase-on-main; documents CI gates.
Code Standards and Testing
CONTRIBUTING.md (Code Standards, Testing Requirements)
Specifies Python/FastAPI and TypeScript/React rules, CI pytest invocation, frontend test guidance, and expands rejection checklist.
Review Timeline and Labels
CONTRIBUTING.md (Review Timeline, Issue Labels)
Converts review timeline to a target table and updates label guidance for issues/PRs.
CI Dependency Management & Lint Step
backend/requirements-ci.txt, backend/requirements-base.txt, backend/requirements.txt, .github/workflows/ci.yml
Adds base and CI requirements files; CI now installs from requirements-ci.txt and runs ruff check without installing Ruff each job.
Automation Workflows and Repo Config
.github/dependabot.yml, .github/workflows/greetings.yml, .github/workflows/stale.yml, .gitignore, README.md, .coderabbit.yaml
Adds Dependabot, Greetings, and Stale workflows; updates .gitignore to ignore ._*; swaps README feature label to feature; updates .coderabbit.yaml for language and auto-review prompt.

Camera Stream Ref Capture Fix

Layer / File(s) Summary
Camera Stream Ref Snapshotting
src/pages/ScannerPage.tsx
Snapshots videoRef.current to currentVideo for stream setup and cleanup so the correct video element is referenced throughout the effect lifecycle.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A twitch, a tweak, a careful fix,

Camera keeps its steady mix.
Docs now warn where secrets hide,
CI tidy, workflows tied.
Hops of joy — the repo’s spry!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: updating contribution guidelines and establishing security policies (SECURITY.md, stricter CONTRIBUTING.md rules, template updates for security routing).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/guidlines-and-security

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/ISSUE_TEMPLATE/bug_report.yml">

<violation number="1" location=".github/ISSUE_TEMPLATE/bug_report.yml:9">
P1: Broken link: `../SECURITY.md` resolves to `.github/SECURITY.md`, which doesn't exist. SECURITY.md is at the repository root. Fix the relative path so users don't hit a 404.</violation>
</file>

<file name="backend/requirements-ci.txt">

<violation number="1" location="backend/requirements-ci.txt:1">
P2: `requirements-ci.txt` duplicates nearly all deps from `requirements.txt`. When shared deps change in one file, the other drifts silently until CI breaks. Extract common deps into a base file (e.g., `requirements-base.txt` excluding torch/torchvision) and reference it from both `requirements.txt` and `requirements-ci.txt` with `-r requirements-base.txt`. Then `requirements-ci.txt` only needs its CI-specific extras line.</violation>
</file>

<file name=".github/ISSUE_TEMPLATE/feature_request.yml">

<violation number="1" location=".github/ISSUE_TEMPLATE/feature_request.yml:8">
P2: Relative paths `../SECURITY.md` and `../DOCUMENTATION.md` won't resolve correctly in the issue template form. GitHub doesn't resolve markdown relative links in issue forms from the file's directory. Both SECURITY.md and DOCUMENTATION.md are at repo root — use absolute URLs or drop the `../` prefix.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/ISSUE_TEMPLATE/bug_report.yml Outdated
Comment thread backend/requirements-ci.txt Outdated
Comment thread .github/ISSUE_TEMPLATE/feature_request.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/ISSUE_TEMPLATE/bug_report.yml:
- Line 9: Replace the relative link target in the issue template line that reads
"Do NOT use this form. Read [SECURITY.md](../SECURITY.md) and report it
privately via email instead." with a root-relative or absolute path so it always
resolves (e.g., change "../SECURITY.md" to "/SECURITY.md" or the repo's full
URL); update only the link target in that quoted string so the link points to
the repository root SECURITY.md.

In @.github/ISSUE_TEMPLATE/feature_request.yml:
- Around line 8-13: Update the two relative links in the issue template that
currently point to "../SECURITY.md" and "../DOCUMENTATION.md#14-future-roadmap"
so they use root-relative paths ("/SECURITY.md" and
"/DOCUMENTATION.md#14-future-roadmap") to ensure links resolve correctly from
.github/ISSUE_TEMPLATE/feature_request.yml; locate and replace the link strings
in the block containing "Is this a security concern? Use [SECURITY.md]" and the
"Read before opening" section.

In `@backend/requirements-ci.txt`:
- Around line 1-10: The CI requirements file uses loose >= specifiers which
allows dependency drift; update backend/requirements-ci.txt to pin each package
to an exact version (replace each "package>=x.y.z" with "package==x.y.z",
preserving extras like "uvicorn[standard]") using the currently
validated/resolved versions for fastapi, uvicorn[standard], supabase, Pillow,
numpy, python-dotenv, python-multipart, httpx, pytest, ruff, etc.; to keep this
reproducible, regenerate the file from your lockfile/resolved environment (e.g.,
pip freeze or pip-compile) so the exact versions in requirements-ci.txt match
the tested CI environment.

In `@CONTRIBUTING.md`:
- Around line 74-76: Markdown fenced code blocks in CONTRIBUTING.md are missing
a language tag which triggers markdownlint MD040; update both code fences
containing the commit message templates so they include a language (for example
"text") by changing the opening backticks from ``` to ```text for the block that
shows "<type>(<scope>): <summary>" and the example block that lists commit lines
like "feat(scanner): add live confidence threshold display" and "fix(auth):
handle OAuth redirect loop on mobile Safari" (also apply the same change to the
similar block at lines 102-107).

In `@SECURITY.md`:
- Around line 15-17: The fenced block containing the email currently has no
language and triggers markdownlint MD040; update that fence in SECURITY.md by
adding a language (e.g., change the triple-backtick fence to ```text) or remove
the code fence to make it plain text so the markdown linter stops flagging
it—locate the email block and apply the change.

In `@src/components/Navbar.tsx`:
- Line 22: The useEffect currently calls setProfile(null) synchronously
(triggering react-hooks/set-state-in-effect); remove the synchronous
setProfile(null) from the useEffect body and instead call setProfile(null)
inside the auth-change event handler (the function that handles auth-change
events used in the same effect), e.g., update the auth-change handler
(referenced as the auth-change callback registered in useEffect) to
setProfile(null) when appropriate and keep the effect only for
registering/unregistering that handler.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0871c5b3-6245-4ac8-bc49-271770e1c418

📥 Commits

Reviewing files that changed from the base of the PR and between d61cda9 and 4e9c87a.

📒 Files selected for processing (11)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/ci.yml
  • .gitignore
  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • backend/requirements-ci.txt
  • public/._manifest.json
  • src/components/Navbar.tsx

Comment thread .github/ISSUE_TEMPLATE/bug_report.yml Outdated
Comment thread .github/ISSUE_TEMPLATE/feature_request.yml Outdated
Comment thread backend/requirements-ci.txt Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread SECURITY.md Outdated
Comment thread src/components/Navbar.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coderabbit.yaml:
- Line 3: The reviews.auto_review entry is using a boolean but the schema
expects an object; update the .coderabbit.yaml to replace reviews.auto_review:
true with an object like reviews.auto_review: { enabled: true } (or the
equivalent YAML mapping) so the field conforms to the expected structure and any
additional properties (e.g., enabled) can be added later.

In @.github/workflows/greetings.yml:
- Line 16: Update the workflow's action reference so it uses a specific commit
SHA instead of the floating tag; replace the line that reads "uses:
actions/first-interaction@v1" with "uses:
actions/first-interaction@<commit-sha>" where <commit-sha> is the exact commit
hash from the actions/first-interaction repository (use the action's GitHub repo
to find the latest stable commit and pin to that SHA) to ensure immutability for
the "actions/first-interaction@v1" usage.

In @.github/workflows/stale.yml:
- Line 14: Replace the mutable reference "uses: actions/stale@v9" with a pinned
full commit SHA for the actions/stale action; locate the latest stable commit
SHA from the actions/stale repository (or the specific release tag you want) and
update the workflow job step that contains the literal "uses: actions/stale@v9"
to use "uses: actions/stale@<full-commit-sha>" so the workflow is pinned to an
immutable revision.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ea869b67-bada-41cd-a397-e88676a74513

📥 Commits

Reviewing files that changed from the base of the PR and between a6da084 and f50983f.

📒 Files selected for processing (11)
  • .coderabbit.yaml
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/dependabot.yml
  • .github/workflows/greetings.yml
  • .github/workflows/stale.yml
  • CONTRIBUTING.md
  • SECURITY.md
  • backend/requirements-base.txt
  • backend/requirements-ci.txt
  • backend/requirements.txt
✅ Files skipped from review due to trivial changes (5)
  • backend/requirements-base.txt
  • .github/dependabot.yml
  • SECURITY.md
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • CONTRIBUTING.md

Comment thread .coderabbit.yaml
Comment thread .github/workflows/greetings.yml
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


🏁 Script executed:

#!/bin/bash
# Verify unpinned GitHub Actions references in workflows.
rg -nP '^\s*-\s*uses:\s*[^@]+@((?![0-9a-f]{40}).)+$' .github/workflows

Repository: jpdevhub/FreshScanAi

Length of output: 584


Pin actions/stale to a commit SHA (avoid mutable @v9).

.github/workflows/stale.yml:14 uses actions/stale@v9, and @v9 is mutable; pinning to the full commit SHA reduces action-reference drift.

      - uses: actions/stale@v9
🔒 Proposed fix
-      - uses: actions/stale@v9
+      - uses: actions/stale@<FULL_LENGTH_COMMIT_SHA>
🧰 Tools
🪛 zizmor (1.25.2)

[error] 14-14: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/stale.yml at line 14, Replace the mutable reference "uses:
actions/stale@v9" with a pinned full commit SHA for the actions/stale action;
locate the latest stable commit SHA from the actions/stale repository (or the
specific release tag you want) and update the workflow job step that contains
the literal "uses: actions/stale@v9" to use "uses:
actions/stale@<full-commit-sha>" so the workflow is pinned to an immutable
revision.

@jpdevhub jpdevhub self-assigned this May 26, 2026
@jpdevhub jpdevhub added the documentation Improvements or additions to documentation label May 26, 2026
@jpdevhub jpdevhub removed their assignment May 26, 2026
@jpdevhub jpdevhub requested a review from Copilot May 26, 2026 07:29

Copilot AI left a comment

Copy link
Copy Markdown

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 strengthens contributor/security workflows (new security policy, stricter contribution and template guidance, CI dependency pinning) and includes a small frontend fix to address a React Hooks lint issue in the scanner camera effect.

Changes:

  • Added a formal security policy and updated contributor docs/templates to route vulnerability reports privately and enforce contribution standards.
  • Refactored backend dependency installation for CI to use pinned requirements files.
  • Adjusted ScannerPage camera effect to avoid stale ref usage in async/cleanup.

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/pages/ScannerPage.tsx Captures videoRef.current once per effect run to satisfy hooks/lint and stabilize cleanup behavior.
SECURITY.md Adds a private vulnerability reporting policy and response timelines.
README.md Updates “Request Feature” link label parameter.
CONTRIBUTING.md Overhauls contribution requirements, standards, and testing expectations.
backend/requirements.txt Switches to -r requirements-base.txt and keeps local test deps.
backend/requirements-ci.txt Introduces CI-only dependency set (base + pytest + ruff).
backend/requirements-base.txt Introduces shared backend dependency list used by other requirement files.
.gitignore Ignores macOS ._* metadata files.
.github/workflows/stale.yml Adds stale issue/PR automation.
.github/workflows/greetings.yml Adds first-interaction greeting automation for issues/PRs.
.github/workflows/ci.yml Installs backend CI deps via backend/requirements-ci.txt and simplifies Ruff setup.
.github/PULL_REQUEST_TEMPLATE.md Updates PR template to a single description section + stricter checklist.
.github/ISSUE_TEMPLATE/feature_request.yml Adds security-routing guidance and stronger pre-submission expectations.
.github/ISSUE_TEMPLATE/bug_report.yml Adds security-routing warning and stricter report expectations.
.github/dependabot.yml Enables Dependabot updates for npm/pip/GitHub Actions.
.coderabbit.yaml Configures CodeRabbit auto-review behavior and PR complexity labeling instructions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- [ ] `npm run lint` passes with no errors
- [ ] `npm run build` compiles without TypeScript errors
- [ ] `python -m pytest` passes (including new tests I added)
Comment on lines +16 to +18
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +14 to +16
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
@jpdevhub jpdevhub merged commit 434ccdc into main May 26, 2026
8 checks passed
@jpdevhub jpdevhub deleted the docs/guidlines-and-security branch May 26, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants