KB-3511

Codex GPT Context Report — UI 4 Mothers

17 min read Revision 1
ui-reviewgpt-context4-mothersincomexmanifestqaprompt-v4

title: "Codex GPT Context Report — UI 4 Mothers" tags:

  • ui-review
  • gpt-context
  • 4-mothers
  • incomex
  • manifest
  • qa
  • prompt-v4 date: 2026-07-02 status: current

Codex GPT Context Report — UI 4 Mothers

0. Skill / Scope Guard

Tuyen ngon thuc thi: doc truoc khi code; chi ket luan theo bang chung song; merge khong bang done. Bao cao nay chi doc va verify public UI, khong sua UI, khong chay prompt v4, khong ghi vao public docroot. Bang chung gom local skill, Agent Data search, public curl, static read, Playwright QA tren URL public.

9 nguyen tac ap dung: SSOT truoc; Constitution truoc; metadata > code; DOT truoc SQL; UI khong chua business logic moi; verify public production; khong background agent; khong git add .; thieu pasted output thi khong PASS.

Agent Data / law context da doc:

search_knowledge("operating rules SSOT")
=> knowledge/dev/ssot/vps/vps-operating-rules.md
=> Version 1.0, Date 2026-02-28, Active

search_knowledge("hiến pháp v4.0 constitution Incomex active version")
=> knowledge/dev/laws/constitution.md
=> active title: Hiến pháp v4.6.3 BAN HÀNH
=> revision metadata: v4.6.3

search_knowledge("UI 4 Mothers prompt v4 B1 modit B2 split system-manifest qa-contracts prompt nén")
=> Khong tim thay full prompt v4; tim thay report lien quan va tai lieu UI 4 Mothers truoc do.

1. Executive Verdict

Verdict: GO_WITH_PATCH.

Y nghia chinh xac:

  • GO_WITH_PATCH cho B1 neu viec tiep theo chi la patch/phau thuat modit-entry-enhance.js hoac review B1 voi dieu kien append-only, co pre/post QA public, khong overwrite base engine, khong dua report/golden vao public UI.
  • NO_GO neu muon chay prompt v4 ket hop B1 + B2 ngay lap tuc. Full prompt v4 khong duoc tim thay trong KB/local, va B2 tach system-manifest.js / qa-contracts.js la thay doi kien truc phai thanh phase rieng.
  • MERGE != DONE. Trang thai chi duoc tinh done neu QA public production PASS voi output that va web-state/path integrity khop.

Ly do: live UI hien tai dang xanh tren public QA, manifest v5.3 co du cac dau moc contract moi, web-state khop core files, va duplicate guard da ton tai o engine layer. Rui ro con lai nam o viec prompt v4 co the lam B2 split cung B1, thay doi canonical.core_files, lam hong deep-equal/path-integrity va/hoac test nham local workdir thay vi public URL.

2. Environment / Public Path Verification

Public base da verify bang curl read-only:

https://incomex.vn/ui-preview/mcp-writes/

Host/local context:

pwd
/Users/nmhuyen/Documents/Manual Deploy/web-test

VPS absolute path trong prompt khong truy cap duoc tu Codex local hien tai:

ls -ld /opt /opt/incomex /opt/incomex/docs /opt/incomex/docs/mcp-writes /opt/incomex/docs/mcp-writes/ui-preview
ls: /opt/incomex: No such file or directory
ls: /opt/incomex/docs: No such file or directory
ls: /opt/incomex/docs/mcp-writes: No such file or directory
ls: /opt/incomex/docs/mcp-writes/ui-preview: No such file or directory
drwxr-xr-x  3 root  wheel  96 Jul 12  2025 /opt

Docker/nginx local khong truy cap duoc tu session nay:

docker ps -a
Cannot connect to the Docker daemon at unix:///Users/nmhuyen/.docker/run/docker.sock. Is the docker daemon running?

docker inspect incomex-nginx ...
Cannot connect to the Docker daemon at unix:///Users/nmhuyen/.docker/run/docker.sock. Is the docker daemon running?

Ket luan environment: public URL doc duoc va QA chay duoc; host path /opt/incomex/... va container bind mount la UNKNOWN trong session local nay, khong duoc suy dien.

Public file fetch:

200    84671 system-manifest.js
200    63663 qa-contracts.js
200     4996 binding-status.js
200    11098 eco-nav.js
200     9230 entry-engine.js
200    24321 modit-entry-enhance.js
200    29078 qa-runner.html
200    16852 guide.html
200     9073 guide-extra.js
200    14398 he-thong-thiet-ke.html
200     8326 he-thong-dau-noi.html
200     6310 entry-savemode.js
200      785 web-state.json
200      346 web-intent.json

Sensitive-path public probe mau:

404 153 .git/config
404 153 .env
404 153 .env.local
404 153 .DS_Store
200 785 web-state.json

3. Files Inspected

File Size (bytes) sha256 Role read_ok
system-manifest.js 84671 c6b47889548508e982ada8405a7b034d3d909c7c51c1818b2e6c2904df544731 SYS contract / manifest yes
qa-contracts.js 63663 7918a9c749c24c506e379d2fffae1df0438b8f3bfcb39e8914d9bdea5790a664 QA_EXTRA contract checks yes
binding-status.js 4996 ef5fff546f511c3ff9944548bd113f41cb3ac418909941d04b8aee7d9ee587b5 binding status UI yes
eco-nav.js 11098 a60307f2ed7d13a53a9a2197600bb774e15215759116f460193013f2c0e787cd navigation contract yes
entry-engine.js 9230 52f56a78011fed84432f76303e76a08b9a6fb7fe2a49af82ddfc708a63854198 entry engine / saveShape yes
modit-entry-enhance.js 24321 fa6082a0714f01361e87a5dd4a11fd4fa5b7aa42871c6e0b28a592606672308f Modit entry enhancement yes
qa-runner.html 29078 88c0eb15c7c08444cb4a36949a94e4ee05944d96333ac1a103e7a4bee14ceaf8 public QA runner yes
guide.html 16852 c90b7e288c16683c9aa3ec6d46e852cda32e8c9bbace9dafdc341526677d0315 official guide surface yes
guide-extra.js 9073 9f919078e36238256fe43a4afaaaec3bb2ad4d099a60a362413dbdc309f479a9 guide extension yes
he-thong-thiet-ke.html 14398 c0f6788c0ece512e32d8398759914ada8c3623227f23f672de9669d36272a3fd design system surface yes
he-thong-dau-noi.html 8326 5aae2eef22e3d1991ef57fb3adc7bab6d9da200f6203088492ad85687150f8b6 binding/connect surface yes
entry-savemode.js 6310 11a8cd2fa72ca6347be6a780bfd3296c45c1f43993806e2ca56fdeace9537066 entry save mode yes
web-state.json 785 3c5279686f64314b057ecce840968a144962b487bb69ba2ffc9862d010af35a3 public state/golden yes
web-intent.json 346 5b819cb3e812abbf287d3cdce99fd7a5ee0b7571eb04b4a1dec7c8ef5e3889f5 allowed intent diff yes

4. Manifest Effective Structure

Runtime evaluation:

SYS_META {"name":"Hệ UI 4 Mẹ — Incomex Saigon","version":"manifest v5.3 (+kestra_heads + directus_capabilities + integrity_contract + pre_dot_birth_blockers)","updated":"2026-07-02","scope":"UI-side contract. Số liệu là YÊU CẦU UI đặt ra cho PG, không phải trạng thái PG hiện tại.","note_pg":"PG có thể CHƯA có các bảng này — không sao. Agent sẽ tạo theo hợp đồng (qua Đ0-G + cổng duyệt)."}
COUNTS {"tables":23,"laws":26,"dots":8,"surfaces":18,"core_files":11}
DOTS DOT-HARVEST,DOT-PROBE,DOT-BIRTH,DOT-WIRE,DOT-TEST,DOT-GUARD,DOT-QA-HARVEST,DOT-REL
HAS {"ui_business_object":true,"ui_relation":true,"dot_rel":true,"backend_map":20,"backend_pending":20}
CORE_FILES system-manifest.js:40000:window.SYS|qa-contracts.js:14000:QA_EXTRA|eco-nav.js:8000:UI_CONTRACT|entry-engine.js:1500:EntryEngine|modit-entry-enhance.js:1500:refInputs|guide.html:4000:manifest|guide-extra.js:1500:entry_binding|he-thong-thiet-ke.html:4000:manifest|he-thong-dau-noi.html:2500:manifest|entry-savemode.js:800:saveMode|binding-status.js:3000:BINDING_STATUS

Effective structure dang co:

  • tables: 23, trong do co ui_business_object va ui_relation.
  • laws: 26.
  • dots: 8, gom DOT-HARVEST, DOT-PROBE, DOT-BIRTH, DOT-WIRE, DOT-TEST, DOT-GUARD, DOT-QA-HARVEST, DOT-REL.
  • surfaces: 18.
  • canonical.core_files: 11 file, gom manifest, QA, nav, engine, modit, 3 HTML/JS guide surfaces, save mode, binding status.
  • backend_map: 20 pending mappings, dang la contract UI dat ra cho PG, khong phai bang chung PG da co bang.

Append v5.3 dang co trong system-manifest.js:

  • S.kestra_heads: co correlation/workflow_run/orchestration_state; yeu cau them truoc wire: idempotency_key, attempt_count, last_error, compensation_state, lease_heartbeat, resume_token, event_schema_version.
  • S.directus_capabilities: co entry_binding + scope_code_spec; yeu cau pagination/cursor, sort/order, field projection, type coercion, timezone/token time, M-N filter mapping, field-permission snapshot truoc wire.
  • S.integrity_contract: yeu cau multi-table transaction, schema versioning, migration path, audit propagation, permission propagation, event outbox.
  • S.pre_dot_birth_blockers: backend_map_decided, scope_code_structured, kestra_heads_added, multi_table_txn; co law PRE-BIRTH-GATE.
  • S.meta.version da set manifest v5.3.

5. QA System

QA contract evaluation:

QAC {"active":56,"sentinel":true,"bySuite":{"Miền dữ liệu":3,"Công cụ":5,"Phase B":1,"Phase C":4,"Khóa":4,"Nhập liệu":18,"Chống-quên":13,"Đồng bộ 3 thực thể":1,"Backend (design-time)":4,"Đầu ra":3}}
RUNNER {"base_dot":true,"qa_result":true,"ok_formula":0,"withTimeout":3,"wdcut":13,"chotMoc":true,"chotMocCore":true}

Runner mechanics da doc:

  • BASE='./'.
  • withTimeout co watch-dog.
  • Suite extra timeout va suite timeout deu tang __WDCUT.
  • clean=(totFail===0 && __WDCUT===0).
  • window.__QA_RESULT expose total/pass/fail/warn/wdcut/timeouts/ok.
  • chotMoc() hash SYS.canonical.core_files tu guide frame bang string length + djb2, khong phai cryptographic hash.

Public web-state/path-integrity verification:

OK system-manifest.js state=76194/2633092126 live=76194/2633092126
OK qa-contracts.js state=59745/1980198745 live=59745/1980198745
OK eco-nav.js state=10638/1278338427 live=10638/1278338427
OK entry-engine.js state=8972/506044135 live=8972/506044135
OK modit-entry-enhance.js state=23496/151456376 live=23496/151456376
OK guide.html state=15977/2447880021 live=15977/2447880021
OK guide-extra.js state=8500/2789430186 live=8500/2789430186
OK he-thong-thiet-ke.html state=13976/3150980252 live=13976/3150980252
OK he-thong-dau-noi.html state=8041/2700124134 live=8041/2700124134
OK entry-savemode.js state=5920/619881482 live=5920/619881482
OK binding-status.js state=4659/1320086943 live=4659/1320086943
intent_files 0
changed_count 0

Public Playwright QA output:

{
  "result": {
    "at": "2026-07-02T10:26:28.847Z",
    "total": 111,
    "pass": 102,
    "fail": 0,
    "warn": 9,
    "wdcut": 0,
    "timeouts": 0,
    "seconds": 57,
    "ok": true,
    "reds": []
  },
  "countsText": "102 xanh · 0 đỏ · 9 cảnh báo · 57s"
}

Luu y: lan thu hai de lay chi tiet warning bi Playwright default timeout 30s, nen bao cao nay khong vien dan chi tiet 9 warning:

QA_WARN_FAILED: page.waitForFunction: Timeout 30000ms exceeded.

6. modit-entry-enhance.js Analysis

Static summary:

MODIT bytes=24321 chars=23496
top_level_IIFE=6
App.preview_wraps=6
role_kind_v1=true
role_kind_v2=true
role_kind_v3=true
formZone=true
vInp=true
moldJson=true
dupBanner=true

Important observed behavior:

  • Co 6 top-level IIFE va 6 lan wrap App.preview. Day la append-layer style, khong phai mot module sach duy nhat.
  • newRef() tao reference input mac dinh.
  • Host resolution refZoneParent() dung #formZone cho MODIT, parent cua #vInp cho MODT, fallback parent cua #moldJson hoac document.body.
  • First wrap render reference zone va augmentMold().
  • augmentMold() tao reference_inputs, valueList, save_shape, ghi lai #moldJson.
  • C3 table-first add target collection UI, sinh value_fields, set window.MOLD.
  • Freeze/guard logic chi freeze role neu label da doi so voi default; value column freeze neu raw field co key kit/k/key/id, nguoc lai van slug theo label.
  • Duplicate guard co banner; final role_kind v3 dung slug va danh dau role_kind_source.

Engine-layer duplicate guard da co trong entry-engine.js:

  • Original saveShape co nguy co overwrite, nhung append override da thay bang dup guard.
  • Override set E.__dupGuarded=true, tao suffix cho duplicated ref/value columns, va ghi out.__dup_guard.
  • QA co check "Direct engine duplicate guard" va dang active.

Ket luan B1: Neu can sua B1 thi chi nen patch cuc bo mot diem can thiet, giu engine dup guard, them QA neu doi behavior. Khong nen viet lai toan bo modit-entry-enhance.js trong prompt v4.

7. Prompt v4 Risk Review

Full prompt v4 khong tim thay trong KB/local theo search hien co. Review duoi day dua tren mo ta trong prompt hien tai: B1 modit-entry-enhance.js, B2 split system-manifest.js / qa-contracts.js, va cac rui ro user neu.

Risk matrix:

Item Verdict Reason
B1 modit-entry-enhance.js patch GO_WITH_PATCH Live QA ok, engine dup guard da co. Chi duoc patch surgical/append-only, pre/post public QA, khong overwrite engine layer.
B2 split manifest/QA NO_GO in same prompt Tach file lam doi SYS.canonical.core_files, loader/order, web-state, path-integrity va deep-equal SYS. Phai la phase rieng.
.git / dotfile public exposure PASS sample probe .git/config, .env, .env.local, .DS_Store deu 404 tren public probe mau.
Test workdir vs live URL HIGH RISK Acceptance phai curl public URL va chay QA public, khong duoc chi test local/tmp.
Golden/report trong public docroot NO_GO Bao cao/golden phai nam KB hoac audit path ngoai public UI. Khong dat vao ui-preview.
git add . FORBIDDEN Phai stage dung file, khong gom artifact/report/cache ngoai scope.
Prompt v4 as-is NO_GO Full prompt khong co de kiem tra; neu gom B1+B2 thi qua rong va pha contract verification hien tai.

Nhung dieu prompt v4 bat buoc co neu muon duoc chay:

  • Public URL acceptance: https://incomex.vn/ui-preview/mcp-writes/qa-runner.html.
  • Pre/post curl size/hash cho files touched.
  • Pre/post window.__QA_RESULT voi fail=0, wdcut=0, ok=true.
  • Neu doi canonical.core_files, phai update web-state.json, intent, QA loader va path-integrity trong cung phase B2 rieng.
  • Khong ghi report, golden tam, backup, .git, .env, cache vao public docroot.
  • Khong goi SQL tay, khong ALTER TABLE, khong dua business logic vao Nuxt.
  1. Dua bao cao nay cho GPT review nhu context current.
  2. Yeu cau GPT phan tach quyet dinh:
    • B1: co can patch nua khong, neu co thi patch nao la minimum.
    • B2: thiet ke phase split rieng, khong thuc thi chung voi B1.
  3. Neu Owner muon chay B1, tao prompt moi chi gom B1 surgical, voi acceptance public QA va exact touched files.
  4. Chua chay B2 cho den khi co design doc rieng gom loader order, canonical.core_files, web-state.json, web-intent.json, path-integrity, deep-equal strategy va rollback.

Recommended operational verdict: khong chay prompt v4 as-is; chay GPT review truoc, sau do moi tao prompt B1 nho hon.

9. Notes For GPT

  • Live state hien tai dang QA ok true tren public runner: 102 xanh, 0 do, 9 canh bao, wdcut=0.
  • system-manifest.js dang la manifest v5.3, khong chi la v5.2.
  • qa-contracts.js co 56 active QAC, gom check duplicate guard, backend heads, pre-dot-birth blockers va value stable lock.
  • modit-entry-enhance.js hien la nhieu append IIFE/wrap; sua lon rat de tao order bug.
  • entry-engine.js da co engine duplicate guard; neu B1 can fix UI builder thi khong duoc lam mat guard nay.
  • web-state.json hien khop 11 core files; B2 split se lam mat moc nay neu khong update dong bo.
  • web-intent.json hien whitelist rong theo verification (intent_files 0).
  • Current Codex local khong thay /opt/incomex/... va khong connect Docker daemon, nen khong ket luan ve bind mount/container.
  • Full prompt v4 khong tim thay, nen moi verdict ve prompt v4 as-is phai bao luu.

10. Open Questions For Owner

  1. Owner muon GPT review de quyet dinh B1/B2, hay muon Codex tao ngay prompt B1 surgical rieng?
  2. B2 split co phai muc tieu bat buoc trong lan nay khong, hay co the de thanh phase thiet ke rieng?
  3. Bao cao/golden neu can luu ngoai KB thi Owner muon path audit nao ngoai public docroot?
  4. Co can Codex lay chi tiet 9 warning bang mot lan Playwright timeout dai hon khong?

Evidence Checklist

  • Read .claude/skills/incomex-rules.md.
  • Read attached prompt.
  • Agent Data search OR / Constitution / UI 4 Mothers context.
  • Public curl all target files.
  • Static hash table.
  • Manifest runtime evaluation.
  • QA contract evaluation.
  • Public QA runner output pasted.
  • Dotfile public probe.
  • Prompt v4 availability checked.
  • Report saved in KB path, not public UI docroot.