Commit Graph
990 Commits
Author SHA1 Message Date
BaaRai ac5e714eb6 Merge pull request #313 from BaaRai/fix/task-llm-health-badge
fix(llm): record breaker health on every task path
2026-11-18 01:42:49 +01:00
BaaRai 6568a8eb44 fix(llm): record breaker health on every task LLM path
The /system/llm/ badge read llm_profile_health, which only the failover
Pool wrote. A task pinned to an explicit chain, a bound agent with
failover off, and the global provider all call the provider directly, so
a dead backend stayed "Healthy".

One policy now lives in llmpool.Registry.RecordCall, used by the Pool and
by the task runtimes: a success clears the state, a failover-eligible
failure trips it, context cancellation and deterministic 400s do not, and
a stream that already delivered output is left alone. The selection
carries the profile whose breaker the call updates, and a provider
already wrapped in the Pool reports nothing to avoid double counting.

The LLM recording page also explains an empty list while the llm_record
toggle is off, after the settings call resolves.

Originally reported in #257.
2026-11-18 01:31:18 +01:00
BaaRai 9a2a9e61ef Merge pull request #308 from Coff0xc/feat/finding-report-state
feat(findings): report stage separate from triage status
2026-11-18 00:17:48 +01:00
Coff0xc 6a0b79d34f feat(findings): add report_state separate from triage 2026-11-18 00:07:50 +01:00
BaaRai 729f935a21 Merge pull request #311 from BaaRai/fix/agent-frame-intent-summaries
fix(agent): frame intent summaries as data (issue #124)
2026-11-17 23:55:50 +01:00
BaaRai 9777163bbf fix(agent): frame intent summaries as data
The wake lines interpolated a planner-written intent summary into the trusted sentence, and the overview kept every summary in the plain JSON, so an inherited summary crossed tasks as if this planner had written it (#124, F3). Frame the summary on the wake lines and move the open/running/recent-done summaries into one framed block; the structured intent fields stay plain.
2026-11-17 23:44:36 +01:00
BaaRai e80a33c098 Merge pull request #301 from Protonmatter/protonmatter/session-epoch
Reject sessions issued before a password change
2026-11-17 23:28:24 +01:00
protonmatter 95bd9c24f0 Merge commit 'eddf03ce61f0a506fede039ea8936709b84ade8e' into protonmatter/session-epoch
# Conflicts:
#	CHANGELOG.md
2026-11-17 16:56:29 -05:00
protonmatter 134562c3d9 Drop the unused database import and align the password constants. 2026-11-17 22:54:16 +01:00
protonmatter 7cac9c240b Retry the password version on login when startup could not read it. 2026-11-17 22:54:16 +01:00
protonmatter ebc54b8751 Bind sessions to a password version so revocation cannot tie inside one second.
The hash and version commit together, a failed read rejects tokens, and the reset script tells the operator to restart.
2026-11-17 22:54:16 +01:00
protonmatter 26a7bbec37 Reject sessions issued before a password change.
A failed password read no longer mints a setup token, and filling the login limiter no longer drops an active lockout.
2026-11-17 22:54:16 +01:00
BaaRai eddf03ce61 Merge pull request #304 from Protonmatter/protonmatter/llmpool-health-queue
Coalesce circuit-breaker health writes
2026-11-17 22:52:27 +01:00
BaaRai 9bc5856565 Merge pull request #302 from Protonmatter/protonmatter/budget-restore
Restore task spend from the lanes the live ledger counts
2026-11-17 22:52:23 +01:00
protonmatter c9d81a453f Align the Server literal so gofmt accepts it. 2026-11-17 22:39:53 +01:00
protonmatter b2a2f95e8c Release the circuit-breaker queue lock around the database write. 2026-11-17 22:39:53 +01:00
protonmatter 1fbf2263a1 Keep circuit-breaker writes in state order and flush them before the database closes.
A later update can no longer be queued behind an older one, a failed save is retried, and shutdown waits for the last cooling window.
2026-11-17 22:39:53 +01:00
protonmatter 847e32407a Coalesce circuit-breaker writes onto one queue.
A newer state for the same profile replaces one that has not been written yet, and a failed write is logged instead of discarded on a detached goroutine.
2026-11-17 22:39:50 +01:00
BaaRai 7bd9bf6e3e Merge pull request #309 from BaaRai/feat/traffic-rewrite-p33b1
feat(traffic): apply rewrite rules in the capture proxy (P3.3b1)
2026-11-17 22:38:59 +01:00
BaaRai f8bc3b3b6d Merge pull request #305 from Protonmatter/protonmatter/json-body-cap
Cap JSON request bodies
2026-11-17 22:29:08 +01:00
BaaRai 4fb29fd841 Merge pull request #303 from Protonmatter/protonmatter/coverage-flag-error
Keep coverage tools available when the flag read fails
2026-11-17 22:29:04 +01:00
protonmatter 074962a351 Say that a revived task keeps the spend already recorded. 2026-11-17 16:25:16 -05:00
BaaRai 7c3d50d533 docs: describe applying the rewrite rules in the proxy
The status line said the proxy does not apply rules yet. Replace it with
the request and response phases, what exchange_rewrites records and how
the hashes are formed (plain SHA-256, keyed HMAC for sensitive actions),
the SSE and WebSocket behaviour, the 5 MiB response pass-through, the
snapshot limits (live slots are never deleted by the TTL), and the fact
that replays go through the proxy and are rewritten like captures.
2026-11-17 22:23:12 +01:00
BaaRai b57bafe74a feat(server): upgrade the built-in traffic_get description once
It now says that traffic_get shows the originals of a rewritten exchange
and that traffic_search never finds a value a rewrite rule wrote. As for
traffic_search, only the original built-in text is replaced.
2026-11-17 22:23:12 +01:00
BaaRai fa07d69f1d feat(traffic): apply rewrite rules in the capture proxy (P3.3b1)
The sink runs the request phase in the Request hook and the response phase
at the start of the Response hook; at SSEStart only status and header
actions apply. WebSocketStart comes after the client is upgraded, so the
handshake is traced "not rewritten: stream" and recorded as sent.

Exchanges keep what the client sent and what the target answered. The
original of a rewritten request lives in a per-flow snapshot slot (entry or
tombstone, 1024 entries / 64 MiB, 4096 tombstones), reserved before the
request is changed, released on Response, RequestError, SSEStart, a 5 MiB
response, or by a sweep of finished flows (ClientDisconnected, 1 s
debounce, 1 min period). Under pressure an entry older than 15 minutes is
turned into a tombstone in place, only when that frees room for the new
reservation; its exchange is recorded "original request unavailable".

record(), recordStreamStart() and insertExchange() clear any trace under
the id before INSERT OR REPLACE; the trace (exchange_rewrites, created
with CREATE TABLE IF NOT EXISTS) is written in the exchange's transaction,
its spilled values registered in blob_refs, and purged with the exchange.
The full-text index covers the originals only. Logs of a rewritten flow
name the host, the step or error class and the rule ids, never the URL or
the error text. A rewritten request's transport error never switches its
host to passthrough. traffic_get shows the rewritten flag and rule ids.

Without a rule that applies, what is recorded is unchanged byte for byte.
2026-11-17 22:23:12 +01:00
BaaRai b3e1f5359f feat(traffic/rewrite): let the proxy record a rule's transport error
The request phase can fail after the engine is done: the rewritten request
does not reach the target. NoteError records that as the rule's last error,
under the new class transport_error.
2026-11-17 22:22:56 +01:00
BaaRai 5fdf8eb075 fix(server): keep the MaxBytesError so a caller's 413 mapping still works
A handler that installs its own MaxBytesReader and then calls decode lost the 413: decode converted the error to a plain one and the middleware's limitedBody had been replaced. Return the original *http.MaxBytesError and update the cap test to errors.As.
2026-11-17 22:19:59 +01:00
BaaRai d646f6999b fix(test): check each coverage tool on the set that carries it
list_untested_assets is a planner tool, not a worker tool; the fail-open assertion can only be made against PlannerTools.
2026-11-17 22:18:54 +01:00
BaaRai 8ae53f74cf Merge pull request #306 from Protonmatter/protonmatter/mitm-passthrough-ttl
Expire MITM passthrough after one minute
2026-11-17 22:14:58 +01:00
BaaRai 03ac1c7d47 Merge pull request #300 from Protonmatter/protonmatter/shutdown-outbox
Drain task goroutines on shutdown and replay unsaved activities
2026-11-17 22:08:25 +01:00
protonmatter 287cbb685c Treat an expired passthrough mark as intercepted again, and say what the window costs.
Replay was still honoring a stale bypass, and a host whose interception always fails now loses one request per minute instead of one per process.
2026-11-17 15:58:24 -05:00
protonmatter 186594ed3a Cap every non-multipart body and answer an oversized one with 413.
Handlers that decode JSON directly were still unbounded, and a body past the cap was reported as a bad request.
2026-11-17 15:57:43 -05:00
protonmatter 133dc68668 Test that a failed coverage read stays enabled, including auto-scope writes.
A missing task and a query error both leave the flag on. The worker keeps the coverage tools and still records auto scope when the stored flag is off.
2026-11-17 15:52:04 -05:00
protonmatter 40de6ba898 Say what a restored task budget still allows, and test the lanes that count.
A task already inside the wrap-up reserve only has that reserve left. The worker estimate starts from the defaults because usage rows have no run boundary.
2026-11-17 15:50:00 -05:00
protonmatter a1c6103cbf Stop admitting work before the drain and replay each outbox row once.
The listener closes before Wait, and a shutdown refuses new task operations. Wait also stays until detached runs finish. The activity insert and the outbox delete commit together, and a row that keeps failing is dropped after five attempts so it cannot block the rest.
2026-11-17 15:41:56 -05:00
BaaRai 56d11bb51c Merge pull request #290 from Coff0xc/fix/rsi-lesson-retract
fix(db): retract lesson evidence when a disposition reverses
2026-11-17 20:30:19 +01:00
Coff0xc c73fec7471 fix(db): look up caution lessons by cue
The caution action carries the vulnclass, not the finding summary.
2026-11-17 19:13:32 +00:00
Coff0xc 0fb4ed145d fix(db): retract every retest when a finding is reversed
The negative path only dropped the latest retest. Operator-retired
lessons with evidence also came back on the next extract.
2026-11-17 19:13:31 +00:00
Coff0xc c0ce7a9494 fix(db): retract lesson evidence when a disposition reverses
Re-extract after flipping a finding to false_positive left the old
positive lesson in place.
2026-11-17 19:13:19 +00:00
BaaRai 758bc416dd Merge pull request #307 from BaaRai/chore/contributing-pr-cap
docs: cap contributors at 7 open pull requests, and have the bot say so
2026-11-17 20:11:38 +01:00
BaaRai 28363ec3e5 docs: document the 7 open pull request cap 2026-11-17 20:06:36 +01:00
BaaRai d4c1a5cca1 Merge pull request #298 from BaaRai/feat-bulk-finding-status
feat(findings): bulk status update from the findings table
2026-11-17 19:58:49 +01:00
BaaRai 72f3b0c3af Merge pull request #287 from Coff0xc/fix/rsi-lesson-correctness
fix(db): scope RSI lessons from task_scope and stop splitting UTF-8
2026-11-17 19:58:45 +01:00
Coff0xc a2b26f5416 fix(db): skip RSI lesson extract on multi-company tasks
NULL company_id leaked those lessons to every later task.
2026-11-17 18:08:49 +00:00
protonmatter 0234025d28 Drain task goroutines on shutdown and replay activities that could not be stored.
The outbox migration is 0006 because 0005 is already traffic rewrite rules. A shutdown cancel leaves an in-flight intent claim running, so the next start can reset it to open instead of recording the interrupt as done or blocked.
2026-11-17 13:05:23 -05:00
protonmatter 69bdd94d13 Cap JSON request bodies and bound how long a body may arrive.
decode stops at 32 MiB. ReadTimeout limits header and body arrival without cutting a handler that is already running.
2026-11-17 13:04:50 -05:00
protonmatter 08eb4ec244 Expire a MITM passthrough mark after one minute.
A host that cannot be intercepted is tunneled until the mark expires, then interception is tried again.
2026-11-17 13:04:37 -05:00
protonmatter ce218c4b16 Leave asset-coverage tools available when the flag read fails.
A missing task stays enabled. A database error is returned to the caller and logged, instead of being treated as a reason to hide the tools.
2026-11-17 13:04:36 -05:00
protonmatter be25f14970 Restore a task spend cap from the lanes the live ledger counts.
Planner, worker, judge, and compactor rows rebuild the cap. Main-agent chat, goal decomposition, and side questions stay out, so a restart does not count turns the running process never metered.
2026-11-17 13:04:36 -05:00
Coff0xc cc0082cfda fix(db): scope RSI lessons from task_scope and stop splitting UTF-8
Lessons were scoped on tasks.company_id, which create never writes.
Generic rows also sorted first on Postgres.
2026-11-17 18:03:10 +00:00