Skip to content

E24: Code Hygiene #254

Closed
30 of 30 issues completed
Closed

Description

@DavidCozens

Overview

Non-functional improvements to the codebase as a unit. Cross-cutting work
that protects properties of the code — how it's built, organised,
structured — rather than adding capabilities.

These items are typically too large to land as one-off chore PRs but don't
fit under any feature epic. They're rails, gates, and uniform pattern
adoption that improve quality and resilience without changing what the
library does.

In scope

  • CI gates that protect non-functional invariants (include hygiene,
    layering, language version)
  • Cross-cutting refactors that apply patterns uniformly (e.g. Nil Object
    adoption across abstractions)
  • Other code-quality work that doesn't belong under a capability-focused
    epic

Out of scope

  • Anything covered by a feature epic — stays where it is
  • One-off chore PRs that don't need a tracked story (small refactors,
    dependency bumps, formatter changes)
  • Static analysis and MISRA tooling — covered by E10
  • Documentation tooling — covered by E23

Candidate ideas

Ideas live here until commitment. Each becomes a story (added to the table
below) only when scope is clear and we're ready to do the work. New ideas
are added as comments before promotion.

  • Resource-leak detection in tests — every test group exercising a
    class that owns an external resource installs a balance counter in
    setup/teardown that asserts the resource is fully released by
    end-of-test. Drives out Open()-without-Close() leaks (symptom: S26.02: MbedTlsStream Open() unwinds inner transport and SSL state on failure #420
    / S26.02) and surfaces the wider class of missing failure-path tests.
    Balance counter lives in the fake (e.g. SocketFake.openFdCount); the
    first per-class story to touch a shared fake also retrofits the
    assertion to every other TEST_GROUP that uses it. Per-class story,
    raised when picked up. Classes to cover (no particular order):
    • share SocketFake: PosixTcpStream, PosixDatagram, PosixResolver
    • share WinsockFake: WinsockTcpStream, WinsockDatagram, WinsockResolver
    • share FreeRTOS net fakes: FreeRtosTcpStream, FreeRtosDatagram
    • share lwIP fakes: LwipRawTcpStream, LwipRawDatagram
    • OpenSslStream (OpenSslFake)
    • MbedTlsStream (MbedTlsFake)
    • PosixFile, WindowsFile, FatFsFile
    • PosixMessageQueueBuffer (mq_t open/close/unlink)
      Plus an integration-harness fd-balance check across N forced-failure
      cycles per platform. Closes the scope of S26.02: MbedTlsStream Open() unwinds inner transport and SSL state on failure #420 (its two specific fixes
      fall out of the OpenSslStream and MbedTlsStream stories).

Stories

Story Title Status
S24.01 (#255) IWYU CI gate for include hygiene Done
S24.02 (#321) Adopt CALLED_FUNCTION test macro and standardise *CallCount naming Done
S24.03 (#325) Drop AtomicOps vtable; select atomics implementation at link time Done
S24.04 (#332) Migrate Linux BDD off Example/SingleTask; remove the SingleTask binary Done
S24.05 (#333) Move BDD-target binaries from Example/ to Bdd/Targets// Done
S24.06 (#335) Retire Example/FreeRtos/HelloWorld bring-up smoke binary Done
S24.07 (#418) SolidSyslogAddress as pool-allocated handle Done
S24.08 (#423) Enforce top-down function ordering across all source files Done
S24.09 (#424) StreamSender bad-setup contract — reject NULL Resolver / Stream / Address Done
S24.10 (#449) Rename file-leaking identifiers and comments in BlockStore tests Done
S24.11 (#459) Extend tidy / cppcheck / IWYU CI to cover platform + BDD code Done
S24.12 (#461) Audit inline cppcheck-suppress and NOLINT comments tree-wide Done
S24.13 (#468) Switch IWYU lanes to advisory Done
S24.14 (#477) CI supply-chain hardening — persist-credentials + SHA-pin remaining actions Done
S24.15 (#478) FreeRTOS BDD-target teardown handshake (drop fixed-sleep mutex destroy) Done
S24.16 (#495) C99 portability — unconditional static-assert macro + atomics compile-check gating Done
S24.17 (#501) Collapse per-platform pool-size tunables to role-based tunables Done
S24.18 (#552) Drop redundant do/while(0)+NOLINT wrapper from test CHECK_* macros Done
S24.19 (#587) markdownlint config, backlog fix, and CI lane Done
S24.20 (#605) SolidSyslogBuffer_Read conflates empty buffer with oversized-record stall Done
S24.21 (#608) PlusFatFile Open falls back to truncating "w+" on any "r+" failure Done
S24.22 (#609) FreeRtosSysUpTime does not account for FreeRTOS tick-counter wrap Done
S24.23 (#610) Address pool exhaustion returns a shared mutable singleton Won't fix
S24.24 (#664) Pin CI container images by digest Done
S24.25 (#682) "Tier" means three different things, one of them contractual Todo
S24.26 (#689) Write API identifiers in full in prose — no bare _Create shorthand Done
S24.27 (#722) Public error enum constants do not carry the SOLIDSYSLOG_ prefix Done
#727 Integration-test Stream doubles do not honour close-on-failure Todo
#738 The this-pointer naming rule and the concrete writer classes disagree Todo
#740 Assert that a symbol named in the docs exists Todo

The last three were raised as standalone chores and linked here during the
pre-0.1.0 issue audit so they sit in this epic's swimlane rather than off the
board. They keep their chore titles rather than being renumbered as stories.

Resolved candidates

Recorded so they are not re-proposed:

  • C99 portability gate — delivered. build-linux-c99 builds Core against a
    dedicated c99 preset and then checks the platform packs, with a C89 public
    header check alongside it. S24.16 did the source work; the lane keeps it honest.
  • IWYU cost versus value (comment below) — settled. Of the six directions
    listed, "downgrade IWYU to advisory" was chosen and shipped as S24.13, and the
    lanes cite it. IWYU is advisory in CI and is not part of any pre-push budget.

Activity

  1. changed the title [-]E24: Hardening[/-] [+]E24: Code Hygiene[/+] on May 10, 2026
  2. DavidCozens commented on May 11, 2026

    @DavidCozens
    CollaboratorAuthor

    All three S24 stories Done (S24.01 #255, S24.02 #321, S24.03 #325). Closing the epic.

  3. 12 remaining items

  4. DavidCozens commented on Jul 20, 2026

    @DavidCozens
    CollaboratorAuthor

    All 23 stories complete (subIssuesSummary 23/23). Final story S24.22 (#609 — FreeRtosSysUpTime tick-wrap guard) merged via PR #634; sibling S24.23 (#610 — Address pool exhaustion race) closed as won't-fix (accepted tradeoff). Closing E24: Code Hygiene.

  5. DavidCozens commented on Jul 26, 2026

    @DavidCozens
    CollaboratorAuthor

    Reopening — E24 is the rolling code-hygiene catchall and stays open by design; new hygiene stories accrete under it over time.

  6. DavidCozens commented on Oct 2, 2026

    @DavidCozens
    CollaboratorAuthor

    All 30 stories are done. The one idea never promoted, resource-leak counters in the test fakes, overlaps #889 and gets its own epic if it is ever started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicEpic issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions