Hanna: Difference between revisions

From H4KS
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 1: Line 1:
== Recent Commit by ValwareIRC: Normalizing Case for Nickname Comparison in JOIN ==
= Hanna =


=== Overview ===
Hanna is the internal automation assistant used across H4KS to streamline workflows, coordinate tasks, and log important events. This page documents Hanna's purpose, architecture, usage, governance, and maintenance.
Recently, there has been an important update to the Hanna IRC bot code, specifically concerning how it handles user nicknames during IRC sessions. The commit by ValwareIRC aims to improve the bot's robustness and consistency by implementing case normalization for nickname comparison.


=== Background ===
== Overview ==
In IRC channels, user nicknames are often case-insensitive, but the protocol treats them as case-sensitive strings. This discrepancy can lead to issues such as failing to recognize that different casings of the same nickname refer to the same user. Addressing this inconsistency is crucial for accurate user tracking, ban enforcement, and command handling.
Hanna is a modular automation agent that integrates with IRC channels, project tooling, and bespoke workflows through a pluggable plugin architecture. It is designed to be privacy-conscious, auditable, and resilient.


=== Details of the Commit ===
== Purpose and scope ==
The commit identified via GitHub with the SHA b20dd06fd55bd4dc55631fdcd14d59a747809fc7 introduces a change that ensures all nicknames are compared in a case-insensitive manner. The core modification involves normalizing the case of nicknames before comparison, typically converting them to lowercase.
* Automate repetitive tasks (notification routing, log aggregation, task creation)
* Enforce standards and governance across channels
* Provide quick access to information and open action items
* Serve as a consistent interface for human operators and automated processes


=== Implementation ===
== Architecture ==
The change is implemented by modifying the nickname comparison logic within the IRC join handler. Instead of comparing raw nickname strings, the code now compares their lowercase equivalents. This guarantees that nicknames such as "Hanna" and "hanna" are treated as identical.
* Core engine: message parser, command dispatcher, plugin manager
* Plugins:
* IRC plugin: connects to #lobby and other channels
* N8n adapter: triggers workflows via n8n
* Logging: emits structured logs to central log store
* Status: basic responsiveness and health checks
* Data model: contexts per user/session, per-channel, per-workflow state
* External interfaces: IRC, REST endpoints, Webhooks


For example:
== Deployment and configuration ==
* Runs in containerized environment; uses environment variables for config
* Config: /etc/hanna/config.yaml
* Secrets handling: Vault or secret manager
* Versioning: SemVer


<syntaxhighlight lang="python">
== Usage ==
== Old comparison ==
* Basic commands:
if nick1 == nick2:
** Hanna help
<pre># ...</pre>
** Hanna status
** Hanna log <level> <message>
* Examples:
** Listening to channel logs and summarizing nightly events
** Triggering a workflow in n8n via the N8n adapter
* Access control and privacy: only authorized users can invoke admin commands


== New comparison ==
== Security and privacy ==
if nick1.lower() == nick2.lower():
* Authentication and authorization model, role-based access control
<pre># ...</pre>
* Data retention and deletion policies
</syntaxhighlight>
* Audit logging and tamper-evident records where feasible


=== Benefits ===
== Maintenance and governance ==
* Ensures consistent identification of users regardless of nickname casing.
* Owners: Hanna team; primary maintainers include Valware and mattf
* Avoids issues where commands or moderation actions fail due to case mismatch.
* Change management: PRs, code reviews, tests, and staging reviews
* Enhances user experience by respecting user preferences for nickname casing.
* Release cycle: monthly minor releases with quarterly major updates


=== Future Work ===
== Backup and disaster recovery ==
Further improvements may include persistent case normalization settings per user or channel, as well as additional support for Unicode characters and internationalization considerations.
* Daily backups of critical state and logs; retention 30 days
* Offsite replication and periodic DR drills
* Runbooks and escalation paths for outages


=== Summary ===
== History and changelog ==
The commit by ValwareIRC is a significant step towards more reliable and user-friendly IRC bot operations. By normalizing nickname comparison cases, Hanna can better manage user identities and streamline interactions within channels.
* 1.0 initial release and stabilization
* 1.1 added IRC connectivity defaults and improved logging
* 1.2 introduced N8n node adapter and improved security checks


== End of Update ==
== Related pages ==
* Hanna's Parents: Valware and mattf
* Hanna LLC
* Hanna Backup Procedures
* N8n-nodes-hanna License
* Mita and Hanna Collaboration
* Debugging Bub Message in Mini Hanna Node

Latest revision as of 15:35, 9 September 2025

Hanna[edit]

Hanna is the internal automation assistant used across H4KS to streamline workflows, coordinate tasks, and log important events. This page documents Hanna's purpose, architecture, usage, governance, and maintenance.

Overview[edit]

Hanna is a modular automation agent that integrates with IRC channels, project tooling, and bespoke workflows through a pluggable plugin architecture. It is designed to be privacy-conscious, auditable, and resilient.

Purpose and scope[edit]

  • Automate repetitive tasks (notification routing, log aggregation, task creation)
  • Enforce standards and governance across channels
  • Provide quick access to information and open action items
  • Serve as a consistent interface for human operators and automated processes

Architecture[edit]

  • Core engine: message parser, command dispatcher, plugin manager
  • Plugins:
  • IRC plugin: connects to #lobby and other channels
  • N8n adapter: triggers workflows via n8n
  • Logging: emits structured logs to central log store
  • Status: basic responsiveness and health checks
  • Data model: contexts per user/session, per-channel, per-workflow state
  • External interfaces: IRC, REST endpoints, Webhooks

Deployment and configuration[edit]

  • Runs in containerized environment; uses environment variables for config
  • Config: /etc/hanna/config.yaml
  • Secrets handling: Vault or secret manager
  • Versioning: SemVer

Usage[edit]

  • Basic commands:
    • Hanna help
    • Hanna status
    • Hanna log <level> <message>
  • Examples:
    • Listening to channel logs and summarizing nightly events
    • Triggering a workflow in n8n via the N8n adapter
  • Access control and privacy: only authorized users can invoke admin commands

Security and privacy[edit]

  • Authentication and authorization model, role-based access control
  • Data retention and deletion policies
  • Audit logging and tamper-evident records where feasible

Maintenance and governance[edit]

  • Owners: Hanna team; primary maintainers include Valware and mattf
  • Change management: PRs, code reviews, tests, and staging reviews
  • Release cycle: monthly minor releases with quarterly major updates

Backup and disaster recovery[edit]

  • Daily backups of critical state and logs; retention 30 days
  • Offsite replication and periodic DR drills
  • Runbooks and escalation paths for outages

History and changelog[edit]

  • 1.0 initial release and stabilization
  • 1.1 added IRC connectivity defaults and improved logging
  • 1.2 introduced N8n node adapter and improved security checks

Related pages[edit]

  • Hanna's Parents: Valware and mattf
  • Hanna LLC
  • Hanna Backup Procedures
  • N8n-nodes-hanna License
  • Mita and Hanna Collaboration
  • Debugging Bub Message in Mini Hanna Node