docs(traceability): trace the preprocessor-aware C/C++ engine - #98
Merged
Conversation
The libclang engine (#85) shipped in 1.4.0 with no traceability artifacts: no `feature` need in features.rst and no `@` markers in analyse/preproc/, so 353 lines of new code had no coverage. Adds FE_PREPROC with three fault children, and six `@` markers linking to it - one per documented capability of the feature.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
=======================================
Coverage 92.38% 92.38%
=======================================
Files 43 43
Lines 3743 3743
Branches 381 381
=======================================
Hits 3458 3458
Misses 172 172
Partials 113 113 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bburda
approved these changes
Jul 30, 2026
ubmarco
added a commit
that referenced
this pull request
Jul 30, 2026
Merged
ubmarco
added a commit
that referenced
this pull request
Jul 30, 2026
patdhlk
pushed a commit
that referenced
this pull request
Jul 30, 2026
Prepares the **1.4.0** release. ## Release changes - ⬆️ Bump version `1.3.0` → `1.4.0` in `pyproject.toml`. - 📝 Finalize the changelog: convert the `Unreleased` heading into a dated `1.4.0` section (released 30.07.2026). Only 1 of the 6 PRs merged since 1.3.0 (#92) had added a changelog entry, so this also documents the 5 that were missing one, plus the traceability artifacts from #98. - 🗺️ No roadmap changes — none of the merged PRs completed a listed roadmap item. Minor bump: two new user-facing features, no removals or config-breaking changes. ## Changelog for 1.4.0 **New and Improved** - ✨ Added Bash language support for the `analyse` module (#92) - ✨ Added an opt-in preprocessor-aware C/C++ extraction engine, powered by libclang (#85) - 📚 Traced the preprocessor-aware C/C++ engine in the feature documentation (#98) - 🧪 Added a declarative fixture and snapshot test layer for marker extraction (#83) **Fixes** - 🐛 Anchor newline-terminated one-line markers to the start of the comment (#89, fixes #88) - 🐛 Pinned `typer` and `sphinxcontrib-typer` to keep the documentation build working (#84, #86) ## Behavior change worth calling out #89 is released as a fix, but it does narrow marker matching: a newline-terminated one-line marker (default `@…`) is now only recognized when nothing but comment decoration and whitespace precedes the start sequence. A project that deliberately embedded such markers *after* prose on the same line will stop seeing them — the fix is what stops `@` in prose from producing bogus need IDs and `InvalidNeedException`. Explicitly bounded markers (e.g. `[[ … ]]`) are unaffected. ## Verification Rebased onto `main` at #98, so this branch carries the full 1.4.0 content. - `tox -e py312-sphinx8-needs5` — 345 passed, 1 skipped (58 snapshots passed). - `tox -e docs-clean` (`sphinx-build -nW --keep-going`) — build succeeded, 0 warnings. - `pre-commit run --files docs/source/development/change_log.rst pyproject.toml` — all hooks pass. ## Not included Pre-existing traceability gaps are left for a follow-up, since all predate 1.3.0: `FE_CSHARP` has no incoming `impl` link; the five enum-site markers carrying a trailing `;` (`IMPL_BASH_1`, `IMPL_GO_1`, `IMPL_RUST_1`, `IMPL_RUST_2`, `IMPL_JSONC_1`) are inert and produce no needs, so file-extension discovery is untraced for every language; and `IMPL_C_1` / `IMPL_PY_1` / `IMPL_GO_2` are anchored on `COMMENT_MARKERS`, which has no readers. See the discussion in #98. ## After merge - Tag `1.4.0` on the merge commit (matching the existing `1.0.0`–`1.3.0` tags). The `Release` workflow triggers on that tag pattern and publishes to PyPI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #97. Adds the traceability artifacts for the substantial features that landed since 1.3.0 without any.
Audit
Every merged PR in the
1.3.0→1.4.0window, checked againstfeatures.rstand the@markers insrc/:FE_BASH+FAULT_BASH_1/2+IMPL_BASH_1/2/3+ added toIMPL_LANG_1IMPL_OLP_1)src/change)So the libclang engine was the one gap: 4 new modules and 353 lines in
analyse/preproc/, plus wiring inanalyse.py/config.py/cmd.py/src_trace.py, with zero traceability.Changes
docs/source/components/features.rst— newFE_PREPROCfeature need, placed after the language-support block, with threefaultchildren:FAULT_PREPROC_1— objects in inactive branches are extracted (false positives, the defect the engine exists to prevent)FAULT_PREPROC_2— objects in active branches are dropped (false negatives)FAULT_PREPROC_3— flags resolved from the wrong compilation database entry, so the wrong branches evaluate as activeSix
@markers, one per capability listed in the need, so the mapping is 1:1 and reviewable:IMPL_PREPROC_1analyse.py::create_src_objects_libclangIMPL_PREPROC_2preproc/libclang_parser.py::extract_active_commentsIMPL_PREPROC_3preproc/compile_db.py::find_compile_dbIMPL_PREPROC_4preproc/compile_db.py::load_flags_mapIMPL_PREPROC_5preproc/compile_db.py::defines_to_argsIMPL_PREPROC_6preproc/loader.py::load_clang_cindexComments only — no logic touched.
Verification
A green
-nWbuild alone would not prove the markers work: a marker that fails to parse produces no need and no error. So the built output was checked directly.tox -e py312-sphinx8-needs5— 345 passed, 1 skipped, 58 snapshots passedtox -e mypy— no issues in 20 source filespre-commit run --files …— all hooks passDeliberately out of scope
Pre-existing gaps, all predating the 1.3.0 → 1.4.0 window this PR was scoped to. Flagging rather than fixing, since each is a separate judgment call:
FE_CSHARPis an orphan. It has no incomingimpllink — it is missing from theIMPL_LANG_1list inanalyse/utils.py:110even thoughinit_tree_sitterhandlesCommentType.cs(utils.py:122). C# is the only supported language whose implementation is untraced. One-word fix if you want it here.src-tracedirective, nor for source-link URL generation (local-url/remote-url), while the CLI has three (FE_CLI_*). This asymmetry may be intentional — capability-level needs covering what is traced regardless of interface — so changing it is a feature-model decision, not a gap fix.docs/ubproject.tomldefines atesttype anddevelopment/traceability.rstruns asrc-traceover thetestsproject, buttests/carries no@markers, so zeroTEST_needs exist.Note on sequencing
No changelog entry here, deliberately: this PR is based on
main, where theUnreleasedheading still holds the Bash entry that #97 converts into the dated1.4.0section. Editing it would conflict with the open release PR. Since these artifacts document a feature already listed in the 1.4.0 notes, either fold a line into #97 before merging it, or let the next release's notes pick this up — your call on the order.