Repository navigation
[AI-0303] feat(endpoint): add fail-closed S-F strict seam - #514
Conversation
Add opaque publication acknowledgement capability and strict pre-handler dispatch. No same-domain provider/routing snapshot binding exists yet, so strict requests fail closed as Unbound; normal dispatch remains tolerant. MCP tool-list version is not misused as the Core publication version. Live Core/Lua/IPC wiring remains out of scope. Review: APPROVE (PX-1419 ai-0303-domain-reviewer; prior blockers PX-1415/PX-1417 resolved by domain-safe fail-closed correction). Gates: fmt, clippy, workspace tests, just check, act -n, green. Priority: P1 | Area: ipc | Labels: feat,P1 Milestone: v0.1.0 | RFC: AIQ-38 | Task: AI-0303
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🔇 Additional comments: 4
crates/bitty-ai-endpoint/src/metadata_publication.rs: 1
35-68: LGTM!Also applies to: 167-185, 491-542
crates/bitty-ai-endpoint/src/lib.rs: 2
76-87: LGTM!Also applies to: 216-223, 248-249, 267-319, 562-574, 1095-1096, 1105-1117, 1214-1224, 1239-1240, 8136-8158, 8171-8174, 8455-8457, 8474-8543
637-688: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.The handler table after the unconditional refusal is unreachable. It also duplicates the
dispatch_withtable.
StrictEndpoint::enforcealways returnsErr(Unbound). As a result, the method table at Lines 656-687 never runs. That table copies the table indispatch_with. If someone adds a method to one table and not the other, the two tables will disagree after a binding exists, and no current test will catch the difference. The project guide also says not to add product code before its gates are accepted. Two fixes are possible:
- Return the refusal right after enforcement and remove the copied table until a same-domain binding is accepted.
- Extract a shared
run_e1a_table(view, input, scope)helper and call it from both dispatch entries.♻️ Proposed refactor
- if let Err(refusal) = endpoint.enforce() { - return DispatchOutcome::Refused(strict_refusal_error(refusal)); - } - // Keep the E1a method table identical after the strict pre-handler check. - let result = match input.method { - ... - }; - match result { ... } + if let Err(refusal) = endpoint.enforce() { + return DispatchOutcome::Refused(strict_refusal_error(refusal)); + } + run_e1a_table(view, input, scope)crates/bitty-ai-endpoint/API.md: 1
26-41: LGTM!
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6a1c75ea-289a-4d5e-b32a-265327465bb6
📒 Files selected for processing: 3
crates/bitty-ai-endpoint/API.mdcrates/bitty-ai-endpoint/src/lib.rscrates/bitty-ai-endpoint/src/metadata_publication.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Add opaque publication acknowledgement capability and strict pre-handler dispatch. No same-domain provider/routing snapshot binding exists yet, so strict requests fail closed as Unbound; normal dispatch remains tolerant. MCP tool-list version is not misused as the Core publication version. Live Core/Lua/IPC wiring remains out of scope.\n\nReview: APPROVE (PX-1419 ai-0303-domain-reviewer; PX-1415/PX-1417 blockers resolved by domain-safe fail-closed correction).\nGates: fmt, clippy, workspace tests, just check, act -n, green.\n\nPriority: P1 | Area: ipc | Labels: feat,P1 | Milestone: v0.1.0 | RFC: AIQ-38 | Task: AI-0303
Summary by CodeRabbit