← Back to Pull requests

Complete epic #9 and accept ADR-002 [#9] #94

Closed
unknown closed this pull request without merging on Oct 02, 2026 13:40 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 12:01 UTC
Author

Completes the remaining criteria of epic #9 and, at the maintainer's request, accepts ADR-002.

Changes


  • Stream uniqueness (AuditSinkAdapter::addRing): returns AuditRingRegistration. An invalid identity → InvalidStream; an identity already registered on the adapter → DuplicateStream, which covers a second concurrent producer and a recreated producer that kept its identity while its sequence restarted. Refusals are configuration errors in audit health (lastIssue names them) and refused rings are not drained. Registered identities stay reserved for the adapter's lifetime. Uniqueness across adapters, processes and boot sessions remains the host's obligation (stated in the ADR and the guide). Breaking: the result is [[nodiscard]].

  • AuditRing::identity() accessor (governed core, non-allocating).

  • External consumer review (docs/audit-scenario-validation.md), MduX d972d77 and WebFront 3027d33: identifiers fit the grammar and capacities (longest 29 bytes); MduX's governance AuditEvent records the development history and is not an input to this path (its Lifecycle is a software-lifecycle phase); WebFront emits no audit; Lifecycle and Operator still lack a runtime call site, recorded as a residual gap for the ADR review.

  • ADR-002 Decision 5: states the 64-bit sequence, start at 1, one admission of UINT64_MAX then permanent SequenceExhausted, and the enforced scope of stream uniqueness.

  • docs/migration/audit-admission.md: registration results and the breaking change.
  • ADR-002 accepted (maintainer request): status lists the implementing issues (#56–#59, this PR) and the limits acceptance does not lift — levels 1–2 only (level 3 with ADR-004/#11), Lifecycle/Operator without a runtime call site, no monotonic value, per-adapter stream uniqueness. Approval dated 2026-10-02. Index, README roadmap and validation report updated.

  • Review fix: addRing() rolls the identity reservation back if adding the ring source throws.
  • Verification (macOS arm64, LLVM 21.1.8, CMake 4.3.1)


  • Configured, compiled, linked; CTest 118/118, including the new audit-stream-identity-uniqueness spec (concurrent duplicate, recreated producer, invalid identity, health, refused ring not drained).

  • webfront.integration.source and .installed: passed.

  • clang-format 21: clean on changed files.
  • #9 criteria


  • Categories validated against the ADR scenarios (#59) and the external consumers (this PR); residual gap recorded.

  • Grammars and capacities from real usage, sequence width, exhaustion and host time states: documented (#56/#59, this PR).

  • logAudit() migration and field-boundary refusals naming the field: #58 (audit-public-field-boundaries).

  • Stream uniqueness per producer instance: enforced per adapter (this PR); cross-boot uniqueness is the host's.
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Audit stream identities must now be valid and unique within an adapter. Invalid or duplicate rings are refused and reported as configuration errors; refused rings are not drained.
    Ring registration now reports whether it succeeded or was refused.
    Documentation
    * Clarified sequence-number limits, stream identity responsibilities, and audit identifier compatibility.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 428 lines (+321 / -107) across 5 files Reviewer: AM-L Review duration: 98m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 428 lines diff across 5 files
    0.45
    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%
    60%
    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.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #94"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 17.8% · Safe to merge
    17.8%