|
|
@@ -10,7 +10,7 @@ from pydantic import ValidationError
|
|
|
from script_build_host.domain.digests import Sha256Digest
|
|
|
from script_build_host.domain.errors import ProtocolViolation, UnsafeOutboundTarget
|
|
|
from script_build_host.infrastructure.canonical_json import canonical_json_text, canonical_sha256
|
|
|
-from script_build_host.infrastructure.config import ScriptBuildSettings
|
|
|
+from script_build_host.infrastructure.config import PROJECT_ROOT, ScriptBuildSettings
|
|
|
from script_build_host.infrastructure.outbound import OutboundPolicy
|
|
|
from script_build_host.infrastructure.redaction import redact, redact_text
|
|
|
|
|
|
@@ -83,6 +83,26 @@ def test_settings_hide_dsns_and_enforce_production_user_separation(tmp_path: Pat
|
|
|
)
|
|
|
|
|
|
|
|
|
+def test_settings_resolve_relative_paths_from_project_root(
|
|
|
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
|
+) -> None:
|
|
|
+ monkeypatch.chdir(tmp_path)
|
|
|
+ settings = _settings(
|
|
|
+ Path(".local/agent-data"),
|
|
|
+ persona_root=Path(".local/legacy-inputs/persona"),
|
|
|
+ section_pattern_root=Path(".local/legacy-inputs/sections"),
|
|
|
+ decode_index_root=Path(".local/legacy-inputs/decode/index"),
|
|
|
+ decode_raw_root=Path(".local/legacy-inputs/decode/raw"),
|
|
|
+ knowledge_root=Path(".local/legacy-inputs/knowledge/knowledge.json"),
|
|
|
+ prompt_fallback_root=Path("src/script_build_host/agents/prompts"),
|
|
|
+ )
|
|
|
+
|
|
|
+ assert settings.agent_data_root == PROJECT_ROOT / ".local/agent-data"
|
|
|
+ assert settings.persona_root == PROJECT_ROOT / ".local/legacy-inputs/persona"
|
|
|
+ assert settings.decode_raw_root == PROJECT_ROOT / ".local/legacy-inputs/decode/raw"
|
|
|
+ assert settings.prompt_fallback_root == PROJECT_ROOT / "src/script_build_host/agents/prompts"
|
|
|
+
|
|
|
+
|
|
|
@pytest.mark.asyncio
|
|
|
async def test_outbound_policy_revalidates_dns_and_redirects() -> None:
|
|
|
calls: list[tuple[str, int]] = []
|