feat(openshell-core): add MCP route observation state - #3207
Conversation
Signed-off-by: Shiju <shiju@nvidia.com>
Follow-Up NeededI cannot validate this PR yet because it is the first change in a three-PR feature stack, while the related design issue #3205 is still in Please have a maintainer confirm the project direction for #3205 and this PR stack (for example by accepting/validating the issue or commenting here). If the original submitter or a maintainer does not respond within 48 business hours, this PR may be closed as not planned. Weekend hours do not count toward the TTL. Action required: a maintainer should confirm whether #3205 and this three-PR implementation stack should proceed. Gator metadata
|
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The operator’s maintainer-authorized review direction resolves the earlier project-acceptance follow-up. The initial code review found one blocking freshness issue in the new observation-authority state machine.
Action required: @shiju-nv, rotate a non-reusable authority generation on inventory installation and supervisor replacement, and add the requested stale-handle regression tests.
Blocking findings:
GATOR-0852929e-01: obsolete observation handles can become current again after supervisor replacement or an A→B→A epoch cycle.
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Project direction confirmed by the maintainer-authorized operator request; this focused core layer implements the first part of issue #3205.
- Docs: Not needed for this internal primitive boundary; public gateway/runtime semantics are deferred to the dependent PRs.
- Checks: Current branch checks, Helm lint, Trivy/required gates, DCO, and vouch gates are green; review feedback remains unresolved.
- E2E: Deferred until blocking review feedback is resolved.
- Head SHA:
0852929ebadc8ef11fa1c4fbce6369c912d640ba - Base SHA:
320d4ef79dd572c642133f175f12bafc20d89fd9 - Merge base SHA:
320d4ef79dd572c642133f175f12bafc20d89fd9 - Patch ID:
75f222e7cb8f507a87c83955bd78b8b05ad86dff - Gator payload:
8 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
| subject, | ||
| outcome, | ||
| } => { | ||
| if self.epoch.as_ref() != Some(&epoch) { |
There was a problem hiding this comment.
gator-agent
Warning — GATOR-0852929e-01 · Obsolete observations can become current again
Summary: If a supervisor is replaced, or policy moves A→B→A while an earlier MCP exchange remains in flight, the old handle’s policy hash and provider revision can equal the current epoch. apply then accepts stale evidence after invalidation, making route status and freshness look current to operators and automation.
Fix: Add a non-reusable observation-authority generation, rotate it on every inventory installation and supervisor replacement, and capture it in each handle.
Verify: Retain a handle across clear_observations, then submit it; repeat across Reset(A), Reset(B), Reset(A). Both old observations must be rejected, while a handle captured after the latest installation must succeed.
Agent context
- Ownership: This PR introduces the reusable value-only epoch and session-replacement clearing behavior.
- Location:
crates/openshell-core/src/mcp_route_status.rs:301
Summary
Add the OpenShell-owned primitives for representing MCP route identity, observation outcomes, and epoch-aware readiness state. This establishes a redacted state-machine boundary that later gateway and runtime PRs can consume without coupling lifecycle readiness to route evidence.
Related Issue
Related to #3205
This is the first PR in a three-PR stack. It establishes the core layer but does not complete the public gateway or runtime behavior, so the final runtime PR uses
Closes #3205after the dependencies land.Changes
openshell-coredependency graphs include the new hashing and TLS dependencies andmise run pre-commitleaves the worktree clean.Testing
mise run pre-commitpassesChecklist