KB-4F4F

GPT Decision S191 — P10D-2A evidence PASS, choose minimal Directus composition path

5 min read Revision 1
s191p10dp10d-2aevidence-passassembly-firstdirectusnuxtgpt-decision

GPT Decision S191 — P10D-2A evidence PASS, choose minimal Directus composition path

Date: 2026-04-30
Phase: TAC MVP / P10D
Decision: P10D-2A evidence accepted. Proceed with minimal Directus composition prompt, not broad platform refactor.


1. Evidence read

Read report:

knowledge/dev/laws/dieu38-trien-khai/reports/p10d-2a-evidence-quick-check-2026-04-30.md


2. Corrections accepted

Opus correction is accepted:

  • Previous claim that /docs / /knowledge/[...slug] hardcoded KB API was wrong.
  • Evidence shows the existing knowledge/document reader path uses Directus collections:
    • knowledge_documents
    • agent_views
  • DocsTreeView and buildDocsTree are source-agnostic.
  • This means the core pattern already exists:
Directus collection → readItems() → map to tree-shaped list → buildDocsTree() → DocsTreeView + markdown/prose reader

This is Assembly First reuse, not greenfield architecture.


3. What is still true

The current /knowledge/laws/index.vue is only partially config-driven:

  • data comes from governance_docs via Directus;
  • section grouping and categories are hardcoded in the page;
  • adding an official TAC section to that exact page cannot be done purely by Directus config today.

A future root fix is a section/layout registry for laws pages, but that is not required for the MVP pilot.


4. Decision: choose minimal composition path now

Do not choose a broad D2 platform capability now.

Choose a narrow MVP composition step based on the already-proven Directus reader pattern.

Recommended next task:

P10D-2B — Official TAC Laws Reader Composition Prompt

Principles:

  • reuse existing Directus SDK pattern;
  • reuse DocsTreeView, buildDocsTree, and markdownToHtml;
  • no new server route;
  • no direct PG;
  • no new custom renderer;
  • no new tree component;
  • no DDL/DML;
  • no Directus mutation;
  • preserve current /knowledge/laws behavior;
  • make the smallest UI composition needed to expose D35/D32/D28.

5. Preferred implementation shape

Because User wants /knowledge/laws as the official area, the prompt should evaluate two minimal shapes and pick the smaller one during implementation:

Shape A — Add official TAC area inside existing /knowledge/laws/index.vue

  • Add a section Tài liệu chính thức / Official TAC Laws.
  • Fetch tac_publication list via Directus.
  • Link each publication to a TAC reader route.
  • Use minimal page composition.

Shape B — Add a dedicated child reader route under /knowledge/laws/[pubId].vue

  • Reuse pattern from /knowledge/[...slug].vue.
  • Fetch tac_publication_member for selected pub.
  • Map rows into tree/list shape.
  • Feed DocsTreeView and markdownToHtml.

If Shape B requires a new page file, it is still an assembly composition exception, not a new server/data architecture, because it reuses existing Directus/Nuxt primitives and avoids all forbidden patterns.

However, the prompt must explicitly state this exception and justify why pure config cannot attach it today: current laws page section layout lacks section registry.


6. What not to do now

Do not start D2 “Collection Document Reader capability” now.

D2 is a valid future root fix when migrating the rest of KB into PG, but it is a broader platform capability and should be designed separately after the pilot view is visible.

Do not refactor the existing /knowledge/[...slug] reader into generic platform code in this step.

Do not attempt topic graph, search, admin/review workflow, auto-linking, or full folder migration in this step.


7. Direction to Opus

Opus should draft P10D-2B prompt for GPT review.

The prompt must be small and concrete:

  1. Gate 0 SSH + repo path.
  2. Backup/check git status.
  3. Inspect existing reader files immediately before patching.
  4. Patch only the minimal files needed.
  5. Prefer no new component files.
  6. If adding a route file is necessary, justify it as an assembly composition page using existing primitives.
  7. Verify:
    • /knowledge/laws still works;
    • official TAC list shows D35/D32/D28;
    • selecting one publication renders tree + content;
    • D35 has 36 nodes;
    • no direct PG, no server route, no custom renderer/component.
  8. Upload report.
  9. STOP.

8. Boundary

P10D-2B implementation is not yet authorized. Only prompt drafting is authorized.

GPT review required before dispatch because this may touch Nuxt page files, even if only as assembly composition.

Back to Knowledge Hub knowledge/dev/reports/gpt-decision-s191-p10d-2a-evidence-pass-next-minimal-composition-2026-04-30.md