All notable changes to this project are documented in this file. The format is based on Keep a Changelog, and the project uses Semantic Versioning.
- README images did not render on PyPI. They were written as repository-relative
paths, which resolve against
pypi.org/project/docsifter/there rather than against the repository, so the project page carried three broken images from the moment 0.1.0 was published. Every image now uses a full URL. PyPI's own renderer confirms it, and a test keeps relative paths from coming back -- the same renderer also drops<source>, so the architecture diagram falls back to its light theme there while<picture>still switches on GitHub.
twnlp/ChineseErrorCorrector3-4Bis recorded as running on the card this was built on, rather than as unverified. Its output has still not been measured against the benchmark corpus.
Initial public release.
- Local small-model correction with the recommended
shibing624/chinese-text-correction-1.5bbackend and an optional 7B variant. - Conservative rule preview, terminology allowlists, skip patterns, and false-positive management for technical documentation.
- Markdown, AsciiDoc, and plain-text directory review from the CLI and Web UI.
- Self-contained HTML reports with diffs, finding provenance, severity, rule IDs, statistics, and filtered or full views.
- Asynchronous Web review with live progress, cancellation, history, and report downloads.
- Event-driven GitHub pull request review through signed webhooks, changed-file filtering, delivery deduplication, and head-revision checkout.
- SMTP notifications for local and GitHub review completion or failure.
- English and Simplified Chinese Web UI and project documentation.
- A repository-aware Codex review contract in
AGENTS.md. - Python package entry points, smoke and frontend tests, Dependabot, Docker, and Docker Compose support.
- Continuous integration on every pull request (
.github/workflows/ci.yml): lint and format checks, the smoke suite on Python 3.10 and 3.13, the frontend tests, the rule-preview benchmark, and an install of the built wheel into a clean environment. twnlp/ChineseErrorCorrector3-4Bjoins the curated local list. On the pycorrector leaderboard it averages 0.85 against the default's 0.68 and the 7B's 0.82, at a size that fits a 12 GB card. It has not been run here.- A
modelextra:pip install "docsifter[model]"pulls the local small-model runtime, so an install from PyPI can reach it without a checkout. - Vendored Web UI assets under
src/docsifter/static/vendor/, regenerated bytools/build_vendor_assets.py. The architecture diagram in both READMEs is generated the same way, bytools/build_architecture_diagram.py, which emits a light and a dark SVG from one layout definition. The Tailwind file is a generated subset of the classes the UI references, so the interface renders identically on an air-gapped host and no CDN is contacted. - An annotated benchmark corpus (
benchmarks/cases.json) with a runner that reports per-category precision/recall for the rule-preview path. The runner exits non-zero when aprotectionnegative is modified, or when a rule produces a wrong fix in rule-preview mode; those two hold regardless of corpus size, and accuracy figures are not gated. - Pluggable correction model backends: the local transformers runtime
(default) can be replaced with Ollama or any OpenAI-compatible
chat/completionsendpoint viamodel_backendconfiguration or theDOCSIFTER_MODEL_BACKEND,DOCSIFTER_OLLAMA_BASE_URL,DOCSIFTER_OPENAI_BASE_URL, andDOCSIFTER_OPENAI_API_KEYenvironment overrides. Remote backends accept arbitrary model ids; all backends share the same syntax/whitelist protection pipeline. - Optional LLM second-pass review that validates model-sourced findings through
any OpenAI-compatible
chat/completionsendpoint before the report is generated. The layer is disabled by default, capped byllm_max_reviews, tolerates endpoint failures, and never persists the API key to disk. - LLM verdicts (
confirmed/rejectedwith confidence and reason) are shown as provenance badges in HTML reports; rejected rows are dimmed. DOCSIFTER_LLM_REVIEW_ENABLED,DOCSIFTER_LLM_ENDPOINT,DOCSIFTER_LLM_MODEL, andDOCSIFTER_LLM_API_KEYenvironment overrides.- Pluggable text extraction: new file formats can register an extractor with
docsifter.extractors.register_text_extractorwithout touching the corrector. Built-in Markdown and AsciiDoc extraction moved to the same registry. - Structured logging and in-process metrics.
DOCSIFTER_LOG_FORMAT=jsonemits single-line JSON records andDOCSIFTER_LOG_LEVELcontrols verbosity, for review metrics, correction-guard warnings, the email subsystem, retention, and web request logs; progress narration still prints to standard output. The/metricsendpoint exposes review counters and durations in Prometheus text format with no extra dependencies. - Optional LLM cross-line context review. When enabled with
DOCSIFTER_CONTEXT_REVIEW_ENABLED(reusing the LLM endpoint settings), a second prompt looks for terminology inconsistency, contradictions, and broken cross-references across lines, capped at ten issues per file. Findings are labeledcontextin reports and never trigger the false-positive filter. - Benchmark runner support for remote backends (
--backend ollama|openaiwith--base-url), per-case error tolerance so one unreachable endpoint does not abort the run, and an expanded corpus of 64 annotated cases covering typo, grammar, terminology, and protection categories. - A LLM review panel in the Web UI configures both optional LLM layers
without editing files: endpoint, model, API key, the two toggles, and the
llm_max_reviews/context_max_filesceilings. Settings pinned by environment variables are shown as locked and cannot be overridden from the browser, a key typed into the panel is held in memory only and never persisted or returned, and neither layer can be enabled before an endpoint and model are set. context_review_scope(defaultflagged) decides which files the cross-line layer reviews. That layer sends a whole document per request and ignores what the local model found, so reviewing every file costs orders of magnitude more than the per-finding pass — two orders of magnitude across this project's own Markdown — and undoes the reason the small model runs first. The default now follows findings like the rest of the pipeline;allrestores full coverage, which is what catches a clean file that contradicts itself.context_max_files(default 50) caps how many files one run may context-review. That layer sends a whole document per file, including files with no findings, so it needs a ceiling of its own.- LLM verdict badges now cover
skipped(the run'sllm_max_reviewsbudget was spent) anderror(that request failed) in addition toconfirmedandrejected, so an unbadged finding can no longer be mistaken for a verified one. - Both optional LLM layers now also run on the GitHub pull request path, gated
by
pr_llm_enabled/DOCSIFTER_PR_LLM_ENABLED(default off). Webhook reviews run unattended and share the serialized review lock with local reviews, so that path opts in separately; the gate is a path switch rather than a third layer, and each layer's own switch and ceiling still apply. - Retention for review history, monitor logs, and generated report files,
controlled by
retention_days(default 90,0keeps everything) and applied once at web startup. None of the three was ever removed before, so a long-lived deployment grew without bound. Deleting a row also deletes the report it referenced, unreferenced reports are removed by file age, and a report still referenced by a surviving row is kept however old the file is. - Recorded what each layer catches in
benchmarks/README.md, for the rule preview and for the local 1.5B model, as counts against their sample size. Rules correct every terminology case and no typo at all; the model corrects 15 of 19 typo cases, and is wrong about as often as it is right on grammar. For how accurate the correction model itself is, the page now points at the model author's own evaluation on public sets rather than implying this corpus measures that. Both leave all 16 protection negatives alone. The corpus is stated there as illustrative rather than a benchmark: 76 cases across four categories shows the shape of each layer but cannot support an accuracy figure. - Every configurable email setting is declared in
get_default_config. They previously existed only as inline defaults at each read site, which is how a settings endpoint came to drop four of them silently. - Python 3.13 is declared in the package metadata.
-
Every module narrates through the logger. Per-file progress, startup, and
--debugtraces are log records, soDOCSIFTER_LOG_FORMAT=jsonnow covers a whole run; the CLI's result (report path and statistics) stays on stdout.DocumentReviewer.print_stats()becameformat_stats(), which returns the block instead of printing it. -
--debugraises the run's log level. It is no longer wired to Flask'sdebugflag, so--server --debugcannot start the Werkzeug debugger. -
The Web layer moved from one 900-line factory into
docsifter.web: an app factory plus a module each for the administrator gate, the error contract, and each route group.docsifter.web_appkeeps exportingcreate_flask_appandvalidate_server_bind. -
Stop treating a bare all-caps acronym as evidence that a line is technically dense. Chinese has no spaces, so a whole sentence counts as a few words and one acronym cleared the density threshold, skipping the model for 9% of this project's own documentation while protecting nothing the model would have damaged: with the guard bypassed the model left all 14 protection negatives untouched. Measured on the 72-case corpus, removing that one pattern raises one more
typocase on the corpus, with no protection negative touched either way. URL, email, version, and filename patterns still hold a line back. -
Split the monolithic
main.pyintoorchestrator.py(review coordination),web_app.py(Flask app factory),webhook.py(GitHub routes), andcli.py(console entry point, nowdocsifter.cli:main).docsifter.mainno longer exists. -
Move the report markup, styles, and scripts from Python string literals in
html_template.pyinto plain assets undersrc/docsifter/templates/report/; the rendered report output is unchanged. -
Document the single-instance deployment boundary (in-memory task state, SQLite history, local report files) and scaling guidance in both READMEs.
-
Split the lightweight runtime from optional model dependencies so rule preview does not install PyTorch or download model weights.
-
Store mutable configuration, reports, false positives, and SQLite state under
DOCSIFTER_DATA_DIR; container deployments keep the model cache in the same mounted data volume. -
Run the container as a non-root user behind a single-worker Gunicorn server.
-
Adopt the standard
src/package layout; installable commands aredocsifteranddocsifter-webinstead of running scripts directly. -
Exclude common dependency, cache, generated, and local design directories from document scans and release artifacts.
-
Move the optional LLM, retention, and model-backend sections of both READMEs below Usage, so installation is reached at roughly a fifth of the way in rather than two fifths.
-
Unexpected server-side exceptions no longer reach the HTTP client. The detail is logged; the response carries a fixed
Internal server error, so filesystem paths, SMTP hosts and database locations stay on the server. -
The dashboard's "Valid Corrections" and "Defect Rate" cards showed zero on every install. They read
valid_changesanddefect_rate_per_thousand, but the endpoint feeding them reports the same two numbers astotal_changesandavg_defect_rate, and|| 0turned the mismatch into a plausible-looking zero. -
The English UI no longer welds two translated sentences together ("...1.5B small model.The current selection..."). Substring translation now inserts the space English needs at a sentence boundary.
-
docsifter.webis declared in the package manifest, so an installed wheel can actually start the Web UI. -
SMTP credentials are optional.
is_configured()no longer demands a username and password, and the session only authenticates when one is set, so an internal relay that accepts unauthenticated mail can be used. -
"Send test email" no longer requires notifications to be switched on first, which is the order the settings are actually checked in.
-
A label rendered through
t()while the UI is in English returns to Chinese when the language is switched back. Its English text was being recorded as the node's source; an unambiguous reverse lookup now recovers the Chinese one. -
A run of
的collapses to one. The rule was the literal string的的, which replaces pairs left to right, so的的的came out as的的— still wrong. The benchmark corpus had recorded that output as the expected result, which hid the bug and scored the model down for producing the better answer. -
The
登录terminology rule now reaches past a product name. Its lookahead required the context noun to follow到directly, so the ordinary shape in Chinese technical writing —登陆到 Grafana 控制台,登陆到 Jenkins 后台,登陆至 AWS 控制台— was missed silently while登陆到控制台was caught. One Latin word is now allowed in between; the landing sense (台风登陆,诺曼底登陆) is still left alone, and the rule preview corrects every terminology case in the corpus again. -
AsciiDoc text extraction no longer truncates lines at the
//inside URLs such ashttps://example.com. -
Markdown and AsciiDoc extraction no longer strip markup characters from inside inline code spans. Underscore pairs spanning two spans on one line made
`sync_config.yaml`and`retry_limit`reach the report assyncconfig.yamlandretrylimit, so a suggestion could silently corrupt a filename or configuration key. AsciiDoc lines are likewise no longer truncated at a--inside inline code such as`git log --oneline`. -
Cross-line context review reports how many lines a long document left unreviewed instead of silently truncating at 200 lines.
-
Email notification toggles (
notify_on_local_complete,notify_on_github_complete,notify_on_error,attach_report) are saved. A prefix filter on the settings endpoint discarded every key without anemail_prefix, so switching one off in the Web UI reported success and changed nothing. -
A rejected SMTP login is no longer retried three times. Authentication and other permanent (5xx) failures are raised immediately, since repeating them never succeeds and can get the mail account locked.
-
Email settings are validated before they are stored. The port must be a real integer in range (a string
"465"previously missed the implicit-TLS branch), addresses are checked, recipients accept a list or a separated string (a bare string was previously joined character by character), unknown keys are rejected, and a rejected value leaves the previous settings untouched. -
Reports larger than
email_max_attachment_mb(default 10) are left off the notification instead of pushing the message past the provider limit and losing the notification entirely. -
Forced-fix rules can no longer corrupt a protected region. A rule matching inside a placeholder (one normalizing underscores, say) damaged it, and restoring then fell back to the placeholder's bare index, replacing every occurrence of that digit with the whole protected span — turning "30 秒" into "3
retry_limit秒". Restoration is now exact-match only, and the rule path discards fixes that damaged a placeholder, as the model path already did. -
One push that raises several webhook events (
synchronizeplusedited, say) no longer starts a second review of the same commit. Deduplication now also matches an in-flight review with the samehead_sha, which was recorded but never used; a new push still triggers a review. -
Record every timestamp against one base. Review history was stored in UTC while local task history used local time, so the same moment was written hours apart, and serialized values carried no offset — a client parsed them as local time and rendered review history eight hours early on a UTC+8 host.
utcnowandisoformat_utcnow live indocsifter.runtime, every store uses them, and API timestamps carry an explicit offset.
docsifter.extractors.extract_from_path, which had no callers and duplicatedTextCorrector.extract_text_from_file.
- Skip symbolic links and files above
max_file_size_mb(default 5) during document discovery and reading. A link inside a documentation tree resolves outside the tree being reviewed, and one pointing at a character device never returns; because reviews are serialized under a shared lock, a single such file added by a pull request would stall every later review. The guard lives in the read, so it covers the GitHub path, which builds its file list from the pull request's changed files rather than from directory discovery. - Require administrator authentication for public deployments and reject unsafe non-loopback binds without a strong token.
- Keep
llm_api_keyandopenai_api_keyout of the/configresponse alongside the existing email and GitHub secrets. - Restrict Web filesystem access to configured roots and keep environment secrets out of persisted configuration.
- Escape untrusted Web and report content, remove inline data handlers, and preserve protected code, links, URLs, markup, and terminology in model output.
- Serialize review execution, recover interrupted tasks, and prevent duplicate webhook retries from creating overlapping reviews.