mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 10:45:59 -10:00
internal/ was 141 packages side by side, so nothing but a reader's memory
said which were foundations and which assembled the rest. Each now sits in a
layer directory, and the directory is the declaration:
base L0 foundation with no domain in it
contract L1 types and interfaces the layers above agree on
model, tools, safety, ext, state, platform
L2 subsystems, peers of one another
runtime L3 the turn engine
session L4 the controller
assembly L5 the composition root
frontend L6 cli, serve, acp and the host adapters
Only paths change: package names, code and behaviour do not. Imports,
repolint and coverage baselines, sensitive paths, CI package lists and docs
follow the new paths; release notes keep the paths they were written with,
and sample paths inside tests and fixtures keep theirs.
repolint gains layer-order: a package may import its own layer and those
below it, read from where it lives. The 47 imports that point upward today
are recorded as that rule's opening debt (-allow-widen, a new rule's first
baseline) and can only go down. Most of it is config, which still reaches
into eight subsystems and is the next thing to take apart; the rest is
event, history and a few tools reaching into runtime for types that belong
in contract.
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package boot
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// Assembly notices must not reach the transcript: a fact about which model was
|
|
// resolved is not a turn in the conversation the runtime is about to have. The
|
|
// audience is what says so, report is the only thing that stamps it, and an
|
|
// emitter that goes around report loses the stamp silently — the notice simply
|
|
// shows up in the flow, which is exactly the bug this replaced.
|
|
func TestAssemblyNoticesGoThroughReport(t *testing.T) {
|
|
files, err := filepath.Glob("*.go")
|
|
if err != nil || len(files) == 0 {
|
|
t.Fatalf("no sources found: %v", err)
|
|
}
|
|
found := 0
|
|
for _, file := range files {
|
|
if strings.HasSuffix(file, "_test.go") || file == "report.go" {
|
|
continue
|
|
}
|
|
src, err := os.ReadFile(file)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for line := range strings.SplitSeq(string(src), "\n") {
|
|
if !strings.Contains(line, "event.Notice") {
|
|
continue
|
|
}
|
|
found++
|
|
if strings.Contains(line, ".Emit(") {
|
|
t.Errorf("%s emits a notice directly: %s", file, strings.TrimSpace(line))
|
|
}
|
|
}
|
|
}
|
|
if found == 0 {
|
|
t.Fatal("no notice emission found at all — this test has stopped watching anything")
|
|
}
|
|
}
|