swallo 0.1.0__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 (187) hide show
  1. swallo-0.1.0/.github/workflows/bench.yml +48 -0
  2. swallo-0.1.0/.github/workflows/ci.yml +134 -0
  3. swallo-0.1.0/.github/workflows/clean-install.yml +80 -0
  4. swallo-0.1.0/.github/workflows/codeql.yml +40 -0
  5. swallo-0.1.0/.github/workflows/release.yml +90 -0
  6. swallo-0.1.0/.github/workflows/scorecard.yml +38 -0
  7. swallo-0.1.0/.gitignore +43 -0
  8. swallo-0.1.0/CHANGELOG.md +26 -0
  9. swallo-0.1.0/CODEOWNERS +12 -0
  10. swallo-0.1.0/CODE_OF_CONDUCT.md +127 -0
  11. swallo-0.1.0/CONTRIBUTING.md +38 -0
  12. swallo-0.1.0/LICENSE +36 -0
  13. swallo-0.1.0/LICENSE-APACHE +177 -0
  14. swallo-0.1.0/LICENSE-MIT +22 -0
  15. swallo-0.1.0/PKG-INFO +277 -0
  16. swallo-0.1.0/README.md +232 -0
  17. swallo-0.1.0/REVIEW_PACKET.md +81 -0
  18. swallo-0.1.0/SECURITY.md +26 -0
  19. swallo-0.1.0/benchmarks/__init__.py +2 -0
  20. swallo-0.1.0/benchmarks/deterministic/__init__.py +2 -0
  21. swallo-0.1.0/benchmarks/deterministic/corpus.py +269 -0
  22. swallo-0.1.0/benchmarks/deterministic/defense_matrix.py +133 -0
  23. swallo-0.1.0/benchmarks/deterministic/fuzz_atheris.py +123 -0
  24. swallo-0.1.0/benchmarks/deterministic/hash_stability.py +120 -0
  25. swallo-0.1.0/benchmarks/deterministic/invariants.py +121 -0
  26. swallo-0.1.0/benchmarks/deterministic/runner.py +132 -0
  27. swallo-0.1.0/benchmarks/deterministic/sanitizer.py +60 -0
  28. swallo-0.1.0/benchmarks/deterministic/tamper_detection.py +97 -0
  29. swallo-0.1.0/benchmarks/deterministic/variants.py +102 -0
  30. swallo-0.1.0/benchmarks/perf/__init__.py +4 -0
  31. swallo-0.1.0/benchmarks/perf/runner.py +521 -0
  32. swallo-0.1.0/benchmarks/results/deterministic.json +110 -0
  33. swallo-0.1.0/benchmarks/results/perf/summary.json +162 -0
  34. swallo-0.1.0/docs/BENCHMARKS.md +150 -0
  35. swallo-0.1.0/docs/CLI_AND_MCP_SPEC.md +101 -0
  36. swallo-0.1.0/docs/COMMANDS.md +238 -0
  37. swallo-0.1.0/docs/DECISIONS.md +221 -0
  38. swallo-0.1.0/docs/IMPLEMENTATION_PLAN.md +311 -0
  39. swallo-0.1.0/docs/PACKAGING_AND_RELEASE.md +151 -0
  40. swallo-0.1.0/docs/PACKET_SCHEMA.md +150 -0
  41. swallo-0.1.0/docs/PRD.md +128 -0
  42. swallo-0.1.0/docs/Paper.md +186 -0
  43. swallo-0.1.0/docs/QUICKSTART.md +125 -0
  44. swallo-0.1.0/docs/README.md +53 -0
  45. swallo-0.1.0/docs/ROADMAP.md +53 -0
  46. swallo-0.1.0/docs/Security.md +230 -0
  47. swallo-0.1.0/docs/TRD.md +331 -0
  48. swallo-0.1.0/docs/USER_GUIDE.md +103 -0
  49. swallo-0.1.0/docs/schemas/v0.1.json +399 -0
  50. swallo-0.1.0/docs/security/FINDINGS_REGISTER.md +33 -0
  51. swallo-0.1.0/docs/security/IDE_VERIFICATION.md +119 -0
  52. swallo-0.1.0/docs/templates/ANNOTATION_GUIDE.md +36 -0
  53. swallo-0.1.0/docs/templates/PREREGISTRATION.md +46 -0
  54. swallo-0.1.0/pyproject.toml +96 -0
  55. swallo-0.1.0/scripts/build_bench_page.py +215 -0
  56. swallo-0.1.0/src/swallo/__init__.py +5 -0
  57. swallo-0.1.0/src/swallo/__main__.py +12 -0
  58. swallo-0.1.0/src/swallo/adapters/__init__.py +33 -0
  59. swallo-0.1.0/src/swallo/adapters/antigravity.py +121 -0
  60. swallo-0.1.0/src/swallo/adapters/base.py +90 -0
  61. swallo-0.1.0/src/swallo/adapters/chat.py +86 -0
  62. swallo-0.1.0/src/swallo/adapters/claude_code.py +98 -0
  63. swallo-0.1.0/src/swallo/adapters/registry.py +65 -0
  64. swallo-0.1.0/src/swallo/bench/__init__.py +11 -0
  65. swallo-0.1.0/src/swallo/bench/fixtures.py +141 -0
  66. swallo-0.1.0/src/swallo/bench/manifest.py +64 -0
  67. swallo-0.1.0/src/swallo/bench/metrics.py +210 -0
  68. swallo-0.1.0/src/swallo/bench/runner.py +180 -0
  69. swallo-0.1.0/src/swallo/bench/schema.py +119 -0
  70. swallo-0.1.0/src/swallo/bench/verify.py +227 -0
  71. swallo-0.1.0/src/swallo/capture/__init__.py +7 -0
  72. swallo-0.1.0/src/swallo/capture/importers/__init__.py +19 -0
  73. swallo-0.1.0/src/swallo/capture/importers/base.py +194 -0
  74. swallo-0.1.0/src/swallo/capture/importers/chatgpt.py +261 -0
  75. swallo-0.1.0/src/swallo/capture/importers/claude_export.py +264 -0
  76. swallo-0.1.0/src/swallo/capture/importers/gemini_takeout.py +283 -0
  77. swallo-0.1.0/src/swallo/capture/importers/stream.py +54 -0
  78. swallo-0.1.0/src/swallo/capture/prompt.py +68 -0
  79. swallo-0.1.0/src/swallo/cli.py +237 -0
  80. swallo-0.1.0/src/swallo/commands/__init__.py +4 -0
  81. swallo-0.1.0/src/swallo/commands/approve.py +213 -0
  82. swallo-0.1.0/src/swallo/commands/bench.py +44 -0
  83. swallo-0.1.0/src/swallo/commands/breaker.py +119 -0
  84. swallo-0.1.0/src/swallo/commands/diff.py +144 -0
  85. swallo-0.1.0/src/swallo/commands/doctor.py +359 -0
  86. swallo-0.1.0/src/swallo/commands/drafts.py +198 -0
  87. swallo-0.1.0/src/swallo/commands/edit.py +198 -0
  88. swallo-0.1.0/src/swallo/commands/import_cmd.py +304 -0
  89. swallo-0.1.0/src/swallo/commands/init.py +154 -0
  90. swallo-0.1.0/src/swallo/commands/load.py +183 -0
  91. swallo-0.1.0/src/swallo/commands/log.py +102 -0
  92. swallo-0.1.0/src/swallo/commands/mcp.py +82 -0
  93. swallo-0.1.0/src/swallo/commands/merge.py +159 -0
  94. swallo-0.1.0/src/swallo/commands/prompt.py +56 -0
  95. swallo-0.1.0/src/swallo/commands/resolve.py +149 -0
  96. swallo-0.1.0/src/swallo/commands/save.py +214 -0
  97. swallo-0.1.0/src/swallo/commands/send.py +315 -0
  98. swallo-0.1.0/src/swallo/commands/show.py +210 -0
  99. swallo-0.1.0/src/swallo/commands/staleness.py +157 -0
  100. swallo-0.1.0/src/swallo/commands/status.py +148 -0
  101. swallo-0.1.0/src/swallo/config.py +255 -0
  102. swallo-0.1.0/src/swallo/errors.py +88 -0
  103. swallo-0.1.0/src/swallo/merge/__init__.py +1 -0
  104. swallo-0.1.0/src/swallo/merge/conflicts.py +219 -0
  105. swallo-0.1.0/src/swallo/merge/dedupe.py +166 -0
  106. swallo-0.1.0/src/swallo/merge/normalize.py +72 -0
  107. swallo-0.1.0/src/swallo/merge/resolve.py +194 -0
  108. swallo-0.1.0/src/swallo/py.typed +1 -0
  109. swallo-0.1.0/src/swallo/redact/__init__.py +4 -0
  110. swallo-0.1.0/src/swallo/redact/decode.py +249 -0
  111. swallo-0.1.0/src/swallo/redact/denylist.py +43 -0
  112. swallo-0.1.0/src/swallo/redact/engine.py +149 -0
  113. swallo-0.1.0/src/swallo/redact/entropy.py +64 -0
  114. swallo-0.1.0/src/swallo/redact/patterns.py +86 -0
  115. swallo-0.1.0/src/swallo/render/__init__.py +21 -0
  116. swallo-0.1.0/src/swallo/render/agents_md.py +94 -0
  117. swallo-0.1.0/src/swallo/render/briefing.py +97 -0
  118. swallo-0.1.0/src/swallo/render/budget.py +137 -0
  119. swallo-0.1.0/src/swallo/render/fence.py +62 -0
  120. swallo-0.1.0/src/swallo/render/sanitize.py +110 -0
  121. swallo-0.1.0/src/swallo/repo/__init__.py +41 -0
  122. swallo-0.1.0/src/swallo/repo/gitstate.py +205 -0
  123. swallo-0.1.0/src/swallo/repo/paths.py +107 -0
  124. swallo-0.1.0/src/swallo/repo/staleness.py +313 -0
  125. swallo-0.1.0/src/swallo/schema/__init__.py +3 -0
  126. swallo-0.1.0/src/swallo/schema/canonical.py +199 -0
  127. swallo-0.1.0/src/swallo/schema/jsonschema.py +32 -0
  128. swallo-0.1.0/src/swallo/schema/limits.py +23 -0
  129. swallo-0.1.0/src/swallo/schema/models.py +212 -0
  130. swallo-0.1.0/src/swallo/server/__init__.py +26 -0
  131. swallo-0.1.0/src/swallo/server/guards.py +458 -0
  132. swallo-0.1.0/src/swallo/server/mcp_server.py +612 -0
  133. swallo-0.1.0/src/swallo/store/__init__.py +3 -0
  134. swallo-0.1.0/src/swallo/store/db.py +202 -0
  135. swallo-0.1.0/src/swallo/store/eventlog.py +167 -0
  136. swallo-0.1.0/src/swallo/store/ledger.py +170 -0
  137. swallo-0.1.0/src/swallo/store/objects.py +94 -0
  138. swallo-0.1.0/src/swallo/store/registry.py +134 -0
  139. swallo-0.1.0/src/swallo/store/signing.py +207 -0
  140. swallo-0.1.0/src/swallo/terminal.py +121 -0
  141. swallo-0.1.0/tests/fixtures/golden_canonical_v1.json +1 -0
  142. swallo-0.1.0/tests/fixtures/v0_1_packet.json +66 -0
  143. swallo-0.1.0/tests/golden/raw_briefing_golden.md +19 -0
  144. swallo-0.1.0/tests/test_adapter_base.py +96 -0
  145. swallo-0.1.0/tests/test_adapter_registry.py +48 -0
  146. swallo-0.1.0/tests/test_adapters_antigravity.py +118 -0
  147. swallo-0.1.0/tests/test_bench.py +172 -0
  148. swallo-0.1.0/tests/test_briefing.py +63 -0
  149. swallo-0.1.0/tests/test_budget.py +62 -0
  150. swallo-0.1.0/tests/test_canonical.py +108 -0
  151. swallo-0.1.0/tests/test_chat_adapter.py +76 -0
  152. swallo-0.1.0/tests/test_claude_code_adapter.py +103 -0
  153. swallo-0.1.0/tests/test_cli.py +88 -0
  154. swallo-0.1.0/tests/test_commands_init_doctor.py +90 -0
  155. swallo-0.1.0/tests/test_commands_lifecycle.py +133 -0
  156. swallo-0.1.0/tests/test_config.py +129 -0
  157. swallo-0.1.0/tests/test_decode_scan.py +115 -0
  158. swallo-0.1.0/tests/test_deterministic_benchmarks.py +104 -0
  159. swallo-0.1.0/tests/test_e2e_production.py +90 -0
  160. swallo-0.1.0/tests/test_eventlog.py +108 -0
  161. swallo-0.1.0/tests/test_fence.py +45 -0
  162. swallo-0.1.0/tests/test_fence_fuzz.py +43 -0
  163. swallo-0.1.0/tests/test_golden_renders.py +77 -0
  164. swallo-0.1.0/tests/test_hash_and_ids.py +146 -0
  165. swallo-0.1.0/tests/test_importer_security.py +148 -0
  166. swallo-0.1.0/tests/test_importers_e2e.py +261 -0
  167. swallo-0.1.0/tests/test_init.py +8 -0
  168. swallo-0.1.0/tests/test_ledger.py +113 -0
  169. swallo-0.1.0/tests/test_load_command.py +113 -0
  170. swallo-0.1.0/tests/test_mcp_server.py +792 -0
  171. swallo-0.1.0/tests/test_merge_conflicts.py +208 -0
  172. swallo-0.1.0/tests/test_merge_dedupe.py +181 -0
  173. swallo-0.1.0/tests/test_merge_lifecycle.py +412 -0
  174. swallo-0.1.0/tests/test_merge_normalize.py +93 -0
  175. swallo-0.1.0/tests/test_packaging_metadata.py +56 -0
  176. swallo-0.1.0/tests/test_paths.py +110 -0
  177. swallo-0.1.0/tests/test_redact_detectors.py +112 -0
  178. swallo-0.1.0/tests/test_redact_engine.py +104 -0
  179. swallo-0.1.0/tests/test_registry.py +107 -0
  180. swallo-0.1.0/tests/test_render_agents_md.py +74 -0
  181. swallo-0.1.0/tests/test_repo_staleness.py +274 -0
  182. swallo-0.1.0/tests/test_sanitize.py +71 -0
  183. swallo-0.1.0/tests/test_schema_models.py +119 -0
  184. swallo-0.1.0/tests/test_send_command.py +375 -0
  185. swallo-0.1.0/tests/test_signing.py +157 -0
  186. swallo-0.1.0/tests/test_store.py +169 -0
  187. swallo-0.1.0/tests/test_terminal.py +65 -0
@@ -0,0 +1,48 @@
1
+ name: Statistical Performance Benchmarks
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ # Run once a week at midnight UTC on Sundays
7
+ - cron: '0 0 * * 0'
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ benchmarks:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
20
+ with:
21
+ python-version: "3.12"
22
+ cache: "pip"
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e .[dev,tokens] psutil pyperf pytest-benchmark
28
+
29
+ - name: Run deterministic benchmarks and verify
30
+ run: |
31
+ python -m benchmarks.deterministic.runner
32
+ swallo bench verify benchmarks/results/deterministic.json
33
+
34
+ - name: Run statistical benchmarks
35
+ run: |
36
+ python -m benchmarks.perf.runner
37
+
38
+ - name: Upload benchmark results artifact
39
+ uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
40
+ with:
41
+ name: perf-benchmark-results
42
+ path: benchmarks/results/perf/
43
+ retention-days: 30
44
+
45
+ - name: Runner Noise Disclaimer
46
+ run: |
47
+ echo "Note: GitHub Actions hosted runners share virtualized hardware with variable noisy neighbors."
48
+ echo "These benchmark numbers are indicative of order-of-magnitude performance and not absolute."
@@ -0,0 +1,134 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ lint-and-types:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Check out repository
21
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
22
+
23
+ - name: Set up Python 3.11
24
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
25
+ with:
26
+ python-version: "3.11"
27
+
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ python -m pip install -e ".[dev,sign,mcp]"
32
+
33
+ - name: Run Ruff check
34
+ run: python -m ruff check src tests
35
+
36
+ - name: Run Mypy strict
37
+ run: python -m mypy src/swallo
38
+
39
+ test-matrix:
40
+ runs-on: ${{ matrix.os }}
41
+ continue-on-error: ${{ matrix.experimental || false }}
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ os: [ubuntu-latest, macos-latest, windows-latest]
46
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
47
+ include:
48
+ - python-version: "3.14"
49
+ experimental: true
50
+ - python-version: "3.15"
51
+ experimental: true
52
+ steps:
53
+ - name: Check out repository
54
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
55
+
56
+ - name: Set up Python ${{ matrix.python-version }}
57
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
58
+ with:
59
+ python-version: ${{ matrix.python-version }}
60
+ allow-prereleases: true
61
+
62
+ - name: Install dependencies with dev and sign extras
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ python -m pip install -e ".[dev,sign]"
66
+
67
+ - name: Run Pytest test suite with coverage
68
+ run: python -m pytest --cov=swallo --cov-report=xml --cov-report=term
69
+
70
+ core-only:
71
+ runs-on: ubuntu-latest
72
+ steps:
73
+ - name: Check out repository
74
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
75
+
76
+ - name: Set up Python 3.11
77
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
78
+ with:
79
+ python-version: "3.11"
80
+
81
+ - name: Install core package only (no extras)
82
+ run: |
83
+ python -m pip install --upgrade pip
84
+ python -m pip install .
85
+
86
+ - name: Verify zero non-standard runtime dependencies & zero warnings
87
+ run: |
88
+ python -W error -c "import swallo; print('swallo version:', swallo.__version__)"
89
+ python -c "import sys; assert 'cryptography' not in sys.modules; assert 'tiktoken' not in sys.modules; assert 'mcp' not in sys.modules; print('Verified core runtime dependency isolation')"
90
+
91
+ - name: Run core tests with pytest
92
+ run: |
93
+ python -m pip install pytest hypothesis
94
+ python -m pytest
95
+
96
+ security-scan:
97
+ runs-on: ubuntu-latest
98
+ steps:
99
+ - name: Check out repository
100
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
101
+
102
+ - name: Set up Python 3.11
103
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
104
+ with:
105
+ python-version: "3.11"
106
+
107
+ - name: Install audit tools
108
+ run: |
109
+ python -m pip install --upgrade pip "setuptools>=84.1.0"
110
+ python -m pip install pip-audit bandit .
111
+
112
+ - name: Run pip-audit vulnerability scan
113
+ run: python -m pip_audit
114
+
115
+ - name: Run Bandit AST security scan
116
+ run: python -m bandit -r src/swallo -ll -q
117
+
118
+ build-and-check:
119
+ runs-on: ubuntu-latest
120
+ steps:
121
+ - name: Check out repository
122
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
123
+
124
+ - name: Set up Python 3.11
125
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
126
+ with:
127
+ python-version: "3.11"
128
+
129
+ - name: Build package and check distribution metadata
130
+ run: |
131
+ python -m pip install --upgrade pip
132
+ python -m pip install build twine
133
+ python -m build
134
+ python -m twine check dist/*
@@ -0,0 +1,80 @@
1
+ name: Clean Install Verification
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ clean-install-matrix:
15
+ runs-on: ${{ matrix.os }}
16
+ continue-on-error: ${{ matrix.experimental || false }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, macos-latest, windows-latest]
21
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
22
+ include:
23
+ - python-version: "3.14"
24
+ experimental: true
25
+ - python-version: "3.15"
26
+ experimental: true
27
+ steps:
28
+ - name: Check out repository
29
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
30
+
31
+ - name: Set up Python ${{ matrix.python-version }}
32
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+ allow-prereleases: true
36
+
37
+ - name: Build wheel and sdist
38
+ run: |
39
+ python -m pip install --upgrade pip build twine
40
+ python -m build
41
+ python -m twine check dist/*
42
+
43
+ - name: Install built wheel into isolated environment
44
+ shell: bash
45
+ run: |
46
+ python -m venv test-venv
47
+ if [ "$RUNNER_OS" = "Windows" ]; then
48
+ VENV_PYTHON="test-venv/Scripts/python"
49
+ else
50
+ VENV_PYTHON="test-venv/bin/python"
51
+ fi
52
+ "$VENV_PYTHON" -m pip install --upgrade pip
53
+ "$VENV_PYTHON" -m pip install dist/*.whl
54
+
55
+ - name: Test zero-warning import and dependency isolation
56
+ shell: bash
57
+ run: |
58
+ if [ "$RUNNER_OS" = "Windows" ]; then
59
+ VENV_PYTHON="test-venv/Scripts/python"
60
+ else
61
+ VENV_PYTHON="test-venv/bin/python"
62
+ fi
63
+ "$VENV_PYTHON" -W error -c "import swallo; print('Imported swallo v' + swallo.__version__)"
64
+ "$VENV_PYTHON" -c "import sys; assert 'mcp' not in sys.modules; assert 'cryptography' not in sys.modules; assert 'tiktoken' not in sys.modules; print('Verified isolation')"
65
+
66
+ - name: Verify CLI commands in temp directory
67
+ shell: bash
68
+ run: |
69
+ if [ "$RUNNER_OS" = "Windows" ]; then
70
+ VENV_BIN="test-venv/Scripts"
71
+ else
72
+ VENV_BIN="test-venv/bin"
73
+ fi
74
+ export PATH="$PWD/$VENV_BIN:$PATH"
75
+ swallo --help
76
+ swallo version
77
+ mkdir temp_workspace
78
+ cd temp_workspace
79
+ swallo init
80
+ swallo doctor
@@ -0,0 +1,40 @@
1
+ name: "CodeQL Analysis"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+ schedule:
9
+ - cron: '0 6 * * 1'
10
+
11
+ permissions:
12
+ actions: read
13
+ contents: read
14
+ security-events: write
15
+
16
+ jobs:
17
+ analyze:
18
+ name: Analyze Code
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 15
21
+
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ language: [ 'python' ]
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
30
+
31
+ - name: Initialize CodeQL
32
+ uses: github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3
33
+ with:
34
+ languages: ${{ matrix.language }}
35
+ queries: security-and-quality
36
+
37
+ - name: Perform CodeQL Analysis
38
+ uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3
39
+ with:
40
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,90 @@
1
+ name: Release Distribution
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution packages
14
+ runs-on: ubuntu-latest
15
+ outputs:
16
+ hash: ${{ steps.hash.outputs.hash }}
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
23
+ with:
24
+ python-version: "3.11"
25
+
26
+ - name: Install build dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ python -m pip install build twine
30
+
31
+ - name: Build sdist and wheel
32
+ run: python -m build
33
+
34
+ - name: Check package metadata with twine
35
+ run: python -m twine check --strict dist/*
36
+
37
+ - name: Upload build artifacts
38
+ uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
39
+ with:
40
+ name: python-package-distributions
41
+ path: dist/
42
+ if-no-files-found: error
43
+
44
+ provenance:
45
+ needs: [build]
46
+ runs-on: ubuntu-latest
47
+ permissions:
48
+ id-token: write
49
+ attestations: write
50
+ contents: read
51
+ steps:
52
+ - name: Download distribution packages
53
+ uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
54
+ with:
55
+ name: python-package-distributions
56
+ path: dist
57
+
58
+ - name: Generate build provenance attestations
59
+ uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
60
+ with:
61
+ subject-path: "dist/*"
62
+
63
+ publish-to-pypi:
64
+ name: Publish to PyPI via Trusted Publishing (OIDC)
65
+ needs: [build, provenance]
66
+ runs-on: ubuntu-latest
67
+ environment:
68
+ name: pypi
69
+ url: https://pypi.org/p/swallo
70
+ permissions:
71
+ id-token: write # Mandatory for PyPI Trusted Publishing (OIDC)
72
+ contents: write
73
+ steps:
74
+ - name: Download distributions
75
+ uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
76
+ with:
77
+ name: python-package-distributions
78
+ path: dist
79
+
80
+ - name: Publish package distributions to PyPI
81
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
82
+ with:
83
+ packages-dir: dist/
84
+ attestations: true
85
+
86
+ - name: Create GitHub Release
87
+ uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
88
+ with:
89
+ files: dist/*
90
+ generate_release_notes: true
@@ -0,0 +1,38 @@
1
+ name: OpenSSF Scorecard
2
+
3
+ on:
4
+ branch_protection_rule:
5
+ schedule:
6
+ - cron: '30 1 * * 6'
7
+ push:
8
+ branches: [ "main" ]
9
+
10
+ permissions: read-all
11
+
12
+ jobs:
13
+ analysis:
14
+ name: Scorecard analysis
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ security-events: write
18
+ id-token: write
19
+ contents: read
20
+ actions: read
21
+
22
+ steps:
23
+ - name: "Checkout code"
24
+ uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
25
+ with:
26
+ persist-credentials: false
27
+
28
+ - name: "Run analysis"
29
+ uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
30
+ with:
31
+ results_file: results.sarif
32
+ results_format: sarif
33
+ publish_results: true
34
+
35
+ - name: "Upload SARIF results"
36
+ uses: github/codeql-action/upload-sarif@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3
37
+ with:
38
+ sarif_file: results.sarif
@@ -0,0 +1,43 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+ ENV/
17
+
18
+ # Project local storage
19
+ .swallo/
20
+
21
+ # In-repo MCP configs and IDE configs (prefer user-level global config)
22
+ .cursor/
23
+ .cursor/mcp.json
24
+ .vscode/
25
+ .idea/
26
+ .codeium/
27
+ .mcp.json
28
+ *.mcp.json
29
+ .cursorrules
30
+ .windsurfrules
31
+ .agents/
32
+
33
+ # Testing and linting caches
34
+ .pytest_cache/
35
+ .mypy_cache/
36
+ .ruff_cache/
37
+ .mustel/
38
+ .coverage
39
+ htmlcov/
40
+
41
+ # Operating system files
42
+ .DS_Store
43
+ Thumbs.db
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented here. Format follows Keep a Changelog; versioning follows SemVer. The packet `schema_version` is versioned separately (see `docs/PACKET_SCHEMA.md`).
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.0] - 2026-11-10
8
+
9
+ ### Added
10
+ - Core context handoff CLI with 23 commands: `init`, `doctor`, `prompt`, `save`, `import`, `merge`, `resolve`, `show`, `edit`, `approve`, `send`, `load`, `diff`, `list`, `status`, `log`, `staleness`, `drafts`, `breaker`, `bench`, `mcp`, `help`, `version`.
11
+ - Zero-network runtime with content-addressed packet store in SQLite WAL mode.
12
+ - Swallo Canonical JSON v1 serialization and SHA-256 integrity hashing without floating-point numbers.
13
+ - Secret and PII redaction engine with decoded-variant scanning (base64, hex, URL, rot13, reverse, zero-width) and decode-bomb caps.
14
+ - Trojan Source sanitizer neutralizing bidirectional override and Unicode tag controls (CVE-2021-42574).
15
+ - Anti-tamper verification across event log hash chains and MAC-signed approval ledgers.
16
+ - Model Context Protocol (MCP) server with draft quotas, per-session token bucket, and circuit breakers.
17
+ - Adapters for Claude Code, Cursor, and Antigravity IDEs.
18
+ - Optional passphrase-derived Ed25519 digital signatures (`[sign]` extra via cryptography).
19
+ - Deterministic and statistical benchmark harnesses (`swallo bench run` and `swallo bench verify`) with 164-sample anti-overfitting corpus and 20-round realistic-transcript throughput suite.
20
+ - Dual licensing under MIT and Apache-2.0 (`LICENSE-MIT` and `LICENSE-APACHE`).
21
+ - Contributor Covenant Code of Conduct v2.1 (`CODE_OF_CONDUCT.md`).
22
+
23
+ ### Security
24
+ - Defense matrix against Zip-Slip, decompression bombs, symlink escapes, path traversal, and JSON nesting limits.
25
+ - Mandatory interactive TTY approval for context injection; no approve tools exposed to MCP agents.
26
+ - Registered project root enforcement preventing arbitrary directory traversal or rogue MCP workspace configurations.
@@ -0,0 +1,12 @@
1
+ # Default code owner
2
+ * @raunaknayak12
3
+
4
+ # Security-sensitive modules requiring maintainer review
5
+ src/swallo/redact/ @raunaknayak12
6
+ src/swallo/store/ledger.py @raunaknayak12
7
+ src/swallo/repo/paths.py @raunaknayak12
8
+ src/swallo/render/sanitize.py @raunaknayak12
9
+ src/swallo/capture/importers/ @raunaknayak12
10
+ src/swallo/server/guards.py @raunaknayak12
11
+ src/swallo/store/registry.py @raunaknayak12
12
+ src/swallo/store/signing.py @raunaknayak12
@@ -0,0 +1,127 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ **conduct@swallo.dev** (or by contacting project maintainers privately).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][mozilla-coc].
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
126
+ [mozilla-coc]: https://github.com/mozilla/diversity
127
+
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ Thanks for helping. This project handles private conversation data, so changes are reviewed with extra care.
4
+
5
+ ## Ground rules
6
+
7
+ - By contributing you agree your contributions are dual-licensed under both the MIT License and the Apache License, Version 2.0.
8
+ - Pure Python. New runtime dependencies need a written justification (see `docs/TRD.md`, dependency policy).
9
+ - No network access in the core. Optional features (`[remote]`) must be opt-in and off by default.
10
+ - Never log, print or store secret or transcript text in error paths. Tests enforce this.
11
+ - Security-sensitive modules (`redact/`, `store/ledger.py`, `repo/paths.py`, `render/sanitize.py`, `capture/importers/`, `server/guards.py`, `store/registry.py`, `store/signing.py`) require review from a code owner.
12
+
13
+ ## Development setup
14
+
15
+ ```
16
+ git clone <repo>
17
+ cd swallo
18
+ python -m venv .venv && source .venv/bin/activate
19
+ pip install -e ".[dev]"
20
+ pytest
21
+ ruff check . && ruff format --check . && mypy src
22
+ ```
23
+
24
+ ## Pull requests
25
+
26
+ 1. Open an issue first for non-trivial changes.
27
+ 2. Add tests. Parsers and path handling need property-based or fuzz tests.
28
+ 3. Update docs and `CHANGELOG.md`.
29
+ 4. Schema changes need a version bump, a migrator and a fixture for the old version (`docs/PACKET_SCHEMA.md`).
30
+ 5. Benchmark or security claims in docs must match what a test actually shows.
31
+
32
+ ## Contributing benchmark data
33
+
34
+ Only consented, redacted transcripts. See `docs/BENCHMARKS.md` and `docs/templates/ANNOTATION_GUIDE.md`. Never include real secrets or personal data.
35
+
36
+ ## Code of conduct
37
+
38
+ Please review and adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) (Contributor Covenant v2.1). Violations can be reported to conduct@swallo.dev.