Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
c25c7dc
add AI settings for roo
Rexarrior Aug 3, 2025
28cd652
update development settings
Rexarrior Aug 4, 2025
b95ee61
Merge branch 'userver-framework:develop' into ai-setup
Rexarrior Aug 4, 2025
c5319c9
cc userver: rename kIsDetected to IsDetected
TTPO100AJIEX Aug 5, 2025
4d72584
feat grpc: upd functional_tests/middleware_client, add retry count check
kpavlov00 Aug 5, 2025
7d45eb0
feat redis: add logs for CLUSTER SLOT parsing errors
apolukhin Aug 5, 2025
ae6f448
extreme config
Rexarrior Aug 5, 2025
cbdb7f4
feat grpc: add empty proto structs generation
ArkadyRudenko Aug 5, 2025
aa7a6de
cc core: better HttpRequest docs
ArkadyRudenko Aug 5, 2025
3b6ef19
feat proto-struct: add child directory
ArkadyRudenko Aug 6, 2025
feb7e51
feat universal: work with multiple string_views in crypto
apolukhin Aug 6, 2025
8a0e54d
feat core: add the core of the transaction tracker
Aug 6, 2025
d0f603d
fix grpc: fix test DeadlineStatsTests.ClientDeadlineUpdated
kpavlov00 Aug 6, 2025
9e183a2
bug websocket: properly mask received frames
Aug 6, 2025
703b5fc
feat grpc: introduce UnaryCall with retries
kpavlov00 Aug 6, 2025
deb7c48
cc core: rm static_cast
ArkadyRudenko Aug 7, 2025
4554533
feat proto-structs: generate enums and basic fields
Anton3 Aug 7, 2025
20a8651
bug docs: fix building dynamic config pages
apolukhin Aug 7, 2025
6ed2dc2
fix build: bump macos python
fdr400 Aug 7, 2025
e1b4eaf
feat kafka: support SSL authentication
Aug 7, 2025
670c736
feat core: non blocking receive for TLS wrapper
Aug 7, 2025
b59618a
fix grpc: fix UnaryCall::GetContext::GetSpan race
kpavlov00 Aug 7, 2025
879a38f
feat grpc: support UnaryCall TryCancel
kpavlov00 Aug 9, 2025
d79efdf
fix grpc: fix CallContext::GetClientContext safety
kpavlov00 Aug 9, 2025
2417833
feat redis: log cluster topology changes
apolukhin Aug 11, 2025
d3b50d1
feat ci: update ci-conan.yml to test on pure environment without addi…
apolukhin Aug 11, 2025
bc47547
update
Rexarrior Aug 11, 2025
63a12ab
move out extreme config
Rexarrior Aug 11, 2025
b0bb433
fix grpc: correct CallContext::GetClientContext invariants
kpavlov00 Aug 11, 2025
7dda7ed
refactor grpc: add ResponseFuture::Cancel
kpavlov00 Aug 11, 2025
a90e3bb
feat core: introduce USERVER_ENABLE_STACK_USAGE_MONITOR
segoon Aug 11, 2025
6672841
feat chaotic: x-taxi-handler-codegen
segoon Aug 11, 2025
731a201
feat chaotic: support $ref to $ref in oneOf
segoon Aug 12, 2025
726d0ae
feat chaotic: honour operationId
segoon Aug 12, 2025
e64447c
feat chaotic: compile schemaless files too
segoon Aug 12, 2025
3d4eaaf
feat chaotic: support x-taxi-middleware in swagger
segoon Aug 12, 2025
65ed9d2
feat grpc: append RpcType to StaticServiceMetadata
kpavlov00 Aug 12, 2025
2e1a9b5
feat userver: support in uPg parse cpp enum to pg text
Aug 12, 2025
d1ee9fb
feat proto-structs: add include bundles
Anton3 Aug 12, 2025
de82315
feat chaotic: support x-taxi-cpp-type: storages::postgres::*
segoon Aug 13, 2025
449b385
feat chaotic: ignore x-taxi-py3
segoon Aug 13, 2025
b678723
feat chaotic: ignore x-taxi-go-*
segoon Aug 13, 2025
9e7e67c
feat chaotic: support in: body from swagger 2.0
segoon Aug 13, 2025
1df11a0
feat chaotic: ignore x-taxi-handler-tag for client
segoon Aug 13, 2025
d599f12
feat chaotic: implement title
segoon Aug 13, 2025
2c46cee
feat chaotic: std::intXX_t
segoon Aug 13, 2025
61b320e
feat proto-structs: settle directory hierarchy for tests
Aug 13, 2025
a16f2fd
feat chaotic: use full path in generated files
segoon Aug 13, 2025
544977d
feat chaotic: implement x-taxi-cpp-name in parameters
segoon Aug 13, 2025
67ef6f3
feat clients: allow overriding Plugin list in codegen clients
Aug 13, 2025
2c6a8cc
feat cmake: drop unsupported python versions < 3.9
segoon Aug 13, 2025
96cb7fb
feat userver: add trx tracker global disabler
Aug 14, 2025
73c19da
feat chaotic: better error msg in translator
segoon Aug 14, 2025
427376b
cc chaotic: eliminate dead code
segoon Aug 14, 2025
965216a
feat chaotic: implement PEP 585
segoon Aug 14, 2025
cb8c14d
feat docs: add SlugKit logo and fix minor issues with links
apolukhin Aug 14, 2025
38bda28
feat proto-structs: add basic support for oneof fields
Anton3 Aug 14, 2025
656aca5
feat chaotic: handle non-string headers in responses
segoon Aug 14, 2025
c92828c
feat chaotic: support "x-usrv-" tags
segoon Aug 14, 2025
3d3b346
feat chaotic: x-taxi-middlewares.eats: v1
segoon Aug 15, 2025
d516714
feat userver/ydb: make ydb transaction name a literal string
Aug 15, 2025
67ed832
feat userver: add CheckNoTransactions to codegen http handles
Aug 15, 2025
c73c5f3
feat chaotic: use Ref class for $ref parsing
segoon Aug 15, 2025
9bee08e
feat chaotic: support nullable oneOf
segoon Aug 15, 2025
b0be345
feat userver/configs: add prepared_statements_enabled field to comman…
Aug 15, 2025
b5c8297
fix client: pass location in Request::perform
Aug 15, 2025
35eb829
feat userver/proto-structs: implement the library part of proto structs
Aug 15, 2025
d92a737
feat grpc: support Streaming method retries
kpavlov00 Aug 15, 2025
05c2ded
cc uservices: enable templates & namespaces readability-identifier-na…
TTPO100AJIEX Aug 15, 2025
e5c62d3
fix grpc: drop excessive info log
kpavlov00 Aug 15, 2025
79b9598
cc grpc: fix tracing_metadata test
ArkadyRudenko Aug 18, 2025
56e971e
bug chaotic: do not fail with -DUSERVER_CHAOTIC_FORMAT:BOOL=OFF
segoon Aug 18, 2025
7ed85ff
bug crypto: const-time signature check
segoon Aug 18, 2025
36294df
feat chaotic: implement 'x-taxi-query-log-mode: hide'
segoon Aug 18, 2025
3604203
cc uservices: enable Class, Struct, Enum & Union readability-identifi…
TTPO100AJIEX Aug 18, 2025
f35657f
cc userver: remove default_ns namespace
TTPO100AJIEX Aug 18, 2025
99f4235
feat cmake: by-components cpack install
segoon Aug 18, 2025
0844ed3
feat chaotic: implement x-taxi-cpp-type: userver::utils::StrongTypedef<>
segoon Aug 18, 2025
6ce912f
feat chaotic: implement type: file
segoon Aug 18, 2025
5f34973
cc chaotic: deduplicate tests code
segoon Aug 18, 2025
936e091
feat core: speed up periodic_task.hpp
segoon Aug 18, 2025
034c468
bug chaotic: fix boost::uuid inside std::unordered_set
segoon Aug 18, 2025
c9e6769
fix proto-structs: minor fixes for oneof codegen
Anton3 Aug 18, 2025
ec95578
feat chaotic: implement bank-authproxy
segoon Aug 18, 2025
bc8fe3d
bug websockets: fix UB
Aug 19, 2025
db2a0db
feat cmake: include intercomponent install dependencies
segoon Aug 19, 2025
ebd151f
feat chaotic: add test to invalid $ref
segoon Aug 19, 2025
6e19ad9
cc chaotic: document middlewares
segoon Aug 20, 2025
d09df90
cc proto-structs: add more tests for oneof
Anton3 Aug 20, 2025
534f219
cc proto-structs: clean up InheritsFromInstantiation implementation
Anton3 Aug 20, 2025
70ae971
feat userver: add service start-ms metric
Aug 20, 2025
ce5b019
feat proto-structs: remove boilerplate in common enum name patterns
Anton3 Aug 20, 2025
b31f5d7
feature: support exponential format in decimal64::Decimal::FromString…
Aug 20, 2025
2b16a9b
feat mongo: support the collection.distinct operation
Aug 20, 2025
55a6748
feat grpc: add tests on metadata usage and documentation for them
Aug 20, 2025
4879813
cc grpc: document how to complete client-side streaming RPCs gracefully
Aug 21, 2025
5de7bf0
feat engine: invalidate cancelled task after Get()
Aug 21, 2025
ca52b94
fix proto-structs: fix concept names resolving
4JustMe4 Aug 21, 2025
3b0b0df
feat docs: add info on mirrors
apolukhin Aug 21, 2025
48644ad
feat proto-structs: implement map types
Anton3 Aug 21, 2025
66f2e92
cc userver: document distro maintainer's role
segoon Aug 21, 2025
fa3a8f7
feat docs: improve version change widget
Lone-Marshal Aug 22, 2025
3d1c435
feat userver: generate debian/ & add test for .deb packages installation
segoon Aug 22, 2025
672959d
feat proto-structs: generate proper oneof classes
Anton3 Aug 22, 2025
db84423
cc userver: enable Member and Method readability-identifier-naming
TTPO100AJIEX Aug 22, 2025
bc33a7d
cc chaotic: improve in-code documentation
segoon Aug 22, 2025
5c70de3
feat cmake: add Fedora github CI workflow
segoon Aug 23, 2025
0d98da8
feat docs: minor updates for the docs building scripts
apolukhin Aug 25, 2025
10b3119
cc kafka: fix -Wpointer-bool-conversion in tests
4JustMe4 Aug 25, 2025
f6514c3
feat concurrent: allow zero-sized items in GenericQueue
Aug 25, 2025
8ec88f2
cc userver: fixes for debian/ generator
segoon Aug 25, 2025
1fdccc4
feat redis: add Client::GenericCommand
Aug 25, 2025
7dbfadb
feat proto-struct: sort dependencies
ArkadyRudenko Aug 26, 2025
6db4eef
feat grpc: add transaction check to grpc calls
Aug 26, 2025
8088a19
fix build: declare support for protobuf 6.x.y (v6.30+)
halfdarkangel Aug 26, 2025
2f0b456
feat userver/otlp: add support for separate endpoints
Aug 26, 2025
a16140c
feat core: warn on Host header not being present, clarify GetUrl docs
Aug 26, 2025
fc78011
feat userver: support parsing custom key types in maps
Aug 27, 2025
8181854
cc formats: showcase PerformMinimalFormatConversion in json2yaml
Anton3 Aug 28, 2025
04b6740
fix build: set CMAKE_CXX_SCAN_FOR_MODULES OFF
botanegg Aug 28, 2025
98715b8
feat userver: support_deprecated_in_configs
Aug 28, 2025
911e2c6
feat userver: set trx_tracker start/end in transactions
Aug 28, 2025
da9e76b
feat macos: up boost to 1.89
segoon Aug 28, 2025
8ab036b
feat docs: add changelog for 2.12
apolukhin Aug 28, 2025
0464dff
feat docs: document the gRPC retries and timeouts
apolukhin Aug 29, 2025
c9bde1a
feat docs: fix typos
apolukhin Aug 29, 2025
9b7d40b
feat CI: update URL to for MariaDB keys
apolukhin Aug 29, 2025
db5ef54
feat qc-gateway: add future states
TTPO100AJIEX Aug 29, 2025
7b4bf1d
feat CI: bump actions/checkout from 4 to 5
Aug 29, 2025
bcbb7a6
feat cmake: use GLOB_RECURSE in userver_add_sql_library
Anton3 Aug 29, 2025
e50ba7f
feat docs: fix some of the Doxygen noted issues
apolukhin Sep 1, 2025
d4f5496
feat ci: fix Conan runs on MacOS
apolukhin Sep 1, 2025
057883a
feat docs: release 2.12
apolukhin Sep 1, 2025
e58db4f
feat docs: start 2.13-rc
apolukhin Sep 1, 2025
876d0b7
feat postgresql: add static assertions for custom containers in Postg…
Sep 1, 2025
f4c21b7
feat cmake: add CPM to Boost
segoon Sep 1, 2025
1825e27
Revert "feat cmake: add CPM to Boost"
apolukhin Sep 2, 2025
d2c6b12
feat userver: support status codes log levels in grpc
Sep 2, 2025
90beea9
fix build: update describe for status_codes.cpp
apolukhin Sep 3, 2025
582368a
feat cmake: use namespace when calling utils::RegisterResource
zmij Sep 3, 2025
897ea9c
feat core: reuse ssl ctx for TLS server
Sep 3, 2025
d24908a
bug github: fix alpine workflow name
segoon Sep 3, 2025
69f95f2
feat grpc: add test for issue from https://github.com/userver-framewo…
apolukhin Sep 3, 2025
16558d2
feat userver core: fix fs::TempFile destructor crash when fs::TempFil…
Sep 3, 2025
f122b64
feat grpc: add src tvm id to access log
Sep 3, 2025
c27306d
feat userver/proto-structs: tests and fixes
Sep 4, 2025
d1f7aea
cc uservices: replace russian с with english c
TTPO100AJIEX Sep 4, 2025
1ede5ce
cc docs: fix some Doxygen errors
Anton3 Sep 4, 2025
2670e0d
refactor: change the way adding src tvm id in access log
Sep 4, 2025
c046f86
bug chaotic: fix . in schema name
segoon Sep 4, 2025
99429b8
fix core: disable trx tracker check on testpoint
Sep 5, 2025
fe051c4
bug chaotic: fix peerdir for api-4.0
segoon Sep 5, 2025
acf2348
bug docs: fix formatting
segoon Sep 5, 2025
aaac81a
bug chaotic: fix array serialization in request body
segoon Sep 5, 2025
e9c1178
bug github: fix macos workflow
segoon Sep 5, 2025
a5a7994
feat docs: add FAQ for SIGUSR1 and fix some links
apolukhin Sep 5, 2025
853c1e5
bug chaotic: fix usrv_build.json contents
segoon Sep 5, 2025
af2442f
feat userver/proto-structs: enhancements
Sep 5, 2025
fe9130c
feat grpc: publish logging functions for google::protobuf::Message an…
Sep 5, 2025
59f0b6e
cc decimal64: add info about exponential format in doc
Sep 7, 2025
db1a1a0
feat proto-struct: io functions
ArkadyRudenko Sep 8, 2025
b0f3f22
feat ci: add debian
segoon Sep 8, 2025
f8e656c
bug cmake: build fix for alpine
segoon Sep 8, 2025
b0fcf81
refactor docs: clarify max_response_size_in_flight
apolukhin Sep 8, 2025
cac0fc7
feat cmake: add CPM to several depenencies
segoon Sep 8, 2025
c85259a
feat cmake: add OpenSSL to CPM
segoon Sep 8, 2025
c154316
released controller getter
Sep 8, 2025
6210fd3
Fix names resolution
4JustMe4 Sep 8, 2025
d46c97e
Add GEOPOS redis command to the driver
Sep 9, 2025
03b8c65
feat debian: additions for debian source package
segoon Sep 9, 2025
8fa1a13
feat cmake: print CPM packages
segoon Sep 9, 2025
349c649
feat chaotic: autocreate userver/chaotic/io for uservices/libraries
segoon Sep 9, 2025
be5d608
bug chaotic: fix translator for response header type
segoon Sep 9, 2025
14d4794
feat chaotic: ignore x-usrv-non-std-type-reason
segoon Sep 9, 2025
d23150a
feat chaotic: support empty media-type
segoon Sep 9, 2025
d26a47d
feat chaotic: prepare for driver-mode library
segoon Sep 9, 2025
fb6236b
feat cmake: Boost for CPM
segoon Sep 10, 2025
61964ba
feat userver: add method in LRU cache to get update time of a key
Sep 10, 2025
7630779
feat proto-structs: support userver/structs/annotations.proto
Anton3 Sep 10, 2025
3286809
feat chaotic: support x-usrv-cpp-type: unsigned
segoon Sep 11, 2025
6589b92
feat userver/redis: return chrono type from ttl request
Sep 11, 2025
08fd5ff
feat: update third_party date/date.h to a5db3aec
botanegg Sep 11, 2025
039f98f
feat docs: clarify some of the docs
apolukhin Sep 11, 2025
b767405
feat redis: improve logs
Sep 11, 2025
679ff5e
feat chaotic: improvements here and there
segoon Sep 11, 2025
6d02dbb
bug chaotic: report about duplicate types
segoon Sep 11, 2025
2303ca1
feat userver: make GetOptionalTimezone public
Sep 12, 2025
59cf92f
Fix `-Wignored-qualifiers` and `-Wreturn-stack-address` improved in c…
4JustMe4 Sep 12, 2025
40b8800
refactor proto-struct: better io
ArkadyRudenko Sep 12, 2025
3dc06a1
add some documentation
Sep 12, 2025
8ac8326
refactor proto-structs: prettify IO and bundles
ArkadyRudenko Sep 15, 2025
991e889
feat protobuf: add support for protobuf v6 (30.x)
vasily-sviridov Sep 15, 2025
2a6a7dc
feat proto-structs: camel case for enums
ArkadyRudenko Sep 16, 2025
fa404d4
feat mongo: remove MONGO_DEADLINE_PROPAGATION_ENABLED_V2
GitSparTV Sep 16, 2025
727d2e3
fix userver: fix crash on conversion from deeply nested YamlConfig to…
Sep 16, 2025
8a37325
feat chaotic: use pydantic in jsonschema
segoon Sep 16, 2025
f764877
fix build: add abseil-cpp PR 1739 patch for CPM
botanegg Sep 16, 2025
678e94d
Revert commit rXXXXXX, feat chaotic: use pydantic in jsonschema
Sep 16, 2025
db5d2b5
feat docs: add Debian badge to Readme.md
apolukhin Sep 16, 2025
f258a39
refactor grpc: move once used 'MakeClientFactorySettings' to anonymou…
kpavlov00 Sep 17, 2025
10c2580
feat redis: add options to expire redis command
Sep 17, 2025
c8c4c94
feat github: CI for Arch Linux
segoon Sep 17, 2025
3825b51
feat docs: add more publications and mirrors to videos
apolukhin Sep 17, 2025
0e75fd7
test core: trx tracker functional test
Sep 18, 2025
6aaacee
feat userver-configs: regen const.py
Sep 18, 2025
52515d8
feat grpc-proto-structs: added client/server codegen_declarations.hpp…
kpavlov00 Sep 18, 2025
ed03071
feat userver: import dynamic configs for egress proxy
Sep 19, 2025
f462ff8
feat userver: add multipart upload methods support to s3api
Sep 19, 2025
b0161e0
feat proto-structs: auto-break dependency cycles using utils::Box
Anton3 Sep 21, 2025
a56a062
feat yaml_config: treat #env values as string
Sep 22, 2025
2f3578f
feat proto-structs: require proto3 optional to produce std::optional …
Anton3 Sep 22, 2025
f65d973
feat redis: disable flapping test
apolukhin Sep 22, 2025
3eb84df
fix tests: reenable disabled proto-structs oneof tests
Anton3 Sep 22, 2025
d6473ef
fix userver: fix s3api multipart upload response parsers' arguments
Sep 22, 2025
943351c
feat grpc: introduce grpc-proto-structs server stream
kpavlov00 Sep 22, 2025
203bc2c
cc grpc: drop prefix ProtoStruct
kpavlov00 Sep 22, 2025
7a4ac22
refactor grpc: place grpc-client client-data into utils::Box
kpavlov00 Sep 23, 2025
f333fcc
refactor grpc: add place grpc-client client-data into box, follow by
kpavlov00 Sep 23, 2025
7b16327
Fix -Wdeprecated-literal-operator in taxi
4JustMe4 Sep 23, 2025
9fc7102
cc userver: enable function & parameter readability-identifier-naming
TTPO100AJIEX Sep 23, 2025
b891210
Resolve merge conflicts and simplify AI settings according to require…
Rexarrior Sep 23, 2025
aa1123f
cc proto-structs: drop outer `-` from macro-endmacro
Anton3 Sep 23, 2025
a07aa49
bug core: fix TSan markup for Mutex
apolukhin Sep 23, 2025
c702440
refactor grpc: fwd ClientData
kpavlov00 Sep 23, 2025
4b229a3
fix proto-structs: account for WEAK dependencies on nested types
Anton3 Sep 23, 2025
32e9578
add AI settings for roo
Rexarrior Aug 3, 2025
3bb213a
update development settings
Rexarrior Aug 4, 2025
6779c54
extreme config
Rexarrior Aug 5, 2025
acaba06
update
Rexarrior Aug 11, 2025
9e6a2ca
move out extreme config
Rexarrior Aug 11, 2025
797102f
Resolve merge conflicts and simplify AI settings according to require…
Rexarrior Sep 23, 2025
030a1cd
Merge branch 'ai-setup' of https://github.com/Rexarrior/userver into …
Rexarrior Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 422 additions & 0 deletions .ai_system_prompt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ static-analyzer-report
.clangd
.vscode
scripts/docs/en/dynamic_configs
ai-memory-bank/progress.md
ai-memory-bank/active_context.md
360 changes: 360 additions & 0 deletions .roorules

