feat: DISHA v5.0.0 — Global Launch & Elite Modernization - #66
Conversation
📝 WalkthroughWalkthroughDISHA reaches v5.0.0 with comprehensive documentation overhaul (new CODE_OF_CONDUCT, SECURITY, REPORT, and refreshed README/WIKI), new backend agents for national intelligence coordination and disaster response, FastAPI dependency formatting refinements, frontend redesign with new CSS design system and landing page, and dependency upgrades across React, Next.js, TypeScript, and AI SDKs. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 19
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
ai-platform/backend/app/services/automation/dependency_audit.py (2)
9-9:⚠️ Potential issue | 🔴 CriticalFix pipeline failure: Add missing blank line before class definition.
PEP 8 requires 2 blank lines before top-level class definitions, but only 1 is present. This is causing the flake8 E302 error in CI.
🔧 Proposed fix
logger = structlog.get_logger(__name__) + class DependencyAudit: """Service to scan for insecure dependencies and supply-chain threats."""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-platform/backend/app/services/automation/dependency_audit.py` at line 9, Add a missing blank line before the top-level class definition to satisfy PEP8: ensure there are two blank lines immediately before the class DependencyAudit declaration (i.e., insert one additional newline above "class DependencyAudit") so flake8 E302 no longer fails.
83-83:⚠️ Potential issue | 🔴 CriticalString comparison fails for semantic versioning—use
packaging.version.parse()instead.Version comparison at line 83 uses string comparison (
pkg["version"] < threat_patterns[name]["min_safe"]), which produces incorrect results for semantic versions. For example,"0.9.0" < "0.100.0"evaluates toFalselexicographically (since"9" > "1"), even though semantically 0.9.0 is less than 0.100.0. This causes the vulnerability detection to miss critical packages.Proposed fix
Add import:
from packaging.version import parse as parse_versionUpdate the comparison:
if pkg["version"] != "latest" and parse_version(pkg["version"]) < parse_version(threat_patterns[name]["min_safe"]):🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-platform/backend/app/services/automation/dependency_audit.py` at line 83, Replace the lexicographic version comparison with semantic version parsing: add an import for packaging.version.parse (e.g., parse_version) and update the conditional that currently checks pkg["version"] != "latest" and pkg["version"] < threat_patterns[name]["min_safe"] to instead parse both pkg["version"] and threat_patterns[name]["min_safe"] with parse_version before comparing (refer to the if that evaluates pkg["version"] and threat_patterns[name]["min_safe"] and the pkg and threat_patterns variables).ai-platform/backend/app/core/middleware/security.py (1)
9-12:⚠️ Potential issue | 🟠 MajorAdd required blank-line separation before
SentinelSecurityMiddleware.Line 11 fails E302 (
expected 2 blank lines), which blocks the CI job.💡 Suggested patch
logger = structlog.get_logger(__name__) + class SentinelSecurityMiddleware(BaseHTTPMiddleware):🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-platform/backend/app/core/middleware/security.py` around lines 9 - 12, The file currently has no blank line between the module-level logger declaration and the class definition, which triggers E302; insert one additional blank line before the SentinelSecurityMiddleware class declaration (the class named SentinelSecurityMiddleware defined after logger = structlog.get_logger(__name__)) so there are two blank lines separating the top-level statement and the class.ai-platform/backend/app/api/v1/routers/websockets.py (1)
7-13:⚠️ Potential issue | 🟠 MajorFix flake8 E252/E302 in websocket router declarations.
Line 11/21 need whitespace around
=, and endpoint blocks need proper top-level blank-line separation to satisfy E302.💡 Suggested patch
router = APIRouter() + `@router.get`("/alerts") async def get_alerts( limit: int = 50, level: str | None = None, - current_user: dict=Depends(get_current_user), - alert_manager=Depends(get_alert_manager) + current_user: dict = Depends(get_current_user), + alert_manager = Depends(get_alert_manager), ): @@ """Get recent alerts.""" return {"alerts": alert_manager.get_alerts(limit=limit, level=level)} + `@router.websocket`("/ws/alerts") async def websocket_alerts( websocket: WebSocket, token: str | None = None, - connection_manager=Depends(get_connection_manager) + connection_manager = Depends(get_connection_manager), ):Also applies to: 17-22
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-platform/backend/app/api/v1/routers/websockets.py` around lines 7 - 13, Fix flake8 spacing and top-level separation in the websocket router declarations: add spaces around the equals in the parameter annotations for current_user and alert_manager (change "current_user: dict=Depends(...)" to "current_user: dict = Depends(...)" and similarly for "alert_manager=Depends(...)"), and ensure there is a single blank line separating top-level endpoint function blocks (e.g., before and after async def get_alerts and the other websocket endpoint functions) so E252 and E302 are satisfied; apply the same spacing/blank-line changes to the other endpoint defs in this module as well.README.md (1)
100-121: 🧹 Nitpick | 🔵 TrivialFix markdown formatting around headings and code blocks.
The static analysis flagged missing blank lines around headings (Lines 102, 107, 116) and fenced code blocks (Lines 117, 120). This affects markdown rendering consistency.
✏️ Add required blank lines
## 🚀 Installation ### Prerequisites + - **Bun** ≥ 1.1.0 - **Python** ≥ 3.11 - **Docker** + **Docker Compose** ### Quick Start + ```bash git clone https://github.com/Tashima-Tarsh/Disha.git cd Disha bun install bun run build ./dist/cli.mjs
Full Ecosystem Launch
cd ai-platform/docker docker compose up -d
Access the Premium Dashboard at
http://localhost:3000.</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@README.mdaround lines 100 - 121, The README has missing blank lines around
several headings and fenced code blocks causing markdown rendering issues; edit
the README.md to ensure there's a blank line before each heading (e.g., "## 🚀
Installation", "### Prerequisites", "### Quick Start", "### Full Ecosystem
Launch") and add blank lines above and below each fenced code block (the ```bash
blocks for Quick Start and Full Ecosystem Launch) so headings and code fences
are separated from surrounding text.</details> </blockquote></details> <details> <summary>web/app/layout.tsx (1)</summary><blockquote> `57-76`: _⚠️ Potential issue_ | _🔴 Critical_ **Extract client interactivity to a separate component—metadata cannot coexist with client hooks in the same file.** `web/app/layout.tsx` exports `metadata` (line 39) while using client hooks like `useState` (line 62) and `AnimatePresence` (line 74) without a `"use client"` directive. Next.js App Router enforces that metadata exports are only valid in Server Components. Adding `"use client"` would break the metadata export. This violates Next.js's server/client component architecture and will cause a build-time error. Move all client interactivity to a separate Client Component (`RootShell.tsx` marked with `"use client"`) and import it into the Server Component layout: <details> <summary>Refactor</summary> ```diff // web/app/layout.tsx import type { Metadata } from "next"; import { Inter, JetBrains_Mono, Outfit, Plus_Jakarta_Sans } from "next/font/google"; import "./globals.css"; -import { ThemeProvider } from "@/components/layout/ThemeProvider"; -import { ToastProvider } from "@/components/notifications/ToastProvider"; -import { JarvisProvider } from "@/components/layout/JarvisProvider"; -import { StartupScreen } from "@/components/layout/StartupScreen"; -import { JarvisOrb } from "@/components/ui/JarvisOrb"; -import React, { useState, useEffect } from "react"; -import { AnimatePresence } from "framer-motion"; +import React from "react"; +import { RootShell } from "./RootShell"; @@ export default function RootLayout({ children, }: { children: React.ReactNode; }) { - const [isInitializing, setIsInitializing] = useState(true); - return ( <html lang="en" className="dark h-full w-full overflow-hidden" suppressHydrationWarning> <body className={`${inter.variable} ${jetbrainsMono.variable} ${outfit.variable} ${plusJakartaSans.variable} font-sans antialiased bg-background text-foreground h-full w-full overflow-hidden relative selection:bg-primary/30`}> <div className="quantum-grid fixed inset-0 pointer-events-none opacity-20" /> - <div className="relative z-10 h-full w-full overflow-hidden"> - ... - </div> + <RootShell>{children}</RootShell> </body> </html> ); } ``` ```tsx // web/app/RootShell.tsx "use client"; import React, { useState } from "react"; import { AnimatePresence } from "framer-motion"; import { ThemeProvider } from "@/components/layout/ThemeProvider"; import { ToastProvider } from "@/components/notifications/ToastProvider"; import { JarvisProvider } from "@/components/layout/JarvisProvider"; import { StartupScreen } from "@/components/layout/StartupScreen"; import { JarvisOrb } from "@/components/ui/JarvisOrb"; export function RootShell({ children }: { children: React.ReactNode }) { const [isInitializing, setIsInitializing] = useState(true); return ( <div className="relative z-10 h-full w-full overflow-hidden"> <JarvisProvider> <ThemeProvider> <ToastProvider> <AnimatePresence mode="wait"> {isInitializing ? ( <StartupScreen key="startup" onComplete={() => setIsInitializing(false)} /> ) : ( <div key="main" className="h-full w-full animate-in fade-in duration-700"> {children} <JarvisOrb /> </div> )} </AnimatePresence> </ToastProvider> </ThemeProvider> </JarvisProvider> </div> ); } ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@web/app/layout.tsx` around lines 57 - 76, The layout file exports server-only metadata but also uses client hooks/behavior (useState in RootLayout and AnimatePresence/StartupScreen) which breaks Next.js App Router rules; extract all client-side interactivity into a new client component (e.g., create RootShell.tsx with "use client") that contains the useState, AnimatePresence, StartupScreen logic, JarvisProvider/ThemeProvider/ToastProvider wrappers and JarvisOrb, then import and render <RootShell>{children}</RootShell> from the server RootLayout (leave metadata export and HTML/body markup in the server layout and remove useState/AnimatePresence from RootLayout). ``` </details> </blockquote></details> </blockquote></details>🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Inline comments: In `@ai-platform/backend/app/agents/national_intelligence_agent.py`: - Around line 35-36: Adjust the assignment to the project variable to satisfy flake8 E261 by ensuring there are two spaces before the inline comment on the statement project = options.get("project", "general") and remove the whitespace-only blank line that follows; i.e., edit the line containing project = options.get("project", "general") to have two spaces before the comment (e.g., add an extra space before "# varuna, ...") and delete the trailing whitespace-only line immediately after. - Around line 8-10: The file has only one blank line between the module-level logger assignment and the top-level class, causing flake8 E302; add a second blank line between the logger = structlog.get_logger(__name__) statement and the class NationalIntelligenceAgent(BaseAgent): declaration so there are two blank lines separating module-level declarations from the top-level class; update the spacing around the logger symbol and the NationalIntelligenceAgent class definition accordingly. In `@ai-platform/backend/app/api/v1/routers/multimodal.py`: - Around line 8-13: The endpoint declarations (e.g., the analyze_vision function) violate PEP8 formatting: add spaces around the default argument equals (change current_user: dict=Depends(...) to current_user: dict = Depends(...), and vision_agent=Depends(...) to vision_agent = Depends(...)) and ensure top-level endpoint functions are separated by two blank lines (E302) so each router.post function definition is preceded by the required blank lines; apply the same fixes to the other endpoint blocks noted in the comment. In `@ai-platform/backend/app/api/v1/routers/ranking.py`: - Around line 26-32: The endpoint definitions violate flake8: add spaces around default-argument equals (E252) in decorated functions (e.g., change current_user: dict=Depends(...) to current_user: dict = Depends(...), cluster_coordinator=Depends(...) to cluster_coordinator = Depends(...), intelligence_ranker=Depends(...) to intelligence_ranker = Depends(...)) and ensure E302 by inserting the required blank-line separation before each top-level decorated function (apply this fix to collaborative_investigate and the other router endpoint functions mentioned). In `@ai-platform/backend/app/api/v1/routers/rl.py`: - Around line 9-15: The endpoint function definitions (e.g., submit_feedback) violate flake8 rules: change function parameters from forms like current_user: dict=Depends(get_current_user) and reward_computer=Depends(get_reward_computer) to include spaces around the equals (current_user: dict = Depends(...), reward_computer = Depends(...)) to fix E252, and ensure there is a blank line between top-level function/endpoint definitions (E302) by adding a single blank line separating each endpoint block; apply these fixes to submit_feedback and the other endpoint functions in this router file referenced in the review. In `@ai-platform/backend/app/services/automation/dependency_audit.py`: - Line 5: The import block in dependency_audit.py has a leftover blank line after the Path import was removed; remove the redundant empty line so the remaining imports are contiguous (i.e., edit the top-of-file imports in dependency_audit.py where Path was deleted to delete the extra blank line and keep imports compact). In `@ai-platform/backend/app/services/ingestion/legal_pipeline.py`: - Around line 9-11: The file currently has only a single blank line between the top-level assignment logger = structlog.get_logger(__name__) and the class definition class LegalPipeline, which triggers flake8 E302; fix it by inserting one additional blank line so there are two blank lines separating the top-level statement and the class definition (ensure the extra blank line appears immediately above the class LegalPipeline), then run lint to confirm the E302 violation is resolved. In `@ai-platform/backend/app/services/ni/disaster_service.py`: - Around line 8-11: Add the missing blank line before the top-level class definition to satisfy E302 by ensuring there are two blank lines between the module-level logger assignment (logger = structlog.get_logger(__name__)) and the DisasterService class declaration, and remove any trailing whitespace on the file (address W293 at the line around the end of the file) so no lines end with extraneous spaces. - Around line 13-15: Add an explicit return type annotation "-> None" to DisasterService.__init__ and adjust the method that constructs and returns the "impact" dict (the function that builds the variable named impact around lines 48-60) to return the impact mapping directly instead of returning a wrapped or extra value; update the signature and the return statement in __init__ and replace any unnecessary wrapping/extra return logic so the function that builds impact simply returns the impact dict. In `@ai-platform/backend/tests/test_trained_models.py`: - Around line 44-49: The RL_CKPT class attribute is defined but unused; either remove RL_CKPT or use it consistently: update the skipif decorator and the assertions inside test_checkpoint_exists to reference RL_CKPT instead of repeating (CKPT_DIR / "rl_policy.pt"), e.g. replace (CKPT_DIR / "rl_policy.pt") in the pytest.mark.skipif and both assert lines with RL_CKPT (or delete RL_CKPT and keep the current literals) so the attribute isn't unused; ensure references to rl_training_metrics.json remain correct (use CKPT_DIR / "rl_training_metrics.json" or add a similar class attribute if you prefer consistency). - Around line 84-90: The skipif decorator on the test_checkpoints_exist function uses a different path variable (_BACKEND / "checkpoints") than the test body (self.CKPT_DIR); update the decorator to reference the class attribute used in the test (e.g., TestTrainedModels.CKPT_DIR / "gnn_link_predictor.pt") so the decorator and the test body use the same CKPT_DIR symbol; leave the reason string intact and apply the same change for any other decorators in this file that reference _BACKEND for checkpoint existence checks. In `@CODE_OF_CONDUCT.md`: - Around line 43-45: The Code of Conduct currently references Contributor Covenant "version 1.4" and the old URL; update the document to reference Contributor Covenant v2.1 by replacing the version string "version 1.4" with "version 2.1", update the linked URL to the v2.1 page (and the [homepage] reference) so both the inline citation and the [homepage] link point to the official v2.1 location, and ensure any wording that explicitly mentions v1.4 is adjusted to reflect v2.1. In `@CONTRIBUTING.md`: - Around line 11-15: Align the documented Python requirement with the CI: either update the "Prerequisites" entry under the "### Prerequisites" section in CONTRIBUTING.md (change "Python ≥ 3.13" to "Python ≥ 3.11") or update the GitHub Actions workflow `.github/workflows/modules-ci.yml` to use Python 3.13+ by changing the action's python-version/setup value (the `python-version` key in the workflow) so the CI and the "Python ≥ 3.13" line in CONTRIBUTING.md match. In `@package.json`: - Line 54: Remove the redundant type package: delete the `@types/diff` dependency entry from package.json because you upgraded "diff" to ^9.0.0 which bundles its own types; update package.json to only keep the "diff": "^9.0.0" entry and run npm/yarn install to refresh lockfile so the removed `@types/diff` is no longer installed. In `@REPORT.md`: - Around line 5-10: Update the table header casing by changing the lowercase header "status" to Title Case "Status" in the Markdown table header row (the row containing "Metric | Score | status") so it matches "Metric" and "Score"; locate and edit the header token "status" in REPORT.md to "Status" and keep the rest of the table unchanged. In `@SECURITY.md`: - Line 11: Replace the placeholder email "security@disha.agi" in SECURITY.md with a guaranteed monitored contact (e.g., a real security@ or a dedicated vulnerability-reporting inbox) and/or add an alternate monitored channel (such as a security contact at the organization or an official GitHub Security Policy link); update the line containing "Private Disclosure: Send a detailed report to `security@disha.agi`" to use the actual monitored address and ensure the maintainer DM suggestion remains as an optional fallback. In `@web/app/globals.css`: - Line 76: Add a blank line before the font-feature-settings declaration(s) to satisfy the stylelint rule: locate the font-feature-settings: "rlig" 1, "calt" 1; lines in globals.css (the CSS declaration for font-feature-settings) and insert an empty line immediately above each declaration (both occurrences) so they no longer trigger declaration-empty-line-before violations. In `@web/app/layout.tsx`: - Around line 43-54: The OG/Twitter image path in the metadata block (openGraph and twitter in layout.tsx) points to /docs/images/banner_v5.png which won't be served; either move the asset into the public folder (e.g., public/docs/images/banner_v5.png) so the existing relative path resolves, or set metadataBase and replace the image entries with absolute URLs (https://yourdomain/... ) so openGraph and twitter images resolve correctly; update the openGraph.images and twitter.images entries accordingly. In `@web/package.json`: - Line 30: The lint script in package.json currently calls the removed Next.js wrapper (e.g., the "lint" script entry) so update the "lint" npm script to invoke the ESLint CLI directly by replacing the existing value with a call to the ESLint CLI (for example using npx), and make the same change for the duplicate script entries referenced at lines 42 and 48; ensure the script name remains "lint" and that it runs the ESLint CLI (e.g., npx eslint .) so npm run lint works with Next.js 16. --- Outside diff comments: In `@ai-platform/backend/app/api/v1/routers/websockets.py`: - Around line 7-13: Fix flake8 spacing and top-level separation in the websocket router declarations: add spaces around the equals in the parameter annotations for current_user and alert_manager (change "current_user: dict=Depends(...)" to "current_user: dict = Depends(...)" and similarly for "alert_manager=Depends(...)"), and ensure there is a single blank line separating top-level endpoint function blocks (e.g., before and after async def get_alerts and the other websocket endpoint functions) so E252 and E302 are satisfied; apply the same spacing/blank-line changes to the other endpoint defs in this module as well. In `@ai-platform/backend/app/core/middleware/security.py`: - Around line 9-12: The file currently has no blank line between the module-level logger declaration and the class definition, which triggers E302; insert one additional blank line before the SentinelSecurityMiddleware class declaration (the class named SentinelSecurityMiddleware defined after logger = structlog.get_logger(__name__)) so there are two blank lines separating the top-level statement and the class. In `@ai-platform/backend/app/services/automation/dependency_audit.py`: - Line 9: Add a missing blank line before the top-level class definition to satisfy PEP8: ensure there are two blank lines immediately before the class DependencyAudit declaration (i.e., insert one additional newline above "class DependencyAudit") so flake8 E302 no longer fails. - Line 83: Replace the lexicographic version comparison with semantic version parsing: add an import for packaging.version.parse (e.g., parse_version) and update the conditional that currently checks pkg["version"] != "latest" and pkg["version"] < threat_patterns[name]["min_safe"] to instead parse both pkg["version"] and threat_patterns[name]["min_safe"] with parse_version before comparing (refer to the if that evaluates pkg["version"] and threat_patterns[name]["min_safe"] and the pkg and threat_patterns variables). In `@README.md`: - Around line 100-121: The README has missing blank lines around several headings and fenced code blocks causing markdown rendering issues; edit the README.md to ensure there's a blank line before each heading (e.g., "## 🚀 Installation", "### Prerequisites", "### Quick Start", "### Full Ecosystem Launch") and add blank lines above and below each fenced code block (the ```bash blocks for Quick Start and Full Ecosystem Launch) so headings and code fences are separated from surrounding text. In `@web/app/layout.tsx`: - Around line 57-76: The layout file exports server-only metadata but also uses client hooks/behavior (useState in RootLayout and AnimatePresence/StartupScreen) which breaks Next.js App Router rules; extract all client-side interactivity into a new client component (e.g., create RootShell.tsx with "use client") that contains the useState, AnimatePresence, StartupScreen logic, JarvisProvider/ThemeProvider/ToastProvider wrappers and JarvisOrb, then import and render <RootShell>{children}</RootShell> from the server RootLayout (leave metadata export and HTML/body markup in the server layout and remove useState/AnimatePresence from RootLayout).🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID:
f5a7e524-5535-49f2-adf9-05957dbc27ac⛔ Files ignored due to path filters (1)
docs/images/banner_v5.pngis excluded by!**/*.png📒 Files selected for processing (31)
CHANGELOG.mdCODE_OF_CONDUCT.mdCONTRIBUTING.mdREADME.mdREPORT.mdSECURITY.mdWIKI.mdai-platform/backend/app/agents/national_intelligence_agent.pyai-platform/backend/app/agents/orchestrator.pyai-platform/backend/app/api/v1/routers/multimodal.pyai-platform/backend/app/api/v1/routers/ranking.pyai-platform/backend/app/api/v1/routers/rl.pyai-platform/backend/app/api/v1/routers/websockets.pyai-platform/backend/app/core/middleware/security.pyai-platform/backend/app/models/schemas.pyai-platform/backend/app/services/automation/dependency_audit.pyai-platform/backend/app/services/automation/learning_loop.pyai-platform/backend/app/services/ingestion/legal_pipeline.pyai-platform/backend/app/services/ni/disaster_service.pyai-platform/backend/checkpoints/gnn_training_metrics.jsonai-platform/backend/graph_ai/models.pyai-platform/backend/tests/test_trained_models.pycognitive-engine/agents/deliberation.pypackage.jsonsrc/server/web/public/terminal.cssweb/app/globals.cssweb/app/layout.tsxweb/app/page.tsxweb/components/layout/EliteHero.tsxweb/components/layout/Header.tsxweb/package.json
| logger = structlog.get_logger(__name__) | ||
|
|
||
| class NationalIntelligenceAgent(BaseAgent): |
There was a problem hiding this comment.
Fix flake8 E302 before merge (CI blocker).
Line 10 defines a top-level class with one blank line after module-level declarations; flake8 requires two and the pipeline is currently failing.
Proposed fix
logger = structlog.get_logger(__name__)
+
class NationalIntelligenceAgent(BaseAgent):📝 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.
| logger = structlog.get_logger(__name__) | |
| class NationalIntelligenceAgent(BaseAgent): | |
| logger = structlog.get_logger(__name__) | |
| class NationalIntelligenceAgent(BaseAgent): |
🧰 Tools
🪛 GitHub Actions: AI Platform CI
[error] 10-10: flake8 (E302) expected 2 blank lines, found 1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ai-platform/backend/app/agents/national_intelligence_agent.py` around lines 8
- 10, The file has only one blank line between the module-level logger
assignment and the top-level class, causing flake8 E302; add a second blank line
between the logger = structlog.get_logger(__name__) statement and the class
NationalIntelligenceAgent(BaseAgent): declaration so there are two blank lines
separating module-level declarations from the top-level class; update the
spacing around the logger symbol and the NationalIntelligenceAgent class
definition accordingly.
| project = options.get("project", "general") # varuna, marg-safe, nyaya, setu, raksha | ||
|
|
There was a problem hiding this comment.
Fix flake8 E261 + trailing whitespace in this block (CI blocker).
Line 35 needs at least two spaces before the inline comment, and Line 36 contains whitespace-only content.
Proposed fix
- project = options.get("project", "general") # varuna, marg-safe, nyaya, setu, raksha
-
+ project = options.get("project", "general") # varuna, marg-safe, nyaya, setu, raksha
+📝 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.
| project = options.get("project", "general") # varuna, marg-safe, nyaya, setu, raksha | |
| project = options.get("project", "general") # varuna, marg-safe, nyaya, setu, raksha | |
🧰 Tools
🪛 GitHub Actions: AI Platform CI
[error] 35-35: flake8 (E261) at least two spaces before inline comment
[warning] 36-36: flake8 (W293) blank line contains whitespace
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ai-platform/backend/app/agents/national_intelligence_agent.py` around lines
35 - 36, Adjust the assignment to the project variable to satisfy flake8 E261 by
ensuring there are two spaces before the inline comment on the statement project
= options.get("project", "general") and remove the whitespace-only blank line
that follows; i.e., edit the line containing project = options.get("project",
"general") to have two spaces before the comment (e.g., add an extra space
before "# varuna, ...") and delete the trailing whitespace-only line immediately
after.
| @router.post("/analyze/vision") | ||
| async def analyze_vision( | ||
| request: VisionAnalysisRequest, | ||
| current_user: dict = Depends(get_current_user), | ||
| vision_agent = Depends(get_vision_agent) | ||
| current_user: dict=Depends(get_current_user), | ||
| vision_agent=Depends(get_vision_agent) | ||
| ): |
There was a problem hiding this comment.
Fix endpoint declaration formatting (E252/E302).
Line 11/24/38 currently fail E252 due to missing spaces around =, and these top-level endpoint blocks need E302-compliant separation.
💡 Suggested patch
router = APIRouter()
+
`@router.post`("/analyze/vision")
async def analyze_vision(
request: VisionAnalysisRequest,
- current_user: dict=Depends(get_current_user),
- vision_agent=Depends(get_vision_agent)
+ current_user: dict = Depends(get_current_user),
+ vision_agent = Depends(get_vision_agent),
):
@@
}
return await vision_agent.run(request.target, context)
+
`@router.post`("/analyze/audio")
async def analyze_audio(
request: AudioAnalysisRequest,
- current_user: dict=Depends(get_current_user),
- audio_agent=Depends(get_audio_agent)
+ current_user: dict = Depends(get_current_user),
+ audio_agent = Depends(get_audio_agent),
):
@@
}
return await audio_agent.run(request.target, context)
+
`@router.post`("/analyze/multimodal")
async def analyze_multimodal(
request: MultimodalRequest,
- current_user: dict=Depends(get_current_user),
- orchestrator=Depends(get_orchestrator),
- vision_agent=Depends(get_vision_agent),
- audio_agent=Depends(get_audio_agent),
- multimodal_fusion=Depends(get_multimodal_fusion)
+ current_user: dict = Depends(get_current_user),
+ orchestrator = Depends(get_orchestrator),
+ vision_agent = Depends(get_vision_agent),
+ audio_agent = Depends(get_audio_agent),
+ multimodal_fusion = Depends(get_multimodal_fusion),
):Also applies to: 21-26, 35-43
🧰 Tools
🪛 GitHub Actions: AI Platform CI
[error] 8-8: flake8 (E302) expected 2 blank lines, found 1
[error] 11-11: flake8 (E252) missing whitespace around parameter equals
🪛 Ruff (0.15.10)
[warning] 11-11: Unused function argument: current_user
(ARG001)
[warning] 11-11: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
[warning] 12-12: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ai-platform/backend/app/api/v1/routers/multimodal.py` around lines 8 - 13,
The endpoint declarations (e.g., the analyze_vision function) violate PEP8
formatting: add spaces around the default argument equals (change current_user:
dict=Depends(...) to current_user: dict = Depends(...), and
vision_agent=Depends(...) to vision_agent = Depends(...)) and ensure top-level
endpoint functions are separated by two blank lines (E302) so each router.post
function definition is preceded by the required blank lines; apply the same
fixes to the other endpoint blocks noted in the comment.
| @router.post("/investigate/collaborative") | ||
| async def collaborative_investigate( | ||
| request: CollaborativeRequest, | ||
| current_user: dict = Depends(get_current_user), | ||
| cluster_coordinator = Depends(get_cluster_coordinator), | ||
| intelligence_ranker = Depends(get_intelligence_ranker) | ||
| current_user: dict=Depends(get_current_user), | ||
| cluster_coordinator=Depends(get_cluster_coordinator), | ||
| intelligence_ranker=Depends(get_intelligence_ranker) | ||
| ): |
There was a problem hiding this comment.
Reapply flake8-compliant endpoint formatting.
Line 29/48/59/72/86 fail E252; the decorated top-level function blocks also need E302 blank-line separation.
💡 Suggested patch
cluster_coordinator.register_agent("vision", get_vision_agent(), ["vision", "image"])
cluster_coordinator.register_agent("audio", get_audio_agent(), ["audio", "speech"])
+
`@router.post`("/investigate/collaborative")
async def collaborative_investigate(
request: CollaborativeRequest,
- current_user: dict=Depends(get_current_user),
- cluster_coordinator=Depends(get_cluster_coordinator),
- intelligence_ranker=Depends(get_intelligence_ranker)
+ current_user: dict = Depends(get_current_user),
+ cluster_coordinator = Depends(get_cluster_coordinator),
+ intelligence_ranker = Depends(get_intelligence_ranker),
):
@@
intelligence_ranker.index_entities_from_investigation(result)
return result
+
`@router.get`("/cluster/status")
async def cluster_status(
- current_user: dict=Depends(get_current_user),
- cluster_coordinator=Depends(get_cluster_coordinator)
+ current_user: dict = Depends(get_current_user),
+ cluster_coordinator = Depends(get_cluster_coordinator),
):
@@
if not cluster_coordinator.nodes:
_register_cluster_agents(cluster_coordinator)
return cluster_coordinator.get_cluster_status()
+
`@router.post`("/rankings/entities")
async def get_entity_rankings(
request: RankingRequest,
- current_user: dict=Depends(get_current_user),
- intelligence_ranker=Depends(get_intelligence_ranker)
+ current_user: dict = Depends(get_current_user),
+ intelligence_ranker = Depends(get_intelligence_ranker),
):
@@
)
return {"rankings": rankings, "total": len(rankings)}
+
`@router.get`("/rankings/agents")
async def get_agent_rankings(
- current_user: dict=Depends(get_current_user),
- intelligence_ranker=Depends(get_intelligence_ranker)
+ current_user: dict = Depends(get_current_user),
+ intelligence_ranker = Depends(get_intelligence_ranker),
):
@@
return {
"agent_rankings": intelligence_ranker.get_agent_rankings(),
"metrics": intelligence_ranker.get_metrics(),
}
+
`@router.post`("/rankings/record-outcome")
async def record_agent_outcome(
@@
- current_user: dict=Depends(get_current_user),
- intelligence_ranker=Depends(get_intelligence_ranker)
+ current_user: dict = Depends(get_current_user),
+ intelligence_ranker = Depends(get_intelligence_ranker),
):Also applies to: 46-50, 56-61, 70-74, 81-88
🧰 Tools
🪛 GitHub Actions: AI Platform CI
[error] 26-26: flake8 (E302) expected 2 blank lines, found 1
[error] 29-29: flake8 (E252) missing whitespace around parameter equals
🪛 Ruff (0.15.10)
[warning] 29-29: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
[warning] 30-30: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
[warning] 31-31: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ai-platform/backend/app/api/v1/routers/ranking.py` around lines 26 - 32, The
endpoint definitions violate flake8: add spaces around default-argument equals
(E252) in decorated functions (e.g., change current_user: dict=Depends(...) to
current_user: dict = Depends(...), cluster_coordinator=Depends(...) to
cluster_coordinator = Depends(...), intelligence_ranker=Depends(...) to
intelligence_ranker = Depends(...)) and ensure E302 by inserting the required
blank-line separation before each top-level decorated function (apply this fix
to collaborative_investigate and the other router endpoint functions mentioned).
| @router.post("/feedback") | ||
| async def submit_feedback( | ||
| request: FeedbackRequest, | ||
| current_user: dict = Depends(get_current_user), | ||
| reward_computer = Depends(get_reward_computer), | ||
| policy_network = Depends(get_policy_network) | ||
| current_user: dict=Depends(get_current_user), | ||
| reward_computer=Depends(get_reward_computer), | ||
| policy_network=Depends(get_policy_network) | ||
| ): |
There was a problem hiding this comment.
Restore flake8-compliant spacing/blank lines to unblock CI.
Line 12/38/50 currently violate E252 (param=Depends(...)), and these endpoint blocks also need E302-compliant blank-line separation.
💡 Suggested patch
router = APIRouter()
+
`@router.post`("/feedback")
async def submit_feedback(
request: FeedbackRequest,
- current_user: dict=Depends(get_current_user),
- reward_computer=Depends(get_reward_computer),
- policy_network=Depends(get_policy_network)
+ current_user: dict = Depends(get_current_user),
+ reward_computer = Depends(get_reward_computer),
+ policy_network = Depends(get_policy_network),
):
@@
return {
"feedback_recorded": True,
"reward": round(reward, 4),
"policy_update": update_metrics,
}
+
`@router.get`("/rl/metrics")
async def rl_metrics(
- current_user: dict=Depends(get_current_user),
- reward_computer=Depends(get_reward_computer),
- prompt_optimizer=Depends(get_prompt_optimizer)
+ current_user: dict = Depends(get_current_user),
+ reward_computer = Depends(get_reward_computer),
+ prompt_optimizer = Depends(get_prompt_optimizer),
):
@@
return {
"reward_metrics": reward_computer.get_metrics(),
"prompt_metrics": prompt_optimizer.get_metrics(),
}
+
`@router.post`("/rl/evolve-prompts")
async def evolve_prompts(
- current_user: dict=Depends(get_current_user),
- prompt_optimizer=Depends(get_prompt_optimizer)
+ current_user: dict = Depends(get_current_user),
+ prompt_optimizer = Depends(get_prompt_optimizer),
):Also applies to: 36-41, 48-52
🧰 Tools
🪛 GitHub Actions: AI Platform CI
[error] 9-9: flake8 (E302) expected 2 blank lines, found 1
[error] 12-12: flake8 (E252) missing whitespace around parameter equals
🪛 Ruff (0.15.10)
[warning] 12-12: Unused function argument: current_user
(ARG001)
[warning] 12-12: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
[warning] 13-13: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
[warning] 14-14: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ai-platform/backend/app/api/v1/routers/rl.py` around lines 9 - 15, The
endpoint function definitions (e.g., submit_feedback) violate flake8 rules:
change function parameters from forms like current_user:
dict=Depends(get_current_user) and reward_computer=Depends(get_reward_computer)
to include spaces around the equals (current_user: dict = Depends(...),
reward_computer = Depends(...)) to fix E252, and ensure there is a blank line
between top-level function/endpoint definitions (E302) by adding a single blank
line separating each endpoint block; apply these fixes to submit_feedback and
the other endpoint functions in this router file referenced in the review.
| | Metric | Score | status | | ||
| |--------|-------|--------| | ||
| | **Repo Health** | 98/100 | ⚡ ELITE | | ||
| | **Security Score** | 95/100 | 🛡️ SECURE | | ||
| | **Performance Score** | 92/100 | 🚀 OPTIMIZED | | ||
| | **Production Readiness** | 90/100 | ✅ READY | |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Minor: Inconsistent table header casing.
The "status" column header uses lowercase while other column headers use Title Case ("Metric", "Score").
✏️ Fix table header casing
-| Metric | Score | status |
+| Metric | Score | Status |📝 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.
| | Metric | Score | status | | |
| |--------|-------|--------| | |
| | **Repo Health** | 98/100 | ⚡ ELITE | | |
| | **Security Score** | 95/100 | 🛡️ SECURE | | |
| | **Performance Score** | 92/100 | 🚀 OPTIMIZED | | |
| | **Production Readiness** | 90/100 | ✅ READY | | |
| | Metric | Score | Status | | |
| |--------|-------|--------| | |
| | **Repo Health** | 98/100 | ⚡ ELITE | | |
| | **Security Score** | 95/100 | 🛡️ SECURE | | |
| | **Performance Score** | 92/100 | 🚀 OPTIMIZED | | |
| | **Production Readiness** | 90/100 | ✅ READY | |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@REPORT.md` around lines 5 - 10, Update the table header casing by changing
the lowercase header "status" to Title Case "Status" in the Markdown table
header row (the row containing "Metric | Score | status") so it matches "Metric"
and "Score"; locate and edit the header token "status" in REPORT.md to "Status"
and keep the rest of the table unchanged.
|
|
||
| We strongly encourage responsible disclosure. If you find a security vulnerability, please do NOT open a public issue. Instead, follow this process: | ||
|
|
||
| 1. **Private Disclosure:** Send a detailed report to `security@disha.agi` (placeholder) or direct message the maintainer [@Tashima-Tarsh](https://github.com/Tashima-Tarsh). |
There was a problem hiding this comment.
Replace the placeholder vulnerability contact with a guaranteed monitored channel.
Line 11 still labels the email as a placeholder, which makes the disclosure path unreliable.
📄 Suggested documentation fix
-1. **Private Disclosure:** Send a detailed report to `security@disha.agi` (placeholder) or direct message the maintainer [`@Tashima-Tarsh`](https://github.com/Tashima-Tarsh).
+1. **Private Disclosure:** Send a detailed report to `security@disha.agi` or open a private report via GitHub Security Advisories (if enabled for this repository).📝 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.
| 1. **Private Disclosure:** Send a detailed report to `security@disha.agi` (placeholder) or direct message the maintainer [@Tashima-Tarsh](https://github.com/Tashima-Tarsh). | |
| 1. **Private Disclosure:** Send a detailed report to `security@disha.agi` or open a private report via GitHub Security Advisories (if enabled for this repository). |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@SECURITY.md` at line 11, Replace the placeholder email "security@disha.agi"
in SECURITY.md with a guaranteed monitored contact (e.g., a real security@ or a
dedicated vulnerability-reporting inbox) and/or add an alternate monitored
channel (such as a security contact at the organization or an official GitHub
Security Policy link); update the line containing "Private Disclosure: Send a
detailed report to `security@disha.agi`" to use the actual monitored address and
ensure the maintainer DM suggestion remains as an optional fallback.
| } | ||
| body { | ||
| @apply bg-background text-foreground; | ||
| font-feature-settings: "rlig" 1, "calt" 1; |
There was a problem hiding this comment.
Fix stylelint declaration-empty-line-before violations.
Line 76 and Line 94 violate the configured rule and may fail style checks.
✅ Minimal lint-only fix
body {
`@apply` bg-background text-foreground;
+
font-feature-settings: "rlig" 1, "calt" 1;
}
@@
.text-brand-gradient {
`@apply` bg-clip-text text-transparent;
+
background-image: var(--gradient-aurora);
}Also applies to: 94-94
🧰 Tools
🪛 Stylelint (17.7.0)
[error] 76-76: Expected empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/app/globals.css` at line 76, Add a blank line before the
font-feature-settings declaration(s) to satisfy the stylelint rule: locate the
font-feature-settings: "rlig" 1, "calt" 1; lines in globals.css (the CSS
declaration for font-feature-settings) and insert an empty line immediately
above each declaration (both occurrences) so they no longer trigger
declaration-empty-line-before violations.
| openGraph: { | ||
| title: "DISHA v5.0.0 | Autonomous Cognitive AGI", | ||
| description: "The world-class 7-layer AGI platform for intelligence and defense.", | ||
| images: ["/docs/images/banner_v5.png"], | ||
| type: "website", | ||
| }, | ||
| twitter: { | ||
| card: "summary_large_image", | ||
| title: "DISHA v5.0.0 | AGI Ecosystem", | ||
| description: "Empowering the top 1% organizations with cognitive decision systems.", | ||
| images: ["/docs/images/banner_v5.png"], | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if banner image exists and where
fd -i "banner_v5.png"
# Check metadata URL base/image configuration
rg -n "metadataBase|openGraph|twitter|banner_v5\\.png" web/app/layout.tsxRepository: Tashima-Tarsh/Disha
Length of output: 216
🏁 Script executed:
# Check the metadataBase configuration in layout.tsx
head -50 web/app/layout.tsx | cat -n
# Check if there's a next.config.js or next.config.ts with custom static paths
fd -i "next.config" | head -5
# Check if docs/ directory has any special configuration
ls -la docs/ 2>/dev/null || echo "docs directory details not available"Repository: Tashima-Tarsh/Disha
Length of output: 3006
🏁 Script executed:
# Check the web/next.config.ts for any custom static serving
cat web/next.config.ts
# Check full metadata export including metadataBase
sed -n '39,60p' web/app/layout.tsx | cat -n
# Check if there's a public directory
ls -la web/public/ 2>/dev/null | head -20 || echo "public directory check"Repository: Tashima-Tarsh/Disha
Length of output: 2337
Fix social metadata image path: image will not be publicly accessible.
Lines 46 and 53 reference /docs/images/banner_v5.png, but the docs/ directory is not publicly served. Next.js serves static assets only from the public/ directory; this path will resolve to https://domain.com/docs/images/banner_v5.png which will 404. Additionally, no metadataBase is defined, preventing proper absolute URL generation for OG/Twitter metadata.
Move the image to public/docs/images/banner_v5.png or set metadataBase in metadata and use the full absolute URL.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/app/layout.tsx` around lines 43 - 54, The OG/Twitter image path in the
metadata block (openGraph and twitter in layout.tsx) points to
/docs/images/banner_v5.png which won't be served; either move the asset into the
public folder (e.g., public/docs/images/banner_v5.png) so the existing relative
path resolves, or set metadataBase and replace the image entries with absolute
URLs (https://yourdomain/... ) so openGraph and twitter images resolve
correctly; update the openGraph.images and twitter.images entries accordingly.
| "lucide-react": "^1.8.0", | ||
| "nanoid": "^5.1.7", | ||
| "next": "^16.2.3", | ||
| "next": "^16.3.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
For Next.js 16.3.0, what are the required migration steps from Next.js 15, and is next lint still the recommended lint command?
💡 Result:
The required migration steps from Next.js 15 to Next.js 16.3.0 (latest patch in 16.x series as of 2026-04-15, with no additional breaking changes beyond initial 16.0) are primarily handled by the official codemod tool. Run npx @next/codemod@canary upgrade latest (or equivalent with pnpm/yarn/bun). This automates: - Updating next.config.js for Turbopack (now default and stable for next dev/build). - Migrating deprecated middleware.ts to proxy.ts (rename file and exported function). - Removing unstable_ prefixes from stabilized APIs. - Migrating async Request APIs (cookies, headers, draftMode, searchParams in page.js, etc.) which are now fully async (synchronous access removed). - Updating dependencies: next@latest, react@latest, react-dom@latest, @types/react, @types/react-dom (if using TypeScript). Manual checks post-codemod: - Ensure Node.js >=20.9.0 (18 no longer supported), TypeScript >=5.1.0. - Update browsers support if needed (Chrome 111+, etc.). - Test for PPR changes (experimental flag removed, behavior updated). - Validate caching with new Cache Components and APIs like updateTag. - Run npm run lint (now ESLint CLI), npx tsc --noEmit, npm run build, and full app testing. next lint is NOT the recommended lint command anymore. The codemod migrates from next lint to the ESLint CLI directly (e.g., npx eslint .). next lint has been removed/deprecated in Next.js 16.
Citations:
- 1: https://nextjs.org/docs/app/guides/upgrading
- 2: https://nextjs.org/docs/app/guides/upgrading/version-16
- 3: https://nextjs.org/blog/next-16
- 4: https://github.com/vercel/next.js/releases/tag/v16.2.0
- 5: https://nextjs.org/blog/next-16-2
- 6: https://www.salmanizhar.com/blog/nextjs-16-migration-guide
- 7: https://www.npmjs.com/package/next/v/16.2.2
🏁 Script executed:
sed -n '25,50p' web/package.jsonRepository: Tashima-Tarsh/Disha
Length of output: 797
🏁 Script executed:
cat -n web/package.json | grep -A 20 '"scripts"'Repository: Tashima-Tarsh/Disha
Length of output: 943
Update lint script for Next.js 16 compatibility.
The lint script uses deprecated next lint which was removed in Next.js 16. Update line 9 to use the ESLint CLI directly:
"lint": "npx eslint ."
This must be fixed before the Next.js 16.3.0 upgrade takes effect, otherwise npm run lint will fail.
Also applies to: 42-42, 48-48
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/package.json` at line 30, The lint script in package.json currently calls
the removed Next.js wrapper (e.g., the "lint" script entry) so update the "lint"
npm script to invoke the ESLint CLI directly by replacing the existing value
with a call to the ESLint CLI (for example using npx), and make the same change
for the duplicate script entries referenced at lines 42 and 48; ensure the
script name remains "lint" and that it runs the ESLint CLI (e.g., npx eslint .)
so npm run lint works with Next.js 16.
Pull Request
Summary
Type of Change
Component(s) Affected
src/)ai-platform/)cyber-defense/)historical-strategy/)quantum-physics/)integrations/)mcp-server/)Testing
Checklist
bun run lint/flake8passes)Related Issues
Summary by CodeRabbit
New Features
Documentation
Style