Entrega Final – Producto completo (PeredaHR) – FSF#249
Conversation
Cumplimenta la plantilla de entrega del curso con la documentación del proyecto PeredaHR, enlazando a los artefactos del repositorio privado. Incluye los accesos del equipo evaluador (TA y Mentor). Documentación anonimizada (sin nombre de empresa ni número de trabajadores). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Apunta al repositorio privado franpereda/PeredaHR (rama feature-entrega2-FSF, PR LIDR-academy#12) y rellena instalacion, infraestructura/despliegue on-premise, tests, capturas de evidencia, modelo de datos, API (OpenAPI), historias, tickets y PRs reales de la Entrega 2, manteniendo la estructura de la plantilla del curso. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Repunta enlaces al repo privado (rama feature-entrega2-FSF), sustituye los marcadores "Previsto para Entrega 2" por prompts reales (infra/despliegue on-premise, tests, API, tickets spec-driven y PRs) manteniendo la estructura de la plantilla. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Master directive: submission documentation must be in English. Translates the AI4Devs delivery readme.md and prompts.md, keeping the index anchors, section titles, links to the private PeredaHR repo, code blocks, proper nouns and legal references intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ducto completo) PeredaHR v1.0: bloque de IA (RAG del convenio con citas + Text-to-SQL con guardrails), suite E2E Playwright en CI, rediseño UI de marca y evidencia del sistema en marcha. Apunta al repo privado franpereda/PeredaHR, rama finalproject-FSF (tag v1.0-final-FSF). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR replaces Spanish placeholder documentation with English final-delivery documentation for PeredaHR. It adds concrete prompts, product and architecture details, API and data-model summaries, user stories, work tickets, pull requests, and delivery evidence guidance. ChangesFinal delivery documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@prompts.md`:
- Around line 1-2: Update the prompt-count requirement in the introductory
guidance of prompts.md to apply the maximum of three prompts per subsection,
matching the document structure and allowing Section 2’s existing subsection
prompts to remain compliant.
- Around line 65-68: Update the security prompt and its corresponding documented
whitelist exclusions to include biometrics alongside DNI, NSS, and geolocation.
Apply the same exclusion consistently in both referenced prompt sections,
preserving the existing Text-to-SQL PII contract.
- Around line 38-47: Update the earlier technology-stack statement in Prompt 2
to mark the OpenAI choice as provisional or superseded, rather than a closed
decision. Preserve Prompt 2 (Final) as the authoritative decision selecting
Anthropic Claude and Voyage AI, including the 1024-dimensional vectors and
citation/threshold behavior.
- Around line 1-3: Fix the MD028 violation in the blockquote in the prompts
section by removing the blank line or adding a blockquote marker (`>`), keeping
the entire quoted content within one valid blockquote.
In `@readme.md`:
- Line 150: Update the fenced directory listing in readme.md to specify an
appropriate language identifier, preferably text, immediately after the opening
fence so markdownlint MD040 passes.
- Line 30: Update the PeredaHR description to characterize direct BioStar and
SAGE database integration as planned architecture or future scope, not delivered
functionality. Preserve the existing integration context while making clear that
the ETL/production integration is not currently implemented.
- Around line 302-305: Update the Ticket 3 Database details in the README so the
HNSW index requirement is removed from the Presence schema acceptance/details
and documented under the RAG schema for the vector-bearing AgreementChunk
entity. Keep the ClockEntry and WorkDay migration requirements unchanged.
- Around line 242-261: Update the OpenAPI definitions for /api/leave-requests
and /api/ai/report-chat to declare authentication and required roles, including
ADMIN/HR for report access. Revise report responses to state that unauthorized
requests are rejected, PII or out-of-scope questions produce no generated or
executed SQL, and all rejections are audited; remove the conflicting “answered
with a warning” wording.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| > Detail in this section the main prompts used during the creation of the project, justifying the use of code assistants across all phases of the development life cycle. We expect a maximum of 3 per section, mainly the ones for initial creation or the ones for correcting or adding the functionalities you consider most relevant. | ||
| You may additionally add the full conversation as a link or attached file if you consider it appropriate. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Align the prompt-count rule with the document structure.
The introduction requires a maximum of three prompts “per section,” but Section 2 contains more than three prompts across its subsections. Clarify that the limit applies per subsection, or reduce the prompts so the final document is internally compliant.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prompts.md` around lines 1 - 2, Update the prompt-count requirement in the
introductory guidance of prompts.md to apply the maximum of three prompts per
subsection, matching the document structure and allowing Section 2’s existing
subsection prompts to remain compliant.
| > Detail in this section the main prompts used during the creation of the project, justifying the use of code assistants across all phases of the development life cycle. We expect a maximum of 3 per section, mainly the ones for initial creation or the ones for correcting or adding the functionalities you consider most relevant. | ||
| You may additionally add the full conversation as a link or attached file if you consider it appropriate. | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the blank line inside the blockquote.
Markdownlint reports MD028 for the blank line at Line 3. Remove it or prefix it with > so the blockquote remains valid.
Proposed fix
> Detail in this section the main prompts used during the creation of the project. We expect a maximum of 3 per section, mainly the ones for initial creation or the ones for correcting or adding the functionalities you consider most relevant.
You may additionally add the full conversation as a link or attached file if you consider it appropriate.
-📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| > Detail in this section the main prompts used during the creation of the project, justifying the use of code assistants across all phases of the development life cycle. We expect a maximum of 3 per section, mainly the ones for initial creation or the ones for correcting or adding the functionalities you consider most relevant. | |
| You may additionally add the full conversation as a link or attached file if you consider it appropriate. | |
| > Detail in this section the main prompts used during the creation of the project, justifying the use of code assistants across all phases of the development life cycle. We expect a maximum of 3 per section, mainly the ones for initial creation or the ones for correcting or adding the functionalities you consider most relevant. | |
| You may additionally add the full conversation as a link or attached file if you consider it appropriate. |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 3-3: Blank line inside blockquote
(MD028, no-blanks-blockquote)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prompts.md` around lines 1 - 3, Fix the MD028 violation in the blockquote in
the prompts section by removing the blank line or adding a blockquote marker
(`>`), keeping the entire quoted content within one valid blockquote.
Source: Linters/SAST tools
| **Prompt 2:** | ||
| "Fix the technology stack: full-stack TypeScript (Next.js + NestJS + Prisma), PostgreSQL + pgvector and OpenAI (GPT-4o + text-embedding-3). Present it as a closed decision so as not to interrupt the later flow." | ||
|
|
||
| **Prompt 3:** | ||
|
|
||
| ### **2.2. Descripción de componentes principales:** | ||
| ### **2.2. Description of the main components:** | ||
|
|
||
| **Prompt 1:** | ||
| "Split the solution into containers: web (Next.js/PWA), API (NestJS with RBAC), synchronization worker (ETL) and AI service (RAG + Text-to-SQL with guardrails)." | ||
|
|
||
| **Prompt 2:** | ||
| **Prompt 2 (Final):** | ||
| "The project's AI stack switches provider: **Anthropic Claude** for generation and **Voyage AI** for embeddings (Anthropic's recommended partner); OpenAI is discarded. Migrate the vector column to 1024 dimensions. The RAG assistant must always cite the article and BOCM page it relies on, and answer 'not on record' below the similarity threshold instead of calling the model." |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Mark the OpenAI stack as superseded, not closed.
Line 39 calls the OpenAI stack a closed decision, but Line 47 later discards it for Anthropic Claude and Voyage. This contradiction can cause agents to implement the wrong provider stack; label the earlier choice as provisional or explicitly mark Prompt 2 as superseded by the final decision. readme.md:143 confirms Claude/Voyage as the final stack.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prompts.md` around lines 38 - 47, Update the earlier technology-stack
statement in Prompt 2 to mark the OpenAI choice as provisional or superseded,
rather than a closed decision. Preserve Prompt 2 (Final) as the authoritative
decision selecting Anthropic Claude and Voyage AI, including the
1024-dimensional vectors and citation/threshold behavior.
| ### **2.5. Security** | ||
|
|
||
| **Prompt 1:** | ||
|
|
||
| **Prompt 2:** | ||
|
|
||
| **Prompt 3:** | ||
| "Apply security by design: OAuth2/OIDC, RBAC with 3 roles, encryption in transit and at rest, and exclusion of sensitive PII (DNI, NSS, geolocation) from Text-to-SQL via a whitelist; the RAG must answer 'not on record' if there is no evidence." |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Include biometrics in the Text-to-SQL exclusion contract.
The security and data-model prompts exclude DNI, NSS, and geolocation but omit biometrics. This conflicts with readme.md:176, which requires biometrics to be excluded from the PII-free Text-to-SQL schema. Add biometrics consistently to both prompts and the documented whitelist exclusions.
Also applies to: 85-86
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prompts.md` around lines 65 - 68, Update the security prompt and its
corresponding documented whitelist exclusions to include biometrics alongside
DNI, NSS, and geolocation. Apply the same exclusion consistently in both
referenced prompt sections, preserving the existing Text-to-SQL PII contract.
| ### **0.3. Brief project description:** | ||
|
|
||
| > Puedes tenerlo alojado en público o en privado, en cuyo caso deberás compartir los accesos de manera segura. Puedes enviarlos a [alvaro@lidr.co](mailto:alvaro@lidr.co) usando algún servicio como [onetimesecret](https://onetimesecret.com/). También puedes compartir por correo un archivo zip con el contenido | ||
| PeredaHR is an internal time, presence and HR operations management platform. It replaces the current time-tracking SaaS, removing the licensing cost, integrates via **direct access to the SQL databases** of the clocking terminals (BioStar) and the ERP (SAGE), and incorporates **generative AI verticalized to the real domain**: a RAG assistant over the collective agreement with citations and conversational reporting (Text-to-SQL) with privacy guardrails. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Qualify BioStar/SAGE integration as planned, not delivered.
Line 30 says the platform integrates directly with BioStar and SAGE, but Line 135 states that the ETL worker is descoped because production credentials were unavailable. Describe this as planned architecture/future scope to avoid overstating the final product.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` at line 30, Update the PeredaHR description to characterize direct
BioStar and SAGE database integration as planned architecture or future scope,
not delivered functionality. Preserve the existing integration context while
making clear that the ETL/production integration is not currently implemented.
| Monorepo with modular organization by domain: | ||
|
|
||
| > Representa la estructura del proyecto y explica brevemente el propósito de las carpetas principales, así como si obedece a algún patrón o arquitectura específica. | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Specify a language for the fenced directory listing.
Use ```text (or another appropriate language) for the code fence so markdownlint MD040 passes.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 150-150: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` at line 150, Update the fenced directory listing in readme.md to
specify an appropriate language identifier, preferably text, immediately after
the opening fence so markdownlint MD040 passes.
Source: Linters/SAST tools
| /api/leave-requests: | ||
| post: | ||
| summary: Create a leave request (self-service) | ||
| responses: | ||
| "201": { description: Request created (PENDING, balance reserved) } | ||
| "409": { description: Overlap with another request } | ||
| /api/ai/report-chat: | ||
| post: | ||
| summary: Conversational Text-to-SQL reporting (Admin/HR role) | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| required: [question] | ||
| properties: | ||
| question: { type: string, example: "¿Cuántas jornadas hay por estado en 2026?" } | ||
| responses: | ||
| "200": { description: "Result table + generated SQL (inspectable); PII requests answered with a warning" } | ||
| "422": { description: Out-of-scope question or query rejected by the SQL guardrails } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Make authentication and PII rejection explicit in the API contract.
The leave and report endpoints omit security and role declarations, while the report response says PII requests receive a warning. This conflicts with the documented ADMIN-only, deny-by-default, PII-free Text-to-SQL contract. State that unauthorized requests are rejected, no SQL is generated/executed for PII or out-of-scope questions, and rejections are audited.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 242 - 261, Update the OpenAPI definitions for
/api/leave-requests and /api/ai/report-chat to declare authentication and
required roles, including ADMIN/HR for report access. Revise report responses to
state that unauthorized requests are rejected, PII or out-of-scope questions
produce no generated or executed SQL, and all rejections are audited; remove the
conflicting “answered with a warning” wording.
| **Ticket 3 · Database** — PER-16 · Presence schema | ||
| - **Objective:** model and migrate `ClockEntry` and `WorkDay` with Prisma over PostgreSQL. | ||
| - **Detail:** types, FKs and status enums (`PENDING/CONFIRMED/INCIDENT/VALIDATED`); auditing (`confirmed_by/at`, `validated_by/at`); `@@unique([employee_id, day])`; HNSW index for the RAG. | ||
| - **Acceptance:** reproducible migration (`migrate deploy`) + seeds; confirmation as a competence of Admin/HR. **DoD:** migration applied in a clean environment. ✅ |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Move the HNSW index requirement to the RAG schema.
This ticket is for ClockEntry and WorkDay, but the HNSW index belongs to the vector-bearing AgreementChunk entity. Keeping it here can cause the migration work to target the wrong tables.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 302 - 305, Update the Ticket 3 Database details in
the README so the HNSW index requirement is removed from the Presence schema
acceptance/details and documented under the RAG schema for the vector-bearing
AgreementChunk entity. Keep the ClockEntry and WorkDay migration requirements
unchanged.
Entrega Final — PeredaHR (producto completo)
Proyecto: PeredaHR — plataforma interna de control horario, presencia y RRHH con IA verticalizada al dominio.
Alumno: Fran Sales Folch (FSF)
El
readme.mdy elprompts.mdde esta rama resumen el proyecto y enlazan al repositorio privado donde vive todo el código, la documentación y la evidencia: franpereda/PeredaHR — ramafinalproject-FSF, tagv1.0-final-FSF(acceso ya concedido al equipo evaluador: @vick-lidr, @SoyJorgePilo).Qué añade la Entrega Final sobre el MVP de la Entrega 2
READ ONLY, SQL generado inspeccionable (PER-14).Evidencia de despliegue
Sin URL pública por diseño (RGPD + LOPDGDD: los datos de presencia deben quedarse en infraestructura de la empresa; despliegue on-premise). La entrega es por evidencias: docs/evidencia-final.md — 18 capturas del sistema final en marcha (desktop y móvil, IA respondiendo de verdad) — más arranque local en un comando y CI verde (typecheck, lint, 263 tests, build y E2E).
🤖 Generated with Claude Code
Summary by CodeRabbit