Skip to content

docs: add Actions & Pipelines reference page - #32

Merged
gen740 merged 6 commits into
mainfrom
docs/actions
May 11, 2026
Merged

gen740 merged 6 commits into
mainfrom
docs/actions

Conversation

@gen740

@gen740 gen740 commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds docs/docs/actions.mdx: comprehensive reference for the pipeline concept, built-in conversion/validation/pack steps, standalone evaluation via invoke, and custom step authoring
  • Includes a design note explaining why | defers type-checking to Arg<> — preserves polymorphism of validation steps like validation::range<>
  • Adds 'actions' entry to docs/sidebars.ts

🤖 Generated with Claude Code

gen740 and others added 3 commits May 11, 2026 01:05
Documents the pipeline concept, building blocks (conversion/validation/pack),
standalone evaluation, custom step authoring, and utility patterns.
Includes a design note explaining why type-checking is deferred to Arg<>
to preserve polymorphism of validation steps like validation::range<>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace SimpleAction/PackAction CRTP with explicit helper variable
templates. Users reference them directly in their trait declarations
rather than inheriting a base class:

  template <class Input>
  static constexpr bool accepts_input =
      cli::deduce_accepts_input<MyStep, Input>;

  template <class Input>
  using after_type = cli::deduce_after_type<MyStep, Input>;

deduce_after_type is ill-formed (requires constraint) when
deduce_accepts_input is false, giving a clear error instead of a
silent void fallback. The Action<> requires clause no longer probes
after_type<void> since validate_impl already gates access behind
accepts_input.

actions.mdx updated to show the helper-based style with an explanation
of why storage_type must remain explicit for pack steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backtick inline code combined with {#anchor} in a heading caused
acorn to fail parsing the MDX. Replaced with escaped underscore and
auto-generated heading ID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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

This PR adds a new documentation page describing cli20 “Actions & Pipelines” and introduces small API additions in include/cli/action.hh to support authoring custom pipeline steps with less boilerplate, along with unit tests that exercise the new deduction helpers.

Changes:

  • Added cli::deduce_accepts_input and cli::deduce_after_type to derive step traits from operator() for non-terminal steps.
  • Expanded unit tests to cover custom conversion/pack steps and pipeline invocation using the new helpers.
  • Added a new “Actions & Pipelines” reference page and linked it from the docs sidebar.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
include/cli/action.hh Adds trait deduction helpers (and supporting type-trait scaffolding) for custom action steps.
tests/test_conversion.cc Adds tests demonstrating custom action steps using the deduction helpers.
docs/sidebars.ts Adds the new Actions page to the Docusaurus sidebar.
docs/docs/actions.mdx New reference documentation explaining pipelines, traits, invocation, and custom step authoring.

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

Comment thread tests/test_conversion.cc Resolved
Comment thread tests/test_conversion.cc Resolved
Comment thread include/cli/action.hh Resolved
Comment thread docs/docs/actions.mdx Resolved
Comment thread docs/docs/actions.mdx Resolved
Comment thread docs/docs/actions.mdx Resolved
gen740 and others added 2 commits May 11, 2026 11:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…example

- RGBConversion: pass ctx.index to invalid_value_error instead of 0
- RGBConversion: check from_chars ec and fully-consumed pointer;
  reject components like "1,2,x" instead of silently treating as 0
- actions.mdx standalone invoke example: pass ActionCtx<optional<int>>
  with .arg = std::ref(storage) for pack::set_once; read result from
  storage, not result.value (terminal steps return ActionResult<void>)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gen740
gen740 enabled auto-merge (rebase) May 11, 2026 02:18
@gen740
gen740 merged commit 133bee5 into main May 11, 2026
9 checks passed
@gen740
gen740 deleted the docs/actions branch May 11, 2026 02:39
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