Skip to content

refactor: standardize command names to :RESOURCE:ACTION: pattern#128

Merged
fank merged 1 commit intomainfrom
refactor/command-naming
Feb 23, 2026
Merged

refactor: standardize command names to :RESOURCE:ACTION: pattern#128
fank merged 1 commit intomainfrom
refactor/command-naming

Conversation

@fank
Copy link
Member

@fank fank commented Feb 23, 2026

Summary

  • Renames all extension command strings from inconsistent naming (overloaded :NEW:, mixed verb/noun ordering, bare nouns) to a consistent :RESOURCE:ACTION: pattern
  • System commands namespaced under :SYS: (INIT, VERSION, LOG, DIR, TIMESTAMP)
  • Entity commands use :RESOURCE:CREATE/STATE: (SOLDIER, VEHICLE, PLACED, MARKER)
  • Event commands namespaced under :EVENT: (GENERAL, KILL, PROJECTILE, CHAT, RADIO)
  • Mission commands flipped to :MISSION:START/SAVE:
  • Callbacks aligned (:EXT:READY::SYS:READY:)

Coordinated change

Must be deployed together with the addon PR: OCAP2/addon#80

Test plan

  • go test ./... passes
  • Grep confirms zero leftover old command strings
  • Integration test with addon using matching branch

@gemini-code-assist
Copy link

Summary of Changes

Hello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the command naming scheme used throughout the extension to introduce a standardized :RESOURCE:ACTION: pattern. This change aims to improve consistency, readability, and maintainability of the command interface, making it easier to understand and work with the various commands that the extension processes. The update impacts system, entity, event, and mission-related commands, ensuring a uniform approach across the board.

Highlights

  • Standardized Command Naming: All extension command strings have been refactored to follow a consistent :RESOURCE:ACTION: pattern, replacing inconsistent naming conventions.
  • System Commands Namespacing: System-level commands such as INIT, VERSION, LOG, DIR, and TIMESTAMP are now explicitly namespaced under :SYS: (e.g., :SYS:INIT:).
  • Entity and Event Command Clarity: Entity-related commands (SOLDIER, VEHICLE, PLACED, MARKER) now use :RESOURCE:CREATE/STATE: patterns, and event commands (GENERAL, KILL, PROJECTILE, CHAT, RADIO) are grouped under :EVENT:.
  • Mission Command Renaming: Mission-related commands have been updated to :MISSION:START: and :MISSION:SAVE: for improved clarity.
  • Callback Alignment: Callbacks, such as :EXT:READY:, have been aligned with the new system naming convention, becoming :SYS:READY:.
  • Documentation Updates: All relevant documentation files (CLAUDE.md, README.md) and code comments have been updated to reflect the new command naming scheme.
Changelog
  • CLAUDE.md
    • Updated command names in the GORM models and data flow documentation tables.
  • README.md
    • Updated command names in the buffered handlers description.
    • Updated command names in the detailed command tables for entity, combat, general, marker, placed object, and system commands.
  • cmd/ocap_recorder/main.go
    • Updated callback command strings from :EXT:READY: to :SYS:READY: and :VERSION: to :SYS:VERSION:.
    • Updated comments to reflect the new system command names for early dispatcher initialization.
    • Renamed handleNewMission comment to reflect the new :MISSION:START: command.
    • Updated command registration strings for system lifecycle commands (INIT, INIT:STORAGE, VERSION, GETDIR:ARMA, GETDIR:MODULE, GETDIR:OCAPLOG, ADDON:VERSION, LOG, NEW:MISSION, SAVE:MISSION) to their new standardized names.
  • cmd/ocap_recorder/storage.go
    • Updated the log message for the storage initialization command to reflect :STORAGE:INIT:.
  • internal/model/model.go
    • Updated SQF command comments for Soldier from :NEW:SOLDIER: to :SOLDIER:CREATE:.
    • Updated SQF command comments for SoldierState from :NEW:SOLDIER:STATE: to :SOLDIER:STATE:.
    • Updated SQF command comments for Vehicle from :NEW:VEHICLE: to :VEHICLE:CREATE:.
    • Updated SQF command comments for VehicleState from :NEW:VEHICLE:STATE: to :VEHICLE:STATE:.
    • Updated SQF command comments for ProjectileEvent from :PROJECTILE: to :EVENT:PROJECTILE:.
    • Updated SQF command comments for ProjectileHitsSoldier and ProjectileHitsVehicle to reflect :EVENT:PROJECTILE:.
    • Updated SQF command comments for GeneralEvent from :EVENT: to :EVENT:GENERAL:.
    • Updated SQF command comments for KillEvent from :KILL: to :EVENT:KILL:.
    • Updated SQF command comments for ChatEvent from :CHAT: to :EVENT:CHAT:.
    • Updated SQF command comments for RadioEvent from :RADIO: to :EVENT:RADIO:.
    • Updated ServerFpsEvent comment to reflect the new :TELEMETRY:FRAME: command.
    • Updated SQF command comments for TimeState from :NEW:TIME:STATE: to :TIME:STATE:.
    • Updated SQF command comments for Marker from :NEW:MARKER: to :MARKER:CREATE:.
    • Updated SQF command comments for MarkerState from :NEW:MARKER:STATE: to :MARKER:STATE:.
  • internal/worker/dispatch.go
    • Updated command registration strings for all event handlers to align with the new naming convention, including entity creation, state updates, combat events, general events, ACE3 events, placed objects, and marker operations.
  • internal/worker/dispatch_test.go
    • Updated the list of expected commands in TestRegisterHandlers_RegistersAllCommands.
    • Updated command strings used in various test dispatches for handleNewSoldier, handleNewVehicle, handleSoldierState, handleVehicleState, handleKillEvent, handleProjectile, handleMarkerMove, handleChatEvent, handleMarkerDelete, handleTimeState, handleGeneralEvent, handleRadioEvent, handleTelemetryEvent, handleMarkerCreate, handleNewPlaced to reflect the new naming scheme.
  • pkg/a3interface/rvextension.go
    • Updated the built-in timestamp command from :TIMESTAMP: to :SYS:TIMESTAMP: in both RVExtension and RVExtensionArgs functions.
  • pkg/a3interface/rvextension_test.go
    • Updated command names in TestFormatDispatchResponse test cases to reflect the new :SYS: namespace for system commands.
  • pkg/core/events.go
    • Updated the comment for TelemetryEvent to reference :TELEMETRY:FRAME: instead of :TELEMETRY:.
Activity
  • The pull request author has confirmed that go test ./... passes.
  • The author has verified that no old command strings are left over via grep.
  • Integration tests with the addon using a matching branch are pending.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request standardizes command names to a :RESOURCE:ACTION: pattern, improving consistency and clarity across the project. This refactoring impacts documentation, main application logic, data models, and worker handlers, ensuring all components align with the new naming convention. The changes are well-implemented and tested, contributing positively to the codebase's maintainability.

…ttern

Rename all command strings from inconsistent naming (overloaded :NEW:,
mixed verb/noun ordering, bare nouns) to a consistent :RESOURCE:ACTION:
pattern. This is a coordinated change with the addon repo.

Key changes:
- System commands namespaced under :SYS: (INIT, VERSION, LOG, DIR, TIMESTAMP)
- Entity commands use :RESOURCE:CREATE/STATE: (SOLDIER, VEHICLE, PLACED, MARKER)
- Event commands namespaced under :EVENT: (GENERAL, KILL, PROJECTILE, CHAT, RADIO)
- Mission commands flipped to :MISSION:START/SAVE:
- Telemetry uses :TELEMETRY:FRAME:
- Callbacks aligned (:EXT:READY: → :SYS:READY:)
@fank fank force-pushed the refactor/command-naming branch from c492672 to 208b742 Compare February 23, 2026 11:41
@github-actions
Copy link

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/extension/v5/cmd/ocap_recorder 0.00% (ø)
github.com/OCAP2/extension/v5/internal/model 100.00% (ø)
github.com/OCAP2/extension/v5/internal/worker 100.00% (ø)
github.com/OCAP2/extension/v5/pkg/a3interface 0.00% (ø)
github.com/OCAP2/extension/v5/pkg/core 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/extension/v5/cmd/ocap_recorder/main.go 0.00% (ø) 0 0 0
github.com/OCAP2/extension/v5/cmd/ocap_recorder/storage.go 0.00% (ø) 0 0 0
github.com/OCAP2/extension/v5/internal/model/model.go 100.00% (ø) 23 23 0
github.com/OCAP2/extension/v5/internal/worker/dispatch.go 100.00% (ø) 186 186 0
github.com/OCAP2/extension/v5/pkg/a3interface/rvextension.go 0.00% (ø) 0 0 0
github.com/OCAP2/extension/v5/pkg/core/events.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/OCAP2/extension/v5/internal/worker/dispatch_test.go
  • github.com/OCAP2/extension/v5/pkg/a3interface/rvextension_test.go

@fank fank merged commit bf0fbc1 into main Feb 23, 2026
3 checks passed
@fank fank deleted the refactor/command-naming branch February 23, 2026 11:44
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