Skip to content

DO NOT MERGE: revert proofs for #6593, round 1 - #6625

Closed
erikdarlingdata wants to merge 13 commits into
devfrom
train/6593-proof-1
Closed

erikdarlingdata wants to merge 13 commits into
devfrom
train/6593-proof-1

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Claude posting for Erik Darling.

This PR exists only to run CI with the listed reverts, and is closed after.

Three reverts moved out of this round, because each one changes a test that another revert here targets. The legacy OperatorActor revert is in round 3 (#6627). The create-path agent call and the level 3 refusal are in round 4.

Revert File Test expected to fail
RefuseBeforeGateAsync journals parsed.AgentId DarlingMcpPlanForceTools.cs EveryRefusalBeforeTheGate_*
Delete return false after the named-token Critical line DarlingMcpHostService.cs NamedTokensThatCannotBeServed_*
Drop AND NOT v_operator from the agent-route DL403 guard DarlingManagedRoles.cs and provision-roles.sql AnOperatorToken_ChangesSendResolutionsAndEnabled_, TheLegacyWritesToken_
SetRouteAgentAsync caller passes no p_before (NULL) DarlingMcpAlertTools.RouteAdmin.cs OneCall_ChangingTheMatchAndTheLevel_*
Drop agentTokenName at the five kill refusal sites (bad session, bad login time, Azure database, PG bad backend id, PG pid mismatch) DarlingMcpPlanForceTools.cs EachKillRefusalBeforeTheGate_* (each case), AKillCallThroughTheHost_*

Note: for row 4 the edit is on the journaling line inside RefuseBeforeGateAsync (agentTokenName ?? parsed.AgentId becomes parsed.AgentId), so the parameter stays and the code compiles. For the SetRouteAgentAsync row the NULL is made by dropping the before argument at the update-path call site.

…#6542 part 2)

create_notification_route and update_notification_route take agent_level, the four limits and
fallback_route_id for a named operator token only, checked with NotificationRouteWriter.Validate and
written by config.set_notification_route_agent, which journals route_agent_changed as operator:<name>.
Level 3 is refused over MCP, and a route at level 3 is not changed over MCP. Early agent refusals
journal under the agent token's name. A named token's resolve error names its own setting.
…6542 part 2)

MCP is full admin: the level 3 refusals are removed from the tool and the store function, and the
test now asserts level 3 is set, changed and lowered by an operator token, each change journaled.
…ields (#6542 part 2)

Agreed with the coordinator: under R2 of #5632 that token never holds the investigation tools, so it
sets agent levels 0 to 3 and edits agent routes like a named operator token. Its journal actor is
operator: plus the token identity the route write logs already carry. A token served the
investigations sets no agent field.
…ames a match change (#6542 part 2, review round 1)

M2: config.update_notification_route and config.set_notification_route_destinations take the actor the
service passes. They change a route with an agent setting only for an operator: actor and refuse every
other caller with DL403, as set_notification_route_agent does. The old signatures are dropped in the
managed batch and in tools/provision-roles.sql, so neither stays callable. set_notification_route_enabled
and set_notification_route_fallback hand an operator token's change to an agent route to the same path.

L2: update_notification_route returns the row before the change, and set_notification_route_agent journals
it as the before, so one call that changes metric_match and agent_level journals both, as the Viewer does.

L3: a theory over the kill and PostgreSQL kill refusals made before the gate, and one tools/call through
the host with a named agent token, each asserting the journal row names the token.

L1 and M1: the test comment and the ServerActionGate comment now say what holds.
… review round 1)

"v_changed || 'agent_level'" reads the literal as a text array and fails with
"malformed array literal", so every journaled agent change rolled back. Checked against a
throwaway PostgreSQL 16 container.
One conflict, in DarlingMcpHostGateLiveTests.cs: this branch's new
NamedTokensThatCannotBeServed_WithNoLegacyToken_StopTheStart test is kept,
and the source-text test TryStartServerAsync_ResolvesTheLoopbackOnlyToken,
which dev removed in #6507, stays removed.
ScalarAsync turns a boolean into "True", so the enabled and send_resolutions
asserts compared "true" with "True" and failed (Darling PG tests shard 1).
Both reads now cast to text, as the test's other reads do. The send_resolutions
read was after the failing line, so it had not run yet.
…ields

# Conflicts:
#	Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpAlertTools.cs
- DarlingMcpAlertTools.RouteAdmin.cs: CreateNotificationRouteAsync no longer calls SetRouteAgentAsync
- DarlingMcpAlertTools.RouteAdmin.cs: AgentFieldRefusal refuses level 3 again
- DarlingMcpWritePolicy.cs: OperatorActor returns TokenName alone for the legacy token
- DarlingMcpPlanForceTools.cs: RefuseBeforeGateAsync journals parsed.AgentId, not agentTokenName
- DarlingMcpHostService.cs: return false removed after the named-token Critical line
- DarlingManagedRoles.cs and provision-roles.sql: AND NOT v_operator dropped from the agent-route DL403 guard
- DarlingMcpAlertTools.RouteAdmin.cs: SetRouteAgentAsync call in the update path no longer passes before
- DarlingMcpPlanForceTools.cs: agentTokenName dropped at the kill bad-session, bad-login-time, Azure database, PG bad backend id and PG pid mismatch refusal sites

(cherry picked from commit 4e8b98c)
Moved out of this round: the create-path set_notification_route_agent call,
the level-3 refusal and the legacy OperatorActor. They change tests this
round's other reverts target, so they run in rounds 3 and 4.

- DarlingManagedRoles.cs and provision-roles.sql: AND NOT v_operator dropped from the agent-route DL403 guard
- DarlingMcpPlanForceTools.cs: RefuseBeforeGateAsync passes parsed.AgentId
- DarlingMcpHostService.cs: return false after the named-token Critical line deleted
- DarlingMcpAlertTools.RouteAdmin.cs: the update-path SetRouteAgentAsync passes no before
- DarlingMcpPlanForceTools.cs: agentTokenName dropped at the bad-session, bad-login-time, Azure-no-database, PG-bad-backend-id and PG-pid-mismatch refusals

(cherry picked from commit 8452948)
@erikdarlingdata

Copy link
Copy Markdown
Owner Author

Claude posting for Erik Darling. Revert proof round done. The results are in #6593's body. Closing without merge.

@erikdarlingdata
erikdarlingdata deleted the train/6593-proof-1 branch October 23, 2026 15:07
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