Skip to content

Plan code base audit remediation - #52

Draft
leynos wants to merge 10 commits into
mainfrom
code-base-audit-2026-06-05
Draft

Plan code base audit remediation#52
leynos wants to merge 10 commits into
mainfrom
code-base-audit-2026-06-05

Conversation

@leynos

@leynos leynos commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Review Notes

This PR is intentionally plan-only. Implementation is blocked on explicit approval of the ExecPlan.

The plan covers the requested work around canonical action-name newtypes, checked mangling APIs, typed validation diagnostics, schema serde boundaries, schema default documentation, macro query/render separation, fixture helper consolidation, Rustdoc examples, and duplicated deserialization boilerplate.

Validation

  • make fmt
  • make check-fmt
  • make markdownlint
  • make nixie
  • make lint
  • make test
  • coderabbit review --agent exited successfully on retry with no finding payload.

Summary by Sourcery

Add an execution plan for addressing 2026-06-05 code base audit findings and expand repository and contribution documentation to guide future implementation and abstractions.

Enhancements:

  • Clarify contributor guidance in AGENTS.md around abstraction/helper policies, documentation updates, testing practices, dependency versioning, and project documentation expectations.

Documentation:

  • Introduce a detailed ExecPlan document for the 2026-06-05 code base audit remediation and link it from the documentation index.
  • Add a repository layout guide describing canonical locations for source, tests, fixtures, generated artefacts, and long-lived docs.
  • Restructure the documentation index into thematic sections, including execution plans, guides, architecture, and reference material.

leynos added 2 commits June 5, 2026 00:58
Import the latest Rust agent instructions and align the documentation index
with the current style-guide structure. Add the canonical repository layout
reference so contributors have one source of truth for path ownership and
fixture locations.

Run the Markdown formatter across the documentation set so existing prose
continues to satisfy the repository documentation gates.
Add the execution plan for the 2026-06-05 code base audit remediation work and index it from the documentation contents. Record the validation gates, CodeRabbit review outcome, related follow-up issues, and approval boundary before implementation begins.
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8fd80030-ddd3-4506-a30f-9a958bcd7853

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch code-base-audit-2026-06-05

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new execution plan for remediating a recent code base audit, wires it into the documentation index, tightens repository/agent guidance around abstractions, testing, and documentation, and introduces a canonical repository layout doc plus minor doc cleanups.

Flow diagram for the approval-gated code base audit ExecPlan

flowchart TD
    A[Audit findings 2026-06-05] --> B[ExecPlan code-base-audit-2026-06-05.md]
    B --> C[User explicitly approves implementation]
    C --> D[Milestones 1-8 implemented]
    D --> E[Repo gates make fmt/lint/test]
    E --> F[coderabbit review --agent]
    F --> G[Audit remediation complete]
Loading

File-Level Changes

Change Details Files
Introduce a detailed ExecPlan for the 2026-06-05 code base audit remediation and index it from the docs.
  • Add a plan-only execution document describing constraints, milestones, risks, and validation steps for addressing audit findings around canonical action names, mangling, validation diagnostics, schema serde boundaries, docs, and fixtures.
  • Document related follow-up issues that are explicitly out of scope for this plan.
  • Record current progress, surprises, and decision log entries for the audit remediation effort.
docs/execplans/code-base-audit-2026-06-05.md
docs/contents.md
Refine AGENTS and contributor guidance for change quality, refactoring, testing, dependency policy, error handling, and documentation.
  • Adjust headings and wording for change quality and refactoring sections to be clearer and more concise.
  • Add an explicit policy for introducing abstractions/ports/helpers that requires repo-wide sweeps, scoping documentation, and recording design decisions in the docs indexed from contents.md.
  • Clarify expectations for tests, including adding insta snapshot tests when multivariant outputs matter, and reinforce usage of cap-std, caret dependency requirements, and strict expect usage.
  • Add a project documentation section explaining where to record design decisions, ADRs, user-facing behaviour, and internal practices.
AGENTS.md
Clarify and slightly correct wording and formatting in existing ExecPlan and ADR docs.
  • Normalize inline code spans, spacing, and line-wrapping in existing execution plans to improve readability and markdown formatting.
  • Clarify example function signatures and descriptions in validation and action-signature ADR docs without changing their technical meaning.
  • Ensure references to tools like cargo-kani and function entrypoints are formatted consistently.
docs/execplans/3-2-2-gate-generated-kani-harnesses.md
docs/execplans/2-3-2-optional-literal-text-wrapper.md
docs/execplans/1-2-1-validate-required-fields-and-non-empty-constraints.md
docs/execplans/2-3-1-argument-decoding-for-plain-yaml-strings.md
docs/adr-004-action-signature-specification.md
Reorganize and expand the documentation contents index into a structured, categorized table of contents, including a new repository layout guide and explicit ExecPlan listings.
  • Restructure contents.md into sections for user/contributor guides, architecture and design, decision records, reference material, and execution plans.
  • Add entries and descriptions for the new code-base-audit ExecPlan and additional existing ExecPlans and architecture docs that were previously less clearly grouped.
  • Introduce a new "Repository layout" document and link it early in the index as the canonical map of the repo.
  • Tighten link descriptions and wording for existing docs (e.g., doctest guide, roadmap, design spec, scripting standards, localization).
docs/contents.md
docs/repository-layout.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-delta-analysis[bot]

This comment was marked as outdated.

Update the living ExecPlan after pushing the plan branch and opening the draft pull request so the progress checklist reflects the current review state.
codescene-delta-analysis[bot]

This comment was marked as outdated.

leynos added 2 commits June 5, 2026 02:45
Add shared integration fixture helpers for theorem files and diagnostics,
then migrate duplicated BDD and schema tests to use them. Add googletest
and pretty_assertions as test-only dependencies so new helper coverage uses the
requested assertion styles.

Document the reusable testing pattern in the developers guide and record
Milestone 1 validation plus CodeRabbit review status in the ExecPlan.
Update the audit ExecPlan with the Milestone 1 implementation commit
after the fixture-helper refactor passed deterministic documentation gates.
codescene-delta-analysis[bot]

This comment was marked as outdated.

leynos added 2 commits June 5, 2026 03:22
Move canonical action-name grammar and typed validation reasons into a
neutral theoremc-core module shared by schema validation and mangling.
Change identifier-sensitive mangle APIs to accept CanonicalActionName or
return InvalidCanonicalActionName from checked string entry points.

Update collision detection, macro probe rendering, behavioural tests, and
property tests to use the checked boundary. Document the shared-domain
pattern in the developers guide and record Milestone 2 validation in the
audit ExecPlan.
Update the audit ExecPlan with the canonical action-name milestone
implementation commit after validation and CodeRabbit review were completed.
codescene-delta-analysis[bot]

This comment was marked as outdated.

leynos added 2 commits June 5, 2026 03:52
Store action signature keys and action-call targets as
`CanonicalActionName` instead of `String`, so invalid action names are
rejected during raw-to-domain conversion rather than during late
validation or code generation.

Update collision detection, macro action probes, and tests to consume the
new domain type. Add raw conversion coverage for invalid `Actions` keys
and action-call names, and document the raw schema boundary in the
developer guide and ExecPlan.
Mark the canonical action-name domain migration as committed in the
ExecPlan after the implementation commit, deterministic gates, and
CodeRabbit review completed successfully.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Return typed validation paths and reason kinds from semantic schema
validation, then render public diagnostics at the loader boundary. Map
those paths through the raw schema adapter so source locations no longer
depend on parsing human-readable error strings.

Document the validation diagnostic boundary in the developer guide and
record Milestone 4 progress, local gate evidence, and the repeated
CodeRabbit sandbox-preparation blocker in the ExecPlan.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Failed
New code is healthy (1 new file with code health below 10.00)
Enforce advisory code health rules (2 files with String Heavy Function Arguments, Code Duplication)

Our agent can fix these. Install it.

Gates Passed
4 Quality Gates Passed

Reason for failure
New code is healthy Violations Code Health Impact
canonical_action_name.rs 1 rule 9.69 Suppress
Enforce advisory code health rules Violations Code Health Impact
collision.rs 1 advisory rule 10.00 → 9.39 Suppress
canonical_action_name.rs 1 advisory rule 9.69 Suppress

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant