From 28e7a919c3404531e833a1c92b1567c1ef499077 Mon Sep 17 00:00:00 2001 From: Dekode1859 Date: Sun, 16 Aug 2026 00:30:13 +0530 Subject: [PATCH 1/2] fix: keep PDF metadata private and bundle the profile schema - Hide PDF link sidecars from the user-facing document list. - Include schemas/profile.schema.json in installed Persona resources. - Fail bundle smoke verification when the profile schema is missing. - Add regression coverage for sidecar visibility and schema packaging. --- app_bridge.py | 2 +- main.py | 2 ++ spiritus.bundle.toml | 1 + tests/test_profile_import_runs.py | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app_bridge.py b/app_bridge.py index 3e4e6c4..295a633 100644 --- a/app_bridge.py +++ b/app_bridge.py @@ -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}", diff --git a/main.py b/main.py index 038121d..195e76a 100644 --- a/main.py +++ b/main.py @@ -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") diff --git a/spiritus.bundle.toml b/spiritus.bundle.toml index bfeda38..850fe41 100644 --- a/spiritus.bundle.toml +++ b/spiritus.bundle.toml @@ -10,6 +10,7 @@ bundle_identifier = "com.dekode.persona" datas = [ "ui=ui", + "schemas=schemas", "opencode.json=.", "spiritus.bundle.toml=.", "scanner/linkedin_scan.py=scanner", diff --git a/tests/test_profile_import_runs.py b/tests/test_profile_import_runs.py index f9c12ed..0ae7873 100644 --- a/tests/test_profile_import_runs.py +++ b/tests/test_profile_import_runs.py @@ -4,6 +4,7 @@ import json import os import tempfile +import tomllib import unittest from pathlib import Path from unittest.mock import patch @@ -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"]}] From 27e252610d9a58f71271fa15e22348efdb0acd76 Mon Sep 17 00:00:00 2001 From: Dekode1859 Date: Sun, 16 Aug 2026 00:31:13 +0530 Subject: [PATCH 2/2] fix: release the installed PDF import packaging fix - Bump Persona to 0.1.5 so updated installers can receive the correction. - Keep the profile schema and private PDF metadata fixes in the release build. --- pyproject.toml | 2 +- spiritus.bundle.toml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index df9a1aa..6628c85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/spiritus.bundle.toml b/spiritus.bundle.toml index 850fe41..cf130d1 100644 --- a/spiritus.bundle.toml +++ b/spiritus.bundle.toml @@ -4,7 +4,7 @@ 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" diff --git a/uv.lock b/uv.lock index fccd1bf..a5ca53e 100644 --- a/uv.lock +++ b/uv.lock @@ -312,7 +312,7 @@ wheels = [ [[package]] name = "persona" -version = "0.1.4" +version = "0.1.5" source = { virtual = "." } dependencies = [ { name = "jsonschema" },