Large diffs are not rendered by default.

126 changes: 126 additions & 0 deletions ai-development-settings/minimalistic/.ai_system_prompt
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# AI Agent System Prompt for userver Service Development

I am an expert C++ software engineer specializing in developing services using the userver framework. My purpose is to help create high-performance, scalable services that leverage the full power of the userver framework's component-based architecture and asynchronous capabilities.

## Core Principles

### Service Development Focus
- I develop services that use the userver framework, not the framework itself
- I focus on implementing business logic in handlers and components
- I use existing framework components rather than creating new ones
- I follow service development patterns and best practices

### Component-Based Architecture
- Services are composed of components registered in main.cpp
- Components have well-defined lifecycles (Constructor → Start → Stop → Destructor)
- Components are configured through static_config.yaml
- Dependencies between components are declared explicitly

### Asynchronous Programming Model
- All I/O operations use userver's asynchronous drivers
- Operations are non-blocking and coroutine-safe
- Deadline propagation ensures responsive service behavior
- Cancellation support handles long-running operations gracefully

## Service Development Workflow

### 1. Service Creation
- Start with the service_template/ as a base.
- You MUST use command `userver-create-service service_name [--mongo] [--postgres] [--grpc]` to get service template
- Customize CMakeLists.txt for project-specific dependencies
- Implement handlers in src/ directory following established patterns
- Configure components in configs/static_config.yaml

### 2. Handler Implementation
- Inherit from userver::server::handlers::HttpHandlerBase
- Use kName constant for component registration
- Implement HandleRequestThrow for exception-based error handling
- Extract request parameters with request.GetArg("name")
- Set response headers and content type appropriately

### 3. Component Registration
- Register components in main.cpp using MinimalServerComponentList()
- Append standard components like Ping, HttpClient, DnsClient
- Add custom handlers and components as needed
- Use component names that match static_config.yaml

### 4. Configuration Management
- Configure task processors for CPU-bound and filesystem-bound operations
- Map handlers to URLs in static_config.yaml
- Set up database connections and other external dependencies
- Use environment variables for deployment-specific settings

## Key Implementation Patterns

### HTTP Handler Pattern
Refer to .roorules for detailed implementation patterns.

### Request Processing
Refer to .roorules for detailed request processing techniques.

### Error Handling
Refer to .roorules for detailed error handling approaches.

## Service-Specific Components

### Core Components
Refer to .roorules for a complete list of available components.

### Database Components
Refer to .roorules for database component options.

### Optional Components
Refer to .roorules for optional component options.

## Best Practices

### Performance Optimization
- Use asynchronous operations to minimize context switches
- Implement connection pooling for database and HTTP clients
- Apply deadline propagation to all downstream requests
- Use caching for frequently accessed data

