Skip to content

Implement modular src architecture with core engine, AI responders, middleware, frontend, and tests#18

Merged
Mohammed-coder-dev merged 1 commit intomainfrom
codex/implement-project-architecture-structure
Feb 6, 2026
Merged

Implement modular src architecture with core engine, AI responders, middleware, frontend, and tests#18
Mohammed-coder-dev merged 1 commit intomainfrom
codex/implement-project-architecture-structure

Conversation

@Mohammed-coder-dev
Copy link
Owner

Motivation

  • Provide the requested project layout under 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.
  • Ensure the assistant enforces a compliance-first routing (strict vs normal) and allows a safe local fallback responder while keeping an LLM responder scaffold for future integration.

Description

  • Added a modular Express app factory (createApp) in app.js and a small startup entry in server.js, and mounted API routes from src/api/routes.js with controllers in src/api/controllers.js.
  • Implemented core engine and safety pipeline in src/core/ including engine.js, policy.js, validator.js, and riskLabeler.js, with runEngine wiring validation, lane detection, risk labeling, prompt building, and responder selection.
  • Added AI prompt builder and responder implementations in src/ai/ with prompts.js, a localResponder (safe, KB-backed fallback) and a scaffolded llmResponder placeholder.
  • Added data artifacts in src/data/ (knowledge.json, sources.json, disclaimers.json) and simple middleware in src/middleware/ (auth.js, rateLimit.js, logging.js).
  • Implemented small static frontend pages in src/frontend/ and lightweight styles, plus configuration files in src/config/ (env.js, vercel.js).
  • Added unit tests under src/tests/ for policy detection, validator, and engine (policy.test.js, validator.test.js, engine.test.js).
  • Updated package.json scripts to run tests from src/tests and updated README.md to document the new layout and run commands.
  • The llmResponder is intentionally scaffolded as a placeholder; the engine defaults to the local responder path unless mode: 'llm' is selected.

Testing

  • Executed unit tests via node --test src/tests/*.test.js; all tests in src/tests passed (6/6).
  • Attempted npm install but it failed in this environment due to npm registry access returning 403 Forbidden, which prevented dependency installation.
  • Attempted npm start but the server could not be started because dependencies were not installed (missing express), as a result of the npm install failure.

Codex Task

@vercel
Copy link

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
oman-x Ready Ready Preview, Comment Feb 6, 2026 1:52am

@Mohammed-coder-dev Mohammed-coder-dev merged commit 7dcd456 into main Feb 6, 2026
2 of 3 checks passed
@Mohammed-coder-dev Mohammed-coder-dev deleted the codex/implement-project-architecture-structure branch February 7, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant