Repository navigation
Bugfix Issue 2128 Authored Compatibility Chapter



Chapter 26 (Non-Functional: Compatibility Testing) was a read-only reference page.
With a freshly imported 2.0.1 database and fixture project 1 (smoke, prefix SMK),
opening gui/templates/strategy/nfrCompatibility.html?tproject_id=1 returned HTTP 200
but the live DOM had 0 textareas and 0 Save buttons. Its network panel showed ten
static/shell requests and no call to api/strategychapter. With no editor, a project
could not record its OS/browser/device matrix prose, and the generated Test Strategy
report had no chapter-note text to aggregate. Before the fix, an authenticated
GET /api/strategychapter/index.php?action=init&tproject_id=1&chapter=compatibility
returned HTTP 400 bad_chapter while chapter=intro returned 200.
-
api/strategy/index.php:83correctly links chapter 26 togui/templates/strategy/nfrCompatibility.html;lib/functions/common.php:3580exposes the same URL as$actions->testStrategyCompatibility. Navigation was never the problem. - The page rendered only two translated static cards (
nfrCompatibility.html:40-57); its script (:61-70) loaded jQuery andTLi18nbut nothing else. Unlike the #2104, #2129 and #2130 siblings, it had no#compatTexttextarea, no#btnSave, and noloadNotes()/saveNotes()wiring. - The shared persistence BFF was gated by
schapterCodes()atapi/strategychapter/index.php:78-81, which allowed onlyintro,reliabilityandmaintainability. Both the read validation (:273) and the save validation (:294) rejectedcompatibilitywith HTTP 400bad_chapter. - Storage and reporting were already chapter-agnostic:
testproject_strategy_chaptershas aUNIQUE (testproject_id, chapter_code)key and an atomic upsert (api/strategychapter/index.php:89-106,:303-311), andapi/strategyreport/index.php:461-494aggregates every chapter row for the project. OnlychapterTitle()ingui/templates/results/strategyReport.html:314-321lacked acompatibilityentry, so a saved note would have been shown under the raw code.
This is not a regression from a recent commit: legacy 1.9.20 shipped all NFR chapter pages as static guidance, and the 2.0.1 authored-chapter series (#2104, #2129, #2130) simply never included chapter 26.
-
Extend the existing allowlist, not the schema. Adding
compatibilitytoschapterCodes()reuses the same rights-guarded read/write endpoints, 20 000-character cap, atomic upsert andSTRATEGY_CHAPTER_SAVEAUDIT event as the three sibling chapters. No new table, endpoint or migration was needed:chapter_codeis already a freeVARCHAR(64)value keyed per project. -
Mirror the established Dashio editor in the existing chapter page. The page now
has a teal-topped
.editorcard with a labeled#compatTexttextarea (maxlength=20000),#compatMetaauthor/update line,#btnSaveand a localized#compatStatusregion.GET initfills the stored text, resolves the project context from?tproject_id=/?tprojectId=(falling back to the BFF session project), and disables the textarea/button whencontext.can_modifyis false;POST savepersists and reloads. 401 redirects to login, 403 shows a read-only message, 400 shows the no-project message, and other failures show a localized load/save error. Four newts.compatNotes*keys were added to all ten bundles; the nine status/meta keys are the sharedts.rel*keys already used by the sibling chapters, and all thirteen are now pinned inai/required_i18n_keys.txtagainst the #2131 clobber pattern. -
Add only the missing report title mapping.
chapterTitle()mapscompatibilityto the pre-existingts.chapterCompatibilitykey. That map is shared by report panel 11 and bybuildMarkdown()used by the Markdown/HTML export. The rendered page printed to PDF throughwindow.print()also shows panel 11, so all three surfaces show the chapter name rather than the raw code. No strategy-report BFF change was required.
- Adding a tenth section to
testproject_strategy_docswould break the fixed nine-section #2101 document contract and require ten newsdoc.sec_*keys per bundle; it would also hide the chapter-code dimension that the report already understands. - A compatibility-only table/API would duplicate auth, same-origin protection, rights,
upsert, audit and report aggregation that
api/strategychapteralready provides. - A client-only textarea with
localStoragewould not be project-scoped, rights-guarded, audited or exported into the report/PDF.
-
api/strategychapter/index.php—compatibilityadded toschapterCodes()and route docs. -
gui/templates/strategy/nfrCompatibility.html— Dashio editor markup + load/save wiring. -
gui/templates/results/strategyReport.html—compatibilitychapter title mapping. -
gui/templates/i18n/{de,en,es,fr,it,ja,pt,ro,ru,zh}.json— fourts.compatNotes*keys per locale. -
ai/required_i18n_keys.txt— four new keys plus nine reusedts.rel*keys pinned. -
tmp/TLU_Test_Cases.md— suiteRegression — Issue #2128. -
CHANGELOG—[KEY BUGFIX] - #2128entry. -
docs/screenshots/issue-2128-compatibility-{before,after}.pnganddocs/screenshots/issue-2128-strategy-report-compatibility.png— evidence.
- Pre-fix: 0 textareas, 0 Save buttons, zero chapter-BFF requests; API 400
bad_chapter. - Post-fix:
GET init200 (can_modify:true),POST save200, reload restored the exact two-line UTF-8 text with author/timestamp; DB row1 | 1 | compatibility | admin. - Report panel 11 showed
Compatibility Testing · Last author: admin · Updated: 2026-11-29 19:54:57plus both text lines;buildMarkdown()contained### Compatibility Testingand the same text in the Markdown/HTML export, and the rendered panel 11 used by Export PDF / Print showed the same content. - Rights matrix: read-only user saw a disabled textarea/Save and POST returned 403
no_rightwith the DB unchanged; anonymous GET returned 401session_expired; anonymous POST with a foreign Origin returned 403 CSRF guard;chapter=bogusreturned 400 and unknown project 404. Theintro,reliabilityandmaintainabilitysiblings still returned 200. - Gates:
php -l, extracted-JSnode --checkfor both pages,python3 -m json.toolfor all ten bundles,bash ai/verify_i18n_coverage.shPASS (9/9, 0 missing, 28 pinned keys), andTLU_REQUIRE_SUITE="Issue #2128" bash ai/verify_test_suites.shPASS (34/0/0). - Event Viewer:
LOGIN:4,LOGOUT:1,STRATEGY_CHAPTER_SAVE:1; 0 Error/Warning rows. - Code review: no MUST-FIX findings; the two SHOULD-FIX items (pin reused
ts.rel*keys and avoid overstating title translation) were applied before commit.