### Reliability Patterns
- Implement circuit breaker patterns for external dependencies
- Use proper retry strategies with exponential backoff
- Handle different HTTP status codes appropriately
- Implement graceful degradation for non-critical failures

### Development Practices
- Follow component lifecycle guidelines for initialization and cleanup
- Use framework-provided synchronization primitives
- Implement structured logging with contextual information
- Write tests at multiple levels (unit, functional, integration)

## Available Resources

### Userver framework documentation
- Repository https://github.com/userver-framework/userver
- Site with documentation: https://userver.tech/de/d6a/md_en_2index.html

### Documentation
- userver/samples: Example services demonstrating various features
- userver/service_template: Template for creating new services
- userver/ai-memory-bank: Memory bank with framework patterns and context

### Development Environment
- CMake for build configuration
- GTest for unit testing
- pytest with testsuite for functional testing
- Google Benchmark for performance testing

## Quality Standards

### Code Quality
- Follow userver coding guidelines and patterns
- Use RAII and exception-safe coding practices
- Implement proper memory management with smart pointers
- Maintain consistent code formatting

### Testing Requirements
- Unit tests for core business logic
- Functional tests for service endpoints
- Integration tests for database and external service interactions
- Performance benchmarks for critical operations

For detailed implementation instructions, refer to the .roorules file.
Empty file.
187 changes: 187 additions & 0 deletions ai-development-settings/minimalistic/.roorules
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# userver Service Development Rules

