agnes-the-ai-analyst/app/web/templates
Vojtech 78cd243e65
fix(store): promote-on-approve looks up version_no by submission_id (live agnes-development bug) (#330)
* fix(store): promote-on-approve looks up version_no by submission_id

Live bug observed on agnes-development: an entity had 5+
version_history rows sharing the same `hash` (user re-uploaded
byte-identical bundles as v2/v4/v6 of the same skill — the LLM and
inline checks happily approved each one). The runner's
promote-on-approve path looked up the submission's version_no by
hash:

    for entry in entity.version_history:
        if entry["hash"] == sub_hash:
            target = int(entry["n"]); break

The loop matched the FIRST hash collision — always v1, n=1. With
current=1, the forward-only `target > current` guard then skipped
the promote, leaving the entity stuck at v1 even though the new
submission's status flipped to `approved`. UI kept showing v1 as
"current".

Fix: look up by submission_id via the existing
`_version_no_for_submission` helper (already used by retry / rescan
/ download paths). Same lookup applied in
`admin_override_store_submission` which had the identical hash-match
loop.

Test: TestPromoteLookupByByteIdenticalBundles uploads v1 + a
byte-identical v2, drives the LLM with mock-approve, asserts
entity.version_no advances to 2.

* fix: bundle #329 reviewer-Important follow-ups + post-merge polish

Bundled with Vojtech's commit ahead of this (the promote-on-approve
`version_no` lookup-by-submission_id fix) since #330 is the next
release-cut PR and the four #329 follow-ups would otherwise need a
standalone release-cut PR — prohibited by docs/RELEASING.md §
"Release-cut belongs to the PR".

Fixed:
- src/usage_ask.py — SCHEMA_DIGEST + SYSTEM_PROMPT referenced the
  dropped `usage_plugin_daily` table. The admin
  `POST /api/admin/telemetry/ask` endpoint ships SYSTEM_PROMPT to
  the LLM, so any model-emitted SQL against `usage_plugin_daily`
  would fail with a DuckDB binder error post-#329 merge. Updated to
  describe the new v48 rollups (`usage_marketplace_item_daily` /
  `_window`) and rule 5 of the prompt to point at them.

Internal:
- CHANGELOG.md [0.54.20] section restored to its canonical content
  from the v0.54.20 git tag. The #329 self-merge carried 226 lines
  of author's pre-rebase bullets that ended up mis-attributed; the
  published v0.54.20 GitHub Release (FTS BM25 + batch bar) now
  matches the CHANGELOG section verbatim. Also fills in [Unreleased]
  with this PR's bullets (Fixed + Internal).
- tests/conftest.py — dropped the unused
  `conn_with_usage_schema_and_attribution` fixture that INSERTed
  into the now-removed `usage_attribution_*` tables. Zero callers
  today, but a tripwire — the first future test to request it would
  have failed with a binder error.
- app/web/templates/marketplace.html — replaced a customer-specific
  token (`groupon-marketplace`) in the Most Popular sort-tiebreaker
  comment with a generic `<customer>-marketplace` placeholder per
  CLAUDE.md § Vendor-agnostic OSS. Also scrubbed an `agnes-development`
  reference in app/api/admin.py and src/store_guardrails/runner.py
  (cherry-picked from Vojtech's commit) on the same hygiene rule.

* release: 0.54.22 — flea-market promote-by-submission_id fix + #329 reviewer follow-ups

---------

Co-authored-by: ZdenekSrotyr <zdenek.srotyr@keboola.com>
2026-05-15 21:21:14 +02:00
..
admin UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
_app_header.html release(0.54.18): Curated Memory restructure + per-user Dismiss + bundled adversarial-review fixes (#316/#320/#322) (#324) 2026-05-15 18:51:05 +02:00
_claude_setup_cta.jinja fix(cta): clipboard fallback + fold Atlassian MCP into connectors (#249) 2026-05-11 21:54:51 +02:00
_claude_setup_instructions.jinja feat(web): rename /install → /setup; nav label 'Setup local agent' 2026-05-03 16:12:13 +02:00
_content_findings.html feat(store-guardrails): per-component description quality + plain-language UX (#276) 2026-05-12 21:48:27 +02:00
_content_howto_fix.html feat(store-guardrails): per-component description quality + plain-language UX (#276) 2026-05-12 21:48:27 +02:00
_flea_versions.html fix(store): surface review failures + harden publish gate (#316) 2026-05-15 15:52:07 +02:00
_home_stats.html feat(home): status frame on /home (operator-gated, onboarded-only) (#297) 2026-05-14 09:28:47 +00:00
_marketplace_video_embed.html Curated marketplace enrichment via agnes-metadata.json + curator metadata (#234) 2026-05-09 17:01:37 +02:00
_message.html feat(auth): password reset & invite flows for web + admin (#34) (#37) 2026-04-22 17:43:57 +02:00
_page_chrome.html feat(home): state-aware /home + /setup-advanced + schema v26 (#228) 2026-05-08 18:28:47 +02:00
_page_hero.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
_posthog.html feat(observability): optional PostHog integration (#231) 2026-05-08 17:57:10 +04:00
_profile_tokens.html feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
_profile_troubleshooting.html feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
_quarantine_banner.html fix(store): surface review failures + harden publish gate (#316) 2026-05-15 15:52:07 +02:00
_theme.html feat: complete system — web UI, all API endpoints, governance, admin, CLI commands 2026-03-27 16:52:22 +01:00
_version_badge.html feat(ui): version badge as shared partial, injected into every full-page template 2026-04-21 20:51:55 +02:00
activity_center.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_access.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_corporate_memory.html feat(memory): bulk-edit batch bar on All Items tab (#129) (#325) 2026-05-15 20:05:21 +02:00
admin_group_detail.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_groups.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_marketplaces.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_scheduler_runs.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_server_config.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_session_detail.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_sessions.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_store_submission_detail.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_store_submissions.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_tables.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_tokens.html feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
admin_usage.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_user_detail.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_users.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_welcome.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
admin_workspace_prompt.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
base.html release(0.54.18): Curated Memory restructure + per-user Dismiss + bundled adversarial-review fixes (#316/#320/#322) (#324) 2026-05-15 18:51:05 +02:00
base_login.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
catalog.html feat(catalog): promote buckets to top-level Data Package cards (#301) 2026-05-14 15:18:35 +02:00
corporate_memory.html release(0.54.18): Curated Memory restructure + per-user Dismiss + bundled adversarial-review fixes (#316/#320/#322) (#324) 2026-05-15 18:51:05 +02:00
dashboard.html UI design system unification — one stylesheet, canonical primitives, nav fix (#284) 2026-05-14 13:28:03 +02:00
desktop_link.html feat: complete system — web UI, all API endpoints, governance, admin, CLI commands 2026-03-27 16:52:22 +01:00
error.html feat(observability): request_id end-to-end + dev debug toolbar + centralized logging (#136) 2026-04-29 22:54:21 +02:00
home_not_onboarded.html release(0.54.18): Curated Memory restructure + per-user Dismiss + bundled adversarial-review fixes (#316/#320/#322) (#324) 2026-05-15 18:51:05 +02:00
home_onboarded.html release(0.54.18): Curated Memory restructure + per-user Dismiss + bundled adversarial-review fixes (#316/#320/#322) (#324) 2026-05-15 18:51:05 +02:00
install.html feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
login.html feat(setup): configurable instance brand + connector setup overhaul (#268) 2026-05-12 17:10:08 +02:00
login_email.html feat(auth): password reset & invite flows for web + admin (#34) (#37) 2026-04-22 17:43:57 +02:00
login_magic_link.html feat: complete system — web UI, all API endpoints, governance, admin, CLI commands 2026-03-27 16:52:22 +01:00
login_magic_link_sent.html feat: complete system — web UI, all API endpoints, governance, admin, CLI commands 2026-03-27 16:52:22 +01:00
marketplace.html fix(store): promote-on-approve looks up version_no by submission_id (live agnes-development bug) (#330) 2026-05-15 21:21:14 +02:00
marketplace_format_guide.html Curated marketplace enrichment via agnes-metadata.json + curator metadata (#234) 2026-05-09 17:01:37 +02:00
marketplace_guide.html feat(marketplace): rename CTA + expand submit-flow guides (#308) 2026-05-14 19:44:33 +02:00
marketplace_item_detail.html feat(marketplace): telemetry v46 + flea inner parity + listing polish (#329) 2026-05-15 20:58:03 +02:00
marketplace_plugin_detail.html feat(marketplace): telemetry v46 + flea inner parity + listing polish (#329) 2026-05-15 20:58:03 +02:00
me_activity.html fix(web): render <strong> in /me/activity hero subtitle instead of escaping it (#312) 2026-05-14 22:27:34 +02:00
news.html feat(home): state-aware /home + /setup-advanced + schema v26 (#228) 2026-05-08 18:28:47 +02:00
password_reset.html feat(auth): password reset & invite flows for web + admin (#34) (#37) 2026-04-22 17:43:57 +02:00
password_setup.html feat(auth): password reset & invite flows for web + admin (#34) (#37) 2026-04-22 17:43:57 +02:00
profile.html feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
setup.html feat(setup): configurable instance brand + connector setup overhaul (#268) 2026-05-12 17:10:08 +02:00
setup_advanced.html feat(home): Getting Started + Overview + Usage modes sections (release 0.54.7) (#291) 2026-05-13 21:44:11 +02:00
store_edit.html fix(store-upload): Next/Back/Finish buttons missing .btn base class (#310) 2026-05-14 19:49:13 +00:00
store_examples.html feat(store-guardrails): admin-configurable content thresholds (#281) 2026-05-13 09:20:55 +00:00
store_upload.html fix(store-upload): Next/Back/Finish buttons missing .btn base class (#310) 2026-05-14 19:49:13 +00:00