agentleFS
zhixuli0406zhixuli0406/DuDuClaw/AGENTS.md

DuDuClaw

AGENTS.md49 starsChanged 59 days agoApache-2.0View on GitHub

Owner instruction, 2026-10-03: 「每次有新功能與修復時都開分支」. It outranks every other workflow rule in this file.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before starting a feature or a fix, create a branch from the latest origin/main (feat/…, fix/…, docs/…, chore/…).

    line 7
  2. Distinctive:

    When another session is using the main checkout, work in a separate git worktree instead of switching branches there.

    line 9
  3. Distinctive:

    When several open PRs touch the same files, merge them in the order the owner gives.

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

DuDuClaw Project Guidelines

Highest directive: every new feature and every fix gets its own branch

Owner instruction, 2026-10-03: 「每次有新功能與修復時都開分支」. It outranks every other workflow rule in this file.

  • Before starting a feature or a fix, create a branch from the latest origin/main (feat/…, fix/…, docs/…, chore/…). Feature and fix commits never go on main directly.
  • The change reaches main through a pull request. main requires four checks on a PR merge: Rust ubuntu-latest, Rust macos-latest, Dashboard, Python.
  • When another session is using the main checkout, work in a separate git worktree instead of switching branches there.
  • When several open PRs touch the same files, merge them in the order the owner gives; the later one rebases.
  • Opening a branch is not permission to merge or release. Merging a PR and cutting a release stay the owner's decision.

Architecture Overview (v1.68.0)

v1.69.1 (2026-10-04): Antigravity employees can call platform tools at the default permission level

  • Cause (agy 1.2.16, found 2026-10-04 with a real Gemini API key; present since v1.67.0): in print mode agy soft-denies every tool confirmation it cannot ask a human about, so an employee at ReadOnly/WorkspaceWrite (argv --sandbox) could not call any DuDuClaw MCP tool; only FullAccess (--dangerously-skip-permissions) could. The earlier verification only proved the MCP server started, the model never called a tool.
  • Fix (runtime/antigravity_setup.rs): the locked merge that already writes trustedWorkspaces into ~/.gemini/antigravity-cli/settings.json (merge_user_settings, ensure_user_settings) now also appends tool_grants(user_home) to permissions.allow through ensure_allow_rules: MCP_TOOL_GRANT (mcp(duduclaw/*)) and schema_read_grant(home) (read_file(<HOME>/.gemini/antigravity-cli/mcp/duduclaw), because agy loads MCP tools lazily and the model must read <tool>.json there first; both spellings when HOME canonicalizes to another path). No rule for commands, file writes or URLs, and the argv is unchanged (never --sandbox together with auto-approve: that let the write tool leave the workspace). A home path with (, ), ,, *, CR/LF or non-UTF-8 gets no read rule (warn). The operator's allow/deny/ask entries are kept; a non-object permissions or non-array allow is left untouched and surfaces as MergedSettings::grant_issue / SettingsOutcome::grant_issue (warn, appended to any failure by with_grant_note); trust and modelProvider are still written. Live check (agy 1.2.16, real key): default-level employee called DuDuClaw tools; a shell command and a write outside the workspace in the same turn, a path-traversal read and a symlink read leaving the directory were still refused.
  • Decision (owner, 2026-10-04): ReadOnly Antigravity employees get the same rules and can call DuDuClaw tools, gated by the MCP server's allow/deny/approval lists (as for Claude; Codex differs, its read-only level rejects every MCP call). The rules live in a user-level file shared by the whole OS user and cannot depend on an employee's level. Side effects: the operator's own interactive agy also auto-approves the duduclaw server's tools and that schema directory; rules are only added, never removed (edit permissions.allow by hand); two gateways under one OS user write identical rules.
  • Errors (runtime/antigravity.rs): denial_summary turns result.denied_actions into a sentence naming the refused tools; a non-SUCCESS status leads with it and keeps agy's error text as secondary detail (a retried 503 used to mask the denial); exit_failure_message does the same for a non-zero exit (stream_denial_summary plus stderr); an empty reply with a denial is an Err instead of handing the raw result JSON over as the answer; a normal reply with a denial is kept and logged (ParsedStream::denied). Every agy-supplied fragment goes through redact_then_cap (redact, then cap) and the key-aware parse_stream_output_keyed, so a cut cannot leave a key prefix.
  • Not verified: the real-key end-to-end test has not been rerun since the last code change; not run on Linux, in Docker or on Windows. Gemini CLI runtime removal stays at v1.70.0, pending a repeat verification of Antigravity with a real key after v1.69.1. Known and not handled: agy can report failure after a retried 503 succeeded (the gateway then treats a complete reply as failed); failover after an Antigravity failure may switch to Claude.

v1.69.0 (2026-10-04): removals of the v1.66.0 deprecations, two deferrals

  • MCP aliases removed (duduclaw_core::tool_catalog::REMOVED_MCP_TOOLS, RemovedMcpTool::message/suggestion): shared_wiki_ls / _read / _write / _search / _stats / _lint (use wiki_* with scope="shared"), schedule_task (use tasks_create with schedule) and skill_bank_search (use skill_search with source="bank") are no longer declared, so they are gone from tools/list; a call returns a tool error naming the replacement call. DEPRECATED_MCP_TOOLS is empty. shared_wiki_delete and wiki_share were never aliases and stay. The tool count went from 249 to 241. What a removed name left in an employee's agent.toml [capabilities] list does: allowed_tools entries match nothing, so an employee whose allowlist names only a removed tool loses that capability; denied_tools, approval_required_tools, irreversible_tools, maybe_irreversible_tools, scoped_tools and config.toml [provenance] sensitive_tools keep gating the call that replaced the name (tool_catalog::removed_name_for_call: wiki_* with scope="shared", tasks_create with a cron schedule, skill_search with source="bank"), checked at the MCP dispatch gate (mcp_dispatch.rs denied and scoped gates, mcp/approval.rs::static_gate_flags for the approval and irreversibility lists; a scoped grant is looked up under the name written in the list) and only ever narrowing, so the same tool without that argument is unaffected. The Claude CLI --disallowedTools flags for denied_tools and scoped_tools are name-based and do not match the new spelling; the MCP gate is the primary enforcement. A removed-name call is answered only after the injection scan and the rate limiter (and skips the scope check), so repeating it is rate-limited and cannot flood tool_calls.jsonl. duduclaw doctor has a row for removed names (removed_mcp_tools_check in duduclaw-cli/src/lib.rs, backed by mcp_alias::scan_agent_dir_for_removed_tools / scan_config_for_removed_tools): it reads each employee's [capabilities] lists, the root prompt files, Markdown under SKILLS/ and wiki/, and config.toml [provenance] and [[ccr.allowed_sources]]; it does not read prompt text in cron tasks and automation rules, evals/ or playbook tool assertions, .mcp.json or the shared wiki. Fail when an employee loses a capability, Warn otherwise (the four gating lists say they still apply and should be renamed).
  • CLI spellings removed (duduclaw-cli/src/removed_spelling.rs, RemovedSpelling): duduclaw migrate-from, audit, gdpr export, playbook export, acp-server and expert install stay as hidden clap stubs that accept any flags, print one sentence naming the replacement (migrate from, export audit, export gdpr, export playbook, acp server, pack install) and exit with status 2 without running anything. The dashboard's one-click, upload and AI-draft install (experts.* RPCs) drive duduclaw pack install.
  • Judge modes removed (duduclaw-gateway/src/judge_mode.rs, JUDGE_MODES_REMOVED_IN): [dispatch] judge accepts only mav (default) and external; system.update_config and the dashboard refuse evaluator_only / human_only (and the aliases evaluator / human). A value still in config.toml is recognised on read: evaluator_only is judged as mav; human_only does not fall back to machine acceptance, every task sent for acceptance parks at needs_human with a system-problem pause reason and the fix (dispatch_engine/review.rs), and the operator can mark it done or fix the setting and retry (a retry returns the task to pending, clears its stored result summary and claim, uses the note as the next round's instruction, keeps counting rounds and removes no files). Each removed value warns once per process; the judge_mode_removed audit event and Activity Feed notice are written once per gateway process and data directory, when the first piece of work enters acceptance, and again after a restart; judge_mode_deprecated is no longer produced. duduclaw doctor row removed_judge_mode_check (judge_mode::check_removed_judge_mode_in_home): human_only is a Fail, evaluator_only a Warn, and a config.toml that cannot be read or parsed, or a non-string judge, a Warn saying the check could not be made. Employees that need human gating use [capabilities] autonomy_level and approval_required_tools.
  • Not removed, and no longer listed as deprecated: duduclaw data-migrate stays as a hidden alias of duduclaw migrate data because shipped DuDuClaw OS images run duduclaw data-migrate --run from a boot unit on a read-only root filesystem; the three bare forms duduclaw migrate, duduclaw export --out … and duduclaw acp are documented behaviour; duduclaw expert list stays (it lists the installed records and is not an alias of pack list); preset.toml is the job-preset storage format.
  • Deferred, still deprecated: the legacy pack manifests (expert.toml, team.toml, industry pack directories) are still read and have no removal version; they go together with the rewritten premium templates. Reason: duduclaw pack install (pack_cmd.rs::install_pack) installs a pack.toml only when kind = "preset"; a pack.toml team or template pack is read and then handed to the expert pipeline, whose expert/detect.rs::detect recognises only expert.toml, a Claude Code plugin or a lone Agent Skill, so it cannot be installed. docs/guides/build-your-own-pack.md therefore tells authors to keep expert.toml for teams and industry packs. The Gemini CLI runtime (runtime_catalog.rs, remove_in: "v1.70.0") moves from v1.69.0 to v1.70.0: verifying Antigravity API-key mode with a real Gemini key showed that an Antigravity employee at the default permission level has its platform tool calls refused by the Antigravity CLI itself; the fix ships in v1.69.1 (see above) and the removal still waits for a repeat verification with a real key after that release. The Gemini API provider is unaffected. Table of all names: docs/guides/deprecations.md (three languages).

v1.69.0 (2026-10-04): MCP record authorization, home-state hook allow-list, verified-only belief calibration

  • Record authorization (security, released versions affected) (duduclaw-cli/src/mcp/record_authz.rs): tasks_update / tasks_claim / tasks_complete / tasks_block / activity_post with task_id / update_cron_task / delete_cron_task / pause_cron_task / run_cron_task / create_reminder resolve a RecordActor once per call (record_actor_for → RecordActor::resolve, which calls mcp_memory_handlers::ai_employee_caller directly and adds two rules: the employee id is the resolved default_agent, and any process with DUDUCLAW_AGENT_ID set is an employee): Operator = a key mapping to no AI employee in a process with no DUDUCLAW_AGENT_ID (unrestricted); otherwise Agent(id) — the internal key with no env identity acts as gateway-internal, which owns nothing, and a process with DUDUCLAW_AGENT_ID is an employee whatever key it holds. check_record_change_allowed: owner == caller → allow; else the WP21 delegation predicate; empty owner / empty caller / system-sender caller → refuse; every refusal audited (delegation_denied, or a tool_calls.jsonl row with reason owner_unknown / caller_unknown / system_sender_identity). Owners: task = assigned_to / claimed_by / created_by (complete/block: assignee or claimer only; unassigned + unclaimed ⇒ claim first; tasks_update and activity_post also accept the creator), claim of a task assigned to someone else and reassigning someone else's task to yourself need the relationship; cron = the row's agent_id (default → main agent); reminder = agent_id (omitted = caller). Cron tools addressed by name act on exactly one row; a shared name is refused with the candidate ids (delete/pause used to hit every row with that name).
  • System-sender names are not MCP identities: get_default_agent turns dashboard / cron / goal-loop-driver / heartbeat / autopilot / webhook into UNTRUSTED_AGENT_ID and writes one tool_calls.jsonl row per process (mcp_identity, reason system_sender_identity, claimed, source env/config); check_actor_identity refuses them too. As long as no employee is named after one, the gateway never stamps one (employee ids are directory ids; the MCP create_agent tool, the dashboard and the duduclaw agent create CLI all refuse these names, the CLI only since this batch). An existing employee whose name equals a system-sender name (creatable through the CLI before) resolves to untrusted after the upgrade and is refused by the task/cron/reminder tools; rename it.
  • Task control fields: AI employees cannot change title / description of a goal_mode task (joins acceptance_criteria, audit goal_contract_frozen), nor add / remove / reorder the control tags outcome:*, grant:*, auto-research on any task (RESERVED_TASK_TAG_PREFIXES / RESERVED_TASK_TAGS, audit reserved_tag_change); tasks_create refuses them in tags (the server-built goal outcome: tag is unaffected).
  • agent_update self-authority guard: an AI employee sending reports_to / db_sources / db_sources_add / db_sources_remove / budget_cents / role about itself is refused whole (SELF_AUTHORITY_PARAMS, audit agent_authority_refused, reason: self_authority_change); editing a subordinate and operator edits unchanged.
  • Hook home allow-list (G1, security, released versions affected) (duduclaw-core/src/org_field_guard/): for agent and untrusted callers, everything under <home> except the caller's own agent directory and HOME_WRITABLE_DIRS (attachments/, contents only) is refused (BlockedHomeStateWrite): audit log, evals/ (held-out and peers' suites), every SQLite store, breaker state, licences and org files, global skills, shared wiki. Write/Edit judge both the literal path and the real path (resolve_real_path, symlinks followed; a path whose real location cannot be determined ⇒ BlockedUnresolvablePath, "無法確認這次寫入實際會落在哪裡"); relative paths resolve against the envelope cwd. agent_hook_installer bakes --home "<home>" into the hook command for every <home>/agents/<id> directory, single-quoting a path with shell-special characters (the scrubbed spawn env has no DUDUCLAW_HOME, so the hook used to judge non-default homes against $HOME/.duduclaw; stale entries are rewritten in place at the next spawn/boot). resolve_hook_home order: --home → no claimed id (operator) ⇒ duduclaw_home() → explicitly set absolute DUDUCLAW_HOME (the home is not inferred from the working directory) → otherwise every Write/Edit/NotebookEdit/Bash call of that employee is refused (BlockedUnresolvablePath). Write/Edit relative paths without an envelope cwd resolve against the own agent dir. Hook subcommands skip the file logger (is_hook_command). Upgrade: a pre-change duduclaw/duduclaw-pro binary rejects --home as a usage error, which blocks every Write/Edit/Bash; upgrade both together, and restart the gateway after a downgrade so boot rewrites the hook command and the matcher becomes Write|Edit|MultiEdit|NotebookEdit|Bash (notebook_path judged like file_path). Existing-but-unreadable agent.toml / config.toml / .mcp.json ⇒ refused (was treated as a new file).
  • Own agent.toml freeze, allow-list (AGENT_EDITABLE_SECTIONS / AGENT_SECURITY_KEYS, BlockedAgentSecuritySection; agent and untrusted callers only; the installed hook command always carries --agent, so an operator running claude by hand in an employee's directory is judged as that employee and must use the dashboard or an ordinary editor): only the sections listed editable in org_field_guard/rules.rs may be changed by the employee's own Write/Edit; every other section is frozen, so a section added later is protected by default. Inside editable sections [agent] role, [prompt] cli_bare_mode, [model] account_pool stay frozen (plus the WP21 org fields and [capabilities]). Canonical description: docs/features/05-security-defense.md.
  • Bash lane (bash_lane.rs, bash_parse.rs, bash_cmd.rs; canonical description docs/features/05-security-defense.md): the command is shell-unescaped first (line continuations, backslashes, quotes; redirects to /dev/null and fd duplication such as 2>&1 are not writes; redirecting output and errors together into a file is). For agent/untrusted callers a "protected home target" (home outside the own directory and attachments/, another agent's directory, the removed area; for untrusted callers also the own directory) is refused as an output-redirect target for any command; READ_ONLY_COMMANDS skip argument checks (commands with an option that writes output to a file or runs another command are kept off the list or stop counting as read-only with that option; employees reading home files must use a listed command or the MCP tool); copy-shaped commands are judged on their destination only (copying a home file into the own directory passes); every other command, mutating, interpreter, unrecognised or behind an unparsable prefix option, is refused when any argument is a home target, write fragment or not. <home> database files outside agent directories and attachments/ are refused even for reads. Relative paths resolve against the envelope cwd (else the own directory), cd/pushd followed; an unknown cwd makes relative paths in judged positions refused when the command names a home target anywhere, else unjudged. Existing symlinks are resolved and judged; an unresolvable judged path is refused. Still a speed bump: paths from variables/command substitution/other computation, encoded commands, scripts written then run, here-documents fed to an interpreter, aliases/functions, an env var that makes a later shell load a file, a write option of a listed read-only command the list did not account for, extraction/download with no explicit destination (writes into the current directory, which the lane does not judge; cd into the home first evades it), a link created and written through in one command, hard links, check-to-execution races; conversely an unresolvable judged path (dangling links included) is refused even outside the home; Read is not covered; non-Claude runtimes do not run the hook; the own directory's state files and the shared attachments/ are not protected.
  • Belief calibration, verified only (prediction/belief.rs): only settle_source == "agent+tick_verified" (SETTLE_SOURCE_TICK_VERIFIED, exact) counts toward hit rate / Wilson / Brier / overconfidence and the 30-row threshold; agent_unverified, unknown, empty and legacy NULL are self-reports, counted separately. Nothing in production supplies a cross-check (belief_settle passes no tick_price; no gateway-side TickHub settle path exists), so every settlement today is a self-report and calibration_status reads no_verified_settlements. Breaking: belief.summary ({stats}) and belief_stats return n_submitted, n_settled_all, calibration_status (no_verified_settlements / insufficient_samples / calibrated), verified{n,hits,hit_rate,hit_rate_wilson_low,mean_brier,overconfidence}, self_reported{n,hit_rate}, per_subject[{subject,verified{n,hits,mean_brier},self_reported{n}}]; the flat fields are gone. belief_settle adds counts_toward_calibration (+ note when self-reported). ## 信念校準 is not injected with zero verified settlements. Foresight page shows verified figures only, self-reports counted apart, each settled row labelled 已核實 / 自報. Self-study subject picking still uses all settlements on purpose (it only picks a topic).

v1.68.0 (unreleased): dashboard switches, dead fields wired or removed, memory namespace unification

  • Memory namespace (duduclaw-cli/src/mcp_namespace.rs::resolve_for_caller): an internal-key MCP caller whose DUDUCLAW_AGENT_ID is proven by DUDUCLAW_AGENT_TOKEN (HMAC over identity.key, written into .mcp.json; verified_employee, Verified verdict only) reads/writes memory under the bare employee id, the namespace distillation, review approval and injection use; unproven → internal/gateway-internal (fail closed); duduclaw http-server never inherits process identity (verified_agent: None); a per-agent key whose client id has agents/<id>/agent.toml maps to that id; external keys unchanged. Pre-upgrade pool rows are not moved: hidden operator CLI duduclaw memory migrate-namespace {list,export,assign,archive} (memory_namespace_cmd.rs, engine side duduclaw-memory/src/engine/namespace_migration.rs) refuses AI sessions, attributes rows from tool_calls.jsonl (memory id / content / ±10 min inferred), assign --to <id> --all|--ids|--attributed [--include-inferred] [--refused hold|skip] [--include-flagged] re-keys rows in place (rows that look like prompt injection are skipped without --include-flagged) under the supersession trust guard (refused rows held as review items or left), dry run unless --confirm, archive expires leftovers tagged namespace-archived, audit memory_namespace_migrated.
  • [permissions] enforced (mcp_dispatch.rs::permission_for_call): explicit false on can_create_agents / can_send_cross_agent / can_modify_own_skills / can_schedule_tasks refuses the mapped tools (-32003, audit permission_denied; tools stay in tools/list); absent/wrong type allows, unreadable agent.toml refuses. One-time boot migration agents_update_v168::migrate_all_agent_permissions (from MethodHandler::with_extension): [permissions] without permissions_enforced_since gets every false of the four set true plus permissions_enforced_since = "1.68.0" (audit permission_flags_reset); agents/.ephemeral/ skipped so role members keep their falses. Scaffolds/templates write true.
  • Dashboard surface: system.update_config accepts the v1.68 keys in handlers/system_update_config_v168.rs (takeover, mail, webchat widget, tick, files.allowed_roots, night.llm_enabled, dispatch judge_provider/judge_model + role_team, acp.trusted, telemetry.otlp_endpoint, container.sandbox.*, computer_use.image, memory.supersession_trust_guard, team defaults, logging.format, integrations.github, secret-manager 1Password/Infisical fields) and returns restart_required[]; PROTECTED_KEYS changes audit config_protected_key_changed. Writes refuse an unparsable config.toml and go through handlers/config_commit.rs (file lock + content-hash compare). agents.update writes only received fields (heartbeat cron no longer cleared; agents.inspect returns it), authority keys ([agent] reports_to/department/name, all [capabilities], sandbox_enabled, network_access, can_modify_own_soul) admin-only with audit agent_authority_changed on success and agent_authority_refused on a refusal, org.toml upsert only on a real change, typed advanced_kv validated as AgentConfig. Map: docs/guides/dashboard-settings.md.
  • Raw editor (handlers/config_raw_rpc.rs, config.raw.get/set, admin): config / inference / agent:<id>; secrets masked «set» (kept on save), [mcp_keys] hidden; TOML line/column errors then typed check; base_hash conflict; backup <file>.bak-<ts> (5 kept, 0600); audit config_raw_edited; restart list.
  • Hot apply: tick sources respawn in place (tick.sources.list/upsert/remove, handlers/tick_sources_rpc.rs); inference.update → reset_inference_engine(); rotation strategy/cooldown → invalidate_rotator_cache(); log level through a reload layer (log.rs, unless RUST_LOG); [logging] format = "json" read at init (restart). Webhook channels hot-mount: webhook_slots.rs keeps /webhook/{whatsapp,feishu,googlechat,teams,wecom,dingtalk} always mounted (404 until the channel is configured, then the platform signature is enforced, 401 on a bad one); channels.add fills the slot without a restart and returns restart_required: false + not_started_reason; per-agent Slack hot-starts.
  • Wired (were saved, never read): killswitch_triggers.rs (KILLSWITCH.toml [triggers], only keys present enforce, null disarms, mtime re-read; cost → global L2, replies/min per conversation drop, consecutive errors / error rate → failsafe +1; audit killswitch_trigger); redaction_sources.rs (user_input, system_prompt, cron_context; purge_after_expire_days → vault GC); Discord agent_override global fallback and thread_archive_minutes; Telegram/LINE voice via stt::transcribe_channel_audio ([voice] stt_*, env Whisper only when unset); Feishu/DingTalk mention_only / allowed_channels; account tags (+ account_pool tag match); branding subtitle; [identity.notion] refresh_seconds; graph_embed_seed in employee recall; Odoo features_* (per-call refusal by model prefix; project/hr default off; protocol = "xmlrpc" refused).
  • Channel admin fix (security, released versions affected): WhatsApp/Feishu/Teams/WeCom/Google Chat/DingTalk passed is_admin = true; now chat_commands::handle_command_for_sender → is_channel_admin (global admin_users, exact, none = nobody); WebChat admin = active dashboard Admin account (webchat_command_admin). Admin token: resolve_admin_auth_token reads auth_token_enc (dashboard-written since v1.22.0; previously lost on restart).
  • Removed dead fields/keys (values left in files): voice ASR trio, inference max_memory_mb / [generation] gpu_layers/context_size / [embedding], [model.local] backend/context_length/gpu_layers from the edit page, sticker/stagnation cards, skill_security_scan/skill_auto_activate toggles, container cmd/env/mounts/readonly_project/max_concurrent, token_budget_per_check, check_interval, per-agent LINE/WhatsApp/Feishu/WeCom/DingTalk credentials, redaction sub_agent row, KILLSWITCH [audit], [secaudit] parser, MemGPT leftovers, [task_forward_model] cold_start_llm/min_samples/mature_n, ApprovalModal.tsx (browser.respond_approval never had a handler).
  • Known gaps: other settings RPCs still use the lenient read_config_table; dashboard system.doctor container row still uses the old Docker check; clearing a llamafile field in the UI does not remove the stored value; WebChatWidgetCard reads a webchat_widget_key_set field no handler emits (falls back to the masked value).
  • LLM output contract, secaudit v2, red-team v2 (design commercial/docs/DESIGN-llm-contract-secaudit-v2-2026-10.md, source analysis research/harness-2026-08/cloudflare-security-audit-skill-2026-10.md, Cloudflare security-audit-skill, MIT, schema-level reference only): duduclaw_core::llm_contract holds six primitives, strict_json (one JSON value or the whole reply is discarded, never patched), safe_path (SafeRepoPath), fingerprint (stable root_fingerprint, canonical_id), coverage (unit status table, RunStatus/IncompleteReason), severity (anchors, overall<=impact) and visible_text. duduclaw secaudit v2 (schema_version 2, all additive): AI candidates carry a six-slot threat_model + trace + conditions, a zero-LLM pre-check (precheck.rs) refutes invented paths/lines before any review call, every file excerpt sent to a model is line-numbered (<n> | code, llm_util::number_lines) and line/trace[].line must copy those numbers (a live run showed the model mis-counting lines by 4–5 when it had to count itself), the verifier gets up to 24 KiB of the main file plus ±20 lines of each other trace file and must give blockers + validation_plan for plausible, and may return corrected_line/corrected_trace with plausible when the defect is real but the location is off (re-checked against the repo before being applied; id and root_fingerprint unchanged; evidence verifier_corrected: line 10→14; refuted means the claimed defect is not there), every ranked module gets a coverage entry (covered/candidate/deferred/unreadable/llm_failed/parse_failed, the first failed LLM call defers the rest as engine_unavailable), run_status/incomplete_reason, prior-report carry-forward by root_fingerprint + file_hash (--no-prior; unreadable or v1 newest reports are skipped), and validator.rs runs before any write (violation => exit 2; duduclaw secaudit-validate <report.json> exit 0/1/2). D1=B: NeedsHuman carries severity_basis = model_self_reported, is counted in needs_human_by_severity and does not fail --fail-on unless --fail-on-needs-human (then merged into by_severity); D2=B: --verifier-agent <id> and verifier.independence (same_agent/different_agent/not_run) in the report and dashboard; dashboard review writes an operator_review evidence item, severity_basis = operator and recomputes the counts. Security fix G1 (released versions affected, --profile deep): a model-returned file was joined onto the repo root unchecked in the adversarial review and PoC steps, so an absolute path could redirect the read; all such paths now pass SafeRepoPath first. Red-team v2 (duduclaw-gateway/src/redteam.rs, duduclaw test, duduclaw redteam): eleven techniques x en/zh-TW x each must_not rule form a coverage ledger; input guard blocked => covered, not blocked => status: "blocked" / reading: "needs_live_validation" (待活體驗證, not a vulnerability), report schema_version 2 with a redteam object, --emit-evals <dir> / --locale / --force write one duduclaw eval case per unit needing validation. Live run on the restaurant template: 154 units, 14 covered (all injection), 140 eval cases (70 covered / 84 cases after the WP-G3 input-guard families, see below). Next wave: goal loop adopts llm_contract (design §8). Docs: docs/features/49-code-security-audit.md, 09-behavioral-contracts.md, docs/guides/evals.md.
  • Goal-loop strict reply parsing (shadow) and input-guard shape families (design commercial/docs/DESIGN-llm-contract-goal-loop-2026-10.md, WP-G1 + WP-G3; user docs docs/guides/goal-loop.md, docs/features/05-security-defense.md): the three places that turn a judge reply into a decision, the MAV panel (dispatch_engine::parse_panel_verdict_for), the first-stage evaluator (parse_pre_evaluation) and the external judge (judge_mode::parse_external_verdict), each gain a llm_contract::strict_json::parse_strict path in dispatch_engine/strict_shadow.rs. config.toml [dispatch] strict_reply_parsing = off | shadow | enforce, read at every decision, default shadow: lenient parsing still decides, the strict parse runs and is compared, each comparison increments judge_parse_shadow_total{parser,outcome} and a disagreement writes audit judge_parse_shadow_mismatch; enforce makes strict authoritative and a violation takes the parser's existing fail-closed path; off is byte-identical to before; a judge built with no home dir (stub judges) resolves to off. Flipping the default to enforce needs >=50 judge rounds or 7 days with strict_rejects <2%, decided by the operator, never automatic. input_guard gains four sentence-shape families (authority_escalation, memory_poisoning, role_provenance, action_binding, en + zh-TW, SHAPE_FAMILIES, no fixed phrases): one signal warns, two distinct signals of one family or one signal plus an existing rule block (action_binding never stacks with itself), so the guard now has eleven rule categories (was seven) and drop-on-any-hit callers (distillation, profile writes, goal intent) also drop these shapes; documented cost: one ordinary sentence with two signals is blocked too. Measured on the restaurant template: 70/154 covered (was 14; injection/indirect_injection/memory_poisoning/role_provenance/authority_escalation 14/14, the other six techniques 0/14, 84 eval cases), starter bank benign probes 5/5 allowed, system_prompt_extraction and encoding_bypass (3 each) still missed as before. First strict-parsing data point: one shadow-mode goal gave 7 judge replies (panel 3, pre-evaluator 4), all agree, no mismatch event, and an enforce-mode goal was accepted in one round; one data point of the observation window, not proof. WP-G2 (per-criterion acceptance ledger) is implemented in duduclaw-gateway/src/goal_loop/criteria_ledger.rs (ledger_for_new_goal is the single creation point): config.toml [goal_loop] criteria_ledger = off | report | enforce, default report, read per round; handles C1..Cn are system-numbered from the frozen acceptance_criteria_baseline for goals created from the dashboard, MCP tasks_create kind="goal", chat /goal and goal-suggestion confirmation (not autopilot goals or planner sub-tasks); the worker reports through a strict <criteria_status> tag (a void report leaves the ledger unchanged and writes audit criteria_status_invalid); report gives the judge the self-report as reference only, enforce requires one verdict per handle and correctness passes only if all pass; the ledger shows on the task detail page and in the needs-human summary. In every mode the acceptance judge prompt now carries one system-provided line with the worker's working directory (<home>/agents/<id>), because a live run showed the judge rejecting a correct result twice without it. Live goal runs (2026-10-03): a normal goal was accepted in one round with 3/3 criteria covered; a goal with one unachievable criterion had the worker mark it blocked without fabricating a result and went to needs_human (blocked_needs_decision). Not yet exercised live: enforce verdicts, the needs-human channel card summary, a chat /goal ledger.
  • Post-v1.68.1 debts (unreleased, 2026-10-03): (1) config writes keep the operator's formatting: handlers/config_commit.rs::render_preserving edits the on-disk text with toml_edit (unchanged keys keep their bytes, a changed scalar keeps its trailing comment, new keys go to the end of their section, new sections to the end of the file, read-back must equal the intended table or it falls back to a full re-serialisation with a warn!), used by commit_table_locked (system.update_config, tick.sources.*, the voice-config HTTP endpoint, which also gained the lock + hash compare) and write_config_table (every other settings RPC, also inference.toml), plus security_rpc credential cleanup and mcp_internal_key rotation; writers behind write_config_table still have no lock/hash compare. (2) [redaction.sources] sub_agent has a reader again: dispatcher::append_subagent_reply_to_parent_session_with passes a delegated agent's reply through redaction_sources::redact_sub_agent_reply under the session OWNER (direct parent, or chain root on a relayed append) and that session id before writing it into the owner's session; only mode on builds a pipeline (default inherit is byte-identical), a failing pass stores SUB_AGENT_REPLY_WITHHELD instead of the raw text, the dashboard row is back; not covered: the channel copy for the human, check_responses (a tool result), Team role hand-offs, Agent Mail. (3) Windows: concurrency_gate::is_lock_contended treats ERROR_LOCK_VIOLATION as contention (was an immediate failure), task_sandbox::settings::valid_executable judges in-image paths with POSIX rules on every host, discovery::evaluator::container_path joins container paths with /, a non-unix Discovery store reports StoreError::UnsupportedPlatform; 70 Discovery tests are #[cfg_attr(not(unix), ignore)] (Discovery is unix-only by design) with one Windows test asserting the fail-closed refusal. (4) scripts/live-test/{make-home.sh,mcp-probe.sh} build an isolated home with a plain and a prod-shaped employee (wildcard mcp__duduclaw__* allowlist, denied/approval lists, permissions, budget, contract) and call real tools through each employee's own .mcp.json; scripts/clean-build-cache.sh removes only this workspace's own artifacts under target/. Docs: docs/guides/dashboard-settings.md, docs/features/05-security-defense.md, docs/guides/development-guide.md §1.5.

v1.67.1 (2026-10-03)

  • Autopilot: "no conditions" ({}, absent, null, {"all": []}) now fires on every event of the trigger (autopilot_engine::evaluate; {} used to never match, so existing such rules start firing; {"any": []} still never matches). handlers::validate_autopilot_conditions refuses malformed trees on create/update/induced-rule enable with the node path. cron_tick (no emitter) is refused on create and by rule induction (validate_autopilot_trigger_event_for_create); update accepts it only when the stored rule already has it (validate_autopilot_trigger_event_for_update). The dashboard rule form (web/src/lib/autopilot-rules.ts + AutopilotRuleDialog.tsx) now sends the server's shape and edits stored rules; SERVER_TRIGGER_EVENTS is pinned to AUTOPILOT_CREATE_TRIGGER_EVENTS by autopilot_validation_tests.
  • MCP marketplace catalogue (mcp_template::marketplace_catalog) is four cards on real npm packages: Playwright @playwright/mcp, Browserbase @browserbasehq/mcp (needs BROWSERBASE_API_KEY/BROWSERBASE_PROJECT_ID/GEMINI_API_KEY), Filesystem, Memory; the @anthropic-ai/mcp-server-* names never existed. Existing .mcp.json entries are not rewritten.
  • inference.update refuses a backend other than openai_compat or empty (a stored removed value echoed back unchanged is accepted); [model.local] backend default, duduclaw onboard/duduclaw wizard and shipped templates write openai_compat. Dashboard fields with no reader removed (voice reply/ASR/language; max_memory_mb; [generation] gpu_layers/context_size; [model.local] context_length/gpu_layers); saved values are left in place.
  • Memory supersession trust guard (duduclaw-memory/src/supersession_guard.rs, store_temporal_outcome): a write whose effective origin_trust is strictly below the current fact's (stored trust capped at its class ceiling; pre-WP1 rows read as unattributed 0.6) cannot supersede it; reaffirmation, triple-less inserts and historical segments are not checked; exact subject/predicate only. config.toml [memory] supersession_trust_guard (default true) is read by memory_factory::build_memory_engine and the mcp-server engine; directly constructed engines keep it on. Refusals in wiki_ingest (conversation facts) and profile_distill (traits, now origin user_profile 0.6 instead of channel) become held claims (metadata.held_claim, quarantined) with a knowledge_quarantine approval (24 h; approve = promote_quarantined with operator origin, stale if the protected fact changed; ≤20 new per agent per UTC day via auto_wiki_page::MAX_HELD_CLAIMS_PER_DAY, beyond that audit memory_supersession_refused review_cap_hit); other callers skip, log, or error. Burst-quarantine release now goes through the guard (outranked rows become held claims). knowledge_quarantine is dashboard-only (approval_notify::is_dashboard_only_kind: plain notice, never to the originating chat, channel decisions refused); expired cards cannot be approved; a daily sweep closes quarantined rows with no pending card; GDPR export/erase match held claims. Third review: cards are built only from the stored held row and show full statement + new value beside current content (cut at 600 chars, noted) + current value + whose profile; statements >600 chars are audit-only (not_held_reason: "too_long"); approve is bound to the card's claim_digest (claim or protected fact changed ⇒ nothing written, stale); approvals_decide::decide_knowledge_quarantine applies the side effect before recording the decision under a per-approval lock (failure ⇒ stays pending, retryable; applied but not recorded ⇒ error naming what was applied + audit knowledge_review_decision_unrecorded); re-approving a burst after partial failure files missing conflict cards; burst rows over 600 chars at release are audit-only (too_long); first daily-cap hit per agent per UTC day raises Activity Feed knowledge_review_cap_reached; memory_invalidate_by_origin from an AI-employee caller (mcp_memory_handlers::ai_employee_caller, fail-closed: the shared internal key always counts, with or without an agent id, as do agent and eph- keys; only an admin key mapping to no agent is exempt) is limited to origin::ai_may_invalidate classes (channel/mcp_external/tool_echo), else refused + audit memory_invalidate_refused; duduclaw gdpr erase also scrubs the review store (wiki_ingest::scrub_review_store_after_erase: withdraw pending cards, scrub card text in any state, delete matching knowledge.quarantined events; by erased ids, or by exact subject on a re-run that finds no rows; id-less events wait for 7-day retention), runs every step even after a failure and exits non-zero asking for a safe re-run; pseudo-user system writes no profile; user_profile_record refuses pseudo-users and input_guard-scans predicate and value; the Mini App shows only the plain notice for this kind.
  • MCP memory tools used the MCP key's namespace, so every gateway-spawned employee shared internal/gateway-internal (since v1.44.0) while gateway-side distillation, review and injection used the employee id. Fixed in v1.68.0 (see above).
  • input_guard Chinese coverage: instruction_override now matches override verb + scope word + instruction noun within one clause and 12 chars (was four exact strings, bypassed by an inserted word); Chinese system_prompt_extraction (weight 30, non-blocking) and role_hijack phrases added; thresholds/English unchanged; known false positives pinned by known_benign_shapes_that_do_match (e.g. 「請忽略之前寄的指示,以新版為準」); distillation paths drop on any match.
  • Integrations page hides the Identity tab in personal mode (identity.* is enterprise-only). Edition comes from DUDUCLAW_EDITION > licence tier > personal; agent.toml [edition] profile has no reader (the EditionProfile doc comment in duduclaw-core/src/types.rs still names it).

DuDuClaw is a Multi-Runtime AI Agent Platform — supporting Codex / Codex / Gemini (deprecated, removal scheduled for v1.70.0) CLI as AI backends via a unified AgentRuntime trait with auto-detection and per-agent configuration. DuDuClaw provides the plumbing: channel routing, session management, memory, evolution, multi-account rotation, local LLM inference, and browser automation.

Key architectural decisions:

  • Multi-Runtime (AgentRuntime trait) — Codex / Codex / Gemini (deprecated, removal scheduled for v1.70.0) / Antigravity (agy) / OpenAI-compat five backends, RuntimeRegistry auto-detection, per-agent config in agent.toml [runtime]. Runtime parity (v1.33): RuntimeContext carries CapabilitiesConfig; codex/gemini spawn with capability-derived sandbox flags (SandboxLevel ReadOnly/WorkspaceWrite/FullAccess — no more blanket --full-auto/yolo; antigravity maps ReadOnly/WorkspaceWrite to --sandbox and FullAccess to --dangerously-skip-permissions, never both); PTY-pooled sessions inject per-agent --allowedTools/--disallowedTools (previously zero restrictions reached the pool); codex/gemini/antigravity execute() register the duduclaw MCP server in each CLI's native config (codex -c overrides, gemini/antigravity settings.json per-key merge) so non-Codex agents get the full MCP tool surface; agent create --runtime scaffolds AGENTS.md/GEMINI.md and rejects typo'd providers; model_matches_provider() warns on [model] preferred ↔ [runtime] provider mismatches
  • Unified LLM provider layer (duduclaw-llm crate, v1.33): the API-level twin of the CLI-level AgentRuntime — one normalized ChatRequest/ContentPart/StreamEvent/NormalizedUsage shape over four native protocols: Anthropic Messages (layered cache_control, thinking replay, real SSE), OpenAI Responses API, Gemini generateContent (thoughtSignature echoed verbatim), OpenAI-compat chat/completions (8 presets: deepseek/minimax/groq/together/mistral/openrouter/xai/qwen + local; DeepSeek reasoning_content, real SSE). ModelRegistry vendors ~15 models with millicent/MTok prices + price-cliff math + capability flags (user override via ~/.duduclaw/models.toml). Tool-call args are always parsed serde_json::Value at the boundary; errors classify into a ten-way LlmError aligned with FailureReason. MCP client + tool-loop (mcp_client.rs behind default-on mcp-client feature, tool_loop.rs always-on): a stdio JSON-RPC MCP client + provider-agnostic run_tool_loop so the direct-API, local-inference, and the multi-runtime openai-compat AgentRuntime dispatch path get the full MCP tool surface (previously tools were CLI-backend-only; the openai-compat AgentRuntime used by API-mode Grok/DeepSeek/MiniMax agents sent tools-less messages and could only narrate "I'll go look that up" — now execute() drives run_tool_loop with a capability-filtered ToolRegistry over a spawned duduclaw mcp-server, degrading to plain messages only when no tools are reachable) — ToolRegistry aggregates N MCP servers, the loop feeds ToolResult back until the model stops (max-iters cap, per-call errors fed back as is_error). Real SSE streaming on all four providers. Local inference folded in (2026-09-29 / T5-O11): duduclaw-inference no longer keeps its own reqwest chat/completions client — the capability that kept it alive (per-token logprobs/top_logprobs capture for the UCCI cascade) is now ChatRequest::{top_p, stop, logprobs, top_logprobs} plus OpenAiCompatProvider::complete_with_logprobs(), absent from the wire body when unset. The local backend is a thin InferenceBackend shell that carries two local-only settings explicitly rather than inheriting them: a 300s request timeout (CPU generation routinely exceeds the shared 120s singleton) and with_verbatim_model_id() (a local server's qwen/qwen3-4b is a name, not a provider/model qualifier — the shared split_model_id would send a model the server does not have). The UCCI margin computation deliberately stayed on the inference side: the shared provider transports the signal, it does not score it.
  • MCP Server (duduclaw mcp-server) exposes channel, memory, agent, skill, task, shared wiki, and autopilot tools to AI Runtime via JSON-RPC 2.0 over stdin/stdout. Registered per agent in <agent_dir>/.mcp.json, created and repaired at every gateway boot by mcp_template::ensure_mcp_absolute_paths_all (the Claude CLI in -p mode does not read MCP servers from the global ~/.claude/settings.json; the global-registration helper ensure_global_mcp_server has no caller)
  • Agent directories are Codex compatible: each contains .Codex/, SOUL.md, AGENTS.md. The DuDuClaw MCP server and any agent-specific MCP server (e.g. Playwright) both live in the per-agent .mcp.json
  • Sub-agent orchestration via create_agent / spawn_agent / list_agents MCP tools with reports_to hierarchy. System prompt auto-includes "## Your Team" roster with sub-agents from the reports_to hierarchy (v1.8.2). Channel bot tokens cascade up this same hierarchy (v1.8.28 — resolve_agent_channel_token_via_reports_to): cron / delegation forwarding first check the agent's own [channels.<ch>], then walk reports_to until an ancestor's token is found, then fall back to global config.toml. Prevents 401 Unauthorized in multi-bot setups where a sub-agent without its own Discord bot token would otherwise fall to a different global bot that lacks access to the team root's threads. Delegation authorization (v1.52 — duduclaw-core/delegation_policy.rs): reports_to tree is the authority for hierarchical permissions; agents can delegate to their entire sub-tree and escalate to ancestors (any depth, both directions); same-department agents may coordinate (configurable via [delegation] policy); cross-team collaboration via explicit white-list pairs. MCP/bus/task/ACP paths all enforce the predicate; fail-closed DENY writes audit log. Removed-name reservation (duduclaw-core/src/agent_trash.rs, 2026-10): agent_remove moves the employee to agents/_trash/<id>_<14-digit ts> and no longer returns the path or an rm -rf hint; an AI caller (every MCP caller; the CLI scaffold path when DUDUCLAW_AGENT_ID/DUDUCLAW_AGENT_TOKEN are set) cannot create a name that has a trash entry, a dangling org.toml record, or an unlistable trash (fail closed) — closing remove-and-recreate as a way to shed CONTRACT.toml / [capabilities] / sandbox settings; audit agent_name_reserved (path_kind mcp_create_agent/cli_scaffold/cli_bash_agent_create, reason removed_to_trash/dangling_org_record/trash_unlistable) and agent_removed; operators (dashboard, terminal) are unrestricted and restore/purge by hand (no UI); create_agent/agent_remove over HTTP with a non-internal key are judged by that key's client id. Gaps: Claude/Codex/Gemini employees' Bash env carries no identity, so pack install/migrate from from their Bash are not covered; not live-tested through a gateway.
  • Session Manager persists conversations in SQLite with 50k token auto-compression (CJK-aware token estimation)
  • Native multi-turn session management (v1.8.1): Codex CLI --resume <session-id> with SHA-256 deterministic session ID + fallback to history-in-prompt; per-turn tail trimming (>800 chars, CJK-safe; DuDuClaw heuristic — turn format follows the ChatML/ShareGPT convention, not a published Hermes feature); Direct API prompt cache with "system_and_3" breakpoint strategy; session compression summaries injected into system prompt (not conversation turns)
  • Cross-invocation action continuity (recent_actions.rs, 2026-08): sessions are per-conversation, so an agent's scheduled/heartbeat/goal-loop runs and its channel replies can't see each other's actions — asked "did you do X?" an agent consulting only live tool state would deny actions its own audit trail records (blocked/rejected orders are invisible to live state; LWM D2 incident). Every invocation now opens with a ## 近期自身行動(稽核紀錄) section compressed from tool_calls.jsonl (programmatic evidence, resolve_audit_agent attribution, failures/blocked calls included) plus a hard instruction to answer self-questions from durable records, never live tool state alone. Injected on both prompt paths (channel_reply dynamic tail after CACHE_SPLIT_MARKER; claude_runner uncached tasks_suffix for dispatch/cron/heartbeat/reminder/ephemeral). config.toml [memory] recent_actions_enabled (default on) / recent_actions_count (default 10, cap 50); 256KB tail-read, consecutive-duplicate collapse, 2400-byte section cap, empty feed → zero injection, all failures fail-open to "no section"
  • Cross-wake working state (working_state.rs, 2026-08, LWM D3 incident — "three stop-loss lines in one day"): per-agent authoritative key-value state + handoff note, durable across ALL trigger sources. Operational rules living only in prose notes are ghost memory (A-TMA arXiv:2607.01935) — each fresh wake re-derives them from whichever note it happens to read. Now the gateway injects a ## 工作狀態(唯一權威…) section into every wake-up's dynamic tail (before the recent-actions feed, after CACHE_SPLIT_MARKER / uncached tasks_suffix), wording marks conflicting note values as superseded history (A-TMA read-time labeling) and carries the ASSUME-INTERRUPTION write-back instruction. Updates are explicit MCP tool calls ONLY (working_state_set/clear/handoff/get — never parsed from completions; all writes audit-logged, in SELF_ECHO_TOOL_NAMES): reason required, supersession chain in working_state_history.jsonl, optional expected_value CAS (Letta memory_replace stale-write rejection — concurrent 3-min cron wakes can't stomp each other; expired entries don't satisfy CAS), optional ttl_hours for day-scoped rules (expired entries leave the authority view but stay readable), 32-key cap refused-with-listing (consolidate, don't sprawl). Store: <agent_dir>/state/working_state.json, with_file_lock + atomic rename, BTreeMap deterministic serialization. config.toml [memory] working_state_enabled (default on) gates injection only; empty state → zero injection; every failure fails open to "no section". Follow-up deferred: sleep-time consolidation (journal → handoff briefing), dashboard card.
  • File-based IPC (bus_queue.jsonl) for inter-agent delegation; AgentDispatcher consumes and spawns Codex CLI subprocesses
  • Container sandbox — two separate paths: the per-agent task sandbox (agent.toml [container] sandbox_enabled, Docker only, duduclaw-gateway/src/task_sandbox.rs; read-only rootfs, non-root, caps dropped, bridge network because the AI CLI must reach its provider, /workspace tmpfs, only allowlisted agent-dir entries at /agent/<name>, fails closed; covers bus/dashboard tasks, heartbeat task-board wake-ups, autopilot delegate/run_skill, goal rounds and plan steps; a sandboxed employee's goal rounds are always Solo (team gate rule sandbox_enabled, ahead of always_team), its Agent Mail arrival trigger is skipped, and channel reply / cron / reminder / proactive / ephemeral / duduclaw acp / live duduclaw eval stay on the host with a once-per-(employee, path)-per-process task_sandbox_not_applied audit event) and the script sandbox (duduclaw-container via PTC execute_program and the secaudit PoC step; Docker on macOS/Linux, WSL2-then-Docker on Windows (WSL2 cross-compiled only, never run on Windows), Apple Container never selected; same image key as the task sandbox, never pulled; host user (1000:1000 if root), caps dropped, no-new-privileges, read-only root, --network=none, 2 GiB no swap / 256 pids / 1 CPU, tmpfs /tmp, log 8m + 2 MiB read cap, 600 s hard cap, force-removed on cancel; only a private read-only script dir at /workspace, no host temp dir and no PTC socket, so scripts cannot call platform tools; when unavailable, [container.sandbox] script_when_unavailable (default "fail", separate from the task sandbox's when_unavailable) refuses with Script sandbox unavailable (<code>) + audit script_sandbox_unavailable, "run_unsandboxed" runs on the host and audits script_sandbox_bypassed; secaudit never runs on the host; no boot-time sweep for script containers)
  • Eleven channels: Telegram (long polling), LINE (webhook), Discord (Gateway WebSocket with tokio::select! heartbeat), Slack (Socket Mode), WhatsApp (Cloud API webhook, signature fail-closed), Feishu (webhook), Google Chat (webhook, JWT-verified, service-account send), Microsoft Teams (Azure Bot / Connector v3, JWT-verified), WeCom (HMAC-SHA1 + AES-256-CBC), DingTalk (HMAC-SHA256 + time window), WebChat (WebSocket). (Older docs said "nine" — wecom/dingtalk were added later; 2026-08 audit corrected the count.) Channel UX layer (v1.35): per-platform markdown rendering (markdown_render.rs — block IR → Telegram HTML / Slack native markdown block / WhatsApp markup / Feishu Card 2.0 / Google Chat markup / Teams markdown / LINE plain text; CJK-width-aware monospace tables where native tables are unsupported); typing indicators (channel_typing.rs RAII guards — TG sendChatAction / DC typing / LINE loading / WA typing_indicator / Slack assistant.threads.setStatus / Teams typing activity; Google Chat uses placeholder + edit-in-place); live long-task progress via ProgressEvent::TodoUpdate (parses Codex TodoWrite tool_use from stream-json into a 📋 task board, delivered edit-in-place on TG/Slack/GChat/Teams/Discord, throttled elsewhere, deleted when the final reply lands). Delegation callback forwarding covers all 8 external channels (Teams via a persisted conversation-reference store teams_conversations.json — the standard Bot Framework proactive pattern; Google Chat via service-account send_text_to_space); Computer Use senders exist for all channels (today only the computer_* tools' high-risk confirmation uses them; GChat/Teams photo upload falls back to a text notice). Inbound quoted-reply context (2026-08): replying to (quoting) a message now carries the quoted content into the agent input on the five channels whose payload embeds it — Telegram reply_to_message + forward_origin provenance, Discord referenced_message, Slack message-share attachments[].text (link unfurls excluded), Teams text/html attachment <blockquote>, WhatsApp context (annotation only — Cloud API never ships the quoted body); one shared block format channel_format::format_quoted_context (CJK-safe 2000-byte cap, QUOTED_SELF_LABEL when the quoted author is the bot itself), and replying to the bot's message counts as an @mention in Telegram/Discord mention-only groups. Remaining channels need API round-trips or the platform withholds content — tracked in docs/todo/TODO-channel-quote-context-remaining.md. LINE, WhatsApp, Feishu, Google Chat, Teams, WeCom and DingTalk use the deployment-wide credentials in config.toml [channels]; per-employee bot tokens exist for Telegram, Discord and Slack only (with the reports_to cascade). For LINE, the WP7 multi-OA + credit-metering layer (credit.rs, [[channels.line.accounts]]) was removed in 2026-09 — routing and the deduction gate were never wired, so those config keys promised behavior that did not exist
  • BroadcastLayer tracing layer streams real-time logs to WebSocket subscribers
  • Dashboard / WebSocket auth: JWT account login (duduclaw-auth: Argon2id + JWT, users.db) or the gateway admin token. Those are the only two paths: the earlier Ed25519 challenge-response path was removed from the gateway (no configuration ever read a public key, only tests constructed it, the dashboard never implemented the client side, so it could never be enabled). Ed25519 remains in licence signatures, update verification and the relay device protocol
  • Unified heartbeat scheduler — per-agent cron/interval for bus polling + GVU silence breaker, max_concurrent_runs semaphore
  • CronScheduler reads cron_tasks.jsonl, evaluates cron expressions, fires tasks on schedule. list_cron_tasks returns all tasks (no longer filters by default_agent, v1.8.3)
  • Prediction-driven evolution engine: Prediction-error-driven evolution (Active Inference / Dual Process Theory) — zero LLM cost for ~90% of conversations. Dual Process Router: Negligible/Moderate errors → zero cost, Significant → GVU reflection, Critical → emergency GVU loop. MetaCognition self-calibrates error thresholds every 100 predictions (negligible_upper/significant_upper raise back toward default after a long clean stretch, not just tighten — v3 Phase 0 R7 fix, previously one-directional drift).
  • GVU outer loop (gvu/loop_.rs) — the per-agent run lock, the WP0.3 cooldown (agent.toml [evolution] gvu_cooldown_minutes, default 60, shared by channel ε-exploration / silence timer / sub-agent dispatch) and the hand-off to AEE. S11 (2026-09-29) removed the legacy SOUL.md rewrite path entirely: gvu/generator.rs, proposal.rs, updater.rs, consolidate.rs, observation_finalizer.rs, the verify_all / verify_deterministic / verify_metrics / verify_mistake_regression legacy verification chain, SoulVersion versioning with its 24h observation window + auto-rollback + deferred retry, the [evolution] legacy_soul_evolution escape hatch and the duduclaw evolution finalize CLI all went with it — SOUL.md had been read-only for agents since v3 (WP1.1), so those guards protected a write path that no longer existed. Existing evolution.db rows (soul_versions / gvu_consolidations / deferred_gvu) are left on disk with no reader; version_store.rs now owns only the experiment log (gvu_experiment_log), which AEE writes and gvu/stagnation.rs + gvu/telemetry.rs read. Retained: AEE, stagnation.rs (scans evolution.db every 30 min for consecutive-rejected / D-days-zero-apply / repeated-rejection-reason signals → Activity Feed + dashboard, once per stagnation state), reward_hack.rs, mistake_notebook.rs, telemetry.rs, champion.rs, and soul_partition.rs (duduclaw playbook migrate-soul depends on it). AEE's entry-level settlement sweep moved from ObservationFinalizer to gvu/aee/sweeper.rs (same 30-min schedule from server.rs, same behavior). gvu::generator::escape_xml_tag — the one symbol with live external callers (wiki_ingest's prompt XML fencing) — moved to gateway/xml_fence.rs.
  • Agentic Evolution Engine (AEE) — the only evolution path (gvu/aee/); it superseded "rewrite the whole SOUL.md" as the target in v3 and that older path was deleted in S11 (2026-09-29). agent.toml [evolution] gvu_enabled ships true from the factory since K2 (2026-09-29) — onboarding, the industry-template wizard and MCP create_agent all write gvu_enabled = true + strategy = "balanced"; the runtime gate (gvu::trigger::agent_gvu_enabled) is unchanged and still fail-closed on a missing/malformed key, existing agent.toml files keep their value, and ephemeral one-task agents deliberately stay false. Cost is bounded on both sides: gvu_cooldown_minutes throttles round frequency and the zero-LLM Gate rejects a doomed candidate before any judge call is paid for. Per-agent skill knobs (max_active_skills / skill_synthesis_threshold / skill_synthesis_cooldown_hours / skill_graduation_min_lift) are read per turn from agent.toml since H3 (2026-09-29); eight sibling knobs with no reader were removed. Details: SOUL.md is a read-only persona layer for agents (see Security layer below); the evolving artifact is the playbook (crates/duduclaw-gateway/src/playbook/), an ACE-style (arXiv:2510.04618) condition-action rule set stored as an extension of the existing rule_lifecycle semantic-memory rows — no new store. Each entry is gene-shaped (EvoMap/evolver GEP protocol, schema-only reference — no code/deps vendored): category (repair/optimize/innovate), signals_match trigger tokens (wired to MistakeCategory/FailureReason), ordered strategy, failure history, ≥1 linked EvalCaseRef (entries with none are refused at write time), capsule-style application log (outcome/score) + success_streak. Content is capped compact (≤400 chars — 2604.15097 found that expanding gene entries into documents hurts); merges are deterministic (no LLM); near-duplicate detection uses char n-gram cosine at a deliberately conservative 0.92 (a false merge silently loses a distinct rule, worse than a redundant one) and rejects-with-audit rather than silently dropping. Injection into ## Learned Rules is now signal-match-first + net-score fallback (was pure net-score top-3). One AEE round: gvu/aee/intent.rs picks repair/optimize/innovate deterministically from agent.toml [evolution] strategy (balanced default / innovate / harden / repair_only — replaces raw ε-exploration) → inner_loop.rs runs ≤3 generate/gate/shadow-apply/score/revise rounds (nothing persists until commit) → Gate/Measure split replaces the old 8-layer all-veto chain: Gate (verifier_gate.rs — G-Safety/G-Contract/G-Canary-Static/G-Schema/G-Capacity, deterministic, zero LLM, keeps veto) runs first so a doomed candidate never pays for a judge call; Measure (verifier_measure.rs — eval case pass rate, L3 judge downgraded to one score dimension where a failed call is None not 0.0, anti-sycophancy, novelty, mistake-relevance) has no veto → commit gate is matches-or-improves (AVO P7) against the reigning champion (champion.rs — a whole-playbook snapshot hash, not per-entry, so one improved rule can't hide three regressed ones) within a configurable noise band (agent.toml [evolution.noise_band]), with anti-drift companions against repeated tie-commits → entry-level accept/rollback settles per entry against its own linked eval case (aee_settle_hours, default 24h) so a regression only rolls back the one entry that caused it. duduclaw eval gained --case <id>[,...] (exact EvalCaseRef match, unlike substring --filter), --exclude-dir <name> (held-out rotation), --report <path>; AEE calls it via subprocess + JSON report (config.toml [evolution] eval_suites_root/eval_binary), never in-process, to stay runtime-agnostic across Codex/codex/gemini/antigravity/openai-compat. duduclaw playbook export --agent <id> dumps an agent's active entries as GEP-shaped gene JSON (local file only, no hub). Dashboard: Memory page "自主學習" (evolution) tab — mode banner, version history, stagnation card, rejection-telemetry chart, consolidation log, playbook entry cards (export / manual retire) via evolution.*/playbook.* RPCs. Full design: commercial/docs/DESIGN-evolution-v3-aee.md; rollout plan: commercial/docs/TODO-evolution-v3-2026-08.md; user-facing walkthrough: docs/features/38-aee-playbook-evolution.md. v1.53 additions: every playbook Add must now carry E1 EntryAssertions (must_use_tools / must_not_use_tools / output_contains / output_not_contains, ≤6 items × ≤80 chars — WP2.8/D8); playbook/assertions.rs replays them zero-LLM against recorded eval transcripts, feeding a G-Assertions gate step in inner_loop.rs (no transcript → degrade to advisory, never silently pass). A reward-hack audit (gvu/reward_hack.rs, WP2.10/C4) screens candidate entries for H1 eval-prompt leakage (n-gram overlap ≥0.6), H2 tautologies, and H3 failure-suppression — folded into the existing G-Contract veto family (no new layer, per D11); H4 judge-pleasing phrasing is Measure-side telemetry only. duduclaw playbook migrate-soul --agent <id> [--apply] (WP1.4) extracts behavioral rules from a legacy SOUL.md into draft playbook entries for human review before apply. Still deferred from the same plan: hypothesis-object observation windows (C1) and LLM-assisted refactor-toward-simplicity (C3).
  • Task-level forward model (harness→LWM plan A, v1.53): a predict-act-verify world-model layer on the goal loop, runtime-agnostic, config.toml [task_forward_model] (default on since v1.54; set enabled = false to opt out). Before dispatch, prediction/task_forward.rs predicts the task outcome via a 4-tier degradation chain (per-(agent, tool-class) statistics → marginal statistics → prior → optional LLM — cold start costs zero LLM); after settle, task_observe.rs diffs prediction vs. observation on 4 dimensions and records the transition (transition.rs — SPO fields deliberately None so transitions stay out of temporal supersession). Every observation carries an explicit ObservationFidelity — Full (native tool events), McpOnly (the main branch: audit-log evidence only), None — never silently conflated. NativeToolEvent (runtime/mod.rs) is the runtime-neutral tool-event collector (task-local + (task_id, round) bridge; masked result_text/input_text): Codex/codex/gemini/openai-compat reach Full; the PTY-pool path deliberately has no collector; codex/gemini event field names are dual-name tolerant pending a real-CLI spot-check. Native evidence is hoisted once per settle and shared by all three consumers (forward-model observe / grounding / judge digest). The goal loop injects a structured <state> block (goal_loop/state.rs, XML-escaped; agent updates it via a state_update reply tag with <> stripped) plus a (state, action) visit graph (goal_loop/signals.rs) — repeat-visit streak ≥2 triggers early oscillation needs_human; task_rule_induce.rs (A4) deterministically induces task rules from repeated transitions into the existing rule_lifecycle store (template-based, inject cap 2, same settle/retire lifecycle — NOT playbook entries, per T8/T9). Confirmed post-task facts persist via merge_goal_state_json. Design: commercial/docs/design-task-forward-model-2026-08-06.md.
  • Calibrated forward model + held-out learning gate (v1.54): domain-agnostic (confidence, realized_outcome) layer on top of the task forward model, all three sub-switches under config.toml/agent.toml [task_forward_model] default on since v1.54 (enabled/calibration_enabled/held_out_gate_enabled; each can be switched off independently, and an off layer is byte-identical to the pre-feature behavior). prediction/calibration.rs scores settled predictions with proper, bounded scores (Brier/RPS, never log score) and a Murphy decomposition (reliability/resolution/uncertainty — only rising resolution counts as real skill) against a frozen baseline, yielding a three-state HonestLabel (Supported/Candidate/IndistinguishableFromLuck). prediction/rule_gate.rs gates reflexion-derived rules the same way: evidence-backed lessons inject normally, evidence-less inductive lessons are born as shadow candidates and only promote once their out-of-sample Wilson lower bound (Bonferroni-corrected across concurrent candidates) beats the baseline, with keep-better demotion on regression. Shadow-scoring runs on both settle paths (2026-08-12 closed the dialogue-side debt): task settles score signal-matched (goal_kind: tag) shadow candidates in dispatch_engine; channel replies arm the shadow candidates whose playbook signals_match tokens hit the turn's TurnSignals at prompt-build time (playbook::collect_armed_shadow — never injected) and grade exactly those ids at outcome settle (rule_lifecycle::score_shadow_candidates_by_ids, hit ⇔ Significant/Critical) against the agent's dialogue climatology (PredictionEngine::high_risk_base_rate over prediction_log; coin-flip fallback under 8 samples). Gate-on channel settles also route injected rules through settle_injected_rules_held_out (dispatch parity); gate-off stays byte-identical to the pre-gate lifecycle. Not trading-specific — any agent using tool calls benefits. See docs/features/39-calibrated-forward-model.md.
  • Belief Loop (prediction/belief.rs, 2026-08, domain-agnostic on purpose): the agent-facing twin of the task forward model — structured beliefs about the external world (any subject: a ticker, an index, a KPI…), each carrying subject/horizon(free-form label, ≤40 chars)/direction/probability vs a submit-time judgment baseline value (ref_value), via MCP belief_submit/belief_settle/belief_stats, settled deterministically against a caller-supplied realized_value (three-way Brier, configurable flat band [belief] flat_band_pct default 0.3%; settle can cross-check against a platform-supplied tick_price with 1% tolerance, refusing a divergent report and recording agent+tick_verified on agreement, but no production path supplies one — the belief_settle tool passes none and no gateway-side TickHub settle path exists — so every settlement today is agent_unverified, a self-report that never counts toward calibration; see the Unreleased block). Two programmatic injection hooks (never agent recall — arXiv:2605.29463): goal-dispatch prompts get a ## 信念校準 calibration section (zero verified settlements ⇒ not injected; <30 verified ⇒ counts only, self-reports named as not counted; per-row stats_injected recorded because "injecting history improves calibration" has NO first-hand evidence — deliberately shipped as an evaluable experiment), autopilot tick wake-ups get a ## 信念對照 belief-vs-live-value diff line (tick field resolution: explicit [belief] tick_subject_map config entry first, zXXXX→XXXX naming convention as fallback). Stats reuse calibration.rs Wilson/proper-scoring (no second statistics dialect); dashboard = Foresight page 信念與驗證 tab (belief.recent/belief.summary, manager-gated, three honest states keyed on verified settlements: none / <30 counts only / calibrated; self-reports listed apart, each settled row labelled verified or self-reported). Calibration is scored separately from task outcomes and never conflated (arXiv:2607.03015). Per-goal layer (same design doc §6): tasks.goal_create accepts duration_hours (deadline → needs_human, min with global wall-clock) and risk_boundary (empty ⇒ [goal_defaults] baseline_boundary five-line default), boundary injected into every dispatch round + the MAV judge's safety aspect. Design: commercial/docs/DESIGN-market-belief-loop-2026-08.md (9 research-derived hard constraints; six-track 2026-08-14 literature sweep; investment is the first validated pilot use case, in the design doc's appendix — the platform itself doesn't know or care what the subject domain is).
  • Cognitive memory (optional): SqliteMemoryEngine with episodic/semantic separation and Generative Agents 3D-weighted retrieval. The recency dimension uses Ebbinghaus retrievability (MemoryBank, arXiv:2305.10250): R = exp(-t/S) with stability S = base·(1 + k·ln(1+access_count))·(importance/5) — frequently-recalled memories rank higher and survive decay; run_decay archives entries only when old + low-importance + R < 0.05 (replaces the binary access_count == 0 heuristic). HippoRAG-lite graph retrieval (graph_rank.rs, arXiv:2405.14831): Personalized PageRank (d=0.5, ≤20 iterations) over the v1.19.0 SPO triple graph — currently-valid facts only, CJK-safe whole-word seeding; blends w_graph (0.15) into the re-ranking and appends up to 3 graph-only two-hop hits FTS missed; no seed match → byte-identical to FTS-only. MemGPT 3-layer system (Core Memory, Recall Memory, Archival Bridge, Budget Manager, Consolidation Pipeline, 6 MCP tools) was removed in v1.8.1 (−1,985 LOC)
  • Memory Intelligence (v1.19.0) — three W18/W19-designed features implemented non-invasively on the live SqliteMemoryEngine (no schema rewrite, MemoryEntry unchanged): (F1) Temporal Memory — memories gains temporal/knowledge-graph columns (valid_from/valid_until/superseded_by/supersedes/subject/predicate/object/confidence/metadata) via the idempotent migration loop + two indexes; store_temporal(entry, TemporalMeta) does automatic conflict resolution (same (agent, subject, predicate) supersedes the prior fact and links a supersession chain, unless the v1.67.1 supersession trust guard refuses a lower-trust write); search()/search_layer() default-filter to currently-valid rows; get_history()/get_at() expose chain + point-in-time. (F2) Reflexion Loop bridges the existing MistakeNotebook (not a new store): F2a injects an agent's recent unresolved mistakes into the answering prompt (## Past Mistakes to Avoid, CJK-safe topic match + recency fallback); F2b consolidates ≥3 same-MistakeCategory unresolved mistakes into one semantic memory rule (reflexion.rs, detached, deterministic synthesis) then marks the sources resolved. Trigger signal is the existing ErrorCategory (Significant/Critical, MetaCognition-adaptive) — NOT the GVU Verifier (which validates SOUL.md proposals). Rule lifecycle (ACE arXiv:2510.04618 / ExpeL arXiv:2308.10144, prediction/rule_lifecycle.rs): consolidated rules carry rule_stats {helpful, harmful} in metadata (seeded helpful=1 under v1.41 Janus probation — see below); channel reply injects ## Learned Rules ranked by net score (cap 3); after apply_outcome, injected rules settle — Negligible/Moderate → helpful+1, Significant/Critical → harmful+1; net 0 → retired (retired-rule tag, excluded from selection) so stale rules die instead of diluting the prompt. (F3) memory_fetch_batch MCP tool + get_by_ids fetch ≤100 entries by ID in one call (namespace/ownership enforced, partial hits → missing_ids)
  • Trusted memory & judge hardening (v1.41) — five paper-driven upgrades: (1) write-time origin binding (TMA-NM arXiv:2606.24322, duduclaw-memory/src/origin.rs): every memory write carries an origin class with a non-malleable trust ceiling (origin_trust = min(caller, ceiling, derived_from)); unattributed writes default to 0.6 not 1.0; since v1.67.1 a write may not supersede a current fact with strictly higher trust, and user_profile is its own class at 0.6 (was a 1.0 alias of user_direct); reaffirmation is Sybil-resistant — only ≥2 distinct non-self-derived origin classes can bump confidence (+0.1/step, cap 1.0), agent self-summaries and tool echoes never corroborate each other; all production write paths stamp explicit origins. (2) GovMem promotion gate (arXiv:2607.02579): reflexion consolidation groups mistakes by source_kind (decision_gap vs task_failure counted separately) and requires ≥2 distinct sessions + ≥2 distinct normalized descriptions before promoting — correlated same-session observations no longer masquerade as independent evidence. (3) Janus probation (arXiv:2606.31121): new consolidated rules seed helpful=1 with a probation-rule tag; first harmful settle retires them, helpful≥3 graduates. (4) PORTICO task-scoped grants (arXiv:2606.22504, capability_grants.rs): tools listed in agent.toml [capabilities] scoped_tools require an active grant (MCP capability_request → ApprovalBroker, or goal-kickoff grant:<tool> tags); grants are revoked at every task terminal state (accept/reject/needs_human/cancel/escalate) plus TTL sweep — authority does not outlive the task phase; enforced fail-closed at the MCP dispatch gate and CLI spawn disallowedTools. (5) trace grounding (GroundEval arXiv:2606.22737): duduclaw eval gains [[expect.grounded]] deterministic assertions (tool must have a non-error result sharing a ≥N-char CJK-safe span with the final answer; failures classify as MAST FM-3.3), the eval transcript parser now pairs tool_use↔tool_result, and the MAV acceptance judge receives a <tool_activity> audit digest so self-reported result summaries are checked against actual tool activity. Plus cache-aware compression guard (arXiv:2607.12161): the reply-path compression pipeline is skipped when recent cache efficiency >50% and budget overshoot <15% (compressing marginally costs more via cache-prefix rebuild than it saves); token_usage records compressed/compression_stages, and cache_attribution_snapshot() finally has a consumer (hourly top-10 cache-break causes → log + evolution event).
  • Memory trustification & grounded dispatch (harness→LWM plan B, v1.53): (1) anti-fake-surprise novelty gate (duduclaw-memory/src/novelty_gate.rs): semantic-layer writes are screened by char n-gram cosine at 0.92 (same yardstick as playbook dedup) — near-duplicates are rejected-with-telemetry instead of accumulating as false "surprise" (arXiv:2606.29182: 37.5% false surprise without pruning); fail-open when no embedder is attached, F1 temporal-supersession/reaffirmation paths exempt; [memory] novelty_gate (default on) is honored through the single memory_factory::build_memory_engine construction point, and as of 2026-09 (H4) every gateway-internal auto-write/auto-read path actually goes through it — channel_reply (key-fact storage, profile block, fact recall, decision capture/auto-resolve/TTL sweep), profile_distill, goal_loop task-rule injection, chat_commands /rules, autopilot_engine persona lines, night_engine N1–N4, the skill-synthesis evidence lookup, and server.rs's scheduled decay job. Three families stay on the raw constructor on purpose and are documented in memory_factory.rs: the operator/dashboard RPC path (human curation is not screened), memory_migrate::merge_one (schema bootstrap + SQL row copy — a write-time dedup gate there would silently drop rows), and tests. (2) Verified-only reflexion: MistakeNotebook entries carry TrajectoryEvidence (tool_name / error_kind / assertion_failed / source_span) extracted programmatically from transcripts; self-reported mistakes without evidence no longer feed F2b consolidation (Honest Lying, arXiv:2605.29463 — self-reports are untrusted). (3) Grounded dispatch precheck: duduclaw-core/src/grounding.rs (one shared module for duduclaw eval and production) checks that a completion shares a contiguous CJK-safe span with an actual non-error tool result; dispatch_engine runs it before the MAV judge ([dispatch] grounding_precheck_enabled, default on) — hardened with a self-echo deny-list (SELF_ECHO_TOOL_NAMES: tools like tasks_complete that echo the agent's own summary can never self-ground) and input-overlap subtraction (text the agent itself passed into the tool call doesn't count as evidence). (4) Audit log as evidence source: tool_calls.jsonl records masked result_text/input_text (mask-before-truncate; 3-pass secret masking covering JSON-kv, bare-prefix, plain-kv plus connection-string / lowercase-bearer / CJK-adjacent patterns; 16MB rotation; 0600 perms), and resolve_audit_agent attributes system-sender dispatches (goal-loop / cron / heartbeat / autopilot, all six SYSTEM_SENDERS) to the executing agent — fixing the P0 where DUDUCLAW_DELEGATION_SENDER overwrote attribution and silently starved every downstream evidence consumer (fidelity stuck at None, grounding always Skip, judge saw zero evidence).
  • Security layer: SOUL.md drift detection (SHA-256), prompt injection scanner (11 rule categories), JSONL audit log, per-agent key isolation. SOUL.md read-only for agents (Evolution v3 WP1.1): MCP agent_update_soul and the Write/Edit/NotebookEdit/Bash file-protect hooks now refuse an agent-identity caller writing its own or any other agent's SOUL.md, closing a previously-dead gate (agent.toml [permissions] can_modify_own_soul had zero readers before this) — the only legitimate write paths left are the operator/dashboard and, for a single agent explicitly opted in via can_modify_own_soul = true, self-write only (never cross-agent). The dead duduclaw-security::rbac module (zero callers workspace-wide) was removed; its one live piece of behavior moved to this MCP-front-door check, its other (validate_agent_creation) was already superseded by v1.52's delegation_policy.
  • Data sources & native DB connector (2026-09): RFC-23 redaction's db_field sugar used to be Odoo-only; a [redaction.data_sources.<name>] registry (tools / table_arg|table / record_paths / key_alias) now lets a rule's source name any tool-backed data source — two built-ins ship un-overridable (odoo, the original table now expressed as registry bindings; duduclaw_db, below), connector is the deprecated alias. Redaction's reach extends past DuDuClaw's own MCP server for the first time: duduclaw mcp-proxy (hidden subcommand; a spawn-time .mcp.json rewrite, tool names namespaced <server>.<tool>, credentials carried via env var DUDUCLAW_MCP_PROXY_ENV rather than argv) redacts a customer's own external stdio MCP servers, and a new duduclaw-llm::ToolInterceptor hook (before_call/after_call) does the in-process equivalent for the openai-compat tool loop. The rewrite is wired into both channel_reply.rs's two Codex-CLI spawn paths (fresh-spawn and one-shot PTY) and claude_runner.rs's prepare_claude_cmd (dispatch/cron/heartbeat/goal-loop turns, via the shared mcp_proxy_cli_args helper) — a redaction-inactive spawn stays byte-identical either way. Not yet covered: the PTY session pool ([runtime] pty_pool_enabled, default off, standby — a pooled REPL outlives the per-call spawn this rewrite hooks into, so it needs a session-owned guard instead), HTTP/SSE MCP servers (logged, not silent), the codex/gemini/antigravity runtimes, and the local-inference tool loop (local_llm.rs). New crate duduclaw-db (sqlx 0.8.6, minimal features) is a first-party read-only PostgreSQL/MySQL/SQLite connector — three independent read-only layers (statement guard, driver-level READ ONLY transaction / SQLite read-only handle, row/timeout caps) — exposing four MCP tools (db_sources / db_tables / db_select / db_query, db_query refused unless a source's allowed_tables = ["*"]) behind Scope::DbRead (db:read, the 23rd MCP scope) plus a deny-by-default per-agent [capabilities] db_sources grant; five admin db_sources.* RPCs (list/test/upsert/remove/tables) never return the connection string, only SecretStatus, and upsert tests the connection before saving unless told to skip. Dashboard ships 資料表欄位規則 and 資料來源 cards (試跑 dry-run, poison banner for a broken [redaction] config). Local files (2026-09): three MCP tools file_read/csv_read/xlsx_read (crates/duduclaw-cli/src/mcp_files.rs, new calamine dependency for xlsx/xlsm/xls/ods) close the gap where the Codex CLI's built-in Read/Bash bypass redaction entirely; a built-in duduclaw_files registry source (table name read from the tool result via TableSource::FromResult, free_form_names for CJK/extension-bearing table and column names) lets db_field rules target customers.csv.name / 客戶清單.xlsx.地址 directly; a PreToolUse data-file-guard hook ([redaction] data_file_guard, default on) blocks the built-in route back to those files, honestly documented as a heuristic (Bash filename matching, inert on Windows without bash) rather than a sandbox. AI detection & custom rules (2026-09): type = "ner" rule kind + built-in ai_pii profile run OpenAI Privacy Filter on-device via ort load-dynamic (redaction crate ner feature, default on; the release binary links no ORT — redaction.model.install downloads model + runtime with pinned sha256 under ~/.duduclaw/, fail-closed while absent), eight labels mapped onto existing categories at priority 30 so every regex rule wins on overlap; AuditEvent::Redact carries engine (rule/ner) + model_revision. Dashboard-authored custom rules live in profiles/custom.toml (redaction.custom_rules.*, redaction.profiles.import/.remove, per-rule enabled on all kinds, [meta.labels]); redaction.suggest_pattern turns 2–5 examples into a validated pattern (local inference → utility model → heuristic, 10/min per caller, pattern: null rather than a fabricated one); redaction.dry_run accepts sample_text + draft_rules for pre-save preview. db_sources grant UX (2026-09): granting an agent a database source no longer requires hand-editing agent.toml — the redaction wizard's step 4 and a new AI-employee 工具與權限 section grant it via db_sources.grants.list/.set and agents.update { capabilities.db_sources }, and the MCP agent_update tool gained db_sources/db_sources_add/db_sources_remove (gated by the existing delegation policy, audited as db_sources_grant_changed, fail-closed id validation except on remove) — every route hot-reloads with no gateway restart. See docs/features/55-data-sources.md.
  • Reversible context retrieval, evidence-bound causal graph, and decision twin (2026-09, all admin-only; CCR and causal extraction default off, the Decision Lab surface is mounted by default and is switched off with [decision] enabled = false): three related, independently-gated additions that trade a compressed or exploratory view for an auditable, scope-checked path back to the source. CCR (duduclaw-llm/src/ccr.rs, config.toml [ccr], deny-by-default allowed_sources) lets a long tool result be compressed into a model-visible preview while the exact original stays retrievable — only to the same principal, in the same scope — via the MCP tools duduclaw_ccr_retrieve/duduclaw_ccr_find, until the bound source is revoked; revocation flips any in-flight channel reply to a fixed refusal string rather than risk delivering a stale excerpt. Causal evidence graph (duduclaw-memory/causal*.rs, config.toml [causal_extraction]) turns admin-approved source spans into scoped, human-reviewed claims/DAGs/effect estimates behind 24 /api/causal/* routes and the /app/system/causal Curation page; estimators fail closed to Unknown rather than assert an effect the assumptions don't support, and every derived value is scrubbed on source invalidation, deletion, or retention expiry. Decision twin / Decision Lab (duduclaw-gateway/src/decision_*.rs, /app/system/decision-lab, 34 /api/decision/* routes) applies the same evidence discipline to a support-queue staffing simulator — synthetic and (separately) operator-uploaded pilot data, prospective shadow forecasts frozen before their outcome is known, and human-inspection receipts recorded through the existing ApprovalBroker. Its kill switch now retires the dashboard with the HTTP surface (2026-09-29, audit X1): config.toml [decision] enabled = false already 404s every /api/decision/* route, and system.status now forwards the same authority as decision_enabled, so the SPA drops the Decision Lab rail row, its 進階設定 index entry, its ⌘K command and its /app/system card (Gated.requiresFeature in web/src/lib/nav-visibility.ts — the one deliberately fail-open gate there, since an older gateway reporting no field must not hide a live feature) while /app/system/decision-lab stays reachable and states that the operator switched the line off, naming the key rather than silently redirecting. Real data feeds (2026-09-29, audit X1): the decision twin gained two non-synthetic sources — the local task board (decision_task_board_export.rs + the default-off [decision] task_board_shadow scheduler; staffing[].agents is a documented max_concurrent_runs proxy and the cost axis is inert) and an Odoo Helpdesk/Project adapter (duduclaw-odoo::support_export + decision_odoo_export.rs, per-agent credentials, mapping-tested only — no live Odoo instance) — and the causal graph gained one: causal_audit_ingest.rs transcribes a failed goal settle's fault token plus that round's own tool_calls.jsonl bytes into a candidate claim ([causal] audit_ingest, default on, zero LLM, zero egress, 50/agent/UTC day, deduplicated). Its consumer is an AEE causal_support Measure dimension that is deliberately absent from the commit gate's dimensions() (telemetry only; None at zero accepted claims, never 0.0), with the opt-in [evolution] require_causal_evidence routing an unsupported playbook entry to the existing shadow-rule path instead. CCR gained [ccr] builtin_sources (default on) routing DuDuClaw's own 11 high-output read-only MCP tools, but [ccr] enabled stays false: the four-arm cost/quality comparison is unmeasured for want of a provider credential (wiki/reports/ccr-real-measurement-2026-09-29.md). Shared invariant across all three: passing a gate or screen means "eligible for human inspection," never "promoted," "calibrated," or "authorized to act" — a real feed is not a real pilot, and none of the three lines has moved past synthetic/pilot validation. See docs/todo/TODO-reversible-context-causal-simulation.md and docs/spec/reversible-context-ccr.md / causal-evidence-graph.md / support-decision-twin.md.
  • Codex PreToolUse hooks (installed per agent by agent_hook_installer into <agent_dir>/.Codex/settings.json, merged not clobbered, re-registered every boot): (1) duduclaw hook agent-file-guard — a Rust subcommand (cross-platform by design), matcher Write|Edit|MultiEdit|NotebookEdit|Bash (NotebookEdit since the Unreleased block), installed command carries --agent "<id>" and --home "<home>" (the spawn env is scrubbed of DUDUCLAW_HOME, so before --home a non-default home was judged against $HOME/.duduclaw), exits 2 on any write by an agent or untrusted caller under <home> outside its own agent directory and attachments/ (allow-list: audit log, evals/ incl. held-out sets, SQLite stores, breaker state, licences/org files, global skills, shared wiki are all refused; Write/Edit judged on the symlink-resolved real path too, unresolvable ⇒ refused; only a caller with no --agent and no DUDUCLAW_AGENT_ID is unaffected; the installed command always carries --agent, so an operator running claude by hand in an employee's directory is judged as that employee, or as unverified under strict identity mode), on an agent-structure file written outside the canonical <home>/agents/<name>/ tree, on an agent writing its own SOUL.md (no hook-level opt-in; can_modify_own_soul = true only opens the agent_update_soul MCP tool, self only), on an agent writing its own CONTRACT.toml (BlockedOwnContractWrite, duduclaw_core::check_own_contract_write, no opt-in at all; operators use the admin-only contract.update RPC), on any cross-agent write, on AI writes/moves/deletes under agents/_trash/ (Bash by heuristic), and on a Bash duduclaw agent create <reserved name>; the Bash lane matches the own SOUL.md/CONTRACT.toml both as agents/<self>/… and as relative spellings (CONTRACT.toml, ./CONTRACT.toml), and also refuses, for agent/untrusted callers, Bash commands that write to <home> state (known read-only commands pass; any other command with a <home> argument is refused; <home> database files outside agent directories and attachments/ refused even for reads) and an untrusted caller's write anywhere under agents/ — still a speed bump, rules and limits in docs/features/05-security-defense.md; real containment is not granting Bash; (2) org_field_guard runs inside that same hook — field-wise diff of the reconstructed post-write content against disk, denying changes to [agent] reports_to/department/name, the whole [capabilities] table, and config.toml [delegation]/[acp] (every caller), plus, for agent callers only, every section of the caller's own agent.toml not on the editable allow-list (new sections frozen by default) and [agent] role / [prompt] cli_bare_mode / [model] account_pool; fail-closed on unparseable or unreconstructable writes and on an existing file it cannot read; (3) duduclaw hook data-file-guard (RFC-23 §14.4, matcher Read|Bash; decision logic in duduclaw_core::data_file_guard) — armed only when redaction is active for that agent (DUDUCLAW_DATA_FILE_GUARD at spawn), documented as a Bash filename heuristic rather than a sandbox. H10 (2026-09) replaced the original data-file-guard.sh shell script, which was inert on a Windows host with no bash on PATH; the installer deletes any leftover script on upgrade. Plus the library-side duduclaw_security::input_guard (11 rule categories, block threshold 60, NFKC-normalized, en + zh-TW patterns) at the MCP dispatch front door, channel messages, distillation, migrate from imports, expert-pack install, mail and reminders (Chinese patterns are gap-tolerant since v1.67.1; see docs/features/05-security-defense.md). The 2026-04 three-phase shell defense (blacklist → obfuscation detection → Haiku AI judgment, GREEN/YELLOW/RED threat-level state machine) was deleted in ba015a48 when .Codex/ left the public repo; .Codex/ is gitignored and nothing in the shipped binary reads it. ~/.duduclaw/threat_level survives only as an operator-written kill switch polled by computer_use_orchestrator (absent ⇒ GREEN). Current description: docs/features/05-security-defense.md; commercial/docs/TODO-security-hooks.md and code-review-security-hooks.md are marked historical.
  • Browser automation & computer use — two built-in fetch tools and an optional external browser server the agent chooses between, plus computer-use sessions driven through the computer_* MCP tools; there is no auto-router: L1 web_fetch_cached (SSRF-gated + disk-cached HTTP GET, body truncated at 60k chars, shares web_fetch::validate_url / resolve_public_addrs with resident sensing; every outbound SSRF gate — web tools, media, tick sources, relay, MCP import, skills RPC, Odoo, wiki federation, computer-use pinning — classifies addresses with the one duduclaw_core::net_addr::is_public_ip: IPv4 special-purpose blocks incl. CGNAT/documentation/benchmarking/multicast/reserved, IPv6 only 2000::/3 minus Teredo/documentation, IPv4-mapped/NAT64/6to4 judged by the embedded IPv4; the older web check let [::ffff:127.0.0.1] through), L2 web_extract (same fetch path + CSS selector, text/html/json), L5 computer use has one driver over one container (computer_use_orchestrator, global cap 5 sessions): the eight computer_* MCP tools (computer_session_start/screenshot/click/type/key/scroll/navigate/session_stop) drive a gateway-owned session — duduclaw mcp-server (mcp/computer_use_client.rs) is a thin client that POSTs {op: start|screenshot|action|stop|status} to POST /api/internal/computer-use on loopback, signed per request (X-Duduclaw-Agent-Id/-Timestamp/-Nonce/-Signature = HMAC-SHA256 keyed by the gateway-internal MCP key over agent id, agent token, timestamp, nonce, body hash; loopback peer only, ±60 s, 120 s nonce replay cache, 120 req/min/agent, 64 KiB body; computer_use_sessions/auth.rs) and computer_use_sessions/ owns everything else: one session per agent, ephemeral agents and computer_use_mode = "native" refused, 120 s idle / max_session_minutes / max_actions (navigate counts, screenshots do not), 15 s reaper, home+deadline-labelled duduclaw-cu-* containers swept at boot and every 10 min, threat level YELLOW = screenshot/stop only and RED = end, chat emergency-stop words end tool sessions too; the gateway re-checks denied_tools/allowed_tools/scoped_tools and the three approval lists itself (gates.rs, maybe-irreversible always asked, no LLM judge; the MCP-side approval gate skips these eight tools); high-risk actions need a confirmation in the chat of the agent's live turn (turns.rs, the gateway's own (agent, DUDUCLAW_TURN_ID) → reply channel registry, never the request) and are refused with no channel; unreadable focused-window title refuses the action; computer_screenshot returns an MCP image block + text (the gateway answer carries fully_masked + mask_reason several_pages/title_sensitive/title_unreadable/helper_failed, decided from duduclaw-eval-dom's exit status 3/1, recorded in the audit row, and a fully masked picture's text says why and what to do next); typed text is audited as a character count only; rows go to audit/browser/audit.jsonl (tier L5a) and tool_calls.jsonl. Network: none unless agent.toml [capabilities.computer_use_config] allowed_domains (exact hostnames, ≤20, invalid entries dropped with a warning, duduclaw_core::types::normalize_navigation_host) — the gateway resolves each host at start (all answers public or the host is skipped, IPv4 only), pins it with --add-host, passes ALLOWED_IPS to domain-filter.sh (default drop, TCP 443 to pinned addresses only, DNS refused) and adds NET_ADMIN; computer_navigate (navigation.rs) takes https:// only, no userinfo, port absent/443, host exactly one of the session's resolved hosts, ≤2,000 bytes, validated before any approval (approval text names the validated host only), URL handed to duduclaw-navigate on stdin (argv = usage error); the kiosk browser has no address bar. Container hardening (both paths): --security-opt no-new-privileges, pinned sessions pass --network bridge explicitly, domain-filter.sh limits loopback to 127.0.0.1/::1 and rejects Docker's resolver 127.0.0.11 in pinned and no-allowlist-networked modes (its own TCP RST / ICMP unreachable answers pass on lo, so refusals are immediate), Chromium managed policy container/scripts/chromium-policy.json (no local-network/loopback access for pages, no incognito/guest, no file dialogs/printing/downloads/pop-ups, device permissions blocked, file:///chrome:///devtools:///view-source:/javascript:// blocked; DeveloperToolsAvailability deliberately unset because it kills the loopback CDP the helpers use), helper JS runs in an isolated world (Page.createIsolatedWorld, duduclaw_cdp.py), screenshots captured to root-only /tmp/duduclaw-root (0700, created before the browser starts). Known limits: ctrl+t/ctrl+n cannot be blocked by policy (ctrl+n opens a window with an address bar; reach still only pinned hosts; >1 visible page ⇒ fully masked screenshots until the next navigate closes extras); a root docker exec process keeps NET_ADMIN (only PID 1's tree drops it; only the gateway execs). Pointer actions run xdotool mousemove without --sync (it stalled ~18 s when the pointer was already on target). Exercised on Docker Desktop macOS arm64 only; IPv6 filter rules not exercised with traffic. Residual risks (documented in SECURITY.md): an allowlisted site gets whatever the AI types, same-domain proxies/redirectors relay, addresses pinned at start. The chat-message loop is removed (2026-10): a channel message with computer-use keywords takes the normal reply path and the employee decides whether to call the tools; the gateway no longer calls the Anthropic computer_20251124 tool, posts no progress/screenshots/"cannot start" replies, and computer use reads no Anthropic key. Native mode is removed (no enigo/duduclaw-desktop dependency; the gateway's desktop cargo feature is kept empty because the release workflow passes it): [capabilities] computer_use_mode still parses, "native" is refused by the tools with native_unsupported (no silent fallback), "auto"/absent = "container", duduclaw doctor warns and names employees still set to native; audit rows no longer carry tier L5b. Neither removed path could complete a session in any released build (v1.66.1's container used an image nothing built, whose Dockerfile could not start; native called the same container start first). Verified with a real model (Claude Sonnet 5.5 through the real MCP server: start, navigate, read page from screenshot, click by coordinates, recognise the off-allowlist error page, stop); unverified: a session from inside a gateway-spawned turn on a real channel, the WebChat confirmation prompt, the keyword-message fall-through on a real channel. Screenshots are kept 7 days, ≤500 files / 200 MiB per agent. The L5 image (container/Dockerfile.computer-use) never worked until it was repaired and verified on 2026-10-01 (Debian chromium + openbox, browser as unprivileged sandbox, kiosk at 0,0 with scale factor 1); .github/workflows/computer-use-image.yml publishes it on tags v* (native amd64/arm64 runners, smoke-tested with the gateway's container flags before push) as ghcr.io/zhixuli0406/duduclaw-computer-use:<tag> + :latest — first run is the first release tag after v1.66.1; release.sh verify does not check it. Default image …/duduclaw-computer-use:v<gateway version>, only override the global config.toml [computer_use] image (digest ok; invalid section ⇒ unavailable, never the default; no per-agent key; computer_use_image.rs); never pulled (--pull never + presence check); duduclaw doctor has a 電腦操作 row. Screenshot masking runs the in-image helper duduclaw-eval-dom (CDP on container loopback, 5s limit, 10s gateway timeout; input[type=password] / .credit-card / [data-sensitive]; any failure masks the whole screenshot; then the focused window's title is read, and a credential-marker title or an unreadable one (error/timeout/non-zero exit/non-UTF-8) masks the whole screenshot, an empty readable title does not; browser UI, cross-origin iframes and shadow DOM undetected), and domain-filter.sh refuses to start when it cannot install its default-deny egress rule while a non-loopback route exists, so the gateway adds --cap-add=NET_ADMIN only on the filtered-egress paths (--pids-limit 512). L3 headless is an optional external per-agent MCP server (Playwright or Browserbase, an entry the operator writes into .mcp.json by hand; the generator helpers in mcp_template.rs have no caller) — not in the binary, no fallback into it. Deny-by-default via CapabilitiesConfig in agent.toml [capabilities] — computer_use (fail-closed: missing file / bad TOML / wrong type all deny), browser_via_bash, allowed_tools, denied_tools (passed as --disallowedTools and enforced at the MCP dispatch gate). browser_via_bash no longer sets any env flag — the bash-gate.sh allowlist that read DUDUCLAW_BROWSER_VIA_BASH went with the shell hooks in ba015a48; the capability still feeds disallowed_tools() and CapabilitiesConfig::sandbox_level() (codex/gemini ReadOnly vs WorkspaceWrite). The "5-layer auto-routing" story was browser_router.rs — 438 LOC written 2026-04, zero call sites, never in the CHANGELOG, deleted 2026-09; its "L4 Sandbox Browser" tier never existed as a separate capability, and its trusted/blocked-domain, per-session page cap, screenshot-audit and per-action approval fields were never implemented (approval gating lives in ApprovalBroker + approval_required_tools/irreversible_tools). See docs/features/08-browser-automation.md; commercial/docs/TODO-browser-automation.md is marked partly historical.
  • Behavioral contracts (CONTRACT.toml) with must_not / must_always boundaries + duduclaw test red-team CLI
  • Agent behavioral evals (duduclaw eval, v1.33): golden-task regression for agents — evals/<agent>/*.toml cases with deterministic tool-call/regex assertions + optional LLM judge (reuses duduclaw-fork::judge); live mode drives the real CLI (captures actual tool_use), replay mode re-parses recorded transcripts offline for CI; JSON report + non-zero exit gates PRs. The external yardstick independent of the GVU verifier for a self-evolving platform (design hook to feed SOUL.md 24h observation-window post-metrics). v1.53 eval hardening: --record rewrites .mcp.json to a temp copy pointing DUDUCLAW_HOME at the eval home + DUDUCLAW_MCP_API_KEY=eval-local (recording has zero production side effects and can't leak real MCP keys into transcripts); a run that dies on any max-turns cap parses as error_max_turns — an assessable failure baseline, not an infra error (infra errors stay hard); duduclaw eval-scaffold drafts eval cases from an agent's SOUL behavioral rules into evals-drafts/ (free-tier path to the AEE ≥1-EvalCaseRef hard requirement — drafts must be human-reviewed before moving into evals/); premium team deployment auto-installs bundled eval suites (premium_templates::install_eval_suite — dual-location resolution, rename-safe agent-field rewrite, never clobbers an existing dest). See docs/guides/evals.md.
  • HITL ApprovalBroker (approval.rs, v1.33): one interrupt/approval primitive spanning MCP tools / autopilot actions / bus tasks — SQLite approvals.db (WAL), request/decide/await_decision/expire_stale, TTL-expiry = DENY (fail-closed). Wired into autopilot require_approval; agent.toml [capabilities] approval_required_tools parser; converges the three ad-hoc approval impls (browser router / channel confirmation / governance workflow) onto one auditable store. One push entry (2026-09-29 / T5-O5): goal_notify / approval_notify / install_notify / autopilot_notify each carried their own "resolve a bot token → deliver the card → remember the first destination that worked" loop (their doc comments admitted the duplication to each other); that loop is now notify_push::push(card, dest), where dest picks the only thing that genuinely differed — the token dialect: an agent-addressed card uses that agent's own [channels.<ch>] token with the reports_to cascade, a linked-dashboard-user-addressed card uses the deployment's DM bot tokens and tries each until one reaches the person. The four modules keep their pub fns and own exactly what the domain knows: what the card says and where it belongs. Authorization did not move (decision_notify::authorize_press + each module's delivered_targets) — a push is an outbound side effect and must never be able to widen who can decide. The two transports send_with_markup (TG inline keyboard / Slack blocks / Discord DM-open / LINE quickReply) and send_plain_text moved from goal_notify.rs into channel_sender.rs, where six non-goal modules were already reaching for them. Simulate-before-act (harness→LWM plan D, v1.53): approval requests carry a structured simulation of what the action would do — ActionGuard's maybe-irreversible judgment produces the narrative (fail-closed semantics unchanged), and goal-loop needs_human escalations attach a three-step simulated trajectory (15s timeout; on timeout the request degrades to no-simulation rather than blocking); wiki-derived context for simulations is restricted to read-only namespaces and can never decide irreversibility (no self-certification). The dashboard approval card renders the simulation (approvals.list ships the simulation field).
  • OpenTelemetry GenAI tracing (otel.rs, opt-in otel feature, v1.33): invoke_agent / chat / execute_tool spans following the gen_ai.* semantic conventions, OTLP-exportable (gRPC) to Langfuse/Grafana/Jaeger/Datadog. DEFAULT OFF (zero deps/overhead unless config.toml [telemetry] otlp_endpoint set); coexists with the Prometheus metrics.rs layer. See docs/guides/observability.md.
  • A2A v1.0 Agent Card (acp/server.rs, v1.33): /.well-known/agent-card.json (v1.0 schema; legacy /agent.json alias) with the x-duduclaw ADR-002 capability-negotiation extension preserved; message/send is fully wired to bus_queue.jsonl (advisory-locked append, sender identity recorded, honest submitted state — never fakes completed; tasks/get maps bus observations back to A2A states).
  • A2A delegation isolation (v1.52): Organizational boundaries enforce access control on inter-agent delegation — policy engine (duduclaw-core/delegation_policy.rs): six-rule predicate (self-delegation forbidden, system senders bypass, hierarchical authority bidirectional, same-department horizontal, white-list pairs, else DENY); enforcement chokes (v1.52): dispatcher bus consumption (gateway/dispatcher.rs C1), MCP front doors (send_to_agent/spawn_agent C2 with legacy check_supervisor_relation removed), task assignment (tasks_create/tasks_update C3), agent hierarchy creation (create_agent/agent_update C4 caller-owned-subtree-only; since the Unreleased block an AI employee cannot send reports_to/db_sources*/budget_cents/role about itself), ephemeral spawn (C5 parent==caller), and (Unreleased block, mcp/record_authz.rs) every tool that changes or triggers another employee's record: tasks_update/tasks_claim/tasks_complete/tasks_block, activity_post with task_id, update_cron_task/delete_cron_task/pause_cron_task/run_cron_task, create_reminder for another agent_id — owner passes, else the same predicate, unknown owner/caller refused. System-sender names are no longer accepted as an MCP process identity (they resolve to the untrusted sentinel), so the predicate's system-sender bypass is reachable only from gateway-internal callers. Visibility filtering (C6): list_agents/agent_status per-caller scope (self + subtree + ancestors + same-dept + white-list; open policy shows all). Policy modes ([delegation] policy): department (predefined+default), hierarchy (no horizontal), open (legacy escape hatch). White-list config (allow = [["a","b"]] pairs, bidirectional, ignores malformed/self entries). Dashboard management (delegation.get/set RPC, admin-only) + UI card in advanced settings (radio + pairing editor, no restart needed). ACP entry ([acp] trusted = true opts into a2a-client sender allowlist; default deny). Audit log event delegation_denied carries sender/target/path_kind/policy. Identity & integrity (v1.52 hardening): HMAC-SHA256 caller token per spawn (DUDUCLAW_AGENT_TOKEN env); PreToolUse hook freezes org fields (agent.toml [agent] name/reports_to/department, config.toml [delegation]/[acp], .mcp.json identity block, .Codex/settings.json; since the Unreleased block also the own agent.toml security sections and every <home> path outside the own directory and attachments/) to MCP/Edit/Write tools—config mutations routed through agent_update/dashboard only; require_identity_token soft/hard modes in [delegation]. No rank-based auth (hierarchy via reports_to trees only, per §2.7). Org authority store (v1.52 WP22 hardening): central ~/.duduclaw/org.toml (org_store.rs) seed-once on first gateway boot from agent.toml manifests; org mutations thereafter via duduclaw org sync CLI (operator-terminal only, fail-closed in AI sessions), duduclaw org show inspection, duduclaw doctor drift detection. Manual agent.toml edits no longer auto-propagate. Cross-agent file isolation: PreToolUse + sandbox (workspace-write blocks ~/.duduclaw/ for non-Codex runtime) prevent agent self-mutation of org settings affecting delegation decisions (FullAccess sandbox exempt, operator choice).
  • Unified pack format (duduclaw-core/src/pack/ + duduclaw pack {list,install,inspect}, T5/O2 2026-09): "a pre-configured set of AI employees" used to be three manifest dialects with three install verbs — expert packs (expert.toml), premium team playbooks (teams/<industry>-team/team.toml), job presets (presets/<id>/preset.toml) — plus a fourth the audit table missed, the <industry>-pro/ industry-pack directory. One pack.toml schema and one in-memory Pack type now cover all four (kind = preset|team|template, tier = free|premium, agents[]/humans[]/excluded[]/eval_suites/autopilot_rules/examples), with four legacy loaders reading the old files verbatim — no disk migration (the premium tree's compliance overlays are human-reviewed line by line and are never machine-rewritten). duduclaw pack install is the single front door: it resolves a source through the existing fenced resolver (zip-slip guard, 50 MB cap, registry sha256 + minisign), applies the one premium decision (tier == Premium → licence check; an unreadable tier counts as premium, fail-closed — this also closes the gap where expert install ./templates-premium/experts/<slug> bypassed the gate entirely in white-label bundles), then routes by kind: a preset lands in the preset store, a team/industry pack goes to the untouched expert-pack pipeline (safe_zip → DATA scan → scaffold → org_store::upsert → hooks quarantine), so installed results are byte-identical to the old path. duduclaw expert install was removed in v1.69.0 (a hidden stub prints pack install and exits with status 2); the experts.* RPCs shell out to duduclaw pack install; expert list stays and lists the installed records (it is not an alias of pack list); authoring verbs (pack/publish/export/convert-teams/hooks/remove) stay under duduclaw expert. pack inspect --emit-canonical prints (never writes) the pack.toml a legacy pack corresponds to. The legacy dialects (expert.toml, team.toml, industry directories) are still read and are deprecated with no removal version (they go with the rewritten premium templates, because a pack.toml team or template pack cannot be installed yet); preset.toml is the job-preset storage format and is not deprecated; the old verb expert install was removed in v1.69.0. Design: commercial/docs/DESIGN-pack-format-unification-2026-09.md; user docs: docs/features/12, docs/features/32, docs/guides/build-your-own-pack.md (all three locales).
  • Skill ecosystem: GitHub Search API live indexing of real skill repos, 24h local cache, weighted search, MCP skill_search / skill_list tools. Hub aggregation covers anthropic / github / clawhub / lobehub / skills-sh (DEFAULT_HUB_IDS); skills-sh needs a Vercel OIDC bearer token we do not have, so it answers 401 and is reported through [unreachable: <hub>: …] rather than contributing hits. One search entry (T5/O13, 2026-09-29): skill_search takes source: "all" | "github" | "hub" | "bank" (default all — hubs plus the learned skill bank, de-duplicated by skill name, each hit labelled); skill_bank_search was a deprecated alias for source="bank" and was removed in v1.69.0. The learned skill bank is still an empty in-memory stub, so source="bank" reports an empty store rather than returning hub results
  • Integration gates (2026-09 audit): GitHub — the five github_* tools had no integration_enabled layer, so a token in the OAuth vault meant every agent could post as the operator (github_issue_comment is a public write). [integrations] github (default false; missing file / bad TOML / non-boolean all read as off) now gates them, they are hidden from tools/list when off (discoverable ⇔ callable), and completing the dashboard's GitHub OAuth connection flips it on — same "connecting is the opt-in" rule Google already followed. Google Workspace — [integrations] google_workspace defaults false and the frontend now reads that flag instead of hardcoding true (the old mismatch showed the tab and then 403'd on click)
  • Skill auto-synthesis (Phase 3-4, H2 wired 2026-09): Gap accumulator detects repeated domain gaps → skill_lifecycle::synthesis_runner synthesizes a SKILL.md from episodic memory (Voyager-inspired) → security scan (the skill_security_scan scanner, fail-closed) → sandbox trial with TTL → cross-agent graduation. The trigger consumer is gated by agent.toml [evolution] skill_synthesis_enabled (default false): with it off the runner only clears pending and spends nothing. Every failure path calls cancel_pending (topic re-accumulates), only a passing candidate calls confirm_synthesis (cooldown + evidence cleared). Until 2026-09 the chain dead-ended: confirm_synthesis/cancel_pending and SandboxStore::add had zero production call sites, so a triggered topic stayed pending forever and the sandbox was always empty. Feedback-signal rows use the canonical type key (readers still accept the legacy signal_type). MCP tools: skill_security_scan, skill_graduate, skill_synthesis_status Four skill_lifecycle modules with zero call sites anywhere in the workspace were removed in 2026-09 (curiosity.rs / dependency_resolver.rs / reconstruction.rs / recommender.rs, 1,165 LOC) — reconstruction::reconstruct_skill had never been called even by its own test, while docs/features/15 sold it as "Stage 4 Reconstruction"; that page is now a six-stage description with Stage 2 (three-layer progressive loading, not deduplication) and Stage 5 (prediction-error diagnosis, not skill grading) corrected to match the code. vetting.rs was deliberately kept — it is the second security gate inside sandbox_trial::graduate_skill_to_disk.
  • Task Board: SQLite-backed task management with status/priority/assignment tracking, real-time Activity Feed via WebSocket. Two access layers: Dashboard WebSocket RPC (tasks.list/create/update/remove/assign, activity.list) for the web UI; Agent-facing MCP tools (tasks_list, tasks_create, tasks_update, tasks_claim, tasks_complete, tasks_block, activity_list, activity_post) that let agents see their own queue, claim work, and post progress — fulfilling the Multica "Agent-as-teammate" design. Pending tasks (up to 5) are auto-injected into the agent system prompt. Record relationship (Unreleased block): an AI-employee caller changes a task only as its assignee / claimer / creator (tasks_complete/tasks_block: assignee or claimer only) or through the delegation predicate against the assignee; an unassigned, unclaimed task must be claimed first (creator excepted for tasks_update/activity_post); claiming a task assigned to someone else or reassigning it to yourself needs the relationship; goal_mode title/description are frozen like acceptance_criteria; the control tags outcome:*/grant:*/auto-research cannot be added, removed or reordered (refused in tasks_create tags too); operators (a key mapping to no employee, no DUDUCLAW_AGENT_ID) are unrestricted. One creation entry (T5/O4, 2026-09-29): tasks_create gained kind: "task" | "goal" and schedule (cron expression or RFC3339 instant), both optional and both defaulting to today's behavior. kind="goal" runs duduclaw-gateway/src/goal_create_core.rs — the function extracted out of the dashboard tasks.goal_create RPC, so the H9-G acceptance-contract freeze, the structured-outcome parse, per-goal wall clock / risk boundary and I-1c plan_first have exactly one implementation instead of two that can drift. schedule delegates verbatim: a cron expression to the schedule_task rail (CronStore), an RFC3339 instant to the one-shot reminder rail (agent_callback, requires notify_channel + notify_chat_id since the wake-up runs detached) — cron rows cannot express "once", so a date pinned into cron fields would silently fire again next year. kind="goal" + schedule is refused, never half-applied. The WP21 C3 delegation gate is now enforced once at the merged entry, before any branch — a caller can no longer launder a cross-department assignment through whichever of the four old tools checked least. schedule_task was a deprecated alias and was removed in v1.69.0. goals_create and create_task are NOT deprecated — goals_create creates a goal-hierarchy node (Initiative → Project → Issue), and create_task submits an explicit multi-step steps plan to the TaskSpec dispatcher, which tasks_create has no parameter for; both descriptions now disambiguate instead.
  • Autonomous Goal Loop (goal_loop.rs + goal_notify.rs + dispatch_engine.rs, v1.37): user-facing outer loop turning one-shot Q&A into "give a goal → agent loops to completion → stuck escalates to human". /goal <描述> [|| <驗收標準>] chat command creates a goal_mode task (source channel/chat stamped for progress push-back); GoalLoopDriver (30s tick, gated by [dispatch] enabled — default ON since v1.59, opt-out via config or the Settings→Automation「派工引擎」hot-reload switch; the engine + goal-loop driver build/spawn live on MethodHandler::respawn_dispatch_engine / respawn_goal_loop_driver so boot and system.update_config share one path) dispatches via message_queue without the heartbeat 1h cooldown (heartbeat excludes goal tasks to avoid double-dispatch), retries immediately with judge feedback on rejection; DispatchEngine acceptance judge is a three-aspect MAV panel (correctness/completeness/safety, one LLM call via run_utility_prompt → account rotator, all-pass to accept, fail-closed parse) — DONE only via verifier approval, never agent self-report (LoopTrap defense). Hard guards: iteration cap (default 5 — lowered from 8 in the Iterative Kanban round; older docs saying 8 are stale), wall-clock 24h, concurrency 3, in-flight dedup, no-progress oscillation detection (two identical rejection feedbacks → early needs_human), all under [goal_loop] config. HITL: needs_human pushes approve/retry/abort buttons to TG/Discord/Slack/LINE (WP16 codec; text-only fallback elsewhere) + dashboard needs_human board column; per-agent [capabilities] autonomy_level five levels (operator/collaborator/consultant/approver*/observer — collaborator/consultant require kickoff approval via ApprovalBroker, fail-closed TTL). ActionGuard three-value irreversibility ([capabilities] irreversible_tools/maybe_irreversible_tools: always→human, maybe→LLM judge fail-closed, never→auto) layered on approval_required_tools taking the stricter. Runaway defenses (arXiv 2607.01641): cross-process dispatch_guard sliding-window breaker in duduclaw-core (~/.duduclaw/dispatch_guard.json under with_file_lock, spawn/ephemeral/cron paths, [dispatch_guard] config), cascading hop_depth over bus handoffs (env DUDUCLAW_HOP_DEPTH, max 5), termination_manipulation injection rule (7th input_guard category, weight 30 no instant-block). See docs/guides/goal-loop.md.
  • Team-as-Agent(一位員工四角色,v1.66 起預設開):一個 AI 員工可以把一輪 goal 拆成 規劃/執行/審核/合成 四個角色,每個角色綁自己的 (runtime, model, effort)(config.toml [team] + agent.toml [team] 逐欄 cascade),角色之間只交換 TaskPacket(duduclaw-core/task_packet.rs),不傳逐字稿。[team] enabled 預設 true(v1.66 前是 false)——但真正決定成團的是有沒有在 [team.roles] 指名第二家廠商:沒寫角色時執行與審核雙雙 cascade 到員工自己的 runtime/model(types::cascade_unbound_roles,規劃/合成刻意不填,否則會憑空多出一個沒人設定的階段),同家族被去相關規則(arXiv:2607.13918)拒絕,任務照舊走 Solo,且拒絕是安靜的(FreezeOutcome::SoloByDefault 只留 debug!,不寫 team_refused 稽核列;明寫 enabled = true 或設了角色卻驗證失敗的操作者仍拿到吵版稽核列)。另兩道安全條件:可拆性閘(duduclaw-core/team_gate.rs,零 LLM、四訊號取三)仍讓一般任務逐位不變地走 Solo;[dispatch.team_budget] 連一輪降級後的最小編組都付不起時第一輪改判 Solo(team_composer::budget_forces_solo),已花掉額度的任務才維持 needs_human(budget_exhausted)。角色跑在 ~/.duduclaw/agents/.ephemeral/ 的一次性 role member 上(工作目錄是員工自己的工作區),回合結束立即拆除,每階段寫一列 role_turns.jsonl。duduclaw eval --matrix 產出的 role_model_matrix.toml 現在被 composer 當先驗讀取(H11):[team.roles.*] 未寫 model 的角色先查矩陣、再退回員工 [model] preferred,只採計該角色自己 runtime 上的 resolved 格、勝出模型必須維持該角色的模型家族、平手與憑證不可用一律忽略;沒有矩陣檔時與接線前逐位相同。同一份矩陣自 2026-09-29 起也餵 gate 的第三個訊號 capability_gap_pp(team_composer::capability_gap_from_matrix):取執行角色 (role, runtime) 下最佳 resolved 模型與該角色今天實際跑的模型(明寫的 [team.roles.executor] model,否則員工 [model] preferred)之 n 加權平均差(百分點),跨家族勝出者不算、兩邊都要有 resolved 格,並與矩陣 header 的 declared_mde 同檔成對供給 declared_mde_pp(差值配另一份檔案的 MDE 是兩份檔都沒做過的宣稱);出貨矩陣每格都是 unresolved,所以預設部署仍是四訊號只有兩個量得到、灰帶照舊走 Solo。enabled = false(全域或單一員工)與 gate = "always_solo" 都是一行還原。設計 commercial/docs/DESIGN-team-as-agent-2026-09.md,使用者面 docs/features/56-team-as-agent.md。
  • 兩段式裁決+停滯/收工偵測+交接與目標契約硬化(harness-borrowings 2026-08 Phase 1):三份外部 harness 調研(deepseek-harness/WorkBuddy/grok-build)收斂出的裁決工程借鑑,全部落在既有 MAV 判官與 goal loop 之上,不另起爐灶。兩段式裁決:dispatch_engine.rs settle 時先跑一個無工具、單次 LLM 呼叫的便宜 evaluator(三值 continue/candidate_complete/blocked),只有完成候選才進現行三面向 MAV 判官團;evaluator 任何故障一律降級直接跑 MAV([dispatch] two_stage_judge,預設開)。MAV prompt 加了反棘輪/只稽核不自建證據/反契約外擴張/自稱完成不是證據四條紀律,並補上兩個既有 fail-open 洞(截斷面板 JSON 不再落回舊版掃描器誤判 PASS;PASS 須是回覆第一行的開頭 token)。停滯偵測升級(goal_loop/signals.rs):從駁回回饋抽 path:line 與反引號關鍵詞正規化成指紋,換句話說的同一個 gap 也判成同一次卡住(無引用時退回逐字比對);提前收工偵測(同檔):九條 zh+en 正則比對 agent 回合最後一段文字,命中記遙測(goal_loop_bail_pattern_total{pattern})並把提示帶進下一輪判官/evaluator 輸入,不自行駁回。重啟不自動復活:[goal_loop] resume_on_restart = "auto"|"pause"(WP-E 2026-08 起預設 pause,機制首次上線時原預設 auto),pause 時 gateway 開機把 in-flight goal 任務轉 needs_human;system.update_config 白名單只收兩值,儀表板「設定→自動化」可切換,只在下次 gateway 真正重啟時生效。交接契約硬化:working_state_handoff 新增可選 Ralph 式欄位 status/next_steps/evidence/blocker,依 status 強制校驗,超長([memory] working_state_handoff_max_bytes,預設 16384)整筆拒絕絕不截斷。目標契約凍結:/goal/tasks.goal_create 建立時把驗收標準凍結成 acceptance_criteria_baseline,判官與 evaluator 一律讀這份基準;agent 身分 tasks_update 改 goal 任務驗收標準一律拒絕並留審計(goal_contract_frozen),僅操作者可經儀表板編輯顯示用副本;/goal 無 || 時回覆附四要素(目標/輸入/輸出格式/約束)與 3-5 條 outcome 式驗收標準建議。設計全文 commercial/docs/DESIGN-harness-borrowings-2026-08.md,調研全文 research/harness-2026-08/。
  • Goal Loop 第二梯人為信號補完+spawn 准入排隊+ActionGuard/MCP 安全收斂(harness-borrowings 2026-08 第二梯):needs_human 帶封閉六類 pause_reason(no_progress/budget_exhausted/blocked_needs_decision/infra/restart/unknown,goal_loop/state.rs,觸發現場靜態標記、絕不從 judge_feedback 反解),/goals 看板/詳情/通道通知三處渲染分類;已認領任務靜默逾 [goal_loop] progress_report_minutes(預設 10 分,0 關)以 Activity Feed 事件為訊號源(非 lease-renewer 會刷新的 updated_at)通報一次,純提醒不介入;單輪同工具同(遮罩)參數連擊 3/5/8 觸發零 LLM 的 <state> advisory(goal_loop/signals.rs,[goal_loop] tool_streak_advisory 預設開)。Ephemeral spawn 准入排隊(行為變更):spawn_admission.rs 超限從硬拒絕改有界 FIFO 排隊([dispatch] admission 預設 "queue","fail" 回退),TTL 過期落稽核、turn 終態作廢遲到票券、上限 0 鉗 1。ActionGuard 封閉列舉:maybe-irreversible 判官改吃 21 項固定 token 的 ActionGuardFinding,prompt 建構參數型別排除原文——攻擊者可控文字編譯期進不了判官 prompt。MCP 三缺口:key registry mtime 感知 per-call 重驗(輪替/撤銷下一呼叫生效、重載失敗 fail-closed);denied_tools/allowed_tools 補上 McpDispatcher 分派總門強制(先前只轉譯 CLI flag);scope/grants/denied 拒絕落稽核(error_class)。agent.toml 影子直讀統一(R2 前置):5 檔 toml::Value 手刻 reader 收斂到 duduclaw_core::agent_toml::AgentTomlSections 單一型別化解析點(lenient 錯型降級不炸 agent、缺鍵方向逐欄鎖測試含歷史怪癖 opt_float_strict),並修掉 agent_update 覆寫時整段刪除未型別化區塊的資料遺失 bug;讀取刻意不加快取維持即時生效;影子 reader 全貌 62 處/16 檔,餘者列於 preset 設計文件。通知靜默修復:googlechat/teams 的自我設定型憑證不再被 token 判定誤判為未設定(needs_human/evolution 通知恢復);reminder 改走統一 create_sender 十通道(webchat 明確拒絕防假成功)。AI 團隊召喚卡片:團隊卡顯示成員構成/真人保留崗位/任務示例(team.toml examples 優先、worker 摘要回退),召喚=experts.install_builtin。
  • credentials 讀取單一化+wiki ACL 型別化+產物物件化+計畫模式(harness-borrowings 2026-08 第三波):duduclaw-security::secret_ref 新增 SecretRef/Secret/SecretStatus,取代多套手刻「_enc 解密失敗退明文」實作——修掉 secret://<backend>/<name> 參照字面值被當真憑證送給 vendor API 的 bug(設計文件四路徑+dispatcher.rs 第五份平行實作);Secret zeroize/Debug 遮蔽/無 Serialize;[mcp_keys] 鍵名遮罩補洞;同步路徑網路 backend fail-closed(async 化列 P1)。shared_wiki_delete main-agent 判定從無錨定 contains(role="main") 改型別化 [agent] role(堵冒充刪頁洞,雙向回歸測試)。影子 reader 第二期:capabilities/budget/evolution/skills/mcp.external/os_watch/pty/agent 各區段全遷 AgentTomlSections,指派範圍影子 reader 歸零(全貌 62 處/16 檔;刻意不遷:原樣回吐/寫入路徑/read-modify-write)。任務產物物件化(I-2b):artifacts.jsonl provenance ledger(declared/swept/uploaded/produced/unknown 五 origin+exact/inferred 歸屬標示、上傳與 unknown 永不被時窗推定;合併鍵用真實 basename 防 CJK sanitize 誤併),任務詳情「產物」分頁+/files 來源欄/任務篩選+開機冪等回填;已知限制(goal 派工路徑無封存副本)已於第四波補上。靈感畫廊 /gallery(newIn 1.60.0):22 組產業劇本 examples 扇出成果卡,一鍵做同款預填交辦面板。「想一想」計畫模式(I-1c):交辦第三模式——tasks.goal_create(plan_first) 同步產計畫→needs_human(blocked_needs_decision)+獨立 plan_pending 欄位(與 judge_feedback 生命週期分離)→核准後首輪注入 <execution_plan> 一次性消費;規劃器失敗 fail-closed 到 infra。通知同族收尾:channel_sender::resolve_channel_target 單一來源,autopilot notify 補齊六通道、MCP send_message 十通道;殘留兩項(第三份 sender 拷貝、雙 snowflake 驗證器)已於第四波收斂。
  • 第四波(harness-borrowings 批次一,2026-08-15):credentials P1——secret://keychain(OS 鑰匙圈,feature 關閉時明確報錯非靜默查無)與 secret://file(固定 root 集+canonicalize containment+64KB 上限+world-writable 拒絕)兩個本機 backend、[[tick.sources]] headers secret:// 逐請求解析+解析後 CR/LF 重驗、security.credential_inventory RPC+安全頁憑證來源總表(只報鍵路徑不報值,[mcp_keys] 整段跳過——表格鍵名本身就是金鑰)、duduclaw doctor --fix-residue 互動式殘留清理、accounts.add 不再寫明文孿生鍵;第 6/7 種解密方言收斂(Apps Script 共享密鑰與 inference api_key 先前會把 secret:// 參照原樣送給 vendor;BridgeConfig.secret 改 Secret 型別堵 Debug 洩漏)——七種方言至此全數收斂。goal 產物封存:accept 時將歷輪寫出檔案封存至既有 attachments/(agent_id 白名單→canonicalize 圈定→單檔 20MB/單批 100MB cap→失敗留痕不炸 settle,冪等)。通知同族:autopilot 第三份手刻 sender 移除(slack 通知自始未送出的活 bug 一併修復)、Discord snowflake 驗證統一至 duduclaw_core::is_valid_discord_snowflake。**(2026-09-29 盤點更正:這一句原寫「終章」,但 dispatcher.rs 的 forward_to_channel(約 2634-3125 行)仍是第四份手刻 sender——九個通道各自手寫 reqwest POST、自帶 resolve_forward_token token 串接與 lookup_origin_agent,沒有走 channel_sender::create_sender。收斂列在 O5,尚未完成。)**openapi.yaml 通道 enum 補齊十一通道。調研:AutoDesign(arXiv 2608.13560)+OfficeCLI 報告落 research/harness-2026-08/;AutoDesign 鏡頭實錘 verifier_measure.rs commit 閘 visible/held-out 混維缺口。批次二(同日):AEE 驗收閘拆維防遮蔽——commit 閘 dimensions() 並排新增 cases_visible/cases_holdout(holdout band 預設主 band 減半、[evolution.noise_band] holdout 可設、顯式值鉗不寬於主 band),兩新維 fence-only 只否決不晉升(不重置 anti-drift/不關觀察窗);settle suite_verdict 同修,band 於 commit 時凍結進 PendingSettlement.band_holdout(settle 不回讀 config);無 holdout case 行為逐位不變;冠軍 bootstrap include_holdout:false 蘋果比橘子列拍板項未動。goal 預算耗盡交「最佳輪成品」(goal_loop/state.rs 純函式三優先序:進過判官團的輪→gap 最少→最後一輪;task_iterations.worker_excerpt 於駁回當下快照節錄;judge retry budget 路徑同類接上;零輪誠實空手)。[limits] DocumentLimits(document_limits.rs)守三個下游解析器(soffice 預覽/office_script Python/expert 解壓):解壓總量 256MiB/entry 4096/壓縮比 100:1/XML 深度 128/容器巢狀 4,零遞迴實作,0=預設非無上限;safe_zip header 謊報洞(宣告 size 累計 vs 實際寫入)一併修補。[office] delivery_gate(artifact_gate.rs,預設開)📎DELIVER 前結構檢查硬失敗(零位元組/magic 不符/zip 損壞)+佔位殘留 warn-only(delivery_gate_placeholder_block 可升級硬擋)。agent_id 驗證器五份收斂雙權威版(core is_valid_agent_id 廣義+新 is_valid_new_agent_id 小寫 slug 契約;MCP 面頭尾連字號漂移修補變嚴;telegram chat_id 兩處刻意不同不併)。
  • 第五波(2026-08-15):判官 seam(judge_mode.rs)——[dispatch] judge = mav(預設,逐位相同)/external(外部指令裁決,spawn 失敗/逾時/非零碼/壞 JSON 全降級回 MAV+審計 judge_seam_degraded,feedback 當 DATA 先截斷再 scan_input),未知值回退 mav(最強非最便宜)、judge_command 刻意不開放 RPC、每次裁決時讀 config(與 two_stage_judge 同套熱生效)——「一切皆插件」第一個真 seam,eval_backed 以「同一條 subprocess 路徑不寫兩份」刻意不做。T5/O12(2026-09-29):另兩個模式 evaluator_only/human_only 標為棄用,v1.69.0 已移除(見上方 v1.69.0 一節與 docs/guides/deprecations.md):儀表板與 system.update_config 拒絕寫入,設定檔殘留值的處理見該節。AEE bootstrap 同形量測(include_holdout: false→true,繼承性預設非決策;舊快照單邊跳過自癒;反向驗證實錘第一輪 holdout 1.0→0.0 舊行為判 improves 提交)。agent_id 同族二期(ipc/trust_store 收斂、vault key 128→64、兩處過時註解誠實化)。web:SecretSourceField 憑證來源選擇器(四表單,env/keychain/file 引導組字+反解);任務詳情四分頁(產物/檔案/變更/過程,badge 計數、keepMounted 保狀態、needs_human 卡位置不變審批動線零增加)。B6 設計文件結論 SHELVED(commercial/docs/DESIGN-evolution-harness-knobs-2026-08.md:量尺自我認證兩難+樣本量 10³-10⁴/臂不可測;替代品 A1 離線 knob sweep/A2 旋鈕遙測/A3 clear_holdout_rotation 零呼叫端出口——A3 已 grep 實錘列欠帳)。
  • 第六波(2026-08-15,收官波):Agent Mail(mail.rs/mail_worker.rs+/mail 頁 newIn 1.60.0 雙導覽清單)——per-agent 信箱、入站 Gmail API/drop folder(<home>/mail/inbound/*.eml)、到達即觸發預設關且注入掃描標記信永不觸發、外發一律 ApprovalBroker 確認(mail_send 只建草稿回 pending_confirmation,實寄由 worker settle——broker 零修改所以三個既有決策入口自動全通)、信件內容雙路徑同一 DATA 圍欄、Scope::MailRead/MailSend 不可外部授予、跨 agent 過 delegation_policy、ledger mail/mailbox.jsonl 照抄 artifacts.jsonl 形狀;死碼 email.rs 接活;欠:原生 IMAP、channel-registry 整合、autopilot 事件、附件。preset P1(duduclaw-core/preset.rs+duduclaw preset CLI+agent create --preset)——綁定權威 preset_bindings.toml、agent.toml 唯讀鏡像、解析物化到 agent 目錄外 agent_resolved/(防自改繞過,R2b:agent_toml::load() 重導向讓 12 個已收斂 reader 自動吃到)、org 欄位帶值整包拒絕/敏感段靜默剝除、9 個部門 preset(premium);欠 dashboard 視覺卡。Code Mode Phase 0 量測閘(tool_loop_probe.rs+duduclaw cost tool-loop)——已於 2026-09-29 移除(wiki/reports/feature-audit-2026-09-29.md T3-S9):一次性決策工具,本機量測已產出 INSUFFICIENT_DATA,Code Mode 本身未立案;cost 子命令族(CostCommands enum)一併刪除。當時的 fact-check 結論保留為歷史紀錄(repo 有兩個同名 openai_compat.rs;compat 協定的顯式 cache 斷點是 byte-identical 空操作,CacheHint 序列化時結構性丟棄),設計文件 commercial/docs/DESIGN-code-mode-2026-08.md 檔頭已標 HISTORICAL。credentials async 化收尾(三路轉 async、網路 backend 全路徑可用、sync 版生產呼叫端清零;accounts.add 回歸測試補齊)+第 8 處 secret:// 洩漏修補(runtime/openai_compat.rs API 模式 bearer token 字面值)+潛伏地雷 key_vault.rs 整檔刪除(ciphertext 當 key 回傳、零呼叫端三重確認)。判官 seam 儀表板下拉(設定→自動化,使用者視角文案+external env 繼承在 guide 誠實揭露)。duduclaw evolution clear-holdout-rotation(A3 出口)+AEE 每輪快照 14 旋鈕進 aee_round 事件(A2,死 schema 接活);knob 快照 goal 結算半邊列欠帳。
  • 第八波(2026-08-16,credentials 收官):P2 零重啟輪換——帳號池寫入觸發 rotator 快取失效(claude_runner ROTATOR_CACHE invalidate-on-write 取代 5 分鐘 TTL;跨行程 CLI 直寫留 30 分鐘 backstop);Telegram poll_loop 每輪重解析 token(不再烤進 api_base);六 webhook 通道(feishu/whatsapp/wecom/dingtalk/googlechat/msteams)inbound 驗簽 per-request resolve 比照 line,outbound 衍生 token 保留 doctrine §2.4 TTL;Odoo set_global 改 disconnect_all+修 profile 變更孤兒 slot bug。仍需重啟:Discord/Slack WS 長駐。P3 env 擦洗——duduclaw-core/spawn_env.rs AGENT_CLI_ENV_ALLOWLIST 白名單 spawn env(濾除所有 *_API_KEY/*_TOKEN/*_SECRET/*_PASSWORD,vendor 金鑰改呼叫端顯式注入;型別層測試焊死無密鑰形狀名字;env -i 真 OAuth 活測最小集足夠),claude_runner/channel_reply/pty_runtime+oneshot(clear_env 參數)皆套;duduclaw-core/provider_env.rs provider→env 表 3→1 收斂;行為變更:白名單排除 SSH_AUTH_SOCK/GNUPGHOME(靠 SSH/GPG 的 git push agent 受影響,待拍板改 per-agent 授權);judge_mode env 繼承刻意不改(第五波文件化取捨,改需同步 goal-loop.md)。secret:// 收斂第二輪:account_rotator 2 處+mcp.rs 2 處手刻 decrypt 收斂 SecretRef(順帶修 Odoo 加密指標字面值外送洩漏)——至此殘留清單 #4-6 全清。
  • 第九波(2026-08-16,狀態同步+插件能力):runtime 狀態匯入 P0(duduclaw-cli/migrate_from/Codex.rs+claude_code_transcript.rs)——duduclaw migrate from Codex(含逐字稿,需 --agent)單向匯入 Codex 狀態:memory shard→semantic+SPO(store_temporal 冪等、valid_from=frontmatter modified)、AGENTS.md→agent wiki(layer=context 不佔注入預算、trust=0.3)、session 逐字稿→精簡對話+零 LLM 摘要(classify_line 噪音濾除只留 human prompt+assistant text,先對真實 ~/.Codex 實測才落碼——有效訊號僅約 1.5%);origin=import(trust≤0.7 強制、不偽裝一手觀察)、內容一律 DATA、redaction 預設開(--no-redact 關,general RuleEngine+secret_redact;shard 只套 secret_redact 免毀可用性)、skill 過 skill_security_scan;dry-run 真實活測 53 專案 1114 項、注入掃描正確擋可疑 shard、無 panic(未 --apply);欠:--apply/worktree .git 指標/dashboard RPC 接線/P1(skills·byte-cursor 增量·codex·gemini·antigravity·grok 平台)。設計全文 commercial/docs/DESIGN-runtime-state-sync-2026-08.md。plugin P2 通道能力表(channel_capabilities.rs)——11 通道×7 能力+進度節流單一權威表,收斂 10 處硬編節流字面值與散落的 file/photo/typing 支援判斷,不支援能力從靜默 no-op 改為 log_unsupported/debug_unsupported 留痕;保守用不變量測試鎖定與 decision_markup/channel_editable/typing 本體一致(不改寫本體);欠:handlers/goal_notify 的 gc/teams workaround(home_dir 分歧)、line.rs Step/ModelInfo 過濾缺口。Opus spawn 事故:第八/九波期間 Opus 子代理連續 spawn 即死(0 工具、數秒返回),實作全改 Sonnet 完成;設計文件 commercial/docs/DESIGN-roadmap-post-v1.60-2026-08.md 收錄七到九波路線圖與跨波拍板項。
  • 第十波(2026-08-16,收尾批):per-agent git 憑證授權([capabilities] git_credentials 預設 false)——合規恢復 git push/GPG 簽章:開啟才讓該 agent spawn 子行程額外拿 SSH_AUTH_SOCK/SSH_AGENT_PID/GPG_TTY/GNUPGHOME(spawn_env.rs per-agent 追加層+審計 git_credentials_env_granted 只記名不記值+真子行程 env toggle 活測),預設關與第八波逐位相同;揭露:授權=交出操作者完整 ssh-agent/gpg 身分(協定無更細粒度介面),故逐 agent 明確授權。+claimable_tasks 排除 archived、I-3c 共用 needs_human 重試補 note 欄(後端本就支援)、line.rs Step/ModelInfo 過濾缺口(discord 同缺記後續)、account_rotator provider 表收斂(三份收成兩份)。終驗 core 516/security 340/agent 199/gateway 5459/web 綠。
  • OS-native line (v1.42 → v1.65, absent from this overview until the 2026-09-29 audit) — four layers that turn the platform from "a gateway you talk to" into "a machine it runs on". (1) Perception & proactive care (duduclaw-os crate: watch.rs cross-platform filesystem watcher on notify-debouncer-mini with burst debouncing + sliding-window rate limiting and a re-derived Created/Modified/Removed classification, frontmost.rs, spotlight.rs, calendar.rs, notify_native.rs, open_target.rs; gateway side os_events.rs / os_frontmost.rs / os_intent.rs / os_operator.rs) feeds footprint memory, care checks and one-click automations — agent.toml [capabilities] os_native, deny-by-default. See docs/features/33-os-native-perception.md. (2) Appliance (duduclaw-sysd privilege-separated helper with its own protocol.rs/dispatch.rs/client.rs; gateway device.rs / device_about.rs / device_ops.rs / os_update.rs / pre_update_backup.rs / relay_device.rs / network.rs / power_local.rs / backup_restore.rs / migration_alert.rs, plus duduclaw-relay for the webhook relay). DeviceOps is the single place any device.* RPC decides an argv — handlers never spawn a subprocess directly. os_ops.rs is the single authority for the whole device/system os_* capability family (O16, 2026-09-29): the same ~20 capabilities used to be implemented three times — the agent-facing os_* MCP tools (duduclaw-cli::mcp_os_ops), the operator CLI leaves duduclaw os <group> <verb> (duduclaw-cli::os_drive), and the dashboard device.*/network.* RPCs. All three are now thin adapters that do exactly three things: their own permission gate, request parsing, response rendering. One pub async fn per capability performs the effect and returns the canonical payload; inputs are typed (PowerAction / WifiAudit / CheckUpdateOptions), errors unify into OsOpError which deliberately carries the original DeviceOpError / WifiError because the three surfaces render the same failure differently on purpose. Permission gates did NOT move — MCP's Scope::OsNative/Scope::Admin + [capabilities] os_native, the RPC's require_admin!() + require_appliance!() + require_confirm!(), and the CLI's operator-terminal identity + os_drive::approval::gate each stay at their own front door, because moving them would mean re-deriving three different authorization models. Tool names, command names, RPC names and every success/failure JSON shape are byte-identical; the two places the surfaces genuinely differed (the CLI's 序列化失敗:{e} vs MCP/RPC's <what> serialize failed: {e}; os_check_update's verbose system half vs the CLI's brief one) became named call-site options, not a second body. Deliberately not consolidated, with reasons in the module doc: the perception tools (os_notify / os_open / os_frontmost / os_spotlight_search / os_calendar_today / os_watch_status — single front door, duduclaw-os is already their authority), the dashboard-only os.* page RPCs, and system.apply_update vs os_apply_update(target="system") (the RPC trusts a URL pair cached in the live gateway's MethodHandler::pending_update, which a separate mcp-server process cannot read, so the tool re-resolves a fresh trusted pair — two mechanisms, same invariant). See docs/features/50-duduclaw-os-appliance.md and 51-os-keyboard-shortcuts.md. (3) Desktop edition & co-driving (codrive/ — a scripted GUI co-drive driver talking to the duduclaw-comp compositor's agent-injection socket over a hand-mirrored wire protocol locked down by serde shape tests, deliberately not a duduclaw_comp dependency; display_bridge.rs and audio_bridge.rs are the agent→display / agent→audio gateway bridges). Shadow workspace, human input always wins, explicit hand-back, co-driving off by default. See docs/features/52-desktop-edition.md. (4) The UI crates — duduclaw-shell (gpui desktop shell app for DuDuClaw OS), duduclaw-comp (smithay compositor, Linux-only, a detached workspace member excluded from the root workspace), duduclaw-native-gui (plain chat/management client), duduclaw-pets, duduclaw-desktop. The Yocto image layers live in the separate DuDuClaw-OS repo (2026-09 split, OS versioned independently at 0.1.0). Since 2026-09-29 the three gpui/smithay crates — duduclaw-shell, duduclaw-comp, duduclaw-native-gui — live in the DuDuClaw-OS repo's crates/ too: they were always workspace excluded detached crates with their own lockfiles and the main workspace never depended on them, so nothing here changed. duduclaw-pets / duduclaw-desktop stayed. In the same move the duduclaw compat subcommand family became cargo feature app-compat (cli + core, default off) rather than being deleted — DuDuClaw OS's shell spawns duduclaw compat windows-vm app at runtime, so the platform binary simply does not compile it and the OS recipe builds with --features app-compat (main-repo CI keeps one cargo check on the feature).
  • Shared Knowledge Base: Cross-agent wiki at ~/.duduclaw/shared/wiki/ for SOPs, policies, product specs. Wiki target classification (agent/shared/both), visibility control via wiki_visible_to capability. One tool set, two wikis (T5/O3, 2026-09-29): wiki_ls / wiki_read / wiki_write / wiki_search / wiki_stats / wiki_lint take a scope: "agent" | "shared" parameter (default agent, so every pre-merge call is byte-identical); the six shared_wiki_* spellings were deprecated aliases and were removed in v1.69.0 (not in tools/list; a call returns the replacement call, docs/guides/deprecations.md). Scope resolution is duduclaw-cli/src/mcp_alias.rs, fail-closed on an unknown token, and a scope argument can only narrow or select a wiki, never widen the caller's access. shared_wiki_delete and wiki_share keep their own names — shared_wiki_delete deliberately was NOT merged (no agent-local twin, so a wiki_delete scope="agent" would have added a destructive capability). .scope.toml SoT policy, wiki_visible_to visibility and the author-or-main-agent delete rule are unchanged
  • Autopilot rule engine: Event-driven automation built on a tokio::broadcast event bus (capacity 8192). AutopilotEngine subscribes to TaskCreated / TaskStatusChanged / ChannelMessage / AgentIdle / CronTick events, evaluates per-rule conditions (all/any + eq/neq/in/not_in/gt/gte/lt/lte/contains ops), and dispatches three action types: delegate (enqueue bus task for target agent), notify (send to channel), run_skill (invoke skill — skill name + target agent validated via alphanumeric allowlist + canonicalize() path containment). Rule CRUD is exposed via dashboard RPC (autopilot.list/create/update/remove/history) and agent-facing MCP autopilot_list; every CRUD call validates trigger_event, conditions and action structure at write time (cron_tick refused on create; empty conditions mean always-true, v1.67.1). Every execution appends to autopilot_history with status + error context. Three-state circuit breaker per rule (Closed / Open / HalfOpen) prevents self-reinforcing loops: 10 fires in 60s trips to Open (60s cooldown), then HalfOpen allows 1 probe; retry within the probe window re-trips, a quiet probe window returns to Closed. Transitions are logged to autopilot_history and the Activity Feed. MCP → engine bridge runs through SQLite events.db (WAL + monotonic auto-increment id + background prune at 7-day retention) — replaces the legacy events.jsonl file bus so there's no rotation race, no partial-line hazard, no permission concern.
  • Resident sensing (tick_config.rs / tick_source.rs / tick_source_poll.rs / tick_source_ws.rs / autopilot_screen.rs): external data streams — http_poll / command / file_tail / websocket, declared under config.toml [tick] / [[tick.sources]], default off — join the autopilot bus as a new AutopilotEvent::Tick (event_name() = "tick", also a legal CEP first/then name), one task per source with a per-source max_events_per_minute cap (floor 1s) and reserved-field-name/prefix rejection at config-load time (fail-closed per source, never aborts gateway boot); websocket is the one push-based kind (each text frame is a payload through the identical pipeline): ws/wss only, plaintext ws:// restricted to loopback while every other host must be wss:// and re-passes the shared web_fetch::validate_url SSRF gate scheme-mapped to https, optional ≤8×4KB verbatim subscribe frames, exponential reconnect backoff (start interval_secs, ×2, cap 60s, +≤25% jitter, reset after a ≥60s session), binary frames dropped and counted as non_text; every numeric extracted field automatically grows deterministic prev_<f>/delta_<f>/pct_<f> companions so a rule writes {"field":"pct_price","op":"gt","value":2} with no new condition operator. Recent observations live in an in-process TickHub ring buffer (256/source — ticks are NOT persisted to events.db by default; opt-in persist_every_n for an audit trail) that both the delegate wake-up prompt (context_ticks, default 10, cap 50) and an optional per-rule local-model screening layer (action.screen) read from. Screening is local-only (never escalates to cloud) and fail-open by default (unavailable/timeout/unparseable verdict → dispatch anyway unless on_unavailable = "drop"; verdict parsing strips edge ASCII punctuation from the first token before matching YES/NO). Dashboard: ticks.sources/ticks.recent RPCs feed a read-only "即時監控來源" card on the Autopilot settings tab; tick_events_total/tick_dropped_total/tick_screen_total/tick_wakes_total Prometheus counters. D5-W2 hardening: http_poll + websocket accept custom headers (≤8, transport-owned names and CR/LF-bearing values refused at config load; values never logged, never serialized — TickSourceConfig has a hand-written Debug and no Serialize, and ticks.sources exposes only headers_count); websocket gains an idle watchdog + client ping (idle_timeout_secs default 300 / floor 30, ping_interval_secs default 30 / floor 5, 0 disables either, idle > ping enforced — any inbound frame resets both clocks, an idle recycle redials immediately and is deliberately not counted as a drop); and every http_poll request plus every non-loopback wss dial re-resolves DNS at request time through the shared web_fetch::resolve_public_addrs (all resolved addresses must be public or the whole answer is refused, then pinned — reqwest resolve_to_addrs for HTTP, a TcpStream dialled at the vetted addresses with hostname-derived SNI for WS), which also replaced and hardened the single-address re-pin previously inlined in web_fetch_cached. Third live-fire round (real Kraken wss feed) corrected three pipeline defects: the D2 delta baseline is now per-field last-seen (prev_<f> compares against the last tick in which f actually appeared — wholesale map replacement let interleaved heartbeat frames erase it, measured at ~90% of ticks producing no delta); extracted numeric strings are coerced to JSON numbers ("63669.60000" → 63669.6, integers staying i64 — every mainstream feed ships string prices, so gt and the delta trio were silently dead; leading zeros / leading + / non-finite stay strings, and the coercion is confined to the tick extraction layer, never the global rule-engine number_pair); and a payload that resolves none of a source's configured json_fields is dropped as DropReason::NoFields rather than emitted as a field-less tick (checked before the rate cap so control frames cannot starve the emission budget; sources with no json_fields, and non-JSON payloads, keep the raw_len behavior). A fourth round added round6 to delta_<f> (it had only ever been applied to pct_<f>): float subtraction of two decimal prices leaves last-bit noise that, post-F2, reached rule comparisons and wake-up prompts directly and flipped thresholds like delta_price gt 0.1; prev_<f> stays verbatim (a reported value, not a derived one) and the integral path bypasses rounding entirely (round6 scales by 1e6 and stops being exact past ~9×10⁹). Two residual settings close the round out: per-source baseline_max_age_secs (default 3600, 0 = never) gives each field's delta baseline a shelf life — past it the baseline is forgotten, the observation reads as a first tick (no delta trio) and re-establishes the baseline, so a field that stopped reporting for a day cannot manufacture a giant fictional move; and global [tick] dns_ttl_secs (default 60, 0 = per-request) lets each source task reuse its already-screened address set for the TTL (lock-free, task-local, keyed host:port), which strengthens rather than weakens the rebinding defence — what is cached is a vetted public address set, and flipping an answer requires a fresh resolution. web_fetch_cached keeps its own semantics. Knob presets (T5/O15, 2026-09): [tick] preset = "conservative" | "aggressive" supplies defaults for the keys a source (or a rule's action.screen) did NOT write — max_events_per_minute 30/600, baseline_max_age_secs 900/21600, and on_unavailable drop/pass; presence is read from the raw TOML table (not from "the parsed value equals the default"), so an explicit key always wins even when its value equals the old default, an unknown preset is warned about and ignored, and omitting the key is byte-identical to before. The dashboard card shows the active preset; since v1.68.0 the [tick] settings and [[tick.sources]] are edited on Settings → Advanced → Automation → 常駐感知 (tick.sources.*, hot respawn). See docs/features/41-resident-sensing.md.
  • Odoo ERP bridge (duduclaw-odoo crate): JSON-RPC middleware supporting CE/EE, 17 MCP tools (CRM/Sales/Inventory/Accounting), EditionGate auto-detection, event polling + webhook. RFC-21 §2 (v1.11.0): per-agent credential isolation — agent.toml [odoo] overrides + OdooConnectorPool keyed by (agent_id, profile) replaces the v1.10.1 global singleton; new Scope::OdooRead/Write/Execute triplet plus allowed_models / allowed_actions (with write:crm.lead qualified-verb form) defence-in-depth filter; tool_calls.jsonl audit attribution carries profile + ok=bool so Odoo activity attributes to the originating agent. See docs/rfc/RFC-21-operator-guide.md for migration playbook. Test-before-save (v1.13.1): odoo.test RPC accepts inline params — when params include url/db/credentials the connector is built from the form values without touching config.toml; omitting the credential field falls back to the stored encrypted secret; inline-mode params go through the same SSRF / HTTPS / db-name validators as odoo.configure (cannot bypass safety rules); scrub_odoo_error() caps connector failure text at 240 chars before forwarding to the dashboard to avoid leaking HTML error pages or URLs with query strings. 事件同步接線(G4,2026-09 盤點):duduclaw-odoo 的 PollTracker::poll_model/classify_event/parse_webhook 自橋接上線起零生產呼叫端(沒有路由、沒有背景工作),而 OdooPage 照實把 poll_enabled/poll_models/webhook_enabled 寫進 config。新增 duduclaw-gateway/src/odoo_events.rs 補上缺的一半:背景輪詢工作(每輪重讀 config,儀表板改設定免重啟;用全域 [odoo] 憑證——OdooConnectorPool 在 duduclaw-cli,而 cli 依賴 gateway,方向上取不到,且 poll_models/poll_interval_seconds 本來就是全域鍵)與 POST /webhook/odoo(miniapp 式 always-mounted + 自我 gate)。兩條管道收斂到新的 AutopilotEvent::OdooEvent(event_name() = "odoo_event",同時進 cep_matcher::KNOWN_EVENT_NAMES 與 handlers::validate_autopilot_trigger_event),記錄的頂層純量欄位攤平供規則條件直讀,保留欄位名不可被覆蓋。Fail-closed:webhook 關 → 404、密鑰不符 → 401、空密鑰一律拒絕;輪詢需 poll_enabled + 已設定 + 至少一個合法模型名。OdooConfig::default().poll_enabled 與 OdooPage.tsx 預設一併由 true 改成 false(先前無消費者才無害)。
  • Identity Resolution (duduclaw-identity crate, RFC-21 §1, v1.11.0): IdentityProvider async trait with three impls — WikiCacheIdentityProvider (reads <home>/shared/wiki/identity/people/*.md), NotionIdentityProvider (Notion databases/query with configurable field_map), ChainedProvider (cache → upstream with graceful degrade on outage). identity_resolve MCP tool gated by Scope::IdentityRead returns canonical ResolvedPerson records. Channel reply auto-injects an XML-delimited <sender> block into the system prompt (resolved once per turn) so SOUL.md "reject non-project members" rules become evaluable from data instead of mid-reasoning shared_wiki_read lookups. G5(2026-09 盤點):channel_reply::build_sender_block 與 identity_resolve MCP 工具原本硬編 WikiCacheIdentityProvider(各自留著「之後的步驟再接」註解),只有儀表板 RPC 真的讀 [identity] provider——設定 Notion 的操作者會在儀表板看到 Notion 的答案,而每個 agent 只讀得到本地快取。三個呼叫點現在共用 duduclaw-gateway/src/identity_provider.rs::build_identity_provider,選擇 fail-safe(Notion 缺 database_id 或金鑰 → 降級回快取,不報錯)。RFC-21 承諾的 identity_list_project_members/identity_invalidate_cache 未實作、未排程,已在 docs/features/25 與 docs/rfc/RFC-21-identity-credential-isolation.md 標明。
  • Shared wiki SoT policy (RFC-21 §3, v1.11.0): operators drop ~/.duduclaw/shared/wiki/.scope.toml to declare which top-level namespaces (identity/, access/, policies/, ...) are owned by an external sync. Three modes — agent_writable (default, no change vs. v1.10.1), read_only { synced_from = "<capability>" } (only that capability may write), operator_only (never via MCP). Both shared_wiki_write and shared_wiki_delete honour the policy. wiki_namespace_status MCP tool exposes the active policy. Absent / malformed file ⇒ no policy, fail-safe.
  • Wiki ↔ memory boundary (v1.33, re-opened by WP5c v1.50): conversation distillation feeds two sinks. Ordinary conversational knowledge still lands in the memory system (temporal supersession); durable reference documents (charter / SOP / spec / policy) are auto-filed as agent-local wiki pages. The v1.33 ban on automatic wiki writes is lifted, with each of its three original objections answered structurally: ① duplication → single sink: the document's full text exists ONLY as the wiki page, memory keeps a ≤200-char pointer triple (subject = wiki:auto/<doc_type>/<slug>, predicate = documented_in) that store_temporal supersedes automatically; ② curation dilution → four locks (auto/{charter,sop,spec,policy,reference}/ is the only writable prefix; author: auto-distill + auto-distilled tag self-label every page — no new frontmatter key is invented because parse_wiki_page → serialize_page silently drops unknown keys; .scope.toml is consulted before every write and, unlike the shared-wiki fail-safe, an existing-but-malformed policy stops the auto write; layer: context keeps auto pages out of collect_by_layer_with_meta so they cost 0 bytes of the injection budget and human curation's injected bytes are unchanged — do_not_inject is deliberately NOT set, since WikiStore::search drops such pages and auto pages must stay findable); ③ no supersession → deterministic page key (resolve_slug validates an LLM slug against ^[a-z0-9][a-z0-9-]{0,63}$, else <doc_type>-<sha8(NFKC title)>), identical content is a no-op, different content overwrites and appends a revision-log line. Grading is knowledge_route.rs: L0 hard exclusions (too short / question / scan_input hit / fallback narrative), then a zero-LLM signal table (≥65 files, 30–64 asks the utility model via four extra fields folded into build_cloud_ingest_prompt_with_knowledge — parsed independently of the fact array so one malformed half cannot break the other, <30 memory path). It runs BEFORE classify_for_ingest and never reads the assistant reply, fixing the defect where a 2,000-char paste answered in eight characters was Skip-ed entirely. Circuit breakers: 20 auto pages + 20 grey-band arbitrations per agent per UTC day (auto_wiki_page::try_consume_quota, cross-process with_file_lock). Every gate degrades to the memory path, never to a failure. Curation station (KnowledgeCuration.tsx) gains a 自動建檔 audit tab — wiki.auto_pages / wiki.promote / wiki.archive / wiki.share RPCs; removal expires exactly that page's pointer via expire_by_subject, NOT invalidate_by_origin (which stays as the clearly-labelled nuclear option). The 待審知識 tab was removed from the station; the knowledge_quarantine approval backend is untouched (burst detection still produces items, released via the inbox). Unchanged from v1.33: session-stable wiki injection (15-min pinned selection + CACHE_SPLIT_MARKER), injection dedup (wiki wins over memory key facts), and .scope.toml knowledge_owner = "memory" excluding a namespace from injection; default = wiki-owned.
  • Per-agent model routing (SDK-first design): agent.toml [model] — preferred (Codex SDK model), local.model (local GGUF), local.use_router (confidence router), api_mode (cli/direct/auto), account_pool (which rotator accounts this agent may use). Hybrid routing: ① Local offload (Router-confirmed simple queries) → ② CLI + OAuth rotation (primary brain, subscription quota) → ③ Direct API + API Key (paid fallback, 95%+ cache via cache_control: ephemeral). account_pool wiring (2026-08): previously a serialized-but-unread setting (the dashboard picker wrote it, no backend consumed it). It now narrows the rotator candidate set — applied after the provider/health/cooldown/budget filters and before the strategy runs, so Priority/LeastCost/Failover/RoundRobin are untouched. Entries match account id or dashboard label (exact, trimmed, ASCII-case-insensitive — never substring, per coding convention 2). Fail-open: a pool that matches no available account (stale ids, all cooling down) logs a warn and falls back to the full set — a stale pool can never brick an agent. Empty/unset ⇒ byte-identical to before. Threaded through claude_runner::call_with_rotation (dispatch/cron/heartbeat/goal-loop), channel_reply::call_claude_cli_rotated + call_claude_cli_pty_rotated → rotate_cli_spawn_with_pool (all eleven channels), and RuntimeContext.account_pool → runtime/Codex.rs (multi-runtime choke-point + failover substitutions). Agent-less system callers (GVU/utility, night engine, dashboard widget & expert-pack generation) pass &[].
  • Multi-OAuth account rotation: OAuth sessions (Codex Pro/Team/Max via Codex auth status + CLAUDE_CODE_OAUTH_TOKEN env var for setup-token accounts) + API keys, with 4 strategies (Priority/LeastCost/Failover/RoundRobin), health tracking, rate-limit cooldown (2min), billing-exhaustion cooldown (24h), budget enforcement, token expiry tracking (30d/7d warnings). LeastCost prefers OAuth → API. Both the sub-agent dispatcher path (claude_runner::call_with_rotation) and the user-facing channel reply path (channel_reply::call_claude_cli_rotated → testable primitive rotate_cli_spawn) go through the rotator — fixes intermittent "Codex not found" errors that previously appeared when the single default OAuth session was cooling down. Channel replies classify failures (FailureReason::RateLimited / Billing / Timeout / BinaryMissing / SpawnError / EmptyResponse / NoAccounts / Unknown) and render category-specific zh-TW messages instead of the misleading "please run Codex auth status" hint. Structured failure records are appended to ~/.duduclaw/channel_failures.jsonl for dashboard surfacing. which_claude() / which_claude_in_home() probe Homebrew (Intel + Apple Silicon), Bun, Volta, npm-global, .Codex/bin, .local/bin, asdf shims, and NVM version directories so launchd-launched gateways discover the binary without PATH inheritance. Credential hardening (2026-09): health checks for token-bearing OAuth accounts and API-key accounts now run a real zero-cost probe (GET /v1/models) instead of trusting Codex auth status's loggedIn flag (true for any ambient token, valid or not) — 200 restores the account, 401/403 keep it dead, 429/network leaves it untouched; a confirmed auth failure parks the account in a new auth_dead state with exponential backoff (15min → 6h cap) replacing the old 3-strikes/2-minute flap, an undecryptable stored credential is excluded at load time as broken instead of spawning credential-less runs, accounts.add runs the same probe before saving (rejects 401/403/short-lived sk-ant-at01- access tokens), and an all-accounts-auth-dead condition fires a one-time Activity Feed + notification alert (and a one-time recovery notice) via duduclaw-gateway::auth_outage.
  • One-shot PTY invocation (duduclaw-cli-runtime crate): some CLIs (notably the Grok CLI) check for a TTY and refuse to run when stdout is a plain pipe. oneshot_pty_invoke / pty_runtime::invoke_oneshot spawns such a CLI under a real pseudo-terminal (portable-pty: ConPTY on Win 10 1809+, openpty on Unix) and drains stdout to EOF — one call, one process, no retained state. clear_env starts the child from an empty environment seeded only by the caller's allowlist (credentials doctrine P3, keeps the gateway's vendor *_API_KEYs out of a spawned agent CLI); deadline is an absolute wall-clock cap that force-kills the child. Callers: runtime/grok.rs and the duduclaw CLI-login helper. The PTY session pool was removed in 2026-09 — the long-lived sentinel-framed Codex REPL pool, duduclaw-cli-worker, worker_supervisor.rs, runtime_status.rs (GET /api/runtime/status), pty_default_migration.rs, RuntimeMode::PtyPool, agent.toml [runtime] pty_pool_enabled / worker_managed / pty_idle_timeout_secs / pty_interactive_timeout_secs, DUDUCLAW_DISABLE_PTY_POOL, and the pty_pool_* / worker_* Prometheus families are all gone (~8,000 LOC). Two reasons: the Anthropic programmatic-usage split it insured against was scheduled for 2026-06-15 and paused on the day, never resumed in the 15 months since; and pool sessions were keyed without a conversation dimension, so a multi-conversation agent bled context between conversations — it could never be enabled safely. Every agent now runs the fresh-spawn Codex -p path, which holds no CLI-side session state (per-turn context comes solely from get_messages(session_id), and session ids are per-conversation). If the split is ever re-activated, rebuild it with a conversation key in the session identity from the first commit; design notes survive in commercial/docs/runtime-pty-pool-design.md (marked HISTORICAL) and the removed code in git history at the v1.65 tag. See docs/features/27-pty-pool-runtime.md.
  • CostTelemetry: SQLite-backed token usage tracking with cache efficiency analytics (cache_read / (input + cache_read + cache_creation)), 200K price cliff warning, adaptive routing (auto prefer_local when cache_eff < 30%). MCP tools: cost_summary, cost_agents, cost_recent. 燒錢速率異常(D12,2026-09 盤點):cost_anomaly::detect() 的模組文件宣稱已接 notify 路徑,實際只有自己的測試呼叫。現在從 budget::check_agent_budget 接上,刻意放在 is_inert 短路之前——沒設上限的 agent 正是沒有別的機制會發現它燒錯錢的那一個。節流:每 agent 每小時一次 SQL(行程內 LAST_SCAN),每 agent 每 UTC 日一次告警(cost_anomaly_state.json,with_file_lock,跨重啟有效)。命中 → log + Activity Feed(cost_anomaly_detected)+ L1 goal_notify 推播,不阻擋任何呼叫。新增 CostTelemetry::daily_cost_series(帶日期標籤),因為 daily_cost_millicents 略過零花費的日子,用 last() 當今天會把舊的忙碌日誤判成今天。
  • Direct API client (direct_api.rs): Bypasses Codex CLI for pure chat, calls Anthropic Messages API with cache_control: ephemeral on system prompt → 95%+ cache hit rate. Singleton reqwest::Client with 120s timeout. Used as fallback when all OAuth accounts are rate-limited. Layered cache breakpoints: system prompt can be split via CACHE_SPLIT_MARKER into ≤3 independently-cached blocks (static / semi-stable) so a semi-stable change doesn't invalidate the whole prefix; call_direct_api_attributed(scope, …) hashes each cached block per agent:model stream and classifies every prefix invalidation (cold / none / system_block_N / layout) — cache_attribution_snapshot() tells you which block keeps breaking the cache, not just that efficiency is low.
  • Channel hot-start/stop: Dashboard channels.add immediately launches the channel bot; channels.remove aborts the running task. No gateway restart needed.
  • Local inference engine (duduclaw-inference crate): one InferenceBackend implementation — OpenAI-compatible HTTP (llama-server / Ollama / vLLM / SGLang / llamafile), configured via inference.toml [openai_compat] — since T5-O11 (2026-09-29) a thin shell over the shared duduclaw-llm compat provider, see the "Unified LLM provider layer" entry. The in-process llama.cpp (llama-cpp-2), mistral.rs (mistralrs-core) and MLX (mlx_lm subprocess) backends were removed 2026-09-29 (wiki/reports/feature-audit-2026-09-29.md T1-D2/D3, T3-S5): the release build never compiled any of them (release.sh passes neither metal/cuda/vulkan nor mistralrs), and llama.cpp's generate() was a stub that returned "not yet fully implemented". BackendType::LlamaCpp/MistralRs survive as parseable config values only — selecting one now fails with a message naming openai_compat. Hardware auto-detection and GGUF model management (~/.duduclaw/models/) are unchanged. MCP tools: model_list, model_load, model_unload, inference_status, hardware_info, route_query.
  • Confidence Router: Three-tier query routing (LocalFast → LocalStrong → CloudAPI) based on heuristic confidence scoring — token count, keyword complexity detection, CJK-aware token estimation. Configurable thresholds and keyword lists in inference.toml [router]. Router escalation: when confidence is low, automatically falls back to Codex API through the AccountRotator. Post-hoc logistic gate removed (2026-09-29): the [router] post_hoc_enabled / _alpha / _beta / _accept_threshold keys, ConfidenceRouter::evaluate_post_hoc/assess_post_hoc and InferenceEngine::assess_response are gone (wiki/reports/feature-audit-2026-09-29.md T3-S7). They were never fitted — with the shipped α 4.0 / β −2.0 / threshold 0.5 the "probability" was a fixed cutoff at mean logprob ≥ ln 0.5, and nothing ever persisted (p̄, g, accepted) next to an outcome label. UCCI is now the only calibration gate (see the UCCI bullet below); a tier with no UCCI router file simply accepts its local answer. Leftover post_hoc_* keys in an existing inference.toml are ignored.
  • UCCI calibrated cascade (duduclaw-inference/src/ucci.rs, experimental, opt-in via inference.toml [router] ucci_fast_router/ucci_strong_router/ucci_shadow_strong, all unset/false by default): an alternative to the Confidence Router's unfitted post-hoc gate above — wraps an external isotonic-calibration ucci crate (git-pinned) so LocalFast/LocalStrong can each carry an offline-fitted router file and escalate on top-2 token-margin uncertainty instead of g = sigmoid(α·p̄+β); a tier with a UCCI file escalates on top-2 token margin; a tier without one accepts its local answer (the legacy post-hoc gate it used to fall back to was removed 2026-09-29). scripts/ucci_fit.py/ucci_pair.py are separate, human-reviewed offline fitting tools — nothing in the gateway trains or refits automatically. See docs/features/57-ucci-calibrated-cascade.md.
  • InferenceManager: multi-mode auto-switching state machine with priority: llamafile → Direct backend → OpenAI-compat → Cloud API. Periodic health checks with automatic failover between modes. (The Exo P2P tier was removed 2026-09-29 — wiki/reports/feature-audit-2026-09-29.md T3-S4: no example config anywhere in the repo made it unreachable for users, and pointing [openai_compat] base_url at an Exo endpoint reaches the same cluster.)
  • llamafile manager (llamafile.rs): Subprocess lifecycle management for Mozilla's single-binary LLM inference — auto-start/stop, health monitoring, ready-wait polling, OpenAI-compatible API on localhost. Zero-install portable inference across 6 OS.
  • Token/prompt compression (gateway/prompt_compression.rs): budget-enforcement pipeline on the reply path — TurnTrim (per-turn 800/200-char tail trim; formerly HermesTrim) → DropOldestToolEchoes → BisectAndSummarize, cost-pressure aware, CJK-safe token estimation. (The former three-strategy compressor in the inference crate — Meta-Token/LTSC, LLMLingua-2 bridge, StreamingLLM — was removed in v1.33: it was reachable only via manual MCP tools and duplicated this live pipeline.) minimal_context spawn (第七波, [runtime] minimal_context default ON, env DUDUCLAW_MINIMAL_CONTEXT=0 / per-agent off-switch): every official-CLI spawn carries --tools <curated list> (CURATED_BUILTIN_TOOLS/DISPATCH_DEFAULT_BUILTIN_TOOLS in duduclaw-core/types.rs; capability-explicit wins, only-narrows) + --setting-sources project,local — measured 35,892→10,974 fixed overhead/spawn (~69%). Deliberately NOT --setting-sources "" (would disable the cwd .Codex/settings.json agent-file-guard hook; project,local saves the same tokens while keeping it). estimate_tokens was CJK-recalibrated (codepoint-classed, was chars/1.5 underestimating ~22%). The context-bloat motive behind the SHELVED oauth_direct path (commercial/docs/DESIGN-oauth-direct-llm-2026-08.md) is answered here at zero ToS risk; the second-biggest fixed cost was DuDuClaw's own MCP tool schemas, and O7 (2026-09-29) closed it: tools/list is now filtered by the caller's live capabilities against the same constants the dispatch gate enforces with (mcp_dispatch::{OS_NATIVE_TOOLS, RECORDING_TOOLS, SYSTEM_OPERATOR_TOOLS, CODRIVE_TOOLS, COMPUTER_USE_TOOLS, DB_SOURCE_TOOLS, FORK_TOOLS} plus [fork] enabled and PORTICO scoped_tools grants), so discoverable ⇔ callable — measured 215 tools / 120,092 bytes → 170 / 81,743 (−31.9%) for a scaffold agent when O7 landed; with the 241 ToolDef entries of v1.69.0 a scaffold employee's tools/list is 167 tools / 79,705 bytes. The old DEFERRED note ("hiding undeclared tools makes them uncallable") no longer applies: the server declares tools.listChanged and the stdio loop emits notifications/tools/list_changed when the caller's visible SET actually changes (5s poll, set comparison not mtime), so a mid-session grant/agent_update/agent.toml edit brings tools into view without a restart. Hiding is a discovery filter, never authorization — an unlisted tool call still hits the real gate and is still refused. Descriptions are capped at 200 bytes per tool and per parameter (one documented exemption: team_handoff.packet, the TaskPacket contract), enforced by mcp::tools_list_budget_tests — tool descriptions 51,822 → 33,944 bytes, parameter descriptions 31,604 → 27,120 across all 243 tools; long prose lives in docs/guides/mcp-tools.md. The 241 ToolDef entries (count re-derived 2026-10-04; 249 before the v1.69.0 removals) now live in crates/duduclaw-cli/src/mcp/tools_def/ split into 16 family files (re-derive the count with grep -rc 'ToolDef {' crates/duduclaw-cli/src/mcp/tools_def/ | awk -F: '{s+=$2} END {print s}').
  • MCP tools (inference): model_list, model_load, model_unload, inference_status, hardware_info, route_query, inference_mode, llamafile_start, llamafile_stop, llamafile_list.
  • Evolution external factors: User feedback, security events, channel metrics, Odoo business context, peer agent signals feed into prediction engine and GVU reflections
  • API key encryption: AES-256-GCM stored as base64 in config (all tokens including channel tokens)
  • Summarized-failure retry (context decontamination, arXiv:2605.08563): rotate_cli_spawn passes a deterministic one-line failure summary into the retry attempt after model-behavior failures (Timeout / EmptyResponse) via a <retry_context> block appended to the user message; infra failures (rate limit / billing / auth) keep the prompt byte-identical to preserve prompt cache. Zero LLM cost, synthesized from FailureReason — never raw stderr.
  • MCP HTTP/SSE Transport (W20-P1/P2, v1.9.4): duduclaw http-server --bind 127.0.0.1:8765 exposes Bearer-authenticated REST + SSE endpoints — POST /mcp/v1/call (single JSON-RPC tool call), GET /mcp/v1/stream (long-lived SSE event stream), POST /mcp/v1/stream/call (async + SSE result push), GET /healthz (no auth). Token bucket rate limit (OpType::HttpRequest, 60 req/min). mcp_sse_store.rs manages SSE connections with broadcast channels. Complements stdio transport for external HTTP clients.
  • Three-layer failover (gateway/failover.rs, v1.9.4, consolidated 2026-09-29 / T5-O1): one module tree answers "who takes over when this attempt fails" at all three scopes, with the boundary in a table in the file header instead of scattered comments — account (account_rotator's Failover strategy + cooldowns), model (failover::model, formerly the top-level llm_fallback module: hard timeout / 503 / 429 / "overloaded" → the agent's configured lighter fallback model, never on a billing error), runtime (FailoverManager::execute_with_failover, a different provider CLI). claude_runner's three sites now share one decision, FailoverManager::model_fallback_for(primary, fallback, error) — an associated function, since layer 2 holds no health state. The hard-deadline arm returns Err containing "hard timeout" so the fallback triggers reliably; UTF-8 truncation of the audited trigger error uses char_indices (no multi-byte panic at byte 512). A fourth mechanism, duduclaw-llm::FallbackRouter, was deleted in the same audit (zero production call sites).
  • Evolution Events system (gateway/evolution_events/, v1.9.4 expansion): 30+ event schema definitions (schema.rs +483 lines), async batch+retry emitter (emitter.rs +190 lines), query interface (query.rs 1685 lines), reliability guarantees (reliability.rs 324 lines). HTTP endpoints exposed via handlers.rs and surfaced in the Web ReliabilityPage.
  • LOCOMO memory evaluation (python/duduclaw/memory_eval/, v1.9.4 / W21): retrieval_accuracy / retention_rate / locomo_integrity_check modules, plus cron_runner — which is a manual CLI entry point (python -m memory_eval.cron_runner smoke_test|weekly_kpis|monthly_locomo), not a scheduled job: the repo ships no crontab, systemd timer, CI workflow or gateway task that invokes it, and the "daily 03:00 UTC" cadence its docstrings mention is an intended operator schedule, never an installed one (2026-09-29 audit). 5-minute smoke_test P0, build_golden_qa.py builds the gold-standard QA set from LOCOMO data, 200-entry data/golden_qa_set.jsonl first batch. duduclaw-memory engine adds batch query API for evaluation.
  • Python agents routing module (python/duduclaw/agents/, v1.9.4): capability-based agent routing — capabilities/ (manifest loader + matcher), routing/ (router + resolution + memory_resolver). MCP layer at python/duduclaw/mcp/: API Key auth with key masking, memory tools (store/read/search/namespace/quota) with strict scope enforcement at execute() entry (memory:write / memory:read — patches the v1.9.3 auth gap where any valid API key bypassed scope limits).
  • Discord Gateway hardening (v1.9.2): real op 6 RESUME — persists session_id + resume_gateway_url + sequence across reconnects (no longer issues fresh IDENTIFY every time). select! stall watchdog breaks if no traffic for 2× heartbeat interval (fixed 18-min silent zombie state). Heartbeat channel capacity 1→16 with try_send to avoid reverse-blocking. Op 9 Invalid Session reads d.bool to choose RESUME vs IDENTIFY with 1-5s jitter. Close codes 4007/4009/4003 clear session for fresh IDENTIFY. Backoff cap 300s→60s. Handles RESUMED dispatch.
  • Heartbeat task-board pull is now scheduler-level (v1.9.3): poll_assigned_tasks moved out of execute_heartbeat (which only ran for enabled=true agents — 16 of 17 production agents had enabled=false and never received task-board pulls) into HeartbeatScheduler::run tick body. Scans entire agent registry every 30s; existing 1-hour LIKE-marker cooldown prevents stampedes.
  • 2026-09 功能盤點淘汰批(P3b):一次移除十一項零呼叫端/零出貨/零文件的面。duduclaw-docuseal-mcp(727 LOC,單一 commit、release.sh 不建它、DocuSeal 自 2026-03 有官方 MCP server → docs/guides/docuseal.md 改為掛官方 server);duduclaw export --format agentcompanies(export_to.rs 1,328 LOC,paperclip 路線兩度轉向後無消費者;匯入方向 migrate from paperclip 保留);Git worktree L0 隔離(gateway/worktree.rs 1,151 LOC + [container] worktree_* 四鍵,預設關、零出貨板模啟用,goal loop 主線走 message_queue 根本不經過它;並行隔離剩 L1 容器沙箱);duduclaw auth device --provider qwen(上游 2026-04-15 停掉免費 OAuth,模組自標 PENDING-LIVE;Copilot 座位保留,proxy 端既有 qwen 座位仍可刷新轉發);metrics.rs 六條從未遞增的序列(duduclaw_requests_total / tokens_total / request_duration_seconds / active_sessions / channel_connected / budget_remaining_cents — 建在上面的 Grafana panel 顯示的是恆為零而非系統閒置;逐請求成本改看 cost_telemetry.db);license features.toml 三個零讀取端 quota 欄位(max_local_models / max_messages_per_month / office_hour_hours_per_month);MCP log_mood(描述四個字,語意與 user_profile_record 重疊);一次性 CLI ops tunnel / ops memory bench / rl export|stats|reward(reforward 與 evolution clear-holdout-rotation 改 --help 隱藏而非刪除——後者是唯一能清 AEE holdout_rotation_due 旗標的東西);前端孤兒 _WipPlaceholder.tsx 與 ApprovalsPage.tsx(/approvals 早已重導 /inbox,卡片邏輯已被 ApprovalRequestCard 完整抄走);殘留腳本 scripts/build-release.sh / build.sh / smoke-pty-pool.*。另 license feature flag 分家(行為變更):FeatureGate::check() 現在一律拒絕八個零行為的「服務承諾」布林(dashboard_enterprise / priority_security_patch / private_discord_support / odoo_integration_supported / redistribution / dedicated_engineer / cloud_only / self_host_only),顯示改走 FeatureGate::service_commitment();真正的能力閘只有 premium_templates / white_label / industry_evolution_params 三個。templates/orchestrator/ 與 templates/KILLSWITCH.toml 移到 docs/examples/(零程式引用,只能手動複製,擺在 templates/ 會讓人以為會自動生效)。
  • Deprecation policy (T5, 2026-09-29): a renamed/merged public name survives two minor versions. Everything deprecated in v1.66.0 was removed in v1.69.0, except the Gemini CLI runtime (v1.70.0) and the legacy pack manifests (no version set); see the v1.69.0 block. Signals per surface: an MCP tool keeps its tools/list entry and stays callable, with [deprecated → <new tool> <param>] prefixed to its description and deprecated: true on its duduclaw_core::tool_catalog row (hiding a tool from tools/list makes it uncallable, which is the opposite of what a deprecation window is for); a CLI subcommand becomes a clap hide = true alias (gone from --help, still parsed); a config.toml value still parses and warn!s once per process, plus an audit event when written through an RPC; the dashboard offers only the new name but keeps a saved deprecated value visible and labelled. The complete old→new table is docs/guides/deprecations.md (three languages).

Design Context

Users

DuDuClaw is a Multi-Runtime AI Agent Platform for individual developers and power users, primarily in Taiwan (zh-TW). It supports Codex / Codex / Gemini CLI (deprecated) as interchangeable AI backends. Users interact through a web dashboard to manage AI agents, monitor channels (LINE/Telegram/Discord/Slack/WhatsApp/Feishu), track API budgets, and observe agent self-evolution. They expect a tool that feels like a trusted companion — not a cold enterprise console.

Brand Personality

Professional · Efficient · Precise — with a warm, approachable surface.

Like a skilled engineer who happens to be your close friend: reliable, sharp, but never cold. The paw print (🐾) icon reflects a pet-like companionship — the AI is loyal, attentive, and delightful to interact with.

Aesthetic Direction

  • Primary references: Codex.ai (warm sand/beige tones, generous whitespace, soft typography) + Raycast (macOS-native polish, frosted glass effects, refined dark theme)
  • Anti-references: Grafana (too dense), Discord (too playful), enterprise dashboards (too cold)
  • Color palette:
    • Primary: warm amber (amber-500 / #f59e0b) — evokes warmth and trust
    • Accent: soft orange (orange-400 / #fb923c) — for highlights and CTAs
    • Surface light: warm stone (stone-50 / #fafaf9) with subtle warm undertones
    • Surface dark: deep stone (stone-900 / #1c1917) — warm dark, not cold blue-black
    • Success: emerald, Warning: amber, Error: rose — standard semantic colors
  • Theme: Follow system preference (auto dark/light), with manual toggle
  • Typography: System font stack for performance; generous line-height; larger body text (16px base)
  • Border radius: Rounded (0.75rem default) — soft, approachable
  • Spacing: Generous padding — the interface should breathe
  • Motion: Subtle fade-in/slide transitions (150-200ms); respect prefers-reduced-motion
  • Glass effects: Subtle backdrop-blur on sidebars and overlays (Raycast influence)

Design Principles

  1. Warmth over sterility — Every surface should feel inviting. Prefer warm neutrals over cold grays. Use color strategically to create emotional connection.
  2. Clarity over density — Show what matters, hide what doesn't. Progressive disclosure: summary first, details on demand. Never overwhelm.
  3. Real-time without anxiety — Status indicators should inform, not alarm. Use gentle transitions for state changes. Green means "all is well" and should be the dominant state color.
  4. One binary, one experience — The dashboard is embedded in the Rust binary. It should feel native and instant, like a local app, not a remote web service.
  5. Accessible by default — WCAG 2.1 AA compliance. Semantic HTML. Keyboard navigation. Respect motion preferences. Sufficient color contrast in both themes.

Coding Conventions (security-relevant, from 2026-06 deep review)

These conventions exist to prevent classes of bugs surfaced by the 2026-06 whole-project review. Shared helpers live in duduclaw-core.

  1. Never slice strings by raw byte index. &s[..n] panics when n lands mid-char on multi-byte UTF-8 (any CJK/emoji input). Use duduclaw_core::truncate_bytes(s, max_bytes) (byte budget, walks back to a char boundary) or truncate_chars(s, max_chars) (codepoint count). Applies to every channel/log snippet and id prefix.
  2. No unanchored contains / starts_with for security or routing decisions. Substring checks let http://localhost.evil.com pass a localhost allowlist and the keyword hi match inside this. Use duduclaw_core::origin_host_matches(origin, &allowed) for Origin/CORS allowlists and word_contains_ci(haystack, needle) for keyword matching; use exact/token equality for id routing.
  3. Cross-process file appends must hold an advisory lock. Shared JSONL (bus_queue.jsonl, audit logs) is appended by both the Rust gateway and Python adapters; records over PIPE_BUF interleave and corrupt lines. Wrap the write in duduclaw_core::with_file_lock(path, || …).
  4. Security gates fail closed. Missing config, a detection error, or an unenumerated tool/method must DENY, never fall through to allow. MCP authorization is enumerated explicitly; any tool not in the scope table defaults to requiring Admin scope. Validate the artifact that actually takes effect (the written patch.content, the final screenshot), not just the proposal/narrative.

Documentation Classification & Placement (from 2026-06-20 doc reorg)

Every document (.md, design notes, reports, specs) MUST be filed by TYPE × CONFIDENTIALITY. When creating or moving a doc, pick the matching cell below — do not drop loose files at a tree root, and never co-locate a higher-confidentiality doc inside a lower-confidentiality tree.

Confidentiality tiers (3 levels)

TierMeaningGit stateLives in
L1 PublicProduct / developer docs intended for the public repo, website, npm/PyPI READMECommitted, externally publishedroot README*.md, CHANGELOG.md, ARCHITECTURE.md, SECURITY.md, LICENSING.md, docs/, templates/, marketing/press-kit/
L2 InternalDev/ops material — committed but not product-facingCommitted (visible to repo collaborators), not polished docswiki/ (knowledge base + reports), team/, ISSUES.md, marketing/{blog,social-templates,threads-drafts}/
L3 ConfidentialCommercial plans, competitive analysis, pricing, research notes, secrets, build outputgitignored — never committed to the public repocommercial/ (own nested git), research/, artifacts/, .env*, anything under a secret manager

Hard rule: L3 lives ONLY in gitignored trees. Before committing, confirm no commercial/, research/, pricing, or secret content is staged. commercial/ and research/ are in .gitignore; if git ls-files <tree> ever returns rows, untrack them with git rm --cached -r <tree> (files stay on disk).

Type taxonomy → canonical home

L1 Public — docs/ only (one subdir per type, never loose at docs/ root):

  • docs/architecture/ — system architecture & engine design (overview.md, evolution-engine.md)
  • docs/rfc/ — Request-for-Comments proposals (RFC-NN-*.md, plus their operator guides)
  • docs/adr/ — Architecture Decision Records (ADR-NNN-*.md)
  • docs/todo/ — public planning / tracking (TODO-*.md)
  • docs/spec/ — open format specs (SOUL.md, CONTRACT.toml, JSON Schema)
  • docs/features/ — feature deep-dives (+ ja-JP/, zh-TW/ translations)
  • docs/guides/ — user & developer how-tos (deployment, development, docker, MCP tools)
  • docs/api/ — protocol / OpenAPI reference

L2 Internal — operational, under wiki/ (single report home) + team/:

  • wiki/reports/tl-daily/<YYYY-MM-DD>.md — daily reports (date-only filename; never daily-report-* and never in docs/, reports/, or artifacts/)
  • wiki/reports/skill-pipeline/<YYYY-MM>/, wiki/reports/memory-quality/<YYYY-MM>/ — automated pipeline/eval outputs
  • wiki/sprint-reports/, wiki/pm/ — sprint logs & PM tracking
  • wiki/duduclaw-kb/{architecture,decisions,specs,drafts,w19,sprint-n}/ — internal knowledge base
  • wiki/{eval,impl,research}/ — evaluation sets, implementation notes, internal design feedback
  • team/ — team roster & role docs

L3 Confidential — gitignored trees (do NOT add to docs/ or wiki/):

  • commercial/docs/ — business plans, pricing, competitive analysis, SI methodology, commercial design docs (e.g. PTY-pool design, runtime TODOs)
  • research/ — AI paper / repo research notes (auto-mirrored to the shared wiki at runtime)
  • artifacts/ — build output (tarballs, generated bundles)

When in doubt

  1. Is it secret / commercial / competitive / a research note? → L3 gitignored tree. Stop.
  2. Is it a daily/sprint/eval/PM report or internal KB? → L2 under wiki/ (reports → wiki/reports/…).
  3. Is it polished product/dev documentation safe to publish? → L1 under the matching docs/<type>/ subdir.
  4. Update docs/README.md (the public index) whenever a docs/ file is added, moved, or removed; update in-repo links (READMEs, AGENTS.md, code comments, CONTRACT.toml) in the same commit.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.