Skip to content

feat: add graph proof evidence UX - #66

Merged
jmagar merged 4 commits into
mainfrom
feat/syslog-mcp-fjdo-graph-proof-ux
Jun 3, 2026
Merged

feat: add graph proof evidence UX#66
jmagar merged 4 commits into
mainfrom
feat/syslog-mcp-fjdo-graph-proof-ux

Conversation

@jmagar

@jmagar jmagar commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add proof-oriented graph evidence lookup anchored on graph_relationship_evidence across DB, service, REST, MCP, and CLI.
  • Add compact endpoint entity summaries on graph relationships and compact safe source log summaries for evidence responses.
  • Harden graph evidence redaction and safe display for auth-like strings, credentials, URL userinfo, private-key markers, home paths, and terminal controls.
  • Update docs and optional smoke coverage for proof UX privacy, bounds, compatibility ids, endpoint summaries, and latency/byte checks.
  • Bump Cortex to 1.9.0 and update changelog/version-bearing files.

Beads

  • Closed syslog-mcp-fjdo.1 Graph evidence lookup: service, REST, and MCP.
  • Closed syslog-mcp-fjdo.2 Graph CLI: proof-oriented evidence command.
  • Closed syslog-mcp-fjdo.3 Graph output: endpoint entity summaries on relationships.
  • Closed syslog-mcp-fjdo.4 Graph docs and smoke coverage for proof UX.
  • Closed parent epic syslog-mcp-fjdo.

Tests

  • RUSTC_WRAPPER='' cargo check --lib --config 'build.rustc-wrapper=""'
  • RUSTC_WRAPPER='' cargo test --lib graph --config 'build.rustc-wrapper=""'
  • RUSTC_WRAPPER='' cargo test --bin cortex graph --config 'build.rustc-wrapper=""'
  • RUSTC_WRAPPER='' cargo test --test cli_help --config 'build.rustc-wrapper=""'
  • RUSTC_WRAPPER='' cargo clippy --config 'build.rustc-wrapper=""' -- -D warnings
  • RUSTC_WRAPPER='' cargo test --config 'build.rustc-wrapper=""'
  • ./scripts/check-version-sync.sh
  • bash -n scripts/smoke-test.sh
  • git diff --check

Residual Risk

  • The new smoke assertions are gated by CORTEX_SMOKE_GRAPH_EVIDENCE_ID, so live proof-UX smoke coverage requires a graph fixture/evidence id in the running deployment.

Summary by cubic

Adds a proof-oriented evidence lookup to the investigation graph with readable endpoint summaries and a bounded, redacted source-log preview. Available via REST /api/graph/evidence, MCP action=graph mode=evidence, and CLI cortex graph evidence, fulfilling Linear syslog-mcp-fjdo.

  • New Features

    • Lookup by graph_relationship_evidence.id returns safe evidence, owning relationship with src_entity/dst_entity summaries, top-level endpoint summaries, bounded source_log_summary, and missing_source_reason when absent.
    • Around/explain responses add compact endpoint summaries; CLI output shows endpoints and follow-ups. HTTP client and docs updated; version 1.9.0.
  • Bug Fixes

    • MCP schema documents explain and adds evidence + evidence_id; REST route count corrected; unknown query params rejected; bearer enforced.
    • Redaction expanded for auth headers, bearer/cookies, client-secret/access-token, URL userinfo, private-key markers, home paths, and control chars; smoke privacy scan expanded to validate these keys and ensure no raw/metadata_json leakage.
    • Restored endpoint summaries in evidence lookup; tightened payload accounting; removed external source-log follow-up suggestion in CLI.

Written for commit ed23b54. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a graph evidence lookup (cortex graph evidence) via CLI, REST and MCP to inspect individual evidence IDs with relationship context.
  • Improvements

    • Relationship responses include optional source/destination entity summaries and payload-budgeting/truncation metadata.
    • CLI output now shows evidence details and follow-up commands for entities.
  • Security/Privacy

    • Broadened redaction/sanitization for tokens, credentials, control characters, and other sensitive patterns.
  • Documentation

    • Updated docs, specs, inventory, and changelog describing evidence lookup, fields, and missing-source semantics.
  • Tests

    • Added unit, integration, and CLI tests covering evidence lookup, redaction, and schema/dispatch behavior.

