Skip to content

Surface report producer context safely#31

Merged
DeliciousBuding merged 1 commit into
mainfrom
feat/audit-producer-fields-20260515
May 15, 2026
Merged

Surface report producer context safely#31
DeliciousBuding merged 1 commit into
mainfrom
feat/audit-producer-fields-20260515

Conversation

@DeliciousBuding
Copy link
Copy Markdown
Owner

Summary

  • Hydrate report audit views with completed-job producer context from the existing audit job detail facade.
  • Render status, updated time, state history, and stdout/stderr tail in the audit history section without adding Runtime schema.
  • Keep runtime text public-safe by sanitizing paths, URLs, hosts, and token-like values before rendering.
  • Update the public Platform roadmap baseline to reflect report-side producer context.

TDD

  • RED: npm --prefix apps/web run test -- ReportAuditView.test.tsx failed because Producer context was not rendered.
  • RED: npm --prefix apps/web run test -- page.test.tsx failed because the report page did not hydrate producer context from job detail.
  • GREEN: both focused tests pass after the minimal implementation.

Validation

  • python scripts/check_public_boundary.py
  • npm --prefix apps/web run lint exits 0 with 12 existing warnings
  • npm --prefix apps/web run test (51 passed / 143 passed)
  • npm --prefix apps/web run build
  • go -C apps/api-go test ./...
  • go -C apps/api-go build ./cmd/platform-api
  • git diff --check
  • git diff --cached --check

Copilot AI review requested due to automatic review settings May 15, 2026 08:24
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a 'Producer Context' section to the report audit view, which displays job status, state history, and sanitized runtime output tails. The changes include new data fetching logic, UI components for rendering the context, and tests to verify that sensitive information is correctly redacted. Review feedback suggested localizing the 'Unknown' fallback state for history entries and ensuring that the primary producer status is also passed through the sanitization utility to prevent potential data leakage.

producerStatus: "状态",
producerUpdated: "更新时间",
outputTail: "Runtime 输出尾部",
stateHistory: "状态历史",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The fallback string "Unknown" used for state history entries is hardcoded. It should be localized within the t translation object to maintain consistency with the rest of the UI.

Suggested change
stateHistory: "状态历史",
stateHistory: "状态历史",
unknownState: "未知状态",

producerStatus: "Status",
producerUpdated: "Updated",
outputTail: "Runtime output tail",
stateHistory: "State history",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The fallback string "Unknown" used for state history entries is hardcoded. It should be localized within the t translation object.

Suggested change
stateHistory: "State history",
stateHistory: "State history",
unknownState: "Unknown",

};
const defendedRows = rows.filter((row) => row.defense !== "none" && row.defense !== "None").length;
const undefendedRows = rows.length - defendedRows;
const producerStatus = displayStatus(producerContext?.status);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The producerStatus is derived from producerContext?.status without sanitization, while other runtime-derived strings like stateHistory entries and output tails are sanitized. To ensure no sensitive information (such as local paths or tokens) is leaked, it should be passed through sanitizeRuntimeText.

Suggested change
const producerStatus = displayStatus(producerContext?.status);
const producerStatus = displayStatus(sanitizeRuntimeText(producerContext?.status));

key={`${entry.state}-${entry.timestamp ?? "none"}-${index}`}
className="rounded-xl border border-border bg-card px-2 py-1 text-[11px] text-muted-foreground"
>
<span className="font-semibold text-foreground">{displayStatus(sanitizeRuntimeText(entry.state)) ?? "Unknown"}</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use the localized string from the t object for the unknown state fallback.

Suggested change
<span className="font-semibold text-foreground">{displayStatus(sanitizeRuntimeText(entry.state)) ?? "Unknown"}</span>
<span className="font-semibold text-foreground">{displayStatus(sanitizeRuntimeText(entry.state)) ?? t.unknownState}</span>

@DeliciousBuding DeliciousBuding merged commit 0c18913 into main May 15, 2026
5 of 6 checks passed
@DeliciousBuding DeliciousBuding deleted the feat/audit-producer-fields-20260515 branch May 15, 2026 08:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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