Skip to content

fix(logging): stage Reply SLA telemetry successor on canonical owner #1486 - #1710

Draft
seonghobae wants to merge 59 commits into
claude/noema-contextualwisdomlab-commercialization-afow1jfrom
fix/reply-sla-redacted-telemetry
Draft

seonghobae wants to merge 59 commits into
claude/noema-contextualwisdomlab-commercialization-afow1jfrom
fix/reply-sla-redacted-telemetry

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Refs #1698. Canonical Reply-SLA/Noema source owner: #1486.

Current authority

This PR was initially created directly on #1700 after the protected-develop #1698 sink inventory identified backend/services/reply_sla_scheduler.py. A fresh open-PR ownership sweep then found that #1486 is already the canonical broad Reply-SLA/Noema writer and currently modifies the same scheduler source and tests. The initial three-file claim is therefore not merge authority and must not become a parallel writer.

The PR is now retargeted to #1486. The branch has not been force-rebased or destructively rewritten, and no merge commit has been manufactured that would discard either #1486 or #1700 valid deltas. Ordinary ancestry reconciliation is deferred until the prerequisite lineages can be combined without dropping source, tests, migrations, contracts, or evidence.

Valid finding to preserve

The protected-develop scheduler loop still uses ordinary exc_info=True; Python logging renders the original exception value and traceback for that form. The first implementation attempt also covered the protected-develop per-owner sink, but #1486 has already independently changed that path to a bounded exception-type diagnostic and removed raw owner interpolation. Any eventual successor must start from #1486's live scheduler semantics rather than overwrite them.

The valid remaining security requirement is:

Preserved TDD provenance

The initial #1700-based lane has two ordinary commits that remain useful provenance but are not accepted owner integration:

  1. c198326a006137b920fd34394f778ec237e8c3d0 — formatter-level RED regressions for the protected-develop scheduler sinks.
  2. eee00bda624c58795a8adb17a5b2b734fd20d0a1 — initial bounded-telemetry repair against the fix(security): bound exception telemetry without raw traceback #1700-era scheduler source.

A focused exact-source harness reproduced secret-bearing exception/credential/path/owner-id disclosure before that repair and bounded output after it. That result is local/source-level evidence only and cannot be transferred to #1486's different current scheduler implementation.

Required ancestry order

  1. fix(security): bound exception telemetry without raw traceback #1700's structured telemetry contract reaches protected ancestry through its canonical fix(security): stabilize exception-redaction successor #1612 lineage and reacquires exact-head hosted/review evidence.
  2. feat(noema-agent): add calendar conflict-check tool #1486 resolves its already-declared fix(ci): make stacked PR validation a develop prerequisite #1691/fix: create workspace_entities/workspace_documents registry and provision Workspace rows #1503 prerequisite topology and ordinarily adopts the resulting protected ancestry without losing its Reply-SLA physical-lease/workspace deltas.
  3. This successor then ordinary/non-force adopts the resulting feat(noema-agent): add calendar conflict-check tool #1486 owner head and the protected telemetry contract, adapts the RED tests to the live scheduler implementation, and proves RED→minimal fix→GREEN on the reconciled exact head.
  4. Only that reconciled head can request hosted required checks and qualifying independent review.

Until then, no source delta in this PR is merge authority. Do not temporary-retarget to develop, copy #1700 helper source, fabricate a two-parent tree that drops parent deltas, use dummy/no-op evidence commits, synthesize statuses, self-approve, force-push, destructively rebase, or weaken gates.

seonghobae and others added 30 commits September 7, 2026 14:38
Signed-off-by: Seongho Bae <me@seonghobae.me>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9cb235f9-2a68-4580-915f-ac4a30522d8d

📥 Commits

Reviewing files that changed from the base of the PR and between 2d6800a and eee00bd.

📒 Files selected for processing (3)
  • backend/services/reply_sla_scheduler.py
  • backend/tests/test_reply_sla_scheduler_exception_telemetry.py
  • docs/doctoring/reply-sla-exception-telemetry.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Reply SLA scheduler now logs redacted exception details at two failure points. New tests verify removal of secrets, paths, tracebacks, and owner identifiers. Documentation records the telemetry migration and retained fields.

Changes

Reply SLA exception telemetry

Layer / File(s) Summary
Redacted scheduler logging
backend/services/reply_sla_scheduler.py
The scheduler loop and owner follow-up handler use redacted_exception_info. The owner follow-up log no longer includes the configured owner’s user ID.
Telemetry regression coverage
backend/tests/test_reply_sla_scheduler_exception_telemetry.py, docs/doctoring/reply-sla-exception-telemetry.md
Async tests verify exception types and fingerprints remain while secrets, internal paths, tracebacks, and owner identifiers are excluded. Documentation records the migration details and unchanged scheduler behavior.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to eee00

The scheduler’s exception telemetry change has no identified merge-blocking issue.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title relates to the Reply SLA logging telemetry change, but it does not clearly state the primary change: redacting sensitive exception data and owner identifiers. It remains sufficiently related…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reply-sla-redacted-telemetry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact 2d6800aea110ac04eeedcd5faa91479f62877408 → eee00bda624c58795a8adb17a5b2b734fd20d0a1, with particular attention to exception-value/traceback confidentiality, removal of the raw configured-owner identifier, preservation of scheduler lifecycle/advisory-lock semantics, and whether the two formatter-level regressions cover both production sinks. Do not treat parent review/check evidence as current-head evidence.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='2d6800aea110ac04eeedcd5faa91479f62877408'
head='eee00bda624c58795a8adb17a5b2b734fd20d0a1'

