Commit Graph
63 Commits
Author SHA1 Message Date
gongzhiyong 8e56284baa fix: polish manager account pages 2026-05-30 15:37:28 +08:00
gongzhiyong 8a43018cf5 docs: update desktop sub agile integration guide 2026-05-30 14:39:26 +08:00
gongzhiyong 8c1d9461f4 fix: use valid default agnet runtime models 2026-05-30 14:15:01 +08:00
gongzhiyong edf7aeaf8a feat: add agnet artifact content proxy 2026-05-30 12:55:04 +08:00
gongzhiyong 70663f47ee fix: separate swarm runtime integration
Add separate Runtime mode selection for ordinary sub and swarm flows, including Swarm-specific create payload shaping and Azure VM env wiring. Document the ordinary sub artifact callback gap, swarm runtime findings, PayPal billing boundaries, deployment migration requirements, and desktop/API progress.

Constraint: Keep ordinary sub and HeiCode-Swarm Runtime deployments separate

Confidence: high

Scope-risk: moderate

Tests: go test ./...
2026-05-29 17:31:24 +08:00
gongzhiyong ed9136d29d docs: list remaining agent manager sub requirements 2026-05-28 21:56:17 +08:00
gongzhiyong fecb365e87 fix: complete sub callback agent state 2026-05-28 21:30:53 +08:00
gongzhiyong 8e7bdc6388 fix: sync sub runtime callback state 2026-05-28 21:24:02 +08:00
gongzhiyong 704579f03e fix: normalize agnet runtime callbacks 2026-05-28 20:33:38 +08:00
gongzhiyong 61e060909d fix: localize agnet detail copy 2026-05-28 19:15:41 +08:00
gongzhiyong 7d7c163f37 fix: localize agnet form field labels 2026-05-28 19:03:51 +08:00
gongzhiyong 53cc1a5e63 fix: localize agnet role and resource labels 2026-05-28 18:51:43 +08:00
gongzhiyong 587746db90 fix: localize agnet create run sheet 2026-05-28 18:43:08 +08:00
gongzhiyong 72cbf43dec fix: localize agnet drawer status text 2026-05-28 18:24:07 +08:00
gongzhiyong fd02edcd52 fix: localize simulated agnet status 2026-05-28 18:16:06 +08:00
gongzhiyong efaac446ab fix: localize agnet console copy 2026-05-28 18:08:18 +08:00
gongzhiyong d2f7ab7333 fix: enable encrypted swarm requests 2026-05-28 16:58:27 +08:00
gongzhiyong 7f9f70b1dc docs: add agent manager sub integration requirements 2026-05-28 16:06:52 +08:00
gongzhiyong 8075891770 feat: document and expose swarm runtime contract 2026-05-28 11:57:58 +08:00
gongzhiyong ee5342c404 docs: rename agent manager action lists 2026-05-28 01:30:09 +08:00
gongzhiyong 6848f1a101 docs: add agent manager integration action lists 2026-05-28 01:28:05 +08:00
gongzhiyong 10fc64e172 feat: complete sub task flow callbacks 2026-05-27 23:31:57 +08:00
gongzhiyong 4ccf7b1062 feat: complete swarm manager callback loop 2026-05-27 21:17:32 +08:00
gongzhiyong 741cc0d254 docs: update desktop sub encrypted request flow 2026-05-27 18:46:32 +08:00
gongzhiyong 9f5b4ba777 feat: encrypt desktop sub requests 2026-05-27 18:15:29 +08:00
gongzhiyong f466c40545 docs: update desktop sub agile integration flow 2026-05-27 17:53:04 +08:00
gongzhiyong 5fc0532ec1 fix: propagate agnet runtime stop 2026-05-27 15:19:57 +08:00
gongzhiyong beaf1e6611 fix: align runtime create payload with agnet 2026-05-27 15:03:48 +08:00
gongzhiyong 50b76dd4e6 feat: align agnet runtime v2.1 integration 2026-05-27 11:04:08 +08:00
gongzhiyong 8a6fea235e fix: restrict agnet simulation controls 2026-05-26 18:41:26 +08:00
gongzhiyong 2cc5e667df feat: complete manager agnet callback timeline 2026-05-26 18:38:24 +08:00
gongzhiyong 0abd761d66 feat: add manager sub deployment bridge 2026-05-26 18:23:23 +08:00
gongzhiyong 6562acaa62 docs: add manager standalone execution plan 2026-05-26 18:02:40 +08:00
gongzhiyong 99776d18af docs: refine sub swarm progress checklist 2026-05-26 17:54:37 +08:00
gongzhiyong cc148b15c3 docs: add sub swarm progress checklist 2026-05-26 17:46:51 +08:00
gongzhiyong d16b2ca1d5 fix: correct admin sidebar model links 2026-05-26 16:51:36 +08:00
gongzhiyong d02685dd5e fix: correct admin sidebar model links 2026-05-26 16:42:29 +08:00
gongzhiyong a80c3e0c35 feat: release manager 1.4.4 agnet persistence 2026-05-26 16:01:49 +08:00
gongzhiyong 1ebaa1ccce fix: move signup email hint below email field 2026-05-25 18:08:17 +08:00
gongzhiyong 07b307c094 fix: place signup email hint under email field 2026-05-25 17:57:09 +08:00
gongzhiyong e1b9de2a49 feat: add azure key vault resource discovery 2026-05-25 17:41:43 +08:00
chenchen 23ec354eb5 更新 2026-05-25 16:03:00 +08:00
chenchenandClaude Opus 4.7 da81c57db2 feat(cloud): Azure subscription binding via Service Principal (M2 phase 1)
Sprint 13. Lifts the resource-binding wizard's "Connect cloud account"
step from a disabled "Coming soon" button to a real binding flow,
scoped to Azure for now (AWS / GCP coming soon).

