Skip to content

feat(xtask): add advisory doc-contract checker#251

Merged
EffortlessSteven merged 1 commit into
mainfrom
feat/doc-contract-checker
May 13, 2026
Merged

feat(xtask): add advisory doc-contract checker#251
EffortlessSteven merged 1 commit into
mainfrom
feat/doc-contract-checker

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • add cargo xtask check-doc-contracts --mode advisory
  • validate source-of-truth document headers, IDs, statuses, linked files, and active goal references
  • write target/policy/doc-contracts-report.md and target/policy/doc-contracts-report.json
  • keep policy-report integration and CI wiring out of this PR

Validation

  • cargo check -p xtask --locked
  • cargo test -p xtask --locked
  • cargo xtask check-doc-contracts --mode advisory
  • cargo xtask check-doc-contracts --mode blocking-allowlist
  • cargo xtask policy-report
  • cargo xtask check-file-policy --mode blocking-allowlist
  • cargo fmt --all -- --check
  • cargo clippy -p xtask --all-targets --locked -- -D warnings
  • git diff --cached --check

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 44 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bca5ec1d-90d5-455d-bae4-b85230d68d2e

📥 Commits

Reviewing files that changed from the base of the PR and between 70ded99 and ab26559.

📒 Files selected for processing (2)
  • xtask/src/doc_contracts.rs
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/doc-contract-checker

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.

@factory-droid

factory-droid Bot commented May 13, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Droid review complete.

Validation summary:

  • 2 candidates processed
  • 1 approved (P1: format string panic in id_mismatch)
  • 1 rejected (P2: backtick inconsistency — incorrect premise)

No security findings.

View batched review

Comment on lines +250 to +253

if let Some(expected_id) = expected_id(document)
&& title_id(title) != Some(expected_id.as_str())
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Missing argument in format string causes runtime panic

The error message in the id_mismatch finding uses a format string with two placeholders ({expected_id} and {}) but only provides one positional argument. When title is None, the second placeholder receives no value, triggering a panic at runtime. This code path is reachable whenever a document's filename ID does not match its title — a common case during document authoring.

Suggested change
if let Some(expected_id) = expected_id(document)
&& title_id(title) != Some(expected_id.as_str())
{
message: format!(
"filename ID `{}` does not match title `{}`",
expected_id,
title.unwrap_or("<missing title>")
),

@EffortlessSteven EffortlessSteven merged commit d689236 into main May 13, 2026
26 checks passed
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