← Back to Pull requests

feat(reliability): measure observer overhead with a synthetic DSH session #6840

Closed
unknown closed this pull request without merging on Oct 19, 2026 10:25 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 02:08 UTC
Author

Goal And Delivered Outcome

  • Outcome basis / optional anchor: #5211; RFC §12 P0 "measured overhead".

  • Goal/source and gap: the capability required measured observer overhead, but there was no measurement tool. This adds a deterministic synthetic bench for the observer component cost.

  • Observable before → after: no tool → one command produces a public-safe JSON/Markdown report with observer off/on arms, CPU, RSS, ledger append latency, ledger bytes, event loss, clock uncertainty, and full denominators. See the real_entrypoint validation row.

  • Issue/task and intended base: Related to #5211; base main at dc9fdbb5186618ec2e797a9d7545e2fe524fee56.
  • Author Declaration

  • Written by: model_agent, DeepSeek (DeepSeek Harness).
  • Implemented against

  • Specification and revision: RFC §12 P0 and #5211; capability README at the same revision.

  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |
    | --- | --- | --- | --- |
    | Deterministic synthetic DSH event stream | implemented | bench/overhead-runner.ts | vitest run tests/observer-overhead.spec.ts |
    | Observer off/on arms with full denominators | implemented | bench/overhead-runner.ts, bench/overhead-report.ts | same test; CLI run |
    | CPU, RSS, append latency, bytes, event loss, clock uncertainty | implemented | bench/overhead-report.ts | same test; CLI run |
    | Public-safe report without IDs or paths | implemented | renderMarkdown, report tests | test asserts fixture IDs absent |
    | No default change and no C1/P0 exit claim | implemented | capability README, report limits | review; manual: not_run |

  • Self-check before submission: read the full diff and the report schema; ran the commands below. No live DSH run was performed.
  • Scope And Continuation

  • Completed scope: additive synthetic bench, report reducer, focused tests, and bilingual capability docs.

  • Review fixes on this branch: 18b08550f (surface lossy trials and measure the shipped ledger writer) and 2f87039a5 (a trial whose planned record and envelope-kind mix is not consumed is excluded, and the report is marked NOT USABLE).

  • Remaining work: live DSH host overhead, eligible C1 evidence, and deployment-owner retention acceptance. This PR is an increment; it does not close #5211 or the P0 gate.
  • Validation

  • Tested revision: 2f87039a527b0f769195b40a0679c2a687b6edcf (current head; the initial slice was submitted at 0ec1e4143).

  • Run state: finished.

  • Input classes: synthetic.
  • | Check kind | Result | Public-safe evidence / limitation |
    | --- | --- | --- |
    | static | passed | tsc host/client/tests project checks exit 0; node scripts/build.mjs; docs-governance-smoke.py; git show --check; loopx check boundary scan clean (6 files) |
    | unit | passed | vitest run tests/observer-overhead.spec.ts → 11 passed (includes a trial marked unusable when a planned kind is not consumed) |
    | real_entrypoint | passed | bench:observer --events 5000 --repeat 3 wrote JSON + Markdown with schema reliability_observer_overhead_report_v0; usable, planned-record and envelope-kind mix passed, 5,000 envelopes persisted, 0 dropped |
    | integration | passed | pytest tests/capabilities/test_reliability_diagnostics.py tests/capabilities/test_reliability_diagnostics_dsh_provider.py -q → 117 passed |
    | regression_parity | not_run | Additive tool; no runtime, default, or projection behavior changed |
    | manual | not_run | No live DSH host, model, or C1 run is claimed |

  • Coverage and gaps: the bench covers the synthetic event plan, two arms, append-failure accounting, count conservation, planned-record and envelope-kind mix coverage, and public-safe rendering. It deliberately excludes Cordis dispatch, DSH scheduling, model/network latency, and live qualification. The full plugin suite on local Windows has pre-existing POSIX-path/symlink/timeout failures unrelated to this diff; the Linux CI lane is authoritative. A local loopx canary premerge --from-git-diff attempt hit environment-level failures (local pnpm 9 cannot parse the pnpm-10 workspace config; Windows install/path smokes); no failure points to this diff.
  • Frontend / Visual Evidence

    UI impact: none. This adds a developer bench and bilingual capability documentation; no first-screen or user-facing surface changed.

    Boundary Checklist

  • Public-safe diff and description; no private state, local paths, credentials, or raw logs.

  • Single-purpose additive change; no duplicated runtime or benchmark work.

  • DCO sign-off included.

  • Default-off runtime behavior unchanged; no C1/P0-exit claim.
  • Diff: 614 lines (+460 / -154) across 7 files Reviewer: JasonBuildAI Review duration: 497m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 614 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.384
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6840"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.2% (MEDIUM) · Higher = larger blast radius
    50.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.7% · Safe to merge
    21.7%