Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Target Safety and Therapeutic-Window Pre-screen Handoff

## Status

- Branch: `task_20260804_target-safety-prescreen-fix`
- Base: latest `origin/main` at task start
- Review: Round 1 returned `REQUEST_CHANGES`; remediation is in clean replacement PR #56
- Data boundary: no source data, cache, result, model weight, or runtime output in the repository

## Scope

This GenModule is a target-level public-evidence pre-screen for ADC development.
It asks whether public evidence contains a target-intrinsic hazard strong enough
to kill, hold, or downgrade investment before antibody discovery and ADC assembly.
It does not claim product-specific therapeutic-window prediction.

## Implemented

- Six evidence axes: normal tissue expression, surface accessibility, antigen density, soluble antigen/shedding/sink, existing modality toxicity, and tissue consequence/recoverability.
- Evidence levels `A/B/C/D/U` and explicit risk directions.
- Fatal-first rules for critical surface hazard, confirmed severe on-target toxicity, non-lower normal density, clinically demonstrated sink/exposure failure, and no exploitable differential.
- Non-fatal material risk is explicitly retained and produces `HOLD`; `GO` requires all six axes to be resolved with no material risk or conflict.
- Unknown direction auto-propagates to unresolved; surface, tissue criticality, and density evidence are aggregated across claims; differential status is structured rather than tag-driven.
- Decision semantics: `KILL`, `HOLD`, `CONDITIONAL_GO`, `GO`.
- Unknown, unresolved, and conflicting claims remain visible and produce next-experiment references.
- All cross-boundary identities and evidence references require `external:` references.
- `claim_ref` and `evidence_refs` are unique and must match exactly; mitigation
references must point to a `SUPPORTS_RISK` claim in the same request.
- Runtime location is declared as `${BIOWORKSPACE_ROOT}/DATA/target_safety_therapeutic_window_prescreen/{raw,processed,result}`; no runtime writer is enabled in the repository.

## Validation

- Module tests pass.
- Module tests: 21 pass; full suite: 228 tests pass.
- `scripts/verify_repository_boundary.sh` passes.
- `git diff --check` passes.
- No `__pycache__` directory remains.

## Known limitations

- Evidence retrieval, source normalization, citation resolution, scoring calibration, and persistence remain external runtime responsibilities.
- The first ruleset is deterministic and conservative; it is not a clinical safety model and must not be used as a product-level therapeutic-window claim.
- The next implementation phase should add an external runtime adapter and benchmark fixtures under `DATA`, only after this contract PR is reviewed.

## Round 1 remediation

- Rebuilt the PR from `origin/main` so the CRC clinical-frame commit is not in scope.
- Bumped the module and contract version to `0.3.0` for the structured differential, material-risk output, and hazard-context fields.
- Replacement PR: `https://github.com/leezx/StelligenOS/pull/56`, head `d36e4a4`.

## Round 2 remediation

- Fatal aggregation is now context-aligned by shared `hazard_context_ref` or `(tissue, cell_type)`; unscoped claims cannot combine into a fatal decision.
- `CONDITIONAL_GO` now requires every material-risk claim to be covered by a context-matched differential or explicit `mitigates_claim_refs`.
- `NO_EXPLOITABLE_DIFFERENTIAL` requires an external comprehensive assessment reference; a single observation is downgraded to unresolved.
- Added cross-context, unrelated-differential, partial-coverage, and unscoped-fatal regression tests.

## Round 3 remediation

