Skip to content

feat(tasks): per-task test-account credentials - #4

Merged
BaaRai merged 1 commit into
mainfrom
feat/task-credentials
Oct 9, 2026
Merged

BaaRai merged 1 commit into
mainfrom
feat/task-credentials

Conversation

@BaaRai

@BaaRai BaaRai commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closes #3

What this adds

A per-task credential list so authenticated testing has a first-class home:

  • At creation: the New Task dialog gains an optional Test accounts section (domain, username, password, note). A program-provided alias account goes here verbatim. Leaving the password empty selects the agent-generates mode from the issue: the entry reaches the worker's graph overview with an explicit instruction to register that account with a strong password and record it.
  • During the run: the agent's registered accounts are no longer forgotten. Two new tools, save_task_credential and list_task_credentials (bound to worker + pentest), plus a standing note injected with the credentials block each round: reuse matching entries instead of re-registering, and ALWAYS record accounts you register.
  • For the human: a Credentials tab in the task detail — passwords masked with explicit reveal/copy, source badge (declared vs agent-recorded), manual add (e.g. relaying an OTP-verified account), delete, and light polling so mid-run recordings appear on their own.

Implementation notes

  • task_credentials table, unique per (task, domain, username): the agent updating an account overwrites the password in place instead of duplicating rows. Idempotent CREATE TABLE IF NOT EXISTS migration.
  • APIs: POST /api/tasks gains credentials; GET/POST/DELETE /api/tasks/{id}/credentials.
  • One-shot, settings-flag-guarded binding migration (same pattern as seedWorkerReadbackRebind etc.) grants the two tools to worker+pentest on databases seeded before this change; fresh databases get them through WorkerTools() and the pentest catalog.
  • The dialog carries the hint from the issue: dedicated test accounts only, since anything declared here transits to the configured LLM provider during the task.

Testing

  • New TestTaskCredentialsFlow (DB-backed): creation with credentials (invalid entry rejected), listing, the agent path recording the generated password onto an empty entry in place, manual add + delete, and cross-task delete isolation.
  • Full agent+server suites on a fresh Postgres: failing tests are exactly the three that also fail on main (TestInterceptFilterHTTP, TestGraphOverviewExpandsAssociatedCompanyScope, TestCaptureApprovalLifecycle — all verified pre-existing by re-running them on the stashed base).
  • go build ./..., go vet, gofmt clean; the five touched frontend files pass an esbuild TSX syntax check.

Out of scope (per the issue)

Cross-task credential sharing and OTP handling (stays interactive via the task chat).

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
@BaaRai
BaaRai merged commit 99dae12 into main Oct 9, 2026
@BaaRai
BaaRai deleted the feat/task-credentials branch October 9, 2026 12:34
BaaRai added a commit that referenced this pull request Oct 9, 2026
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
/api/tasks/{id}/scope 只返回 company_id,前端无从解析名称,测试范围里的
企业行只能渲染成 "company BaaRai#4"。

- TaskScope 增加 company_name,ListTaskScope 与 ListTaskScopeWithSources
  都 LEFT JOIN companies 带出名称(LEFT 而非 INNER:域名/IP/网段行的
  company_id 为 NULL,内连接会把它们全过滤掉)
- 两个查询函数都改,避免结构体字段"一个填一个不填"的不一致
- 前端优先显示名称,公司被删后的残留行仍以「企业 #N」兜底

覆盖图谱的企业节点本就查名显示(task_scope.go 的 BuildCoverageGraph),
不受影响。

Claude-Session: https://claude.ai/code/session_01Q8nhYZfS4H8fsSCBJXxbSy
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
feat(tasks): per-task test-account credentials
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
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.
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
fckoo pushed a commit to fckoo/ARTEX that referenced this pull request Nov 11, 2026
Point the Norma replace at v0.4.7, which brings the thinking replay fix
(BaaRai#4) and the WebFetch CheckRedirect hook (BaaRai#3). go.sum updated by
go mod tidy. No ARTEX code changes.
TaxMachine referenced this pull request in TaxMachine/ARTEX Nov 23, 2026
#1/#4 ssh_upload/ssh_download broken (fact 931): the tool input structs
had NO json tags - snake_case params (local_path/remote_path) never
reached the handler, producing 'local_path and remote_path are
required' for every call. Single-word fields matched case-insensitively
(machine, username), which is why only underscore params broke.
Tagged; AST-audited the whole agent package for the same class (no
other multi-word untagged tool-input fields remain); auto-tagged the
simple ones found along the way. VERIFIED by task 13 end-to-end:
upload + download + hash compare -> confirmed fact 1723.

#2 windbg-mcp attach_process 0x80070057: upgraded the VM service
v0.18.0 -> v0.24.0 (backup kept). attach_process verified live against
a running process - full register state returned. Unlocks heap tools
on live Office processes instead of fresh launches.

#3 fuzzer WER mis-attribution (task 11's 8 fake 'unique' crashes):
Get-CrashSignature now requires the 1001 event to be newer than the
current case's open start (:caseStart) - late-flushed
pre-campaign events can no longer be attributed to the running case.

BaaRai#5 re-dispatched intents replay generate-then-read from zero:
exhausted intents now settle with a resume-checkpoint fact (last
remote action + 'read existing results via crash_dumps/output dirs
before regenerating' guidance) recorded synchronously at settlement,
where a crash/timeout cannot lose it.

BaaRai#6 crash dumps split across dirs: new crash_dumps worker tool (seed
v10) - one call scans the WER LocalDumps configured folder +
%LOCALAPPDATA%/CrashDumps + WER ReportArchive + caller extras,
newest-first with process name parsed from dump names and a
since_seconds attribution fence. Replaces every intent's hand-rolled
two-dir watcher.

All six resolved in the backlog with root-cause notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task credentials: declare test accounts at creation; agent-generated accounts get recorded automatically

1 participant