Skip to content

fix(assembly): refuse an HTML NUL on the assembly host - #5429

Merged
natechadwick-intsof merged 3 commits into
mainfrom
fix/issue-5412-assembly-html-nul
Oct 8, 2026
Merged

natechadwick-intsof merged 3 commits into
mainfrom
fix/issue-5412-assembly-html-nul

Conversation

@natechadwick-intsof

@natechadwick-intsof natechadwick-intsof commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Assembly host save refuses an HTML value that contains a NUL. The previous markup stays after reload. Ordinary HTML still saves. Cancel does not write. HTTP 400 is not success. The single-line and long-text NUL gates are unchanged.

Parent: #4530. Slice 111.

Fixes #5412

Operator: Grok: night-issue-prs (model grok-4.7)

Test plan

  1. Open Active Assembly for an item with an HTML field.
  2. Put a NUL in that HTML and choose Save fields. The notice is That HTML contains a character that cannot be saved. The server is not called. Reload still shows the previous HTML.
  3. Cancel on that edit does not write.
  4. Save ordinary HTML. Reload shows the new markup.
  5. An HTTP 400 from the fields PUT is not Fields saved, and the previous HTML stays.

H2 proof used mocked assembly routes in tests/assembly-html-nul-field.spec.js (4 passed). Console errors on those paths were asserted empty. CMS server.log added only login-success INFO lines.

Checklist

  • Product documentation — updated product-docs/8.2/admin/content-explorer.md (Active Assembly HTML NUL)
  • Unit / module tests — assembly Vitest covers the NUL refusal, cancel, ordinary HTML, overlay strip, and the existing HTTP 400 path
  • WebUI + Playwright — modules/perc-qa-automation/frontend/tests/assembly-html-nul-field.spec.js
  • Build gates — standalone clean install for WebUI and perc-qa-automation
  • Cross-platform — N/A (no path/file I/O)

Build evidence

modules_built: WebUI, modules/perc-qa-automation

downstream_checked: none (no public Java API or final/sealed change)

  • cd WebUI && JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install — BUILD SUCCESS. Java Tests run: 69, Failures: 0, Errors: 0, Skipped: 0. Vitest Test Files 747 passed, Tests 7245 passed.
  • Focused Vitest before the module install: overlayFields.test.ts 61 passed, AssemblyHost.test.tsx 123 passed.
  • cd modules/perc-qa-automation && JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install — BUILD SUCCESS. No tests to run (Playwright is not bound to the default Maven test phase).

UI proof (C5)

  • python3 docker/scripts/perc-devctl.py qa-up --skip-image-build --then-qa-deploy-webui
  • RESULT:OK TEST_CMS_URL=http://127.0.0.1:9993 container perc-matrix-cms-h2
  • Deploy copied generated-webui/cm/modern and restarted Jetty inside the cell (not docker restart).
  • python3 docker/scripts/perc-devctl.py qa-health — RESULT:OK HEALTH:healthy HTTP:200
  • cd modules/perc-qa-automation/frontend && TEST_CMS_URL=http://127.0.0.1:9993 ADMIN_USERNAME=Admin TEST_DB_TYPE=h2 TEST_PRODUCT=cms rtk npm run test:surface -- --path tests/assembly-html-nul-field.spec.js
  • 4 passed. console-clean=yes (spec assertQuiet). server.log-clean=yes (new lines were login-success INFO only).
  • python3 docker/scripts/perc-devctl.py qa-down after the run.

Pre-push local code review

Summary

Machine analysis found 3 finding(s), 0 bug(s).

Scope

  • Base: origin/main
  • Head: HEAD
  • Files: 8 analyzed
  • In-diff: 1 finding(s); preexisting: 1
  • Persona: erlang 0.1.1
  • Persona source: /home/nate/.local/share/mkd/agents/erlang

Recommendation

approve

Gate

  • Blocking bugs: 0
  • May commit/push: yes

Issues

Issue 1 -- Severity: bug

  • File: WebUI/src/main/ts/assembly/AssemblyHost.tsx:629 (preexisting)
  • Rule: complexity.cognitive
  • Tool: arborist-metrics
  • Description: Function handleSaveFields cognitive=49 (max 15), cyclomatic=46 (max 15)
  • Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
  • Status: open

Issue 2 -- Severity: suggestion

  • File: WebUI/src/main/ts/assembly/overlayFields.ts:1206 (in-diff)
  • Rule: complexity.cognitive
  • Tool: arborist-metrics
  • Description: Function readNodeValue cognitive=20 (max 15), cyclomatic=15 (max 15)
  • Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
  • Status: open

Issue 3 -- Severity: suggestion

  • File: review

  • Rule: llm.error

  • Tool: llm

  • Description: model ollama-dev-coder failed: http: status 500 Internal Server Error body {"error":{"message":"llama-server process has terminated: exit status 1: cudaMalloc failed: out of memory\nalloc_tensor_range: failed to allocate CUDA0 buffer of size 5064192000\nerror loading model: unable to allocate CUDA0 buffer","type":"api_error","param":null,"code":null}}

  • Status: open

Independent gate: approve. In-diff blocking bugs: 0. Preexisting handleSaveFields complexity does not block. readNodeValue complexity is a suggestion. The Ollama CUDA failure is fail-open, not a product defect. Report: docs/ai-generated/code-reviews/pr-5429-erlang.md.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.

Saving HTML that contains a NUL does not write. Ordinary HTML still
saves. Cancel and HTTP 400 are not success. Single-line and long-text
NUL gates are unchanged.

Fixes #5412

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
Machine review of the issue 5412 branch. No in-diff bugs.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
@natechadwick-intsof natechadwick-intsof added operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow model:grok-4.7 Session model grok-4.7 labels Oct 8, 2026
Independent review of the assembly HTML NUL change. No in-diff bugs.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.
@natechadwick-intsof

Copy link
Copy Markdown
Collaborator Author

LGTM. Independent Erlang review: no in-diff bugs. Recommendation: approve. Preexisting complexity and the Ollama CUDA failure do not block. Squash-merging.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

@natechadwick-intsof
natechadwick-intsof merged commit 25e9bdc into main Oct 8, 2026
6 checks passed
@natechadwick-intsof
natechadwick-intsof deleted the fix/issue-5412-assembly-html-nul branch October 8, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model:grok-4.7 Session model grok-4.7 operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue 4530 slice 111: Assembly host refuse an HTML NUL

1 participant