Code Development Workflow

SYSTEM SPECIFICATION & CODING PROTOCOL

Self-Documenting Code Architecture & Drift Prevention Protocol

Module ID: SPEC-WP-300  |  Target Engine: System Governance & Code Snippets Registry  |  Status: Active Standard

Purpose & Governance Objectives

To prevent code drift during iterative development, this protocol establishes a formal boundary between system registries and defines a 3-Phase Refactoring Protocol for all backend PHP, shortcodes, and site architecture modifications. All code must remain fully self-documenting and directly map to its designated registry parser.

1. Unified Functional Architecture Matrix

Strict isolation of data sources prevents cross-engine parsing errors while maintaining a cohesive modal/UI layer.

Component Primary Data Source Core Parsing Strategy UI / Interactive Layer
Function Registry Code Snippets DB
($wpdb->prefix . 'snippets')
Description field tags ([[Group]], [sub_function]) & active add_shortcode() scan Topology Legend modal, Jump Bar navigation, copy-shortcode macros
Classification Registry WP Core API
(get_posts / $post->post_name)
Page Slug taxonomy structures (e.g., c4r-hub-*) & category tags System documentation modals, visual schema diagrams, taxonomy jump bars
System Documentation Block Editor / Code Editor HTML Containers Gutenberg comment delimiters (<!-- wp:group -->) & HTML tables Direct post/page render, embedded code blocks, standardized CSS styling

2. 3-Phase Refactoring Protocol

Every new function or modification built upon existing code must progress through three mandatory validation gates:

Phase Stage Mandatory Operational Actions
Phase 1 Audit & Lock Invariants Identify target data sources. Verify that existing regex rules, slug patterns, and comment delimiters remain uncompromised before editing working code.
Phase 2 Self-Doc Draft Define function block headers (Module ID, Target Engine) and Code Snippets Description metadata ([[Group Name]], [sub_function], or @PHP prefix) prior to writing logic.
Phase 3 Execution & Registry Audit Deploy code and verify rendering within

50.10 CONTAINER & PAGE MANAGEMENT (3)

