mol-dog-stale-db formula renders literal {{var}} placeholders into the step script: warn-threshold test errors with "integer expected" #8

Open
opened 2026-09-11 06:15:32 +00:00 by forgejo-admin · 0 comments

Source: examples/bd/dolt/formulas/mol-dog-stale-db.toml (pack sha pinned in city.toml: 3b3b89f201; formula_hash 8ed7c1cc16708a4ac70d2b470375dac84acc62dd9ca24d2ef23f70a4eceb80b6)

Observed: the cleanup step script reaches the agent with literal {{warn_threshold}} and {{max_orphans_for_sql}} in the text. The template engine did not substitute the formula vars. Measured on the 2026-09-11 04:49Z run of wisp gs-jk08ay (session bd.dog-1):

/tmp/mol-step.sh: line 210: [: {{warn_threshold}}: integer expected

Line 210 is if [ "$ORPHAN_TOTAL" -ge "{{warn_threshold}}" ]. The same literal also appears in --max-orphan-dbs "{{max_orphans_for_sql}}" on the apply line, so a run that actually reaches the apply branch would pass the literal string as the flag's value, not a number.

Consequence today: the test errored, the shell treats the errored condition as false, and the maintenance-warning notice was skipped. Harmless only because the scan found 0 orphans. On a run with orphans, the warning notice and possibly the apply guard flag are both wrong.

Expected: the rendered step script carries the resolved var values (this run: 5 and 20), or fails closed at render time instead of shipping mustache text.

Workaround used: none. The run completed and the wisp was closed (orphans=0, applied=0, escalated=0); the failed warning test is the only symptom.

Note: the pinned pack does not reach the city until someone deliberately re-pins the sha, so a fix here is inert until then.

**Source:** `examples/bd/dolt/formulas/mol-dog-stale-db.toml` (pack sha pinned in city.toml: 3b3b89f2011e06d84459aa7bea1552382f13930a; formula_hash 8ed7c1cc16708a4ac70d2b470375dac84acc62dd9ca24d2ef23f70a4eceb80b6) **Observed:** the `cleanup` step script reaches the agent with literal `{{warn_threshold}}` and `{{max_orphans_for_sql}}` in the text. The template engine did not substitute the formula vars. Measured on the 2026-09-11 04:49Z run of wisp gs-jk08ay (session bd.dog-1): ``` /tmp/mol-step.sh: line 210: [: {{warn_threshold}}: integer expected ``` Line 210 is `if [ "$ORPHAN_TOTAL" -ge "{{warn_threshold}}" ]`. The same literal also appears in `--max-orphan-dbs "{{max_orphans_for_sql}}"` on the apply line, so a run that actually reaches the apply branch would pass the literal string as the flag's value, not a number. **Consequence today:** the test errored, the shell treats the errored condition as false, and the maintenance-warning notice was skipped. Harmless only because the scan found 0 orphans. On a run with orphans, the warning notice and possibly the apply guard flag are both wrong. **Expected:** the rendered step script carries the resolved var values (this run: `5` and `20`), or fails closed at render time instead of shipping mustache text. **Workaround used:** none. The run completed and the wisp was closed (`orphans=0, applied=0, escalated=0`); the failed warning test is the only symptom. Note: the pinned pack does not reach the city until someone deliberately re-pins the sha, so a fix here is inert until then.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
celilo/gascity-packs#8
No description provided.