Skip to content

Add core input/action boundary#16

Merged
sij411 merged 3 commits into
fedify-dev:nextfrom
sij411:phase1-core-boundary
Jun 12, 2026
Merged

Add core input/action boundary#16
sij411 merged 3 commits into
fedify-dev:nextfrom
sij411:phase1-core-boundary

Conversation

@sij411

@sij411 sij411 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the portable core/runtime boundary for Phase 1:

  • Introduces FederCore::handle(input) -> HandleResult.
  • Adds public Input, Action, and HandleResult types.
  • Adds initial action payloads for storing followers/objects and sending activities.
  • Keeps boundary enums non-exhaustive so later Phase 1 issues can extend them without freezing the API too early.

handle intentionally returns an empty action list for now. Follow acceptance, object storage behavior, and Create(Note) behavior are left to later Phase 1 issues.

Design notes

  • feder-core is no_std + alloc.
  • IDs and timestamps are provided through inputs instead of generated inside core.
  • The core performs no HTTP, filesystem, database, async runtime, clock, or random-number work.

Validation

  • cargo test
  • mise run check

Closes #6

Summary by CodeRabbit

New Features

  • Introduced ActivityPub core module for processing federation activities
  • Support for handling incoming follow requests and user-created content
  • Core module provides clean input/output interfaces for federation workflows

Tests

  • Added test coverage for core activity handling

sij411 added 3 commits June 12, 2026 11:20
Assisted-by: Codex:gpt-5.5
Assisted-by: Codex:gpt-5.5
Assisted-by: Codex:gpt-5.5
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eeea1f4a-fd8d-401f-a12f-83c70c1bce1f

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab4d51 and 50baf2e.

📒 Files selected for processing (1)
  • crates/feder-core/src/lib.rs

📝 Walkthrough

Walkthrough

A new no_std portable ActivityPub core module establishes an I/O-free handler boundary: FederCore::handle() accepts structured Input (follow reception or note creation) and returns HandleResult wrapping Action batches (store followers/objects, send activities) without performing filesystem, database, or network operations.

Changes

Core I/O Boundary and Handler

Layer / File(s) Summary
Crate setup and core entry point
crates/feder-core/src/lib.rs
#![no_std] mode with allocator imports and feder_vocab re-export; FederCore struct with new() and handle(Input) -> HandleResult method stubs both input variants, returning empty action sets.
Input type contract
crates/feder-core/src/lib.rs
Input enum carries vocab::Follow or UserCreateNote payload; UserCreateNote struct holds IRI fields for note/create IDs, an actor reference, note content, and optional published timestamp.
Output and action type contract
crates/feder-core/src/lib.rs
Action enum (StoreFollower, StoreObject, SendActivity) with payload structs define runtime work; Activity enum (Accept, CreateNote) and Object enum (Note) enumerate what payloads can contain.
Result wrapper and helpers
crates/feder-core/src/lib.rs
HandleResult wraps Vec<Action> with new(actions) constructor and is_empty() checker, defining the core's output envelope.
Handler and result tests
crates/feder-core/src/lib.rs
Unit tests confirm FederCore::handle yields empty results for both ReceivedFollow and UserCreateNote, and HandleResult::new correctly wraps action lists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • fedify-dev/feder#13: Introduces the minimal ActivityPub vocabulary types (Follow, Accept, Note, Create<Note>) that the new core's Input and Activity enums reference.

Suggested labels

enhancement, phase 1

Poem

A rabbit hops through the core with care,
No I/O here, just actions fair,
Input types dance with output plans,
The boundary drawn in no_std lands,
Logic flows pure, like morning air. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add core input/action boundary' directly summarizes the main change—introducing the core/runtime boundary with Input and Action types as defined in the changeset.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from issue #6: adds Input, Action, and HandleResult types; implements FederCore::handle(input) -> HandleResult; injects nondeterminism via inputs; and performs no real I/O.
Out of Scope Changes check ✅ Passed All changes are within scope—core library definitions, type boundaries, and no-I/O implementation align precisely with issue #6 objectives; no unrelated additions detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@sij411

sij411 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sij411 sij411 merged commit 1ea5f5b into fedify-dev:next Jun 12, 2026
2 checks passed
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