Added first procedures

This commit is contained in:
Niels Geens
2025-01-08 22:42:14 +01:00
parent e730eba58c
commit 4cd0fe8450
7 changed files with 333 additions and 6 deletions

View File

@@ -0,0 +1,52 @@
# Using Procedures
## Core Guidelines
When following a procedure's flowchart:
1. Start with reasoning:
- State current position in flowchart explicitly
- Focus on immediate next step, don't go ahead of the chart
- Evaluate current context and task state
- Often state entry id's that can be removed and explain why to avoid mistakes
- State expected output and runtime for scripts
2. After script execution:
- Analyze the actual output and compare with the expected output
- Reevaluate situation based on results
- Return to flowchart for next step
- Consider if current path is still appropriate
3. When a procedure fails:
- Create a task explaining the issue and the need to fix it
- Add timestamps and id's of relevant entries
## Attention Management
LLMs pay more attention to recently mentioned information.
Reasoning entries should mention what needs attention now.
To maintain focus:
1. State current flowchart position in each reasoning
2. Quote relevant parts of important entries
3. Reference specific entry IDs when using their information
4. Periodically remind about ongoing tasks or future needs
5. Clean up entries that aren't needed for current step
Example of good attention management:
```xml
<reasoning>
At node "evaluate_test_results". Entry 45f3d2 shows failed test: "Error: Connection timeout".
Will need to check system logs soon (noted in /tasks/reminders.txt, check at 14:00).
First focusing on this error.
</reasoning>
```
## Reasons to Switch Procedures
Common triggers:
- Data available on stdin
- Time matching scheduled task
- Error conditions in script output
- Resource constraints detected
- User input needed

View File

@@ -0,0 +1,58 @@
# Design Rationale
## Why Procedures
Procedures provide guided reasoning paths for complex tasks. The LLM engine can make mistakes when:
- Jumping to action before proper analysis
- Losing track of task context after interruptions
- Missing key steps in complex processes
- Forgetting to preserve state before transitions
Procedures help prevent these issues by:
- Encouraging reasoning before action through flowchart structure
- Providing clear decision points for state evaluation
- Identifying when sub-procedures may help
- Guiding consistent approaches to common tasks
## Task State vs Procedure Guidance
Procedures guide reasoning about tasks but don't manage task state directly. For example:
During code development:
- Task state in /tasks/: code files, test results, requirements
- Procedure guidance: when to write tests, when to debug, when to refactor
- State preserved in files before switching focus
- Context regenerated from files when returning
This separation allows:
- Clean task interruption and resumption
- Natural procedure transitions
- State preservation without rigid control
- Flexible adaptation to situations
## Common Mistakes
### Premature Context Cleaning
```xml
<context ...>
<single ... id="123">
cat /procedures/test/procedure.md
<stdout>
...
</stdout>
<stderr/>
</single>
...
<reasoning>Test failed. Moving to debug procedure.</reasoning>
</context>
<delete id="123"/>
```
This removes the active procedure entry before finishing its steps
### Keeping irrelevant info in context
LLM's have difficulty spotting duplicates and sections with a low attention score.
Procedures with explicit instructions for finding these sections can help increase their attention.