← Back

Bug-fix report — 2026-06-14

Each issue below was reproduced, root-caused, fixed, and verified. Two repositories are covered: Ethica.no (the platform) and the document portal (dokument.ethica.no = EthicaDocServer serving EthicaDoc content). Companion engineering note: patch-notes-2026-06-14-session2.md.


Ethica.no — smoke-suite failures

BUG-1 · Site search returned no results

  • Symptom: /api/search?q=ethica{"query":"ethica","results":[]}; the pages full-text table was empty.
  • Root cause: the Hugo home JSON output had been removed ([outputs] home = ["HTML", "RSS"]) as “unused”, so public/index.json was never built. The server’s import_search_index() reads that file at startup to populate the search table — it was not unused.
  • Fix: re-enabled JSON in [outputs] and added layouts/index.json that emits the index (title/permalink/section/type/date/summary/content) for every regular page.
  • Safety: in gated docs modes the file is still refused by the request handler and deleted right after import, so private content can’t leak.
  • Verified: search returns hits; the index builds with 14 entries (Hugo 0.161.1).

BUG-2 · CRM “deal move” rejected with 403 in the smoke

  • Symptom: the deal-move POST got 403 instead of a 302 redirect.
  • Root cause: the kanban pipeline publishes its CSRF token as data-csrf="…" (read by the move JS), not as a hidden name=csrf field. The smoke grepped for name=csrf, found nothing, and POSTed an empty token — which the server correctly rejected.
  • Fix: the smoke now reads the token from data-csrf.
  • Safety: no access-control change — an empty/invalid CSRF still returns 403 (verified live); a valid token returns 302.

BUG-3 · “projects list” smoke assertion failed

  • Symptom: the page rendered but the asserted marker was absent.
  • Root cause: the active projects view is now a kanban board (class="kanban"); tk-list only appears in the archived view. The assertion was stale.
  • Fix: assert class="kanban". (App output is correct and unchanged.)

Combined result: the Docker smoke went from 53 passed / 3 failed to 56 passed / 0 failed, with no new failures.


Document portal (dokument.ethica.no)

BUG-4 · A company’s doc folder showed no “folder box”

  • Symptom: one company’s landing page showed a folder box that another company’s did not.
  • Root cause: the company page renders one box per Hugo section (.Sections). A nested folder is a section only if it contains an _index.md; a folder of loose .md files without one is not a section → no box, and its pages are orphaned from the grid. Authors push plain folders without an _index.md.
  • Fix: new build step scripts/ensure_section_index.py creates a titled _index.md in any company sub-folder that holds markdown but lacks one (runs on the cloned content at build time; never edits the upstream repo). Box titles also fall back to the folder # H1 / name via the doc-title.html partial.
  • Verified: a sub-folder without _index.md (e.g. components/) now renders a titled box.

BUG-5 · Page title shown twice

  • Symptom: doc and section pages displayed their heading twice (e.g. “Change log” appeared as both the big header and again below it).
  • Root cause: the templates render the page title and the full markdown body — and the body starts with the same # H1 the title is derived from.
  • Fix: list.html and single.html strip a leading body <h1> before rendering.
  • Verified: single doc pages now render exactly one H1.
  • Symptom: off-brand pink/olive accents across the portal; the login screen had no logo.
  • Root cause: both the Hugo CSS (assets/css/main.css) and the server-rendered chrome (server.py render_shell) still carried the SecBitz brand palette (#f00b51 / #aa9903, “Aldrich” font) from the readpage/portal origin.
  • Fix: both now use the Ethica navy/blue palette mirroring ethica.no (--brand-primary #79b0ee, accent #5b86c4, bg #090d16, text #e9eef6) and the Comfortaa display font; the Ethica logo was added to the sign-in card.
  • Verified: rebuilt CSS contains the Ethica palette and zero SecBitz colours; Comfortaa loads in the head; the login page renders the logo and Ethica colours.

BUG-7 · “Recent Pages” cramped against the doc list

  • Symptom: no separation between a folder’s doc list and the “Recent Pages” block.
  • Fix: added a top border + margin/padding above the Recent-Pages section.

Files changed

Ethica.no (branch bugfix/baseline-smoke-failures): config/_default/hugo.toml, layouts/index.json (new), .claude/skills/run-ethica-no/smoke.sh — plus the review branch’s documentation comments and the 3 commented-out unused blocks.

Document portal — EthicaDocServer (working tree, deploys on next image build): scripts/ensure_section_index.py (new), Dockerfile, layouts/_default/list.html, layouts/_default/single.html, layouts/_default/baseof.html, assets/css/main.css, server.py. The git-files docs submodule was not modified.

Notes

  • BUG-2, BUG-3 and BUG-7 were test/UI corrections; the application logic and access control were unchanged.
  • BUG-1, BUG-4, BUG-5, BUG-6 were real defects in the build/render pipeline; all fixes are general (not content-specific) and take effect on the next deploy/rebuild.