87 Commits
Author SHA1 Message Date
Sycun e8a5392b37 fix: serialize installation updates and recover interrupted adoption and rollback 2026-10-09 10:58:12 +08:00
Sycun 94a18263b9 feat: make the update source one repository address, the official repo by default
The update source used to be three things - a remote name or an address, plus an
optional branch - and unset it followed whatever this directory's remotes and
upstream happened to say. That asked people to understand git topology before
they could update, and the person it was built for could not tell what "follow
the remote this tree tracks" meant. It is now one field: config.yaml update.repo,
an address, empty meaning the official repository
(https://github.com/AIPentest/CyberStrikeAI.git). Point it at a mirror (GitHub is
hard to reach in some places) or at your own fork and that is the whole
configuration.

The branch nothing is any more: an update follows the source repository's own
default branch, resolved from the source itself (ls-remote --symref HEAD), so a
fork whose default is not "main" still works and nobody has to name a branch.
Remote names, the mine/origin/upstream ranking, @{upstream} tracking and the
adopt flow's branch argument are all gone with it.

The console page loses two input fields: the source section is one address, a
hint that empty means the official repository, and a save button; clearing the
address is the way back to the default. The install facts drop the remote name,
the check section shows the source's default branch once the network answer
arrives, and the adopt entry no longer requires saving an address first - the
official default makes connecting a tarball install a zero-configuration action.

The CLI now reads the same update.repo field the page saves (LoadUpdateRepo reads
just that field, without validating the rest of the file - a broken unrelated
section must not block the path that fixes the tree), so the keyboard and the
button cannot update from different repositories. -check-update prints the source
it is about to use.

Tests: the source suite now pins the default (official), the single-address save
(including the empty-string reset), and that the followed branch comes from the
source's own default branch rather than a hardcoded "main"; the console suite
posts the one field and renders the default hint; docs, config.example.yaml and
upgrade.sh describe the one-field story.
2026-10-08 13:46:14 +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
Ed1s0nZ 76da98944c fix: mask stored credentials and validate agent saves 2026-10-06 02:04:14 +08:00
SycunandParallels 470eb5ead1 feat: add runtime storage cleanup with per-category retention (#310) (#313)
Runtime artifacts (agent workspaces, tool-output spill, C2 payloads, chat
uploads, workflow checkpoints, diagnostic logs) previously accumulated
without bound: most were only removed when a conversation or project was
deleted, and tmp/c2 plus workflow checkpoints were never removed at all.

Add a storage cleaner with named per-category tasks (Gitea-style), a
settings page tab, and a background sweep that is off by default so
upgrading never deletes existing data.

Safety properties, since mis-deleting live task data costs far more than
the disk saved:
- dry-run is the default; a real cleanup requires dry_run=false together
  with confirm=true at the API layer, not just a frontend dialog
- sessions active within active_grace_hours are always skipped, and a
  failed activity lookup skips conservatively (fail closed)
- directories whose conversation/project no longer exists are reclaimed
  as orphans after orphan_grace_days
- scanners never follow symlinks and every candidate path is confined to
  its category root; deletion renames to a .tmp-for-deletion marker first
  so a crash leaves recoverable residue instead of a half-deleted dir
- storage:* permissions are admin-only; without the grantSystemRolePermissions
  skip the default branch would have given operators an irreversible
  file-deletion right

Also fix two confirmed leaks: DeleteConversation left chat_uploads files
on disk (their rows already vanished via ON DELETE CASCADE), and workflow
checkpoints had no deletion path at all.

Co-authored-by: Parallels <parallels@kali-linux-2025-2.localdomain>
2026-09-25 14:46:23 +08:00
Ed1s0nZandCursor 38b96ec67a feat: add TypeSafe Jev as HITL audit backend
Let audit_agent approve or reject with one System One call instead of chat JSON, while keeping the OpenAI-compatible backend as an option.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 21:15:53 +08:00
Ed1s0nZ 6ad9ea2d13 feat: add configurable tool call blocking and monitoring 2026-09-08 09:44:32 +08:00
temp d6d48c97c0 fix: normalize deepseek config profile 2026-08-25 18:37:08 +08:00
temp 21c6ad9bdf feat: persist hitl default config 2026-08-24 19:45:07 +08:00
公明 cecbe5a086 Add files via upload 2026-08-18 20:20:39 +08:00
公明 55ee5fbac9 Delete internal directory 2026-08-18 20:14:29 +08:00
公明 409e75f15a Add files via upload 2026-08-15 02:19:19 +08:00
公明 2910289f0b Delete internal directory 2026-08-15 01:54:26 +08:00
公明 8bde9d749a Add files via upload 2026-08-15 01:47:48 +08:00
公明 cee46f40fa Add files via upload 2026-07-23 19:07:27 +08:00
公明 06a9cea97d Add files via upload 2026-07-22 10:34:42 +08:00
公明 9464ffe105 Add files via upload 2026-07-21 23:40:49 +08:00
公明 07229f0fde Add files via upload 2026-07-21 20:57:07 +08:00
公明 9bafc2ab98 Add files via upload 2026-07-20 17:31:20 +08:00
公明 1f3472955c Add files via upload 2026-07-17 17:11:16 +08:00
公明 9ac5fd33ec Add files via upload 2026-07-11 11:40:09 +08:00
公明 b76e06ff92 Add files via upload 2026-07-10 21:29:13 +08:00
公明 16a854d0f5 Add files via upload 2026-07-09 11:41:24 +08:00
公明 dc5791f85c Add files via upload 2026-07-07 11:39:05 +08:00
公明 a63b535a68 Add files via upload 2026-07-06 13:58:12 +08:00
公明 b97e726237 Add files via upload 2026-07-03 14:15:51 +08:00
公明 2e2a6dedd4 Add files via upload 2026-07-02 12:02:37 +08:00
公明 b4b2f55665 Add files via upload 2026-06-30 18:04:16 +08:00
公明 39f1c72755 Add files via upload 2026-06-29 14:35:52 +08:00
公明 0bcb16e021 Add files via upload 2026-06-29 10:41:42 +08:00
公明 09b0479fb3 Add files via upload 2026-06-18 21:50:44 +08:00
公明 7eadccbff6 Add files via upload 2026-06-18 12:44:42 +08:00
公明 cf1f8515d9 Delete internal directory 2026-06-18 12:37:39 +08:00
公明 f3be355820 Add files via upload 2026-06-12 19:39:01 +08:00
公明 444f85b9c4 Add files via upload 2026-06-04 13:36:46 +08:00
公明 e606369e31 Add files via upload 2026-06-03 17:16:48 +08:00
公明 f0fb634a6b Add files via upload 2026-06-02 13:27:15 +08:00
公明 0569255189 Add files via upload 2026-05-20 17:54:30 +08:00
公明 9325aed1eb Add files via upload 2026-05-20 16:09:33 +08:00
公明 199392a5d5 Add files via upload 2026-05-19 18:52:22 +08:00
公明 679a68b12f Add files via upload 2026-05-14 11:55:47 +08:00
公明 60a063dd7d Add files via upload 2026-05-14 11:31:56 +08:00
公明 2e1e57ce27 Add files via upload 2026-05-12 12:55:02 +08:00
公明 30afd71c05 Add files via upload 2026-05-11 19:56:38 +08:00
公明 debe967272 Add files via upload 2026-05-06 20:50:28 +08:00
公明 57ebc7c04b Add files via upload 2026-05-04 13:09:43 +08:00
公明 1318607813 Add files via upload 2026-04-29 02:57:22 +08:00
公明 44079674dd Add files via upload 2026-04-28 14:07:01 +08:00
公明 d17da2a47d Add files via upload 2026-04-24 01:54:38 +08:00
公明 7ddf0f2437 Add files via upload 2026-04-22 11:09:43 +08:00