Skip to main content

Hard Self-Healing (-X)

Hard self-healing handles 404 Not Found errors by automatically finding and re-running the node that originally created the missing resource, then retrying the failed request with the freshly created resource's new ID.

Most useful when test data was deleted externally between runs.

Enabling Hard Healing

CLI Flag

rumour run ./requests/ -X
# or
rumour run ./requests/ --hard-heal

Collection Config File

# api.config.toml
[config]
hard_heal = true

How It Works

When a node receives 404 Not Found, the healer reconstructs the missing resource in this order:

  1. Dependency graph lookup — searches the node's declared dependencies for any variable whose name contains id, email, user, account, token, auth, or access. The node that produced that variable is treated as the creator.
  2. Inference-based lookup — if no matching dependency variable is found, naming conventions are used to infer the creator (e.g., create_post.toml for get_post.toml).
  3. Disk fallback — if the creator node is not in the current workflow graph (e.g., you ran a single file), the healer loads it directly from disk.
  4. Reconstruction — the creator node is re-executed and extracted variables (the new resource ID) are pushed into the runtime scope.
  5. Retry — the original failing node is retried with the new resource ID in scope.

Recursive Hard Healing

If the creator node also fails (because it depends on another missing resource), the healer recursively reconstructs up to 5 levels deep.

Difference from Soft Healing

FeatureSoft Heal (-H)Hard Heal (-X)
Target errors401, 400, 503, timeouts404 Not Found
StrategyToken refresh, retry, mutationRe-run creator node
Use caseTransient auth/rate-limit issuesMissing test data
Requires creator node?NoYes

Use both simultaneously for maximum resilience:

rumour run ./tests/ -H -X

Example

A three-node ordered workflow: create_post.toml creates a post, delete_post.toml deletes it (simulating external deletion or clean breakdown), and get_post.toml attempts to retrieve it. Without -X active, the retrieval fails with 404. With -X active, Rumour automatically detects that the post has been deleted, identifies the creator node create_post.toml, executes it, maps the new post_id in runtime memory, and successfully retries get_post.toml.

File Layout

config_examples/09_hard_heal/
├── workspace.env.toml
├── hard_heal.suite.toml
├── create_post.toml
├── delete_post.toml
└── get_post.toml

workspace.env.toml

base_url = "http://localhost:4000/api/v2"

hard_heal.suite.toml

[suite]
name = "Hard Heal Demonstration Suite"
ordered = true

requests = [
"create_post.toml",
"delete_post.toml",
"get_post.toml"
]

create_post.toml

name = "create_post"

[request]
method = "POST"
url = "{{base_url}}/posts"

[headers]
Content-Type = "application/json"

[body]
type = "json"
raw = '{"title":"Hard Heal Demo","body":"resource to reconstruct","userId":1}'

[assert]
status = 201

[extract]
post_id = "id"

delete_post.toml

name = "delete_post"

[request]
method = "DELETE"
url = "{{base_url}}/posts/{{post_id}}"

get_post.toml

name = "get_post"

[request]
method = "GET"
url = "{{base_url}}/posts/{{post_id}}"

[assert]
status = 200

Run

rumour run ./09_hard_heal/hard_heal.suite.toml -X -v

Output

POST http://localhost:4000/api/v2/posts
Header: Content-Type: application/json
URL: http://localhost:4000/api/v2/posts
Body (json): {"title":"Hard Heal Demo","body":"resource to reconstruct","userId":1}
✓ SUCCESS: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml (2ms)
DELETE http://localhost:4000/api/v2/posts/23
URL: http://localhost:4000/api/v2/posts/23
✓ SUCCESS: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/delete_post.toml (0ms)
GET http://localhost:4000/api/v2/posts/23
URL: http://localhost:4000/api/v2/posts/23
✗ FAILED: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (0ms) - HTTP Status: Expected status 200, got 404
↻ RETRYING: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (Attempt 1/2) [Wait 500ms]
GET http://localhost:4000/api/v2/posts/23
URL: http://localhost:4000/api/v2/posts/23
✗ FAILED: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (1ms) - HTTP Status: Expected status 200, got 404
↻ RETRYING: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (Attempt 2/2) [Wait 1000ms]
GET http://localhost:4000/api/v2/posts/23
URL: http://localhost:4000/api/v2/posts/23
✗ FAILED: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (1ms) - HTTP Status: Expected status 200, got 404
⚡ Hard Healing: Executing creator node /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml
POST http://localhost:4000/api/v2/posts
Header: Content-Type: application/json
URL: http://localhost:4000/api/v2/posts
Body (json): {"title":"Hard Heal Demo","body":"resource to reconstruct","userId":1}
✓ SUCCESS: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml (1ms)
✔ Healed resource producer registered: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml
✔ Satisfying dependency requirement: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml
↻ Retrying original request: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml
GET http://localhost:4000/api/v2/posts/24
URL: http://localhost:4000/api/v2/posts/24
✓ SUCCESS: /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml (0ms)
🔨 /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml → RECONSTRUCTED (Hard Heal)
✓ config_examples/09_hard_heal/hard_heal.suite.toml → PASS (3 Pass, 0 Fail, 0 Skip)
╭──────────────────────────────────────────────────────────────────────────╮
│ RUMOUR EXECUTION REPORT │
├──────────────────────────────────────────────────────────────────────────┤
│ Total Requests: 3
│ Successful: 3
│ Failed: 0
│ Skipped: 0
│ Success Rate: 100.0% │
│ Total Time: 1520ms │
│ Self-Healed: 1
╰──────────────────────────────────────────────────────────────────────────╯

✓ Successful Requests:
- /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/create_post.toml [201] [4ms]
- /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/delete_post.toml [204] [2ms]
- /home/bugsfounder/workspace/testing/config_examples/09_hard_heal/get_post.toml [200] [1513ms]

Actionable Recommendations:
→ Run with --json to export this report for your CI/CD pipeline.

Interaction with Auto-Cleanup (-C)

When combining Hard Self-Healing (-X) with Automated Resource Cleanup (-C), the creation tracking engine captures all successfully created resources, including those created during reconstruction:

  1. Multiple Creations Tracked: If a request receives a 404 Not Found and Hard Healing re-runs its creator node, both the original resource ID (which was later deleted/lost) and the newly reconstructed resource ID are registered in the session's tracked creations.
  2. Double Deletion Queue: At the end of the execution, the Auto-Cleanup engine executes the cleanup node (e.g., delete_post.toml) twice—once for the original resource ID, and once for the newly reconstructed resource ID.
  3. Graceful Deletion Assertions: Because the original resource was already deleted (triggering the 404 in the first place), executing the cleanup node on it again will return 404 Not Found from the server. To prevent cleanup nodes from logging failure warning messages in the CLI, configure their assertions to accept both successful deletion and resource absence:
# delete_post.toml
[assert]
status = [204, 404]

Limitations

  • Hard healing requires a discoverable creator node — in the graph or on disk. If no creator is found, the node fails.
  • Reconstruction may partially fail if the creator's own dependencies are also missing (recursive healing attempts up to depth 5).
  • Increases execution time when reconstruction chains are deep.
  • Applies only to 404 Not Found responses.