Skip to content

[AIV-P2-006] Submit the scorecard, apply the score change and log it #120

In review

Description

@ALFRED-LUCIFER
Phase P2 · Recruiter path: interviews, decisions and pilot
Epic AIV-P2-E01 · Interviews and scorecards
Journey J3 Interviews and decisions
Type / priority Story · MUST
Roles Interviewer
Estimate 2 ideal dev-days
Screens Interview, Candidate
Depends on AIV-P2-005, AIV-P1-117 (#571, the apply command), AIV-P0-013

Description

Submit the scorecard: in one transaction @aivera/interviews marks the interview completed and stores the scorecard; @aivera/assessment applies the strength changes as a new assessment snapshot with a recorded reason; @aivera/audit writes one entry per change (interviewer name, time, competency, before/after strength, before/after backed score, note). The ranking and the candidate's "Interview history and score changes" update from the new snapshot.

Deliverables:

  • Command submitScorecard (server action) with idempotency key; refuses a second submit.
  • Score change records {competency, fromStrength, toStrength, fromScore, toScore, reason: note, actor, at} exposed to the candidate profile.
  • Confirmation state "Scorecard submitted and logged. Daniel's assessment has been updated." with "See the ranking".
  • Audit trail on the scorecard: "12 Nov · Evidence assessed by Aivera, reviewed by you. Backed score 55.", "15 Nov · Round 1 guide generated from 2 evidence gaps.", plus the new entry.
  • Recommendation stored on the scorecard only; it never changes a stage.

Acceptance criteria (Gherkin)

Feature: Submit the scorecard and apply the score change
  As an interviewer, I want my submitted ratings to update the assessment with my reason recorded,
  so that every score change can be traced to a person, a time and a note.

  Background:
    Given Daniel Novak's backed score is 55 and he ranks 4 of 64
    And I rated "Retrieval and evaluation" as "Clearly shown" with the note "Walked through the 200-question set he built"
    And I rated "Cost and reliability" as "Partly shown"

  Scenario: Submitting applies the change
    When I choose "Submit scorecard"
    Then I see "Scorecard submitted and logged. Daniel's assessment has been updated."
    And his backed score is 61
    And the job's ranking is recomputed from the new assessment snapshot

  Scenario: Every change is logged
    Then the audit trail has an entry with my name, the time, "Retrieval and evaluation: Supporting to Medium", "Backed score 55 to 61" and my note
    And no entry is written for "Cost and reliability" because nothing changed

  Scenario: The candidate profile shows the change
    When I open Daniel's evidence profile
    Then "Interview history and score changes" lists "Round 1, structured screen" with "Backed score 55 to 61"

  Scenario: Recommendation does not decide
    Given I chose "Do not recommend for Round 2"
    When I submit
    Then Daniel's stage is unchanged and he stays visible in the ranking
    And the recommendation is shown in the decision pack for the hiring owner

  Scenario: Double submit
    When the submit request is sent twice
    Then the change is applied once and the second request returns "Already submitted"

  Scenario: Failure leaves nothing half done
    Given the assessment write fails
    Then the interview is not completed, no audit entry exists, and I see "Not submitted. Your ratings are saved; try again."

  Scenario: Audit entries cannot be altered
    When anyone tries to update or delete the audit entry
    Then the database refuses it

Tests

  • Integration (Testcontainers PostgreSQL): one transaction across interview, assessment snapshot and audit; rollback on failure; idempotent submit.
  • // SAFETY: mutation check: skip the audit write and the "every change is logged" test fails; let the recommendation change the stage and the "does not decide" test fails.
  • Playwright J3 step: submit → See the ranking shows 61.

Not in this ticket

  • Live preview before submit: AIV-P2-005.
  • Recording decisions: AIV-P2-012.
  • Overdue reminders: AIV-P2-008.

Pilot trial scope (24 Nov 2026)

This ticket is on the pilot trial path (label pilot, priority MUST, epic AIV-P1-E11): one recruiter signs in, adds a job, imports CVs, gets a first shortlist, records interview results, and forwards the final list to the hiring owner. Step 6 of 8: Interviews and final list.

Applying a confirmed change and logging it is the same path the meeting-summary re-analysis uses: one re-assessment for both inputs. The ranking afterwards is the final list.

Activity

  1. ALFRED-LUCIFER commented on Nov 20, 2026

    @ALFRED-LUCIFER
    OwnerAuthor

    Follow-on from the amended AIV-P2-004 (#118) and the new AIV-P2-055 (#396) / AIV-P2-056 (#397), for whoever builds this ticket: the submit transaction should write the interview_note evidence payloads from toInterviewNoteEvidence(scorecard) (AIV-P2-004) through recordEvidence, linked to their competencies, including the live-task answer, time taken and prompt trail when present. A competency marked "Not assessed in this round" (every question "Not asked" or "Not answered") must produce no strength change: it stays a gap and is never scored down. The body of this ticket is not edited; fold this into its Gherkin when it is picked up.

  2. added
    journey: J3 Interviews and decisions
    pilot
    on Nov 22, 2026
  3. ALFRED-LUCIFER commented on Nov 26, 2026

    @ALFRED-LUCIFER
    OwnerAuthor

    Notes from PR #639 review (26 Nov 2026): (1) The backed score goes 55 → 67, not 61: backed score = Σ weight × proven level ÷ 5, and Clearly shown adds a Medium item at the needed level 3 on a 20% weight (20 × 3 ÷ 5 = 12). The formula wins over illustrative numbers (owner decision 20 Nov 2026, modules/assessment/README.md). (2) "Every change is logged": the merged apply command (AIV-P1-117) writes one score.changed entry per rating, moved or not, so a Partly shown rating is audited with no move rather than having no entry; the Background's "no entry because nothing changed" does not hold as written. (3) "The recommendation is shown in the decision pack" is delivered by #125 (stacked on #639). (4) The profile history and the Audit trail card are deferred to #110 (commented there).

  4. ALFRED-LUCIFER commented on Nov 26, 2026

    @ALFRED-LUCIFER
    OwnerAuthor

    Correction to point (2) of my 26 Nov review notes above. A first-time Partly shown rating writes no score.changed entry. modules/assessment/src/domain/scoreChange.ts drops it from the changes, and tests/integration/src/score-change.test.ts ("a rating that changes nothing stores and audits nothing") proves it. So the Background's "no entry is written for Cost and reliability because nothing changed" holds as written. PR #639 adds a test for that exact case.

  5. ALFRED-LUCIFER commented on Nov 26, 2026

    @ALFRED-LUCIFER
    OwnerAuthor

    PR #639 merged (83e6ccc) and deployed to dev (deploy run https://github.com/ALFRED-LUCIFER/aivera/actions/runs/45876000691; /api/ready 200). The interviewer submits the Round 1 scorecard: the previewed change is applied, logged and shown on the ranking. This stays partly done for the two scenarios deferred to #110 (profile score history, the Audit trail card). The recommendation in the decision pack is delivered by #125 (PR #640, in review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditjourney: J3 Interviews and decisionsphase: P2pilotpriority: MUSTscoringstatus: partly donetype: Story

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions