KB-2ED8

GPT Review — G8B Directus Roles/Permissions Prompt v0.1

5 min read Revision 1
s186gpt-reviewg8bdirectusrolespermissionsdieu38p9needs-patch

GPT Review — G8B Directus Roles/Permissions Prompt v0.1

Date: 2026-04-28

Verdict

CONDITIONALLY READY — patch to v0.2 with 4 focused fixes, then final review.

The prompt is directionally correct and aligned with Directus 11 Role → Access → Policy → Permissions model. No major constitutional/law conflict is found if execution waits for explicit User GO and remains within G8B scope.

However, 4 issues should be patched before dispatch. These are not cosmetic; they affect whether the gate can honestly PASS.

Law / constitutional check

No blocking legal conflict if patched.

  • Hiến pháp / User-gated production: aligned only after GPT PASS + User GO.
  • Điều 38 / LSL-01: aligned. G8B grants governed access to the TAC schema after schema/collections/seed exist.
  • Điều 33: aligned. PostgreSQL remains SSOT; this gate does not mutate public.tac_* truth data.
  • Directus 11 model: aligned in design: permissions bind to policies, not roles.
  • Gate separation: mostly aligned. No DDL, seed, corpus migration, Nuxt, registry/birth/catalog.
  • G11: not yet authorized.

Accepted strengths

  1. Correct model: Role → Access → Policy → Permissions.
  2. Correct hard exclusions.
  3. Token provisioning is not attempted blindly.
  4. Matrix intent is right: tac-agent CRU core / CRUD members / read vocab-config; tac-admin CRUD all 14.
  5. Gate A/B/C integrity checks are included.

Required v0.2 patches

Patch 1 — Resolve permission count contradiction

v0.1 says the goal is 28 permission rows, then later correctly computes:

  • tac-agent-policy: 28 rows
  • tac-admin-policy: 56 rows
  • total: 84 rows

v0.2 must consistently state:

  • 2 roles
  • 2 policies
  • 2 access bindings
  • 84 permission rows total
    • 28 for tac-agent-policy
    • 56 for tac-admin-policy

Also patch the PASS criteria accordingly.

Patch 2 — Token deferral must be reflected in gate naming/status

G8A §6.2 included token provisioning as a PASS criterion. v0.1 defers token provisioning due to GSM access/path. This is acceptable only if stated honestly.

v0.2 must declare one of these explicitly:

Option A — preferred for speed:

  • This prompt executes G8B-RP: roles/policies/permissions only.
  • It can PASS the role/permission part of G8B.
  • Token provisioning remains a separate pre-G11 gate or G8B-token follow-up.
  • Do not claim full G8B/P9 G8 PASS until token gate is resolved.

Option B:

  • Include token provisioning only if approved GSM path is confirmed and safe.

Given current prompt, choose Option A.

Patch 3 — Idempotency / partial-state handling needs tightening

v0.1 says roles/policies should not exist and STOP if they do. That is safe but not fully aligned with an ensure gate and can be brittle after partial attempts.

v0.2 should say:

  • If tac-* role/policy/access/permission objects already exist before mutation, snapshot and classify:
    • exact match to target → allowed to treat as already satisfied / skip;
    • partial or mismatch → STOP and report;
    • unknown extra tac-* objects → STOP.
  • No blanket delete.

This preserves safety without unnecessary failure on harmless existing exact state.

Patch 4 — Verify full matrix, not just counts + 2 spot checks

Counts alone can pass with wrong actions. v0.2 should require a deterministic expected matrix file/table generated in the prompt and compare actual rows against it.

Minimum acceptable:

  • list expected tuples (policy_name, collection, action) for all 84 rows;
  • fetch actual tuples from Directus;
  • compare expected minus actual = 0 and actual minus expected = 0;
  • then spot checks are optional evidence, not the main proof.

Non-blocking notes

  • app_access=false for tac-admin-policy is acceptable because G8A left it pending and default false is safer.
  • Role IDs and policy IDs may be logged; tokens must be masked.
  • If Directus API defaults permission fields incorrectly, Agent should capture full response. No need to over-design unless execution fails.

Directive to Opus 4.6

Patch G8B v0.1 → v0.2 with the 4 focused fixes above. Do not expand scope into seed, DDL, registry/birth/catalog, corpus migration, Nuxt, or G11.

Return v0.2 for GPT final review. No Agent execution is authorized yet.