Skip to content

Commit 25a35b6

Browse files
tyaginidhiclaude
andcommitted
Address #202 review: fix two inaccurate code comments
- set-plan-status.js: a crash between the HTML-then-JSON renames leaves "HTML ahead of JSON" (new HTML, old JSON), not "JSON behind HTML". Reworded to the correct direction (it's the inverse of the original pre-atomic bug; benign + self-healing). - estimate-solution-size.js: the marker probe was said to be "documented in CLAUDE.md"; point at the canonical source (detect-project-context.js, also in AGENTS.md) instead. Comment-only; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b814c62 commit 25a35b6

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

plugins/power-pages/scripts/lib/estimate-solution-size.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function parseArgs(argv) {
8484
// Resolve the build-axis site type for the estimator's diagnostic `siteType`
8585
// output field. Prefer the caller-supplied value (plan-alm resolves this in
8686
// Phase 1 via detect-project-context.js, the authoritative source), and fall
87-
// back to a lightweight local probe of the same markers documented in CLAUDE.md:
87+
// back to a lightweight local probe of the same markers detect-project-context.js
88+
// resolves on (also described in the plugin's AGENTS.md "detect-project-context.js" entry):
8889
// - `powerpages.config.json` → code / SPA site
8990
// - `.powerpages-site/.portalconfig/` → declarative design-studio (EDM/standard) site
9091
// Returns the canonical values ('code' | 'declarative') to match

plugins/power-pages/scripts/lib/set-plan-status.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,12 @@ function setPlanStatus(opts) {
161161
try { fs.unlinkSync(htmlTmp); } catch {}
162162
throw e;
163163
}
164-
// Both products are ready: commit the HTML then the JSON. (Same-dir renames in
165-
// one process; a failure between them is vanishingly unlikely and would at worst
166-
// reproduce the pre-existing "JSON behind HTML" state, never a torn JSON file.)
164+
// Both products are ready: commit the HTML then the JSON. A crash BETWEEN these
165+
// two same-dir renames (vanishingly unlikely in one process) would leave the new
166+
// HTML in place with the JSON still old — "HTML ahead of JSON". That's benign and
167+
// self-healing: the next render re-derives the HTML from whatever the JSON says,
168+
// and no file is ever torn (each rename is atomic). It is the inverse of the
169+
// original pre-atomic bug (new JSON + stale HTML), and harmless in the same way.
167170
fs.renameSync(htmlTmp, htmlPath);
168171
rendered = true;
169172
}

0 commit comments

Comments
 (0)