Fix all RULES.md divergences #2
Reference in New Issue
Block a user
Delete Branch "fix/rules-audit-divergences"
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?
Addresses 3 items from the RULES.md audit (#1):
balanceLine(): Add fallback when USD price is unavailable orformatUsd()returns empty, preventing layout shiftisoDate/timeAgo: Move shared functions fromhome.jsandtransactionDetail.jsintohelpers.js, import from bothItems 2 (DEBUG log threshold), 4 (timestamp display), and 5 (mnemonic naming) left as-is per review.
All checks pass (
make check+docker build).02eefa8f80to2244b52f5fmake checkoutputdocker build .also succeeds.Code Review — PR #2
make checkpasses (14 tests, lint clean, fmt clean).Changes reviewed:
helpers.js—isoDate/timeAgodeduplication: Moved fromhome.jsandtransactionDetail.jsinto sharedhelpers.js. Logic is identical to the originals. Exported and imported correctly in both consumers. ✅helpers.js:88—balanceLine fallback: Changed from""toformatUsd(amount * price) || " "with" "as the else-branch. This matches the RULES.md "No Layout Shift" requirement (formatUsd(null)returns""— callers must use fallback). ✅RULES.md— External Communication update: "exactly two" → "exactly three" to include Blockscout block-explorer API. Matches the actual external services the extension contacts. ✅Findings:
LGTM — no issues found. Clean dedup, correct layout-shift fix, accurate docs update.
ok, update RULES with a notice at the top that it is never to be changed by agents.
leave this change in.
update the README to document the use of the third service and exactly what information is sent.
On it — will:
Pushing shortly.
Pushed two commits:
Please remember to add
docker build .as a pre-commit hook after checking out any repo that contains aDockerfile.Noted — adding that to my PR checklist now. Will ensure all sub-agents run
docker build .before pushing on any repo with a Dockerfile.Noted — will add
docker build .to my checkout procedure for any repo with a Dockerfile. Adding to my PR checklist.Ok, now figure out why this one's docker build is failing.
Fixed — the docker build was failing because README.md and RULES.md (which I edited earlier) had Prettier formatting issues. Pushed a formatting commit.
docker build .now passes.CI is passing now on the latest commit (
31b22c1):check / check (push) — Successful in 21s. Docker build also passes locally.If it was failing on an earlier commit, the latest pushes (RULES.md agent notice + README Blockscout docs) may have resolved whatever was wrong. Unfortunately I can't read CI job logs on Gitea 1.22.3 to confirm what the earlier failure was — that API lands in a newer version (upgrading tomorrow).