feat(server): INGEST_WING_RESOLVE=1 wires the wing resolver into the watcher (#205 S3)
Off by default (retired layout unchanged). On: eligibility from classification.yaml, local ingest LLM as classifier, BM25 as cross-check, INGEST_WING_THRESHOLD (default 0.9, rejected outside [0,1]). Build failure is fatal when explicitly enabled. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package wing_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mathiasbq/hyperguild/ingestion/internal/wing"
|
||||
)
|
||||
|
||||
func TestKnownWings_ListsWingsWithHallsAndSkipsTheRetiredLayout(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
writePage(t, dir, "wiki/homelab/facts/a.md", "x")
|
||||
writePage(t, dir, "wiki/tapir/decisions/b.md", "x")
|
||||
writePage(t, dir, "wiki/concepts/c.md", "x") // retired layout, a file directly under a legacy dir
|
||||
writePage(t, dir, "wiki/sources/d.md", "x") // retired layout
|
||||
writePage(t, dir, "wiki/entities/e.md", "x") // retired layout
|
||||
writePage(t, dir, "wiki/loose-note.md", "x") // a file, not a wing
|
||||
writePage(t, dir, "wiki/emptywing/_index.md", "x") // a dir with no hall subdirectory
|
||||
got, err := wing.KnownWings(dir)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, []string{"homelab", "tapir"}, got)
|
||||
}
|
||||
|
||||
func TestKnownWings_NoWikiDirIsAnError(t *testing.T) {
|
||||
_, err := wing.KnownWings(t.TempDir())
|
||||
assert.Error(t, err, "a brain without wiki/ must not look like a brain with no wings")
|
||||
}
|
||||
Reference in New Issue
Block a user