Skip to content

Add deep-dive documentation#5

Open
cyberkunju wants to merge 4 commits into
Edneam:mainfrom
cyberkunju:docs/deep-dive
Open

Add deep-dive documentation#5
cyberkunju wants to merge 4 commits into
Edneam:mainfrom
cyberkunju:docs/deep-dive

Conversation

@cyberkunju

@cyberkunju cyberkunju commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a docs/ folder with deep, detailed documentation of the whole project, grounded in the actual codebase.

Documents

  • docs/01-VISION-AND-PRODUCT.md - the problem (reporting is ~60%% of an engagement; the real bottleneck is trust, not speed), the 'proof before polish' thesis, personas, a real-world walkthrough using the demo evidence pack, the competitive landscape, the moat, value, honest limitations, and the roadmap.
  • docs/02-ARCHITECTURE-AND-ENGINE.md - full A-to-Z: stack, the complete data model (EvidenceChunk / ReportClaim / Finding / VerricReport), the parse -> chunk -> draft -> validate -> ground -> score pipeline, the pure-TS CVSS 3.1 engine, the independent grounding pass, claim status lifecycle, the three-tier honesty partitioning, the PDF/DOCX/TXT renderers, and the production deployment (Docker standalone + nginx name-based vhost + Cloudflare origin cert).
  • docs/03-INNOVATIONS-AND-COMPETITIVE-EDGE.md - each innovation with what/how/why-it-matters/real-world-impact and where competitors fall short, a capability comparison table, and the defensibility analysis.
  • docs/README.md - index + 60-second overview.

Notes

  • Docs only; no code changes. Content is derived from reading the engine, API routes, exporters, studio UI, and deployment config.

Summary by CodeRabbit

  • New Features

    • Added "New Report" button to easily reset the studio and start fresh penetration test reports.
  • Documentation

    • Added comprehensive documentation suite covering product vision, complete technical architecture, and detailed competitive innovations and differentiation.
  • Chores

    • Established containerized deployment infrastructure and configured production environment for optimized application serving.

Add a multi-stage Dockerfile (Next.js standalone output), .dockerignore, and docker-compose.yml. Enables output: standalone in next.config.mjs for a lean runtime image. Secrets are injected at runtime via .env.local, never baked into the image. Verified: image builds and the container serves HTTP 200.
Alpine's busybox wget lacks --spider/--no-verbose, and the standalone server binds to IPv4 0.0.0.0, so the probe must hit 127.0.0.1 not localhost (::1). Also add the nginx reverse-proxy vhost used to serve the app behind the shared nginx as a name-based virtual host.
Adds a 'New Report' button in the header that clears the project brief, evidence artifacts, manual notes, and generated draft, returning the studio to the setup step. Confirms before discarding in-progress work, resets the file input, and clears any auto-saved draft from localStorage.
Three detailed documents plus an index covering the product vision and competitive positioning, the full A-to-Z architecture and engine pipeline, and a catalog of innovations with their real-world rationale and moat analysis.
Copilot AI review requested due to automatic review settings June 6, 2026 05:44

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place.

Review Change Stack

📝 Walkthrough

Walkthrough

This PR establishes production deployment infrastructure for Verric, comprehensive product and technical documentation, and adds a UI feature to reset the report studio. The changes configure Next.js for standalone output, define a multi-stage Docker build with Alpine runtime, compose the service with environment variables and health checks, set up Nginx reverse proxy with TLS and security headers, document the product vision and competitive positioning, provide a technical architecture reference, and introduce a reset button to start fresh reports.

Changes

Production Deployment and Containerization

Layer / File(s) Summary
Next.js standalone build configuration
next.config.mjs
Next.js config exports nextConfig with output: "standalone" to emit a self-contained server bundle for containerized deployment.
Docker build infrastructure and context filtering
.dockerignore, Dockerfile
Multi-stage Dockerfile installs dependencies, builds the app with telemetry disabled, and assembles a minimal Alpine runtime as a non-root user. .dockerignore excludes build artifacts, secrets, VCS/CI metadata, editor noise, and demo files.
Docker service composition and healthcheck
docker-compose.yml
Service definition builds from the Dockerfile, exposes port 3000, loads .env.local with production defaults for OpenAI model and mock report flag, includes restart policy, and defines HTTP healthcheck probe.
Nginx reverse proxy and TLS termination
deploy/verric.cyberkunju.com.conf
Reverse proxy for verric.cyberkunju.com upstream to Docker app at 127.0.0.1:3000, redirects HTTP to HTTPS, serves on port 443 with TLS 1.2+, security headers (HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy), logging, and extended read timeout for report generation.

Product and Technical Documentation

Layer / File(s) Summary
Documentation index and overview
docs/README.md
Documentation README introduces the doc set with table of contents and 60-second overview of the evidence-grounded reporting pipeline and export workflow.
Product vision and positioning
docs/01-VISION-AND-PRODUCT.md
Vision document defines Verric's pitch, articulates the proof-before-polish thesis for pentest reports, describes the product workflow and target personas, provides a concrete demo engagement walkthrough, positions against alternative categories, quantifies value, lists honest limitations, and outlines roadmap.
Technical architecture and engine reference
docs/02-ARCHITECTURE-AND-ENGINE.md
Complete technical reference documenting the stack, repository structure, strongly-typed data model, evidence-to-report pipeline (ingest, inference, parsing, chunking, drafting, validation, independent grounding, CVSS scoring, mock fallback), claim status lifecycle, honesty partitioning, exporters, and deployment details.
Innovations and competitive differentiation
docs/03-INNOVATIONS-AND-COMPETITIVE-EDGE.md
Catalogues 12 innovations including independent grounding, evidence-based provenance, computed CVSS scoring, honesty partitioning, evidence parsing, mock report fallback, export fidelity, prompt rules, competitive comparison, defensibility, broader use cases, and summary.

Studio Reset Feature

Layer / File(s) Summary
Reset studio state and New Report button
src/app/page.tsx
Introduces resetStudio() helper that clears report state (project details, artifacts, notes, selections) after confirmation, removes persisted draft from localStorage, and adds a New Report button to the header alongside Run Verric Review.

🐰 A studio born to prove what's true,
With Docker packed and docs on cue,
Reset the slate, start fresh and clear—
Verric reports the truth, sincere! ✨

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 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 'Add deep-dive documentation' directly describes the main change: adding comprehensive documentation files (vision, architecture, innovations, and README) to the docs folder.
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

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 and usage tips.

@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: 4

🤖 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 `@docker-compose.yml`:
- Around line 14-18: The environment block currently uses shell-style
substitutions (OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o-mini}, USE_MOCK_REPORT:
${USE_MOCK_REPORT:-false}) which override values from env_file; remove those
substitutions from the docker-compose service's environment section so it relies
solely on env_file values (i.e., stop setting OPENAI_MODEL and USE_MOCK_REPORT
with ${...:-} in the compose file), and instead add or update a
.env.local.example documenting defaults (OPENAI_MODEL=gpt-4o-mini,
USE_MOCK_REPORT=false, OPENAI_API_KEY=...) so users know the expected variables
and defaults.

In `@docs/01-VISION-AND-PRODUCT.md`:
- Around line 115-126: The fenced code block containing the numbered artifact
list is missing a language identifier; update that opening fence from ``` to
```text so the block becomes a text code fence (i.e., add the language tag to
the triple-backtick that precedes the list) to satisfy markdownlint MD040 while
leaving the list contents unchanged.

In `@docs/02-ARCHITECTURE-AND-ENGINE.md`:
- Around line 25-46: Several fenced code blocks in the ARCHITECTURE doc are
missing language specifiers (MD040); update each fenced block that contains
ASCII diagrams, directory trees or plain text to use ```text and the deploy
command block to use ```bash. Locate the blocks that include the src/ tree, the
RAW EVIDENCE → ... flow, the grounded/unsupported ASCII diagram, the cd ~/verric
&& git pull && sudo docker compose up -d --build snippet, and the Studio
(page.tsx, client) box and add the appropriate language labels (`text` for
diagrams/trees and `bash` for the deploy command) so linting passes.

In `@src/app/page.tsx`:
- Around line 380-382: The confirmation guard builds hasWork but omits edited
project setup state, so add the project-dirty check to the same boolean used
before calling window.confirm. Update the hasWork computation (the const hasWork
that currently references artifacts, manualNotes, and hasReviewed) to also
include the project edit flag or comparison (e.g., projectDirty or projectEdited
or a diff between currentProject and initialProject) so that the if (hasWork &&
!window.confirm(...)) branch prevents starting a new report when project fields
have unsaved edits.
🪄 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

Run ID: d2e4e89f-42b5-4933-be34-7d6d192352ed

📥 Commits

Reviewing files that changed from the base of the PR and between c50e632 and 4374ca2.

📒 Files selected for processing (10)
  • .dockerignore
  • Dockerfile
  • deploy/verric.cyberkunju.com.conf
  • docker-compose.yml
  • docs/01-VISION-AND-PRODUCT.md
  • docs/02-ARCHITECTURE-AND-ENGINE.md
  • docs/03-INNOVATIONS-AND-COMPETITIVE-EDGE.md
  • docs/README.md
  • next.config.mjs
  • src/app/page.tsx

Comment thread docker-compose.yml
Comment on lines +14 to +18
environment:
NODE_ENV: production
# Sensible fallbacks if a value is absent from .env.local.
OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o-mini}
USE_MOCK_REPORT: ${USE_MOCK_REPORT:-false}

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

Environment section overrides env_file values.

The environment section takes precedence over env_file, and ${VAR:-default} substitutes from the host shell environment (not from .env.local). If a user sets OPENAI_MODEL=gpt-4o in .env.local but doesn't export it in their host shell, the container will receive gpt-4o-mini (the default), ignoring the .env.local value.

This contradicts the comment on line 11 ("Reuses your existing .env.local") and line 16 ("fallbacks if a value is absent from .env.local").

⚙️ Recommended fix: rely on env_file only
     env_file:
       - .env.local
     environment:
       NODE_ENV: production
-      # Sensible fallbacks if a value is absent from .env.local.
-      OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o-mini}
-      USE_MOCK_REPORT: ${USE_MOCK_REPORT:-false}

Then document the expected .env.local format with defaults in a comment or .env.local.example:

OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
USE_MOCK_REPORT=false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
environment:
NODE_ENV: production
# Sensible fallbacks if a value is absent from .env.local.
OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o-mini}
USE_MOCK_REPORT: ${USE_MOCK_REPORT:-false}
environment:
NODE_ENV: production
🤖 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 `@docker-compose.yml` around lines 14 - 18, The environment block currently
uses shell-style substitutions (OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o-mini},
USE_MOCK_REPORT: ${USE_MOCK_REPORT:-false}) which override values from env_file;
remove those substitutions from the docker-compose service's environment section
so it relies solely on env_file values (i.e., stop setting OPENAI_MODEL and
USE_MOCK_REPORT with ${...:-} in the compose file), and instead add or update a
.env.local.example documenting defaults (OPENAI_MODEL=gpt-4o-mini,
USE_MOCK_REPORT=false, OPENAI_API_KEY=...) so users know the expected variables
and defaults.

Comment on lines +115 to +126
```
01-nmap-external-scan.txt # service enumeration
02-burp-admin-unauthenticated-poc.http # /admin returns 200 without auth
03-burp-idor-user-export-poc.http # IDOR on a user-export endpoint
04-sqlmap-login-confirmed.txt # confirmed SQLi from sqlmap
05-login-sqli-request-response.http # manual true/false request/response proof
06-tester-notes.md # rough hypotheses and context
07-admin-panel-screenshot.png # visual PoC
08-idor-response-screenshot.png # visual PoC
09-sqlmap-confirmed-screenshot.png # visual PoC
10-api-export-response.json # raw API response
```

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 | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced block to satisfy markdownlint (MD040).

The code fence starting at Line 115 is missing a language identifier. Add text to keep docs lint-clean.

Suggested patch
-```
+```text
 01-nmap-external-scan.txt              # service enumeration
 02-burp-admin-unauthenticated-poc.http # /admin returns 200 without auth
 ...
 10-api-export-response.json            # raw API response
-```
+```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
01-nmap-external-scan.txt # service enumeration
02-burp-admin-unauthenticated-poc.http # /admin returns 200 without auth
03-burp-idor-user-export-poc.http # IDOR on a user-export endpoint
04-sqlmap-login-confirmed.txt # confirmed SQLi from sqlmap
05-login-sqli-request-response.http # manual true/false request/response proof
06-tester-notes.md # rough hypotheses and context
07-admin-panel-screenshot.png # visual PoC
08-idor-response-screenshot.png # visual PoC
09-sqlmap-confirmed-screenshot.png # visual PoC
10-api-export-response.json # raw API response
```
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 `@docs/01-VISION-AND-PRODUCT.md` around lines 115 - 126, The fenced code block
containing the numbered artifact list is missing a language identifier; update
that opening fence from ``` to ```text so the block becomes a text code fence
(i.e., add the language tag to the triple-backtick that precedes the list) to
satisfy markdownlint MD040 while leaving the list contents unchanged.

Source: Linters/SAST tools

Comment on lines +25 to +46
```
src/
├── app/
│ ├── page.tsx # The 5-step studio (client component, all UI state)
│ ├── layout.tsx # Root layout, fonts (Cormorant Garamond, IBM Plex Sans/Mono)
│ ├── globals.css # Theme tokens
│ └── api/
│ ├── generate-report/route.ts # LLM draft + validateReport + verifyGrounding (2nd pass)
│ ├── export-pdf/route.tsx # Multi-page React-PDF renderer
│ ├── export-docx/route.ts # docx renderer
│ └── export-txt/route.ts # Plain-text renderer
└── lib/
└── report.ts # Types, CVSS engine, nmap parser, chunker,
# validateReport, deterministic mock report,
# renderPlainTextReport
demo-evidence-pack/ # Minimal demo artifacts
demo-complete-evidence-pack/ # 10 artifacts for the full demo flow
deploy/
└── verric.cyberkunju.com.conf # nginx reverse-proxy vhost (production)
Dockerfile # Multi-stage, Next.js standalone output
docker-compose.yml # One-command deploy, runtime secrets, healthcheck
```

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 | 🟡 Minor | ⚡ Quick win

Fence language specifiers are missing on multiple blocks (MD040).

Several fenced blocks are missing language labels. Please add explicit identifiers (text for diagrams/maps, bash for the deploy command).

Suggested patch
-```
+```text
 src/
 ...
 docker-compose.yml                     # One-command deploy, runtime secrets, healthcheck
-```
+```

-```
+```text
 RAW EVIDENCE → 1. INGEST → 2. CHUNK → 3. DRAFT (LLM) → 4. VALIDATE → 5. GROUND (LLM `#2`) → 6. SCORE → OUTPUT
-```
+```

-```
+```text
                 ┌───────────────────────────── grounded   (in polished body)
 ...
                             unsupported → flagged        (⚠ "unsupported", pulled from body)
-```
+```

-```bash
+```bash
 cd ~/verric && git pull && sudo docker compose up -d --build

- +text
┌── Studio (page.tsx, client) ───────────────────────────────────────────────┐
...
└──────────────────────────────────────────────────────────────────────────────┘
- +

</details>

   


Also applies to: 144-146, 248-257, 340-342, 350-366

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 25-25: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

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

In @docs/02-ARCHITECTURE-AND-ENGINE.md around lines 25 - 46, Several fenced code
blocks in the ARCHITECTURE doc are missing language specifiers (MD040); update
each fenced block that contains ASCII diagrams, directory trees or plain text to
use text and the deploy command block to use bash. Locate the blocks that
include the src/ tree, the RAW EVIDENCE → ... flow, the grounded/unsupported
ASCII diagram, the cd ~/verric && git pull && sudo docker compose up -d --build
snippet, and the Studio (page.tsx, client) box and add the appropriate language
labels (text for diagrams/trees and bash for the deploy command) so linting
passes.


</details>

<!-- fingerprinting:phantom:triton:hawk -->

<!-- cr-comment:v1:7e91b2ca9eb960337949cf1e -->

_Source: Linters/SAST tools_

<!-- This is an auto-generated comment by CodeRabbit -->

Comment thread src/app/page.tsx
Comment on lines +380 to +382
const hasWork = artifacts.length > 0 || manualNotes.trim().length > 0 || hasReviewed;
if (hasWork && !window.confirm("Start a new report? This clears the current brief, evidence, and draft.")) {
return;

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

Confirmation guard misses edited project brief state

Line 380 only checks artifacts/manual notes/review status. If the user edits project fields in setup, no confirmation is shown and Line 385 clears that work immediately. Include project-dirty state in hasWork so “New Report” consistently protects in-progress brief edits.

Suggested fix
   function resetStudio() {
-    const hasWork = artifacts.length > 0 || manualNotes.trim().length > 0 || hasReviewed;
+    const hasProjectChanges = JSON.stringify(project) !== JSON.stringify(emptyProjectDetails);
+    const hasWork = hasProjectChanges || artifacts.length > 0 || manualNotes.trim().length > 0 || hasReviewed;
     if (hasWork && !window.confirm("Start a new report? This clears the current brief, evidence, and draft.")) {
       return;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const hasWork = artifacts.length > 0 || manualNotes.trim().length > 0 || hasReviewed;
if (hasWork && !window.confirm("Start a new report? This clears the current brief, evidence, and draft.")) {
return;
const hasProjectChanges = JSON.stringify(project) !== JSON.stringify(emptyProjectDetails);
const hasWork = hasProjectChanges || artifacts.length > 0 || manualNotes.trim().length > 0 || hasReviewed;
if (hasWork && !window.confirm("Start a new report? This clears the current brief, evidence, and draft.")) {
return;
🤖 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 `@src/app/page.tsx` around lines 380 - 382, The confirmation guard builds
hasWork but omits edited project setup state, so add the project-dirty check to
the same boolean used before calling window.confirm. Update the hasWork
computation (the const hasWork that currently references artifacts, manualNotes,
and hasReviewed) to also include the project edit flag or comparison (e.g.,
projectDirty or projectEdited or a diff between currentProject and
initialProject) so that the if (hasWork && !window.confirm(...)) branch prevents
starting a new report when project fields have unsaved edits.

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