|
root / tests / test_hermes_classify.reef
test_hermes_classify.reef Reef 47 lines 2.2 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/******************************************************************************
                __               ____                __   
               / /   ___  ____ _/ __/_____________ _/ /__ 
              / /   / _ \/ __ `/ /_/ ___/ ___/ __ `/ / _ \
             / /___/  __/ /_/ / __(__  ) /__/ /_/ / /  __/
            /_____/\___/\__,_/_/ /____/\___/\__,_/_/\___/ 

    (C)opyright 2026, Leafscale, LLC -  https://www.leafscale.com

    Project: repoman
   Filename: tests/test_hermes_classify.reef
    Authors: Chris Tusa <chris.tusa@leafscale.com>
    License: <see LICENSE file included with this source code>
Description: Tests: hermes path classification helper
     
******************************************************************************/

import hermes
import test.framework

proc main()
    let runner = new framework.TestRunner()

    let copy = hermes.SEED_KIND_COPY()
    let link = hermes.SEED_KIND_SYMLINK()

    // Runtime dirs (hermes-agent/, node/, bin/) used to be SYMLINK for
    // host-upgrade pass-through, but symlinks loop back into themselves
    // across the bind-mount boundary inside containers. v0.3 falls back
    // to COPY for all entries (spec O-3).
    runner.assert_eq_int(hermes.classify_seed_entry("hermes-agent/"), copy, "hermes-agent/ copy (was symlink, see O-3)")
    runner.assert_eq_int(hermes.classify_seed_entry("node/"),         copy, "node/ copy (was symlink)")
    runner.assert_eq_int(hermes.classify_seed_entry("bin/"),          copy, "bin/ copy (was symlink)")

    // Credentials/config/customizations → copy
    runner.assert_eq_int(hermes.classify_seed_entry(".env"),          copy, ".env copy")
    runner.assert_eq_int(hermes.classify_seed_entry("config.yaml"),   copy, "config.yaml copy")
    runner.assert_eq_int(hermes.classify_seed_entry("SOUL.md"),       copy, "SOUL.md copy")
    runner.assert_eq_int(hermes.classify_seed_entry("skills/"),       copy, "skills/ copy (user data, not runtime)")
    runner.assert_eq_int(hermes.classify_seed_entry("hooks/"),        copy, "hooks/ copy")

    // Unknown entries → conservative default (copy)
    runner.assert_eq_int(hermes.classify_seed_entry("custom_thing"),  copy, "unknown defaults to copy")

    runner.report()
end main