Commit Graph

188 Commits

Author SHA1 Message Date
Sycun 12b4bf638e fix(app,hitl,chat): lock DB instance before startup recovery and clear stale task/plan state 2026-11-30 16:59:32 +08:00
Sycun e7669f445d fix(pi): isolate pooled worker tail calls, record image read receipts, and fallback polyglots 2026-11-29 23:44:22 +08:00
Sycun b501a91913 fix(pi): preserve skill stats, guard vendor draft fields, and propagate runtime config 2026-11-29 21:54:22 +08:00
Sycun f33afa6d93 chore(plugin-hub): merge one-click update branch switcher from main 2026-11-28 20:26:01 +08:00
Sycun 4e12a49f09 feat(update): support selecting and switching target branch in one-click update 2026-11-28 20:25:07 +08:00
Sycun aaa284586f feat(plugin-hub): add plugin capability platform with embedded WebUI proxy and unified LLM gateway 2026-11-28 20:10:45 +08:00
Sycun 1c5c04362b feat(settings,chat): add GUI controls and entry points for vision model and knowledge base 2026-11-28 19:52:38 +08:00
Sycun f4257cea3a perf(web,config): prevent cross-page HTTP stalls and honor 1M context default in probes
- Upgrade useResource and NotificationsBell with AbortController cancellation on unmount/reload and in-flight deduplication for silent polling, preventing abandoned requests from exhausting browser HTTP/1.1 connection slots
- Move external MCP tool lookups and markdown agent directory scans outside ConfigHandler.mu.RLock, bind request context, and support GET /api/config?include_tools=0 for chat model preferences and model settings
- Add immutable Cache-Control headers for content-hashed /static/app/assets/* and 1h caching for /static/i18n/*
- Add indexed created_at lower bound to NotificationHandler vulnerability summary query
- Pass effective configured/default 1M context_window in model probe requests, compute effective_max_total_tokens on fallback, display fallback window/source in ProbePanel, and suppress false context_window_unknown warnings when 1M default or manual window is active
- Rebuild web/static/app bundle and add Go + Playwright regression tests
2026-11-28 18:52:08 +08:00
Sycun 966836ef19 perf(chat): eliminate old conversation loading lag and polling livelock
- Add compact summary mode (include_process_details=summary) on GET /api/conversations/:id that skips progress noise, strips duplicated tool outputs/large arguments/long thinking bodies/finalText, and defers full payloads for on-demand GET /api/process-details/:id fetches
- Prevent paginated GET /api/messages/:id/process-details from leaking full tool_result payloads through message when includeToolPayload is false
- Add stdlib Gzip response compression middleware (skipping SSE, WebSocket, and already-compressed assets)
- Add SQLite composite indexes on messages(conversation_id, created_at) and process_details(conversation_id/message_id, created_at)
- Switch chat page to summary loading with on-demand ToolBlock/ReasoningBlock detail fetching, AbortController cancellation, and in-flight poll deduplication to fix backgroundRunning 4s polling livelock
- Memoize MessageRow/TurnBody, defer prettyJson until panel expansion, and window long conversation histories (>40 messages)
- Rebuild web/static/app bundle and add Go + Playwright regression tests
2026-11-28 18:41:33 +08:00
Sycun b5f4ab9071 feat(assessment): fuse global security base and deep assessment governance (v1.8.2)
- Add random-nonce CSAI_DATA prompt guard envelope and typed scanner surface ingest (nmap/nuclei/httpx/ffuf) with cross-path execution deduplication
- Add deterministic 3-axis vulnerability fingerprinting and 5-dimension adversarial review shared across record/status/retest/assessment review
- Extend project scope_json with structured allow/deny constraints, scanner noise profiles, and evidence-gated project lessons (off/shadow/inject)
- Bundle offline WSTG/CWE/ATT&CK lookup_security_taxonomy tool and Pi compact skill index + prompt_cache_prefix_split support
- Add deep assessment pre-plan goal decomposition, persistent coverage ledger & acceptance gate, optimistic-concurrency plan notes, and graceful segment wrap-up
- Bump personal version to v1.8.2 and update CHANGELOG.md
2026-11-27 19:21:04 +08:00
Sycun 480f1ae7e2 feat(projects): link project memory and vulnerability archives 2026-11-26 17:50:36 +08:00
Sycun 614e5ff57f feat(assessments): add in-task progress questions and scoped operator controls 2026-11-20 22:19:51 +08:00
Sycun f689e92678 feat(projects): share evidence across assets, assessments, and reports
Keep project facts, collections, retests, and exports on the same read boundary, and stop a manual fixed status or a blocked batch from looking complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-20 20:07:23 +08:00
Sycun 2fab8b7e11 feat(assessments): record attack surface clues alongside assets 2026-11-20 20:03:34 +08:00
Sycun 67007436a0 fix(settings): test audit models with configured backend 2026-11-19 22:55:20 +08:00
Sycun 6815645a3f fix(chat): persist human approval for the conversation 2026-11-19 10:45:23 +08:00
Sycun 04a70859b7 feat(frontend): migrate to Semi Design and refresh workspace
统一 React + Semi Design 页面与视觉体系,保留既有业务接口、权限和深链接;补齐构建产物、SPA 入口校验及浏览器回归,减少旧模板与全局脚本的维护成本。
2026-11-19 09:09:11 +08:00
Sycun e8ad42ac2c feat(assessments): connect asset and acceptance evidence reviews 2026-11-19 00:09:43 +08:00
Sycun c5f797c521 feat(assessments): add shared asset graph and durable intent exploration 2026-11-15 09:20:09 +08:00
Sycun e6f80618f3 feat(assessments): link findings to tasks and source evidence 2026-11-14 09:45:01 +08:00
Sycun 3097d5f9ff feat(assessments): make exploration continuous with graph memory 2026-11-14 02:29:50 +08:00
Sycun 1ebfac570c feat(assessments): add Pi-native long-running assessment workspace 2026-11-14 01:18:43 +08:00
Sycun 1c0c6b9c91 revert(tasks): restore v1.8.0 batch queue workflow 2026-11-14 00:10:44 +08:00
Sycun 310007fab3 fix(tasks): paginate compact task lists and preserve scroll on refresh 2026-11-13 23:20:58 +08:00
Sycun ed427505a8 feat(tasks): unify task management and redesign the creation dialog 2026-11-13 22:01:00 +08:00
Sycun e1c4551b64 feat(tasks): replace deep assessments with durable goal tasks 2026-11-13 20:20:05 +08:00
Sycun a125d749e7 feat(vulnerabilities): add review workspace and persistent finding cases 2026-11-13 16:11:36 +08:00
Sycun 4f2af3371b fix(tls): reuse the generated HTTPS certificate across updates 2026-11-13 11:09:49 +08:00
Sycun aa7a533497 fix(update): reload after confirming the accepted update is running 2026-11-13 10:05:42 +08:00
Sycun cfe3f82dd4 fix(pi): invalidate deleted sessions and prepare legacy upgrades 2026-11-12 21:19:09 +08:00
Sycun 5d98f5d805 fix(update): switch versions without interrupting sign-in 2026-11-12 17:35:35 +08:00
Sycun 9ed4e19f5e fix(update): activate new binaries without a supervisor 2026-11-11 17:34:13 +08:00
Sycun b88e6229eb feat(assessment): close delegated work loop with intake and owner questions 2026-11-11 13:33:13 +08:00
Sycun 0dd997ca01 refactor(runtime): remove Eino and make Pi the sole agent engine 2026-11-11 12:45:32 +08:00
Sycun 67683f4266 merge: preserve personal assessment and model profile work in Pi migration 2026-11-11 09:22:23 +08:00
Sycun 43b5ac2da5 feat(runtime): introduce Pi agents and native workflow and retrieval engines 2026-11-11 09:19:14 +08:00
Sycun f895a33eb1 merge: integrate local model profiles with personal gateway headers 2026-11-03 10:17:34 +08:00
Sycun 1ac81fe217 merge: integrate HTTP proxy settings into personal main 2026-11-03 10:13:15 +08:00
Sycun 261d2cd0ad feat(assessment): add acceptance review, specialist workers and resilient recovery 2026-11-02 23:46:55 +08:00
Sycun ef89d9e464 fix(assessment): bind approvals and enforce scoped execution boundaries 2026-11-02 22:32:11 +08:00
Sycun 07864b355f feat(assessment): add durable deep assessment workbench independent of chat 2026-11-02 21:17:03 +08:00
Sycun cc37959e14 feat(proxy): add stable HTTP egress settings isolated from tools and models 2026-11-01 00:03:51 +08:00
Sycun baa1d02cd4 feat(vulnerabilities): offer Markdown and Word report downloads 2026-10-30 09:29:44 +08:00
Ed1s0nZ c0d5c8460b feat(api): add durable asynchronous conversation runs 2026-10-23 11:45:15 +08:00
Sycun d7e8a29dfe feat(ai): add local model context profile and runtime window probe
- Probe Ollama, llama.cpp, LM Studio and vLLM runtime context windows, including reverse-proxy subpaths
- Add context_window and context_profile=local: clamp budgets, compaction triggers, tool-output limits and always-visible tools
- Count tool schemas in the soft input budget and apply a 10% token estimate margin for local tokenizers
- Prefer max_tokens for local requests across agent, attack-chain, FOFA, workflow and HITL paths, and honor channel extra_request_fields
- Recognize local context-overflow errors and retry with aggressive compaction
2026-10-21 00:12:57 +08:00
Sycun 6a67364947 feat: add vulnerability retest branches with an isolated evidence log
Retesting a finding creates an independent conversation branch that
snapshots the source history and model trace, so verification can run
multi-turn without writing to the original session.

- POST /api/vulnerabilities/:id/retest creates the branch and persists the
  prompt, so a lost response, navigation or refresh can resume it
- new update_vulnerability_status tool closes the loop; a retest branch may
  only read and update its own finding
- {{vulnerability_id}}, {{conversation_id}} and {{source_conversation_id}}
  resolve on send, in the first turn and in follow-ups
- evidence appends to a read-only vulnerabilities.retest_log column instead
  of retest_notes: that field is operator-authored and the edit form
  rewrites it wholesale, so a routine edit used to erase the retest trail
- the retest prompt is prefilled with the operator's retest_notes, which
  already states how to verify the fix
- copied messages are re-bound as time.Time. Scanning a DATETIME column into
  a string yields RFC3339Nano while AddMessage writes the driver's
  space-separated format, and messages sort on the raw created_at text, so a
  branch rendered its new turn above the inherited history
2026-10-10 07:21:20 +08:00
Sycun e80668b2e9 feat: make a restart part of the one-click update, and recover the page by itself
The console now knows what it is running: the status endpoint compares the binary
identity captured at startup (size + nanosecond mtime) with the file on disk, so
an update, a rollback or a CLI run that swapped the binary without a restart is
reported as needsRestart (with the build time) - a state that used to live only in
one job's result and vanished with the process. That state grows a persistent
banner and POST /api/system/update/restart (409 when there is nothing to activate
or a job owns the tree, 400 without a hook), so a forgotten tick is one click
instead of a shell login.

The restart tick defaults to on exactly where it is safe: launchd/systemd leave
markers in the environment (XPC_SERVICE_NAME, INVOCATION_ID/JOURNAL_STREAM) and
the box follows them; an operator's own choice is never second-guessed afterwards.

While the process is down the console becomes a recovery view that probes the
status endpoint every 2 seconds: 200 means the old process still answers, a dead
socket means it is on its way out, and a 401 - only a new process can fail to know
the session - reloads the page back to #system-update. A job poll that dies during
a requested restart is the restart in flight, not a failure to toast.

Also fixed: updateT now asks i18next not to escape interpolated values, because
the console escapes at render time - the apply confirm dialog has been showing
branch names with &#x2F; ever since they contained a slash, and the new banner
showed dates the same way.

Tests: 7 new console contract tests (36 total: banner, tick default, restart
confirm/refusal, watchdog 200-vs-401, timeout copy, the in-flight poll death) plus
handler tests for the stamp and the endpoint, all mutation-probed; docs describe
the pending-restart state and the self-recovery.
2026-10-07 22:53:32 +08:00
Sycun acd84cd525 feat: let an installation choose its update source, and adopt a plain directory
config.yaml gains an optional update section (remote / remote_url / branch). The
resolver keeps its default - whatever remote this tree already tracks - and the
explicit choice wins when set, which is also what lets a tarball installation
that never saw git get on the update rails at all.

- RemoteURL is fetched straight into a ref namespace of its own, so a URL source
  cannot be shadowed by a same-named remote's stale refs. ValidRemoteURL allowlists
  https/http/ssh/git/file and local absolute paths, and rejects git's ext::
  transport (which executes commands) before anything reaches argv.
- Adopt connects a plain directory to the source. Preview is side-effect free (the
  fetch happens in a throwaway bare repository) and lists every local file whose
  content the target would replace, plus the operator content that is put aside.
  The confirmed run inits, adds origin, stashes operator content, keeps every
  replaced file under .update-backup/<ts>/overwritten/ so "the update ate my edit"
  has an address, lands the target content, sets upstream, rebuilds the binary.
  A failure removes only the .git it created itself; once the content has landed
  the tree stays adopted even if the build fails.
- Console/API: the status envelope carries the configured source;
  POST /system/update/source writes it through the same config path every other
  setting uses (validated, audited); POST /system/update/adopt is preview-then-job,
  with the job's kind recorded. OpenAPI updated; RBAC rides the existing
  update:apply prefix and the route inventory stays green.

Tests: URL-mode check/apply against real repositories (including the address
beating a remote name), URL validation table, and the full adoption story -
preview touches nothing, operator content survives, the replaced edit is in the
backup, and the adopted tree updates and rolls back like any other installation.
2026-10-07 12:46:32 +08:00
Sycun cb8bc6b824 feat: update this installation's own source in one action
An operator running a fork has no honest way to upgrade: upgrade.sh downloads the
Release tarball of one hard-coded third-party repository and rsyncs it over the
tree, so "upgrade" means "overwrite yourself with somebody else's code", and the
safe alternative is to pull by hand and remember the build command.

internal/update drives the remote the directory already tracks: fetch, fast-forward,
go build into .update-staging, atomic rename of the binary (the previous one kept as
cyberstrike-ai.prev), and a .update-state.json so a rollback has a target that is
not guessed at. Refusals are the point - local source edits and a diverged branch
stop with the file names and commit counts in the error rather than being reset to
match, and operator-owned content (roles/skills/tools/agents/data/config.yaml) is put
aside before the merge and restored over it, with what was kept listed in keptContent
instead of quietly dropped.

Consumers: GET/POST /api/system/update* behind update:read / update:apply (mutations
are process-global, so they need a global-scope session); a console page at
#system-update with an apply button that names why it is blocked, a job polled from
the server and a rollback control; the same three actions as -check-update / -update
/ -update-rollback on the binary; OpenAPI entries for all five endpoints. Permission
gating no longer re-enables a control a page disabled for a reason of its own
(data-state-disabled), which every state-disabled, permission-gated button in the
console was subject to. upgrade.sh becomes a thin shell over the same implementation
and only falls back to the tarball path for installs that are not git work trees.

Docs and the zh/EN/RU dictionaries are updated. The package runs 13 tests against
real temporary git repositories; the HTTP layer, RBAC and the console page each
carry their own contract tests.
2026-10-07 12:07:26 +08:00
Ed1s0nZ 079ba0d2b3 fix: validate login and role inputs and protect task access 2026-10-06 01:36:31 +08:00