Skip to content

feat(openshell-core): add MCP route observation state - #3207

Open
shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:feat/mcp-route-readiness-core
Open

feat(openshell-core): add MCP route observation state#3207
shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:feat/mcp-route-readiness-core

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 #3205 after the dependencies land.

Changes

  • Derive opaque SHA-256 route subjects from normalized host, canonical path, and the sorted, deduplicated effective port set.
  • Define typed redacted outcomes for reachable, policy-denied, credential, TLS, transport, upstream-rejection, and unobserved states.
  • Add a bounded, non-blocking observation channel and an epoch-aware tracker that coalesces observations without affecting sandbox lifecycle phase.
  • Cover canonicalization, deduplication, multi-port identity, epoch reset, timestamp, and bounded-channel behavior with unit tests.
  • Update both standalone example lockfiles so their openshell-core dependency graphs include the new hashing and TLS dependencies and mise run pre-commit leaves the worktree clean.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (not applicable to this core-only state-machine boundary)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable to this internal primitive boundary; public semantics are documented in the dependent gateway PR)

Signed-off-by: Shiju <shiju@nvidia.com>
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

Follow-Up Needed

I 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 state:triage-needed and has no recorded maintainer acceptance, roadmap placement, or explicit confirmation that this stack should proceed.

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
  • Head SHA: 0852929ebadc8ef11fa1c4fbce6369c912d640ba
  • Gator payload: 8
  • Next state: gator:follow-up-needed
  • Blocked reason: project_acceptance_required

@johntmyers johntmyers added the gator:follow-up-needed Gator needs submitter or maintainer follow-up label Sep 9, 2026

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@johntmyers johntmyers added gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:follow-up-needed Gator needs submitter or maintainer follow-up labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:in-review Gator is reviewing or awaiting PR review feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants