Skip to content

Test Strategy Introduction Chapter Notes

github-actions[bot] edited this page Nov 29, 2026 · 1 revision

Test Strategy — Introduction & Background chapter notes (Issue #2104)

Summary

Chapter 1 Introduction & Background (gui/templates/strategy/intro.html) now includes a project-scoped authored notes editor, following the same pattern used by Reliability (#2129) and Maintainability (#2130).

Root cause

intro.html was a static Dashio page with no textarea/save action. The api/strategychapter/index.php BFF allowlist accepted only reliability and maintainability, so chapter=intro returned 400 bad_chapter. The strategy report already aggregated all testproject_strategy_chapters rows generically, but its UI chapterTitle() map did not know intro.

Fix

  • api/strategychapter/index.php — added intro to schapterCodes() allowlist. Existing rights checks, project resolution, lazy schema, 20k text cap, atomic upsert, and STRATEGY_CHAPTER_SAVE audit event remain unchanged.
  • gui/templates/strategy/intro.html — kept the existing static guidance cards and added an editor block below: textarea #introText, Save button, status/meta, project context, disabled for users without mgt_modify_tc. Uses CHAPTER_CODE='intro' against /api/strategychapter/index.php?action=init|save. 401 redirects to login; 403/400/load failures show localized status.
  • gui/templates/results/strategyReport.html — added intro: 'ts.chapterIntro' to chapterTitle() so panel 11 renders the translated chapter title.
  • i18n — added ts.introNotesTitle, ts.introNotesHint, ts.introNotesLabel, ts.introNotesSave to all 10 locale bundles; reused existing shared ts.rel* status/meta keys.

Verification

  • php -l api/strategychapter/index.php — no syntax errors.
  • Intro inline JS node --check — clean.
  • python3 -m json.tool on all 10 locale bundles — OK.
  • bash ai/verify_i18n_coverage.sh — 9/9 passed, 14142 keys each.
  • API: init intro returns empty chapter; save persists UTF-8/multiline text; DB row stores chapter_code=intro, author, update_ts.
  • Negative/rights: unauthenticated GET/POST save → 401; bad project 404; bad chapter 400; read-only user POST save → 403 no_right, DB unchanged.
  • Browser: intro page shows textarea/save/meta; save via UI produces init/save/init 200 requests; report panel 11 shows "Introduction & Background" note with author/updated/text.
  • Console: no console messages. Event Viewer: only AUDIT STRATEGY_CHAPTER_SAVE rows, no Error/Warning.

Screenshots

Introduction chapter editor

Strategy report showing intro chapter note

Files

  • api/strategychapter/index.php
  • gui/templates/strategy/intro.html
  • gui/templates/results/strategyReport.html
  • gui/templates/i18n/*.json

Clone this wiki locally