Skip to content

Add server runtime skeleton#28

Merged
sij411 merged 9 commits into
fedify-dev:nextfrom
sij411:phase2-linux-runtime
Jun 28, 2026
Merged

Add server runtime skeleton#28
sij411 merged 9 commits into
fedify-dev:nextfrom
sij411:phase2-linux-runtime

Conversation

@sij411

@sij411 sij411 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Add the feder-runtime-server workspace crate for the Phase 2 server runtime.
  • Add a Tokio/Axum server entry point with a /healthz endpoint.
  • Add local default runtime config for a single actor.
  • Construct FederCore from runtime config and attach it to Axum app state.
  • Add runtime startup logging with tracing.
  • Document how to run the local server preview.
  • Add cross-platform Cargo test CI for Linux, macOS, and Windows.

Scope

This establishes the runnable server runtime skeleton for #22.

The runtime intentionally does not implement WebFinger, actor endpoints, inbox handling, storage, HTTP Signatures, actor fetching, delivery, or JSON-LD normalization yet. Those remain scoped to later Phase 2 issues.

Validation

  • cargo test --workspace
  • mise run check

Refs #22

Summary by CodeRabbit

  • New Features
    • Added a local runtime server with a health check endpoint and default localhost configuration.
    • Expanded workspace support to include the new runtime server component.
  • Bug Fixes
    • Improved CI coverage by running the test suite on Linux, macOS, and Windows.
  • Documentation
    • Added guidance for running the runtime server and updated AI/commit contribution instructions.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 468dff0f-21cb-4874-b109-6fcc952ae528

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new feder-runtime-server workspace crate with local config, Axum routing, a binary entrypoint, README instructions, and cross-platform workspace tests. It also updates AI policy and agent guidance for commit trailers and adds license headers to existing core and vocab files.

Changes

Runtime server introduction

Layer / File(s) Summary
Workspace entrypoints and crate surface
Cargo.toml, crates/feder-runtime-server/Cargo.toml, crates/feder-runtime-server/src/lib.rs, crates/feder-runtime-server/src/error.rs
Adds the new workspace member and crate manifest, and exposes the crate root modules plus the shared boxed error alias.
Runtime config and Axum app
crates/feder-runtime-server/src/config.rs, crates/feder-runtime-server/src/app.rs
Defines RuntimeConfig, builds the local default configuration, constructs AppState from FederCore, and routes GET /healthz to 204 No Content.
Binary startup and validation
crates/feder-runtime-server/src/main.rs, crates/feder-runtime-server/README.md, .github/workflows/main.yaml
Adds the server entrypoint, documents how to run the crate and check health, and adds a cross-platform workspace test job.

Policy and licensing updates

Layer / File(s) Summary
Agent instructions and commit trailers
AGENTS.md, AI_POLICY.md, .agents/skills/commit/SKILL.md
Adds agent instructions and updates policy text so AI-assisted commit disclosure uses the Assisted-by trailer format.
License headers
crates/feder-core/src/lib.rs, crates/feder-vocab/src/lib.rs, crates/feder-vocab/tests/phase1_shapes.rs
Adds project and license header comments to existing core, vocab, and test files.

Sequence Diagram(s)

sequenceDiagram
  participant ComponentA
  participant ComponentB
  ComponentA->>ComponentB: observable interaction
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • fedify-dev/feder issue 22: The runtime server crate, local config, Axum app, entrypoint, and README match the issue’s server scope.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • dahlia

Poem

🐰 I hopped through configs, quick and bright,
A health check blinked green in the night.
The server booted, neat and true,
With trailers tagged and rules anew.
I left a carrot-shaped commit in sight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the server runtime skeleton and new runtime server crate.
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

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.

@sij411

sij411 commented Jun 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@sij411

sij411 commented Jun 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Jun 27, 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 requested a review from dahlia June 27, 2026 08:36

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76716e899e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md
Comment thread crates/feder-core/src/lib.rs

@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: 4

🧹 Nitpick comments (3)
.agents/skills/commit/SKILL.md (1)

14-16: 📐 Maintainability & Code Quality | 🔵 Trivial

Add language specifier to the fenced code block.

The Assisted-by trailer example block lacks a language specifier, triggering markdownlint MD040.

 ~~~~
+```text
 Assisted-by: AGENT_NAME:MODEL_VERSION
 ~~~~
+```
🤖 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 @.agents/skills/commit/SKILL.md around lines 14 - 16, The fenced example in
SKILL.md is missing a language specifier, which triggers markdownlint MD040.
Update the `Assisted-by` trailer example block to use a proper fenced code block
language in the markdown around the `Assisted-by` trailer text, keeping the
example content the same while making the fence syntax valid.

Source: Linters/SAST tools

AGENTS.md (1)

23-25: 📐 Maintainability & Code Quality | 🔵 Trivial

Add language specifier to the fenced code block for consistency.

The Assisted-by trailer example block lacks a language specifier, triggering markdownlint MD040. Add text to match the style of other literal blocks in the document.

 ~~~~
+```text
 Assisted-by: AGENT_NAME:MODEL_VERSION
 ~~~~
+```
🤖 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 `@AGENTS.md` around lines 23 - 25, The fenced example for the Assisted-by
trailer in AGENTS.md is missing a language specifier, causing markdownlint
MD040. Update the literal block so it uses a consistent fenced code style with a
text specifier, matching the other examples in the document and keeping the
Assisted-by trailer snippet intact.

Source: Linters/SAST tools

crates/feder-runtime-server/src/app.rs (1)

17-27: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Prefer an async-aware mutex for shared Axum state.

Line 26 puts FederCore behind std::sync::Mutex even though this state is mounted into async handlers. That blocking lock will become a Tokio worker bottleneck as soon as a handler starts mutating core. Switching to tokio::sync::Mutex now avoids baking the blocking primitive into the app-state surface.

Proposed change
-use std::sync::{Arc, Mutex};
+use std::sync::Arc;
 
 use crate::config::RuntimeConfig;
 use axum::{Router, http::StatusCode, routing::get};
 use feder_core::{FederConfig, FederCore};
 use feder_vocab::Actor;
+use tokio::sync::Mutex;
🤖 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 `@crates/feder-runtime-server/src/app.rs` around lines 17 - 27, The shared Axum
app state currently wraps FederCore in std::sync::Mutex inside AppState, which
is a blocking primitive for async handlers. Update AppState to use
tokio::sync::Mutex instead, and adjust any lock usage in the async request paths
that access core so they await the async mutex; keep the change centered around
AppState and any handler code that reads or mutates FederCore.
🤖 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 @.agents/skills/commit/SKILL.md:
- Around line 12-16: The trailer example in the commit skill guide is
inconsistent with the Codex guidance. Update the wording around the Assisted-by
trailer in SKILL.md so it either uses a generic AI-assisted reference or matches
the Codex-specific format from AI_POLICY.md; locate the section mentioning the
commit trailer and replace the placeholder agent identifier template with the
correct Codex-oriented example.

In @.github/workflows/main.yaml:
- Around line 35-36: The workflow hardening is incomplete in the checkout and
toolchain setup steps. Update the actions used in the main job by pinning both
actions to full commit SHAs instead of floating refs, and modify the
actions/checkout step to disable credential persistence with persist-credentials
set to false. Use the existing checkout and dtolnay/rust-toolchain entries in
the workflow to locate and tighten these steps.

In `@crates/feder-core/src/lib.rs`:
- Around line 5-7: The license header in the crate-level comment conflicts with
the workspace license declaration. Update the `lib.rs` header to match `license
= "AGPL-3.0-only"` by removing the “any later version” wording, or alternatively
change the Cargo license field to `AGPL-3.0-or-later`; keep the header and
`Cargo.toml` consistent.

In `@crates/feder-runtime-server/README.md`:
- Around line 14-16: The README run example for feder-runtime-server uses
POSIX-only env-var syntax, so update the documentation to either mark the cargo
run example in the relevant README section as Unix-shell-specific or add
equivalent Windows commands for PowerShell and cmd.exe. Keep the guidance near
the existing cargo run snippet and preserve the cross-platform context by
referencing the run example in the README’s usage instructions.

---

Nitpick comments:
In @.agents/skills/commit/SKILL.md:
- Around line 14-16: The fenced example in SKILL.md is missing a language
specifier, which triggers markdownlint MD040. Update the `Assisted-by` trailer
example block to use a proper fenced code block language in the markdown around
the `Assisted-by` trailer text, keeping the example content the same while
making the fence syntax valid.

In `@AGENTS.md`:
- Around line 23-25: The fenced example for the Assisted-by trailer in AGENTS.md
is missing a language specifier, causing markdownlint MD040. Update the literal
block so it uses a consistent fenced code style with a text specifier, matching
the other examples in the document and keeping the Assisted-by trailer snippet
intact.

In `@crates/feder-runtime-server/src/app.rs`:
- Around line 17-27: The shared Axum app state currently wraps FederCore in
std::sync::Mutex inside AppState, which is a blocking primitive for async
handlers. Update AppState to use tokio::sync::Mutex instead, and adjust any lock
usage in the async request paths that access core so they await the async mutex;
keep the change centered around AppState and any handler code that reads or
mutates FederCore.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0d983667-9f00-4649-8e70-6d8c4db04f49

📥 Commits

Reviewing files that changed from the base of the PR and between e386616 and 76716e8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .agents/skills/commit/SKILL.md
  • .github/workflows/main.yaml
  • AGENTS.md
  • AI_POLICY.md
  • Cargo.toml
  • crates/feder-core/src/lib.rs
  • crates/feder-runtime-server/Cargo.toml
  • crates/feder-runtime-server/README.md
  • crates/feder-runtime-server/src/app.rs
  • crates/feder-runtime-server/src/config.rs
  • crates/feder-runtime-server/src/error.rs
  • crates/feder-runtime-server/src/lib.rs
  • crates/feder-runtime-server/src/main.rs
  • crates/feder-vocab/src/lib.rs
  • crates/feder-vocab/tests/phase1_shapes.rs

Comment thread .agents/skills/commit/SKILL.md
Comment thread .github/workflows/main.yaml
Comment thread crates/feder-core/src/lib.rs
Comment thread crates/feder-runtime-server/README.md
@sij411 sij411 force-pushed the phase2-linux-runtime branch from 76716e8 to 0520f97 Compare June 28, 2026 15:09
Assisted-by: Codex:gpt-5.5
@sij411 sij411 merged commit d3f6799 into fedify-dev:next Jun 28, 2026
5 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.

2 participants