validate-package.py: duplicated pattern section in SKILL.md passes validation (dict key collapse defeats the numbering check)
I maintainer di solito rispondono entro 6 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read scripts/validate-package.py and inspect how it parses pattern headings from SKILL.md and README.md. Reproduce the duplicate heading case, then check that validation rejects duplicate numbers in both files before checking the numbering range. The issue names .github/workflows/validate.yml as the CI entry point; done means the validator reports the duplicate clearly and the existing CI check runs it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
scripts/validate-package.py collects the pattern headings from SKILL.md (and README.md) into a dict keyed by pattern number:
skill_patterns = dict((int(number), name) for number, name in re.findall(r"(?m)^### ([0-9]+)\. (.+)$", SKILL))
pattern_numbers = list(skill_patterns)
if pattern_count == 0 or pattern_numbers != list(range(1, pattern_count + 1)):
raise SystemExit(...)
Because the headings go into a dict keyed by number, a duplicated ### N. heading overwrites the first occurrence instead of registering as an extra pattern. The numbering check only ever sees the unique keys, so it cannot detect a duplicated (shadowed) pattern section.
Reproduction
On a clean checkout of v4.0.0 (commit b48c832):
- Duplicate one pattern section in SKILL.md verbatim — e.g. copy the whole
### 7. Repeated sentence openingssection so SKILL.md contains 27 pattern headings with two §7 sections. - Run the validator:
$ grep -c '### 7\.' SKILL.md
2
$ python3 scripts/validate-package.py
Humanizer package v4.0.0 is valid
Exit code 0 — the package validates despite the duplicated pattern.
Expected
The validator should fail when a pattern number appears more than once in SKILL.md (and likewise for README.md, which is parsed the same way).
Actual
Validation passes. A merge that duplicates or shadows a pattern section would ship green through CI (.github/workflows/validate.yml runs exactly this script).
Related symptom of the same root cause: if the duplicated heading's name differs from the original, the validator does fail, but with a misleading message blaming the README ("Match the README pattern names to SKILL.md: 7: … should be …") rather than reporting the duplicate heading in SKILL.md.
Suggested direction
Collect the matches as a list and check for duplicate numbers explicitly (or compare the number of regex matches against the dict size) before the range check, for both SKILL.md and README.md.
Environment
- Repo at commit b48c832 (v4.0.0)
- Validator run locally with Python 3
- Lingua principale
- Python
- Stelle
- 53.9k
- Fork
- 4.3k
- Merge medio
- 6g 11h
- PR unite (30g)
- 9
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 blader/humanizer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di blader/humanizer
Issue simili
-
automated endpoint-dead needs-curation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
almanac-data/climate-almanac#138 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OceanDataTools/openrvdas#760 ·
I maintainer di solito rispondono entro 1 giorno
-
level/subtask type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
wazuh/wazuh-virtual-machines#1091 ·
I maintainer di solito rispondono entro 1 giorno
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentForse già presa @halcyon-past l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/semantic-kernel#14824 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stack314/django-neolith#142 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno