blitz-cli 0.9.0__tar.gz → 0.11.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.
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/.gitignore +1 -1
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/PKG-INFO +20 -20
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/README.md +19 -19
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/__init__.py +2 -2
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_activity.py +2 -2
- blitz_cli-0.9.0/blitz_cli/_implement.py → blitz_cli-0.11.0/blitz_cli/_execute.py +8 -8
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_ontology.py +10 -10
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_playbooks.py +10 -10
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_redact.py +1 -1
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/cli.py +75 -82
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/analyze.md +13 -13
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/clarify.md +4 -4
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/implement.md +8 -8
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/plan.md +6 -6
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/playbook.md +23 -23
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/specify.md +6 -6
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/tasks.md +9 -9
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/scripts/bash/common.sh +31 -31
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/scripts/bash/create-new-feature.sh +2 -2
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/scripts/bash/setup-tasks.sh +1 -1
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/templates/plan-template.md +3 -3
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/workspace/huddle.md +8 -8
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/templates/workspace_playbook.md.tmpl +3 -3
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/pyproject.toml +1 -1
- blitz_cli-0.11.0/specs/001-cli-model-namespace/checklists/requirements.md +34 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/contracts/cli-commands.md +47 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/plan.md +73 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/quickstart.md +37 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/research.md +34 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/spec.md +69 -0
- blitz_cli-0.11.0/specs/001-cli-model-namespace/tasks.md +83 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_cli.py +19 -0
- blitz_cli-0.9.0/tests/test_implement.py → blitz_cli-0.11.0/tests/test_execute.py +31 -31
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_ontology.py +9 -9
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_playbooks.py +15 -15
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/.github/workflows/homebrew.yml +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/.github/workflows/publish.yml +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/.mcp.json +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/LICENSE +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_code_graph.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_corpus.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_dataset.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_git.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_make.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_scaffold.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_tool_schemas.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/_train.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/__init__.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/commands/__init__.py +0 -0
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/memory/playbook.md +0 -0
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/scripts/bash/check-prerequisites.sh +0 -0
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/scripts/bash/setup-plan.sh +0 -0
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/templates/spec-template.md +0 -0
- {blitz_cli-0.9.0/blitz_cli/playbooks/scaffold/.playbooks → blitz_cli-0.11.0/blitz_cli/playbooks/scaffold/.blitz}/templates/tasks-template.md +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/playbooks/workspace/__init__.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/templates/__init__.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/templates/locker_room_Makefile.tmpl +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/templates/locker_room_README.md.tmpl +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/blitz_cli/templates/locker_room_compose.yml.tmpl +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_activity.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_corpus.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_make.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_redact.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_scaffold.py +0 -0
- {blitz_cli-0.9.0 → blitz_cli-0.11.0}/tests/test_tool_schemas.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blitz-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
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
|
|
@@ -31,18 +31,18 @@ The core CLI is stdlib plus `rich`. Two optional extras carry heavier deps only
|
|
|
31
31
|
when you need them: `blitz-cli[locker-room]` (the MCP server) and
|
|
32
32
|
`blitz-cli[train]` (the QLoRA trainer).
|
|
33
33
|
|
|
34
|
-
Top-level commands: `
|
|
34
|
+
Top-level commands: `init`, `model`, `locker-room`.
|
|
35
35
|
|
|
36
36
|
## Playbooks: spec-driven development commands
|
|
37
37
|
|
|
38
|
-
`blitz
|
|
38
|
+
`blitz init` installs a set of spec-driven-development slash-commands
|
|
39
39
|
into a repo, rendered for whichever agent you use (Claude Code, Cursor, GitHub
|
|
40
|
-
Copilot, Gemini CLI, OpenCode), plus a shared `.
|
|
40
|
+
Copilot, Gemini CLI, OpenCode), plus a shared `.blitz/` working area.
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
blitz
|
|
44
|
-
blitz
|
|
45
|
-
blitz
|
|
43
|
+
blitz init # auto-detect the agent(s) in this repo
|
|
44
|
+
blitz init --agent claude # or target one explicitly
|
|
45
|
+
blitz init --all # install for every supported agent
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
The commands are `specify`, `plan`, `tasks`, `implement`, `playbook`, `clarify`,
|
|
@@ -51,9 +51,9 @@ and `analyze`. Run at a folder of repos, `init` installs into each repo it finds
|
|
|
51
51
|
for coordinating a feature across repos. Use `--ignore PATH` to skip a repo and
|
|
52
52
|
`--root` to force a single install.
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## Model execute: run a tasks.md with a local model
|
|
55
55
|
|
|
56
|
-
`blitz
|
|
56
|
+
`blitz model execute` drives a local model (served by Ollama) through a
|
|
57
57
|
playbook-generated `tasks.md`, one task at a time. The model only proposes
|
|
58
58
|
actions (full-file writes and shell commands); the driver applies them, runs
|
|
59
59
|
each phase's machine-runnable verification, retries with the failure fed back
|
|
@@ -61,17 +61,17 @@ each phase's machine-runnable verification, retries with the failure fed back
|
|
|
61
61
|
`- [x]` in the tasks.md. A task that keeps failing stops the run so the state
|
|
62
62
|
stays inspectable. Per-attempt model replies, snapshots, and exact token
|
|
63
63
|
accounting (`usage.json`, per task and total) land under
|
|
64
|
-
`.
|
|
64
|
+
`.blitz/execute/runs/<timestamp>/`.
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
blitz
|
|
68
|
-
blitz
|
|
69
|
-
blitz
|
|
67
|
+
blitz model execute # auto-detect the open specs/*/tasks.md
|
|
68
|
+
blitz model execute specs/001-my-feature/tasks.md # or name it
|
|
69
|
+
blitz model execute --model qwen2.5-14b-28k --start-at T005
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Tasks whose text says "optional manual" are skipped and left unchecked. The
|
|
73
73
|
Ollama endpoint comes from `--ollama-url` or `OLLAMA_HOST`; the model from
|
|
74
|
-
`--model` or `
|
|
74
|
+
`--model` or `BLITZ_EXECUTE_MODEL`.
|
|
75
75
|
|
|
76
76
|
## Locker-room: ontology graph, watcher, trainer, MCP
|
|
77
77
|
|
|
@@ -120,17 +120,17 @@ the base model with `BASE_MODEL_HF` or `blitz locker-room init --base-model`.
|
|
|
120
120
|
|
|
121
121
|
## Activity: replay a coding-agent session
|
|
122
122
|
|
|
123
|
-
`blitz activity` reads your coding agent's own local session transcripts
|
|
123
|
+
`blitz locker-room activity` reads your coding agent's own local session transcripts
|
|
124
124
|
(currently Claude Code's, at `~/.claude/projects`) for the current repo and
|
|
125
125
|
replays each prompt alongside the actions taken to resolve it (tool calls,
|
|
126
126
|
sub-agents) and the final response:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
blitz activity --list # sessions for this repo, most recent first
|
|
130
|
-
blitz activity # the most recent session's timeline
|
|
131
|
-
blitz activity <session-id-prefix> # a specific session
|
|
132
|
-
blitz activity --full # untruncated prompts/responses/tool I/O
|
|
133
|
-
blitz activity --html report.html # also write a self-contained HTML report
|
|
129
|
+
blitz locker-room activity --list # sessions for this repo, most recent first
|
|
130
|
+
blitz locker-room activity # the most recent session's timeline
|
|
131
|
+
blitz locker-room activity <session-id-prefix> # a specific session
|
|
132
|
+
blitz locker-room activity --full # untruncated prompts/responses/tool I/O
|
|
133
|
+
blitz locker-room activity --html report.html # also write a self-contained HTML report
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
The terminal view is compact by default; `--full` shows untruncated text. The
|
|
@@ -12,18 +12,18 @@ The core CLI is stdlib plus `rich`. Two optional extras carry heavier deps only
|
|
|
12
12
|
when you need them: `blitz-cli[locker-room]` (the MCP server) and
|
|
13
13
|
`blitz-cli[train]` (the QLoRA trainer).
|
|
14
14
|
|
|
15
|
-
Top-level commands: `
|
|
15
|
+
Top-level commands: `init`, `model`, `locker-room`.
|
|
16
16
|
|
|
17
17
|
## Playbooks: spec-driven development commands
|
|
18
18
|
|
|
19
|
-
`blitz
|
|
19
|
+
`blitz init` installs a set of spec-driven-development slash-commands
|
|
20
20
|
into a repo, rendered for whichever agent you use (Claude Code, Cursor, GitHub
|
|
21
|
-
Copilot, Gemini CLI, OpenCode), plus a shared `.
|
|
21
|
+
Copilot, Gemini CLI, OpenCode), plus a shared `.blitz/` working area.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
blitz
|
|
25
|
-
blitz
|
|
26
|
-
blitz
|
|
24
|
+
blitz init # auto-detect the agent(s) in this repo
|
|
25
|
+
blitz init --agent claude # or target one explicitly
|
|
26
|
+
blitz init --all # install for every supported agent
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
The commands are `specify`, `plan`, `tasks`, `implement`, `playbook`, `clarify`,
|
|
@@ -32,9 +32,9 @@ and `analyze`. Run at a folder of repos, `init` installs into each repo it finds
|
|
|
32
32
|
for coordinating a feature across repos. Use `--ignore PATH` to skip a repo and
|
|
33
33
|
`--root` to force a single install.
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Model execute: run a tasks.md with a local model
|
|
36
36
|
|
|
37
|
-
`blitz
|
|
37
|
+
`blitz model execute` drives a local model (served by Ollama) through a
|
|
38
38
|
playbook-generated `tasks.md`, one task at a time. The model only proposes
|
|
39
39
|
actions (full-file writes and shell commands); the driver applies them, runs
|
|
40
40
|
each phase's machine-runnable verification, retries with the failure fed back
|
|
@@ -42,17 +42,17 @@ each phase's machine-runnable verification, retries with the failure fed back
|
|
|
42
42
|
`- [x]` in the tasks.md. A task that keeps failing stops the run so the state
|
|
43
43
|
stays inspectable. Per-attempt model replies, snapshots, and exact token
|
|
44
44
|
accounting (`usage.json`, per task and total) land under
|
|
45
|
-
`.
|
|
45
|
+
`.blitz/execute/runs/<timestamp>/`.
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
blitz
|
|
49
|
-
blitz
|
|
50
|
-
blitz
|
|
48
|
+
blitz model execute # auto-detect the open specs/*/tasks.md
|
|
49
|
+
blitz model execute specs/001-my-feature/tasks.md # or name it
|
|
50
|
+
blitz model execute --model qwen2.5-14b-28k --start-at T005
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Tasks whose text says "optional manual" are skipped and left unchecked. The
|
|
54
54
|
Ollama endpoint comes from `--ollama-url` or `OLLAMA_HOST`; the model from
|
|
55
|
-
`--model` or `
|
|
55
|
+
`--model` or `BLITZ_EXECUTE_MODEL`.
|
|
56
56
|
|
|
57
57
|
## Locker-room: ontology graph, watcher, trainer, MCP
|
|
58
58
|
|
|
@@ -101,17 +101,17 @@ the base model with `BASE_MODEL_HF` or `blitz locker-room init --base-model`.
|
|
|
101
101
|
|
|
102
102
|
## Activity: replay a coding-agent session
|
|
103
103
|
|
|
104
|
-
`blitz activity` reads your coding agent's own local session transcripts
|
|
104
|
+
`blitz locker-room activity` reads your coding agent's own local session transcripts
|
|
105
105
|
(currently Claude Code's, at `~/.claude/projects`) for the current repo and
|
|
106
106
|
replays each prompt alongside the actions taken to resolve it (tool calls,
|
|
107
107
|
sub-agents) and the final response:
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
|
-
blitz activity --list # sessions for this repo, most recent first
|
|
111
|
-
blitz activity # the most recent session's timeline
|
|
112
|
-
blitz activity <session-id-prefix> # a specific session
|
|
113
|
-
blitz activity --full # untruncated prompts/responses/tool I/O
|
|
114
|
-
blitz activity --html report.html # also write a self-contained HTML report
|
|
110
|
+
blitz locker-room activity --list # sessions for this repo, most recent first
|
|
111
|
+
blitz locker-room activity # the most recent session's timeline
|
|
112
|
+
blitz locker-room activity <session-id-prefix> # a specific session
|
|
113
|
+
blitz locker-room activity --full # untruncated prompts/responses/tool I/O
|
|
114
|
+
blitz locker-room activity --html report.html # also write a self-contained HTML report
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
The terminal view is compact by default; `--full` shows untruncated text. The
|
|
@@ -13,7 +13,7 @@ Commands:
|
|
|
13
13
|
- ``blitz traces list`` / ``blitz traces show <trace_id>`` — inspect captured
|
|
14
14
|
traces from the local SQLite store.
|
|
15
15
|
|
|
16
|
-
- ``blitz activity [session] [--list] [--html report.html]`` — replay a
|
|
16
|
+
- ``blitz locker-room activity [session] [--list] [--html report.html]`` — replay a
|
|
17
17
|
Claude Code session for this repo: each prompt you sent, the actions taken
|
|
18
18
|
to resolve it (tool calls, sub-agents), and the final response. Reads
|
|
19
19
|
``~/.claude/projects`` directly; unrelated to Blitz's own captured traces.
|
|
@@ -30,4 +30,4 @@ Commands:
|
|
|
30
30
|
|
|
31
31
|
__all__ = ["__version__"]
|
|
32
32
|
|
|
33
|
-
__version__ = "0.
|
|
33
|
+
__version__ = "0.11.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""`blitz activity` — replay a coding-agent session: what you asked, and how it
|
|
1
|
+
"""`blitz locker-room activity` — replay a coding-agent session: what you asked, and how it
|
|
2
2
|
was resolved.
|
|
3
3
|
|
|
4
4
|
The currently-supported transcript format is Claude Code's, at
|
|
@@ -734,7 +734,7 @@ def render_html(session: Session, limit: int) -> str:
|
|
|
734
734
|
'<html lang="en">',
|
|
735
735
|
"<head>",
|
|
736
736
|
'<meta charset="utf-8">',
|
|
737
|
-
f"<title>blitz activity — {html.escape(session.title)}</title>",
|
|
737
|
+
f"<title>blitz locker-room activity — {html.escape(session.title)}</title>",
|
|
738
738
|
f"<style>{_HTML_STYLE}</style>",
|
|
739
739
|
"</head>",
|
|
740
740
|
"<body>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Drive a local model (served by Ollama) through a playbook-generated
|
|
2
2
|
tasks.md, one task at a time — the local-model execution backend for the
|
|
3
|
-
`
|
|
3
|
+
`blitz model execute` command.
|
|
4
4
|
|
|
5
5
|
The model never touches the repo directly: it only proposes actions
|
|
6
6
|
(full-file ===WRITE=== blocks and ===RUN=== commands) and this driver applies
|
|
@@ -220,12 +220,12 @@ def spec_name(repo: Path, tasks_file: Path) -> str:
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
def local_model_config(repo: Path) -> dict:
|
|
223
|
-
"""The `local_model` block from the nearest `.
|
|
223
|
+
"""The `local_model` block from the nearest `.blitz/config.json`,
|
|
224
224
|
checking the repo first and then walking up to the workspace root. This is
|
|
225
225
|
the same config the `tasks` playbook reads to decide which tasks get the
|
|
226
226
|
[L] (local-model eligible) marker. Returns {} when unconfigured."""
|
|
227
227
|
for d in [repo.resolve(), *repo.resolve().parents]:
|
|
228
|
-
cfg = d / ".
|
|
228
|
+
cfg = d / ".blitz" / "config.json"
|
|
229
229
|
if cfg.is_file():
|
|
230
230
|
try:
|
|
231
231
|
block = json.loads(cfg.read_text()).get("local_model")
|
|
@@ -237,12 +237,12 @@ def local_model_config(repo: Path) -> dict:
|
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
def usage_by_spec(repo: Path) -> dict:
|
|
240
|
-
"""Aggregate every
|
|
241
|
-
.
|
|
240
|
+
"""Aggregate every execute run's usage.json under
|
|
241
|
+
.blitz/execute/runs/, keyed by spec: total input/output tokens, model
|
|
242
242
|
calls, run count, and the models used. This is what the locker-room
|
|
243
243
|
ontologizer attaches to Feature nodes so the UI can show per-spec cost."""
|
|
244
244
|
totals: dict = {}
|
|
245
|
-
for f in sorted(repo.glob(".
|
|
245
|
+
for f in sorted(repo.glob(".blitz/execute/runs/*/usage.json")):
|
|
246
246
|
try:
|
|
247
247
|
record = json.loads(f.read_text())
|
|
248
248
|
except (OSError, ValueError):
|
|
@@ -289,7 +289,7 @@ def run(
|
|
|
289
289
|
"""Execute every unchecked task in tasks_file. Returns 0 on success, 1 when a
|
|
290
290
|
task fails after all retries (the run stops there so state stays inspectable)."""
|
|
291
291
|
call_model = call_model or (lambda messages: call_ollama(ollama_url, model, messages))
|
|
292
|
-
run_root = run_root or (repo / ".
|
|
292
|
+
run_root = run_root or (repo / ".blitz" / "execute" / "runs")
|
|
293
293
|
rundir = run_root / datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
|
|
294
294
|
snapdir = rundir / "snapshots"
|
|
295
295
|
snapdir.mkdir(parents=True, exist_ok=True)
|
|
@@ -333,7 +333,7 @@ def run(
|
|
|
333
333
|
if local_only and not any(t["local"] for t in tasks):
|
|
334
334
|
print_fn("warning: no [L] markers in this tasks.md — with --local-only "
|
|
335
335
|
"there is nothing to execute (regenerate tasks with a "
|
|
336
|
-
"local_model configured in .
|
|
336
|
+
"local_model configured in .blitz/config.json).")
|
|
337
337
|
last_in_phase = {t["phase"]: t["id"] for t in tasks}
|
|
338
338
|
started = start_at is None
|
|
339
339
|
|
|
@@ -16,7 +16,7 @@ import re
|
|
|
16
16
|
import sqlite3
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
|
|
19
|
-
from blitz_cli import _activity,
|
|
19
|
+
from blitz_cli import _activity, _execute, _playbooks
|
|
20
20
|
|
|
21
21
|
# --- graph store -------------------------------------------------------------
|
|
22
22
|
|
|
@@ -338,8 +338,8 @@ class OntologyStore:
|
|
|
338
338
|
|
|
339
339
|
|
|
340
340
|
def _read_active_feature(repo: Path) -> str | None:
|
|
341
|
-
"""Basename of the repo's active feature dir, from .
|
|
342
|
-
fj = repo / ".
|
|
341
|
+
"""Basename of the repo's active feature dir, from .blitz/feature.json."""
|
|
342
|
+
fj = repo / ".blitz" / "feature.json"
|
|
343
343
|
try:
|
|
344
344
|
val = json.loads(fj.read_text(encoding="utf-8")).get("feature_directory", "")
|
|
345
345
|
except (OSError, ValueError):
|
|
@@ -349,10 +349,10 @@ def _read_active_feature(repo: Path) -> str | None:
|
|
|
349
349
|
|
|
350
350
|
def _tasks_complete(tasks_md: Path) -> bool:
|
|
351
351
|
"""True when every required task in a tasks.md is checked off. Tasks whose
|
|
352
|
-
text says "optional manual" don't count against completion (the
|
|
352
|
+
text says "optional manual" don't count against completion (the execute
|
|
353
353
|
driver skips them by design)."""
|
|
354
354
|
try:
|
|
355
|
-
tasks, _ =
|
|
355
|
+
tasks, _ = _execute.parse_tasks(tasks_md.read_text(encoding="utf-8"))
|
|
356
356
|
except OSError:
|
|
357
357
|
return False
|
|
358
358
|
required = [t for t in tasks if "optional manual" not in t["body"].lower()]
|
|
@@ -422,7 +422,7 @@ def _parse_huddle(text: str) -> dict:
|
|
|
422
422
|
|
|
423
423
|
|
|
424
424
|
def _ingest_huddles(ws_root: Path, ws_id: str, store: OntologyStore, repo_ids: dict) -> None:
|
|
425
|
-
huddles_dir = ws_root / ".
|
|
425
|
+
huddles_dir = ws_root / ".blitz" / "huddles"
|
|
426
426
|
if not huddles_dir.is_dir():
|
|
427
427
|
return
|
|
428
428
|
for hd in sorted(huddles_dir.iterdir()):
|
|
@@ -491,19 +491,19 @@ def ontologize(workspace_root, db_path, ignore=None, code=True,
|
|
|
491
491
|
ws_id = f"workspace:{ws_root}"
|
|
492
492
|
store.add_node(ws_id, "Workspace", {"name": ws_root.name, "path": str(ws_root)})
|
|
493
493
|
_ingest_doc_file(store, ws_id, "playbook",
|
|
494
|
-
ws_root / ".
|
|
494
|
+
ws_root / ".blitz" / "memory" / "playbook.md", max_file_bytes)
|
|
495
495
|
|
|
496
496
|
repo_ids: dict[str, str] = {} # name -> node id, for huddle cross-referencing
|
|
497
497
|
ignore_paths = [Path(p) for p in (ignore or [])]
|
|
498
498
|
for repo in _playbooks.find_git_repos(ws_root, ignore=ignore_paths):
|
|
499
|
-
if not (repo / ".
|
|
499
|
+
if not (repo / ".blitz").is_dir():
|
|
500
500
|
continue # only playbook-enabled repos are ontologized
|
|
501
501
|
rid = f"repo:{repo.resolve()}"
|
|
502
502
|
repo_ids[repo.name] = rid
|
|
503
503
|
store.add_node(rid, "Repo", {"name": repo.name, "path": str(repo)})
|
|
504
504
|
store.add_edge(ws_id, rid, "CONTAINS")
|
|
505
505
|
_ingest_doc_file(store, rid, "playbook",
|
|
506
|
-
repo / ".
|
|
506
|
+
repo / ".blitz" / "memory" / "playbook.md", max_file_bytes)
|
|
507
507
|
|
|
508
508
|
for agent in _playbooks.detect_agents(repo):
|
|
509
509
|
aid = f"agent:{agent}"
|
|
@@ -527,7 +527,7 @@ def ontologize(workspace_root, db_path, ignore=None, code=True,
|
|
|
527
527
|
_code_graph.scan_repo(store, repo, rid, max_file_bytes=max_file_bytes)
|
|
528
528
|
|
|
529
529
|
active = _read_active_feature(repo)
|
|
530
|
-
usage =
|
|
530
|
+
usage = _execute.usage_by_spec(repo)
|
|
531
531
|
specs = repo / "specs"
|
|
532
532
|
if specs.is_dir():
|
|
533
533
|
for feat in sorted(specs.iterdir()):
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"""`blitz
|
|
1
|
+
"""`blitz init` — install spec-driven-development slash-commands into a repo.
|
|
2
2
|
|
|
3
3
|
The command bodies under ``blitz_cli/playbooks/commands`` are spec-driven-development
|
|
4
4
|
slash-commands adapted from GitHub's spec-kit (https://github.com/github/spec-kit).
|
|
5
5
|
At install time we render each agent-agnostic body into the conventional command
|
|
6
6
|
file for whichever agentic coding tool the user runs (Claude Code, Cursor, GitHub Copilot, Gemini
|
|
7
|
-
CLI, OpenCode), and drop a shared ``.
|
|
7
|
+
CLI, OpenCode), and drop a shared ``.blitz/`` working area (scripts +
|
|
8
8
|
templates) that those commands drive.
|
|
9
9
|
"""
|
|
10
10
|
|
|
@@ -41,11 +41,11 @@ AGENTS: dict[str, AgentSpec] = {
|
|
|
41
41
|
"opencode": AgentSpec(".opencode/command", ".md", "md", "$ARGUMENTS", (".opencode",)),
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
WORKDIR = ".
|
|
44
|
+
WORKDIR = ".blitz"
|
|
45
45
|
|
|
46
46
|
_COMMANDS_PKG = "blitz_cli.playbooks.commands"
|
|
47
47
|
# Workspace-only commands (e.g. /huddle) install into a *folder of repos*, never
|
|
48
|
-
# into an individual repo — they orchestrate across the repos' .
|
|
48
|
+
# into an individual repo — they orchestrate across the repos' .blitz/ dirs.
|
|
49
49
|
_WORKSPACE_PKG = "blitz_cli.playbooks.workspace"
|
|
50
50
|
|
|
51
51
|
# spec-kit cross-references commands as ``__SPECKIT_COMMAND_<NAME>__``; we drop
|
|
@@ -136,7 +136,7 @@ def render(command: str, agent: str, package: str = _COMMANDS_PKG) -> str:
|
|
|
136
136
|
return _wrap(spec.fmt, description, body)
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
# --- scaffold (shared .
|
|
139
|
+
# --- scaffold (shared .blitz working area) -------------------------------
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
def _walk(node, prefix: str = ""):
|
|
@@ -231,7 +231,7 @@ def workspace_command_names() -> list[str]:
|
|
|
231
231
|
|
|
232
232
|
|
|
233
233
|
def install_workspace_scaffold(dest_dir: Path) -> Path | None:
|
|
234
|
-
"""Seed the workspace-level ``.
|
|
234
|
+
"""Seed the workspace-level ``.blitz/memory/playbook.md`` from the
|
|
235
235
|
default template. Unlike command installs this NEVER overwrites — the
|
|
236
236
|
file holds user-authored operating knowledge, so even ``--force`` must
|
|
237
237
|
not reset it. Returns the written path, or None when it already exists."""
|
|
@@ -254,8 +254,8 @@ def install_workspace_commands(
|
|
|
254
254
|
"""Install workspace-only commands (/huddle) into ``dest_dir``'s command dirs.
|
|
255
255
|
|
|
256
256
|
``dest_dir`` is a workspace root — a folder of repos, not a repo itself.
|
|
257
|
-
No ``.
|
|
258
|
-
what it needs (``.
|
|
257
|
+
No ``.blitz/`` scaffold is installed here; the huddle command creates
|
|
258
|
+
what it needs (``.blitz/huddles/``) on first use.
|
|
259
259
|
"""
|
|
260
260
|
commands = workspace_command_names()
|
|
261
261
|
results: list[InstallResult] = []
|
|
@@ -271,9 +271,9 @@ def install_workspace_commands(
|
|
|
271
271
|
|
|
272
272
|
|
|
273
273
|
def install_scaffold(dest_dir: Path, force: bool) -> InstallResult:
|
|
274
|
-
"""Copy the shared ``.
|
|
274
|
+
"""Copy the shared ``.blitz/`` working area, rewriting stale paths.
|
|
275
275
|
|
|
276
|
-
Files under ``.
|
|
276
|
+
Files under ``.blitz/memory/`` are seeded once and NEVER overwritten,
|
|
277
277
|
even with ``force`` — they hold user-authored knowledge (a repo's
|
|
278
278
|
constitution/playbook), and ``--force`` is for refreshing rendered
|
|
279
279
|
commands and scaffold templates, not resetting memory."""
|
|
@@ -12,7 +12,7 @@ is exactly the class of thing this module exists to catch, and exactly why
|
|
|
12
12
|
"best-effort" is not "guaranteed."
|
|
13
13
|
|
|
14
14
|
That same real key also surfaced a concrete failure mode worth documenting:
|
|
15
|
-
once displayed via `blitz activity --full`, rich's Tree rendering wrapped the
|
|
15
|
+
once displayed via `blitz locker-room activity --full`, rich's Tree rendering wrapped the
|
|
16
16
|
long token across terminal lines, inserting a real newline plus a
|
|
17
17
|
box-drawing tree-branch prefix (e.g. "\\n│ │ ") *in the middle of the
|
|
18
18
|
token*. If that wrapped output is later captured as another tool's output
|