Implement modular src architecture with core engine, AI responders, middleware, frontend, and tests#18
Merged
Mohammed-coder-dev merged 1 commit intomainfrom Feb 6, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
src/with clear separation between API, core logic, AI layers, data, middleware, frontend, config, and tests to make the codebase easier to extend and audit.strictvsnormal) and allows a safe local fallback responder while keeping an LLM responder scaffold for future integration.Description
createApp) inapp.jsand a small startup entry inserver.js, and mounted API routes fromsrc/api/routes.jswith controllers insrc/api/controllers.js.src/core/includingengine.js,policy.js,validator.js, andriskLabeler.js, withrunEnginewiring validation, lane detection, risk labeling, prompt building, and responder selection.src/ai/withprompts.js, alocalResponder(safe, KB-backed fallback) and a scaffoldedllmResponderplaceholder.src/data/(knowledge.json,sources.json,disclaimers.json) and simple middleware insrc/middleware/(auth.js,rateLimit.js,logging.js).src/frontend/and lightweight styles, plus configuration files insrc/config/(env.js,vercel.js).src/tests/for policy detection, validator, and engine (policy.test.js,validator.test.js,engine.test.js).package.jsonscripts to run tests fromsrc/testsand updatedREADME.mdto document the new layout and run commands.llmResponderis intentionally scaffolded as a placeholder; the engine defaults to the local responder path unlessmode: 'llm'is selected.Testing
node --test src/tests/*.test.js; all tests insrc/testspassed (6/6).npm installbut it failed in this environment due to npm registry access returning403 Forbidden, which prevented dependency installation.npm startbut the server could not be started because dependencies were not installed (missingexpress), as a result of thenpm installfailure.Codex Task