KB-586C

06 — Label / Grouping Governance Alignment (Đ24 / Đ29)

7 min read Revision 1
dieu24dieu29labelgroupingclassificationtaxonomyregistries-pivot

06 — Label / Grouping Governance Alignment (Branch F)

Sources: Đ24 Label Law v1.3 (FROZEN), Đ29 Collection Classification Law v2.0 (knowledge/dev/laws/), live taxonomy_facets/taxonomy/label_rules/entity_labels.

1. Does Đ24 already govern labels sufficiently?

Largely yes. Đ24 governs system-wide multi-dimensional faceted classification ("toàn hệ thống") via 5 collections (taxonomy_facets, taxonomy, taxonomy_matrix, entity_labels, label_rules). It defines grouping ("Cùng nhóm" = §5.4 Scored Union Top-N, per-facet), label provenance (§10 FAC-PROV: PROV-AI/HUMAN/DOT), and value lifecycle (status active/deprecated + replaced_by with cycle/same-facet checks). Gap: Đ24 has no human-approval gate to create a new facet/dimension — additions are INSERT ... ON CONFLICT DO NOTHING ("data not code"). That is why new grouping dimensions are currently ungoverned by Đ32.

2. Are taxonomy_facets enough to represent grouping dimensions?

Yes. Live: 10 facets (FAC-01 expertise, FAC-02 system-role, FAC-03 action, FAC-04 impact-scope, FAC-05 phase, FAC-06 serves-whom, FAC-07 which-doc, FAC-08 content-topic, FAC-09 architecture-layer, FAC-PROV provenance). FAC-09 directly models the composition-layer grouping the GPT direction asked for. cardinality ∈ {single, multiple} + max_labels_per_entity per facet. These ARE the grouping dimensions — no new dimension store needed.

3. Are entity_labels enough to represent applied classifications?

Yes (~755k rows, junction entity↔label with assigned_by ∈ {auto,rule,user,ai,dot}). Grouping count = pivot PIV-311 (GROUP BY label_code). No new applied-label store needed.

4. Where should threshold policy live?

LAW_GAP — it lives nowhere today. The "max-ungrouped 50 ceiling" is in no law. Đ24's only ceiling is taxonomy_facets.max_labels_per_entity (per-entity label cap, anti-farming — NOT a display ceiling). Đ26's only "max" is max-7-dimensions. Recommendation: the per-species ungrouped-display ceiling belongs as a clause in Đ24 (grouping/display threshold) or Đ29, owned by whoever owns classification (→ GOV-COUNCIL), expressed as a reference table (Đ24 pattern: INSERT a row, never hardcode 50). It is a ceiling, not a target; pagination ≠ semantic grouping.

5. Is threshold policy part of label law, pivot law, or governance org?

It is a grouping/display concern → best in Đ24 (label/grouping) as a small clause, with the enforcement (when a list exceeds the ceiling → emit CLASSIFICATION_REQUIRED) wired through Đ31 integrity + Đ45 events. NOT Đ37 (that only assigns the owner).

6. Who owns grouping policy?

Law: classification domain → Đ24 primary, Đ29 secondary. Agency: currently none → recommend GOV-COUNCIL (doc 03/12). Đ29 explicitly forbids parallel systems: "Hai hệ thống hành chính song song = vi phạm Assembly First + Điều 28." So Registries-Pivot must reuse Đ24/Đ29, never build its own.

7. Who can approve a new grouping dimension?

Today: nobody (INSERT-only). Should be: an approval_requests of type schema_add (new facet) or rule_change (new label rule) decided under Đ32 — for a cross-system dimension that is medium+ risk → ≥1 president; for a structural/law-touching change → council_review.

8. Who can approve auto-label application?

label_rules drive fn_auto_label_assignment(). Rule CHANGES should be rule_change approvals (Đ32). Individual auto-assignments are not approval-gated (volume) but are capped per facet and over-cap writes to system_issues (Đ24 v1.3 anti-farming).

9. How to prevent label farming / over-labeling?

Already enforced (Đ24 v1.3, Gemini-R3): multi-cardinality facets enforce max_labels_per_entity; auto-assign past the cap → do NOT assign + write system_issues. Reuse this; do not re-implement.

10. How to detect stale/wrong labels?

Partial today: status='deprecated' + replaced_by chain; provenance (FAC-PROV) flags AI-set labels for human review; Đ29 fn_registry_health() detects misclassification ("nhầm chuồng" — excluded collection holding governed species). Gap: no active "wrong-label" scanner. Recommendation: add a Đ31 contract / A-tier audit DOT (GOV-SIV) comparing applied labels vs rule expectations → system_issues type label_stale|label_wrong.

11. How to validate grouping with the pivot invariant?

Group counts (PIV-311 by label_code) must reconcile to the leaf-scoped accounting invariant (total = counted + orphan + phantom, leaf set only — never blind-SUM over rollup rows = Đ28 double-count trap). Đ31 count-integrity contract owns this check.

Relation map (the layering the GPT "layer clarification" asked for)

Composition level (atom→molecule→compound→material→product→building)   ← semantic axis (Đ0-B), FAC-09
        ⟂ orthogonal to ⟂
Display / drill layer (L1 rollup → L2 children → L3 objects → substrate)  ← data-driven projection (Đ26 L1-L5)
Species (≈33)  →  groups all collections (Đ29 §III "SPECIES GOM")
governance_role (governed/observed/excluded)  →  3-way collection split (Đ29)
Registry collection  →  the source_object of a pivot (Đ26 registry_group)
Label / taxonomy_facet  →  semantic group within a list (Đ24)
  • Composition level ≠ display layer (the GPT clarification's core point): composition is a fixed semantic classification axis; display/drill layers are generated dynamically (variable depth, leaf = object DB substrate). Đ26 L1/L2/L5 are CỨNG (hard), L3/L4 MỀM (soft/dynamic).
  • Grouping dimension = a taxonomy_facet (Đ24) OR a structural axis (composition_level / species / governance_role / registry_group). Both are PG-backed; neither may be a frontend array (Đ28 NT-D1/D3).
  • Top-down grouping (root rollup → composition/species → collection/registry → semantic group/label → object list → substrate) is the recommended path; when a list exceeds the per-species ceiling → emit CLASSIFICATION_REQUIRED (not paginate).

Verdict

Label/grouping is the lowest-island-risk area: Đ24 + Đ29 already centralize it, species/governance_role is the explicit anti-parallel grouping substrate, and the facets/values/junction all exist. The only governance ADDITIONS needed are: (a) a threshold clause (Đ24, LAW_GAP), (b) an approval gate for new dimensions/rules (Đ32 reuse), (c) an agency owner for the classification domain (GOV-COUNCIL), and (d) a stale-label audit (GOV-SIV/Đ31). All REUSE/EXTEND — nothing NEW-local.

Back to Knowledge Hub knowledge/dev/reports/architecture/full-stack-governance-alignment-audit-registries-pivot-grouping-2026-05-31/06-label-grouping-governance-alignment.md