Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Report Generation

Report generation is where Prompt Diary realizes the product purposes. It turns a prepared workspace into daily report artifacts that communicate the day’s work, assess observable engagement faithfully, and surface team learning from AI-agent usage. Those purposes converge in the daily report synthesis phase, whose model the rendering phase then projects into views.

Generation starts from the Workspace Layout. It should not rediscover raw assistant sessions or reinterpret the report date. If the workspace is missing, the CLI may run preparation first; once generation starts, the prepared workspace is the evidence boundary.

Generation is not a transcript summary, a Git summary, or an unrestricted investigation. It must present only claims grounded in copied sessions through the project session indexes.

Page Role

This page defines the generation orchestration contract: phase boundaries, durable artifact handoffs, phase output constraints, and links from each phase to its detailed contract. Product-level principles live in Prompt Diary Product; linked generation pages define schemas, prompt templates, grouping rules, writing rules, citation rules, report output shape, and phase-local checks.

Orchestration Rules

  • Each phase transforms one durable artifact into the next durable artifact.
  • Each phase must be runnable after its prerequisites complete. It consumes only the prepared workspace plus durable artifacts from prior phases, and writes its own durable output before returning success.
  • Missing, stale, or invalid prerequisite artifacts must be reported as actionable errors instead of causing a phase to silently re-run the whole pipeline.
  • Evidence extraction failures may be carried into project synthesis as evidence gaps only when represented by durable evidence-card artifacts.
  • Codex-backed phases retry ordinary agent-turn failures inside the active task by re-reading their durable artifacts and continuing on the same agent conversation. The pipeline scheduler does not recover these failures by starting a new task attempt.
  • Each phase owns the correctness of its output. If an output misses required evidence, drops an input, overstates a claim, or violates structural rules, that is a bug in the producing phase.
  • Phase-local quality checks are implementation details. The overview states what each phase must output, not how the phase proves it.

Pipeline

All generation agents run with their process current working directory set to the prepared report workspace for the target date: <reports-root>/work/<YYYY-MM-DD>. The reports root resolves from --reports-root, then PROMPT_DIARY_HOME, then the stored config, then the per-user data directory default. Data artifacts shown in the diagram are read from or written to that workspace unless the artifact description says otherwise. Project-scoped phases receive an explicit project_key and session references; they do not change the process current working directory to the project folder.

Before each Codex-backed generation conversation starts, Prompt Diary injects runtime developer instructions into the agent thread and writes the same generated AGENTS.md in the prepared workspace. These instructions include the selected content language and the synthesis style norm: agent-generated output should be pragmatic, straightforward, concise, plain-worded, and explicit about evidence limits. The style norm applies to all generation-agent output, including assistant responses that are not captured in report artifacts. It does not rewrite source material, schema tokens, citations, paths, commands, code identifiers, or deterministic renderer-owned text.

flowchart TD
    workspace[/Prepared Workspace/]
    evidence["Evidence Extraction"]
    evidence_cards[/Evidence cards/]
    project["Project Synthesis"]
    work_items[/Work items/]
    report["Daily Report Synthesis"]
    model[/"daily-report.json"/]
    rendering["Rendering"]
    final[/"report.md + report.notion.json (Notion page payload)"/]

    workspace -->|"Indexed sessions"| evidence
    evidence --> evidence_cards
    evidence_cards --> project
    project --> work_items
    work_items --> report
    report -->|"Semantic model"| model
    model --> rendering
    rendering -->|"Rendered outputs"| final

The pipeline has four artifact-producing phases:

  • Evidence Extraction turns indexed sessions into evidence cards.
  • Project Synthesis turns evidence cards into work items.
  • Daily Report Synthesis turns work items into a semantic daily report model, daily-report.json; it is the convergence phase for work communication, engagement review, and team learning.
  • Rendering projects daily-report.json into report.md (the reader-facing Markdown view) and report.notion.json (the Notion page payload the publish step uploads to create the Notion page). It is deterministic and agent-free, adding no claims.

Phase Output Constraints

PhaseInputOutputOutput constraints
Evidence ExtractionIndexed sessionsEvidence cardsCards record trigger-centered observations, terminal states, visible checks, and citations without verification judgment or unsupported outcomes. Canonical card writes use MCP evidence tools.
Project SynthesisEvidence cardsWork itemsWork items group evidence chains by line of work, cite them, and summarize them; every indexed turn is covered by exactly one work item, including no-material, evidence-gap, and excluded items.
Daily Report SynthesisWork itemsdaily-report.jsonThe report model realizes all three product readings from the same evidence base: clear work communication, faithful engagement assessment, and reusable AI-agent usage learning. It preserves no-material signals where relevant, cites claim-bearing content, and records confidence and evidence gaps structurally.
Renderingdaily-report.jsonreport.md (Markdown view) + report.notion.json (Notion page payload)Rendering is deterministic and agent-free: it projects the model into its outputs and adds no claim-bearing content. Every claim, citation, confidence value, and evidence-quality signal in a rendered output comes from the model; an output that adds, drops, or alters a claim is a rendering bug.

Artifact Handoffs

ArtifactDescription
Indexed sessionsPrepared workspace indexes plus copied sessions. They define the target spans and evidence boundary that generation must not expand.
Evidence cardsPer-session, trigger-centered records of user triggers, agent reactions, observed outcomes, observed checks, terminal states, and citations.
Work itemsProject-level groupings of evidence chains by line of work. Each work item cites and summarizes its chains; every indexed turn is covered by exactly one work item, including no-material, evidence-gap, and excluded items.
daily-report.jsonThe authoritative semantic daily report model, synthesized from work items and evidence citations. Daily report synthesis uses preserved material and non-material evidence for outcomes, evidence gaps, risks, engagement assessment, next actions, and team-learning content.
report.mdThe required Markdown view, produced by Rendering from daily-report.json in the section order it defines.
report.notion.jsonThe deterministic Notion page payload, produced by Rendering from daily-report.json.