You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BREAKING] [FIX]: Apply the _async naming convention (#159)
## Description
Second commit of the #22 follow-up. Clears the `.flake8` baseline added
in #158 (merge that first), so `RMP001` is enforced everywhere with no
exemptions.
147 renames: 8 in `rampart/`, 139 async test functions, plus call sites,
tests and docs.
| Old | New |
|---|---|
| `InjectionHandle.wait_until_ready` | `wait_until_ready_async` |
| `ExecutionEventHandler.on_event` | `on_event_async` |
| `sleep_until_ready` | `sleep_until_ready_async` |
| `BaseExecution._fire` | `_fire_async` |
| `_send_via_normalizer` | `_send_via_normalizer_async` |
| `_send_and_parse` | `_send_and_parse_async` |
## Breaking changes
`InjectionHandle.wait_until_ready` and `ExecutionEventHandler.on_event`
are public. External surfaces and handlers must rename to `*_async`.
Handles that don't now raise a clear `TypeError` from `Attacks.xpia`
instead of failing obscurely.
## Checklist
- [x] `pre-commit run --all-files` passes
- [x] Tests added or updated for changes -- 20 test files updated for
renamed symbols and test names
- [x] Documentation updated -- `core-protocols.md`, `xpia.md`,
`extending-rampart.md`, `authoring-tests.md`,
`unit-tests-standards.instructions.md`
1.**Inject** — Place payloads into the agent's data sources via surfaces. Each `surface.inject(payload)` returns an [`InjectionHandle`][rampart.core.injection.InjectionHandle].
31
-
2.**Wait** — Handles call `wait_until_ready()` to allow indexing. Runs concurrently for multiple surfaces.
31
+
2.**Wait** — Handles call `wait_until_ready_async()` to allow indexing. Runs concurrently for multiple surfaces.
32
32
3.**Trigger** — Send benign prompts that cause the agent to retrieve the injected content. Triggers are never adversarial — the attack is in the payload, not the prompt.
33
33
4.**Evaluate** — Check each turn for the attack objective. Early-stops on detection.
34
34
5.**Clean up** — Remove injected content. Guaranteed via `AsyncExitStack`, even on exceptions.
Copy file name to clipboardExpand all lines: docs/contributing/extending-rampart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -337,7 +337,7 @@ For the basic protocol skeleton, see [Implementing Surfaces](../usage/authoring-
337
337
338
338
-**`Surface.inject` does not activate** — it only prepares the handle. Activation happens when an execution strategy enters the handle as an async context manager.
339
339
-**`__aexit__` must be idempotent and must not raise** — cleanup runs even on exceptions, and a failing cleanup must not mask the original error.
340
-
-**`wait_until_ready` should bound itself** with `TimeoutError` rather than block indefinitely. For simple delay-based waits, call `sleep_until_ready` from `rampart.core.injection`.
340
+
-**`wait_until_ready_async` should bound itself** with `TimeoutError` rather than block indefinitely. For simple delay-based waits, call `sleep_until_ready_async` from `rampart.core.injection`.
341
341
-**Raise `InfrastructureError`** for transient, external failures (timeouts, rate limits, service outages). It's the documented convention for surfaces and adapters to signal "not a safety signal" — `BaseExecution` catches all exceptions and produces an `ERROR` result either way, but the exception type is preserved in metadata for triage.
342
342
343
343
For a complete reference, see [`OneDriveSurface`](https://github.com/microsoft/RAMPART/blob/main/rampart/surfaces/onedrive.py).
0 commit comments