{
  "trace_schema_version": "capsule_replay.trace.v1",
  "trace_id": "base-deterministic-compile",
  "description": "Show that repeated compile requests over unchanged state re-emit the same bounded context deterministically.",
  "steps": [
    {
      "step_id": "event_issue",
      "endpoint": "/v1/event",
      "body": {
        "task_id": "proof_base_determinism_task",
        "step_id": "step_001",
        "idempotency_key": "proof_base_determinism_event_001",
        "event_type": "tool_result",
        "summary_1line": "identify auth regression in webhook guard",
        "task_title": "Auth Regression Follow-up",
        "task_goal": "Keep compile output stable across repeated reads",
        "fact_key": "target_file",
        "fact_value": "src/auth/webhook_guard.rs",
        "payload": {
          "artifacts_inline": [],
          "artifact_refs": [],
          "paths_touched": [
            "src/auth/webhook_guard.rs"
          ]
        }
      }
    },
    {
      "step_id": "event_fix",
      "endpoint": "/v1/event",
      "body": {
        "task_id": "proof_base_determinism_task",
        "step_id": "step_002",
        "idempotency_key": "proof_base_determinism_event_002",
        "event_type": "tool_result",
        "summary_1line": "queue signature validation fix",
        "task_title": "Auth Regression Follow-up",
        "task_goal": "Keep compile output stable across repeated reads",
        "fact_key": "next_action",
        "fact_value": "re-enable HMAC verification",
        "payload": {
          "artifacts_inline": [
            {
              "type": "diff",
              "content": "restore verify_hmac_signature in webhook guard",
              "tags": [
                "auth",
                "fix"
              ],
              "related_paths": [
                "src/auth/webhook_guard.rs"
              ]
            }
          ],
          "artifact_refs": [],
          "paths_touched": [
            "src/auth/webhook_guard.rs"
          ]
        }
      }
    },
    {
      "step_id": "compile_a",
      "endpoint": "/v1/compile",
      "body": {
        "task_id": "proof_base_determinism_task",
        "budget": {
          "total_tokens_max": 5000,
          "section_tokens_max": {
            "TASK": 400,
            "SUCCESS_CRITERIA": 200,
            "CONSTRAINTS": 200,
            "CURRENT_STATE_SNAPSHOT": 500,
            "RECENT_DECISIONS": 300,
            "KNOWN_FACTS": 400,
            "RELEVANT_ARTIFACT_SNIPPETS": 1200,
            "PLAN_SLICE": 300,
            "OPEN_ITEMS_AND_RISKS": 200,
            "OUTPUT_REQUIREMENTS": 200
          }
        },
        "format": {
          "template_id": "default_v1",
          "include_artifact_hashes": true
        }
      }
    },
    {
      "step_id": "compile_b",
      "endpoint": "/v1/compile",
      "body": {
        "task_id": "proof_base_determinism_task",
        "budget": {
          "total_tokens_max": 5000,
          "section_tokens_max": {
            "TASK": 400,
            "SUCCESS_CRITERIA": 200,
            "CONSTRAINTS": 200,
            "CURRENT_STATE_SNAPSHOT": 500,
            "RECENT_DECISIONS": 300,
            "KNOWN_FACTS": 400,
            "RELEVANT_ARTIFACT_SNIPPETS": 1200,
            "PLAN_SLICE": 300,
            "OPEN_ITEMS_AND_RISKS": 200,
            "OUTPUT_REQUIREMENTS": 200
          }
        },
        "format": {
          "template_id": "default_v1",
          "include_artifact_hashes": true
        }
      }
    }
  ]
}
