Repository navigation
chore: quality pass for 2.3.0 (leaner code, lint, fixes, docs) - #29
Merged
Merged
Conversation
- server/routes/http.ts: one wrapWith() and writeOpts() for the task, crontab and fleet routes (were three wraps and two writeOpts). - server/errors.ts: httpError() replaces hand-built Object.assign errors. - server/crontab/cache.ts: the 3 s crontab read cache moves out of routes/tasks.ts, so routes/crontab.ts no longer imports a route file. - moveRunner takes the loaded task (the toggle route read it twice). No behaviour change; fleet errors now also get a [fleet] log line before the app error handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arse security.ts used its own copy of the FIREBASE_ENABLED parse; the Firebase service built six status errors by hand and had two near-identical service-account branches. Same messages and statuses as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
re2js is no longer in the dependency tree (npm ls re2js --all: none); the installed tree is identical without the override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any error without a status used to come back as 401 with its raw message (e.g. a database error text). Errors from verifyFirebaseLogin keep their status and message; everything else is logged and answered with a generic 500. New route test (no database) covers success, 403 passthrough, 400, and both 500 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four routes asserted storage.updateTask() found the row; a concurrent delete turned that into a TypeError and a 500 with a stack in the log. They now answer 404 "Task not found", like the other task routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repository is public. .env.example carried the real Firebase allowlist emails and the real fleet (LAN/tunnel IPs, host names); the 2.1 plan carried the host inventory, firewall rules, sudo facts and the rollout runbook. Now: example.com addresses, documentation IP ranges (192.0.2.0/24, 198.51.100.0/24), generic host ids, and the plan as a design record (section anchors kept for the code comments that link to it). Comment-only edits in AGENTS.md, CHANGELOG.md, app.ts, fleet.tsx. No runtime change: code defaults (PITASKER_ORIGIN, PITASKER_BIN_MASTER, PITASKER_BIN_DIR) are untouched. Git history is not rewritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ten 1.x guides and status notes (~5,900 lines) that their own README marked as not current. Git history keeps them (last at tag v2.2.3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eslint.config.js: @eslint/js + typescript-eslint recommended on all
TypeScript, eslint-plugin-react-hooks recommended on client/src; no
stylistic rules; .js/.mjs/.cjs are not linted. New dev dependencies
(pinned, all released 2+ weeks ago): eslint 10.14.0, @eslint/js 10.0.1,
typescript-eslint 8.72.1, eslint-plugin-react-hooks 7.1.1.
First run: 23 problems, all fixed:
- react-hooks/set-state-in-effect (5), react-hooks/refs (5): the task
form mounts on every open instead of resetting state in an effect; the
run history and log pages derive their default selection; shortcut
handlers live in useState and the latest callback is set in a layout
effect.
- no-control-regex (5): three identical regexes become CONTROL_CHARS in
shared/cron.ts (task names: CONTROL_CHARS or tab, as before); two
justified disables remain.
- no-useless-escape, unused import/params, require() in a test,
preserve-caught-error (cause attached).
- Justified disables: Playwright's ({}, use) fixture form; the test
helper's JSON body type.
The three existing eslint-disable comments are all still needed (ESLint
reports unused directives; none were reported).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When nothing is shown, the Fleet page now says why: with filters set, "No job matches the filters." plus a Clear filters button; without filters, "Nothing is scheduled on any host yet." and, when the hub is the only host, a pointer to PITASKER_HOSTS. Before, both cases read "No job matches the filters.". New E2E test for the filter case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README in the shape of the other hexawulf repos: badges (CI, release, license, node), features, how it works, quick start, configuration, fleet agents, tests, deployment, security, layout. Release notes moved out (they are in CHANGELOG.md); no real hosts, addresses or emails. - SECURITY.md: how to report, scope, design notes. - Screenshots (tasks, fleet, tasks dark) from the E2E harness with a demo crontab (tests/fixtures/crontab.demo): npm run screenshots. The spec fails if a page shows anything that looks like a private address, an email or a non-demo host name. - engines: node >=22, .nvmrc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three comments in server/fleet/collector.ts and one test title named real hosts; a test used an address on a real domain (now example.net). Comment, title and test-data changes only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quality pass for 2.3.0: less duplicated code, lint in CI, two error-path fixes, one small feature, public-repo hygiene and a README in the style of the other hexawulf repos. No route, response shape, auth path, cookie/session name, CSP/Helmet setting or database schema changed, except where listed under Behaviour changes.
Before / after
Measured on the same machine (Node 24.22.3, npm 11.14.1, scratch PostgreSQL 18),
main=0a7dee5.tsc)npm audit(all /--omit=dev)dist/public/dist/index.js/dist/agent.mjsApp code stays flat although the branch adds a feature, three small modules and a component split: the removed duplicates pay for them.
Commits
refactor(server): onewrapWith()/writeOpts()(server/routes/http.ts),httpError()(server/errors.ts), crontab cache inserver/crontab/cache.ts.refactor(auth): oneisFirebaseEnabled(),httpError(), one service-account parse.chore(deps): drop the stalere2jsoverride (not in the tree; installed tree identical).fix(auth):firebase-loginanswers 500 for unexpected errors. New route test.fix(tasks): 404 instead of a 500/TypeError when a task is deleted during an update. New test.chore(security): placeholders instead of real emails, hosts and topology (.env.example, the 2.1 plan, comments).chore: removedocs/archive/.chore(lint): ESLint (recommended sets only) +npm run lintin CI; the 23 first-run problems fixed.feat(fleet): clearer empty states. New E2E test.docs: README rewrite,SECURITY.md, screenshots,engines+.nvmrc.chore(release): 2.3.0 (CHANGELOG entry says unreleased; set the date when tagging).chore(security): no host names in the remaining comments and test titles.Deleted
docs/archive/(10 files, 5,776 lines)v2.2.3)re2jsinoverridesnpm ls re2js --all: none; installed tree identical without itdrizzle.config.tsno-unused-varsuseEffectstate syncs (run history, logs) and the task-form reset effectreact-hooks/set-state-in-effectBehaviour changes
POST /api/auth/firebase-login: an error without a status (database, session store) used to be answered 401 with its raw message; now it is logged and answered 500 "Internal server error during Firebase login.". The verifier's own 400/401/403/503 answers are unchanged.PATCH /api/tasks/:id,POST /api/tasks/:id/runner,POST /api/tasks/:id/toggle-system-managed): if the task is deleted mid-update the answer is 404 "Task not found" instead of a 500.PITASKER_HOSTSwhen the hub is alone).[fleet]log line before the app's error handler.Not changed on purpose
PITASKER_ORIGINdefault inserver/middleware/sameOrigin.ts,PITASKER_BIN_MASTERdefault inserver/fleet/hosts.ts,/home/zk/bindefaults. Test inputs for the path guards also keep/home/zk.PITASKER_TZ=Asia/Taipei(asserted by the fleet tests) shows in the screenshots.docs/plans/2.0.md); every file this PR adds or edits was scanned clean of real host names, private IPs and emails.tests/e2e/fleet.spec.tsalready covers both views in both themes and at 390 px. No change made.SECURITY.mdworks either way. Turning it on (Settings → Code security) makes the Report a vulnerability path inSECURITY.mdavailable.Screenshots
Taken with
npm run screenshotsagainst the E2E harness (fake crontab withtests/fixtures/crontab.demo, scratch database, fixture fleet agents) running in a throwaway container with the host namedemo-hub. The spec refuses to capture a page that shows a private address, an email or a non-demo host name.Manual test checklist (after deploy)
/loginreturns 200; headers keep the CSP (Firebase hosts inscript-src,connect-src,frame-src),Referrer-Policy: strict-origin-when-cross-origin, and noCross-Origin-Opener-Policy./login.pm2 logs pitasker --lines 50 --nostreamshows no errors.v2.3.0, set the CHANGELOG date, GitHub release.🤖 Generated with Claude Code