Files
serena/.serena/memories/project_structure.md
T
Dominik Jain 6707cd9b7e Introduce component-based licensing: Serena GPL-3.0-or-later, SolidLSP MIT
The repository is licensed per component. SolidLSP (src/solidlsp,
test/solidlsp, test/resources) remains MIT-licensed and independently
reusable; the Serena application (src/serena, src/interprompt, scripts,
test/serena, docs) is licensed under GPL-3.0-or-later starting with the v2
licensing transition. The change is not retroactive: all releases and
commits up to v1.7.0 / 74c38a65 (tag mit-final) remain available under MIT.

Since MIT is GPL-compatible, a distribution combining both (such as the
serena-agent package) is as a whole subject to GPL-3.0-or-later, while the
SolidLSP files themselves stay MIT and can be extracted and used separately
under MIT terms. The distribution metadata therefore declares
GPL-3.0-or-later, with both license texts shipped alongside it.

Serena originally began under the GPL (v2) and was switched to MIT in
May 2025 following community requests. We consider that change a mistake;
the substantial changes in v2 make this the appropriate time to revert it.
We want the best version of Serena to remain free.

Changes:
* LICENSE is now the licensing overview; canonical license texts live in
  LICENSES/ (MIT.txt is the previous LICENSE verbatim, GPL-3.0-or-later.txt
  is the unmodified FSF text)
* pyproject.toml declares the PEP 639 license expression
  "GPL-3.0-or-later" and bundles LICENSE and LICENSES/* as license files;
  the deprecated MIT classifier is dropped and flake.nix declares gpl3Plus;
  README has per-component license badges and a License section
* SPDX-License-Identifier headers in all Python sources under src/ and
  scripts/, added by the new idempotent scripts/add_spdx_headers.py, which
  gen_prompt_factory.py also uses to keep the header on the generated
  module; existing third-party notices are preserved
* CLA.md: Contributor License Agreement (contributor retains copyright;
  grants a perpetual, irrevocable license including relicensing under any
  terms, incl. proprietary/commercial; patent grant; authority
  representations), to be enforced repository-wide via cla-assistant.io
* CONTRIBUTING.md, PR template and a new docs page explain the licensing
  boundary and the CLA workflow
2026-09-14 21:33:18 +02:00

2.4 KiB

Serena — Project Core

Serena is an MCP-based "IDE for coding agents": semantic code retrieval/editing/refactoring tools driven by language servers.

Source map

  • src/serena/ — agent, MCP server, tools, project/config layer
    • agent.py, mcp.py, project_server.py, cli.py, hooks.py — entrypoints/wiring
    • tools/ — tool implementations (memory_tools, symbol_tools, file_tools, workflow_tools, query_project_tools, config_tools, cmd_tools, jetbrains_tools)
    • tools/tools_base.py — base classes for all tools
    • config/ — serena_config.py, context_mode.py, client_setup.py
    • resources/config/contexts/*.yml, resources/config/modes/*.yml — context/mode definitions
    • code_editor.py, symbol.py, ls_manager.py — symbolic editing / LS lifecycle
    • dashboard.py, gui_log_viewer.py — web dashboard / log viewer
    • prompt_factory.py + generated/generated_prompt_factory.py — prompts (regenerate with scripts/gen_prompt_factory.py)
  • src/solidlsp/ — LSP client framework; per-language servers under language_servers/
  • src/interprompt/ — prompt template library (synced from external repo; see .syncCommitId.*)
  • test/serena/, test/solidlsp/<lang>/ — pytest suites; per-language tests gated by pytest markers
  • test/resources/repos/<lang>/ — fixture projects used by language-server tests
  • scripts/ — utilities (prompt regen, tool overview, profiling, agno agent)
  • docs/ — Jupyter Book sources; build via poe doc-build

Project-wide invariants

  • Package name (PyPI): serena-agent; Wheel includes serena, interprompt, solidlsp.
  • Python: >=3.11, <3.15. Dependencies are exact-pinned in pyproject.toml (uvx installs from git, lockfile ignored — pin exactly).
  • Entry points: serena → serena.cli:top_level; serena-hooks → serena.hooks:hook_commands.
  • Licensing is per component (authoritative overview: LICENSE; texts in LICENSES/): src/solidlsp, test/solidlsp, test/resources → MIT; everything else (incl. src/interprompt, scripts, test/serena) → GPL-3.0-or-later. Never change SolidLSP's MIT status. New .py files under src//scripts/ get a # SPDX-License-Identifier: <id> line (after the module docstring); scripts/add_spdx_headers.py adds missing ones idempotently and is invoked by gen_prompt_factory.py. Contributions require the CLA (CLA.md, enforced via cla-assistant.io).