Skip to content

docs: README rewrite (shipping behavior only) + pgx adoption feedback on the roadmap#32

Merged
ehabterra merged 11 commits into
mainfrom
readme-rewrite
Jul 16, 2026
Merged

docs: README rewrite (shipping behavior only) + pgx adoption feedback on the roadmap#32
ehabterra merged 11 commits into
mainfrom
readme-rewrite

Conversation

@ehabterra

@ehabterra ehabterra commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

The README rewrite (the item originally deferred to the v1.0 gate, landed early by request — the gate itself stays open, the beta status note remains):

  • 861 → ~380 lines; every claim is shipped behavior linked to its guide
  • "Is this the right tool?" up front — including when NOT to use it (flat status-column domains; durable-execution needs)
  • Quick start extracted and verified verbatim: the exact YAML + Go blocks from the README were compiled and executed against this branch — the program runs and prints [review] exactly as its comment claims
  • The model in sixty seconds, illustrated with the renderer's own output
  • Feature tour covering the full current surface (net constructs, colored tokens, host-driven timers, crash-consistent writes, definition diffs, token read-model, observability, diagrams with direction, test kits)
  • Persistence section with a bring-your-own-driver paragraph: the tx any contract means a custom backend hands transactional side effects its own transaction type (e.g. pgx.Tx), validated by storagetest.Run
  • Docs + examples tables, boundaries summary, corrected Go version badge (1.25+)

Adoption feedback recorded — an external evaluation declined adoption ("the library's tx wouldn't be our tx"; pgx-native + sqlc stack with a hard same-transaction rule). The ROADMAP gains an adoption-driven contrib/pgx candidate (native pgxpool backend, effects receiving pgx.Tx, full conformance against real Postgres) so the next evaluator doesn't have to build that backend to find out; the evaluation's second point (Petri net oversized for a flat status column) is a correct application of our own boundaries and the README now says so first.

Note: this branch is based on the union of #30 + #31 + main so the README can describe all shipping features; it should merge after those two.

Checklist

  • Quick-start snippet compiled AND executed verbatim (scratch module, replace to this branch)
  • All README relative links verified to resolve
  • Full serialized test suites green (root + all modules)
  • CHANGELOG.md updated under [Unreleased]
  • Pre-1.0 status note retained — no v1.0 claims

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added OpenTelemetry tracing and metrics for workflow firings.
    • Added non-blocking workflow observers, including guard-rejection events.
    • Added configurable Mermaid diagram directions and improved diagram rendering.
    • Added OR-input transitions and reset arcs for consolidated workflow paths.
    • Added reusable workflow testing helpers, guard assertions, and test clocks.
  • Documentation

    • Updated the README, changelog, roadmap, and examples with the latest APIs and usage guidance.
  • Bug Fixes

    • Expanded CI validation to include contribution modules.

ehabterra and others added 5 commits July 15, 2026 19:31
…pping features)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
#	ROADMAP.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Full rewrite (861 → ~380 lines): honest positioning (embedded declarative
Petri-net library, not a Temporal competitor), an explicit is-this-the-
right-tool section (including when NOT to use it), a quick start extracted
and verified to compile AND run verbatim (prints [review] as its comment
claims), the model in sixty seconds with the renderer's own diagram, a
feature tour where every claim is shipped and linked to its guide, the
persistence contract with a bring-your-own-driver section (the tx-any
design: pgx-native backends hand effects a real pgx.Tx, storagetest proves
conformance), docs and examples tables, and the boundaries summary.

Still pre-1.0: the beta status note stays (this is NOT the v1.0 gate
closing — other gate criteria remain open). Go version badge fixed to
1.25+ (go.mod); retired Go Report Card badge already replaced earlier.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
#	README.md
An external evaluation declined adoption on two grounds; both are now
recorded where they act:

1. "The library's tx wouldn't be our tx" (pgx-native + sqlc stack, hard
   same-transaction rule for audit/outbox). Half-right: the shipped
   backends speak database/sql, but the CONTRACT doesn't — TxSideEffect
   receives tx as `any` precisely so a custom backend hands effects a
   pgx.Tx, and storagetest proves conformance. ROADMAP gains an
   adoption-driven `contrib/pgx` candidate so evaluators don't have to
   build that backend to find out; the README's new bring-your-own-driver
   section documents the extension point today.

2. Flat status-column domain → Petri net oversized. Correct per our own
   boundaries; the README's "Is this the right tool?" section now says it
   up front so the next evaluation reads it from us first.

Also: the v1.0-gate README-rewrite line updated to note the rewrite landed
early while THE GATE STAYS OPEN (still pre-1.0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ehabterra, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f099881e-e8e2-4d38-aa4c-035eb512011a

📥 Commits

Reviewing files that changed from the base of the PR and between 4b07f9b and d6654bc.

📒 Files selected for processing (4)
  • ROADMAP.md
  • examples/advanced_workflow/README.md
  • examples/advanced_workflow/workflow.yaml
  • examples/expense_approval/otel.go

Walkthrough

Changes

Workflow platform and examples

Layer / File(s) Summary
Observer events and OpenTelemetry instrumentation
listeners.go, workflow.go, manager.go, definition.go, event.go, token_firing.go, observer_test.go, contrib/otel/*
Adds panic-safe observer listeners, EventGuardRejected, manager/definition/workflow registration APIs, and OpenTelemetry spans and firing outcome metrics.
Configurable diagram rendering
mermaid.go, workflow_test.go, examples/advanced_workflow/..., examples/expense_approval/..., examples/website_workflow/...
Adds Mermaid direction constants and propagation through rendering endpoints, templates, examples, and tests.
OR-input rejection workflow
examples/advanced_workflow/workflow.yaml, examples/advanced_workflow/main.go, examples/advanced_workflow/templates/project.html, examples/advanced_workflow/*README.md, workflow_yaml_test.go
Replaces multiple rejection transitions with reject_project, using from_any and reset arcs, and updates permissions, UI, documentation, and validation.
Workflow testing helpers
workflowtest/*, examples/expense_approval/*_test.go
Adds marking, transition-path, guard, manual-clock, and due-transition helpers with comprehensive tests and adopts them in expense-approval tests.
Documentation and build integration
README.md, CHANGELOG.md, ROADMAP.md, contrib/otel/go.mod, .github/workflows/ci.yml, .gitignore
Updates project documentation, release notes, roadmap, module dependencies, CI discovery, and ignored generated output.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant Observer
  participant OTelInstrumentation
  participant TelemetryProviders
  Workflow->>Observer: dispatch before/after/rejected event
  Observer->>OTelInstrumentation: invoke panic-safe callback
  OTelInstrumentation->>TelemetryProviders: record span or outcome metric
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.47% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the README rewrite and the roadmap pgx adoption feedback.
Description check ✅ Passed The description is substantial and covers summary and checklist, though the related issue and roadmap milestone sections are omitted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch readme-rewrite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
examples/expense_approval/flows_test.go (1)

340-340: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise a non-default diagram direction.

The test now verifies only the TD default, so the endpoint could ignore its dir query parameter without detection. Add a request such as /diagrams?dir=LR and assert flowchart LR.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/expense_approval/flows_test.go` at line 340, Extend the diagram
endpoint test around the existing “flowchart TD” assertion to issue a request
with dir=LR and verify the response contains “flowchart LR”. Keep the default TD
coverage and use the same request/assertion helpers already used in the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/advanced_workflow/README.md`:
- Line 80: Correct the guard labels in the README entries around the
approve-design flow and the corresponding entry near line 90 by changing each
malformed `#39`; apostrophe entity to the proper &amp;`#39`; form, preserving the
surrounding label expressions and quoted context keys.

In `@examples/advanced_workflow/workflow.yaml`:
- Line 121: Move the person classification from the deployment_ready definition
to the mark_deployment_ready definition in the workflow configuration. Remove
diagram_class: person from deployment_ready and assign it to
mark_deployment_ready so the generated diagram classifies the human decision
task correctly.

In `@examples/expense_approval/otel.go`:
- Around line 36-68: Update the provider initialization flow around the tracer
provider, meter provider, and otelworkflow.Instrument calls so every later
initialization failure shuts down all providers created so far before returning.
Delay otel.SetTracerProvider and otel.SetMeterProvider until instrumentation
succeeds, preventing globals from referencing providers that cannot be closed;
preserve the existing successful shutdown callback for both providers.

---

Nitpick comments:
In `@examples/expense_approval/flows_test.go`:
- Line 340: Extend the diagram endpoint test around the existing “flowchart TD”
assertion to issue a request with dir=LR and verify the response contains
“flowchart LR”. Keep the default TD coverage and use the same request/assertion
helpers already used in the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a75f741-8ed9-4155-a863-9ff1d0499fdb

📥 Commits

Reviewing files that changed from the base of the PR and between b76ab16 and 4b07f9b.

⛔ Files ignored due to path filters (2)
  • contrib/otel/go.sum is excluded by !**/*.sum
  • examples/expense_approval/go.sum is excluded by !**/*.sum
📒 Files selected for processing (42)
  • .github/workflows/ci.yml
  • .gitignore
  • CHANGELOG.md
  • README.md
  • ROADMAP.md
  • contrib/otel/README.md
  • contrib/otel/go.mod
  • contrib/otel/otel.go
  • contrib/otel/otel_test.go
  • definition.go
  • event.go
  • examples/advanced_workflow/OR_SEMANTICS_BEST_PRACTICES.md
  • examples/advanced_workflow/README.md
  • examples/advanced_workflow/go.mod
  • examples/advanced_workflow/main.go
  • examples/advanced_workflow/templates/diagram.html
  • examples/advanced_workflow/templates/project.html
  • examples/advanced_workflow/workflow.yaml
  • examples/advanced_workflow/workflow_yaml_test.go
  • examples/expense_approval/README.md
  • examples/expense_approval/app.go
  • examples/expense_approval/flows_test.go
  • examples/expense_approval/go.mod
  • examples/expense_approval/main.go
  • examples/expense_approval/otel.go
  • examples/expense_approval/payment_migration_test.go
  • examples/expense_approval/server.go
  • examples/expense_approval/templates/batch.html
  • examples/expense_approval/templates/detail.html
  • examples/expense_approval/templates/diagrams.html
  • examples/expense_approval/templates/layout.html
  • examples/website_workflow/main.go
  • examples/website_workflow/templates/diagram.html
  • listeners.go
  • manager.go
  • mermaid.go
  • observer_test.go
  • token_firing.go
  • workflow.go
  • workflow_test.go
  • workflowtest/workflowtest.go
  • workflowtest/workflowtest_test.go

Comment thread examples/advanced_workflow/README.md
Comment thread examples/advanced_workflow/workflow.yaml Outdated
Comment thread examples/expense_approval/otel.go
ehabterra and others added 3 commits July 15, 2026 19:57
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.70%. Comparing base (b76ab16) to head (f3d9330).

Files with missing lines Patch % Lines
workflowtest/workflowtest.go 93.18% 4 Missing and 2 partials ⚠️
workflow.go 78.57% 2 Missing and 1 partial ⚠️
definition.go 0.00% 2 Missing ⚠️
token_firing.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   81.20%   81.70%   +0.50%     
==========================================
  Files          30       31       +1     
  Lines        3128     3252     +124     
==========================================
+ Hits         2540     2657     +117     
- Misses        368      374       +6     
- Partials      220      221       +1     
Files with missing lines Coverage Δ
event.go 100.00% <ø> (ø)
listeners.go 86.66% <100.00%> (+1.76%) ⬆️
manager.go 84.98% <100.00%> (+0.11%) ⬆️
mermaid.go 86.55% <100.00%> (+0.76%) ⬆️
token_firing.go 82.35% <66.66%> (+2.18%) ⬆️
definition.go 98.05% <0.00%> (-1.95%) ⬇️
workflow.go 84.61% <78.57%> (+0.27%) ⬆️
workflowtest/workflowtest.go 93.18% <93.18%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ehabterra and others added 3 commits July 16, 2026 04:46
- otel.go: shut down already-created providers on later init failures,
  and set OTel globals only after full success (no leak on partial init).
- advanced_workflow: move diagram_class: person from the deployment_ready
  place to the mark_deployment_ready transition (the human decision), and
  regenerate the README diagram to match (now shows the START marker and
  the person-classed decision, consistent with the app's rendering).

Skipped the '#39;' guard-label finding: that is Mermaid's own numeric
entity convention (# without &), used deliberately by escapeMermaidLabel
alongside #58;/#34;/#60; — it renders as an apostrophe, not literal text.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	CHANGELOG.md
#	ROADMAP.md
@ehabterra
ehabterra merged commit 6c850cc into main Jul 16, 2026
4 checks passed
@ehabterra
ehabterra deleted the readme-rewrite branch July 16, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant