blocks-genesis 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. blocks_genesis-0.3.1/.github/actions/install-dependencies/action.yml +18 -0
  2. blocks_genesis-0.3.1/.github/actions/setvars/action.yml +13 -0
  3. blocks_genesis-0.3.1/.github/variables/vars.env +4 -0
  4. blocks_genesis-0.3.1/.github/workflows/2_sonar.yml +65 -0
  5. blocks_genesis-0.3.1/.github/workflows/dev.yml +34 -0
  6. blocks_genesis-0.3.1/.github/workflows/release.yml +62 -0
  7. blocks_genesis-0.3.1/.github/workflows/repo-hygiene.yml +16 -0
  8. blocks_genesis-0.3.1/.gitignore +79 -0
  9. blocks_genesis-0.3.1/.python-version +1 -0
  10. blocks_genesis-0.3.1/CODE_OF_CONDUCT.md +228 -0
  11. blocks_genesis-0.3.1/CONTRIBUTING.md +382 -0
  12. blocks_genesis-0.3.1/LICENSE +21 -0
  13. blocks_genesis-0.3.1/PKG-INFO +28 -0
  14. blocks_genesis-0.3.1/README.md +436 -0
  15. blocks_genesis-0.3.1/SECURITY.md +34 -0
  16. blocks_genesis-0.3.1/api.py +97 -0
  17. blocks_genesis-0.3.1/blocks_genesis/__init__.py +50 -0
  18. blocks_genesis-0.3.1/blocks_genesis/_auth/__init__.py +0 -0
  19. blocks_genesis-0.3.1/blocks_genesis/_auth/auth.py +667 -0
  20. blocks_genesis-0.3.1/blocks_genesis/_auth/blocks_context.py +233 -0
  21. blocks_genesis-0.3.1/blocks_genesis/_cache/CacheClient.py +135 -0
  22. blocks_genesis-0.3.1/blocks_genesis/_cache/__init__.py +0 -0
  23. blocks_genesis-0.3.1/blocks_genesis/_cache/cache_provider.py +41 -0
  24. blocks_genesis-0.3.1/blocks_genesis/_cache/redis_client.py +540 -0
  25. blocks_genesis-0.3.1/blocks_genesis/_core/__init__.py +0 -0
  26. blocks_genesis-0.3.1/blocks_genesis/_core/api.py +146 -0
  27. blocks_genesis-0.3.1/blocks_genesis/_core/azure_key_vault.py +73 -0
  28. blocks_genesis-0.3.1/blocks_genesis/_core/blocks_secret.py +16 -0
  29. blocks_genesis-0.3.1/blocks_genesis/_core/configuration.py +19 -0
  30. blocks_genesis-0.3.1/blocks_genesis/_core/env_vault_config.py +19 -0
  31. blocks_genesis-0.3.1/blocks_genesis/_core/secret_loader.py +52 -0
  32. blocks_genesis-0.3.1/blocks_genesis/_core/worker.py +141 -0
  33. blocks_genesis-0.3.1/blocks_genesis/_database/__init__.py +0 -0
  34. blocks_genesis-0.3.1/blocks_genesis/_database/db_context.py +21 -0
  35. blocks_genesis-0.3.1/blocks_genesis/_database/mongo_context.py +87 -0
  36. blocks_genesis-0.3.1/blocks_genesis/_database/mongo_event_subscriber.py +38 -0
  37. blocks_genesis-0.3.1/blocks_genesis/_entities/__init__.py +0 -0
  38. blocks_genesis-0.3.1/blocks_genesis/_entities/base_entity.py +13 -0
  39. blocks_genesis-0.3.1/blocks_genesis/_lmt/__init__.py +0 -0
  40. blocks_genesis-0.3.1/blocks_genesis/_lmt/activity.py +115 -0
  41. blocks_genesis-0.3.1/blocks_genesis/_lmt/log_config.py +26 -0
  42. blocks_genesis-0.3.1/blocks_genesis/_lmt/mongo_log_exporter.py +164 -0
  43. blocks_genesis-0.3.1/blocks_genesis/_lmt/mongo_trace_exporter.py +127 -0
  44. blocks_genesis-0.3.1/blocks_genesis/_lmt/tracing.py +22 -0
  45. blocks_genesis-0.3.1/blocks_genesis/_message/__init__.py +0 -0
  46. blocks_genesis-0.3.1/blocks_genesis/_message/azure/azure_message_client.py +149 -0
  47. blocks_genesis-0.3.1/blocks_genesis/_message/azure/azure_message_worker.py +280 -0
  48. blocks_genesis-0.3.1/blocks_genesis/_message/azure/config_azure_service_bus.py +103 -0
  49. blocks_genesis-0.3.1/blocks_genesis/_message/consumer.py +15 -0
  50. blocks_genesis-0.3.1/blocks_genesis/_message/consumer_message.py +11 -0
  51. blocks_genesis-0.3.1/blocks_genesis/_message/event_message.py +6 -0
  52. blocks_genesis-0.3.1/blocks_genesis/_message/event_registry.py +32 -0
  53. blocks_genesis-0.3.1/blocks_genesis/_message/message_client.py +26 -0
  54. blocks_genesis-0.3.1/blocks_genesis/_message/message_configuration.py +118 -0
  55. blocks_genesis-0.3.1/blocks_genesis/_message/rabbit_mq/__init__.py +9 -0
  56. blocks_genesis-0.3.1/blocks_genesis/_message/rabbit_mq/rabbit_message_client.py +183 -0
  57. blocks_genesis-0.3.1/blocks_genesis/_message/rabbit_mq/rabbit_message_worker.py +202 -0
  58. blocks_genesis-0.3.1/blocks_genesis/_message/rabbit_mq/rabbit_mq_service.py +93 -0
  59. blocks_genesis-0.3.1/blocks_genesis/_middlewares/__init__.py +0 -0
  60. blocks_genesis-0.3.1/blocks_genesis/_middlewares/global_exception_middleware.py +57 -0
  61. blocks_genesis-0.3.1/blocks_genesis/_middlewares/tenant_middleware.py +222 -0
  62. blocks_genesis-0.3.1/blocks_genesis/_tenant/__init__.py +0 -0
  63. blocks_genesis-0.3.1/blocks_genesis/_tenant/tenant.py +96 -0
  64. blocks_genesis-0.3.1/blocks_genesis/_tenant/tenant_service.py +317 -0
  65. blocks_genesis-0.3.1/blocks_genesis/_utilities/__init__.py +0 -0
  66. blocks_genesis-0.3.1/blocks_genesis/_utilities/crypto_service.py +74 -0
  67. blocks_genesis-0.3.1/changelog +9 -0
  68. blocks_genesis-0.3.1/config/dev.json +4 -0
  69. blocks_genesis-0.3.1/pyproject.toml +52 -0
  70. blocks_genesis-0.3.1/sonar-project.properties +4 -0
  71. blocks_genesis-0.3.1/static/index.html +10 -0
  72. blocks_genesis-0.3.1/test_consumer.py +8 -0
  73. blocks_genesis-0.3.1/tests/test_CacheClient.py +62 -0
  74. blocks_genesis-0.3.1/tests/test_api.py +40 -0
  75. blocks_genesis-0.3.1/tests/test_api_cov.py +116 -0
  76. blocks_genesis-0.3.1/tests/test_auth.py +103 -0
  77. blocks_genesis-0.3.1/tests/test_auth_cov.py +738 -0
  78. blocks_genesis-0.3.1/tests/test_azure_key_vault.py +53 -0
  79. blocks_genesis-0.3.1/tests/test_azure_message_client_cov.py +264 -0
  80. blocks_genesis-0.3.1/tests/test_azure_message_worker_cov.py +406 -0
  81. blocks_genesis-0.3.1/tests/test_blocks_context.py +69 -0
  82. blocks_genesis-0.3.1/tests/test_blocks_context_cov.py +99 -0
  83. blocks_genesis-0.3.1/tests/test_blocks_secret.py +11 -0
  84. blocks_genesis-0.3.1/tests/test_cache_client_cov.py +22 -0
  85. blocks_genesis-0.3.1/tests/test_cache_provider.py +17 -0
  86. blocks_genesis-0.3.1/tests/test_config_azure_service_bus_cov.py +83 -0
  87. blocks_genesis-0.3.1/tests/test_configuration.py +23 -0
  88. blocks_genesis-0.3.1/tests/test_core_cov.py +34 -0
  89. blocks_genesis-0.3.1/tests/test_crypto_service.py +24 -0
  90. blocks_genesis-0.3.1/tests/test_crypto_service_cov.py +33 -0
  91. blocks_genesis-0.3.1/tests/test_database_cov.py +97 -0
  92. blocks_genesis-0.3.1/tests/test_db_context.py +15 -0
  93. blocks_genesis-0.3.1/tests/test_env_vault_config.py +21 -0
  94. blocks_genesis-0.3.1/tests/test_global_exception_cov.py +41 -0
  95. blocks_genesis-0.3.1/tests/test_global_exception_middleware.py +59 -0
  96. blocks_genesis-0.3.1/tests/test_lmt_small_cov.py +204 -0
  97. blocks_genesis-0.3.1/tests/test_message_small_cov.py +187 -0
  98. blocks_genesis-0.3.1/tests/test_mongo_context.py +50 -0
  99. blocks_genesis-0.3.1/tests/test_mongo_event_subscriber.py +36 -0
  100. blocks_genesis-0.3.1/tests/test_mongo_log_exporter_cov.py +218 -0
  101. blocks_genesis-0.3.1/tests/test_mongo_trace_exporter_cov.py +158 -0
  102. blocks_genesis-0.3.1/tests/test_rabbit_message_client_cov.py +237 -0
  103. blocks_genesis-0.3.1/tests/test_rabbit_message_worker_cov.py +257 -0
  104. blocks_genesis-0.3.1/tests/test_rabbit_mq_service_cov.py +138 -0
  105. blocks_genesis-0.3.1/tests/test_redis_client_cov.py +569 -0
  106. blocks_genesis-0.3.1/tests/test_secret_loader.py +54 -0
  107. blocks_genesis-0.3.1/tests/test_tenant.py +57 -0
  108. blocks_genesis-0.3.1/tests/test_tenant_middleware.py +95 -0
  109. blocks_genesis-0.3.1/tests/test_tenant_middleware_cov.py +150 -0
  110. blocks_genesis-0.3.1/tests/test_tenant_service.py +148 -0
  111. blocks_genesis-0.3.1/tests/test_tenant_service_cov.py +268 -0
  112. blocks_genesis-0.3.1/tests/test_worker.py +98 -0
  113. blocks_genesis-0.3.1/tests/test_worker_cov.py +90 -0
  114. blocks_genesis-0.3.1/uv.lock +2629 -0
  115. blocks_genesis-0.3.1/worker.py +42 -0
@@ -0,0 +1,18 @@
1
+ name: Install dependencies
2
+ description: Installs dependencies for the python project
3
+
4
+ runs:
5
+ using: "composite"
6
+ steps:
7
+ - name: Install uv
8
+ uses: astral-sh/setup-uv@v3
9
+ with:
10
+ # Install a specific version of uv.
11
+ version: "0.5.26"
12
+ enable-cache: true
13
+ cache-dependency-glob: "uv.lock"
14
+
15
+ - name: Install dependencies
16
+ shell: bash
17
+ run: |
18
+ uv sync
@@ -0,0 +1,13 @@
1
+ name: 'Set environment variables'
2
+ description: 'Configures environment variables for a workflow'
3
+ inputs:
4
+ varFilePath:
5
+ description: 'File path to variable file or directory. Defaults to ./.github/variables/* if none specified and runs against each file in that directory.'
6
+ required: false
7
+ default: ./.github/variables/*
8
+ runs:
9
+ using: "composite"
10
+ steps:
11
+ - run: |
12
+ sed "" ${{ inputs.varFilePath }} >> $GITHUB_ENV
13
+ shell: bash
@@ -0,0 +1,4 @@
1
+ SONARQUBE_HOST=https://code.selise.biz
2
+ AUTHOR=seliseblocks
3
+ REPO_NAME=blocks-genesis-py
4
+ SONAR_KEY=SELISEdigitalplatforms_blocks-genesis-py_c3d4471b-e585-48c9-950c-d3ee10ba4175
@@ -0,0 +1,65 @@
1
+ name: Analyze Code Quality
2
+
3
+ on:
4
+ workflow_call:
5
+ secrets:
6
+ SONAR_TOKEN:
7
+ required: true
8
+
9
+ jobs:
10
+ build:
11
+ name: SonarQube Analysis
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - name: Set Environment Variables
20
+ uses: ./.github/actions/setvars
21
+ with:
22
+ varFilePath: ./.github/variables/vars.env
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v4
26
+ with:
27
+ python-version: '3.10'
28
+
29
+ - name: Set up JDK 17
30
+ uses: actions/setup-java@v1
31
+ with:
32
+ java-version: "17"
33
+
34
+ - name: Cache SonarQube packages
35
+ uses: actions/cache@v4
36
+ with:
37
+ path: ~/.sonar/cache
38
+ key: ${{ runner.os }}-sonar
39
+ restore-keys: |
40
+ ${{ runner.os }}-sonar
41
+
42
+ - name: Install dependencies
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ pip install pytest pytest-cov pytest-asyncio
46
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
47
+ if [ -f pyproject.toml ]; then pip install .; fi
48
+
49
+ - name: Run tests with coverage
50
+ continue-on-error: true
51
+ run: |
52
+ python -m pytest --asyncio-mode=auto --cov=. --cov-report=xml
53
+
54
+ - uses: sonarsource/sonarqube-scan-action@master
55
+ env:
56
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57
+ SONAR_HOST_URL: ${{ env.SONARQUBE_HOST }}
58
+
59
+ # - name: SonarQube Quality Gate check
60
+ # uses: sonarsource/sonarqube-quality-gate-action@master
61
+ # # Force to fail step after specific time.
62
+ # timeout-minutes: 5
63
+ # env:
64
+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65
+ # SONAR_HOST_URL: ${{ env.SONARQUBE_HOST }}
@@ -0,0 +1,34 @@
1
+ name: sonarqube analysis
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - dev
7
+ - sonar
8
+ - main
9
+ pull_request:
10
+ branches:
11
+ - dev
12
+ - sonar
13
+ - main
14
+
15
+ env:
16
+ RUN_SONARQUBE: "true"
17
+
18
+ jobs:
19
+ initialization:
20
+ runs-on: ubuntu-latest
21
+ outputs:
22
+ envvalue1: ${{ steps.setvar.outputs.envvar1 }}
23
+ steps:
24
+ - name: set value
25
+ id: setvar
26
+ run: |
27
+ echo "::set-output name=envvar1::$RUN_SONARQUBE"
28
+
29
+ sonarqube-job:
30
+ if: ${{ success() && needs.initialization.outputs.envvalue1=='true' }}
31
+ uses: ./.github/workflows/2_sonar.yml
32
+ secrets:
33
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_GLOBAL }}
34
+ needs: [initialization]
@@ -0,0 +1,62 @@
1
+ name: Publish package to PyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - inception
7
+ release:
8
+ types: [published]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ name: Build distribution
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Check out release source
20
+ uses: actions/checkout@v4
21
+ with:
22
+ ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@v5
31
+ with:
32
+ enable-cache: true
33
+
34
+ - name: Build distribution packages
35
+ run: uv build
36
+
37
+ - name: Verify distribution metadata
38
+ run: uv tool run twine check dist/*
39
+
40
+ - name: Upload distribution packages
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: python-package-distributions
44
+ path: dist/
45
+
46
+ publish-to-pypi:
47
+ name: Publish distribution
48
+ needs: build
49
+ runs-on: ubuntu-latest
50
+ permissions:
51
+ id-token: write
52
+
53
+ steps:
54
+ - name: Download distribution packages
55
+ uses: actions/download-artifact@v4
56
+ with:
57
+ name: python-package-distributions
58
+ path: dist/
59
+
60
+ - name: Publish package to PyPI
61
+ uses: pypa/gh-action-pypi-publish@release/v1
62
+
@@ -0,0 +1,16 @@
1
+ name: repo-hygiene
2
+ on:
3
+ push:
4
+ branches: [inception]
5
+ pull_request:
6
+ branches: [inception]
7
+ jobs:
8
+ repo-hygiene:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: no stray markdown or AI artifacts
13
+ run: |
14
+ badmd=$(git ls-files '*.md' | grep -vE '(^|/)(README|LICENSE|CONTRIBUTING|SECURITY|CODE_OF_CONDUCT)\.md$' || true)
15
+ badai=$(git ls-files | grep -iE '(^|/)(\.claude|\.cursor|\.codex|\.hermes|\.aider|\.windsurf|\.gemini|\.kiro|\.trae|graphify-out)(/|$)|(^|/)(\.cursorrules|\.mcp\.json|copilot-instructions\.md)$' || true)
16
+ if [ -n "$badmd$badai" ]; then echo "Policy violations:"; echo "$badmd"; echo "$badai"; exit 1; fi
@@ -0,0 +1,79 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyd
5
+ *.pyo
6
+ .Python
7
+ env/
8
+ .env
9
+ venv/
10
+ lib/
11
+ include/
12
+ bin/
13
+ share/
14
+ logs/
15
+ *.log
16
+ .pytest_cache/
17
+ .coverage
18
+ htmlcov/
19
+ .nox/
20
+ .tox/
21
+ dist/
22
+ build/
23
+ *.egg-infol
24
+ *.egg
25
+ .mypy_cache/
26
+ .ruff_cache/
27
+ .vscode/
28
+
29
+ # IDEs
30
+ .idea/
31
+ *.iml
32
+ *.iws
33
+ *.ipr
34
+
35
+ # OS generated files
36
+ .DS_Store
37
+ .Trashes
38
+ ehthumbs.db
39
+ Thumbs.db
40
+
41
+ # FastAPI specific
42
+ # If you have an sqlite database file
43
+ *.db
44
+
45
+ # Docker
46
+ # If you are using Docker, you might want to ignore these
47
+ # .dockerignore should handle what goes into the image, but these are for local dev
48
+ # .docker/
49
+ # docker-compose.yml (if you have local-only modifications)
50
+
51
+ # Environment variables (if you have a .env file outside of your venv)
52
+ .env
53
+
54
+
55
+ # --- AI assistant artifacts: never track ---
56
+ .claude/
57
+ .cursor/
58
+ .codex/
59
+ .hermes/
60
+ .aider*
61
+ .windsurf/
62
+ .gemini/
63
+ .kiro/
64
+ .trae/
65
+ graphify-out/
66
+ CLAUDE.md
67
+ GEMINI.md
68
+ AGENTS.md
69
+ .cursorrules
70
+ .mcp.json
71
+ copilot-instructions.md
72
+
73
+ # --- markdown policy: only standard docs tracked ---
74
+ *.md
75
+ !README.md
76
+ !LICENSE.md
77
+ !CONTRIBUTING.md
78
+ !SECURITY.md
79
+ !CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,228 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Commitment
4
+
5
+ We are committed to providing a welcoming, respectful, and inclusive environment for all contributors and community members of the **blocks-genesis-py** project. As maintainers, contributors, and participants, we pledge to make collaboration within our community a harassment-free, inclusive experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, socioeconomic status, sexual identity and orientation, or any other dimension of identity.
6
+
7
+ We recognize that a healthy community requires mutual respect, open dialogue, and accountability. This Code of Conduct establishes clear expectations for participation and ensures that everyone can contribute safely and meaningfully.
8
+
9
+ ## Expected Behavior
10
+
11
+ We encourage all community members to:
12
+
13
+ ### Professional Communication
14
+ - Use welcoming, inclusive, and respectful language
15
+ - Avoid jargon or explain technical terms to ensure accessibility
16
+ - Communicate clearly and thoughtfully in both written and verbal interactions
17
+
18
+ ### Collaborative Attitude
19
+ - Respect differing viewpoints, experiences, and expertise
20
+ - Listen actively and seek to understand other perspectives
21
+ - Provide and receive constructive criticism with grace and humility
22
+ - Focus on the quality of ideas rather than personalities or backgrounds
23
+
24
+ ### Community Focus
25
+ - Prioritize what is best for the project and community
26
+ - Be patient with newcomers and help them get oriented
27
+ - Share knowledge generously and mentor less experienced contributors
28
+ - Celebrate successes and acknowledge contributions from others
29
+
30
+ ### Inclusivity and Accessibility
31
+ - Use inclusive language and avoid assumptions about backgrounds or experiences
32
+ - Make efforts to ensure discussions are accessible to participants with different abilities
33
+ - Be mindful of time zone differences and varied work schedules
34
+ - Welcome contributions in different forms (code, documentation, design, testing, etc.)
35
+
36
+ ### Professional Conduct
37
+ - Keep discussions focused on the project and community matters
38
+ - Maintain professionalism even during disagreements
39
+ - Respect confidentiality and privacy of others
40
+ - Avoid cross-posting or multi-threading discussions unnecessarily
41
+
42
+ ## Unacceptable Behavior
43
+
44
+ The following behaviors are unacceptable and will not be tolerated in community spaces:
45
+
46
+ ### Harassment and Abuse
47
+ - Deliberate intimidation, threats, or harassment
48
+ - Unwanted or inappropriate personal comments
49
+ - Sustained disruption or derailment of discussions
50
+ - Targeted campaigns against individuals or groups
51
+
52
+ ### Discriminatory Conduct
53
+ - Slurs, stereotypes, or discriminatory remarks based on protected characteristics
54
+ - Exclusionary language or gatekeeping based on identity
55
+ - Questioning someone's right to participate based on identity or background
56
+ - Microaggressions or invalidation of others' experiences
57
+
58
+ ### Sexual Harassment and Misconduct
59
+ - Unwelcome sexual comments, advances, or requests
60
+ - Sexualized language, imagery, or references
61
+ - Non-consensual physical contact or invasion of personal space
62
+ - Sexual jokes or innuendos in professional settings
63
+
64
+ ### Harmful Content and Privacy Violations
65
+ - Publishing or threatening to publish others' private information without consent
66
+ - Sharing confidential project or personal information
67
+ - Doxxing or any attempt to identify or locate someone without consent
68
+ - Sharing explicit, violent, or otherwise harmful content
69
+
70
+ ### Bad Faith Participation
71
+ - Trolling, deliberately provocative posts, or bad faith arguments
72
+ - Spam, self-promotion, or off-topic solicitation
73
+ - Impersonation or misrepresentation of identity or affiliation
74
+ - Coordinated inauthentic behavior or vote manipulation
75
+
76
+ ### Retaliation
77
+ - Retaliatory action against someone for reporting a violation or participating in an investigation
78
+ - Threatening or intimidating those who raise concerns
79
+ - Exclusion or marginalization of someone for speaking up
80
+
81
+ ## Our Responsibilities
82
+
83
+ ### Maintainers' Obligations
84
+
85
+ Project maintainers commit to:
86
+
87
+ - Clarify and communicate the standards of acceptable behavior
88
+ - Enforce this Code of Conduct fairly and consistently
89
+ - Address violations promptly and appropriately
90
+ - Provide a safe mechanism for reporting concerns
91
+ - Maintain confidentiality of reporters
92
+ - Document and review enforcement decisions
93
+
94
+ ### Enforcement Authority
95
+
96
+ Maintainers have the authority and responsibility to:
97
+
98
+ - Remove, edit, or reject comments, commits, code, issues, pull requests, and other contributions that violate this Code of Conduct
99
+ - Temporarily or permanently ban users who engage in unacceptable behavior
100
+ - Take corrective action proportional to the severity of the violation
101
+ - Communicate decisions and reasons for moderation when appropriate
102
+ - Consider context and good faith when evaluating violations
103
+
104
+ ## Scope
105
+
106
+ This Code of Conduct applies to all community spaces associated with the blocks-genesis-py project, including but not limited to:
107
+
108
+ - GitHub repositories, issues, pull requests, and discussions
109
+ - Official project communication channels (email, chat, forums, etc.)
110
+ - Project events and meetings (virtual and in-person)
111
+ - Social media accounts managed by or for the project
112
+ - Third-party spaces where individuals are representing the project or community
113
+
114
+ This Code of Conduct applies to all types of contributions and participation:
115
+ - Code contributions
116
+ - Documentation
117
+ - Issue reports and discussion
118
+ - Comments and feedback
119
+ - Mentoring and advice
120
+
121
+ Individuals are responsible for upholding this Code of Conduct in all spaces where they represent the project.
122
+
123
+ ## Reporting and Enforcement
124
+
125
+ ### How to Report
126
+
127
+ If you witness or experience a violation of this Code of Conduct, please report it to the project team:
128
+
129
+ **Email**: [blocks@selisegroup.com](mailto:blocks@selisegroup.com)
130
+
131
+ When reporting, please include:
132
+
133
+ - Your contact information (name and email)
134
+ - Description of the incident (what happened and when)
135
+ - Location of the incident (URL, channel, etc.)
136
+ - Names or usernames of those involved (if known)
137
+ - Any additional context or evidence
138
+ - Whether this is an ongoing situation
139
+
140
+ **Reports are taken seriously. We will acknowledge receipt within 48 hours.**
141
+
142
+ ### Confidentiality
143
+
144
+ - Reporter identities will be kept confidential unless the reporter consents otherwise
145
+ - Investigation details will be shared only with those who need to know
146
+ - We will not reveal information about the incident beyond what is necessary for enforcement
147
+ - Retaliation against reporters is strictly prohibited
148
+
149
+ ### Investigation and Response
150
+
151
+ Upon receiving a report, the project team will:
152
+
153
+ 1. **Acknowledge** receipt and inform the reporter of next steps
154
+ 2. **Investigate** the incident fairly and impartially, gathering information from all parties
155
+ 3. **Evaluate** the severity and context of the violation
156
+ 4. **Decide** on appropriate corrective action
157
+ 5. **Implement** the decision and communicate outcomes to relevant parties
158
+ 6. **Follow up** to ensure the behavior does not recur
159
+
160
+ ### Corrective Actions
161
+
162
+ Depending on the severity and nature of the violation, corrective actions may include:
163
+
164
+ - **Warning**: A private or public reminder of the Code of Conduct
165
+ - **Temporary Suspension**: Temporary removal from community spaces (24 hours to 30 days)
166
+ - **Permanent Ban**: Permanent removal from the project and community
167
+ - **Escalation**: Referral to legal or other authorities for serious violations
168
+
169
+ Factors considered in determining appropriate action:
170
+
171
+ - Severity and impact of the behavior
172
+ - Pattern or repeat offenses
173
+ - Good faith versus deliberate misconduct
174
+ - Cooperation with the investigation
175
+ - Previous warnings or violations
176
+
177
+ ### Appeal Process
178
+
179
+ If you believe a decision was unfair or incorrect, you may submit an appeal:
180
+
181
+ 1. Submit a written appeal to [blocks@selisegroup.com](mailto:blocks@selisegroup.com) within 14 days of the decision
182
+ 2. Explain why you believe the decision should be reconsidered
183
+ 3. A different member of the project leadership will review your appeal
184
+ 4. The decision will be communicated within 14 days of receipt
185
+
186
+ Decisions on appeals are final.
187
+
188
+ ## Conflict Resolution
189
+
190
+ We recognize that conflicts may arise. When disagreements occur:
191
+
192
+ - Assume good intent and good faith
193
+ - Focus on the issue, not the person
194
+ - Request a private discussion if needed
195
+ - Seek to understand differing perspectives
196
+ - Work toward resolution that benefits the community
197
+ - If informal resolution fails, escalate to the enforcement process
198
+
199
+ ## Examples of Conduct in Practice
200
+
201
+ ### Positive Examples
202
+
203
+ - Respectfully disagreeing on a technical approach: *"I see the merit in your approach. I wonder if we've considered X? Here's why I think it might be important..."*
204
+ - Welcoming a newcomer: *"Welcome! Thanks for your first contribution. Here's how to run the tests. Feel free to ask questions."*
205
+ - Giving constructive feedback: *"This is a good start. Would it be possible to add tests for the edge case we discussed?"*
206
+ - Acknowledging a mistake: *"You're right, I was wrong about that. Thanks for catching it. Here's what I've learned..."*
207
+
208
+ ### Unacceptable Examples
209
+
210
+ - Dismissive language: *"That's a stupid idea. Anyone competent would know better."*
211
+ - Gatekeeping: *"You're not a 'real' developer if you don't know X."*
212
+ - Harassment: Repeated unwanted contact or personal attacks
213
+ - Privacy violation: Sharing someone's personal information without consent
214
+ - Retaliation: Excluding someone for reporting a violation
215
+
216
+ ## Questions or Concerns
217
+
218
+ If you have questions about this Code of Conduct or need clarification:
219
+
220
+ - **Email**: [blocks@selisegroup.com](mailto:blocks@selisegroup.com)
221
+ - **Discussion**: Open an issue labeled `code-of-conduct` (for non-sensitive questions)
222
+
223
+ ## Attribution
224
+
225
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
226
+
227
+ The project leadership is committed to enforcing this Code of Conduct consistently and fairly. We thank the Contributor Covenant community for providing a foundation for inclusive open-source communities.
228
+