What ships:
  - New AzureCloudBindingSheet — Service Principal credentials form
    (subscription_id / tenant_id / client_id / client_secret + display
    name)
  - Creates a mcp-server ResourceBinding of type 'cloud_account' with
    provider=azure metadata, permission_scope=['azure:read'], status
    flips between 'active' (vault configured) and 'pending' (vault
    not yet wired)
  - Sheet shows a yellow warning when OpenBao isn't configured,
    explaining that client_secret will NOT be persisted server-side
    until vault is online — operators re-enter or rotate the secret
    once vault is up
  - Explicit "what Heicode will / will not do" footer card per
    product docs §13.9 — read-only ARM, never modify without desktop
    approval, never log client_secret
  - Cloud step "Connect" button now opens this sheet (was disabled)
  - Wizard summary description updated: AWS/GCP labelled coming soon
    instead of implying all three providers ship today

Phase 2 (Azure OAuth code flow) + phase 3 (ARM auto-discovery) need
Azure App Registration + OpenBao online first — separate sprints.

i18n localized en + zh.

Verification:
  - tsc --noEmit clean
  - no backend change — leverages existing mcp-server ResourceBinding
    endpoint which already supports cloud_account type

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:53:34 +08:00
chenchenandClaude Opus 4.7 cdcc864298 feat(states): unified QueryState wrapper covers permission + network errors
Sprint 11 — closes M13 ("七态完整性") on the three highest-traffic
pages (Deployments, Events, Audit). Earlier behaviour was binary
(loading skeleton OR card list); 401/403 and offline both fell
through to a toast or a blank page.

New /components/query-state.tsx:
  - One wrapper that takes isLoading + error + isEmpty + retry
  - classifyError reads axios + fetch shapes; maps to 'permission'
    / 'network' / 'generic'
  - Permission state: ShieldOff icon, no retry button (admins must
    grant access; retry would just 401 again)
  - Network state: WifiOff icon, retry wired
  - Generic state: AlertTriangle + retry + decoded error.message
  - Empty state: passthrough to existing EmptyState
  - Loading: passthrough to caller's loadingFallback or 3 skeleton rows

Applied to:
  - AgnetDeploymentsPage (replaces inline loading/empty ternary)
  - AgnetAuditPage (same)
  - AgnetEventsPage (wraps the events ol)

In all three, the existing useQuery now also surfaces error + refetch.
retry: false set so QueryState handles error display directly
instead of TanStack retrying 3 times silently.

i18n strings added for 5 new copy keys (permission denied, network
unreachable, retry, load failed) in en + zh.

Verification:
  - tsc --noEmit clean
  - no backend change

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:48:31 +08:00
chenchenandClaude Opus 4.7 d8f61957f0 feat(manager): version 1.4.2 — H2 sk- hash + M9 audit drawer + M3 docs + M7 vault
Bundled release bumping Manager to 1.4.2 with four product-doc gap
closures lined up in a single deploy.

VERSION:
  - 1.2.0 → 1.4.2 (catches up after Sprints 1-5 shipped under 1.2.0)

H2 — sk- hash phase A (server-side, zero client impact):
  - tokens table: new key_hash varchar(64) index column
  - Token.Insert() dual-writes Key + KeyHash on every new token
  - BackfillTokenKeyHash() runs at startup, batches 500 rows at a
    time, idempotent. Fills legacy rows that pre-date the column
    without blocking app boot
  - 5 unit tests pin: sha256 correctness, dual-write on Insert,
    empty Key → empty hash, backfill behaviour, idempotency
  - Phase B (switch lookup index off plaintext + drop Key column)
    can ship later once telemetry shows key_hash IS NULL count is 0

M9 — task detail drawer with audit timeline:
  - Deployments page click → Sheet drawer with RunDetailPanel +
    new RunAuditTimeline component
  - Timeline pulls from existing /api/agnet/deployments/:id/events
    which Sprint 1 already wired to the persistent
    agnet_audit_events table — no new backend
  - Vertical timeline w/ coloured dots (primary / amber / rose by
    classifyEventLevel), occurred_at + correlation_id per row,
    max-height + overflow for long traces
  - 15s polling; empty/loading/error states all rendered

M3 — project_doc as a first-class binding step:
  - Resource binding wizard split "SK or project docs" into two
    distinct steps: "Connect project docs" + "Connect SK skill packs"
  - Each step's Connect button pre-selects the matching type in
    the advanced sheet so users don't accidentally tag a doc repo
    as Git or SK
  - Summary dialog still receives the combined skOrDocSources view
    to keep the recommendation-card contract unchanged

M7 — secret vault status (admin panel):
  - controller/secret_store.go: new GetSecretStoreStatus handler
    + fetchHealth() method. Hits OpenBao /sys/health (token-less
    upstream endpoint), maps to a sanitized response — NEVER
    returns secret names or values per product docs §13.9
  - Graceful degradation: env vars unset → "not configured" pill;
    network error → "unreachable"; sealed → amber warning; healthy
    → green
  - Mounted at GET /api/secret-store/status behind middleware.AdminAuth
  - New SecretStoreSection in system-settings/maintenance,
    registered before Performance. Read-only card with refresh
    button, 7 status fields, message line, "how to enable" hint

