Skip to content

chore(guard): remove legacy markov risk model#155

Merged
michiosw merged 2 commits into
mainfrom
feat/eng-325-remove-markov
May 18, 2026
Merged

chore(guard): remove legacy markov risk model#155
michiosw merged 2 commits into
mainfrom
feat/eng-325-remove-markov

Conversation

@hasandemirkiran
Copy link
Copy Markdown
Contributor

@hasandemirkiran hasandemirkiran commented May 18, 2026

Summary

  • ENG-325 follow-up: remove the obsolete Markov risk-model runtime path so Guard only uses deterministic policy plus the local LLM judge.
  • Delete Markov/model-snapshot/trace-training packages and embedded models/guard artifacts.
  • Remove model startup flags/env usage and dashboard/docs/scripts references to Markov risk scoring.

Verification

  • go test ./...
  • pnpm --dir web/guard-dashboard typecheck
  • scripts/build-guard-dashboard-assets.sh
  • scripts/guard-e2e-local.sh

Notes

  • scripts/build-guard-dashboard-assets.sh completed, but Vite printed its existing Node version warning because this machine is on Node 18.20.7 while Vite recommends Node 20.19+ or 22.12+. The build exited successfully.

Stacked on: #154
Linear: ENG-325

Copy link
Copy Markdown
Contributor Author

hasandemirkiran commented May 18, 2026

@hasandemirkiran hasandemirkiran marked this pull request as ready for review May 18, 2026 12:38
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR removes the legacy Markov risk-model path from Guard. The main changes are:

  • Deleted Markov, trace-training, model snapshot, and embedded model packages.
  • Simplified Guard server policy flow to deterministic policy plus optional local judge.
  • Removed model startup flags, environment handling, and runtimehost model activation.
  • Updated dashboard types and copy to show deterministic and judge decision stages.

Confidence Score: 4/5

This looks close to safe, with one diagnostic workflow to fix.

  • The main runtime path now consistently uses deterministic policy and the local judge.

  • The smoke-test command still expects the old credential-access ask result.

  • No security issue was confirmed in the changed code.

  • internal/guard/cli/cli.go smoke-test expectations.

Important Files Changed

Filename Overview
internal/guard/app/server/policy.go Replaces scorer-backed risk decisions with deterministic policy evaluation and optional local judge decisions.
internal/guard/cli/cli.go Removes model flags and loading, but leaves stale smoke-test expectations for credential-access decisions.
internal/runtimehost/host.go Removes embedded model activation and starts the server with only local judge configuration.

Comments Outside Diff (1)

  1. internal/guard/cli/cli.go, line 716-717 (link)

    P2 Smoke test expects old decision The default policy path now deterministically denies credential access. These smoke-test cases still expect .env reads and cat .env to return ask, so kontext guard smoke-test fails even though the daemon is returning the new expected decision.

Reviews (1): Last reviewed commit: "chore(guard): remove legacy markov risk ..." | Re-trigger Greptile

@hasandemirkiran hasandemirkiran force-pushed the feat/eng-325-remove-markov branch from 93aee7c to 25e6a07 Compare May 18, 2026 12:42
@hasandemirkiran hasandemirkiran force-pushed the feat/eng-325-guard-decision-path branch from 6734b55 to 97e1684 Compare May 18, 2026 12:57
@hasandemirkiran hasandemirkiran force-pushed the feat/eng-325-remove-markov branch from 25e6a07 to 55dc4cc Compare May 18, 2026 12:57
@hasandemirkiran hasandemirkiran requested a review from michiosw May 18, 2026 14:51
@hasandemirkiran hasandemirkiran force-pushed the feat/eng-325-remove-markov branch from 55dc4cc to 70cb383 Compare May 18, 2026 15:10
@hasandemirkiran hasandemirkiran force-pushed the feat/eng-325-guard-decision-path branch from 97e1684 to 46fc334 Compare May 18, 2026 15:10
Comment thread README.md Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

michiosw commented May 18, 2026

Merge activity

  • May 18, 4:28 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 18, 4:30 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 18, 4:32 PM UTC: @michiosw merged this pull request with Graphite.

@michiosw michiosw changed the base branch from feat/eng-325-guard-decision-path to graphite-base/155 May 18, 2026 16:28
@michiosw michiosw changed the base branch from graphite-base/155 to main May 18, 2026 16:29
@michiosw michiosw force-pushed the feat/eng-325-remove-markov branch from a709e37 to 6cf050d Compare May 18, 2026 16:29
@michiosw michiosw merged commit 147845c into main May 18, 2026
5 checks passed
@michiosw michiosw deleted the feat/eng-325-remove-markov branch May 18, 2026 16:32
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.

2 participants