Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
37aca67
feat: add autonomous Evidence Mentor runner
Enksodsoon Aug 21, 2026
0305eb8
feat: add governed model qualification packs
Enksodsoon Aug 22, 2026
ec51418
test: mock evidence runner status
Enksodsoon Aug 22, 2026
31dc44c
feat: pin and acquire DINOv2 baseline
Enksodsoon Aug 22, 2026
bf7270f
Record offline DINOv2 worker qualification
Enksodsoon Aug 22, 2026
125c99c
Require immutable tiles for H&E qualification
Enksodsoon Aug 22, 2026
787dd9d
feat(evidence): add autonomous service dashboard
Enksodsoon Aug 22, 2026
bd103fc
test(evidence): add service acceptance gate
Enksodsoon Aug 22, 2026
21c7516
fix(evidence): support elevated Windows PowerShell install
Enksodsoon Aug 22, 2026
8b72cc2
fix(evidence): enable Windows service SID
Enksodsoon Aug 22, 2026
27cacfe
fix(evidence): resume verified service staging
Enksodsoon Aug 22, 2026
74e1834
fix(evidence): complete service activation safely
Enksodsoon Aug 22, 2026
799935b
Recover service jobs immediately after restart
Enksodsoon Aug 22, 2026
4d5aa2c
Preserve endpoint ACL across service restarts
Enksodsoon Aug 22, 2026
b34e47a
Resume jobs from durable service checkpoints
Enksodsoon Aug 22, 2026
ead8d92
Observe short jobs during restart acceptance
Enksodsoon Aug 22, 2026
016a4fb
Add fail-closed Session 0 GPU acceptance pack
Enksodsoon Aug 22, 2026
fd7d59b
Qualify portable Session 0 GPU runtime
Enksodsoon Aug 22, 2026
bb4647b
Require post-boot job completion evidence
Enksodsoon Aug 22, 2026
90ddb84
Fail closed experimental evidence packs
Enksodsoon Aug 22, 2026
19ea3ee
Add brightfield qualification harness
Enksodsoon Aug 22, 2026
49f43d7
feat: add autonomous all-rounder qualification campaign
Enksodsoon Aug 22, 2026
f9a5827
test: normalize protocol hashes across platforms
Enksodsoon Aug 22, 2026
a09f583
feat: stage deterministic qualification campaign
Enksodsoon Aug 22, 2026
166c5dd
Make qualification preflight fail closed
Enksodsoon Aug 22, 2026
aeca4e2
Add fail-closed post-reboot service recovery
Enksodsoon Aug 22, 2026
6f3157c
Make post-reboot recovery workspace independent
Enksodsoon Aug 22, 2026
e562e92
feat(ai): add autonomous real-data acquisition telemetry
Enksodsoon Aug 22, 2026
2a88959
fix(ai): restart non-range acquisitions safely
Enksodsoon Aug 23, 2026
37a11df
fix(ai): repair installed service recovery state
Enksodsoon Aug 23, 2026
27e397f
feat(ai): add standalone acquisition monitor
Enksodsoon Aug 23, 2026
17bbc5f
feat(ai): run real NCT-CRC DINOv2 execution
Enksodsoon Aug 23, 2026
9af1ffe
feat(ai): qualify frozen DINOv2 GI cohort
Enksodsoon Aug 23, 2026
32ca0ba
feat(ai): automate TCGA lung qualification cohort
Enksodsoon Aug 23, 2026
5e03ad3
fix(ai): protect autonomous cohort handoff
Enksodsoon Aug 23, 2026
a4d2859
fix(service): align runner package version
Enksodsoon Aug 23, 2026
7ce964d
docs(ai): record TCGA lung qualification result
Enksodsoon Aug 23, 2026
8194edc
feat(ai): advance lung and ihc qualification
Enksodsoon Aug 23, 2026
3f288c3
fix(ai): checkpoint IHC fixture acquisition
Enksodsoon Aug 23, 2026
9c24798
fix(ai): resume exact IHC chunks idempotently
Enksodsoon Aug 23, 2026
6e82b75
fix(ai): bind IHC fixtures after atomic publish
Enksodsoon Aug 23, 2026
672c37f
feat(ai): stage official MoNuSAC acquisition
Enksodsoon Aug 23, 2026
2ce1a99
feat(ai): evaluate held-out cell instances
Enksodsoon Aug 24, 2026
07920d1
feat(ai): freeze HoVer-Net research candidate
Enksodsoon Aug 24, 2026
828e2bc
feat(ai): prove HoVer-Net P2000 runtime
Enksodsoon Aug 24, 2026
149d654
feat(ai): validate shared model runtimes
Enksodsoon Aug 24, 2026
37594f7
feat(ai): checkpoint HoVer-Net qualification
Enksodsoon Aug 24, 2026
cfd2d00
Fix terminal model worker progress attribution
Enksodsoon Aug 24, 2026
23d066f
Record terminal HoVer-Net remediation
Enksodsoon Aug 24, 2026
1f5d207
Add BRACS breast retrieval qualification track
Enksodsoon Aug 24, 2026
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/evidence/he-retrieval-qualification-protocol-v1.md text eol=lf
28 changes: 28 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,34 @@ tasks.withType<Jar>().configureEach {
isReproducibleFileOrder = true
}

tasks.register<JavaExec>("brightfieldQualification") {
group = "verification"
description = "Runs synthetic-only cell and IHC pre-qualification checks."
dependsOn(tasks.classes)
classpath = sourceSets.main.get().runtimeClasspath
mainClass = "org.pathlab.forge.evidence.BrightfieldQualificationHarness"
val report = providers.gradleProperty("pathlab.qualification.output")
.orElse(layout.buildDirectory.file("qualification/brightfield-report.json").map { it.asFile.absolutePath })
args(
"--packs", file("src/main/resources/evidence-packs").absolutePath,
"--output", report.get())
}

tasks.register<JavaExec>("cellInstanceQualification") {
group = "verification"
description = "Runs the frozen held-out cell-instance qualification evaluator."
dependsOn(tasks.classes)
classpath = sourceSets.main.get().runtimeClasspath
mainClass = "org.pathlab.forge.evidence.CellInstanceQualificationEvaluator"
maxHeapSize = "768m"
val cohort = providers.gradleProperty("pathlab.cell.cohort")
val cohortSha = providers.gradleProperty("pathlab.cell.cohortSha256")
val report = providers.gradleProperty("pathlab.cell.output")
.orElse(layout.buildDirectory.file("qualification/cell-instance-metrics.json")
.map { it.asFile.absolutePath })
doFirst { setArgs(listOf(cohort.get(), cohortSha.get(), report.get())) }
}

val installVersionedRuntime = tasks.register<Sync>("installVersionedRuntime") {
dependsOn(tasks.installDist)
val localAppData = providers.environmentVariable("LOCALAPPDATA")
Expand Down
10 changes: 10 additions & 0 deletions contracts/evidence-mentor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Evidence Mentor contracts

These schemas are the cross-repository truth boundary for the private research MVP.

- `pathlab.ai-pack/1` describes a locally installed expert pack and its rights/resource gates.
- `pathlab.ai-evidence/1` is the immutable, signed, slide-bound result accepted by Viewer.
- `pathlab.knowledge-pack/1` contains reviewed atomic claims; the tutor may select claim IDs but may not invent factual prose.
- `pathlab.model-qualification-report/1` records checksum-bound synthetic or held-out checks without activating a pack.

Raw WSI pixels and reusable embeddings are never valid evidence-bundle members. All contracts are research-only and fail closed.
30 changes: 30 additions & 0 deletions contracts/evidence-mentor/pathlab-ai-evidence-v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pathlab.local/schemas/pathlab-ai-evidence-v1.schema.json",
"title": "PathLab AI Evidence v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "bundleId", "source", "pack", "status", "researchOnly", "notDiagnostic", "reviewRequired", "coordinates", "evidence", "cellAggregates", "ihcDescriptors", "citations", "qc", "provenance", "manifestSha256", "signature"],
"properties": {
"schema": {"const": "pathlab.ai-evidence/1"},
"bundleId": {"type": "string", "pattern": "^[A-Za-z0-9._-]{1,120}$"},
"source": {"type": "object", "additionalProperties": false, "required": ["slideSha256", "revision"], "properties": {"slideSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "revision": {"type": "string", "minLength": 1, "maxLength": 160}}},
"pack": {"type": "object", "additionalProperties": false, "required": ["id", "version", "manifestSha256", "preprocessing", "artifacts", "allowedUse", "validationStatus"], "properties": {"id": {"type": "string", "maxLength": 120}, "version": {"type": "string", "maxLength": 64}, "manifestSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "preprocessing": {"type": "string", "maxLength": 120}, "artifacts": {"type": "array", "maxItems": 16, "items": {"type": "string", "pattern": "^[a-f0-9]{64}$"}}, "allowedUse": {"const": "private-research"}, "validationStatus": {"enum": ["experimental", "qualified"]}}},
"status": {"enum": ["completed", "partial", "abstained", "unsupported", "failed"]},
"researchOnly": {"const": true},
"notDiagnostic": {"const": true},
"reviewRequired": {"const": true},
"coordinates": {"type": "object", "additionalProperties": false, "required": ["space", "originX", "originY", "scaleX", "scaleY"], "properties": {"space": {"const": "source-pixel"}, "originX": {"type": "number", "minimum": 0}, "originY": {"type": "number", "minimum": 0}, "scaleX": {"type": "number", "exclusiveMinimum": 0}, "scaleY": {"type": "number", "exclusiveMinimum": 0}}},
"evidence": {"type": "array", "maxItems": 1000, "items": {"$ref": "#/$defs/region"}},
"cellAggregates": {"type": "array", "maxItems": 1000, "items": {"type": "object", "additionalProperties": false, "required": ["regionId", "algorithm", "count", "densityPerMm2", "meanNucleusAreaPx2"], "properties": {"regionId": {"type": "string", "maxLength": 120}, "algorithm": {"enum": ["hovernet-fast", "od-watershed", "od-connected-components"]}, "count": {"type": "integer", "minimum": 0}, "densityPerMm2": {"type": ["number", "null"], "minimum": 0}, "meanNucleusAreaPx2": {"type": ["number", "null"], "minimum": 0}, "meanNucleusPerimeterPx": {"type": ["number", "null"], "minimum": 0}, "meanNucleusEccentricity": {"type": ["number", "null"], "minimum": 0, "maximum": 1}, "meanNucleusSolidity": {"type": ["number", "null"], "minimum": 0, "maximum": 1}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}}}},
"ihcDescriptors": {"type": "array", "maxItems": 1000, "items": {"type": "object", "additionalProperties": false, "required": ["regionId", "marker", "compartment", "dabAreaFraction", "meanDabOd", "researchEstimate"], "properties": {"regionId": {"type": "string", "maxLength": 120}, "markerId": {"enum": ["generic", "er", "pr", "ki-67", "her2", "pd-l1"]}, "marker": {"enum": ["generic", "er", "pr", "ki-67", "her2", "pd-l1"]}, "markerIdentitySource": {"enum": ["unknown", "faculty-authored", "slide-label", "import-metadata"]}, "analysisMode": {"enum": ["marker-aware", "generic-fallback", "generic-descriptive"]}, "cellMaskSource": {"enum": ["hovernet-fast", "od-watershed", "od-connected-components"]}, "compartmentSource": {"enum": ["none", "faculty-authored", "faculty-approved", "model-suggested"]}, "calibrationStatus": {"enum": ["calibrated", "relative_only", "not_evaluable"]}, "compartment": {"enum": ["nuclear", "membrane", "tumor-immune-region", "generic-region"]}, "dabAreaFraction": {"type": "number", "minimum": 0, "maximum": 1}, "meanDabOd": {"type": "number", "minimum": 0}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "abstentionReason": {"type": ["string", "null"], "maxLength": 500}, "researchEstimate": {"const": true}}}},
"citations": {"type": "array", "maxItems": 100, "items": {"type": "object", "additionalProperties": false, "required": ["claimId", "sourceUrl"], "properties": {"claimId": {"type": "string", "maxLength": 160}, "sourceUrl": {"type": "string", "format": "uri", "maxLength": 1000}}}},
"qc": {"type": "object", "additionalProperties": false, "required": ["focus", "tissueFraction", "uncertainty", "abstentionReasons"], "properties": {"focus": {"type": "number", "minimum": 0, "maximum": 1}, "tissueFraction": {"type": "number", "minimum": 0, "maximum": 1}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "abstentionReasons": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 500}}, "calibrationStatus": {"enum": ["calibrated", "relative_only", "not_evaluable"]}, "backgroundFraction": {"type": "number", "minimum": 0, "maximum": 1}, "saturationFraction": {"type": "number", "minimum": 0, "maximum": 1}, "stainSeparation": {"type": "number", "minimum": 0, "maximum": 1}, "warnings": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 500}}}},
"provenance": {"type": "object", "additionalProperties": false, "required": ["createdAt", "codeRevision", "offlineAnalysis"], "properties": {"createdAt": {"type": "string", "format": "date-time"}, "codeRevision": {"type": "string", "maxLength": 160}, "offlineAnalysis": {"const": true}}},
"manifestSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"signature": {"type": "object", "additionalProperties": false, "required": ["algorithm", "keyId", "publicKeyDer", "value"], "properties": {"algorithm": {"const": "Ed25519"}, "keyId": {"type": "string", "maxLength": 160}, "publicKeyDer": {"type": "string", "minLength": 1}, "value": {"type": "string", "minLength": 1}}}
},
"$defs": {
"region": {"type": "object", "additionalProperties": false, "required": ["id", "stage", "kind", "x", "y", "width", "height", "score"], "properties": {"id": {"type": "string", "maxLength": 120}, "stage": {"enum": ["coarse", "refined"]}, "kind": {"enum": ["support", "similar", "contrast"]}, "x": {"type": "number", "minimum": 0}, "y": {"type": "number", "minimum": 0}, "width": {"type": "number", "exclusiveMinimum": 0}, "height": {"type": "number", "exclusiveMinimum": 0}, "score": {"type": "number", "minimum": 0, "maximum": 1}, "thumbnail": {"type": "string", "pattern": "^thumbnails/[A-Za-z0-9._-]+\\.(png|jpg|webp)$"}}}
}
}
29 changes: 29 additions & 0 deletions contracts/evidence-mentor/pathlab-ai-evidence-v2.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://pathlab.local/schemas/pathlab-ai-evidence-v2.schema.json",
"title": "PathLab AI Evidence v2", "type": "object", "additionalProperties": false,
"required": ["schema", "bundleId", "source", "pack", "qualificationAttestationSha256", "status", "researchOnly", "notDiagnostic", "reviewRequired", "coordinates", "regions", "cellInstances", "cellAggregates", "ihcDescriptors", "specialStainDescriptors", "cytologyDescriptors", "citations", "qc", "provenance", "manifestSha256", "signature"],
"properties": {
"schema": {"const": "pathlab.ai-evidence/2"}, "bundleId": {"$ref": "#/$defs/id"},
"source": {"type": "object", "additionalProperties": false, "required": ["slideSha256", "revision", "width", "height"], "properties": {"slideSha256": {"$ref": "#/$defs/sha"}, "revision": {"type": "string", "minLength": 1, "maxLength": 160}, "width": {"type": "integer", "minimum": 1}, "height": {"type": "integer", "minimum": 1}}},
"pack": {"type": "object", "additionalProperties": false, "required": ["id", "version", "manifestSha256", "capability", "scope", "preprocessing", "artifacts"], "properties": {"id": {"$ref": "#/$defs/id"}, "version": {"type": "string", "maxLength": 64}, "manifestSha256": {"$ref": "#/$defs/sha"}, "capability": {"type": "string", "maxLength": 120}, "scope": {"enum": ["deployment", "research-restricted"]}, "preprocessing": {"type": "string", "maxLength": 160}, "artifacts": {"type": "array", "maxItems": 32, "items": {"$ref": "#/$defs/sha"}}}},
"qualificationAttestationSha256": {"$ref": "#/$defs/sha"}, "status": {"enum": ["completed", "partial", "abstained", "unsupported", "failed"]},
"researchOnly": {"const": true}, "notDiagnostic": {"const": true}, "reviewRequired": {"const": true},
"coordinates": {"type": "object", "additionalProperties": false, "required": ["space", "originX", "originY", "scaleX", "scaleY"], "properties": {"space": {"const": "source-pixel"}, "originX": {"type": "number", "minimum": 0}, "originY": {"type": "number", "minimum": 0}, "scaleX": {"type": "number", "exclusiveMinimum": 0}, "scaleY": {"type": "number", "exclusiveMinimum": 0}}},
"regions": {"type": "array", "maxItems": 1000, "items": {"$ref": "#/$defs/region"}},
"cellInstances": {"type": "array", "maxItems": 100000, "items": {"type": "object", "additionalProperties": false, "required": ["id", "regionId", "maskEncoding", "mask", "areaPx2", "perimeterPx", "eccentricity", "solidity", "meanIntensity", "uncertainty", "category"], "properties": {"id": {"$ref": "#/$defs/id"}, "regionId": {"$ref": "#/$defs/id"}, "maskEncoding": {"enum": ["polygon", "rle"]}, "mask": {"type": "array", "minItems": 3, "maxItems": 4096, "items": {"type": "number", "minimum": 0}}, "areaPx2": {"type": "number", "minimum": 0}, "perimeterPx": {"type": "number", "minimum": 0}, "eccentricity": {"type": "number", "minimum": 0, "maximum": 1}, "solidity": {"type": "number", "minimum": 0, "maximum": 1}, "meanIntensity": {"type": "number", "minimum": 0, "maximum": 1}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "category": {"enum": ["unclassified", "model-category-1", "model-category-2", "model-category-3", "model-category-4", "model-category-5"]}}}},
"cellAggregates": {"type": "array", "maxItems": 1000, "items": {"type": "object", "additionalProperties": false, "required": ["regionId", "algorithm", "count", "densityPerMm2", "distributions", "uncertainty", "qc"], "properties": {"regionId": {"$ref": "#/$defs/id"}, "algorithm": {"enum": ["hovernet-fast", "pathosam", "od-watershed"]}, "count": {"type": "integer", "minimum": 0}, "densityPerMm2": {"type": ["number", "null"], "minimum": 0}, "distributions": {"type": "object"}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "qc": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 200}}}}},
"ihcDescriptors": {"type": "array", "maxItems": 1000, "items": {"$ref": "#/$defs/stainDescriptor"}},
"specialStainDescriptors": {"type": "array", "maxItems": 1000, "items": {"$ref": "#/$defs/stainDescriptor"}},
"cytologyDescriptors": {"type": "array", "maxItems": 1000, "items": {"$ref": "#/$defs/stainDescriptor"}},
"citations": {"type": "array", "maxItems": 100, "items": {"type": "object", "additionalProperties": false, "required": ["claimId", "sourceUrl"], "properties": {"claimId": {"$ref": "#/$defs/id"}, "sourceUrl": {"type": "string", "format": "uri", "maxLength": 1000}}}},
"qc": {"type": "object", "additionalProperties": false, "required": ["focus", "tissueFraction", "uncertainty", "abstentionReasons", "warnings"], "properties": {"focus": {"type": "number", "minimum": 0, "maximum": 1}, "tissueFraction": {"type": "number", "minimum": 0, "maximum": 1}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "abstentionReasons": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 500}}, "warnings": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 500}}}},
"provenance": {"type": "object", "additionalProperties": false, "required": ["createdAt", "codeRevision", "offlineAnalysis", "campaignId"], "properties": {"createdAt": {"type": "string", "format": "date-time"}, "codeRevision": {"type": "string", "maxLength": 160}, "offlineAnalysis": {"const": true}, "campaignId": {"type": ["string", "null"], "maxLength": 120}}},
"manifestSha256": {"$ref": "#/$defs/sha"}, "signature": {"$ref": "#/$defs/signature"}
},
"$defs": {
"id": {"type": "string", "pattern": "^[A-Za-z0-9._-]{1,160}$"}, "sha": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"region": {"type": "object", "additionalProperties": false, "required": ["id", "stage", "kind", "reviewStatus", "x", "y", "width", "height", "score"], "properties": {"id": {"$ref": "#/$defs/id"}, "stage": {"enum": ["coarse", "refined"]}, "kind": {"enum": ["support", "similar", "contrast", "analysis", "tumor-compartment", "immune-compartment"]}, "reviewStatus": {"enum": ["unreviewed", "faculty-authored", "faculty-approved"]}, "x": {"type": "number", "minimum": 0}, "y": {"type": "number", "minimum": 0}, "width": {"type": "number", "exclusiveMinimum": 0}, "height": {"type": "number", "exclusiveMinimum": 0}, "score": {"type": "number", "minimum": 0, "maximum": 1}, "thumbnail": {"type": "string", "pattern": "^thumbnails/[A-Za-z0-9._-]+\\.(png|jpg|webp)$"}}},
"stainDescriptor": {"type": "object", "additionalProperties": false, "required": ["regionId", "stainId", "markerId", "analysisMode", "cellMaskSource", "compartmentSource", "calibrationStatus", "measurements", "qc", "uncertainty", "abstentionReason", "researchEstimate"], "properties": {"regionId": {"$ref": "#/$defs/id"}, "stainId": {"enum": ["ihc_dab", "pas", "pas_d", "trichrome", "gms", "afb", "papanicolaou", "generic_brightfield"]}, "markerId": {"enum": ["generic", "er", "pr", "ki-67", "her2", "pd-l1", "none"]}, "analysisMode": {"enum": ["marker-aware", "generic-fallback", "generic-descriptive", "special-stain-descriptive", "cytology-descriptive"]}, "cellMaskSource": {"enum": ["hovernet-fast", "pathosam", "od-watershed", "none"]}, "compartmentSource": {"enum": ["none", "faculty-authored", "faculty-approved", "model-suggested"]}, "calibrationStatus": {"enum": ["calibrated", "relative_only", "not_evaluable"]}, "measurements": {"type": "object"}, "qc": {"type": "array", "maxItems": 20, "items": {"type": "string", "maxLength": 200}}, "uncertainty": {"type": "number", "minimum": 0, "maximum": 1}, "abstentionReason": {"type": ["string", "null"], "maxLength": 500}, "researchEstimate": {"const": true}}},
"signature": {"type": "object", "additionalProperties": false, "required": ["algorithm", "keyId", "value"], "properties": {"algorithm": {"const": "Ed25519"}, "keyId": {"$ref": "#/$defs/sha"}, "value": {"type": "string", "minLength": 1, "maxLength": 1000}}}
}
}
Loading
Loading