feat(inbox): render the signal report artefact log#2557
Conversation
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
|
| async (client) => | ||
| (await client.getTask(content.task_id)) as unknown as Task, |
There was a problem hiding this comment.
getTask already returns Task internally (it does its own as unknown as Task cast). The additional cast here is redundant and suggests a type mismatch that isn't actually present. Removing the outer cast makes the intent clear.
| async (client) => | |
| (await client.getTask(content.task_id)) as unknown as Task, | |
| (client) => client.getTask(content.task_id), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/detail/ArtefactTaskRun.tsx
Line: 37-38
Comment:
`getTask` already returns `Task` internally (it does its own `as unknown as Task` cast). The additional cast here is redundant and suggests a type mismatch that isn't actually present. Removing the outer cast makes the intent clear.
```suggestion
(client) => client.getTask(content.task_id),
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Done in dd2d85b — getTask already returns Task, so the outer cast was redundant and is removed.
600fb45 to
ecf7f72
Compare
After every successful git_signed_commit push the harness posts one `commit` artefact per pushed commit to every signal report the task is associated with, attributed via the X-PostHog-Task-Id header. Best-effort: reportCommitArtefacts never throws, so an artefact failure can't fail a commit that already landed. SignedCommitResult now carries the repository (owner/repo) so the hook doesn't re-derive it. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
Adds an Activity section below the report summary rendering every artefact chronologically with a tailored body per type: syntax-highlighted code references and line references, unified-diff coloring for code diffs, commits with a lazily-fetched commit-vs-parent diff (new getCommitDiff endpoint), task runs that expand to the full conversation log, notes, judgments, findings, reviewers, and dismissals — plus a dev-only raw-JSON inspector. Artefacts are an append-only history now, so the status selectors (reviewers, judgments, findings) become explicitly latest-wins instead of relying on response ordering, and the reviewers edit optimistically appends a synthetic latest row mirroring the server's append semantics. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
SignalReportTask is now an unlabelled task↔report association — the relationship label is gone from the API. A task's purpose (Research / Implementation / a custom agent's humanized identifier) is derived from the report's task_run artefacts; freely-associated tasks with no task_run artefact surface generically as "Agent task". Task creation stops sending the relationship label, and the report repository falls back to walking associated tasks oldest-first. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
Renders as a RightColumnSection below the report's status sections (Runs, Suggested reviewers) instead of under the summary, and drops the now-unused belowSummary slot from InboxDetailFrame. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
Priority and actionability entries show their badge with the explanation behind a "Show reasoning" toggle — the paragraphs were dominating the log. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
Notes are free-form markdown and can run long — collapsed they show a truncated first-line preview that expands to the rendered note + author. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
The backend removed the /signals/reports/{id}/tasks/ surface — task_run
artefacts are the sole source of association. useReportTasks now reads them
directly (one entry per associated task, earliest artefact wins for
startedAt), getSignalReportTasks and the SignalReportTask type are gone, and
resolveReportRepository walks artefact-derived task ids oldest-first.
Generated-By: PostHog Code
Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
The API already attributes every artefact (created_by for user writes, task_id for agent writes) but the client normalizers dropped both fields, so the log had no byline. Thread them through a shared artefact base type and render who produced each entry next to its timestamp. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
The normalizer had no safety_judgment branch, so rows fell into the generic fallback (which requires a content/session_id string) and were silently dropped — the "Safety assessed" label was unreachable. Add the typed artefact, its normalizer, and a Safe/Unsafe badge body with collapsible reasoning. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
058c05e to
5194d1d
Compare
Typed normalizers returned null on any shape mismatch, vanishing the row (unknown dismissal reasons, future artefact types, partial content). Route every miss through a degraded fallback that keeps the row — type, timestamps, attribution, and a text preview — and render it as a plain entry. Adds coverage asserting all 14 backend artefact types normalize and that malformed rows survive as degraded previews. Generated-By: PostHog Code Task-Id: 03657aa4-20d8-4dea-aeef-e8c1ab4bbce2
The backend removed the code_diff artefact type in the review pass — agents point at code via code_reference / line_reference, and real diffs render from commit artefacts. Removes the type, its normalizer, and its renderer; DiffBlock stays for the commit diff view. Generated-By: PostHog Code Task-Id: f65424ca-a7fe-49f5-9f75-7a3cf004b417
Problem
Signal reports now accumulate a richer set of artefacts on the backend — code references, diffs, pushed commits, task runs, and notes — alongside the existing judgments and findings. The inbox had no way to surface them, so all that work-log context was invisible to reviewers.
This is the PostHog Code side of the artefact-log feature. The backend half (new artefact types, the append-only log, per-commit diffs, attribution, and unlabelled task↔report associations) lands in PostHog/posthog#61545.
Changes
Adds a chronological activity log to the right column of the report detail pane (below the status sections), rendering every artefact type with a tailored body rather than raw JSON:
DiffBlock).TaskLogsPanel. Badged from the artefact's(product, type): signals-pipeline runs show Research / Implementation; custom agents show their humanized product + type.created_by/task_idattribution fields.Beyond rendering, this PR also tracks the backend's model changes:
git_signed_commitpush, the harness automatically records onecommitartefact per pushed commit on every signal report the task is associated with, attributed via theX-PostHog-Task-Idheader. Best-effort: an artefact failure can never fail a commit that already landed. Credentials come from the sandbox env (live agentsh env file first), so it works identically in the Claude in-process server and the Codex stdio child.SignalReportTaskis gone from the backend; atask_runartefact is the task↔report association. The Runs bars and the activity log now read the same artefacts: each association, its start time, and its purpose badge (Research / Implementation for the signals pipeline, humanized product + type for custom agents) all derive from the report'stask_runartefacts.getSignalReportTasksand theSignalReportTasktype are deleted (desktop + mobile).Artefact content types are hand-written in
packages/shared/src/domain-types.ts— every artefact extends a sharedSignalReportArtefactBasecarrying timestamps plus attribution — and normalized inpackages/api-client'sposthog-client.ts(thetask_runcontent carriesproduct/type, matching the backend).How did you test this?
pnpm typecheck— passes.biome check— clean on all changed files.vitest— git, agent, and app suites green, including new unit tests for the signed-commit hook (one POST per commit per report, header attribution, failures swallowed, no-op without a task or credentials).commitdiff loads against a real pushed commit, thetask_runentry expands to the conversation log, and the timeline orders correctly by timestamp.Automatic notifications
Created with PostHog Code