education tests: derive the open-ended entry-level sweep from OPEN_ENDED_ALT instead of restating four of its six forms
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing-qa
Direzione di ricerca
Inizia in src/lib/heuristics/extract/education.test.ts, nello sweep a livello di entry all’interno di describe("isInlineDatedProgram: a date word must be a whole word (#925)"), e ispeziona lo sweep del predicato adiacente di #952. Leggi OPEN_ENDED_ALT in src/lib/heuristics/regex.ts, poi fai in modo che entrambi gli sweep derivino da quella costante o che proteggano esplicitamente dal drift rispetto a essa. Esegui npm run verify; il lavoro è completato quando tutte e sei le forme superficiali attuali sono coperte e il commento aggiornato non descrive più quattro parole.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What
src/lib/heuristics/extract/education.test.ts pins the extractEducation-level behaviour of an open-ended date range with a hand-written list of four words:
it.each(["Presently", "Currently", "Ongoing", "Now"])(
"does not let a season-led open-ended range ending in %s reach an education entry",
...
The production strip it guards is not a four-word list. inlineDatedProgramText composes the shared constant:
// src/lib/heuristics/extract/education.ts
String.raw`\b(?:${SEASON}s?|(?:${OPEN_ENDED_ALT})(?:ly)?|${STRICT_MONTH})\b`
and OPEN_ENDED_ALT (src/lib/heuristics/regex.ts:151) is "Present|Current|Now|Ongoing", so with the (?:ly)? inflection the strip recognises six surface forms: Present, Presently, Current, Currently, Now, Ongoing.
Two consequences:
- Bare
Presentand bareCurrentare unpinned at the entry level. They are covered at the predicate level by the#952describe, but the whole premise of #987 item 1 is that a predicate pin is not enough — the damage shows up one level higher, as afieldon the next school. That argument applies toPresentandCurrentexactly as it applies toNowandOngoing. - The list is a drifted copy waiting to happen. Adding a fifth word to
OPEN_ENDED_ALTupdates the production strip and silently leaves both the entry-level sweep and the#952predicate sweep behind. This repo has already paid for that shape twice: #931 (a 19th hardcoded copy of the open-ended vocabulary inparseDateRange) and #952 (this very strip spellingpresentas a literal and omitting the rest ofOPEN_ENDED_ALT).
Evidence it is a gap and not a deliberate exclusion
Extending the sweep to all six forms is green today — on gh-04-987-education-entry-pins, changing the list to
it.each(["Presently", "Currently", "Ongoing", "Now", "Present", "Current"])(
runs 136 passed (136) (was 134 passed (134)). So the two missing words are not omitted because they fail; they are omitted because the list was written out by hand.
The in-code comment above the sweep says Present, Presently and Current "came out clean" before #985, which is true and is a good reason not to claim them as regression pins. It is not a reason to leave them unpinned going forward — a future edit to the strip can break them, and nothing at the entry level would notice.
Where
src/lib/heuristics/extract/education.test.ts— theit.each([...])entry-level sweep insidedescribe("isInlineDatedProgram: a date word must be a whole word (#925)")(no line number: #989 is unmerged and the squash will move it).- Same file — the
#952predicatedescribehand-writes the vocabulary a second time, in its"Fall 2013 - Current"/"- Ongoing"/"- Now"rows. src/lib/heuristics/regex.ts:151—OPEN_ENDED_ALT, the constant both copies should derive from.
Proposed fix
Derive the sweep from the shared constant rather than restating it, e.g.
import { OPEN_ENDED_ALT } from "../regex.ts";
/** Every surface form the strip's `(?:${OPEN_ENDED_ALT})(?:ly)?` recognises.
* Derived, not restated, so a new open-ended word cannot ship unpinned. */
const OPEN_ENDED_FORMS = OPEN_ENDED_ALT.split("|").flatMap((w) =>
w === "Present" || w === "Current" ? [w, `${w}ly`] : [w],
);
and iterate that. If the ly branch reads as too clever, an explicit six-element list plus a one-line assertion that OPEN_ENDED_ALT.split("|") has the expected members is enough to make drift fail loudly.
Update the adjacent comment at the same time — it currently explains a four-word choice.
Acceptance criteria
- The
extractEducation-level open-ended sweep covers every word inOPEN_ENDED_ALT, including the barePresentandCurrentforms - Adding a word to
OPEN_ENDED_ALTwithout touchingeducation.test.tseither extends the sweep automatically or fails a test — it does not silently pass - The
#952predicate sweep in the same file is covered by the same rule, or an explicit comment says why it stays literal - The comment above the sweep no longer describes a four-word list
-
npm run verifygreen
Provenance
Found while reviewing #989 (which closes #987). Not blocking there: #987's acceptance criterion names those exact four words, so #989 implements its spec correctly. This is the spec being narrower than the invariant.
- Lingua principale
- TypeScript
- Stelle
- 11
- Fork
- 4
- Merge medio
- 18h 56m
- PR unite (30g)
- 92
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di offlinecv/OfflineCV
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
bug gaal ready-for-agent
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
bug gaal refactor
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
[epic] Fix It guidance: advice that is right for the résumé in front of the userForse già presa @Samhit21 l’ha presa 1 giorno fa. Apertaimprovement ready-for-agent ux:score-clarity
offlinecv/OfflineCV#1086 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di offlinecv/OfflineCV
Issue simili
-
priority: P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
prime-radiant-inc/evener#3291 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility bug revealjs
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto-cli#14961 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
supabase/agent-skills#614 ·
-
Content
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
RunestoneInteractive/rs#1559 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni