Repository navigation
refactor(hooks): await native relay persistence and drainage - #144828
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 11:06 AM ET / 15:06 UTC (Revision 5). ClawSweeper reviewWhat this changesMakes native hook relay publication, renewal, and cleanup awaitable while preserving Gateway fallback and hooks retained for child runs. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, maintainer-sponsored change absent from current main. The earlier Gateway fallback blocker is resolved, and no new blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherNative hook commands connect Codex tool events to OpenClaw policy through a local listener or the Gateway. The relay owns the SQLite locator, live registration, and cleanup that make those calls available. flowchart LR
A[Codex thread preparation] --> B[Relay publication and authority check]
B --> C[SQLite locator]
D[Native hook command] --> C
C --> E[Local listener]
D --> F[Gateway fallback]
E --> G[Current relay policy]
F --> G
G --> H[Hook response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +244, Tests +768, Docs +11. Total +1023 across 39 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep lifecycle completion with the existing relay owner, preserve fallback and retained-child contracts, and leave the actual SQLite worker cutover to the broader storage initiative. Do we have a high-confidence way to reproduce the issue? Not applicable as a standalone bug report: this is asynchronous lifecycle groundwork with focused fault-injection coverage; no runtime reproduction was executed during this review. Is this the best way to solve the issue? Yes. Extending the existing relay owner and awaiting its operations avoids competing lifecycle ownership while retaining the supported fallback and public handle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af73c58582b5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
873e3ff to
44ab9e2
Compare
|
Merged via squash.
|
…w#144828) * refactor(hooks): await native relay persistence and drainage * test(codex): retain relay retirement beyond deadline simulation * fix(codex): preserve Gateway hooks when direct relay publication fails * test(codex): include native hook fallback in full suite
…45810) ## What Problem This Solves Operators who copied the shipped redaction strings into `logging.redactPatterns` lost form-body and structured authorization protection after #145553. Public SDK and subsystem-console output could expose encoded form values and Digest credentials. The built-in AWS secret access key detector also shortened public URL paths ending in `@latest` or followed by a query containing `@`. Compact serialized URLs could share the wrong authority state. The final file-log `message` was affected too. Ordinary 40-character hashes unnecessarily triggered a full pattern scan. Follow-up to #145553 and #144059. Found by adversarial round 3. ## Why This Change Was Made - `redactPatterns` replaces the string list; built-in structural protections always apply. Form-body and structured-auth preprocessing run at the owner without list-identity recognition. Every enabled resolution includes the same AWS matcher, including current copied defaults, older lists, default-plus-extra and custom-only configurations. - `matchAwsSecretAccessKeys` owns unlabelled AWS candidate classification. Its shared value expression also supplies the fast admission check. Explicit secret-field names retain their separate field contract. - Each candidate captures its own URL context. The scanner waits until whitespace or end to classify pending candidates, so later raw-userinfo punctuation can settle the original authority without a sibling URL overwriting it. - Authority ends at `/`, `?`, or `#`. An `@` in a path or query cannot turn an earlier public path into userinfo. The public preservation boundary and the URL context lifetime are separate: punctuation can shorten the former, while the matching original delimiter at the same escape depth ends the latter. Query/fragment context prevents nested URL-looking text from restarting public shielding. - Support exports replace their separate AWS regex with the shared matcher. Their vendor pass uses the existing full-context option, so long tokens and boundary assertions remain intact before support applies its full AWS marker. Existing field and private-data stages follow. The built-in decision whether an unlabelled 40-character value is an AWS secret access key is made by exactly one mechanism at `src/logging/redact-patterns.ts:99` (`matchAwsSecretAccessKeys`). The prefilter consumes that matcher’s value probe, and diagnostic support consumes that matcher’s decisions. ## User Impact - Built-in redaction preserves public `path@latest` and query-at paths, plus compact and escaped URL siblings. Existing raw-userinfo and nested-query credential cases remain masked. - File logging preserves complete public URLs in the final written message. Ordinary hash-filled objects avoid the full redaction walk. - A late review exposed slash-containing database passwords skipped by the narrowed prefilter. Baseline SDK/console masked them; the candidate leaked them. The generic URL admission probe now includes those passwords, so the existing database rule runs. AWS classification and the hash probe are unchanged. - The established malformed numeric-port/path candidate ending in `@` still masks. Its sibling without terminal `@` stays intact. This explicit ambiguity does not redefine ordinary path `@` as authority. - Copied string lists and custom-only lists retain form, structured-auth and bare-AWS protection in SDK and console output. `getDefaultRedactPatterns` returns only serializable strings; the internal executable registry still serves browser/default consumers. Tool and final file routes also retain their fixed string rules. - Older copied regexes retain their literal behavior, including their previous URL false positives. Operator patterns are not rewritten, and previously damaged stored text cannot be recovered. Support vendor rules had also lost full-context metadata. With custom-only strings, the real `gateway diagnostics export` path (`register.ts` → exporter → configured reader) stored a raw long-token tail. Actual ZIP field lengths: original11, intermediate240(red), final11(green). The custom marker masks on every pin. Default-config CLI masks upstream on all pins; injected-reader ZIP probes remain supplemental. Configuration remains a string list. No schema, migration, protocol, CLI option, public SDK argument, or updater change is introduced. The retired custom-only form-disablement expectation was the bug; docs, SDK guidance and configuration help now describe the accepted structural contract. ## Evidence Candidate `f7e9e940b8df674bbdca31bb679fc3942a42efee` adds only a docs correction to `78869554857369b9dcb3b9e8145dd36d740de03c`. General runtime proof executed at `771474bbb4ab78736971e75da0329eafba8260ea`; relevant sources are unchanged except the support adapter, separately proved through the actual CLI at788. Browser/Telegram proof retains its19634179 execution identity for unchanged scanner/rendering behavior. Generated config-doc hashes and config:docs:check pass. No historical execution is relabeled as new. | Registered path or final artifact | Current candidate result | | --- | --- | | Public security-runtime SDK, tool payload, subsystem console and final file output | Seven independent configurations × 23 fixtures (161 records) cover current/older/default-plus-extra/custom-only and the unchanged v2026.9.4-authored config; all structural protections remain active | | `getLogger.info` → final file fields | At-version paths, query-at paths, arrays, objects, newline and escaped siblings, comma paths and the no-`@` numeric-port/path sibling remain complete | | Compiled CLI config validation | Six explicit pattern lists validate; retained v2026.9.4-authored config loads and redacts without changing its bytes | | Compiled Gateway config reload and process restart | Both current/older-list sequences pass; new turns use the selected rules and prior history retains its recorded text | | `writeDiagnosticSupportExport` → final ZIP log member | Final compiled head restores complete long-vendor masking; short-token and five-fixture AWS/vendor/public-URL controls pass | | `gateway diagnostics export` → actual ZIP log member | Nonempty custom-only list: intermediate771 retains240 characters; final788 emits exact11-character hint. Default-config sibling stays masked. | | `chat.send` → history and complete provider input; `exec.approval.request/get/resolve` | 184 initialized-conversation scenarios on each pin; all candidate history/provider observations and full approval display pass. Twelve public-context fixtures fail baseline preservation and pass on candidate. Exact-secret precedence uses actual environment-backed secret resolution. | | Telegram Test Server → follow-up provider context | 19 sends and 19 replies on each pin; replayed history within complete provider requests retains candidate public URLs and existing credential masks. Incoming first-send Telegram text is unchanged. Both recordings complete. Runner cleanup failed; exact-owner recovery released both leases. | | Real Control UI → expanded message-tool cards and return legs | Seven real message-tool calls render expected preservation and masking; expanded path, compact, escaped and credential captures were inspected. Calls finish with the normal synthetic unavailable-channel error; external delivery is not claimed. | The final paired benchmark alternates the exact pre-#145553 parent `5678830c8960fdc808f22665551ad8ffba42016d` and final compiled `771474bb` for ten measured samples after two warmups. The 4,096-field, 228,267-byte hash object measures **15.70 ms → 4.35 ms** median with identical full outputs. The complete samples and 39-character control are retained. This establishes the fixture result, not universal throughput. Every final shipped string and the matcher’s exact value expression ran through `src/security/safe-regex.ts` on the execution host with production source/flags: **123 accepted, 0 rejected**. Configured resolution retains all 122 shipped strings plus the shared matcher: **0 silently dropped**. Each pattern result is retained. The supplied Cookie fixture and the `X-Amz-Credential`, `X-Goog-Credential` and `X-Goog-Signature` fixtures remain visible on both pins. This repair does not add protection for those unchanged cases. `X-Amz-Signature` remains masked. Telegram cleanup requires a separate qualification: both recordings completed all 19 actions, but the runner exited 1 during cleanup. The candidate diagnostic captured a process-group existence check returning `EPERM`. The canonical recovery path revalidated ownership, released both leases and removed credential scratch. Clean Gateway shutdown, process/open-file reconciliation and free ports establish settled cleanup. The failing process-group target was not retained, so no exact-ID absence is claimed. The original failures and complete recovery evidence remain available for review. Support proof inspects actual `logs/openclaw-sanitized.jsonl`. Supplemental imported bare/Bearer keys receive the support marker before field rules. Default-config tails retain upstream hints; custom-only CLI tails exercise support masking directly. ## Consumers `redactPatterns` replaces the string list; built-in structural protections always apply when redaction is enabled. Forced safety-boundary helpers retain their default string rules plus configured strings. Fresh typed queries on integration `d0b38ca710db0c8c5889a6521be7a8152bb73d58` (tree `6ecb6c37ccb015591207738af005d1a26e1e93a2`) cover 83 original declarations: 3,028 rows, 1,194 distinct symbol/location pairs, 193 files. Four derived diagnostic declarations add 59 rows across 20 files; combined: 3,087 rows, 1,253 pairs, 207 files, all dispositioned below. Canonical lexical census passes with no manual rows or exemptions. Root resolves all 87 declarations; browser has 83 unresolved core-source positions and SDK/UI each have two dynamic-binding gaps, covered by root. Unloaded/native projects and full dependency declaration checking remain coverage limits. Prior executed query identities and raw outputs are retained. Scope: **I** owner/config/SDK/console/file/support/browser policy; **P** registered chat/history/provider/tool-card/approval pipeline; **D** decision boundary tested as described below; **B** callback/type/re-export linkage; **X** named endpoint excluded from execution claims (source reviewed; derived output can change); **U** updater/triage lifecycle excluded, shared support sink included; **C** other channels excluded by task; **T** Telegram HTTP/cache-error diagnostics excluded, Telegram replay included; **V** validation reader only. Decision proof: 363 tests pass: direct CLI subprocess 12, node WebSocket relay 67, telemetry service/exporter 191, transcript projection 86, public SDK 1, core diagnostic events 6. The final seven-config egress matrix has 161 records, including 98 structural rows, with no recorded leak or SDK/console/file mismatch. This is composed evidence, not every config × plugin operation combination. - Anthropic `withDiagnostics` selects exact environment secrets by field-redaction inequality before raw/URI/JSON replacement and final error display. Explicit tools options use shipped defaults before/after; actual subprocess tests observe error egress. - Node `http/request` uses text inequality to reject credential-bearing requests before forwarding. Actual WebSocket rejection/byte-preservation is tested; remote HTTP execution is excluded. - OTel and core logger attribute admission reject keys changed by redaction. Tests observe final exporter/event attributes. Diagnostic dimension normalization can intentionally replace newly masked labels with `unknown`; live external telemetry is excluded. - Transcript equality predicates retain/drop custom opaque signatures and replay IDs. Projection tests cover provider-specific structural exceptions. Actual opaque-signature acceptance by an external provider is excluded; normal chat provider requests are not relabeled as signature proof. - `redactDisplayLabel` canonicalization affects structured-clone validation, not execution authority. `resolvePluginTrust` masks only returned install-spec display after matching, not its trust decision. | File | Operation / final consumer | Scope | | --- | --- | --- | | `extensions/crabbox/src/crabbox-worker-command-error.ts` | crabboxCommandDetail sanitizes combined stderr/stdout before whitespace collapse and trailing failure excerpt. | X | | `extensions/acpx/src/runtime.ts` | readCodexWrapperStderrTail sanitizes retained child stderr before compact ACP wrapper error diagnostics. | X | | `extensions/anthropic/cli-process.ts` | withDiagnostics selects env values using field-redaction inequality, replaces raw/URI/JSON forms in child stderr, then attaches sanitized Error diagnostic. | D | | `extensions/beam/src/mirror.ts` | Sanitizes user/agent messages and upload title before clipping and remote Beam upload. | X | | `extensions/browser/src/browser/cdp.helpers.ts` | redactCdpErrorText removes CDP URL credentials then sanitizes the full error string. | X | | `extensions/browser/src/browser/chrome-mcp-connect.ts` | Connection failure builds sanitized configured endpoint label; chosen connection target itself is not changed. | X | | `extensions/browser/src/browser/chrome-mcp-result.ts` | formatChromeMcpEndpointForDiagnostic sanitizes endpoint labels used in Chrome MCP tool error messages. | X | | `extensions/browser/src/browser/chrome.diagnostics.ts` | safeChromeCdpErrorMessage and failureDiagnostic sanitize reachability error/cause/message; raw wsUrl is a separate diagnostic field. | X | | `extensions/browser/src/browser/chrome.ts` | Sanitizes child error/startup stderr for diagnostics; singleton recovery uses separate stderrSignals. | X | | `extensions/browser/src/logging/redact.ts` | Browser diagnostic adapter reexports public logging-core functions; no pattern copy or classifier. | I | | `extensions/clickclack/src/http-client.ts` | request sanitizes remote response detail before ClickClackHttpError; status and headers remain separate. | X | | `extensions/codex/src/app-server/context-engine-projection.ts` | pickToolPayloadMetadata/redactPreservedToolValue sanitize metadata and preserved strings before context projection. | X | | `extensions/codex/src/app-server/event-projector-diagnostics.ts` | redactCodexEventKind sanitizes event method text before projector diagnostic logging. | X | | `extensions/codex/src/app-server/sandbox-exec-server-node-relay.ts` | rejectCredentialedCodexNodeHttpRequest rejects headers/URL/decoded body when tool redaction changes text, before node dispatch; disconnect causes are sanitized. | D | | `extensions/codex/src/app-server/tool-progress-normalization.ts` | sanitizeCodexAgentEventValue recursively redacts progress strings/field values before event publication. | X | | `extensions/crabbox/src/crabbox-worker-node-enrollment-diagnostics.ts` | collectCrabboxNodeEnrollmentEvidence sanitizes command evidence before byte-bounded enrollment report. | X | | `extensions/diagnostics-otel/api.ts` | Reexports security-runtime redactSensitiveText to OTel recorder and attribute owners. | B | | `extensions/diagnostics-otel/src/service-attributes.ts` | assignOtelLogAttribute/assignOtelEventAttributes reject changed keys; redactOtelAttributes masks values; securityTargetNameAttr validates normalized labels. | D | | `extensions/diagnostics-otel/src/service-content-normalization.ts` | normalizeOtelLogString and JSON serializers sanitize captured content before attribute length/array bounds. | X | | `extensions/diagnostics-otel/src/service-genai-attributes.ts` | assignGenAiSpanIdentityAttrs writes redacted raw requested model to span model attribution. | X | | `extensions/diagnostics-otel/src/service-recorders-model.ts` | Model call recorder sanitizes error category before SpanStatusCode.ERROR status message. | X | | `extensions/diagnostics-otel/src/service-recorders-operations.ts` | Session state/recovery/tool-loop recorders sanitize reason/error strings before counters and span status. | X | | `extensions/diagnostics-otel/src/service-recorders-tools.ts` | Tool recorder sanitizes tool error text before span error status. | X | | `extensions/diagnostics-otel/src/service-recorders-usage.ts` | Webhook/usage recorders sanitize error strings before metric/span attribute and status writes. | X | | `extensions/diagnostics-prometheus/api.ts` | Reexports security-runtime redactSensitiveText to Prometheus service error formatter. | B | | `extensions/diagnostics-prometheus/src/service.ts` | safeErrorMessage sanitizes and bounds exporter error text, including control-character normalization. | X | | `extensions/discord/src/api.ts` | formatDiscordApiErrorText sanitizes reflected remote errors before DiscordApiError construction. | C | | `extensions/discord/src/error-body.ts` | summarizeDiscordResponseBody redacts provider summary before bounded Discord error text. | C | | `extensions/discord/src/internal/rest-errors.ts` | isSensitiveDiscordErrorKey uses field redaction as secret-key predicate; redactDiscordErrorBody sanitizes nested values and collision-safe keys before structured Discord error construction. | C | | `extensions/github-copilot/embeddings.ts` | discoverEmbeddingModels and embedMany sanitize non-OK response bodies before provider HTTP errors. | X | | `extensions/googlechat/src/api.ts` | readGoogleChatErrorResponse sanitizes response text before surfaced request error. | C | | `extensions/lmstudio/src/models.fetch.ts` | redactLmstudioLoadError removes active request credentials then canonical token text before model-load error. | X | | `extensions/matrix/src/matrix/sdk/logger.ts` | formatMessage formats SDK arguments then redacts the Matrix log line. | C | | `extensions/memory-core/src/memory/manager-provider-lifecycle.ts` | Records sanitized initialization/recovery reasons and bootstrap-sync warnings; provider choice is separate. | X | | `extensions/memory-core/src/memory/manager-search-orchestration.ts` | Search bootstrap sanitizes provider-retirement and fallback-sync warning text; error state selects recovery. | X | | `extensions/memory-core/src/memory/manager-sync-outcome.ts` | MemorySyncOutcomeLedger.recordActiveFailure stores sanitized reason with failure revision. | X | | `extensions/nextcloud-talk/src/guarded-response.ts` | readNextcloudTalkErrorBody removes known credential bytes then redacts remote error body. | C | | `extensions/openai/openai-chatgpt-oauth-token.runtime.ts` | normalizeTokenErrorSummary sanitizes token endpoint error summary before its bounded OAuth failure message; token selection is separate. | X | | `extensions/openai/realtime-host.ts` | openAIRealtimeHost supplies canonical redactor callback to realtime capability implementation. | X | | `extensions/parallel/src/parallel-web-search-provider.runtime.ts` | runParallelSearch layers current configured text redaction with forced tool defaults before non-OK Parallel API errors. | X | | `extensions/qa-lab/src/gateway-log-redaction.ts` | redactQaGatewayDebugText sanitizes Gateway QA captures before extra QA secret-array/header patterns; not production redaction policy. | X | | `extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-cli.ts` | redactMatrixQaCliOutput sanitizes Matrix QA CLI captures; outside selected Telegram evidence. | C | | `extensions/reef/src/transport.ts` | redactReefRelayErrorMessage removes known credentials then sanitizes remote relay error string. | X | | `extensions/slack/src/errors.ts` | redact sanitizes Slack error detail strings before their combined error message. | C | | `extensions/slack/src/monitor/media.ts` | formatSlackMediaFailure redacts download failures before bounded diagnostic/model media error. | C | | `extensions/sms/src/twilio.ts` | TwilioApiError redacts response text before parsing error fields and exposing message/structured response. | C | | `extensions/telegram/src/send-context.ts` | createTelegramHttpLogger redacts formatted HTTP failure; closeCachedTelegramClientOptions sanitizes transport-close failure before subsystem warning. Neither callback rewrites delivered Telegram content. | T | | `extensions/voice-call/src/providers/shared/response-body.ts` | readProviderErrorResponseSnippet applies forced tools redaction before voice provider error truncation. | C | | `extensions/whatsapp/src/inbound/message-enrichment.ts` | sanitizeMediaErrorMessage redacts model-facing media failure text before channel URL, phone and identity removal. | C | | `packages/memory-host-sdk/src/host/error-utils.ts` | formatErrorMessage injects forced tool-payload redaction into memory-host error formatter. | X | | `packages/memory-host-sdk/src/host/openclaw-runtime-io.ts` | Reexports canonical redactSensitiveText to buildSessionEntry and memory-host consumers. | B | | `packages/memory-host-sdk/src/host/session-files.ts` | buildSessionEntry redacts user/assistant text before renderSessionExportLines creates memory session entry with provenance. | X | | `packages/plugin-sdk/src/security-runtime.ts` | Workspace security-runtime barrel forwards public redaction contract; no independent policy execution. | I | | `scripts/lib/dev-tooling-safety.ts` | redactForDevToolLog and previewForDevToolLog sanitize tooling logs before preview bounds. | X | | `src/acp/runtime/errors.ts` | Installs canonical tool redactor via configureAcpErrorRedactor before ACP runtime error exports; fallback package rules are general credential formatting, not another logging AWS matcher. | X | | `src/agents/agent-run-terminal-receipt.ts` | formatAgentRunModelRef and normalizeAgentRunRouteChange sanitize model route receipt labels before terminal receipt rendering. | X | | `src/agents/agent-tool-definition-adapter.ts` | formatToolParamPreview redacts serialized tool parameters before console-safe error preview. | P | | `src/agents/agent-tools.before-tool-call.diagnostics.ts` | prepareToolTerminalPresentation redacts terminal formatter text before bounding and presentation. | P | | `src/agents/agent-tools.read.ts` | createOpenClawReadTool applies structured redaction to .env results before model-visible details are returned. | P | | `src/agents/auth-profiles/oauth-manager.ts` | formatRedactedOAuthRefreshError removes current OAuth credentials then sanitizes refresh failure/cause; does not choose or update auth credentials. | X | | `src/agents/bash-tools.exec-approval-followup.ts` | formatDirectExecApprovalFollowupText sanitizes finished/completed background execution body before reply delivery. | X | | `src/agents/bash-tools.exec-runtime.ts` | Background finalizer failure appends sanitized error into retained stderr for observer consumption. | X | | `src/agents/cli-session-store.ts` | settleCliSessionResult sanitizes save-continuity failure into bounded diagnostic attached to result. | X | | `src/agents/command/attempt-execution.ts` | sanitizeAcpDiagnosticText bounds sanitized ACP runtime event diagnostic text. | X | | `src/agents/diagnostic-redaction.ts` | redactAgentDiagnosticPayload runs canonical structured redaction after diagnostic payload sanitation. | X | | `src/agents/embedded-agent-error-observation.ts` | redactObservationText merges configured strings/defaults in forced tools mode before always-on provider error logs. | P | | `src/agents/embedded-agent-runner/run/images.ts` | loadMediaFromRef creates sanitized media reference only for error/diagnostic text; fetch still uses resolved original reference. | X | | `src/agents/embedded-agent-tool-results.ts` | sanitizeToolResult deep-redacts model-facing results; extractToolResultText sanitizes serialized blocks; metadata field values are protected. | P | | `src/agents/mcp-error.ts` | redactMcpDiagnosticError removes reflected response body and sensitive URLs before tool text sanitation. | X | | `src/agents/model-routing-decision.ts` | boundedModelRef sanitizes already selected model route for routing-decision announcement; does not select the provider. | X | | `src/agents/provider-http-errors.ts` | redactProviderErrorBody sanitizes retained provider error metadata; active credential replacement precedes forced tool redaction for reflected transport failures. | X | | `src/agents/provider-local-service.ts` | appendLocalServiceOutputTail sanitizes accumulated child output then removes exact service environment values before retaining tail. | X | | `src/agents/provider-request-header-redaction.ts` | redactProviderResponseErrorText removes reflected request-header secrets before canonical tool redaction. | X | | `src/agents/session-activity-notes.ts` | sanitizeActivityText and summarizeToolArgs redact text before activity-note truncation/summary; state activity remains separately tracked. | X | | `src/agents/session-tool-result-guard.ts` | redactPersistedDetailString/Value sanitize bounded tool details and keys before append, retaining lookahead at truncation boundaries. | P | | `src/agents/tool-display-common.ts` | coerceDisplayValue redacts first display line before the compact tool label truncation. | P | | `src/agents/tool-display-exec.ts` | compactRawCommand and resolveExecTitle redact execution labels before shortening them for tool display. | P | | `src/agents/tool-display.ts` | formatToolDetail redacts inferred tool detail for consumer presentation. | P | | `src/agents/tools/sessions-history-tool.ts` | truncateHistoryText sanitizes sessions_history output and computes its redacted flag from changed text before truncation. | X | | `src/agents/tools/sessions-search-tool.ts` | sanitizeHit sanitizes sessions_search hit snippets before bounded tool result. | X | | `src/agents/transcript-redact.ts` | Credential equality gates custom opaque signatures/replay IDs; provider structural exceptions remain; sanitizes transcript text/fields before storage/replay. | D | | `src/audit/audit-event-writer.ts` | formatAuditWriterError sanitizes bounded audit persistence failure diagnostics; original audit write outcome is separate. | X | | `src/audit/execution-identity-admission.ts` | redactDisplayLabel canonicalizes display labels for structured-clone validation; the label grants no authority. | X | | `src/channels/status/account-state.ts` | resolveUnavailableChannelAccountSnapshot sanitizes failed plugin error into channel status; excludes per-channel activation/status flows. | C | | `src/cli/claws-cli-output.ts` | logClawPlanNotices and logClawUpdatePlanSummary sanitize notice/effect/requirement display text; plan effects and approval data remain original. | X | | `src/cli/claws-cli.runtime.ts` | Sanitizes displayed capability effects and delegates MCP command argv display; integrity/consent uses separately bound plan data. | X | | `src/cli/gateway-cli/register.ts` | Registers gateway diagnostics export; delegates archive production to writeDiagnosticSupportExport. | I | | `src/cli/logs-cli.ts` | logs command journal fallback resolves logging options and redacts joined lines before CLI output; Gateway error display also uses URL sanitation. | I | | `src/cli/update-cli/update-command-fresh-doctor.ts` | Sanitizes full child stderr/stdout before bounded Doctor failure handoff. | U | | `src/cli/update-cli/update-finalization-output.ts` | Finalization output capture sanitizes update stream before retained output snapshot. | U | | `src/commands/onboard-non-interactive/local/output.ts` | Gateway-health recovery output redacts message/detail/hints object before noninteractive onboarding response. | X | | `src/commands/runtime-plugin-install.ts` | finalizeRequiredRuntimePluginInstall sanitizes failure reason before returned installer error result. | X | | `src/commands/status-all/format.ts` | formatStatusServiceValue sanitizes service inspection failure detail/runtime text before status output. | X | | `src/commands/triage-failure.ts` | Sanitizes triage failure fields through redactSupportString before retained report/error output. | U | | `src/commands/triage-prompt.ts` | Triage prompt formats sanitized finding IDs/messages/fix hints for repair model context. | U | | `src/commands/triage-update.ts` | Serializes sanitized update outcome text into byte-bounded triage handoff. | U | | `src/commands/triage.ts` | Triage collection errors, external-agent stdout/stderr and displayed findings use support sanitation; writeDiagnosticSupportExport owns archive creation. | U | | `src/config/io.audit.ts` | sanitizeConfigAuditRecord sanitizes config command argv and entire audit object before appendConfigAuditRecord persists it. | X | | `src/config/redact-argv.ts` | redactSensitiveArgv masks credential flags and changed tool-text arguments while preserving argv shape and optional marker. | X | | `src/config/sessions/session-accessor.sqlite-transcript-store.ts` | redactTranscriptMessageForStorage applies message-aware or structured redaction before SQLite transcript append. | P | | `src/cron/command-output-summary.ts` | redactCronCommandSummaryForExternalDelivery sanitizes retained command output before extra secret-assignment replacement and outbound summary. | X | | `src/cron/run-diagnostics.ts` | normalizeCronRunDiagnostics supplies forced redaction callback to normalized cron diagnostic records. | X | | `src/gateway/client.ts` | createOpenClawGatewayClientHostDeps supplies redactForLog callback; client transport diagnostics use it, while transport credentials are separately registered. | X | | `src/gateway/control-ui-public-session-render.ts` | publicMessageText/renderPublicSessionDocument sanitize messages/title before public HTML serialization. | X | | `src/gateway/health/collector.ts` | projectError sanitizes failed plugin activation error before health response. | X | | `src/gateway/local-user-ingress.ts` | safeDisplayLabel canonicalizes ingress display label for admission facts; authentication is separate. | X | | `src/gateway/server-methods/chat-user-turn-recorder.ts` | createGatewayChatUserTurnController redacts recorded user-turn mention excerpts after accepted chat input. | P | | `src/gateway/server-methods/control-ui.ts` | projectSessionPreview sanitizes lastMessagePreview before bounded Control UI bootstrap preview; title normalization is separate. | X | | `src/gateway/server/hooks.ts` | sanitizeHookLogMetadata redacts string fields before control-character folding/console bounds. | X | | `src/gateway/session-companion-ask.ts` | sanitizeAnswer redacts companion answer then rejects private-reference echoes before returning answer. | X | | `src/gateway/session-companion-context.ts` | normalizeContextText sanitizes transcript text before bounded companion model context. | X | | `src/gateway/session-observer-model.ts` | sanitizeSessionObserverModelText sanitizes model observer summaries before whitespace folding and bounds. | X | | `src/gateway/worker-environments/bootstrap.ts` | commandFailure sanitizes bootstrap stderr/stdout before thrown phase error. | X | | `src/gateway/worker-environments/tunnel-ssh-runner.ts` | workerSshStderrTail sanitizes SSH stderr before bounded tunnel failure excerpt. | X | | `src/gateway/worker-environments/worker-error.ts` | boundWorkerErrorText sanitizes worker failure messages before bounded error text. | X | | `src/gateway/worker-environments/worker-session-tool-result.ts` | workerSessionToolErrorResult sanitizes error before model-facing worker session tool failure. | X | | `src/gateway/worker-environments/worker-turn-computer-rpc.ts` | Computer RPC unavailable response sanitizes bounded message before result transmission; reason enum remains original. | X | | `src/gateway/worker-environments/worker-turn-execution.ts` | Worker process failure sanitizes stderr before thrown execution error; result code controls failure. | X | | `src/gateway/worker-environments/worker-turn-failure.ts` | workerTurnRecoveryError sanitizes formatted recovery failure before bounded turn failure. | X | | `src/gateway/worker-environments/workspace-result-finalize.ts` | workspaceError sanitizes finalize failure before surfaced workspace result. | X | | `src/gateway/worker-environments/workspace-sync-helpers.ts` | workspaceSyncError sanitizes stderr/stdout before constructing sync error. | X | | `src/gateway/ws-log.ts` | formatForLog uses process-cached shipped regex rules to redact strings and composed error chains before bounded WebSocket diagnostics. | P | | `src/infra/error-diagnostics.ts` | attachErrorDiagnostic stores a bounded sanitized diagnostic in its WeakMap attached to Error identity. | X | | `src/infra/errors.ts` | formatErrorMessage/WithCode and formatUncaughtError inject canonical redactor into message/code/stack rendering. | X | | `src/infra/exec-approval-text-sanitize.ts` | sanitizeExecApprovalDisplayTextInternal unions raw/invisible-stripped redaction bitmaps before final approval display. | P | | `src/infra/state-migrations.audit-records.ts` | prepareLegacyAuditRecords sanitizes imported system-agent/config records before stable digest and migrated record preparation. | X | | `src/infra/state-migrations.messages.ts` | recordStartupMigrationWarnings sanitizes joined warnings before terminal-safe startup output. | X | | `src/infra/update-candidate-canary.ts` | Canary child output and Doctor findings are sanitized before retained update diagnostics. | U | | `src/infra/update-candidate-snapshot.ts` | Snapshot child failure sanitizes stderr before thrown update-state snapshot error. | U | | `src/infra/update-failure-report-prepare.ts` | sanitizeReportField removes diagnostic lines then support secrets before update failure report. | U | | `src/infra/update-repair-agent.ts` | Repair prompt fields and extracted repair summary use support sanitation before model handoff/report. | U | | `src/infra/update-repair-worker.ts` | Repair worker diagnostics sanitize error/string values before bounded report. | U | | `src/infra/update-run-codec.ts` | UpdateRunRecordSchema receives mapJsonText-sanitized strings and redacted path roots before run record storage. | U | | `src/infra/update-triage.ts` | Triage export/command failure sanitizes reason before recovery hint and suggested command output. | U | | `src/llm/ai-transport-host.ts` | Configures provider-error redactor and AiTransportHost callbacks so model transport receives canonical sanitized tool data immediately before provider serialization. | P | | `src/logging/code-mode-diagnostic.ts` | Code-mode diagnostic writer sanitizes bounded name metadata serialized to subsystem log. | X | | `src/logging/console.ts` | writeFormattedConsoleOutput redacts a captured console message or stack before stdout/stderr writes; JSON style delegates envelope formatting. | I | | `src/logging/diagnostic-stability-bundle.ts` | readErrorMessage and sanitizeSessionEvidencePath sanitize stability-bundle error/path labels before export. | X | | `src/logging/diagnostic-support-export.ts` | writeDiagnosticSupportExport writes sanitized ZIP members; safeScalar admits only unchanged safe identifiers. | I | | `src/logging/diagnostic-support-log-redaction.ts` | sanitizeLogString scrubs imported log values before ZIP member serialization and truncation. | I | | `src/logging/diagnostic-support-redaction.ts` | redactCommonCredentialTextForSupport uses shared AWS spans with support marker; snapshot/config/string projections then scrub other export identifiers. | I | | `src/logging/json-console-line.ts` | formatJsonConsoleLine redacts nonstructural envelope strings then final serialized JSON; time/level keep structural handling. | I | | `src/logging/log-tail.ts` | readConfiguredLogTail resolves current logging options and redacts the joined final returned lines; multiline credentials remain one matching context. | I | | `src/logging/logger-file-transport.ts` | writeFileTransportWarning redacts transport failure diagnostics before asynchronous or synchronous stderr output. | I | | `src/logging/logger.ts` | getLogger.info redacts fields and final serialized message; assignDiagnosticLogAttribute rejects changed keys before diagnostic event emission. | I | | `src/logging/redact-pattern-runtime.ts` | Parses source/flags; dispatches RegExp or matcher with capture offsets used by replacement and bitmap readers. | I | | `src/logging/redact-patterns.ts` | Owns shipped regex strings and the single AWS eligibility/context matcher; candidate URL state lives only for one call. | I | | `src/logging/redact-source.ts` | redactSourceInputTextWithConfig applies configured text policy then source-assignment preservation; oversized source uses tool-payload policy. Assignment exemption does not disable structural secrets. | I | | `src/logging/redact.ts` | Resolves enabled policy; always applies form/auth/AWS structural protection, then selected regex strings; projects fields, batches, tool text and masks. | I | | `src/logging/subsystem.ts` | createSubsystemLogger.warn formats the configured console message, then writeConsoleLine applies terminal sanitation and raw-write redaction before console/stderr delivery. | I | | `src/media/fetch.ts` | redactMediaUrl sanitizes source URL in MediaFetchError; original source still drives network fetch. | X | | `src/node-host/connection.ts` | Node stats publication and worker-hosting-disabled warnings sanitize causes/reasons before stderr; hosting state is set separately. | X | | `src/node-host/node-worker-bundle-installer.ts` | Bundle install failure sanitizes caught error before NodeWorkerBundleInstallError; does not select bundle source. | X | | `src/node-host/node-worker-output.ts` | sanitizeNodeWorkerDiagnostic removes launch and registered secrets before canonical tool redaction of worker output. | X | | `src/plugin-sdk/agent-harness-runtime.ts` | formatToolProgressOutput redacts tool progress output before caller-selected maximum length. | X | | `src/plugin-sdk/browser-cdp.ts` | redactCdpUrl parses/strips userinfo and sensitive query fields, then canonical tool redaction; malformed URL text takes canonical text path. | X | | `src/plugin-sdk/diagnostic-runtime.ts` | normalizeDiagnosticValue/normalizeDiagnosticLane redact dimensions before grammar, fallback and scoped-lane grouping. | D | | `src/plugin-sdk/logging-core.ts` | Public logging-core barrel exposes canonical text, field and tool redaction without another classifier. | I | | `src/plugin-sdk/security-runtime.ts` | Public security-runtime barrel exposes canonical redactSensitiveText through the narrow security surface. | I | | `src/plugins/capability-catalog-context.ts` | createPluginCapabilityCatalogContext installs canonical redactor in capability callbacks for runtime provider discovery. | B | | `src/plugins/capability-catalog-context.types.ts` | Declares redactSensitiveText callback type on PluginCapabilityCatalogContext; no execution or decision. | B | | `src/plugins/installed-plugin-record-match.ts` | resolvePluginTrust sanitizes returned installSpec after trust/source matching; sanitized spec is not matching input. | X | | `src/plugins/plugin-command-runtime.ts` | executeSelectedPluginCommand sanitizes failed-plugin registration reason before bounded chat command error. | X | | `src/sessions/session-run-error.ts` | sanitizeSessionRunError sanitizes rendered error before stored failed-run outcome text. | X | | `src/system-agent/audit.ts` | appendSystemAgentAuditEntry redacts timestamped audit record before storage. | X | | `src/system-agent/setup-inference-core.ts` | Setup inference removes discovered exact secrets then canonical tool redaction before presentation. | X | | `src/trajectory/export.ts` | Sanitizes diagnostic values and path/object-key strings before trajectory export; preserves keys that collide after masking. | X | | `src/trajectory/metadata.ts` | buildSkillsCapture sanitizes sourceInfo; metadata capture sanitizes invocation argv and paths before export. | X | | `src/trajectory/runtime.ts` | sanitizeTrajectoryPayload redacts finalPromptText before bounds and sanitizes diagnostic objects before storage. | X | | `src/tts/tts-synthesis-support.ts` | formatTtsProviderError and sanitizeTtsErrorForLog sanitize synthesis failures before user/log error text. | X | | `src/tui/tui.ts` | formatTuiAuthCommandArgv sanitizes serialized auth command argv before terminal-renderable bounded output. | X | | `src/worker/worker-connection-contract.ts` | formatWorkerConnectionFailure sanitizes bounded connection detail before formatted failure message. | X | | `ui/src/lib/browser-redact.ts` | Builds browser cached string regexes and executable matcher references from canonical defaults; redactToolDetail/redactToolPayloadText replace captures before UI rendering. | I | **Validation readers (V):** These existing tests/fixtures import the owner; they are not additional shipped endpoints. - `extensions/codex/src/app-server/client-private-transport.test.ts` - `extensions/codex/src/app-server/sandbox-exec-server-node-relay.test.ts` - `packages/plugin-sdk/tests/security-runtime.test.ts` - `src/agents/provider-transport-fetch.integration.test.ts` - `src/agents/tools/web-search-provider-common.test.ts` - `src/commands/models/auth-api-key.test.ts` - `src/commands/models/list.auth-overview.test.ts` - `src/commands/triage.test.ts` - `src/config/sessions/transcript-append.test-support.ts` - `src/gateway/gateway-models.profiles.live.test.ts` - `src/gateway/server.agent.gateway-server-agent-a.test.ts` - `src/logging/diagnostic-support-export.test.ts` - `src/logging/diagnostic-support-redaction.test.ts` - `src/logging/redact-token-ordering.test.ts` - `src/logging/redact.structured-properties.test.ts` - `src/logging/redact.test.ts` - `src/logging/subsystem.test.ts` - `src/secrets/runtime.test.ts` - `src/secrets/sentinel.test.ts` - `src/system-agent/setup-app-recommendations.live.test.ts` **Lexical and callback readers:** | Reader | Operation / disposition | | --- | --- | | `packages/ai/src/host.ts:148,234` | Declares redaction callbacks/inert embedding defaults. OpenClaw installs the host in `src/llm/ai-transport-host.ts` (P/B); standalone unconfigured embedding excluded. | | `packages/ai/src/transports/transport-utils.ts:16–17` | Package text adapter delegates to active host tool redactor; options intentionally ignored (P/B). | | `packages/ai/src/transports/openai-responses-debug.ts:166–178` | `stringifyRedactedPayload` omits encrypted content, sanitizes serialized payload, then bounds debug output (X). | | `packages/acp-core/src/error-format.ts:93–100` | Stores/calls configured ACP redactor before package fallback credential rules. OpenClaw installs canonical callback; standalone fallback excluded (B/X). | | `packages/acp-core/src/runtime/errors.ts:70,127,142` | `readAcpRequestErrorDetails`/`formatAcpErrorChain` sanitize arbitrary details/causes before ACP errors (X). | | `extensions/openai/realtime-quicksilver-wire.ts:33–46,487–491` | Removes exact secrets then runtime callback before realtime error detail (X). | | `ui/src/plugins/control-ui-host.ts:94` | Supplies browser redaction as plugin-host callback; third-party UI callback execution excluded (B/X). | | `ui/src/lib/chat/tool-cards.ts:277–289` | `resolveCollapsedToolArgumentPreview` sanitizes argument line before collapsed card preview (P). | | `ui/src/lib/format-error.ts:4–10` | `formatUiError`/`formatUiExternalText` sanitize errors before fallback (X). | | `ui/src/pages/activity/tool-activity.ts:115–124` | `buildOutputPreview` sanitizes tool output before activity bounds (X). | | `ui/src/pages/chat/components/chat-tool-failure.ts:13–49` | `failureExcerpt`/`renderToolFailures` sanitize normalized failure output/display labels; failure-specific endpoint excluded unless separately observed (X). | | `src/config/schema.help.core.ts:77–78` | Help now explains string replacement plus mandatory structural protections (I). | | `src/config/schema.labels.ts:48` | “Custom Redaction Patterns” label remains accurate; no key change (I). | | `src/config/zod-schema.root-shape.ts:118`, `src/logging/config.ts:66–75` | Preserve config `string[]`; old config loading/reload/restart included (I). | | `docs/logging.md:630`, `docs/gateway/logging.md:160–165` | State replacement/structural contract and additive safety-boundary string rules (I). | | `docs/gateway/security/secrets-and-storage.md:79` | Environment-specific pattern guidance cannot disable structural protection (I). | | `docs/plugins/sdk-subpaths.md:284–318` | Documents public arguments, matcher contract and old-host limitation; objects never enter config (I). | | `docs/plugins/beam.md:185` | Promises default plus configured masking before mirror clipping even when logging is off; remote upload excluded (X). | Lexical non-consumers: `src/commands/backup-schedule.ts:50,98` and `extensions/qa-lab/src/multipass.runtime.ts:113,349` use local booleans. `extensions/qa-lab/web/src/ui-render-capture-redaction.ts:167` owns separate capture field redaction; its app/render-format callers do not consume this matcher. Lexical-only Browser CDP fuzz, Copilot embeddings, Parallel configured-pattern, ACP error-format, config help/labels/dead-key and browser-redact tests are validation readers. New/rewritten test entry points: `createSubsystemLogger.warn`, `getLogger.info` with final file flush, `chat.send` → `agent.wait` → `chat.history`/provider request, **`renderToolCard`** → Lit DOM, and `writeDiagnosticSupportExport` → final ZIP member. The test ledger records the retired false-positive path/query expectation. No unrelated channel pass is claimed. Additional Appendix B readers supplement the 193-file typed inventory. Rows marked V are existing validation only: the named operation was source-reviewed, with no new execution/pass or additional live endpoint claimed. The full per-file impact account is retained. | Reader | Disposition | | --- | --- | | `docs/gateway/config-observability.md` | Corrected operator contract: replace string regexes; retain structural protection. | | `extensions/browser/src/browser/cdp.helpers.fuzz.test.ts` | V: CDP non-URL masking and userinfo/error boundaries. | | `extensions/browser/src/browser/chrome.internal.test.ts` | V: Chromium lock recovery must retain its raw detector despite masked stderr. | | `extensions/codex/src/app-server/transcript-mirror.test.ts` | V: Mirror append/snapshot redaction preserves deduplication identity. | | `extensions/parallel/src/parallel-web-search-provider.test.ts` | V: Parallel HTTP error text masks exact and configured secrets; live delivery excluded. | | `extensions/qa-lab/web/src/app.ts` | QA error display uses its local keyed-capture redactor after shared error formatting; separate policy, QA endpoint excluded. | | `extensions/qa-lab/web/src/ui-render-capture-format.ts` | QA capture rendering uses that local JSON/query-field policy; no shared bare-AWS classifier or delivery claim. | | `extensions/whatsapp/src/inbound.media.test.ts` | V: Inbound media diagnostics apply custom patterns; WhatsApp remains excluded. | | `packages/acp-core/src/error-format.test.ts` | V: ACP configured callback followed by package fallback error masking. | | `packages/memory-host-sdk/src/host/error-utils.test.ts` | V: Memory error adapter merges provider/custom masking; service execution excluded. | | `src/acp/runtime/errors.test.ts` | V: ACP runtime error-chain custom/provider masking; live ACP excluded. | | `src/agents/embedded-agent-error-observation.test.ts` | V: Error previews reread config per call; fingerprints and sanitization failure remain distinct. | | `src/agents/embedded-agent-runner.guard.test.ts` | V: Session append masks thinking, tool arguments and results before storage. | | `src/agents/embedded-agent-runner/run/attempt.exec-review-transcript.test.ts` | V: Exec-review callback reads active-attempt rules and releases on teardown. | | `src/agents/embedded-agent-runner/server-endpoint-compaction.test.ts` | V: Compaction declines a durable commit when redaction would alter its window; live endpoint excluded. | | `src/agents/embedded-agent-subscribe.tools.test.ts` | V: Tool args/results retain nested configured masking; final-card proof is separate. | | `src/agents/exec-auto-review-transcript.test.ts` | V: Exec-review input uses attempt rules independently of ambient config. | | `src/agents/harness/host-capability.annotation.test.ts` | V: Annotation admission rejects restoration of storage-redacted text; live annotations excluded. | | `src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts` | V: Tool-result content/details use in-memory policy before persistence. | | `src/agents/sessions/agent-session-code-mode-source.test.ts` | V: Code-mode source survives SQLite reopen into replay with credential masks. | | `src/agents/tools/sessions-history-tool.test.ts` | V: sessions_history masks recalled text and marks contentRedacted. | | `src/agents/transcript-redact.test.ts` | V: Transcript masking may remove identity/mention provenance, not only text. | | `src/auto-reply/reply/conversation-turn-capture.test.ts` | V: Pending-reply capture masks correlated text; synthetic/other-channel delivery excluded. | | `src/config/schema.help.quality.test-fixtures.ts` | V: Help-quality fixture requires logging.redactPatterns documentation. | | `src/config/sessions/transcript-append-redact.test.ts` | V: Transcript append reads logging config when caller omits it, then masks before disk. | | `src/config/types.base.ts` | LoggingConfig remains optional string[]; it carries config and makes no policy decision. | | `src/gateway/client.test.ts` | V: GatewayClient failure-log config fixture; network/device-auth execution not claimed. | | `src/gateway/control-ui-public-session-render.test.ts` | V: Public-share HTML title/text masking; separate from tool-card browser proof. | | `src/gateway/server-methods/channels.status.test.ts` | V: channels.status keeps failed plugins visible while sanitizing diagnostics. | | `src/gateway/server/hooks.early-failure.test.ts` | V: Hook/cron diagnostics reach configured console/log sinks; live scheduling excluded. | | `src/gateway/session-companion-context.test.ts` | V: Companion context masks each selected transcript row; delivery excluded. | | `src/logging/config.test.ts` | V: Config reader keeps custom regexes despite an unrelated unresolved variable. | | `src/logging/console-capture.test.ts` | V: Console message/subsystem/metadata masks run before JSON escaping. | | `src/logging/log-tail.test.ts` | V: Log-tail spies verify delegation, not masking; real CLI proof covers the reader. | | `src/plugins/contracts/capability-catalog.contract.test.ts` | V: Unavailable redactor callback protects cold catalog construction; no masking executes. | | `src/plugins/loader.capability-factory.test.ts` | V: Unavailable redactor callback protects cold factory construction; no masking executes. | | `src/plugins/plugin-command-runtime.test.ts` | V: Authorized plugin failure replies mask configured secrets; channel delivery excluded. | | `src/system-agent/setup-inference-error-reporting.test.ts` | V: Setup-error stdout/stderr masking fixture; no live inference claim. | | `src/tui/tui.local-auth.test.ts` | V: Local-auth argv display masks custom/built-in values; login execution excluded. | | `ui/src/lib/browser-redact.test.ts` | V: Browser-safe adapter credential tests; renderToolCard supplies final-display proof. | The derived help path is `scripts/lib/control-ui-i18n-catalog.ts:105` (compose current hints and source-hash input) → `ui/src/i18n/lib/config-hint-translation.ts:9` (path/field/source-derived key) → `ui/src/lib/config-form-utils.ts:114` (active translation or current Gateway English fallback). These are included help-text consumers, not redaction-policy owners. All following memory/adapter pairs were inspected. Each memory has the old help key and unchanged label key, but no new help key. Each source-owned adapter exports its matching virtual locale. Current-key/source-hash validation rejects stale help; generated refresh belongs to the serialized post-merge locale workflow. No generated file is changed or translated-output execution claimed. | Canonical memory | Runtime adapter | | --- | --- | | `ui/src/i18n/.i18n/ar.tm.jsonl` | `ui/src/i18n/locales/ar.ts` | | `ui/src/i18n/.i18n/de.tm.jsonl` | `ui/src/i18n/locales/de.ts` | | `ui/src/i18n/.i18n/es.tm.jsonl` | `ui/src/i18n/locales/es.ts` | | `ui/src/i18n/.i18n/fa.tm.jsonl` | `ui/src/i18n/locales/fa.ts` | | `ui/src/i18n/.i18n/fr.tm.jsonl` | `ui/src/i18n/locales/fr.ts` | | `ui/src/i18n/.i18n/hi.tm.jsonl` | `ui/src/i18n/locales/hi.ts` | | `ui/src/i18n/.i18n/id.tm.jsonl` | `ui/src/i18n/locales/id.ts` | | `ui/src/i18n/.i18n/it.tm.jsonl` | `ui/src/i18n/locales/it.ts` | | `ui/src/i18n/.i18n/ja-JP.tm.jsonl` | `ui/src/i18n/locales/ja-JP.ts` | | `ui/src/i18n/.i18n/ko.tm.jsonl` | `ui/src/i18n/locales/ko.ts` | | `ui/src/i18n/.i18n/nl.tm.jsonl` | `ui/src/i18n/locales/nl.ts` | | `ui/src/i18n/.i18n/pl.tm.jsonl` | `ui/src/i18n/locales/pl.ts` | | `ui/src/i18n/.i18n/pt-BR.tm.jsonl` | `ui/src/i18n/locales/pt-BR.ts` | | `ui/src/i18n/.i18n/ru.tm.jsonl` | `ui/src/i18n/locales/ru.ts` | | `ui/src/i18n/.i18n/th.tm.jsonl` | `ui/src/i18n/locales/th.ts` | | `ui/src/i18n/.i18n/tr.tm.jsonl` | `ui/src/i18n/locales/tr.ts` | | `ui/src/i18n/.i18n/uk.tm.jsonl` | `ui/src/i18n/locales/uk.ts` | | `ui/src/i18n/.i18n/vi.tm.jsonl` | `ui/src/i18n/locales/vi.ts` | | `ui/src/i18n/.i18n/zh-CN.tm.jsonl` | `ui/src/i18n/locales/zh-CN.ts` | | `ui/src/i18n/.i18n/zh-TW.tm.jsonl` | `ui/src/i18n/locales/zh-TW.ts` | The integration base added a diagnostic-fact pipeline. These paths consume the repaired support owner; they do not add an AWS classifier or change update admission: - `src/logging/diagnostic-support-redaction.ts` adds first-line/path/command projection after the existing complete support pass; `src/infra/update-failure-facts.ts` normalizes each diagnostic fact and batches up to five facts. - `src/infra/update-runner-command.ts`, `src/infra/package-update-verification-step.ts`, `src/infra/package-update-swap.ts`, and `src/infra/package-update-steps.ts` capture normalized command, verification, swap and package-install failures before returning update-step diagnostics. Exit/recovery outcomes remain separate. - `src/infra/update-doctor-lint.ts` converts error findings into facts; `src/flows/doctor-health.ts` captures config-write/migration/Doctor failures; `src/infra/update-doctor-result.ts` normalizes facts at both child receipt write and parent receipt read. - `src/cli/update-cli/update-command-service-plan.ts` and `src/cli/update-cli/shared.ts` normalize service/runtime preflight errors; `src/cli/update-cli/update-command-plugins-internals.ts` normalizes plugin failures; `src/cli/update-cli/update-command-fresh-doctor.ts` carries normalized child errors in `UpdateDoctorError`. - `src/cli/update-cli/update-finalization-lifecycle.ts`, `src/cli/update-cli/update-command-verification.ts`, and `src/cli/update-cli/update-command-terminal.ts` normalize phase timeout/error, restart health and terminal failure facts before ledger/report handling. They do not infer success from redacted text. - `src/infra/update-candidate-canary.ts` captures a sanitized first stderr line and failed-phase facts; `src/infra/update-run-codec.ts` normalizes facts before ledger encoding. Existing captured-tail and other diagnostic redaction remain. - `src/commands/triage.ts` carries recorded facts into `src/commands/triage-update.ts`, which sanitizes them before the bounded triage prompt. `src/infra/update-failure-report-prepare.ts` applies the stricter public diagnostic projection before report preview/body preparation. Public support reports intentionally remove private prose/paths; the chat URL-preservation contract does not require those reports to retain a URL. These update/triage lifecycle and report endpoints remain excluded from execution claims (U). Their source-supported diagnostic dependencies are accounted for here; retained runtime evidence is not relabeled as new fact-pipeline execution. **Shipped consumers:** No new required public argument, config key or plugin capability is introduced. Actual artifacts and operation limits are recorded below. | Consumer/version | Declared floor | Artifact / operation | Result / scope | | --- | --- | --- | --- | | Operator config authored by 2026.9.4 CLI | Existing `string[]` contract | Retained old-CLI config; candidate load, egress, reload/restart | Final candidate unchanged-config/egress pass; not an old-CLI updater lifecycle claim. | | External public security-runtime consumer | SDK 2026.9.4 | Published npm 2026.9.4 tarball and compiled788 candidate, identical consumer | Runtime PASS: ten processes, five configs per artifact, 11 existing argument shapes, 110 fixtures; stable repeated calls and unchanged config bytes. Candidate custom-only retains structural masks. The same external TypeScript consumer compiles and runs against shipped/candidate declarations in [CI proof](https://github.com/openclaw/openclaw/actions/runs/34688551385), strict with skipLibCheck:12 call forms ×5 subjects per host, all120 outputs inspected. Separate candidate matcher compilation/execution passes. | | Anthropic bundled plugin 2026.9.4 | Private same-package plugin; no independent minimum declared | Manifest + candidate direct CLI backend | 12 subprocess/warm-session tests pass; no separate historical minimum-host claim. | | Published Codex plugin 2026.9.4 | Install `>=2026.5.1-beta.1`; **pluginApi `>=2026.9.4`** | Same npm tarball on published2026.9.4 and candidate788 | Index import PASS both. Floor owner-created WebSocket relay handles16 requests and cleans up. Candidate lazy relay FAILS before admission: removed `registerRetainedNativeHookRelayForBundledRuntime` export. Baseline196 has the same failure; baselineMain source is identical. #144828 predates this PR. Outside contract by owner decision; no candidate shipped-relay pass claimed. Existing candidate-source67 admission tests remain separate. | | Published diagnostics-otel2026.9.4 | Install `>=2026.4.25`; **pluginApi `>=2026.9.4`** | Same npm tarball on published2026.9.4 and candidate788; register → service.start → log.record → actual stdout → stop | PASS:4 processes/36 exported records with current/custom configs. Candidate omits credential-shaped keys, masks secret values/form/Digest and preserves public URLs. Subscriptions removed/config unchanged. Network exporter not claimed. | | Browser bundled plugin 2026.9.4 | Private same-package plugin; no independent minimum declared | Manifest + bundled browser adapter/UI asset | Final tool-card proof retained; CDP connection-error flow excluded. `browser-cdp` is documented private JavaScript host runtime, not typed third-party SDK. | | Remaining listed provider/memory/error callbacks | Existing logging-core/security-runtime contract | Named source readers above | Operation-specific exclusions; no blanket plugin compatibility or historical floor-artifact pass. | **Follow-ups:** The published Codex plugin lazy relay fails on the pre-fix baseline and candidate because #144828 removed a native-hook export before intake; the owner excluded this failure from this PR. ## Invalidation - Scanner state belongs to one invocation. Each run retains its original URL object. A matching closer clears the active pointer; whitespace/end consumes and clears pending runs. No scanner state survives the call. - Built-in patterns, the non-global value probe, resolved default/tool arrays, support vendor rules, copied WebSocket defaults and browser compiled rules are derived from code. Process restart or loading the updated UI bundle rebuilds them. - Startup and Gateway reload still use `applyLoggingConfig`. Fresh runtime checks cover current/older copied lists, adding and removing a pattern, restoration and process restart. - Registered-secret additions and eviction keep their existing cache invalidation. No new config reader or persistent state is introduced. Help/locales: `buildBaseHints` in `src/config/schema.hints.ts` carries current server help into the catalog. The help key changes from `v1-2nwid5-6w` to `v1-1esa6eg-7k`; the label key stays `v1-17ykioa-p`. `scripts/lib/control-ui-i18n-catalog-values.ts:67` requires both a current key and matching normalized source hash before using a translation. `ui/config/control-ui-locales.ts` materializes locale modules, watches transitive source/memory files and replaces its cache on build start or watch changes. `ui/src/i18n/lib/registry.ts` loads the adapters; `ui/src/i18n/lib/translate.ts` retains maps for the current page. The config editor uses current English when the new help key is absent. Deploying the rebuilt UI and reloading the page adopts refreshed maps; logging reload does not translate catalogs or replace a loaded bundle. `ui/AGENTS.md` assigns translation generation to `.github/workflows/control-ui-locale-refresh.yml`: main changes to `src/config/schema*.ts` trigger serialized refresh and an isolated generated PR with auto-merge, validated against source invalidation paths. All 20 memory files and 20 adapters remain untouched in this source PR. Keyless `ui:i18n:verify` covers source/wiring; strict `ui:i18n:check` owns generated/release parity. This account verifies source and memory, not post-merge workflow completion or a live localized UI run. Invalidation addition: facts are freshly normalized at capture, Doctor receipt write/read, ledger encode, triage projection and report preparation. Stored masks are not reversed after a config change. A new operation uses current process/configuration policy; restart loads current code. Canary first-line state belongs to one child. Recomputed report bodies get a new preview digest. No new cache or policy owner is added. ## Contention Redaction remains synchronous and adds no lock, queue or transaction. Each caller owns its scanner state. Two 4,096-candidate Gateway workloads submit a competing operation during the actual staging interval. Candidate completion is 134.53 ms and 83.64 ms; maximum owner queue wait is 0.231 ms. Full inputs, owner timestamps and state readbacks are retained. Earlier filesystem-notification measurements did not establish temporal overlap and are excluded from this claim. ## Tests - The current registered Gateway suite passes **46 tests**. `chat.send` assertions inspect `chat.history` and complete recorded provider requests; the approval test inspects the display after actual request registration. - Retained UI suites pass **102 tests**. `renderToolCard` redaction cases inspect rendered tool-card text, including public paths, compact siblings, raw userinfo and nested query values. - Fresh targeted logging/support suites pass **289 tests**. `writeDiagnosticSupportExport` requires the long vendor token’s final ZIP field to contain only the established hint, with no raw tail. `createSubsystemLogger.warn` covers copied defaults, extra/custom-only strings, structural credentials and default slash-containing database passwords; `getLogger.info` checks final on-disk messages and malformed credential siblings. - One stale masking expectation is deliberately retired: `https://example.test/path-S?foo=@` now belongs in the Gateway preservation table, and the UI expects the complete URL. Here `S` denotes the synthetic 40-character value. This follows the explicit requirement that a query at-sign cannot retroactively classify a public path as credentials. A parenthesized nested-query case replaces the stale Gateway masking row and continues to require masking inside the query. - Fresh independent source review finds no blocking issue. The historical native scanner review retains its original 32 matcher cases and 20 server/browser consumer observations. - Fresh boundary suites pass **363 tests**: public SDK, subprocess diagnostic error display, WebSocket node HTTP admission, registered telemetry exporter, transcript projection and diagnostic log attribute admission. These observe the named boundaries, not remote vendor acceptance or live external export. - The `redactSensitiveText` custom-only form test now requires masking. Two capture/backreference tests use `project_value` instead of `password` so mandatory form preprocessing does not preempt the capture test. `resolveRedactOptions` tests retain mode-off and compiled-RegExp reuse, removing only obsolete flag/count assumptions. `redactSensitiveLines` tests use actual custom-only/rejected-regex resolution and retain Digest/registered-secret masking. `getDefaultRedactPatterns` tests its serializable string contract. - Fresh compiled-runtime acceptance passes configuration, logging, support exports, reload/restart and the paired benchmark. The complete Gateway corpus, real-browser display and Telegram semantics pass. Telegram cleanup is separately qualified above. - The fresh lexical census passes on the CI merge tree with no remaining removed-matcher reader, manual row or generic exemption. Completed typed proof covers that exact integration tree. Previous CI receipts and ClawSweeper gate remain historical; fresh structural receipts and exact-head review are required for this head. CI owns typechecking and full suites; guarded merge still requires independent census ACCEPT. Co-authored-by: Ayaan Zaidi <[email protected]>
…enclaw#145810) ## What Problem This Solves Operators who copied the shipped redaction strings into `logging.redactPatterns` lost form-body and structured authorization protection after #145553. Public SDK and subsystem-console output could expose encoded form values and Digest credentials. The built-in AWS secret access key detector also shortened public URL paths ending in `@latest` or followed by a query containing `@`. Compact serialized URLs could share the wrong authority state. The final file-log `message` was affected too. Ordinary 40-character hashes unnecessarily triggered a full pattern scan. Follow-up to #145553 and #144059. Found by adversarial round 3. ## Why This Change Was Made - `redactPatterns` replaces the string list; built-in structural protections always apply. Form-body and structured-auth preprocessing run at the owner without list-identity recognition. Every enabled resolution includes the same AWS matcher, including current copied defaults, older lists, default-plus-extra and custom-only configurations. - `matchAwsSecretAccessKeys` owns unlabelled AWS candidate classification. Its shared value expression also supplies the fast admission check. Explicit secret-field names retain their separate field contract. - Each candidate captures its own URL context. The scanner waits until whitespace or end to classify pending candidates, so later raw-userinfo punctuation can settle the original authority without a sibling URL overwriting it. - Authority ends at `/`, `?`, or `#`. An `@` in a path or query cannot turn an earlier public path into userinfo. The public preservation boundary and the URL context lifetime are separate: punctuation can shorten the former, while the matching original delimiter at the same escape depth ends the latter. Query/fragment context prevents nested URL-looking text from restarting public shielding. - Support exports replace their separate AWS regex with the shared matcher. Their vendor pass uses the existing full-context option, so long tokens and boundary assertions remain intact before support applies its full AWS marker. Existing field and private-data stages follow. The built-in decision whether an unlabelled 40-character value is an AWS secret access key is made by exactly one mechanism at `src/logging/redact-patterns.ts:99` (`matchAwsSecretAccessKeys`). The prefilter consumes that matcher’s value probe, and diagnostic support consumes that matcher’s decisions. ## User Impact - Built-in redaction preserves public `path@latest` and query-at paths, plus compact and escaped URL siblings. Existing raw-userinfo and nested-query credential cases remain masked. - File logging preserves complete public URLs in the final written message. Ordinary hash-filled objects avoid the full redaction walk. - A late review exposed slash-containing database passwords skipped by the narrowed prefilter. Baseline SDK/console masked them; the candidate leaked them. The generic URL admission probe now includes those passwords, so the existing database rule runs. AWS classification and the hash probe are unchanged. - The established malformed numeric-port/path candidate ending in `@` still masks. Its sibling without terminal `@` stays intact. This explicit ambiguity does not redefine ordinary path `@` as authority. - Copied string lists and custom-only lists retain form, structured-auth and bare-AWS protection in SDK and console output. `getDefaultRedactPatterns` returns only serializable strings; the internal executable registry still serves browser/default consumers. Tool and final file routes also retain their fixed string rules. - Older copied regexes retain their literal behavior, including their previous URL false positives. Operator patterns are not rewritten, and previously damaged stored text cannot be recovered. Support vendor rules had also lost full-context metadata. With custom-only strings, the real `gateway diagnostics export` path (`register.ts` → exporter → configured reader) stored a raw long-token tail. Actual ZIP field lengths: original11, intermediate240(red), final11(green). The custom marker masks on every pin. Default-config CLI masks upstream on all pins; injected-reader ZIP probes remain supplemental. Configuration remains a string list. No schema, migration, protocol, CLI option, public SDK argument, or updater change is introduced. The retired custom-only form-disablement expectation was the bug; docs, SDK guidance and configuration help now describe the accepted structural contract. ## Evidence Candidate `f7e9e940b8df674bbdca31bb679fc3942a42efee` adds only a docs correction to `78869554857369b9dcb3b9e8145dd36d740de03c`. General runtime proof executed at `771474bbb4ab78736971e75da0329eafba8260ea`; relevant sources are unchanged except the support adapter, separately proved through the actual CLI at788. Browser/Telegram proof retains its19634179 execution identity for unchanged scanner/rendering behavior. Generated config-doc hashes and config:docs:check pass. No historical execution is relabeled as new. | Registered path or final artifact | Current candidate result | | --- | --- | | Public security-runtime SDK, tool payload, subsystem console and final file output | Seven independent configurations × 23 fixtures (161 records) cover current/older/default-plus-extra/custom-only and the unchanged v2026.9.4-authored config; all structural protections remain active | | `getLogger.info` → final file fields | At-version paths, query-at paths, arrays, objects, newline and escaped siblings, comma paths and the no-`@` numeric-port/path sibling remain complete | | Compiled CLI config validation | Six explicit pattern lists validate; retained v2026.9.4-authored config loads and redacts without changing its bytes | | Compiled Gateway config reload and process restart | Both current/older-list sequences pass; new turns use the selected rules and prior history retains its recorded text | | `writeDiagnosticSupportExport` → final ZIP log member | Final compiled head restores complete long-vendor masking; short-token and five-fixture AWS/vendor/public-URL controls pass | | `gateway diagnostics export` → actual ZIP log member | Nonempty custom-only list: intermediate771 retains240 characters; final788 emits exact11-character hint. Default-config sibling stays masked. | | `chat.send` → history and complete provider input; `exec.approval.request/get/resolve` | 184 initialized-conversation scenarios on each pin; all candidate history/provider observations and full approval display pass. Twelve public-context fixtures fail baseline preservation and pass on candidate. Exact-secret precedence uses actual environment-backed secret resolution. | | Telegram Test Server → follow-up provider context | 19 sends and 19 replies on each pin; replayed history within complete provider requests retains candidate public URLs and existing credential masks. Incoming first-send Telegram text is unchanged. Both recordings complete. Runner cleanup failed; exact-owner recovery released both leases. | | Real Control UI → expanded message-tool cards and return legs | Seven real message-tool calls render expected preservation and masking; expanded path, compact, escaped and credential captures were inspected. Calls finish with the normal synthetic unavailable-channel error; external delivery is not claimed. | The final paired benchmark alternates the exact pre-#145553 parent `8210aa3fa2ca732d1c57a476fac025c032ef2940` and final compiled `771474bb` for ten measured samples after two warmups. The 4,096-field, 228,267-byte hash object measures **15.70 ms → 4.35 ms** median with identical full outputs. The complete samples and 39-character control are retained. This establishes the fixture result, not universal throughput. Every final shipped string and the matcher’s exact value expression ran through `src/security/safe-regex.ts` on the execution host with production source/flags: **123 accepted, 0 rejected**. Configured resolution retains all 122 shipped strings plus the shared matcher: **0 silently dropped**. Each pattern result is retained. The supplied Cookie fixture and the `X-Amz-Credential`, `X-Goog-Credential` and `X-Goog-Signature` fixtures remain visible on both pins. This repair does not add protection for those unchanged cases. `X-Amz-Signature` remains masked. Telegram cleanup requires a separate qualification: both recordings completed all 19 actions, but the runner exited 1 during cleanup. The candidate diagnostic captured a process-group existence check returning `EPERM`. The canonical recovery path revalidated ownership, released both leases and removed credential scratch. Clean Gateway shutdown, process/open-file reconciliation and free ports establish settled cleanup. The failing process-group target was not retained, so no exact-ID absence is claimed. The original failures and complete recovery evidence remain available for review. Support proof inspects actual `logs/openclaw-sanitized.jsonl`. Supplemental imported bare/Bearer keys receive the support marker before field rules. Default-config tails retain upstream hints; custom-only CLI tails exercise support masking directly. ## Consumers `redactPatterns` replaces the string list; built-in structural protections always apply when redaction is enabled. Forced safety-boundary helpers retain their default string rules plus configured strings. Fresh typed queries on integration `d0b38ca710db0c8c5889a6521be7a8152bb73d58` (tree `6ecb6c37ccb015591207738af005d1a26e1e93a2`) cover 83 original declarations: 3,028 rows, 1,194 distinct symbol/location pairs, 193 files. Four derived diagnostic declarations add 59 rows across 20 files; combined: 3,087 rows, 1,253 pairs, 207 files, all dispositioned below. Canonical lexical census passes with no manual rows or exemptions. Root resolves all 87 declarations; browser has 83 unresolved core-source positions and SDK/UI each have two dynamic-binding gaps, covered by root. Unloaded/native projects and full dependency declaration checking remain coverage limits. Prior executed query identities and raw outputs are retained. Scope: **I** owner/config/SDK/console/file/support/browser policy; **P** registered chat/history/provider/tool-card/approval pipeline; **D** decision boundary tested as described below; **B** callback/type/re-export linkage; **X** named endpoint excluded from execution claims (source reviewed; derived output can change); **U** updater/triage lifecycle excluded, shared support sink included; **C** other channels excluded by task; **T** Telegram HTTP/cache-error diagnostics excluded, Telegram replay included; **V** validation reader only. Decision proof: 363 tests pass: direct CLI subprocess 12, node WebSocket relay 67, telemetry service/exporter 191, transcript projection 86, public SDK 1, core diagnostic events 6. The final seven-config egress matrix has 161 records, including 98 structural rows, with no recorded leak or SDK/console/file mismatch. This is composed evidence, not every config × plugin operation combination. - Anthropic `withDiagnostics` selects exact environment secrets by field-redaction inequality before raw/URI/JSON replacement and final error display. Explicit tools options use shipped defaults before/after; actual subprocess tests observe error egress. - Node `http/request` uses text inequality to reject credential-bearing requests before forwarding. Actual WebSocket rejection/byte-preservation is tested; remote HTTP execution is excluded. - OTel and core logger attribute admission reject keys changed by redaction. Tests observe final exporter/event attributes. Diagnostic dimension normalization can intentionally replace newly masked labels with `unknown`; live external telemetry is excluded. - Transcript equality predicates retain/drop custom opaque signatures and replay IDs. Projection tests cover provider-specific structural exceptions. Actual opaque-signature acceptance by an external provider is excluded; normal chat provider requests are not relabeled as signature proof. - `redactDisplayLabel` canonicalization affects structured-clone validation, not execution authority. `resolvePluginTrust` masks only returned install-spec display after matching, not its trust decision. | File | Operation / final consumer | Scope | | --- | --- | --- | | `extensions/crabbox/src/crabbox-worker-command-error.ts` | crabboxCommandDetail sanitizes combined stderr/stdout before whitespace collapse and trailing failure excerpt. | X | | `extensions/acpx/src/runtime.ts` | readCodexWrapperStderrTail sanitizes retained child stderr before compact ACP wrapper error diagnostics. | X | | `extensions/anthropic/cli-process.ts` | withDiagnostics selects env values using field-redaction inequality, replaces raw/URI/JSON forms in child stderr, then attaches sanitized Error diagnostic. | D | | `extensions/beam/src/mirror.ts` | Sanitizes user/agent messages and upload title before clipping and remote Beam upload. | X | | `extensions/browser/src/browser/cdp.helpers.ts` | redactCdpErrorText removes CDP URL credentials then sanitizes the full error string. | X | | `extensions/browser/src/browser/chrome-mcp-connect.ts` | Connection failure builds sanitized configured endpoint label; chosen connection target itself is not changed. | X | | `extensions/browser/src/browser/chrome-mcp-result.ts` | formatChromeMcpEndpointForDiagnostic sanitizes endpoint labels used in Chrome MCP tool error messages. | X | | `extensions/browser/src/browser/chrome.diagnostics.ts` | safeChromeCdpErrorMessage and failureDiagnostic sanitize reachability error/cause/message; raw wsUrl is a separate diagnostic field. | X | | `extensions/browser/src/browser/chrome.ts` | Sanitizes child error/startup stderr for diagnostics; singleton recovery uses separate stderrSignals. | X | | `extensions/browser/src/logging/redact.ts` | Browser diagnostic adapter reexports public logging-core functions; no pattern copy or classifier. | I | | `extensions/clickclack/src/http-client.ts` | request sanitizes remote response detail before ClickClackHttpError; status and headers remain separate. | X | | `extensions/codex/src/app-server/context-engine-projection.ts` | pickToolPayloadMetadata/redactPreservedToolValue sanitize metadata and preserved strings before context projection. | X | | `extensions/codex/src/app-server/event-projector-diagnostics.ts` | redactCodexEventKind sanitizes event method text before projector diagnostic logging. | X | | `extensions/codex/src/app-server/sandbox-exec-server-node-relay.ts` | rejectCredentialedCodexNodeHttpRequest rejects headers/URL/decoded body when tool redaction changes text, before node dispatch; disconnect causes are sanitized. | D | | `extensions/codex/src/app-server/tool-progress-normalization.ts` | sanitizeCodexAgentEventValue recursively redacts progress strings/field values before event publication. | X | | `extensions/crabbox/src/crabbox-worker-node-enrollment-diagnostics.ts` | collectCrabboxNodeEnrollmentEvidence sanitizes command evidence before byte-bounded enrollment report. | X | | `extensions/diagnostics-otel/api.ts` | Reexports security-runtime redactSensitiveText to OTel recorder and attribute owners. | B | | `extensions/diagnostics-otel/src/service-attributes.ts` | assignOtelLogAttribute/assignOtelEventAttributes reject changed keys; redactOtelAttributes masks values; securityTargetNameAttr validates normalized labels. | D | | `extensions/diagnostics-otel/src/service-content-normalization.ts` | normalizeOtelLogString and JSON serializers sanitize captured content before attribute length/array bounds. | X | | `extensions/diagnostics-otel/src/service-genai-attributes.ts` | assignGenAiSpanIdentityAttrs writes redacted raw requested model to span model attribution. | X | | `extensions/diagnostics-otel/src/service-recorders-model.ts` | Model call recorder sanitizes error category before SpanStatusCode.ERROR status message. | X | | `extensions/diagnostics-otel/src/service-recorders-operations.ts` | Session state/recovery/tool-loop recorders sanitize reason/error strings before counters and span status. | X | | `extensions/diagnostics-otel/src/service-recorders-tools.ts` | Tool recorder sanitizes tool error text before span error status. | X | | `extensions/diagnostics-otel/src/service-recorders-usage.ts` | Webhook/usage recorders sanitize error strings before metric/span attribute and status writes. | X | | `extensions/diagnostics-prometheus/api.ts` | Reexports security-runtime redactSensitiveText to Prometheus service error formatter. | B | | `extensions/diagnostics-prometheus/src/service.ts` | safeErrorMessage sanitizes and bounds exporter error text, including control-character normalization. | X | | `extensions/discord/src/api.ts` | formatDiscordApiErrorText sanitizes reflected remote errors before DiscordApiError construction. | C | | `extensions/discord/src/error-body.ts` | summarizeDiscordResponseBody redacts provider summary before bounded Discord error text. | C | | `extensions/discord/src/internal/rest-errors.ts` | isSensitiveDiscordErrorKey uses field redaction as secret-key predicate; redactDiscordErrorBody sanitizes nested values and collision-safe keys before structured Discord error construction. | C | | `extensions/github-copilot/embeddings.ts` | discoverEmbeddingModels and embedMany sanitize non-OK response bodies before provider HTTP errors. | X | | `extensions/googlechat/src/api.ts` | readGoogleChatErrorResponse sanitizes response text before surfaced request error. | C | | `extensions/lmstudio/src/models.fetch.ts` | redactLmstudioLoadError removes active request credentials then canonical token text before model-load error. | X | | `extensions/matrix/src/matrix/sdk/logger.ts` | formatMessage formats SDK arguments then redacts the Matrix log line. | C | | `extensions/memory-core/src/memory/manager-provider-lifecycle.ts` | Records sanitized initialization/recovery reasons and bootstrap-sync warnings; provider choice is separate. | X | | `extensions/memory-core/src/memory/manager-search-orchestration.ts` | Search bootstrap sanitizes provider-retirement and fallback-sync warning text; error state selects recovery. | X | | `extensions/memory-core/src/memory/manager-sync-outcome.ts` | MemorySyncOutcomeLedger.recordActiveFailure stores sanitized reason with failure revision. | X | | `extensions/nextcloud-talk/src/guarded-response.ts` | readNextcloudTalkErrorBody removes known credential bytes then redacts remote error body. | C | | `extensions/openai/openai-chatgpt-oauth-token.runtime.ts` | normalizeTokenErrorSummary sanitizes token endpoint error summary before its bounded OAuth failure message; token selection is separate. | X | | `extensions/openai/realtime-host.ts` | openAIRealtimeHost supplies canonical redactor callback to realtime capability implementation. | X | | `extensions/parallel/src/parallel-web-search-provider.runtime.ts` | runParallelSearch layers current configured text redaction with forced tool defaults before non-OK Parallel API errors. | X | | `extensions/qa-lab/src/gateway-log-redaction.ts` | redactQaGatewayDebugText sanitizes Gateway QA captures before extra QA secret-array/header patterns; not production redaction policy. | X | | `extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-cli.ts` | redactMatrixQaCliOutput sanitizes Matrix QA CLI captures; outside selected Telegram evidence. | C | | `extensions/reef/src/transport.ts` | redactReefRelayErrorMessage removes known credentials then sanitizes remote relay error string. | X | | `extensions/slack/src/errors.ts` | redact sanitizes Slack error detail strings before their combined error message. | C | | `extensions/slack/src/monitor/media.ts` | formatSlackMediaFailure redacts download failures before bounded diagnostic/model media error. | C | | `extensions/sms/src/twilio.ts` | TwilioApiError redacts response text before parsing error fields and exposing message/structured response. | C | | `extensions/telegram/src/send-context.ts` | createTelegramHttpLogger redacts formatted HTTP failure; closeCachedTelegramClientOptions sanitizes transport-close failure before subsystem warning. Neither callback rewrites delivered Telegram content. | T | | `extensions/voice-call/src/providers/shared/response-body.ts` | readProviderErrorResponseSnippet applies forced tools redaction before voice provider error truncation. | C | | `extensions/whatsapp/src/inbound/message-enrichment.ts` | sanitizeMediaErrorMessage redacts model-facing media failure text before channel URL, phone and identity removal. | C | | `packages/memory-host-sdk/src/host/error-utils.ts` | formatErrorMessage injects forced tool-payload redaction into memory-host error formatter. | X | | `packages/memory-host-sdk/src/host/openclaw-runtime-io.ts` | Reexports canonical redactSensitiveText to buildSessionEntry and memory-host consumers. | B | | `packages/memory-host-sdk/src/host/session-files.ts` | buildSessionEntry redacts user/assistant text before renderSessionExportLines creates memory session entry with provenance. | X | | `packages/plugin-sdk/src/security-runtime.ts` | Workspace security-runtime barrel forwards public redaction contract; no independent policy execution. | I | | `scripts/lib/dev-tooling-safety.ts` | redactForDevToolLog and previewForDevToolLog sanitize tooling logs before preview bounds. | X | | `src/acp/runtime/errors.ts` | Installs canonical tool redactor via configureAcpErrorRedactor before ACP runtime error exports; fallback package rules are general credential formatting, not another logging AWS matcher. | X | | `src/agents/agent-run-terminal-receipt.ts` | formatAgentRunModelRef and normalizeAgentRunRouteChange sanitize model route receipt labels before terminal receipt rendering. | X | | `src/agents/agent-tool-definition-adapter.ts` | formatToolParamPreview redacts serialized tool parameters before console-safe error preview. | P | | `src/agents/agent-tools.before-tool-call.diagnostics.ts` | prepareToolTerminalPresentation redacts terminal formatter text before bounding and presentation. | P | | `src/agents/agent-tools.read.ts` | createOpenClawReadTool applies structured redaction to .env results before model-visible details are returned. | P | | `src/agents/auth-profiles/oauth-manager.ts` | formatRedactedOAuthRefreshError removes current OAuth credentials then sanitizes refresh failure/cause; does not choose or update auth credentials. | X | | `src/agents/bash-tools.exec-approval-followup.ts` | formatDirectExecApprovalFollowupText sanitizes finished/completed background execution body before reply delivery. | X | | `src/agents/bash-tools.exec-runtime.ts` | Background finalizer failure appends sanitized error into retained stderr for observer consumption. | X | | `src/agents/cli-session-store.ts` | settleCliSessionResult sanitizes save-continuity failure into bounded diagnostic attached to result. | X | | `src/agents/command/attempt-execution.ts` | sanitizeAcpDiagnosticText bounds sanitized ACP runtime event diagnostic text. | X | | `src/agents/diagnostic-redaction.ts` | redactAgentDiagnosticPayload runs canonical structured redaction after diagnostic payload sanitation. | X | | `src/agents/embedded-agent-error-observation.ts` | redactObservationText merges configured strings/defaults in forced tools mode before always-on provider error logs. | P | | `src/agents/embedded-agent-runner/run/images.ts` | loadMediaFromRef creates sanitized media reference only for error/diagnostic text; fetch still uses resolved original reference. | X | | `src/agents/embedded-agent-tool-results.ts` | sanitizeToolResult deep-redacts model-facing results; extractToolResultText sanitizes serialized blocks; metadata field values are protected. | P | | `src/agents/mcp-error.ts` | redactMcpDiagnosticError removes reflected response body and sensitive URLs before tool text sanitation. | X | | `src/agents/model-routing-decision.ts` | boundedModelRef sanitizes already selected model route for routing-decision announcement; does not select the provider. | X | | `src/agents/provider-http-errors.ts` | redactProviderErrorBody sanitizes retained provider error metadata; active credential replacement precedes forced tool redaction for reflected transport failures. | X | | `src/agents/provider-local-service.ts` | appendLocalServiceOutputTail sanitizes accumulated child output then removes exact service environment values before retaining tail. | X | | `src/agents/provider-request-header-redaction.ts` | redactProviderResponseErrorText removes reflected request-header secrets before canonical tool redaction. | X | | `src/agents/session-activity-notes.ts` | sanitizeActivityText and summarizeToolArgs redact text before activity-note truncation/summary; state activity remains separately tracked. | X | | `src/agents/session-tool-result-guard.ts` | redactPersistedDetailString/Value sanitize bounded tool details and keys before append, retaining lookahead at truncation boundaries. | P | | `src/agents/tool-display-common.ts` | coerceDisplayValue redacts first display line before the compact tool label truncation. | P | | `src/agents/tool-display-exec.ts` | compactRawCommand and resolveExecTitle redact execution labels before shortening them for tool display. | P | | `src/agents/tool-display.ts` | formatToolDetail redacts inferred tool detail for consumer presentation. | P | | `src/agents/tools/sessions-history-tool.ts` | truncateHistoryText sanitizes sessions_history output and computes its redacted flag from changed text before truncation. | X | | `src/agents/tools/sessions-search-tool.ts` | sanitizeHit sanitizes sessions_search hit snippets before bounded tool result. | X | | `src/agents/transcript-redact.ts` | Credential equality gates custom opaque signatures/replay IDs; provider structural exceptions remain; sanitizes transcript text/fields before storage/replay. | D | | `src/audit/audit-event-writer.ts` | formatAuditWriterError sanitizes bounded audit persistence failure diagnostics; original audit write outcome is separate. | X | | `src/audit/execution-identity-admission.ts` | redactDisplayLabel canonicalizes display labels for structured-clone validation; the label grants no authority. | X | | `src/channels/status/account-state.ts` | resolveUnavailableChannelAccountSnapshot sanitizes failed plugin error into channel status; excludes per-channel activation/status flows. | C | | `src/cli/claws-cli-output.ts` | logClawPlanNotices and logClawUpdatePlanSummary sanitize notice/effect/requirement display text; plan effects and approval data remain original. | X | | `src/cli/claws-cli.runtime.ts` | Sanitizes displayed capability effects and delegates MCP command argv display; integrity/consent uses separately bound plan data. | X | | `src/cli/gateway-cli/register.ts` | Registers gateway diagnostics export; delegates archive production to writeDiagnosticSupportExport. | I | | `src/cli/logs-cli.ts` | logs command journal fallback resolves logging options and redacts joined lines before CLI output; Gateway error display also uses URL sanitation. | I | | `src/cli/update-cli/update-command-fresh-doctor.ts` | Sanitizes full child stderr/stdout before bounded Doctor failure handoff. | U | | `src/cli/update-cli/update-finalization-output.ts` | Finalization output capture sanitizes update stream before retained output snapshot. | U | | `src/commands/onboard-non-interactive/local/output.ts` | Gateway-health recovery output redacts message/detail/hints object before noninteractive onboarding response. | X | | `src/commands/runtime-plugin-install.ts` | finalizeRequiredRuntimePluginInstall sanitizes failure reason before returned installer error result. | X | | `src/commands/status-all/format.ts` | formatStatusServiceValue sanitizes service inspection failure detail/runtime text before status output. | X | | `src/commands/triage-failure.ts` | Sanitizes triage failure fields through redactSupportString before retained report/error output. | U | | `src/commands/triage-prompt.ts` | Triage prompt formats sanitized finding IDs/messages/fix hints for repair model context. | U | | `src/commands/triage-update.ts` | Serializes sanitized update outcome text into byte-bounded triage handoff. | U | | `src/commands/triage.ts` | Triage collection errors, external-agent stdout/stderr and displayed findings use support sanitation; writeDiagnosticSupportExport owns archive creation. | U | | `src/config/io.audit.ts` | sanitizeConfigAuditRecord sanitizes config command argv and entire audit object before appendConfigAuditRecord persists it. | X | | `src/config/redact-argv.ts` | redactSensitiveArgv masks credential flags and changed tool-text arguments while preserving argv shape and optional marker. | X | | `src/config/sessions/session-accessor.sqlite-transcript-store.ts` | redactTranscriptMessageForStorage applies message-aware or structured redaction before SQLite transcript append. | P | | `src/cron/command-output-summary.ts` | redactCronCommandSummaryForExternalDelivery sanitizes retained command output before extra secret-assignment replacement and outbound summary. | X | | `src/cron/run-diagnostics.ts` | normalizeCronRunDiagnostics supplies forced redaction callback to normalized cron diagnostic records. | X | | `src/gateway/client.ts` | createOpenClawGatewayClientHostDeps supplies redactForLog callback; client transport diagnostics use it, while transport credentials are separately registered. | X | | `src/gateway/control-ui-public-session-render.ts` | publicMessageText/renderPublicSessionDocument sanitize messages/title before public HTML serialization. | X | | `src/gateway/health/collector.ts` | projectError sanitizes failed plugin activation error before health response. | X | | `src/gateway/local-user-ingress.ts` | safeDisplayLabel canonicalizes ingress display label for admission facts; authentication is separate. | X | | `src/gateway/server-methods/chat-user-turn-recorder.ts` | createGatewayChatUserTurnController redacts recorded user-turn mention excerpts after accepted chat input. | P | | `src/gateway/server-methods/control-ui.ts` | projectSessionPreview sanitizes lastMessagePreview before bounded Control UI bootstrap preview; title normalization is separate. | X | | `src/gateway/server/hooks.ts` | sanitizeHookLogMetadata redacts string fields before control-character folding/console bounds. | X | | `src/gateway/session-companion-ask.ts` | sanitizeAnswer redacts companion answer then rejects private-reference echoes before returning answer. | X | | `src/gateway/session-companion-context.ts` | normalizeContextText sanitizes transcript text before bounded companion model context. | X | | `src/gateway/session-observer-model.ts` | sanitizeSessionObserverModelText sanitizes model observer summaries before whitespace folding and bounds. | X | | `src/gateway/worker-environments/bootstrap.ts` | commandFailure sanitizes bootstrap stderr/stdout before thrown phase error. | X | | `src/gateway/worker-environments/tunnel-ssh-runner.ts` | workerSshStderrTail sanitizes SSH stderr before bounded tunnel failure excerpt. | X | | `src/gateway/worker-environments/worker-error.ts` | boundWorkerErrorText sanitizes worker failure messages before bounded error text. | X | | `src/gateway/worker-environments/worker-session-tool-result.ts` | workerSessionToolErrorResult sanitizes error before model-facing worker session tool failure. | X | | `src/gateway/worker-environments/worker-turn-computer-rpc.ts` | Computer RPC unavailable response sanitizes bounded message before result transmission; reason enum remains original. | X | | `src/gateway/worker-environments/worker-turn-execution.ts` | Worker process failure sanitizes stderr before thrown execution error; result code controls failure. | X | | `src/gateway/worker-environments/worker-turn-failure.ts` | workerTurnRecoveryError sanitizes formatted recovery failure before bounded turn failure. | X | | `src/gateway/worker-environments/workspace-result-finalize.ts` | workspaceError sanitizes finalize failure before surfaced workspace result. | X | | `src/gateway/worker-environments/workspace-sync-helpers.ts` | workspaceSyncError sanitizes stderr/stdout before constructing sync error. | X | | `src/gateway/ws-log.ts` | formatForLog uses process-cached shipped regex rules to redact strings and composed error chains before bounded WebSocket diagnostics. | P | | `src/infra/error-diagnostics.ts` | attachErrorDiagnostic stores a bounded sanitized diagnostic in its WeakMap attached to Error identity. | X | | `src/infra/errors.ts` | formatErrorMessage/WithCode and formatUncaughtError inject canonical redactor into message/code/stack rendering. | X | | `src/infra/exec-approval-text-sanitize.ts` | sanitizeExecApprovalDisplayTextInternal unions raw/invisible-stripped redaction bitmaps before final approval display. | P | | `src/infra/state-migrations.audit-records.ts` | prepareLegacyAuditRecords sanitizes imported system-agent/config records before stable digest and migrated record preparation. | X | | `src/infra/state-migrations.messages.ts` | recordStartupMigrationWarnings sanitizes joined warnings before terminal-safe startup output. | X | | `src/infra/update-candidate-canary.ts` | Canary child output and Doctor findings are sanitized before retained update diagnostics. | U | | `src/infra/update-candidate-snapshot.ts` | Snapshot child failure sanitizes stderr before thrown update-state snapshot error. | U | | `src/infra/update-failure-report-prepare.ts` | sanitizeReportField removes diagnostic lines then support secrets before update failure report. | U | | `src/infra/update-repair-agent.ts` | Repair prompt fields and extracted repair summary use support sanitation before model handoff/report. | U | | `src/infra/update-repair-worker.ts` | Repair worker diagnostics sanitize error/string values before bounded report. | U | | `src/infra/update-run-codec.ts` | UpdateRunRecordSchema receives mapJsonText-sanitized strings and redacted path roots before run record storage. | U | | `src/infra/update-triage.ts` | Triage export/command failure sanitizes reason before recovery hint and suggested command output. | U | | `src/llm/ai-transport-host.ts` | Configures provider-error redactor and AiTransportHost callbacks so model transport receives canonical sanitized tool data immediately before provider serialization. | P | | `src/logging/code-mode-diagnostic.ts` | Code-mode diagnostic writer sanitizes bounded name metadata serialized to subsystem log. | X | | `src/logging/console.ts` | writeFormattedConsoleOutput redacts a captured console message or stack before stdout/stderr writes; JSON style delegates envelope formatting. | I | | `src/logging/diagnostic-stability-bundle.ts` | readErrorMessage and sanitizeSessionEvidencePath sanitize stability-bundle error/path labels before export. | X | | `src/logging/diagnostic-support-export.ts` | writeDiagnosticSupportExport writes sanitized ZIP members; safeScalar admits only unchanged safe identifiers. | I | | `src/logging/diagnostic-support-log-redaction.ts` | sanitizeLogString scrubs imported log values before ZIP member serialization and truncation. | I | | `src/logging/diagnostic-support-redaction.ts` | redactCommonCredentialTextForSupport uses shared AWS spans with support marker; snapshot/config/string projections then scrub other export identifiers. | I | | `src/logging/json-console-line.ts` | formatJsonConsoleLine redacts nonstructural envelope strings then final serialized JSON; time/level keep structural handling. | I | | `src/logging/log-tail.ts` | readConfiguredLogTail resolves current logging options and redacts the joined final returned lines; multiline credentials remain one matching context. | I | | `src/logging/logger-file-transport.ts` | writeFileTransportWarning redacts transport failure diagnostics before asynchronous or synchronous stderr output. | I | | `src/logging/logger.ts` | getLogger.info redacts fields and final serialized message; assignDiagnosticLogAttribute rejects changed keys before diagnostic event emission. | I | | `src/logging/redact-pattern-runtime.ts` | Parses source/flags; dispatches RegExp or matcher with capture offsets used by replacement and bitmap readers. | I | | `src/logging/redact-patterns.ts` | Owns shipped regex strings and the single AWS eligibility/context matcher; candidate URL state lives only for one call. | I | | `src/logging/redact-source.ts` | redactSourceInputTextWithConfig applies configured text policy then source-assignment preservation; oversized source uses tool-payload policy. Assignment exemption does not disable structural secrets. | I | | `src/logging/redact.ts` | Resolves enabled policy; always applies form/auth/AWS structural protection, then selected regex strings; projects fields, batches, tool text and masks. | I | | `src/logging/subsystem.ts` | createSubsystemLogger.warn formats the configured console message, then writeConsoleLine applies terminal sanitation and raw-write redaction before console/stderr delivery. | I | | `src/media/fetch.ts` | redactMediaUrl sanitizes source URL in MediaFetchError; original source still drives network fetch. | X | | `src/node-host/connection.ts` | Node stats publication and worker-hosting-disabled warnings sanitize causes/reasons before stderr; hosting state is set separately. | X | | `src/node-host/node-worker-bundle-installer.ts` | Bundle install failure sanitizes caught error before NodeWorkerBundleInstallError; does not select bundle source. | X | | `src/node-host/node-worker-output.ts` | sanitizeNodeWorkerDiagnostic removes launch and registered secrets before canonical tool redaction of worker output. | X | | `src/plugin-sdk/agent-harness-runtime.ts` | formatToolProgressOutput redacts tool progress output before caller-selected maximum length. | X | | `src/plugin-sdk/browser-cdp.ts` | redactCdpUrl parses/strips userinfo and sensitive query fields, then canonical tool redaction; malformed URL text takes canonical text path. | X | | `src/plugin-sdk/diagnostic-runtime.ts` | normalizeDiagnosticValue/normalizeDiagnosticLane redact dimensions before grammar, fallback and scoped-lane grouping. | D | | `src/plugin-sdk/logging-core.ts` | Public logging-core barrel exposes canonical text, field and tool redaction without another classifier. | I | | `src/plugin-sdk/security-runtime.ts` | Public security-runtime barrel exposes canonical redactSensitiveText through the narrow security surface. | I | | `src/plugins/capability-catalog-context.ts` | createPluginCapabilityCatalogContext installs canonical redactor in capability callbacks for runtime provider discovery. | B | | `src/plugins/capability-catalog-context.types.ts` | Declares redactSensitiveText callback type on PluginCapabilityCatalogContext; no execution or decision. | B | | `src/plugins/installed-plugin-record-match.ts` | resolvePluginTrust sanitizes returned installSpec after trust/source matching; sanitized spec is not matching input. | X | | `src/plugins/plugin-command-runtime.ts` | executeSelectedPluginCommand sanitizes failed-plugin registration reason before bounded chat command error. | X | | `src/sessions/session-run-error.ts` | sanitizeSessionRunError sanitizes rendered error before stored failed-run outcome text. | X | | `src/system-agent/audit.ts` | appendSystemAgentAuditEntry redacts timestamped audit record before storage. | X | | `src/system-agent/setup-inference-core.ts` | Setup inference removes discovered exact secrets then canonical tool redaction before presentation. | X | | `src/trajectory/export.ts` | Sanitizes diagnostic values and path/object-key strings before trajectory export; preserves keys that collide after masking. | X | | `src/trajectory/metadata.ts` | buildSkillsCapture sanitizes sourceInfo; metadata capture sanitizes invocation argv and paths before export. | X | | `src/trajectory/runtime.ts` | sanitizeTrajectoryPayload redacts finalPromptText before bounds and sanitizes diagnostic objects before storage. | X | | `src/tts/tts-synthesis-support.ts` | formatTtsProviderError and sanitizeTtsErrorForLog sanitize synthesis failures before user/log error text. | X | | `src/tui/tui.ts` | formatTuiAuthCommandArgv sanitizes serialized auth command argv before terminal-renderable bounded output. | X | | `src/worker/worker-connection-contract.ts` | formatWorkerConnectionFailure sanitizes bounded connection detail before formatted failure message. | X | | `ui/src/lib/browser-redact.ts` | Builds browser cached string regexes and executable matcher references from canonical defaults; redactToolDetail/redactToolPayloadText replace captures before UI rendering. | I | **Validation readers (V):** These existing tests/fixtures import the owner; they are not additional shipped endpoints. - `extensions/codex/src/app-server/client-private-transport.test.ts` - `extensions/codex/src/app-server/sandbox-exec-server-node-relay.test.ts` - `packages/plugin-sdk/tests/security-runtime.test.ts` - `src/agents/provider-transport-fetch.integration.test.ts` - `src/agents/tools/web-search-provider-common.test.ts` - `src/commands/models/auth-api-key.test.ts` - `src/commands/models/list.auth-overview.test.ts` - `src/commands/triage.test.ts` - `src/config/sessions/transcript-append.test-support.ts` - `src/gateway/gateway-models.profiles.live.test.ts` - `src/gateway/server.agent.gateway-server-agent-a.test.ts` - `src/logging/diagnostic-support-export.test.ts` - `src/logging/diagnostic-support-redaction.test.ts` - `src/logging/redact-token-ordering.test.ts` - `src/logging/redact.structured-properties.test.ts` - `src/logging/redact.test.ts` - `src/logging/subsystem.test.ts` - `src/secrets/runtime.test.ts` - `src/secrets/sentinel.test.ts` - `src/system-agent/setup-app-recommendations.live.test.ts` **Lexical and callback readers:** | Reader | Operation / disposition | | --- | --- | | `packages/ai/src/host.ts:148,234` | Declares redaction callbacks/inert embedding defaults. OpenClaw installs the host in `src/llm/ai-transport-host.ts` (P/B); standalone unconfigured embedding excluded. | | `packages/ai/src/transports/transport-utils.ts:16–17` | Package text adapter delegates to active host tool redactor; options intentionally ignored (P/B). | | `packages/ai/src/transports/openai-responses-debug.ts:166–178` | `stringifyRedactedPayload` omits encrypted content, sanitizes serialized payload, then bounds debug output (X). | | `packages/acp-core/src/error-format.ts:93–100` | Stores/calls configured ACP redactor before package fallback credential rules. OpenClaw installs canonical callback; standalone fallback excluded (B/X). | | `packages/acp-core/src/runtime/errors.ts:70,127,142` | `readAcpRequestErrorDetails`/`formatAcpErrorChain` sanitize arbitrary details/causes before ACP errors (X). | | `extensions/openai/realtime-quicksilver-wire.ts:33–46,487–491` | Removes exact secrets then runtime callback before realtime error detail (X). | | `ui/src/plugins/control-ui-host.ts:94` | Supplies browser redaction as plugin-host callback; third-party UI callback execution excluded (B/X). | | `ui/src/lib/chat/tool-cards.ts:277–289` | `resolveCollapsedToolArgumentPreview` sanitizes argument line before collapsed card preview (P). | | `ui/src/lib/format-error.ts:4–10` | `formatUiError`/`formatUiExternalText` sanitize errors before fallback (X). | | `ui/src/pages/activity/tool-activity.ts:115–124` | `buildOutputPreview` sanitizes tool output before activity bounds (X). | | `ui/src/pages/chat/components/chat-tool-failure.ts:13–49` | `failureExcerpt`/`renderToolFailures` sanitize normalized failure output/display labels; failure-specific endpoint excluded unless separately observed (X). | | `src/config/schema.help.core.ts:77–78` | Help now explains string replacement plus mandatory structural protections (I). | | `src/config/schema.labels.ts:48` | “Custom Redaction Patterns” label remains accurate; no key change (I). | | `src/config/zod-schema.root-shape.ts:118`, `src/logging/config.ts:66–75` | Preserve config `string[]`; old config loading/reload/restart included (I). | | `docs/logging.md:630`, `docs/gateway/logging.md:160–165` | State replacement/structural contract and additive safety-boundary string rules (I). | | `docs/gateway/security/secrets-and-storage.md:79` | Environment-specific pattern guidance cannot disable structural protection (I). | | `docs/plugins/sdk-subpaths.md:284–318` | Documents public arguments, matcher contract and old-host limitation; objects never enter config (I). | | `docs/plugins/beam.md:185` | Promises default plus configured masking before mirror clipping even when logging is off; remote upload excluded (X). | Lexical non-consumers: `src/commands/backup-schedule.ts:50,98` and `extensions/qa-lab/src/multipass.runtime.ts:113,349` use local booleans. `extensions/qa-lab/web/src/ui-render-capture-redaction.ts:167` owns separate capture field redaction; its app/render-format callers do not consume this matcher. Lexical-only Browser CDP fuzz, Copilot embeddings, Parallel configured-pattern, ACP error-format, config help/labels/dead-key and browser-redact tests are validation readers. New/rewritten test entry points: `createSubsystemLogger.warn`, `getLogger.info` with final file flush, `chat.send` → `agent.wait` → `chat.history`/provider request, **`renderToolCard`** → Lit DOM, and `writeDiagnosticSupportExport` → final ZIP member. The test ledger records the retired false-positive path/query expectation. No unrelated channel pass is claimed. Additional Appendix B readers supplement the 193-file typed inventory. Rows marked V are existing validation only: the named operation was source-reviewed, with no new execution/pass or additional live endpoint claimed. The full per-file impact account is retained. | Reader | Disposition | | --- | --- | | `docs/gateway/config-observability.md` | Corrected operator contract: replace string regexes; retain structural protection. | | `extensions/browser/src/browser/cdp.helpers.fuzz.test.ts` | V: CDP non-URL masking and userinfo/error boundaries. | | `extensions/browser/src/browser/chrome.internal.test.ts` | V: Chromium lock recovery must retain its raw detector despite masked stderr. | | `extensions/codex/src/app-server/transcript-mirror.test.ts` | V: Mirror append/snapshot redaction preserves deduplication identity. | | `extensions/parallel/src/parallel-web-search-provider.test.ts` | V: Parallel HTTP error text masks exact and configured secrets; live delivery excluded. | | `extensions/qa-lab/web/src/app.ts` | QA error display uses its local keyed-capture redactor after shared error formatting; separate policy, QA endpoint excluded. | | `extensions/qa-lab/web/src/ui-render-capture-format.ts` | QA capture rendering uses that local JSON/query-field policy; no shared bare-AWS classifier or delivery claim. | | `extensions/whatsapp/src/inbound.media.test.ts` | V: Inbound media diagnostics apply custom patterns; WhatsApp remains excluded. | | `packages/acp-core/src/error-format.test.ts` | V: ACP configured callback followed by package fallback error masking. | | `packages/memory-host-sdk/src/host/error-utils.test.ts` | V: Memory error adapter merges provider/custom masking; service execution excluded. | | `src/acp/runtime/errors.test.ts` | V: ACP runtime error-chain custom/provider masking; live ACP excluded. | | `src/agents/embedded-agent-error-observation.test.ts` | V: Error previews reread config per call; fingerprints and sanitization failure remain distinct. | | `src/agents/embedded-agent-runner.guard.test.ts` | V: Session append masks thinking, tool arguments and results before storage. | | `src/agents/embedded-agent-runner/run/attempt.exec-review-transcript.test.ts` | V: Exec-review callback reads active-attempt rules and releases on teardown. | | `src/agents/embedded-agent-runner/server-endpoint-compaction.test.ts` | V: Compaction declines a durable commit when redaction would alter its window; live endpoint excluded. | | `src/agents/embedded-agent-subscribe.tools.test.ts` | V: Tool args/results retain nested configured masking; final-card proof is separate. | | `src/agents/exec-auto-review-transcript.test.ts` | V: Exec-review input uses attempt rules independently of ambient config. | | `src/agents/harness/host-capability.annotation.test.ts` | V: Annotation admission rejects restoration of storage-redacted text; live annotations excluded. | | `src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts` | V: Tool-result content/details use in-memory policy before persistence. | | `src/agents/sessions/agent-session-code-mode-source.test.ts` | V: Code-mode source survives SQLite reopen into replay with credential masks. | | `src/agents/tools/sessions-history-tool.test.ts` | V: sessions_history masks recalled text and marks contentRedacted. | | `src/agents/transcript-redact.test.ts` | V: Transcript masking may remove identity/mention provenance, not only text. | | `src/auto-reply/reply/conversation-turn-capture.test.ts` | V: Pending-reply capture masks correlated text; synthetic/other-channel delivery excluded. | | `src/config/schema.help.quality.test-fixtures.ts` | V: Help-quality fixture requires logging.redactPatterns documentation. | | `src/config/sessions/transcript-append-redact.test.ts` | V: Transcript append reads logging config when caller omits it, then masks before disk. | | `src/config/types.base.ts` | LoggingConfig remains optional string[]; it carries config and makes no policy decision. | | `src/gateway/client.test.ts` | V: GatewayClient failure-log config fixture; network/device-auth execution not claimed. | | `src/gateway/control-ui-public-session-render.test.ts` | V: Public-share HTML title/text masking; separate from tool-card browser proof. | | `src/gateway/server-methods/channels.status.test.ts` | V: channels.status keeps failed plugins visible while sanitizing diagnostics. | | `src/gateway/server/hooks.early-failure.test.ts` | V: Hook/cron diagnostics reach configured console/log sinks; live scheduling excluded. | | `src/gateway/session-companion-context.test.ts` | V: Companion context masks each selected transcript row; delivery excluded. | | `src/logging/config.test.ts` | V: Config reader keeps custom regexes despite an unrelated unresolved variable. | | `src/logging/console-capture.test.ts` | V: Console message/subsystem/metadata masks run before JSON escaping. | | `src/logging/log-tail.test.ts` | V: Log-tail spies verify delegation, not masking; real CLI proof covers the reader. | | `src/plugins/contracts/capability-catalog.contract.test.ts` | V: Unavailable redactor callback protects cold catalog construction; no masking executes. | | `src/plugins/loader.capability-factory.test.ts` | V: Unavailable redactor callback protects cold factory construction; no masking executes. | | `src/plugins/plugin-command-runtime.test.ts` | V: Authorized plugin failure replies mask configured secrets; channel delivery excluded. | | `src/system-agent/setup-inference-error-reporting.test.ts` | V: Setup-error stdout/stderr masking fixture; no live inference claim. | | `src/tui/tui.local-auth.test.ts` | V: Local-auth argv display masks custom/built-in values; login execution excluded. | | `ui/src/lib/browser-redact.test.ts` | V: Browser-safe adapter credential tests; renderToolCard supplies final-display proof. | The derived help path is `scripts/lib/control-ui-i18n-catalog.ts:105` (compose current hints and source-hash input) → `ui/src/i18n/lib/config-hint-translation.ts:9` (path/field/source-derived key) → `ui/src/lib/config-form-utils.ts:114` (active translation or current Gateway English fallback). These are included help-text consumers, not redaction-policy owners. All following memory/adapter pairs were inspected. Each memory has the old help key and unchanged label key, but no new help key. Each source-owned adapter exports its matching virtual locale. Current-key/source-hash validation rejects stale help; generated refresh belongs to the serialized post-merge locale workflow. No generated file is changed or translated-output execution claimed. | Canonical memory | Runtime adapter | | --- | --- | | `ui/src/i18n/.i18n/ar.tm.jsonl` | `ui/src/i18n/locales/ar.ts` | | `ui/src/i18n/.i18n/de.tm.jsonl` | `ui/src/i18n/locales/de.ts` | | `ui/src/i18n/.i18n/es.tm.jsonl` | `ui/src/i18n/locales/es.ts` | | `ui/src/i18n/.i18n/fa.tm.jsonl` | `ui/src/i18n/locales/fa.ts` | | `ui/src/i18n/.i18n/fr.tm.jsonl` | `ui/src/i18n/locales/fr.ts` | | `ui/src/i18n/.i18n/hi.tm.jsonl` | `ui/src/i18n/locales/hi.ts` | | `ui/src/i18n/.i18n/id.tm.jsonl` | `ui/src/i18n/locales/id.ts` | | `ui/src/i18n/.i18n/it.tm.jsonl` | `ui/src/i18n/locales/it.ts` | | `ui/src/i18n/.i18n/ja-JP.tm.jsonl` | `ui/src/i18n/locales/ja-JP.ts` | | `ui/src/i18n/.i18n/ko.tm.jsonl` | `ui/src/i18n/locales/ko.ts` | | `ui/src/i18n/.i18n/nl.tm.jsonl` | `ui/src/i18n/locales/nl.ts` | | `ui/src/i18n/.i18n/pl.tm.jsonl` | `ui/src/i18n/locales/pl.ts` | | `ui/src/i18n/.i18n/pt-BR.tm.jsonl` | `ui/src/i18n/locales/pt-BR.ts` | | `ui/src/i18n/.i18n/ru.tm.jsonl` | `ui/src/i18n/locales/ru.ts` | | `ui/src/i18n/.i18n/th.tm.jsonl` | `ui/src/i18n/locales/th.ts` | | `ui/src/i18n/.i18n/tr.tm.jsonl` | `ui/src/i18n/locales/tr.ts` | | `ui/src/i18n/.i18n/uk.tm.jsonl` | `ui/src/i18n/locales/uk.ts` | | `ui/src/i18n/.i18n/vi.tm.jsonl` | `ui/src/i18n/locales/vi.ts` | | `ui/src/i18n/.i18n/zh-CN.tm.jsonl` | `ui/src/i18n/locales/zh-CN.ts` | | `ui/src/i18n/.i18n/zh-TW.tm.jsonl` | `ui/src/i18n/locales/zh-TW.ts` | The integration base added a diagnostic-fact pipeline. These paths consume the repaired support owner; they do not add an AWS classifier or change update admission: - `src/logging/diagnostic-support-redaction.ts` adds first-line/path/command projection after the existing complete support pass; `src/infra/update-failure-facts.ts` normalizes each diagnostic fact and batches up to five facts. - `src/infra/update-runner-command.ts`, `src/infra/package-update-verification-step.ts`, `src/infra/package-update-swap.ts`, and `src/infra/package-update-steps.ts` capture normalized command, verification, swap and package-install failures before returning update-step diagnostics. Exit/recovery outcomes remain separate. - `src/infra/update-doctor-lint.ts` converts error findings into facts; `src/flows/doctor-health.ts` captures config-write/migration/Doctor failures; `src/infra/update-doctor-result.ts` normalizes facts at both child receipt write and parent receipt read. - `src/cli/update-cli/update-command-service-plan.ts` and `src/cli/update-cli/shared.ts` normalize service/runtime preflight errors; `src/cli/update-cli/update-command-plugins-internals.ts` normalizes plugin failures; `src/cli/update-cli/update-command-fresh-doctor.ts` carries normalized child errors in `UpdateDoctorError`. - `src/cli/update-cli/update-finalization-lifecycle.ts`, `src/cli/update-cli/update-command-verification.ts`, and `src/cli/update-cli/update-command-terminal.ts` normalize phase timeout/error, restart health and terminal failure facts before ledger/report handling. They do not infer success from redacted text. - `src/infra/update-candidate-canary.ts` captures a sanitized first stderr line and failed-phase facts; `src/infra/update-run-codec.ts` normalizes facts before ledger encoding. Existing captured-tail and other diagnostic redaction remain. - `src/commands/triage.ts` carries recorded facts into `src/commands/triage-update.ts`, which sanitizes them before the bounded triage prompt. `src/infra/update-failure-report-prepare.ts` applies the stricter public diagnostic projection before report preview/body preparation. Public support reports intentionally remove private prose/paths; the chat URL-preservation contract does not require those reports to retain a URL. These update/triage lifecycle and report endpoints remain excluded from execution claims (U). Their source-supported diagnostic dependencies are accounted for here; retained runtime evidence is not relabeled as new fact-pipeline execution. **Shipped consumers:** No new required public argument, config key or plugin capability is introduced. Actual artifacts and operation limits are recorded below. | Consumer/version | Declared floor | Artifact / operation | Result / scope | | --- | --- | --- | --- | | Operator config authored by 2026.9.4 CLI | Existing `string[]` contract | Retained old-CLI config; candidate load, egress, reload/restart | Final candidate unchanged-config/egress pass; not an old-CLI updater lifecycle claim. | | External public security-runtime consumer | SDK 2026.9.4 | Published npm 2026.9.4 tarball and compiled788 candidate, identical consumer | Runtime PASS: ten processes, five configs per artifact, 11 existing argument shapes, 110 fixtures; stable repeated calls and unchanged config bytes. Candidate custom-only retains structural masks. The same external TypeScript consumer compiles and runs against shipped/candidate declarations in [CI proof](https://github.com/openclaw/openclaw/actions/runs/34688551385), strict with skipLibCheck:12 call forms ×5 subjects per host, all120 outputs inspected. Separate candidate matcher compilation/execution passes. | | Anthropic bundled plugin 2026.9.4 | Private same-package plugin; no independent minimum declared | Manifest + candidate direct CLI backend | 12 subprocess/warm-session tests pass; no separate historical minimum-host claim. | | Published Codex plugin 2026.9.4 | Install `>=2026.5.1-beta.1`; **pluginApi `>=2026.9.4`** | Same npm tarball on published2026.9.4 and candidate788 | Index import PASS both. Floor owner-created WebSocket relay handles16 requests and cleans up. Candidate lazy relay FAILS before admission: removed `registerRetainedNativeHookRelayForBundledRuntime` export. Baseline196 has the same failure; baselineMain source is identical. #144828 predates this PR. Outside contract by owner decision; no candidate shipped-relay pass claimed. Existing candidate-source67 admission tests remain separate. | | Published diagnostics-otel2026.9.4 | Install `>=2026.4.25`; **pluginApi `>=2026.9.4`** | Same npm tarball on published2026.9.4 and candidate788; register → service.start → log.record → actual stdout → stop | PASS:4 processes/36 exported records with current/custom configs. Candidate omits credential-shaped keys, masks secret values/form/Digest and preserves public URLs. Subscriptions removed/config unchanged. Network exporter not claimed. | | Browser bundled plugin 2026.9.4 | Private same-package plugin; no independent minimum declared | Manifest + bundled browser adapter/UI asset | Final tool-card proof retained; CDP connection-error flow excluded. `browser-cdp` is documented private JavaScript host runtime, not typed third-party SDK. | | Remaining listed provider/memory/error callbacks | Existing logging-core/security-runtime contract | Named source readers above | Operation-specific exclusions; no blanket plugin compatibility or historical floor-artifact pass. | **Follow-ups:** The published Codex plugin lazy relay fails on the pre-fix baseline and candidate because #144828 removed a native-hook export before intake; the owner excluded this failure from this PR. ## Invalidation - Scanner state belongs to one invocation. Each run retains its original URL object. A matching closer clears the active pointer; whitespace/end consumes and clears pending runs. No scanner state survives the call. - Built-in patterns, the non-global value probe, resolved default/tool arrays, support vendor rules, copied WebSocket defaults and browser compiled rules are derived from code. Process restart or loading the updated UI bundle rebuilds them. - Startup and Gateway reload still use `applyLoggingConfig`. Fresh runtime checks cover current/older copied lists, adding and removing a pattern, restoration and process restart. - Registered-secret additions and eviction keep their existing cache invalidation. No new config reader or persistent state is introduced. Help/locales: `buildBaseHints` in `src/config/schema.hints.ts` carries current server help into the catalog. The help key changes from `v1-2nwid5-6w` to `v1-1esa6eg-7k`; the label key stays `v1-17ykioa-p`. `scripts/lib/control-ui-i18n-catalog-values.ts:67` requires both a current key and matching normalized source hash before using a translation. `ui/config/control-ui-locales.ts` materializes locale modules, watches transitive source/memory files and replaces its cache on build start or watch changes. `ui/src/i18n/lib/registry.ts` loads the adapters; `ui/src/i18n/lib/translate.ts` retains maps for the current page. The config editor uses current English when the new help key is absent. Deploying the rebuilt UI and reloading the page adopts refreshed maps; logging reload does not translate catalogs or replace a loaded bundle. `ui/AGENTS.md` assigns translation generation to `.github/workflows/control-ui-locale-refresh.yml`: main changes to `src/config/schema*.ts` trigger serialized refresh and an isolated generated PR with auto-merge, validated against source invalidation paths. All 20 memory files and 20 adapters remain untouched in this source PR. Keyless `ui:i18n:verify` covers source/wiring; strict `ui:i18n:check` owns generated/release parity. This account verifies source and memory, not post-merge workflow completion or a live localized UI run. Invalidation addition: facts are freshly normalized at capture, Doctor receipt write/read, ledger encode, triage projection and report preparation. Stored masks are not reversed after a config change. A new operation uses current process/configuration policy; restart loads current code. Canary first-line state belongs to one child. Recomputed report bodies get a new preview digest. No new cache or policy owner is added. ## Contention Redaction remains synchronous and adds no lock, queue or transaction. Each caller owns its scanner state. Two 4,096-candidate Gateway workloads submit a competing operation during the actual staging interval. Candidate completion is 134.53 ms and 83.64 ms; maximum owner queue wait is 0.231 ms. Full inputs, owner timestamps and state readbacks are retained. Earlier filesystem-notification measurements did not establish temporal overlap and are excluded from this claim. ## Tests - The current registered Gateway suite passes **46 tests**. `chat.send` assertions inspect `chat.history` and complete recorded provider requests; the approval test inspects the display after actual request registration. - Retained UI suites pass **102 tests**. `renderToolCard` redaction cases inspect rendered tool-card text, including public paths, compact siblings, raw userinfo and nested query values. - Fresh targeted logging/support suites pass **289 tests**. `writeDiagnosticSupportExport` requires the long vendor token’s final ZIP field to contain only the established hint, with no raw tail. `createSubsystemLogger.warn` covers copied defaults, extra/custom-only strings, structural credentials and default slash-containing database passwords; `getLogger.info` checks final on-disk messages and malformed credential siblings. - One stale masking expectation is deliberately retired: `https://example.test/path-S?foo=@` now belongs in the Gateway preservation table, and the UI expects the complete URL. Here `S` denotes the synthetic 40-character value. This follows the explicit requirement that a query at-sign cannot retroactively classify a public path as credentials. A parenthesized nested-query case replaces the stale Gateway masking row and continues to require masking inside the query. - Fresh independent source review finds no blocking issue. The historical native scanner review retains its original 32 matcher cases and 20 server/browser consumer observations. - Fresh boundary suites pass **363 tests**: public SDK, subprocess diagnostic error display, WebSocket node HTTP admission, registered telemetry exporter, transcript projection and diagnostic log attribute admission. These observe the named boundaries, not remote vendor acceptance or live external export. - The `redactSensitiveText` custom-only form test now requires masking. Two capture/backreference tests use `project_value` instead of `password` so mandatory form preprocessing does not preempt the capture test. `resolveRedactOptions` tests retain mode-off and compiled-RegExp reuse, removing only obsolete flag/count assumptions. `redactSensitiveLines` tests use actual custom-only/rejected-regex resolution and retain Digest/registered-secret masking. `getDefaultRedactPatterns` tests its serializable string contract. - Fresh compiled-runtime acceptance passes configuration, logging, support exports, reload/restart and the paired benchmark. The complete Gateway corpus, real-browser display and Telegram semantics pass. Telegram cleanup is separately qualified above. - The fresh lexical census passes on the CI merge tree with no remaining removed-matcher reader, manual row or generic exemption. Completed typed proof covers that exact integration tree. Previous CI receipts and ClawSweeper gate remain historical; fresh structural receipts and exact-head review are required for this head. CI owns typechecking and full suites; guarded merge still requires independent census ACCEPT. Co-authored-by: Ayaan Zaidi <[email protected]>
Put back upstream b1c68b9 content that the continuation line had silently reverted in shared files. Every row has a keep/restore disposition recorded in the round journal. Feature hunks are preserved. Production: - announce deps: use callSubagentLifecycleGateway for the wake and cleanup deps (openclaw#146369 inherited Gateway binding). - reply-delivery: clear blockSourceText on superseded deferred replies (openclaw#143722). - stream-rendering: record a block reply as delivered only when it has text (openclaw#135751). - gateway runtime handles: carry hotReloadStatus through the managed reload. - sweep-kill and sweeper: honor retired cancellations (reconcileRetiredSubagentCancellation), and pass the run's Gateway context resolver into sweep session deletes. - registry read: per-child snapshot reads (openclaw#154727), so the Gateway event loop is not blocked. - session delivery queue: read the post-enqueue status inside the SQLite worker instead of on the main thread, restoring the openclaw#147887 invariant. Tests restored to upstream's coverage: - task-registry kernel test: back to upstream's kernel functions. - double-announce: real outbound adapter retry outcomes (openclaw#131419). - side-question: listener-failure hooks case (openclaw#144828). - session-delivery storage: main-thread-SQL idle assertion (openclaw#157458). - media-only: the re-resolved auth selection assertion. - resume persistence: activation uses the real recovery-runtime shape. The resume "steered requester turn" test was adapted for upstream's async task lookup (openclaw#157634). Its stub now settles like the real waker, and the test waits for settle before an exact count, with a no-pending-wake assertion added. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Fq5EX9ESA3CG9cuZxVoKAK
Related: #144592
What Problem This Solves
Native-hook startup and cleanup assume SQLite locator operations finish synchronously. Delayed publication or renewal can start a thread before its relay is discoverable, expose an expiry before it is stored, or leave an old locator after unregistering. Lookup delays can also initiate transport after the caller deadline.
Why This Change Was Made
The relay owner retains publication, serialized renewal, conditional deletion and listener closure. Bundled Codex startup waits for the direct publication attempt and revalidates current foreground authority; if direct publication fails, the generated command keeps its existing Gateway route. Strict publication errors remain observable separately. Non-listening relays retain logical renewal; listening relays publish durable expiry before exposing it.
Cleanup joins accepted work while preserving successful-yield children and existing late-hook grace. The shipped synchronous registration handle and command getters remain compatible; readiness, preparation and drainage are private bundled capabilities. Schema, hook payloads and approval policy stay unchanged.
User Impact
Native hooks preserve their command, fallback and approval behavior while startup, renewal and cleanup gain explicit completion boundaries. Cancellation, replacement and foreground retirement still reject stale invocation. An exhausted lookup deadline cannot start transport.
Evidence
This is lifecycle/API groundwork. Native SQLite still runs on the calling thread until the canonical worker cutover. The compiled proof exercises real Gateway, CLI and SQLite behavior; native Codex binary execution and model inference were not run.