clawmind 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. clawmind-0.1.1/PKG-INFO +208 -0
  2. clawmind-0.1.1/README.md +200 -0
  3. clawmind-0.1.1/app/__init__.py +1 -0
  4. clawmind-0.1.1/app/adapters/__init__.py +1 -0
  5. clawmind-0.1.1/app/adapters/filesystem_adapter.py +1 -0
  6. clawmind-0.1.1/app/adapters/llm_adapter.py +545 -0
  7. clawmind-0.1.1/app/adapters/logseq_adapter.py +328 -0
  8. clawmind-0.1.1/app/application/__init__.py +1 -0
  9. clawmind-0.1.1/app/application/audit_service.py +213 -0
  10. clawmind-0.1.1/app/application/classifier_service.py +220 -0
  11. clawmind-0.1.1/app/application/context_builder.py +177 -0
  12. clawmind-0.1.1/app/application/recovery_service.py +122 -0
  13. clawmind-0.1.1/app/application/runner_service.py +600 -0
  14. clawmind-0.1.1/app/application/writeback_service.py +91 -0
  15. clawmind-0.1.1/app/config.py +69 -0
  16. clawmind-0.1.1/app/domain/__init__.py +1 -0
  17. clawmind-0.1.1/app/domain/contracts.py +30 -0
  18. clawmind-0.1.1/app/domain/enums.py +59 -0
  19. clawmind-0.1.1/app/domain/models.py +205 -0
  20. clawmind-0.1.1/app/executors/__init__.py +1 -0
  21. clawmind-0.1.1/app/executors/codex_runner.py +199 -0
  22. clawmind-0.1.1/app/executors/deterministic_executor.py +66 -0
  23. clawmind-0.1.1/app/main.py +405 -0
  24. clawmind-0.1.1/app/policies/__init__.py +1 -0
  25. clawmind-0.1.1/app/policies/context_options.py +26 -0
  26. clawmind-0.1.1/app/repositories/__init__.py +1 -0
  27. clawmind-0.1.1/app/repositories/artifact_repository.py +49 -0
  28. clawmind-0.1.1/app/repositories/run_log_repository.py +1 -0
  29. clawmind-0.1.1/clawmind.egg-info/PKG-INFO +208 -0
  30. clawmind-0.1.1/clawmind.egg-info/SOURCES.txt +46 -0
  31. clawmind-0.1.1/clawmind.egg-info/dependency_links.txt +1 -0
  32. clawmind-0.1.1/clawmind.egg-info/entry_points.txt +2 -0
  33. clawmind-0.1.1/clawmind.egg-info/requires.txt +1 -0
  34. clawmind-0.1.1/clawmind.egg-info/top_level.txt +1 -0
  35. clawmind-0.1.1/pyproject.toml +22 -0
  36. clawmind-0.1.1/setup.cfg +4 -0
  37. clawmind-0.1.1/tests/test_artifact_repository.py +78 -0
  38. clawmind-0.1.1/tests/test_classifier_service.py +172 -0
  39. clawmind-0.1.1/tests/test_codex_cli_adapter.py +434 -0
  40. clawmind-0.1.1/tests/test_codex_runner.py +198 -0
  41. clawmind-0.1.1/tests/test_config.py +70 -0
  42. clawmind-0.1.1/tests/test_context_builder.py +158 -0
  43. clawmind-0.1.1/tests/test_deterministic_executor.py +121 -0
  44. clawmind-0.1.1/tests/test_domain_models.py +113 -0
  45. clawmind-0.1.1/tests/test_logseq_adapter.py +179 -0
  46. clawmind-0.1.1/tests/test_main.py +327 -0
  47. clawmind-0.1.1/tests/test_recovery_service.py +99 -0
  48. clawmind-0.1.1/tests/test_runner_service.py +811 -0
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: clawmind
3
+ Version: 0.1.1
4
+ Summary: Task-state-machine-first runner for Logseq-driven workflows.
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: flashtext>=2.7
8
+
9
+ # ClawMind -- Logseq AI Coworker
10
+
11
+ > From chat to interaction.
12
+ > You’re not talking to AI—you’re thinking with yourself.
13
+
14
+ ClawMind is a Logseq-native workflow runner for individuals who need AI execution with human
15
+ oversight.
16
+ It turns everyday notes, questions, and task blocks into
17
+ a controlled execution flow that is understandable,
18
+ replayable, and auditable.
19
+
20
+ Unlike a generic AI chat tool, ClawMind separates flow
21
+ control, reasoning, and writeback into explicit system
22
+ boundaries.
23
+ Work Runner manages task intake and state transitions,
24
+ Codex Runner handles reasoning-heavy execution, and the
25
+ Deterministic Executor writes results back in a
26
+ repeatable way.
27
+
28
+ ## Why ClawMind
29
+
30
+ ClawMind is designed for knowledge workflows where
31
+ correctness, traceability, and operational clarity
32
+ matter.
33
+
34
+ - Logseq remains the human-facing workflow surface.
35
+ - AI execution is bounded by explicit runtime and
36
+ writeback rules.
37
+ - Every run can leave reproducible audit evidence in
38
+ `run_logs/` and `runtime_artifacts/`.
39
+ - The system is built to reduce ad hoc task handling and
40
+ turn repeated thinking work into durable process assets.
41
+
42
+ ## Demo
43
+
44
+ <video src="./logseq_Edemo.mp4" controls></video>
45
+
46
+ ## How It Works
47
+
48
+ ClawMind turns a Logseq task into a controlled workflow:
49
+
50
+ `DOING -> WAITING -> execute -> writeback -> audit`
51
+
52
+ ```mermaid
53
+ sequenceDiagram
54
+ participant L as Logseq Task
55
+ participant W as Work Runner
56
+ participant C as Codex Runner
57
+ participant D as Deterministic Executor
58
+
59
+ L->>W: DOING task detected
60
+ W->>W: Normalize id and lock as WAITING
61
+ W->>C: Build context and execute
62
+ C-->>W: Return structured result
63
+ W->>D: Apply deterministic writeback
64
+ D-->>L: Update answer and links
65
+ W-->>L: Record audit trail
66
+ ```
67
+
68
+ ### Roles
69
+
70
+ - Work Runner is the flow controller.
71
+ It scans DOING tasks, normalizes id::, moves tasks
72
+ into WAITING, builds execution context, and
73
+ coordinates the full run.
74
+ - Codex Runner is the reasoning engine.
75
+ It handles the AI-heavy part of the task and returns
76
+ structured output, but it does not directly mutate
77
+ Logseq pages or task state.
78
+ - Deterministic Executor is the writeback layer.
79
+ It applies results in a repeatable way, writes answer
80
+ pages and journal links, and helps preserve
81
+ idempotency and auditability.
82
+
83
+ ## Core Guarantees
84
+
85
+ - stable `id::` primary key
86
+ - runtime / knowledge domain separation
87
+ - writeback idempotency
88
+ - AI does not write to Logseq directly
89
+
90
+ ## Project Structure
91
+
92
+ ```text
93
+ app/ Core application code
94
+ tests/ Unit tests
95
+ run_logs/ Execution audit records
96
+ runtime_artifacts/ Execution artifacts
97
+ ```
98
+
99
+ ## Environment Requirements
100
+
101
+ - WINDOWS OS
102
+ - Install Codex CLI (Plus / month)
103
+ - Install Logseq
104
+ - Python 3.13+
105
+
106
+ ## Configuration
107
+
108
+ The program resolves configuration files in this order:
109
+
110
+ 1. The file specified by `CLAWMIND_ENV_PATH`
111
+ 2. `.env` in the current working directory
112
+ 3. `.env` in the project root
113
+
114
+ Common settings:
115
+
116
+ ```env
117
+ LOGSEQ_PATH=<your Logseq root directory>
118
+ CODEX_CLI_PATH=<path to the codex executable>
119
+ JOURNAL_SCAN_DAYS=<optional>
120
+ MAX_RETRIES=<optional>
121
+ CODEX_TIMEOUT_SECONDS=<optional>
122
+ ```
123
+
124
+ Variable notes
125
+
126
+ - JOURNAL_SCAN_DAYS
127
+ - Unset = scan all journals
128
+ - Set = scan only the most recent N days
129
+ - MAX_RETRIES defaults to 2
130
+ - CODEX_TIMEOUT_SECONDS defaults to 300 seconds
131
+ - Example CODEX_CLI_PATH: `C:\Users\<Username>\AppData\Local\nvm\v24.11.0\codex.cmd`
132
+
133
+ ## Installation
134
+
135
+ Development environment:
136
+
137
+ ```powershell
138
+ uv sync
139
+ ```
140
+
141
+ To install as a CLI:
142
+
143
+ ```powershell
144
+ pip install -e .
145
+ ```
146
+
147
+ If you are not using `uv`, use:
148
+
149
+ ```powershell
150
+ python -m venv .venv
151
+ .venv\Scripts\activate
152
+ pip install -e .
153
+ ```
154
+
155
+ ## Run
156
+
157
+ **Persistent worker**
158
+
159
+ ```powershell
160
+ clawmind run-worker
161
+ ```
162
+
163
+ **Stop**
164
+
165
+ ```
166
+ Ctrl+C
167
+ ```
168
+
169
+ On startup, the program prints `config_source` and `env_path` so you can verify which configuration source was actually used.
170
+
171
+ ## CLI Helper Commands
172
+
173
+ Check version:
174
+
175
+ ```powershell
176
+ clawmind version
177
+ ```
178
+
179
+ Show installation info:
180
+
181
+ ```powershell
182
+ clawmind install-info
183
+ ```
184
+
185
+ Upgrade:
186
+
187
+ ```powershell
188
+ clawmind upgrade --method auto
189
+ clawmind upgrade --method pipx
190
+ clawmind upgrade --method uv
191
+ clawmind upgrade --method pip
192
+ ```
193
+
194
+ Method mapping:
195
+
196
+ - `pipx install clawmind` -> `clawmind upgrade --method pipx`
197
+ - `uv tool install clawmind` -> `clawmind upgrade --method uv`
198
+ - `pip install clawmind` -> `clawmind upgrade --method pip`
199
+
200
+ ## Roadmap
201
+
202
+ - Support macOS.
203
+ - Support Gemini CLI and Claude CLI.
204
+ -
205
+
206
+ ## Contact
207
+
208
+ - X.com @pigslybear
@@ -0,0 +1,200 @@
1
+ # ClawMind -- Logseq AI Coworker
2
+
3
+ > From chat to interaction.
4
+ > You’re not talking to AI—you’re thinking with yourself.
5
+
6
+ ClawMind is a Logseq-native workflow runner for individuals who need AI execution with human
7
+ oversight.
8
+ It turns everyday notes, questions, and task blocks into
9
+ a controlled execution flow that is understandable,
10
+ replayable, and auditable.
11
+
12
+ Unlike a generic AI chat tool, ClawMind separates flow
13
+ control, reasoning, and writeback into explicit system
14
+ boundaries.
15
+ Work Runner manages task intake and state transitions,
16
+ Codex Runner handles reasoning-heavy execution, and the
17
+ Deterministic Executor writes results back in a
18
+ repeatable way.
19
+
20
+ ## Why ClawMind
21
+
22
+ ClawMind is designed for knowledge workflows where
23
+ correctness, traceability, and operational clarity
24
+ matter.
25
+
26
+ - Logseq remains the human-facing workflow surface.
27
+ - AI execution is bounded by explicit runtime and
28
+ writeback rules.
29
+ - Every run can leave reproducible audit evidence in
30
+ `run_logs/` and `runtime_artifacts/`.
31
+ - The system is built to reduce ad hoc task handling and
32
+ turn repeated thinking work into durable process assets.
33
+
34
+ ## Demo
35
+
36
+ <video src="./logseq_Edemo.mp4" controls></video>
37
+
38
+ ## How It Works
39
+
40
+ ClawMind turns a Logseq task into a controlled workflow:
41
+
42
+ `DOING -> WAITING -> execute -> writeback -> audit`
43
+
44
+ ```mermaid
45
+ sequenceDiagram
46
+ participant L as Logseq Task
47
+ participant W as Work Runner
48
+ participant C as Codex Runner
49
+ participant D as Deterministic Executor
50
+
51
+ L->>W: DOING task detected
52
+ W->>W: Normalize id and lock as WAITING
53
+ W->>C: Build context and execute
54
+ C-->>W: Return structured result
55
+ W->>D: Apply deterministic writeback
56
+ D-->>L: Update answer and links
57
+ W-->>L: Record audit trail
58
+ ```
59
+
60
+ ### Roles
61
+
62
+ - Work Runner is the flow controller.
63
+ It scans DOING tasks, normalizes id::, moves tasks
64
+ into WAITING, builds execution context, and
65
+ coordinates the full run.
66
+ - Codex Runner is the reasoning engine.
67
+ It handles the AI-heavy part of the task and returns
68
+ structured output, but it does not directly mutate
69
+ Logseq pages or task state.
70
+ - Deterministic Executor is the writeback layer.
71
+ It applies results in a repeatable way, writes answer
72
+ pages and journal links, and helps preserve
73
+ idempotency and auditability.
74
+
75
+ ## Core Guarantees
76
+
77
+ - stable `id::` primary key
78
+ - runtime / knowledge domain separation
79
+ - writeback idempotency
80
+ - AI does not write to Logseq directly
81
+
82
+ ## Project Structure
83
+
84
+ ```text
85
+ app/ Core application code
86
+ tests/ Unit tests
87
+ run_logs/ Execution audit records
88
+ runtime_artifacts/ Execution artifacts
89
+ ```
90
+
91
+ ## Environment Requirements
92
+
93
+ - WINDOWS OS
94
+ - Install Codex CLI (Plus / month)
95
+ - Install Logseq
96
+ - Python 3.13+
97
+
98
+ ## Configuration
99
+
100
+ The program resolves configuration files in this order:
101
+
102
+ 1. The file specified by `CLAWMIND_ENV_PATH`
103
+ 2. `.env` in the current working directory
104
+ 3. `.env` in the project root
105
+
106
+ Common settings:
107
+
108
+ ```env
109
+ LOGSEQ_PATH=<your Logseq root directory>
110
+ CODEX_CLI_PATH=<path to the codex executable>
111
+ JOURNAL_SCAN_DAYS=<optional>
112
+ MAX_RETRIES=<optional>
113
+ CODEX_TIMEOUT_SECONDS=<optional>
114
+ ```
115
+
116
+ Variable notes
117
+
118
+ - JOURNAL_SCAN_DAYS
119
+ - Unset = scan all journals
120
+ - Set = scan only the most recent N days
121
+ - MAX_RETRIES defaults to 2
122
+ - CODEX_TIMEOUT_SECONDS defaults to 300 seconds
123
+ - Example CODEX_CLI_PATH: `C:\Users\<Username>\AppData\Local\nvm\v24.11.0\codex.cmd`
124
+
125
+ ## Installation
126
+
127
+ Development environment:
128
+
129
+ ```powershell
130
+ uv sync
131
+ ```
132
+
133
+ To install as a CLI:
134
+
135
+ ```powershell
136
+ pip install -e .
137
+ ```
138
+
139
+ If you are not using `uv`, use:
140
+
141
+ ```powershell
142
+ python -m venv .venv
143
+ .venv\Scripts\activate
144
+ pip install -e .
145
+ ```
146
+
147
+ ## Run
148
+
149
+ **Persistent worker**
150
+
151
+ ```powershell
152
+ clawmind run-worker
153
+ ```
154
+
155
+ **Stop**
156
+
157
+ ```
158
+ Ctrl+C
159
+ ```
160
+
161
+ On startup, the program prints `config_source` and `env_path` so you can verify which configuration source was actually used.
162
+
163
+ ## CLI Helper Commands
164
+
165
+ Check version:
166
+
167
+ ```powershell
168
+ clawmind version
169
+ ```
170
+
171
+ Show installation info:
172
+
173
+ ```powershell
174
+ clawmind install-info
175
+ ```
176
+
177
+ Upgrade:
178
+
179
+ ```powershell
180
+ clawmind upgrade --method auto
181
+ clawmind upgrade --method pipx
182
+ clawmind upgrade --method uv
183
+ clawmind upgrade --method pip
184
+ ```
185
+
186
+ Method mapping:
187
+
188
+ - `pipx install clawmind` -> `clawmind upgrade --method pipx`
189
+ - `uv tool install clawmind` -> `clawmind upgrade --method uv`
190
+ - `pip install clawmind` -> `clawmind upgrade --method pip`
191
+
192
+ ## Roadmap
193
+
194
+ - Support macOS.
195
+ - Support Gemini CLI and Claude CLI.
196
+ -
197
+
198
+ ## Contact
199
+
200
+ - X.com @pigslybear
@@ -0,0 +1 @@
1
+ """ClawMind application package."""
@@ -0,0 +1 @@
1
+ """External adapters package."""
@@ -0,0 +1 @@
1
+ """Filesystem adapter placeholder for future implementation."""