Build LoopCraft, a Hermes-native Python loop engineering plugin that turns a focused set of runtime workflow reminders into a clear, testable, publishable implementation, with priority on:
- accurate hook mapping
- a simple, explicit state machine
- test coverage for every rule
- no cross-language bridge complexity
All important constraints should live in Hermes hooks:
pre_tool_callpost_tool_calltransform_tool_resultpre_llm_callon_session_starton_session_endon_session_finalize
Prompt text is only a lightweight reminder layer. It does not carry the real enforcement burden, and injected runtime context must be clearly marked as generated context rather than user speech.
Policy logic should stay reusable and testable, but host wiring must remain Hermes-native.
Shared policy includes:
- command detection
- low-signal classification
- phase transitions
- result summarization
Hermes adapter responsibilities include:
register(ctx)- Hermes hook return shapes
- path and tool-name adaptation
v1 does not use a TS runtime with a Python shim and does not spawn a Node bridge.
Why:
- Hermes plugin entrypoints are naturally Python
- state and error propagation are simplest inside Python
- open-source installation and troubleshooting stay easier for users
Every rule should start with a failing test before implementation.
Current test coverage includes:
- existing-file mutation records an advisory without evidence by default, and blocks only in
strictmode - mutation records pending-verification advisories before the next mutation by default, and blocks only in
strictmode - repeated low-signal probes record advisories by default, and block only in
strictmode - tool-result summarization
- stage-aware
pre_llm_callcontext - session end/finalize runtime-state cleanup
- mutation closeout includes final-report cleanup status
- generated LoopCraft context is not treated as user speech or memory-provider input
The state machine intentionally keeps only three phases:
observeexecutereview
Meaning:
observe: not enough evidence yetexecute: enough evidence exists for a minimal changereview: a recent mutation happened and validation must run next
Each session stores:
phaseevidence_countlast_evidence_labelpending_verificationlast_mutation_labelconsecutive_low_signallast_low_signal_signaturelast_low_signal_intentlast_updated_at
on_session_start: initialize session statepost_tool_call: advance the state machineon_session_end/on_session_finalize: clean up session state- prune automatically when TTL expires or capacity is exceeded
Returns either None to allow the call or, in strict / dangerous-command block paths:
{"action": "block", "message": "..."}Responsibilities:
- dangerous-command policy (
warn,allow,block,approve) - non-blocking workflow-risk recording for missing evidence / pending verification / broad evidence / low-signal repeats
- strict compatibility hard blocks for operators that explicitly choose strict mode
Responsibilities:
- classify observation / mutation / validation
- update evidence counts
- set
pending_verification - maintain the low-signal streak state
Responsibilities:
- summarize oversized tool output
- reduce context pollution
Responsibilities:
- inject phase summaries and runtime reminders
- append context rather than rewriting the system prompt
The public v0.0.11 / 0.0.11 release line continues the LoopCraft line with heredoc validation-target hardening. It keeps the package/plugin key proofrail for compatibility and includes:
- default
enforcement_mode=advisory; workflow risks are recorded as advisories and compact next-action cards instead of blocking tool calls - explicit
enforcement_mode=strictcompatibility for the older hard-block cooperative modes - default
dangerous_command_action=warn; high-risk commands stay out of a manual approval loop, but they are audited and paired with self-verification reminders - a JSONL audit trail for session lifecycle, tool preflight, dangerous commands, tool results, advisories, and large-output summarization
- a validation-suggestion layer that proposes narrow follow-up checks from touched files and command shape
- session state for mutation / validation / dangerous-command counts, touched files, validation suggestions, advisories, recent labels, and task-ledger state
pre_llm_callinjection of touched files, suggested validations, dangerous-command audit reminders, compact advisory cards, Agent Self-Routing Checkpoints, and final evidence/cleanup-report requirements- explicit forced modes:
gather_target_evidence,validate_only,change_strategy, anduser_choicefor strict/classifier paths - task-panel handoff framing with allowed / forbidden next actions and mode-specific collaboration wording
- classifier fallback from unsupported structured output into
RuleBasedGrayAreaClassifier - classifier-to-mode mapping so gray-area decisions become concrete runtime submodes
forced_mode_transitionaudit events from classifier, strict block, and tool-observation sourcesforward_progress_reopenedsemantics when validation clearsvalidate_only- diagnostic-preserving large-output summaries that keep
FAILED,ERROR, traceback, and assertion lines from omitted middle sections - phantom-target recovery hardening for shell assignment tokens, suppression redirects, directory-level targets, Windows slash-style command switches, and handoff wording compatibility
- behavior-simulation, advisory-runtime, self-routing, assistive-hygiene, and self-smoke coverage for the runtime path
- GitHub release/tag line:
v0.0.11 - Python package version:
0.0.11
This split is intentional: GitHub tags keep the leading v, while Python packaging follows PEP 440.
- expose
explain_state()as a formal Hermes debug tool - add diff / mutation review summaries to the final review lane
- add compaction-related snapshots and recovery anchors
- add clean-install / wheel / plugin-dir installation smoke tests
- validate the plugin in a live Hermes rollout