Skip to content

docs(code-design): services see MessengerTraits and import nothing from cli/ - #242

Merged
leemour merged 1 commit into
mainfrom
docs/code-design-layers
Oct 15, 2026
Merged

leemour merged 1 commit into
mainfrom
docs/code-design-layers

Conversation

@leemour

@leemour leemour commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Updates the Code design page in English, Russian and Spanish to match cli-core #1281 (re-review step 4).

  • Layers table: ports/ now holds the adapter contract, traits.ts (what a service reads of the messenger) and app.ts. Services, plus replies/, attachments/, moderation/, models/ and analysis/, may not import cli/. domain/ is described as almost the bottom, since it still reads two types from search/ and the task kinds from tasks/.
  • The descriptor: services see the 14 fields of MessengerTraits; Messenger adds the parts only the CLI uses.
  • servicesFor: it builds the services per command run and per MCP call, not once. The old line that commands and MCP always give the same answer is replaced by: both call the same service functions.
  • Convention 2 is rewritten: a use case takes the narrowest dependency it needs. Measured on cli-core main, 25 of 87 service files take only the store and 36 take ServiceDeps.
  • Limits: "services still know a little about the CLI" is replaced by the limit that remains. connect, accountOf, guard and diagnose still take a commander Command.
  • The "new front end" row no longer says that the helpers in cli/ move with it.

Checks:

  • pnpm docs:lint and pnpm ci:quick pass. I did not run check:links locally: it needs a full site build (out/). The one new link points to src/ports/traits.ts at cli-core 80616b38.
  • All 5 Mermaid blocks on each page render with beautiful-mermaid.

🤖 Generated with Claude Code

…om cli/

cli-core #1281 moved the service layers off src/cli/. The page now says so
in EN, RU and ES:
- ports/ holds traits.ts and app.ts beside the adapter contract; services
  and the layers beside them may not import cli/.
- domain/ is almost the bottom: two types from search/, task kinds from tasks/.
- servicesFor builds per command run and per MCP call, not once.
- Convention 2: a use case takes the narrowest dependency it needs; 25 of 87
  service files take only the store, 36 take ServiceDeps.
- The limit about services knowing the CLI is replaced by the one left:
  connect/accountOf/guard/diagnose take a commander Command.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour
leemour merged commit f5d3df7 into main Oct 15, 2026
2 checks passed
@leemour
leemour deleted the docs/code-design-layers branch October 15, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant