residual workspace audit — 2026-08-03 #19
Labels
No labels
harness
proj-core-console
proj-core-demo
proj-core-edit
proj-core-init
proj-core-lib
proj-core-login
proj-core-res
proj-core-sh
proj-core-theme
proj-docs
proj-extra-calc
proj-extra-code
proj-extra-playbook
proj-extra-sheets
proj-harness
proj-os
residual
tier-0-trivial
tier-1-easy
tier-2-medium
tier-3-hard
tier-4-major
tier-5-epic
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
residual-overview — workspace audit
orientation
project: residual — Linux terminal suite (core + extra utilities)
root: /workspace/git.merith.xyz/residual (workspace root repo)
stack: Go 1.25 (toolchain 1.26.5 present) · bubbletea + lipgloss · gopher-lua · sqlite
modules: git.merith.xyz/residual/core (single tool module)
git.merith.xyz/residual/extra (extra utilities; resolves core via network)
shared: core/lib/ (proc, ipc, lock, script, tui, edit, config, cmd, help, …)
binaries: core/cmd/{res,residual-init,res-console,res-sh,residual-login,res-edit,res-demo,res-theme}
extra/cmd/{res-calc,res-code,res-sheets}
config: /etc/residual/.toml + ~/.config/residual/.toml (waterfall)
aesthetic: amber-on-black via core/lib/tui/theme
(#0d0a00 bg, #ffb000 fg, #7a5500 dim, #ff6600 urgent, #1a1400 border)
test cmd: cd core && go test ./... (CGO_ENABLED=1 for PAM)
cd extra && go test ./...
build cmd: cd core && go build ./cmd/... (or: make build)
cd extra && go build ./cmd/...
derived rules
assumptions
PASS. The codebase appears structurally sound but verification is deferred.
review scope
Full residual workspace consistency audit (2026-08-03): binaries vs docs,
config-path conventions, aesthetic compliance, stale names, go.work/replace
state, docs-sync, issue backlog health, and cross-cutting design coherence.
Source not modified except this file.
verification log
audit — workspace-wide (2026-08-03)
summary
The codebase is structurally sound. The previous overlay-shade aesthetic
violation is resolved — all theme.go styles now use only the 5 approved palette
colors. The
core/lib/cmdpackage (command registry + UI + Lua bridge) is awell-designed addition that is correctly documented in its own package doc but
absent from
docs/architecture.md. The critical remaining issues are: (1) theinverted
UnifiedThemesemantics inres-console, (2)res-shandresidual-loginstill enforcing palette when they should not, (3)res-demoand
res-themeleaking intores help, (4) stale documentation indocs/design/aesthetic.md, and (5) four unlabeled issues in the backlog.resolved since last audit
core/lib/tui/theme/theme.go— aesthetic violation — The fouroff-palette overlay shade hexes (
#080600,#120f00,#aa8800,#3a2a00)have been removed. All Overlay* styles now use
LBg,LAmber,LDim,LBlack, orLUrgentexclusively.buildFilledOverlayStyles(),buildTransparentOverlayStyles(), andinitLinuxConsoleTheme()all drawfrom the 5-color palette. The palette.go comment confirms: "no off-palette
shades." This was the highest-severity item from the 2026-07-18 audit.
violations
[VIOLATION]
core/cmd/res-console/main.go:45-46— modkey/aesthetic —UnifiedThemelogic is inverted. WhenUnifiedTheme = true, the code callstheme.InitInherit()(terminal colors). Whenfalse(default), it appliesthe amber palette. The aesthetic.md spec says
unified_theme = trueshouldmean "apply the unified amber palette." The config template at
console/config/config.go:78also documentsfalseas the default for"inherit terminal colors," which matches the code behavior but contradicts
the semantic intent. Fix shape: swap the branches so
true→ amber,false→ inherit, and set the default totrueinDefaults(). This isIssue #3/#11 in the backlog.
[VIOLATION]
core/cmd/res-sh/main.go:42-46— aesthetic —res-shstillcalls
theme.ApplyPalette()andtheme.ResetPalette()when it owns theterminal. Per Issue #11 and the aesthetic enforcement model, only
res-consoleshould enforce the palette.res-shshould inherit theterminal's existing colors. Fix shape: remove the palette block (lines 42-46)
and the
theme+termimports.[VIOLATION]
core/cmd/residual-login/main.go:138,210,253,378-388—aesthetic —
residual-loginstill callsapplyThemeGuard()which appliesthe full 16-color palette via
theme.ApplyPalette(). Per Issue #11, thisshould be removed — only
res-consoleenforces. Fix shape: deleteapplyThemeGuard()and all threedefer applyThemeGuard(...)call sites.issues
[ISSUE]
core/cmd/res-demo/main.go:19+core/cmd/res-theme/main.go:487— docs-sync — Both call
help.IfRequested(...), so they surface inres helpas subcommands ("demo" and "theme"). They are developer/calibrationtools, not user-facing commands.
docs/README.md:27correctly parenthesizesthem as dev tools, but
AGENTS.md §3binary table still omits thementirely. Fix shape: either (a) add them to AGENTS.md §3 tagged as dev
tools, or (b) have them not register
--res-helpto exclude them fromdiscovery.
[ISSUE]
docs/design/aesthetic.md:146-154— docs-sync — The "themeenforcement" section still says "
res-shandresidual-loginapply thefull 16-color palette (OSC 4) when they own the terminal." This is stale —
Issue #3 and #11 plan to remove enforcement from these tools. Fix shape:
update to reflect the console-only enforcement model once Issue #11 is
implemented.
[ISSUE]
docs/architecture.md— docs-sync — The architecture doc does notlist the
core/lib/cmdpackage (command registry, UI widgets, Lua bridge)or
core/lib/help(dispatcher discovery contract). Both are real, exportedpackages with tests. Fix shape: add entries to the package table in
docs/architecture.md.[ISSUE]
.agent/plans/sheets-formula-editor-embed.md— harness — This planfile still exists despite Issue #1 establishing that the backlog lives in
Forgejo issues (not
.agent/plans/). It duplicates Issue #16. Fix shape:delete the file; the plan content lives in Issue #16.
[ISSUE] Forgejo issues #6, #7, #8, #9, #10 — harness — Four issues have no
project or tier labels: #6 (sheets Phase 5), #7 (sheets array/spill), #8
(repository APK repo), #9 (os/ ISO build), #10 (os/ persistent overlay).
Per AGENTS.md §10 rule 8, every issue must have two labels (proj-* + tier-*).
Fix shape: add appropriate labels to each.
smells
[SMELL]
core/internal/libs/init/config/config.go:44-58— Thedurationtype has a legacy
map[Duration:...]repair inUnmarshalText. Thissuggests old config files were written with
%vformatting on a structinstead of the duration string. The fix is correct but the debt should be
noted — any tooling that wrote those files has been fixed, but the repair
path remains forever.
[SMELL]
core/cmd/res/main.go:82-218— The help cache write path(Issue #4) is now implemented:
scanExternalHelp()writes to cache afterquerying. However, the
@refreshdetached child approach (lines 67-72) isclever but fragile — it relies on
Setsid+ orphaned process to survivesyscall.Exec. This works on Linux but is non-portable. Acceptable givenresidual is Linux-only, but worth a comment.
[SMELL] Issue backlog has 18 issues but zero are closed except #1 (the
harness migration itself). Several issues (#2, #3, #4, #11, #12) have been
partially implemented in code but remain open. The backlog needs a triage
pass to close completed items and re-scope remaining work.
notes
[NOTE]
core/lib/cmd/is a well-designed three-layer command system(registry → UI → Lua). It is documented in its own package doc
(
types.go:1-11) but missing fromdocs/architecture.md. The designfollows the unix-like composition principle cleanly.
[NOTE] Config paths across all four apps (console, shell, login, init) are
consistent:
/etc/residual/<app>.toml→~/.config/residual/<app>.toml.Template generation via
coreconfig.InitTemplateworks uniformly. Good.[NOTE] The
go.moddependency set is lean: bubbletea, lipgloss, gopher-lua,chroma (syntax highlighting), creack/pty, pam/v2. No unexpected transitive
bloat. The
core/magefiles/go.modcorrectly isolates build tooling from thelibrary module.
[NOTE] The 8 Lua widget scripts in
core/internal/libs/console/widgets/(battery, brightness, clock, memory, network, spacer, storage, user) are
embedded and loaded at runtime. They are not documented in the scripting API
doc (
docs/console/scripting.md).[NOTE]
res-sheetshas 14 formula evaluation source files — the most complexcomponent in
extra/. Issue #17 reports that res-code's key forwarding isbroken after the
core/lib/editPhase 1 refactor, which also affectsres-sheets if it uses the same edit library for formula input (Issue #16).
backlog health
:command systemrepositoryAPK repoBacklog stats: 18 issues, 1 closed, 17 open. 5 unlabeled. 0 with tier-5.
Average age: ~2 weeks. No stale-bot or lifecycle management.
priority assessment
Critical (fix before next release):
both fight res-console for palette control).
High (should close soon):
3. Issue #3 — Theming model is half-implemented. The overlay fix landed but
the console inversion and enforcement model remain.
4. Issue #12 — Stale docs actively mislead contributors.
5. Issue #4 — Help-cache write is done but docs are stale.
Medium (next sprint):
6. Issue #5 — Command system library exists; integration is the work.
7. Issue #16 — Formula editor embed has a plan file; execute it.
8. Issue #15 — Small, self-contained, high user value.
9. Issue #2 — Quick fix for calc convergence.
Low (backlog):
10. Issues #6, #7, #14 — res-sheets future phases.
11. Issues #8, #9, #10 — OS/ infrastructure (separate repo, longer timeline).
12. Issue #18 — New feature, well-specified but not urgent.
13. Issue #13 — Informational, can be closed.