- Read ChatGPT Round 3 `REQUEST_CHANGES`; the remaining blocker was that duplicate
claim/evidence references and invalid mitigation references could corrupt risk
coverage and permit a false `CONDITIONAL_GO`.
- Tightened `AssessmentRequest` to require unique claim references, unique
evidence references, exact equality between the two reference sets, and
mitigation references that resolve to in-request `SUPPORTS_RISK` claims.
- Added five contract-integrity regression tests covering duplicate claims,
duplicate evidence, missing mitigation targets, non-risk mitigation targets,
and the duplicate-reference conditional-go path.
- Bumped module and contract versions from `0.3.0` to `0.4.0`.
4 changes: 4 additions & 0 deletions genmodules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ are not lifecycle stages or Gate implementations.
- `gen_indication_endpoint_target@0.1.0`: defines data-free contracts for
constrained ADC indication, endpoint, and target opportunity generation;
generation, evaluation, ranking, and evidence remain external.
- `target_safety_therapeutic_window_prescreen@0.4.0`: applies conservative,
fatal-first rules to externally supplied public-evidence claims for target-
intrinsic ADC safety pre-screening; it does not predict a product-specific
therapeutic window.

## Repository boundary

Expand Down
57 changes: 57 additions & 0 deletions genmodules/target_safety_therapeutic_window_prescreen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Public-Evidence Target Safety and Therapeutic-Window Pre-screen Engine

This GenModule performs a conservative, target-level ADC safety pre-screen from
already-normalized public evidence. It does **not** predict a product-specific
therapeutic window and does not replace Gate evaluation, toxicology, or human
decision-making.

## Six evidence axes

1. Normal-tissue and cell-type expression.
2. Surface localization and vascular accessibility.
3. Normal-cell antigen density.
4. Soluble antigen, shedding, and target sink.
5. Existing modality exposure and toxicity attribution.
6. Tissue consequence and recoverability.

Evidence levels are `A` (human causal), `B` (human protein/cell-resolved), `C`
(multi-omic concordance), `D` (single or indirect), and `U` (unknown).
Unknown remains unresolved; it is never converted into safety.

Material risk claims that do not meet a fatal threshold produce `HOLD`, not
`GO`. A target reaches `GO` only when all six axes are represented and resolved
with no material risk or conflict. Differential status is a structured field;
free-form tags cannot create a fatal flag. Fatal aggregation requires a shared
`hazard_context_ref` or `(tissue, cell_type)` context; unscoped evidence cannot
be combined into a fatal decision. A differential must either share that
context or explicitly list the risk claims it mitigates.
Request contracts require unique claim and evidence references, exact equality
between those reference sets, and mitigation references to resolve to
in-request risk claims.

## Decision semantics

The evaluator applies fatal flags first:

- `KILL`: a defined target-level fatal condition is supported.
- `HOLD`: critical evidence is unknown, conflicting, or unresolved.
- `CONDITIONAL_GO`: no fatal condition and a plausible exploitable differential
exists, with explicit mitigation work.
- `GO`: no public target-intrinsic fatal flaw was found; this is not proof of a
therapeutic window.

## Runtime boundary

The package is pure and in-memory. Evidence claims carry only `external:`
references. A runtime may resolve those references under:

```text
${BIOWORKSPACE_ROOT}/DATA/target_safety_therapeutic_window_prescreen/
├── raw/ immutable source downloads and manifests
├── processed/ normalized evidence tables and provenance
└── result/ run-specific assessment packages and reports
```

The repository contains no source data, database, cache, result, model weight,
or runtime artifact. The external runtime must record source versions,
checksums, policy version, code commit, and unresolved evidence.
31 changes: 31 additions & 0 deletions genmodules/target_safety_therapeutic_window_prescreen/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Public-evidence target safety pre-screen contracts and conservative rules."""

from .contracts import (
AssessmentRequest,
AssessmentResult,
Criticality,
Decision,
DifferentialStatus,
EvidenceAxis,
EvidenceClaim,
EvidenceLevel,
FatalFlag,
RiskDirection,
TargetProfile,
)
from .engine import assess_target

__all__ = [
"AssessmentRequest",
"AssessmentResult",
"Criticality",
"Decision",
"DifferentialStatus",
"EvidenceAxis",
"EvidenceClaim",
"EvidenceLevel",
"FatalFlag",
"RiskDirection",
"TargetProfile",
"assess_target",
]
Loading
Loading