Skip to content

Systems and records

Documentation code mismatch dataset: tickets Django closed in the docs

By SourceX Editorial · Updated

9 sections

Short answer

A documentation code mismatch dataset collects cases where a reported bug was resolved by fixing the documentation because the code was right. Each case needs the report, both texts at the same version, the decision and the fix. In Django, 161 of 1,213 ticket-closing commits from 2023 to 2025 changed only documentation, and the rewritten behavior descriptions had stood a median of 7.7 years.

Provenance trail

Documentation code mismatch

This page covers documentation code mismatch dataset: tickets Django closed in the docs.Illustrative

Key takeaways

  • About one Django ticket fix in eight (161 of 1,213, 2023-2025) changed only documentation, and one reader judged 76 of those to be real divergence between docs and code.
  • Behavior descriptions that were rewritten had stood unchanged a median of 2,800 days and shipped in a median of 11 feature releases.
  • Release notes did not stop drift: SQLite foreign key enforcement was announced in Django 2.0, while a topic guide kept denying it through 5.0, 10 feature releases.
  • Commit messages record the closure but rarely the cause: 2 of 161 point to the change that made the text stale.
  • Label each case with a verdict such as code correct and docs wrong, or code kept for compatibility, never with a bare fixed.

What is a documentation code mismatch dataset?

A documentation code mismatch dataset is a set of cases in which someone reported that software behaved wrongly, maintainers decided the code was right, and the resolution changed the documentation instead. Each case needs the report, the documentation text and the code as they stood at the same version, the decision and its reason, and the commit that brought the two back into line.

These cases are worth collecting because they are the mirror image of an ordinary bug fix. A coding or review model that trusts the documentation will flag the correct code as a defect, and a model that trusts the code will miss the documentation fix the team actually shipped. Only a record that keeps both versions and the decision between them can teach which source governed.

The public test case here is Django, the Python web framework. Its commit messages follow a fixed convention that names the ticket each commit closes, its documentation lives in the same repository as its code, and its release process says how documentation fixes travel to older versions. That makes every docs-only ticket closure countable from git alone.

How documentation drift makes correct code look wrong

Documentation drift makes correct code look wrong when behavior changes, or is decided, in one place and the text a user reads still describes the old or the hoped-for behavior. The user compares the two, sees a contradiction and files a bug against the code. Aghajani and colleagues built a taxonomy of documentation issues from mailing lists, Stack Overflow discussions, issue repositories and pull requests (ICSE 2019), a reminder that these problems often surface as questions, issue reports and pull requests rather than as tickets filed against the documentation.

Django's tracker holds a clean example. Ticket #32811 is titled "Annotate removes Meta.ordering", which reads as a defect report. Yet Django had removed default ordering from GROUP BY queries on purpose: the 3.1 release notes state that "A model's Meta.ordering doesn't affect GROUP BY queries." The ticket that finally closed the gap in the reference documentation, #36686, is titled "Clarify the behavior difference between order_by() and Meta.ordering in GROUP BY queries". Meanwhile Django's aggregation guide still said that Django "never removes ordering constraints that you have specified". The #36686 fix narrowed that sentence to constraints "specified explicitly with order_by()" and added a note that GROUP BY queries don't use the model's default ordering. The code had behaved as intended since 3.1; the guide described something else.

A version note did not prevent the confusion. That is the central point for anyone building training data: a release note records that behavior changed, but the reference page, tutorial or example that users consult can keep describing the earlier behavior for years.

How often does Django close a ticket by changing only the docs?

Django closed about one ticket in eight by changing only documentation. Among commits on Django's main branch committed from January 1, 2023 through December 31, 2025, 1,213 begin with the phrase Fixed #, which Django's committer guide says automatically closes the referenced ticket. Of those, 567 changed no documentation, 477 changed code and documentation, 8 touched only release notes, and 161 (13.3 percent) touched only documentation. The count held steady across the three years: 47, 56 and 58.

Not every documentation-only fix is drift. One reader labeled the 161 by what the change did, using the subject and, where unclear, the diff. Sixty-two corrected or added a statement about how the code behaves and 14 fixed a wrong example or reference, so 76 of the 161 (47.2 percent) are cases where documentation and code had diverged:

