Skip to content

Figure-level traceability on the revenue plan#6

Open
Vidur-lyzr wants to merge 1 commit into
mainfrom
feat/figure-traceability
Open

Figure-level traceability on the revenue plan#6
Vidur-lyzr wants to merge 1 commit into
mainfrom
feat/figure-traceability

Conversation

@Vidur-lyzr

Copy link
Copy Markdown
Collaborator

Implements the PRD's headline trust feature: "Clicking any figure the agent produces should reveal where it came from — which line of the contract, which step of the calculation, and which input value."

Previously this existed only as text citations in the brief. Now every allocated figure on the Revenue Plan is interactive.

What it does

Click any allocated revenue figure → a popover shows:

  • Result — the figure + product
  • Source — the contract line it came from (product + source doc)
  • Inputs — quantity, unit price (+ period), contract line total, service period
  • Calculation — recognition pattern + the Anaplan schedule description

How

  • getAllocationTrace() (view.ts) joins each Pricing allocation row to the Reader's line-item by line_item_id — all data already produced by the agents; no new agent work.
  • TraceableAllocationTable renders the allocation with each figure as a click-to-trace popover.
  • Gate1RevenuePlan swaps the generic table for the traceable one, so it appears on every contract's Revenue Plan tab.

Verified

  • tsc --noEmit clean; customer page renders 200.
  • Join proven on sample data: $450,000 → source OS_82608 · Subscription, inputs 1200 × $25/user/yr, calc subscription_ratable — straight-line over 547 days.

Follow-ups

Same click-to-trace can extend to the Monthly projection and Journal Entries figures.

🤖 Generated with Claude Code

Implements the PRD's "trust feature": click any allocated figure to see exactly
where it came from — the source contract line, the inputs that produced it, and
how it was computed.

- view.ts: getAllocationTrace() joins each Pricing allocation row to the Reader's
  line-item (by line_item_id), assembling source doc, inputs (quantity, unit
  price, line total, service period) and the calc (recognition pattern + Anaplan
  schedule description).
- TraceableAllocationTable: renders the allocation with each allocated figure as a
  click-to-trace popover (Result · Source · Inputs · Calculation).
- Gate1RevenuePlan: uses the traceable table in place of the generic SimpleTable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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