Repository navigation
feat(detectors): changelog detector + hardened secret scan (lock-file + TOCTOU safety) - #2
Open
raofal-msodeh wants to merge 1 commit into
Conversation
- Add a changelog detector that verifies the presence of a CHANGELOG file (CHANGELOG.md, CHANGELOG.txt, docs/CHANGELOG.md, ...) and emits an attention finding with keep-a-changelog remediation when missing. - Skip machine-generated dependency lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock, Gemfile.lock, composer.lock, Cargo.lock, go.sum, uv.lock) in the secret-hygiene scan so artifact content never flags contributor hygiene. - Tolerate time-of-check/time-of-use races in the secret scan: file enumeration failures are handled without crashing the audit. - Update the shared test fixture and add fixture-based regression tests covering presence/absence paths, docs subdirectory, lock-file exclusion, secret detection in contributor code, and a simulated TOCTOU vanishing entry. - Refresh README (signal table + roadmap) and CHANGELOG (Unreleased). Co-authored-by: Manus <agent@manus.im>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What this PR adds
Shipwright inspects repositories as untrusted input and turns the evidence it finds into a deterministic release-readiness verdict. This PR extends the evidence ledger in two ways: a release-metadata signal that has been on the roadmap, and a set of hardening fixes for the secret-hygiene scan discovered while writing its fixture-based tests.
1. New
changelogdetector (shipwright_core/detectors.py)CHANGELOG.md,CHANGELOG.txt,CHANGELOG,changelog.md, ordocs/CHANGELOG.mdfollowing the keep-a-changelog convention.VERIFIEDwhen present (evidence source is the detected file);ATTENTIONwith a remediation hint when missing.DEFAULT_DETECTORSalongside the existing seven signals.2. Secret-hygiene scan hardening
package-lock.json,yarn.lock,pnpm-lock.yaml,poetry.lock,Gemfile.lock,composer.lock,Cargo.lock,go.sum,uv.lock) are now skipped by name, not just by extension. This matters because this repository ships apnpm-lock.yaml; before this change, generated artifact content could produce a false BLOCKED verdict against a contributor who never authored those strings.path.is_file(),stat(), andread_text()failures (entries that vanish between enumeration and inspection) are now skipped instead of crashing the audit, so concurrent filesystem activity cannot break a release check.3. Tests
tests/test_changelog_and_secret_hardening.pycovers the presence/absence paths, thedocs/subdirectory, lock-file exclusion with deliberately secret-looking content, genuine secret detection in contributor code, a simulated TOCTOU vanishing entry, and the JSON audit contract including the newchangelogcheck id. The shared fixture intests/test_shipwright.pynow emits aCHANGELOG.mdso the readiness and gate contracts still hold after the new detector joined the default set.Full suite result: 92.86% coverage (requirement: 85%),
ruffclean,mypyclean on 9 source files, and the SARIF renderer contract (version,rules,uriBaseId) still passes.4. Documentation
README.md: Release metadata signal added to the evidence table; roadmap sharpened to changelog content-structure detection.CHANGELOG.md: new[Unreleased]section documenting both additions.Why it matters
The existing
secret-hygienescan could false-positive on any project whose lock file happens to contain a secret-shaped string, and it could crash on transient filesystem states — both undermine the deterministic-verdict contract Shipwright is built around. The changelog detector closes the last roadmap item about release metadata without adding any execution risk, and it gives maintainers an explicit, evidence-backed nudge to keep a written release history.Checklist
feat(...),docs)ruff, andmypypass