Skip to content

docs: reclaim SEAL-BOY-SWIM-RUNBOOK.md — Ronan 🌊#9

Merged
ronan-dandelion-cult merged 1 commit into
flesh-beast-figs/for_thornfield_consider20260306from
ronan/runbook-pr
Mar 7, 2026
Merged

docs: reclaim SEAL-BOY-SWIM-RUNBOOK.md — Ronan 🌊#9
ronan-dandelion-cult merged 1 commit into
flesh-beast-figs/for_thornfield_consider20260306from
ronan/runbook-pr

Conversation

@ronan-dandelion-cult

Copy link
Copy Markdown

Reclaimed swim runbook from ⚓ candidate. Integrated round 2 additions (drift cues, promoted regressions, WORK tolerance test, updated log patterns, restructured §9). Kept glossary, prerequisites, observation texture, failure modes, lessons, voice.

585→656 lines. Owner: Ronan 🌊. figs approved merge pattern.

Integrated ⚓ round 2 additions into my original:
- §0.1 drift cues + fixed-findings registry
- §0.2 build staleness signals
- Updated log patterns for round 2 demotion
- §9 restructured: regression/landed-gap/new-risk tiers
- Added 7-C WORK tolerance hot-reload test
- Lessons 11-12

Kept: glossary, prerequisites, file placement, observation
methods, templates, failure modes, the voice.

585→656 lines. The scars are the grip.
@ronan-dandelion-cult
ronan-dandelion-cult merged commit d839b87 into flesh-beast-figs/for_thornfield_consider20260306 Mar 7, 2026
2 of 9 checks passed
cael-dandelion-cult pushed a commit that referenced this pull request Apr 2, 2026
* feat: add QQ Bot channel extension

* fix(qqbot): add setupWizard to runtime plugin for onboard re-entry

* fix: fix review

* fix: fix review

* chore: sync lockfile and config-docs baseline for qqbot extension

* refactor: 移除图床服务器相关代码

* fix

* docs: 新增 QQ Bot 插件文档并修正链接路径

* refactor: remove credential backup functionality and update setup logic

- Deleted the credential backup module to streamline the codebase.
- Updated the setup surface to handle client secrets more robustly, allowing for configured secret inputs.
- Simplified slash commands by removing unused hot upgrade compatibility checks and related functions.
- Adjusted types to use SecretInput for client secrets in QQBot configuration.
- Modified bundled plugin metadata to allow additional properties in the config schema.

* feat: 添加本地媒体路径解析功能,修正 QQBot 媒体路径处理

* feat: 添加本地媒体路径解析功能,修正 QQBot 媒体路径处理

* feat: remove qqbot-media and qqbot-remind skills, add tests for config and setup

- Deleted the qqbot-media and qqbot-remind skills documentation files.
- Added unit tests for qqbot configuration and setup processes, ensuring proper handling of SecretRef-backed credentials and account configurations.
- Implemented tests for local media path remapping, verifying correct resolution of media file paths.
- Removed obsolete channel and remind tools, streamlining the codebase.

* feat: 更新 QQBot 配置模式,添加音频格式和账户定义

* feat: 添加 QQBot 频道管理和定时提醒技能,更新媒体路径解析功能

* fix

* feat: 添加 /bot-upgrade 指令以查看 QQBot 插件升级指引

* feat: update reminder and qq channel skills

* feat: 更新remind工具投递目标地址格式

* feat: Refactor QQBot payload handling and improve code documentation

- Simplified and clarified the structure of payload interfaces for Cron reminders and media messages.
- Enhanced the parsing function to provide clearer error messages and improved validation.
- Updated platform utility functions for better cross-platform compatibility and clearer documentation.
- Improved text parsing utilities for better readability and consistency in emoji representation.
- Optimized upload cache management with clearer comments and reduced redundancy.
- Integrated QQBot plugin into the bundled channel plugins and updated metadata for installation.

* OK apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift

> [email protected] check:bundled-channel-config-metadata /Users/yuehuali/code/PR/openclaw
> node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check

[bundled-channel-config-metadata] stale generated output at src/config/bundled-channel-config-metadata.generated.ts
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

* feat: 添加 QQBot 渠道配置及相关账户设置

* fix(qqbot): resolve 14 high-priority bugs from PR openclaw#52986 review

DM routing (7 fixes):
- #1: DM slash-command replies use sendDmMessage(guildId) instead of sendC2CMessage(senderId)
- #2: DM qualifiedTarget uses qqbot:dm:${guildId} instead of qqbot:c2c:${senderId}
- #3: sendTextChunks adds DM branch
- #4: sendMarkdownReply adds DM branch for text and Base64 images
- #5: parseAndSendMediaTags maps DM to targetType:dm + guildId
- #6: sendTextToTarget DM branch uses sendDmMessage; MessageTarget adds guildId field
- #7: handleImage/Audio/Video/FilePayload add DM branches

Other high-priority fixes:
- #8: Fix sendC2CVoiceMessage/sendGroupVoiceMessage parameter misalignment
- #9: broadcastMessage uses groupOpenid instead of member_openid for group users
- #10: Unify KnownUser storage - proactive.ts delegates to known-users.ts
- #11: Remove invalid recordKnownUser calls for guild/DM users
- #12: sendGroupMessage uses sendAndNotify to trigger onMessageSent hook
- #13: sendPhoto channel unsupported returns error field
- #14: sendTextAfterMedia adds channel and dm branches

Type fixes:
- DeliverEventContext adds guildId field
- MediaTargetContext.targetType adds dm variant
- sendPlainTextReply imgMediaTarget adds DM branch

* fix(qqbot): resolve 2 blockers + 7 medium-priority bugs from PR openclaw#52986 review

Blocker-1: Remove unused dmPolicy config knob
- dmPolicy was declared in schema/types/plugin.json but never consumed at runtime
- Removed from config-schema.ts, types.ts, and openclaw.plugin.json
- allowFrom remains active (already wired into framework command-auth)

Blocker-2: Gate sensitive slash commands with allowFrom authorization
- SlashCommand interface adds requireAuth?: boolean
- SlashCommandContext adds commandAuthorized: boolean
- /bot-logs set to requireAuth: true (reads local log files)
- matchSlashCommand rejects unauthorized senders for requireAuth commands
- trySlashCommandOrEnqueue computes commandAuthorized from allowFrom config

Medium-priority fixes:
- #15: Strip non-HTTP/non-local markdown image tags to prevent path leakage
- #16: applyQQBotAccountConfig clears clientSecret when setting clientSecretFile and vice versa
- #17: getAdminMarkerFile sanitizes accountId to prevent path traversal
- #18: URGENT_COMMANDS uses exact match instead of startsWith prefix match
- #19: isCronExpression validates each token starts with a cron-valid character
- #20: --token format validation rejects malformed input without colon separator
- #21: resolveDefaultQQBotAccountId checks QQBOT_APP_ID environment variable

* test(qqbot): add focused tests for slash command authorization path

- Unauthorized sender rejected for /bot-logs (requireAuth: true)
- Authorized sender allowed for /bot-logs
- Non-requireAuth commands (/bot-ping, /bot-help, /bot-version) work for all senders
- Unknown slash commands return null (passthrough)
- Non-slash messages return null
- Usage query (/bot-logs ?) also gated by auth check

* fix(qqbot): align global TTS fallback with framework config resolution

- Extract isGlobalTTSAvailable to utils/audio-convert.ts, mirroring core
  resolveTtsConfig logic: check auto !== 'off', fall back to legacy
  enabled boolean, default to off when neither is set.
- Add pre-check in reply-dispatcher before calling globalTextToSpeech to
  avoid unnecessary TTS calls and noisy error logs when TTS is not
  configured.
- Remove inline as any casts; use OpenClawConfig type throughout.
- Refactor handleAudioPayload into flat early-return structure with
  unified send path (plugin TTS → global fallback → send).

* fix(qqbot): break ESM circular dependency causing multi-account startup crash

