Skip to content

chore: nettoyer les dossiers morts, préserver ce qui n'existait que là - #266

Merged
thierryvm merged 4 commits into
mainfrom
chore/repo-cleanup
Jul 26, 2026
Merged

chore: nettoyer les dossiers morts, préserver ce qui n'existait que là#266
thierryvm merged 4 commits into
mainfrom
chore/repo-cleanup

Conversation

@thierryvm

Copy link
Copy Markdown
Owner

Nettoyage demandé avant la refonte. Rien de ce qui avait de la valeur n'a été jeté.

Supprimé — 9 entrées, toutes sans consommateur

Pourquoi
coverage/, .tmp/, .playwright-mcp/, build-output.log artefacts régénérables (13 Mo)
.agents/ doublonnait .claude/skills/, d'où les skills se chargent réellement
.codex/, AGENTS.md convention Codex, abandonné au profit de Claude Code
design-snapshots/ archivé (cf. plus bas)
design_handoff_ankora_v1/ archivé (cf. plus bas)

AGENTS.md était le seul suivi par git — donc récupérable. Les autres ne l'étaient pas : git ne peut rien restaurer, ce qui a dicté le traitement des deux cas suivants.

Migré plutôt que supprimé

cc-handoffs/ à la racine contenait 12 handoffs de mai 2026, aucun présent dans docs/handoffs/. C'est de l'historique projet : ils rejoignent docs/handoffs/ où ils sont versionnés, au lieu de rester à un rm de l'oubli.

Archivé avant suppression

design_handoff_ankora_v1/ (93 fichiers, 2,6 Mo : SVG de marque + ~20 composants prototypes) et design-snapshots/ ont été copiés dans Desktop/ankora-archive-2026-07-26 (94 fichiers) avant retrait.

La refonte visuelle repart d'une page blanche, donc ils sortent du repo — mais jeter l'unique copie des assets de marque la veille de ce travail aurait été négligent.

Vérifications

  • npm run typecheck vert : rien dans src/ ne référençait ces dossiers
  • build-output.log ajouté au .gitignore ; tout le reste y était déjà
  • Aucun fichier applicatif touché

