agent-cadence-progress
Musical cadence as task completion signal — agents signal resolution the same way music does.
Concept
In music theory, a cadence is a chord progression that signals the end of a phrase. Different cadence types communicate different levels of finality:
- Perfect authentic (V → I): "Done. Period. No question."
- Plagal (IV → I): "Done, but softly — the 'Amen' ending."
- Deceptive (V → vi): "Wait, I thought we were done? Nope, twist!"
- Half (→ V): "Hold on, we're paused mid-thought..."
- Phrygian (↓v → V): "Dramatic cliffhanger!"
agent-cadence-progress maps these patterns to task completion signals. Instead of simple percentage-complete bars, agents use cadence patterns to communicate how complete they are — and whether that completion is real or deceptive.
Key Types
CadenceType
The five musical cadence types, each with a resolution strength (0.0–1.0) and a human-readable description.
use CadenceType;
assert!;
assert!;
assert!;
TaskProgress
Maps a task's numeric progress to a cadence type. Progress values translate to cadences:
| Progress Range | Cadence | Meaning |
|---|---|---|
| 0.98–1.0 | Perfect Authentic | Definitively complete |
| 0.90–0.97 | Plagal | Complete, soft landing |
| 0.80–0.89 | Deceptive | Looks done but isn't |
| 0.40–0.79 | Half | In progress, paused |
| < 0.40 | Phrygian | Just started, tense |
use TaskProgress;
let mut task = with_progress;
let cadence = task.detect_cadence;
assert!;
CompletionSignal
Detects when a group of agents collectively reaches a cadence point. Aggregates individual task progresses to determine the group's overall completion signal.
use ;
let tasks = vec!;
let signal = detect_from_group.unwrap;
assert!;
DeceptiveResolution
Detects tasks that appear complete but regress — the "deceptive cadence" of task management. Tracks when progress goes backwards, indicating a false completion.
use DeceptiveResolution;
let mut dr = new;
dr.track; // Regression detected!
assert!;
Chord Functions and ProgressionTracker
Models task progression as a chord progression using standard harmonic functions:
- Tonic (I): Home base, stable — task begins or completes
- Supertonic (ii): Moving away — gathering resources
- Mediant (iii): Ambiguous — exploring options
- Subdominant (IV): Building tension — work in progress
- Dominant (V): Maximum tension — approaching resolution
- Submediant (vi): Deceptive resolution — false finish
- Leading (vii°): Highly unstable — critical moment
use ProgressionTracker;
let mut tracker = standard;
// I → ii → IV → V → I
while let Some = tracker.advance
let cadence = tracker.detect_cadence; // PerfectAuthentic
CadenceCoordinator
Orchestrates multiple tasks with a shared progression tracker.
Why Cadences?
Simple percentage-complete metrics lose nuance. A task at 85% might be nearly done (building toward authentic cadence) or might be about to fail (building toward deceptive cadence). Musical cadence theory gives us a richer vocabulary for understanding completion states.
Installation
[]
= { = "." }
License
MIT