From cdc4308cdea4ce947c8d0e20b9d34b5528c17f71 Mon Sep 17 00:00:00 2001 From: saagpatel <269905221+saagpatel@users.noreply.github.com> Date: Sat, 5 Sep 2026 05:16:21 -0700 Subject: [PATCH 1/2] fix: ignore generated publication staging and backup files --- .gitignore | 3 +++ tests/test_producer_preflight.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 6074f74..df68296 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ output/.github-security-coverage-latest.json.lock output/.portfolio-truth-latest.json.lock # Local run output written by PortfolioCommandCenter before truth publication. output/pcc-auditor-run.log +# Staging and rollback copies of the generated JSON artifacts above. +output/tmp*.json.tmp +output/tmp*.json.bak # Generated private portfolio dumps written to the repo ROOT (chmod 600). The # output/*.md rule above does not cover root-level files, so name them explicitly # to keep a stray `git add -A` from committing private portfolio data. diff --git a/tests/test_producer_preflight.py b/tests/test_producer_preflight.py index 74e5944..5f41dab 100644 --- a/tests/test_producer_preflight.py +++ b/tests/test_producer_preflight.py @@ -73,6 +73,8 @@ def test_canonical_producer_fails_dirty_worktree(tmp_path: Path) -> None: def test_publication_runtime_files_preserve_clean_producer(tmp_path: Path) -> None: from github_repo_auditor.portfolio_truth_publish import ( _portfolio_truth_publication_lock, + _stage_bytes, + _stage_text, ) repo, _ = _repo(tmp_path) @@ -95,9 +97,13 @@ def test_publication_runtime_files_preserve_clean_producer(tmp_path: Path) -> No output.mkdir() (output / "pcc-auditor-run.log").write_text("running\n") with _portfolio_truth_publication_lock(output / "portfolio-truth-latest.json"): + staged = _stage_text(output / "portfolio-truth-latest.json", "{}\n") + backup = _stage_bytes(output / "project-registry.json", b"{}\n") verify_evidence_still_current(repo, result.evidence) verify_evidence_still_current(repo, result.evidence) assert (output / ".portfolio-truth-latest.json.lock").is_file() + assert staged.is_file() + assert backup.is_file() (output / "unexpected-source.py").write_text("changed = True\n") with pytest.raises(ValueError, match="worktree"): From 233c7f32be855c2b88fe17ab57fb4117421b390e Mon Sep 17 00:00:00 2001 From: saagpatel <269905221+saagpatel@users.noreply.github.com> Date: Sat, 5 Sep 2026 05:22:46 -0700 Subject: [PATCH 2/2] fix: cover Markdown compatibility publication stages --- .gitignore | 8 +++++++- tests/test_producer_preflight.py | 14 ++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index df68296..a90ddda 100644 --- a/.gitignore +++ b/.gitignore @@ -16,14 +16,20 @@ output/.github-security-coverage-latest.json.lock output/.portfolio-truth-latest.json.lock # Local run output written by PortfolioCommandCenter before truth publication. output/pcc-auditor-run.log -# Staging and rollback copies of the generated JSON artifacts above. +# Staging and rollback copies of the generated artifacts above. output/tmp*.json.tmp output/tmp*.json.bak +output/tmp*.md.tmp +output/tmp*.md.bak # Generated private portfolio dumps written to the repo ROOT (chmod 600). The # output/*.md rule above does not cover root-level files, so name them explicitly # to keep a stray `git add -A` from committing private portfolio data. /PORTFOLIO-AUDIT-REPORT.md /project-registry.md +/tmp*.project-registry.md.tmp +/tmp*.project-registry.md.bak +/tmp*.PORTFOLIO-AUDIT-REPORT.md.tmp +/tmp*.PORTFOLIO-AUDIT-REPORT.md.bak output/PORTFOLIO.md !output/.gitkeep config/notion-config.json diff --git a/tests/test_producer_preflight.py b/tests/test_producer_preflight.py index 5f41dab..2708307 100644 --- a/tests/test_producer_preflight.py +++ b/tests/test_producer_preflight.py @@ -97,13 +97,19 @@ def test_publication_runtime_files_preserve_clean_producer(tmp_path: Path) -> No output.mkdir() (output / "pcc-auditor-run.log").write_text("running\n") with _portfolio_truth_publication_lock(output / "portfolio-truth-latest.json"): - staged = _stage_text(output / "portfolio-truth-latest.json", "{}\n") - backup = _stage_bytes(output / "project-registry.json", b"{}\n") + targets = [ + output / "portfolio-truth-latest.json", + output / "project-registry.json", + output / "portfolio-truth-latest.md", + repo / "project-registry.md", + repo / "PORTFOLIO-AUDIT-REPORT.md", + ] + staged = [_stage_text(target, "{}\n") for target in targets] + backups = [_stage_bytes(target, b"{}\n") for target in targets] verify_evidence_still_current(repo, result.evidence) verify_evidence_still_current(repo, result.evidence) assert (output / ".portfolio-truth-latest.json.lock").is_file() - assert staged.is_file() - assert backup.is_file() + assert all(path.is_file() for path in staged + backups) (output / "unexpected-source.py").write_text("changed = True\n") with pytest.raises(ValueError, match="worktree"):