Summary
Restructure the application by moving root-level files (config.yaml & index.js) into 'src' and organizing the codebase around discrete backends.
Motivation
The current structure has config.yaml and index.js at the project root alongside the src/ directory, creating an inconsistent layout. Moving these files into src/ and organizing around discrete backends will improve code organization, make the project structure more maintainable, and align with the project's architecture.
Proposed Solution
- Move
config.yaml from project root into src/config/
- Move
index.js from project root into src/
- Update all import paths and references accordingly
- Update Dockerfile and build scripts to reflect new structure
Alternatives Considered
Keeping files at root level but adding documentation — rejected as it doesn't solve the structural inconsistency.
OpenSpec Note
This project uses OpenSpec for feature development. If this request is approved, I will:
- Run
/opsx:propose to generate a full proposal with specs and tasks
- Iterate on the design before any code is written
- Follow the task-driven implementation workflow
Additional Context
Current root files:
config.yaml (1.7KB)
index.js (11.6KB)
Existing src/ structure includes: agent, config, logger, memory, provider, sandbox, scheduler, session, skills, telemetry, tools, tui, workspace
Audit Findings (for Issue #630)
- src/config/loader.js:12 — Hardcoded path
join(PROJECT_ROOT, "../../config.yaml") assumes config.yaml is at project root. Moving config.yaml to src/config/ would simplify this to join(PROJECT_ROOT, "config.yaml").
- Dockerfile:13,41 —
COPY config.yaml ./ copies from project root. Would need to change to COPY src/config.yaml ./src/ or similar.
- package.json:27,29 —
"index.js" and "config.yaml" listed in files/exports. Both would need path updates.
- package.json:38,39,41 —
"main": "index.js", "bin": "index.js", and "start": "node index.js --mode interactive" all reference root index.js. Would need to point to src/index.js or equivalent.
- Dockerfile:26 — Entrypoint script references
index.js directly in /app. Would need update to match new path.
- src/tui/contextTokens.js:6 — Comment references config.yaml (cosmetic, but should be updated).
- src/session/checkpointer.js:5 — JSDoc references config.yaml (cosmetic).
- src/agent/backends/coreBackend.js, contextBackend.js — Use relative imports from src/ — moving root files into src/ may affect their import chains.
- src/workspace/loadAgents.js — Uses relative path traversal (
../..) — restructuring may simplify or complicate these paths depending on final layout.
Key impact areas:
- Dockerfile COPY commands and entrypoint (2 files, 4 lines)
- package.json main/bin/start/config references (4 lines)
- src/config/loader.js config path resolution (1 critical line)
- Any external consumers referencing root index.js (npm package entry point)
Summary
Restructure the application by moving root-level files (config.yaml & index.js) into 'src' and organizing the codebase around discrete backends.
Motivation
The current structure has config.yaml and index.js at the project root alongside the src/ directory, creating an inconsistent layout. Moving these files into src/ and organizing around discrete backends will improve code organization, make the project structure more maintainable, and align with the project's architecture.
Proposed Solution
config.yamlfrom project root intosrc/config/index.jsfrom project root intosrc/Alternatives Considered
Keeping files at root level but adding documentation — rejected as it doesn't solve the structural inconsistency.
OpenSpec Note
This project uses OpenSpec for feature development. If this request is approved, I will:
/opsx:proposeto generate a full proposal with specs and tasksAdditional Context
Current root files:
config.yaml(1.7KB)index.js(11.6KB)Existing
src/structure includes: agent, config, logger, memory, provider, sandbox, scheduler, session, skills, telemetry, tools, tui, workspaceAudit Findings (for Issue #630)
join(PROJECT_ROOT, "../../config.yaml")assumes config.yaml is at project root. Moving config.yaml to src/config/ would simplify this tojoin(PROJECT_ROOT, "config.yaml").COPY config.yaml ./copies from project root. Would need to change toCOPY src/config.yaml ./src/or similar."index.js"and"config.yaml"listed in files/exports. Both would need path updates."main": "index.js","bin": "index.js", and"start": "node index.js --mode interactive"all reference root index.js. Would need to point tosrc/index.jsor equivalent.index.jsdirectly in/app. Would need update to match new path.../..) — restructuring may simplify or complicate these paths depending on final layout.Key impact areas: