Skip to content

feat: implement structured extraction checkpoints B1 and B2#912

Draft
Abhijeet2409 wants to merge 2 commits into
OWASP:mainfrom
Abhijeet2409:feature/structured-extraction-b1-b2
Draft

feat: implement structured extraction checkpoints B1 and B2#912
Abhijeet2409 wants to merge 2 commits into
OWASP:mainfrom
Abhijeet2409:feature/structured-extraction-b1-b2

Conversation

@Abhijeet2409
Copy link
Copy Markdown

@Abhijeet2409 Abhijeet2409 commented May 31, 2026

This PR implements Workstream B checkpoints B1 and B2 from the OWASP Cheat Sheet to CRE Mapping pipeline RFC.

Added

1. cheatsheet_defs.py

Adds the CheatsheetRecord dataclass and validation logic required by Checkpoint B1.

The implementation validates the RFC contract for:

  • required string fields
  • list[str] fields
  • metadata fields
  • summary normalization and length bounds

2. cheatsheet_extractor.py

Adds the extract_cheatsheet_record() implementation required by Checkpoint B2.

The extractor performs deterministic extraction of:

  • source ID
  • title
  • canonical hyperlink
  • headings
  • summary
  • parser metadata

The implementation follows the structured extraction requirements defined in the RFC and returns a typed CheatsheetRecord.

Notes

This PR covers the primary extraction path (B1/B2) and assumes well-formed OWASP Cheat Sheet markdown as described in the RFC.

Fallback handling for missing titles, irregular markdown structures, and other malformed inputs is intentionally deferred to Checkpoint B3.

Signed-off-by: Abhijeet Saharan <abhijeetsaharan2236@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 28a3e13b-5add-409a-8f4c-8080842e00a0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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