KB-4F63
S157-B Species Taxonomy Complete Report
7 min read Revision 1
reports157bspeciestaxonomybirth-registryS157complete
S157-B Species Taxonomy Complete Report
Session: S157-B | Date: 2026-03-21 | Status: COMPLETE PR: https://github.com/Huyen1974/web-test/pull/559 | Merged: squash into main
Assembly Gate
- Q0: YES — ALTER TABLE entity_species + PG birth triggers + bulk INSERT species = PG metadata operations.
- Q1: Directus entity_species collection da co san. ALTER qua DOT schema tool (dot-schema-species-tree-ensure).
- Q2: Nuxt — Khong thay doi. Verify only.
- Q3: Code moi = 1 DOT schema tool (dot-schema-species-tree-ensure). Phan con lai = VPS operations.
- Q4: Test: INSERT entity vao modules → birth record co species_code = 'module'. PASS.
- Q5: Rollback: DELETE 18 species + DROP columns + DROP triggers. Git revert PR.
Changes — 1 file
| File | Type | Description |
|---|---|---|
| dot-schema-species-tree-ensure | NEW | ALTER entity_species +parent_id +depth + meta composition_level |
VPS Operations Executed
Part 1: Birth triggers deployed — 18 governed collections
| # | Collection | Code field | Trigger | Status |
|---|---|---|---|---|
| 1 | dot_tools | code | trg_birth_dot_tools | Phase A |
| 2 | agents | code | trg_birth_agents | PASS |
| 3 | checkpoint_sets | code | trg_birth_checkpoint_sets | PASS |
| 4 | checkpoint_types | code | trg_birth_checkpoint_types | PASS |
| 5 | collection_registry | code | trg_birth_collection_registry | PASS |
| 6 | entity_dependencies | code | trg_birth_entity_dependencies | PASS |
| 7 | entity_species | code | trg_birth_entity_species | PASS |
| 8 | meta_catalog | code | trg_birth_meta_catalog | PASS |
| 9 | modules | code | trg_birth_modules | PASS |
| 10 | system_issues | code | trg_birth_system_issues | PASS |
| 11 | tasks | code | trg_birth_tasks | PASS |
| 12 | taxonomy | code | trg_birth_taxonomy | PASS |
| 13 | taxonomy_facets | code | trg_birth_taxonomy_facets | PASS |
| 14 | ui_pages | code | trg_birth_ui_pages | PASS |
| 15 | workflow_change_requests | code | trg_birth_workflow_change_requests | PASS |
| 16 | workflow_steps | code | trg_birth_workflow_steps | PASS |
| 17 | workflows | process_code | trg_birth_workflows | PASS |
| 18 | table_registry | table_id | trg_birth_table_registry | PASS |
Skipped (no code column): entity_labels, label_rules, entity_rules
Part 2: entity_species — tree support
- parent_id: ADDED (integer FK to entity_species.id)
- depth: ADDED (smallint DEFAULT 1, values 0/1/2)
- composition_level choices: UPDATED (+meta)
Part 3: 21 species registered
| # | code | species_code | display_name | level | mode |
|---|---|---|---|---|---|
| 1 | SPE-CAT | catalog | Danh muc he thong | atom | governed |
| 2 | SPE-TBL | table_ui | Bang UI | molecule | governed |
| 3 | SPE-MOD | module | Module | compound | governed |
| 4 | SPE-WKF | workflow | Quy trinh | compound | governed |
| 5 | SPE-WFS | workflow_step | Buoc quy trinh | molecule | governed |
| 6 | SPE-WCR | wcr | De xuat thay doi | compound | governed |
| 7 | SPE-DOT | dot_tool | DOT Tool | atom | governed |
| 8 | SPE-PGE | page | Trang UI | molecule | governed |
| 9 | SPE-COL | collection | Collection | molecule | governed |
| 10 | SPE-TSK | task | Nhiem vu | compound | governed |
| 11 | SPE-AGT | agent | Agent | atom | governed |
| 12 | SPE-CPT | checkpoint_type | Loai checkpoint | atom | governed |
| 13 | SPE-CPS | checkpoint_set | Bo checkpoint | molecule | governed |
| 14 | SPE-DEP | dependency | Phu thuoc | atom | governed |
| 15 | SPE-LBL | entity_label | Entity Label | atom | governed |
| 16 | SPE-FAC | label_facet | Chieu phan loai | atom | governed |
| 17 | SPE-LBR | label_rule | Quy tac gan nhan | atom | governed |
| 18 | SPE-SPE | species | Loai | meta | governed |
| 19 | SPE-ERL | entity_rule | Quy tac thuc the | atom | governed |
| 20 | SPE-ISS | system_issue | Van de he thong | atom | governed |
| 21 | SPE-DXF | directus_field | Directus Field | atom | observed |
Part 4: species_collection_map — 20 mappings
20 governed collection-to-species mappings created. All is_primary = true.
PG Verification
birth_registry_total: 1425
governed: 1425
certified: 1407
uncertified: 18 (the 18 new species records — auto-inserted by trigger, not yet inspected)
null_species: 0
entity_species: 21
species_collection_map: 20
Per-species distribution:
system_issue: 738
dependency: 141
collection: 138
dot_tool: 112
workflow_step: 70
entity_label: 55
page: 37
catalog: 33
checkpoint_type: 31
species: 21
table_ui: 20
task: 6
label_facet: 6
agent: 6
module: 4
wcr: 3
checkpoint_set: 2
workflow: 2
Test INSERT → Birth Auto with Species
INSERT INTO modules (code, name, _dot_origin, status) VALUES ('M-999', 'Test', 'MANUAL-test|claude|2026-03-21T13:00:00', 'draft');
Result: PASS
- entity_code = M-999
- collection_name = modules
- species_code = module (auto-resolved)
- composition_level = compound (auto-resolved)
- dot_origin = MANUAL-test|claude|2026-03-21T13:00:00 (from entity row)
- governance_role = governed
- certified = false (new, uncertified)
Cleaned up after test.
Nuxt Verify
- Homepage: 200 OK
- Directus health: 200 OK
- /knowledge/registries: 200 OK
- No regression. Phase B has no Nuxt changes.
- KHOP — Nuxt /registries hien thi dung. PG birth_registry: 1425. 18 collections covered.
Governance Classification
| governance_role | count |
|---|---|
| governed | 19 collections |
| observed | 2 collections (directus_fields, label_rules) |
Tu Kiem Tra
| # | Cau hoi | Ket qua |
|---|---|---|
| 1 | Birth triggers deployed cho TAT CA governed collections? | DAT (18 collections) |
| 2 | birth_registry COUNT bao gom MOI governed entities? | DAT (1425 records, 18 collections) |
| 3 | entity_species = 21 records? parent_id + depth? | DAT |
| 4 | species_collection_map >= 20 governed mappings? | DAT (20) |
| 5 | INSERT entity moi → birth record co species_code? | DAT (M-999 test) |
| 6 | birth_registry species_code backfill cho records cu? | DAT (0 null species) |
| 7 | HC GREEN, Smoke PASS, Nuxt OK? | DAT |
| 8 | Report dung path Agent Data? PR + CI GREEN? | DAT |
S157-B COMPLETE. Species Taxonomy 21/21. Birth Registry 1425 records. 18 collections covered.
S157-B | 2026-03-21 | PR #559 merged | 21 species | 20 mappings | 1425 birth records | 0 null species