Skip to content

Update contributing documentation for agents - #21776

Merged
dwelch-r7 merged 1 commit into
rapid7:masterfrom
dwelch-r7:update-frozen-string-guidance
Aug 11, 2026
Merged

Update contributing documentation for agents#21776
dwelch-r7 merged 1 commit into
rapid7:masterfrom
dwelch-r7:update-frozen-string-guidance

Conversation

@dwelch-r7

@dwelch-r7 dwelch-r7 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Clarifies # frozen_string_literal: true guidance in AGENTS.md. The previous wording ("add to new files") was overly broad and caused confusion on PR #21574, where a spec file with the pragma crashed against library code that mutates string instance variables.

The new guidance explicitly scopes where frozen string literals should and shouldn't be used:

  • Library files (lib/): yes, with String.new or +'' for mutable buffers
  • Module files: no — framework APIs mutate strings via instance variables
  • Spec files: no

Related Issue: Discussion on #21574

Breaking Changes

None — documentation only.

Verification Steps

    • Read the updated bullet point in AGENTS.md and confirm it matches the project's actual Style/FrozenStringLiteralComment: Enabled: false configuration
    • Confirm String.new is listed first (177 files in lib/ use it vs 46 using +'')

Test Evidence

N/A — documentation change only.

Environment

Field Details
Operating System macOS

AI Usage Disclosure

AI (Kiro/Claude) was used to draft the revised wording based on analysis of existing codebase patterns and the failure observed on PR #21574.

Pre-Submission Checklist

  • No sensitive information in code or documentation
  • Read the CONTRIBUTING.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Clarifies frozen-string guidance for library, module, and spec files without changing runtime behavior.

Changes:

  • Scopes the pragma requirement to new library files.
  • Removes it from module templates and guidance.
  • Documents mutable-string handling with String.new.

Impact Analysis: isolated change; no meaningful downstream impact identified from diff.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
AGENTS.md Clarifies frozen-string conventions and updates templates.
CONTRIBUTING.md Removes the module pragma requirement.
.github/instructions/modules.instructions.md Updates module structure guidance.
.github/instructions/library.instructions.md Clarifies library mutable-string guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 14 to 17
6. `prepend Msf::Exploit::Remote::AutoCheck` — ALWAYS LAST
8. `def initialize` with `update_info`
9. `def check` (when possible)
10. `def exploit` or `def run`
4. Protocol mixins (`include Msf::Exploit::Remote::HttpClient`, etc.)
5. Utility mixins (`include Msf::Exploit::FileDropper`, etc.)
6. `prepend Msf::Exploit::Remote::AutoCheck` — ALWAYS LAST
8. `def initialize` with `update_info`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No 7?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's been banned because of the whole 6 7 meme

(I'll put it back)

@dwelch-r7
dwelch-r7 force-pushed the update-frozen-string-guidance branch from 4098710 to 844110f Compare August 11, 2026 22:08
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Aug 11, 2026
@adfoster-r7 adfoster-r7 added the rn-no-release-notes no release notes label Aug 11, 2026
@dwelch-r7
dwelch-r7 merged commit ad2cc6a into rapid7:master Aug 11, 2026
68 of 69 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-no-release-notes no release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants