Skip to content

Render the recorded provenance triple in Paper Review from the proposal endpoint - #2511

Merged
Chris0Jeky merged 2 commits into
mainfrom
issue-1987/provenance-frontend
Sep 4, 2026
Merged

Render the recorded provenance triple in Paper Review from the proposal endpoint#2511
Chris0Jeky merged 2 commits into
mainfrom
issue-1987/provenance-frontend

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Summary

Frontend half of #1987, on top of the backend contract landed in #2494. The Paper Review provenance footnote and drawer now render the proposal-scoped, server-recorded producer triple.

  • api/proposalDeepReviewApi.ts gains getProvenanceMetadata(proposalId, options?) for GET /automation/proposals/{id}/provenance/metadata, typed as { provider: string | null, model: string | null, promptVersion: string | null }.
  • composables/usePaperReviewSelectors.ts makes that endpoint the primary source of provenanceMetadataData. The PR Surface capture provenance metadata in Review #2310 capture-detail path stays as a fallback, consulted only when the endpoint recorded nothing and the proposal carries a capture link.

This is a source swap at the two existing settle sites, not new machinery. The proposal-scoped read is added into the existing Promise.allSettled that already carried the capture lookup, so it inherits the current generation/abort/settled-key guards unchanged. No new request generation, no change to polling, abort, or revision-lock code — those belong to the in-flight Review race-state work (#2455 / #2457 / #2458 / #2464).

Behavioral consequences:

Coverage caveat (Refs #2499)

Only capture-triage proposals carry the triple today: CaptureTriageService is the sole writer of the trusted ProvenanceProvider / ProvenancePromptVersion inputs. Chat- and Manual-origin proposals, and every proposal created before #2494, still record no producer and therefore still render no claim — correctly, but silently. The wiring in this PR is what makes those cases renderable once something stamps them.

Test plan

Base 65c77a53f; head a57195276 (branch issue-1987/provenance-frontend). All from frontend/taskdeck-web/.

Command Result
npx vitest --run --maxWorkers=2 src/tests/composables/usePaperReviewSelectors.spec.ts src/tests/api/proposalDeepReviewApi.spec.ts src/tests/views/paper/review/PaperReviewView.spec.ts 3 files, 212 passed, 0 failed
npx vitest --run --maxWorkers=2 src/tests/views/paper/review/ 14 files, 313 passed, 0 failed, 0 unhandled errors (identical to the pre-change baseline measured on a stashed tree)
npm run typecheck clean
npm run build built, 142 precache entries
npx eslint on all 8 changed files clean
git diff --check origin/main...HEAD clean

New coverage — tests/api/proposalDeepReviewApi.spec.ts (7 cases): URL and expectedStatuses: [403, 404], abort-signal passthrough, all-null payload returned verbatim, 403 and 404 normalized to no-recorded-producer, 5xx and transport failures still rejecting, id encoding. tests/composables/usePaperReviewSelectors.spec.ts (6 cases): server value renders with no capture link and no capture read; server value wins over a conflicting capture payload; fallback engages only when the endpoint recorded nothing; neither source recording anything renders no claim; a failed lookup renders no claim without stalling the core batch; a pending metadata read does not delay loading going false.

Four sibling specs (PaperReviewView.spec.ts, PaperReviewActiveProposalStability.spec.ts, PaperReviewMembershipFilter.spec.ts, PaperReviewView.language.spec.ts) gain the new method on their proposalDeepReviewApi mock, defaulted to the all-null payload so their existing capture-detail expectations are unchanged.

Documentation

  • docs/STATUS.md — intentionally untouched; the shipped-reality note for the provenance footnote belongs to the coordinator's STATUS block.
  • docs/IMPLEMENTATION_MASTERPLAN.md — no sequencing change.
  • ADR — none; implements the already-decided review-first provenance model.

Risks

Closes #1987
Refs #1284
Refs #2315
Refs #2499

… endpoint

Adds proposalDeepReviewApi.getProvenanceMetadata and makes the proposal-scoped, board-authorized endpoint the primary source of the Paper Review producer footnote, keeping the capture-detail path as a fallback for proposals stamped before the triple existed. Closes #1987
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Review gate (Codex credits exhausted, SC-9): one fresh-context reviewer confirmed no client-supplied or synthesized producer-claim path (both render paths funnel through resolveProvenanceMetadata; the backend never emits a model without a provider and the client mapper re-checks), that every abort bumps fetchGeneration before aborting so a slow response for proposal A cannot overwrite B, and that expectedStatuses only suppresses logging (401 re-auth intact, no toast). Verdict SHIP. MEDIUM noted, not blocking (narrows pre-existing behaviour): a 403 on the proposal-scoped read is normalized to 'unrecorded' so the owner-only capture fallback can still render the caller's own capture provenance under a proposal whose read was refused — tracked under #2315 state 2/3 (already cited in the code comment). LOWs declined: settled-key refresh passes no signal (guard discards the result); +1 request per selected capture-less proposal (cached); no composed spec for 403->fallback. Merging when CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Backend][Frontend] Wire the provenance triple (provider/model/promptVersion) into the deep-review payload so #1963's honest footnote can render

1 participant