Skip to content

fix(presets): make the burndown and burnup presets pass the query guard (#11) - #12

Merged
pikann merged 1 commit into
Paca-AI:masterfrom
laithalenooz:fix/burndown-preset-passes-query-guard
Oct 7, 2026
Merged

pikann merged 1 commit into
Paca-AI:masterfrom
laithalenooz:fix/burndown-preset-passes-query-guard

Conversation

@laithalenooz

Copy link
Copy Markdown
Contributor

Summary

Fixes #11. The Burndown (active sprint) and Burnup (active sprint) presets in the frontend's preset list, and the burndown preset in the paca-dashboard-builder skill, were rejected by the plugin's own query guard, so they failed the moment anyone used them:

  • they used UNION ALL, which the guard forbids (deliberately: a second branch escapes the project filter);
  • they repeated {{project_id}} inside nested subqueries, while the guard requires it exactly once, as a top-level equality filter.

The presets now select the project's most recently started active sprint in the outer query, generate one row per day from its start date to today with generate_series, and count scope / completed tasks with correlated subqueries. Days without activity now appear too, which reads better as a burndown. The skill's "Query safety rules" section now states the single top-level placeholder rule, the compound-SELECT ban, and the subquery restriction for tables with sensitive columns, which agents previously had to discover from error messages.

New backend/presets_test.go runs every preset shipped in frontend/src/presets.ts and in the skill through validateQuery with its declared scope. Before the fix it failed on exactly these three presets; the other seven already passed.

Checklist

  • Scoped to the presets, the skill text, and the new test.
  • go test ./... and go vet ./... pass in backend/; tsc --noEmit passes in frontend/.
  • Verified against a running Paca 0.18.6 with this plugin's 0.4.0 guard: both rewritten queries pass /dashboard/query/preview and return the expected columns (day, remaining_tasks and day, total_scope, completed).

…rd (Paca-AI#11)

The "Burndown (active sprint)" and "Burnup (active sprint)" presets in the
frontend, and the burndown preset in the paca-dashboard-builder skill, used
UNION ALL and repeated {{project_id}} inside nested subqueries. The guard
rejects both (compound SELECTs are forbidden because a second branch escapes
the project filter; the placeholder must appear once, as a top-level
equality), so these presets failed the moment anyone used them.

They now select the most recently started active sprint in the outer query
and produce one row per day from its start date to today with
generate_series, counting scope and completed tasks with correlated
subqueries. The skill's safety rules now state the single top-level
placeholder rule, the compound-SELECT ban and the subquery restriction for
tables with sensitive columns.

backend/presets_test.go runs every preset shipped in presets.ts and in the
skill through validateQuery, so an invalid preset fails the build.

Fixes Paca-AI#11

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit 2c8fbcd into Paca-AI:master Oct 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

paca-dashboard-builder skill: burndown preset is rejected by the plugin's own query guard

2 participants