mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
- source.rs: Add ClawSource adapter that reads .claw/sessions/*.jsonl (skips
LFS stubs), parses both full-JSON and JSONL-stream formats, normalises into
ChatSession/ChatMessage identical to the OpenCode path.
- models.rs: Add title/agent/model fields to ChatSession; remove unused
chrono import.
- normalize.rs: Populate title/agent/model from OpenCodeSession.
- sink.rs: Full rewrite:
- DDL adds title/agent/model columns + ALTER TABLE IF NOT EXISTS migration
path for existing clusters.
- upsert_session and upsert_messages parameter counts match placeholders
($19 and $13 respectively).
- FTS index uses COALESCE to handle NULL text_content.
- sslmode= token stripped before parse so NoTls connect doesn't reject
it; README documents the SSL upgrade path (tokio-postgres-rustls).
- with-serde_json-1 feature added to tokio-postgres dep for JSONB params.
- main.rs:
- Replace DefaultHasher sha256_text with FNV-1a 64-bit (correct hex digest).
- Add ClawSync, List, Get subcommands.
- Remove unused Context import.
- bridge.rs: Rewrite to use bridge_wrapper.py subprocess rather than inline
-c script; resolves wrapper path relative to infra_dir or CARGO_MANIFEST_DIR;
unwraps {"ok":true,"data":{}} envelope; health_check() tests python3 only.
- embed.rs: Remove unused OllamaEmbedRequest import.
- systemd/: Add ene-session-sync.service + .timer (5-min cadence, 2-min
OnBootSec, Persistent=true for catch-up after suspend).
- README.md: Architecture diagram, CLI reference, schema, build/install,
systemd install, Python bridge setup.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
37 lines
1.2 KiB
Desktop File
37 lines
1.2 KiB
Desktop File
[Unit]
|
|
Description=ENE Session Sync — OpenCode→RDS chat log ingestion daemon
|
|
Documentation=file:///home/researcher/stack/4-Infrastructure/infra/ene-session-sync/README.md
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
# Run as the developer user so ~/.local/share/opencode/opencode.db is reachable.
|
|
User=researcher
|
|
Group=researcher
|
|
|
|
# Binary is installed to ~/.cargo/bin after `cargo install --path .` or
|
|
# symlinked from target/release/.
|
|
ExecStart=/home/researcher/.cargo/bin/ene-session-sync \
|
|
--db /home/researcher/.local/share/opencode/opencode.db \
|
|
sync
|
|
|
|
# Embedding is opt-in; set OLLAMA_HOST + OLLAMA_EMBED_MODEL env vars and
|
|
# add --embed to ExecStart if Ollama is available.
|
|
|
|
EnvironmentFile=-/etc/ene-session-sync/env
|
|
EnvironmentFile=-/home/researcher/.config/ene-session-sync/env
|
|
|
|
# Credentials (RDS_HOST, RDS_PORT, RDS_USER, RDS_PASSWORD or RDS_IAM_TOKEN)
|
|
# live in the EnvironmentFile above. Never hard-code them here.
|
|
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=ene-session-sync
|
|
|
|
# Restart on failure with backoff — the DB may be temporarily locked.
|
|
Restart=on-failure
|
|
RestartSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|