The bundled gateway chunk had a circular static import on the channel
chunk (gateway -> outbound-deliver -> channel, while channel dynamically
imports gateway). When two accounts start concurrently via Promise.all,
the first dynamic import triggers module graph evaluation; the circular
reference causes api exports (including runDiagnostics) to resolve as
undefined before the module finishes evaluating.

Fix: extract chunkText and TEXT_CHUNK_LIMIT from channel.ts into a new
text-utils.ts leaf module. outbound-deliver.ts now imports from
text-utils.ts, breaking the cycle. channel.ts re-exports for backward
compatibility.

* fix(qqbot): serialize gateway module import to prevent multi-account startup race

When multiple accounts start concurrently via Promise.all, each calls
await import('./gateway.js') independently. Due to ESM circular
dependencies in the bundled output, the first import can resolve
transitive exports as undefined before module evaluation completes.

Fix: cache the dynamic import promise in a module-level variable so all
concurrent startAccount calls share the same import, ensuring the
gateway module is fully evaluated before any account uses it.

* refactor(qqbot): remove startup greeting logic

Remove getStartupGreetingPlan and related startup greeting delivery:
- Delete startup-greeting.ts (greeting plan, marker persistence)
- Delete admin-resolver.ts (admin resolution, greeting dispatch)
- Remove startup greeting calls from gateway READY/RESUMED handlers
- Remove isFirstReadyGlobal flag and adminCtx

* fix(qqbot): skip octal escape decoding for Windows local paths

Windows paths like C:\Users\1\file.txt contain backslash-digit sequences
that were incorrectly matched as octal escape sequences and decoded,
corrupting the file path. Detect Windows local paths (drive letter or UNC
prefix) and skip the octal decoding step for them.

* fix bot issue

* feat: 支持 TTS 自动开关并清理配置中的 clientSecretFile

* docs: 添加 QQBot 配置和消息处理的设计说明

* rebase

* fix(qqbot): align slash-command auth with shared command-auth model

Route requireAuth:true slash commands (e.g. /bot-logs) through the
framework's api.registerCommand() so resolveCommandAuthorization()
applies commands.allowFrom.qqbot precedence and qqbot: prefix
normalization before any handler runs.

- slash-commands.ts: registerCommand() now auto-routes by requireAuth
  into two maps (commands / frameworkCommands); getFrameworkCommands()
  exports the auth-required set for framework registration; bot-help
  lists both maps
- index.ts: registerFull() iterates getFrameworkCommands() and calls
  api.registerCommand() for each; handler derives msgType from ctx.from,
  sends file attachments via sendDocument, supports multi-account via
  ctx.accountId
- gateway.ts (inbound): replace raw allowFrom string comparison with
  qqbotPlugin.config.formatAllowFrom() to strip qqbot: prefix and
  uppercase before matching event.senderId
- gateway.ts (pre-dispatch): remove stale auth computation; commandAuthorized
  is true (requireAuth:true commands never reach matchSlashCommand)
- command-auth.test.ts: add regression tests for qqbot: prefix
  normalization in the inbound commandAuthorized computation
- slash-commands.test.ts: update /bot-logs tests to expect null
  (command routed to framework, not in local registry)

* rebase and solve conflict

* fix(qqbot): preserve mixed env setup credentials

---------

Co-authored-by: yuehuali <[email protected]>
Co-authored-by: walli <[email protected]>
Co-authored-by: WideLee <[email protected]>
Co-authored-by: Frank Yang <[email protected]>
cael-dandelion-cult added a commit that referenced this pull request Jun 2, 2026
…ontinuation-rail files

