Skip to content

Commit 4586004

Browse files
refactor: rename CIS to Membrane everywhere (#10)
Renamed Content Immune System (CIS) to Membrane across: - Directory: src/qp_vault/cis/ -> src/qp_vault/membrane/ - Classes: CISPipeline -> MembranePipeline, CISStageRecord -> MembraneStageRecord, etc. - Enums: CISStage -> MembraneStage, CISResult -> MembraneResult - Events: CIS_SCAN -> MEMBRANE_SCAN, CIS_RELEASE -> MEMBRANE_RELEASE, CIS_FLAG -> MEMBRANE_FLAG - Tests: test_cis*.py -> test_membrane*.py - All comments, docstrings, and references Zero CIS references remaining. 518 tests passing. Lint clean.
1 parent cc3abee commit 4586004

15 files changed

+147
-147
lines changed

src/qp_vault/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232

3333
from qp_vault.enums import (
3434
AdversarialStatus,
35-
CISResult,
36-
CISStage,
3735
DataClassification,
3836
EventType,
3937
Lifecycle,
38+
MembraneResult,
39+
MembraneStage,
4040
MemoryLayer,
4141
ResourceStatus,
4242
ResourceType,
@@ -54,11 +54,11 @@
5454
)
5555
from qp_vault.models import (
5656
Chunk,
57-
CISPipelineStatus,
58-
CISStageRecord,
5957
Collection,
6058
ContentProvenance,
6159
HealthScore,
60+
MembranePipelineStatus,
61+
MembraneStageRecord,
6262
MerkleProof,
6363
Resource,
6464
SearchResult,
@@ -91,8 +91,8 @@
9191
"MerkleProof",
9292
"VaultEvent",
9393
"ContentProvenance",
94-
"CISStageRecord",
95-
"CISPipelineStatus",
94+
"MembraneStageRecord",
95+
"MembranePipelineStatus",
9696
# Enums
9797
"TrustTier",
9898
"DataClassification",
@@ -102,8 +102,8 @@
102102
"MemoryLayer",
103103
"EventType",
104104
"AdversarialStatus",
105-
"CISStage",
106-
"CISResult",
105+
"MembraneStage",
106+
"MembraneResult",
107107
"UploadMethod",
108108
# Protocols (for implementors)
109109
"StorageBackend",

src/qp_vault/cis/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/qp_vault/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class AdversarialStatus(StrEnum):
9191
"""Flagged by one or more Membrane stages. Multiplier: 0.3x."""
9292

9393

94-
class CISStage(StrEnum):
94+
class MembraneStage(StrEnum):
9595
"""Membrane pipeline stages."""
9696

9797
INGEST = "ingest"
@@ -119,7 +119,7 @@ class CISStage(StrEnum):
119119
"""Stage 8: Attack Pattern Registry feedback loop."""
120120

121121

122-
class CISResult(StrEnum):
122+
class MembraneResult(StrEnum):
123123
"""Result of a single Membrane stage evaluation."""
124124

125125
PASS = "pass" # nosec B105 — Membrane stage result, not a password
@@ -202,7 +202,7 @@ class EventType(StrEnum):
202202
SUPERSEDE = "supersede"
203203
VERIFY = "verify"
204204
SEARCH = "search"
205-
CIS_SCAN = "cis_scan"
206-
CIS_RELEASE = "cis_release"
207-
CIS_FLAG = "cis_flag"
205+
MEMBRANE_SCAN = "cis_scan"
206+
MEMBRANE_RELEASE = "cis_release"
207+
MEMBRANE_FLAG = "cis_flag"
208208
ADVERSARIAL_STATUS_CHANGE = "adversarial_status_change"

src/qp_vault/membrane/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2026 Quantum Pipes Technologies, LLC
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""Membrane: multi-stage content screening pipeline."""
5+
6+
from qp_vault.membrane.pipeline import MembranePipeline
7+
8+
__all__ = ["MembranePipeline"]
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import re
1414
from dataclasses import dataclass, field
1515

16-
from qp_vault.enums import CISResult, CISStage
17-
from qp_vault.models import CISStageRecord
16+
from qp_vault.enums import MembraneResult, MembraneStage
17+
from qp_vault.models import MembraneStageRecord
1818

1919
# Default blocklist patterns (prompt injection, jailbreak attempts, data exfiltration)
2020
DEFAULT_BLOCKLIST: list[str] = [
@@ -47,7 +47,7 @@ class InnateScanConfig:
4747
async def run_innate_scan(
4848
content: str,
4949
config: InnateScanConfig | None = None,
50-
) -> CISStageRecord:
50+
) -> MembraneStageRecord:
5151
"""Run innate scan on content.
5252
5353
Checks content against regex blocklist patterns.
@@ -57,7 +57,7 @@ async def run_innate_scan(
5757
config: Optional scan configuration.
5858
5959
Returns:
60-
CISStageRecord with PASS, FLAG, or FAIL result.
60+
MembraneStageRecord with PASS, FLAG, or FAIL result.
6161
"""
6262
if config is None:
6363
config = InnateScanConfig()
@@ -73,15 +73,15 @@ async def run_innate_scan(
7373
continue # Skip malformed patterns
7474

7575
if matches:
76-
return CISStageRecord(
77-
stage=CISStage.INNATE_SCAN,
78-
result=CISResult.FLAG,
76+
return MembraneStageRecord(
77+
stage=MembraneStage.INNATE_SCAN,
78+
result=MembraneResult.FLAG,
7979
matched_patterns=matches[:5],
8080
reasoning=f"Matched {len(matches)} blocklist patterns",
8181
)
8282

83-
return CISStageRecord(
84-
stage=CISStage.INNATE_SCAN,
85-
result=CISResult.PASS, # nosec B105 — CIS stage result, not a password
83+
return MembraneStageRecord(
84+
stage=MembraneStage.INNATE_SCAN,
85+
result=MembraneResult.PASS, # nosec B105 — Membrane stage result, not a password
8686
reasoning=f"Checked {len(config.blocklist_patterns)} patterns, none matched",
8787
)
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Copyright 2026 Quantum Pipes Technologies, LLC
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""CIS Pipeline: orchestrates multi-stage content screening.
4+
"""Membrane Pipeline: orchestrates multi-stage content screening.
55
6-
Runs content through the Content Immune System stages:
6+
Runs content through the Membrane stages:
77
1. INNATE_SCAN — pattern-based detection (regex, blocklists)
88
2. RELEASE — risk-proportionate gating decision
99
@@ -13,21 +13,21 @@
1313

1414
from __future__ import annotations
1515

16-
from qp_vault.cis.innate_scan import InnateScanConfig, run_innate_scan
17-
from qp_vault.cis.release_gate import evaluate_release
18-
from qp_vault.enums import CISResult, CISStage, ResourceStatus
19-
from qp_vault.models import CISPipelineStatus, CISStageRecord
16+
from qp_vault.enums import MembraneResult, MembraneStage, ResourceStatus
17+
from qp_vault.membrane.innate_scan import InnateScanConfig, run_innate_scan
18+
from qp_vault.membrane.release_gate import evaluate_release
19+
from qp_vault.models import MembranePipelineStatus, MembraneStageRecord
2020

2121

22-
class CISPipeline:
23-
"""Content Immune System pipeline.
22+
class MembranePipeline:
23+
"""Membrane pipeline.
2424
2525
Screens content through multiple stages before allowing indexing.
2626
Content that fails screening is quarantined.
2727
2828
Args:
2929
innate_config: Configuration for the innate scan stage.
30-
enabled: Whether CIS screening is active. Default True.
30+
enabled: Whether Membrane screening is active. Default True.
3131
"""
3232

3333
def __init__(
@@ -39,29 +39,29 @@ def __init__(
3939
self._innate_config = innate_config
4040
self._enabled = enabled
4141

42-
async def screen(self, content: str) -> CISPipelineStatus:
43-
"""Run content through the CIS pipeline.
42+
async def screen(self, content: str) -> MembranePipelineStatus:
43+
"""Run content through the Membrane pipeline.
4444
4545
Args:
4646
content: Text content to screen.
4747
4848
Returns:
49-
CISPipelineStatus with stage results and overall decision.
49+
MembranePipelineStatus with stage results and overall decision.
5050
"""
5151
if not self._enabled:
52-
return CISPipelineStatus(
52+
return MembranePipelineStatus(
5353
stages=[
54-
CISStageRecord(
55-
stage=CISStage.RELEASE,
56-
result=CISResult.PASS, # nosec B105
54+
MembraneStageRecord(
55+
stage=MembraneStage.RELEASE,
56+
result=MembraneResult.PASS, # nosec B105
5757
reasoning="Released: screening disabled",
5858
),
5959
],
60-
overall_result=CISResult.PASS, # nosec B105
60+
overall_result=MembraneResult.PASS, # nosec B105
6161
recommended_status=ResourceStatus.INDEXED,
6262
)
6363

64-
stages: list[CISStageRecord] = []
64+
stages: list[MembraneStageRecord] = []
6565

6666
# Stage 1: Innate scan
6767
innate_result = await run_innate_scan(content, self._innate_config)
@@ -73,12 +73,12 @@ async def screen(self, content: str) -> CISPipelineStatus:
7373

7474
# Determine overall result and recommended status
7575
overall = release_result.result
76-
if overall == CISResult.FAIL or overall == CISResult.FLAG:
76+
if overall == MembraneResult.FAIL or overall == MembraneResult.FLAG:
7777
status = ResourceStatus.QUARANTINED
7878
else:
7979
status = ResourceStatus.INDEXED
8080

81-
return CISPipelineStatus(
81+
return MembranePipelineStatus(
8282
stages=stages,
8383
overall_result=overall,
8484
recommended_status=status,
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
"""Release gate: risk-proportionate gating before indexing.
55
6-
Evaluates CIS stage results and decides whether content should be:
6+
Evaluates Membrane stage results and decides whether content should be:
77
- RELEASED (indexed normally)
88
- HELD (quarantined for human review)
99
- REJECTED (blocked from indexing)
1010
"""
1111

1212
from __future__ import annotations
1313

14-
from qp_vault.enums import CISResult, CISStage
15-
from qp_vault.models import CISStageRecord
14+
from qp_vault.enums import MembraneResult, MembraneStage
15+
from qp_vault.models import MembraneStageRecord
1616

1717

1818
async def evaluate_release(
19-
stage_records: list[CISStageRecord],
20-
) -> CISStageRecord:
19+
stage_records: list[MembraneStageRecord],
20+
) -> MembraneStageRecord:
2121
"""Evaluate whether content should be released for indexing.
2222
2323
Decision logic:
@@ -26,32 +26,32 @@ async def evaluate_release(
2626
- Otherwise: PASS (release)
2727
2828
Args:
29-
stage_records: Results from previous CIS stages.
29+
stage_records: Results from previous Membrane stages.
3030
3131
Returns:
32-
CISStageRecord for the RELEASE stage.
32+
MembraneStageRecord for the RELEASE stage.
3333
"""
34-
has_fail = any(r.result == CISResult.FAIL for r in stage_records)
35-
has_flag = any(r.result == CISResult.FLAG for r in stage_records)
34+
has_fail = any(r.result == MembraneResult.FAIL for r in stage_records)
35+
has_flag = any(r.result == MembraneResult.FLAG for r in stage_records)
3636

3737
if has_fail:
38-
failed = [r.stage.value for r in stage_records if r.result == CISResult.FAIL]
39-
return CISStageRecord(
40-
stage=CISStage.RELEASE,
41-
result=CISResult.FAIL,
38+
failed = [r.stage.value for r in stage_records if r.result == MembraneResult.FAIL]
39+
return MembraneStageRecord(
40+
stage=MembraneStage.RELEASE,
41+
result=MembraneResult.FAIL,
4242
reasoning=f"Rejected: {', '.join(failed)} failed",
4343
)
4444

4545
if has_flag:
46-
flagged = [r.stage.value for r in stage_records if r.result == CISResult.FLAG]
47-
return CISStageRecord(
48-
stage=CISStage.RELEASE,
49-
result=CISResult.FLAG,
46+
flagged = [r.stage.value for r in stage_records if r.result == MembraneResult.FLAG]
47+
return MembraneStageRecord(
48+
stage=MembraneStage.RELEASE,
49+
result=MembraneResult.FLAG,
5050
reasoning=f"Quarantined: {', '.join(flagged)} flagged",
5151
)
5252

53-
return CISStageRecord(
54-
stage=CISStage.RELEASE,
55-
result=CISResult.PASS, # nosec B105
53+
return MembraneStageRecord(
54+
stage=MembraneStage.RELEASE,
55+
result=MembraneResult.PASS, # nosec B105
5656
reasoning=f"Released: {len(stage_records)} stages passed",
5757
)

src/qp_vault/models.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
from qp_vault.enums import (
1111
AdversarialStatus,
12-
CISResult,
13-
CISStage,
1412
DataClassification,
1513
EventType,
1614
Lifecycle,
15+
MembraneResult,
16+
MembraneStage,
1717
MemoryLayer,
1818
ResourceStatus,
1919
ResourceType,
@@ -213,7 +213,7 @@ class ContentProvenance(BaseModel):
213213
created_at: datetime = Field(default_factory=_utcnow)
214214

215215

216-
class CISStageRecord(BaseModel):
216+
class MembraneStageRecord(BaseModel):
217217
"""Result of a single Membrane pipeline stage evaluation.
218218
219219
Every stage (INGEST through REMEMBER) creates one record per document.
@@ -222,8 +222,8 @@ class CISStageRecord(BaseModel):
222222

223223
id: str = ""
224224
resource_id: str = ""
225-
stage: CISStage = CISStage.INGEST
226-
result: CISResult = CISResult.PASS
225+
stage: MembraneStage = MembraneStage.INGEST
226+
result: MembraneResult = MembraneResult.PASS
227227
risk_score: float = 0.0
228228
reasoning: str = ""
229229
matched_patterns: list[str] = Field(default_factory=list)
@@ -232,17 +232,17 @@ class CISStageRecord(BaseModel):
232232
created_at: datetime = Field(default_factory=_utcnow)
233233

234234

235-
class CISPipelineStatus(BaseModel):
235+
class MembranePipelineStatus(BaseModel):
236236
"""Aggregate status of the Membrane pipeline for a single document."""
237237

238238
resource_id: str = ""
239-
stages: list[CISStageRecord] = Field(default_factory=list)
240-
stages_completed: list[CISStage] = Field(default_factory=list)
241-
stages_pending: list[CISStage] = Field(default_factory=list)
242-
overall_result: CISResult = CISResult.PASS
239+
stages: list[MembraneStageRecord] = Field(default_factory=list)
240+
stages_completed: list[MembraneStage] = Field(default_factory=list)
241+
stages_pending: list[MembraneStage] = Field(default_factory=list)
242+
overall_result: MembraneResult = MembraneResult.PASS
243243
recommended_status: ResourceStatus = ResourceStatus.INDEXED
244244
aggregate_risk_score: float = 0.0
245245
recommended_action: str = "pending"
246-
stage_results: list[CISStageRecord] = Field(default_factory=list)
246+
stage_results: list[MembraneStageRecord] = Field(default_factory=list)
247247
started_at: datetime | None = None
248248
completed_at: datetime | None = None

0 commit comments

Comments
 (0)