M4b task 15: fix task 14's dropped refusal reason, as a listed edit
Task 15's session found the defect in serve/approvals.rs, a file it did not list, and stopped. The comment in task 14 used one name for two values; task 14's tests could not reach it. Lesson T30. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,8 @@ The last three pieces (M4b spec, section 7):
|
||||
pending here"), `crates/gatewayd/tests/support/gateway.rs` (`Tuning` has `notice`)
|
||||
- Modify: `crates/gatewayd/src/approvals/mod.rs`, `crates/gatewayd/src/deliver.rs`,
|
||||
`crates/gatewayd/src/serve/mod.rs`, `crates/gatewayd/src/serve/handle.rs`,
|
||||
`crates/gatewayd/src/sessions.rs`, `docs/implementer-log.md`
|
||||
`crates/gatewayd/src/serve/approvals.rs` (one fix, below), `crates/gatewayd/src/sessions.rs`,
|
||||
`docs/implementer-log.md`
|
||||
|
||||
## The changes, exactly
|
||||
|
||||
@@ -128,6 +129,32 @@ parameter of `Gateway::new`, which `run` passes as `tuning.notice`.
|
||||
|
||||
**`sessions.rs`**: delete `pub const M4B_COMMAND`.
|
||||
|
||||
**`serve/approvals.rs`, a fix to task 14's `ended`.** `ended` has two different values that were
|
||||
both called `reason`: the refusal's text, in `Ending::Answered { reason, .. }`, and the
|
||||
`DenyReason` in `GatewayOutcome::Denied { reason }`. Task 14's comment did not say which went
|
||||
where, and its tests could not send a refusal, so the refusal's text was dropped (`reason: _`, and
|
||||
`Ended::Refused { by, reason: None }`). This task's `refused_with_a_reason_the_post_says_so` shows
|
||||
it. Name the refusal's text `refusal`:
|
||||
|
||||
```rust
|
||||
Ending::Answered {
|
||||
by,
|
||||
reason: refusal,
|
||||
outcome,
|
||||
} => {
|
||||
```
|
||||
|
||||
and in the `match outcome` inside it, the `Refused` arm becomes:
|
||||
|
||||
```rust
|
||||
GatewayOutcome::Refused {} => Ended::Refused {
|
||||
by,
|
||||
reason: refusal,
|
||||
},
|
||||
```
|
||||
|
||||
The `Denied { reason }` arm stays as it is: that `reason` is the `DenyReason`.
|
||||
|
||||
## Steps
|
||||
|
||||
- [ ] **1. Copy.** `git switch m4b`, then
|
||||
|
||||
Reference in New Issue
Block a user