Add SQLite daemon migrations and reentrant session test#27
Merged
Conversation
Introduce a lightweight startup schema migrator for daemon SQLite persistence, include initial Akka.Persistence.Sql table DDL, and add upgrade runbook guidance for host and Docker deployments. Add an in-memory reconnect integration test that verifies session reattachment after transport disconnects.
Replace string-based persistence provider selection with a strongly typed enum and add startup options validation using IValidateOptions with ValidateOnStart. Document that persistence configuration belongs in netclaw.json and not secrets.json.
Aaronontheweb
added a commit
to Aaronontheweb/netclaw
that referenced
this pull request
May 12, 2026
0.1.4-alpha lands the issue netclaw-dev#27 fix: the parser extends the verb chain greedily through every "verb-like" token until it hits a flag (-x) or a path (anything containing / or .). Production hit on `git worktree list` (extracted as `git worktree`, mismatching at retry time) is fixed — multi-token CLI subcommands now extract cleanly without per-CLI tables. Side effects: - Auto-proposed verb patterns are narrower. `git push origin main` now proposes `git push origin main *` instead of `git push *`. This is intentionally tighter — approving the specific argument set is safer than approving the whole verb family. - Test expectations updated for the new shape. Three new integration cases cover stop-at-flag, stop-at-path, and the multi-token CLI subcommand regression directly. - TrustState xmldoc updated: verb-pattern matching is exact verb-chain equality + arg-glob suffix, so a stale `git push *` no longer matches a `git push origin main` invocation. Operators with persisted `git push *` from older runs will be re-prompted on the new shape. 557 Security tests + 314 Configuration tests + 1528 Actors tests pass.
Aaronontheweb
added a commit
to Aaronontheweb/netclaw
that referenced
this pull request
May 12, 2026
The v2 approval matcher's `ExtractVerbChain` was capping at depth 2,
truncating multi-token CLI subcommands like `freshdesk ticket list` and
`git worktree list` to two tokens (`freshdesk ticket`, `git worktree`).
The truncation surfaced two ways in production:
- Approval prompts displayed misleading verb names ("Approve `freshdesk
ticket` in this session?" for what is really `freshdesk ticket list`).
- Verb-chain mismatch between approval-prompt time and retry time
threw `ToolApprovalRequiredException` mid-flight, surfacing as
"I encountered an error executing a tool" with a correlation ID.
The 0.1.4-alpha ShellSyntaxTree bump shipped a greedy verb-chain
extractor (issue netclaw-dev#27), but it was only wired into the new
GateEvaluator/TrustStateComposer code path — which isn't on the live
runtime approval flow yet (trust-zones milestones B-N pending). This
puts it on the v2 path so the live prompt benefits immediately.
`ShellApprovalSemanticsBase.ExtractVerbChain` now delegates to
`BashParser.Parse(...).Clauses[0].Verb.Joined` for greedy extraction.
The path-aware/side-effect short-circuit (cap at depth 1 for cat, grep,
find, ls, echo, printf, etc.) is preserved as a post-check so positional
search patterns and target paths don't bake into persisted approval
keys (`grep secret /var/log/syslog` still extracts as `grep` alone).
`maxDepth` is now an upper bound rather than a default cap; the
default is `int.MaxValue` so callers get greedy extraction unless
they explicitly request a tighter chain.
Tests:
- ShellTokenizerTests: existing depth-2 expectations updated to greedy
shape (`git push origin main`, `kubectl delete pod my-pod`,
`docker compose up`). Path-aware verbs unchanged (cat, grep, ls
still cap at 1).
- New regression theory `ExtractVerbChain_extracts_multi_token_cli_subcommands`
pins the production hits: freshdesk ticket list, git worktree list,
gh pr view, kubectl get pods.
- ToolApprovalGateTests: gate test renamed and re-asserted to expect
the greedy chain on `git push origin main`.
561 Security + 1530 Actors + 314 Configuration tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.netclaw/netclaw.dbpath support and document host/docker upgrade workflow in a new daemon upgrade runbookValidation
dotnet build Netclaw.slnxdotnet test Netclaw.slnxdotnet slopwatch analyze