Copilot AI review requested due to automatic review settings June 3, 2026 03:34
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Implements graph evidence lookup across service, DB, REST, MCP, and CLI: new models, DB query, service shaping (redaction, payload budgeting), REST/MCP/CLI endpoints and output, tests, docs, and version bumps to 1.9.0.

Changes

Graph Evidence Lookup Feature

Layer / File(s) Summary
Models and contracts
src/app/models.rs, src/app.rs, docs/contracts/investigation-graph.md
GraphEntitySummary, GraphEvidenceLookupRequest/Response, and GraphSourceLogSummary added. GraphRelationship now supports optional src_entity/dst_entity. Contracts/specs document evidence/relationship responses and safety rules for source_log_summary.
Database layer
src/db/graph.rs, src/db/graph_tests.rs
graph_evidence_by_id returns evidence + relationship + entities + optional source-log summary. Unit test validates linkage and summarized log content.
Service orchestration
src/app/service.rs, src/app/service_tests.rs
CortexService::graph_evidence_lookup added: validates request, loads DB rows, converts to models with entity summaries, safely redacts/truncates log summaries, computes missing_source_reason, estimates payload against payload_budget, and returns metadata. Refactors and adds payload estimation/redaction helpers.
REST API and API tests
src/api.rs, src/api_tests.rs
GET /api/graph/evidence route and handler added; tests assert response shape, omitted unsafe fields, auth enforcement, and unknown-field rejection.
MCP tool and schema
src/mcp/schemas.rs, src/mcp/tools.rs, src/mcp/tools_tests.rs, docs/mcp/TOOLS.md, docs/mcp/TESTS.md
MCP graph mode gains evidence + evidence_id; tool dispatch invokes evidence lookup and schema/help/docs updated; MCP tests validate dispatch and schema.
CLI argument parsing
src/cli/args.rs, src/cli/commands/graph.rs, src/cli/parse_tests.rs, src/cli/help.rs
Adds GraphEvidenceArgs and GraphCommand::Evidence; parse_graph_evidence validates positional <evidence-id>, optional --payload-budget and --json; parsing tests added.
CLI execution and output
src/cli/dispatch_surface_gap.rs, src/cli/dispatch_surface.rs, src/cli/run.rs, src/cli/http_client.rs, src/cli/output_graph.rs, src/cli/output_graph_tests.rs
run_graph_evidence dispatches to local service or HTTP client; HttpClient::graph_evidence calls /api/graph/evidence; print_graph_evidence_lookup_response formats evidence with relationship/entity context and follow-up commands; tests validate safe rendering and control-character handling.
Documentation and release
CHANGELOG.md, Cargo.toml, .claude-plugin/plugin.json, mcpb/manifest.json, server.json, docs/CLI.md, docs/INVENTORY.md, docs/specs/investigation-graph.md, scripts/smoke-test.sh, docs/api.md
Version bumped to 1.9.0 across manifests. CHANGELOG documents feature/fixes. CLI docs/specs/contracts updated. Smoke-test adds optional evidence UX validation and bounds checks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 I hop through graphs with careful tread,
Finding proofs where traces led,
Redacting secrets, cutting the noise,
Serving evidence in bounded voice,
A tiny rabbit proud of this spread.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: add graph proof evidence UX' accurately summarizes the main change by introducing evidence lookup functionality across the graph service UI.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/syslog-mcp-fjdo-graph-proof-ux

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 743eba8e5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/service.rs Outdated
Comment on lines +4018 to +4019
let redacted = lower.contains("authorization")
|| lower.contains("bearer")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Redact credential values after auth markers

When a source log contains split auth headers such as Authorization: Bearer s3cr3t or Cookie: sid=abc, this token-by-token redaction only replaces the marker tokens (Authorization:, Bearer) and then emits the following credential value unchanged in source_log_summary.message. Because this commit adds the proof/evidence source-log summary specifically as a safe/redacted view, those common header formats can leak secrets through the new graph evidence endpoint/CLI output; please carry state to redact the value token(s) following these markers as well.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a proof-oriented “graph evidence” UX that lets callers fetch a single graph_relationship_evidence row with its owning relationship, endpoint summaries, and a bounded/redacted source-log summary across DB/service/REST/MCP/CLI. This extends existing graph surfaces (around/explain) with compact endpoint summaries and tightens redaction/safe-display guarantees for potentially sensitive evidence/log-derived text.

Changes:

  • Added graph evidence lookup mode end-to-end (DB query + service method + REST route + MCP dispatch/schema + CLI command + HTTP client).
  • Extended graph relationship payloads to optionally include compact src_entity/dst_entity endpoint summaries for more readable output.
  • Added/updated docs, optional smoke checks, and bumped version to 1.9.0.

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/mcp/tools.rs Adds MCP graph tool dispatch for mode=evidence.
src/mcp/tools_tests.rs Tests MCP dispatch for graph evidence mode and schema enum exposure.
src/mcp/schemas.rs Updates MCP schema to include explain + evidence modes and evidence_id.
src/db/graph.rs Adds DB structs + query to fetch evidence row with relationship, endpoints, and optional log summary.
src/db/graph_tests.rs Validates DB evidence lookup returns relationship endpoints + source log summary.
src/cli/run.rs Wires new GraphCommand::Evidence into CLI run loop.
src/cli/parse_tests.rs Adds CLI parsing tests for graph evidence and validation errors.
src/cli/output_graph.rs Adds evidence lookup human output; enhances around/explain output with endpoint summaries.
src/cli/output_graph_tests.rs Adds output tests for evidence lookup rendering and shared metadata helper.
src/cli/http_client.rs Adds HTTP client call for /api/graph/evidence.
src/cli/help.rs Documents new cortex graph evidence command in help catalog.
src/cli/dispatch.rs Exposes run_graph_evidence in dispatch re-exports.
src/cli/dispatch_tests.rs Adds request snapshot test for evidence args → request mapping.
src/cli/dispatch_surface.rs Re-exports run_graph_evidence through surface module.
src/cli/dispatch_surface_gap.rs Implements local/HTTP dispatch for evidence lookup and prints response.
src/cli/commands/graph.rs Implements CLI argument parsing for graph evidence subcommand.
src/cli/args.rs Adds GraphEvidenceArgs and new GraphCommand::Evidence variant.
src/cli.rs Re-exports GraphEvidenceArgs in CLI public module.
src/app/service.rs Implements graph_evidence_lookup, endpoint summaries on relationships, and redaction/bounds for source summaries.
src/app/service_tests.rs Adds service-level tests for evidence lookup safety/redaction and missing-source behavior; tightens around/explain assertions for summaries.
src/app/models.rs Adds GraphEntitySummary, evidence lookup request/response models, and optional endpoint summaries on relationships.
src/app.rs Re-exports new graph evidence/summaries models from app.
src/api.rs Adds REST route + handler for GET /api/graph/evidence.
src/api_tests.rs Extends API tests to cover evidence endpoint behavior and bearer enforcement.
server.json Bumps server package version and image tag to 1.9.0.
scripts/smoke-test.sh Adds optional smoke coverage for graph evidence proof UX, privacy, size, and latency bounds.
mcpb/manifest.json Bumps MCP bundle manifest version to 1.9.0.
docs/specs/investigation-graph.md Updates investigation graph spec with evidence lookup and relationship summaries.
docs/mcp/TOOLS.md Updates MCP tool docs to mention evidence proof rows.
docs/mcp/TESTS.md Adds MCP call example + proof UX smoke checklist for evidence lookup.
docs/INVENTORY.md Adds cortex graph evidence to CLI/MCP inventory table.
docs/contracts/investigation-graph.md Defines contract for endpoint summaries and evidence lookup response + safety rules.
docs/CLI.md Documents cortex graph evidence and updated around output expectations.
CHANGELOG.md Adds 1.9.0 changelog entry for graph evidence UX and redaction hardening.
Cargo.toml Bumps crate version to 1.9.0.
Cargo.lock Updates locked crate version to 1.9.0.
.claude-plugin/plugin.json Bumps plugin version to 1.9.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/service.rs Outdated
Comment on lines +4011 to +4014
let control_stripped: String = value
.chars()
.map(|ch| if ch.is_control() { ' ' } else { ch })
.collect();
Comment thread src/app/service.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 10: The changelog added the release header "[1.9.0]" but the
reference-link block lacks a corresponding "[1.9.0]" entry and still points at
older ranges, breaking the compare links; update the reference-link block to add
a "[1.9.0]" link that compares the previous tag to v1.9.0 (e.g. compare
v1.8.0...v1.9.0) and adjust the "[Unreleased]" baseline to compare from
v1.9.0..HEAD so the new release and ongoing changes resolve correctly.

In `@docs/specs/investigation-graph.md`:
- Line 166: Update the CLI example "cortex graph evidence <evidence-id>
[--json]" to include the optional payload size flag used by the implementation:
change it to "cortex graph evidence <evidence-id> [--json] [--payload-budget
BYTES]" so the spec matches the actual supported flags (reference the command
string "cortex graph evidence <evidence-id> [--json]" and the flag name
"--payload-budget BYTES").

In `@scripts/smoke-test.sh`:
- Around line 896-901: The date commands that set GRAPH_PROOF_START and
GRAPH_PROOF_END use GNU-specific +%s%3N and will fail on macOS; replace those
timestamp captures with a portable approach (e.g., call python3 to emit
millisecond epoch timestamps) so GRAPH_PROOF_START/GRAPH_PROOF_END are valid
everywhere and GRAPH_EVIDENCE_LATENCY_MS calculation remains correct; update the
two places where GRAPH_PROOF_START and GRAPH_PROOF_END are set and ensure
GRAPH_EVIDENCE_LATENCY_MS still computes as GRAPH_PROOF_END - GRAPH_PROOF_START.
- Around line 914-915: The privacy smoke test loop that asserts sensitive
markers are absent from blob (the for marker in (...) assert marker not in blob
...) misses URL userinfo patterns; add a check that searches blob for URL
userinfo (e.g., using a regex like '://[^\\s:@]+:[^\\s@]+@' or equivalent) and
fail the test if any match is found so URLs containing user:pass@ are detected
and flagged for redaction. Ensure this new check runs alongside the existing
marker assertions against the same blob variable in the same loop/section.

In `@src/app/service.rs`:
- Line 4033: The redaction check using lower.contains("begin") is too broad and
will match words like "beginning"; update the logic that uses the lower variable
(the expression lower.contains("begin")) to instead match PEM markers more
precisely—for example, use lower.starts_with("begin ") or check exact strings
like "begin private key" / "begin rsa private key" (case-normalized) so only
genuine PEM header lines are redacted; locate and replace the
lower.contains("begin") usage accordingly.

In `@src/cli/output_graph.rs`:
- Around line 235-329: The printed follow-up "cortex get {source_log_id}" in
print_graph_evidence_lookup_response is invalid; locate the println that formats
source_log_id (uses the response.evidence.source_log_id variable inside
print_graph_evidence_lookup_response) and replace it with the actual CLI
subcommand used to fetch logs in the top-level dispatch (or remove it if you
choose to implement a dedicated top-level get command instead). Ensure the new
printed string matches the real command name and argument style used by the CLI
dispatch (or leave a clear TODO if you implement a top-level cortex get LOG_ID).

In `@src/mcp/schemas.rs`:
- Around line 62-65: The schema for "evidence_id" currently allows any integer
but the backend function graph_evidence_lookup in src/app/service.rs rejects
evidence_id <= 0; update the JSON Schema for the "evidence_id" property in
schemas.rs to include a lower bound (e.g., "minimum": 1) so clients validate
values >=1 and fail fast before calling graph_evidence_lookup.