service_development_rules:
description: "Rules and guidelines for developing services using the userver framework"

# Notes about available resources
notes:
framework_source: "In userver repo (https://github.com/userver-framework/userver) there is the source code of the framework for reference"
samples: "In userver/samples there are many examples of userver services demonstrating various features and components"
memory_bank: "In userver/ai-memory-bank there is memory about framework sources and patterns"

# Service project structure based on service_template
project_structure:
description: "Standard directory structure for userver services"
structure:
service_name:
- "CMakeLists.txt # Build configuration"
- "configs/ # Configuration files"
- " └── static_config.yaml # Static service configuration"
- "src/ # Source code"
- " ├── main.cpp # Service entry point"
- " ├── handlers/ # HTTP handlers"
- " │ ├── handler_name.hpp # Handler declaration"
- " │ └── handler_name.cpp # Handler implementation"
- " └── components/ # Custom components (optional)"
- "tests/ # Tests (optional)"
- "unittests/ # Unit tests (optional)"
- "benchmarks/ # Benchmarks (optional)"

# Key implementation files
key_files:
main_cpp:
description: "Service entry point"
responsibilities:
- "Sets up the component list"
- "Registers handlers and components"
- "Starts the service using userver::utils::DaemonMain"

cmake_lists_txt:
description: "Build configuration"
responsibilities:
- "Finds the userver package"
- "Defines object libraries for source files"
- "Links against userver components"
- "Sets up installation targets"

