Commit Graph
502 Commits
Author SHA1 Message Date
BaaRai 2c8359fdb1 feat: built-in backup script (pg_dump with rotation, optional data archive)
scripts/backup.sh dumps the Postgres database through the postgres compose
service (no host psql needed) into timestamped gzip files under backups/,
keeping the newest N (default 14). --with-data additionally tars the
bind-mounted data directory and fails loudly when files written by the
container are unreadable instead of shipping a partial archive. README gains
a Backups section with the restore one-liner and a cron example.

Closes #40
2026-10-11 22:46:47 +02:00
BaaRai e2d7eecb61 feat: rea reverse-engineering skill + per-server MCP HTTP request timeout (#37)
feat: rea reverse-engineering skill + per-server MCP HTTP request timeout
2026-10-11 19:55:54 +02:00
BaaRai 799defadd1 fix: quote the rea skill description so the YAML frontmatter parses
A plain YAML scalar cannot contain a colon followed by a space; the unquoted
description had one, so yaml.Unmarshal failed and every frontmatter field
(including mcps) stayed empty. The skill then loaded with its directory name
but never gated its MCP server, and the server was silently skipped.
2026-10-11 19:09:08 +02:00
BaaRai 24c8ea13c0 feat: rea reverse-engineering skill + per-server MCP HTTP request timeout
Add a rea skill (skill-gated MCP): agents get binary and application package
reverse engineering through a rea MCP server, with tools kept deferred so the
172-tool catalog never bloats the prompt until the skill loads.

Remote MCP servers now take timeout_seconds (default 120): analysis servers
with minutes-long tool calls were cut off mid-call by the fixed 120s client
timeout. Applies to the Streamable HTTP transport; wired through discovery,
the ScopeSentry sync client, the API and the MCP dialog.

Closes #8
2026-10-11 19:02:23 +02:00
BaaRai b17fa7fe3a Merge pull request #36 from BaaRai/docs/prune-upstream
README: prune dead upstream links and fork-irrelevant sections
2026-10-11 17:23:53 +02:00
BaaRai e771e4f165 README: prune dead upstream links and fork-irrelevant sections
The original ARTEX repository no longer exists upstream, so both clone
URLs and both Releases links pointed at 404s: they now point at this
fork, which is the maintained source. The live demo lines and the
WeChat community group section (with its QR code screenshot) belonged
to the original author's channels and are removed. The References,
ScopeSentry, norma and AegisHook links stay (all alive, all
meaningful).
2026-10-11 17:23:46 +02:00
BaaRai 4ce99fb8bd Merge pull request #35 from BaaRai/docs/readme-coherence
README: make the license terms match reality, drop em dashes
2026-10-11 16:38:57 +02:00
BaaRai 4a901cb417 README: make the license terms match reality, drop em dashes
The repo is public now, so the header no longer says it is kept
private. The usage terms still described a learning-only toy, which
contradicted what the tool is; they now require explicit
authorization (own systems, labs, or bounty program scope) and drop
the mainland-China-specific law list for a general jurisdiction line.
All em dashes are replaced with standard punctuation.
2026-10-11 16:38:50 +02:00
BaaRai e827c62933 Merge pull request #34 from BaaRai/feat/traffic-ingest
Traffic ingest: capture operator browsing via a browser extension
2026-10-11 15:03:08 +02:00
BaaRai d8f47d4359 Traffic ingest: capture operator browsing via a browser extension
Closes #33. The MITM proxy only sees the agent's own actions, so
anything behind a human gate (signup captcha, email OTP, 2FA, SSO)
left the authenticated surface dark. The operator's browser becomes a
capture source instead:

- traffic: exported RecordExternal storing an externally captured
  exchange through the same spill/blob/FTS path as proxy traffic
  (insert logic shared with record()); rejects unparsable URLs and
  empty methods
- server: POST /api/traffic/ingest inside the authenticated API group,
  batch capped at 50 entries, bodies truncated at 256 KiB, per-entry
  ingested/failed counts
- extension/: Manifest V3 Chrome/Edge extension driving the
  chrome.debugger Network domain on the chosen tab, batching text
  exchanges to the ingest endpoint with the operator's URL + JWT in
  chrome.storage.local; binary bodies skipped; flush on batch/stop
- tests for both layers, README section
2026-10-11 14:53:08 +02:00
BaaRai 95a8206cb6 Merge pull request #30 from BaaRai/bot/fix-argjson
Bot: quote the response_format JSON for --argjson
2026-10-10 19:19:39 +02:00
BaaRai 0e82253686 Bot: quote the response_format JSON for --argjson
--argjson requires strict JSON; the unquoted-key object made jq fail,
sent an empty request body, and the triage died with 'model returned
nothing'. Also log the raw API response when choices is missing so the
next failure shows its cause immediately.
2026-10-10 19:19:34 +02:00
BaaRai 905e401676 Merge pull request #28 from BaaRai/bot/json-mode
Bot: JSON mode for triage, temperature 0, flash model
2026-10-10 19:16:42 +02:00
BaaRai 42f3bd98ea Bot: JSON mode for triage, temperature 0, flash model
The trailing-line LABELS contract was unreliable at temperature 0.2:
a raw A/B run showed both deepseek-chat and deepseek-flash emit the
line correctly at temperature 0 but drop it nondeterministically at
0.2 (five failed live runs, one lucky success). Structural fix: the
triage now requests response_format json_object, temperature 0, and
parses the reply with jq (comment field for the reply, labels array
for labeling). The label whitelist still drops invented names and the
raw JSON is logged before parsing. Model switched to deepseek-flash:
the A/B showed JSON compliance on both models and flash is the
cheaper line. Mentions and PR first-looks keep text mode at
temperature 0.
2026-10-10 19:16:37 +02:00
BaaRai cf68aece0a Merge pull request #26 from BaaRai/bot/restore-prompt
Bot: restore the original LABELS instruction wording
2026-10-10 19:08:06 +02:00
BaaRai f420277729 Bot: restore the original LABELS instruction wording
The reworded instruction from #20 ("plain text with no markdown
formatting, characters, or emphasis") made models stop emitting the
LABELS line entirely; the original quoted phrasing had 100 percent
compliance. Tolerant parser and debug logging stay.
2026-10-10 19:08:00 +02:00
BaaRai e39734539d Merge pull request #24 from BaaRai/bot/debug-tail
Bot: log the raw reply tail for triage debugging
2026-10-10 19:06:04 +02:00
BaaRai d1d28cb333 Bot: log the raw reply tail for triage debugging 2026-10-10 19:05:59 +02:00
BaaRai 631859657a Merge pull request #22 from BaaRai/bot/revert-flash
Bot: back to deepseek-chat
2026-10-10 19:02:19 +02:00
BaaRai 698ec389e0 Bot: back to deepseek-chat
deepseek-flash dropped the LABELS instruction twice in live tests
(decorated once, absent once); deepseek-chat followed it exactly on
the first try. The price difference is fractions of a cent per call,
reliability wins. The tolerant parser from #20 stays: it is harmless
and protects against any model formatting quirks.
2026-10-10 19:02:13 +02:00
BaaRai 919755dc2a Merge pull request #20 from BaaRai/bot/robust-labels
Bot: tolerate decorated LABELS lines from smaller models
2026-10-10 19:00:09 +02:00
BaaRai c08a229a57 Bot: tolerate decorated LABELS lines from smaller models
deepseek-flash sometimes bolds or backticks the LABELS marker and the
individual names. Accept any decoration around the marker line and
strip markdown characters from each name before the whitelist check.
Also log the parsed label line for easier triage of future misses.
2026-10-10 19:00:04 +02:00
BaaRai 0213310e38 Merge pull request #18 from BaaRai/bot/deepseek-flash
Bot: switch the model to deepseek-flash
2026-10-10 18:56:23 +02:00
BaaRai f95e975e31 Bot: switch the model to deepseek-flash
DeepSeek's current recommendation: V4.1-Flash replaces V4-Pro and is
the efficient line (new encoder-decoder MoE, quarter-size KV cache,
off-peak at half price). Plenty for triage work; the API name is
deepseek-flash.
2026-10-10 18:56:18 +02:00
BaaRai 765308712e Merge pull request #16 from BaaRai/bot/maintainer-labels
Bot: label maintainer-opened issues, silently
2026-10-10 18:46:37 +02:00
BaaRai 7511937e82 Bot: label maintainer-opened issues, silently
Closes #15. Issues opened by the maintainer now go through the same
classification and label application but without the triage comment
or reaction. Visitors keep the full behavior; mentions and PR
first-looks stay maintainer-off.
2026-10-10 18:46:31 +02:00
BaaRai e9527fa8f2 Merge pull request #14 from BaaRai/bot/triage-labels
Bot: apply type and priority labels when triaging new issues
2026-10-10 18:43:27 +02:00
BaaRai 875f2f0f53 Bot: apply type and priority labels when triaging new issues
Closes #13. The triage prompt now ends with a LABELS line (bug,
question, feature, plus P1/P2/P3 for bugs). The script strips that
line from the posted comment, filters it against a fixed whitelist,
creates the labels with stable colors if missing, and applies them.
Mentions and PR first-looks stay comment-only.
2026-10-10 18:43:21 +02:00
BaaRai 3eebf02596 Merge pull request #12 from BaaRai/bot/issue-pr-bot
Add triage and reply bot for issues and pull requests
2026-10-10 18:18:20 +02:00
BaaRai 815a12d91c Merge pull request #11 from BaaRai/ci/add-ci
Add CI: go build/vet/test with postgres, web typecheck and static build
2026-10-10 18:18:16 +02:00
BaaRai 525ad9ffde Skip the four known-broken tests in code instead of CI -skip flags
The go test -skip flag proved unreliable in the full-suite CI shape
(the same pattern skipped correctly in isolation but ran on the
runner), so each of the four tests now carries an explicit t.Skip with
the reason and a pointer to issue #9. The CI workflow drops the -skip
argument and keeps serial package execution.
2026-10-10 18:12:42 +02:00
BaaRai 78a2d2c01f ci: serialize test packages against the shared postgres
The rotating agent-package failures were cross-package database
interference: go test runs package binaries in parallel and they all
share the one postgres service, so fixtures delete each other's rows.
-p 1 makes package execution serial and the database deterministic.
2026-10-10 17:50:07 +02:00
BaaRai 24e40338b1 ci: fix skip typo, add the CI-flaky llmrec test to the list
First CI run caught a typo in the skip list (the test name is
TestGraphOverviewExpands, with a d) and exposed that
TestSideUsageRecordedOnceOnConsumerCancellation is timing-sensitive
on 2-core runners: it passes locally, fails on CI. Both noted in #9.
2026-10-10 17:44:57 +02:00
BaaRai 88dbe0cb66 Add triage and reply bot for issues and pull requests
Closes #10. A GitHub Action bot with no server: one triage comment per
new issue (classification, missing-info list, grounded first answer),
answers comments that @artex-bot, and a first-look summary checklist on
opened pull requests. Comment-only, never an approving review. Skips
the maintainer, bots, and itself; exits cleanly without the API key;
all model inputs are size-capped.
2026-10-10 17:38:07 +02:00
BaaRai 74e85bc945 Add CI: go build/vet/test with postgres, web typecheck and static build
Closes #9. Go job runs the test suite against a postgres:16 service
container, skipping the three tests that fail on unmodified upstream
code with a fresh database (documented in the issue). Web job runs
tsc --noEmit and the static export build.
2026-10-10 17:36:38 +02:00
BaaRai 858021252e Merge pull request #7 from BaaRai/fix/credential-username-placeholder
Clarify credentials username placeholder
2026-10-09 15:17:24 +02:00
BaaRai 39e630f3fb Clarify credentials username placeholder
Bug bounty alias accounts are nearly always emails, so a bare
"username" placeholder read like a handle only. Say "email or
username" in both the creation dialog and the task detail tab.
The agent tool description already said "login name / email used".
2026-10-09 15:17:12 +02:00
BaaRai ea933902c9 Merge pull request #6 from BaaRai/fix/credentials-ui-regression
Fix credentials UI regression from #4
2026-10-09 14:46:17 +02:00
BaaRai d3e6f4167e Fix credentials UI regression from #4
The test accounts section was mounted after the scrollable field area
of the New task sheet, so it sat pinned under the scrollbar instead of
scrolling with the other fields, and its Add account button floated in
a header row instead of sitting in the field content like Add row.

Move it inside the scroll container as a proper Field with the add
button below the rows, matching the intercept rules editor pattern.
Also place the credentials TabsContent after assets in the task detail
page to match the TABS array order and use the local id variable.
2026-10-09 14:45:52 +02:00
BaaRai 6c7169565b Merge pull request #4 from BaaRai/feat/task-credentials
feat(tasks): per-task test-account credentials
2026-10-09 14:34:15 +02:00
BaaRai c177ab9d86 feat(tasks): per-task test-account credentials
Task credentials (#3): declare test accounts at task creation, and never
lose the accounts the agent registers on its own.

- task_credentials table (unique per task+domain+username; upsert
  overwrites the password in place), idempotent schema migration
- POST /api/tasks accepts credentials; GET/POST/DELETE
  /api/tasks/{id}/credentials serve the UI (manual add, e.g. relaying an
  OTP-verified account; delete)
- empty password = the "agent generates" mode: the entry surfaces in the
  worker's graph overview with an explicit instruction to register that
  account with a strong password and record it
- new tools save_task_credential / list_task_credentials for worker and
  pentest; the graph overview injects the task's credentials each round
  with a standing note: reuse matching entries, always record accounts
  you register
- New Task dialog: optional credentials section (domain, username,
  password, note) with a dedicated-test-accounts hint
- task detail: Credentials tab, passwords masked with explicit
  reveal/copy, agent-recorded badge, light polling so mid-run recordings
  appear

One-shot binding migration (settings-flag-guarded, same pattern as the
other seeds) grants the two tools to worker+pentest on databases seeded
before this change; fresh DBs get them via WorkerTools()/the pentest
catalog.

Closes #3
2026-10-09 14:28:08 +02:00
BaaRai b28829e36d Merge pull request #2 from BaaRai/fix/pause-preserves-timeout-budget
fix(tasks): freeze the timeout budget while a task is paused
2026-10-09 11:46:18 +02:00
BaaRai 353a947285 fix(tasks): freeze the timeout budget while a task is paused
deadline_at is a wall-clock timestamp, so pause time counted against the
task timeout: pausing overnight (or shutting the machine down while
paused) made the deadline ring while parked, and resuming landed
straight into the settle sequence and a timeout terminal state.

ApplyTaskPause now stamps paused_at, and ApplyTaskAdmission credits the
paused interval back onto deadline_at in the same atomic UPDATE that
ends the pause (paused_at is cleared there too). The shifted deadline
flows to the live handle via the existing RETURNING mirror, so the
engine clock context picks it up. Matches the re-basing the
archive-restore path already did for paused tasks.

Migration is an idempotent ADD COLUMN; tasks paused before the upgrade
have no paused_at and keep the old behavior.

Fixes #1
2026-10-09 11:37:30 +02:00
BaaRai 0aa837149d README: note this is a private English fork of Autumn-27's ARTEX 2026-10-08 23:22:05 +02:00
BaaRai e233c02314 Translate all Chinese text to English
Comments, doc comments, UI labels, log and error messages, LLM prompt
strings, markdown docs, test data and assertions. Identifiers, enum
keys, routes, placeholders and code structure are unchanged.

Notes:
- docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md
- tests that exercised CJK specific handling (GBK zip names, Chinese
  full text search) now use ASCII equivalents; go build passes and the
  test suite matches the pre translation baseline (remaining failures
  need a PostgreSQL DSN and fail identically on the original)
- frontend mention syntax now uses English kinds (finding, asset, ...)
  matching the backend, chat mentions tests pass
2026-10-08 23:14:34 +02:00
Autumn-27 d1196853dc docs(changelog): 定版 0.3.15 2026-10-07 08:54:02 -04:00
Autumn bd4a6e31e8 Merge pull request #197 from Autumn-27/fix/auth-init-fail-open
fix: 密码初始化/登录接口在数据库读失败时 fail closed
2026-10-07 19:47:48 +08:00
Autumn-27 66b7006c69 fix bug 2026-10-07 07:45:28 -04:00
Autumn f4aea9859d Merge pull request #191 from Autumn-27/feat/judge-token-usage
feat(intercept): 模型兜底审批单独计量 token 并在配置页展示
2026-10-04 14:43:54 +08:00
Autumn-27 8bc4d58c85 feat(intercept): 模型兜底审批单独计量 token 并在配置页展示
兜底审批(LLM judge)调模型判定漏网命令,其 token 消耗此前无法单独查看:
usage 行要么无 worker 归属、要么被并进复用的模型 profile 桶里。

- llmrec 增加 WithWorker 上下文覆盖,reviewer 调用前标注 worker='judge',
  让审批调用的计量行可被单独筛出(复用现有 llm_usage.worker 列,无需迁移)。
- db.JudgeUsageStats 返回累计总量 + 近 N 天每日序列(WHERE worker='judge')。
- 新增 GET /api/intercept/judge/usage。
- 配置页「模型兜底审批」开关下方新增用量卡片:调用次数 / 输入 / 输出 /
  缓存读写 五项统计 + 近 30 天每日消耗迷你柱图 + 刷新。
2026-10-04 02:43:26 -04:00