KB-1E3D rev 2

5000x-live — Nuxt factory deploy package (exact blocker)

5 min read Revision 2
iu-core5000x-livenuxtdeploy-packageexternal-blockerhygiene-repaired-by-6000x

5000x-live — Nuxt factory deploy package (exact blocker)

Hygiene note (6000x): title/tags renormalised from "5500x" to "5000x-live" to match the path. Content preserved verbatim except this banner.

Verdict: DONE_WITH_EXTERNAL_BLOCKER — frontend/DevOps owns build/restart.

Artifact reproducibility

  • Factory entry: cutter_agent/iu_core/ui_factory.py (load_descriptor + generate)
  • Descriptor: ui-package/nuxt-three-axis-factory/descriptors/iu_three_axis_envelope.json
  • Templates: ui-package/nuxt-three-axis-factory/templates/ (4 templates)
  • Generated digest (regenerated this macro): 413143da9efa51bfea3a9f4ae74f3b26e4697a30932147566c8f9d1c54c7636e — byte-identical to committed generated/iu_three_axis_envelope/ (digest matches).
  • 4 files: pages/admin/iu-three-axis.vue, composables/useIuThreeAxis.ts, runtimeConfig.snippet.ts, compose.snippet.yml.

Deploy gates (all PASS — substance only, no execution)

Gate Status Verification
Factory-only (no hand-coded Nuxt page) PASS Generated from descriptor + templates; templates carry no IU-specific field name
No PG access PASS Composable imports @directus/sdk + readItems/aggregate only; no pg/postgres reference
No business logic for IU semantics in Nuxt PASS Composable is schema-agnostic; field names injected from descriptor at generation
No hardcoded collection name PASS Reads useRuntimeConfig().public['iuCoreDirectusCollection'], throws if unset
Compatible with live Nuxt env PASS Live repo /opt/incomex/docker/nuxt-repo/web has useDirectus<> composable at modules/directus/runtime/composables/useDirectus.ts; same pattern as composables/useKnowledge.ts
No path overlap PASS Live pages/admin/ has knowledge-tree, super-session, users; iu-three-axis.vue is new
axis_b_tags dict-shape robustness PASS flattenAxisBTags(raw) accepts both string[] and Record<string,string[]>; defect inherited from 4000x found+fixed in 5000x and re-validated against real DIEU-35 data this macro

Exact deploy patch (what frontend/DevOps must apply)

  1. Add 2 files to /opt/incomex/docker/nuxt-repo/web/:

    • pages/admin/iu-three-axis.vue ← copy from ui-package/nuxt-three-axis-factory/generated/iu_three_axis_envelope/pages/admin/iu-three-axis.vue
    • composables/useIuThreeAxis.ts ← copy from ui-package/.../composables/useIuThreeAxis.ts
  2. Edit nuxt.config.ts — merge into runtimeConfig.public:

    iuCoreDirectusCollection: process.env.IU_CORE_DIRECTUS_COLLECTION || 'iu_three_axis_envelope',
    
  3. Add env var to /opt/incomex/docker/docker-compose.yml under nuxt: service environment::

    IU_CORE_DIRECTUS_COLLECTION: iu_three_axis_envelope
    
  4. Build + restart:

    cd /opt/incomex/docker/nuxt-repo/web
    pnpm install --frozen-lockfile      # 1-3 min
    pnpm run build                       # 3-5 min
    sudo rsync -a --delete .output/ /opt/incomex/deploys/nuxt-output/
    docker restart incomex-nuxt          # only this container
    
  5. Smoke (post-restart):

    curl -sS https://ai.incomexsaigoncorp.vn/admin/iu-three-axis -H 'Cookie: <auth>' | head -5
    

    Expected: 3-axis tabs render, axis A groups by axis_a_doc_code (DIEU-35/28/32), axis B by tag, axis C by depth.

Exact blocker

  • VPS-side pnpm install requires network egress to npm registry; web/node_modules is missing on VPS — fresh install needed.
  • web/.output is missing — full build required.
  • Image nuxt-ssr-local:s174 in docker-compose differs from running nuxt-ssr-local:d28gmr-1778407456 — the live image is from an out-of-band build (d28gmr- epoch tag); frontend/DevOps owns this build pipeline.
  • Auto-snapshot pattern in git log (auto-snapshot: 1 files (...) commits every ~12h) indicates an automated PR/build flow on Huyen1974/web-test.git. Deploy SHOULD route through this flow, not via ad-hoc host build.

Reversibility

  • Drop the 2 new files; remove the env var; remove the iuCoreDirectusCollection line; rebuild. The factory artifact is additive-only.
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-5000x-live-ui-ops-real-corpus-pilot-open-goal/02-nuxt-deploy-package.md