Skip to content

Commit 7e0ff79

Browse files
hyperpolymathclaude
andcommitted
Add VeriSimDB session helper script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a3c9126 commit 7e0ff79

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

verisimdb-session.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: PMPL-1.0-or-later
3+
# VeriSimDB Session Trace Helpers
4+
# Usage: source this file or call functions directly
5+
#
6+
# verisimdb_trace "title" "body" — create a session trace octad
7+
# verisimdb_decision "name" "chosen" "reason" — log a decision
8+
# verisimdb_query "search term" — search past traces
9+
# verisimdb_status — show instance status
10+
11+
VERISIMDB_WORK="http://localhost:8096"
12+
13+
verisimdb_status() {
14+
curl -s "$VERISIMDB_WORK/health" | python3 -m json.tool 2>/dev/null || echo "VeriSimDB work instance not running. Start with: systemctl --user start verisimdb-work.service"
15+
}
16+
17+
verisimdb_trace() {
18+
local title="$1"
19+
local body="$2"
20+
local date=$(date +%Y-%m-%d)
21+
curl -s -X POST "$VERISIMDB_WORK/octads" \
22+
-H "Content-Type: application/json" \
23+
-d "{
24+
\"title\": \"$title\",
25+
\"body\": \"$body\",
26+
\"types\": [\"session-trace\"],
27+
\"metadata\": {\"date\": \"$date\", \"agent\": \"claude\"},
28+
\"provenance\": {\"event_type\": \"created\", \"actor\": \"claude\", \"description\": \"Session trace\"}
29+
}"
30+
}
31+
32+
verisimdb_decision() {
33+
local name="$1"
34+
local chosen="$2"
35+
local reason="$3"
36+
local date=$(date +%Y-%m-%dT%H:%M:%S)
37+
curl -s -X POST "$VERISIMDB_WORK/octads" \
38+
-H "Content-Type: application/json" \
39+
-d "{
40+
\"title\": \"Decision: $name\",
41+
\"body\": \"Chosen: $chosen. Reason: $reason\",
42+
\"types\": [\"decision-trace\", \"007-branch\"],
43+
\"metadata\": {\"decision\": \"$name\", \"chosen\": \"$chosen\", \"timestamp\": \"$date\"},
44+
\"provenance\": {\"event_type\": \"created\", \"actor\": \"claude\", \"description\": \"007 decision trace\"}
45+
}"
46+
}
47+
48+
verisimdb_query() {
49+
local term="$1"
50+
curl -s "$VERISIMDB_WORK/search/text?q=$term" 2>/dev/null
51+
}
52+
53+
verisimdb_list() {
54+
curl -s "$VERISIMDB_WORK/octads" | python3 -m json.tool 2>/dev/null
55+
}

0 commit comments

Comments
 (0)