Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
// Package mestionora owns bounded search, search projections and the SQLite
|
|
// search index. It consumes read-policy decisions; it never grants permissions.
|
|
// Search results and excerpts are untrusted text, not HTML-safe output.
|
|
package mestionora
|
|
|
|
import (
|
|
"database/sql"
|
|
"strings"
|
|
)
|
|
|
|
const Component = "mestionora"
|
|
|
|
// SQLite borrows a metadata connection pool. Construction performs no I/O or
|
|
// schema initialization. EnsureSearchIndexSchema is a separate startup step.
|
|
// The caller owns the pool lifetime and provisions the application schema.
|
|
type SQLite struct{ db *sql.DB }
|
|
|
|
func NewSQLite(db *sql.DB) *SQLite { return &SQLite{db: db} }
|
|
|
|
// Match the established Path scope rules, without filesystem path cleaning or
|
|
// URL decoding. Percent/underscore characters remain literal search data.
|
|
func normalizePath(value string) string {
|
|
value = strings.TrimSpace(value)
|
|
if value == "" {
|
|
return "/"
|
|
}
|
|
if !strings.HasPrefix(value, "/") {
|
|
value = "/" + value
|
|
}
|
|
if value != "/" {
|
|
value = strings.TrimRight(value, "/")
|
|
}
|
|
return value
|
|
}
|