E2E: verify DP handles P0c kine fields (enforcement_mode, mandatory, direction) in real guardrail flow
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 157
- Forks
- 32
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 145
Description
Context
ai-gateway PR #411 adds enforcement_mode, mandatory, and direction to the outer aisix_core::Guardrail struct with #[serde(default)]. Unit tests (including p0c_fields_dont_trip_keyword_config_deny_unknown_fields) confirm the serde routing is correct.
However, there is no E2E test that boots a real DP, pushes a kine payload from AISIX-Cloud PR #516 that includes these three fields, and verifies the DP:
- Parses the payload without error
- Reads
enforcement_mode=monitorcorrectly (i.e. does not block when it should only monitor) - Reads
mandatory=truecorrectly - Reads
direction=inputcorrectly and applies it to hook filtering (when direction filtering is implemented)
What to add
Add an E2E test in the aisix-e2e compose suite under flows/ or live/ that:
- Creates a guardrail with
enforcement_mode=monitor,mandatory=false,direction=bothvia the CP API - Attaches it to an env-scope
- Sends a chat request that would trigger the guardrail keyword match
- Asserts the request is allowed through (monitor mode, not block)
- Asserts the usage event records the guardrail match with
enforcement_mode=monitor
Priority
LOW — the DP unit tests pin the serde contract; this E2E test verifies the full CP→kine→DP pipeline. Should be added before the enforcement_mode field is used in product UI (i.e. before the dashboard exposes it as a real control).
Related
- ai-gateway PR #411
- AISIX-Cloud PR #516
- #379 P0c checklist
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the aisix-e2e compose suite under flows/ or live/ and its existing CP API flows, then trace the real CP→kine→DP path. Create the specified guardrail and env-scope, send a keyword-triggering chat request, and verify it is allowed while the usage event records the match and enforcement_mode=monitor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100