Registry Entity / Macro Sub-Functions & Description
#334
[50.10.10 NATIVE PAGE-TITLE FORMATTER ⚙️334]
System Hub PHP
2026-10-09 13:45
> SELF 334 -canonical
> add_filter( 'the_title',c4r_format_dual_segment_title', 10, 2 )
#397
[50.10.30 PAGE SLUG PARSING ⚙️397]
System Hub PHP
2026-10-04 19:10 397 -canonical
> SELF 397 -canonical
> DEPENDENCY
#427
[50.10.40 PAGE TYPE_ENGINE ⚙️ 427]
System Hub PHP
2026-10-10 08:15
> SELF 427 -canonical
> ,
> ,
> ARRAY ,
> add_action( 'wp', 'c4r_execute_context_resolver'

80.10.10 BASE RESETS (2)

Registry Entity / Macro Sub-Functions & Description
#274
[80.10.10.10 TEMPLATE OPTION THEME ADD ⚙️274]
System Hub PHP
2026-09-29 23:10 274 -canonical
> SELF 274 -canonical
> add_filter( 'theme_page_templates', ... )
> add_filter( 'template_include', ... )
#284
[80.10.10.20 FILL-WIDTH PAGE CANVAS INJECTOR ⚙️284]
System Hub PHP
2026-09-29 23:15 284 -canonical
> SELF 284 -canonical
> add_filter( 'body_class', ... )

80.20 UTILITIES & TOOLS (1)

Registry Entity / Macro Sub-Functions & Description
#386
[80.20.20 PAGE ID LOOKUP ♻️386]
[c4r_page_lookup]
2026-09-29 23:05 386 -canonical
> SELF 386 -canonical
> ,
> add_shortcode( 'c4r_page_lookup', 'c4r_render_page_lookup_shortcode' )

80.30 DATABASE MANAGEMENT (1)

Registry Entity / Macro Sub-Functions & Description
#341
[80.30.10 MODULE REGISTRY, ACCESS, VISIBILITY CONTROLLER 💾⚙️341]
System Hub PHP
2026-09-25 12:45
> SELF 341 -canonical
>
>
>
> HOOKS
> add_option( 'c4r_public_module_registry
> add_action( 'init', 'c4r_register_public_modules_option

ANCHOR-NAV (1)

Registry Entity / Macro Sub-Functions & Description
#021
[SCROLL TO TOP ♻️21]
[c4r_scroll_top]
2026-10-08 15:00
> SELF: - canonical
PAGE TYPES: All (global template utility)

COMMENT BLOCK (3)

Registry Entity / Macro Sub-Functions & Description
#045
[SYS: INVITATION - COMMENT BANNER ♻️45]
[c4r_comment_invitation]
... self  — Invitation for the native WP Comment block  — Includes private message link, and  navigation anchor → {#post_comment}
#048
[SYS: SUBSCRIPTION BOXES ⚙️48]
System Hub PHP
... self  add_action → comment_form_after_fields,  add_action → comment_form_logged_in_after,  —  Build Comment/Conversation Subscription Engine (native JetPack turned off)  —  01.00  Add Jetpack-compatible subscription checkboxes to Native Comment Forms   
—  01.01  Subscribe_comment  —  01.02  Subscribe_blog  —  02.00 Hook into native comment form fields for all users 
#056
[SYS: INVITATION - STARS CONVO BANNER ♻️56]
[c4r_invitation_stars]
— Renders the "Under the Stars" community invitation block— Includes private message link, and navigation anchor → "#front_porch"

DEDICATIONS (1)

Registry Entity / Macro Sub-Functions & Description
#134
[PAGEONE: DEDICATION 🔢134]
[c4r_dedication_beautiful_accident]
, , ,—  Three Front Page functions in one PHP package.

HEADER MANAGEMENT (1)

Registry Entity / Macro Sub-Functions & Description
#020
[PAGEONE: HEADER ECHO ♻️20]
[c4r_header_echo_frontpage]
2026-09-29 08:00
> SELF:

LAYOUT (1)

Registry Entity / Macro Sub-Functions & Description
#415
[10.30.20 PAGE: TYPE_PSEUDO HELPER ⚙️🪛415]
System Hub PHP
2026-10-10 14:00 415 -canonical
> SELF: c4r_inject_context_body_classes()
> SELF: c4r_render_title_as_footer_metadata()
...helper

MISSION CONTROL (2)

Registry Entity / Macro Sub-Functions & Description
#314
[MENU: DB ORPHAN MENUS ⚙️🔢314]
System Hub PHP
2026-09-21— add_action( 'admin_menu', 'c4r_register_nav_cleaner_page' , ,
#318
[SYS: MISSION CONTROL ♻️318]
[c4r_mission_control]
2026-09-21  — includes CALSSIFICATION-DOMAIN Registry DB purge

NAVIGATION (10)

Registry Entity / Macro Sub-Functions & Description
#016
[MENU: REFLECTION SERIES ♻️16]
[c4r_nav_reflection_series]
  ...self    — Reflection Series (1 through 12)  — 6-column equally spaced grid layout, with theme line override
#022
[SYS: SCROLL TO PORCH ♻️22]
[c4r_scroll_porch]
#036
[SIDE BARS: FOUR CORNERS NAV ♻️36]
[c4r_nav_sidebar_four_corners]
... self  — go to: Compendium, mini-Compendium, Directory  — Separator line, gold serif heading, and navigation link index.
#148
[10.30.05 PAGE: TYPE_WP MANAGER ♻️148]
System Hub PHP
2026-09-28 13:50 148 -canonical
> SELF:
> c4r_site_nav_consolidated()
#309
[MENU: FORCE NAV BLOCK STYLES⚙️♻️309]
System Hub PHP
— add_action( 'wp_head', 'c4r_force_navigation_block_styles', 100 )
#311
[10.80.10 PAGE: FLAT SCULPTED NAV ♻️⚙️311]
System Hub PHP
2026-09-21— add_filter( 'the_content', 'c4r_sculpt_flat_pseudo_menu', 99 )— properly named: 
 
 
#333
[MENU: REGISTRY NAV PILLS ♻️333]
[c4r_nav_cornerstone_registries]
... self  —  2026-09-22 22:47  — Mission Control Panel-inspired
#336
[NAR: CLASS LICENSE PLATE - NAV FOOTER 🪛336]
System Hub PHP
  ... Self  2026-09-23 22:26
#354
[10.80.20 PAGE: NAV GRID ♻️354]
[c4r_main_menu_hub]
2026/09/26 20:15 -canonical
> SELF:
#380
[MENU: MENUBAR #2 ♻️373]
[c4r_nav_secondary]
2026-09-28 14:30 373 -canonical
> SELF:
> add_shortcode( 'c4r_nav_secondary',

NOTICE-DISCLAIMER (1)

Registry Entity / Macro Sub-Functions & Description
#141
[FOOTER: COPYRIGHT - SIMPLE BANNERS🔢141]
[c4r_footer_copyright_gold]
, ,—  Replaces individualized c4r_copyright 1 and 2

REGISTRY (10)

Registry Entity / Macro Sub-Functions & Description
#267
[DB: CLASS REGISTRY REPORTER ♻️267]
[c4r_classification_registry_reporter]
NOTE: This function, c4r_classification_registry_reporter, is supported internally by 4r_get_master_regisrty 
#294
[DB: CLASS REGISTRY CSV LOAD ⚙️🔢294]
[c4r_classification_registry_audit]
2026-09-18 20:00 , ,  , ,  — Load CSV version of master spreadsheet: CLassification-Domain Registry 
 
— works  —  loads local csv spreadsheet
#297
[NAR: CLASS LICENSE PLATE EXTRATOR 🔢297]
[c4r_classification_license_plate]
2026-09-21  , ,
#306
[DB: CLASS REGISTER PURGE⚙️♻️306]
System Hub PHP
2026_09-19 17:35  , ,
#317
[DB: CLASS REGISTRY MASTER PURGE ♻️⚙️317]
System Hub PHP
2026-09-21 11:35—  add_action('admin_post_c4r_purge_master_registry_db  ,
#331
[PAGE: CONVENTIONS - SITE MAPS 🔢331]
[c4r_folder_tree]
2026-10-04 18:45 331 -canonical
> SELF:
> DEPENDS: MOD-SYS-330 (c4r_parse_canonical_slug)
#385
[SYS: TAB INTERFACE REGISTRY 💾385]
[c4r_tab_interface]
2026-10-05 12:00 385 -canonical
> SELF: c4r_render_tab_interface_shortcode()
#410
PAGE:
System Hub PHP
2026-10-10 09:15 410 -canonical
> SELF: c4r_get_master_page_type_registry()
> SELF: c4r_sync_page_type_registry_to_options()
#417
[PAGE: CONVENTIONS - CLASS NARRATIVES 🔢417]
System Hub PHP
2026-10-09 11:30 417 -canonical
> SELF: c4r_get_classification_narrative_types()
> SELF: c4r_get_classification_library_destinations()
#418
[PAGE: CONVENTIONS - POST REGISTRY 🔢418]
System Hub PHP
2026-10-09 11:50 418 -canonical
> SELF: c4r_get_post_entity_registry()
> SELF: c4r_get_classification_narrative_types()
> SELF: c4r_get_classification_library_destinations()

SIDEBAR-WIDGETS (4)

Registry Entity / Macro Sub-Functions & Description
#061
[SIDE BARS: SUBSCRIBER PANEL ♻️61]
[c4r_sidebar_subscriber]
Add Subscribers
#062
[SIDE BARS: RESOURCE DIRECTORY ♻️62]
[c4r_sidebar_resource_directory]
Resource Directory
#063
[SIDEBARS: FIRST CARDS 🔢63]
[c4r_frameworks_card]
, — Sidebar One and Sidebar Two
#101
[SIDE BARS: THE FIVE 🔢101]
[c4r_catalog28_at_a_glance]
Sidebar One: 4+1 Corners, , , , , 
— 2nd Sidebar: 4+1 Corners , , , ,  

SYSTEM MANAGEMENT (9)

Registry Entity / Macro Sub-Functions & Description
#151
[MENU: MENUBAR #1 ♻️151]
[c4r_nav_site]
2026-09-28 13:35 151 -canonical
> SELF:
> add_shortcode( 'c4r_nav_site',
> , ,
> ,
#322
[SNIPPET: REGISTRY ♻️]
[c4r_function_registry]
2026-09-21 18:58 322 -canonical
> SELF
FOUNDATIONAL SNIPPET
#332
[SNIPPET: SHORTCODE PILL HELPER 🔢332]
[c4r_edit_link]
2026-09-22 20:53 /bullet fix + previous add modals for grand Module Description, , ,  , , , , , , , , ,
#355
[SNIPPET: DB WATCHDOG: LIVE AUDIT ⚙️]
System Hub PHP
2026-09-28 08:30 355 -canonical
> SELF:
> add_action( 'admin_bar_menu',
#364
[SNIPPET: DEBUG VIEWER ♻️]
[c4r_debug_hook_payload]
2026-09-28 09:00 364 -canonical
> SELF:
> add_shortcode( 'c4r_debug_hook_payload',
#368
[SNIPPET: META-DATA DB UPDATE ⚙️]
System Hub PHP
2026-09-28 08:20 361 -canonical
> SELF:
> add_action( 'code_snippets/update_snippet',
#376
[MENU: SERIES MANAGER ♻️376]
[c4r_nav_series]
2026-09-28 19:55 376 -canonical
> SELF:
> add_shortcode( 'c4r_nav_series',
#379
[SNIPPET: DEBUG CAPTURE HOOK ⚙️379]
System Hub PHP
2026-09-29 17:20 379 -canonical
> SELF:
#390
[PAGE: DOCUMENTATION EXPORTER ♻️387]
[c4r_doc_exporter]
2026-10-05 15:30 387 - canonical
> SELF:

UTILITY (6)

Registry Entity / Macro Sub-Functions & Description
#006
[SYS: PATTERN RENDERER ♻️6]
[c4r_pattern_render]
  ... self  —  Render Synced Block Patterns inside HTML/Text  —  Usage example: c4r_pattern id="105481"
#019
[SYS: SITE SEARCH ♻️19]
[c4r_site_search]
  ... self  — 100% full-width search bar with dark button icon & placeholder prompt  — Insert c4r_site_search  into a shortcode block on any page
#037
[SYS:
[c4r_spacer_{$height}]
  ... for each of  , ,  —  Spacers: 12, 24, and 48 pixels  —  Standardized, accessible spacing blocks to replace Gutenberg spacer markup.
#100
[PAGE: ID REVEAL ON ADMIN BAR ⚙️100]
System Hub PHP
— Display Page/Post ID in the Top Admin Toolbar, runs like its the theme— BOTH view mode & edit mode
#157
[SYS: PNG GRID FINDER ♻️157]
[c4r_png_grid_finder]
Shortcode Wrapper for visual coordinate testing   — Placement:  → [c4r_hub_graphic img_url="..."] ←  [/c4r_png_grid_finder] 
#335
[PAGE: CONVENTIONS - POST CATEGORY PARSER ♻️335]
[c4r_taxonomy_trail]
2026-09-23 19:28c4r_taxonomy_trail  ...self   — 
 

component: CLASSIFICATION (1)

Registry Entity / Macro Sub-Functions & Description
#338
[NAR: CLASS LICENSE PLATE - PROTOTYPE ♻️338]
[c4r_classification_license_plate]
MODULE ID: MOD-LP-200 / 2026-09-23 23:26    — CLASSIFICATION LICENSE PLATE, ANALYTICS, NARRATIVE NAVI  —  Hopeful find of lost navi footer and modals  

General / Uncategorized (1)

Registry Entity / Macro Sub-Functions & Description
#330
[SNIPPET: CATALOGING COPYBOOK 📙330]
System Hub PHP
. Confirm visual badge alignment (UI Macro vs. System Hub PHP) and modal interactivity.

3. Immutable Governance Rules

  • Comments as Contracts: Scientific docblocks, inline comments, and regex parsing rules inside source code are treated as immutable contracts. They cannot be stripped or repurposed without formal document revisions.
  • Presentation-Agnostic Modals: UI overlays (such as c4r-topology-modal) share styling and trigger patterns across components, but must never leak data logic between distinct registries.
  • Code Editor Precision: System documentation blocks are maintained purely through native Gutenberg layout containers in Code Editor mode, completely bypassing fragile block wrappers like Custom HTML.

Care4Rare Publishing System  •  Coding Architecture Standard  •  Document Version 1.0

: Code Development Workflow

Leave a Reply

Your email address will not be published. Required fields are marked *