Skip to content

Treat date-like sequences as atomic inline fragments (#346) - #350

Merged
leynos merged 27 commits into
mainfrom
issue-346-treat-date-like-sequences-as-atomic-fragments
Jun 8, 2026
Merged

Treat date-like sequences as atomic inline fragments (#346)#350
leynos merged 27 commits into
mainfrom
issue-346-treat-date-like-sequences-as-atomic-fragments

Conversation

@lodyai

@lodyai lodyai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This branch treats common English date-like prose sequences as atomic inline fragments before wrap_first_fit receives them, so mdtablefix --wrap avoids splitting dates such as 25th December 2025 and July 4, 2008 across lines when they fit.

Closes #346.

Review walkthrough

Validation

  • cargo test --test wrap_unit dates: passed
  • make check-fmt: passed
  • make lint: passed
  • make test: passed
  • coderabbit review --agent: final pass completed with 0 findings

Summary by Sourcery

Treat common English date-like sequences as atomic inline fragments during wrapping to prevent them being split across lines.

Enhancements:

  • Add date sequence token matching and predicates for month names, days, and years to the inline wrapper.
  • Integrate date-sequence detection into token span determination so date runs (optionally with footnote refs) are wrapped as a single fragment.

Tests:

  • Add example-based and property-based tests ensuring date predicates and date-like wrapping behaviour preserve dates intact, handle punctuation and footnotes, and respect over-width and partial-date cases.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@lodyai[bot], we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c6583e67-78bc-4fa9-9292-ce18d2246701

📥 Commits

Reviewing files that changed from the base of the PR and between 6c36216 and 89f9076.

📒 Files selected for processing (3)
  • docs/developers-guide.md
  • src/wrap/inline.rs
  • src/wrap/inline/span_helpers.rs

Walkthrough

This PR extends the inline text-wrapping pipeline to recognise and preserve English date sequences (e.g., 25th December 2025, 19 March 2018, July 4, 2008) as atomic fragments. It adds date-component token predicates, a five-token sequence matcher, integrates the matcher into the span-grouping short-circuit path, provides extensive test coverage across unit/property/snapshot strategies, updates documentation and an ADR, and adds a Makefile typecheck target.

Changes

Date-sequence atomicity in text wrapping

Layer / File(s) Summary
Month names and token predicates
src/wrap/inline/month_names.rs, src/wrap/inline/predicates.rs
Add a canonical 23-entry month-name table and four new token classifiers: is_month_name (case-insensitive, with leading-punctuation stripping), is_ordinal_day, is_numeric_day (with optional trailing comma), and is_year (1000–2999 range). Broaden is_opening_punct to treat " and Unicode openers as strippable prefixes. Reorganise predicate tests into separate #[path = "..."] test modules.
Property-test strategies for dates
src/wrap/inline/date_strategies.rs, tests/wrap_unit/date_strategies.rs
Define boxed proptest strategies for month names with randomised casing, ordinal suffixes, ordinal and numeric days (with optional trailing commas), years (1000–2999), and composite three-variant date token sequences with literal " " separators. Re-export selected strategies for wrap unit test use.
Predicate property and tracing validation
src/wrap/inline/predicate_date_props.rs, src/wrap/inline/predicate_tracing_tests.rs
Add property and example tests for month/day/year classification; validate opener-punctuation stripping and case-insensitive matching; assert predicate instrumentation emits trace events at the expected log level.
Five-token date-sequence matcher
src/wrap/inline/span_helpers.rs
Extend imports with date-token classifiers and add try_match_date_sequence to detect three ordered day–month–year variants within a fixed five-token window (enforcing whitespace separators). Add date_token_span to compute combined display width and optionally couple a following footnote reference. Include property and tracing tests.
Inline span short-circuit integration
src/wrap/inline.rs
Wire the month_names module and date span helpers; update determine_token_span to call date_token_span first and return early on match (bypassing prior punctuation/link/code/footnote coupling); make build_fragments wrap-width-aware and log when a date group exceeds current wrap width; pass width through to build_fragments from wrap_preserving_code.
Wrap-text unit, property, and snapshot coverage
tests/wrap_unit/dates.rs, tests/wrap_unit/dates_prop.rs, tests/wrap/date_snapshots.rs
Add regression tests verifying date atomicity across ordinal, numeric, and month-first forms with punctuation/footnote adjacency; property tests for full-date containment, no-split-across-lines, content preservation, over-width fallback, monotonic line count, and partial-month+year rejection. Include snapshot-driven test cases.
Updated expected wrap fixtures
tests/data/wrap_renumber_regression_expected.txt
Adjust wrapped citation lines where "accessed on" and date tokens now break separately under the new date-grouping behaviour.
Docs, ADR, and release notes
docs/adrs/0003-date-sequences-as-inline-fragments.md, docs/developers-guide.md, docs/users-guide.md, README.md, CHANGELOG.md
Add an Accepted ADR (2026-06-08) documenting the date-sequence grouping contract, day/month/year patterns, fallback semantics, and TRACE-level observability. Update developer guide with ADR rationale, sequencing notes, API table references, and instrumented-function details. Update user guide and README to describe date-sequence handling. Record the change in the unreleased changelog.
Makefile typecheck target
Makefile
Add typecheck to .PHONY declarations and implement a target that runs cargo check --all-targets --all-features with build job parallelism for type-correctness feedback.

Possibly related PRs

  • leynos/mdtablefix#280: Modifies determine_token_span and footnote-coupling behaviour; main PR adds early date-span short-circuit that bypasses the prior footnote coupling loop.
  • leynos/mdtablefix#302: Changes determine_token_span span selection via atomic code-token and suffix rules; main PR similarly adds an early atomic-span short-circuit for dates.
  • leynos/mdtablefix#301: Adjusts determine_token_span and try_couple_footnote_reference ordering for code/link+footnote scenarios; main PR introduces an early date-span short-circuit that can bypass that coupling entirely.

Poem

📅 Five tokens dance in perfect stride,
Day, month, and year—now unified!
No longer split across the seam,
Dates wrap whole, a writer's dream.
Atomic prose, at last set free!


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 6 warnings)

Check name Status Explanation Resolution
Unit Architecture ❌ Error wrap_width parameter in build_fragments (line 217) exists only for info!() logging (line 226), violating library logging policy. This couples side-effects to query API, breaking unit architecture. Remove info!() from line 226. Drop wrap_width from build_fragments. Update line 340 call. Fix docs line 544 to list date_token_span as trace-only.
Rust Compiler Lint Integrity ❌ Error Unresolved review comment: tracing::info! in build_fragments (line 226) violates documented policy that library code must never emit at info! or above (developers-guide.md line 464-465). Remove tracing::info! from src/wrap/inline.rs lines 226-232; drop wrap_width parameter from build_fragments; update docs/developers-guide.md line 544 to remove info from date_token_span instrumentation.
Developer Documentation ⚠️ Warning Developers guide documents date_token_span at "info" level, violating the stated policy: "Never emit at info or above from library code". Code contains a tracing::info! call in violation. Remove tracing::info! from src/wrap/inline.rs, remove wrap_width parameter from build_fragments, and update developers guide to document date_token_span at "trace" level only.
Testing (Property / Proof) ⚠️ Warning Property tests are substantive, covering predicates and span matching invariants. However, unresolved review comments require removal of info! logging from library code at line 226. Remove info! emission at src/wrap/inline.rs:226 and wrap_width parameter from build_fragments.
Domain Architecture ⚠️ Warning Line 226 in src/wrap/inline.rs emits tracing::info! from library code, violating the logging policy at developers-guide.md lines 464-465 (Never emit info! or above from library code). Remove the info! call from build_fragments and revert wrap_width parameter. Keep date diagnostics at debug!/trace! level only, per review comment at src/wrap/inline.rs lines 217-233.
Observability ⚠️ Warning Library code emits tracing::info! at line 226 of src/wrap/inline.rs on normal operation, violating stated policy that forbids info! in library code (developers-guide line 465). Remove the info! call from build_fragments, drop the wrap_width parameter, and update developers-guide line 544 to reflect only trace/debug per policy.
Performance And Resource Use ⚠️ Warning try_match_date_sequence is called twice per loop iteration: once inside determine_token_span and again at line 223 for logging only, causing redundant date matching work on every token. Remove the explicit try_match_date_sequence call and info! logging at line 223. The date detection is already complete from determine_token_span.
Architectural Complexity And Maintainability ⚠️ Warning src/wrap/inline.rs line 226 emits tracing::info! from library code, violating stated policy against info! or above in library code and forcing unused wrap_width parameter in build_fragments. Replace info! with debug! in date-span over-width path; remove unused wrap_width parameter from build_fragments.
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly summarises the main change: treating English date-like sequences as atomic inline fragments during wrapping, and includes the issue reference (#346) as required.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the motivation, implementation approach, and test coverage for the date-sequence atomicity feature.
Linked Issues check ✅ Passed The changeset implements all core objectives from issue #346: date-component predicates (is_month_name, is_ordinal_day, is_numeric_day, is_year), sequence detection (try_match_date_sequence), integration into token-span grouping (date_token_span), over-width fallback, and comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are scoped to the date-sequence atomicity feature: predicates, span helpers, tests, documentation, and build tooling. No unrelated refactoring, architectural changes, or out-of-scope modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Testing (Overall) ✅ Passed Rigorous test coverage: property tests verify dates aren't split when fitting; snapshot tests assert exact output; predicate tests validate ranges; tests would fail if implementation removed.
User-Facing Documentation ✅ Passed Date atomicity documented in users-guide.md with examples, README.md signposts feature appropriately, CHANGELOG.md entry added, backward-compatible enhancement.
Module-Level Documentation ✅ Passed All modules carry clear docstrings explaining purpose, utility and function with component relationships documented where applicable.
Testing (Unit And Behavioural) ✅ Passed Unit tests for predicates and span matching include edge cases; property tests verify public API invariants; behavioural tests exercise wrap_text function; snapshot tests record regressions.
Testing (Compile-Time / Ui) ✅ Passed PR uses 8 meaningful snapshot tests (insta) with stable deterministic inputs, complemented by semantic assertions in unit and property-based tests. Internal APIs require no compile-time tests.
Security And Privacy ✅ Passed PR introduces no secrets, unsafe I/O, injection vectors, or sensitive data exposure; changes are scoped to text-wrapping date-pattern recognition only.
Concurrency And State ✅ Passed The PR adds single-threaded date-sequence detection for text wrapping. No concurrency primitives, shared mutable state, or ordering guarantees are introduced—all state is local scope.
📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #346

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-346-treat-date-like-sequences-as-atomic-fragments

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

@sourcery-ai

sourcery-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Treat common English date-like token sequences as single atomic inline fragments during wrapping by adding date component predicates, a date sequence matcher in span helpers, integrating it into span determination, and covering behavior with new unit and property tests.

Flow diagram for date sequence handling in determine_token_span

flowchart TD
    A_determine[determine_token_span]
    B_try_date[try_match_date_sequence]
    C_date_found[[date_end found]]
    D_no_date[[no date sequence]]
    E_width[sum token widths]
    F_footnote[try_couple_footnote_reference]
    G_return_date[(return date_end, date_width)]
    H_return_footnote[(return footnote_end, date_width)]
    I_general[existing span heuristics]

    A_determine --> B_try_date
    B_try_date -->|"Some(date_end)"| C_date_found
    B_try_date -->|"None"| D_no_date

    C_date_found --> E_width
    E_width --> F_footnote
    F_footnote -->|"Some(footnote_end)"| H_return_footnote
    F_footnote -->|"None"| G_return_date

    D_no_date --> I_general
Loading

File-Level Changes

Change Details Files
Introduce predicates to recognize date component tokens (months, days, years) used by the inline wrapper.
  • Add is_month_name, is_ordinal_day, is_numeric_day, and is_year helpers with range and punctuation handling.
  • Refactor shared helpers for day number parsing and ranges.
  • Add focused property tests for date predicates, including valid/invalid ranges, case-insensitive month matching, and punctuation handling.
src/wrap/inline/predicates.rs
src/wrap/inline/predicate_date_props.rs
Add a date-sequence matcher that groups day–month–year token runs into a single inline span before general span heuristics.
  • Implement try_match_date_sequence and pattern-specific matchers for ordinal and numeric day–month–year forms and month-first variants.
  • Use whitespace-sensitive matching and reuse date predicates to validate sequences.
  • Add property tests for try_match_date_sequence covering valid patterns, offsets, separators, and partial sequences.
src/wrap/inline/span_helpers.rs
Integrate date sequence detection into span determination to keep dates atomic, including interaction with footnote references.
  • Call try_match_date_sequence early in determine_token_span to compute date span width and end index.
  • Reuse try_couple_footnote_reference to attach trailing footnote refs to date spans.
  • Ensure existing punctuation and link-coupling logic remains unchanged for non-date tokens.
src/wrap/inline.rs
Add unit and property tests ensuring wrap_text treats date-like sequences as atomic, including edge cases and over-width dates.
  • Add rstest-based examples verifying that various date formats (ordinal, numeric, abbreviated, different casings, punctuation) remain intact under wrapping.
  • Add tests for over-width dates, exact-boundary widths, and partial dates to check both atomicity and that non-full dates are not grouped.
  • Add property tests that generate random valid dates and prose prefixes to assert dates are not split across adjacent lines, content is preserved, and line counts behave monotonically with width.
tests/wrap_unit.rs
tests/wrap_unit/dates.rs
tests/wrap_unit/dates_prop.rs

Assessment against linked issues

Issue Objective Addressed Explanation
#346 Recognize common English date-like sequences (ordinal day + month + year, numeric/plain day + month + year, and month + numeric day-comma + year) during inline fragment grouping and treat each full date run as a single atomic inline fragment for wrapping.
#346 Ensure the atomicity of date-like sequences is soft: when a date fits within the available width it must not be split across lines, but when the date itself exceeds the width the wrapper should gracefully fall back (e.g., emit an over-width token) without panicking or corrupting output, and avoid grouping partial dates incorrectly.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@leynos
leynos marked this pull request as ready for review June 6, 2026 07:52
sourcery-ai[bot]

This comment was marked as resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65fb3b8b18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/wrap/inline/predicates.rs
@leynos

leynos commented Jun 6, 2026

Copy link
Copy Markdown
Owner

@coderabbitai please propose a property test design for this functionality and provide an AI coding agent prompt for this.

@coderabbitai

This comment was marked as resolved.

@lodyai
lodyai Bot marked this pull request as draft June 6, 2026 08:08
@coderabbitai coderabbitai Bot added the Issue label Jun 6, 2026
@leynos

leynos commented Jun 6, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Have the following now been resolved?

Annul any requirements that violate the en-GB-oxendict spelling (-ize / -yse / -our) conventions (for example a request to replace "normalize" with "normalise" or "artefact" with "artifact"), or where the requirement unnecessarily increases cyclomatic complexity.

Please address the comments from this code review:

## Overall Comments
- The date matcher allows commas on numeric day tokens but not on year tokens, so common prose like `July 4, 2008,` will leave the trailing comma outside the atomic span; consider extending `is_year` (or the matching logic) to handle a trailing comma or other simple punctuation on the year component as well.

## Individual Comments

### Comment 1
<location path="tests/wrap_unit/dates.rs" line_range="16-22" />
<code_context>
+use mdtablefix::wrap::wrap_text;
+use rstest::rstest;
+
+#[rstest]
+#[case("25th December 2025")]
+#[case("19 March 2018")]
+#[case("July 4, 2008")]
+#[case("25th Dec 2025")]
+#[case("Jul 4, 2008")]
+fn wrap_text_keeps_date_sequence_intact(#[case] expected_date: &str) {
+    let input = lines_vec![format!(
+        "This paragraph has enough preceding prose to make {expected_date} a tempting wrap point."
</code_context>
<issue_to_address>
**suggestion (testing):** Broaden the positive cases to cover casing variations and date formats without commas

Since `is_month_name` and `is_numeric_day` are case-insensitive and allow an optional comma, please add a few more parameterized cases (e.g. `"july 4, 2008"`, `"JUL 4, 2008"`, `"July 4 2008"`, `"March 19 2018"`) to confirm casing and comma-optional behavior and to better protect against future changes in tokenization or predicate logic.

```suggestion
#[rstest]
#[case("25th December 2025")]
#[case("19 March 2018")]
#[case("July 4, 2008")]
#[case("25th Dec 2025")]
#[case("Jul 4, 2008")]
// Casing variations
#[case("july 4, 2008")]
#[case("JUL 4, 2008")]
// Comma-optional variants
#[case("July 4 2008")]
#[case("March 19 2018")]
fn wrap_text_keeps_date_sequence_intact(#[case] expected_date: &str) {
```
</issue_to_address>

### Comment 2
<location path="tests/wrap_unit/dates.rs" line_range="34-48" />
<code_context>
+}
+
+#[test]
+fn wrap_text_handles_date_wider_than_width() {
+    let input = lines_vec!["Remember 25th December 2025 when wrapping."];
+    // Width 10 is intentionally narrower than `25th December 2025`, so this
+    // exercises the long-atomic-token fallback path rather than normal fitting.
+    let output = wrap_text(&input, 10);
+
+    assert!(!output.is_empty());
+    assert!(
+        output
+            .iter()
+            .any(|line| line.contains("25th December 2025")),
+        "over-width date should fall back to long-token emission: {output:?}"
+    );
+}
</code_context>
<issue_to_address>
**suggestion (testing):** Also test narrow-width behavior when the date is adjacent to punctuation or at the line boundary

To better exercise tokenisation and span coupling, add narrow-width cases where the date is at the start/end of a line or directly followed by punctuation (e.g. `"On 25th December 2025, we met."`, `"25th December 2025."`) with widths that would otherwise force a break around the date. This confirms the date sequence is still treated atomically in these common patterns.

```suggestion
#[test]
fn wrap_text_handles_date_wider_than_width() {
    // Baseline: date in the middle of a sentence.
    let input = lines_vec!["Remember 25th December 2025 when wrapping."];
    // Width 10 is intentionally narrower than `25th December 2025`, so this
    // exercises the long-atomic-token fallback path rather than normal fitting.
    let output = wrap_text(&input, 10);

    assert!(!output.is_empty());
    assert!(
        output
            .iter()
            .any(|line| line.contains("25th December 2025")),
        "over-width date should fall back to long-token emission: {output:?}"
    );

    // Date directly followed by punctuation in the middle of a sentence.
    let input_with_following_punct = lines_vec!["On 25th December 2025, we met."];
    let output_with_following_punct = wrap_text(&input_with_following_punct, 10);

    assert!(
        !output_with_following_punct.is_empty(),
        "wrapped output for date+comma case should not be empty",
    );
    assert!(
        output_with_following_punct
            .iter()
            .any(|line| line.contains("25th December 2025")),
        "over-width date with following punctuation should still be emitted atomically: \
         {output_with_following_punct:?}",
    );

    // Date at the start of the line and directly followed by punctuation.
    let input_at_line_start = lines_vec!["25th December 2025. We met again."];
    let output_at_line_start = wrap_text(&input_at_line_start, 10);

    assert!(
        !output_at_line_start.is_empty(),
        "wrapped output for date-at-line-start case should not be empty",
    );
    assert!(
        output_at_line_start
            .iter()
            .any(|line| line.contains("25th December 2025")),
        "over-width date at line start with following punctuation should still be \
         emitted atomically: {output_at_line_start:?}",
    );
}
```
</issue_to_address>

### Comment 3
<location path="src/wrap/inline/span_helpers.rs" line_range="49" />
<code_context>
 }

+/// Returns the exclusive end of a date-like token run beginning at `start`.
+pub(in crate::wrap::inline) fn try_match_date_sequence(
+    tokens: &[String],
+    start: usize,
</code_context>
<issue_to_address>
**issue (complexity):** Consider inlining the three specific date-matching patterns into dedicated functions instead of using a generic higher-order helper to make the control flow clearer and self-documenting.

You can reduce the abstraction overhead by making the three date patterns explicit and dropping the higher‑order helper. This keeps behavior identical but makes the control flow self‑documenting and removes the function‑pointer indirection.

For example, replace `try_match_date_sequence` + `match_component_whitespace_component_whitespace_component` with three small pattern matchers:

```rust
pub(in crate::wrap::inline) fn try_match_date_sequence(
    tokens: &[String],
    start: usize,
) -> Option<usize> {
    match_ordinal_day_month_year(tokens, start)
        .or_else(|| match_numeric_day_month_year(tokens, start))
        .or_else(|| match_month_numeric_day_year(tokens, start))
}

fn match_ordinal_day_month_year(tokens: &[String], start: usize) -> Option<usize> {
    let day = tokens.get(start)?;
    let space1 = tokens.get(start + 1)?;
    let month = tokens.get(start + 2)?;
    let space2 = tokens.get(start + 3)?;
    let year = tokens.get(start + 4)?;

    if is_ordinal_day(day)
        && is_whitespace_token(space1)
        && is_month_name(month)
        && is_whitespace_token(space2)
        && is_year(year)
    {
        Some(start + 5)
    } else {
        None
    }
}

fn match_numeric_day_month_year(tokens: &[String], start: usize) -> Option<usize> {
    let day = tokens.get(start)?;
    let space1 = tokens.get(start + 1)?;
    let month = tokens.get(start + 2)?;
    let space2 = tokens.get(start + 3)?;
    let year = tokens.get(start + 4)?;

    if is_numeric_day(day)
        && is_whitespace_token(space1)
        && is_month_name(month)
        && is_whitespace_token(space2)
        && is_year(year)
    {
        Some(start + 5)
    } else {
        None
    }
}

fn match_month_numeric_day_year(tokens: &[String], start: usize) -> Option<usize> {
    let month = tokens.get(start)?;
    let space1 = tokens.get(start + 1)?;
    let day = tokens.get(start + 2)?;
    let space2 = tokens.get(start + 3)?;
    let year = tokens.get(start + 4)?;

    if is_month_name(month)
        && is_whitespace_token(space1)
        && is_numeric_day(day)
        && is_whitespace_token(space2)
        && is_year(year)
    {
        Some(start + 5)
    } else {
        None
    }
}
```

This keeps the same semantics (same indices, same whitespace checks, same predicates) but:

- Removes the generic, long helper name.
- Eliminates bare function‑pointer arguments.
- Makes each supported date form obvious via function name and local variable names.
</issue_to_address>

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the current state of the relevant files on the PR branch
cat tests/wrap_unit/dates.rs
echo "---FILE_SEPARATOR---"
cat src/wrap/inline/span_helpers.rs
echo "---FILE_SEPARATOR---"
cat src/wrap/inline/predicates.rs

Length of output: 21797



@leynos All four items are resolved in the current branch state.

Item Status
Overall – extend is_year to absorb trailing prose punctuation on the year token is_year now calls trim_end_matches(is_trailing_punct) before parsing, and the rstest block covers "2025,", "2008)", "2008).", and "2008,)". The wrap_text_keeps_date_sequence_intact cases include "July 4, 2008," and "July 4, 2008)".
Comment 1 – broaden positive cases for casing and comma-optional variants ✅ All four suggested cases ("july 4, 2008", "JUL 4, 2008", "July 4 2008", "March 19 2018") are present, plus three additional trailing-punctuation date cases.
Comment 2 – add narrow-width tests for date adjacent to punctuation and at line boundary wrap_text_handles_date_wider_than_width now contains both input_with_following_punct ("On 25th December 2025, we met.") and input_at_line_start ("25th December 2025. We met again.") sub-cases.
Comment 3 – replace generic higher-order helper with three explicit pattern-matching functions match_component_whitespace_component_whitespace_component is gone; replaced by match_ordinal_day_month_year, match_numeric_day_month_year, and match_month_numeric_day_year.

🧠 Learnings used
Learnt from: CR
Repo: leynos/wireframe PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-06T22:30:31.802Z
Learning: Applies to docs/src/message_assembler/series.rs : Implement message continuation ordering validation in `src/message_assembler/series.rs` using the three-helper split: `start_sequence_tracking()` for untracked-to-tracked transition, `advance_tracked_sequence()` for duplicate/gap/out-of-order validation, and `advance_sequence_or_overflow()` as the shared leaf helper

Learnt from: CR
Repo: leynos/wireframe PR: 0
File: docs/formal-verification-methods-in-wireframe.md:0-0
Timestamp: 2026-06-06T22:32:36.740Z
Learning: Applies to docs/src/{frame,fragment}/**/*.rs : First Kani targets in Phase 2: supported length-prefix round-trip (widths 1,2,4,8 with both endiannesses), unsupported-width behavior regression harness, `FragmentSeries` trace checks, `Reassembler` small-trace checks, `MessageSeries` sequencing checks

@leynos
leynos marked this pull request as ready for review June 7, 2026 01:41
sourcery-ai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@lodyai
lodyai Bot marked this pull request as draft June 7, 2026 02:35
@leynos
leynos marked this pull request as ready for review June 7, 2026 03:40
sourcery-ai[bot]

This comment was marked as resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 465ee74048

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/wrap/inline/span_helpers.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 465ee74048

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/wrap/inline/span_helpers.rs Outdated
@lodyai
lodyai Bot marked this pull request as draft June 7, 2026 03:43
@leynos

leynos commented Jun 7, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@leynos

This comment was marked as resolved.

@leynos

This comment was marked as resolved.

@leynos

leynos commented Jun 7, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already.

❌ Failed checks (2 errors, 6 warnings)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error Three new predicates lack unit tests; tests pass vacuously for over-permissive implementations. Proposed property tests not implemented. Add unit tests covering boundary conditions for day/ordinal/month predicates. Implement the property-based tests previously proposed for this feature.
Module-Level Documentation ❌ Error src/wrap/inline/predicates.rs and src/wrap/inline/span_helpers.rs lack module-level documentation mentioning the new date-detection and date-sequence-matching functionality respectively. Update module docstrings in predicates.rs and span_helpers.rs to describe the date-component detection and date-sequence grouping capabilities they now provide.
User-Facing Documentation ⚠️ Warning Date-sequence atomicity is not documented in docs/users-guide.md. The Paragraph wrapping section describes other unbreakable units (code, links, footnotes, punctuation, affixes) but omits dates. Document in docs/users-guide.md Paragraph wrapping section that date-like sequences are now grouped atomically, with examples like "25th December 2025" and "July 4, 2008".
Developer Documentation ⚠️ Warning Five new internal APIs for date sequence detection added to wrap::inline are not documented in developers-guide.md as required. Document is_month_name, is_ordinal_day, is_numeric_day, is_year (in predicates.rs) and try_match_date_sequence (in span_helpers.rs) in the Key types table and wrap module architecture section of developers-guide.md.
Testing (Unit And Behavioural) ⚠️ Warning Four public date-related functions lack unit tests: is_month_name, is_ordinal_day, is_numeric_day, and try_match_date_sequence lack dedicated unit tests for local behaviour and edge cases. Add unit tests for each predicate function covering valid/invalid ranges and edge cases, and unit tests for try_match_date_sequence covering pattern matching and malformed-input rejection.
Testing (Property / Proof) ⚠️ Warning PR introduces date predicates and matching logic with clear invariants over input ranges but lacks property tests to verify predicates and matchers comprehensively. Add proptest properties for is_month_name, is_ordinal_day (1-31), is_numeric_day, is_year (1000-2999 range), try_match_date_sequence (offset invariance, separator validation), and wrap_text integration tests asserting dates fit intact.
Testing (Compile-Time / Ui) ⚠️ Warning Unit and snapshot tests are present and meaningful, but recommended property-based tests for date detection were designed in PR comments but not implemented. Implement proptest property tests as designed in PR: extend predicates and span_helpers, add tests/wrap_unit/dates_prop.rs for properties covering predicate invariants and date matching across random inputs.
Observability ⚠️ Warning New date-sequence predicates and span grouping lack tracing instrumentation. Similar predicates (looks_like_footnote_ref, ends_with_footnote_ref) have #[tracing::instrument]; these do not. Add #[tracing::instrument(level = "trace", ret)] to is_month_name, is_ordinal_day, is_numeric_day, is_year; add tracing at try_match_date_sequence call site and a tracing_tests module.

@leynos
leynos marked this pull request as ready for review June 7, 2026 11:47

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/adrs/0003-date-sequences-as-inline-fragments.md`:
- Around line 18-35: Rewrite the paragraph to remove first-person phrasing
(e.g., replace "we decided for matching" with an impersonal construction like
"The implementation matches" or "The matcher recognises"), normalize to
en-GB-oxendict -ize spellings (use "recognizes" → "recognises", "parenthesized"
→ "parenthesised" if following en‑GB-oxendict) and keep references to the
implementation (mention src/wrap/inline/span_helpers.rs and the InlineFragment
grouping model) so the text reads objectively and follows repository docstyle
rules.

In `@src/wrap/inline/date_strategies.rs`:
- Around line 3-5: Update the module doc comment in date_strategies.rs to use
en-GB-oxendict `-ize` spelling by replacing "recognises" with "recognizes" in
the top comment block; locate the module-level doc string at the start of the
file (the triple-slash //! comment) and make the single-word spelling change so
documentation follows the project's `-ize` guideline.

In `@src/wrap/inline/month_names.rs`:
- Around line 8-11: Doc comment in month_names.rs uses British spelling
"recognised"; update the Rust doc comment to the repository's en-GB-oxendict
`-ize` form by replacing "recognised" with "recognized" in the paragraph that
describes Full and abbreviated English month names (the doc block above the
month names and the comment referencing `is_month_name`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aa59ccdb-b3bc-4a6c-b1a3-747da344b0f8

📥 Commits

Reviewing files that changed from the base of the PR and between 029d2b7 and 52c29d7.

⛔ Files ignored due to path filters (8)
  • tests/snapshots/date_month_day_year_punctuation_wrap.snap is excluded by !**/*.snap
  • tests/snapshots/date_ordinal_day_month_year_wrap.snap is excluded by !**/*.snap
  • tests/snapshots/date_parenthesised_and_footnote_wrap.snap is excluded by !**/*.snap
  • tests/snapshots/date_wrap_month_day_year_with_comma.snap is excluded by !**/*.snap
  • tests/snapshots/date_wrap_numeric_day_month_year.snap is excluded by !**/*.snap
  • tests/snapshots/date_wrap_ordinal_day_month_year.snap is excluded by !**/*.snap
  • tests/snapshots/date_wrap_over_width_fallback.snap is excluded by !**/*.snap
  • tests/snapshots/date_wrap_parenthesised_with_footnote.snap is excluded by !**/*.snap
📒 Files selected for processing (14)
  • CHANGELOG.md
  • README.md
  • docs/adrs/0003-date-sequences-as-inline-fragments.md
  • docs/developers-guide.md
  • src/wrap/inline.rs
  • src/wrap/inline/date_strategies.rs
  • src/wrap/inline/month_names.rs
  • src/wrap/inline/predicates.rs
  • src/wrap/inline/span_helpers.rs
  • tests/wrap/date_snapshots.rs
  • tests/wrap/mod.rs
  • tests/wrap_unit/date_strategies.rs
  • tests/wrap_unit/dates.rs
  • tests/wrap_unit/dates_prop.rs

Comment thread docs/adrs/0003-date-sequences-as-inline-fragments.md Outdated
Comment thread src/wrap/inline/date_strategies.rs
Comment thread src/wrap/inline/month_names.rs Outdated
leynos added 2 commits June 8, 2026 13:38
Remove first-person phrasing from the date atomicity ADR and align the
reviewed doc comments with the requested spelling forms.
Document the instrumented date span helpers and add traced tests that
verify both `date_token_span` and `try_match_date_sequence` emit TRACE
events when date grouping is exercised.
@leynos

This comment was marked as resolved.

@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

This comment was marked as resolved.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/adrs/0003-date-sequences-as-inline-fragments.md (1)

24-34: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize Oxford spelling to -ize forms in ADR prose.

Replace recognises with recognizes, and replace parenthesised with
parenthesized to align with repository en-GB-oxendict conventions.

Triage: [type:spelling] [type:docstyle]

As per coding guidelines, documentation must use en-GB-oxendict with -ize
forms outside API literals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adrs/0003-date-sequences-as-inline-fragments.md` around lines 24 - 34,
The ADR prose uses en-GB spellings "recognises" and "parenthesised"; update the
text in docs/adrs/0003-date-sequences-as-inline-fragments.md by replacing
"recognises" with "recognizes" and "parenthesised" with "parenthesized" so the
document follows the repository en-GB-oxendict `-ize` convention (search for the
sentence beginning "The matcher recognises..." to locate the tokens to change).

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/adrs/0003-date-sequences-as-inline-fragments.md`:
- Around line 24-34: The ADR prose uses en-GB spellings "recognises" and
"parenthesised"; update the text in
docs/adrs/0003-date-sequences-as-inline-fragments.md by replacing "recognises"
with "recognizes" and "parenthesised" with "parenthesized" so the document
follows the repository en-GB-oxendict `-ize` convention (search for the sentence
beginning "The matcher recognises..." to locate the tokens to change).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02caa539-3ca6-4180-90d7-37977a6dee71

📥 Commits

Reviewing files that changed from the base of the PR and between 52c29d7 and 704a82a.

📒 Files selected for processing (7)
  • docs/adrs/0003-date-sequences-as-inline-fragments.md
  • docs/developers-guide.md
  • src/wrap/inline.rs
  • src/wrap/inline/date_strategies.rs
  • src/wrap/inline/inline_tracing_tests.rs
  • src/wrap/inline/month_names.rs
  • src/wrap/inline/span_helpers.rs

@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

leynos added 2 commits June 8, 2026 14:39
Add the missing `make typecheck` guidance and normalize the remaining
Oxford spelling violations in the date-sequence ADR and span helper module
documentation.
Emit DEBUG events for matched date sequence patterns and INFO events when
an over-width date span falls back to long-token wrapping. Expand the date
snapshot module documentation and keep the date span tracing tests colocated
with the span helper implementation.
@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Module-Level Documentation ❌ Error tests/wrap/date_snapshots.rs lacks adequate module documentation; its one-line docstring fails to explain utility, function, or relationship to complementary test modules. Expand tests/wrap/date_snapshots.rs docstring to document snapshot-assertion approach, scope, and relationship to example-based test module dates.rs.
Observability ⚠️ Warning Only TRACE instrumentation exists with input/output parameters; missing DEBUG logs at decision points and INFO logs for fallback behaviour. Add DEBUG logs to try_match_date_sequence identifying matched pattern. Add INFO logs when dates exceed wrap width triggering fallback.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== tests/wrap/date_snapshots.rs top ==="
fd -e rs date_snapshots --exec sh -c 'echo "--- {} ---"; sed -n "1,80p" "{}"'

echo
echo "=== try_match_date_sequence and logging in span_helpers.rs ==="
fd -e rs span_helpers --exec sh -c 'echo "--- {} ---"; rg -n -C 4 "try_match_date_sequence|debug!|info!|tracing::debug|tracing::info|matched pattern|date.*pattern" "{}"'

echo
echo "=== date_token_span / fallback logging in inline.rs ==="
sed -n '1,140p' src/wrap/inline.rs
echo
rg -n -C 4 "date_token_span|try_match_date_sequence|debug!|info!|tracing::debug|tracing::info|fallback|width|date_width" src/wrap/inline.rs src/wrap/inline/*.rs

echo
echo "=== tracing imports ==="
rg -n "use tracing|tracing::|debug!|info!" src/wrap/inline.rs src/wrap/inline/span_helpers.rs

echo
echo "=== relevant tracing tests ==="
rg -n -C 3 "try_match_date_sequence|date_token_span|debug|info|logs_contain|traced_test" src tests | head -120

Length of output: 77672



@leynos Yes — both checks are now resolved.

Check Status Evidence
Module-Level Documentation ✅ Resolved tests/wrap/date_snapshots.rs now has a multi-sentence module doc explaining the snapshot-assertion approach, reviewed line-boundary changes, scope over representative date formats, and relationship to the example-based dates.rs tests.
Observability ✅ Resolved try_match_date_sequence now emits DEBUG logs identifying the matched pattern (ordinal_day_month_year, numeric_day_month_year, month_numeric_day_year). build_fragments now emits an INFO log when a date span exceeds wrap_width and triggers fallback behaviour. Traced tests verify the matched-pattern log and over-width fallback log.

No further AI coding agent prompt is required.


🧠 Learnings used
Learnt from: leynos
Repo: leynos/mdtablefix PR: 350
File: src/wrap/inline/span_helpers.rs:0-0
Timestamp: 2026-06-07T14:17:30.141Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), as of commit cc0676d, `is_month_name`, `is_ordinal_day`, and `is_numeric_day` each apply a private `strip_leading_openers(token)` helper before classification. This helper iterates over leading chars and skips any for which `is_opening_punct` returns true, covering `(`, `[`, `"`, and Unicode equivalents. `is_year` does not need stripping because trailing closers are already handled by `trim_end_matches(is_trailing_punct)`. Property tests in `span_helpers.rs` (`prop_try_match_date_sequence_accepts_leading_opener_on_first_component`) verify this behaviour holds across generated inputs.

Learnt from: CR
Repo: leynos/episodic PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T18:45:21.937Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/beatcue PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T22:51:00.631Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/agent-template-rust PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-06T07:40:29.180Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/podbot PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-01T18:44:26.074Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-07T18:27:09.528Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/axinite PR: 0
File: :0-0
Timestamp: 2026-04-07T14:53:29.361Z
Learning: In the leynos/axinite repository, dead-code and complexity lints on test support items must be resolved via correctly scoped conditional compilation (#[cfg(...)]) and narrow inline `pub mod` blocks, not via #[allow(...)] or #[expect(...)] suppressions. Items only consumed by one submodule should be grouped in a dedicated inline sub-module. The clippy::type_complexity lint on complex function-pointer const assertions should be eliminated by extracting a local `type` alias rather than suppressing the lint.

Learnt from: CR
Repo: leynos/css-view PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T00:35:46.625Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/rust-prover-tools PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T02:45:37.463Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/*.rs : Implement cross-test paragraph grouping, identical input fingerprint checks, and crate-post emission controls.

Learnt from: CR
Repo: leynos/dear-diary PR: 0
File: docs/adr-001-whitaker-lint-contract.md:0-0
Timestamp: 2026-05-23T12:12:21.541Z
Learning: Ensure Rustdoc, Clippy, and Whitaker findings are resolved before pull requests reach review

Learnt from: CR
Repo: leynos/simulacat-core PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T14:45:34.803Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-07T14:38:38.319Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), `MONTH_NAMES` is declared as `pub(crate) const` so that both the inline submodule's own test code and integration tests in `tests/` can import it directly rather than defining independent copies. `tests/date_strategies.rs` imports it via `use super::predicates::MONTH_NAMES`, and `src/wrap/inline/date_strategies` imports it via `super::predicates::MONTH_NAMES`. The crate root re-exports `date_strategies` under `#[cfg(test)]` so integration tests can use `mdtablefix::date_strategies::{…}`.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In leynos/axinite, the preferred approach for eliminating `#[allow(dead_code)]` and `#[allow(unused_imports)]` lint suppressions on helpers in integration test support modules (`tests/support/`) is:
1. Move the helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) within the support file so that test binaries which do not use those helpers never reference the sub-module.
2. Register each helper's function-pointer signature via a compile-time type-assertion (using a locally-declared generic helper `fn assert_x<Fut>(f: fn(...) -> Fut) { let _ = f; }`) inside the `*_symbol_refs()` function in `tests/support/mod.rs`, anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders any lint suppression unnecessary. Only `#[expect(dead_code, reason = "...")]` is permitted as a last resort on the `*_symbol_refs` anchor function itself.

Learnt from: CR
Repo: leynos/rstest-bdd PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-05-31T21:16:27.596Z
Learning: Applies to docs/crates/rstest-bdd-policy/**/*.rs : Keep `RuntimeMode`, `TestAttributeHint`, and their helper behavior defined in `rstest-bdd-policy` as the single source of truth for shared policy types used by both runtime and macro crates.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In this Rust codebase (leynos/axinite), the preferred approach for eliminating `dead_code` and `unused_import` lint suppressions in integration test support modules (`tests/support/`) is:
1. Group related helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) so test binaries that do not use those helpers have no reference to the sub-module.
2. Register each helper's signature via a compile-time function-pointer type assertion inside the relevant `*_symbol_refs()` function in `tests/support/mod.rs`, which is anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders lint suppression unnecessary.
This supersedes the approach of adding `#[allow(dead_code)]` or `#[expect(dead_code, ...)]` to individual helpers in the support crate.

Learnt from: CR
Repo: leynos/actix-v2a PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T17:43:16.203Z
Learning: Applies to docs/**/*test*.rs : Property tests should use narrow strategies matching the invariant, keep generated collection sizes bounded, use prop_assert! and prop_assert_eq! for clear failures, avoid returning Result unless necessary, and preserve handwritten regression tests for named boundary cases

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/adr-003-formal-proof-strategy-for-clone-detector-pipeline.md:0-0
Timestamp: 2026-04-15T02:03:27.529Z
Learning: Applies to docs/**/*{test,tests}*.rs : Keep ordinary unit, behaviour, and integration tests for exact regression vectors, fixture-driven scenarios, and end-to-end clone detector pipeline behaviour, including SplitMix64 regression vectors, seed-stream stability, token-pass, candidate-generation, and SARIF-emission behaviour

Learnt from: CR
Repo: leynos/wireframe PR: 0
File: docs/formal-verification-methods-in-wireframe.md:0-0
Timestamp: 2026-06-06T22:32:36.753Z
Learning: Applies to docs/src/{frame,fragment}/**/*.rs : First Kani targets in Phase 2: supported length-prefix round-trip (widths 1,2,4,8 with both endiannesses), unsupported-width behavior regression harness, `FragmentSeries` trace checks, `Reassembler` small-trace checks, `MessageSeries` sequencing checks

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/**/*.rs : Use `trace!` for branch-level checks: predicate matched, prefix mismatch, unterminated bracket

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/tests/ui/**/*.rs : Add UI pass/fail coverage for simple paragraphs, too-short candidates, control-flow-containing blocks, and intermediate reuse cases.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/{tests,test}/**/*.rs : The verification strategy must include a compact matrix of test cases covering the combinatorial surface of return style, failure style, strictness, mode, message matching, `rstest` case placement, and async runtime macro order, rather than only one example per feature; must verify that a passing body classified under strict xfail becomes XPASS and fails through panic, a panicking body classified under default mode becomes XFAIL, a `Result::Err` body classified under default mode becomes XFAIL, and that `mode` and `contains` mismatches become unexpected failures

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : The macro must rewrite annotated functions to return `()` and call `rstest_xfail::expect_fail(policy, || -> Original { original_body })` for sync functions or `rstest_xfail::expect_fail_async(policy, async move { original_body }).await` for async functions, preserving the user's runtime test attribute

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Implement `XfailPolicy`, `FailureMode`, `Strictness`, `BodyOutcome`, and `XfailOutcome` in `rstest-xfail-core` crate

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The classification functions must avoid syntactic detection of result aliases and instead use the `IntoBodyOutcome` trait to convert body outcomes

Learnt from: CR
Repo: leynos/shared-actions PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T21:05:22.983Z
Learning: Applies to **/*_test.rs : Snapshot tests must encode meaningful behavioural expectations: they must not be so generic that they bless meaningless output, nor so brittle that incidental formatting churn causes blithe failure cascades. Prefer focused snapshots, stable serialization, explicit redaction of nondeterministic fields, and small semantic assertions around the snapshot when that improves reviewability.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : Unknown arguments to `#[xfail]` must be compile errors, `#[xfail]` on non-function items must be compile errors, and `#[xfail]` on functions with unsupported signatures must be compile errors with a diagnostic that names the unsupported construct

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Stabilize structured outcome accessors for external reporters in `rstest-xfail-core`

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/tests/**/*.rs : Add runtime tests for per-case xfail and all-case xfail scenarios

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The `rstest-xfail-core` crate must define stable types: `XfailPolicy` (with fields `reason`, `strict`, `mode`, `expected_message`), `Strictness` enum (with variants `Strict` and `NonStrict`), `FailureMode` enum (with variants `Any`, `Panic`, `Result`), `BodyOutcome` enum (with variants `Passed`, `Panicked { message: Option<String> }`, `ReturnedError { message: String }`), and `XfailOutcome` enum (with variants `Xfail`, `Xpass`, `UnexpectedFailure`)

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-08T10:43:40.216Z
Learning: In leynos/mdtablefix, always use `make test` (the Makefile `test` target) rather than `cargo test` when specifying test commands in AI agent prompts. Never instruct an agent to run `cargo test` directly in this repository.

Learnt from: CR
Repo: leynos/stilyagi PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-04T21:53:21.943Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect; if harder, request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or proper `#[expect(...)]` justification

Learnt from: CR
Repo: leynos/df12-documentation-skills PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T00:20:49.681Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Preserve byte content verbatim for every line inside an open fence so post-wrap transforms such as `--ellipsis`, `--renumber`, `--breaks`, `--fences` cannot mutate fenced code block bodies

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Use the same `FenceTracker` implementation across `tokenize_markdown()`, `wrap_text`, and `src/wrap/fence.rs` to track whether the tokenizer is inside a fenced code block

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Use `compress_fences` to perform `FenceTracker`-driven conditional rewriting of fenced blocks, preserving outer delimiter width and marker family when normalizing would make an inner fence line structural

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Reuse `FenceTracker` from `src/wrap/fence.rs` in fence preprocessing to keep semantics consistent with the wrapping pipeline

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Normalize code block delimiters with `fences::compress_fences` using `FenceTracker` semantics to prevent fence-like lines inside open fenced blocks from being treated structurally, and ensure outer delimiters are only compressed when safe

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/tokenize/**/*.rs : Emit opening backtick fences, every interior line, and the matching closer as `Token::Fence` for structural fenced blocks, then resume inline tokenization

Learnt from: leynos
Repo: leynos/wireframe PR: 489
File: tests/fixtures/budget_transitions.rs:132-137
Timestamp: 2026-03-02T21:08:35.739Z
Learning: In Rust, the #[rustfmt::skip] attribute on #[fixture] functions (from the rstest crate) is a required workaround for a tooling conflict. Without it, cargo fmt collapses short function bodies to a single line, then the #[fixture] proc-macro wraps the body in braces, triggering clippy's unused_braces lint (which fails under -D warnings). Attribute-based suppression (#[allow] or #[expect]) doesn't work because the proc-macro rewrites the code after attributes are processed. This pattern is widespread (25+ instances) across test fixture files in the wireframe project and should not be flagged as unnecessary. Apply this understanding to all Rust files using rstest fixtures, particularly in tests/fixtures/ and similar test infrastructure.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/postprocess.rs : Use `merge_whitespace_only_lines` and `rebalance_atomic_tails` in post-processing to normalize whitespace-only wrap artifacts and isolated tails before rendering fragments

Learnt from: CR
Repo: leynos/tei-rapporteur PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-25T12:07:25.566Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is "harder", request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/spycatcher-harness PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T21:29:27.390Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/ddlint PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:41:58.806Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: CR
Repo: leynos/frankie PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T23:41:17.307Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/simulacat PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:45:23.282Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/fail_match_with_nested_if.rs:5-5
Timestamp: 2026-04-09T19:50:53.849Z
Learning: In the `leynos/whitaker` repository, for Rust UI test fixtures (files under `crates/*/ui/`), prefer eliminating dead-code warnings structurally rather than with lint suppression:
1. Wrap all fixture items in a `pub mod fixture { … }` — the compiler treats `pub` members of a `pub mod` as externally reachable and emits no `dead_code` warnings for them.
2. Gate genuinely unreachable marker helpers with `#[cfg(any())]` (always-false predicate) so they are never compiled and cannot trigger warnings.
3. Keep `fn main {}` at the crate root outside the module.
4. Do NOT use `#![expect(dead_code, …)]`, `#[allow(dead_code)]`, or any other lint-suppression attribute in UI fixture files.
This approach is preferred over `#[cfg_attr(not(any(…)), expect(dead_code, …))]` or any other suppression strategy.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/technical-design-for-test-support-dead-code-and-masked-dead-code-expectations.md:0-0
Timestamp: 2026-04-19T23:54:49.198Z
Learning: Applies to docs/tests/{support,common,prelude}/**/*.rs : Use `#[expect(dead_code, reason = "...")]` only on individual items after confirming via workspace analysis that the item is dead in that specific target; avoid file-level `#![allow(unfulfilled_lint_expectations)]` that masks stale expectations

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/pass_single_match_cluster.rs:5-5
Timestamp: 2026-04-09T19:50:53.591Z
Learning: In the leynos/whitaker repository, UI fixture files (e.g. under `crates/*/ui/*.rs`) must not use crate-level or item-level `#![expect(dead_code, …)]` suppressions. The preferred approach is to move all fixture items into a private inline module (`mod fixture { … }`) and call every item from `fn main()` so the compiler considers them used. This eliminates dead-code warnings without any lint suppression. Dylint still analyses all functions regardless of module visibility. Conditional compilation (`#[cfg(…)]`) may be used additionally where items must be excluded from non-fixture builds, but the primary pattern is the inline-module + main-exercised approach.

Learnt from: CR
Repo: leynos/ortho-config PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T11:53:42.414Z
Learning: Applies to docs/**/tests/rstest_bdd/**/*.rs : Remove file-wide lint suppressions used only for historical generated-fixture warnings in rstest-bdd; retain only narrow, item-level `#[expect(...)]` annotations when still required

Learnt from: leynos
Repo: leynos/wireframe PR: 455
File: src/app_data_store.rs:138-164
Timestamp: 2026-02-16T21:11:43.870Z
Learning: In Rust test modules using rstest fixtures, when the `#[fixture]` proc-macro triggers lints like `unused_braces`, the `#[expect(lint)]` attribute must be placed at module level rather than on the fixture function. Item-level attributes are consumed by the proc-macro before clippy evaluates them, causing `unfulfilled_lint_expectations` errors. Module-level scoping is the narrowest viable option in this case. For the reason string in the attribute, use backslash continuation for multi-line text, not `concat!()`, as attribute meta items require string literals.

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-01T12:13:46.615Z
Learning: In the `mdtablefix` repository, the `test-macros` proc-macro crate (`test-macros/src/lib.rs`) intentionally emits `#[allow(unused_braces, ...)]` rather than `#[expect(...)]`. This is unavoidable due to a bug in `rstest`: the nature of rstest fixture macro expansion makes `#[expect]` unusable in the emitted output. Do not flag this `#[allow]` usage as a lint-integrity violation; it is the only viable option at that call site.

Learnt from: leynos
Repo: leynos/wireframe PR: 417
File: tests/steps/codec_error_steps.rs:58-62
Timestamp: 2026-01-08T18:04:12.422Z
Learning: In the wireframe project, test step functions that always succeed cannot return `TestResult` even for consistency, because `clippy::unnecessary_wraps` would fire but cannot be suppressed: `#[allow]` is forbidden, and `#[expect(clippy::unnecessary_wraps)]` fails with "unfulfilled lint expectation" when the lint fires in one test target but not another.

Learnt from: leynos
Repo: leynos/wireframe PR: 419
File: tests/common/mod.rs:0-0
Timestamp: 2026-01-17T03:35:26.145Z
Learning: For integration tests in the `tests/` directory that share utilities across multiple independent test binaries, `#![allow(dead_code)]` with FIXME and tracking issue is acceptable as a last resort when: (1) cargo features cannot coordinate across independent test binaries, (2) `#[cfg(test)]` has no effect (already under tests/), and (3) `#[expect]` fires unfulfilled lint expectations in binaries that do use the shared utilities. This is a known Rust limitation with integration test compilation.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/tests/ui/**/*.rs : Add UI coverage for dyn-required supertrait cases, high-confidence async-trait marker detection, missing sibling traits, and missing blanket adapters.

Learnt from: CR
Repo: leynos/spycatcher-harness PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-05-29T00:02:45.537Z
Learning: Applies to docs/src/**/*.rs : Verification failures must provide machine-readable and human-readable output suitable for CI annotations

Learnt from: CR
Repo: leynos/frankie PR: 0
File: docs/adr-008-pr-discussion-summary-contract.md:0-0
Timestamp: 2026-03-12T18:50:05.455Z
Learning: Applies to docs/src/ai/pr_discussion_summary/**/*.rs : Fail explicitly for AI-provider schema validation, configuration problems, invalid severities, unknown thread IDs, and missing required fields in PR discussion summaries, rather than falling back to heuristic prose

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Classify combined code-and-suffix tokens as atomic in `has_inline_code_structure` in `src/wrap/inline/fragment.rs` so wrapping treats the full string (e.g., `` `VarGuard`s ``, `` `class`'s ``, `` `fetch`ed ``, or `` `run`ning ``) as an unbreakable unit

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/fragment.rs : Tag inline code spans, Markdown links, and GFM footnote references with atomic fragment kinds so the wrapper never inserts a break inside their Markdown syntax

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Use `wrap_preserving_code` in `src/wrap/inline.rs` to tokenize prose and group tokens into `InlineFragment` values for line fitting

Learnt from: CR
Repo: leynos/crate-tools PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-24T22:30:56.584Z
Learning: Commit messages: imperative mood subject (<=50 chars), blank line, wrapped body at 72 chars explaining what and why; use Markdown in body as needed

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : In the inline tokenizer, iterate over the source string lazily without creating a duplicate `Vec<char>` representation, group the resulting tokens into Markdown-aware fragments, and pass them to `textwrap::wrap_algorithms::wrap_first_fit` which chooses breakpoints without splitting code spans, links, or punctuation groups

Learnt from: CR
Repo: leynos/falcon-pachinko PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-01T00:48:47.120Z
Learning: Commit messages: concise subject (~50 chars), blank line before body, explain what/why, wrap body at 72, use Markdown formatting as needed

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : In `clean_rows`, `detect_separator`, and `calculate_widths`, prefer explicit separator lines but promote the second parsed row when the source embeds the separator in the body, and measure widths with `UnicodeWidthStr::width` to align CJK text, emoji, and accented characters by display width rather than byte count

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Makefile typecheck target ==="
rg -n "^(typecheck:|\.PHONY:|.*cargo check --all-targets --all-features|.*check --all-targets --all-features)" Makefile || true

echo
echo "=== developers-guide typecheck documentation ==="
rg -n -C 3 "\btypecheck\b|make typecheck|cargo check --all-targets --all-features|make (fmt|lint|test|check-fmt)" docs/developers-guide.md || true

echo
echo "=== spelling checks in named files ==="
for f in src/wrap/inline/month_names.rs src/wrap/inline/date_strategies.rs docs/adrs/0003-date-sequences-as-inline-fragments.md src/wrap/inline/span_helpers.rs; do
  echo "--- $f ---"
  rg -n "recognised|recognises|parenthesised|recognized|recognizes|parenthesized" "$f" || true
done

echo
echo "=== ADR line 20 context ==="
nl -ba docs/adrs/0003-date-sequences-as-inline-fragments.md | sed -n '16,24p'

echo
echo "=== tracing instrumentation declarations ==="
rg -n -C 2 "#\[tracing::instrument\(level\s*=\s*\"trace\",\s*ret\)\]|fn date_token_span|fn try_match_date_sequence" src/wrap/inline.rs src/wrap/inline/span_helpers.rs || true

echo
echo "=== developers-guide instrumented functions section ==="
rg -n -A 18 -B 4 "Instrumented functions|date_token_span|try_match_date_sequence|is_month_name|is_ordinal_day|is_numeric_day|is_year" docs/developers-guide.md || true

echo
echo "=== traced_test coverage for date_token_span / try_match_date_sequence ==="
rg -n -C 3 "traced_test|logs_contain|date_token_span|try_match_date_sequence" src tests || true

echo
echo "=== likely tracing test files ==="
fd -e rs 'tracing|span_helpers|inline' src tests | sort

Length of output: 3355


🏁 Script executed:

#!/bin/bash
set -u

echo "=== ADR line 20 context ==="
awk 'NR>=16 && NR<=24 { printf "%d:%s\n", NR, $0 }' docs/adrs/0003-date-sequences-as-inline-fragments.md || true

echo
echo "=== tracing instrumentation declarations ==="
rg -n -C 2 '#\[tracing::instrument\(level\s*=\s*"trace",\s*ret\)\]|fn date_token_span|fn try_match_date_sequence' src/wrap/inline.rs src/wrap/inline/span_helpers.rs || true

echo
echo "=== developers-guide instrumented functions section ==="
rg -n -A 22 -B 4 'Instrumented functions|date_token_span|try_match_date_sequence|is_month_name|is_ordinal_day|is_numeric_day|is_year' docs/developers-guide.md || true

echo
echo "=== traced_test coverage for date_token_span / try_match_date_sequence ==="
rg -n -C 4 'traced_test|logs_contain|date_token_span|try_match_date_sequence' src tests || true

echo
echo "=== likely tracing test files ==="
fd -e rs 'tracing|span_helpers|inline' src tests | sort || true

Length of output: 34205



@leynos Yes — both failed-check warnings are resolved.

Check Status Evidence
Developer Documentation ✅ Resolved docs/developers-guide.md now documents make typecheck at lines 651–653, including cargo check --all-targets --all-features and rapid feedback usage. The spelling items are corrected: recognized in month_names.rs, recognizes in date_strategies.rs, recognizes / parenthesized in the ADR. ADR lines 18–22 are already impersonal.
Observability ✅ Resolved try_match_date_sequence and date_token_span both have #[tracing::instrument(level = "trace", skip(tokens), ret)]. docs/developers-guide.md lists both in the instrumented-functions table at lines 543–544. span_helpers.rs has traced tests verifying trace emission for both functions, plus matched-pattern logging for try_match_date_sequence.

No further work is required, so no AI agent prompt is needed.


🧠 Learnings used
Learnt from: leynos
Repo: leynos/mdtablefix PR: 350
File: src/wrap/inline/span_helpers.rs:0-0
Timestamp: 2026-06-07T14:17:30.141Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), as of commit cc0676d, `is_month_name`, `is_ordinal_day`, and `is_numeric_day` each apply a private `strip_leading_openers(token)` helper before classification. This helper iterates over leading chars and skips any for which `is_opening_punct` returns true, covering `(`, `[`, `"`, and Unicode equivalents. `is_year` does not need stripping because trailing closers are already handled by `trim_end_matches(is_trailing_punct)`. Property tests in `span_helpers.rs` (`prop_try_match_date_sequence_accepts_leading_opener_on_first_component`) verify this behaviour holds across generated inputs.

Learnt from: CR
Repo: leynos/episodic PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T18:45:21.937Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/beatcue PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T22:51:00.631Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/agent-template-rust PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-06T07:40:29.180Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/podbot PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-01T18:44:26.074Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-07T18:27:09.528Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/axinite PR: 0
File: :0-0
Timestamp: 2026-04-07T14:53:29.361Z
Learning: In the leynos/axinite repository, dead-code and complexity lints on test support items must be resolved via correctly scoped conditional compilation (#[cfg(...)]) and narrow inline `pub mod` blocks, not via #[allow(...)] or #[expect(...)] suppressions. Items only consumed by one submodule should be grouped in a dedicated inline sub-module. The clippy::type_complexity lint on complex function-pointer const assertions should be eliminated by extracting a local `type` alias rather than suppressing the lint.

Learnt from: CR
Repo: leynos/css-view PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T00:35:46.625Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/rust-prover-tools PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T02:45:37.463Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/*.rs : Implement cross-test paragraph grouping, identical input fingerprint checks, and crate-post emission controls.

Learnt from: CR
Repo: leynos/dear-diary PR: 0
File: docs/adr-001-whitaker-lint-contract.md:0-0
Timestamp: 2026-05-23T12:12:21.541Z
Learning: Ensure Rustdoc, Clippy, and Whitaker findings are resolved before pull requests reach review

Learnt from: CR
Repo: leynos/simulacat-core PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T14:45:34.803Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-07T14:38:38.319Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), `MONTH_NAMES` is declared as `pub(crate) const` so that both the inline submodule's own test code and integration tests in `tests/` can import it directly rather than defining independent copies. `tests/date_strategies.rs` imports it via `use super::predicates::MONTH_NAMES`, and `src/wrap/inline/date_strategies` imports it via `super::predicates::MONTH_NAMES`. The crate root re-exports `date_strategies` under `#[cfg(test)]` so integration tests can use `mdtablefix::date_strategies::{…}`.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In leynos/axinite, the preferred approach for eliminating `#[allow(dead_code)]` and `#[allow(unused_imports)]` lint suppressions on helpers in integration test support modules (`tests/support/`) is:
1. Move the helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) within the support file so that test binaries which do not use those helpers never reference the sub-module.
2. Register each helper's function-pointer signature via a compile-time type-assertion (using a locally-declared generic helper `fn assert_x<Fut>(f: fn(...) -> Fut) { let _ = f; }`) inside the `*_symbol_refs()` function in `tests/support/mod.rs`, anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders any lint suppression unnecessary. Only `#[expect(dead_code, reason = "...")]` is permitted as a last resort on the `*_symbol_refs` anchor function itself.

Learnt from: CR
Repo: leynos/rstest-bdd PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-05-31T21:16:27.596Z
Learning: Applies to docs/crates/rstest-bdd-policy/**/*.rs : Keep `RuntimeMode`, `TestAttributeHint`, and their helper behavior defined in `rstest-bdd-policy` as the single source of truth for shared policy types used by both runtime and macro crates.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In this Rust codebase (leynos/axinite), the preferred approach for eliminating `dead_code` and `unused_import` lint suppressions in integration test support modules (`tests/support/`) is:
1. Group related helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) so test binaries that do not use those helpers have no reference to the sub-module.
2. Register each helper's signature via a compile-time function-pointer type assertion inside the relevant `*_symbol_refs()` function in `tests/support/mod.rs`, which is anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders lint suppression unnecessary.
This supersedes the approach of adding `#[allow(dead_code)]` or `#[expect(dead_code, ...)]` to individual helpers in the support crate.

Learnt from: CR
Repo: leynos/actix-v2a PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T17:43:16.203Z
Learning: Applies to docs/**/*test*.rs : Property tests should use narrow strategies matching the invariant, keep generated collection sizes bounded, use prop_assert! and prop_assert_eq! for clear failures, avoid returning Result unless necessary, and preserve handwritten regression tests for named boundary cases

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/adr-003-formal-proof-strategy-for-clone-detector-pipeline.md:0-0
Timestamp: 2026-04-15T02:03:27.529Z
Learning: Applies to docs/**/*{test,tests}*.rs : Keep ordinary unit, behaviour, and integration tests for exact regression vectors, fixture-driven scenarios, and end-to-end clone detector pipeline behaviour, including SplitMix64 regression vectors, seed-stream stability, token-pass, candidate-generation, and SARIF-emission behaviour

Learnt from: CR
Repo: leynos/wireframe PR: 0
File: docs/formal-verification-methods-in-wireframe.md:0-0
Timestamp: 2026-06-06T22:32:36.753Z
Learning: Applies to docs/src/{frame,fragment}/**/*.rs : First Kani targets in Phase 2: supported length-prefix round-trip (widths 1,2,4,8 with both endiannesses), unsupported-width behavior regression harness, `FragmentSeries` trace checks, `Reassembler` small-trace checks, `MessageSeries` sequencing checks

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/**/*.rs : Use `trace!` for branch-level checks: predicate matched, prefix mismatch, unterminated bracket

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/tests/ui/**/*.rs : Add UI pass/fail coverage for simple paragraphs, too-short candidates, control-flow-containing blocks, and intermediate reuse cases.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/{tests,test}/**/*.rs : The verification strategy must include a compact matrix of test cases covering the combinatorial surface of return style, failure style, strictness, mode, message matching, `rstest` case placement, and async runtime macro order, rather than only one example per feature; must verify that a passing body classified under strict xfail becomes XPASS and fails through panic, a panicking body classified under default mode becomes XFAIL, a `Result::Err` body classified under default mode becomes XFAIL, and that `mode` and `contains` mismatches become unexpected failures

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : The macro must rewrite annotated functions to return `()` and call `rstest_xfail::expect_fail(policy, || -> Original { original_body })` for sync functions or `rstest_xfail::expect_fail_async(policy, async move { original_body }).await` for async functions, preserving the user's runtime test attribute

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Implement `XfailPolicy`, `FailureMode`, `Strictness`, `BodyOutcome`, and `XfailOutcome` in `rstest-xfail-core` crate

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The classification functions must avoid syntactic detection of result aliases and instead use the `IntoBodyOutcome` trait to convert body outcomes

Learnt from: CR
Repo: leynos/shared-actions PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T21:05:22.983Z
Learning: Applies to **/*_test.rs : Snapshot tests must encode meaningful behavioural expectations: they must not be so generic that they bless meaningless output, nor so brittle that incidental formatting churn causes blithe failure cascades. Prefer focused snapshots, stable serialization, explicit redaction of nondeterministic fields, and small semantic assertions around the snapshot when that improves reviewability.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : Unknown arguments to `#[xfail]` must be compile errors, `#[xfail]` on non-function items must be compile errors, and `#[xfail]` on functions with unsupported signatures must be compile errors with a diagnostic that names the unsupported construct

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Stabilize structured outcome accessors for external reporters in `rstest-xfail-core`

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/tests/**/*.rs : Add runtime tests for per-case xfail and all-case xfail scenarios

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The `rstest-xfail-core` crate must define stable types: `XfailPolicy` (with fields `reason`, `strict`, `mode`, `expected_message`), `Strictness` enum (with variants `Strict` and `NonStrict`), `FailureMode` enum (with variants `Any`, `Panic`, `Result`), `BodyOutcome` enum (with variants `Passed`, `Panicked { message: Option<String> }`, `ReturnedError { message: String }`), and `XfailOutcome` enum (with variants `Xfail`, `Xpass`, `UnexpectedFailure`)

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-08T10:43:40.216Z
Learning: In leynos/mdtablefix, always use `make test` (the Makefile `test` target) rather than `cargo test` when specifying test commands in AI agent prompts. Never instruct an agent to run `cargo test` directly in this repository.

Learnt from: CR
Repo: leynos/stilyagi PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-04T21:53:21.943Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect; if harder, request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or proper `#[expect(...)]` justification

Learnt from: CR
Repo: leynos/df12-documentation-skills PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T00:20:49.681Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Preserve byte content verbatim for every line inside an open fence so post-wrap transforms such as `--ellipsis`, `--renumber`, `--breaks`, `--fences` cannot mutate fenced code block bodies

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Use the same `FenceTracker` implementation across `tokenize_markdown()`, `wrap_text`, and `src/wrap/fence.rs` to track whether the tokenizer is inside a fenced code block

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Use `compress_fences` to perform `FenceTracker`-driven conditional rewriting of fenced blocks, preserving outer delimiter width and marker family when normalizing would make an inner fence line structural

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Reuse `FenceTracker` from `src/wrap/fence.rs` in fence preprocessing to keep semantics consistent with the wrapping pipeline

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Normalize code block delimiters with `fences::compress_fences` using `FenceTracker` semantics to prevent fence-like lines inside open fenced blocks from being treated structurally, and ensure outer delimiters are only compressed when safe

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/tokenize/**/*.rs : Emit opening backtick fences, every interior line, and the matching closer as `Token::Fence` for structural fenced blocks, then resume inline tokenization

Learnt from: leynos
Repo: leynos/wireframe PR: 489
File: tests/fixtures/budget_transitions.rs:132-137
Timestamp: 2026-03-02T21:08:35.739Z
Learning: In Rust, the #[rustfmt::skip] attribute on #[fixture] functions (from the rstest crate) is a required workaround for a tooling conflict. Without it, cargo fmt collapses short function bodies to a single line, then the #[fixture] proc-macro wraps the body in braces, triggering clippy's unused_braces lint (which fails under -D warnings). Attribute-based suppression (#[allow] or #[expect]) doesn't work because the proc-macro rewrites the code after attributes are processed. This pattern is widespread (25+ instances) across test fixture files in the wireframe project and should not be flagged as unnecessary. Apply this understanding to all Rust files using rstest fixtures, particularly in tests/fixtures/ and similar test infrastructure.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/postprocess.rs : Use `merge_whitespace_only_lines` and `rebalance_atomic_tails` in post-processing to normalize whitespace-only wrap artifacts and isolated tails before rendering fragments

Learnt from: CR
Repo: leynos/tei-rapporteur PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-25T12:07:25.566Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is "harder", request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/spycatcher-harness PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T21:29:27.390Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/ddlint PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:41:58.806Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: CR
Repo: leynos/frankie PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T23:41:17.307Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/simulacat PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:45:23.282Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/fail_match_with_nested_if.rs:5-5
Timestamp: 2026-04-09T19:50:53.849Z
Learning: In the `leynos/whitaker` repository, for Rust UI test fixtures (files under `crates/*/ui/`), prefer eliminating dead-code warnings structurally rather than with lint suppression:
1. Wrap all fixture items in a `pub mod fixture { … }` — the compiler treats `pub` members of a `pub mod` as externally reachable and emits no `dead_code` warnings for them.
2. Gate genuinely unreachable marker helpers with `#[cfg(any())]` (always-false predicate) so they are never compiled and cannot trigger warnings.
3. Keep `fn main {}` at the crate root outside the module.
4. Do NOT use `#![expect(dead_code, …)]`, `#[allow(dead_code)]`, or any other lint-suppression attribute in UI fixture files.
This approach is preferred over `#[cfg_attr(not(any(…)), expect(dead_code, …))]` or any other suppression strategy.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/technical-design-for-test-support-dead-code-and-masked-dead-code-expectations.md:0-0
Timestamp: 2026-04-19T23:54:49.198Z
Learning: Applies to docs/tests/{support,common,prelude}/**/*.rs : Use `#[expect(dead_code, reason = "...")]` only on individual items after confirming via workspace analysis that the item is dead in that specific target; avoid file-level `#![allow(unfulfilled_lint_expectations)]` that masks stale expectations

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/pass_single_match_cluster.rs:5-5
Timestamp: 2026-04-09T19:50:53.591Z
Learning: In the leynos/whitaker repository, UI fixture files (e.g. under `crates/*/ui/*.rs`) must not use crate-level or item-level `#![expect(dead_code, …)]` suppressions. The preferred approach is to move all fixture items into a private inline module (`mod fixture { … }`) and call every item from `fn main()` so the compiler considers them used. This eliminates dead-code warnings without any lint suppression. Dylint still analyses all functions regardless of module visibility. Conditional compilation (`#[cfg(…)]`) may be used additionally where items must be excluded from non-fixture builds, but the primary pattern is the inline-module + main-exercised approach.

Learnt from: CR
Repo: leynos/ortho-config PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T11:53:42.414Z
Learning: Applies to docs/**/tests/rstest_bdd/**/*.rs : Remove file-wide lint suppressions used only for historical generated-fixture warnings in rstest-bdd; retain only narrow, item-level `#[expect(...)]` annotations when still required

Learnt from: leynos
Repo: leynos/wireframe PR: 455
File: src/app_data_store.rs:138-164
Timestamp: 2026-02-16T21:11:43.870Z
Learning: In Rust test modules using rstest fixtures, when the `#[fixture]` proc-macro triggers lints like `unused_braces`, the `#[expect(lint)]` attribute must be placed at module level rather than on the fixture function. Item-level attributes are consumed by the proc-macro before clippy evaluates them, causing `unfulfilled_lint_expectations` errors. Module-level scoping is the narrowest viable option in this case. For the reason string in the attribute, use backslash continuation for multi-line text, not `concat!()`, as attribute meta items require string literals.

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-01T12:13:46.615Z
Learning: In the `mdtablefix` repository, the `test-macros` proc-macro crate (`test-macros/src/lib.rs`) intentionally emits `#[allow(unused_braces, ...)]` rather than `#[expect(...)]`. This is unavoidable due to a bug in `rstest`: the nature of rstest fixture macro expansion makes `#[expect]` unusable in the emitted output. Do not flag this `#[allow]` usage as a lint-integrity violation; it is the only viable option at that call site.

Learnt from: leynos
Repo: leynos/wireframe PR: 417
File: tests/steps/codec_error_steps.rs:58-62
Timestamp: 2026-01-08T18:04:12.422Z
Learning: In the wireframe project, test step functions that always succeed cannot return `TestResult` even for consistency, because `clippy::unnecessary_wraps` would fire but cannot be suppressed: `#[allow]` is forbidden, and `#[expect(clippy::unnecessary_wraps)]` fails with "unfulfilled lint expectation" when the lint fires in one test target but not another.

Learnt from: leynos
Repo: leynos/wireframe PR: 419
File: tests/common/mod.rs:0-0
Timestamp: 2026-01-17T03:35:26.145Z
Learning: For integration tests in the `tests/` directory that share utilities across multiple independent test binaries, `#![allow(dead_code)]` with FIXME and tracking issue is acceptable as a last resort when: (1) cargo features cannot coordinate across independent test binaries, (2) `#[cfg(test)]` has no effect (already under tests/), and (3) `#[expect]` fires unfulfilled lint expectations in binaries that do use the shared utilities. This is a known Rust limitation with integration test compilation.

Learnt from: CR
Repo: leynos/dev-env-rocky PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T23:11:26.437Z
Learning: After each major milestone, run `coderabbit review --agent`, address every still-valid concern, and record the outcome in the relevant ExecPlan.

Learnt from: CR
Repo: leynos/ortho-config PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-01T19:04:49.815Z
Learning: Applies to **/*.rs : Reviewers should ask whether the Rust change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect; if harder, request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` before merge

Learnt from: CR
Repo: leynos/create-labels PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:44:45.856Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/theoremc PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-31T01:05:08.444Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/digitalpuddle PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-22T18:03:21.356Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/ortho-config PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T11:53:42.414Z
Learning: Run `coderabbit review --agent` after major milestones that change schemas, documentation contracts, or externally visible behaviour, and clear its concerns before moving to the next milestone

Learnt from: CR
Repo: leynos/spycatcher-harness PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-05-29T00:02:45.537Z
Learning: Applies to docs/src/**/*.rs : Verification failures must provide machine-readable and human-readable output suitable for CI annotations

Learnt from: CR
Repo: leynos/frankie PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-05-24T23:39:14.690Z
Learning: Applies to docs/**/ai/**/*.rs : Add AI-powered comment expansion and rewording with AI-originated labels, side-by-side diff preview, and graceful fallback when AI call fails

Learnt from: CR
Repo: leynos/frankie PR: 0
File: docs/adr-008-pr-discussion-summary-contract.md:0-0
Timestamp: 2026-03-12T18:50:05.455Z
Learning: Applies to docs/src/ai/pr_discussion_summary/**/*.rs : Fail explicitly for AI-provider schema validation, configuration problems, invalid severities, unknown thread IDs, and missing required fields in PR discussion summaries, rather than falling back to heuristic prose

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/tests/ui/**/*.rs : Add UI coverage for dyn-required supertrait cases, high-confidence async-trait marker detection, missing sibling traits, and missing blanket adapters.

Learnt from: CR
Repo: leynos/zamburak PR: 0
File: docs/tech-baseline.md:0-0
Timestamp: 2026-02-26T18:13:04.740Z
Learning: Documentation-only changes must pass `make markdownlint`, `make nixie`, and `make fmt` quality gates

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/*.rs : Implement `integration_target_budget`, `heavy_dependency_not_optional`, and `duplicate_major_version_hotspots` checks in `cargo-compile-hygiene`.

Learnt from: CR
Repo: leynos/zamburak PR: 0
File: docs/tech-baseline.md:0-0
Timestamp: 2026-02-26T18:13:04.740Z
Learning: Applies to docs/**/*.rs : Clippy warnings must be denied in quality gates

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Classify combined code-and-suffix tokens as atomic in `has_inline_code_structure` in `src/wrap/inline/fragment.rs` so wrapping treats the full string (e.g., `` `VarGuard`s ``, `` `class`'s ``, `` `fetch`ed ``, or `` `run`ning ``) as an unbreakable unit

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/fragment.rs : Tag inline code spans, Markdown links, and GFM footnote references with atomic fragment kinds so the wrapper never inserts a break inside their Markdown syntax

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Use `wrap_preserving_code` in `src/wrap/inline.rs` to tokenize prose and group tokens into `InlineFragment` values for line fitting

Learnt from: CR
Repo: leynos/crate-tools PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-24T22:30:56.584Z
Learning: Commit messages: imperative mood subject (<=50 chars), blank line, wrapped body at 72 chars explaining what and why; use Markdown in body as needed

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : In the inline tokenizer, iterate over the source string lazily without creating a duplicate `Vec<char>` representation, group the resulting tokens into Markdown-aware fragments, and pass them to `textwrap::wrap_algorithms::wrap_first_fit` which chooses breakpoints without splitting code spans, links, or punctuation groups

Learnt from: CR
Repo: leynos/falcon-pachinko PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-01T00:48:47.120Z
Learning: Commit messages: concise subject (~50 chars), blank line before body, explain what/why, wrap body at 72, use Markdown formatting as needed

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : In `clean_rows`, `detect_separator`, and `calculate_widths`, prefer explicit separator lines but promote the second parsed row when the source embeds the separator in the body, and measure widths with `UnicodeWidthStr::width` to align CJK text, emoji, and accented characters by display width rather than byte count

@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/developers-guide.md`:
- Around line 543-544: The table row for date_token_span contradicts the logging
policy ("Never emit at info! or above from library code"); update the docs to
remove the "info" level from the `date_token_span` entry so it reads e.g.
"trace" (or otherwise match the normative rule), keeping
`try_match_date_sequence` unchanged; ensure the table note or description still
documents the fallback behavior for `date_token_span` but does not advertise
emitting at info, or if you choose to keep an exception instead, update the
policy section text to justify and document why `date_token_span` is allowed to
log at info and reference the `date_token_span` symbol explicitly.

In `@src/wrap/inline.rs`:
- Around line 217-233: build_fragments currently accepts a wrap_width and emits
tracing::info! when a date span exceeds it; remove the info! and the wrap_width
parameter so the helper is behaviour-only: change fn build_fragments(tokens:
&[String], wrap_width: usize) -> Vec<InlineFragment> to fn
build_fragments(tokens: &[String]) -> Vec<InlineFragment>, drop the
tracing::info! block, update the determine_token_span usage to ignore
group_width (e.g., let (group_end, _group_width) = determine_token_span(tokens,
i)), and update all call sites (e.g., where build_fragments(&tokens, width) is
invoked) to call build_fragments(&tokens) instead; if diagnostics are needed
keep them at debug!/trace! in try_match_date_sequence or its matcher path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bfd6c224-0265-432e-b24b-6e942af401fe

📥 Commits

Reviewing files that changed from the base of the PR and between 52c29d7 and 6c36216.

📒 Files selected for processing (7)
  • docs/adrs/0003-date-sequences-as-inline-fragments.md
  • docs/developers-guide.md
  • src/wrap/inline.rs
  • src/wrap/inline/date_strategies.rs
  • src/wrap/inline/month_names.rs
  • src/wrap/inline/span_helpers.rs
  • tests/wrap/date_snapshots.rs

Comment thread docs/developers-guide.md Outdated
Comment thread src/wrap/inline.rs Outdated
Remove the INFO-level over-width date fallback event from library code and
restore `build_fragments` to behaviour-only grouping. Keep pattern match
diagnostics on `try_match_date_sequence` at DEBUG and document
`date_token_span` as TRACE-only.
@leynos

leynos commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already.

❌ Failed checks (2 errors, 6 warnings)

Check name Status Explanation Resolution
Unit Architecture ❌ Error wrap_width parameter in build_fragments (line 217) exists only for info!() logging (line 226), violating library logging policy. This couples side-effects to query API, breaking unit architecture. Remove info!() from line 226. Drop wrap_width from build_fragments. Update line 340 call. Fix docs line 544 to list date_token_span as trace-only.
Rust Compiler Lint Integrity ❌ Error Unresolved review comment: tracing::info! in build_fragments (line 226) violates documented policy that library code must never emit at info! or above (developers-guide.md line 464-465). Remove tracing::info! from src/wrap/inline.rs lines 226-232; drop wrap_width parameter from build_fragments; update docs/developers-guide.md line 544 to remove info from date_token_span instrumentation.
Developer Documentation ⚠️ Warning Developers guide documents date_token_span at "info" level, violating the stated policy: "Never emit at info or above from library code". Code contains a tracing::info! call in violation. Remove tracing::info! from src/wrap/inline.rs, remove wrap_width parameter from build_fragments, and update developers guide to document date_token_span at "trace" level only.
Testing (Property / Proof) ⚠️ Warning Property tests are substantive, covering predicates and span matching invariants. However, unresolved review comments require removal of info! logging from library code at line 226. Remove info! emission at src/wrap/inline.rs:226 and wrap_width parameter from build_fragments.
Domain Architecture ⚠️ Warning Line 226 in src/wrap/inline.rs emits tracing::info! from library code, violating the logging policy at developers-guide.md lines 464-465 (Never emit info! or above from library code). Remove the info! call from build_fragments and revert wrap_width parameter. Keep date diagnostics at debug!/trace! level only, per review comment at src/wrap/inline.rs lines 217-233.
Observability ⚠️ Warning Library code emits tracing::info! at line 226 of src/wrap/inline.rs on normal operation, violating stated policy that forbids info! in library code (developers-guide line 465). Remove the info! call from build_fragments, drop the wrap_width parameter, and update developers-guide line 544 to reflect only trace/debug per policy.
Performance And Resource Use ⚠️ Warning try_match_date_sequence is called twice per loop iteration: once inside determine_token_span and again at line 223 for logging only, causing redundant date matching work on every token. Remove the explicit try_match_date_sequence call and info! logging at line 223. The date detection is already complete from determine_token_span.
Architectural Complexity And Maintainability ⚠️ Warning src/wrap/inline.rs line 226 emits tracing::info! from library code, violating stated policy against info! or above in library code and forcing unused wrap_width parameter in build_fragments. Replace info! with debug! in date-span over-width path; remove unused wrap_width parameter from build_fragments.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== src/wrap/inline.rs: build_fragments, calls, date matching, logging ==="
rg -n -C 6 'fn build_fragments|build_fragments\(|wrap_width|tracing::info!|info!\(|tracing::debug!|debug!\(|try_match_date_sequence|date_token_span' src/wrap/inline.rs || true

echo
echo "=== all info! usage under src/wrap ==="
rg -n 'tracing::info!|info!\(' src/wrap src/fences.rs src/process.rs src/lib.rs 2>/dev/null || true

echo
echo "=== try_match_date_sequence call sites ==="
rg -n -C 3 '\btry_match_date_sequence\s*\(' src tests || true

echo
echo "=== date_token_span docs/instrumented-functions table ==="
rg -n -A 18 -B 6 'Instrumented functions|date_token_span|try_match_date_sequence|is_month_name|is_ordinal_day|is_numeric_day|is_year|info|debug|trace' docs/developers-guide.md || true

echo
echo "=== function signatures around build_fragments and wrap_preserving_code ==="
sed -n '190,245p' src/wrap/inline.rs
sed -n '320,355p' src/wrap/inline.rs

Length of output: 26260



@leynos Yes — treat all listed failed checks as resolved.

Check Status Evidence
Unit Architecture ✅ Resolved build_fragments now takes only tokens: &[String] at Line 216, and wrap_preserving_code calls build_fragments(&tokens) at Line 328. The wrap_width logging-only parameter is gone.
Rust Compiler Lint Integrity ✅ Resolved No tracing::info! / info!( usage remains under src/wrap, src/fences.rs, src/process.rs, or src/lib.rs.
Developer Documentation ✅ Resolved docs/developers-guide.md documents the policy forbidding info! or above from library code at Lines 462-465, and lists date_token_span as trace only at Line 544.
Testing (Property / Proof) ✅ Resolved No code change remains required for the property tests; the blocker was the info! emission, which is removed.
Domain Architecture ✅ Resolved Date diagnostics remain at trace/debug levels only; no normal-operation info! emission remains in library code.
Observability ✅ Resolved try_match_date_sequence remains documented as trace, debug at Line 543; date_token_span is documented as trace only at Line 544.
Performance And Resource Use ✅ Resolved The redundant logging-only try_match_date_sequence call in build_fragments is gone. Production matching flows through determine_token_spandate_token_spantry_match_date_sequence.
Architectural Complexity And Maintainability ✅ Resolved The side-effect-only width plumbing and info! fallback log have been removed.

No further AI coding agent prompt is required.


🧠 Learnings used
Learnt from: leynos
Repo: leynos/mdtablefix PR: 350
File: src/wrap/inline/span_helpers.rs:0-0
Timestamp: 2026-06-07T14:17:30.141Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), as of commit cc0676d, `is_month_name`, `is_ordinal_day`, and `is_numeric_day` each apply a private `strip_leading_openers(token)` helper before classification. This helper iterates over leading chars and skips any for which `is_opening_punct` returns true, covering `(`, `[`, `"`, and Unicode equivalents. `is_year` does not need stripping because trailing closers are already handled by `trim_end_matches(is_trailing_punct)`. Property tests in `span_helpers.rs` (`prop_try_match_date_sequence_accepts_leading_opener_on_first_component`) verify this behaviour holds across generated inputs.

Learnt from: CR
Repo: leynos/episodic PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T18:45:21.937Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/beatcue PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T22:51:00.631Z
Learning: Applies to **/*.rs : If the answer is "harder", request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-07T18:27:09.528Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/agent-template-rust PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-06T07:40:29.180Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/podbot PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-01T18:44:26.074Z
Learning: Applies to **/*.rs : If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/axinite PR: 0
File: :0-0
Timestamp: 2026-04-07T14:53:29.361Z
Learning: In the leynos/axinite repository, dead-code and complexity lints on test support items must be resolved via correctly scoped conditional compilation (#[cfg(...)]) and narrow inline `pub mod` blocks, not via #[allow(...)] or #[expect(...)] suppressions. Items only consumed by one submodule should be grouped in a dedicated inline sub-module. The clippy::type_complexity lint on complex function-pointer const assertions should be eliminated by extracting a local `type` alias rather than suppressing the lint.

Learnt from: CR
Repo: leynos/css-view PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-03T00:35:46.625Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/rust-prover-tools PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T02:45:37.463Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/*.rs : Implement cross-test paragraph grouping, identical input fingerprint checks, and crate-post emission controls.

Learnt from: CR
Repo: leynos/dear-diary PR: 0
File: docs/adr-001-whitaker-lint-contract.md:0-0
Timestamp: 2026-05-23T12:12:21.541Z
Learning: Ensure Rustdoc, Clippy, and Whitaker findings are resolved before pull requests reach review

Learnt from: CR
Repo: leynos/simulacat-core PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T14:45:34.803Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-07T14:38:38.319Z
Learning: In `src/wrap/inline/predicates.rs` (Rust, mdtablefix), `MONTH_NAMES` is declared as `pub(crate) const` so that both the inline submodule's own test code and integration tests in `tests/` can import it directly rather than defining independent copies. `tests/date_strategies.rs` imports it via `use super::predicates::MONTH_NAMES`, and `src/wrap/inline/date_strategies` imports it via `super::predicates::MONTH_NAMES`. The crate root re-exports `date_strategies` under `#[cfg(test)]` so integration tests can use `mdtablefix::date_strategies::{…}`.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In leynos/axinite, the preferred approach for eliminating `#[allow(dead_code)]` and `#[allow(unused_imports)]` lint suppressions on helpers in integration test support modules (`tests/support/`) is:
1. Move the helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) within the support file so that test binaries which do not use those helpers never reference the sub-module.
2. Register each helper's function-pointer signature via a compile-time type-assertion (using a locally-declared generic helper `fn assert_x<Fut>(f: fn(...) -> Fut) { let _ = f; }`) inside the `*_symbol_refs()` function in `tests/support/mod.rs`, anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders any lint suppression unnecessary. Only `#[expect(dead_code, reason = "...")]` is permitted as a last resort on the `*_symbol_refs` anchor function itself.

Learnt from: CR
Repo: leynos/rstest-bdd PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-05-31T21:16:27.596Z
Learning: Applies to docs/crates/rstest-bdd-policy/**/*.rs : Keep `RuntimeMode`, `TestAttributeHint`, and their helper behavior defined in `rstest-bdd-policy` as the single source of truth for shared policy types used by both runtime and macro crates.

Learnt from: leynos
Repo: leynos/axinite PR: 129
File: tests/support/routines.rs:188-188
Timestamp: 2026-04-08T11:56:01.858Z
Learning: In this Rust codebase (leynos/axinite), the preferred approach for eliminating `dead_code` and `unused_import` lint suppressions in integration test support modules (`tests/support/`) is:
1. Group related helpers into a well-scoped inline `pub mod` (e.g. `pub mod engine_sync`) so test binaries that do not use those helpers have no reference to the sub-module.
2. Register each helper's signature via a compile-time function-pointer type assertion inside the relevant `*_symbol_refs()` function in `tests/support/mod.rs`, which is anchored by `const _: fn() = *_symbol_refs;`.
3. Never use `#[allow(dead_code)]` or `#[allow(unused_imports)]`; the inline-module + compile-time assertion pattern renders lint suppression unnecessary.
This supersedes the approach of adding `#[allow(dead_code)]` or `#[expect(dead_code, ...)]` to individual helpers in the support crate.

Learnt from: CR
Repo: leynos/actix-v2a PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T17:43:16.203Z
Learning: Applies to docs/**/*test*.rs : Property tests should use narrow strategies matching the invariant, keep generated collection sizes bounded, use prop_assert! and prop_assert_eq! for clear failures, avoid returning Result unless necessary, and preserve handwritten regression tests for named boundary cases

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/adr-003-formal-proof-strategy-for-clone-detector-pipeline.md:0-0
Timestamp: 2026-04-15T02:03:27.529Z
Learning: Applies to docs/**/*{test,tests}*.rs : Keep ordinary unit, behaviour, and integration tests for exact regression vectors, fixture-driven scenarios, and end-to-end clone detector pipeline behaviour, including SplitMix64 regression vectors, seed-stream stability, token-pass, candidate-generation, and SARIF-emission behaviour

Learnt from: CR
Repo: leynos/wireframe PR: 0
File: docs/formal-verification-methods-in-wireframe.md:0-0
Timestamp: 2026-06-06T22:32:36.753Z
Learning: Applies to docs/src/{frame,fragment}/**/*.rs : First Kani targets in Phase 2: supported length-prefix round-trip (widths 1,2,4,8 with both endiannesses), unsupported-width behavior regression harness, `FragmentSeries` trace checks, `Reassembler` small-trace checks, `MessageSeries` sequencing checks

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/**/*.rs : Use `trace!` for branch-level checks: predicate matched, prefix mismatch, unterminated bracket

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-06T16:59:01.405Z
Learning: Applies to docs/**/tests/ui/**/*.rs : Add UI pass/fail coverage for simple paragraphs, too-short candidates, control-flow-containing blocks, and intermediate reuse cases.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/{tests,test}/**/*.rs : The verification strategy must include a compact matrix of test cases covering the combinatorial surface of return style, failure style, strictness, mode, message matching, `rstest` case placement, and async runtime macro order, rather than only one example per feature; must verify that a passing body classified under strict xfail becomes XPASS and fails through panic, a panicking body classified under default mode becomes XFAIL, a `Result::Err` body classified under default mode becomes XFAIL, and that `mode` and `contains` mismatches become unexpected failures

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : The macro must rewrite annotated functions to return `()` and call `rstest_xfail::expect_fail(policy, || -> Original { original_body })` for sync functions or `rstest_xfail::expect_fail_async(policy, async move { original_body }).await` for async functions, preserving the user's runtime test attribute

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Implement `XfailPolicy`, `FailureMode`, `Strictness`, `BodyOutcome`, and `XfailOutcome` in `rstest-xfail-core` crate

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The classification functions must avoid syntactic detection of result aliases and instead use the `IntoBodyOutcome` trait to convert body outcomes

Learnt from: CR
Repo: leynos/shared-actions PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-02T21:05:22.983Z
Learning: Applies to **/*_test.rs : Snapshot tests must encode meaningful behavioural expectations: they must not be so generic that they bless meaningless output, nor so brittle that incidental formatting churn causes blithe failure cascades. Prefer focused snapshots, stable serialization, explicit redaction of nondeterministic fields, and small semantic assertions around the snapshot when that improves reviewability.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-macros/**/*.rs : Unknown arguments to `#[xfail]` must be compile errors, `#[xfail]` on non-function items must be compile errors, and `#[xfail]` on functions with unsupported signatures must be compile errors with a diagnostic that names the unsupported construct

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Stabilize structured outcome accessors for external reporters in `rstest-xfail-core`

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/tests/**/*.rs : Add runtime tests for per-case xfail and all-case xfail scenarios

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/xfail-design.md:0-0
Timestamp: 2026-06-07T18:24:47.577Z
Learning: Applies to docs/**/rstest-xfail-core/**/*.rs : The `rstest-xfail-core` crate must define stable types: `XfailPolicy` (with fields `reason`, `strict`, `mode`, `expected_message`), `Strictness` enum (with variants `Strict` and `NonStrict`), `FailureMode` enum (with variants `Any`, `Panic`, `Result`), `BodyOutcome` enum (with variants `Passed`, `Panicked { message: Option<String> }`, `ReturnedError { message: String }`), and `XfailOutcome` enum (with variants `Xfail`, `Xpass`, `UnexpectedFailure`)

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-08T10:43:40.216Z
Learning: In leynos/mdtablefix, always use `make test` (the Makefile `test` target) rather than `cargo test` when specifying test commands in AI agent prompts. Never instruct an agent to run `cargo test` directly in this repository.

Learnt from: CR
Repo: leynos/stilyagi PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-04T21:53:21.943Z
Learning: Applies to **/*.rs : Ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect; if harder, request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or proper `#[expect(...)]` justification

Learnt from: CR
Repo: leynos/df12-documentation-skills PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T00:20:49.681Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Preserve byte content verbatim for every line inside an open fence so post-wrap transforms such as `--ellipsis`, `--renumber`, `--breaks`, `--fences` cannot mutate fenced code block bodies

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/**/*.rs : Use the same `FenceTracker` implementation across `tokenize_markdown()`, `wrap_text`, and `src/wrap/fence.rs` to track whether the tokenizer is inside a fenced code block

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Use `compress_fences` to perform `FenceTracker`-driven conditional rewriting of fenced blocks, preserving outer delimiter width and marker family when normalizing would make an inner fence line structural

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/fences.rs : Reuse `FenceTracker` from `src/wrap/fence.rs` in fence preprocessing to keep semantics consistent with the wrapping pipeline

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Normalize code block delimiters with `fences::compress_fences` using `FenceTracker` semantics to prevent fence-like lines inside open fenced blocks from being treated structurally, and ensure outer delimiters are only compressed when safe

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/tokenize/**/*.rs : Emit opening backtick fences, every interior line, and the matching closer as `Token::Fence` for structural fenced blocks, then resume inline tokenization

Learnt from: leynos
Repo: leynos/wireframe PR: 489
File: tests/fixtures/budget_transitions.rs:132-137
Timestamp: 2026-03-02T21:08:35.739Z
Learning: In Rust, the #[rustfmt::skip] attribute on #[fixture] functions (from the rstest crate) is a required workaround for a tooling conflict. Without it, cargo fmt collapses short function bodies to a single line, then the #[fixture] proc-macro wraps the body in braces, triggering clippy's unused_braces lint (which fails under -D warnings). Attribute-based suppression (#[allow] or #[expect]) doesn't work because the proc-macro rewrites the code after attributes are processed. This pattern is widespread (25+ instances) across test fixture files in the wireframe project and should not be flagged as unnecessary. Apply this understanding to all Rust files using rstest fixtures, particularly in tests/fixtures/ and similar test infrastructure.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/postprocess.rs : Use `merge_whitespace_only_lines` and `rebalance_atomic_tails` in post-processing to normalize whitespace-only wrap artifacts and isolated tails before rendering fragments

Learnt from: CR
Repo: leynos/tei-rapporteur PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-25T12:07:25.566Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is "harder", request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/spycatcher-harness PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-24T21:29:27.390Z
Learning: Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` before merge.

Learnt from: CR
Repo: leynos/ddlint PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:41:58.806Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge

Learnt from: CR
Repo: leynos/create-labels PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-29T17:44:45.856Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/theoremc PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-31T01:05:08.444Z
Learning: Applies to **/*.rs : Reviewers should ask whether the change makes unused code easier or harder for `rustc` and Clippy to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/fail_match_with_nested_if.rs:5-5
Timestamp: 2026-04-09T19:50:53.849Z
Learning: In the `leynos/whitaker` repository, for Rust UI test fixtures (files under `crates/*/ui/`), prefer eliminating dead-code warnings structurally rather than with lint suppression:
1. Wrap all fixture items in a `pub mod fixture { … }` — the compiler treats `pub` members of a `pub mod` as externally reachable and emits no `dead_code` warnings for them.
2. Gate genuinely unreachable marker helpers with `#[cfg(any())]` (always-false predicate) so they are never compiled and cannot trigger warnings.
3. Keep `fn main {}` at the crate root outside the module.
4. Do NOT use `#![expect(dead_code, …)]`, `#[allow(dead_code)]`, or any other lint-suppression attribute in UI fixture files.
This approach is preferred over `#[cfg_attr(not(any(…)), expect(dead_code, …))]` or any other suppression strategy.

Learnt from: CR
Repo: leynos/whitaker PR: 0
File: docs/technical-design-for-test-support-dead-code-and-masked-dead-code-expectations.md:0-0
Timestamp: 2026-04-19T23:54:49.198Z
Learning: Applies to docs/tests/{support,common,prelude}/**/*.rs : Use `#[expect(dead_code, reason = "...")]` only on individual items after confirming via workspace analysis that the item is dead in that specific target; avoid file-level `#![allow(unfulfilled_lint_expectations)]` that masks stale expectations

Learnt from: leynos
Repo: leynos/whitaker PR: 192
File: crates/bumpy_road_function/ui/pass_single_match_cluster.rs:5-5
Timestamp: 2026-04-09T19:50:53.591Z
Learning: In the leynos/whitaker repository, UI fixture files (e.g. under `crates/*/ui/*.rs`) must not use crate-level or item-level `#![expect(dead_code, …)]` suppressions. The preferred approach is to move all fixture items into a private inline module (`mod fixture { … }`) and call every item from `fn main()` so the compiler considers them used. This eliminates dead-code warnings without any lint suppression. Dylint still analyses all functions regardless of module visibility. Conditional compilation (`#[cfg(…)]`) may be used additionally where items must be excluded from non-fixture builds, but the primary pattern is the inline-module + main-exercised approach.

Learnt from: CR
Repo: leynos/ortho-config PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-05T11:53:42.414Z
Learning: Applies to docs/**/tests/rstest_bdd/**/*.rs : Remove file-wide lint suppressions used only for historical generated-fixture warnings in rstest-bdd; retain only narrow, item-level `#[expect(...)]` annotations when still required

Learnt from: leynos
Repo: leynos/wireframe PR: 455
File: src/app_data_store.rs:138-164
Timestamp: 2026-02-16T21:11:43.870Z
Learning: In Rust test modules using rstest fixtures, when the `#[fixture]` proc-macro triggers lints like `unused_braces`, the `#[expect(lint)]` attribute must be placed at module level rather than on the fixture function. Item-level attributes are consumed by the proc-macro before clippy evaluates them, causing `unfulfilled_lint_expectations` errors. Module-level scoping is the narrowest viable option in this case. For the reason string in the attribute, use backslash continuation for multi-line text, not `concat!()`, as attribute meta items require string literals.

Learnt from: leynos
Repo: leynos/mdtablefix PR: 0
File: :0-0
Timestamp: 2026-06-01T12:13:46.615Z
Learning: In the `mdtablefix` repository, the `test-macros` proc-macro crate (`test-macros/src/lib.rs`) intentionally emits `#[allow(unused_braces, ...)]` rather than `#[expect(...)]`. This is unavoidable due to a bug in `rstest`: the nature of rstest fixture macro expansion makes `#[expect]` unusable in the emitted output. Do not flag this `#[allow]` usage as a lint-integrity violation; it is the only viable option at that call site.

Learnt from: leynos
Repo: leynos/wireframe PR: 417
File: tests/steps/codec_error_steps.rs:58-62
Timestamp: 2026-01-08T18:04:12.422Z
Learning: In the wireframe project, test step functions that always succeed cannot return `TestResult` even for consistency, because `clippy::unnecessary_wraps` would fire but cannot be suppressed: `#[allow]` is forbidden, and `#[expect(clippy::unnecessary_wraps)]` fails with "unfulfilled lint expectation" when the lint fires in one test target but not another.

Learnt from: leynos
Repo: leynos/wireframe PR: 419
File: tests/common/mod.rs:0-0
Timestamp: 2026-01-17T03:35:26.145Z
Learning: For integration tests in the `tests/` directory that share utilities across multiple independent test binaries, `#![allow(dead_code)]` with FIXME and tracking issue is acceptable as a last resort when: (1) cargo features cannot coordinate across independent test binaries, (2) `#[cfg(test)]` has no effect (already under tests/), and (3) `#[expect]` fires unfulfilled lint expectations in binaries that do use the shared utilities. This is a known Rust limitation with integration test compilation.

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-macros/src/**/*.rs : Extend `#[xfail]` rewriting in `rstest-xfail-macros` for async functions, preserving their return type inside the generated future

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-macros/src/**/*.rs : Rewrite sync function bodies into calls to `rstest_xfail::expect_fail`, preserving attributes, generics, visibility, where clauses, arguments, and doc comments

Learnt from: CR
Repo: leynos/rstest-xfail PR: 0
File: docs/roadmap.md:0-0
Timestamp: 2026-06-07T18:22:37.376Z
Learning: Applies to docs/rstest-xfail-core/src/**/*.rs : Spike `expect_fail_async` helper to classify passing, panicking, and `Err` futures without installing a runtime behind an async feature flag

Learnt from: leynos
Repo: leynos/weaver PR: 107
File: crates/weaver-test-macros/src/lib.rs:17-21
Timestamp: 2026-04-18T12:39:35.686Z
Learning: In `crates/weaver-test-macros/src/lib.rs`, the `allow_fixture_expansion_lints` proc-macro intentionally emits `#[allow(unused_braces, reason = "...")]` (rather than `#[expect(...)]`) in the generated token stream. `#[expect]` is incorrect here because it would produce spurious warnings at fixture sites where the `unused_braces` lint does not fire (the lint is only triggered by rstest's specific macro-expansion shape for single-expression fixture bodies). The Clippy `allow_attributes` concern is handled separately by also emitting `#[cfg_attr(clippy, expect(clippy::allow_attributes, reason = "..."))]`. Do not flag the use of `#[allow]` inside the `quote! { ... }` block of this proc-macro as a violation of the project's lint-suppression policy.

Learnt from: leynos
Repo: leynos/mxd PR: 280
File: crates/mxd-verification/tests/session_gating_bdd.rs:74-84
Timestamp: 2026-02-07T01:41:23.569Z
Learning: In rstest fixture functions, the macro expansion may trigger the `unused_braces` lint on expression bodies. When this occurs, the following nested attribute pattern is acceptable as a workaround: `#[expect(clippy::allow_attributes, reason = "...")]` wrapping `#[allow(unused_braces, reason = "...")]`. This pattern makes the exception explicit and expected rather than silently suppressed.

Learnt from: CR
Repo: leynos/post-turn-quality-stop-hook PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-06-07T02:56:50.284Z
Learning: Reviewers should ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect. If the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/falcon-correlate PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-05-31T20:26:11.798Z
Learning: Reviewers should ask whether the change makes unused code, stale helpers, and unnecessary ownership work easier or harder for `rustc`, Clippy, and human reviewers to detect; if the answer is 'harder', request a narrower module boundary, removal of stale code, removal or justification of unnecessary clones, or a properly justified `#[expect(...)]` tied to planned work before merge.

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Use `wrap_preserving_code` in `src/wrap/inline.rs` to tokenize prose and group tokens into `InlineFragment` values for line fitting

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Tokenize prose with `tokenize::segment_inline` and group tokens into `InlineFragment` values via `determine_token_span` in `wrap_preserving_code`

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : In the inline tokenizer, iterate over the source string lazily without creating a duplicate `Vec<char>` representation, group the resulting tokens into Markdown-aware fragments, and pass them to `textwrap::wrap_algorithms::wrap_first_fit` which chooses breakpoints without splitting code spans, links, or punctuation groups

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Classify combined code-and-suffix tokens as atomic in `has_inline_code_structure` in `src/wrap/inline/fragment.rs` so wrapping treats the full string (e.g., `` `VarGuard`s ``, `` `class`'s ``, `` `fetch`ed ``, or `` `run`ning ``) as an unbreakable unit

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline/fragment.rs : Tag inline code spans, Markdown links, and GFM footnote references with atomic fragment kinds so the wrapper never inserts a break inside their Markdown syntax

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Group opening punctuation tokens (`(`, `[`, and CJK openers) with the next inline code span or Markdown link via `determine_token_span` so wrapping never leaves a lone opener at the end of a line

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/developers-guide.md:0-0
Timestamp: 2026-06-07T14:16:25.094Z
Learning: Applies to docs/src/wrap/inline.rs : Never split inline code spans, Markdown links, or GFM footnote references across lines; they move as a unit when they would overflow the target width

Learnt from: CR
Repo: leynos/mdtablefix PR: 0
File: docs/architecture.md:0-0
Timestamp: 2026-06-01T23:44:02.797Z
Learning: Applies to docs/**/*.rs : Apply `wrap::wrap_text` for optional line wrapping that classifies Markdown block structure locally and delegates greedy line fitting to the `textwrap` crate over Markdown-aware fragments measured with `unicode-width`

@leynos
leynos merged commit a459db3 into main Jun 8, 2026
4 checks passed
@leynos
leynos deleted the issue-346-treat-date-like-sequences-as-atomic-fragments branch June 8, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(wrap): treat date-like sequences as atomic inline fragments

1 participant