Verification:
  - go vet ./... clean
  - go test ./controller/... ./middleware/... ./model/... all green
  - tsc --noEmit clean
  - Backend M7 endpoint deliberately tolerant — production may not
    have OPENBAO_ADDR set yet, UI shows "not configured" instead of
    500ing

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:19:42 +08:00
chenchenandClaude Opus 4.7 3fa345ff5e feat(privacy): per-session consent modal on first authenticated entry
Sprint 5. Pops a non-dismissable modal once per browser tab session
after the user lands on any /_authenticated/* route. Covers two
user-visible policy points the product team called out:

  1. Project data: Heicode does NOT guarantee against project loss.
     Users must back up to their own Git / local storage.
  2. Model privacy: when calling third-party models (OpenAI /
     Anthropic / Google etc.), each vendor's privacy, retention,
     and training-use terms apply. Heicode does NOT modify those
     terms and makes no privacy promises on the vendors' behalf.

Design:
  - Pure frontend, no schema migration, no backend endpoint. The
    "show every login" requirement is satisfied by sessionStorage
    (cleared when the tab closes); persisting acceptance server-
    side would force a forced-consent log we don't need yet.
  - Modal is intentionally non-dismissable (no overlay close, no
    Escape key, no X button). User must explicitly Agree or
    Decline.
  - Decline triggers auth.reset() + redirect to /sign-in — same
    logout path the sidebar uses.
  - Agree button stays disabled until the acknowledgement checkbox
    is ticked.
  - i18n localized en + zh.

If we later need an auditable consent trail (e.g. regulator asks
"prove user X clicked agree on date Y"), promote this to a DB-backed
flow with a users.accepted_privacy_at column and a POST endpoint.
Until then sessionStorage is the right scope.

Verification:
  - tsc --noEmit clean
  - mounted at AuthenticatedLayout — every authenticated route hits
    it; sign-in / sign-up / public pages do not
  - sessionStorage flag survives navigation within a tab, clears on
    tab close — matches "弹一次每次登录" requirement

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 20:38:58 +08:00
chenchenandClaude Opus 4.7 131639f672 feat(deploy): structured execution-confirm card replaces raw JSON dump
Sprint 4. Closes M6 from the product-doc gap analysis.

Previously the "Review" tab of the new-deployment sheet showed a
JSON.stringify of the full orchestration plan + a single checkbox.
Two problems:
  1. The raw JSON is nearly unreadable to non-engineering users
     (the typical operator of this surface).
  2. Product docs §10 "执行前确认卡" require five named sections,
     not a freeform payload dump:
       - 本次会做 (this run will do)
       - 本次允许使用 (resources this run may use)
       - 本次不会做 (this run will NOT do — static off-limits list)
       - 高危规则 (high-risk policy reminder)
       - 预计消耗 (token / cost / duration triple)

New layout puts each section in its own card pulled directly from
previewPlan so what the user confirms is byte-identical to what
gets submitted. The "本次不会做" card is static red-bordered text:
production deploys, prod DB writes, long-lived credential
extraction, any resource not listed.

The raw JSON is preserved behind a <details> disclosure so power
users debugging the payload still have access. Same checkbox
behaviour gates submit — no policy regression.

All strings localized en + zh.

Verification:
  - tsc --noEmit clean
  - data binds directly to previewPlan — no drift risk between
    preview and actual submit
  - no backend change

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 20:25:22 +08:00
chenchenandClaude Opus 4.7 4bab918808 feat(manifest): collapsible permission-manifest preview on run detail
Sprint 3. Closes M5 from the product-doc gap analysis — gives users
a safe, opt-in view of "which agents got which permissions over which
resources" without exposing plaintext credentials.

Per docs/product-package/10-frontend-detail-spec.md §"执行前确认卡"
and §13.9:
  - Default folded. Only a "Show manifest" button surfaces.
  - When expanded, shows the five policy-safe columns per resource
    grant: resource (type + id), allowed actions, constraints,
    secret_ref, status.
  - secret_ref is rendered via maskSecretRef() which keeps the
    vault path scheme + first 6 chars of the leaf and ellipsises
    the rest. The full plaintext value (if anyone ever puts one
    there by mistake) is NEVER rendered.
  - Constraints render as compact key=value chips, value truncated
    at 24 chars to keep the row scannable.
  - Status pill colors mirror the device-binding active/revoked
    palette established in May.
  - Footer note reminds the reader: "Plaintext credentials are
    never shown. The secret_ref column is a vault pointer, not
    the secret itself."

Existing "Permission manifest" stub card grew the new toggle in
place (no new card column added); the Events / Audit usage cards
stay on the same grid. M5 unblocks Sprint 4 (M6 execution-confirm
card) which depends on the same data layout.

Verification:
  - tsc --noEmit clean
  - go test ./controller/... ./middleware/... ./model/... all green
  - no backend change in this commit — pure frontend work over the
    existing AgnetDeployment payload shape
  - i18n additions for en + zh

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 17:55:51 +08:00
chenchenandClaude Opus 4.7 d022518a0a feat(agnet): canonical six-role catalog + role-templates API
Sprint 2. Materialises the six platform-recommended Agnet roles
documented in docs/product-package/13-platform-description.md §3.

Backend:
  - controller/agnet_role_template.go (new): AgnetRoleTemplate type
    + canonical catalog returned by GET /api/agnet/role-templates.
    Six roles: product / architect / frontend / backend / reviewer / ops.
    Stored as constants (not DB rows) because they are platform
    contracts, not user-editable data. Each entry carries:
      - stable key (frontend dispatches on this — never rename)
      - display name + summary (translatable)
      - default model recommendation
      - default permission scope hints
      - risk classification (low/medium/high) — Ops alone is high,
        matching the production-deploy-needs-approval rule
  - router/api-router.go: mount GET /api/agnet/role-templates inside
    the existing /api/agnet group (same auth as the other endpoints)
  - controller/agnet_role_template_test.go (new): 4 tests pin the
    six-role set, risk-level matrix, HTTP envelope shape, and the
    closed-set helper that will gate validation later

Frontend:
  - features/agnet-console/api.ts: new AgnetRoleTemplate type + a
    module-level cached listAgnetRoleTemplates() helper. Caching
    means the picker doesn't refetch every time the deployment sheet
    opens.
  - features/agnet-console/create-agnet-deployment-sheet.tsx:
    - Replace free-text role_template Input with a Select bound to
      the catalog; falls back to Input if the catalog is empty so
      the form stays usable when the endpoint is down.
    - Fix two informal role names in built-in presets (debugger →
      reviewer, executor → backend) so presets reference only
      canonical keys.

Verification:
  - go test ./controller/... ./middleware/... ./model/... all green
    (4 new role-template tests + existing suite)
  - frontend tsc --noEmit clean
  - zero touch on the token / device-signature hot paths

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 17:23:43 +08:00
chenchenandClaude Opus 4.7 8f70115c6a feat(audit): persist Agnet control-plane audit events to DB
Sprint 1 of the post-product-doc gap closure. Replaces the previous
in-process `agnetEvents map[string][]agnetEvent` (lost on every
container restart) with a real GORM table `agnet_audit_events`.

What changed:
  - model/agnet_audit.go (new): AgnetAuditEvent model + InsertAgnetAuditEvent
    / ListAgnetAuditEvents / ListAgnetAuditEventsByDeployment helpers.
    Indexes picked for the dashboard queries: user_id, deployment_id,
    binding_scope, occurred_at desc.
  - model/main.go: AutoMigrate &AgnetAuditEvent{} alongside the existing
    schema (SQLite/MySQL/PostgreSQL compatible per CLAUDE.md Rule 2).
  - controller/agnet_control_plane.go: drop agnetEvents map; the 3
    producer sites (deployment accepted / stop / sk_snapshot_refreshed)
    now call recordAgnetAuditEvent which writes to DB best-effort.
    The 3 reader sites (events list / logs / audit-logs) now query
    the table; AgnetListAuditLogs also supports limit/offset pagination.
  - controller/agnet_control_plane_test.go: reset helper no longer
    touches the deleted map.
  - model/agnet_audit_test.go (new): 4 tests covering persistence,
    nil-guard production safety, filter+paginate, chronological reads.

Sidebar UX:
  - "Preparation checklist" → "Resource binding"
    Per product-package doc README §统一表述 — user-facing term is
    "资源绑定" not "准备清单". URL /sk-sources kept to preserve
    bookmarks; can rename in a later pass with redirect.

Verification:
  - go test ./controller/... ./middleware/... ./model/... all green
  - go vet clean
  - frontend tsc --noEmit clean
  - audit writes are best-effort: errors log via SysLog but never
    fail the user API call; DB nil-guards in place

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 16:42:34 +08:00