Skip to content

Final pipeline - #9

Closed
yb175 wants to merge 1 commit into
mainfrom
final-pipeline
Closed

Final pipeline#9
yb175 wants to merge 1 commit into
mainfrom
final-pipeline

Conversation

@yb175

@yb175 yb175 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Finalizes the node-api ingestion pipeline with incident fingerprinting, step normalization, and an admin reset endpoint. Improves dedupe, telemetry accuracy, and failure reporting while hardening env setup.

  • New Features

    • Add incident fingerprinting via generateFingerprint from @void-server/incident-fingerprint; respond with "skipped" when formation takes no action.
    • Add admin reset endpoint POST /api/admin/reset to wipe Postgres data and flush Redis/BullMQ queues using ioredis.
    • Normalize agent steps to a unified tool_calls shape for forward compatibility.
  • Bug Fixes

    • Harden env bootstrapping in env.ts: load .env from multiple paths, set a local default for DATABASE_URL, normalize port to 5432, and default REDIS_URL to redis://localhost:6379.
    • Fix telemetry by counting failed tool calls within tool_calls and aligning tool_call_count with normalized steps.
    • Improve /api/investigations failure responses by returning the worker error from engineering_report when available.

Written for commit 9090d90. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added an administrative reset option to clear incident data and queued processing state.
    • Improved trace processing with standardized agent steps, tool-call counts, and failure tracking.
    • Added clearer incident fingerprints and support for skipped incident creation.
  • Bug Fixes

    • Improved failed investigation details using available engineering report information.
    • Added safer local database configuration and port handling.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70727f50-ff10-4ad4-8b28-1633f5291a2e

📥 Commits

Reviewing files that changed from the base of the PR and between 67d633b and 9090d90.

📒 Files selected for processing (2)
  • apps/node-api/src/env.ts
  • apps/node-api/src/index.ts

📝 Walkthrough

Walkthrough

The Node API now loads layered environment files, normalizes trace agent steps and tool-call telemetry, adds Redis-backed reset controls, improves investigation failure details, and handles fingerprinted incident formation results including skipped outcomes.

Changes

Node API trace and incident control

Layer / File(s) Summary
Runtime configuration and reset state
apps/node-api/src/env.ts, apps/node-api/src/index.ts
Environment files and database URL defaults are configured, while the admin reset endpoint clears PostgreSQL records and Redis state.
Trace normalization and telemetry
apps/node-api/src/index.ts
Trace ingestion standardizes agent steps, derives tool-call counts and failures, and logs risk and adaptive-sampling results.
Incident outcomes and error details
apps/node-api/src/index.ts
Failed investigations use engineering report errors, and incident formation passes fingerprints and returns explicit skipped responses.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TraceEndpoint as POST /api/traces
  participant normalizeAgentSteps
  participant RiskEngine
  participant AdaptiveSampler
  participant formationService.process
  TraceEndpoint->>normalizeAgentSteps: normalize incoming steps
  normalizeAgentSteps-->>TraceEndpoint: agentSteps and tool-call telemetry
  TraceEndpoint->>RiskEngine: evaluate trace
  RiskEngine-->>TraceEndpoint: risk outcome and labels
  TraceEndpoint->>AdaptiveSampler: determine sampling result
  AdaptiveSampler-->>TraceEndpoint: sampled
  TraceEndpoint->>formationService.process: submit labels and fingerprint
  formationService.process-->>TraceEndpoint: action and incidentId
Loading

Possibly related PRs

✨ 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 final-pipeline

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

@yb175 yb175 closed this Jul 25, 2026
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