-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTATE.scm
More file actions
310 lines (270 loc) · 12.6 KB
/
Copy pathSTATE.scm
File metadata and controls
310 lines (270 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
;; -*- mode: scheme -*-
;; SPDX-License-Identifier: MIT AND Palimpsest-0.8
;; STATE.scm - Project state checkpoint for polysafe-gitfixer
;; Download at session end, upload at session start to resume context
(define state
'((metadata
. ((format-version . "0.2.0")
(project . "polysafe-gitfixer")
(updated . "2025-12-08T00:00:00Z")
(generator . "Claude/STATE-system")))
(user-context
. ((name . "Jonathan D.A. Jewell")
(handle . "@Hyperpolymath")
(roles . ("architect" "rust-developer" "security-engineer"))
(languages . ("Rust" "Elixir" "Haskell" "Idris"))
(tools . ("GitLab" "GitHub" "Podman" "Guix"))
(values . ("FOSS" "formal-verification" "capability-security" "polyglot"))))
(session-context
. ((conversation-id . "01RrCvazrZbt5T3GxdtZfUrq")
(branch . "claude/create-state-scm-01RrCvazrZbt5T3GxdtZfUrq")))
;; =========================================================================
;; CURRENT POSITION
;; =========================================================================
(current-position
. ((summary . "Rust foundation crates implemented with core security primitives")
(phase . "foundation")
(completion-percent . 25)
(implemented
. (("capability" . "DirCapability with path traversal prevention, Permissions model")
("capability" . "AuditLog with hash-chained tamper-evident logging")
("fs_ops" . "FsTransaction with atomic ops, journaling, RAII rollback")
("git_ops" . "Safe git2 wrappers: status, staging, repo discovery, remotes")
("polysafe_nifs" . "Placeholder module structure for Rustler NIFs")))
(not-implemented
. (("polysafe_nifs" . "Actual NIF function implementations (commented out)")
("orchestrator" . "Elixir supervision tree and workflow engine")
("diff-engine" . "Haskell semantic diff for polyglot merge")
("tui" . "Haskell brick/vty terminal UI")
("workflow" . "Idris verified merge strategies")
("cli" . "User-facing command-line interface")
("backup-detection" . "Auto-detect backup files and match to repos")))))
;; =========================================================================
;; ROUTE TO MVP v1
;; =========================================================================
(mvp-v1-roadmap
. ((goal . "CLI tool that safely merges git backup files into working repos")
(target-features
. ("Detect backup .git directories"
"Match backups to source repositories"
"Interactive diff review"
"Safe merge with rollback"
"Audit trail of all operations"))
(phases
. (((phase . 1)
(name . "Complete Rust Foundation")
(status . "in-progress")
(completion . 85)
(tasks
. (("Implement actual NIF bindings" . "pending")
("Add chrono to workspace deps" . "pending")
("Add uuid to workspace deps" . "pending")
("Add hex crate or keep inline" . "pending")
("Integration tests across crates" . "pending"))))
((phase . 2)
(name . "Elixir Orchestrator")
(status . "pending")
(completion . 0)
(tasks
. (("Initialize mix project" . "pending")
("Design supervision tree" . "pending")
("Integrate Rustler NIFs" . "pending")
("Implement GenServer workers" . "pending")
("Add telemetry/logging" . "pending"))))
((phase . 3)
(name . "Backup Detection Engine")
(status . "pending")
(completion . 0)
(tasks
. (("Scan filesystem for .git dirs" . "pending")
("Fingerprint repos by remote URLs" . "pending")
("Match backups to working copies" . "pending")
("Handle orphaned backups" . "pending"))))
((phase . 4)
(name . "Diff & Merge Core")
(status . "pending")
(completion . 0)
(tasks
. (("Compare commit histories" . "pending")
("Identify divergent branches" . "pending")
("Generate merge candidates" . "pending")
("3-way merge implementation" . "pending"))))
((phase . 5)
(name . "CLI Interface")
(status . "pending")
(completion . 0)
(tasks
. (("Argument parsing (clap)" . "pending")
("Interactive prompts" . "pending")
("Progress reporting" . "pending")
("JSON output mode" . "pending"))))))))
;; =========================================================================
;; KNOWN ISSUES & BLOCKERS
;; =========================================================================
(issues
. (((id . "ISS-001")
(severity . "low")
(title . "Missing workspace dependencies")
(description . "chrono, uuid, hex used in crates but not declared in workspace Cargo.toml")
(affected . ("capability/audit_log" "fs_ops/transaction")))
((id . "ISS-002")
(severity . "medium")
(title . "NIF bindings are placeholder only")
(description . "polysafe_nifs has all NIF code commented out, awaiting Elixir side")
(blocked-by . "Elixir orchestrator project must be created first"))
((id . "ISS-003")
(severity . "low")
(title . "SECURITY.md is GitHub template")
(description . "Security policy file contains placeholder text, not actual policy"))
((id . "ISS-004")
(severity . "low")
(title . "No integration tests")
(description . "Each crate has unit tests but no cross-crate integration tests"))
((id . "ISS-005")
(severity . "info")
(title . "Repository URL mismatch")
(description . "Cargo.toml points to GitLab but code is also on GitHub"))))
;; =========================================================================
;; QUESTIONS FOR MAINTAINER
;; =========================================================================
(questions
. (((id . "Q-001")
(topic . "Architecture")
(question . "Should MVP be pure Rust CLI, or commit to Elixir orchestration?")
(context . "Elixir adds complexity but enables better supervision/fault-tolerance")
(options . ("Pure Rust with tokio" "Elixir + Rust NIFs" "Hybrid: Rust CLI + optional Elixir")))
((id . "Q-002")
(topic . "Platform Priority")
(question . "Which platforms should MVP target?")
(options . ("Linux-only" "Linux + macOS" "Linux + macOS + Windows"))
(notes . "Windows git paths and symlinks differ significantly"))
((id . "Q-003")
(topic . "Backup Format Support")
(question . "What backup formats should MVP support?")
(context . "Different backup tools create different structures")
(options . ("Raw .git directories only"
"Bare repos"
"Git bundles"
"tar/zip archives"
"All of the above")))
((id . "Q-004")
(topic . "UI Priority")
(question . "MVP interface priority?")
(options . ("CLI-only" "CLI + TUI" "CLI + Web UI")))
((id . "Q-005")
(topic . "Diff Engine")
(question . "Start Haskell diff-engine now or defer?")
(context . "Could use basic byte-diff for MVP, semantic diff for v2")
(tradeoff . "Faster MVP vs better merge quality"))))
;; =========================================================================
;; LONG-TERM ROADMAP
;; =========================================================================
(roadmap
. ((v1-0
. ((codename . "Archivist")
(goal . "Basic backup merger CLI")
(features . ("Backup detection"
"Repo matching"
"Interactive merge"
"Audit logging"
"Transactional safety"))))
(v1-5
. ((codename . "Curator")
(goal . "Enhanced intelligence")
(features . ("Semantic diff (Haskell)")
"Auto-resolve simple conflicts"
"Branch topology visualization"
"Backup scheduling recommendations"))))
(v2-0
. ((codename . "Librarian")
(goal . "Full polyglot stack")
(features . ("TUI with brick/vty"
"Verified merge strategies (Idris)"
"Plugin system for custom resolvers"
"Distributed backup coordination"))))
(future
. ((ideas . ("Cloud backup integration"
"Git LFS handling"
"Submodule-aware merging"
"Time-travel debugging for merges"
"AI-assisted conflict resolution"))))))
;; =========================================================================
;; PROJECT CATALOG (for STATE.scm standard compatibility)
;; =========================================================================
(projects
. (((name . "capability-crate")
(status . "complete")
(completion . 100)
(category . "foundation")
(next-steps . ()))
((name . "fs_ops-crate")
(status . "complete")
(completion . 100)
(category . "foundation")
(next-steps . ()))
((name . "git_ops-crate")
(status . "complete")
(completion . 100)
(category . "foundation")
(next-steps . ()))
((name . "polysafe_nifs-crate")
(status . "blocked")
(completion . 10)
(category . "integration")
(blockers . ("Elixir orchestrator not started"))
(next-steps . ("Create Elixir mix project" "Implement NIF functions")))
((name . "elixir-orchestrator")
(status . "pending")
(completion . 0)
(category . "orchestration")
(next-steps . ("Initialize mix project" "Design supervision tree")))
((name . "haskell-diff-engine")
(status . "pending")
(completion . 0)
(category . "algorithms")
(next-steps . ("Evaluate: needed for MVP or v2?")))
((name . "cli-interface")
(status . "pending")
(completion . 0)
(category . "user-interface")
(next-steps . ("Decide: Rust clap or Elixir escript")))))
;; =========================================================================
;; VELOCITY HISTORY (for burndown tracking)
;; =========================================================================
(history
. (((date . "2024-12-01")
(snapshot . (("capability-crate" . 100)
("fs_ops-crate" . 100)
("git_ops-crate" . 100)
("polysafe_nifs-crate" . 10)
("elixir-orchestrator" . 0))))
((date . "2025-12-08")
(snapshot . (("capability-crate" . 100)
("fs_ops-crate" . 100)
("git_ops-crate" . 100)
("polysafe_nifs-crate" . 10)
("elixir-orchestrator" . 0)))
(notes . "Initial STATE.scm creation"))))
;; =========================================================================
;; CRITICAL NEXT ACTIONS
;; =========================================================================
(next-actions
. (((priority . 1)
(action . "Decide: Pure Rust vs Elixir orchestration for MVP")
(owner . "@Hyperpolymath")
(context . "Blocks all further architecture decisions"))
((priority . 2)
(action . "Fix workspace Cargo.toml dependencies")
(owner . "any")
(context . "Add chrono, uuid, hex to workspace.dependencies"))
((priority . 3)
(action . "Write integration tests for Rust crates")
(owner . "any")
(context . "Verify capability + fs_ops + git_ops work together"))
((priority . 4)
(action . "Update SECURITY.md with real policy")
(owner . "@Hyperpolymath")
(context . "Replace GitHub template with actual security contact info"))))))
;; Query helpers (for minikanren-style queries if using Guile)
;; (define (project-status name state)
;; (assoc-ref (assoc-ref state 'projects) name))