Harden bridge author metadata provenance#43
Draft
mike-remakerdigital wants to merge 1 commit into
Draft
Conversation
| verdict_path = project_root / verdict_rel_path | ||
| try: | ||
| verdict_path.unlink() | ||
| except FileNotFoundError: |
🧪 Test & Coverage Report
Lowest Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR isolates the verified WI-4938/WI-4939/WI-4940 bridge author-metadata fixes onto a clean
origin/mainbranch.Outage Root Cause
Bridge status-bearing artifacts could be written or accepted with missing, synthetic, or non-unique author provenance. The OpenRouter and Ollama harness paths propagated placeholder session IDs such as
openrouter-harness-fandollama-harness-d, while the bridge writer/finalizer and compliance hook did not consistently reject those placeholders before artifacts reached disk. The new audit scanner confirms there is also a legacy population of bridge files with missing or weak metadata that needs to remain visible during future cleanup.Hardening Changes
scripts/bridge_author_metadata.py..claude/hooks/bridge-compliance-gate.py,groundtruth-kb/templates/hooks/bridge-compliance-gate.py,scripts/gtkb_bridge_writer.py, and.claude/skills/verify/helpers/write_verdict.py.current_specificationstables without atypecolumn.Audit Coverage Added
scripts/bridge_metadata_audit.pyandgt bridge audit metadatafor deterministic read-only bridge metadata auditing.Verification
python -m ruff check scripts/bridge_metadata_audit.py platform_tests/scripts/test_bridge_metadata_audit.py groundtruth-kb/src/groundtruth_kb/cli.pypython -m ruff format --check scripts/bridge_metadata_audit.py platform_tests/scripts/test_bridge_metadata_audit.py groundtruth-kb/src/groundtruth_kb/cli.pypython -m pytest platform_tests/scripts/test_bridge_metadata_audit.py -q --no-header -v --basetemp work/pytest-wi4938- 4 passedgt bridge audit metadata --json- completed successfully; 877 artifacts scannedpython -m ruff check scripts/bridge_author_metadata.py scripts/openrouter_harness.py scripts/ollama_harness.py platform_tests/scripts/test_bridge_author_metadata.pypython -m ruff format --check scripts/bridge_author_metadata.py scripts/openrouter_harness.py scripts/ollama_harness.py platform_tests/scripts/test_bridge_author_metadata.pypython -m pytest platform_tests/scripts/test_bridge_author_metadata.py platform_tests/scripts/test_openrouter_harness.py platform_tests/scripts/test_ollama_harness.py -q --no-header --basetemp work/pytest-wi4939- 56 passedpython scripts/bridge_applicability_preflight.py --bridge-id gtkb-wi4940-bridge-metadata-write-time-enforcementpython scripts/adr_dcl_clause_preflight.py --bridge-id gtkb-wi4940-bridge-metadata-write-time-enforcementpython -m ruff check groundtruth-kb/templates/hooks/bridge-compliance-gate.py .claude/hooks/bridge-compliance-gate.py scripts/gtkb_bridge_writer.py .claude/skills/verify/helpers/write_verdict.py scripts/bridge_applicability_preflight.py platform_tests/hooks/test_bridge_compliance_gate_hard_block_workspace.py platform_tests/scripts/test_codex_bridge_compliance_gate.pypython -m ruff format --check groundtruth-kb/templates/hooks/bridge-compliance-gate.py .claude/hooks/bridge-compliance-gate.py scripts/gtkb_bridge_writer.py .claude/skills/verify/helpers/write_verdict.py scripts/bridge_applicability_preflight.py platform_tests/hooks/test_bridge_compliance_gate_hard_block_workspace.py platform_tests/scripts/test_codex_bridge_compliance_gate.pypython -m py_compile groundtruth-kb/templates/hooks/bridge-compliance-gate.py .claude/hooks/bridge-compliance-gate.py scripts/gtkb_bridge_writer.py .claude/skills/verify/helpers/write_verdict.py scripts/bridge_applicability_preflight.pypython -m pytest platform_tests/hooks/test_bridge_compliance_gate_hard_block_workspace.py -q --timeout=120 --basetemp work/pytest-wi4940-hooks- 16 passedpython -m pytest platform_tests/scripts/test_codex_bridge_compliance_gate.py -vv --timeout=120 --basetemp work/pytest-wi4940-codex- 7 passedscripts/check_dev_environment_inventory_drift.py --staged --allow-review-evidence --jsongit diff --cached --check