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.
- CLAUDE.mdCLAUDE.md
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
- Very specific: line 7
Before starting a feature or a fix, create a branch from the latest origin/main (feat/…, fix/…, docs/…, chore/…).
- Distinctive: line 9
When another session is using the main checkout, work in a separate git worktree instead of switching branches there.
- Distinctive: line 10
When several open PRs touch the same files, merge them in the order the owner gives.
≈ “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.
Files
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 onmaindirectly. - The change reaches
mainthrough a pull request.mainrequires 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 worktreeinstead 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 writestrustedWorkspacesinto~/.gemini/antigravity-cli/settings.json(merge_user_settings,ensure_user_settings) now also appendstool_grants(user_home)topermissions.allowthroughensure_allow_rules:MCP_TOOL_GRANT(mcp(duduclaw/*)) andschema_read_grant(home)(read_file(<HOME>/.gemini/antigravity-cli/mcp/duduclaw), because agy loads MCP tools lazily and the model must read<tool>.jsonthere first; both spellings whenHOMEcanonicalizes to another path). No rule for commands, file writes or URLs, and the argv is unchanged (never--sandboxtogether 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'sallow/deny/askentries are kept; a non-objectpermissionsor non-arrayallowis left untouched and surfaces asMergedSettings::grant_issue/SettingsOutcome::grant_issue(warn, appended to any failure bywith_grant_note); trust andmodelProviderare 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
duduclawserver's tools and that schema directory; rules are only added, never removed (editpermissions.allowby hand); two gateways under one OS user write identical rules. - Errors (
runtime/antigravity.rs):denial_summaryturnsresult.denied_actionsinto a sentence naming the refused tools; a non-SUCCESS status leads with it and keeps agy'serrortext as secondary detail (a retried 503 used to mask the denial);exit_failure_messagedoes the same for a non-zero exit (stream_denial_summaryplus stderr); an empty reply with a denial is anErrinstead 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 throughredact_then_cap(redact, then cap) and the key-awareparse_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(usewiki_*withscope="shared"),schedule_task(usetasks_createwithschedule) andskill_bank_search(useskill_searchwithsource="bank") are no longer declared, so they are gone fromtools/list; a call returns a tool error naming the replacement call.DEPRECATED_MCP_TOOLSis empty.shared_wiki_deleteandwiki_sharewere never aliases and stay. The tool count went from 249 to 241. What a removed name left in an employee'sagent.toml [capabilities]list does:allowed_toolsentries 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_toolsandconfig.toml [provenance] sensitive_toolskeep gating the call that replaced the name (tool_catalog::removed_name_for_call:wiki_*withscope="shared",tasks_createwith a cronschedule,skill_searchwithsource="bank"), checked at the MCP dispatch gate (mcp_dispatch.rsdenied and scoped gates,mcp/approval.rs::static_gate_flagsfor 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--disallowedToolsflags fordenied_toolsandscoped_toolsare 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 floodtool_calls.jsonl.duduclaw doctorhas a row for removed names (removed_mcp_tools_checkinduduclaw-cli/src/lib.rs, backed bymcp_alias::scan_agent_dir_for_removed_tools/scan_config_for_removed_tools): it reads each employee's[capabilities]lists, the root prompt files, Markdown underSKILLS/andwiki/, andconfig.toml[provenance]and[[ccr.allowed_sources]]; it does not read prompt text in cron tasks and automation rules,evals/or playbook tool assertions,.mcp.jsonor 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-serverandexpert installstay 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) driveduduclaw pack install. - Judge modes removed (
duduclaw-gateway/src/judge_mode.rs,JUDGE_MODES_REMOVED_IN):[dispatch] judgeaccepts onlymav(default) andexternal;system.update_configand the dashboard refuseevaluator_only/human_only(and the aliasesevaluator/human). A value still inconfig.tomlis recognised on read:evaluator_onlyis judged asmav;human_onlydoes not fall back to machine acceptance, every task sent for acceptance parks atneeds_humanwith 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 topending, 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; thejudge_mode_removedaudit 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_deprecatedis no longer produced.duduclaw doctorrowremoved_judge_mode_check(judge_mode::check_removed_judge_mode_in_home):human_onlyis a Fail,evaluator_onlya Warn, and aconfig.tomlthat cannot be read or parsed, or a non-stringjudge, a Warn saying the check could not be made. Employees that need human gating use[capabilities] autonomy_levelandapproval_required_tools. - Not removed, and no longer listed as deprecated:
duduclaw data-migratestays as a hidden alias ofduduclaw migrate databecause shipped DuDuClaw OS images runduduclaw data-migrate --runfrom a boot unit on a read-only root filesystem; the three bare formsduduclaw migrate,duduclaw export --out …andduduclaw acpare documented behaviour;duduclaw expert liststays (it lists the installed records and is not an alias ofpack list);preset.tomlis 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 apack.tomlonly whenkind = "preset"; apack.tomlteam or template pack is read and then handed to the expert pipeline, whoseexpert/detect.rs::detectrecognises onlyexpert.toml, a Claude Code plugin or a lone Agent Skill, so it cannot be installed.docs/guides/build-your-own-pack.mdtherefore tells authors to keepexpert.tomlfor 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_postwithtask_id/update_cron_task/delete_cron_task/pause_cron_task/run_cron_task/create_reminderresolve aRecordActoronce per call (record_actor_for→RecordActor::resolve, which callsmcp_memory_handlers::ai_employee_callerdirectly and adds two rules: the employee id is the resolveddefault_agent, and any process withDUDUCLAW_AGENT_IDset is an employee):Operator= a key mapping to no AI employee in a process with noDUDUCLAW_AGENT_ID(unrestricted); otherwiseAgent(id)— the internal key with no env identity acts asgateway-internal, which owns nothing, and a process withDUDUCLAW_AGENT_IDis 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 atool_calls.jsonlrow withreasonowner_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_updateandactivity_postalso 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'sagent_id(default→ main agent); reminder =agent_id(omitted = caller). Cron tools addressed bynameact 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_agentturnsdashboard/cron/goal-loop-driver/heartbeat/autopilot/webhookintoUNTRUSTED_AGENT_IDand writes onetool_calls.jsonlrow per process (mcp_identity, reasonsystem_sender_identity,claimed,sourceenv/config);check_actor_identityrefuses them too. As long as no employee is named after one, the gateway never stamps one (employee ids are directory ids; the MCPcreate_agenttool, the dashboard and theduduclaw agent createCLI 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/descriptionof agoal_modetask (joinsacceptance_criteria, auditgoal_contract_frozen), nor add / remove / reorder the control tagsoutcome:*,grant:*,auto-researchon any task (RESERVED_TASK_TAG_PREFIXES/RESERVED_TASK_TAGS, auditreserved_tag_change);tasks_createrefuses them intags(the server-built goaloutcome:tag is unaffected). agent_updateself-authority guard: an AI employee sendingreports_to/db_sources/db_sources_add/db_sources_remove/budget_cents/roleabout itself is refused whole (SELF_AUTHORITY_PARAMS, auditagent_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 andHOME_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 envelopecwd.agent_hook_installerbakes--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 noDUDUCLAW_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_homeorder:--home→ no claimed id (operator) ⇒duduclaw_home()→ explicitly set absoluteDUDUCLAW_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-changeduduclaw/duduclaw-probinary rejects--homeas 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 becomesWrite|Edit|MultiEdit|NotebookEdit|Bash(notebook_pathjudged likefile_path). Existing-but-unreadableagent.toml/config.toml/.mcp.json⇒ refused (was treated as a new file). - Own
agent.tomlfreeze, allow-list (AGENT_EDITABLE_SECTIONS/AGENT_SECURITY_KEYS,BlockedAgentSecuritySection; agent and untrusted callers only; the installed hook command always carries--agent, so an operator runningclaudeby 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 inorg_field_guard/rules.rsmay 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_poolstay 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 descriptiondocs/features/05-security-defense.md): the command is shell-unescaped first (line continuations, backslashes, quotes; redirects to/dev/nulland fd duplication such as2>&1are not writes; redirecting output and errors together into a file is). For agent/untrusted callers a "protected home target" (home outside the own directory andattachments/, 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_COMMANDSskip 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 andattachments/are refused even for reads. Relative paths resolve against the envelopecwd(else the own directory),cd/pushdfollowed; 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;cdinto 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;Readis not covered; non-Claude runtimes do not run the hook; the own directory's state files and the sharedattachments/are not protected. - Belief calibration, verified only (
prediction/belief.rs): onlysettle_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_settlepasses notick_price; no gateway-side TickHub settle path exists), so every settlement today is a self-report andcalibration_statusreadsno_verified_settlements. Breaking:belief.summary({stats}) andbelief_statsreturnn_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_settleaddscounts_toward_calibration(+notewhen 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 whoseDUDUCLAW_AGENT_IDis proven byDUDUCLAW_AGENT_TOKEN(HMAC overidentity.key, written into.mcp.json;verified_employee,Verifiedverdict 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-servernever inherits process identity (verified_agent: None); a per-agent key whose client id hasagents/<id>/agent.tomlmaps to that id; external keys unchanged. Pre-upgrade pool rows are not moved: hidden operator CLIduduclaw memory migrate-namespace {list,export,assign,archive}(memory_namespace_cmd.rs, engine sideduduclaw-memory/src/engine/namespace_migration.rs) refuses AI sessions, attributes rows fromtool_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,archiveexpires leftovers taggednamespace-archived, auditmemory_namespace_migrated. [permissions]enforced (mcp_dispatch.rs::permission_for_call): explicitfalseoncan_create_agents/can_send_cross_agent/can_modify_own_skills/can_schedule_tasksrefuses the mapped tools (-32003, auditpermission_denied; tools stay intools/list); absent/wrong type allows, unreadableagent.tomlrefuses. One-time boot migrationagents_update_v168::migrate_all_agent_permissions(fromMethodHandler::with_extension):[permissions]withoutpermissions_enforced_sincegets everyfalseof the four settruepluspermissions_enforced_since = "1.68.0"(auditpermission_flags_reset);agents/.ephemeral/skipped so role members keep theirfalses. Scaffolds/templates writetrue.- Dashboard surface:
system.update_configaccepts the v1.68 keys inhandlers/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 returnsrestart_required[];PROTECTED_KEYSchanges auditconfig_protected_key_changed. Writes refuse an unparsableconfig.tomland go throughhandlers/config_commit.rs(file lock + content-hash compare).agents.updatewrites only received fields (heartbeat cron no longer cleared;agents.inspectreturns it), authority keys ([agent] reports_to/department/name, all[capabilities],sandbox_enabled,network_access,can_modify_own_soul) admin-only with auditagent_authority_changedon success andagent_authority_refusedon a refusal,org.tomlupsert only on a real change, typedadvanced_kvvalidated asAgentConfig. 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_hashconflict; backup<file>.bak-<ts>(5 kept, 0600); auditconfig_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, unlessRUST_LOG);[logging] format = "json"read at init (restart). Webhook channels hot-mount:webhook_slots.rskeeps/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.addfills the slot without a restart and returnsrestart_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,nulldisarms, mtime re-read; cost → global L2, replies/min per conversation drop, consecutive errors / error rate → failsafe +1; auditkillswitch_trigger);redaction_sources.rs(user_input,system_prompt,cron_context;purge_after_expire_days→ vault GC); Discordagent_overrideglobal fallback andthread_archive_minutes; Telegram/LINE voice viastt::transcribe_channel_audio([voice] stt_*, env Whisper only when unset); Feishu/DingTalkmention_only/allowed_channels; accounttags(+account_pooltag match); branding subtitle;[identity.notion] refresh_seconds;graph_embed_seedin employee recall; Odoofeatures_*(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; nowchat_commands::handle_command_for_sender→is_channel_admin(globaladmin_users, exact, none = nobody); WebChat admin = active dashboard Admin account (webchat_command_admin). Admin token:resolve_admin_auth_tokenreadsauth_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_layersfrom the edit page, sticker/stagnation cards,skill_security_scan/skill_auto_activatetoggles, containercmd/env/mounts/readonly_project/max_concurrent,token_budget_per_check,check_interval, per-agent LINE/WhatsApp/Feishu/WeCom/DingTalk credentials, redactionsub_agentrow, KILLSWITCH[audit],[secaudit]parser, MemGPT leftovers,[task_forward_model] cold_start_llm/min_samples/mature_n,ApprovalModal.tsx(browser.respond_approvalnever had a handler). - Known gaps: other settings RPCs still use the lenient
read_config_table; dashboardsystem.doctorcontainer row still uses the old Docker check; clearing a llamafile field in the UI does not remove the stored value;WebChatWidgetCardreads awebchat_widget_key_setfield 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 analysisresearch/harness-2026-08/cloudflare-security-audit-skill-2026-10.md, Cloudflare security-audit-skill, MIT, schema-level reference only):duduclaw_core::llm_contractholds six primitives,strict_json(one JSON value or the whole reply is discarded, never patched),safe_path(SafeRepoPath),fingerprint(stableroot_fingerprint,canonical_id),coverage(unit status table,RunStatus/IncompleteReason),severity(anchors, overall<=impact) andvisible_text.duduclaw secauditv2 (schema_version2, all additive): AI candidates carry a six-slotthreat_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) andline/trace[].linemust 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 giveblockers+validation_planforplausible, and may returncorrected_line/corrected_tracewithplausiblewhen the defect is real but the location is off (re-checked against the repo before being applied; id androot_fingerprintunchanged; evidenceverifier_corrected: line 10→14;refutedmeans the claimed defect is not there), every ranked module gets acoverageentry (covered/candidate/deferred/unreadable/llm_failed/parse_failed, the first failed LLM call defers the rest asengine_unavailable),run_status/incomplete_reason, prior-report carry-forward byroot_fingerprint+file_hash(--no-prior; unreadable or v1 newest reports are skipped), andvalidator.rsruns before any write (violation => exit 2;duduclaw secaudit-validate <report.json>exit 0/1/2). D1=B: NeedsHuman carriesseverity_basis = model_self_reported, is counted inneeds_human_by_severityand does not fail--fail-onunless--fail-on-needs-human(then merged intoby_severity); D2=B:--verifier-agent <id>andverifier.independence(same_agent/different_agent/not_run) in the report and dashboard; dashboard review writes anoperator_reviewevidence item,severity_basis = operatorand recomputes the counts. Security fix G1 (released versions affected,--profile deep): a model-returnedfilewas 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 passSafeRepoPathfirst. Red-team v2 (duduclaw-gateway/src/redteam.rs,duduclaw test,duduclaw redteam): eleven techniques x en/zh-TW x eachmust_notrule form a coverage ledger; input guard blocked =>covered, not blocked =>status: "blocked"/reading: "needs_live_validation"(待活體驗證, not a vulnerability), reportschema_version2 with aredteamobject,--emit-evals <dir>/--locale/--forcewrite oneduduclaw evalcase per unit needing validation. Live run on the restaurant template: 154 units, 14 covered (allinjection), 140 eval cases (70 covered / 84 cases after the WP-G3 input-guard families, see below). Next wave: goal loop adoptsllm_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 docsdocs/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 allm_contract::strict_json::parse_strictpath indispatch_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 incrementsjudge_parse_shadow_total{parser,outcome}and a disagreement writes auditjudge_parse_shadow_mismatch;enforcemakes strict authoritative and a violation takes the parser's existing fail-closed path;offis byte-identical to before; a judge built with no home dir (stub judges) resolves tooff. Flipping the default toenforceneeds >=50 judge rounds or 7 days withstrict_rejects<2%, decided by the operator, never automatic.input_guardgains 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_bindingnever 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_escalation14/14, the other six techniques 0/14, 84 eval cases), starter bank benign probes 5/5 allowed,system_prompt_extractionandencoding_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), allagree, 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 induduclaw-gateway/src/goal_loop/criteria_ledger.rs(ledger_for_new_goalis the single creation point):config.toml [goal_loop] criteria_ledger = off | report | enforce, defaultreport, read per round; handlesC1..Cnare system-numbered from the frozenacceptance_criteria_baselinefor goals created from the dashboard, MCPtasks_create kind="goal", chat/goaland 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 auditcriteria_status_invalid);reportgives the judge the self-report as reference only,enforcerequires 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 criteriacovered; a goal with one unachievable criterion had the worker mark itblockedwithout fabricating a result and went toneeds_human(blocked_needs_decision). Not yet exercised live:enforceverdicts, the needs-human channel card summary, a chat/goalledger. - Post-v1.68.1 debts (unreleased, 2026-10-03): (1) config writes keep the operator's formatting:
handlers/config_commit.rs::render_preservingedits the on-disk text withtoml_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 awarn!), used bycommit_table_locked(system.update_config,tick.sources.*, the voice-config HTTP endpoint, which also gained the lock + hash compare) andwrite_config_table(every other settings RPC, alsoinference.toml), plussecurity_rpccredential cleanup andmcp_internal_keyrotation; writers behindwrite_config_tablestill have no lock/hash compare. (2)[redaction.sources] sub_agenthas a reader again:dispatcher::append_subagent_reply_to_parent_session_withpasses a delegated agent's reply throughredaction_sources::redact_sub_agent_replyunder 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 modeonbuilds a pipeline (defaultinheritis byte-identical), a failing pass storesSUB_AGENT_REPLY_WITHHELDinstead 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_contendedtreatsERROR_LOCK_VIOLATIONas contention (was an immediate failure),task_sandbox::settings::valid_executablejudges in-image paths with POSIX rules on every host,discovery::evaluator::container_pathjoins container paths with/, a non-unix Discovery store reportsStoreError::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 aplainand aprod-shapedemployee (wildcardmcp__duduclaw__*allowlist, denied/approval lists, permissions, budget, contract) and call real tools through each employee's own.mcp.json;scripts/clean-build-cache.shremoves only this workspace's own artifacts undertarget/. 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_conditionsrefuses 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_EVENTSis pinned toAUTOPILOT_CREATE_TRIGGER_EVENTSbyautopilot_validation_tests. - MCP marketplace catalogue (
mcp_template::marketplace_catalog) is four cards on real npm packages: Playwright@playwright/mcp, Browserbase@browserbasehq/mcp(needsBROWSERBASE_API_KEY/BROWSERBASE_PROJECT_ID/GEMINI_API_KEY), Filesystem, Memory; the@anthropic-ai/mcp-server-*names never existed. Existing.mcp.jsonentries are not rewritten. inference.updaterefuses abackendother thanopenai_compator empty (a stored removed value echoed back unchanged is accepted);[model.local] backenddefault,duduclaw onboard/duduclaw wizardand shipped templates writeopenai_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 effectiveorigin_trustis strictly below the current fact's (stored trust capped at its class ceiling; pre-WP1 rows read asunattributed0.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 bymemory_factory::build_memory_engineand themcp-serverengine; directly constructed engines keep it on. Refusals inwiki_ingest(conversation facts) andprofile_distill(traits, now originuser_profile0.6 instead ofchannel) become held claims (metadata.held_claim, quarantined) with aknowledge_quarantineapproval (24 h; approve =promote_quarantinedwithoperatororigin, stale if the protected fact changed; ≤20 new per agent per UTC day viaauto_wiki_page::MAX_HELD_CLAIMS_PER_DAY, beyond that auditmemory_supersession_refusedreview_cap_hit); other callers skip, log, or error. Burst-quarantine release now goes through the guard (outranked rows become held claims).knowledge_quarantineis 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'sclaim_digest(claim or protected fact changed ⇒ nothing written, stale);approvals_decide::decide_knowledge_quarantineapplies 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 + auditknowledge_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 Feedknowledge_review_cap_reached;memory_invalidate_by_originfrom 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 andeph-keys; only an admin key mapping to no agent is exempt) is limited toorigin::ai_may_invalidateclasses (channel/mcp_external/tool_echo), else refused + auditmemory_invalidate_refused;duduclaw gdpr erasealso scrubs the review store (wiki_ingest::scrub_review_store_after_erase: withdraw pending cards, scrub card text in any state, delete matchingknowledge.quarantinedevents; 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-usersystemwrites no profile;user_profile_recordrefuses pseudo-users andinput_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_guardChinese coverage:instruction_overridenow matches override verb + scope word + instruction noun within one clause and 12 chars (was four exact strings, bypassed by an inserted word); Chinesesystem_prompt_extraction(weight 30, non-blocking) androle_hijackphrases added; thresholds/English unchanged; known false positives pinned byknown_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 fromDUDUCLAW_EDITION> licence tier > personal;agent.toml [edition] profilehas no reader (theEditionProfiledoc comment induduclaw-core/src/types.rsstill 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 (
AgentRuntimetrait) — Codex / Codex / Gemini (deprecated, removal scheduled for v1.70.0) / Antigravity (agy) / OpenAI-compat five backends,RuntimeRegistryauto-detection, per-agent config inagent.toml [runtime]. Runtime parity (v1.33):RuntimeContextcarriesCapabilitiesConfig; codex/gemini spawn with capability-derived sandbox flags (SandboxLevelReadOnly/WorkspaceWrite/FullAccess — no more blanket--full-auto/yolo; antigravity maps ReadOnly/WorkspaceWrite to--sandboxand FullAccess to--dangerously-skip-permissions, never both); PTY-pooled sessions inject per-agent--allowedTools/--disallowedTools(previously zero restrictions reached the pool); codex/gemini/antigravityexecute()register the duduclaw MCP server in each CLI's native config (codex-coverrides, gemini/antigravity settings.json per-key merge) so non-Codex agents get the full MCP tool surface;agent create --runtimescaffoldsAGENTS.md/GEMINI.mdand rejects typo'd providers;model_matches_provider()warns on[model] preferred↔[runtime] providermismatches - Unified LLM provider layer (
duduclaw-llmcrate, v1.33): the API-level twin of the CLI-levelAgentRuntime— one normalizedChatRequest/ContentPart/StreamEvent/NormalizedUsageshape over four native protocols: Anthropic Messages (layeredcache_control, thinking replay, real SSE), OpenAI Responses API, GeminigenerateContent(thoughtSignatureechoed verbatim), OpenAI-compat chat/completions (8 presets: deepseek/minimax/groq/together/mistral/openrouter/xai/qwen + local; DeepSeekreasoning_content, real SSE).ModelRegistryvendors ~15 models with millicent/MTok prices + price-cliff math + capability flags (user override via~/.duduclaw/models.toml). Tool-call args are always parsedserde_json::Valueat the boundary; errors classify into a ten-wayLlmErroraligned withFailureReason. MCP client + tool-loop (mcp_client.rsbehind default-onmcp-clientfeature,tool_loop.rsalways-on): a stdio JSON-RPC MCP client + provider-agnosticrun_tool_loopso the direct-API, local-inference, and the multi-runtime openai-compatAgentRuntimedispatch path get the full MCP tool surface (previously tools were CLI-backend-only; the openai-compatAgentRuntimeused by API-mode Grok/DeepSeek/MiniMax agents sent tools-less messages and could only narrate "I'll go look that up" — nowexecute()drivesrun_tool_loopwith a capability-filteredToolRegistryover a spawned duduclawmcp-server, degrading to plain messages only when no tools are reachable) —ToolRegistryaggregates N MCP servers, the loop feedsToolResultback until the model stops (max-iters cap, per-call errors fed back asis_error). Real SSE streaming on all four providers. Local inference folded in (2026-09-29 / T5-O11):duduclaw-inferenceno longer keeps its own reqwest chat/completions client — the capability that kept it alive (per-tokenlogprobs/top_logprobscapture for the UCCI cascade) is nowChatRequest::{top_p, stop, logprobs, top_logprobs}plusOpenAiCompatProvider::complete_with_logprobs(), absent from the wire body when unset. The local backend is a thinInferenceBackendshell that carries two local-only settings explicitly rather than inheriting them: a 300s request timeout (CPU generation routinely exceeds the shared 120s singleton) andwith_verbatim_model_id()(a local server'sqwen/qwen3-4bis a name, not aprovider/modelqualifier — the sharedsplit_model_idwould 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 bymcp_template::ensure_mcp_absolute_paths_all(the Claude CLI in-pmode does not read MCP servers from the global~/.claude/settings.json; the global-registration helperensure_global_mcp_serverhas 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_agentsMCP tools withreports_tohierarchy. System prompt auto-includes "## Your Team" roster with sub-agents from thereports_tohierarchy (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 walkreports_tountil an ancestor's token is found, then fall back to globalconfig.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_totree is the authority for hierarchical permissions; agents can delegate to their entire sub-tree and escalate to ancestors (any depth, both directions); same-departmentagents 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_removemoves the employee toagents/_trash/<id>_<14-digit ts>and no longer returns the path or anrm -rfhint; an AI caller (every MCP caller; the CLI scaffold path whenDUDUCLAW_AGENT_ID/DUDUCLAW_AGENT_TOKENare set) cannot create a name that has a trash entry, a danglingorg.tomlrecord, or an unlistable trash (fail closed) — closing remove-and-recreate as a way to shedCONTRACT.toml/[capabilities]/ sandbox settings; auditagent_name_reserved(path_kindmcp_create_agent/cli_scaffold/cli_bash_agent_create,reasonremoved_to_trash/dangling_org_record/trash_unlistable) andagent_removed; operators (dashboard, terminal) are unrestricted and restore/purge by hand (no UI);create_agent/agent_removeover HTTP with a non-internal key are judged by that key's client id. Gaps: Claude/Codex/Gemini employees' Bash env carries no identity, sopack install/migrate fromfrom 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 fromtool_calls.jsonl(programmatic evidence,resolve_audit_agentattribution, 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 afterCACHE_SPLIT_MARKER; claude_runner uncachedtasks_suffixfor 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, afterCACHE_SPLIT_MARKER/ uncachedtasks_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, inSELF_ECHO_TOOL_NAMES):reasonrequired, supersession chain inworking_state_history.jsonl, optionalexpected_valueCAS (Lettamemory_replacestale-write rejection — concurrent 3-min cron wakes can't stomp each other; expired entries don't satisfy CAS), optionalttl_hoursfor 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,/workspacetmpfs, only allowlisted agent-dir entries at/agent/<name>, fails closed; covers bus/dashboard tasks, heartbeat task-board wake-ups, autopilotdelegate/run_skill, goal rounds and plan steps; a sandboxed employee's goal rounds are always Solo (team gate rulesandbox_enabled, ahead ofalways_team), its Agent Mail arrival trigger is skipped, and channel reply / cron / reminder / proactive / ephemeral /duduclaw acp/ liveduduclaw evalstay on the host with a once-per-(employee, path)-per-processtask_sandbox_not_appliedaudit event) and the script sandbox (duduclaw-containervia PTCexecute_programand thesecauditPoC 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:1000if 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'swhen_unavailable) refuses withScript sandbox unavailable (<code>)+ auditscript_sandbox_unavailable,"run_unsandboxed"runs on the host and auditsscript_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.rsRAII 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 viaProgressEvent::TodoUpdate(parses CodexTodoWritetool_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 storeteams_conversations.json— the standard Bot Framework proactive pattern; Google Chat via service-accountsend_text_to_space); Computer Use senders exist for all channels (today only thecomputer_*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 — Telegramreply_to_message+forward_originprovenance, Discordreferenced_message, Slack message-shareattachments[].text(link unfurls excluded), Teamstext/htmlattachment<blockquote>, WhatsAppcontext(annotation only — Cloud API never ships the quoted body); one shared block formatchannel_format::format_quoted_context(CJK-safe 2000-byte cap,QUOTED_SELF_LABELwhen 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 indocs/todo/TODO-channel-quote-context-remaining.md. LINE, WhatsApp, Feishu, Google Chat, Teams, WeCom and DingTalk use the deployment-wide credentials inconfig.toml [channels]; per-employee bot tokens exist for Telegram, Discord and Slack only (with thereports_tocascade). 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_runssemaphore - CronScheduler reads
cron_tasks.jsonl, evaluates cron expressions, fires tasks on schedule.list_cron_tasksreturns 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_upperraise 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, theverify_all/verify_deterministic/verify_metrics/verify_mistake_regressionlegacy verification chain,SoulVersionversioning with its 24h observation window + auto-rollback + deferred retry, the[evolution] legacy_soul_evolutionescape hatch and theduduclaw evolution finalizeCLI all went with it —SOUL.mdhad been read-only for agents since v3 (WP1.1), so those guards protected a write path that no longer existed. Existingevolution.dbrows (soul_versions/gvu_consolidations/deferred_gvu) are left on disk with no reader;version_store.rsnow owns only the experiment log (gvu_experiment_log), which AEE writes andgvu/stagnation.rs+gvu/telemetry.rsread. Retained: AEE,stagnation.rs(scansevolution.dbevery 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, andsoul_partition.rs(duduclaw playbook migrate-souldepends on it). AEE's entry-level settlement sweep moved fromObservationFinalizertogvu/aee/sweeper.rs(same 30-min schedule fromserver.rs, same behavior).gvu::generator::escape_xml_tag— the one symbol with live external callers (wiki_ingest's prompt XML fencing) — moved togateway/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_enabledshipstruefrom the factory since K2 (2026-09-29) — onboarding, the industry-template wizard and MCPcreate_agentall writegvu_enabled = true+strategy = "balanced"; the runtime gate (gvu::trigger::agent_gvu_enabled) is unchanged and still fail-closed on a missing/malformed key, existingagent.tomlfiles keep their value, and ephemeral one-task agents deliberately stayfalse. Cost is bounded on both sides:gvu_cooldown_minutesthrottles 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 fromagent.tomlsince 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 existingrule_lifecyclesemantic-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_matchtrigger tokens (wired toMistakeCategory/FailureReason), ordered strategy, failure history, ≥1 linkedEvalCaseRef(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 Rulesis now signal-match-first + net-score fallback (was pure net-score top-3). One AEE round:gvu/aee/intent.rspicks repair/optimize/innovate deterministically fromagent.toml [evolution] strategy(balanceddefault /innovate/harden/repair_only— replaces raw ε-exploration) →inner_loop.rsruns ≤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 isNonenot0.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 evalgained--case <id>[,...](exactEvalCaseRefmatch, 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) viaevolution.*/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 playbookAddmust now carry E1EntryAssertions(must_use_tools/must_not_use_tools/output_contains/output_not_contains, ≤6 items × ≤80 chars — WP2.8/D8);playbook/assertions.rsreplays them zero-LLM against recorded eval transcripts, feeding aG-Assertionsgate step ininner_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 existingG-Contractveto 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; setenabled = falseto opt out). Before dispatch,prediction/task_forward.rspredicts 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.rsdiffs prediction vs. observation on 4 dimensions and records the transition (transition.rs— SPO fields deliberatelyNoneso transitions stay out of temporal supersession). Every observation carries an explicitObservationFidelity—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; maskedresult_text/input_text): Codex/codex/gemini/openai-compat reachFull; 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 astate_updatereply tag with<>stripped) plus a(state, action)visit graph (goal_loop/signals.rs) — repeat-visit streak ≥2 triggers early oscillationneeds_human;task_rule_induce.rs(A4) deterministically induces task rules from repeated transitions into the existingrule_lifecyclestore (template-based, inject cap 2, same settle/retire lifecycle — NOT playbook entries, per T8/T9). Confirmed post-task facts persist viamerge_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 underconfig.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.rsscores 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-stateHonestLabel(Supported/Candidate/IndistinguishableFromLuck).prediction/rule_gate.rsgates 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 indispatch_engine; channel replies arm the shadow candidates whose playbooksignals_matchtokens hit the turn'sTurnSignalsat 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_rateoverprediction_log; coin-flip fallback under 8 samples). Gate-on channel settles also route injected rules throughsettle_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. Seedocs/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 MCPbelief_submit/belief_settle/belief_stats, settled deterministically against a caller-suppliedrealized_value(three-way Brier, configurable flat band[belief] flat_band_pctdefault 0.3%;settlecan cross-check against a platform-suppliedtick_pricewith 1% tolerance, refusing a divergent report and recordingagent+tick_verifiedon agreement, but no production path supplies one — thebelief_settletool passes none and no gateway-side TickHub settle path exists — so every settlement today isagent_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-rowstats_injectedrecorded 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_mapconfig entry first,zXXXX→XXXXnaming convention as fallback). Stats reusecalibration.rsWilson/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_createacceptsduration_hours(deadline → needs_human, min with global wall-clock) andrisk_boundary(empty ⇒[goal_defaults] baseline_boundaryfive-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):
SqliteMemoryEnginewith episodic/semantic separation and Generative Agents 3D-weighted retrieval. The recency dimension uses Ebbinghaus retrievability (MemoryBank, arXiv:2305.10250):R = exp(-t/S)with stabilityS = base·(1 + k·ln(1+access_count))·(importance/5)— frequently-recalled memories rank higher and survive decay;run_decayarchives entries only when old + low-importance +R < 0.05(replaces the binaryaccess_count == 0heuristic). 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; blendsw_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,MemoryEntryunchanged): (F1) Temporal Memory —memoriesgains 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 existingMistakeNotebook(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-MistakeCategoryunresolved mistakes into one semantic memory rule (reflexion.rs, detached, deterministic synthesis) then marks the sources resolved. Trigger signal is the existingErrorCategory(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 carryrule_stats {helpful, harmful}in metadata (seeded helpful=1 under v1.41 Janus probation — see below); channel reply injects## Learned Rulesranked by net score (cap 3); afterapply_outcome, injected rules settle — Negligible/Moderate → helpful+1, Significant/Critical → harmful+1; net 0 → retired (retired-ruletag, excluded from selection) so stale rules die instead of diluting the prompt. (F3)memory_fetch_batchMCP tool +get_by_idsfetch ≤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, anduser_profileis its own class at 0.6 (was a 1.0 alias ofuser_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 bysource_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 aprobation-ruletag; first harmful settle retires them, helpful≥3 graduates. (4) PORTICO task-scoped grants (arXiv:2606.22504,capability_grants.rs): tools listed inagent.toml [capabilities] scoped_toolsrequire an active grant (MCPcapability_request→ ApprovalBroker, or goal-kickoffgrant:<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 evalgains[[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 pairstool_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_usagerecordscompressed/compression_stages, andcache_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 singlememory_factory::build_memory_engineconstruction 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_looptask-rule injection,chat_commands/rules,autopilot_enginepersona lines,night_engineN1–N4, the skill-synthesis evidence lookup, andserver.rs's scheduled decay job. Three families stay on the raw constructor on purpose and are documented inmemory_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:MistakeNotebookentries carryTrajectoryEvidence(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 forduduclaw evaland production) checks that a completion shares a contiguous CJK-safe span with an actual non-error tool result;dispatch_engineruns it before the MAV judge ([dispatch] grounding_precheck_enabled, default on) — hardened with a self-echo deny-list (SELF_ECHO_TOOL_NAMES: tools liketasks_completethat 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.jsonlrecords maskedresult_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), andresolve_audit_agentattributes system-sender dispatches (goal-loop / cron / heartbeat / autopilot, all sixSYSTEM_SENDERS) to the executing agent — fixing the P0 whereDUDUCLAW_DELEGATION_SENDERoverwrote attribution and silently starved every downstream evidence consumer (fidelity stuck atNone, grounding alwaysSkip, 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_souland 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_soulhad zero readers before this) — the only legitimate write paths left are the operator/dashboard and, for a single agent explicitly opted in viacan_modify_own_soul = true, self-write only (never cross-agent). The deadduduclaw-security::rbacmodule (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'sdelegation_policy. - Data sources & native DB connector (2026-09): RFC-23 redaction's
db_fieldsugar used to be Odoo-only; a[redaction.data_sources.<name>]registry (tools/table_arg|table/record_paths/key_alias) now lets a rule'ssourcename any tool-backed data source — two built-ins ship un-overridable (odoo, the original table now expressed as registry bindings;duduclaw_db, below),connectoris 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.jsonrewrite, tool names namespaced<server>.<tool>, credentials carried via env varDUDUCLAW_MCP_PROXY_ENVrather than argv) redacts a customer's own external stdio MCP servers, and a newduduclaw-llm::ToolInterceptorhook (before_call/after_call) does the in-process equivalent for the openai-compat tool loop. The rewrite is wired into bothchannel_reply.rs's two Codex-CLI spawn paths (fresh-spawn and one-shot PTY) andclaude_runner.rs'sprepare_claude_cmd(dispatch/cron/heartbeat/goal-loop turns, via the sharedmcp_proxy_cli_argshelper) — 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 crateduduclaw-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-levelREAD ONLYtransaction / SQLite read-only handle, row/timeout caps) — exposing four MCP tools (db_sources/db_tables/db_select/db_query,db_queryrefused unless a source'sallowed_tables = ["*"]) behindScope::DbRead(db:read, the 23rd MCP scope) plus a deny-by-default per-agent[capabilities] db_sourcesgrant; five admindb_sources.*RPCs (list/test/upsert/remove/tables) never return the connection string, onlySecretStatus, andupserttests 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 toolsfile_read/csv_read/xlsx_read(crates/duduclaw-cli/src/mcp_files.rs, newcalaminedependency for xlsx/xlsm/xls/ods) close the gap where the Codex CLI's built-inRead/Bashbypass redaction entirely; a built-induduclaw_filesregistry source (table name read from the tool result viaTableSource::FromResult,free_form_namesfor CJK/extension-bearing table and column names) letsdb_fieldrules targetcustomers.csv.name/客戶清單.xlsx.地址directly; a PreToolUsedata-file-guardhook ([redaction] data_file_guard, defaulton) blocks the built-in route back to those files, honestly documented as a heuristic (Bashfilename matching, inert on Windows without bash) rather than a sandbox. AI detection & custom rules (2026-09):type = "ner"rule kind + built-inai_piiprofile run OpenAI Privacy Filter on-device viaortload-dynamic(redaction cratenerfeature, default on; the release binary links no ORT —redaction.model.installdownloads 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::Redactcarriesengine(rule/ner) +model_revision. Dashboard-authored custom rules live inprofiles/custom.toml(redaction.custom_rules.*,redaction.profiles.import/.remove, per-ruleenabledon all kinds,[meta.labels]);redaction.suggest_patternturns 2–5 examples into a validated pattern (local inference → utility model → heuristic, 10/min per caller,pattern: nullrather than a fabricated one);redaction.dry_runacceptssample_text+draft_rulesfor pre-save preview.db_sourcesgrant UX (2026-09): granting an agent a database source no longer requires hand-editingagent.toml— the redaction wizard's step 4 and a new AI-employee 工具與權限 section grant it viadb_sources.grants.list/.setandagents.update { capabilities.db_sources }, and the MCPagent_updatetool gaineddb_sources/db_sources_add/db_sources_remove(gated by the existing delegation policy, audited asdb_sources_grant_changed, fail-closed id validation except on remove) — every route hot-reloads with no gateway restart. Seedocs/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-defaultallowed_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 toolsduduclaw_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/causalCuration page; estimators fail closed toUnknownrather 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 existingApprovalBroker. Its kill switch now retires the dashboard with the HTTP surface (2026-09-29, audit X1):config.toml [decision] enabled = falsealready 404s every/api/decision/*route, andsystem.statusnow forwards the same authority asdecision_enabled, so the SPA drops the Decision Lab rail row, its 進階設定 index entry, its ⌘K command and its/app/systemcard (Gated.requiresFeatureinweb/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-labstays 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_shadowscheduler;staffing[].agentsis a documentedmax_concurrent_runsproxy 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.rstranscribes a failed goal settle's fault token plus that round's owntool_calls.jsonlbytes into a candidate claim ([causal] audit_ingest, default on, zero LLM, zero egress, 50/agent/UTC day, deduplicated). Its consumer is an AEEcausal_supportMeasure dimension that is deliberately absent from the commit gate'sdimensions()(telemetry only;Noneat zero accepted claims, never0.0), with the opt-in[evolution] require_causal_evidencerouting an unsupported playbook entry to the existingshadow-rulepath instead. CCR gained[ccr] builtin_sources(default on) routing DuDuClaw's own 11 high-output read-only MCP tools, but[ccr] enabledstays 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. Seedocs/todo/TODO-reversible-context-causal-simulation.mdanddocs/spec/reversible-context-ccr.md/causal-evidence-graph.md/support-decision-twin.md. - Codex PreToolUse hooks (installed per agent by
agent_hook_installerinto<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), matcherWrite|Edit|MultiEdit|NotebookEdit|Bash(NotebookEditsince the Unreleased block), installed command carries--agent "<id>"and--home "<home>"(the spawn env is scrubbed ofDUDUCLAW_HOME, so before--homea 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 andattachments/(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--agentand noDUDUCLAW_AGENT_IDis unaffected; the installed command always carries--agent, so an operator runningclaudeby 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 ownSOUL.md(no hook-level opt-in;can_modify_own_soul = trueonly opens theagent_update_soulMCP tool, self only), on an agent writing its ownCONTRACT.toml(BlockedOwnContractWrite,duduclaw_core::check_own_contract_write, no opt-in at all; operators use the admin-onlycontract.updateRPC), on any cross-agent write, on AI writes/moves/deletes underagents/_trash/(Bash by heuristic), and on a Bashduduclaw agent create <reserved name>; the Bash lane matches the ownSOUL.md/CONTRACT.tomlboth asagents/<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 andattachments/refused even for reads) and an untrusted caller's write anywhere underagents/— still a speed bump, rules and limits indocs/features/05-security-defense.md; real containment is not granting Bash; (2)org_field_guardruns 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, andconfig.toml [delegation]/[acp](every caller), plus, for agent callers only, every section of the caller's ownagent.tomlnot 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, matcherRead|Bash; decision logic induduclaw_core::data_file_guard) — armed only when redaction is active for that agent (DUDUCLAW_DATA_FILE_GUARDat spawn), documented as aBashfilename heuristic rather than a sandbox. H10 (2026-09) replaced the originaldata-file-guard.shshell script, which was inert on a Windows host with no bash on PATH; the installer deletes any leftover script on upgrade. Plus the library-sideduduclaw_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 fromimports, expert-pack install, mail and reminders (Chinese patterns are gap-tolerant since v1.67.1; seedocs/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 inba015a48when.Codex/left the public repo;.Codex/is gitignored and nothing in the shipped binary reads it.~/.duduclaw/threat_levelsurvives only as an operator-written kill switch polled bycomputer_use_orchestrator(absent ⇒ GREEN). Current description:docs/features/05-security-defense.md;commercial/docs/TODO-security-hooks.mdandcode-review-security-hooks.mdare 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: L1web_fetch_cached(SSRF-gated + disk-cached HTTP GET, body truncated at 60k chars, sharesweb_fetch::validate_url/resolve_public_addrswith 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 oneduduclaw_core::net_addr::is_public_ip: IPv4 special-purpose blocks incl. CGNAT/documentation/benchmarking/multicast/reserved, IPv6 only2000::/3minus Teredo/documentation, IPv4-mapped/NAT64/6to4 judged by the embedded IPv4; the older web check let[::ffff:127.0.0.1]through), L2web_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 eightcomputer_*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}toPOST /api/internal/computer-useon 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) andcomputer_use_sessions/owns everything else: one session per agent, ephemeral agents andcomputer_use_mode = "native"refused, 120 s idle /max_session_minutes/max_actions(navigate counts, screenshots do not), 15 s reaper, home+deadline-labelledduduclaw-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-checksdenied_tools/allowed_tools/scoped_toolsand 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 channelregistry, never the request) and are refused with no channel; unreadable focused-window title refuses the action;computer_screenshotreturns an MCP image block + text (the gateway answer carriesfully_masked+mask_reasonseveral_pages/title_sensitive/title_unreadable/helper_failed, decided fromduduclaw-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 toaudit/browser/audit.jsonl(tierL5a) andtool_calls.jsonl. Network: none unlessagent.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, passesALLOWED_IPStodomain-filter.sh(default drop, TCP 443 to pinned addresses only, DNS refused) and addsNET_ADMIN;computer_navigate(navigation.rs) takeshttps://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 toduduclaw-navigateon stdin (argv = usage error); the kiosk browser has no address bar. Container hardening (both paths):--security-opt no-new-privileges, pinned sessions pass--network bridgeexplicitly,domain-filter.shlimits 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 onlo, so refusals are immediate), Chromium managed policycontainer/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;DeveloperToolsAvailabilitydeliberately 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+ncannot be blocked by policy (ctrl+nopens a window with an address bar; reach still only pinned hosts; >1 visible page ⇒ fully masked screenshots until the next navigate closes extras); a rootdocker execprocess keeps NET_ADMIN (only PID 1's tree drops it; only the gateway execs). Pointer actions runxdotool mousemovewithout--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 Anthropiccomputer_20251124tool, posts no progress/screenshots/"cannot start" replies, and computer use reads no Anthropic key. Native mode is removed (noenigo/duduclaw-desktopdependency; the gateway'sdesktopcargo feature is kept empty because the release workflow passes it):[capabilities] computer_use_modestill parses,"native"is refused by the tools withnative_unsupported(no silent fallback),"auto"/absent ="container",duduclaw doctorwarns and names employees still set to native; audit rows no longer carry tierL5b. 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 (Debianchromium+openbox, browser as unprivilegedsandbox, kiosk at 0,0 with scale factor 1);.github/workflows/computer-use-image.ymlpublishes it on tagsv*(native amd64/arm64 runners, smoke-tested with the gateway's container flags before push) asghcr.io/zhixuli0406/duduclaw-computer-use:<tag>+:latest— first run is the first release tag after v1.66.1;release.sh verifydoes not check it. Default image…/duduclaw-computer-use:v<gateway version>, only override the globalconfig.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 doctorhas a 電腦操作 row. Screenshot masking runs the in-image helperduduclaw-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), anddomain-filter.shrefuses to start when it cannot install its default-deny egress rule while a non-loopback route exists, so the gateway adds--cap-add=NET_ADMINonly on the filtered-egress paths (--pids-limit512). L3 headless is an optional external per-agent MCP server (Playwright or Browserbase, an entry the operator writes into.mcp.jsonby hand; the generator helpers inmcp_template.rshave no caller) — not in the binary, no fallback into it. Deny-by-default viaCapabilitiesConfiginagent.toml [capabilities]—computer_use(fail-closed: missing file / bad TOML / wrong type all deny),browser_via_bash,allowed_tools,denied_tools(passed as--disallowedToolsand enforced at the MCP dispatch gate).browser_via_bashno longer sets any env flag — thebash-gate.shallowlist that readDUDUCLAW_BROWSER_VIA_BASHwent with the shell hooks inba015a48; the capability still feedsdisallowed_tools()andCapabilitiesConfig::sandbox_level()(codex/gemini ReadOnly vs WorkspaceWrite). The "5-layer auto-routing" story wasbrowser_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 inApprovalBroker+approval_required_tools/irreversible_tools). Seedocs/features/08-browser-automation.md;commercial/docs/TODO-browser-automation.mdis marked partly historical. - Behavioral contracts (
CONTRACT.toml) withmust_not/must_alwaysboundaries +duduclaw testred-team CLI - Agent behavioral evals (
duduclaw eval, v1.33): golden-task regression for agents —evals/<agent>/*.tomlcases with deterministic tool-call/regex assertions + optional LLM judge (reusesduduclaw-fork::judge); live mode drives the real CLI (captures actualtool_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:--recordrewrites.mcp.jsonto a temp copy pointingDUDUCLAW_HOMEat 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 aserror_max_turns— an assessable failure baseline, not an infra error (infra errors stay hard);duduclaw eval-scaffolddrafts eval cases from an agent's SOUL behavioral rules intoevals-drafts/(free-tier path to the AEE ≥1-EvalCaseRef hard requirement — drafts must be human-reviewed before moving intoevals/); 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). Seedocs/guides/evals.md. - HITL ApprovalBroker (
approval.rs, v1.33): one interrupt/approval primitive spanning MCP tools / autopilot actions / bus tasks — SQLiteapprovals.db(WAL),request/decide/await_decision/expire_stale, TTL-expiry = DENY (fail-closed). Wired into autopilotrequire_approval;agent.toml [capabilities] approval_required_toolsparser; 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_notifyeach 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 nownotify_push::push(card, dest), wheredestpicks the only thing that genuinely differed — the token dialect: an agent-addressed card uses that agent's own[channels.<ch>]token with thereports_tocascade, 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 theirpub 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'sdelivered_targets) — a push is an outbound side effect and must never be able to widen who can decide. The two transportssend_with_markup(TG inline keyboard / Slack blocks / Discord DM-open / LINE quickReply) andsend_plain_textmoved fromgoal_notify.rsintochannel_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-loopneeds_humanescalations 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.listships thesimulationfield). - OpenTelemetry GenAI tracing (
otel.rs, opt-inotelfeature, v1.33):invoke_agent/chat/execute_toolspans following thegen_ai.*semantic conventions, OTLP-exportable (gRPC) to Langfuse/Grafana/Jaeger/Datadog. DEFAULT OFF (zero deps/overhead unlessconfig.toml [telemetry] otlp_endpointset); coexists with the Prometheusmetrics.rslayer. Seedocs/guides/observability.md. - A2A v1.0 Agent Card (
acp/server.rs, v1.33):/.well-known/agent-card.json(v1.0 schema; legacy/agent.jsonalias) with thex-duduclawADR-002 capability-negotiation extension preserved;message/sendis fully wired tobus_queue.jsonl(advisory-locked append, sender identity recorded, honestsubmittedstate — never fakescompleted;tasks/getmaps 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.rsC1), MCP front doors (send_to_agent/spawn_agentC2 with legacycheck_supervisor_relationremoved), task assignment (tasks_create/tasks_updateC3), agent hierarchy creation (create_agent/agent_updateC4 caller-owned-subtree-only; since the Unreleased block an AI employee cannot sendreports_to/db_sources*/budget_cents/roleabout 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_postwithtask_id,update_cron_task/delete_cron_task/pause_cron_task/run_cron_task,create_reminderfor anotheragent_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_statusper-caller scope (self + subtree + ancestors + same-dept + white-list;openpolicy 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/setRPC, admin-only) + UI card in advanced settings (radio + pairing editor, no restart needed). ACP entry ([acp] trusted = trueopts intoa2a-clientsender allowlist; default deny). Audit log eventdelegation_deniedcarries sender/target/path_kind/policy. Identity & integrity (v1.52 hardening): HMAC-SHA256 caller token per spawn (DUDUCLAW_AGENT_TOKENenv); PreToolUse hook freezes org fields (agent.toml [agent]name/reports_to/department,config.toml [delegation]/[acp],.mcp.jsonidentity block,.Codex/settings.json; since the Unreleased block also the ownagent.tomlsecurity sections and every<home>path outside the own directory andattachments/) to MCP/Edit/Write tools—config mutations routed throughagent_update/dashboard only;require_identity_tokensoft/hard modes in[delegation]. No rank-based auth (hierarchy viareports_totrees 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 viaduduclaw org syncCLI (operator-terminal only, fail-closed in AI sessions),duduclaw org showinspection,duduclaw doctordrift 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. Onepack.tomlschema and one in-memoryPacktype 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 installis 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 whereexpert 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 installwas removed in v1.69.0 (a hidden stub printspack installand exits with status 2); theexperts.*RPCs shell out toduduclaw pack install;expert liststays and lists the installed records (it is not an alias ofpack list); authoring verbs (pack/publish/export/convert-teams/hooks/remove) stay underduduclaw expert.pack inspect --emit-canonicalprints (never writes) thepack.tomla 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 apack.tomlteam or template pack cannot be installed yet);preset.tomlis the job-preset storage format and is not deprecated; the old verbexpert installwas 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_listtools. Hub aggregation coversanthropic/github/clawhub/lobehub/skills-sh(DEFAULT_HUB_IDS);skills-shneeds 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_searchtakessource: "all" | "github" | "hub" | "bank"(defaultall— hubs plus the learned skill bank, de-duplicated by skill name, each hit labelled);skill_bank_searchwas a deprecated alias forsource="bank"and was removed in v1.69.0. The learned skill bank is still an empty in-memory stub, sosource="bank"reports an empty store rather than returning hub results - Integration gates (2026-09 audit): GitHub — the five
github_*tools had nointegration_enabledlayer, so a token in the OAuth vault meant every agent could post as the operator (github_issue_commentis a public write).[integrations] github(defaultfalse; missing file / bad TOML / non-boolean all read as off) now gates them, they are hidden fromtools/listwhen 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_workspacedefaultsfalseand the frontend now reads that flag instead of hardcodingtrue(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_runnersynthesizes a SKILL.md from episodic memory (Voyager-inspired) → security scan (theskill_security_scanscanner, fail-closed) → sandbox trial with TTL → cross-agent graduation. The trigger consumer is gated byagent.toml [evolution] skill_synthesis_enabled(default false): with it off the runner only clearspendingand spends nothing. Every failure path callscancel_pending(topic re-accumulates), only a passing candidate callsconfirm_synthesis(cooldown + evidence cleared). Until 2026-09 the chain dead-ended:confirm_synthesis/cancel_pendingandSandboxStore::addhad zero production call sites, so a triggered topic stayedpendingforever and the sandbox was always empty. Feedback-signal rows use the canonicaltypekey (readers still accept the legacysignal_type). MCP tools:skill_security_scan,skill_graduate,skill_synthesis_statusFourskill_lifecyclemodules 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_skillhad never been called even by its own test, whiledocs/features/15sold 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.rswas deliberately kept — it is the second security gate insidesandbox_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 fortasks_update/activity_post); claiming a task assigned to someone else or reassigning it to yourself needs the relationship;goal_modetitle/descriptionare frozen likeacceptance_criteria; the control tagsoutcome:*/grant:*/auto-researchcannot be added, removed or reordered (refused intasks_createtagstoo); operators (a key mapping to no employee, noDUDUCLAW_AGENT_ID) are unrestricted. One creation entry (T5/O4, 2026-09-29):tasks_creategainedkind: "task" | "goal"andschedule(cron expression or RFC3339 instant), both optional and both defaulting to today's behavior.kind="goal"runsduduclaw-gateway/src/goal_create_core.rs— the function extracted out of the dashboardtasks.goal_createRPC, so the H9-G acceptance-contract freeze, the structured-outcome parse, per-goal wall clock / risk boundary and I-1cplan_firsthave exactly one implementation instead of two that can drift.scheduledelegates verbatim: a cron expression to theschedule_taskrail (CronStore), an RFC3339 instant to the one-shot reminder rail (agent_callback, requiresnotify_channel+notify_chat_idsince 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"+scheduleis 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_taskwas a deprecated alias and was removed in v1.69.0.goals_createandcreate_taskare NOT deprecated —goals_createcreates a goal-hierarchy node (Initiative → Project → Issue), andcreate_tasksubmits an explicit multi-stepstepsplan to the TaskSpec dispatcher, whichtasks_createhas 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 agoal_modetask (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 onMethodHandler::respawn_dispatch_engine/respawn_goal_loop_driverso boot andsystem.update_configshare 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;DispatchEngineacceptance judge is a three-aspect MAV panel (correctness/completeness/safety, one LLM call viarun_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 → earlyneeds_human), all under[goal_loop]config. HITL:needs_humanpushes approve/retry/abort buttons to TG/Discord/Slack/LINE (WP16 codec; text-only fallback elsewhere) + dashboard needs_human board column; per-agent[capabilities] autonomy_levelfive 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 onapproval_required_toolstaking the stricter. Runaway defenses (arXiv 2607.01641): cross-processdispatch_guardsliding-window breaker in duduclaw-core (~/.duduclaw/dispatch_guard.jsonunderwith_file_lock, spawn/ephemeral/cron paths,[dispatch_guard]config), cascadinghop_depthover bus handoffs (envDUDUCLAW_HOP_DEPTH, max 5),termination_manipulationinjection rule (7th input_guard category, weight 30 no instant-block). Seedocs/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.rssettle 時先跑一個無工具、單次 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.tomlexamples優先、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 第五份平行實作);Secretzeroize/Debug 遮蔽/無 Serialize;[mcp_keys]鍵名遮罩補洞;同步路徑網路 backend fail-closed(async 化列 P1)。shared_wiki_deletemain-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.jsonlprovenance 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 補齊六通道、MCPsend_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]]headerssecret://逐請求解析+解析後 CR/LF 重驗、security.credential_inventoryRPC+安全頁憑證來源總表(只報鍵路徑不報值,[mcp_keys]整段跳過——表格鍵名本身就是金鑰)、duduclaw doctor --fix-residue互動式殘留清理、accounts.add不再寫明文孿生鍵;第 6/7 種解密方言收斂(Apps Script 共享密鑰與 inferenceapi_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_tokentoken 串接與lookup_origin_agent,沒有走channel_sender::create_sender。收斂列在 O5,尚未完成。)**openapi.yaml 通道 enum 補齊十一通道。調研:AutoDesign(arXiv 2608.13560)+OfficeCLI 報告落research/harness-2026-08/;AutoDesign 鏡頭實錘verifier_measure.rscommit 閘 visible/held-out 混維缺口。批次二(同日):AEE 驗收閘拆維防遮蔽——commit 閘dimensions()並排新增cases_visible/cases_holdout(holdout band 預設主 band 減半、[evolution.noise_band] holdout可設、顯式值鉗不寬於主 band),兩新維 fence-only 只否決不晉升(不重置 anti-drift/不關觀察窗);settlesuite_verdict同修,band 於 commit 時凍結進PendingSettlement.band_holdout(settle 不回讀 config);無 holdout case 行為逐位不變;冠軍 bootstrapinclude_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_zipheader 謊報洞(宣告 size 累計 vs 實際寫入)一併修補。[office] delivery_gate(artifact_gate.rs,預設開)📎DELIVER 前結構檢查硬失敗(零位元組/magic 不符/zip 損壞)+佔位殘留 warn-only(delivery_gate_placeholder_block可升級硬擋)。agent_id 驗證器五份收斂雙權威版(coreis_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 旋鈕遙測/A3clear_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、ledgermail/mailbox.jsonl照抄 artifacts.jsonl 形狀;死碼email.rs接活;欠:原生 IMAP、channel-registry 整合、autopilot 事件、附件。preset P1(duduclaw-core/preset.rs+duduclaw presetCLI+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.mdT3-S9):一次性決策工具,本機量測已產出 INSUFFICIENT_DATA,Code Mode 本身未立案;cost子命令族(CostCommandsenum)一併刪除。當時的 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.rsAPI 模式 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_CACHEinvalidate-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;Odooset_global改disconnect_all+修 profile 變更孤兒 slot bug。仍需重啟:Discord/Slack WS 長駐。P3 env 擦洗——duduclaw-core/spawn_env.rsAGENT_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.rsprovider→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=frontmattermodified)、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.rsper-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-oscrate:watch.rscross-platform filesystem watcher onnotify-debouncer-miniwith 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 sideos_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. Seedocs/features/33-os-native-perception.md. (2) Appliance (duduclaw-sysdprivilege-separated helper with its ownprotocol.rs/dispatch.rs/client.rs; gatewaydevice.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, plusduduclaw-relayfor the webhook relay).DeviceOpsis the single place anydevice.*RPC decides an argv — handlers never spawn a subprocess directly.os_ops.rsis the single authority for the whole device/systemos_*capability family (O16, 2026-09-29): the same ~20 capabilities used to be implemented three times — the agent-facingos_*MCP tools (duduclaw-cli::mcp_os_ops), the operator CLI leavesduduclaw os <group> <verb>(duduclaw-cli::os_drive), and the dashboarddevice.*/network.*RPCs. All three are now thin adapters that do exactly three things: their own permission gate, request parsing, response rendering. Onepub async fnper capability performs the effect and returns the canonical payload; inputs are typed (PowerAction/WifiAudit/CheckUpdateOptions), errors unify intoOsOpErrorwhich deliberately carries the originalDeviceOpError/WifiErrorbecause the three surfaces render the same failure differently on purpose. Permission gates did NOT move — MCP'sScope::OsNative/Scope::Admin+[capabilities] os_native, the RPC'srequire_admin!()+require_appliance!()+require_confirm!(), and the CLI's operator-terminal identity +os_drive::approval::gateeach 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 verbosesystemhalf 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-osis already their authority), the dashboard-onlyos.*page RPCs, andsystem.apply_updatevsos_apply_update(target="system")(the RPC trusts a URL pair cached in the live gateway'sMethodHandler::pending_update, which a separatemcp-serverprocess cannot read, so the tool re-resolves a fresh trusted pair — two mechanisms, same invariant). Seedocs/features/50-duduclaw-os-appliance.mdand51-os-keyboard-shortcuts.md. (3) Desktop edition & co-driving (codrive/— a scripted GUI co-drive driver talking to theduduclaw-compcompositor's agent-injection socket over a hand-mirrored wire protocol locked down by serde shape tests, deliberately not aduduclaw_compdependency;display_bridge.rsandaudio_bridge.rsare the agent→display / agent→audio gateway bridges). Shadow workspace, human input always wins, explicit hand-back, co-driving off by default. Seedocs/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'scrates/too: they were always workspaceexcluded detached crates with their own lockfiles and the main workspace never depended on them, so nothing here changed.duduclaw-pets/duduclaw-desktopstayed. In the same move theduduclaw compatsubcommand family became cargo featureapp-compat(cli + core, default off) rather than being deleted — DuDuClaw OS's shell spawnsduduclaw compat windows-vm appat runtime, so the platform binary simply does not compile it and the OS recipe builds with--features app-compat(main-repo CI keeps onecargo checkon 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 viawiki_visible_tocapability. One tool set, two wikis (T5/O3, 2026-09-29):wiki_ls/wiki_read/wiki_write/wiki_search/wiki_stats/wiki_linttake ascope: "agent" | "shared"parameter (defaultagent, so every pre-merge call is byte-identical); the sixshared_wiki_*spellings were deprecated aliases and were removed in v1.69.0 (not intools/list; a call returns the replacement call,docs/guides/deprecations.md). Scope resolution isduduclaw-cli/src/mcp_alias.rs, fail-closed on an unknown token, and ascopeargument can only narrow or select a wiki, never widen the caller's access.shared_wiki_deleteandwiki_sharekeep their own names —shared_wiki_deletedeliberately was NOT merged (no agent-local twin, so awiki_delete scope="agent"would have added a destructive capability)..scope.tomlSoT policy,wiki_visible_tovisibility and the author-or-main-agent delete rule are unchanged - Autopilot rule engine: Event-driven automation built on a
tokio::broadcastevent bus (capacity 8192).AutopilotEnginesubscribes toTaskCreated/TaskStatusChanged/ChannelMessage/AgentIdle/CronTickevents, evaluates per-rule conditions (all/any+eq/neq/in/not_in/gt/gte/lt/lte/containsops), 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 MCPautopilot_list; every CRUD call validatestrigger_event,conditionsandactionstructure at write time (cron_tickrefused on create; empty conditions mean always-true, v1.67.1). Every execution appends toautopilot_historywith status + error context. Three-state circuit breaker per rule (Closed/Open/HalfOpen) prevents self-reinforcing loops: 10 fires in 60s trips toOpen(60s cooldown), thenHalfOpenallows 1 probe; retry within the probe window re-trips, a quiet probe window returns toClosed. Transitions are logged toautopilot_historyand the Activity Feed. MCP → engine bridge runs through SQLiteevents.db(WAL + monotonic auto-increment id + background prune at 7-day retention) — replaces the legacyevents.jsonlfile 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 underconfig.toml [tick]/[[tick.sources]], default off — join the autopilot bus as a newAutopilotEvent::Tick(event_name() = "tick", also a legal CEPfirst/thenname), one task per source with a per-sourcemax_events_per_minutecap (floor 1s) and reserved-field-name/prefix rejection at config-load time (fail-closed per source, never aborts gateway boot);websocketis the one push-based kind (each text frame is a payload through the identical pipeline):ws/wssonly, plaintextws://restricted to loopback while every other host must bewss://and re-passes the sharedweb_fetch::validate_urlSSRF gate scheme-mapped to https, optional ≤8×4KB verbatimsubscribeframes, exponential reconnect backoff (startinterval_secs, ×2, cap 60s, +≤25% jitter, reset after a ≥60s session), binary frames dropped and counted asnon_text; every numeric extracted field automatically grows deterministicprev_<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-processTickHubring buffer (256/source — ticks are NOT persisted toevents.dbby default; opt-inpersist_every_nfor an audit trail) that both thedelegatewake-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 unlesson_unavailable = "drop"; verdict parsing strips edge ASCII punctuation from the first token before matching YES/NO). Dashboard:ticks.sources/ticks.recentRPCs feed a read-only "即時監控來源" card on the Autopilot settings tab;tick_events_total/tick_dropped_total/tick_screen_total/tick_wakes_totalPrometheus counters. D5-W2 hardening:http_poll+websocketaccept customheaders(≤8, transport-owned names and CR/LF-bearing values refused at config load; values never logged, never serialized —TickSourceConfighas a hand-writtenDebugand noSerialize, andticks.sourcesexposes onlyheaders_count);websocketgains an idle watchdog + client ping (idle_timeout_secsdefault 300 / floor 30,ping_interval_secsdefault 30 / floor 5,0disables either,idle > pingenforced — any inbound frame resets both clocks, an idle recycle redials immediately and is deliberately not counted as a drop); and everyhttp_pollrequest plus every non-loopbackwssdial re-resolves DNS at request time through the sharedweb_fetch::resolve_public_addrs(all resolved addresses must be public or the whole answer is refused, then pinned — reqwestresolve_to_addrsfor HTTP, aTcpStreamdialled at the vetted addresses with hostname-derived SNI for WS), which also replaced and hardened the single-address re-pin previously inlined inweb_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 whichfactually 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 stayingi64— every mainstream feed ships string prices, sogtand 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-enginenumber_pair); and a payload that resolves none of a source's configuredjson_fieldsis dropped asDropReason::NoFieldsrather than emitted as a field-less tick (checked before the rate cap so control frames cannot starve the emission budget; sources with nojson_fields, and non-JSON payloads, keep theraw_lenbehavior). A fourth round addedround6todelta_<f>(it had only ever been applied topct_<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 likedelta_price gt 0.1;prev_<f>stays verbatim (a reported value, not a derived one) and the integral path bypasses rounding entirely (round6scales by 1e6 and stops being exact past ~9×10⁹). Two residual settings close the round out: per-sourcebaseline_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, keyedhost: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_cachedkeeps its own semantics. Knob presets (T5/O15, 2026-09):[tick] preset = "conservative" | "aggressive"supplies defaults for the keys a source (or a rule'saction.screen) did NOT write —max_events_per_minute30/600,baseline_max_age_secs900/21600, andon_unavailabledrop/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). Seedocs/features/41-resident-sensing.md. - Odoo ERP bridge (
duduclaw-odoocrate): 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 +OdooConnectorPoolkeyed by(agent_id, profile)replaces the v1.10.1 global singleton; newScope::OdooRead/Write/Executetriplet plusallowed_models/allowed_actions(withwrite:crm.leadqualified-verb form) defence-in-depth filter;tool_calls.jsonlaudit attribution carriesprofile+ok=boolso Odoo activity attributes to the originating agent. Seedocs/rfc/RFC-21-operator-guide.mdfor migration playbook. Test-before-save (v1.13.1):odoo.testRPC accepts inline params — when params includeurl/db/credentials the connector is built from the form values without touchingconfig.toml; omitting the credential field falls back to the stored encrypted secret; inline-mode params go through the same SSRF / HTTPS / db-name validators asodoo.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-identitycrate, RFC-21 §1, v1.11.0):IdentityProviderasync trait with three impls —WikiCacheIdentityProvider(reads<home>/shared/wiki/identity/people/*.md),NotionIdentityProvider(Notiondatabases/querywith configurablefield_map),ChainedProvider(cache → upstream with graceful degrade on outage).identity_resolveMCP tool gated byScope::IdentityReadreturns canonicalResolvedPersonrecords. 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-reasoningshared_wiki_readlookups. G5(2026-09 盤點):channel_reply::build_sender_block與identity_resolveMCP 工具原本硬編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.tomlto 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). Bothshared_wiki_writeandshared_wiki_deletehonour the policy.wiki_namespace_statusMCP 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) thatstore_temporalsupersedes automatically; ② curation dilution → four locks (auto/{charter,sop,spec,policy,reference}/is the only writable prefix;author: auto-distill+auto-distilledtag self-label every page — no new frontmatter key is invented becauseparse_wiki_page → serialize_pagesilently drops unknown keys;.scope.tomlis consulted before every write and, unlike the shared-wiki fail-safe, an existing-but-malformed policy stops the auto write;layer: contextkeeps auto pages out ofcollect_by_layer_with_metaso they cost 0 bytes of the injection budget and human curation's injected bytes are unchanged —do_not_injectis deliberately NOT set, sinceWikiStore::searchdrops such pages and auto pages must stay findable); ③ no supersession → deterministic page key (resolve_slugvalidates 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 isknowledge_route.rs: L0 hard exclusions (too short / question /scan_inputhit / fallback narrative), then a zero-LLM signal table (≥65 files, 30–64 asks the utility model via four extra fields folded intobuild_cloud_ingest_prompt_with_knowledge— parsed independently of the fact array so one malformed half cannot break the other, <30 memory path). It runs BEFOREclassify_for_ingestand never reads the assistant reply, fixing the defect where a 2,000-char paste answered in eight characters wasSkip-ed entirely. Circuit breakers: 20 auto pages + 20 grey-band arbitrations per agent per UTC day (auto_wiki_page::try_consume_quota, cross-processwith_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.shareRPCs; removal expires exactly that page's pointer viaexpire_by_subject, NOTinvalidate_by_origin(which stays as the clearly-labelled nuclear option). The 待審知識 tab was removed from the station; theknowledge_quarantineapproval 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.tomlknowledge_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 viacache_control: ephemeral).account_poolwiring (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 accountidor dashboardlabel(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 awarnand falls back to the full set — a stale pool can never brick an agent. Empty/unset ⇒ byte-identical to before. Threaded throughclaude_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), andRuntimeContext.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_TOKENenv var forsetup-tokenaccounts) + 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).LeastCostprefers 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 primitiverotate_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 runCodex auth status" hint. Structured failure records are appended to~/.duduclaw/channel_failures.jsonlfor 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 withoutPATHinheritance. 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 trustingCodex auth status'sloggedInflag (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 newauth_deadstate with exponential backoff (15min → 6h cap) replacing the old 3-strikes/2-minute flap, an undecryptable stored credential is excluded at load time asbrokeninstead of spawning credential-less runs,accounts.addruns the same probe before saving (rejects 401/403/short-livedsk-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) viaduduclaw-gateway::auth_outage. - One-shot PTY invocation (
duduclaw-cli-runtimecrate): 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_oneshotspawns 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_envstarts 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);deadlineis an absolute wall-clock cap that force-kills the child. Callers:runtime/grok.rsand theduduclawCLI-login helper. The PTY session pool was removed in 2026-09 — the long-lived sentinel-framedCodexREPL 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 thepty_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-spawnCodex -ppath, which holds no CLI-side session state (per-turn context comes solely fromget_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 incommercial/docs/runtime-pty-pool-design.md(marked HISTORICAL) and the removed code in git history at the v1.65 tag. Seedocs/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)+ L1goal_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 withcache_control: ephemeralon system prompt → 95%+ cache hit rate. Singletonreqwest::Clientwith 120s timeout. Used as fallback when all OAuth accounts are rate-limited. Layered cache breakpoints: system prompt can be split viaCACHE_SPLIT_MARKERinto ≤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 peragent:modelstream 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.addimmediately launches the channel bot;channels.removeaborts the running task. No gateway restart needed. - Local inference engine (
duduclaw-inferencecrate): oneInferenceBackendimplementation — OpenAI-compatible HTTP (llama-server / Ollama / vLLM / SGLang / llamafile), configured viainference.toml [openai_compat]— since T5-O11 (2026-09-29) a thin shell over the sharedduduclaw-llmcompat provider, see the "Unified LLM provider layer" entry. The in-process llama.cpp (llama-cpp-2), mistral.rs (mistralrs-core) and MLX (mlx_lmsubprocess) backends were removed 2026-09-29 (wiki/reports/feature-audit-2026-09-29.mdT1-D2/D3, T3-S5): the release build never compiled any of them (release.shpasses neithermetal/cuda/vulkannormistralrs), and llama.cpp'sgenerate()was a stub that returned "not yet fully implemented".BackendType::LlamaCpp/MistralRssurvive as parseable config values only — selecting one now fails with a message namingopenai_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_thresholdkeys,ConfidenceRouter::evaluate_post_hoc/assess_post_hocandInferenceEngine::assess_responseare gone (wiki/reports/feature-audit-2026-09-29.mdT3-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. Leftoverpost_hoc_*keys in an existinginference.tomlare ignored. - UCCI calibrated cascade (
duduclaw-inference/src/ucci.rs, experimental, opt-in viainference.toml [router] ucci_fast_router/ucci_strong_router/ucci_shadow_strong, all unset/falseby default): an alternative to the Confidence Router's unfitted post-hoc gate above — wraps an external isotonic-calibrationuccicrate (git-pinned) so LocalFast/LocalStrong can each carry an offline-fitted router file and escalate on top-2 token-margin uncertainty instead ofg = 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.pyare separate, human-reviewed offline fitting tools — nothing in the gateway trains or refits automatically. Seedocs/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.mdT3-S4: no example config anywhere in the repo made it unreachable for users, and pointing[openai_compat] base_urlat 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_contextdefault ON, envDUDUCLAW_MINIMAL_CONTEXT=0/ per-agent off-switch): every official-CLI spawn carries--tools <curated list>(CURATED_BUILTIN_TOOLS/DISPATCH_DEFAULT_BUILTIN_TOOLSinduduclaw-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.jsonagent-file-guard hook;project,localsaves the same tokens while keeping it).estimate_tokenswas 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/listis 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] enabledand PORTICOscoped_toolsgrants), so discoverable ⇔ callable — measured 215 tools / 120,092 bytes → 170 / 81,743 (−31.9%) for a scaffold agent when O7 landed; with the 241ToolDefentries of v1.69.0 a scaffold employee'stools/listis 167 tools / 79,705 bytes. The old DEFERRED note ("hiding undeclared tools makes them uncallable") no longer applies: the server declarestools.listChangedand the stdio loop emitsnotifications/tools/list_changedwhen the caller's visible SET actually changes (5s poll, set comparison not mtime), so a mid-session grant/agent_update/agent.tomledit 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 bymcp::tools_list_budget_tests— tool descriptions 51,822 → 33,944 bytes, parameter descriptions 31,604 → 27,120 across all 243 tools; long prose lives indocs/guides/mcp-tools.md. The 241ToolDefentries (count re-derived 2026-10-04; 249 before the v1.69.0 removals) now live incrates/duduclaw-cli/src/mcp/tools_def/split into 16 family files (re-derive the count withgrep -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_spawnpasses 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 fromFailureReason— never raw stderr. - MCP HTTP/SSE Transport (W20-P1/P2, v1.9.4):
duduclaw http-server --bind 127.0.0.1:8765exposes 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.rsmanages 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'sFailoverstrategy + cooldowns), model (failover::model, formerly the top-levelllm_fallbackmodule: hard timeout / 503 / 429 / "overloaded" → the agent's configured lighterfallbackmodel, 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 returnsErrcontaining "hard timeout" so the fallback triggers reliably; UTF-8 truncation of the audited trigger error useschar_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.rs1685 lines), reliability guarantees (reliability.rs324 lines). HTTP endpoints exposed viahandlers.rsand surfaced in the WebReliabilityPage. - LOCOMO memory evaluation (
python/duduclaw/memory_eval/, v1.9.4 / W21):retrieval_accuracy/retention_rate/locomo_integrity_checkmodules, pluscron_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-minutesmoke_testP0,build_golden_qa.pybuilds the gold-standard QA set from LOCOMO data, 200-entrydata/golden_qa_set.jsonlfirst batch.duduclaw-memoryengine 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 atpython/duduclaw/mcp/: API Key auth with key masking, memory tools (store/read/search/namespace/quota) with strict scope enforcement atexecute()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 withtry_sendto avoid reverse-blocking. Op 9 Invalid Session readsd.boolto choose RESUME vs IDENTIFY with 1-5s jitter. Close codes 4007/4009/4003 clear session for fresh IDENTIFY. Backoff cap 300s→60s. HandlesRESUMEDdispatch. - Heartbeat task-board pull is now scheduler-level (v1.9.3):
poll_assigned_tasksmoved out ofexecute_heartbeat(which only ran forenabled=trueagents — 16 of 17 production agents hadenabled=falseand never received task-board pulls) intoHeartbeatScheduler::runtick 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.rs1,328 LOC,paperclip 路線兩度轉向後無消費者;匯入方向migrate from paperclip保留);Git worktree L0 隔離(gateway/worktree.rs1,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);licensefeatures.toml三個零讀取端 quota 欄位(max_local_models/max_messages_per_month/office_hour_hours_per_month);MCPlog_mood(描述四個字,語意與user_profile_record重疊);一次性 CLIops tunnel/ops memory bench/rl export|stats|reward(reforward與evolution clear-holdout-rotation改--help隱藏而非刪除——後者是唯一能清 AEEholdout_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/listentry and stays callable, with[deprecated → <new tool> <param>]prefixed to itsdescriptionanddeprecated: trueon itsduduclaw_core::tool_catalogrow (hiding a tool fromtools/listmakes it uncallable, which is the opposite of what a deprecation window is for); a CLI subcommand becomes a claphide = truealias (gone from--help, still parsed); aconfig.tomlvalue still parses andwarn!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 isdocs/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
- Primary: warm amber (
- 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
- Warmth over sterility — Every surface should feel inviting. Prefer warm neutrals over cold grays. Use color strategically to create emotional connection.
- Clarity over density — Show what matters, hide what doesn't. Progressive disclosure: summary first, details on demand. Never overwhelm.
- 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.
- 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.
- 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.
- Never slice strings by raw byte index.
&s[..n]panics whennlands mid-char on multi-byte UTF-8 (any CJK/emoji input). Useduduclaw_core::truncate_bytes(s, max_bytes)(byte budget, walks back to a char boundary) ortruncate_chars(s, max_chars)(codepoint count). Applies to every channel/log snippet and id prefix. - No unanchored
contains/starts_withfor security or routing decisions. Substring checks lethttp://localhost.evil.compass alocalhostallowlist and the keywordhimatch insidethis. Useduduclaw_core::origin_host_matches(origin, &allowed)for Origin/CORS allowlists andword_contains_ci(haystack, needle)for keyword matching; use exact/token equality for id routing. - 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 overPIPE_BUFinterleave and corrupt lines. Wrap the write induduclaw_core::with_file_lock(path, || …). - 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)
| Tier | Meaning | Git state | Lives in |
| L1 Public | Product / developer docs intended for the public repo, website, npm/PyPI README | Committed, externally published | root README*.md, CHANGELOG.md, ARCHITECTURE.md, SECURITY.md, LICENSING.md, docs/, templates/, marketing/press-kit/ |
| L2 Internal | Dev/ops material — committed but not product-facing | Committed (visible to repo collaborators), not polished docs | wiki/ (knowledge base + reports), team/, ISSUES.md, marketing/{blog,social-templates,threads-drafts}/ |
| L3 Confidential | Commercial plans, competitive analysis, pricing, research notes, secrets, build output | gitignored — never committed to the public repo | commercial/ (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; neverdaily-report-*and never indocs/,reports/, orartifacts/)wiki/reports/skill-pipeline/<YYYY-MM>/,wiki/reports/memory-quality/<YYYY-MM>/— automated pipeline/eval outputswiki/sprint-reports/,wiki/pm/— sprint logs & PM trackingwiki/duduclaw-kb/{architecture,decisions,specs,drafts,w19,sprint-n}/— internal knowledge basewiki/{eval,impl,research}/— evaluation sets, implementation notes, internal design feedbackteam/— 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
- Is it secret / commercial / competitive / a research note? → L3 gitignored tree. Stop.
- Is it a daily/sprint/eval/PM report or internal KB? → L2 under
wiki/(reports →wiki/reports/…). - Is it polished product/dev documentation safe to publish? → L1 under the matching
docs/<type>/subdir. - Update
docs/README.md(the public index) whenever adocs/file is added, moved, or removed; update in-repo links (READMEs,AGENTS.md, code comments,CONTRACT.toml) in the same commit.
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
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.

