[PR #388] [MERGED] Add provenance fields to daily workflows and surface provenance in API/UI #692

Closed
opened 2026-03-13 21:04:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/388
Author: @AJaySi
Created: 3/6/2026
Status: Merged
Merged: 3/8/2026
Merged by: @AJaySi

Base: mainHead: codex/improve-provenance-modeling-across-workflows


📝 Commits (1)

  • 81b2989 Improve daily workflow provenance modeling and UI labels

📊 Changes

6 files changed (+87 additions, -4 deletions)

View changed files

📝 backend/api/today_workflow.py (+22 -0)
📝 backend/models/daily_workflow_models.py (+3 -0)
📝 backend/services/today_workflow_service.py (+29 -4)
📝 frontend/src/components/MainDashboard/components/WorkflowProgressBar.tsx (+19 -0)
📝 frontend/src/stores/workflowStore.ts (+4 -0)
📝 frontend/src/types/workflow.ts (+10 -0)

📄 Description

Motivation

  • Make plan-level provenance first-class so generation origin and fallback behavior can be audited and surfaced in the UI.
  • Ensure task-level metadata.source is strict and normalized so downstream systems can reliably interpret provenance.

Description

  • Added explicit columns to the plan model: generation_mode, committee_agent_count, and fallback_used in backend/models/daily_workflow_models.py and persisted those values when creating a plan.
  • Introduced a strict source enum (agent_committee, llm_generation, llm_pillar_backfill, controlled_fallback) and _normalize_task_metadata to enforce metadata.source in backend/services/today_workflow_service.py, plus stamped committee tasks with source = "agent_committee" and included a provenance block in generated plan payloads.
  • Added a provenance summary builder _build_provenance_summary and included plan-level provenance fields and provenanceSummary in the /api/today-workflow response in backend/api/today_workflow.py.
  • Extended frontend types in frontend/src/types/workflow.ts, populated provenanceSummary in the store (frontend/src/stores/workflowStore.ts), and rendered a calibrated provenance label in the workflow progress UI (frontend/src/components/MainDashboard/components/WorkflowProgressBar.tsx) with labels like "Personalized by Agents", "AI Personalized Guide", and "Baseline Daily Guide".

Testing

  • Compiled Python modules with python -m py_compile backend/models/daily_workflow_models.py backend/services/today_workflow_service.py backend/api/today_workflow.py, which succeeded.
  • Attempted npm --prefix frontend run build, which failed in this environment due to react-scripts not being available.
  • Attempted a Playwright page check against http://127.0.0.1:3000, which failed because the frontend server was not running (network/server availability, not code correctness).

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/388 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/6/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/improve-provenance-modeling-across-workflows` --- ### 📝 Commits (1) - [`81b2989`](https://github.com/AJaySi/ALwrity/commit/81b29895b930ec80ad94b428d39812ca32fe7881) Improve daily workflow provenance modeling and UI labels ### 📊 Changes **6 files changed** (+87 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/api/today_workflow.py` (+22 -0) 📝 `backend/models/daily_workflow_models.py` (+3 -0) 📝 `backend/services/today_workflow_service.py` (+29 -4) 📝 `frontend/src/components/MainDashboard/components/WorkflowProgressBar.tsx` (+19 -0) 📝 `frontend/src/stores/workflowStore.ts` (+4 -0) 📝 `frontend/src/types/workflow.ts` (+10 -0) </details> ### 📄 Description ### Motivation - Make plan-level provenance first-class so generation origin and fallback behavior can be audited and surfaced in the UI. - Ensure task-level `metadata.source` is strict and normalized so downstream systems can reliably interpret provenance. ### Description - Added explicit columns to the plan model: `generation_mode`, `committee_agent_count`, and `fallback_used` in `backend/models/daily_workflow_models.py` and persisted those values when creating a plan. - Introduced a strict source enum (`agent_committee`, `llm_generation`, `llm_pillar_backfill`, `controlled_fallback`) and `_normalize_task_metadata` to enforce `metadata.source` in `backend/services/today_workflow_service.py`, plus stamped committee tasks with `source = "agent_committee"` and included a `provenance` block in generated plan payloads. - Added a provenance summary builder `_build_provenance_summary` and included plan-level provenance fields and `provenanceSummary` in the `/api/today-workflow` response in `backend/api/today_workflow.py`. - Extended frontend types in `frontend/src/types/workflow.ts`, populated `provenanceSummary` in the store (`frontend/src/stores/workflowStore.ts`), and rendered a calibrated provenance label in the workflow progress UI (`frontend/src/components/MainDashboard/components/WorkflowProgressBar.tsx`) with labels like "Personalized by Agents", "AI Personalized Guide", and "Baseline Daily Guide". ### Testing - Compiled Python modules with `python -m py_compile backend/models/daily_workflow_models.py backend/services/today_workflow_service.py backend/api/today_workflow.py`, which succeeded. - Attempted `npm --prefix frontend run build`, which failed in this environment due to `react-scripts` not being available. - Attempted a Playwright page check against `http://127.0.0.1:3000`, which failed because the frontend server was not running (network/server availability, not code correctness). ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69aaf8e0e52483289c6d1e973993cb61) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:04:16 +03:00
Sign in to join this conversation.
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
starred/ALwrity#692
No description provided.