MCPcopy
hub / github.com/github/awesome-copilot / check_file_existence

Function check_file_existence

skills/quality-playbook/quality_gate.py:756–826  ·  view source on GitHub ↗

File existence section (benchmark 40).

(repo_dir, q, strictness)

Source from the content-addressed store, hash-verified

754
755
756def check_file_existence(repo_dir, q, strictness):
757 """File existence section (benchmark 40)."""
758 print("[File Existence]")
759 for f in ["BUGS.md", "REQUIREMENTS.md", "QUALITY.md", "PROGRESS.md",
760 "COVERAGE_MATRIX.md", "COMPLETENESS_REPORT.md"]:
761 if (q / f).is_file():
762 pass_(f"{f} exists")
763 else:
764 fail(f"{f} missing")
765
766 for f in ["CONTRACTS.md", "RUN_CODE_REVIEW.md", "RUN_SPEC_AUDIT.md",
767 "RUN_INTEGRATION_TESTS.md", "RUN_TDD_TESTS.md"]:
768 if (q / f).is_file():
769 pass_(f"{f} exists")
770 else:
771 fail(f"{f} missing")
772
773 if has_file_matching(q, ["test_functional.*", "functional_test.*",
774 "FunctionalSpec.*", "FunctionalTest.*",
775 "functional.test.*"]):
776 pass_("functional test file exists")
777 else:
778 fail("functional test file missing (test_functional.*, functional_test.*, FunctionalSpec.*, FunctionalTest.*, functional.test.*)")
779
780 if (repo_dir / "AGENTS.md").is_file():
781 pass_("AGENTS.md exists")
782 else:
783 fail("AGENTS.md missing (required at project root)")
784
785 if (q / "EXPLORATION.md").is_file():
786 pass_("EXPLORATION.md exists")
787 _check_exploration_sections(q / "EXPLORATION.md")
788 else:
789 fail("EXPLORATION.md missing")
790
791 cr_dir = _resolve_artifact_path(q, "code_reviews")
792 if cr_dir.is_dir() and has_file_matching(cr_dir, ["*.md"]):
793 pass_("code_reviews/ has .md files")
794 else:
795 fail("code_reviews/ missing or empty")
796
797 sa_dir = _resolve_artifact_path(q, "spec_audits")
798 if sa_dir.is_dir():
799 triage_count = count_files_matching(sa_dir, "*triage*")
800 auditor_count = count_files_matching(sa_dir, "*auditor*")
801 if triage_count > 0:
802 pass_("spec_audits/ has triage file")
803 else:
804 fail("spec_audits/ missing triage file")
805 if auditor_count > 0:
806 pass_(f"spec_audits/ has {auditor_count} auditor file(s)")
807 else:
808 fail("spec_audits/ missing individual auditor files")
809
810 if triage_count > 0:
811 has_probes = False
812 if (sa_dir / "triage_probes.sh").is_file():
813 has_probes = True

Callers 1

check_repoFunction · 0.85

Calls 8

pass_Function · 0.85
failFunction · 0.85
has_file_matchingFunction · 0.85
_resolve_artifact_pathFunction · 0.85
count_files_matchingFunction · 0.85
file_containsFunction · 0.85
warnFunction · 0.70

Tested by

no test coverage detected