feat: add CI/CD, code quality, testing and security hardening
CI / quality (push) Failing after 6m22s
CI / quality (push) Failing after 6m22s
Implements Max_Code_Quality_CICD_Production.md: TypeScript strict mode, ESLint flat config with type-checking and security plugin, Prettier, Husky + lint-staged, Vitest with 80%+ coverage (473 tests), Playwright e2e, Electron security hardening (contextIsolation, CSP, IPC validation), electron-builder + electron-updater, Dockerfile, Gitea Actions CI/release workflows, and SonarQube docker-compose setup. Also fixes two real bugs found while writing tests: unawaited clipboard promises and a mermaid container ref timing issue in CoachDrawingView. Fixes lint-staged on Windows/Node 24 by invoking eslint/prettier via `node <bin>.js` instead of their .cmd shims, which Node's child_process now refuses to spawn without shell:true. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
1959ddb41a
commit
e9690a49f9
@@ -0,0 +1,45 @@
|
||||
import { upsertConceptStatus, hasAssessment, type ConceptStatus } from '../../coach/coachStore'
|
||||
import type { SkillDefinition } from '../types'
|
||||
import { asString } from '../argUtils'
|
||||
|
||||
const VALID_STATUSES: ConceptStatus[] = ['not_started', 'in_progress', 'acquired', 'to_review']
|
||||
const EVALUATED_STATUSES: ConceptStatus[] = ['acquired', 'to_review']
|
||||
|
||||
export const trackConceptMastery: SkillDefinition = {
|
||||
name: 'track_concept_mastery',
|
||||
description:
|
||||
"Enregistre l'etat de maitrise d'un concept pour un sujet d'apprentissage en cours (not_started, in_progress, acquired, to_review). not_started/in_progress sont de simples marqueurs de progression pendant l'enseignement. acquired/to_review sont des jugements d'evaluation : ils exigent qu'une question ait ete posee a l'ecrit via ask_written_exercise pour ce concept au prealable, sinon l'appel echoue.",
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
subject: {
|
||||
type: 'string',
|
||||
description: 'Sujet d’apprentissage en cours (ex: "trigonometrie")'
|
||||
},
|
||||
concept: { type: 'string', description: 'Nom du concept precis' },
|
||||
status: {
|
||||
type: 'string',
|
||||
enum: VALID_STATUSES,
|
||||
description: 'Etat de maitrise du concept'
|
||||
}
|
||||
},
|
||||
required: ['subject', 'concept', 'status']
|
||||
},
|
||||
execute: async (args) => {
|
||||
const subject = asString(args.subject).trim()
|
||||
const concept = asString(args.concept).trim()
|
||||
const status = asString(args.status) as ConceptStatus
|
||||
if (!subject) throw new Error('subject manquant')
|
||||
if (!concept) throw new Error('concept manquant')
|
||||
if (!VALID_STATUSES.includes(status)) throw new Error('status invalide')
|
||||
|
||||
if (EVALUATED_STATUSES.includes(status) && !hasAssessment(subject, concept)) {
|
||||
throw new Error(
|
||||
`Aucune evaluation ecrite enregistree pour "${concept}" (${subject}) : appelle ask_written_exercise avant de juger ce statut.`
|
||||
)
|
||||
}
|
||||
|
||||
upsertConceptStatus(subject, concept, status)
|
||||
return `Concept "${concept}" (${subject}) marque comme "${status}".`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user