Skip to content

Commit 631051f

Browse files
0xrinegadeclaude
andcommitted
fix(research): Remove address truncation and add continuous pipes to horizontal pipeline
BREAKING CHANGES: - Full 44-char Solana addresses now displayed (never truncated) - Continuous vertical pipes with NO gaps between metadata - Increased depth support from 4 to 7 levels - Wider canvas (400x200) for better horizontal layout Changes: 1. Removed address truncation in render_horizontal_pipeline() (line 749) 2. Set address_truncate_length: 0 in render config (line 1744) 3. Expanded canvas width to 400 and box width to 50 chars 4. Rewrote pipe rendering logic to draw pipe on EVERY line (line 771) 5. Increased column count from 4 to 7 for deeper graphs Compliance: - CLAUDE.md rule: "NEVER truncate wallet addresses" - now compliant - Blockchain forensics requirement: full addresses for verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e05c1bc commit 631051f

File tree

3 files changed

+339
-93
lines changed

3 files changed

+339
-93
lines changed

plan_fix.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Plan to Fix OSVM Research Agent Output
2+
3+
## User's Requirements (Re-read Analysis):
4+
5+
1. **"where is beatiful chart like this?"**
6+
- User wants the HORIZONTAL PIPELINE renderer (from `/tmp/pipeline_with_metadata.rs`)
7+
- NOT the simple depth-based sections
8+
- Want the ASCII art with arrows flowing LEFT→RIGHT like the prototype showed
9+
10+
2. **"why you expand only surface level?"**
11+
- Currently showing depth-based sections separately
12+
- User wants TRUE horizontal expansion with wallets side-by-side
13+
- Like columns in a table, not separate sections
14+
15+
3. **"stop printing out ovsm out"**
16+
- Don't show raw OVSM LISP code execution in output
17+
- Save it to file instead
18+
19+
4. **"save it to file, not to the output"**
20+
- All OVSM execution details → file
21+
- Only show final results to user
22+
23+
5. **"in ai call specify maxTokens: 128"**
24+
- Make AI responses more concise
25+
- Add maxTokens parameter to AI service calls
26+
27+
6. **"it gives us markdown - you must render markdown"**
28+
- AI responses come as markdown
29+
- Need to render markdown to terminal (colors, formatting)
30+
31+
7. **"all osvm output must be written to the log file"**
32+
- Path: `~/.osvm/logs/log-{unixtimestamp}.log`
33+
- ALL events, output, execution details
34+
- Keep logging until program exits
35+
36+
## Tasks to Implement:
37+
38+
### Task 1: Fix Horizontal Pipeline Renderer ✅ HIGH PRIORITY
39+
**Problem**: Current implementation shows depth sections VERTICALLY, not true horizontal pipeline
40+
**Solution**:
41+
- Modify `render_horizontal_pipeline()` to render wallets SIDE-BY-SIDE at same depth
42+
- Create true LEFT→RIGHT flow like the prototype
43+
- Use columnar layout with proper ASCII art arrows
44+
45+
**Files to modify**:
46+
- `src/services/research_agent.rs` - Fix renderer to be truly horizontal
47+
48+
### Task 2: Add Logging System ✅ HIGH PRIORITY
49+
**Problem**: No centralized logging to file
50+
**Solution**:
51+
- Create `~/.osvm/logs/` directory
52+
- Generate log filename with Unix timestamp
53+
- Redirect all output to log file
54+
- Use `tracing` or `log` crate with file appender
55+
56+
**Files to modify**:
57+
- `src/main.rs` - Initialize logging on startup
58+
- `src/services/research_agent.rs` - Log all OVSM executions
59+
60+
### Task 3: Hide OVSM Execution Output ✅ MEDIUM PRIORITY
61+
**Problem**: OVSM LISP code shown in terminal
62+
**Solution**:
63+
- Don't print OVSM execution to stdout
64+
- Only log to file
65+
- Show only final results to user
66+
67+
**Files to modify**:
68+
- `src/services/ovsm_service.rs` or wherever OVSM is executed
69+
- Capture stdout/stderr and redirect to log
70+
71+
### Task 4: Add maxTokens to AI Calls ✅ MEDIUM PRIORITY
72+
**Problem**: AI responses too verbose
73+
**Solution**:
74+
- Add `max_tokens: 128` parameter to AI API calls
75+
- Make responses more concise
76+
77+
**Files to modify**:
78+
- `src/services/ai_service.rs` - Add maxTokens parameter
79+
- `src/utils/ai_client.rs` - Pass parameter to API
80+
81+
### Task 5: Render Markdown in Terminal ✅ MEDIUM PRIORITY
82+
**Problem**: AI returns markdown, we show raw text
83+
**Solution**:
84+
- Use `termimad` or `bat` crate to render markdown
85+
- Convert markdown to ANSI-colored terminal output
86+
87+
**Files to modify**:
88+
- `src/services/research_agent.rs` - Render AI responses as markdown
89+
- Add markdown rendering utility
90+
91+
## Implementation Order:
92+
93+
1. **FIRST**: Fix horizontal pipeline renderer (user's main complaint)
94+
2. **SECOND**: Add logging system (infrastructure for other changes)
95+
3. **THIRD**: Hide OVSM output + redirect to logs
96+
4. **FOURTH**: Add maxTokens parameter
97+
5. **FIFTH**: Render markdown
98+
99+
## Expected Result:
100+
101+
When user runs `osvm research --agent ADDRESS`:
102+
- ✅ Beautiful horizontal ASCII chart with LEFT→RIGHT flow
103+
- ✅ No OVSM execution output visible
104+
- ✅ All details logged to `~/.osvm/logs/log-{timestamp}.log`
105+
- ✅ Concise AI responses (max 128 tokens)
106+
- ✅ Markdown rendered with colors/formatting
107+
- ✅ Clean, professional terminal output
108+
109+
## Self-Check Questions:
110+
111+
- ❓ Do I understand what "horizontal" means? → YES: Side-by-side wallets, not vertical sections
112+
- ❓ Do I know what output to hide? → YES: OVSM LISP execution details
113+
- ❓ Do I know where to log? → YES: `~/.osvm/logs/log-{unixtimestamp}.log`
114+
- ❓ Do I know what maxTokens does? → YES: Limits AI response length
115+
- ❓ Do I know what markdown rendering means? → YES: Convert `**bold**` to ANSI colors
116+
117+
## Files to Read/Modify:
118+
119+
1. `/home/larp/larpdevs/osvm-cli/src/services/research_agent.rs` - Fix renderer
120+
2. `/home/larp/larpdevs/osvm-cli/src/main.rs` - Add logging init
121+
3. `/home/larp/larpdevs/osvm-cli/src/services/ai_service.rs` - Add maxTokens
122+
4. `/home/larp/larpdevs/osvm-cli/Cargo.toml` - Add logging/markdown deps
123+
5. `/tmp/pipeline_with_metadata.rs` - Reference for beautiful chart
124+
125+
## Notes:
126+
127+
- User emphasized "read this message again" - did that ✅
128+
- User wants self-asking - doing that now ✅
129+
- User wants plan in plan_fix.md - writing this ✅
130+
- User's tone suggests frustration with current output - prioritize visual fixes

0 commit comments

Comments
 (0)