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
2 changes: 1 addition & 1 deletion app_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def profile_list_documents(self) -> list[dict]:
if documents.is_dir():
for path in sorted(documents.iterdir(), key=lambda item: item.name.lower()):
if path.is_file() and path.suffix.lower() in {".txt", ".md", ".markdown", ".json"} \
and not path.name.lower().endswith(".pdf.txt"):
and not path.name.lower().endswith((".pdf.txt", ".pdf.links.json")):
text_documents.append({
"name": path.name,
"path": f"documents/{path.name}",
Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def _verify_bundle() -> None:
raise SystemExit("missing bundled Persona UI")
if not (root / "scanner" / "linkedin_scan.py").is_file():
raise SystemExit("missing bundled scanner script")
if not (root / "schemas" / "profile.schema.json").is_file():
raise SystemExit("missing bundled profile schema")
if not (root / "ms-playwright").is_dir():
raise SystemExit("missing bundled Playwright browsers")
browser_path = os.environ.get("PLAYWRIGHT_BROWSERS_PATH")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "persona"
version = "0.1.4"
version = "0.1.5"
description = "Persona - a Spiritus application for profile, job tracking, and tailored applications"
requires-python = ">=3.11"
dependencies = [
Expand Down
3 changes: 2 additions & 1 deletion spiritus.bundle.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ platforms = ["windows", "macos"]
entrypoint = "main.py"
name = "Persona"
app_id = "persona"
version = "0.1.4"
version = "0.1.5"
console = false
bundle_identifier = "com.dekode.persona"

datas = [
"ui=ui",
"schemas=schemas",
"opencode.json=.",
"spiritus.bundle.toml=.",
"scanner/linkedin_scan.py=scanner",
Expand Down
18 changes: 18 additions & 0 deletions tests/test_profile_import_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import os
import tempfile
import tomllib
import unittest
from pathlib import Path
from unittest.mock import patch
Expand Down Expand Up @@ -92,6 +93,23 @@ def test_pdf_import_uses_profile_operation_and_schema(self) -> None:
self.assertEqual(client.body["format"]["type"], "json_schema")
self.assertEqual(client.body["format"]["schema"]["title"], "Candidate Profile (v2)")

def test_pdf_link_sidecar_is_private_from_document_listing(self) -> None:
bridge, _ = self._bridge(_empty_profile())
documents = self.root / "workspace" / "documents"
documents.mkdir(parents=True, exist_ok=True)
(documents / "resume.pdf").write_bytes(b"%PDF-test")
(documents / "resume.pdf.txt").write_text("Resume text", encoding="utf-8")
(documents / "resume.pdf.links.json").write_text("[]", encoding="utf-8")
(documents / "notes.json").write_text("{}", encoding="utf-8")

names = [item["name"] for item in bridge.profile_list_documents()]

self.assertEqual(names, ["notes.json", "resume.pdf"])

def test_profile_schema_is_declared_as_a_bundle_resource(self) -> None:
spec = tomllib.loads(Path("spiritus.bundle.toml").read_text(encoding="utf-8"))
self.assertIn("schemas=schemas", spec["datas"])

def test_schema_failure_is_a_durable_profile_diagnostic(self) -> None:
near_miss = _empty_profile()
near_miss["skill_buckets"] = [{"name": "Tools", "skills": ["Python"]}]
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading