Commit Graph

19 Commits

Author SHA1 Message Date
Hunter B e8b52ac57a feat(fleet): security/trust + headless-worker foundation; unify recursion depth
Lands the Agent Fleet security/trust boundary and the headless-worker bridge on
the v0.8.60 line, and collapses the sub-agent and fleet recursion model into a
single shared axis (Hunter steer: "not two moving targets").

Security & trust (#3165):
- FleetTrustLevel, FleetSecurityPolicy, FleetSecretRef (redacted), FleetWorkerAuth,
  FleetCapabilityGrant, FleetAlertEndpoint (redacted) in protocol.
- secrets: resolve_direct(key, source_hint) — fleet secret resolution, never logged.
- Host adapters refuse secret-bearing env keys; SSH uses SendEnv (no argv secrets).

Roles & delegation (#3167):
- fleet role -> SubAgentType mapping; reviewer/verifier default read-only.

Headless worker bridge (#3096/#3154, partial — still simulation, real spawn next):
- worker_runtime: FleetTaskSpec -> AgentWorkerSpec, status -> ledger events,
  exec hardening (mirrors #3027), parallel-safe read-only tool set (#2983).
- FleetManager carries an optional SharedSubAgentManager + exec config.

Recursion depth — ONE axis:
- codewhale_config now owns DEFAULT_SPAWN_DEPTH (3) + MAX_SPAWN_DEPTH_CEILING (3).
- sub-agent DEFAULT_MAX_SPAWN_DEPTH and the fleet clamp both source these consts.
- fleet default raised 1 -> 3 to match standalone sub-agents; root runs at depth 0,
  budget gates child delegation. End-to-end test proves a depth-0 fleet worker
  reaches 3 nested levels (afford >= 3).

Dogfood scaffolding (#3166, partial): docs/examples/fleet-dogfood.toml.

Tests green: codewhale-config fleet, codewhale-tui fleet (58), subagent max_depth;
cargo fmt + git diff --check clean; cargo check --workspace ok.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:10:30 -07:00
Hunter B bc61857fad feat(tui): add opt-in fleet alert dry-runs 2026-06-12 19:17:50 -07:00
Hunter B 714276e1c1 feat(tui): add verifiable fleet task specs 2026-06-12 19:01:00 -07:00
Hunter B 9e5688b8c8 feat(tui): add fleet host adapters 2026-06-12 18:31:29 -07:00
Hunter B 59848f18fc merge #3155 fleet protocol types
# Conflicts:
#	crates/protocol/src/lib.rs
2026-06-12 17:50:18 -07:00
Hunter B f0ae838eb1 fix(protocol): harden fleet JSON contract 2026-06-12 17:48:59 -07:00
CodeWhale Agent 3d822488fe chore(fmt): apply cargo fmt for CI parity gate 2026-06-12 17:02:17 -07:00
CodeWhale Agent 09231e74c4 feat(protocol): define Agent Fleet protocol types and event schema (#3155)
Adds  with the durable, serializable
contract for the v0.8.60 Agent Fleet control plane:

- FleetRun, FleetTaskSpec, FleetWorkerSpec, FleetHostSpec
- FleetWorkerStatus and FleetInboxEntry
- FleetWorkerEvent envelope with tagged lifecycle payloads:
  queued, leased, starting, running, model_wait, running_tool,
  heartbeat, artifact, completed, failed, cancelled, interrupted,
  stale, restarted, escalated
- FleetArtifactRef, FleetScorerSpec, FleetRetryPolicy,
  FleetAlertPolicy, FleetReceipt, FleetScore

Types are additive (unknown fields ignored by existing consumers) and
use stable snake_case JSON names. Includes JSON round-trip tests.

Closes #3155.
2026-06-12 11:29:37 -07:00
Turisla 4e3e12eee7 feat(execpolicy): expose matched approval rule metadata (#2971) 2026-06-12 10:53:39 -07:00
Hunter Bown a448194b81 feat(runtime-api): Phase 0 + Phase 1 — brand-neutral naming, capabilities, and dynamic tool protocol types (#3168)
Phase 0:
- Rename runtime API metadata to CodeWhale Runtime API while keeping
  DeepSeek-prefixed env vars and headers as aliases.
- Add CODEWHALE_RUNTIME_TOKEN primary with DEEPSEEK_RUNTIME_TOKEN fallback.
- Accept x-codewhale-runtime-token header alongside x-deepseek-runtime-token.
- Change generated token prefix from dst_ to cwrt_.
- Add runtime_api_version, codewhale_version, transports, capabilities,
  and experimental to /v1/runtime/info while preserving old fields.
- Update CLI help for --auth-token and --cors-origin.
- Add CODEWHALE_CORS_ORIGINS with DEEPSEEK_CORS_ORIGINS alias.

Phase 1:
- Split inline pub mod runtime into crates/protocol/src/runtime/mod.rs.
- Add DynamicToolSpec, DynamicToolItemStatus, DynamicToolCallParams,
  DynamicToolCallResult, DynamicToolCallContent, and TurnEnvironmentParams.
- Accept dynamic_tools and environments on thread create, plus
  dynamic_tools and environment_id on turn start (no-op in Phase 0/1).

Tests:
- Update existing auth/health/runtime_info tests for new naming.
- Add header alias tests and dynamic-tool request deserialization tests.
- Add protocol crate round-trip tests for all new types.

Co-authored-by: CodeWhale Agent <codewhale-agent@hmbown.local>
2026-06-12 10:51:54 -07:00
Hunter B cf910b7da2 feat(goal): persist thread goals through app server 2026-06-12 06:28:47 -07:00
Hunter B 10e41b1153 feat(runtime): expose matched approval rule metadata
Harvests the explainability slice from PR #2971 without changing the public HookEvent constructor shape. Runtime API approval.required frames now carry matched_rule metadata when an execpolicy rule caused the prompt.

Co-authored-by: greyfreedom <11493871+greyfreedom@users.noreply.github.com>
2026-06-12 01:46:41 -07:00
HUQIANTAO 0302ace9d8 docs(protocol): add doc comments to all public types (#2458)
* docs(secrets): add doc comments to all public types

* docs(protocol): add doc comments to all public types

* style(protocol): run rustfmt on docs

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 10:33:13 -07:00
cyq ac6db90333 test(protocol): tighten runtime envelope assertions 2026-05-27 22:32:28 +08:00
cyq d102cbd0f9 feat(protocol): add runtime event envelope 2026-05-27 12:42:20 +08:00
Hunter Bown c6d73d98de refactor(crates): rename workspace members to codewhale-*
Rename the 14 workspace member crates from `deepseek-*` (and
`deepseek-tui-*`) to `codewhale-*`. Internal-only — binary names
(`deepseek` and `deepseek-tui`) are intentionally untouched in this
phase; they move in the next phase along with the deprecation shims.

Affects:
- 14 `[package] name = "..."` declarations.
- All inter-crate `[dependencies]` entries that referenced the old
  package names.
- All `use deepseek_*::...` statements rewritten to `use codewhale_*`.
- Cargo.lock regenerated.

CI workflows and release scripts that pass `-p deepseek-*` still
reference the old names; those move with the binary rename phase so
that pair lands together.

Local gates green: `cargo check --workspace --all-targets --locked`,
`cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets
--all-features --locked -- -D warnings`, `cargo test --workspace
--all-features --locked` (3226+ pass, 0 fail).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 10:21:33 -05:00
Hunter Bown 5ce1314684 feat(runtime): bridge desktop approvals and skills 2026-05-07 13:53:01 -05:00
Hunter Bown 35595f8edc fix: normalize legacy DeepSeek aliases to V4 flash 2026-04-23 23:08:44 -05:00
Hunter Bown 37186c3d95 Workspace migration: split into modular crates, parity CI, release updates
- Convert root to Cargo workspace with crates/ layout
- Add deepseek-* crates mirroring Codex architecture
- Add parity CI workflow with snapshot/protocol/state tests
- Update release workflow to build both deepseek and deepseek-tui binaries
- Bump version to 0.3.28
2026-03-02 17:52:46 -06:00