feat(lineage): require TEPP criterion anchor for channel weights - #606
Conversation
|
Warning Review limit reachedNext included review available in 52 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (42)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…hor-consumer # Conflicts: # backend/app/analysis_run_start.py
|
Queue retry 2026-08-25T17:06 KST (Grok Build cycle). Write-path probe: independent APPROVE is still missing on this exact head Stale v0.71 queue items (#74/#89/#91/#92/#96 leftover-pair local patch) are superseded by current main@4f53190 and this TEPP criterion-anchor consumer. Issue #96 is already gone; #79/#87 remain open and incomplete. |
…perations-dashboard # Conflicts: # docs/adr/README.md
|
Exact consumer alignment in f40ecef: after TEPP PR #237 made the published UUID representation canonical, this boundary now rejects compact/non-canonical estimation-run IDs instead of normalizing them silently. |
…r' into feat/evidence-operations-dashboard
…ions-dashboard feat(dashboard): add evidence-grounded operations workspace
|
Cycle note (2026-08-25): this head still has no independent exact-head APPROVE. Devin COMMENTED only; seonghobae COMMENTED only. Merge stays blocked. Do not self-approve. Do not squash-merge until an independent reviewer APPROVEs this exact head ( Naruon calendar Buyer wiring (ADR 0203 step 2 / #336) is being implemented on a separate branch ( |
# Conflicts: # backend/app/lineage_ingestion.py # backend/app/main.py # docs/product-technical-gap-baseline.md # frontend/src/App.tsx
|
Exact-head repair f8ad49d composes current protected main, preserves the TEPP fail-closed boundary, routes shared ?post= links to the board before Dashboard rendering, and replaces the static-analysis placeholder expressions. Verified 68 focused backend/docstring tests, 9 Workspace navigation tests, frontend lint, and production build. |
| for item in payload: | ||
| if not isinstance(item, dict) or item.get("case_kind_code") not in CASE_KINDS: | ||
| return None | ||
| summary = item.get("summary_text") | ||
| evidence = item.get("evidence_text") | ||
| facts = item.get("facts") | ||
| if not isinstance(summary, str) or not summary.strip() or not isinstance(evidence, str) or evidence not in source_body or not isinstance(facts, list): | ||
| return None | ||
| parsed_facts: list[OperationsCaseFact] = [] | ||
| for fact in facts: | ||
| if not isinstance(fact, dict) or fact.get("fact_type_code") not in FACT_TYPES: | ||
| return None | ||
| value = fact.get("value_text") | ||
| fact_evidence = fact.get("evidence_text") | ||
| if not isinstance(value, str) or not value.strip() or not isinstance(fact_evidence, str) or fact_evidence not in source_body: | ||
| return None | ||
| parsed_facts.append(OperationsCaseFact(fact["fact_type_code"], value.strip(), fact_evidence)) | ||
| cases.append(OperationsCase(item["case_kind_code"], summary.strip(), evidence, tuple(parsed_facts))) |
There was a problem hiding this comment.
📝 Info: Repeated case kind can fail persistence
parse_operations_case_response does not deduplicate case_kind_code across returned cases, but operations_case_classification keys on (post_id, case_kind_code). If the orchestrator returns two cases of the same kind, persist_operations_cases hits a unique violation and the content job fails and retries. Consider rejecting or collapsing duplicate kinds during parse.
Was this helpful? React with 👍 or 👎 to provide feedback.
| case_complete = not require_structure or bool( | ||
| await conn.fetchval( | ||
| "select exists (select 1 from operations_case_analysis " | ||
| "where post_id = $1 and source_body_sha256 = $2)", | ||
| post_id, | ||
| source_body_digest, | ||
| ) | ||
| ) | ||
| if content_complete and case_complete: |
There was a problem hiding this comment.
📝 Info: Existing succeeded jobs reprocessed on rollout
_claim_job now reclaims a SUCCEEDED job when require_structure is true and no operations_case_analysis row matches the digest. Every job that succeeded before this deploy (orchestrator configured) will be reclaimed and fully reprocessed, re-running persist_post_content and the orchestrator case analysis. It converges since an empty result still writes the parent row, but it is a corpus-wide one-time reprocessing and provider-call cost.
Was this helpful? React with 👍 or 👎 to provide feedback.
| return f""" | ||
| ({alias}.visibility_code = 'public' | ||
| or {alias}.corporate_entity_id::text = any($1::text[])) |
There was a problem hiding this comment.
🟥 Dashboard skips process-unit ABAC narrowing
The dashboard's visibility predicate _visible_period_sql admits any private post whose owning entity the account is affiliated with (corporate_entity_id::text = any($1::text[])) and never narrows by process unit; the handler passes only account.corporate_entity_ids and drops process_unit_ids. The canonical rule at main.py restricts a process-unit-limited account to its authorized units. Such a user then receives case summaries, verbatim evidence spans, and counts for private posts in units they cannot access.
Was this helpful? React with 👍 or 👎 to provide feedback.
Outcome
Removes
unanchored_internal_structurefrom the production activation path. A fast-mlsirm channel vector now activates only when the database contains an exact accepted TEPPtepp.lineage_criterion_anchor.v1result bound to the same estimation run, source snapshot, knowledge cutoff, and pair count. Any mismatch disables the whole vector.The LineageWeave request now asks for TEPP model contract
tepp-lineage-criterion-v1and output profilelineage_pair_criterion_anchor; it accepts no consumer-private nested validity flag.Stack dependency
Verification
uv run --extra dev --extra backend pytest -q tests/test_analysis_run_start.py tests/test_lineage_ingestion.py tests/test_migration_replay.py(59 passed)Integrity boundary
No local theta, acceptance threshold, repaired provenance, arbitrary weight, keyword rule, or RankWeave substitute is introduced.