Files
archie/ui/test/nav-capabilities.test.js
T
sam 04d4d8f1d8 chore(memory): delete internal/memory (unification slice 5) (#889)
Deletes internal/memory (Manager, builtin.Provider, memory_edit tool) now
that slices 2-4 built the CRUD engine family and its per-turn read/write
seams. Also deletes internal/infrastructure/memory/builtin/provider.go (the
memory_edit adapter over the old package -- its markdown store already
relocated in slice 2), internal/tools/provider/memory (the old tool
registration, redundant with slice 4's memory_create/update/delete/list),
config.Memory.{Provider,ProviderConfig} and the validateMemory rejection
that existed only to complain about Provider, and webui.MemoryStatus/
MemoryProviderHandle plus its dashboard page -- never wired in production
(s.Memory was always nil), confirmed by /api/capabilities always reporting
"memory": false.

Rewrites ARCHITECTURE.md's "Memory engine family" section to describe the
current engine (internal/domain/memory contract, internal/infrastructure/
memory builtin engine + its builtin/ markdown store, the per-turn read seam
in gateway/turn_memory.go, the per-turn write tools in
gateway/turn_memory_tool.go) instead of the deleted Manager. Fixes two
docs/architecture/configuration.md rows that described the deleted
manager's literals and SaveConfig mechanism.
2026-09-19 13:43:16 +10:00

32 lines
1.2 KiB
JavaScript

import { test } from "node:test";
import assert from "node:assert/strict";
import { hiddenRoutes } from "../src/capabilities.jsx";
const routes = [
{ path: "/", label: "Dashboard" },
{ path: "/logs", label: "Logs", section: "logs" },
{ path: "/skills", label: "Skills", section: "skills" },
{ path: "/tasks", label: "Tasks" },
];
// The dashboard is served by two processes with different capabilities. A
// section the serving process cannot back renders as permanently empty, which
// reads as "nothing has happened" rather than "not served here".
test("a section the server cannot serve is hidden", () => {
assert.deepEqual(hiddenRoutes({ logs: false, skills: true }, routes), ["/logs"]);
});
test("sections with no capability entry stay visible", () => {
assert.deepEqual(hiddenRoutes({}, routes), []);
});
// Fail open: an older server, or a failed read, must not blank the nav.
test("no capabilities at all hides nothing", () => {
assert.deepEqual(hiddenRoutes(undefined, routes), []);
assert.deepEqual(hiddenRoutes(null, routes), []);
});
test("routes without a section are never hidden", () => {
assert.deepEqual(hiddenRoutes({ logs: false }, routes), ["/logs"]);
});