This commit is contained in:
LASTA_DEV01\lasta
2026-05-19 20:31:52 +09:00
parent 00407e7a08
commit e260e5f218
104 changed files with 12898 additions and 1709 deletions

View File

@@ -58,10 +58,11 @@ class Phase(IntEnum):
BASE = 0 # OntoCast only, filesystem storage
TRAFILATURA = 1
CRAWL4AI = 2
GUARDRAILS = 3
NEO4J_GRAPHRAG = 4
MULTI_AGENT = 5
CANDIDATE_REVIEW = 2
CRAWL4AI = 3
GUARDRAILS = 4
NEO4J_GRAPHRAG = 5
MULTI_AGENT = 6
StorageBackend = Literal["filesystem", "fuseki", "neo4j"]
@@ -94,6 +95,10 @@ class PlatformSettings(BaseSettings):
"regardless of any Neo4j/Fuseki credentials in the environment."
),
)
database_url: str = Field(
default="sqlite:///./data/ontology_platform.db",
description="SQLAlchemy database URL for Phase 2 candidate/review storage.",
)
# ─── Paths (mirror ONTOCAST_* but with platform defaults) ────────
working_directory: Path = Field(
@@ -116,12 +121,24 @@ class PlatformSettings(BaseSettings):
default="respect",
description="robots.txt 준수 정책. Phase 2 Crawl4AI 통합에서 사용.",
)
crawler_default_profile: Literal[
"fast_static",
"dynamic_page",
"full_capture",
"structured_extract",
"deep_discovery",
] = Field(default="fast_static")
crawler_cache_policy: Literal["enabled", "disabled", "bypass"] = Field(default="enabled")
crawler_max_pages: int = Field(default=50, ge=1, le=50)
crawler_max_depth: int = Field(default=1, ge=0, le=5)
text2cypher_result_limit: int = Field(default=100, ge=1, le=1000)
graph_search_result_limit: int = Field(default=20, ge=1, le=100)
daily_llm_call_limit: int = Field(default=10_000)
daily_llm_token_limit: int = Field(default=10_000_000)
# ─── Phase 0 enforcement ─────────────────────────────────────────
@model_validator(mode="after")
def _enforce_phase_storage_consistency(self) -> "PlatformSettings":
def _enforce_phase_storage_consistency(self) -> PlatformSettings:
"""Phase 0 forces filesystem; later phases may opt into other backends.
Anything other than 'filesystem' before Phase 4 is treated as a
@@ -130,7 +147,8 @@ class PlatformSettings(BaseSettings):
"""
if self.phase < Phase.NEO4J_GRAPHRAG and self.storage_backend != "filesystem":
raise ValueError(
f"storage_backend={self.storage_backend!r} requires Phase 4+, "
f"storage_backend={self.storage_backend!r} requires Phase 4+/Phase 5+ "
f"(Phase 5 in the current roadmap), "
f"but PHASE={int(self.phase)}. See docs/통합설계서.md §5."
)
# Ensure working directory exists for filesystem mode.
@@ -248,10 +266,10 @@ def load_settings() -> PlatformSettings:
# Provider-grade LLM/embedding config helpers can be added in later phases.
# For Phase 0, OntoCast's own ``LLMConfig`` is sufficient.
__all__ = [
"LLMConfig",
"Phase",
"PlatformSettings",
"StorageBackend",
"build_ontocast_config",
"load_settings",
"LLMConfig",
]