Group the sources into aliased modules and lint with the published plugins #23
Reference in New Issue
Block a user
Delete Branch "group-modules"
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?
Groups the flat
src/into cohesive modules and turns on the published lint plugins. No behavior change.Module layout
Each module is a direct
src/subfolder with anindex.tsbarrel and a#alias inpackage.jsonimports(layer order, top first):#prepareindex.ts(the prepare phase entry point)#runindex.ts(the run phase entry point)#postindex.ts(the post phase entry point),post.ts,post.test.ts#agentsauth.ts,opencode.ts(Codex / Claude Code sign-in, OpenCode args and output)#processeschild.ts,isolation.ts#runtimeruntime.ts,credentials.ts#profilesprofiles.ts#commonerrors.ts,json.ts#testingindex.ts(unchanged)Every top-level entry of
src/is an aliased module folder. Tests stay next to their code as*.test.ts. Each phase'sindex.tsis its entry point, andaction.ymlnow runsnode src/<phase>/index.ts. The post phase's logic moved tosrc/post/post.tsso its test can import it;index.tskeeps the env reading and theimport.meta.maincall.run's prompt URL is now../../prompt.md.scripts/protect-source.shnow copiessrc/recursively (it used to copysrc/*.tsonly), and the workflow test checks that module files get staged too.Lint plugins
eslint-plugin-explicit-types@^0.6.1andeslint-plugin-import-structure@^0.10.2, both injsPlugins. The lockfile comes from a realnpm install.importStructure.configs.modules,explicitTypes.configs.concrete,explicitTypes.configs.absence.namingis off (the other app repos turn it on). Itsupper-snake-string-unionsandno-upper-snake-object-keysrules fire on wire tokens this repo doesn't choose: profile types"claude" | "codex" | "opencode"fromprofiles.json, failure reasons posted to Gitea, Gitea's"new" | "old"side, and environment variable names such asPATH. Satisfying them would change behavior or need opt-outs. This is logged as an open question for the user.Lint fixes, all type-level:
Pick<BotProfile, "type" | "model">became a namedProfileIdentityinterface thatBotProfile,ProfileFailure, andRuntimeProfileextend.RuntimeOutcomeis nowRuntimeSuccess | RuntimeFailure.Record<string, string>env maps becameNodeJS.ProcessEnv.JsonObjectand the verdict table becameNodeJS.Dict<…>.T | undefinedlocals and returns becameT | nullwith matching checks.typeof fetchbecame aFetchertype.isError,apiErrorStatus) after parsing, becauseid-matchrejects snake_case interface members.import-structure/no-duplicate-import-source).Verification
vp check: clean.vp test: 61 passed and 5 skipped as a normal user. All 66 passed as root innode:24-bookworm.node src/<phase>/index.ts) run from aprotect-source.shcopy loads its full alias graph under Node.🤖 Generated with Claude Code
@bot
✅ Approved
Summary: Module aliases, staged action sources, and lint configuration are ready.
Checks
vp checkvp test— 61 passed; 5 expected non-root skipsReview notes
Strengths: the alias barrels preserve the layer boundaries, and the staged copy loads every phase's alias graph.
Declined: none.
@bot