Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ if [ -n "$stale" ]; then
exit 1
fi

# 8b. Block SQLite runtime database files (they get rebuilt by the daemon)
sqlite_staged=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null | grep -E '\.sqlite(-journal|-shm|-wal)?$' || true)
if [ -n "$sqlite_staged" ]; then
echo "FAIL: SQLite runtime DBs must not be committed (daemon rebuilds them):"
echo "$sqlite_staged"
exit 1
fi

# 9. shellcheck (lint shell scripts)
if command -v shellcheck >/dev/null 2>&1; then
shellcheck scripts/*.sh 2>/dev/null || {
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ jobs:
stale=$(find . -name "*.bak" -o -name "*.perf" -o -name "*.old" -not -path "./target/*" 2>/dev/null)
if [ -n "$stale" ]; then echo "FAIL"; echo "$stale"; exit 1; fi

- name: no sqlite runtime DBs
run: |
if git ls-files | grep -qE '\.sqlite(-journal|-shm|-wal)?$'; then
echo "FAIL: SQLite runtime DBs committed (daemon rebuilds these)"
git ls-files | grep -E '\.sqlite'
exit 1
fi

- name: gate.js sync
run: |
if ! diff pi/gate.js crates/reliary-agent/pi/gate.js >/dev/null 2>&1; then
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
target/
.reliary/
*.sqlite
*.sqlite-journal
*.sqlite-shm
*.sqlite-wal
*.bak
*.perf
*.old
__pycache__/
*.pyc
.pytest_cache/
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## v0.7.0 (unreleased)

### Compression Ceiling Breakthrough
- **Aggressive skeleton compression:** Tokenizes all alphanumeric runs to `{w}` while preserving version/number placeholders. Cargo `Compiling X v1.0` lines now share skeletons and group together. Gate restricts activation to content where ≥80% of lines share the same aggressive skeleton AND line lengths are similar — prevents file reads with similar function signatures from collapsing.
- **Information-preserving zone truncation:** Replaces blind first-30 + last-15 zone with score-based selection. Error lines (`FAILED`, `error[`, `panic`, `Traceback`) get +10 score bonus. Allows top-15 selection (vs blind 45 lines) without signal loss.
- **FTS5 document frequency weighting:** Grammar-free pseudo-perplexity proxy (LLM Lingua analog without an LM). Tokens appearing in many files are "predictable" boilerplate; tokens in few files are "surprising" project-specific. Opt-in via `RELIARY_PROXY_FT_WEIGHT=1` (off by default until validated in live sessions).
- **SRCR safety floor:** `preservation × compression` metric. Default `RELIARY_PROXY_SRCR_FLOOR=0.3` blocks destructive compression — if post-compression SRCR is below the floor, the proxy ships the pre-compression content instead. Set `0` to disable.
- **Smoke test:** Cargo test output (6100 chars, 205 lines) compresses to ~225 chars (96% savings, `history_saved=5878`).

### Tunable
- `RELIARY_PROXY_SRCR_FLOOR` — default `0.3`, set `0` to disable
- `RELIARY_PROXY_FT_WEIGHT` — default `0` (off), set `1` to enable

### Test counts
- 81 sift + 13 compress + 14 search + 7 sr_floor + 9 ft_weight_gate = 124 tests passing

## v0.6.4

### Scorecard Security (June 2026)
Expand Down
4 changes: 4 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ reliary-agent uses a cascade of configuration sources (highest priority first):
| `RELIARY_PROXY_GUARD_DISABLE` | `1` | Disable guard (cross-file edit safety). On by default. |
| `RELIARY_PROXY_ANTI_DISABLE` | `1` | Disable anti-decision (sticky identifier failure memory). On by default. |
| `RELIARY_PROXY_OUTPUT_COMPRESS` | `1` | Enable first-appearance freeze compression. On by default. |
| `RELIARY_PROXY_SRCR_FLOOR` | `0.3` | SRCR safety floor. If post-compression SRCR < floor, ship pre-compression content instead. Set to `0` to disable. |
| `RELIARY_PROXY_FT_WEIGHT` | `0` | Enable FTS5 document-frequency weighting for zone truncation. Off by default until validated in live sessions. |
| `RELIARY_PROXY_PASSTHROUGH` | `0` | Disable compression (true transparent forward). Sanitizer still runs. Off by default. |
| `RELIARY_PROXY_SANITIZER` | `1` | Strip empty assistants and duplicate tool_call_id reuses. Default-on for OpenAI/DeepSeek compatibility. Set to `0` to disable. |

## Agent Setup Examples (Proxy Routing)

Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,28 @@ After `init`, your agents get MCP tools for search, risk, compression, fix, dead
detection, healing, and prior session memory. For conversation compression, point your
agent's `*_BASE_URL` at http://localhost:9090.

## Validation

Compression preserves reading comprehension on SQuAD v2 within 2.7x LLM
variance. Measured on 3 runs × 30 samples (270 calls), both proxy conditions
achieve F1 retention ≥ 95% of baseline (the regression-detection floor):

| Condition | F1 | EM | Acc | F1 Retention |
|-------------|-------|-------|--------|--------------|
| baseline | 0.770 | 0.711 | 80.00% | 100% |
| recommended | 0.777 | 0.733 | 78.89% | 100.9% PASS |
| passthrough | 0.791 | 0.756 | 80.00% | 102.6% PASS |

F1 retention > 100% is within 2.7x LLM variance — not a real improvement, but
proof that compression does not regress reading comprehension. See
`scripts/benchmarks/accuracy/README.md` for full methodology and caveats.

Run the benchmark yourself:

```bash
python3 scripts/benchmarks/accuracy/bench_squad.py --runs 3 --samples 30
```

## Usage by Agent

There are two separate things reliary gives your agent. Understanding the difference
Expand Down
4 changes: 2 additions & 2 deletions crates/reliary-agent/pi/gate.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function gateLog(level, msg) {
}

// ── Binary discovery (env var → PATH → hardcoded paths) ──
let RELIARY_BIN = process.env. || null;
let RELIARY_BIN = process.env.RELIARY_BIN_PATH || null;
if (!RELIARY_BIN) {
// Check PATH first
try {
Expand Down Expand Up @@ -120,7 +120,7 @@ function daemonCmd(cmd) {
}

// ── Daemon health check: verify binary exists (TCP check would require daemon running) ──
let = true; // assume healthy — CLI fallback handles gracefully
let DAEMON_HEALTHY = true; // assume healthy — CLI fallback handles gracefully

function cacheRead(path, hash, len) {
return daemonCmd(`cache-read ${path} ${hash} ${len}`);
Expand Down
Loading
Loading