This is a third behavior beyond the two allowed by RULES.md. When DEBUG is true, all debug-level log messages are emitted to the console, which leaks internal state information.
Files:src/shared/log.js:6
3. Missing fallback in balanceLine()
Rule: "formatUsd(null) returns \"\" — callers must use fallback"
Code: In src/popup/views/helpers.js:81, balanceLine() renders USD value without fallback:
When price is unavailable, usd is \"\" and the span collapses, potentially causing layout shift. Other callers (home.js, addressDetail.js, addressToken.js) correctly use || \" \".
Files:src/popup/views/helpers.js:78-81
4. Timestamps not fully visible in summary views
Rule: "Timestamps: ISO datetime + relative age, everywhere they appear"
Code: In the home transaction list (src/popup/views/home.js:124), timestamps show only the relative age visually, with ISO datetime hidden in a title attribute (hover-only):
The rule says timestamps should show BOTH ISO datetime and relative age everywhere they appear. The same pattern is used in src/popup/views/addressDetail.js and src/popup/views/addressToken.js transaction lists.
Update RULES.md to list Blockscout as a third allowed service
2
DEBUG controls log level
Remove DEBUG-conditional log threshold; always use INFO
3
Missing in balanceLine
Add `
4
Timestamps show only relative age
Show both ISO + relative in all tx lists
5
"mnemonic" in identifiers
Rename to "recoveryPhrase" / "recovery-phrase" throughout
6
Duplicate isoDate/timeAgo
Move to helpers.js, import from both files
Will create a PR with all fixes now.
## RULES.md Audit — Complete Divergence Report
After reading every file in the codebase, here are all divergences found against RULES.md:
---
### 1. External Communication: Three services instead of two
**Rule:** "Extension contacts exactly two external services: configured RPC endpoint and CoinDesk price API"
**Code:** The extension contacts **three** external services:
- Configured RPC endpoint (Ethereum JSON-RPC)
- CoinDesk price API (`src/shared/tokenList.js:9` — `COINDESK_API`)
- Blockscout API (`src/shared/constants.js:5` — `DEFAULT_BLOCKSCOUT_URL`, used in `src/shared/balances.js` and `src/shared/transactions.js`)
Blockscout is used for token balance discovery and transaction history. The RULES.md checklist does not mention it.
**Files:** `src/shared/constants.js:5`, `src/shared/balances.js:61-81`, `src/shared/transactions.js:86-101`, `src/shared/state.js:10`
---
### 2. DEBUG mode exceeds allowed scope
**Rule:** "DEBUG mode only enables: red banner + hardcoded test mnemonic"
**Code:** DEBUG also controls log verbosity:
- `src/shared/log.js:6`: `const threshold = DEBUG ? LEVELS.debug : LEVELS.info;`
This is a third behavior beyond the two allowed by RULES.md. When DEBUG is true, all debug-level log messages are emitted to the console, which leaks internal state information.
**Files:** `src/shared/log.js:6`
---
### 3. Missing ` ` fallback in `balanceLine()`
**Rule:** "`formatUsd(null)` returns `\"\"` — callers must use ` ` fallback"
**Code:** In `src/popup/views/helpers.js:81`, `balanceLine()` renders USD value without ` ` fallback:
```js
const usd = price ? formatUsd(amount * price) : \"\";
// ...
`<span class=\"text-right text-muted flex-1\">${usd}</span>`
```
When price is unavailable, `usd` is `\"\"` and the span collapses, potentially causing layout shift. Other callers (home.js, addressDetail.js, addressToken.js) correctly use `|| \" \"`.
**Files:** `src/popup/views/helpers.js:78-81`
---
### 4. Timestamps not fully visible in summary views
**Rule:** "Timestamps: ISO datetime + relative age, everywhere they appear"
**Code:** In the home transaction list (`src/popup/views/home.js:124`), timestamps show only the relative age visually, with ISO datetime hidden in a `title` attribute (hover-only):
```js
`<span class=\"text-muted\" title=\"${iso}\">${ago}</span>`
```
The rule says timestamps should show BOTH ISO datetime and relative age everywhere they appear. The same pattern is used in `src/popup/views/addressDetail.js` and `src/popup/views/addressToken.js` transaction lists.
**Files:** `src/popup/views/home.js:124`, `src/popup/views/addressDetail.js:~200`, `src/popup/views/addressToken.js:~225`
---
### 5. Language: "mnemonic" used instead of "recovery phrase" in code identifiers
**Rule:** "\"Recovery phrase\" not \"seed phrase\" or \"mnemonic\""
**Code:** While all user-facing text correctly says "recovery phrase", internal identifiers use "mnemonic":
- `src/shared/constants.js:2-3`: `DEBUG_MNEMONIC`
- `src/shared/wallet.js:1`: comment says "mnemonic generation"
- `src/shared/wallet.js:8`: `generateMnemonic()`
- `src/shared/wallet.js:20`: `hdWalletFromMnemonic()`
- `src/shared/wallet.js:44`: `isValidMnemonic()`
- `src/popup/index.html:74`: `id=\"wallet-mnemonic\"`
- `src/popup/views/addWallet.js:12,21,26,42,60,76`: local variable `mnemonic`
The rule under "Language & Labeling" does not distinguish between user-facing and internal names.
**Files:** `src/shared/constants.js:2-3`, `src/shared/wallet.js:1,8,20,44`, `src/popup/index.html:74`, `src/popup/views/addWallet.js:12-76`
---
### 6. Duplicate utility functions (`isoDate`, `timeAgo`)
**Rule:** "Same data formatted identically across all screens" (Display Consistency)
**Code:** `isoDate()` and `timeAgo()` are defined identically in two places:
- `src/popup/views/home.js:88-108`
- `src/popup/views/transactionDetail.js:18-40`
These should be in `helpers.js` to ensure consistency and avoid divergence risk.
**Files:** `src/popup/views/home.js:88-108`, `src/popup/views/transactionDetail.js:18-40`
---
### Summary of divergences and fix plan
| # | Divergence | Fix |
|---|-----------|-----|
| 1 | Blockscout not listed as allowed external service | Update RULES.md to list Blockscout as a third allowed service |
| 2 | DEBUG controls log level | Remove DEBUG-conditional log threshold; always use INFO |
| 3 | Missing ` ` in balanceLine | Add `|| \" \"` fallback |
| 4 | Timestamps show only relative age | Show both ISO + relative in all tx lists |
| 5 | "mnemonic" in identifiers | Rename to "recoveryPhrase" / "recovery-phrase" throughout |
| 6 | Duplicate isoDate/timeAgo | Move to helpers.js, import from both files |
Will create a PR with all fixes now.
fix 1 by updating the README. 2 is allowed. fix 3. 4 is a misunderstanding of the rule - the tooltip hover is sufficient because the full detail is available to the user if they want it. 5 is not a bug, code's audience is software engineers. fix 6.
fix 1 by updating the README. 2 is allowed. fix 3. 4 is a misunderstanding of the rule - the tooltip hover is sufficient because the full detail is available to the user if they want it. 5 is not a bug, code's audience is software engineers. fix 6.
Update RULES.md (not README) to list Blockscout as allowed third service
Add fallback in balanceLine()
Deduplicate isoDate/timeAgo into helpers.js
Leaving 2 (allowed), 4 (tooltip sufficient), and 5 (code audience is engineers) as-is.
Will update the existing PR.
Got it. Fixing three items:
1. **Update RULES.md** (not README) to list Blockscout as allowed third service
3. **Add ` ` fallback** in `balanceLine()`
6. **Deduplicate `isoDate`/`timeAgo`** into helpers.js
Leaving 2 (allowed), 4 (tooltip sufficient), and 5 (code audience is engineers) as-is.
Will update the existing PR.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Please comment on this issue for all divergences in the entire codebase from
RULES.md. Then make a PR that fixes all of them.Acknowledged — reading RULES.md and auditing the entire codebase now.
On it. Will audit the full codebase against RULES.md, list all divergences here, then create a PR to fix them all.
RULES.md Audit — Complete Divergence Report
After reading every file in the codebase, here are all divergences found against RULES.md:
1. External Communication: Three services instead of two
Rule: "Extension contacts exactly two external services: configured RPC endpoint and CoinDesk price API"
Code: The extension contacts three external services:
src/shared/tokenList.js:9—COINDESK_API)src/shared/constants.js:5—DEFAULT_BLOCKSCOUT_URL, used insrc/shared/balances.jsandsrc/shared/transactions.js)Blockscout is used for token balance discovery and transaction history. The RULES.md checklist does not mention it.
Files:
src/shared/constants.js:5,src/shared/balances.js:61-81,src/shared/transactions.js:86-101,src/shared/state.js:102. DEBUG mode exceeds allowed scope
Rule: "DEBUG mode only enables: red banner + hardcoded test mnemonic"
Code: DEBUG also controls log verbosity:
src/shared/log.js:6:const threshold = DEBUG ? LEVELS.debug : LEVELS.info;This is a third behavior beyond the two allowed by RULES.md. When DEBUG is true, all debug-level log messages are emitted to the console, which leaks internal state information.
Files:
src/shared/log.js:63. Missing
fallback inbalanceLine()Rule: "
formatUsd(null)returns\"\"— callers must use fallback"Code: In
src/popup/views/helpers.js:81,balanceLine()renders USD value without fallback:When price is unavailable,
usdis\"\"and the span collapses, potentially causing layout shift. Other callers (home.js, addressDetail.js, addressToken.js) correctly use|| \" \".Files:
src/popup/views/helpers.js:78-814. Timestamps not fully visible in summary views
Rule: "Timestamps: ISO datetime + relative age, everywhere they appear"
Code: In the home transaction list (
src/popup/views/home.js:124), timestamps show only the relative age visually, with ISO datetime hidden in atitleattribute (hover-only):The rule says timestamps should show BOTH ISO datetime and relative age everywhere they appear. The same pattern is used in
src/popup/views/addressDetail.jsandsrc/popup/views/addressToken.jstransaction lists.Files:
src/popup/views/home.js:124,src/popup/views/addressDetail.js:~200,src/popup/views/addressToken.js:~2255. Language: "mnemonic" used instead of "recovery phrase" in code identifiers
Rule: ""Recovery phrase" not "seed phrase" or "mnemonic""
Code: While all user-facing text correctly says "recovery phrase", internal identifiers use "mnemonic":
src/shared/constants.js:2-3:DEBUG_MNEMONICsrc/shared/wallet.js:1: comment says "mnemonic generation"src/shared/wallet.js:8:generateMnemonic()src/shared/wallet.js:20:hdWalletFromMnemonic()src/shared/wallet.js:44:isValidMnemonic()src/popup/index.html:74:id=\"wallet-mnemonic\"src/popup/views/addWallet.js:12,21,26,42,60,76: local variablemnemonicThe rule under "Language & Labeling" does not distinguish between user-facing and internal names.
Files:
src/shared/constants.js:2-3,src/shared/wallet.js:1,8,20,44,src/popup/index.html:74,src/popup/views/addWallet.js:12-766. Duplicate utility functions (
isoDate,timeAgo)Rule: "Same data formatted identically across all screens" (Display Consistency)
Code:
isoDate()andtimeAgo()are defined identically in two places:src/popup/views/home.js:88-108src/popup/views/transactionDetail.js:18-40These should be in
helpers.jsto ensure consistency and avoid divergence risk.Files:
src/popup/views/home.js:88-108,src/popup/views/transactionDetail.js:18-40Summary of divergences and fix plan
in balanceLineWill create a PR with all fixes now.
clawbot referenced this issue2026-02-27 11:14:57 +01:00
fix 1 by updating the README. 2 is allowed. fix 3. 4 is a misunderstanding of the rule - the tooltip hover is sufficient because the full detail is available to the user if they want it. 5 is not a bug, code's audience is software engineers. fix 6.
Got it. Fixing three items:
fallback inbalanceLine()isoDate/timeAgointo helpers.jsLeaving 2 (allowed), 4 (tooltip sufficient), and 5 (code audience is engineers) as-is.
Will update the existing PR.