Repository navigation
fix(dashmate): make doctor's masternode, node-ID and container checks fire, and write a Windows-safe report archive - #6317
Conversation
…r the right names The Core status sample destructured the RPC results in the wrong order: `masternodeStatus` received the `mnsync status` response and `masternodeSyncStatus` the `masternode status` one. Every analyser that reads them (PoSe state, sync progress, the evonode node-ID check) judged the wrong data, so none of those problems was ever reported. The test uses `masternode status` and `mnsync status` responses captured from a Dash Core v24.0.3 regtest node running a registered evonode. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… spells it Doctor's node-ID check read `dmnState.platformNodeId`, but Dash Core's `masternode status` returns it as `dmnState.platformNodeID`. The value was always undefined, so an evonode whose Tenderdash node key does not match the one registered on chain was never reported. The tests use the `masternode status` response captured from a Dash Core v24.0.3 evonode, both against the analyser directly and through sample collection. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…array systeminformation returns `si.dockerContainerStats(id)` resolves with an array holding one entry per requested container, but the container analyser read `cpuStats` and `memoryStats` off it as if it were the entry itself. Both were always undefined, so high CPU or memory use by a service was never reported. The analyser now takes the single entry, and reports nothing when Docker returned no stats for the container. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The archive name embedded the ISO collection time, whose ':' characters are not allowed in Windows file names. The name now uses the same timestamp with ':' replaced by '-'; the exact time is still recorded in the archive's date sample, which is what an analysis reads. `archiveSamples` now returns the path it wrote, so `doctor report` prints the archive it actually created instead of rebuilding the name itself. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tar opens the archive file before it reads the samples, so a failure while packing (an unreadable sample, a full disk) left a truncated `.tar.gz` in the working directory that looks like a report. The partial file is now removed before the error is rethrown. Test would have caught this in CI: ✖ before fix, ✔ after. It is skipped when run as root, which reads a file whatever its mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit 4c87688) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
This PR corrects Dashmate doctor’s Core sample names, reads the registered Platform node ID and Docker stats in the shapes their sources return, and gives report archives Windows-safe filenames with cleanup on packing failure. Dashmate tests, all three Dashmate E2E jobs, JS lint, and the main Platform test suite passed; one browser shard was still running.
🟡 7 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.2-sol(effort low) — The behavioral changes are small and contained within Dashmate diagnostics and local report archiving, with focused regression tests for each fix. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(zai below 15% reserve: 5h 100% left, weekly 0% left) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:61-75: Failed report packing can delete an existing report or hide the original error
Impact: An operator can lose a report already at the destination if tar cannot open it for writing but cleanup can delete it, or see a cleanup error instead of the packing failure.
The catch unconditionally removes the final path even when this invocation never opened it. In tar 7.5.22, both output-open errors and pack errors reject `create()`, and the pack-error handler does not close the output stream. `rmSync({ force: true })` suppresses a missing path, not removal errors, so a cleanup failure also prevents `throw e` from running. Pack into a uniquely owned temporary output in the destination directory, close the writer on failure, and publish the final name only after packing and closing succeed. Test that a failure preserves both an existing report and the original error.
In `packages/dashmate/src/doctor/analyse/analyseServiceContainersFactory.js`:
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseServiceContainersFactory.js:28-31: Doctor can miss current CPU saturation after a quiet period
Impact: An operator investigating a saturated Dashmate container can get no CPU warning because the host’s earlier CPU time dominates the calculation.
Reading the first stats entry makes the warning reachable, but the check at lines 57–63 divides cumulative container CPU time by cumulative host CPU time. Those counters can start at different times, and their ratio does not measure the load when doctor ran. The locked `systeminformation` version exposes both `cpuStats` and `precpuStats`; use the paired container and host deltas to preserve the 80% share-of-host threshold, and skip samples without a valid interval. Its `cpuPercent` is scaled by CPU count on Linux and is not a drop-in substitute. Test a saturated interval whose cumulative ratio is still low.
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseServiceContainersFactory.js:31: One non-array Docker stats sample stops analysis of the entire report
Impact: An operator or support engineer opening an otherwise readable report with an object-valued `dockerStats` sample gets no diagnosis.
The archive reader parses each sample and stores it without checking its shape, so a JSON object can reach this line even though live collection returns an array. Destructuring it throws before the inspect guard and prevents doctor from returning any findings. Check `Array.isArray` before taking the first entry and treat other values as missing stats so the inspect data and remaining samples still get analysed.
In `packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js`:
- [SUGGESTION] packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js:459: Doctor says Core is still syncing blocks while it is syncing governance data
Impact: Operators running doctor during governance sync can be told to wait for blockchain sync even when block verification is already at 100%.
The corrected mapping now reaches `analyseCoreFactory`, where `IsSynced === false` triggers a blockchain-specific message and percentage. Dash Core v24.0.3 sets `IsBlockchainSynced` when it leaves the blockchain stage but keeps `IsSynced` false until governance sync finishes. Gate the blockchain message on `IsBlockchainSynced === false` and test the case where the two flags differ. If later stages need a warning, report their progress separately.
- [SUGGESTION] packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js:459-460: Older reports still miss Core warnings even when they contain the right RPC responses
Impact: Support staff replaying a report collected before this fix can miss PoSe, node-ID, or sync warnings without knowing the archive already contains the relevant data.
`doctor --samples` bypasses collection, and the archive reader restores sample keys directly from filenames. An older report therefore still has the `mnsync` payload under `masternodeStatus`; an evonode report can also have the status payload under `masternodeSyncStatus`. Recognize the legacy payloads in the archive reader and restore them under the correct keys without overwriting correctly named samples. Include a replay case for a fullnode report, which may contain only the misplaced sync response.
In `packages/dashmate/src/doctor/analyse/analyseConfigFactory.js`:
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseConfigFactory.js:92-93: Doctor misses a wrong Tenderdash key when the saved node ID still matches
Impact: An evonode operator who changes only the Tenderdash key can get no node-ID warning even though the running node uses a different peer ID from the one registered on chain.
`dashmate config set` can update the key without changing the saved ID: `ensureTenderdashNodeKey` returns when both fields are present. Tenderdash 2.0.0-dev.3 derives its runtime ID from the key’s public half, but this comparison reads only the saved label. The new tests change both fields together or set only the ID, so neither exercises the mismatch. Compare Core’s registration with `node_info.id` from the Tenderdash `status` response doctor already collects; when the service is down, the collector can derive the configured public ID before redacting the key. Test a matching saved ID with a different key.
In `packages/dashmate/test/unit/doctor/archiveSamples.spec.js`:
- [SUGGESTION] packages/dashmate/test/unit/doctor/archiveSamples.spec.js:61-78: The archive cleanup test expects a read failure that Windows does not produce
Impact: Developers running the Dashmate unit suite on Windows can see the new test fail because tar reads the sample successfully instead of rejecting with `EACCES`.
The UID guard skips root but not Windows, where `process.getuid` is absent and Node’s `chmodSync` can change write permission but cannot revoke read permission this way. The setup also redirects only `TMPDIR`, which Windows `os.tmpdir()` ignores, so the staged files fall outside the directory the test removes. Inject a packing failure after output starts and keep staging under the test-owned directory so the regression test works without POSIX permissions.
Out-of-scope follow-up suggestions (2)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- The OOM warning names the wrong services — The OOM branch formats the not-started list, so an operator can see unrelated services named or no service named at all. This path already ran independently of the stats change.
- Follow-up: Fix the OOM message in a follow-up PR and test a report with different stopped and OOM-killed services.
- Report staging files remain in the OS temporary directory — Staged diagnostic data, including potentially large service logs, remains on disk after successful and failed reports. This predates the archive publication change.
- Follow-up: Use a private per-run staging directory and remove it after packing, including on failure.
|
Bots are done — your move: post |
…tor report fails When packing failed, the cleanup removed whatever was at the report's path, even a report this run never wrote, and a failing cleanup replaced the packing error with its own. The archive is now packed under a name only this run uses and renamed into place once complete. A failure removes only that file, closes it first so it can be removed, and always rethrows the packing error. Tests would have caught this in CI: ✖ before fix, ✔ after (an existing report at the destination is kept; the packing error survives a failing cleanup). Co-Authored-By: Claude Opus 5.5 <[email protected]>
These tests make packing fail by revoking read access to a staged sample with a file mode, which Windows does not honour, so tar reads the file and the expected failure never happens. They are now skipped there as well as for root. Test-only change, no behaviour delta. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tead of failing doctor An archived report is read back without checking each sample's shape, so a `dockerStats` sample that is not an array reached the destructuring and threw, and doctor returned no findings for the whole report. Anything other than an array now counts as no stats, and the rest of the report is still analysed. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cing blocks Doctor reported "Core is syncing blockchain data" whenever `mnsync status` had `IsSynced` false. Core keeps that false after the blocks are in, until it has also fetched governance data, so a node with block verification at 100% was told to wait for a block sync that had finished. The block sync message now depends on `IsBlockchainSynced`, and the governance stage is reported on its own, at low severity. The tests use `mnsync status` responses captured from a Dash Core v24.0.3 regtest node in the blockchain, governance and finished stages. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…saved ID, against the registration Doctor compared the registered Platform node ID with the saved `platform.drive.tenderdash.node.id`. Tenderdash takes its ID from the node key, and `config set` can change the key without updating the saved ID, so a node running with a key that does not match its registration was not reported. The key is redacted from the report, so the collector now records the ID derived from it (public, Tenderdash announces it to every peer) and the check compares that. Reports from older versions, which lack it, fall back to the saved ID. Tests would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: The follow-up commits make Dashmate pack reports before publishing them, tolerate unexpected Docker stats, distinguish Core block sync from governance sync, and derive the configured Tenderdash peer ID before redacting the key. Current CI shows the JS build and lint, Dashmate unit and E2E tests, and the Platform suite including both browser shards passed; review and PR Hygiene checks remain pending.
🟡 4 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Still open from earlier rounds (1)
- 🟡 Suggestion: Older reports still miss Core warnings even when they contain the right RPC responses —
packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js:471-472(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The PR changes several diagnostic paths and the report archive write lifecycle, but it does not change how node keys are generated or used by the network, or alter any other critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js`:
- [SUGGESTION] packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js:143-148: Doctor aborts when the optional Tenderdash key is omitted
Impact: An evonode operator whose configuration has a saved Tenderdash ID but omits the key gets neither a diagnosis nor an archive.
Both `dashmate doctor` and `dashmate doctor report` stop in the Configuration task before collecting service diagnostics. The schema requires the `node` object, not its `key` or `id` fields. `config set` can save an ID-only object, and `ensureTenderdashNodeKey` leaves it alone for a masternode rather than generating an unregistered identity. `Config.get()` throws on the missing leaf before the new `typeof` guard runs. Read `.key` from the required `node` object. In `analyseConfigFactory.js`, read the optional `.id` the same way and evaluate that fallback only when Core supplies a registered ID.
- [SUGGESTION] packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js:471-472: Older reports still miss Core warnings even when they contain the right RPC responses
(carried; thread: https://github.com/dashpay/platform/pull/6317#discussion_r4704035067)
In `packages/dashmate/src/doctor/analyse/analyseConfigFactory.js`:
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseConfigFactory.js:93-98: Doctor can clear the node-ID warning before Tenderdash loads the corrected key
Impact: An evonode operator who corrects the configured key and runs doctor before restarting Tenderdash can lose the warning while peers still see the wrong ID.
A correctly configured key can now clear the warning even when Tenderdash is still using the old key. `config set` saves the config and renders `node_key.json` without restarting the service, and Tenderdash v2.0.0-dev.3 loads its key at startup. The new comparison prefers the configured key over the saved ID but never reads the running ID, even though the collector already records it at `status.value.result.node_info.id` when the RPC succeeds. Compare both IDs with Core's registration when available so doctor can distinguish a pending restart from a key that still needs correcting.
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:66-84: A failed report rename can leave a readable diagnostic archive behind
Impact: An operator whose report cannot be published can be left with an unannounced `.partial` archive containing RPC credentials that other local users can read if permissions allow.
The command can fail after writing a complete report and leave it in the output directory. The pipeline closes the writer before `renameSync`, but that rename is outside the cleanup guard; for example, it fails if the destination path is a directory. The `wx` flag makes creation exclusive, not private, and the archive includes Docker inspect data with Core RPC credentials in `Config.Env`. Reserve a private temporary location beside the destination and cover both packing and publication with best-effort cleanup that preserves the original error. Clean up only output this invocation acquired: the current handler also attempts removal if `wx` failed because the path already existed. Add a regression test for a rename failure after successful packing.
Out-of-scope follow-up suggestions (2)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Successful doctor reports include Core RPC credentials from Docker inspect — The collector masks the operator's identity but archives the full inspect object, including
Config.Env. Drive ABCI and DAPI receive Core RPC credentials through those environment variables, so sharing a successfully published report can disclose them.- Follow-up: Open a follow-up PR to allowlist the inspect fields doctor needs and test that exported reports omit service credentials.
- Doctor leaves staged samples in a predictable system temporary directory — Report staging reuses a timestamp-derived directory under
os.tmpdir(), writes samples through existing paths, and leaves the directory behind. In a shared temporary directory, that can expose diagnostics or let existing filesystem entries interfere with collection. The new random suffix applies only to the compressed output.- Follow-up: Open a follow-up PR to stage each report in a private, exclusively created directory and remove it on success and failure.
|
Bots are done — your move: post |
The schema requires the Tenderdash `node` object but neither the `key` nor the `id` in it, and a masternode is never given a generated key, so a config can hold only the saved ID. Reading `node.key` through `Config.get` threw on the missing leaf and aborted doctor before it collected anything; the analyser's fallback read of `node.id` threw the same way for a config with neither. Both are now read off the node object, the saved ID is used when there is no key, and the fallback is only evaluated when Core reports a registered ID. Tests would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…med into place The rename that publishes a packed report sat outside the cleanup guard, so a failed rename (the destination path taken by a directory, say) left the complete archive behind under its temporary `.partial` name. The rename now runs inside the guard: the temporary file is removed and the rename error is rethrown. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cleanup after a failed report removed the temporary `.partial` path even when the exclusive open had failed because that path already existed, so it deleted a file another run owned. The file is now opened synchronously before the cleanup guard, so a refused open throws without removing anything. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed node key is not loaded yet Tenderdash loads its node key at startup, and `config set` does not restart it. After the key was corrected in the config, doctor's node-ID check cleared while the running node still used the old ID. When the configured key matches the registration, doctor now also compares the ID from the Tenderdash `status` sample it already collects, and says a Platform restart is needed when they differ. The test uses a `status` response captured from Tenderdash 2.0.0-dev.3, whose `node_info.id` matches what `deriveTenderdashNodeId` gives for that node's key. The restart is recorded in the restart-advice allow-list with its reason: Tenderdash reads its node key only at startup, and nothing else loads it. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: Dashmate doctor now handles configurations without a Tenderdash key, compares the running node ID with Core’s registration, and cleans up its own temporary archive when publication fails. CI passed the Dashmate tests, all three Dashmate E2E jobs, JavaScript lint, the main Platform suite, and both browser shards; only review and hygiene checks remain pending.
🟡 2 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Still open from earlier rounds (1)
- 🟡 Suggestion: A failed report rename can leave a readable diagnostic archive behind —
packages/dashmate/src/doctor/archiveSamples.js:70(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The PR changes several diagnostic paths and the archive write lifecycle, but does not modify consensus, funds movement, or cryptographic behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/doctor/analyse/analyseConfigFactory.js`:
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseConfigFactory.js:111-123: Doctor recommends a Tenderdash restart when only the saved node ID matches
Impact: An evonode operator whose saved ID matches the registration but whose key is missing can stop a running Tenderdash by following advice that leaves it unable to start again.
Following this advice can turn a running-ID mismatch into a startup failure. `config set` accepts and renders an ID-only `node` object without restarting Tenderdash, and `ensureTenderdashNodeKey` deliberately leaves a missing evonode key unset. When the old process reports a different ID, the new branch treats a matching saved ID as proof that the configured key is correct. The suggested command stops Platform before Tenderdash attempts to load the rendered `node_key.json`, which has no usable key. Keep the saved ID as a fallback for comparison, but recommend a restart only when `nodeIdFromKey` matches the registration. Otherwise report the running mismatch and tell the operator to verify the key first. Cover the ID-only case with a mismatched running ID.
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:70: A failed report rename can leave a readable diagnostic archive behind
(carried; thread: https://github.com/dashpay/platform/pull/6317#discussion_r4704378438)
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Doctor reports and leftover staging samples can contain Core RPC passwords — The report prompt says passwords are obfuscated, but Docker inspect samples retain credential values in
Config.Env. The writer also leaves the unpacked samples in the system temporary directory after packing. Both behaviors predate this PR and are separate from the new partial archive’s permissions.- Follow-up: File a follow-up to redact credentials before serializing Docker inspect data, stage samples in an owner-only directory, and remove that directory on success or failure.
|
Bots are done — your move: post |
…ey gives the registered ID When the running Tenderdash had another node ID, doctor advised a Platform restart whenever the configured ID matched the registration, including when only the saved `node.id` matched and there was no key. Without a usable key a restarted Tenderdash cannot start again. The restart is now advised only when the ID derived from the configured key matches; when only the saved ID does, doctor reports the running mismatch and tells the operator to check the configured node key first. The saved ID is still used for the comparison. Test would have caught this in CI: ✖ before fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… only The temporary archive was opened with the default mode, so under a usual umask other local users could read it, and if renaming and removing it both fail it stays behind. It is now created with mode 0600, which the published report keeps through the rename. Test would have caught this in CI: ✖ before fix, ✔ after. It is skipped on Windows, which does not express access through file modes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This revision recommends a Platform restart only when the configured Tenderdash key derives the registered node ID, and creates report archives with owner-only permissions on POSIX. Dashmate tests, all three Dashmate E2E jobs, JavaScript lint, and the main and browser Platform suites passed; PastaClaw review and PR Hygiene are pending.
🟡 2 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Still open from earlier rounds (1)
- 🟡 Suggestion: A failed report rename can leave a readable diagnostic archive behind —
packages/dashmate/src/doctor/archiveSamples.js:68-84(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The PR changes several diagnostic paths and the report archive lifecycle, warranting ordinary review without changing consensus, funds movement, or cryptographic behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/doctor/analyse/analyseConfigFactory.js`:
- [SUGGESTION] packages/dashmate/src/doctor/analyse/analyseConfigFactory.js:130-133: Following doctor’s missing-key advice prints the Tenderdash private key
Impact: An evonode operator who follows the new repair advice can leave the full node key in a recorded terminal session or shell history.
The repair can disclose the private key during a support session. The new fallback recommends passing the key as the positional value to `dashmate config set`, and `src/commands/config/set.js:87` prints that exact value after saving it. Passing the key through a shell variable still exposes it in the command's output. Keep the diagnosis and identify the setting, but omit the copyable command until `config set` can accept the key without putting it on the command line and confirm the update without echoing it.
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:68-84: A failed report rename can leave a readable diagnostic archive behind
(carried; thread: https://github.com/dashpay/platform/pull/6317#discussion_r4704378438)
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Unredacted RPC passwords remain in staged report files — The existing Docker inspect collector retains RPC passwords in
Config.Env. The report writer stages those samples underos.tmpdir()with default permissions and does not remove them, so a typical POSIX022umask can leave the JSON readable to other local users even when the packed archive is0600. The credentials also reach anyone who receives the report.- Follow-up: Open a follow-up PR to retain only the Docker inspect fields needed for diagnosis and stage them in a private, uniquely created directory that is cleaned up on success and failure.
|
Bots are done — your move: post |
|
/self-reviewed |
…ises Doctor (#6317, via the v5.2-dev merge) treats a node key that gives the registered node ID as correct whatever ID is saved, and advises `restart --platform` when Tenderdash still runs an older ID. This PR's start guard refuses a masternode whose saved node ID is not the one its key gives, so that restart was refused. With a verified key and a stale saved ID, doctor now names `config set platform.drive.tenderdash.node.id <registered ID>` before the restart, and reports the stale ID (medium) when Tenderdash already runs the registered one, since the next start or restart is refused. Reports from an older dashmate carry no ID derived from the key and are judged as before. Found by the Codex gpt-6.2-sol xhigh pass on the merge. Test would have caught this in CI: ✖ before fix (2 failing: no problem for the stale ID; restart advised without saving it), ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings v5.1-dev's 7 commits into v5.2-dev: dashpay#6315, dashpay#6316, dashpay#6289, dashpay#6209, dashpay#6210, dashpay#6267 and dashpay#6274. Conflicts, all in dashmate doctor, where dashpay#6316 (v5.1-dev) and dashpay#6317 (v5.2-dev) changed the same code: - archiveSamples.js: combined. Config secrets are scrubbed, samples are staged in a private mkdtemp directory that is removed afterwards, and the tar is portable and lists the staged files (dashpay#6316). The archive name is Windows-safe, the archive is packed into a `wx` 0600 partial file renamed into place inside its cleanup guard, and its path is returned (dashpay#6317). The staging directory and the mkdtemp prefix use the Windows-safe name. When the archive fails, the staging directory is removed inside a guard, so the error that stopped the archive is the one reported, as dashpay#6317 already did for the partial file. - report.js: passes the config and prints the returned archive path. - collectSamplesTaskFactory.js: both sides' imports. - archiveSamples.spec.js (add/add): v5.1's tests take the archive path from the return value; the "did not write" test plants a directory under both earlier staging names; v5.2's tests sit in an "archive file" block and pass the config. New test: the packing error is reported when removing the staged files fails too (fails on a plain `finally`, passes on the resolution). - collectSamplesTaskFactory.spec.js: both sides' imports. Merged without mergiraf (core.attributesFile=/dev/null). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ive file The merge of v5.1-dev combined dashpay#6317's archive file, opened before its cleanup guard, with dashpay#6316's list of staged samples. That list was read after the file was opened, as an argument to tar. If reading it failed, packing never started, so nothing closed the file: its descriptor stayed open, and on Windows the partial file could not be removed. The list is now read before the file is opened. Test would have caught this: ✖ before the fix (the `.partial` file was opened), ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
Several
dashmate doctorchecks never fire, anddoctor reportwrites an archive whose name is invalid on Windows. These were found while working on the doctor report; all of them predate this PR.What was done?
Core status sample: the RPC results were destructured in the wrong order, so
masternodeStatusheld themnsync statusresponse andmasternodeSyncStatusheld themasternode statusone. As a result, the PoSe, sync-progress and node-ID checks all read the wrong data. The order is fixed.Evonode node-ID check: the analyser read
dmnState.platformNodeId, but Dash Core returnsdmnState.platformNodeID. The check now reads the field Core actually returns, so a configured Tenderdash node ID that differs from the registered one is reported.Container CPU/RAM checks:
si.dockerContainerStats(id)resolves with an array (one entry per requested container), but the analyser readcpuStats/memoryStatsoff the array itself. It now takes the single entry and reports nothing when the array is empty.Archive name: the ISO timestamp's
:is replaced with-(dashmate-report-2026-11-26T10-15-30.123Z.tar.gz). The exact collection time is still recorded in the archive'sdatesample, which is what analysis reads.archiveSamplesnow returns the path it wrote, anddoctor reportprints that path instead of rebuilding the name itself.Partial archive: tar opens the output file before it reads the samples, so a failure while packing left a truncated
.tar.gzthat looked like a report. The partial file is now removed before the error is rethrown.Packing failure, follow-up: the archive is packed under a name only this run uses and renamed into place once complete. A failure removes only that file, never a report already at the destination, and always rethrows the packing error rather than a cleanup error.
Unexpected stats sample: a
dockerStatssample that is not an array counts as no stats instead of stopping analysis of the whole report.Sync stages: the block-sync message now depends on
IsBlockchainSynced. Governance sync, the stage Core v24 still has left after the blocks, is reported separately at low severity.Node key vs registration: the collector records the ID derived from the configured Tenderdash key, since the key is redacted from the report, and the node-ID check compares that ID. Reports without it fall back to the saved ID.
Key loaded vs configured: when the configured key already gives the registered ID but the running Tenderdash, according to its collected
statussample, has a different one, doctor says a Platform restart is needed. That restart is recorded in the restart-advice allow-list with its reason. A config with a saved node ID and no key, which the schema allows, falls back to the saved ID instead of aborting doctor. A failed rename of the packed report removes the temporary file too.The
masternode status(evonode,READY) andmnsync statusfixtures (finished, blockchain and governance stages) undertest/fixtures/coreRpc/24.0.3/were captured from a Dash Core v24.0.3 regtest node, and the Tenderdashstatusfixture from a Tenderdash 2.0.0-dev.3 kvstore node, with an evonode registered throughprotx register_fund_evo.Not changed here, noted for a follow-up:
analyseServiceContainersFactorylistsservicesNotStartedinstead ofservicesOOMKilled.archiveSamplescreates under the OS temp dir is never removed.How Has This Been Tested?
Each fix is its own commit, and each test failed before its fix and passed after it:
collectSamplesTaskFactory.spec.js: each Core response is stored under its own sample, a PoSe-banned masternode is reported, and an evonode with a mismatched Tenderdash node ID is reported end to end (collect, then analyse).analyseConfigFactory.spec.js: a node key whose derived ID differs from the registeredplatformNodeIDis reported, and a matching ID reports nothing.analyseServiceContainersFactory.spec.js(new): high CPU and high RAM are reported from the array shape; normal use and an empty stats array report nothing.archiveSamples.spec.js(new): the archive name is Windows-safe, the exact collection time survives a round trip throughunarchiveSamples, and a packing failure leaves no partial archive, keeps an existing report and surfaces the packing error. The packing-failure tests are skipped for root and on Windows.The full dashmate unit suite passes locally (
yarn mocha --recursive test/unit: 1200 passing, 0 failing). These checks have not been run against a live node withdashmate doctor.Breaking Changes
None.
archiveSamplesnow returns the archive path; its only caller isdoctor report.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull request (N/A)For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
4c87688/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.