Skip to content

Created console debug functions, refreshed documentations, fix issue with nonmap command execution, test separation and trimming.#11

Open
SerhiiRI wants to merge 3 commits intomainfrom
feat/console-debug-and-update-documentation
Open

Created console debug functions, refreshed documentations, fix issue with nonmap command execution, test separation and trimming.#11
SerhiiRI wants to merge 3 commits intomainfrom
feat/console-debug-and-update-documentation

Conversation

@SerhiiRI
Copy link
Copy Markdown
Contributor

ADDED commando.debug namespace — new dedicated module for debug visualization. Provides two main entry points:

  • execute-debug — execute an instruction and visualize it in one of six display modes: :tree, :table, :graph, :stats, :instr-before / :instr-after. Supports combining multiple modes via a vector.
  • execute-trace — trace all nested commando/execute calls.

REMOVED BREAKING print-stats, print-trace (print-deep-stats) from commando.impl.utils. These functions have been replaced by the richer commando.debug namespace.

FIXED crop-final-status-map in commando.core — internal keys (:internal/cm-list, :internal/cm-dependency, :internal/cm-running-order, :registry) are now properly stripped from the result when :debug-result is not enabled.

FIXED execute-command-impl in commando.impl.executing — added guard for non-map command-data before calling dissoc on driver keys (:=>, "=>), preventing errors when command data is a non-map value.

UPDATED documentation — restructured README.md with improved navigation, added "Managing the Registry" and "Debugging" sections. Moved doc files from doc/ to examples/ directory with richer, runnable code examples: walkthrough.clj, integrant.clj, json.clj, reitit.clj, reagent_front.cljs.

UPDATED tests — split monolithic core_test.cljc into focused test namespaces: dependency_test.cljc, finding_commands_test.cljc, graph_test.cljc. Added debug_test.cljc for the new debug module. Updated performance tests.

@Kaspazza i've added debug_test, it's just smoke test for visual check. Nothing more.

…with nonmap command execution, test separation and trimming.
@SerhiiRI SerhiiRI requested a review from Kaspazza March 21, 2026 11:56
@SerhiiRI SerhiiRI self-assigned this Mar 21, 2026
@SerhiiRI SerhiiRI force-pushed the feat/console-debug-and-update-documentation branch from 60946d0 to e926ebb Compare March 21, 2026 22:14
…e with stub components. integrant , component are now fully testable from repl
@SerhiiRI SerhiiRI force-pushed the feat/console-debug-and-update-documentation branch from e926ebb to 4245912 Compare March 21, 2026 22:17
@@ -0,0 +1,630 @@
(ns commando.debug
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.

makes sense to move it from utils.

Copy link
Copy Markdown
Contributor

@Kaspazza Kaspazza left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +608 to +611
(binding [utils/*execute-config*
(assoc (utils/execute-config)
:hook-execute-start
(fn [e]
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.

This execute-trace will overrwrite hooks that user may have set under :hook-execute-start. Would be better to compose hooks instead of overwriting them

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 very special case. I think user need to create its own function. But we can handle this in future release. But for now i think it little bit unnecessary, cause the only one case with hooks, is this function.

Accepts a single mode keyword or a vector of modes to combine.

Modes:
:table — tabular execution map (order, deps, results) (default)
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.

This says :table is default but in implementation it defaults to :tree

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.

good catch, will fix it in the second mr.

execute-debug — execute and visualize a single instruction
execute-trace — trace all nested execute calls with timing

Display modes for execute-debug / pprint-debug:
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.

Having this description of a function details at the ns level docstring is a bad idea, they will drift off quickly.

Even now, when you look at pprint-debug the documentation in it has already drifted, even though it's a first commit on them. The pprint-debug says default is :table and ns says it's :tree.

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.

your right , i'll fix it in the second mr
(sorry no in this one, because in second MR, i've already add few changes to debug.cljc)

- `execute-debug` — execute an instruction and visualize it in one of six display modes: `:tree`, `:table`, `:graph`, `:stats`, `:instr-before` / `:instr-after`. Supports combining multiple modes via a vector.
- `execute-trace` — trace all nested `commando/execute` calls.

REMOVED **BREAKING** `print-stats`, `print-trace` (`print-deep-stats`) from `commando.impl.utils`. These functions have been replaced by the richer `commando.debug` namespace.
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.

If it's breaking it should not be update from 1.1.0 -> 1.1.1, it should be at least 1.2.0

Because the last one is non-breaking so user knows those updates can be safely added and they don't have to change anything in their code.
https://www.taoensso.com/break-versioning

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.

Respect this idea, but still 1->2 to early, it have to be changed conceptually. Debug function itself cannot break the other architectures. Let discuss it.

the evaluated instruction into the atom."
[state-atom instruction]
;; (ajax/POST "/commando" ...)
;; on-success: (swap! state-atom deep-merge (:instruction result))
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.

this is commented out, so it returns nil, is this TODO?

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.

reagent_front itself it not completely executable. We need to create some simulation of Mutate-http in repl. I'd rather explaining it from flow perspective, like form-component reagent with r/track which wouldn't work either without frontned. So it walkthroug but not much testable itself, it will if you place components in frontend.
if you know how make it better - let then discuss

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.

2 participants