codebatch 1.0.1__tar.gz → 1.0.2__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 (149) hide show
  1. {codebatch-1.0.1 → codebatch-1.0.2}/.github/workflows/ci.yml +168 -168
  2. codebatch-1.0.2/.github/workflows/dogfood.yml +165 -0
  3. {codebatch-1.0.1 → codebatch-1.0.2}/.github/workflows/pages.yml +50 -50
  4. {codebatch-1.0.1 → codebatch-1.0.2}/.github/workflows/publish.yml +140 -140
  5. {codebatch-1.0.1 → codebatch-1.0.2}/.gitignore +52 -52
  6. {codebatch-1.0.1 → codebatch-1.0.2}/.spec_baseline_hash +1 -1
  7. {codebatch-1.0.1 → codebatch-1.0.2}/CHANGELOG.md +140 -130
  8. {codebatch-1.0.1 → codebatch-1.0.2}/Dockerfile +15 -15
  9. {codebatch-1.0.1 → codebatch-1.0.2}/LICENSE +21 -21
  10. {codebatch-1.0.1 → codebatch-1.0.2}/PKG-INFO +1 -1
  11. {codebatch-1.0.1 → codebatch-1.0.2}/README.es.md +165 -165
  12. {codebatch-1.0.1 → codebatch-1.0.2}/README.fr.md +165 -165
  13. {codebatch-1.0.1 → codebatch-1.0.2}/README.hi.md +165 -165
  14. {codebatch-1.0.1 → codebatch-1.0.2}/README.it.md +165 -165
  15. {codebatch-1.0.1 → codebatch-1.0.2}/README.ja.md +165 -165
  16. {codebatch-1.0.1 → codebatch-1.0.2}/README.md +194 -194
  17. {codebatch-1.0.1 → codebatch-1.0.2}/README.pt-BR.md +165 -165
  18. {codebatch-1.0.1 → codebatch-1.0.2}/README.zh.md +165 -165
  19. {codebatch-1.0.1 → codebatch-1.0.2}/SCORECARD.md +44 -44
  20. {codebatch-1.0.1 → codebatch-1.0.2}/SECURITY.md +29 -29
  21. {codebatch-1.0.1 → codebatch-1.0.2}/SHIP_GATE.md +80 -80
  22. {codebatch-1.0.1 → codebatch-1.0.2}/SPEC.md +342 -342
  23. {codebatch-1.0.1 → codebatch-1.0.2}/docs/GATES.md +1000 -1000
  24. {codebatch-1.0.1 → codebatch-1.0.2}/docs/INTEGRATION.md +359 -359
  25. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE2_ACCEPTANCE.md +158 -158
  26. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE2_CHARTER.md +175 -175
  27. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE2_RULES.md +142 -142
  28. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE3_CHARTER.md +183 -183
  29. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE3_GATES.md +94 -94
  30. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE6_CHARTER.md +181 -181
  31. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE7_CHARTER.md +314 -314
  32. {codebatch-1.0.1 → codebatch-1.0.2}/docs/PHASE8_CHARTER.md +333 -333
  33. {codebatch-1.0.1 → codebatch-1.0.2}/docs/TASKS.md +533 -533
  34. {codebatch-1.0.1 → codebatch-1.0.2}/docs/index.md +50 -50
  35. {codebatch-1.0.1 → codebatch-1.0.2}/llms.txt +81 -81
  36. {codebatch-1.0.1 → codebatch-1.0.2}/pyproject.toml +55 -55
  37. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/api.schema.json +242 -242
  38. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/batch.schema.json +53 -53
  39. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/chunk-manifest.schema.json +72 -72
  40. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/error.schema.json +40 -40
  41. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/event-record.schema.json +75 -75
  42. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/files-index-record.schema.json +55 -55
  43. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/gate-result.schema.json +124 -124
  44. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/output-record.schema.json +79 -79
  45. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/plan.schema.json +61 -61
  46. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/snapshot.schema.json +73 -73
  47. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/state.schema.json +89 -89
  48. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/store.schema.json +38 -38
  49. {codebatch-1.0.1 → codebatch-1.0.2}/schemas/task.schema.json +91 -91
  50. {codebatch-1.0.1 → codebatch-1.0.2}/scripts/check_no_network.py +149 -149
  51. {codebatch-1.0.1 → codebatch-1.0.2}/scripts/check_spec_protected.py +115 -115
  52. {codebatch-1.0.1 → codebatch-1.0.2}/scripts/check_truth_stores.py +158 -158
  53. {codebatch-1.0.1 → codebatch-1.0.2}/site/astro.config.mjs +24 -24
  54. {codebatch-1.0.1 → codebatch-1.0.2}/site/package-lock.json +7539 -7539
  55. {codebatch-1.0.1 → codebatch-1.0.2}/site/package.json +18 -18
  56. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content/docs/handbook/commands.md +130 -130
  57. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content/docs/handbook/getting-started.md +151 -151
  58. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content/docs/handbook/index.md +52 -52
  59. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content/docs/handbook/reference.md +134 -134
  60. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content/docs/handbook/usage.md +160 -160
  61. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/content.config.ts +7 -7
  62. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/pages/index.astro +33 -33
  63. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/site-config.ts +120 -120
  64. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/styles/global.css +3 -3
  65. {codebatch-1.0.1 → codebatch-1.0.2}/site/src/styles/starlight-custom.css +17 -17
  66. {codebatch-1.0.1 → codebatch-1.0.2}/site/tsconfig.json +5 -5
  67. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/__init__.py +9 -9
  68. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/__main__.py +7 -7
  69. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/batch.py +374 -374
  70. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/cache.py +575 -575
  71. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/cache_meta.py +245 -245
  72. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/cas.py +170 -170
  73. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/cli.py +2640 -2553
  74. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/common.py +109 -109
  75. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/errors.py +287 -287
  76. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/gates/__init__.py +19 -19
  77. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/gates/definitions.py +670 -670
  78. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/gates/registry.py +222 -222
  79. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/gates/result.py +277 -277
  80. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/gates/runner.py +252 -252
  81. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/index_build.py +222 -222
  82. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/paths.py +216 -216
  83. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/query.py +481 -481
  84. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/registry.py +557 -557
  85. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/runner.py +515 -515
  86. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/snapshot.py +352 -352
  87. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/store.py +159 -159
  88. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/tasks/__init__.py +41 -41
  89. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/tasks/analyze.py +348 -348
  90. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/tasks/lint.py +1458 -1458
  91. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/tasks/parse.py +813 -813
  92. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/tasks/symbols.py +703 -703
  93. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/ui/__init__.py +87 -87
  94. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/ui/diff.py +412 -412
  95. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/ui/format.py +439 -439
  96. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/ui/pager.py +153 -153
  97. {codebatch-1.0.1 → codebatch-1.0.2}/src/codebatch/workflow.py +551 -551
  98. {codebatch-1.0.1 → codebatch-1.0.2}/tests/README.md +52 -52
  99. {codebatch-1.0.1 → codebatch-1.0.2}/tests/conftest.py +9 -9
  100. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/crlf_example.txt +3 -3
  101. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/emoji_/360/237/216/211.md +5 -5
  102. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/hello.py +11 -11
  103. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/unicode_/350/267/257/345/276/204.txt +3 -3
  104. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus-windows-only/CaseA.cs +9 -9
  105. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus-windows-only/casea.cs.expected +12 -12
  106. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus_lint/messy.py +14 -14
  107. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/golden/snapshot/files.index.jsonl +6 -6
  108. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/golden/snapshot/snapshot.json +19 -19
  109. {codebatch-1.0.1 → codebatch-1.0.2}/tests/golden/ui/json_basic.json +12 -12
  110. {codebatch-1.0.1 → codebatch-1.0.2}/tests/golden/ui/jsonl_basic.jsonl +3 -3
  111. {codebatch-1.0.1 → codebatch-1.0.2}/tests/golden/ui/table_basic.txt +5 -5
  112. {codebatch-1.0.1 → codebatch-1.0.2}/tests/golden/ui/table_no_header.txt +3 -3
  113. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_analyze_task.py +238 -238
  114. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_batch.py +176 -176
  115. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_cache_perf.py +139 -139
  116. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_cas.py +116 -116
  117. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_diff_commands.py +448 -448
  118. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_diff_engine.py +355 -355
  119. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_e2e_acceptance.py +306 -306
  120. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_errors.py +326 -326
  121. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_explain.py +350 -350
  122. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_gate_cli.py +336 -336
  123. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_gates.py +457 -457
  124. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_index_build.py +531 -531
  125. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_inspect.py +296 -296
  126. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_lint_js.py +0 -2
  127. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_lint_task.py +397 -397
  128. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_parallel.py +0 -2
  129. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_parse_task.py +228 -228
  130. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_paths.py +170 -170
  131. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_phase2_gates.py +582 -582
  132. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_phase6_gates.py +528 -528
  133. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_phase7_gates.py +399 -399
  134. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_phase8_gates.py +1655 -1655
  135. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_query.py +183 -183
  136. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_runner.py +252 -252
  137. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_schema_validation.py +224 -224
  138. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_snapshot.py +145 -145
  139. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_store.py +140 -140
  140. codebatch-1.0.2/tests/test_store_stats.py +92 -0
  141. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_symbols_task.py +430 -430
  142. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_ui_format.py +374 -374
  143. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_version.py +0 -1
  144. {codebatch-1.0.1 → codebatch-1.0.2}/tests/test_workflow.py +256 -256
  145. {codebatch-1.0.1 → codebatch-1.0.2}/uv.lock +693 -693
  146. {codebatch-1.0.1 → codebatch-1.0.2}/.polyglot-cache.json +0 -0
  147. {codebatch-1.0.1 → codebatch-1.0.2}/assets/logo.png +0 -0
  148. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/binary.bin +0 -0
  149. {codebatch-1.0.1 → codebatch-1.0.2}/tests/fixtures/corpus/empty.txt +0 -0
@@ -1,168 +1,168 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- paths:
7
- - 'src/**'
8
- - 'tests/**'
9
- - 'schemas/**'
10
- - 'scripts/**'
11
- - 'pyproject.toml'
12
- - '.github/workflows/**'
13
- pull_request:
14
- branches: [main]
15
- paths:
16
- - 'src/**'
17
- - 'tests/**'
18
- - 'schemas/**'
19
- - 'scripts/**'
20
- - 'pyproject.toml'
21
- - '.github/workflows/**'
22
- workflow_dispatch:
23
-
24
- concurrency:
25
- group: ${{ github.workflow }}-${{ github.ref }}
26
- cancel-in-progress: true
27
-
28
- jobs:
29
- test:
30
- runs-on: ubuntu-latest
31
- strategy:
32
- matrix:
33
- python-version: ["3.12", "3.13"]
34
-
35
- steps:
36
- - uses: actions/checkout@v4
37
-
38
- - name: Set up Python ${{ matrix.python-version }}
39
- uses: actions/setup-python@v6
40
- with:
41
- python-version: ${{ matrix.python-version }}
42
- cache: 'pip'
43
-
44
- - name: Install dependencies
45
- run: |
46
- python -m pip install --upgrade pip
47
- pip install -e ".[dev]"
48
-
49
- - name: Run tests with coverage
50
- run: |
51
- python -m pytest tests/ -v --tb=short \
52
- --cov=codebatch --cov-report=term-missing --cov-report=json \
53
- --cov-fail-under=70
54
-
55
- gates:
56
- runs-on: ubuntu-latest
57
- needs: test # Run gates after tests pass
58
-
59
- steps:
60
- - uses: actions/checkout@v4
61
-
62
- - name: Set up Python
63
- uses: actions/setup-python@v6
64
- with:
65
- python-version: "3.12"
66
- cache: 'pip'
67
-
68
- - name: Install dependencies
69
- run: |
70
- python -m pip install --upgrade pip
71
- pip install -e ".[dev]"
72
-
73
- - name: Create test store and run gates
74
- run: |
75
- # Create a test store with sample data
76
- python -c "
77
- from pathlib import Path
78
- from codebatch.store import init_store
79
- from codebatch.snapshot import SnapshotBuilder
80
- from codebatch.batch import BatchManager
81
- from codebatch.runner import ShardRunner
82
- from codebatch.common import object_shard_prefix
83
- from codebatch.tasks import get_executor
84
-
85
- # Initialize store
86
- store = Path('test_store')
87
- store.mkdir()
88
- init_store(store)
89
-
90
- # Create corpus
91
- corpus = Path('test_corpus')
92
- corpus.mkdir()
93
- (corpus / 'sample.py').write_text('print(\"hello\")')
94
-
95
- # Create snapshot
96
- builder = SnapshotBuilder(store)
97
- snapshot_id = builder.build(corpus)
98
-
99
- # Create batch
100
- manager = BatchManager(store)
101
- batch_id = manager.init_batch(snapshot_id, 'full')
102
-
103
- # Run tasks
104
- runner = ShardRunner(store)
105
- records = builder.load_file_index(snapshot_id)
106
- shards = set(object_shard_prefix(r['object']) for r in records)
107
- plan = manager.load_plan(batch_id)
108
-
109
- for shard_id in shards:
110
- for task_def in plan['tasks']:
111
- executor = get_executor(task_def['task_id'])
112
- runner.run_shard(batch_id, task_def['task_id'], shard_id, executor)
113
-
114
- print(f'BATCH_ID={batch_id}')
115
- " > setup_output.txt
116
-
117
- BATCH_ID=$(grep 'BATCH_ID=' setup_output.txt | cut -d= -f2)
118
- echo "BATCH_ID=$BATCH_ID" >> $GITHUB_ENV
119
-
120
- - name: List available gates
121
- run: |
122
- python -m codebatch gate-list
123
-
124
- - name: Run release gate bundle
125
- run: |
126
- python -m codebatch gate-bundle release \
127
- --store ./test_store \
128
- --batch $BATCH_ID \
129
- --json > gate-results.json
130
-
131
- - name: Show gate results
132
- run: |
133
- cat gate-results.json | python -m json.tool
134
-
135
- - name: Upload gate artifacts on failure
136
- if: failure()
137
- uses: actions/upload-artifact@v4
138
- with:
139
- name: gate-artifacts
140
- path: |
141
- ./test_store/indexes/gate_artifacts/
142
- gate-results.json
143
- retention-days: 7
144
-
145
- lint:
146
- runs-on: ubuntu-latest
147
-
148
- steps:
149
- - uses: actions/checkout@v4
150
-
151
- - name: Set up Python
152
- uses: actions/setup-python@v6
153
- with:
154
- python-version: "3.12"
155
- cache: 'pip'
156
-
157
- - name: Install dependencies
158
- run: |
159
- python -m pip install --upgrade pip
160
- pip install ruff mypy
161
-
162
- - name: Run ruff check
163
- run: |
164
- ruff check src/ tests/ || true
165
-
166
- - name: Run ruff format check
167
- run: |
168
- ruff format --check src/ tests/ || true
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'src/**'
8
+ - 'tests/**'
9
+ - 'schemas/**'
10
+ - 'scripts/**'
11
+ - 'pyproject.toml'
12
+ - '.github/workflows/**'
13
+ pull_request:
14
+ branches: [main]
15
+ paths:
16
+ - 'src/**'
17
+ - 'tests/**'
18
+ - 'schemas/**'
19
+ - 'scripts/**'
20
+ - 'pyproject.toml'
21
+ - '.github/workflows/**'
22
+ workflow_dispatch:
23
+
24
+ concurrency:
25
+ group: ${{ github.workflow }}-${{ github.ref }}
26
+ cancel-in-progress: true
27
+
28
+ jobs:
29
+ test:
30
+ runs-on: ubuntu-latest
31
+ strategy:
32
+ matrix:
33
+ python-version: ["3.12", "3.13"]
34
+
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+
38
+ - name: Set up Python ${{ matrix.python-version }}
39
+ uses: actions/setup-python@v6
40
+ with:
41
+ python-version: ${{ matrix.python-version }}
42
+ cache: 'pip'
43
+
44
+ - name: Install dependencies
45
+ run: |
46
+ python -m pip install --upgrade pip
47
+ pip install -e ".[dev]"
48
+
49
+ - name: Run tests with coverage
50
+ run: |
51
+ python -m pytest tests/ -v --tb=short \
52
+ --cov=codebatch --cov-report=term-missing --cov-report=json \
53
+ --cov-fail-under=70
54
+
55
+ gates:
56
+ runs-on: ubuntu-latest
57
+ needs: test # Run gates after tests pass
58
+
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+
62
+ - name: Set up Python
63
+ uses: actions/setup-python@v6
64
+ with:
65
+ python-version: "3.12"
66
+ cache: 'pip'
67
+
68
+ - name: Install dependencies
69
+ run: |
70
+ python -m pip install --upgrade pip
71
+ pip install -e ".[dev]"
72
+
73
+ - name: Create test store and run gates
74
+ run: |
75
+ # Create a test store with sample data
76
+ python -c "
77
+ from pathlib import Path
78
+ from codebatch.store import init_store
79
+ from codebatch.snapshot import SnapshotBuilder
80
+ from codebatch.batch import BatchManager
81
+ from codebatch.runner import ShardRunner
82
+ from codebatch.common import object_shard_prefix
83
+ from codebatch.tasks import get_executor
84
+
85
+ # Initialize store
86
+ store = Path('test_store')
87
+ store.mkdir()
88
+ init_store(store)
89
+
90
+ # Create corpus
91
+ corpus = Path('test_corpus')
92
+ corpus.mkdir()
93
+ (corpus / 'sample.py').write_text('print(\"hello\")')
94
+
95
+ # Create snapshot
96
+ builder = SnapshotBuilder(store)
97
+ snapshot_id = builder.build(corpus)
98
+
99
+ # Create batch
100
+ manager = BatchManager(store)
101
+ batch_id = manager.init_batch(snapshot_id, 'full')
102
+
103
+ # Run tasks
104
+ runner = ShardRunner(store)
105
+ records = builder.load_file_index(snapshot_id)
106
+ shards = set(object_shard_prefix(r['object']) for r in records)
107
+ plan = manager.load_plan(batch_id)
108
+
109
+ for shard_id in shards:
110
+ for task_def in plan['tasks']:
111
+ executor = get_executor(task_def['task_id'])
112
+ runner.run_shard(batch_id, task_def['task_id'], shard_id, executor)
113
+
114
+ print(f'BATCH_ID={batch_id}')
115
+ " > setup_output.txt
116
+
117
+ BATCH_ID=$(grep 'BATCH_ID=' setup_output.txt | cut -d= -f2)
118
+ echo "BATCH_ID=$BATCH_ID" >> $GITHUB_ENV
119
+
120
+ - name: List available gates
121
+ run: |
122
+ python -m codebatch gate-list
123
+
124
+ - name: Run release gate bundle
125
+ run: |
126
+ python -m codebatch gate-bundle release \
127
+ --store ./test_store \
128
+ --batch $BATCH_ID \
129
+ --json > gate-results.json
130
+
131
+ - name: Show gate results
132
+ run: |
133
+ cat gate-results.json | python -m json.tool
134
+
135
+ - name: Upload gate artifacts on failure
136
+ if: failure()
137
+ uses: actions/upload-artifact@v4
138
+ with:
139
+ name: gate-artifacts
140
+ path: |
141
+ ./test_store/indexes/gate_artifacts/
142
+ gate-results.json
143
+ retention-days: 7
144
+
145
+ lint:
146
+ runs-on: ubuntu-latest
147
+
148
+ steps:
149
+ - uses: actions/checkout@v4
150
+
151
+ - name: Set up Python
152
+ uses: actions/setup-python@v6
153
+ with:
154
+ python-version: "3.12"
155
+ cache: 'pip'
156
+
157
+ - name: Install dependencies
158
+ run: |
159
+ python -m pip install --upgrade pip
160
+ pip install ruff mypy
161
+
162
+ - name: Run ruff check
163
+ run: |
164
+ ruff check src/ tests/
165
+
166
+ - name: Run ruff format check
167
+ run: |
168
+ ruff format --check src/ tests/ || true
@@ -0,0 +1,165 @@
1
+ name: Dogfood
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "src/**"
8
+ - "pyproject.toml"
9
+ - ".github/workflows/dogfood.yml"
10
+ workflow_dispatch:
11
+
12
+ concurrency:
13
+ group: dogfood-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ dogfood:
18
+ runs-on: ubuntu-latest
19
+ if: github.ref == 'refs/heads/main'
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ - run: pip install -e .
26
+
27
+ # --- Scenario: init-and-run-pipeline ---
28
+ # Exercise the real product: initialize a store and list pipelines
29
+
30
+ - name: "Step: init-store"
31
+ id: init_store
32
+ run: |
33
+ codebatch init /tmp/cb-store
34
+ if [ $? -eq 0 ]; then
35
+ echo "status=pass" >> "$GITHUB_OUTPUT"
36
+ else
37
+ echo "status=fail" >> "$GITHUB_OUTPUT"
38
+ fi
39
+
40
+ - name: "Step: list-pipelines"
41
+ id: list_pipelines
42
+ run: |
43
+ codebatch pipelines --json 2>&1 | tee /tmp/pipelines.log
44
+ if [ $? -eq 0 ]; then
45
+ echo "status=pass" >> "$GITHUB_OUTPUT"
46
+ else
47
+ echo "status=fail" >> "$GITHUB_OUTPUT"
48
+ fi
49
+
50
+ - name: "Step: verify-output"
51
+ id: verify_output
52
+ run: |
53
+ if [ -s /tmp/pipelines.log ]; then
54
+ echo "status=pass" >> "$GITHUB_OUTPUT"
55
+ else
56
+ echo "status=fail" >> "$GITHUB_OUTPUT"
57
+ fi
58
+
59
+ # --- Verdict ---
60
+
61
+ - name: Determine overall verdict
62
+ id: verdict
63
+ run: |
64
+ I="${{ steps.init_store.outputs.status }}"
65
+ L="${{ steps.list_pipelines.outputs.status }}"
66
+ V="${{ steps.verify_output.outputs.status }}"
67
+ if [ "$I" = "pass" ] && [ "$L" = "pass" ] && [ "$V" = "pass" ]; then
68
+ echo "verdict=pass" >> "$GITHUB_OUTPUT"
69
+ else
70
+ echo "verdict=fail" >> "$GITHUB_OUTPUT"
71
+ fi
72
+
73
+ # --- Build + dispatch ---
74
+
75
+ - name: Build submission
76
+ run: |
77
+ FINISHED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
78
+ cat > /tmp/submission.json << 'INNER_EOF'
79
+ {
80
+ "schema_version": "1.0.0",
81
+ "run_id": "code-batch-RUN_ID-ATTEMPT",
82
+ "repo": "REPO_SLUG",
83
+ "ref": {
84
+ "branch": "REF_NAME",
85
+ "commit_sha": "COMMIT_SHA"
86
+ },
87
+ "source": {
88
+ "provider": "github",
89
+ "workflow": "dogfood.yml",
90
+ "provider_run_id": "PROVIDER_RUN_ID",
91
+ "attempt": ATTEMPT_NUM,
92
+ "run_url": "RUN_URL_PLACEHOLDER",
93
+ "actor": "ACTOR_NAME"
94
+ },
95
+ "timing": {
96
+ "started_at": "STARTED_PLACEHOLDER",
97
+ "finished_at": "FINISHED_PLACEHOLDER",
98
+ "duration_ms": 0
99
+ },
100
+ "ci_checks": [],
101
+ "scenario_results": [
102
+ {
103
+ "scenario_id": "init-and-run-pipeline",
104
+ "scenario_name": "Initialize store and list pipelines",
105
+ "scenario_version": "1.0.0",
106
+ "product_surface": "cli",
107
+ "execution_mode": "bot",
108
+ "verdict": "VERDICT_PLACEHOLDER",
109
+ "step_results": [
110
+ { "step_id": "init-store", "status": "INIT_STATUS" },
111
+ { "step_id": "list-pipelines", "status": "LIST_STATUS" },
112
+ { "step_id": "verify-output", "status": "VERIFY_STATUS" }
113
+ ],
114
+ "evidence": [
115
+ {
116
+ "kind": "log",
117
+ "url": "RUN_URL_PLACEHOLDER",
118
+ "description": "CI run log with init and pipeline list output"
119
+ }
120
+ ],
121
+ "notes": "Bot-driven store init and pipeline listing"
122
+ }
123
+ ],
124
+ "overall_verdict": "VERDICT_PLACEHOLDER",
125
+ "notes": "Phase 2 rollout: code-batch CLI dogfood."
126
+ }
127
+ INNER_EOF
128
+
129
+ sed -i "s|REPO_SLUG|${GITHUB_REPOSITORY}|g" /tmp/submission.json
130
+ sed -i "s|REF_NAME|${GITHUB_REF_NAME}|g" /tmp/submission.json
131
+ sed -i "s|COMMIT_SHA|${GITHUB_SHA}|g" /tmp/submission.json
132
+ sed -i "s|PROVIDER_RUN_ID|${GITHUB_RUN_ID}|g" /tmp/submission.json
133
+ sed -i "s|ATTEMPT_NUM|${GITHUB_RUN_ATTEMPT}|g" /tmp/submission.json
134
+ sed -i "s|RUN_URL_PLACEHOLDER|https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}|g" /tmp/submission.json
135
+ sed -i "s|ACTOR_NAME|${GITHUB_ACTOR}|g" /tmp/submission.json
136
+ sed -i "s|STARTED_PLACEHOLDER|${{ github.event.head_commit.timestamp || github.event.repository.pushed_at }}|g" /tmp/submission.json
137
+ sed -i "s|FINISHED_PLACEHOLDER|${FINISHED_AT}|g" /tmp/submission.json
138
+ sed -i "s|code-batch-RUN_ID-ATTEMPT|code-batch-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}|g" /tmp/submission.json
139
+ sed -i "s|VERDICT_PLACEHOLDER|${{ steps.verdict.outputs.verdict }}|g" /tmp/submission.json
140
+ sed -i "s|INIT_STATUS|${{ steps.init_store.outputs.status }}|g" /tmp/submission.json
141
+ sed -i "s|LIST_STATUS|${{ steps.list_pipelines.outputs.status }}|g" /tmp/submission.json
142
+ sed -i "s|VERIFY_STATUS|${{ steps.verify_output.outputs.status }}|g" /tmp/submission.json
143
+
144
+ jq empty /tmp/submission.json
145
+ echo "Submission built:"
146
+ jq '.run_id, .overall_verdict' /tmp/submission.json
147
+
148
+ - name: Dispatch to dogfood-labs
149
+ env:
150
+ GH_TOKEN: ${{ secrets.DOGFOOD_TOKEN }}
151
+ run: |
152
+ SUBMISSION=$(cat /tmp/submission.json)
153
+ RUN_ID=$(echo "$SUBMISSION" | jq -r '.run_id')
154
+
155
+ if [ -z "$GH_TOKEN" ]; then
156
+ echo "::warning::DOGFOOD_TOKEN not set — skipping dispatch"
157
+ exit 0
158
+ fi
159
+
160
+ jq -n --argjson sub "$SUBMISSION" \
161
+ '{"event_type":"dogfood_submission","client_payload":{"submission":$sub}}' \
162
+ | gh api repos/mcp-tool-shop-org/dogfood-labs/dispatches \
163
+ --input - --silent
164
+
165
+ echo "Dispatched $RUN_ID to dogfood-labs"
@@ -1,50 +1,50 @@
1
- name: Deploy site to GitHub Pages
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- paths:
7
- - 'site/**'
8
- - '.github/workflows/pages.yml'
9
- workflow_dispatch:
10
-
11
- concurrency:
12
- group: ${{ github.workflow }}-${{ github.ref }}
13
- cancel-in-progress: true
14
-
15
- permissions:
16
- contents: read
17
- pages: write
18
- id-token: write
19
-
20
- jobs:
21
- build:
22
- runs-on: ubuntu-latest
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- - uses: actions/setup-node@v4
27
- with:
28
- node-version: 22
29
-
30
- - name: Install site dependencies
31
- working-directory: site
32
- run: npm ci
33
-
34
- - name: Build site
35
- working-directory: site
36
- run: npm run build
37
-
38
- - uses: actions/upload-pages-artifact@v3
39
- with:
40
- path: site/dist
41
-
42
- deploy:
43
- needs: build
44
- runs-on: ubuntu-latest
45
- environment:
46
- name: github-pages
47
- url: ${{ steps.deployment.outputs.page_url }}
48
- steps:
49
- - id: deployment
50
- uses: actions/deploy-pages@v4
1
+ name: Deploy site to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'site/**'
8
+ - '.github/workflows/pages.yml'
9
+ workflow_dispatch:
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ permissions:
16
+ contents: read
17
+ pages: write
18
+ id-token: write
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: actions/setup-node@v4
27
+ with:
28
+ node-version: 22
29
+
30
+ - name: Install site dependencies
31
+ working-directory: site
32
+ run: npm ci
33
+
34
+ - name: Build site
35
+ working-directory: site
36
+ run: npm run build
37
+
38
+ - uses: actions/upload-pages-artifact@v3
39
+ with:
40
+ path: site/dist
41
+
42
+ deploy:
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ environment:
46
+ name: github-pages
47
+ url: ${{ steps.deployment.outputs.page_url }}
48
+ steps:
49
+ - id: deployment
50
+ uses: actions/deploy-pages@v4