In `@src/mcp/tools.rs`:
- Around line 1522-1530: The help text in tool_cortex_help() needs to be updated
to document the new "evidence" graph mode and its required parameter; modify the
function (tool_cortex_help) to include "evidence" in the list of supported modes
and explicitly state that mode="evidence" requires an evidence_id (or evidence
identifier) parameter, mirroring how "entity"/"around"/"explain" are described
so MCP clients that call cortex help will see the new capability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43095527-c3a7-4115-a34b-c035764d3dbb

📥 Commits

Reviewing files that changed from the base of the PR and between 58a49be and 743eba8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock and included by **/*
📒 Files selected for processing (36)
  • .claude-plugin/plugin.json
  • CHANGELOG.md
  • Cargo.toml
  • docs/CLI.md
  • docs/INVENTORY.md
  • docs/contracts/investigation-graph.md
  • docs/mcp/TESTS.md
  • docs/mcp/TOOLS.md
  • docs/specs/investigation-graph.md
  • mcpb/manifest.json
  • scripts/smoke-test.sh
  • server.json
  • src/api.rs
  • src/api_tests.rs
  • src/app.rs
  • src/app/models.rs
  • src/app/service.rs
  • src/app/service_tests.rs
  • src/cli.rs
  • src/cli/args.rs
  • src/cli/commands/graph.rs
  • src/cli/dispatch.rs
  • src/cli/dispatch_surface.rs
  • src/cli/dispatch_surface_gap.rs
  • src/cli/dispatch_tests.rs
  • src/cli/help.rs
  • src/cli/http_client.rs
  • src/cli/output_graph.rs
  • src/cli/output_graph_tests.rs
  • src/cli/parse_tests.rs
  • src/cli/run.rs
  • src/db/graph.rs
  • src/db/graph_tests.rs
  • src/mcp/schemas.rs
  • src/mcp/tools.rs
  • src/mcp/tools_tests.rs

Comment thread CHANGELOG.md
Comment thread docs/specs/investigation-graph.md Outdated
Comment thread scripts/smoke-test.sh Outdated
Comment thread scripts/smoke-test.sh Outdated
Comment thread src/app/service.rs Outdated
Comment thread src/cli/output_graph.rs
Comment thread src/mcp/schemas.rs
Comment thread src/mcp/tools.rs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13 issues found across 37 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/app/service.rs Outdated
Comment thread docs/contracts/investigation-graph.md
Comment thread src/api_tests.rs Outdated
Comment thread src/app/service.rs Outdated
Comment thread src/app/service.rs Outdated
Comment thread src/cli/output_graph.rs Outdated
Comment thread docs/contracts/investigation-graph.md Outdated
Comment thread CHANGELOG.md
Comment thread src/mcp/schemas.rs
Comment thread src/mcp/tools.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/service.rs (1)

4012-4057: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Redact the full secret value, not just the next token.

The whitespace-token state machine only carries redact_next_value forward by one token. That still leaks secrets for common patterns like Authorization: Basic abc123, Cookie: sid=abc; csrftoken=def, and multiline PEM blocks, because only the marker token (and sometimes the scheme token) gets replaced. This breaks the “no secrets in graph evidence/source-log summaries” guarantee.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/service.rs` around lines 4012 - 4057, In redact_graph_text_unbounded,
the current redact_next_value boolean only hides the immediate next whitespace
token and leaks many secrets; change the logic so that when a marker is seen
(value_marker or cookie/credential patterns, or PEM begin), you redact the
current token and then remain in a redact mode that continues redacting
subsequent tokens until a clear boundary is reached (e.g., the next header-like
token that ends with ':' indicating a new header, a token containing a header
separator, a semicolon-delimited boundary for Cookie values, or for PEM blocks
until the corresponding "-----end" / "end" token). Replace redact_next_value
with a redact_mode state, implement PEM-specific termination (scan for
"-----end" or token == "end"), and ensure tokens containing key=value pairs
(cookie=, credential=, token=) redact the value part and any subsequent
semi-colon separated segments; update the places that set and clear
redact_next_value to use this new redact_mode so the function fully redacts
secret values rather than only the next token.
♻️ Duplicate comments (1)
CHANGELOG.md (1)

1949-1951: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Complete the 1.x changelog reference chain.

Line 1951 still points [1.8.0] at v0.32.3...v1.8.0, so the 1.8.0 heading skips every intermediate 1.x release, and the bracketed 1.7.11.0.0 headings above still have no matching reference definitions. Please add the missing 1.x refs, or at minimum retarget [1.8.0] to v1.7.1...v1.8.0, so the release links stay usable.

📝 Minimal fix shape
 [Unreleased]: https://github.com/jmagar/cortex/compare/v1.9.0...HEAD
 [1.9.0]: https://github.com/jmagar/cortex/compare/v1.8.0...v1.9.0
-[1.8.0]: https://github.com/jmagar/cortex/compare/v0.32.3...v1.8.0
+[1.8.0]: https://github.com/jmagar/cortex/compare/v1.7.1...v1.8.0
+[1.7.1]: https://github.com/jmagar/cortex/compare/v1.7.0...v1.7.1
+...
+[1.0.0]: https://github.com/jmagar/cortex/compare/v0.32.3...v1.0.0
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 1949 - 1951, Update the release reference
definitions in the CHANGELOG so the 1.x chain is contiguous: add missing
bracketed link definitions for each 1.x release referenced (e.g., [1.7.1],
[1.7.0], ... up to [1.0.0]) pointing to their compare URLs, or at minimum change
the existing [1.8.0] definition from "v0.32.3...v1.8.0" to "v1.7.1...v1.8.0" so
the [1.8.0] link targets the previous 1.x tag; adjust the bracket labels (like
[1.9.0], [1.8.0], [1.7.1]) in the bottom reference block to match the headings
above.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/api.md`:
- Line 18: The documented "28 routes total" in docs/api.md is stale; update the
endpoint matrix count or explicitly scope which routes are counted. Inspect the
mounted endpoints referenced in src/api_tests.rs (examples: /api/host-state,
/api/context, /api/fleet-state, /api/correlate-state, /api/silent-hosts,
/api/clock-skew, /api/anomalies, /api/compare, /api/apps,
/api/similar-incidents, /api/incident-context, /api/ai/ask-history,
/api/ai/incidents, /api/ai/investigate) and either recalculate and replace the
"28 routes total" number to the correct total or add a clarifying scope line
(e.g., "28 routes shown here; full surface listed in src/api_tests.rs") so the
canonical reference is accurate.

In `@scripts/smoke-test.sh`:
- Around line 920-922: The URL userinfo regex in scripts/smoke-test.sh currently
uses r'://[^\\s/:]+:[^\\s/@]+@' and misses common user:pass@ forms; update the
regex to explicitly forbid whitespace, '@' and '/' in both user and pass
portions (for example replace with r'://[^\\s@/:]+:[^\\s@/:]+@') so URLs like
https://user:pass@example.com are correctly detected; modify the assertion that
calls re.search to use the new pattern.

In `@src/app/service.rs`:
- Around line 3166-3167: The relationship conversion currently passes None for
endpoint summaries to graph_relationship_to_model, which clears
relationship.src_entity and relationship.dst_entity; update the call in
service.rs to forward the endpoint summary data from the query result instead of
None (e.g., pass rows.relationship.src_entity / src_endpoint_summary and
rows.relationship.dst_entity / dst_endpoint_summary or the fields that
graph_explain/graph_around populate) so graph_relationship_to_model can populate
relationship.src_entity and relationship.dst_entity while still attaching
vec![evidence.id].

In `@src/cli/output_graph.rs`:
- Around line 323-325: Remove the external mcporter suggestion by deleting the
println that outputs "mcporter call --config config/mcporter.json syslog.cortex
action=get id={source_log_id}" in src/cli/output_graph.rs so follow-ups remain
consistent with the native CLI; if a native cortex log-get command exists,
replace that println with the appropriate "cortex" command suggestion instead,
otherwise omit the follow-up entirely to avoid recommending an unavailable
external tool.

---

Outside diff comments:
In `@src/app/service.rs`:
- Around line 4012-4057: In redact_graph_text_unbounded, the current
redact_next_value boolean only hides the immediate next whitespace token and
leaks many secrets; change the logic so that when a marker is seen (value_marker
or cookie/credential patterns, or PEM begin), you redact the current token and
then remain in a redact mode that continues redacting subsequent tokens until a
clear boundary is reached (e.g., the next header-like token that ends with ':'
indicating a new header, a token containing a header separator, a
semicolon-delimited boundary for Cookie values, or for PEM blocks until the
corresponding "-----end" / "end" token). Replace redact_next_value with a
redact_mode state, implement PEM-specific termination (scan for "-----end" or
token == "end"), and ensure tokens containing key=value pairs (cookie=,
credential=, token=) redact the value part and any subsequent semi-colon
separated segments; update the places that set and clear redact_next_value to
use this new redact_mode so the function fully redacts secret values rather than
only the next token.

---

Duplicate comments:
In `@CHANGELOG.md`:
- Around line 1949-1951: Update the release reference definitions in the
CHANGELOG so the 1.x chain is contiguous: add missing bracketed link definitions
for each 1.x release referenced (e.g., [1.7.1], [1.7.0], ... up to [1.0.0])
pointing to their compare URLs, or at minimum change the existing [1.8.0]
definition from "v0.32.3...v1.8.0" to "v1.7.1...v1.8.0" so the [1.8.0] link
targets the previous 1.x tag; adjust the bracket labels (like [1.9.0], [1.8.0],
[1.7.1]) in the bottom reference block to match the headings above.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 83c685b3-016e-4109-8941-cb6f8d1dfaf1

📥 Commits

Reviewing files that changed from the base of the PR and between 743eba8 and 70fbe36.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • docs/api.md
  • docs/contracts/investigation-graph.md
  • docs/specs/investigation-graph.md
  • scripts/smoke-test.sh
  • src/api_tests.rs
  • src/app/service.rs
  • src/app/service_tests.rs
  • src/cli/output_graph.rs
  • src/mcp/schemas.rs
  • src/mcp/tools.rs
  • src/mcp/tools_tests.rs

Comment thread docs/api.md Outdated
Comment thread scripts/smoke-test.sh Outdated
Comment thread src/app/service.rs Outdated
Comment thread src/cli/output_graph.rs Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/smoke-test.sh Outdated
Comment thread scripts/smoke-test.sh Outdated
jmagar added 3 commits June 3, 2026 11:38
Resolve graph evidence proof UX review findings across redaction, payload accounting, help/docs, smoke coverage, and CLI follow-up output.

Resolves review thread PRRT_kwDORy0Fc86GoCwC
Resolves review thread PRRT_kwDORy0Fc86GoCwG
Resolves review thread PRRT_kwDORy0Fc86GoCwJ
Resolves review thread PRRT_kwDORy0Fc86GoCwL
Resolves review thread PRRT_kwDORy0Fc86GoCwO
Resolves review thread PRRT_kwDORy0Fc86GoCvm
Resolves review thread PRRT_kwDORy0Fc86GoCvo
Resolves review thread PRRT_kwDORy0Fc86GoCvr
Resolves review thread PRRT_kwDORy0Fc86GoCvy
Resolves review thread PRRT_kwDORy0Fc86GoCv0
Resolves review thread PRRT_kwDORy0Fc86GoCv4
Resolves review thread PRRT_kwDORy0Fc86GoCv8
Resolves review thread PRRT_kwDORy0Fc86GoCv_
Resolves review thread PRRT_kwDORy0Fc86GoAn_
Resolves review thread PRRT_kwDORy0Fc86GoAoA
Resolves review thread PRRT_kwDORy0Fc86GoAoB
Resolves review thread PRRT_kwDORy0Fc86GoAoF
Resolves review thread PRRT_kwDORy0Fc86GoAoJ
Resolves review thread PRRT_kwDORy0Fc86GoAoK
Resolves review thread PRRT_kwDORy0Fc86GoAoP
Resolves review thread PRRT_kwDORy0Fc86GoAoU
Resolves review thread PRRT_kwDORy0Fc86Gn9M4
Resolves review thread PRRT_kwDORy0Fc86Gn9Mr
Resolves review thread PRRT_kwDORy0Fc86Gn8kE
Restore relationship endpoint summaries in evidence lookup, fix smoke privacy scanning and URL userinfo detection, correct REST route count docs, and remove the external source-log follow-up suggestion.

Resolves review thread PRRT_kwDORy0Fc86GxjaA
Resolves review thread PRRT_kwDORy0Fc86GxjZp
Resolves review thread PRRT_kwDORy0Fc86GxPpN
Resolves review thread PRRT_kwDORy0Fc86GxPpY
Resolves review thread PRRT_kwDORy0Fc86GxPpe
Resolves review thread PRRT_kwDORy0Fc86GxPp4
@jmagar
jmagar force-pushed the feat/syslog-mcp-fjdo-graph-proof-ux branch from 6e5b8f2 to ab7cd40 Compare June 3, 2026 15:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/api_tests.rs (1)

2424-2450: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Select a source-backed evidence row before requiring source_log_summary.

This test currently takes the first /api/graph/around evidence sample and then unconditionally asserts source_log_summary exists. The evidence lookup contract allows missing_source_reason when the evidence row has no source_log_id, so this can become nondeterministic as sampling/order changes. Mirror the MCP test’s source_log_id IS NOT NULL selection or branch on the optional fields here instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api_tests.rs` around lines 2424 - 2450, The test currently picks the
first entry from the `evidence` array and unconditionally asserts
`source_log_summary` exists; change it to select an evidence row that has
`source_log_id` (filter the `evidence` array for entries where
`["source_log_id"]` is not null) before using its `id` with `get_json`, or after
fetching `/api/graph/evidence` assert conditionally: if
`value["source_log_summary"].is_object()` succeed, otherwise assert
`value["missing_source_reason"]` is present; update the use of `evidence`,
`evidence_id`, and the `get_json` call to reflect this selection/branching so
the test no longer depends on sampling/order.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/smoke-test.sh`:
- Around line 914-926: The privacy scan currently builds privacy_blob from
recursive string VALUES via string_values, so sensitive markers appearing as
DICTIONARY KEYS are missed; update the logic to include keys as well (e.g., when
iterating dict in string_values yield the key string in addition to its value)
or replace the approach by serializing the entire payload to JSON and scanning
that serialized string for markers; ensure you still check the same markers list
and the userinfo regex against the new privacy_blob variable used by the markers
loop and assertions.

---

Outside diff comments:
In `@src/api_tests.rs`:
- Around line 2424-2450: The test currently picks the first entry from the
`evidence` array and unconditionally asserts `source_log_summary` exists; change
it to select an evidence row that has `source_log_id` (filter the `evidence`
array for entries where `["source_log_id"]` is not null) before using its `id`
with `get_json`, or after fetching `/api/graph/evidence` assert conditionally:
if `value["source_log_summary"].is_object()` succeed, otherwise assert
`value["missing_source_reason"]` is present; update the use of `evidence`,
`evidence_id`, and the `get_json` call to reflect this selection/branching so
the test no longer depends on sampling/order.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a474442-e0c6-4434-8e15-678d510acd15

📥 Commits

Reviewing files that changed from the base of the PR and between 70fbe36 and 6e5b8f2.

📒 Files selected for processing (7)
  • docs/api.md
  • scripts/smoke-test.sh
  • src/api_tests.rs
  • src/app/service.rs
  • src/app/service_tests.rs
  • src/cli/output_graph.rs
  • src/mcp/tools_tests.rs
💤 Files with no reviewable changes (1)
  • src/cli/output_graph.rs

Comment thread scripts/smoke-test.sh Outdated
@jmagar
jmagar merged commit 6c62c23 into main Jun 3, 2026
13 checks passed
@jmagar
jmagar deleted the feat/syslog-mcp-fjdo-graph-proof-ux branch June 3, 2026 16:06
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.

2 participants