Skip to content

chore(rivetkit): note duplicate admission logic#4948

Merged
NathanFlurry merged 1 commit intomainfrom
05-04-chore_rivetkit_admission_logic_todos
May 5, 2026
Merged

chore(rivetkit): note duplicate admission logic#4948
NathanFlurry merged 1 commit intomainfrom
05-04-chore_rivetkit_admission_logic_todos

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This was referenced May 4, 2026
Copy link
Copy Markdown
Member Author

NathanFlurry commented May 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

Code Review: chore(rivetkit): note duplicate admission logic

Overview

This small chore PR does two things:

  1. Adds paired TODO comments in ActorTask::dispatch_lifecycle_error and RegistryDispatcher::active_actor noting that their admission/lifecycle-guard logic is duplicated and should eventually be unified.
  2. Adds a #[cfg(test)] helper is_actor_request_path in registry/http.rs.

Code Quality

  • TODO comments follow project style conventions: complete sentences, no dashes, no fragmented structure. Both cross-reference each other symmetrically, which is helpful for future refactoring.
  • is_actor_request_path is logically sound. The byte-level suffix check guards correctly against false positives on paths like /requestfoo by requiring the character after /request to be empty, /, or ?.

Concerns / Suggestions

1. No issue link on the TODOs

The TODOs flag a real duplication risk — a change to admission policy in one location will not automatically be reflected in the other — but without a linked ticket they are easy to lose. Consider TODO(#NNNN): Share admission policy with ....

2. is_actor_request_path is test-only but logically paired with production code

normalize_actor_request_path lives in production code and implicitly encodes the same prefix assumption. Having the gate predicate only in #[cfg(test)] while the normalization lives in production code is asymmetric. Either promote is_actor_request_path to production code and use it as the routing gate, or add a comment explaining why the production router does not need it (e.g. the routing match already enforces the prefix before calling normalize_actor_request_path).

3. Admission guard semantics diverge between the two sites

dispatch_lifecycle_error checks destroy_requested() and stopped(), while RegistryDispatcher::active_actor additionally checks started(). This semantic difference could mask bugs if one path is updated but not the other. Worth capturing in .agent/todo/ as a follow-up.

Summary

The TODOs are well-placed and correctly identify a maintenance risk. Main gaps: no issue link to track the refactor, unexplained asymmetry of the test-only helper, and diverging admission-guard semantics between the two sites. Low risk overall, but the duplication is a latent bug surface worth consolidating soon.

@NathanFlurry NathanFlurry force-pushed the 05-04-chore_rivetkit_admission_logic_todos branch from 0b1e417 to da325d9 Compare May 4, 2026 15:36
@NathanFlurry NathanFlurry force-pushed the 05-04-test_rivetkit_bypass_fetch_header branch from 81c9b4d to cc49ff7 Compare May 4, 2026 15:36
Base automatically changed from 05-04-test_rivetkit_bypass_fetch_header to main May 5, 2026 14:58
@NathanFlurry NathanFlurry merged commit da325d9 into main May 5, 2026
36 of 44 checks passed
@NathanFlurry NathanFlurry deleted the 05-04-chore_rivetkit_admission_logic_todos branch May 5, 2026 14:58
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