Skip to content

Entrega Final – Producto completo (PeredaHR) – FSF#249

Open
franpereda wants to merge 5 commits into
LIDR-academy:mainfrom
franpereda:finalproject-FSF
Open

Entrega Final – Producto completo (PeredaHR) – FSF#249
franpereda wants to merge 5 commits into
LIDR-academy:mainfrom
franpereda:finalproject-FSF

Conversation

@franpereda

@franpereda franpereda commented Jul 12, 2026

Copy link
Copy Markdown

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.md y el prompts.md de esta rama resumen el proyecto y enlazan al repositorio privado donde vive todo el código, la documentación y la evidencia: franpereda/PeredaHR — rama finalproject-FSF, tag v1.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

  • Bloque de IA completo, verificado contra las APIs reales (Anthropic Claude + Voyage AI):
    • Asistente RAG del convenio colectivo con citas obligatorias de artículo y página del BOCM (PER-21 indexación + PER-13).
    • Reporting conversacional Text-to-SQL (solo Admin/RRHH): whitelist de esquema sin PII, guardrails deterministas, ejecución READ ONLY, SQL generado inspeccionable (PER-14).
  • Suite E2E con Playwright (PER-24) cubriendo el flujo primario (fichaje → solicitud → aprobación → registro RD-Ley 8/2019 + CSV) contra web+API+Postgres reales, como job propio en CI.
  • Rediseño UI de marca corporativa (#014D88, PER-25): sidebar de escritorio, home hub móvil, login corporativo — cero cambios funcionales (la suite E2E pasó sin tocar los specs).

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

  • Documentation
    • Replaced placeholder and Spanish templates with complete English documentation for the PeredaHR project.
    • Added product overview, architecture, security, data model, API, user stories, tickets, and pull request guidance.
    • Documented installation, development, demo access, testing, deployment, and AI features including citations and privacy safeguards.
    • Added delivery notes, release details, evaluation references, prompt logs, and decision-log links.

FSF and others added 5 commits May 31, 2026 12:58
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>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Final delivery documentation

Layer / File(s) Summary
Prompt specifications
prompts.md
Adds detailed prompts covering product documentation, architecture, data modeling, API contracts, security, testing, and user stories.
Prompt delivery workflow
prompts.md
Defines ticket generation, Linear workflows, UI redesign delegation, pull-request requirements, evidence capture, and release tagging.
README product and architecture
readme.md
Documents the PeredaHR product, setup, architecture, deployment, security, testing, and data model.
README delivery artifacts
readme.md
Adds API examples, user stories, work tickets, representative pull requests, and final branch details.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the final delivery of the PeredaHR project and matches the documentation-focused changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 95e50419-e3bb-4670-92ba-f7c010b745ff

📥 Commits

Reviewing files that changed from the base of the PR and between bcde5c4 and 698e4b1.

📒 Files selected for processing (2)
  • prompts.md
  • readme.md

Comment thread prompts.md
Comment on lines +1 to +2
> 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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.

Comment thread prompts.md
Comment on lines +1 to 3
> 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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.

Suggested change
> 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

Comment thread prompts.md
Comment on lines 38 to +47
**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."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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.

Comment thread prompts.md
Comment on lines +65 to +68
### **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."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 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.

Comment thread readme.md
### **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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ 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.

Comment thread readme.md
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.
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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

Comment thread readme.md
Comment on lines +242 to +261
/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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 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.

Comment thread readme.md
Comment on lines +302 to +305
**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. ✅

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ 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.

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.

1 participant