`wrap` layer expansion can loop forever when the core content contains `{CORE_TEMPLATE}`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 84/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- bash
- Domínio
- tooling
Direção de pesquisa
Comece em scripts/bash/common.sh:606 e inspecione o loop de expansão de placeholders da estratégia wrap. Execute uma camada wrap cujo conteúdo central contenha o literal {CORE_TEMPLATE} e confirme que a expansão termina ao substituir o placeholder de cada camada e preservar o conteúdo ao redor.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Affected: scripts/bash/common.sh:606, confirmed present at tag v0.11.9
(fetched from raw.githubusercontent.com/github/spec-kit/v0.11.9/scripts/bash/common.sh).
The wrap strategy substitutes the core content into the layer at each {CORE_TEMPLATE}
placeholder:
case "$layer_content" in
*'{CORE_TEMPLATE}'*) ;;
*) echo "Error: wrap strategy missing {CORE_TEMPLATE} placeholder" >&2; return 1 ;;
esac
while [[ "$layer_content" == *'{CORE_TEMPLATE}'* ]]; do
local before="${layer_content%%\{CORE_TEMPLATE\}*}"
local after="${layer_content#*\{CORE_TEMPLATE\}}"
layer_content="${before}${content}${after}"
done
The loop condition re-tests the string it just substituted into. If $content itself
contains the literal {CORE_TEMPLATE}, every iteration reintroduces the placeholder, the
condition never goes false, and layer_content grows by ${#content} each pass — an
unbounded loop that ends in memory exhaustion rather than an error message.
The guard above it does not cover this: it rejects a layer that is missing the
placeholder, and says nothing about the content being substituted in.
Suggested fix — scan left to right and never re-scan what was already substituted, which
also preserves the multi-placeholder behaviour the loop exists for:
out=""; rest="$layer_content"
while [[ "$rest" == *'{CORE_TEMPLATE}'* ]]; do
out="${out}${rest%%\{CORE_TEMPLATE\}*}${content}"
rest="${rest#*\{CORE_TEMPLATE\}}"
done
layer_content="${out}${rest}"
Reachability / why we are reporting rather than patching. Found while adopting a
Spec Kit-based plugin in a downstream repo. It is not reachable through that plugin: it
ships nothing that declares {CORE_TEMPLATE}, so $content never carries the placeholder
on that path (grep -rl CORE_TEMPLATE over the plugin returns nothing). It is reachable for
any consumer that authors a wrap template layer whose core content includes the literal
token — which is a normal thing to do by accident when a template documents its own
placeholder syntax.
- Linguagem predominante
- Python
- Estrelas
- 140k
- Forks
- 12.6k
- Merge médio
- 2d 14h
- PRs com merge (30d)
- 204
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/spec-kit
-
feature-assess feature-go triage-can-wait
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
github/spec-kit#4804 · 6 comentários ·
Mantenedores costumam responder em até 1 dia
-
needs-triage triage-nice-to-have
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/spec-kit#4527 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: specify init writes speckit.manifest.json without the speckit-converge skill it just installedTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertabug-assess severity-medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/spec-kit#4273 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: /speckit-implement counts checkbox markers inside fenced code blocks — example checkboxes can falsely block implementationTalvez já em andamento @ntdatt812 assumiu há 29 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
[Extension]: Jira Integration (Sync Engine) v0.5.0 (version update of jira-sync)Talvez já em andamento @github-actions assumiu há 54 dias. Abertaextension-submission validation-passed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/spec-kit#4099 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/spec-kit
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
EvaluationSuite.run fails with default args_for_task and mutates supplied kwargsTalvez já em andamento @ktz03 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/evaluate#825 ·
Mantenedores costumam responder em até 1 dia
-
dependencies feature github_actions good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
wemake-services/wemake-django-template#3149 ·
Mantenedores costumam responder em até 1 dia
-
[request] vsg/1.1.16Abertaupstream update
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
conan-io/conan-center-index#31142 ·
Mantenedores costumam responder em até 1 dia
-
area:core bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia