PromptReports

Plan: Send an incident and its fix to a case file

Partly builtopenspec/changes/wf-incident-to-case-file

Written for an AI agent to fetch and follow: it says what to connect, which steps to build with which product, what a person must approve, and how to check the result. Steps that depend on a part that is not built say so, and tell the agent to record the gap instead of guessing.

URL pattern: /use-cases/<id>/openspec.md, all plans at /use-cases/index.json. Checkboxes on this page are for reading only.

openspec/changes/wf-incident-to-case-file/proposal.md

Why

The incident, the change and session behind it, the fix and who approved it sit in the org's own tools. Nobody outside the org can check them without an account there. Anyone the org invites can check the case export offline, with no account in the org's tools.

What Changes

  • Add the incident-to-case-file workflow to the PromptReports workflow library, run by the workflow runner as an agent acting for a person.
  • RepoOps: Read the incident with the release, change and session it was traced to, the fix packet and the session outcome record, each with its digest (get_incident_evidence) (today: Planned).
  • PromptReports: Plan the case file: the incident, the fix packet, the session outcome record and the approval, each with its digest. A dry run stops here and files nothing (plan_case_file) (today: Built).
  • PromptCompute: A person approves sending the evidence outside the org, and the approval sets digests only or documents (promptcompute.case_file.send) (today: Built).
  • AI Source of Truth: Open one Evidence Rooms case for the incident, or reuse the one already open for it (open_case) (today: Built).
  • AI Source of Truth: File each item as a signed digest reference, or as the document when the approval chose documents. A private session's content is never sent (add_item) (today: Built).
  • PromptReports: Record the case id and its registry anchor on the run record (today: Built).
  • Gate promptcompute.case_file.send through PromptCompute approvals; each gated step runs only after verifyResume passes, with final_args.
  • Write a signed record at the end of each run and count one workflow request.

Impact

  • Products: RepoOps, PromptReports, PromptCompute, AI Source of Truth.
  • Outside the family: The org's Evidence Rooms connection, with its partner key.
  • State: Partly built. The incident-to-case-file manifest and its tools are merged in promptcompute.ai #966 and off behind INCIDENT_CASE_FILE, and the four item kinds are merged in Evidence Rooms #51 and off behind ROOMS_INCIDENT_ITEMS. It cannot run today: the runner will register it only once RUNNER_USE_CASES and INCIDENT_CASE_FILE are on and RepoOps's connector lists get_incident_evidence, which RepoOps has not shipped. Nothing is sent without an approved promptcompute.case_file.send request for that incident, and the tools check that themselves. The default sends digests only.
  • Plan row: none yet (Proposed).
openspec/changes/wf-incident-to-case-file/tasks.md

1. Connect and authorize

  • 1.1 Confirm the org has a connection for each of: RepoOps, PromptReports, PromptCompute, AI Source of Truth. Stop and tell the user which is missing.
  • 1.2 Get a PromptReports ID agent token for each product the run calls (RFC 8693 exchange). Where a product does not accept ID tokens yet, use its connect key.
  • 1.3 Register policy for promptcompute.case_file.send with require_approval as the default.

2. Build the steps

  • 2.1 RepoOps: Read the incident with the release, change and session it was traced to, the fix packet and the session outcome record, each with its digest (get_incident_evidence). Blocked: this part is Planned; until it ships, record the step's evidence as missing and continue.
  • 2.2 PromptReports: Plan the case file: the incident, the fix packet, the session outcome record and the approval, each with its digest. A dry run stops here and files nothing (plan_case_file).
  • 2.3 PromptCompute: A person approves sending the evidence outside the org, and the approval sets digests only or documents (promptcompute.case_file.send).
  • 2.4 AI Source of Truth: Open one Evidence Rooms case for the incident, or reuse the one already open for it (open_case).
  • 2.5 AI Source of Truth: File each item as a signed digest reference, or as the document when the approval chose documents. A private session's content is never sent (add_item).
  • 2.6 PromptReports: Record the case id and its registry anchor on the run record.

3. Verify and record

  • 3.1 Run a dry run with the user's inputs: Incident id = the RepoOps incident id.
  • 3.2 Run it once for real; approve each gate as the user.
  • 3.3 Measure the outcomes: Incidents with a case whose export passes the offline verifier; Case files sent with no document when digests only was chosen.
  • 3.4 Confirm the run left a signed record with a task id and one workflow request counted.
openspec/changes/wf-incident-to-case-file/specs/workflow-incident-to-case-file/spec.md

ADDED Requirements

Requirement: Evidence leaves the org only with a person's approval

The step that sends an incident to a case file SHALL wait for a named person, and SHALL send nothing when the approval is declined.

Scenario: Evidence leaves the org only with a person's approval

  • WHEN a person declines the access approval for a case file
  • THEN no case is opened and no item is sent

Requirement: The org chooses what is sent, and a private session stays private

The step SHALL send digests only unless the approval chose documents for that case, and MUST NOT send the content of a session whose visibility is private.

Scenario: The org chooses what is sent, and a private session stays private

  • WHEN a case file is opened with the default setting
  • THEN the case holds digests, times and ids, and no document

Requirement: An outsider can check the case without trusting the family

A case opened by the step SHALL be exportable with a verifier that runs offline and needs no account.

Scenario: An outsider can check the case without trusting the family

  • WHEN an invited reader runs the offline verifier on the export
  • THEN each item's hash and registry anchor check, or the verifier names the item that failed

Requirement: Evidence stays honest

Each step SHALL report what it saw as measured, inferred or missing, and SHALL never report missing as measured.

Scenario: A product part is not built

  • WHEN a step depends on a part that is Planned or Proposed
  • THEN the step records missing, names the part, and the approval card shows the gap

Requirement: One run is one workflow request

The runner SHALL count one workflow request at the run's first connector action, and SHALL NOT count retries, resumes, dry runs or a run a filter stops first.

Scenario: A gated step resumes after two days

  • WHEN a person approves a step and the run resumes
  • THEN the org's usage does not change