static_config_yaml:
description: "Configuration file"
responsibilities:
- "Defines task processors"
- "Configures components"
- "Maps handlers to URLs"

# Service configuration patterns
configuration_patterns:
handler_configuration:
description: "Handlers are configured in static_config.yaml"
pattern: |
components:
handler-name:
path: /url-path
method: GET,POST # HTTP methods
task_processor: main-task-processor

task_processor_configuration:
description: "Services typically define at least two task processors"
pattern: |
task_processors:
main-task-processor:
worker_threads: 4 # For CPU-bound tasks
fs-task-processor:
worker_threads: 2 # For filesystem-bound tasks

component_registration:
description: "Components are registered in main.cpp using the component list"
pattern: |
auto component_list = userver::components::MinimalServerComponentList()
.Append<userver::server::handlers::Ping>()
.Append<service_namespace::HandlerName>();

# Development workflows
development_workflows:
building:
steps:
- "CMake Configuration: Run cmake to configure the build"
- "Compilation: Run make or ninja to build the service"
- "Installation: Run make install to install the service"

testing:
steps:
- "Unit Tests: Run with make test or ctest"
- "Functional Tests: Use testsuite framework"
- "Benchmarks: Run performance benchmarks"

deployment:
steps:
- "Binary Deployment: Install the service binary"
- "Configuration Deployment: Deploy configuration files"
- "Service Management: Use systemd or similar for service management"

# Service-specific rules and guidelines
service_rules:
handler_implementation:
guidelines:
- "Handler Classes: Inherit from userver::server::handlers::HttpHandlerBase"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes it uses userver:: namespace, sometimes not

- "Handler Names: Use kName constant for component registration"
- "Request Handling: Implement HandleRequestThrow method for exception-based error handling"

component_design:
guidelines:
- "Component Lifecycle: Follow userver component lifecycle (Constructor → Start → Stop → Destructor)"
- "Configuration: Use GetComponentConfig() to access component configuration"
- "Dependencies: Declare dependencies in constructor parameters"

error_handling:
guidelines:
- "Exceptions: Use exceptions for error handling (they are automatically converted to HTTP error responses)"
- "Logging: Use userver::logging for structured logging"
- "Validation: Validate input parameters and return appropriate HTTP status codes"

# Key components that services typically use
key_components:
core_components:
- "server: HTTP server component"
- "logging: Logging component"
- "http-client: HTTP client for making outgoing requests"
- "dns-client: DNS client component"
- "handler-ping: Health check endpoint"
- "tests-control: Testsuite control endpoint"

database_components:
description: "Depending on service requirements"
components:
- "postgres: PostgreSQL database component"
- "mongo: MongoDB database component"
- "redis: Redis/Valkey database component"
- "mysql: MySQL database component"

optional_components:
- "testsuite-support: Testsuite support component"
- "congestion-control: Congestion control component"
- "dynamic-config: Dynamic configuration component"

# Patterns for HTTP handlers, middleware, and error handling
implementation_patterns:
http_handler_patterns:
simple_handler: |
class MyHandler final : public userver::server::handlers::HttpHandlerBase {
public:
static constexpr std::string_view kName = "handler-my-handler";

std::string HandleRequestThrow(
const userver::server::http::HttpRequest& request,
userver::server::request::RequestContext&) const override;
};

request_processing:
- "Extract parameters from query string: request.GetArg(\"name\")"
- "Extract headers: request.GetHeader(\"header-name\")"
- "Set response headers: request.GetHttpResponse().SetHeader(\"header-name\", \"value\")"
- "Set response content type: request.GetHttpResponse().SetContentType(\"text/plain\")"

middleware_patterns:
patterns:
- "Component-Based Middleware: Implement as components that wrap handlers"
- "Handler Chaining: Use handler composition for cross-cutting concerns"
- "Request Context: Use RequestContext to pass data between middleware components"

error_handling_patterns:
patterns:
- "Exception-Based: Throw exceptions for error conditions"
- "HTTP Status Codes: Return appropriate HTTP status codes"
- "Structured Logging: Log errors with context information"

exception_example: |
if (some_error_condition) {
throw userver::server::handlers::ClientError(
userver::server::handlers::InternalError, "Error message");
}

best_practices:
- "Asynchronous Operations: Use userver's asynchronous drivers for I/O operations"
- "Deadline Propagation: Propagate deadlines to downstream services"
- "Circuit Breakers: Use circuit breaker patterns for external dependencies"
- "Caching: Implement caching for frequently accessed data"
- "Rate Limiting: Implement rate limiting to protect services"
- "Start from template: start from template of service, which can be created using userver-create-service command: userver-create-service service_name [--mongo] [--postgres] [--grpc]"
2 changes: 2 additions & 0 deletions ai-memory-bank/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file is used to keep the memory-bank directory in the repository.
# It can be safely deleted if the directory contains other files.
Loading