Skip to content

Fill in the roadmap, the maintainers and the assurance case #35

Done

Description

@polewskm

The update to project-template v0.145.1 (#26) added the documents the OpenSSF Best Practices silver level asks for (the template's ADR-0023). Their facts about the code were filled in (docs/architecture.md's Components), but these sections state the maintainers' own plans and commitments, and still hold the template's prompts:

  • ROADMAP.md: Next Twelve Months and Not Planned (Nothing is ruled out yet.).
  • GOVERNANCE.md: the Maintainer row and Owners today: name no one; the prompt asks to name the owners and keep the list current.
  • docs/assurance-case.md: Security Requirements, Threat Model, Secure Design Principles Applied and Common Weaknesses Countered say Not written yet., and Security Reviews None recorded yet.

Fill each from the maintainers' decisions, deleting each [//]: # "Maintainers: ..." prompt once its section is written. NCode Review raised it as F6 on #34.

Found while planning #26.

Activity

  1. polewskm commented on Nov 29, 2026

    @polewskm
    ContributorAuthor

    Plan snapshot. The working copy is PLAN.md in the plan's checkout; this comment is not updated as steps run.

    Plan: Fill in the roadmap, the maintainers and the assurance case (7 steps)

    Plan: Fill in the roadmap, the maintainers and the assurance case

    Issue: #35

    Goal

    ROADMAP.md, GOVERNANCE.md and docs/assurance-case.md still hold the project template's [//]: # "Maintainers: ..."
    prompts and placeholders (Not written yet., Nothing is ruled out yet., The repository's owners). Write each section
    from evidence that can be checked: GitHub's collaborator and organization lists, the open issues, the decision records,
    the code of the two packages and the repository's CI and ruleset settings. Delete each prompt once its section is
    written, so the OpenSSF Best Practices silver documents (template ADR-0023) say what the project actually does.

    Context for the executor

    • Build: dotnet build
    • Test: dotnet test
    • Gate: ./build/dod.ps1 -Fast
    • Conventions: Markdown lines wrap at 120 characters like the rest of each file; links in docs/assurance-case.md are
      relative to docs/ (decisions/..., ../SECURITY.md), links in ROADMAP.md and GOVERNANCE.md are relative to the
      root; issues are linked as [#33](https://github.com/NCodeGroup/Mediator/issues/33). Follow the shape of the same
      sections in NCodeGroup/brand's docs/assurance-case.md (requirements R1..Rn, a threat table with Threat, In scope,
      Countered by, principles as bold-labelled bullets, CWEs as bullets naming the requirement).
    • Facts gathered on 2026-11-29 (use them as written, claim nothing beyond them):
      • gh api repos/NCodeGroup/Mediator/collaborators: one collaborator, polewskm, role admin.
        gh api orgs/NCodeGroup/members?role=admin: polewskm only; the organization has no other member.
      • nuget.org: NCode.Mediator and NCode.Mediator.Abstractions 1.0.0 are owned by the nuget.org account NCode
        (https://www.nuget.org/profiles/NCode), on a verified ID prefix; nuget.org doesn't show that account's members.
      • Ruleset Protect main (no bypass actors): no deletion, no force push, pull request with one approval of the last
        push, stale approvals dismissed, every review thread resolved, merge methods merge and rebase; required status
        checks build, build-and-test, test, branch up to date; code scanning rule: CodeQL alerts at errors and
        warnings, security alerts of any severity. Ruleset Protect release tags (refs/tags/v*): no deletion, no update.
      • Repository: public; private vulnerability reporting on; secret scanning and push protection on; Dependabot
        security updates on.
      • .github/workflows/ci.yml: top-level contents: read, checkouts with persist-credentials: false, actions pinned
        by full commit SHA; build-and-test runs ./build/dod.ps1 (decision index, Release build with warnings as errors
        and FailOnNuGetAdvisories, tests, pack); reproducible-build runs ./.template/Test-ReproducibleBuild.ps1
        (template ADR-0154), not a required check. Check .NET support runs with -WarnOnly until Move the packages off .NET 8, past its end of support #33.
      • .github/workflows/main.yml (jobs build, test, publish): build and test are required checks; publish
        runs only on a published GitHub release, holds contents: write, uploads the packages to the release and pushes
        them to nuget.org with the NUGET_APIKEY repository secret. Its actions/* steps use version tags
        (actions/checkout@v7), not commit SHAs; only dorny/test-reporter is pinned by SHA. Its publish job expands
        github.event.release.tag_name and the key inside run:. No build provenance attestation is made. Decisions left after the project-template v0.61.2 and NCode Review v1.1.2 upgrade #25 tracks
        trusted publishing, retiring its CI and hardening it.
      • .github/workflows/codeql.yml: CodeQL security-extended on actions and csharp on every pull request, push
        to main, merge group and weekly. .github/workflows/scorecard.yml: OpenSSF Scorecard on each push to main and
        weekly. .github/workflows/code-review.yml: NCode Review (NCodeGroup/code-review, pinned by SHA, v1.7.0) runs
        from the default branch through pull_request_target, reviews each pull request when it opens or is marked ready
        and on a writer's /review, never builds or runs the pull request's code, and its approver app's approval meets
        the ruleset's required approval.
      • .github/dependabot.yml: weekly github-actions, nuget and dotnet-sdk updates, three-day cooldown, security
        updates grouped. nuget.config clears every source and adds only nuget.org.
      • build/ProjectTemplate.props: warnings as errors, latest-recommended analyzers, banned APIs, null-forgiving
        operator banned outside tests, ContinuousIntegrationBuild in CI, Source Link with embedded untracked sources,
        .snupkg symbols, package validation against PackageValidationBaselineVersion 1.0.0 (Directory.Build.props).
        .copier-answers.yml has coverage_gate: false: coverage is not measured or gated.
      • Code (NCode.Mediator/, NCode.Mediator.Abstractions/): AddMediator (DefaultRegistration.cs) registers only
        the library's own types, scoped, with TryAdd; it scans no assembly. DefaultMediator.SendAsync resolves
        ICommandHandlerWrapper<TCommand> or ICommandResponseHandlerWrapper<TCommand,TResponse> with
        GetRequiredService; PolymorphicSendAsync builds that type with MakeGenericType(command.GetType()) and is
        [RequiresDynamicCode]. The standard middleware (Middleware/Standard*.cs, [RequiresDynamicCode]) runs
        pre-processors, then next(), then post-processors; on any exception it notifies the listener wrapper and the
        handler wrapper resolved for exception.GetType(), returns or completes only when state.IsHandled, and
        otherwise throw;. The exception-handler wrappers stop at the first handler that sets handled. Every pipeline
        list is sorted with OrderByDescending(MediatorPriority) (0 without ISupportMediatorPriority), a stable sort.
        The library writes no log, opens no file, socket or process, serializes nothing and keeps no command, response or
        exception after the call. DefaultMediatorPriorities.High and Low are public static settable properties.
      • Open issues to link: Move the packages off .NET 8, past its end of support #33 (drop .NET 8, past end of support), Drop NCode Review v1.7.0's cooldown exception #32 (drop NCode Review v1.7.0's cooldown exception,
        not before 2026-11-30T21:24Z), Decisions left after the project-template v0.61.2 and NCode Review v1.1.2 upgrade #25 (decisions left: AssemblyVersion, auto-merge exception, CA1711/CA1716 names,
        trusted publishing, retire main.yml's CI, main.yml hardening, Directory.Packages.props ownership, changelog
        backfill). docs/best-practices-badge.md: not registered at bestpractices.dev yet. The project has no ADR of its
        own (docs/decisions/ holds only 0000-template.md), and no document rules a feature out.
    • Gotchas: never edit the template-owned files (docs/decisions/project-template/, build/dod.ps1, ...). Leave
      docs/architecture.md's, SECURITY.md's and docs/best-practices-badge.md's own prompts alone: Fill in the roadmap, the maintainers and the assurance case #35 covers only
      the three files.

    Decisions

    Out of scope

    Steps

    [ ] 1. Assert that a throwing pre-processor skips the handler

    • Files: NCode.Mediator.Tests/Middleware/StandardCommandMiddlewareTests.cs (edit),
      NCode.Mediator.Tests/Middleware/StandardCommandResponseMiddlewareTests.cs (edit)
    • Change: in each file's HandleAsync_WhenPreProcessorThrows_NotifiesListenersAndInvokesHandlers, add
      var nextInvoked = false; and pass a next delegate that sets it (() => { nextInvoked = true; return ...; }),
      then Assert.False(nextInvoked); after the existing asserts.
    • Pattern: the listenerInvoked flag in the same test.
    • Done when: dotnet test NCode.Mediator.Tests --filter "FullyQualifiedName~WhenPreProcessorThrows" -- RunConfiguration.TreatNoTestsAsError=true; if (-not $? -or $LASTEXITCODE) { exit 1 } else { exit 0 }

    [ ] 2. Name the maintainer and the owners in GOVERNANCE.md

    • Files: GOVERNANCE.md (edit)
    • Change: delete both [//]: # "Maintainers: ..." lines; Maintainer row's Who becomes
      [@polewskm](https://github.com/polewskm); replace the Owners today: paragraph with: @polewskm, the one owner of
      the NCodeGroup organization and the one admin of this repository; the packages on nuget.org belong to the nuget.org
      account NCode; keep the sentence that continuity needs two people and the
      silver level can't be claimed until then, with its link.
    • Done when: if ((Select-String -LiteralPath GOVERNANCE.md -Pattern 'Maintainers:' -Quiet) -or -not (Select-String -LiteralPath GOVERNANCE.md -Pattern '\| Maintainer \| \[@polewskm\]' -Quiet) -or -not (Select-String -LiteralPath GOVERNANCE.md -Pattern '^Owners today: \[@polewskm\]' -Quiet)) { exit 1 } else { exit 0 }

    [ ] 3. Write the roadmap

    [ ] 4. Write the security requirements and threat model

    • Files: docs/assurance-case.md (edit)
    • Change: Security Requirements: R1 only registered code runs; R2 polymorphic dispatch resolves only registered
      services, a response command with no handler fails; R3 failures fail closed; R4 deterministic order; R5 no side
      effects or retained data; R6 builds and releases come from reviewed code; then what users must not rely on (no
      authorization or validation of its own, a handler that sets handled suppresses any exception, settable
      DefaultMediatorPriorities, dynamic code paths, main.yml gaps Decisions left after the project-template v0.61.2 and NCode Review v1.1.2 upgrade #25, .NET 8 Move the packages off .NET 8, past its end of support #33). Threat Model: trust boundary (the
      host process and its container are trusted; command data is the application's), a Threat/In scope/Countered by
      table, out-of-scope items. Delete both prompts.
    • Done when: $t = Get-Content -LiteralPath docs/assurance-case.md -Raw; if ($t -match 'Maintainers: (list what|add a table)' -or $t -notmatch '\*\*R6\.\*\*' -or $t -notmatch '\| Threat \| In scope \| Countered by \|') { exit 1 } else { exit 0 }

    [ ] 5. Write the design principles and the weaknesses countered

    • Files: docs/assurance-case.md (edit)
    • Change: Secure Design Principles Applied: economy of mechanism, fail-safe defaults, complete mediation, least
      privilege, open design, each from the facts above. Common Weaknesses Countered: CWE-470, CWE-636 and CWE-755,
      CWE-696, CWE-532, CWE-1395, CWE-829, CWE-250, each naming its requirement or control. Delete both prompts.
    • Done when: $t = Get-Content -LiteralPath docs/assurance-case.md -Raw; if ($t -match 'Maintainers: (say how|list the CWE)' -or $t -match 'Not written yet' -or $t -notmatch 'CWE-470' -or $t -notmatch '\*\*Least privilege') { exit 1 } else { exit 0 }

    [ ] 6. Write the evidence and the security reviews

    • Files: docs/assurance-case.md (edit)
    • Change: Evidence: delete its prompt, keep its bullets correct, add a Requirements under test bullet naming the
      tests behind R2–R4 and say coverage isn't gated, and correct Static analysis, Review and Release
      integrity
      to the facts above (CodeQL languages, required checks, reproducible build, release tags ruleset, no
      attestation). Security Reviews: delete its prompt; say no independent security review has been done, and list what
      reviews every change (NCode Review, CodeQL, Scorecard, Dependabot, secret scanning).
    • Done when: $t = Get-Content -LiteralPath docs/assurance-case.md -Raw; if ($t -match 'Maintainers:' -or $t -match 'None recorded yet' -or $t -notmatch 'Requirements under test') { exit 1 } else { exit 0 }

    [ ] 7. Record the change in the changelog

    • Files: CHANGELOG.md (edit)
    • Change: under ## [Unreleased]'s existing ### Changed, add the entry: - GOVERNANCE.md names the maintainer and the owners, ROADMAP.md lists the plans for the next twelve months, and docs/assurance-case.md states the security requirements, the threat model, the design principles and the weaknesses it counters ([#35](https://github.com/NCodeGroup/Mediator/issues/35)). with each file name in backticks.
    • Done when: if (Select-String -LiteralPath CHANGELOG.md -Pattern 'issues/35' -Quiet) { exit 0 } else { exit 1 }

    Review checklist

    • Every claim in the three documents matches the code, a workflow, a setting or an issue as gathered above; no claim
      of a control the repository doesn't have (attestation, trusted publishing, coverage gate, an outside review).
    • No [//]: # "Maintainers: ..." prompt is left in the three files, and no other file's prompt was touched.
    • Every relative link resolves from its file's folder.
    • Marcin reviews the roadmap's and the threat model's wording.
  2. polewskm commented on Nov 29, 2026

    @polewskm
    ContributorAuthor

    Autopilot: re-plan note. While writing R4, the plan found that middleware run lowest priority first (CommandHandlerWrapper and CommandResponseHandlerWrapper fold them from the handler outward after a descending sort), the reverse of what the README and the XML documentation say. Changing either is a decision for a maintainer, outside this documentation issue, so it is filed as #38, and the assurance case describes the order as it is and links #38. It also found that the NUGET_APIKEY secret main.yml publishes with isn't stored for this repository; the assurance case says so and links #25.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions