Skip to content

add anyhow for errors, main does a demo#22

Merged
Idleness76 merged 1 commit into
mainfrom
main1
Sep 7, 2025
Merged

add anyhow for errors, main does a demo#22
Idleness76 merged 1 commit into
mainfrom
main1

Conversation

@Idleness76
Copy link
Copy Markdown
Owner

As a demo, main now does this:

  1. Build a multi-step graph: Start -> A -> B -> End (using NodeKind::Other("A"), NodeKind::Other("B")) plus a duplicate edge from Start to A to hit de-dup logic in frontier building.
  2. Run App::invoke on a richly populated initial state (seed meta, extra, maybe an initial output) to show version increments across channels.
  3. After invoke, manually exercise reducers on cloned data to show direct usage (ADD_MESSAGES, APPEND_VEC, MAP_MERGE).
  4. Manually call apply_barrier with crafted NodePartial sets:
  5. One with mixed channel updates.
  6. One with empty vectors/maps (no version bump).
  7. One where you preset messages.version = u64::MAX then add a message to demonstrate saturating_add behavior (stays at MAX).
  8. Demonstrate both GraphBuilder error cases (MissingEntry and EntryNotRegistered) and print them.
  9. Show snapshot() before and after a manual mutation to confirm independence.
  10. Return Result<()> from main, propagate errors instead of unwrap where possible.
  11. Add small helper fn to pretty-print VersionedState to keep main readable.

@Idleness76 Idleness76 self-assigned this Sep 7, 2025
@Idleness76 Idleness76 merged commit 176d66d into main Sep 7, 2025
@Idleness76 Idleness76 deleted the main1 branch September 7, 2025 15:49
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