<commit_before><commit_msg>Added some minimalist hncp implementation notes (mainly data structures for my own reference).<commit_after>-*- outline -*-
 
Few notes about the implementation (best viewed in Emacs outline mode):

* (Local) TLVs (in a tree, sorted by HNCP TLV sort order)

** hncp->tlvs

vlist (sorted and versioned tree structure)

The version=-1 (=any) is used for HNCP API user supplied TLVs; versioning is used just to handle within-HNCP-implementation things (notably neighbor TLVs)

** hncp->tlvs_dirty 

The flag indicates that local TLV tree has not yet been published to HNCP in
general.

* Links (in a tree)

** hncp->links

vlist of local links for which HNCP is enabled.

** hncp->links_dirty 

The flag indicates that neighbor TLVs from link+neighbor structures to
local TLV tree should be republished (which then becomes dirty, and is
dumped eventually to the local node object).

* Neighbors (within links) (in a tree)

** link->neighbors

* Nodes (in a tree, sorted by node id hash)

** hncp->nodes

These are _all_ nodes within HNCP graph, including our own. They all have also published TLV state (ours possibly somewhat delayed as publishing is handled via tlvs_dirty).

* Network hash

** hncp->network_hash

Current network hash.

** hncp->network_hash_dirty 

The flag indicates that the current structure within the data structure is
NOT up to date and new one should be calculated based on contents of
hncp->nodes.
{'fraction_non_alphanumeric': 0.06689655172413793, 'fraction_numerical': 0.000689655172413793, 'mean_word_length': 4.414179104477612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4131041', 'n_tokens_mistral': 434, 'n_tokens_neox': 414, 'n_words': 204}