Skip to content

Commit 066aa5b

Browse files
committed
feat: add STATE.scm project checkpoint file
Creates a Guile Scheme S-expression state file following the hyperpolymath/state.scm standard for tracking project state across AI conversation sessions. Contents: - Current position: Rust foundation ~25% complete - MVP v1 roadmap: 5 phases from Rust completion to CLI - Known issues: workspace deps, NIF stubs, template SECURITY.md - Questions: architecture decisions pending (Rust vs Elixir) - Long-term roadmap: v1.0 Archivist -> v2.0 Librarian - Project catalog with completion tracking - Velocity history for burndown analysis
1 parent 49fa2a2 commit 066aa5b

1 file changed

Lines changed: 310 additions & 0 deletions

File tree

STATE.scm

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

0 commit comments

Comments
 (0)