printf '%s\n' '=== exact range and changed files ==='
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"
printf '%s\n' '=== scheduler diff ==='
git diff --find-renames --find-copies "$base" "$head" -- backend/services/reply_sla_scheduler.py
printf '%s\n' '=== test diff ==='
git diff --find-renames --find-copies "$base" "$head" -- backend/tests/test_reply_sla_scheduler_exception_telemetry.py
printf '%s\n' '=== doctoring diff ==='
git diff --find-renames --find-copies "$base" "$head" -- docs/doctoring/reply-sla-exception-telemetry.md
printf '%s\n' '=== scheduler outline ==='
ast-grep outline backend/services/reply_sla_scheduler.py --items all || true
printf '%s\n' '=== test outline ==='
ast-grep outline backend/tests/test_reply_sla_scheduler_exception_telemetry.py --items all || true
printf '%s\n' '=== redaction helper definitions and uses ==='
rg -n -C 4 --glob '*.py' '\bdef\s+redacted_exception_info\s*\(|\bredacted_exception_info\s*\(' backend core 2>/dev/null || true
printf '%s\n' '=== exception logging in scheduler ==='
rg -n -C 7 --glob '*.py' '(logger|logging)\.[a-z_]+\(' backend/services/reply_sla_scheduler.py
printf '%s\n' '=== scheduler source ==='
cat -n backend/services/reply_sla_scheduler.py
printf '%s\n' '=== telemetry test source ==='
cat -n backend/tests/test_reply_sla_scheduler_exception_telemetry.py
printf '%s\n' '=== helper source candidates ==='
fd -t f -e py . | xargs -r rg -l 'def redacted_exception_info' | xargs -r -n1 sh -c 'echo "=== $0 ==="; cat -n "$0"'

Length of output: 38774


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='2d6800aea110ac04eeedcd5faa91479f62877408'
head='eee00bda624c58795a8adb17a5b2b734fd20d0a1'

printf '%s\n' '=== commit topology ==='
git merge-base "$base" "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base is ancestor of head'
git rev-list --count "$base..$head"
git diff --check "$base" "$head"
git show --no-patch --format='head=%H%nparents=%P%nsubject=%s' "$head"
printf '%s\n' '=== scheduler test candidates ==='
fd -t f -e py . backend/tests | xargs -r rg -n -l 'ReplySlaScheduler|_try_acquire_sweep_lease|_release_sweep_lease|_sweep_configured_owners' || true
printf '%s\n' '=== scheduler test definitions and assertions ==='
fd -t f -e py . backend/tests | xargs -r rg -n -C 5 'async def test_.*(scheduler|sweep|lease|owner)|def test_.*(scheduler|sweep|lease|owner)|ReplySlaScheduler|_try_acquire_sweep_lease|_release_sweep_lease' || true
printf '%s\n' '=== static exception sink inventory in scheduler at head ==='
git show "$head:backend/services/reply_sla_scheduler.py" | rg -n -C 4 'except (Exception|BaseException)|exc_info'
printf '%s\n' '=== direct changes against parent commit ==='
git show --format=fuller --find-renames --find-copies --stat "$head"
printf '%s\n' '=== safe logging formatter tests ==='
cat -n backend/tests/test_safe_logging.py
printf '%s\n' '=== exception boundary formatter tests ==='
cat -n backend/tests/test_exception_logging_boundaries.py

Length of output: 81543


@seonghobae I reviewed exact 2d6800aea110ac04eeedcd5faa91479f62877408 → eee00bda624c58795a8adb17a5b2b734fd20d0a1.

I found no blocking issue in this range.

  • Both production exception sinks now use redacted_exception_info(exc).
  • The helper supplies a bounded replacement exception and None for the traceback.
  • The per-owner error message no longer includes config.user_id.
  • The changed control flow preserves cancellation handling, loop retry behavior, advisory-lock acquisition and release, and per-owner continuation.
  • The two new formatter-level tests exercise the two distinct production sinks.
  • The owner-path test rejects the configured owner identifier, database credentials, and API-key-shaped data.
  • The loop-path test rejects provider-token-shaped data and the internal path.
  • Both tests require the operation label, exception_type=RuntimeError, and exception_fingerprint=.

I did not execute repository code or tests. I did not use parent review or check evidence as evidence for this head.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae seonghobae changed the title fix(logging): redact Reply SLA exception telemetry fix(logging): stage Reply SLA telemetry successor on canonical owner #1486 Sep 16, 2026
@seonghobae
seonghobae changed the base branch from fix/structured-exception-telemetry to claude/noema-contextualwisdomlab-commercialization-afow1j September 16, 2026 16:56

Copy link
Copy Markdown
Contributor Author

Evidence correction: CodeRabbit submitted APPROVED review PRR_kwDOSNjZ2s8AAAABN3nvwg at 2026-09-16T16:56:07Z, before the ownership repair retarget at 16:56:47Z. That review covered the old #1700-based range and is not qualifying current-base merge evidence for the retargeted #1486 successor. It is retained as historical provenance only; do not dismiss it or transfer it across ancestry. Fresh review is required after ordinary owner/prerequisite reconciliation produces the final exact head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant