Skip to content

Commit 7833d8c

Browse files
committed
fix(verify-module): no credentials FAULT for a config.js without passSource (#659 review)
An older hand-edited config.js (pre-#329) has no passSource. Treating that as "password not from env" gave a project with a real password in project.config.js and TEST_PASS unset a false credentials FAULT (module INCOMPLETE). Now only passSource === 'template placeholder' is refused here; otherwise the instruments' own preflights decide, as when config.js cannot be loaded. Fixture V12: old config.js + real password, TEST_PASS unset -> no credentials row (fails on da45c27). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jQvaonym9V1wKKfAEPmRr
1 parent da45c27 commit 7833d8c

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
1818
`docs/RELEASE-PROCESS.md` §8.
1919

2020
## Unreleased
21-
- fix(verify-module, report-normalize): **a placeholder login is refused once, before journeys and monkey, and every FAULT row prints its reason (#659)**: `verify-module.sh` now probes the credential once, alongside the playwright probe: it uses journey-runner's preflight rule (config.js `passSource === 'template placeholder'`, `ALLOW_CONFIG_CREDENTIALS=1` overrides). On a placeholder it writes ONE `e2e credentials` FAULT row with the reason and the SETUP text, and marks journeys and monkey `SKIPPED (not run: credentials …)`. Before, monkey (which has no preflight) logged in as the placeholder user and then the fallback account, and each rejected attempt counted toward the demo account's lockout. `report-normalize.js` takes a row's reason from its `(…)` cell, or for a FAULT row from the last SETUP / INSTRUMENT FAULT / TIMED OUT line of its log, so `fault()` rows and runner aborts no longer print "no reason recorded". Its elapsed cell now accepts verify-module's `12s`, which used to be read as the log path. The summary.tsv format is unchanged. **After sync:** a project still on the template password with TEST_PASS unset shows one credentials FAULT in place of a journeys FAULT plus a monkey login crash; the module verdict stays INCOMPLETE. Golden: `tests/wave2/fixtures/verify-659/` (real verify-module + journey-runner output); fixture cases V12 in `test-verify-module-446.sh` and case 4 (both layouts) in `test-report-normalize-two-tree.sh` — field run
21+
- fix(verify-module, report-normalize): **a placeholder login is refused once, before journeys and monkey, and every FAULT row prints its reason (#659)**: `verify-module.sh` now probes the credential once, alongside the playwright probe: it applies journey-runner's preflight rule (config.js `passSource === 'template placeholder'`, `ALLOW_CONFIG_CREDENTIALS=1` overrides; an older hand-edited config.js without `passSource` is not refused here, and its instruments' own preflights decide). On a placeholder it writes ONE `e2e credentials` FAULT row with the reason and the SETUP text, and marks journeys and monkey `SKIPPED (not run: credentials …)`. Before, monkey (which has no preflight) logged in as the placeholder user and then the fallback account, and each rejected attempt counted toward the demo account's lockout. `report-normalize.js` takes a row's reason from its `(…)` cell, or for a FAULT row from the last SETUP / INSTRUMENT FAULT / TIMED OUT line of its log, so `fault()` rows and runner aborts no longer print "no reason recorded". Its elapsed cell now accepts verify-module's `12s`, which used to be read as the log path. The summary.tsv format is unchanged. **After sync:** a project still on the template password with TEST_PASS unset shows one credentials FAULT in place of a journeys FAULT plus a monkey login crash; the module verdict stays INCOMPLETE. Golden: `tests/wave2/fixtures/verify-659/` (real verify-module + journey-runner output); fixture cases V12 in `test-verify-module-446.sh` and case 4 (both layouts) in `test-report-normalize-two-tree.sh` — field run
2222
- fix(java-angular): **REST endpoints land when controller and service sit in different packages, the gaps report counts the ones it misses, enums carry path evidence, and the config lives in the project (#637, #639, #643)**: pass 2 joined endpoints to service methods by (leaf package, method name), so on OpenWMS 0 of 70 controller mappings landed and summary.md said 0 gaps. Endpoints are now a list (overloads kept), path constants (`API_LOCATIONS + "/{pKey}"`, `TMSApi.X`) are evaluated, an unmatched controller method becomes its own `logic` item with `delegatesTo[]` resolved by injected field type, and an independent regex count per controller file (string literals and comments stripped in one pass, so `"/**"` or `"://"` cannot swallow code) is printed as "captured N of M", with any disagreement in either direction added to the gaps total. Plain `@Controller` classes now count as controllers; method-level `@RequestMapping(method = …)` gives one endpoint per verb. Overloads get distinct names (`changeState_2`, `overloadOf`), and the microflow mapper qualifies any remaining same-name microflow in a BRD (`<Class>_<name>`, `renamedFrom`), so no BRD lists one name twice. Enums now carry `_source`/`sourceRef`, nested ones are named `Outer_Inner` (merger dedup had dropped 3 of 20 enums sharing a leaf package), and `values`/`vo`/`state` join the technical layers. `run.js`, `merger.js` and `generate-report.js` read `--config <file>` / `MXTK_PIPELINE_CONFIG` (relative paths resolve against that file) and refuse the placeholder template. OpenWMS: endpoints 0 → 70/70, enums 17 → 20 all with `_source`, BRDs 16 → 14 with no api/events/values/state; inventory-management pilot unchanged (11/11 endpoints, 56 links, 2 gaps) except its one nested enum renamed `ItemActionServiceImpl_Action`. New `pipeline/tests/` (node --test) over verbatim OpenWMS files — OpenWMS field run (openwms.org, Apache-2.0)
2323
- fix(facts-lock, gate-check): **per-module UC001… numbering is no longer an owner DEVIATION** (#633 follow-up, #621) — the owner check now applies only where a frozen use case or rule has exactly one owner and that owner is a real BRD `id`; extractor BRDs (no `id`, per-module UC001…) no longer FAIL Stage 2 when one more module BRD is added after a build. A single-owner id moving to another BRD id is still a DEVIATION. The Stage 2 FAIL line now also names `bin/facts-lock.sh <project> forget <ns>/<key>` for deliberate changes. Fixture: the rename case now actually renames. Credit: post-merge independent review of #633.
2424
- fix(file-bugs, harvest-learnings): **the bug-filing flow reads the denylist the user was told about, keeps code readable, and is not "Nothing to harvest" (#645, #646, #647)**: `file-bugs.py` now also reads the toolkit clone's `.leakguard-deny` (or `$MXTK_LEAKGUARD_DENYFILE`), where `init-project.sh` registers every project's name — before, a registered name appeared 4 times unredacted in a dry run; that list redacts but does not stand in for the project's required deny list. Dotted code is no longer `<host>`: a call keeps its name when its first label is a known runtime object or module (`os.path.join(`, `path.resolve(`, `System.getenv(`), an unknown middle label becoming `<name>` (`path.<name>.dmz(`); any other `x.y(` such as `acme.sap(` stays `<host>`, in prose or a fence. `java.`/`javax.`/`kotlin.` packages stay whole only with a known stdlib second label (`java.acme.orders` becomes `java.<org>.orders`). A Java package keeps its shape with the organisation label redacted (`org.<org>.common.service.lib`) unless that label is a public one (`springframework`, `apache`, ...), JDK roots stay whole, and root file names such as `CLAUDE.md` survive a git user called Claude; deny patterns still win over every exemption. The Versions line carries the toolkit: the row's value (now also git-describe output or a sha), else PROJECT.md's `Toolkit commit:`, else `git describe` of the clone, marked `(at filing)`. `harvest-learnings.sh` counts open `docs/bugs.jsonl` rows and points at `file-bugs.sh` instead of saying "Nothing to harvest" (13 logged bugs were missed that way); rows are never copied raw into the inbox. — auto-filed field run issues #645-#647

‎project-bin/verify-module.sh‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,9 @@ fi
675675
# placeholder password in its own preflight (#278), but monkey.js has no preflight: it logged in as
676676
# the placeholder user three times, then the fallback account, and each rejected attempt counts
677677
# toward the demo account's lockout. Same rule as journey-runner.js's preflight: config.js's
678-
# passSource === 'template placeholder' (an older config.js without passSource: the password did not
679-
# come from the env), unless ALLOW_CONFIG_CREDENTIALS=1. One FAULT row carries the reason; journeys
678+
# passSource === 'template placeholder', unless ALLOW_CONFIG_CREDENTIALS=1. An older hand-edited
679+
# config.js without passSource is NOT refused here (it may carry a real password while TEST_PASS
680+
# is unset): its instruments' own preflights decide, as when config.js cannot be loaded. One FAULT row carries the reason; journeys
680681
# and monkey are SKIPPED as its dependents. config.js is only read here (ALLOW_UNVERIFIED_APP=1 lets
681682
# it load without the stack's ownership marker; nothing is contacted). A config.js that cannot be
682683
# read leaves CRED_OK=1: each instrument's own preflight still decides.
@@ -686,7 +687,7 @@ if [ "$SKIP_JOURNEYS" -eq 0 ] || [ "$SKIP_MONKEY" -eq 0 ]; then
686687
for _d in ${_E2E_DIRS[@]+"${_E2E_DIRS[@]}"}; do [ -f "$_d/config.js" ] && { _cfg_js="$_d/config.js"; break; }; done
687688
if [ -n "$_cfg_js" ] && [ "${ALLOW_CONFIG_CREDENTIALS:-}" != 1 ] && command -v node >/dev/null 2>&1; then
688689
_cred="$(ALLOW_UNVERIFIED_APP=1 node -e 'const c = (require(process.argv[1]).cfg) || {};
689-
const ph = c.passSource !== undefined ? c.passSource === "template placeholder" : !c.passFromEnv;
690+
const ph = c.passSource === "template placeholder";
690691
console.log(ph ? `placeholder\t${c.user || ""}` : "ok")' "$_cfg_js" 2>/dev/null | tail -1)"
691692
case "$_cred" in
692693
placeholder*)

‎tests/wave2/test-verify-module-446.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,19 @@ if [ -f "$E2ESRC/config.js" ] && [ -f "$E2ESRC/project.config.template.js" ]; th
225225
&& ok "V12: placeholder password, TEST_PASS unset: one credentials FAULT with its reason; journeys + monkey SKIPPED, never started" \
226226
|| bad "V12: credentials rows=$_cr" "$sum"
227227
[ -n "${CAPTURE:-}" ] && cp "$_vl/summary.tsv" "$CAPTURE/credentials.summary.tsv"
228+
# An older hand-edited config.js (pre-#329: no passSource) with a real password and TEST_PASS
229+
# unset must not be refused here; its instruments' own preflights decide.
230+
cp "$P/tests/e2e/config.js" "$WORK/stub/config.js.keep"
231+
node -e 'const f=process.argv[1],fs=require("fs");let s=fs.readFileSync(f,"utf8");
232+
s=s.replace(/^\s*passSource: passwordSource\(\),\n/m,"");fs.writeFileSync(f,s)' "$P/tests/e2e/config.js"
233+
sed -i.bak "s/^const DEFAULT_PASS = .*/const DEFAULT_PASS = 'RealDemoPw-1';/" "$P/tests/e2e/project.config.js"
234+
_np="$(cd "$P" && PROJECT_ROOT="$P" ALLOW_UNVERIFIED_APP=1 TEST_PASS= APP_PASS= node -e 'const c=require(process.argv[1]).cfg; console.log(String(c.passSource)+"|"+c.pass)' "$P/tests/e2e/config.js" 2>&1 | tail -1)"
235+
TEST_PASS= APP_PASS= ALLOW_CONFIG_CREDENTIALS= vm MyFirstModule
236+
{ [ "$_np" = "undefined|RealDemoPw-1" ] && ! printf '%s' "$sum" | grep -q '^e2e credentials' \
237+
&& row '^journeys [(]UI' | grep -q '^PASS' && row '^monkey' | grep -q '^INFO'; } \
238+
&& ok "V12: old config.js without passSource + real password, TEST_PASS unset: no credentials FAULT" \
239+
|| bad "V12: false credentials FAULT on an old config.js (probe: $_np)" "$sum"
240+
cp "$WORK/stub/config.js.keep" "$P/tests/e2e/config.js"; mv "$P/tests/e2e/project.config.js.bak" "$P/tests/e2e/project.config.js"
228241
TEST_PASS=x vm MyFirstModule
229242
{ ! printf '%s' "$sum" | grep -q '^e2e credentials' && row '^journeys [(]UI' | grep -q '^PASS' && row '^monkey' | grep -q '^INFO'; } \
230243
&& ok "V12: TEST_PASS set: no credentials row, journeys and monkey run" || bad "V12: TEST_PASS set" "$sum"

0 commit comments

Comments
 (0)