You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Story: ENFORCE — check_gitignore_baseline at error severity via the compliance engine #799
ENFORCE — harden the compliance check to error/blocking via the existing compliance engine
Blocked by STORY1 (needs the BEGIN/END markers to detect the block). Runs on the same weekly compliance-audit-and-improvement.yml engine — no new workflow.
Current gap
pp_check_gitignore_secrets_block() in scripts/lib/push-protection.sh verifies only 3 substrings (.env, *.pem, *.key) at warning severity. A repo can be missing 390 baseline lines and still pass.
Deliverables
New/upgraded check — check_gitignore_baseline (in compliance-audit.sh, or evolve the existing pp_check_gitignore_secrets_block):
Fetch repo .gitignore; locate the BEGIN … END petry-projects secrets baseline block.
Compare the block against the canonical block in .github/.gitignore (recommend a content hash of the marker span for a cheap exact-match; tolerate trailing-newline).
Severity = error (blocking tier), standard ref standards/gitignore-standard.md#….
Primary gate = error severity in the compliance engine (per decision + "leverage the compliance workflow"). Optionally, for a true PR-time gate, add a one-line assertion to the standard ci.yml so it becomes a required status check — flag if wanted; not required for this story.
Acceptance
check_gitignore_baseline reports error when the marker block is missing or drifted; passes when present + unmodified.
Repos with valid L2 extensions below END still pass.
Compliance-audit tests cover the four fixtures and are green.
Issue:#799 — Story: ENFORCE — check_gitignore_baseline at error severity via the compliance engine
Scope
Replace the weak 3-substring, warning-severity .gitignore check with a marker-block hash-drift check (pp_check_gitignore_baseline) that fires at error severity by comparing the repo's BEGIN … END petry-projects secrets baseline span against the org canonical block, leaving all L2 (below-END) entries free.
Extended compliance-audit-tests.yml to trigger on scripts/lib/**
Added 4 fixtures (compliant / missing-block / drifted / block-with-L2) as bats tests; updated the remediate routing test
Test Results
1..8
ok 1 compliant .gitignore (verbatim block) → no finding
ok 2 verbatim block with extra trailing newlines still passes (trailing-newline tolerant)
ok 3 no .gitignore at all → error finding
ok 4 .gitignore without the marker block → error finding
ok 5 block with an edited line inside the markers → drift error
ok 6 block with an extra line injected inside the markers → drift error
ok 7 verbatim block followed by L2 ecosystem/OS entries → no finding
ok 8 L2 re-adding a broad pattern below END does not trip the check (only the block is inspected)
# full suites tail:
ok 165 copilot-instructions-missing-language-links routes to the content-agent path
ok 166 applies PATCH to security_and_analysis for non_provider_patterns_enabled
ok 167 applies PATCH to security_and_analysis for secret_scanning_non_provider_patterns (legacy alias)
ok 168 dry-run does not call the GitHub API but records the planned change
ok 169 failed PATCH is reported as a failure
ok 170 non-remediated push-protection findings still hit the skip path
Also green: bash .dev-lead/scripts/dev-lead-lint.sh and shellcheck --severity=warning on the lib, audit, and remediate scripts.
Files Changed
scripts/lib/push-protection.sh: new baseline-block hash check at error severity; retired the weak 3-substring/warning path
scripts/compliance-remediate.sh: routing case renamed to gitignore_baseline
.github/workflows/compliance-audit-tests.yml: trigger on scripts/lib/**
test/scripts/compliance-audit/gitignore-baseline.bats: new (8 tests over the 4 fixtures)
test/scripts/compliance-remediate/routing-messages.bats: updated for the renamed check
Notes
Everything below the END marker is never inspected — verified by two L2-extension fixtures (including one that re-adds *.pem in L2). Trailing-newline tolerance verified. A missing/unreadable canonical .gitignore fails safe (fires a finding rather than silently passing every repo). The optional ci.yml PR-time assertion was left out as the issue marks it not-required — flag if wanted.
Activity
don-petry commentedon Jul 19, 2026
Part of Epic #801.
don-petry commentedon Jul 19, 2026
Dev-Lead Implementation Plan
Issue: #799 — Story: ENFORCE — check_gitignore_baseline at error severity via the compliance engine
Scope
Replace the weak 3-substring,
warning-severity.gitignorecheck with a marker-block hash-drift check (pp_check_gitignore_baseline) that fires aterrorseverity by comparing the repo'sBEGIN … END petry-projects secrets baselinespan against the org canonical block, leaving all L2 (below-END) entries free.Implementation Checklist
scripts/lib/push-protection.sh— add BEGIN/END marker constants, canonical-.gitignorepath,pp_extract_baseline_block+pp_sha256helpers, andpp_check_gitignore_baseline(findings: no.gitignore/ baseline block missing / baseline block drifted; severityerror; refstandards/gitignore-standard.md)scripts/lib/push-protection.sh— retirePP_REQUIRED_GITIGNORE_PATTERNS+pp_check_gitignore_secrets_block; call the new check frompp_run_all_checksscripts/compliance-remediate.sh— rename routing casegitignore_secrets_block→gitignore_baselinewith baseline-copy guidancestandards/gitignore-standard.md+standards/push-protection.md— update enforced-by / compliance-check / severity-table references.github/workflows/compliance-audit-tests.yml— trigger onscripts/lib/**and shellcheck the lib so the new check is gatedTests to Write
test/scripts/compliance-audit/gitignore-baseline.bats— four fixtures: compliant (pass), missing-block (error), drifted-block (error), block-present-with-L2-extensions (pass)test/scripts/compliance-remediate/routing-messages.batsto the renamedgitignore_baselinecheckTest Command
bats test/scripts/compliance-audit/ test/scripts/compliance-remediate/plusbash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jul 19, 2026
Dev-Lead: Implementation Complete
Plan Execution
pp_check_gitignore_baseline(marker-block SHA-256 drift check,errorseverity) +pp_extract_baseline_block/pp_sha256helpers inscripts/lib/push-protection.shPP_REQUIRED_GITIGNORE_PATTERNS+pp_check_gitignore_secrets_block; wired the new check intopp_run_all_checkspush-protection/gitignore_baselinewith baseline-copy guidancestandards/gitignore-standard.md(compliance-check section) +standards/push-protection.md(findings table:error)compliance-audit-tests.ymlto trigger onscripts/lib/**Test Results
Also green:
bash .dev-lead/scripts/dev-lead-lint.shandshellcheck --severity=warningon the lib, audit, and remediate scripts.Files Changed
scripts/lib/push-protection.sh: new baseline-block hash check aterrorseverity; retired the weak 3-substring/warningpathscripts/compliance-remediate.sh: routing case renamed togitignore_baselinestandards/gitignore-standard.md,standards/push-protection.md: docs + findings-table updates.github/workflows/compliance-audit-tests.yml: trigger onscripts/lib/**test/scripts/compliance-audit/gitignore-baseline.bats: new (8 tests over the 4 fixtures)test/scripts/compliance-remediate/routing-messages.bats: updated for the renamed checkNotes
*.pemin L2). Trailing-newline tolerance verified. A missing/unreadable canonical.gitignorefails safe (fires a finding rather than silently passing every repo). The optionalci.ymlPR-time assertion was left out as the issue marks it not-required — flag if wanted.feat: implement issue #799 — Story: ENFORCE — check_gitignore_baselin…