Skip to content

feat(detectors): changelog detector + hardened secret scan (lock-file + TOCTOU safety) - #2

Open
raofal-msodeh wants to merge 1 commit into
Alqudimi:mainfrom
raofal-msodeh:feat/changelog-detector-secret-bounds
Open

raofal-msodeh wants to merge 1 commit into
Alqudimi:mainfrom
raofal-msodeh:feat/changelog-detector-secret-bounds

Conversation

@raofal-msodeh

Copy link
Copy Markdown

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 changelog detector (shipwright_core/detectors.py)

  • Looks for CHANGELOG.md, CHANGELOG.txt, CHANGELOG, changelog.md, or docs/CHANGELOG.md following the keep-a-changelog convention.
  • VERIFIED when present (evidence source is the detected file); ATTENTION with a remediation hint when missing.
  • Registers in DEFAULT_DETECTORS alongside the existing seven signals.
  • Reads only file presence, consistent with the security model of never executing repository code.

2. Secret-hygiene scan hardening

  • Lock-file exclusion. 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) are now skipped by name, not just by extension. This matters because this repository ships a pnpm-lock.yaml; before this change, generated artifact content could produce a false BLOCKED verdict against a contributor who never authored those strings.
  • TOCTOU tolerance. path.is_file(), stat(), and read_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.py covers the presence/absence paths, the docs/ 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 new changelog check id. The shared fixture in tests/test_shipwright.py now emits a CHANGELOG.md so the readiness and gate contracts still hold after the new detector joined the default set.

Full suite result: 92.86% coverage (requirement: 85%), ruff clean, mypy clean 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-hygiene scan 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

  • Follows the Evidence Ledger design (deterministic, no code execution)
  • Conventional commits (feat(...), docs)
  • Fixture-based regression tests added for the new detector
  • All tests, ruff, and mypy pass

- 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>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8952a529-66bf-482d-b783-ed5c8bbd8a7f


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant