Skip to content

Add ->command helper fn#14

Closed
bpringe wants to merge 3 commits into
ObneyAI:mainfrom
bpringe:add_command_helper_fn_9
Closed

Add ->command helper fn#14
bpringe wants to merge 3 commits into
ObneyAI:mainfrom
bpringe:add_command_helper_fn_9

Conversation

@bpringe

@bpringe bpringe commented May 30, 2026

Copy link
Copy Markdown
Contributor

Closes #9

I tested the example app demo code after the changes.

:query/timestamp (time/now)
:query/id (random-uuid)}))
:query/result))
@(def counters

@bpringe bpringe May 30, 2026

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.

Added @ for convenience - so the value of counters is returned when this form is evaluated.

Copilot AI 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.

Pull request overview

Adds a cp/->command helper to standardize command construction by ensuring :command/id and :command/timestamp are present, and updates the example/demo and server-side decoding to use it.

Changes:

  • Introduces ai.obney.grain.command-processor-v2.interface/->command (backed by core/->command) to fill missing :command/id and :command/timestamp.
  • Updates the command request handler to drop any client-supplied :command/id/:command/timestamp and regenerate them server-side via ->command.
  • Updates the example app demo and adds unit tests covering ->command behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
development/src/example_app_demo.clj Uses cp/->command in REPL/demo snippets and cleans up trailing comment return forms.
components/command-request-handler-v2/src/ai/obney/grain/command_request_handler_v2/core.clj Regenerates command id/timestamp server-side via cp/->command after dropping client-supplied values.
components/command-processor-v2/test/ai/obney/grain/command_processor_v2/interface_test.clj Refactors command test helper to use cp/->command and adds focused tests for ->command.
components/command-processor-v2/src/ai/obney/grain/command_processor_v2/interface.clj Exposes the new public ->command helper in the interface namespace.
components/command-processor-v2/src/ai/obney/grain/command_processor_v2/core.clj Implements ->command to populate defaults using random-uuid and time/now.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bpringe

bpringe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing this. It's maybe a premature or unnecessary convenience function.

@bpringe bpringe closed this Jun 15, 2026
@bpringe bpringe deleted the add_command_helper_fn_9 branch June 15, 2026 18:00
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.

Add ->command fn and update examples app demo

2 participants