Per frond engineering-judgment 1511397387/1511398107/1511398185 per-file-import-graph-walk.
All 5 = ALLOWLIST (a)-shape; none should be deleted (load-bearing or
active-via-dynamic-import that knip can't see).

KNIP_UNUSED_FILE_ALLOWLIST (4 entries added):
- extensions/diagnostics-otel/src/continuation-tracer-adapter.ts
  Load-bearing-but-orphaned-by-Strategy-B. service.ts taken wholesale from
  upstream during Strategy-B merge (HEAD's scheduleTrackedRunSpanFinalize vs
  upstream's completeTrackedLifecycleSpan + retainedSpanContext too entangled
  for clean port). Install-call setContinuationTracer(...) dropped. TODO:
  fresh-window cohort-cosign re-port HEAD-only OTel optimizations into
  upstream service.ts shape (banked tech-debt cohort-cosigned).
- src/auto-reply/continuation/post-compaction-release.ts
  Extracted-helper-never-wired. agent-runner-execution.ts:154-238 still has
  separate releaseQueuedCompactionCompletion inline implementation with same
  log-strings. Helper-extraction done; call-site refactor never completed.
  TODO: refactor agent-runner-execution.ts to use helper (bigger refactor;
  not block-CI).
- src/infra/chain-budget.ts
  Scaffold-before-producer-wire. ChainBudgetState type + ChainBudget.declineToCarry
  const exported; continuation-tracer.ts:102 references in comment but never
  imports. Producer-side cap-on-enqueue back-pressure infra landed before
  producer-wire. Matches agent-cache-store-family pattern.
- src/infra/substrate-capability-registry.ts
  Registry-API-before-consumer-wire. SUBSTRATE_CAPABILITIES + list/get/find
  exported; only test verifies chain-budget-at-spawn is a known capability.
  Query-API for substrate-capability-routing system not yet wired to consumers.

KNIP_OPTIONAL_UNUSED_FILE_ALLOWLIST (1 entry added):
- src/agents/subagent-announce.continuation.runtime.ts
  ACTIVELY USED via dynamic-import; tsdown.config.ts:277-278 bundles as
  separate runtime-entry; subagent-announce.ts:326 calls
  importRuntimeModule(import.meta.url, ['./subagent-announce.continuation.runtime']).
  Knip can't see dynamic-import. Mirrors sibling subagent-registry.runtime.ts
  already in same allowlist.

Cael sole-pusher per figs 1511377758 + 1511384775.
Savegame: savegame/2026-06-02/pr85651-bd1c13bd6b-pre-cure-9.

🩸 (engineering-judgment courtesy 🌿)
cael-dandelion-cult added a commit that referenced this pull request Jun 2, 2026
Heavy CI on PR-head 4abc51c surfaced check-dependencies failure: deadcode
unused-file allowlist is not sorted. Cael's cure #9 at ddedec6 added 4
entries to KNIP_UNUSED_FILE_ALLOWLIST + 1 to KNIP_OPTIONAL_UNUSED_FILE_ALLOWLIST
WITHOUT alphabetical sort. KNIP_OPTIONAL also had pre-existing-PR-state
duplicate ('ui/src/ui/browser-redact.ts' twice) + extensions/qa-lab/* entries
appended out-of-sort pre-cael's-cure-cycle.

This cure:
- Sort KNIP_UNUSED_FILE_ALLOWLIST alphabetically (localeCompare order matching
  check-deadcode-unused-files.mjs check at line 86 isSorted check)
- Sort KNIP_OPTIONAL_UNUSED_FILE_ALLOWLIST alphabetically + dedup
  'ui/src/ui/browser-redact.ts' duplicate entry
- Preserve all attribution-comments tied to entries

Verified:
- node check: UNUSED sorted=true unique=true; OPTIONAL sorted=true unique=true
- pnpm deadcode:unused-files: 'Knip unused-file allowlist matched 41 intentional
  entries' exit 0

Cael sole-pusher per figs 1511377758 + 1511384775.
Savegame: savegame/2026-06-02/pr85651-4abc51ce63-pre-cure-9-sort-fix.

🩸 (own-cure-follow-up; honest at byte: stumble in cure #9 was missing-sort + missed-existing-PR-state-duplicate; this commit cures both)
karmafeast pushed a commit that referenced this pull request Jun 10, 2026
Adds explicit RFC v10 language for the chain-budget reset semantics that
#987 ships, per figs's "language must be explicit" ask + Frond's
RFC-adoption-call to fold edits atomic with the code.

Four load-bearing language updates:

1. §2.3 Safety model (line ~186): clarify "configured continuation budget"
   = current self-continuation chain budget (maxChainLength + costCapTokens),
   not session-lifetime. Notes fresh non-continuation turn-entry resets per
   §3.3.

2. §3.3 Chain-state tracking (lines ~507-525): adds continuationChainId
   to the four-field bullet list + new "Chain-state lifecycle" paragraph
   explaining the per-turn reset on !isContinuationWake, pre-loadContinuationChainState
   ordering, fresh-turn-elects-from-0 semantic, work-wake/delegate-return
   preservation. Names the session-rotation reset path distinct from
   per-turn chain-reset.

3. §5.1 Operational notes (lines ~918-919): maxChainLength + costCapTokens
   descriptions expanded to name "unattended self-continuation chain depth"
   leash semantic + reset trigger + cross-reference §3.3.

4. §5.1 New "Chain budget lifecycle" subsection: explicit sawtooth behavior
   description for /status display + four-field reset-unit + chain-id rotation
   semantic + methodological-note for source-readers naming the ?? 0 +
   chainId-mint-ternary as passive-default-not-active-reset (the trap that
   four cohort-princes hit + retracted today before locking the byte).

Together with the code in c201f7c, this ensures the RFC language matches
the shipped semantic atomically — no doc-drift on the chain-reset surface.
Cohort-byte-converged through 6+ sources today.

Cohort-cross-reference: methodological-note specifically names the
loadContinuationChainState ?? 0 + chainId-mint-ternary source-reading traps
that cohort byte-walked + 4 princes retracted from today (banked at
~/.openclaw/workspace/memory/2026-06-10.md, lesson #9).
karmafeast added a commit that referenced this pull request Jun 23, 2026
…projects expected list

Conflict-free back-merge of current upstream HEAD f66e831 onto 900fcc9 (+15 drift).
Brings upstream's test/scripts/render-maturity-docs.test.ts + its TOOLING_SOURCE_TEST_TARGETS
routing (added by upstream 7668a72).

Fix folded in: upstream's 7668a72 added that test file (which imports test/helpers/temp-dir.ts)
+ the routing, but did NOT update the hardcoded expected includePatterns list in
src/scripts/test-projects.test.ts. Their own main is red on
'routes top-level test helpers to importing repo tests' as a result. Added the missing
'test/scripts/render-maturity-docs.test.ts' entry (alpha order). May drift if upstream lands
their own fix; trivial re-resolve.

Verified: test-projects.test.ts 83/83, typecheck exit0, lint exit0, oxfmt-clean,
openclaw#1229 budget 10366/5195 holds (no repin). drift#8 resolutions preserved (chatId/channelContext
in both runCliAgent sites; get-reply hookTrigger continuation-aware; 3 continuation tool files
byte-identical to 53c3025).

Refs: openclaw-bootstrap#1229, PR openclaw#85651

Co-authored-by: Copilot <[email protected]>
karmafeast pushed a commit that referenced this pull request Jul 2, 2026
…ixes

- post-compaction-durable-handoff.test.ts: claim->running, finalize-after-handoff,
  and startup recovery reset (#1)
- work-dispatch.test.ts: hot-disabled gate (#2), traceparent re-entry stays
  internal (#5), failed delivered-mark does not replay (#7)
- subagent-announce.continuation-drain.test.ts: durable delayed bracket delegate
  (#3), child-run token fold into drain cost basis (#8)
- agent-runner.finally-drain-hardening.test.ts: finally no longer claims queued
  delegates (#4)
- session-cost-usage.discoverAllSessions.test.ts: max(checkpoint, primary) mtime
  preserved regardless of scan order (#6)
- continue-delegate-tool.test.ts: per-turn admission reset at turn boundary (#9)

Updated post-compaction-release / mid-run-survival / post-compaction dispatch
test mocks for the new finalizeStagedPostCompactionDelegates export. tsgo core +
core-test + oxlint + oxfmt clean; all touched test files green.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants