ratchet report - xopherdeep/do-it-for-the-xp GitHub Wiki
Status: DONE_WITH_CONCERNS. Every regression in the brief is gone; the whole-project gate still fails on two regressions that come from the parallel Task 11 builder's in-progress files (not touched, see Concerns).
Before (chemx audit at the worktree root, my first run):
gate: fail (ratchet)
regression: AI_SLOP_REDUNDANT_PASSTHROUGH 0 -> 5
regression: CONTROL_FLOW_DISPATCH_SWITCH 36 -> 38
regression: CONTROL_FLOW_INLINE_BOOLEAN 8 -> 22
regression: LINE_BUDGET_FILE 39 -> 40
After (last run, 19:30, with Task 11's files in the tree as they stood then):
gate: fail (ratchet)
regression: COMPLEXITY_CYCLOMATIC_HIGH 27 -> 28
regression: CONTROL_FLOW_INLINE_BOOLEAN 8 -> 9
Counts from the full JSON audit for the four brief rules: AI_SLOP_REDUNDANT_PASSTHROUGH 0, CONTROL_FLOW_DISPATCH_SWITCH 36,
LINE_BUDGET_FILE 39 (all back at baseline), CONTROL_FLOW_INLINE_BOOLEAN 9 = the 8 old ones + src/lib/services/copy/credits.ts:106
(Task 11, new untracked file). None of the 14 INLINE_BOOLEAN sites of this task remain. The COMPLEXITY_CYCLOMATIC_HIGH
regression is src/app/Admin/XpApprovals/XpApprovals.vue:336 (13 > 12), also Task 11's work in progress (the file is
modified by the other builder; I never touched it).
The per-file lines came from chemx audit --json --full (the violations array: filePath, line, rule); chemx q --hazards in
this chemx build ignores the flag and chemx audit <dir> only prints counts.
-
AI_SLOP_REDUNDANT_PASSTHROUGH (5): returned the expression directly.
-
src/lib/databases/ProjectDb.tsisRecord:return typeof id === "string" && typeof status === "string"; -
src/lib/engine/dungeons/generator/templeSolver.tswaitsOnFloor: expression-bodied arrow, noisItsStairs. -
src/lib/services/projects/projectChores.tsrangeHolds:return size >= low && size <= high; -
src/lib/services/projects/projectQuests.tsneedsApproval:return hasChild && !hasGrownUp; -
src/lib/services/projects/projectTower.tsphaseDrafts: thefiltercallback is an expression (chore.roomId === room.id && chore !== boss).
-
-
CONTROL_FLOW_DISPATCH_SWITCH (2 new switches). The brief named the travel.ts switch as
switch (lock)at ~L71, but the L71 switch isswitch (kind)indoorActionsand it predates the feature (the Task 5 review diff does not touch it). The switch the branch added isswitch (lock)incanOpenClimb(~L153), so that is the one I replaced. The count came back to exactly 36, which confirms the L71 switch was part of the baseline and is left alone.-
templeSolver.tspassable:PASSES: Record<LockKind, Passes>(none, small, master, bomb, floorCleared) andpassableisPASSES[door.lock](door, opened, carried). ARecord<LockKind, ...>makes TypeScript demand every kind, as the exhaustive switch did. Unused handler arguments are_-prefixed (eslintargsIgnorePattern: "^_"). -
travel.tscanOpenClimb:HOLDS_WHAT_LOCK_WANTS: Record<ClimbLock, (templeId) => boolean>(small key count, Boss Key, floorCleared always false) andcanOpenClimbindexes it.temples()is still read inside each handler at call time.
-
-
CONTROL_FLOW_INLINE_BOOLEAN (14): named each condition in a
constbefore itsif.-
floorBonus.ts:45hasNoWorkers -
projectChores.tsisPoolEmpty(144),isTeamChore(186),hasNoHeroes(195) -
projectSchedule.tsisLastPhase(30),isTooShort(60),hasNoPhases(68),isBeforeToday(92) -
projectTower.tshasStray(90),hasNoFinale(92),hasManyFinales(93),holdsNothing(110) -
travel.tsisKeyLock(132,lockLine) andisFloorLock(143,lockToOpen). Both guard a never-reassignedconstor parameter, so TypeScript 5.9 still narrows through the alias (the repo'sclimbalready relies on this withisFloorShut). Not typechecked by me (not allowed): the lead's typecheck should confirmCLIMB_LOCK_LINES[lock]inlockLinestill narrows.
-
-
LINE_BUDGET_FILE:
src/lib/engine/quests/QuestSchedule.ts519 -> 500 lines. New siblingsrc/lib/engine/quests/projectQuestSchedule.ts(pure, no Vue, no storage) holds:-
isProjectQuest(moved as is; QuestSchedule.ts imports it and re-exports it withexport { isProjectQuest } from "./projectQuestSchedule";, so every importer is unchanged); -
isProjectQuestAwake(quest)=Boolean(quest.project.wokenAt)(was inline inisQuestActiveOn); -
oneOffDueDayOf(quest, starts, day)(was the private helper in QuestSchedule.ts; the caller now passesparseDate(quest.startsOn)becauseparseDatestays private to QuestSchedule.ts, which avoids a circular import). In QuestSchedule.ts: theparseLocalDateandProjectQuestLinkimports are gone, thedeadlineDayOfdoc's project sentence is folded into the "once" bullet (3 lines to 2), and the doc comment Task 1 added onisQuestActiveOnis dropped (the original had none; its sentence now lives onisProjectQuestAwake). That doc was the last line needed to reach 500. The file sits at exactly 500, so it has no headroom: the next line added to it trips the rule again. No behaviour change.
-
Before my edits: All tests passed (619 passed in 84673ms).
After my edits: All tests passed (619 passed in 73904ms).
Files: ProjectDb, FloorClearedClimb, TowerFloorLock, projectChores, projectQuests, projectTower, floorBonus, projectSchedule,
QuestScheduleProjectQuests, plus QuestSchedule, TempleSolver and TempleSystemDoors (the brief's "specs that exist" for
QuestSchedule, templeSolver and the door code; there is no spec named after roomInteractions/travel, FloorClearedClimb covers it).
No typecheck or lint run (the brief reserves them for the lead).
- src/lib/databases/ProjectDb.ts
- src/lib/engine/dungeons/generator/templeSolver.ts
- src/lib/engine/quests/QuestSchedule.ts
- src/lib/engine/quests/projectQuestSchedule.ts (new, untracked: the lead must add it)
- src/lib/services/projects/floorBonus.ts
- src/lib/services/projects/projectChores.ts
- src/lib/services/projects/projectQuests.ts
- src/lib/services/projects/projectSchedule.ts
- src/lib/services/projects/projectTower.ts
- src/lib/services/temples/roomInteractions/travel.ts
- The gate is not
passyet, only because of Task 11's files:src/lib/services/copy/credits.ts:106(if (mine.length === 0) return [];inheroCredits: needsconst hasNoWork = mine.length === 0;) andsrc/app/Admin/XpApprovals/XpApprovals.vue:336(cyclomatic complexity 13, limit 12). Both belong to the parallel builder (@sonnet-pt11 holds the locks on its neighbours); I did not touch them. After they are fixed,chemx auditshould printgate: pass. -
chemx-ratchet.jsonshows as modified ingit status(ruleset 6 -> 11, new SECURITY_WP_* entries, alanguageslist). Its mtime is 19:06:38, before my first audit run at about 19:16, so I did not write it; I ranchemx auditwithout--rebaseline. The lead should decide whether to keep or revert it before committing by path (do not commit it with these files). - Local chemx is the starter-kit working copy and CI uses the published pin (memory note): the rule set can differ, so the lead may want to confirm the final gate with the pinned version.
- I edited with the Edit/Write tools, not
chemx patch; I only rangit statusandchemx dfor reading. A hook flagged one out-of-band edit ofsrc/lib/services/widgets/widgetDataExtractor.tsduring my last call: that is not my file, it is a peer's write. - Locks: acquired and released on all ten files (the new file needed
--new).