How often does Django close a ticket by changing only the docs?
LabelDocs-only fixesExample commit subject (Django)Verdict for a dataset
Behavior gap or mismatch62Doc'd that negative indexes are not supported in F() slices.Code correct; docs wrong or silent
Wrong example or reference14Corrected QuerySet.acreate() signature in docs.Code correct; example would mislead
Stale outside facts18Removed references to bleach in docs.Environment changed; not a code question
New guidance34Documented how to test callable storage in FileField.Coverage gap; usually no contradiction
Editorial33Fixed typo in docs/topics/db/queries.txt.Exclude from mismatch sets

How long had the corrected text been live?

The text these fixes replaced had usually been live for years and shipped in many releases. For each behavior fix that rewrote existing lines (45 of the 62), git blame on the parent commit gives the last time each removed line changed. Taking the newest of those dates, a conservative lower bound, the rewritten passages had stood unchanged for a median of 2,800 days, about 7.7 years, and had shipped in a median of 11 Django feature releases. Thirty-nine of the 45 had stood for more than a year. Wrong examples were younger, with a median of 663 days across 14 fixes.

Three cases show the lag from the code side, where the commit that changed behavior can be identified. In #36077 the documentation fix names its own origin: "The empty string is no longer special-cased since c2ba59fc1da5287d6286e2c2aca4083d5bafe056." That code change landed in August 2008, before Django 1.0, and the lines the fix replaced had stood unchanged for 4,323 days. In the other two, a release note announced the change while an older passage kept describing the earlier behavior:

How long had the corrected text been live?
TicketCode changeDocs caught upLagFeature releases between change and fix
#36077 primary key and UPDATEAug 27, 2008: empty-string special case removedJan 13, 20255,983 days (16.4 years)23 (1.0 to 5.1)
#35156 SQLite foreign keysJul 11, 2017: constraints enforced; in 2.0 notesJan 31, 20242,395 days (6.6 years)10 (2.0 to 5.0)
#36686 Meta.ordering and GROUP BYSep 10, 2019: ordering dropped from GROUP BY; in 3.1 notesNov 13, 20252,256 days (6.2 years)8 (3.1 to 5.2)
All 45 behavior fixes that rewrote linesRarely named in the fix message2023 to 2025Rewritten text had stood a median of 2,800 daysMedian of 11 since the text last changed
Three timelines, one per Django ticket, each showing a code change and the later documentation fix: 2008 to 2025 across 23 feature releases, 2017 to 2024 across 10, and 2019 to 2025 across 8.
How long three Django docs passages trailed the code they described. Source: SourceX count from django/django git history, October 2026.

What the commit trail records about drift, and what it leaves out

The commit trail reliably records that a ticket was closed by a documentation change, and almost never records why the documentation had drifted. Only 7 of the 161 docs-only messages use a word such as incorrect, outdated, misleading, wrong or no longer, and only 2 point to the earlier commit that made the text stale. Django does have a convention for naming the commit that introduced a code regression, a line beginning Regression in on backports that fix one, but no equivalent habit exists for documentation.

Version notes do not fill the gap either. Sphinx, the tool Django uses to build its docs, defines its version-changed directive as describing when and what changed in a feature, such as new parameters or changed side effects. A correction to a long-standing description is not a feature change, so only 1 of the 76 behavior and example fixes added a version note.

What the trail does record well is reach. Django's release process says that "Documentation fixes generally will be more freely backported to the last release branch." Accordingly, 125 of the 161 docs-only fixes (77.6 percent) were backported to at least one stable branch, against 317 of 1,044 code fixes (30.4 percent). Each backport carries a Backport of line naming the main commit, which tells a dataset builder exactly which released versions shipped the corrected text and which did not.

The mismatch adjudication trace and outcome rubric

A usable mismatch record joins the report, both texts at one version, the decision and the fix, and it labels the outcome from a fixed set rather than from the closing status. The fields below are the trace; the rubric that follows turns a trace into one verdict.

Each verdict implies a different use, which is why a record that only says fixed is not enough to train or grade anything:

  • Report: ticket id, title, date, reporter's version, and the behavior they expected and observed.
  • Documentation at that version: file path, commit and the exact passage the reporter relied on.
  • Code at that version: the function or module and a test or reproduction that shows the actual behavior.
  • Decision: who resolved it, the stated reason (intended behavior, compatibility, scope), and any dissent.
  • Fix: the commit, the files it changed, and every backport with its target series.
  • Drift origin: the commit or release that changed the behavior, when it can be found, and the release notes that mentioned it.
  • Afterward: later tickets on the same passage, reopenings, or a code change that reversed the decision.
The mismatch adjudication trace and outcome rubric
VerdictEvidence that settles itTraining or evaluation useCommon mislabel
Code correct, docs wrongPassage contradicts behavior at the same version; behavior is intendedReview agents must not flag the code; target for doc-update agentsBug, fixed
Code correct, docs silentBehavior intended but never stated; report filed as unexpectedCaveat retrieval and answer-with-limits tasksInvalid, with no link to the fix
Example or reference wrongCopied example fails or misleads against that versionExecutable checks on generated examplesTypo
Code kept for compatibilityMaintainers say the behavior stays because changing it would break usersPreference data on compatibility trade-offsCode correct
Code wrong, docs rightThe fix changes code and tests to match the textOrdinary bug-fix pairsDocumentation fix
UndeterminedDocs or code version unknown, or no decision recordedExclude from gold setsGuessed from the closing status

The strongest objection: a docs-only fix can hide a code decision

The strongest objection is that a documentation-only resolution can be a policy choice dressed as a correction: the code may be imperfect, and the team documents it rather than break existing users. That happens, and the rubric gives it its own verdict for that reason. The same paragraph of the aggregation guide that #36686 corrected explains that Django keeps related behavior in other methods because changing it "would violate our" API stability policy.

The labels in this article are one reader's calls, so the line between a behavior gap and new guidance deserves a second reader before anyone reuses the counts. Django is also a mature project with a disciplined process; a younger codebase may resolve the same reports in a chat thread with no commit at all, which would leave the mismatch invisible to anything counted from git.

Finally, git blame measures how long the exact wording stood, not when it became wrong. A passage can be reformatted without being corrected, which shortens the measured age, so the medians above understate how long drift lasted rather than overstate it.

How buyers would use mismatch records, and what to request

Buyers would use mismatch records to test whether a model can tell which source governs when documentation and code disagree. A code review evaluation can present the diff, the documentation passage at that version and the ticket, with the gold answer that the code is correct and the docs need the change. A documentation agent can be scored on whether its proposed edit matches the one maintainers shipped, and on whether it targets every supported branch the backports reached.

Ask for version alignment before volume. A sample of records should let a reviewer reproduce, for each case, the docs text and the code behavior at the same release, the decision with its reason, and the backport list. Requirement changes over time and conflicts between help-center articles and runbooks are related problems with their own pages on this site; this one covers the case where the code was the authority all along.

Private engineering archives add what Django's public trail lacks: internal wiki pages next to code, tickets closed as works as designed with their discussion, support cases that cite a stale article, and the reason a team chose documentation over a code change. SourceX licenses business data directly from companies and sources datasets after a buyer describes the need rather than holding inventory. A request for mismatch records works best when it names the verdict labels required, the share of cases that must pass the version-alignment test above, and the intended use.

Methods note: repository, labels and counting rules

Counts come from scripts that read git metadata from a blob-less clone of github.com/django/django at commit e9cf067 (main, October 27, 2026), and blame data from a full clone of the same repository; no repository code was run. The population is every non-merge commit reachable from main whose committer timestamp falls from 2023-01-01 00:00 UTC up to but not including 2026-01-01 00:00 UTC, compared as integer seconds, each diffed against its single parent. A ticket fix is a subject beginning Fixed # followed by digits.

Path classes: docs-only means every changed path starts with docs/ and at least one lies outside docs/releases/; notes-only means every path is under docs/releases/; code and docs means both docs/ and other paths; code-only means no docs/ path. Drift words are matched whole-word and case-insensitive in subject and body: incorrect, incorrectly, wrong, wrongly, inaccurate, outdated, obsolete, stale, misleading, mismatch, no longer, out of date, actual and actually. An origin pointer is a hex string of 8 to 40 characters in the body that names a commit in the clone, or the phrase Regression in. A backport is a commit on a stable/X.Y.x branch or tag, not on main, whose body says Backport of the main commit from main or master.

Labels were assigned by one reader to all 161 docs-only fixes from the subject, with the diff read where unclear. Passage age uses git blame on the parent for every line the fix deleted under docs/, excluding release notes, and takes the newest blamed commit; feature releases are tags named major.minor dated before the fix that contain that commit. A version note counts when the fix adds a line whose first non-blank text is .. versionadded::, .. versionchanged::, .. version-added:: or .. version-changed:: under the same paths. Lags in the case table use committer times of the named commits, and its releases are major.minor tags that contain the code change and neither the fix nor a backport of it. Medians of even counts average the two middle values; percentages are rounded once, half up. Saved outputs hold commit hashes, dates, classes and labels, with no names.

Frequently asked questions

What is documentation drift in software?

Documentation drift is the gap that opens when code behavior changes, or is decided, and the documentation users read keeps describing something else. In Django, the description of when Model.save() runs an UPDATE was corrected in January 2025 to match a code change made 5,983 days earlier, with 23 feature releases in between.

How can you tell whether the code or the documentation is wrong?

Compare both at the same version, then look for the decision: a test or release note that shows the behavior was intended points to the documentation, while a fix that changes code and tests to match the text points to the code. Without the version-aligned pair and a recorded decision, the case should be labeled undetermined.

How common are documentation-only fixes in a large open-source project?

In Django from 2023 through 2025, 161 of 1,213 ticket-closing commits (13.3 percent) changed only documentation. One reader judged 76 of those to be corrections of behavior descriptions or examples, the cases where code and documentation had actually diverged.

Do release notes prevent documentation drift?

Not on their own. Django announced that foreign key constraints were enabled on SQLite in its 2.0 notes, yet a topic guide kept saying SQLite had no enforced referential integrity until January 2024. Release notes record that something changed; they do not update the reference pages and examples users consult.

Why would an AI training dataset need documentation mismatch cases?

Coding and review models increasingly read documentation as context. Mismatch cases teach them that documentation can be stale and score whether they defer to the right source, which ordinary bug-fix pairs cannot do because in those the code was the thing that was wrong.

Sources

  • Django's repository at commit e9cf067: the 2023-2025 ticket-fix commits, path classes, backports and blame ages counted in this article. Source
  • Django's committer guide: a commit message starting Fixed #xxxxx automatically closes the referenced ticket; backports carry a Backport of <sha> from main line; regressions name the commit with Regression in. Source
  • Django's release process: documentation fixes are more freely backported to the last release branch. Source
  • Django 3.1 release notes: a model's Meta.ordering doesn't affect GROUP BY queries. Source
  • Django 2.0 release notes: foreign key constraints are now enabled on SQLite. Source
  • Ticket #36077 fix (January 2025): corrected when Model.save() executes an UPDATE, noting the empty string is no longer special-cased since commit c2ba59fc. Source
  • Ticket #36686 fix (November 2025): the aggregation guide sentence that Django never removes ordering constraints you have specified was narrowed to constraints specified explicitly with order_by(), and notes were added that GROUP BY queries do not use default ordering; the paragraph cites the API stability policy. Source
  • Django ticket #32811 is titled Annotate removes Meta.ordering. Source
  • Django ticket #36686 is titled Clarify the behavior difference between order_by() and Meta.ordering in GROUP BY queries. Source
  • Sphinx directive reference: version-changed describes when and what changed in a feature, such as new parameters or changed side effects. Source
  • Aghajani et al., Software documentation issues unveiled (ICSE 2019): a taxonomy of documentation issues built from mailing lists, Stack Overflow discussions, issue repositories and pull requests. Source

Tell us what data you need

Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.

See if your company qualifies