vikingowl
11363f3b97
feat: M1-M7 gap audit phase 2 — security, TUI, context, router feedback
...
Gap 6 (M3): 7 new bash security checks (8-14)
- JQ injection, obfuscated flags (Unicode lookalike hyphens),
/proc/environ access, brace expansion, Unicode whitespace,
zsh dangerous constructs, comment-quote desync
- Total: 14 checks (was 7)
Gap 7 (M5): Model picker numbered selection
- /model shows numbered sorted list, /model 3 picks by number
Gap 8 (M5): /config set command
- /config set provider.default mistral writes to .gnoma/config.toml
- Whitelisted keys: provider.default, provider.model, permission.mode
- New config/write.go with TOML round-trip via BurntSushi/toml
Gap 9 (M6): Simple token estimator
- EstimateTokens (len/4 heuristic), EstimateMessages (content + overhead)
- PreEstimate on Tracker for proactive compaction triggering
Gap 10 (M7): Router quality feedback from elfs
- Router.Outcome + ReportOutcome (logs for now, M9 bandit uses later)
- Manager tracks armID/taskType per elf via elfMeta map
- Manager.ReportResult called after elf completion in both agent + batch tools
2026-04-04 11:07:08 +02:00
vikingowl
de1798ff5c
fix: M1-M7 gap audit phase 1 — bug fix + 5 quick wins
...
Bug fix:
- window.go: token ratio after compaction used len(w.messages) after
reassignment, always producing ratio ~1.0. Fixed by saving original
length before assignment.
Gap 1 (M3): Scanner patterns 13 → 47
- Added 34 new patterns: Azure, DigitalOcean, HuggingFace, Grafana,
GitHub extended (app/oauth/refresh), Shopify, Twilio, SendGrid,
NPM, PyPI, Databricks, Pulumi, Postman, Sentry, Anthropic admin,
OpenAI extended, Vault, Supabase, Telegram, Discord, JWT, Heroku,
Mailgun, Figma
Gap 2 (M3): Config security section
- SecuritySection with EntropyThreshold + custom PatternConfig
- Wire custom patterns from TOML into scanner at startup
Gap 3 (M4): Polling discovery loop
- StartDiscoveryLoop with 30s ticker, reconciles arms vs discovered
- Router.RemoveArm for disappeared local models
Gap 4 (M5): Incognito LocalOnly enforcement
- Router.SetLocalOnly filters non-local arms in Select()
- TUI incognito toggle (Ctrl+X, /incognito) sets local-only routing
Gap 5 (M6): Reactive 413 compaction
- Window.ForceCompact() bypasses ShouldCompact threshold
- Engine handles 413 with emergency compact + retry
2026-04-03 23:11:08 +02:00
vikingowl
63f4c1389e
feat: M6 complete — summarize strategy + tool result persistence
...
SummarizeStrategy: calls LLM to condense older messages into a
summary, preserving key decisions, file changes, tool outputs.
Falls back to truncation on failure. Keeps 6 recent messages.
Tool result persistence: outputs >50K chars saved to disk at
.gnoma/sessions/tool-results/{id}.txt with 2K preview inline.
TUI: /compact command for manual compaction, /clear now resets
engine history. Summarize strategy used by default (with
truncation fallback).
2026-04-03 18:51:28 +02:00
vikingowl
704f3a7302
feat: M6 context intelligence — token tracker + truncation compaction
...
internal/context/:
- Tracker: monitors token usage with OK/Warning/Critical states
(thresholds from CC: 20K warning buffer, 13K autocompact buffer)
- TruncateStrategy: drops oldest messages, preserves system prompt +
recent N turns, adds compaction boundary marker
- Window: manages message history with auto-compaction trigger,
circuit breaker after 3 consecutive failures
Engine integration:
- Context window tracks usage per turn
- Auto-compacts when critical threshold reached
- History syncs with context window after compaction
TUI status bar:
- Token count with percentage (tokens: 1234 (5%))
- Color-coded: green=ok, yellow=warning, red=critical
Session Status extended: TokensMax, TokenPercent, TokenState.
7 context tests.
2026-04-03 18:46:03 +02:00