Quatre PR mergées: les redirections serveur portent la langue (#261), le
registre unique des destinations de nav (#262), un seul contrôle de langue et un
seul écrivain (#263), et les canoniques cross-locale plus les URLs noindex au
sitemap (#264).

Le reste à faire est ordonné par priorité, avec le lot 2 de la refonte UX en
tête — les trois limites que le lot 1 s'est explicitement interdit de traiter y
sont reprises comme entrées, plutôt que laissées à re-découvrir: la répartition
barre/sheet à arbitrer, l'absence d'aria-current sur /app/commitments, et le
sheet qui grandit avec son contenu.

La reconnexion fantôme reste sans diagnostic. Ce n'est pas une perte de session
— Supabase le prouve — donc lancer prod-bug-investigator avant toute hypothèse
plutôt que de théoriser.

Les frictions d'environnement sont consignées parce qu'elles ont coûté du temps
deux fois chacune: playwright.config.ts ne charge pas .env.local, e2e:auth sert
un build prod où le rate limit échoue en fermé sur l'Upstash factice, la
variable est E2E_BASE_URL et le port 3000 appartient à un autre projet.

Miroir dans le vault Obsidian, slug vérifié via _index.md.
Nine folders and files at the root were untracked leftovers with no consumer:
coverage, .tmp, .playwright-mcp and build-output.log are regenerable artefacts;
.agents duplicated .claude/skills, which is where the skills actually load from;
.codex and AGENTS.md are the Codex convention, and Codex is no longer used.
AGENTS.md was the only tracked one, so it stays recoverable through git.

Two of them held things that existed nowhere else, and untracked means git
cannot bring them back — so neither was simply deleted.

cc-handoffs/ at the root held 12 handoffs from May 2026, none of them present in
docs/handoffs/. They are project history, so they move into docs/handoffs/ where
they are versioned rather than sitting one rm away from oblivion.

design_handoff_ankora_v1/ (93 files, 2.6 MB of Claude Design export: brand SVGs
and ~20 prototype components) and design-snapshots/ were copied to
Desktop/ankora-archive-2026-07-26 before removal. The visual redesign is about
to start from a clean sheet, so they leave the repo — but discarding the only
copy of the brand assets on the eve of that work would have been careless.

build-output.log joins .gitignore; every other artefact was already covered.

typecheck stays green: nothing in src/ referenced any of it.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @thierryvm, your pull request is larger than the review limit of 150000 diff characters

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ankora Ready Ready Preview, Comment Jul 26, 2026 11:29am

@github-actions github-actions Bot added status:review-needed Ready for review type:chore Maintenance (deps, CI, tooling) labels Jul 26, 2026
…n the keyring

@Thierry runs a professional project on the `ovb` account — GitHub ovb-willemot,
plus Vercel and Supabase — alongside this personal one. `gh auth status` lists
BOTH GitHub accounts as logged in, with only one active. A silent switch would
push personal code onto the professional infrastructure, or the reverse, and
nothing in the toolchain would object until a 403 hours later.

Adapted from the script the professional project already uses, with three
differences that matter here.

Ankora has no GitHub token in .env.local, so the check queries the `gh` CLI
instead. That is also where the real exposure is: the active CLI account, not a
service token. A second check reads `git config user.name` — a correct `gh`
paired with the other project's git identity produces commits attributed to the
wrong account without any push ever failing.

Supabase is verified twice, because the two failures are independent: the CLI
can be linked to the right project while .env.local points somewhere else, and
the app would then run against the wrong database.

Vercel identifiers are compared by truncated sha256 fingerprint rather than in
clear. Pinning an organisation id in a tracked file would leak it for no gain;
the fingerprint still fails when the link points at the other account. The
Supabase ref is pinned as-is since it already ships to the browser inside
NEXT_PUBLIC_SUPABASE_URL.

Nothing prints a secret value. Tokens are checked for presence only.

Verified it can say no, not just yes: pointing the expected values at the
professional project turns the GitHub, git identity, remote and Vercel checks
red and exits 1.
…p the token idea

.env.local is the development file, so http://localhost:3000 is the value that
belongs there — the production URL lives in Vercel's environment variables. The
check accepted both already, but printed the value bare, which read as a
mismatch. It now names the environment it detected.

Also settling the question of whether this project needs its own GitHub token:
it does not. `git config --get-regexp credential` shows git authenticates
through `gh auth git-credential`, so the account `git push` uses IS the active
gh account — exactly what the preflight already reads. A token in .env.local
would verify something git never consults, and add a secret to rotate for no
gain.

Demonstrated rather than assumed: switching the active account makes
`git credential fill` return username=ovb-willemot, then thierryvm again once
switched back. The failure mode is real, and this check sits on its actual path.
@thierryvm
thierryvm merged commit 669464d into main Jul 26, 2026
9 checks passed
@thierryvm
thierryvm deleted the chore/repo-cleanup branch July 26, 2026 11:40
thierryvm added a commit that referenced this pull request Jul 26, 2026
Both branches added scripts/preflight-accounts.mjs, so git saw an add/add
conflict. This branch's copy is the superset: it carries #266's fixes plus the
--local mode the pre-commit hook depends on, so it is the one kept.

Verified both entry points still work after the resolution: full run gives GO,
and `--local` gives GO while skipping the single network call.
thierryvm added a commit that referenced this pull request Jul 26, 2026
…machine (#267)

**PR dédiée**, conformément à la doctrine : `.husky/` est
l'infrastructure de garde-fous, elle ne se modifie pas dans une PR
feature.

## Le problème

Le script preflight existait (#266) mais **rien ne le lançait**. Ce
n'est pas un garde-fou, c'est une intention : il reposait sur le fait
que quelqu'un y pense — alors que la panne dont il protège est
précisément silencieuse.

## Ce que ça met en place

| Hook | Contenu | Coût |
|---|---|---|
| **pre-push** | preflight complet, compte GitHub inclus | 1 appel
réseau |
| **pre-commit** | nouveau mode `--local` : mêmes contrôles **sans
réseau** | quasi nul |

**Pourquoi séparer.** `git push` s'authentifie via `gh auth
git-credential` : il pousse sous le compte `gh` **actif**, et les deux
comptes cohabitent dans le keyring. Un push déclenche aussi un
déploiement, d'où la vérification de Supabase et Vercel à ce moment-là.

Le `pre-commit` attrape une identité git pointant vers le projet pro
**avant** que des commits mal attribués existent — s'en apercevoir au
push obligerait à réécrire l'historique.

## Démontré, pas supposé

- Basculer le compte fait renvoyer `username=ovb-willemot` à `git
credential fill` → la panne est réelle et le hook est sur son chemin
- En pointant le remote attendu vers le repo pro, **le commit a échoué
et aucun objet commit n'a été créé** → il bloque, il n'avertit pas
- Ce commit-ci a déclenché les deux hooks : GO

## Pas de faux positif hors ligne

`gh api user` et `git push` ont tous les deux besoin du réseau. Sans
réseau, le push échouait de toute façon.

## Le trou, énoncé plutôt que supposé couvert

Les hooks git **ne peuvent pas** couvrir `supabase db push`, `vercel
deploy`, ni une commande `gh` qui écrit — ce ne sont pas des opérations
git. `CLAUDE.md` les porte désormais comme étape manuelle explicite
(`npm run preflight` avant).

Échappatoire d'urgence : `git push --no-verify`, documentée dans le
hook.

## Summary by Sourcery

Automatisation des vérifications préliminaires de compte et
d’environnement pour Ankora afin d’éviter l’utilisation de mauvais
comptes GitHub, Supabase ou Vercel lors des opérations de développement
et de type production.

Améliorations :
- Ajout d’un script Node de prévol (preflight) pour vérifier l’identité
GitHub, le remote git, le lien et l’environnement Supabase, le lien du
projet Vercel, l’URL de l’application, ainsi que les secrets requis.
- Intégration du script de prévol dans les hooks Husky pre-commit
(vérifications locales sans réseau) et pre-push (vérifications complètes
incluant le compte GitHub actif).

Build :
- Exposition du script de prévol via une nouvelle commande `npm run
preflight`.

Documentation :
- Extension de `CLAUDE.md` avec une phase de vérification des comptes
(preflight) décrivant les hooks automatisés, les exigences de prévol
manuelles avant les opérations Supabase/Vercel/gh, et le flux de
récupération correct lorsque les vérifications échouent.

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automate account and environment preflight checks for Ankora to prevent
using the wrong GitHub, Supabase, or Vercel accounts during development
and production-like operations.

Enhancements:
- Add a preflight Node script to verify GitHub identity, git remote,
Supabase linkage and environment, Vercel project linkage, app URL, and
required secrets.
- Wire the preflight script into Husky pre-commit (local checks without
network) and pre-push hooks (full checks including active GitHub
account).

Build:
- Expose the preflight script via a new npm run preflight command.

Documentation:
- Extend CLAUDE.md with a preflight accounts phase describing automated
hooks, manual preflight requirements before Supabase/Vercel/gh
operations, and the correct recovery flow when checks fail.

</details>

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automatisation des vérifications préliminaires de compte et
d’environnement pour Ankora afin d’éviter l’utilisation de mauvais
comptes GitHub, Supabase ou Vercel lors des opérations de développement
et de type production.

Améliorations :
- Ajout d’un script Node de prévol (preflight) pour vérifier l’identité
GitHub, le remote git, le lien et l’environnement Supabase, le lien du
projet Vercel, l’URL de l’application, ainsi que les secrets requis.
- Intégration du script de prévol dans les hooks Husky pre-commit
(vérifications locales sans réseau) et pre-push (vérifications complètes
incluant le compte GitHub actif).

Build :
- Exposition du script de prévol via une nouvelle commande `npm run
preflight`.

Documentation :
- Extension de `CLAUDE.md` avec une phase de vérification des comptes
(preflight) décrivant les hooks automatisés, les exigences de prévol
manuelles avant les opérations Supabase/Vercel/gh, et le flux de
récupération correct lorsque les vérifications échouent.

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automate account and environment preflight checks for Ankora to prevent
using the wrong GitHub, Supabase, or Vercel accounts during development
and production-like operations.

Enhancements:
- Add a preflight Node script to verify GitHub identity, git remote,
Supabase linkage and environment, Vercel project linkage, app URL, and
required secrets.
- Wire the preflight script into Husky pre-commit (local checks without
network) and pre-push hooks (full checks including active GitHub
account).

Build:
- Expose the preflight script via a new npm run preflight command.

Documentation:
- Extend CLAUDE.md with a preflight accounts phase describing automated
hooks, manual preflight requirements before Supabase/Vercel/gh
operations, and the correct recovery flow when checks fail.

</details>

</details>

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automatisation des vérifications préliminaires de compte et
d’environnement pour Ankora afin d’éviter l’utilisation de mauvais
comptes GitHub, Supabase ou Vercel lors des opérations de développement
et de type production.

Améliorations :
- Ajout d’un script Node de prévol (preflight) pour vérifier l’identité
GitHub, le remote git, le lien et l’environnement Supabase, le lien du
projet Vercel, l’URL de l’application, ainsi que les secrets requis.
- Intégration du script de prévol dans les hooks Husky pre-commit
(vérifications locales sans réseau) et pre-push (vérifications complètes
incluant le compte GitHub actif).

Build :
- Exposition du script de prévol via une nouvelle commande `npm run
preflight`.

Documentation :
- Extension de `CLAUDE.md` avec une phase de vérification des comptes
(preflight) décrivant les hooks automatisés, les exigences de prévol
manuelles avant les opérations Supabase/Vercel/gh, et le flux de
récupération correct lorsque les vérifications échouent.

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automate account and environment preflight checks for Ankora to prevent
using the wrong GitHub, Supabase, or Vercel accounts during development
and production-like operations.

Enhancements:
- Add a preflight Node script to verify GitHub identity, git remote,
Supabase linkage and environment, Vercel project linkage, app URL, and
required secrets.
- Wire the preflight script into Husky pre-commit (local checks without
network) and pre-push hooks (full checks including active GitHub
account).

Build:
- Expose the preflight script via a new npm run preflight command.

Documentation:
- Extend CLAUDE.md with a preflight accounts phase describing automated
hooks, manual preflight requirements before Supabase/Vercel/gh
operations, and the correct recovery flow when checks fail.

</details>

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automatisation des vérifications préliminaires de compte et
d’environnement pour Ankora afin d’éviter l’utilisation de mauvais
comptes GitHub, Supabase ou Vercel lors des opérations de développement
et de type production.

Améliorations :
- Ajout d’un script Node de prévol (preflight) pour vérifier l’identité
GitHub, le remote git, le lien et l’environnement Supabase, le lien du
projet Vercel, l’URL de l’application, ainsi que les secrets requis.
- Intégration du script de prévol dans les hooks Husky pre-commit
(vérifications locales sans réseau) et pre-push (vérifications complètes
incluant le compte GitHub actif).

Build :
- Exposition du script de prévol via une nouvelle commande `npm run
preflight`.

Documentation :
- Extension de `CLAUDE.md` avec une phase de vérification des comptes
(preflight) décrivant les hooks automatisés, les exigences de prévol
manuelles avant les opérations Supabase/Vercel/gh, et le flux de
récupération correct lorsque les vérifications échouent.

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Automate account and environment preflight checks for Ankora to prevent
using the wrong GitHub, Supabase, or Vercel accounts during development
and production-like operations.

Enhancements:
- Add a preflight Node script to verify GitHub identity, git remote,
Supabase linkage and environment, Vercel project linkage, app URL, and
required secrets.
- Wire the preflight script into Husky pre-commit (local checks without
network) and pre-push hooks (full checks including active GitHub
account).

Build:
- Expose the preflight script via a new npm run preflight command.

Documentation:
- Extend CLAUDE.md with a preflight accounts phase describing automated
hooks, manual preflight requirements before Supabase/Vercel/gh
operations, and the correct recovery flow when checks fail.

</details>

</details>

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

Labels

status:review-needed Ready for review type:chore Maintenance (deps, CI, tooling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant