blitz-cli 0.14.0__tar.gz → 0.16.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.
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/.gitignore +7 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/PKG-INFO +5 -5
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/README.md +4 -4
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/__init__.py +1 -1
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_activity.py +30 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_collect.py +3 -3
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_collect_http.py +2 -2
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_collect_server.py +3 -3
- blitz_cli-0.16.1/blitz_cli/_corpus.py +542 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_gitignore.py +19 -6
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_train.py +15 -15
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/cli.py +37 -14
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/implement.md +1 -1
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/scripts/bash/check-prerequisites.sh +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/scripts/bash/common.sh +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/scripts/bash/create-new-feature.sh +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/scripts/bash/setup-plan.sh +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/scripts/bash/setup-tasks.sh +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/templates/locker_room_Makefile.tmpl +1 -1
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/templates/locker_room_README.md.tmpl +5 -5
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/templates/locker_room_compose.yml.tmpl +20 -18
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/pyproject.toml +1 -1
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/contracts/ensure-rules.md +8 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/contracts/gitignore-block.md +11 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/checklists/requirements.md +38 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/contracts/gitignore-block.md +94 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/data-model.md +68 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/plan.md +144 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/quickstart.md +160 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/research.md +68 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/spec.md +224 -0
- blitz_cli-0.16.1/specs/006-init-ignore-generated/tasks.md +277 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/checklists/requirements.md +38 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/contracts/activity-db-v2.md +93 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/data-model.md +81 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/plan.md +90 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/quickstart.md +109 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/research.md +182 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/spec.md +151 -0
- blitz_cli-0.16.1/specs/007-usage-data-layer/tasks.md +161 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_activity.py +76 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_cli.py +54 -1
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_collect.py +2 -2
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_collect_http.py +9 -9
- blitz_cli-0.16.1/tests/test_corpus.py +847 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_gitignore.py +58 -7
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_scaffold.py +18 -3
- blitz_cli-0.14.0/.blitz/templates/plan-template.md +0 -113
- blitz_cli-0.14.0/.blitz/templates/tasks-template.md +0 -252
- blitz_cli-0.14.0/blitz_cli/_corpus.py +0 -260
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/scripts/bash/check-prerequisites.sh +0 -195
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/scripts/bash/common.sh +0 -692
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/scripts/bash/create-new-feature.sh +0 -301
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/scripts/bash/setup-plan.sh +0 -83
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/scripts/bash/setup-tasks.sh +0 -91
- blitz_cli-0.14.0/blitz_cli/playbooks/scaffold/.blitz/templates/spec-template.md +0 -131
- blitz_cli-0.14.0/tests/test_corpus.py +0 -350
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/.blitz/memory/playbook.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/.github/workflows/homebrew.yml +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/.github/workflows/publish.yml +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/.mcp.json +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/LICENSE +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_code_graph.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_dataset.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_execute.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_git.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_make.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_ontology.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_playbooks.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_redact.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_scaffold.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/_tool_schemas.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/__init__.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/__init__.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/analyze.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/clarify.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/playbook.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/specify.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/commands/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/scaffold/.blitz/memory/playbook.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/scaffold/.blitz/templates/plan-template.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1/blitz_cli/playbooks/scaffold}/.blitz/templates/spec-template.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/scaffold/.blitz/templates/tasks-template.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/workspace/__init__.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/playbooks/workspace/huddle.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/templates/__init__.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/blitz_cli/templates/workspace_playbook.md.tmpl +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/checklists/requirements.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/contracts/cli-commands.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/quickstart.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/research.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/spec.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/001-cli-model-namespace/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/checklists/requirements.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/contracts/experimental-labels.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/data-model.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/quickstart.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/research.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/spec.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/002-label-experimental-surfaces/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/checklists/requirements.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/contracts/cli-output.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/data-model.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/quickstart.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/research.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/spec.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/003-init-gitignore-rules/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/checklists/requirements.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/contracts/cli.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/contracts/export-format.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/data-model.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/quickstart.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/research.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/spec.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/004-dpo-collect-pairs/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/checklists/requirements.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/contracts/client-sink.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/contracts/ingest-api.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/data-model.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/plan.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/quickstart.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/research.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/spec.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/specs/005-collect-ingest-endpoint/tasks.md +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_collect_server.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_execute.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_make.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_ontology.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_playbooks.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_redact.py +0 -0
- {blitz_cli-0.14.0 → blitz_cli-0.16.1}/tests/test_tool_schemas.py +0 -0
|
@@ -21,3 +21,10 @@ dist/
|
|
|
21
21
|
# the blitz.toml, which is not always the repo root. The `*` covers the SQLite
|
|
22
22
|
# -wal/-shm sidecars.
|
|
23
23
|
**/.blitz/traces.db*
|
|
24
|
+
|
|
25
|
+
# Regenerable `blitz init` output: scripts/ and templates/ are refreshed from the
|
|
26
|
+
# package on --force, so a clone reproduces them exactly by running init.
|
|
27
|
+
# memory/playbook.md is deliberately NOT here: it is seeded once and never
|
|
28
|
+
# overwritten, so it stays tracked.
|
|
29
|
+
/.blitz/scripts/
|
|
30
|
+
/.blitz/templates/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blitz-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.1
|
|
4
4
|
Summary: Developer CLI for Blitz locker-room: spec-driven playbooks, a codebase/huddle ontology graph with an MCP tool, and the composable watcher/trainer/graph containers.
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -79,16 +79,16 @@ Ollama endpoint comes from `--ollama-url` or `OLLAMA_HOST`; the model from
|
|
|
79
79
|
|
|
80
80
|
`blitz model execute --collect` records every generation attempt as DPO
|
|
81
81
|
training data. By default it writes straight to the activity SQLite database
|
|
82
|
-
(`
|
|
82
|
+
(`BLITZ_ACTIVITY_DB_PATH`, else `data/activity.db`). With `BLITZ_COLLECT_ENDPOINT` set,
|
|
83
83
|
the same writes go over HTTP JSON to a collect ingest server instead, so the
|
|
84
84
|
collector needs no filesystem access to the database:
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
# on the locker-room node (default port 1739, binds all interfaces, no auth):
|
|
88
|
-
|
|
88
|
+
BLITZ_ACTIVITY_DB_PATH=data/activity.db blitz locker-room collect-serve
|
|
89
89
|
|
|
90
90
|
# on the collecting machine:
|
|
91
|
-
|
|
91
|
+
BLITZ_COLLECT_ENDPOINT=http://locker-room-host:1739 blitz model execute --collect
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Each attempt is acknowledged by the endpoint before the next model call
|
|
@@ -151,7 +151,7 @@ The `mcp` role serves this: point an agent's MCP config at
|
|
|
151
151
|
|
|
152
152
|
`blitz locker-room train` runs an on-demand QLoRA fine-tune of the watcher corpus
|
|
153
153
|
in the trainer container (needs a GPU); adapters land in `./train-out`. Override
|
|
154
|
-
the base model with `
|
|
154
|
+
the base model with `BLITZ_BASE_MODEL_HF` or `blitz locker-room init --base-model`.
|
|
155
155
|
|
|
156
156
|
## Activity: replay a coding-agent session
|
|
157
157
|
|
|
@@ -60,16 +60,16 @@ Ollama endpoint comes from `--ollama-url` or `OLLAMA_HOST`; the model from
|
|
|
60
60
|
|
|
61
61
|
`blitz model execute --collect` records every generation attempt as DPO
|
|
62
62
|
training data. By default it writes straight to the activity SQLite database
|
|
63
|
-
(`
|
|
63
|
+
(`BLITZ_ACTIVITY_DB_PATH`, else `data/activity.db`). With `BLITZ_COLLECT_ENDPOINT` set,
|
|
64
64
|
the same writes go over HTTP JSON to a collect ingest server instead, so the
|
|
65
65
|
collector needs no filesystem access to the database:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
# on the locker-room node (default port 1739, binds all interfaces, no auth):
|
|
69
|
-
|
|
69
|
+
BLITZ_ACTIVITY_DB_PATH=data/activity.db blitz locker-room collect-serve
|
|
70
70
|
|
|
71
71
|
# on the collecting machine:
|
|
72
|
-
|
|
72
|
+
BLITZ_COLLECT_ENDPOINT=http://locker-room-host:1739 blitz model execute --collect
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Each attempt is acknowledged by the endpoint before the next model call
|
|
@@ -132,7 +132,7 @@ The `mcp` role serves this: point an agent's MCP config at
|
|
|
132
132
|
|
|
133
133
|
`blitz locker-room train` runs an on-demand QLoRA fine-tune of the watcher corpus
|
|
134
134
|
in the trainer container (needs a GPU); adapters land in `./train-out`. Override
|
|
135
|
-
the base model with `
|
|
135
|
+
the base model with `BLITZ_BASE_MODEL_HF` or `blitz locker-room init --base-model`.
|
|
136
136
|
|
|
137
137
|
## Activity: replay a coding-agent session
|
|
138
138
|
|
|
@@ -21,6 +21,9 @@ from pathlib import Path
|
|
|
21
21
|
from typing import Optional
|
|
22
22
|
|
|
23
23
|
_SYSTEM_REMINDER_RE = re.compile(r"<system-reminder>.*?</system-reminder>\s*", re.DOTALL)
|
|
24
|
+
# Slash-command invocations recorded inside the raw user prompt, e.g.
|
|
25
|
+
# <command-name>/huddle</command-name>. Matched BEFORE _clean_prompt() runs.
|
|
26
|
+
_COMMAND_NAME_RE = re.compile(r"<command-name>\s*(/?[\w:-]+)\s*</command-name>")
|
|
24
27
|
# Compact, single-line caps for the terminal's quick-glance labels.
|
|
25
28
|
_MAX_SUMMARY_LEN = 80
|
|
26
29
|
_MAX_SNIPPET_LEN = 200
|
|
@@ -57,6 +60,9 @@ class Turn:
|
|
|
57
60
|
cache_creation_tokens: int = 0
|
|
58
61
|
models: list = field(default_factory=list)
|
|
59
62
|
turn_uuid: Optional[str] = None
|
|
63
|
+
commands: list = field(default_factory=list)
|
|
64
|
+
did_git_push: bool = False
|
|
65
|
+
did_create_pr: bool = False
|
|
60
66
|
|
|
61
67
|
|
|
62
68
|
@dataclass
|
|
@@ -198,6 +204,18 @@ def _prompt_text(content) -> Optional[str]:
|
|
|
198
204
|
return None
|
|
199
205
|
|
|
200
206
|
|
|
207
|
+
def _raw_prompt_text(content) -> str:
|
|
208
|
+
"""The user record's prompt text with nothing stripped, for extraction
|
|
209
|
+
of markers (like <command-name> blocks) that _clean_prompt may remove."""
|
|
210
|
+
if isinstance(content, str):
|
|
211
|
+
return content
|
|
212
|
+
if isinstance(content, list):
|
|
213
|
+
return "\n".join(
|
|
214
|
+
b.get("text", "") for b in content if isinstance(b, dict) and b.get("type") == "text"
|
|
215
|
+
)
|
|
216
|
+
return ""
|
|
217
|
+
|
|
218
|
+
|
|
201
219
|
def _truncate(text: str, limit: int) -> str:
|
|
202
220
|
"""Collapse whitespace to one line and cap length — for compact labels."""
|
|
203
221
|
text = " ".join(text.split())
|
|
@@ -520,6 +538,12 @@ def parse_session(path: Path, file_history_dir: Optional[Path] = None) -> Sessio
|
|
|
520
538
|
if prompt is not None:
|
|
521
539
|
_finalize()
|
|
522
540
|
current = Turn(timestamp=rec.get("timestamp"), prompt=prompt, turn_uuid=rec.get("uuid"))
|
|
541
|
+
# Slash commands are extracted from the RAW prompt text,
|
|
542
|
+
# before _clean_prompt strips anything (research R1).
|
|
543
|
+
current.commands = [
|
|
544
|
+
name if name.startswith("/") else f"/{name}"
|
|
545
|
+
for name in _COMMAND_NAME_RE.findall(_raw_prompt_text(content))
|
|
546
|
+
]
|
|
523
547
|
continue
|
|
524
548
|
# tool-result line: match each block back to its tool_use action
|
|
525
549
|
if isinstance(content, list):
|
|
@@ -574,6 +598,12 @@ def parse_session(path: Path, file_history_dir: Optional[Path] = None) -> Sessio
|
|
|
574
598
|
file_history_dir, session_id, tool_name, tool_input or {},
|
|
575
599
|
file_path, backup_info["backupFileName"],
|
|
576
600
|
)
|
|
601
|
+
if tool_name == "Bash":
|
|
602
|
+
command = (tool_input or {}).get("command") or ""
|
|
603
|
+
if "git push" in command:
|
|
604
|
+
current.did_git_push = True
|
|
605
|
+
if "gh pr create" in command:
|
|
606
|
+
current.did_create_pr = True
|
|
577
607
|
current.actions.append(action)
|
|
578
608
|
if block.get("id"):
|
|
579
609
|
pending_tool_uses[block["id"]] = action
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
`CollectStore` owns four tables (`collect_runs`, `collect_attempts`,
|
|
5
5
|
`dpo_pairs`, `sft_queue`) in the same locker-room activity database that
|
|
6
6
|
`_corpus.py`'s `TurnStore` writes its transcript corpus to (default
|
|
7
|
-
`data/activity.db`, env override `
|
|
7
|
+
`data/activity.db`, env override `BLITZ_ACTIVITY_DB_PATH`, WAL journal). Like
|
|
8
8
|
`TurnStore`, it is the one writer of its tables and creates its schema on
|
|
9
9
|
first connect.
|
|
10
10
|
|
|
@@ -124,9 +124,9 @@ SFT_FIELDS = ("run_id", "task_id", "prompt_messages_json")
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
def default_db_path() -> Path:
|
|
127
|
-
"""The activity database path:
|
|
127
|
+
"""The activity database path: BLITZ_ACTIVITY_DB_PATH env override, else the
|
|
128
128
|
conventional data/activity.db relative to the CWD (same idiom as _train.py)."""
|
|
129
|
-
return Path(os.environ.get("
|
|
129
|
+
return Path(os.environ.get("BLITZ_ACTIVITY_DB_PATH", "data/activity.db"))
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
def _now_iso() -> str:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""HTTP collection sink and buffer/flush tooling for the collect ingest
|
|
2
2
|
endpoint (see _collect_server.py for the server side).
|
|
3
3
|
|
|
4
|
-
`HttpCollectSink` is the
|
|
4
|
+
`HttpCollectSink` is the BLITZ_COLLECT_ENDPOINT-selected counterpart of
|
|
5
5
|
`_collect.CollectStore`: it exposes the same methods the execute loop calls
|
|
6
6
|
(check_writable, insert_run, insert_attempt, finish_run,
|
|
7
7
|
insert_sft_placeholder) but delivers each payload synchronously over HTTP, so
|
|
@@ -60,7 +60,7 @@ def _path_for(kind: str, payload: dict) -> str:
|
|
|
60
60
|
class HttpCollectSink:
|
|
61
61
|
"""Collection sink that writes through the ingest endpoint instead of
|
|
62
62
|
opening the activity database. Duck-types CollectStore's writer surface;
|
|
63
|
-
selected by cli._cmd_execute when
|
|
63
|
+
selected by cli._cmd_execute when BLITZ_COLLECT_ENDPOINT is set."""
|
|
64
64
|
|
|
65
65
|
def __init__(self, endpoint: str, timeout: int = _TIMEOUT):
|
|
66
66
|
self.endpoint = endpoint.rstrip("/")
|
|
@@ -6,7 +6,7 @@ storage behind the endpoint can change without touching any collector. Shipped
|
|
|
6
6
|
here as an importable module so the locker-room node image can run it with a
|
|
7
7
|
thin entrypoint; `blitz locker-room collect-serve` starts it host-side.
|
|
8
8
|
|
|
9
|
-
API (contracts/ingest-api.md): default port 1739 (
|
|
9
|
+
API (contracts/ingest-api.md): default port 1739 (BLITZ_COLLECT_PORT), bind 0.0.0.0,
|
|
10
10
|
no auth, same localhost/LAN trust posture as the mcp role on 1738.
|
|
11
11
|
|
|
12
12
|
GET /v1/health -> {"status": "ok"}
|
|
@@ -203,10 +203,10 @@ def serve(
|
|
|
203
203
|
print_fn=print,
|
|
204
204
|
) -> None:
|
|
205
205
|
"""Blocking entrypoint: resolve defaults from the environment
|
|
206
|
-
(
|
|
206
|
+
(BLITZ_ACTIVITY_DB_PATH, BLITZ_COLLECT_PORT) and serve until interrupted."""
|
|
207
207
|
db = Path(db_path) if db_path is not None else _collect.default_db_path()
|
|
208
208
|
if port is None:
|
|
209
|
-
port = int(os.environ.get("
|
|
209
|
+
port = int(os.environ.get("BLITZ_COLLECT_PORT", DEFAULT_PORT))
|
|
210
210
|
server = make_server(db, host=host, port=port, verbose=True)
|
|
211
211
|
print_fn(f"collect ingest endpoint listening on {host}:{port}, database {db}")
|
|
212
212
|
try:
|