diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,19 @@
 # Changelog for srtree-db
 
+## 0.1.5.0
+
+- **User-supplied rules in `eqsat`**: `--ruleset` now accepts a builtin rule
+  set name (`default`, `params`, `simple`, `constant`, `basic`, `fun`,
+  `merge-only`), `@FILE` with one rule per line (`#` comments), or inline
+  rules separated by `;` (e.g. `"x + 0 -> x; log(exp(x)) <=> x"`). Specs are
+  resolved by `Text.ParseRule.resolveRules` from srtree; invalid specs and
+  rules are rejected with helpful messages (unbound target/condition
+  variables, unknown conditions, unknown rule set names). This also adds the
+  previously planned `--ruleset merge-only` (rules that only merge e-classes
+  or shrink expressions).
+- Requires `srtree >= 3.0.1.0` (new `Text.ParseRule` module).
+- Test suite: new `parse-rules` unit tests for the rule parser and resolver.
+
 ## 0.1.4.0
 
 - **Split-DB correctness**: the egraph DB is now genuinely structure-only when a
diff --git a/app/EqSat.hs b/app/EqSat.hs
--- a/app/EqSat.hs
+++ b/app/EqSat.hs
@@ -18,10 +18,11 @@
 import Data.SRTree (SRTree(..))
 import Algorithm.EqSat (runEqSat)
 import Algorithm.EqSat.Egraph (EGraph(..), EClassPageStore(..))
-import Algorithm.EqSat.Simplify (Rule, rewrites, rewritesParams, myCost)
+import Algorithm.EqSat.Simplify (Rule, myCost)
 import Algorithm.EqSat.Storage.Backend (SqlBackend(..), SqlValue(..), sqlToInt)
 import Algorithm.EqSat.Storage.SQLite (loadGraphResident, loadGraphLazy, saveGraph, flushStore)
 import Algorithm.EqSat.Storage.Query (getOrCreateDataset)
+import Text.ParseRule (resolveRules)
 
 import Database.SQLite3 (Database, open, close, exec)
 
@@ -54,7 +55,7 @@
       ( long "ruleset"
       <> value "default"
       <> metavar "RULESET"
-      <> help "Rule set: default or params" )
+      <> help "Rule set: a builtin name (default, params, simple, constant, basic, fun, merge-only), @FILE with one rule per line, or inline rules separated by ';' (e.g. \"x + 0 -> x; log(exp(x)) <=> x\")" )
   <*> option auto
       ( long "cache-cap"
       <> value 50000
@@ -68,13 +69,13 @@
 -- | Run the eqsat sub-command.
 runEqSatCmd :: EqSatOpts -> IO ()
 runEqSatCmd EqSatOpts{..} = do
-  let rules = case eqsatRuleset of
-                "params" -> rewritesParams
-                _        -> rewrites
-
-  if eqsatBenchmark
-    then runBenchmark EqSatOpts{..} rules
-    else runNormal EqSatOpts{..} rules
+  erules <- resolveRules eqsatRuleset
+  case erules of
+    Left err   -> putStrLn $ "eqsat failed: " ++ err
+    Right rules ->
+      if eqsatBenchmark
+        then runBenchmark EqSatOpts{..} rules
+        else runNormal EqSatOpts{..} rules
 
 -- | Normal eqsat run (existing behavior).
 runNormal :: EqSatOpts -> [Algorithm.EqSat.Simplify.Rule] -> IO ()
diff --git a/srtree-db.cabal b/srtree-db.cabal
--- a/srtree-db.cabal
+++ b/srtree-db.cabal
@@ -1,6 +1,6 @@
 cabal-version: 2.4
 name:          srtree-db
-version:       0.1.4.0
+version:       0.1.5.0
 synopsis:      SQL persistence and querying for srtree e-graphs
 description:   Reusable storage layer for srtree multiset e-graphs:
                a driver-neutral serialization of the Algorithm.EqSat.Store
@@ -43,7 +43,7 @@
     , text >=1.2 && <2.2
     , direct-sqlite >=2.3 && <2.4
     , postgresql-libpq >=0.10 && <0.12
-    , srtree >=3.0.0.6 && <3.1
+    , srtree >=3.0.1.0 && <3.1
     , vector >=0.12 && <0.14
     , mtl >=2.2 && <2.4
   default-language: Haskell2010
@@ -62,7 +62,7 @@
     , directory >=1.3 && <1.4
     , direct-sqlite >=2.3 && <2.4
     , postgresql-libpq >=0.10 && <0.12
-    , srtree >=3.0.0.6 && <3.1
+    , srtree >=3.0.1.0 && <3.1
     , srtree-db >=0.1 && <0.2
   default-language: Haskell2010
 
@@ -75,7 +75,7 @@
       base >=4.14 && <5
     , optparse-applicative >=0.17 && <0.19
     , srtree-db >=0.1 && <0.2
-    , srtree >=3.0.0.6 && <3.1
+    , srtree >=3.0.1.0 && <3.1
     , bytestring >=0.10 && <0.13
     , binary >=0.8 && <0.9
     , containers >=0.6 && <0.9
@@ -105,7 +105,7 @@
     , text >=1.2 && <2.2
     , direct-sqlite >=2.3 && <2.4
     , postgresql-libpq >=0.10 && <0.12
-    , srtree >=3.0.0.6 && <3.1
+    , srtree >=3.0.1.0 && <3.1
     , srtree-db >=0.1 && <0.2
     , vector >=0.12 && <0.14
     , mtl >=2.2 && <2.4
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -32,6 +32,8 @@
 import Algorithm.EqSat.Info (insertFitness)
 import Algorithm.EqSat.DB (Pattern(..), match)
 import Algorithm.EqSat.Queries (findRootClasses)
+import Text.ParseRule (parseRule, parseRules, resolveRules)
+import Data.Either (isLeft, isRight)
 import Algorithm.EqSat.Storage.Backend ( SqlValue(..), SqlBackend(..), sqlToInt )
 import Algorithm.EqSat.Storage.ClassStore
 import Algorithm.EqSat.Storage.SQLite
@@ -644,6 +646,32 @@
           assertEqual "theta applied from fit rows" 1 (length th)
   closeDb db
 
+-- | Pure tests for the user-supplied rule parser (Text.ParseRule).
+testParseRules :: Test
+testParseRules = TestLabel "parse-rules" $ TestCase $ do
+  assertBool "simple rule"       (isRight (parseRule "x + 0 -> x"))
+  assertBool "arrow alias"       (isRight (parseRule "x * 1 => x"))
+  assertBool "bidirectional"     (isRight (parseRule "log(exp(x)) <=> x"))
+  assertBool "conditional"       (isRight (parseRule "x / x -> 1 | isNotZero(x)"))
+  assertBool "multi conditions"  (isRight (parseRule "x ** y * x -> x ** (y + 1) | isPositive(x), isInteger(y)"))
+  assertBool "bare-letter vars"  (isRight (parseRule "a + b -> b + a"))
+  assertBool "powerAbs operator" (isRight (parseRule "x |**| y -> y |**| x | isValid(y)"))
+  assertBool "unbound target"    (isLeft (parseRule "x -> y"))
+  assertBool "unbound cond var"  (isLeft (parseRule "x + 0 -> x | isNotZero(z)"))
+  assertBool "no arrow"          (isLeft (parseRule "x + 0"))
+  assertBool "unterminated cond" (isLeft (parseRule "x -> x | isNotZero(x"))
+  assertBool "unknown condition" (isLeft (parseRule "x -> x | noSuchCond(x)"))
+  assertEqual "parseRules lines/';'/'#'" (Right 3)
+    (fmap length (parseRules "x + 0 -> x\n# comment\nlog(exp(x)) <=> x ; 1 ** x -> 1"))
+  rs <- resolveRules "x + 0 -> x; x * 1 -> x"
+  assertEqual "inline spec" (Right 2) (fmap length rs)
+  rBad <- resolveRules "bogus"
+  assertBool "unknown spec rejected" (isLeft rBad)
+  rMerge <- resolveRules "merge-only"
+  assertBool "merge-only builtin" (either (const False) (not . null) rMerge)
+  rDflt <- resolveRules ""
+  assertBool "empty spec is default" (either (const False) (not . null) rDflt)
+
 runSuite :: SqlBackend db => String -> (IO db, db -> IO ()) -> [Test]
 runSuite tag (openDb, closeDb) =
   [ TestLabel (tag <> " save-load-roundtrip") (testSaveLoadRT openDb closeDb)
@@ -659,7 +687,8 @@
   let sqlitePath = "/tmp/opencode/srtree-db-test.sqlite"
   removeFile sqlitePath `catch` (\(_ :: SomeException) -> pure ())
   sqliteCounts <- runTestTT $ TestList
-    (runSuite "sqlite" (open (T.pack sqlitePath), close)
+    ([testParseRules]
+      <> runSuite "sqlite" (open (T.pack sqlitePath), close)
       <> runPagedSuite "sqlite" (open (T.pack sqlitePath), close))
   mdsn <- lookupEnv "PGDSN"
   case mdsn of
