build-tooling + res help-cache write (deferred) #4
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#4
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?
Plan: build-tooling migration +
rescache/help fix + bulk-script docsStatus
Partially done. The mage build-system migration (
core/magefiles/) and the bulk-script docs landed. Thereshelp-cache write half of the cache/help fix is still deferred — see AGENTS.md §12 ("res help-cache writes: Dispatcher reads cache but currently never writes it"). Theres --res-helpread path works.Decisions (confirmed with user)
core/magefiles/with its owngo.modso mage runs independently of (possibly broken) core libs.respkg-mkinitfs/required for residual-os;os-old/left untouched (legacy backup, deletion not authorized). The "remove stale repos" item is dropped.Steps
residual-demo→res-demo(fixes Makefile breakage):git mv cmd/residual-demo cmd/res-demo; update string literals;res-themealready correct.core/magefiles/: separatego.mod(go 1.25,require github.com/magefile/mage v1.15.0);mage.go(//go:build mage, package main) with targets that only shell out togo(Build, BuildOne, Demo, Theme, Test, TestCgo, Vet, Clean, All); replacecore/Makefilewith thin wrapper delegating to mage; ensurecore/.gitignoreignoresbin/; verifymagefiles/tracked.rescache writing +res --help(core/cmd/res/main.go):--help/-h→cmdHelp;@refreshinternal →RefreshOne; replace orphanedrefreshblock with detached re-exec that writes cache (RES_NO_REFRESH=1,Setsid);scanExternalHelpwrites back viaSaveCache; addcore/cmd/res/main_test.go(run(["--help"])==0, run(["-h"])==0, run(["nonexistentxyz"])==127).AGENTS.mddocs: fixdeploy-harness.shrepo list (core docs editor extra os); add header comments to each.agent/tools/script; verify repo lists post-collapse; document.agent/tools/in AGENTS.md.Verification
cd core && go build ./.../go test ./.../CGO_ENABLED=1 go test ./.../go vet ./...→ PASScd core/magefiles && go run github.com/magefile/mage -d . build(ormake build) builds allcmd/*incl.res-demo,res-themebin/res --help/bin/res -h→ print help (no "unknown subcommand")bin/res consolethen check$XDG_CACHE_HOME/residual/help-cache.jsonexists and containsres-consolebin/res help→ lists external subcommands with cached descriptions.agent/tools/test-all.sh/build-all.shrun againstcore/only;sync-repos.shSKIPs absent reposRisks
go mod tidymay pick a different mage version; verifygo runworks.@refreshchild must finish 500ms-boundedRefreshOnebefore user cares; cache best-effort,scanExternalHelpfalls back to live query + write-back.go run github.com/magefile/magefirst-run cost: compiles mage once (cached after).