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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +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 artifacts above.
output/tmp*.json.tmp
output/tmp*.json.bak
Comment thread
saagpatel marked this conversation as resolved.
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
Expand Down
12 changes: 12 additions & 0 deletions tests/test_producer_preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -95,9 +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"):
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 all(path.is_file() for path in staged + backups)

(output / "unexpected-source.py").write_text("changed = True\n")
with pytest.raises(ValueError, match="worktree"):
Expand Down